Quellcode durchsuchen

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

git-svn-id: http://svn.redmine.org/redmine/trunk@15923 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/3.4.0
Jean-Philippe Lang vor 7 Jahren
Ursprung
Commit
73ef85f672

+ 1
- 1
app/controllers/context_menus_controller.rb Datei anzeigen

@@ -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?

+ 1
- 1
app/controllers/issues_controller.rb Datei anzeigen

@@ -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(:&)

+ 5
- 0
lib/redmine/field_format.rb Datei anzeigen

@@ -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)

Laden…
Abbrechen
Speichern