'Save as' from Excel does not work when using project names #700
This commit is contained in:
parent
41953fdff5
commit
6ea7790305
@ -43,7 +43,7 @@ class DmsfFolder < ActiveRecord::Base
|
|||||||
has_many :locks, -> { where(entity_type: 1).order("#{DmsfLock.table_name}.updated_at DESC") },
|
has_many :locks, -> { where(entity_type: 1).order("#{DmsfLock.table_name}.updated_at DESC") },
|
||||||
:class_name => 'DmsfLock', :foreign_key => 'entity_id', :dependent => :destroy
|
:class_name => 'DmsfLock', :foreign_key => 'entity_id', :dependent => :destroy
|
||||||
|
|
||||||
INVALID_CHARACTERS = /\A[^\/\\\?":<>#%\*]*\z/.freeze
|
INVALID_CHARACTERS = /\A[^\[\]\/\\\?":<>#%\*]*\z/.freeze
|
||||||
STATUS_DELETED = 1.freeze
|
STATUS_DELETED = 1.freeze
|
||||||
STATUS_ACTIVE = 0.freeze
|
STATUS_ACTIVE = 0.freeze
|
||||||
AVAILABLE_COLUMNS = %w(id title extension size modified version workflow author).freeze
|
AVAILABLE_COLUMNS = %w(id title extension size modified version workflow author).freeze
|
||||||
|
|||||||
@ -115,9 +115,6 @@ module RedmineDmsf
|
|||||||
def project_id
|
def project_id
|
||||||
self.project.id if self.project
|
self.project.id if self.project
|
||||||
end
|
end
|
||||||
|
|
||||||
# Characters that MATCH this regex will be replaced with dots, no more than one dot in a row.
|
|
||||||
INVALID_CHARACTERS = /[\/\\\?":<>#%\*]/.freeze # = / \ ? " : < > # % *
|
|
||||||
|
|
||||||
def self.create_project_name(p)
|
def self.create_project_name(p)
|
||||||
use_project_names = Setting.plugin_redmine_dmsf['dmsf_webdav_use_project_names']
|
use_project_names = Setting.plugin_redmine_dmsf['dmsf_webdav_use_project_names']
|
||||||
@ -125,7 +122,7 @@ module RedmineDmsf
|
|||||||
# 1. Invalid characters are replaced with a dot.
|
# 1. Invalid characters are replaced with a dot.
|
||||||
# 2. Two or more dots in a row are replaced with a single 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.)
|
# (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(DmsfFolder.INVALID_CHARACTERS, ".").gsub(/\.{2,}/, '.')} #{p.id}" unless p.nil?
|
||||||
else
|
else
|
||||||
p.identifier unless p.nil?
|
p.identifier unless p.nil?
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user