summaryrefslogtreecommitdiffstats
path: root/app/helpers/custom_fields_helper.rb
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-04-16 15:34:05 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-04-16 15:34:05 +0000
commit538642c5c4323e0ad1f3dc568ff025325ca5ae47 (patch)
treedd079407683b75d0186fc8672fdd4bce221b31b3 /app/helpers/custom_fields_helper.rb
parent4cb943571abcc1cbcc0fa92d0e8f0f690282ca56 (diff)
downloadredmine-538642c5c4323e0ad1f3dc568ff025325ca5ae47.tar.gz
redmine-538642c5c4323e0ad1f3dc568ff025325ca5ae47.zip
Let custom field formats control how they are edited.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3675 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/custom_fields_helper.rb')
-rw-r--r--app/helpers/custom_fields_helper.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/helpers/custom_fields_helper.rb b/app/helpers/custom_fields_helper.rb
index f75c89382..189467409 100644
--- a/app/helpers/custom_fields_helper.rb
+++ b/app/helpers/custom_fields_helper.rb
@@ -35,8 +35,9 @@ module CustomFieldsHelper
custom_field = custom_value.custom_field
field_name = "#{name}[custom_field_values][#{custom_field.id}]"
field_id = "#{name}_custom_field_values_#{custom_field.id}"
-
- case custom_field.field_format
+
+ field_format = Redmine::CustomFieldFormat.find_by_name(custom_field.field_format)
+ case field_format.edit_as
when "date"
text_field_tag(field_name, custom_value.value, :id => field_id, :size => 10) +
calendar_for(field_id)
@@ -70,7 +71,8 @@ module CustomFieldsHelper
def custom_field_tag_for_bulk_edit(name, custom_field)
field_name = "#{name}[custom_field_values][#{custom_field.id}]"
field_id = "#{name}_custom_field_values_#{custom_field.id}"
- case custom_field.field_format
+ field_format = Redmine::CustomFieldFormat.find_by_name(custom_field.field_format)
+ case field_format.edit_as
when "date"
text_field_tag(field_name, '', :id => field_id, :size => 10) +
calendar_for(field_id)