diff --git a/app/views/dmsf/_multi_upload.html.erb b/app/views/dmsf/_multi_upload.html.erb index 79157aee..792e8416 100644 --- a/app/views/dmsf/_multi_upload.html.erb +++ b/app/views/dmsf/_multi_upload.html.erb @@ -22,7 +22,15 @@ :id => 'uploadform', :method=>:post, :multipart => true) do %> <% if Setting.attachment_max_size.to_i >= 102400 %>
- <%= l(:label_file_size) %>: + <%= l(:label_file_size) %>: +
<% end %>

<%= l(:heading_file_upload) %>

@@ -55,7 +63,7 @@ originalUploaderContent = uploader.html(); jQuery('#uploader_select').change(function() { - if(jQuery(this).val() === 2) { + if(jQuery(this).val() == 2) { uploader.html(originalUploaderContent); } else { initPlUploader(uploader); @@ -97,7 +105,7 @@ uploader.plupload({ runtimes : 'html5,flash,html4', url : '<%= url_for({:controller => 'dmsf_upload', :action => 'upload_file', :id => @project}) %>', - max_file_size : '100mb', + max_file_size : '<%= "#{Setting.plugin_redmine_dmsf['dmsf_max_ajax_upload_filesize']}mb" %>', max_file_count: '<%= Setting.plugin_redmine_dmsf['dmsf_max_file_upload'].to_i if Setting.plugin_redmine_dmsf['dmsf_max_file_upload'].to_i > 0 %>', multipart: true, multipart_params : {authenticity_token : jQuery('input[name=authenticity_token]').val()}, @@ -147,8 +155,8 @@ */ } } - if(pluploader.total.uploaded === pluploader.files.length) jQuery('#uploadform').submit(); - else if(pluploader.total.uploaded + pluploader.total.failed === pluploader.files.length) setTimeout(function() {jQuery('#uploadform').submit();}, 2000); + if(pluploader.total.uploaded == pluploader.files.length) jQuery('#uploadform').submit(); + else if(pluploader.total.uploaded + pluploader.total.failed == pluploader.files.length) setTimeout(function() {jQuery('#uploadform').submit();}, 2000); else dmsfFileFieldCount++; return true; }); diff --git a/app/views/dmsf_files/show.html.erb b/app/views/dmsf_files/show.html.erb index 08a15816..f809fb6d 100644 --- a/app/views/dmsf_files/show.html.erb +++ b/app/views/dmsf_files/show.html.erb @@ -170,7 +170,7 @@ }); jQuery('#file_upload').change(function() { - if(jQuery("input[name='version']:checked").val() === '0') { + if(jQuery("input[name='version']:checked").val() == '0') { jQuery('#fileMinorVersionRadio').prop('checked', true); } jQuery('#fileSameVersionRadio').prop('disabled', true); diff --git a/app/views/settings/_dmsf_settings.html.erb b/app/views/settings/_dmsf_settings.html.erb index ebbfc1d3..3b22f537 100644 --- a/app/views/settings/_dmsf_settings.html.erb +++ b/app/views/settings/_dmsf_settings.html.erb @@ -41,6 +41,14 @@ <%= l(:note_maximum_email_filesize) %>

+

+ <%= content_tag(:label, "#{l(:label_maximum_ajax_upload_filesize)}:") %> + <%= text_field_tag 'settings[dmsf_max_ajax_upload_filesize]', @settings['dmsf_max_ajax_upload_filesize'], :size => 10 %>
+ (<%= l(:label_default) %>: 100) +
+ <%= l(:note_maximum_ajax_upload_filesize) %> +

+

<%= content_tag(:label, "#{l(:label_file_storage_directory)}:") %> <% diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 25d5364b..ff2c9f5d 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -279,4 +279,7 @@ cs: my: blocks: locked_documents: Zamčené dokumenty - open_approvals: Procesy ke schválení \ No newline at end of file + open_approvals: Procesy ke schválení + + label_maximum_ajax_upload_filesize: Maximální velikost souboru nahratelná přes AJAX + note_maximum_ajax_upload_filesize: Omezuje velikost souboru, který může být nahrán přes standardní rozhraní AJAX, jinak se použije standarní rozhraní Redminu. Číslo je MB. \ No newline at end of file diff --git a/config/locales/de.yml b/config/locales/de.yml index 70989add..1a100e01 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -281,4 +281,7 @@ de: my: blocks: locked_documents: Locked documents - open_approvals: Open approvals \ No newline at end of file + open_approvals: Open approvals + + label_maximum_ajax_upload_filesize: Maximum file size uploadable via AJAX + note_maximum_ajax_upload_filesize: Limits maximum file size that can uploaded via standard AJAX interface otherwise Redmine standard upload form must be used. Number is in MB. \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index e3cca781..1bc99d72 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -283,3 +283,6 @@ en: blocks: locked_documents: Locked documents openap_provals: Open approvals + + label_maximum_ajax_upload_filesize: Maximum file size uploadable via AJAX + note_maximum_ajax_upload_filesize: Limits maximum file size that can uploaded via standard AJAX interface otherwise Redmine standard upload form must be used. Number is in MB. diff --git a/config/locales/es.yml b/config/locales/es.yml index 5b114044..751317ee 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -280,4 +280,8 @@ es: my: blocks: locked_documents: Locked documents - open_approvals: Open approvals \ No newline at end of file + open_approvals: Open approvals + + + label_maximum_ajax_upload_filesize: Maximum file size uploadable via AJAX + note_maximum_ajax_upload_filesize: Limits maximum file size that can uploaded via standard AJAX interface otherwise Redmine standard upload form must be used. Number is in MB. \ No newline at end of file diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 145120b8..efc6bb9c 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -280,4 +280,7 @@ fr: my: blocks: locked_documents: Locked documents - open_approvals: Open approvals \ No newline at end of file + open_approvals: Open approvals + + label_maximum_ajax_upload_filesize: Maximum file size uploadable via AJAX + note_maximum_ajax_upload_filesize: Limits maximum file size that can uploaded via standard AJAX interface otherwise Redmine standard upload form must be used. Number is in MB. \ No newline at end of file diff --git a/config/locales/ja.yml b/config/locales/ja.yml index d1b4e3a7..9388eaad 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -280,4 +280,7 @@ ja: my: blocks: locked_documents: Locked documents - open_approvals: Open approvals \ No newline at end of file + open_approvals: Open approvals + + label_maximum_ajax_upload_filesize: Maximum file size uploadable via AJAX + note_maximum_ajax_upload_filesize: Limits maximum file size that can uploaded via standard AJAX interface otherwise Redmine standard upload form must be used. Number is in MB. \ No newline at end of file diff --git a/config/locales/ru.yml b/config/locales/ru.yml index ea4ff936..beb9a84c 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -280,4 +280,7 @@ ru: my: blocks: locked_documents: Locked documents - open_approvals: Open approvals \ No newline at end of file + open_approvals: Open approvals + + label_maximum_ajax_upload_filesize: Maximum file size uploadable via AJAX + note_maximum_ajax_upload_filesize: Limits maximum file size that can uploaded via standard AJAX interface otherwise Redmine standard upload form must be used. Number is in MB. \ No newline at end of file diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 622de861..c5845b00 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -280,4 +280,7 @@ sl: my: blocks: locked_documents: Locked documents - open_approvals: Open approvals \ No newline at end of file + open_approvals: Open approvals + + label_maximum_ajax_upload_filesize: Maximum file size uploadable via AJAX + note_maximum_ajax_upload_filesize: Limits maximum file size that can uploaded via standard AJAX interface otherwise Redmine standard upload form must be used. Number is in MB. \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index c5d7f675..ef2d9fc7 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -281,4 +281,7 @@ zh: my: blocks: locked_documents: Locked documents - open_approvals: Open approvals \ No newline at end of file + open_approvals: Open approvals + + label_maximum_ajax_upload_filesize: Maximum file size uploadable via AJAX + note_maximum_ajax_upload_filesize: Limits maximum file size that can uploaded via standard AJAX interface otherwise Redmine standard upload form must be used. Number is in MB. \ No newline at end of file diff --git a/init.rb b/init.rb index c72aff3b..6fe61a45 100644 --- a/init.rb +++ b/init.rb @@ -33,16 +33,17 @@ Redmine::Plugin.register :redmine_dmsf do requires_redmine :version_or_higher => '2.3.0' settings :partial => 'settings/dmsf_settings', - :default => { - 'dmsf_max_file_upload' => '0', - 'dmsf_max_file_download' => '0', - 'dmsf_max_email_filesize' => '0', - 'dmsf_storage_directory' => Rails.root.join('files/dmsf').to_s, - 'dmsf_index_database' => Rails.root.join('files/dmsf_index').to_s, - 'dmsf_stemming_lang' => 'english', - 'dmsf_stemming_strategy' => 'STEM_NONE', - 'dmsf_webdav' => '1' - } + :default => { + 'dmsf_max_file_upload' => '0', + 'dmsf_max_file_download' => '0', + 'dmsf_max_email_filesize' => '0', + 'dmsf_max_ajax_upload_filesize' => '100', + 'dmsf_storage_directory' => Rails.root.join('files/dmsf').to_s, + 'dmsf_index_database' => Rails.root.join('files/dmsf_index').to_s, + 'dmsf_stemming_lang' => 'english', + 'dmsf_stemming_strategy' => 'STEM_NONE', + 'dmsf_webdav' => '1' + } menu :project_menu, :dmsf, { :controller => 'dmsf', :action => 'show' }, :caption => :menu_dmsf, :before => :documents, :param => :id