##// END OF EJS Templates
Time Entries context menu shows activities not available for the time entry's project (#23922)....
Jean-Philippe Lang -
r15570:88ab6dd946f0
parent child
Show More
@@ -59,7 +59,10 class ContextMenusController < ApplicationController
59 59 end
60 60
61 61 def time_entries
62 @time_entries = TimeEntry.where(:id => params[:ids]).preload(:project, :user).to_a
62 @time_entries = TimeEntry.where(:id => params[:ids]).
63 preload(:project => :time_entry_activities).
64 preload(:user).to_a
65
63 66 (render_404; return) unless @time_entries.present?
64 67 if (@time_entries.size == 1)
65 68 @time_entry = @time_entries.first
@@ -67,7 +70,7 class ContextMenusController < ApplicationController
67 70
68 71 @projects = @time_entries.collect(&:project).compact.uniq
69 72 @project = @projects.first if @projects.size == 1
70 @activities = TimeEntryActivity.shared.active
73 @activities = @projects.map(&:activities).reduce(:&)
71 74
72 75 edit_allowed = @time_entries.all? {|t| t.editable_by?(User.current)}
73 76 @can = {:edit => edit_allowed, :delete => edit_allowed}
General Comments 0
You need to be logged in to leave comments. Login now