diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-02-09 18:22:11 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-02-09 18:22:11 +0000 |
commit | 5e0c1cc5ce9e16f3b4d8d2066bc1c4023afdee78 (patch) | |
tree | 4814399d770b5f3fe3197841c3bcf9689ab0e149 /app/controllers | |
parent | de7c49c6ca79f87b697744688d57a07e7af17b4c (diff) | |
download | redmine-5e0c1cc5ce9e16f3b4d8d2066bc1c4023afdee78.tar.gz redmine-5e0c1cc5ce9e16f3b4d8d2066bc1c4023afdee78.zip |
Bulk-edit custom fields through context menu (#6296).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8824 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/context_menus_controller.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/context_menus_controller.rb b/app/controllers/context_menus_controller.rb index defadb230..007cc38e6 100644 --- a/app/controllers/context_menus_controller.rb +++ b/app/controllers/context_menus_controller.rb @@ -42,6 +42,19 @@ class ContextMenusController < ApplicationController @statuses = IssueStatus.find(:all, :order => 'position') @back = back_url + @options_by_custom_field = {} + if @can[:edit] + custom_fields = @issues.map(&:available_custom_fields).inject {|memo, f| memo & f}.select do |f| + %w(bool list user version).include?(f.field_format) && !f.multiple? + end + custom_fields.each do |field| + values = field.possible_values_options(@projects) + if values.any? + @options_by_custom_field[field] = values + end + end + end + render :layout => false end |