Patch #2172
Отстутствие ссылок для типа link
Start date:
13 Mar 2013
Due date:
03 Jun 2013
% Done:
100%
Redmine version:
External issue:
Description
source:app/helpers/extended_fields_helper.rb
filename = custom_field.name.gsub(%r{[^a-z0-9_]+}i, '_').downcase
filename.gsub!(%r{(^_+|_+$)}, '')
- unless filename.empty?
- format_extension = ''
- # Redmine 2.x.x
- if respond_to?(:formats)
- format_extension = ".#{formats.first}"
+ format_extension = ''
+ # Redmine 2.x.x
+ if respond_to?(:formats)
+ format_extension = ".#{formats.first}"
+ # Redmine 1.x.x
+ elsif request && request.respond_to?(:template_format)
+ format_extension = ".#{request.template_format}"
+ # Mailer
+ elsif controller
# Redmine 1.x.x
- elsif request && request.respond_to?(:template_format)
- format_extension = ".#{request.template_format}"
- # Mailer
- elsif controller
- # Redmine 1.x.x
- if controller.respond_to?(:template)
- format_extension = ".#{controller.template.template_format}"
- # Redmine 2.x.x
- elsif controller.respond_to?(:lookup_context)
- format_extension = ".#{controller.lookup_context.formats.first}"
- end
+ if controller.respond_to?(:template)
+ format_extension = ".#{controller.template.template_format}"
+ # Redmine 2.x.x
+ elsif controller.respond_to?(:lookup_context)
+ format_extension = ".#{controller.lookup_context.formats.first}"
end
-
- self.view_paths.each do |load_path|
- if template = load_path["custom_values/#{custom_field.field_format}/_#{filename}#{format_extension}"]
+ end
+ unless filename.empty?
+ self.view_paths.each do |load_path|
+ if template = load_path["custom_values/#{custom_field.field_format}/_#{filename}#{format_extension}"]
return "custom_values/#{custom_field.field_format}/#{filename}"
end
end
-
- self.view_paths.each do |load_path|
- if template = load_path["custom_values/common/_#{custom_field.field_format}#{format_extension}"]
- return "custom_values/common/#{custom_field.field_format}"
- end
+ end
+ self.view_paths.each do |load_path|
+ if template = load_path["custom_values/common/_#{custom_field.field_format}#{format_extension}"]
+ return "custom_values/common/#{custom_field.field_format}"
end
end
для типа link custom_field.name пустое
Related issues
Associated revisions
Applied patch for #2172, updated CREDITS
History
#1 Updated by Александр Гремячкин over 11 years ago
или покороче
@ def find_custom_field_template(custom_field) filename = custom_field.name.gsub(%r{[^a-z0-9_]+}i, '_').downcase filename.gsub!(%r{(^_+|_+$)}, '') unless filename.empty? format_extension = '' # Redmine 2.x.x if respond_to?(:formats) format_extension = ".#{formats.first}" # Redmine 1.x.x elsif request && request.respond_to?(:template_format) format_extension = ".#{request.template_format}" # Mailer elsif controller # Redmine 1.x.x if controller.respond_to?(:template) format_extension = ".#{controller.template.template_format}" # Redmine 2.x.x elsif controller.respond_to?(:lookup_context) format_extension = ".#{controller.lookup_context.formats.first}" end end self.view_paths.each do |load_path| if template = load_path["custom_values/#{custom_field.field_format}/_#{filename}#{format_extension}"] return "custom_values/#{custom_field.field_format}/#{filename}" end end self.view_paths.each do |load_path| if template = load_path["custom_values/common/_#{custom_field.field_format}#{format_extension}"] return "custom_values/common/#{custom_field.field_format}" end end end nil end@
на
@ def find_custom_field_template(custom_field) filename = custom_field.name.gsub(%r{[^a-z0-9_]+}i, '_').downcase filename.gsub!(%r{(^_+|_+$)}, '') format_extension = '' # Redmine 2.x.x if respond_to?(:formats) format_extension = ".#{formats.first}" # Redmine 1.x.x elsif request && request.respond_to?(:template_format) format_extension = ".#{request.template_format}" # Mailer elsif controller # Redmine 1.x.x if controller.respond_to?(:template) format_extension = ".#{controller.template.template_format}" # Redmine 2.x.x elsif controller.respond_to?(:lookup_context) format_extension = ".#{controller.lookup_context.formats.first}" end end unless filename.empty? self.view_paths.each do |load_path| if template = load_path["custom_values/#{custom_field.field_format}/_#{filename}#{format_extension}"] return "custom_values/#{custom_field.field_format}/#{filename}" end end end self.view_paths.each do |load_path| if template = load_path["custom_values/common/_#{custom_field.field_format}#{format_extension}"] return "custom_values/common/#{custom_field.field_format}" end end nil end@
#2 Updated by Andriy Lesyuk over 11 years ago
- Status changed from New to Under Verification
- Target version set to 0.2.2
Спасибо!
#3 Updated by Andriy Lesyuk over 11 years ago
- Due date set to 03 Jun 2013
- Status changed from Under Verification to Closed
- % Done changed from 0 to 100