##// END OF EJS Templates
Don't bulk edit file custom fields (#6719)....
Jean-Philippe Lang -
r15541:73ef85f672d9
parent child
Show More
@@ -45,7 +45,7 class ContextMenusController < ApplicationController
45
45
46 @options_by_custom_field = {}
46 @options_by_custom_field = {}
47 if @can[:edit]
47 if @can[:edit]
48 custom_fields = @issues.map(&:editable_custom_fields).reduce(:&).reject(&:multiple?)
48 custom_fields = @issues.map(&:editable_custom_fields).reduce(:&).reject(&:multiple?).select {|field| field.format.bulk_edit_supported}
49 custom_fields.each do |field|
49 custom_fields.each do |field|
50 values = field.possible_values_options(@projects)
50 values = field.possible_values_options(@projects)
51 if values.present?
51 if values.present?
@@ -251,7 +251,7 class IssuesController < ApplicationController
251 end
251 end
252 end
252 end
253
253
254 @custom_fields = edited_issues.map{|i|i.editable_custom_fields}.reduce(:&)
254 @custom_fields = edited_issues.map{|i|i.editable_custom_fields}.reduce(:&).select {|field| field.format.bulk_edit_supported}
255 @assignables = target_projects.map(&:assignable_users).reduce(:&)
255 @assignables = target_projects.map(&:assignable_users).reduce(:&)
256 @versions = target_projects.map {|p| p.shared_versions.open}.reduce(:&)
256 @versions = target_projects.map {|p| p.shared_versions.open}.reduce(:&)
257 @categories = target_projects.map {|p| p.issue_categories}.reduce(:&)
257 @categories = target_projects.map {|p| p.issue_categories}.reduce(:&)
@@ -79,6 +79,10 module Redmine
79 class_attribute :totalable_supported
79 class_attribute :totalable_supported
80 self.totalable_supported = false
80 self.totalable_supported = false
81
81
82 # Set this to false if field cannot be bulk edited
83 class_attribute :bulk_edit_supported
84 self.bulk_edit_supported = true
85
82 # Restricts the classes that the custom field can be added to
86 # Restricts the classes that the custom field can be added to
83 # Set to nil for no restrictions
87 # Set to nil for no restrictions
84 class_attribute :customized_class_names
88 class_attribute :customized_class_names
@@ -861,6 +865,7 module Redmine
861 self.form_partial = 'custom_fields/formats/attachment'
865 self.form_partial = 'custom_fields/formats/attachment'
862 self.is_filter_supported = false
866 self.is_filter_supported = false
863 self.change_no_details = true
867 self.change_no_details = true
868 self.bulk_edit_supported = false
864 field_attributes :extensions_allowed
869 field_attributes :extensions_allowed
865
870
866 def set_custom_field_value(custom_field, custom_field_value, value)
871 def set_custom_field_value(custom_field, custom_field_value, value)
General Comments 0
You need to be logged in to leave comments. Login now