Redmine's root option pre-filled in automatically

This commit is contained in:
Karel Pičman 2018-06-14 14:14:03 +02:00
parent 854931b997
commit b683351a15
4 changed files with 6 additions and 6 deletions

View File

@ -109,7 +109,7 @@ class DmsfLink < ActiveRecord::Base
:dmsf_folder_id => folder ? folder.id : nil, :dmsf_folder_id => folder ? folder.id : nil,
:target_type => DmsfFile.model_name.to_s).visible.all :target_type => DmsfFile.model_name.to_s).visible.all
links.each do |link| links.each do |link|
return link if link.target_file.name == filename return link if link.target_file && (link.target_file.name == filename)
end end
nil nil
end end

View File

@ -290,7 +290,7 @@
<%= content_tag(:label, l(:label_index_database)) %> <%= content_tag(:label, l(:label_index_database)) %>
<%= text_field_tag 'settings[dmsf_index_database]', @settings['dmsf_index_database'], :disabled => xapian_disabled, :size => 50 %> <%= text_field_tag 'settings[dmsf_index_database]', @settings['dmsf_index_database'], :disabled => xapian_disabled, :size => 50 %>
<em class="info"> <em class="info">
<%= l(:label_default) %>: <%= "#{Rails.root}/files/dmsf_index" %> <%= l(:label_default) %>: <%= File.expand_path('dmsf_index', Rails.root) %>
</em> </em>
</p> </p>

View File

@ -29,7 +29,7 @@ require 'optparse'
######################################################################################################################## ########################################################################################################################
# Redmine installation directory # Redmine installation directory
$redmine_root = '/opt/redmine' $redmine_root = File.expand_path('../../../../', __FILE__)
# DMSF document location $redmine_root/$files # DMSF document location $redmine_root/$files
$files = 'dmsf' $files = 'dmsf'
@ -40,8 +40,8 @@ $scriptindex = '/usr/bin/scriptindex'
# omindex binary path # omindex binary path
$omindex = '/usr/bin/omindex' $omindex = '/usr/bin/omindex'
# Directory containing xapian databases for omindex (Attachments indexing) # Directory containing Xapian databases for omindex (Attachments indexing)
$dbrootpath = '/var/tmp/dmsf-index' $dbrootpath = File.expand_path('dmsf_index', $redmine_root)
# Verbose output, values of 0 no verbose, greater than 0 verbose output # Verbose output, values of 0 no verbose, greater than 0 verbose output
$verbose = 0 $verbose = 0

View File

@ -43,7 +43,7 @@ Redmine::Plugin.register :redmine_dmsf do
'dmsf_max_email_filesize' => '0', 'dmsf_max_email_filesize' => '0',
'dmsf_max_ajax_upload_filesize' => '100', 'dmsf_max_ajax_upload_filesize' => '100',
'dmsf_storage_directory' => 'files/dmsf', 'dmsf_storage_directory' => 'files/dmsf',
'dmsf_index_database' => 'files/dmsf_index', 'dmsf_index_database' => File.expand_path('dmsf_index', Rails.root),
'dmsf_stemming_lang' => 'english', 'dmsf_stemming_lang' => 'english',
'dmsf_stemming_strategy' => 'STEM_NONE', 'dmsf_stemming_strategy' => 'STEM_NONE',
'dmsf_webdav' => '1', 'dmsf_webdav' => '1',