]> source.dussan.org Git - redmine.git/commitdiff
Refactor: Move method
authorEric Davis <edavis@littlestreamsoftware.com>
Fri, 16 Apr 2010 15:33:55 +0000 (15:33 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Fri, 16 Apr 2010 15:33:55 +0000 (15:33 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3673 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/custom_fields_helper.rb
lib/redmine/custom_field_format.rb

index f3fcc1fc586dd3a5fbad1afc80a36a139aaf82c1..f75c89382eca6e63461024063ddaaa609dcd8ba5 100644 (file)
@@ -95,15 +95,7 @@ module CustomFieldsHelper
   
   # Return a string used to display a custom value
   def format_value(value, field_format)
-    return "" unless value && !value.empty?
-    case field_format
-    when "date"
-      begin; format_date(value.to_date); rescue; value end
-    when "bool"
-      l(value == "1" ? :general_text_Yes : :general_text_No)
-    else
-      value
-    end
+    Redmine::CustomFieldFormat.format_value(value, field_format) # Proxy
   end
 
   # Return an array of custom field formats which can be used in select_tag
index 6d42dfba65cc0f56b1b260208d419df95df5f03b..29d82b4462e6f2dc9c7d23bc6089e695634a6c9c 100644 (file)
@@ -61,6 +61,18 @@ module Redmine
           [ l(custom_field_format.label), custom_field_format.name ]
         }
       end
+
+      def format_value(value, field_format)
+        return "" unless value && !value.empty?
+        case field_format
+        when "date"
+          begin; format_date(value.to_date); rescue; value end
+        when "bool"
+          l(value == "1" ? :general_text_Yes : :general_text_No)
+        else
+          value
+        end
+      end
     end
   end 
 end