I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

Patch #2172

Отстутствие ссылок для типа link

Added by Александр Гремячкин almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
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

Related to Extended Fields - Bug #2155: Wiki text field donot work well when using chinese as custom field name Incomplete 28 Feb 2013

Associated revisions

Revision 90 (diff)
Added by Andriy Lesyuk over 11 years ago

Applied patch for #2172, updated CREDITS

History

#1 Updated by Александр Гремячкин almost 12 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

Also available in: Atom PDF

Terms of use | Privacy policy