summaryrefslogtreecommitdiffstats
path: root/app/helpers/custom_fields_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-05-04 15:03:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-05-04 15:03:07 +0000
commit70bdb86c534f2acb074f48ddac3070eaf9a9e3d1 (patch)
tree420ec435fc92bd849036028d03249ef6d172bc31 /app/helpers/custom_fields_helper.rb
parent1269e6c7d3f5e067f4a77d78b66a8149255dd00a (diff)
downloadredmine-70bdb86c534f2acb074f48ddac3070eaf9a9e3d1.tar.gz
redmine-70bdb86c534f2acb074f48ddac3070eaf9a9e3d1.zip
Preserve field values on bulk edit failure (#13943).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11787 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/custom_fields_helper.rb')
-rw-r--r--app/helpers/custom_fields_helper.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/helpers/custom_fields_helper.rb b/app/helpers/custom_fields_helper.rb
index 803dbb6d3..80a3eecd7 100644
--- a/app/helpers/custom_fields_helper.rb
+++ b/app/helpers/custom_fields_helper.rb
@@ -77,7 +77,7 @@ module CustomFieldsHelper
custom_field_label_tag(name, custom_value, options) + custom_field_tag(name, custom_value)
end
- def custom_field_tag_for_bulk_edit(name, custom_field, projects=nil)
+ def custom_field_tag_for_bulk_edit(name, custom_field, projects=nil, value=nil)
field_name = "#{name}[custom_field_values][#{custom_field.id}]"
field_name << "[]" if custom_field.multiple?
field_id = "#{name}_custom_field_values_#{custom_field.id}"
@@ -87,22 +87,22 @@ module CustomFieldsHelper
field_format = Redmine::CustomFieldFormat.find_by_name(custom_field.field_format)
case field_format.try(:edit_as)
when "date"
- text_field_tag(field_name, '', tag_options.merge(:size => 10)) +
+ text_field_tag(field_name, value, tag_options.merge(:size => 10)) +
calendar_for(field_id)
when "text"
- text_area_tag(field_name, '', tag_options.merge(:rows => 3))
+ text_area_tag(field_name, value, tag_options.merge(:rows => 3))
when "bool"
select_tag(field_name, options_for_select([[l(:label_no_change_option), ''],
[l(:general_text_yes), '1'],
- [l(:general_text_no), '0']]), tag_options)
+ [l(:general_text_no), '0']], value), tag_options)
when "list"
options = []
options << [l(:label_no_change_option), ''] unless custom_field.multiple?
options << [l(:label_none), '__none__'] unless custom_field.is_required?
options += custom_field.possible_values_options(projects)
- select_tag(field_name, options_for_select(options), tag_options.merge(:multiple => custom_field.multiple?))
+ select_tag(field_name, options_for_select(options, value), tag_options.merge(:multiple => custom_field.multiple?))
else
- text_field_tag(field_name, '', tag_options)
+ text_field_tag(field_name, value, tag_options)
end
end