Allows user to clear dates and text fields when bulk editing issues (#2199).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12192 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
285baaff94
commit
e35640f3e8
3 files changed
+39
-3
No files matched your search
@@ -105,13 +105,24 @@ module CustomFieldsHelper
|
||||
|
||||
tag_options = {:id => field_id, :class => "#{custom_field.field_format}_cf"}
|
||||
|
||||
unset_tag = ''
|
||||
unless custom_field.is_required?
|
||||
unset_tag = content_tag('label',
|
||||
check_box_tag(field_name, '__none__', (value == '__none__'), :id => nil, :data => {:disables => "##{field_id}"}) + l(:button_clear),
|
||||
:class => 'inline'
|
||||
)
|
||||
end
|
||||
|
||||
field_format = Redmine::CustomFieldFormat.find_by_name(custom_field.field_format)
|
||||
case field_format.try(:edit_as)
|
||||
when "date"
|
||||
text_field_tag(field_name, value, tag_options.merge(:size => 10)) +
|
||||
calendar_for(field_id)
|
||||
calendar_for(field_id) +
|
||||
unset_tag
|
||||
when "text"
|
||||
text_area_tag(field_name, value, tag_options.merge(:rows => 3))
|
||||
text_area_tag(field_name, value, tag_options.merge(:rows => 3)) +
|
||||
'<br />'.html_safe +
|
||||
unset_tag
|
||||
when "bool"
|
||||
select_tag(field_name, options_for_select([[l(:label_no_change_option), ''],
|
||||
[l(:general_text_yes), '1'],
|
||||
@@ -123,7 +134,8 @@ module CustomFieldsHelper
|
||||
options += custom_field.possible_values_options(projects)
|
||||
select_tag(field_name, options_for_select(options, value), tag_options.merge(:multiple => custom_field.multiple?))
|
||||
else
|
||||
text_field_tag(field_name, value, tag_options)
|
||||
text_field_tag(field_name, value, tag_options) +
|
||||
unset_tag
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user