diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-10-23 11:48:52 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-10-23 11:48:52 +0000 |
commit | 73ef85f672d90e1c67206b7ae4674b8d0cb7d0df (patch) | |
tree | 254133937a75994d59830c315e67e3d27c19a3c2 | |
parent | eb023bdcce2bd6d9ec3b1d37aa09e436c5ee8149 (diff) | |
download | redmine-73ef85f672d90e1c67206b7ae4674b8d0cb7d0df.tar.gz redmine-73ef85f672d90e1c67206b7ae4674b8d0cb7d0df.zip |
Don't bulk edit file custom fields (#6719).
git-svn-id: http://svn.redmine.org/redmine/trunk@15923 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/controllers/context_menus_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/issues_controller.rb | 2 | ||||
-rw-r--r-- | lib/redmine/field_format.rb | 5 |
3 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/context_menus_controller.rb b/app/controllers/context_menus_controller.rb index 39594012c..bdec1fccf 100644 --- a/app/controllers/context_menus_controller.rb +++ b/app/controllers/context_menus_controller.rb @@ -45,7 +45,7 @@ class ContextMenusController < ApplicationController @options_by_custom_field = {} if @can[:edit] - custom_fields = @issues.map(&:editable_custom_fields).reduce(:&).reject(&:multiple?) + custom_fields = @issues.map(&:editable_custom_fields).reduce(:&).reject(&:multiple?).select {|field| field.format.bulk_edit_supported} custom_fields.each do |field| values = field.possible_values_options(@projects) if values.present? diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 779e85113..a4a3a34de 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -251,7 +251,7 @@ class IssuesController < ApplicationController end end - @custom_fields = edited_issues.map{|i|i.editable_custom_fields}.reduce(:&) + @custom_fields = edited_issues.map{|i|i.editable_custom_fields}.reduce(:&).select {|field| field.format.bulk_edit_supported} @assignables = target_projects.map(&:assignable_users).reduce(:&) @versions = target_projects.map {|p| p.shared_versions.open}.reduce(:&) @categories = target_projects.map {|p| p.issue_categories}.reduce(:&) diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb index 7d6502b2c..4c3dd7029 100644 --- a/lib/redmine/field_format.rb +++ b/lib/redmine/field_format.rb @@ -79,6 +79,10 @@ module Redmine class_attribute :totalable_supported self.totalable_supported = false + # Set this to false if field cannot be bulk edited + class_attribute :bulk_edit_supported + self.bulk_edit_supported = true + # Restricts the classes that the custom field can be added to # Set to nil for no restrictions class_attribute :customized_class_names @@ -861,6 +865,7 @@ module Redmine self.form_partial = 'custom_fields/formats/attachment' self.is_filter_supported = false self.change_no_details = true + self.bulk_edit_supported = false field_attributes :extensions_allowed def set_custom_field_value(custom_field, custom_field_value, value) |