@@ -59,7 +59,10 class ContextMenusController < ApplicationController | |||||
59 | end |
|
59 | end | |
60 |
|
60 | |||
61 | def time_entries |
|
61 | def time_entries | |
62 |
@time_entries = TimeEntry.where(:id => params[:ids]). |
|
62 | @time_entries = TimeEntry.where(:id => params[:ids]). | |
|
63 | preload(:project => :time_entry_activities). | |||
|
64 | preload(:user).to_a | |||
|
65 | ||||
63 | (render_404; return) unless @time_entries.present? |
|
66 | (render_404; return) unless @time_entries.present? | |
64 | if (@time_entries.size == 1) |
|
67 | if (@time_entries.size == 1) | |
65 | @time_entry = @time_entries.first |
|
68 | @time_entry = @time_entries.first | |
@@ -67,7 +70,7 class ContextMenusController < ApplicationController | |||||
67 |
|
70 | |||
68 | @projects = @time_entries.collect(&:project).compact.uniq |
|
71 | @projects = @time_entries.collect(&:project).compact.uniq | |
69 | @project = @projects.first if @projects.size == 1 |
|
72 | @project = @projects.first if @projects.size == 1 | |
70 | @activities = TimeEntryActivity.shared.active |
|
73 | @activities = @projects.map(&:activities).reduce(:&) | |
71 |
|
74 | |||
72 | edit_allowed = @time_entries.all? {|t| t.editable_by?(User.current)} |
|
75 | edit_allowed = @time_entries.all? {|t| t.editable_by?(User.current)} | |
73 | @can = {:edit => edit_allowed, :delete => edit_allowed} |
|
76 | @can = {:edit => edit_allowed, :delete => edit_allowed} |
General Comments 0
You need to be logged in to leave comments.
Login now