Merge branch 'master' of github.com:danmunn/redmine_dmsf
This commit is contained in:
commit
1fcccc0180
@ -102,15 +102,15 @@ class DmsfMailer < Mailer
|
||||
true
|
||||
when 'selected'
|
||||
notify_member.mail_notification?
|
||||
when 'only_my_events'
|
||||
author = false
|
||||
files.each do |file|
|
||||
if file.involved?(notify_user)
|
||||
author = true
|
||||
break
|
||||
end
|
||||
when 'only_my_events'
|
||||
author = false
|
||||
files.each do |file|
|
||||
if file.involved?(notify_user)
|
||||
author = true
|
||||
break
|
||||
end
|
||||
author
|
||||
end
|
||||
author
|
||||
when 'only_owner', 'only_assigned'
|
||||
author = false
|
||||
files.each do |file|
|
||||
@ -132,4 +132,4 @@ class DmsfMailer < Mailer
|
||||
notify_members.collect { |m| m.user }.uniq
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@ -99,10 +99,14 @@
|
||||
}
|
||||
|
||||
.dmsf_workflow {
|
||||
/*font-size: 0.8em;*/
|
||||
font-size: 0.8em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.dmsf_cf {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
.dmsf_invisible {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@ -27,7 +27,8 @@ class ApprovalWorkflowStdFields < ActiveRecord::Migration
|
||||
# Set updated_on
|
||||
DmsfWorkflow.all.each(&:touch)
|
||||
# Set created_on and author_id
|
||||
DmsfWorkflow.update_all 'created_on = updated_on, author_id = (select id from users where admin limit 1)'
|
||||
admin = User.active.where(admin: true).first
|
||||
DmsfWorkflow.update_all "created_on = updated_on, author_id = #{admin.id}" if admin
|
||||
end
|
||||
|
||||
def self.down
|
||||
@ -35,4 +36,4 @@ class ApprovalWorkflowStdFields < ActiveRecord::Migration
|
||||
remove_column :dmsf_workflows, :created_on
|
||||
remove_column :dmsf_workflows, :author_id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -168,7 +168,7 @@ module RedmineDmsf
|
||||
pinfo = @path.split('/').drop(1)
|
||||
if pinfo.length > 0
|
||||
if use_project_names
|
||||
unless pinfo.first.match('(\[([0-9]+)\])$').nil?
|
||||
unless pinfo.first.match('(-([0-9]+)-)$').nil?
|
||||
pid = $2
|
||||
begin
|
||||
@project = Project.find_by_id(pid)
|
||||
|
||||
@ -117,7 +117,7 @@ module RedmineDmsf
|
||||
end
|
||||
|
||||
# Characters that MATCH this regex will be replaced with dots, no more than one dot in a row.
|
||||
INVALID_CHARACTERS = /[\/\\\?":<>#%\*]/.freeze # = / \ ? " : < > # % *
|
||||
INVALID_CHARACTERS = /[\/\\\?":<>#%\*\[\]]/.freeze # = / \ ? " : < > # % * [ ]
|
||||
|
||||
def self.create_project_name(p)
|
||||
use_project_names = Setting.plugin_redmine_dmsf['dmsf_webdav_use_project_names']
|
||||
@ -125,7 +125,7 @@ module RedmineDmsf
|
||||
# 1. Invalid characters are replaced with a dot.
|
||||
# 2. Two or more dots in a row are replaced with a single dot.
|
||||
# (3. Windows WebClient does not like a dot at the end, but since the project id tag is appended this is not a problem.)
|
||||
"#{p.name.gsub(INVALID_CHARACTERS, ".").gsub(/\.{2,}/, ".")} [#{p.id}]" unless p.nil?
|
||||
"#{p.name.gsub(INVALID_CHARACTERS, ".").gsub(/\.{2,}/, ".")} -#{p.id}-" unless p.nil?
|
||||
else
|
||||
p.identifier unless p.nil?
|
||||
end
|
||||
|
||||
@ -47,7 +47,7 @@ class DmsfWebdavPropfindTest < RedmineDmsf::Test::IntegrationTest
|
||||
# Temporarily enable project names to generate names for project1
|
||||
Setting.plugin_redmine_dmsf['dmsf_webdav_use_project_names'] = true
|
||||
@project1_name = RedmineDmsf::Webdav::ProjectResource.create_project_name(@project1)
|
||||
@project1_uri = URI.encode(@project1_name, /\W/)
|
||||
@project1_uri = URI.encode(@project1_name)
|
||||
Setting.plugin_redmine_dmsf['dmsf_webdav_use_project_names'] = false
|
||||
RedmineDmsf::Webdav::Cache.init_nullcache
|
||||
end
|
||||
@ -269,7 +269,7 @@ class DmsfWebdavPropfindTest < RedmineDmsf::Test::IntegrationTest
|
||||
@project1.name = 'Online Cookbook'
|
||||
@project1.save!
|
||||
project1_new_name = RedmineDmsf::Webdav::ProjectResource.create_project_name(@project1)
|
||||
project1_new_uri = URI.encode(project1_new_name, /\W/)
|
||||
project1_new_uri = URI.encode(project1_new_name)
|
||||
|
||||
# PROPSTATS for / is already cached, but a new PROPSTATS should be cached for project1
|
||||
assert_difference 'RedmineDmsf::Webdav::Cache.cache.instance_variable_get(:@data).count', +1 do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user