1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 23:11:12 +00:00

Don't bulk edit file custom fields (#6719).

git-svn-id: http://svn.redmine.org/redmine/trunk@15923 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2016-10-23 11:48:52 +00:00
parent eb023bdcce
commit 73ef85f672
3 changed files with 7 additions and 2 deletions

View File

@ -45,7 +45,7 @@ class ContextMenusController < ApplicationController
@options_by_custom_field = {} @options_by_custom_field = {}
if @can[:edit] 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| custom_fields.each do |field|
values = field.possible_values_options(@projects) values = field.possible_values_options(@projects)
if values.present? if values.present?

View File

@ -251,7 +251,7 @@ class IssuesController < ApplicationController
end end
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(:&) @assignables = target_projects.map(&:assignable_users).reduce(:&)
@versions = target_projects.map {|p| p.shared_versions.open}.reduce(:&) @versions = target_projects.map {|p| p.shared_versions.open}.reduce(:&)
@categories = target_projects.map {|p| p.issue_categories}.reduce(:&) @categories = target_projects.map {|p| p.issue_categories}.reduce(:&)

View File

@ -79,6 +79,10 @@ module Redmine
class_attribute :totalable_supported class_attribute :totalable_supported
self.totalable_supported = false 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 # Restricts the classes that the custom field can be added to
# Set to nil for no restrictions # Set to nil for no restrictions
class_attribute :customized_class_names class_attribute :customized_class_names
@ -861,6 +865,7 @@ module Redmine
self.form_partial = 'custom_fields/formats/attachment' self.form_partial = 'custom_fields/formats/attachment'
self.is_filter_supported = false self.is_filter_supported = false
self.change_no_details = true self.change_no_details = true
self.bulk_edit_supported = false
field_attributes :extensions_allowed field_attributes :extensions_allowed
def set_custom_field_value(custom_field, custom_field_value, value) def set_custom_field_value(custom_field, custom_field_value, value)