267 lines
9.4 KiB
Plaintext
267 lines
9.4 KiB
Plaintext
<%
|
|
# encoding: utf-8
|
|
#
|
|
# Redmine plugin for Document Management System "Features"
|
|
#
|
|
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
|
|
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
|
|
# Copyright (C) 2011-17 Karel Picman <karel.picman@kontron.com>
|
|
#
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of the GNU General Public License
|
|
# as published by the Free Software Foundation; either version 2
|
|
# of the License, or (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write to the Free Software
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
%>
|
|
|
|
<em class="info">
|
|
<%= l(:label_general) %>
|
|
</em>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_maximum_files_upload)) %>
|
|
<%= text_field_tag 'settings[dmsf_max_file_upload]', @settings['dmsf_max_file_upload'], :size => 10 %>
|
|
<em class="info">
|
|
<%= l(:note_maximum_number_of_files_uploaded) %> <%= l(:label_default) %>: 0
|
|
</em>
|
|
</p>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_maximum_files_download)) %>
|
|
<%= text_field_tag 'settings[dmsf_max_file_download]', @settings['dmsf_max_file_download'], :size => 10 %>
|
|
<em class="info">
|
|
<%= l(:note_maximum_number_of_files_downloaded) %> <%= l(:label_default) %>: 0
|
|
</em>
|
|
</p>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_maximum_email_filesize)) %>
|
|
<%= text_field_tag 'settings[dmsf_max_email_filesize]', @settings['dmsf_max_email_filesize'], :size => 10 %>
|
|
<em class="info">
|
|
<%= l(:note_maximum_email_filesize) %> <%= l(:label_default) %>: 0
|
|
</em>
|
|
</p>
|
|
|
|
<p>
|
|
<%= 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 %>
|
|
<em class="info">
|
|
<%= l(:note_maximum_ajax_upload_filesize) %> <%= l(:label_default) %>: 100
|
|
</em>
|
|
</p>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_file_storage_directory)) %>
|
|
<%
|
|
storage_dir = @settings['dmsf_storage_directory'].strip if @settings['dmsf_storage_directory'].present?
|
|
storage_dir = 'dmsf' if storage_dir.blank?
|
|
%>
|
|
<%= text_field_tag 'settings[dmsf_storage_directory]', storage_dir, :size => 50 %>
|
|
<em class="info">
|
|
<%= l(:label_default) %>: dmsf
|
|
</em>
|
|
</p>
|
|
<% unless File.exist?(DmsfFile.storage_path) %>
|
|
<% begin %>
|
|
<% Dir.mkdir(DmsfFile.storage_path) %>
|
|
<% rescue %>
|
|
<p class="warning"><%= l(:error_file_storage_directory_does_not_exist) %></p>
|
|
<% end %>
|
|
<% end %>
|
|
<% testfilename = DmsfFile.storage_path.join('test.test') %>
|
|
<% if File.exist?(storage_dir) %>
|
|
<% begin %>
|
|
<% File.open(testfilename, 'wb') do |file| %>
|
|
<% end %>
|
|
<% rescue %>
|
|
<p class="warning"><%= l(:error_file_can_not_be_created) %></p>
|
|
<% ensure %>
|
|
<% File.delete(testfilename) if File.exist?(testfilename) %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_physical_file_delete)) %>
|
|
<%= check_box_tag('settings[dmsf_really_delete_files]', true, @settings['dmsf_really_delete_files']) %>
|
|
<em class="info">
|
|
<%= l(:label_default)%>: <%= l(:general_text_No)%>
|
|
</em>
|
|
</p>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_default_notifications)) %>
|
|
<%= select_tag('settings[dmsf_default_notifications]',
|
|
options_for_select([
|
|
[l(:select_option_deactivated), nil],
|
|
[l(:select_option_activated), '1']],
|
|
:selected => @settings['dmsf_default_notifications'])) %>
|
|
<em class="info">
|
|
<%= l(:label_default) %>: <%= l(:select_option_deactivated) %>
|
|
</em>
|
|
</p>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_display_notified_recipients)) %>
|
|
<%= select_tag('settings[dmsf_display_notified_recipients]',
|
|
options_for_select([
|
|
[l(:select_option_deactivated), nil],
|
|
[l(:select_option_activated), '1']],
|
|
:selected => @settings['dmsf_display_notified_recipients'])) %>
|
|
<em class="info">
|
|
<%= l(:note_display_notified_recipients).html_safe %> <%= l(:label_default) %>: <%= l(:select_option_deactivated) %>
|
|
</em>
|
|
</p>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_title_format)) %>
|
|
<%= text_field_tag 'settings[dmsf_global_title_format]', @settings['dmsf_global_title_format'], :size => 10 %>
|
|
<em class="info">
|
|
<%= l(:text_title_format) %>
|
|
</em>
|
|
</p>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_act_as_attachable)) %>
|
|
<%= check_box_tag('settings[dmsf_act_as_attachable]', true, @settings['dmsf_act_as_attachable']) %>
|
|
<em class="info">
|
|
<%= l(:note_dmsf_act_as_attachable) %><br/>
|
|
<%= l(:label_default)%>: <%= l(:general_text_No)%>
|
|
</em>
|
|
</p>
|
|
|
|
<hr/>
|
|
<em class="info">
|
|
<%= l(:menu_dmsf) %> <%= l(:field_column_names) %>
|
|
</em>
|
|
|
|
<%= render(:partial => 'settings/dmsf_columns', :locals => { :settings => @settings }) %>
|
|
|
|
<hr/>
|
|
<em class="info">
|
|
<%= l(:field_label_dmsf_workflow) %>
|
|
</em>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_dmsf_keep_documents_locked)) %>
|
|
<%= check_box_tag('settings[dmsf_keep_documents_locked]', false, @settings['dmsf_keep_documents_locked']) %>
|
|
<em class="info">
|
|
<%= l(:note_dmsf_keep_documents_locked) %><br/>
|
|
<%= l(:label_default)%>: <%= l(:general_text_No)%>
|
|
</em>
|
|
</p>
|
|
|
|
<hr/>
|
|
<em class="info">
|
|
<%= l(:label_webdav) %>
|
|
</em>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_webdav)) %>
|
|
<%= select_tag('settings[dmsf_webdav]',
|
|
options_for_select([
|
|
[l(:select_option_deactivated), nil],
|
|
[l(:select_option_activated), '1']],
|
|
:selected => @settings['dmsf_webdav'])) %>
|
|
<em class="info">
|
|
<%= l(:note_webdav, :protocol => Setting.protocol, :domain => Setting.host_name).html_safe %> <%= l(:label_default) %>: <%= l(:select_option_activated) %>
|
|
</em>
|
|
</p>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_webdav_strategy)) %>
|
|
<%= select_tag('settings[dmsf_webdav_strategy]',
|
|
options_for_select([
|
|
[l(:select_option_webdav_readonly), 'WEBDAV_READ_ONLY'],
|
|
[l(:select_option_webdav_readwrite), 'WEBDAV_READ_WRITE']],
|
|
:selected => @settings['dmsf_webdav_strategy'])) %><br/>
|
|
<em class="info">
|
|
<%= l(:note_webdav_strategy).html_safe %> <%= l(:label_default) %>: <%= l(:select_option_webdav_readonly) %>
|
|
</em>
|
|
</p>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_memcached_servers)) %>
|
|
<%= text_field_tag 'settings[dmsf_memcached_servers]', @settings['dmsf_memcached_servers'], :size => 50 %>
|
|
<em class="info">
|
|
<%= l(:text_memcached_servers) %>
|
|
</em>
|
|
</p>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_webdav_ignore)) %>
|
|
<%= text_field_tag 'settings[dmsf_webdav_ignore]', @settings['dmsf_webdav_ignore'], :size => 50 %>
|
|
<em class="info">
|
|
<%= l(:note_webdav_ignore) %> <%= l(:label_default) %>: ^(\._|\.DS_Store$|Thumbs.db$)
|
|
</em>
|
|
</p>
|
|
<p>
|
|
<%= content_tag(:label, l(:label_webdav_disable_versioning)) %>
|
|
<%= text_field_tag 'settings[dmsf_webdav_disable_versioning]', @settings['dmsf_webdav_disable_versioning'], :size => 50 %>
|
|
<em class="info">
|
|
<%= l(:note_webdav_disable_versioning) %> <br/>
|
|
<%= l(:label_default) %>: ^\~\$|\.tmp$
|
|
</em>
|
|
</p>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_webdav_use_project_names)) %>
|
|
<%= check_box_tag('settings[dmsf_webdav_use_project_names]', true, @settings['dmsf_webdav_use_project_names']) %>
|
|
<em class="info">
|
|
<%= l(:note_webdav_use_project_names) %> <br/>
|
|
<%= l(:label_default)%>: <%= l(:general_text_No)%>
|
|
</em>
|
|
</p>
|
|
|
|
<hr/>
|
|
<em class="info">
|
|
<%= l(:label_full_text) %>
|
|
</em>
|
|
|
|
<% begin %>
|
|
<% require 'xapian' %>
|
|
<% xapian_disabled = false %>
|
|
<% rescue LoadError %>
|
|
<p class="warning"><%= l(:warning_xapian_not_available) %></p>
|
|
<% xapian_disabled = true %>
|
|
<% end %>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_index_database)) %>
|
|
<%= text_field_tag 'settings[dmsf_index_database]', @settings['dmsf_index_database'], :disabled => xapian_disabled, :size => 50 %>
|
|
<em class="info">
|
|
<%= l(:label_default) %>: <%= "#{Rails.root}/files/dmsf_index" %>
|
|
</em>
|
|
</p>
|
|
|
|
<% stem_langs = %w(danish dutch english finnish french german hungarian italian norwegian portuguese romanian russian spanish swedish turkish) %>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_stemming_language)) %>
|
|
<%= select_tag('settings[dmsf_stemming_lang]', options_for_select(stem_langs, @settings['dmsf_stemming_lang']))%>
|
|
<em class="info">
|
|
<%= l(:note_possible_values) %>: <%= stem_langs.join(', ') %>. <%= "#{l(:label_default)}: #{stem_langs[2]}" %>
|
|
</em>
|
|
</p>
|
|
|
|
<p>
|
|
<%= content_tag(:label, l(:label_stem_strategy)) %>
|
|
<%= radio_button_tag 'settings[dmsf_stemming_strategy]', 'STEM_NONE', @settings['dmsf_stemming_strategy'] == 'STEM_NONE', :disabled => xapian_disabled, :checked => true %> <%= l(:option_stem_none) %><br/>
|
|
<%= radio_button_tag 'settings[dmsf_stemming_strategy]', 'STEM_SOME', @settings['dmsf_stemming_strategy'] == 'STEM_SOME', :disabled => xapian_disabled %> <%= l(:option_stem_some) %><br/>
|
|
<%= radio_button_tag 'settings[dmsf_stemming_strategy]', 'STEM_ALL', @settings['dmsf_stemming_strategy'] == 'STEM_ALL', :disabled => xapian_disabled %> <%= l(:option_stem_all) %><br/>
|
|
<em class="info">
|
|
<%= l(:label_stemming_description) %>:<br/>
|
|
STEM_NONE: <%= l(:note_do_not_stem) %><br/>
|
|
STEM_SOME: <%= l(:note_stem_some) %><br/>
|
|
STEM_ALL: <%= l(:note_stem_all) %><br/>
|
|
<%= l(:note_stemming_applied) %>
|
|
</em>
|
|
</p>
|