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,
:target_type => DmsfFile.model_name.to_s).visible.all
links.each do |link|
return link if link.target_file.name == filename
return link if link.target_file && (link.target_file.name == filename)
end
nil
end

View File

@ -290,7 +290,7 @@
<%= 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" %>
<%= l(:label_default) %>: <%= File.expand_path('dmsf_index', Rails.root) %>
</em>
</p>

View File

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

View File

@ -43,7 +43,7 @@ Redmine::Plugin.register :redmine_dmsf do
'dmsf_max_email_filesize' => '0',
'dmsf_max_ajax_upload_filesize' => '100',
'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_strategy' => 'STEM_NONE',
'dmsf_webdav' => '1',