summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-07-29 17:52:27 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-07-29 17:52:27 +0000
commitefc05bc73cf53e2c9d57147f7226f9b17a6350ce (patch)
tree3f7f5f239bf1e1a298f1d26cf459d0524fad3e4a /app/controllers
parent41e7210210b5e50bf57bbcf41259a4d343bba1f0 (diff)
downloadredmine-efc05bc73cf53e2c9d57147f7226f9b17a6350ce.tar.gz
redmine-efc05bc73cf53e2c9d57147f7226f9b17a6350ce.zip
Add time entries custom fields to the context menu for quick bulk edit (#17484).
git-svn-id: http://svn.redmine.org/redmine/trunk@13335 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/context_menus_controller.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/controllers/context_menus_controller.rb b/app/controllers/context_menus_controller.rb
index 2b174c016..36cb13f26 100644
--- a/app/controllers/context_menus_controller.rb
+++ b/app/controllers/context_menus_controller.rb
@@ -71,6 +71,9 @@ class ContextMenusController < ApplicationController
def time_entries
@time_entries = TimeEntry.where(:id => params[:ids]).preload(:project).to_a
(render_404; return) unless @time_entries.present?
+ if (@time_entries.size == 1)
+ @time_entry = @time_entries.first
+ end
@projects = @time_entries.collect(&:project).compact.uniq
@project = @projects.first if @projects.size == 1
@@ -79,6 +82,18 @@ class ContextMenusController < ApplicationController
:delete => User.current.allowed_to?(:edit_time_entries, @projects)
}
@back = back_url
+
+ @options_by_custom_field = {}
+ if @can[:edit]
+ custom_fields = @time_entries.map(&:editable_custom_fields).reduce(:&).reject(&:multiple?)
+ custom_fields.each do |field|
+ values = field.possible_values_options(@projects)
+ if values.present?
+ @options_by_custom_field[field] = values
+ end
+ end
+ end
+
render :layout => false
end
end