Fixed: empty list for user/version custom fields on bulk edit form (#2096).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5354 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
406aa946e5
commit
d0ea5fae62
6 files changed
+46
-5
No files matched your search
@@ -68,7 +68,7 @@ module CustomFieldsHelper
|
||||
custom_field_label_tag(name, custom_value) + custom_field_tag(name, custom_value)
|
||||
end
|
||||
|
||||
def custom_field_tag_for_bulk_edit(name, custom_field)
|
||||
def custom_field_tag_for_bulk_edit(name, custom_field, projects)
|
||||
field_name = "#{name}[custom_field_values][#{custom_field.id}]"
|
||||
field_id = "#{name}_custom_field_values_#{custom_field.id}"
|
||||
field_format = Redmine::CustomFieldFormat.find_by_name(custom_field.field_format)
|
||||
@@ -83,7 +83,7 @@ module CustomFieldsHelper
|
||||
[l(:general_text_yes), '1'],
|
||||
[l(:general_text_no), '0']]), :id => field_id)
|
||||
when "list"
|
||||
select_tag(field_name, options_for_select([[l(:label_no_change_option), '']] + custom_field.possible_values_options), :id => field_id)
|
||||
select_tag(field_name, options_for_select([[l(:label_no_change_option), '']] + custom_field.possible_values_options(projects)), :id => field_id)
|
||||
else
|
||||
text_field_tag(field_name, '', :id => field_id)
|
||||
end
|
||||
|
||||
@@ -58,6 +58,8 @@ class CustomField < ActiveRecord::Base
|
||||
when 'version'
|
||||
obj.project.versions.sort.collect {|u| [u.to_s, u.id.to_s]}
|
||||
end
|
||||
elsif obj.is_a?(Array)
|
||||
obj.collect {|o| possible_values_options(o)}.inject {|memo, v| memo & v}
|
||||
else
|
||||
[]
|
||||
end
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<% end %>
|
||||
|
||||
<% @custom_fields.each do |custom_field| %>
|
||||
<p><label><%= h(custom_field.name) %></label> <%= custom_field_tag_for_bulk_edit('issue', custom_field) %></p>
|
||||
<p><label><%= h(custom_field.name) %></label> <%= custom_field_tag_for_bulk_edit('issue', custom_field, @projects) %></p>
|
||||
<% end %>
|
||||
|
||||
<%= call_hook(:view_issues_bulk_edit_details_bottom, { :issues => @issues }) %>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
</p>
|
||||
|
||||
<% @custom_fields.each do |custom_field| %>
|
||||
<p><label><%= h(custom_field.name) %></label> <%= custom_field_tag_for_bulk_edit('time_entry', custom_field) %></p>
|
||||
<p><label><%= h(custom_field.name) %></label> <%= custom_field_tag_for_bulk_edit('time_entry', custom_field, @projects) %></p>
|
||||
<% end %>
|
||||
|
||||
<%= call_hook(:view_time_entries_bulk_edit_details_bottom, { :time_entries => @time_entries }) %>
|
||||
|
||||
Reference in new issue
Block a user