diff --git a/lib/redmine_dmsf/webdav/base_resource.rb b/lib/redmine_dmsf/webdav/base_resource.rb index f89fc6da..3a6e76db 100644 --- a/lib/redmine_dmsf/webdav/base_resource.rb +++ b/lib/redmine_dmsf/webdav/base_resource.rb @@ -132,6 +132,10 @@ table { width:100%%; } def projectless_path '/'+path.split('/').drop(2).join('/') end + + def path_prefix + public_path.gsub(/#{Regexp.escape(path)}$/, '') + end end end end diff --git a/lib/redmine_dmsf/webdav/dmsf_resource.rb b/lib/redmine_dmsf/webdav/dmsf_resource.rb index 7b801d68..146be59c 100644 --- a/lib/redmine_dmsf/webdav/dmsf_resource.rb +++ b/lib/redmine_dmsf/webdav/dmsf_resource.rb @@ -601,7 +601,7 @@ module RedmineDmsf end lock_entity = lock.folder || lock.file - lock_path = "#{request.scheme}://#{request.host}:#{request.port}/dmsf/webdav/#{URI.escape(lock_entity.project.identifier)}/" + lock_path = "#{request.scheme}://#{request.host}:#{request.port}#{path_prefix}#{URI.escape(lock_entity.project.identifier)}/" lock_path << lock_entity.dmsf_path.map {|x| URI.escape(x.respond_to?('name') ? x.name : x.title) }.join('/') lock_path << "/" if lock_entity.is_a?(DmsfFolder) && lock_path[-1,1] != '/' doc.lockroot { doc.href lock_path }