Mercurial > hg > soundsoftware-site
diff app/controllers/context_menus_controller.rb @ 511:107d36338b70 live
Merge from branch "cannam"
author | Chris Cannam |
---|---|
date | Thu, 14 Jul 2011 10:43:07 +0100 |
parents | cbce1fd3b1b7 |
children | cbb26bc654de |
line wrap: on
line diff
--- a/app/controllers/context_menus_controller.rb Thu Jun 09 16:51:06 2011 +0100 +++ b/app/controllers/context_menus_controller.rb Thu Jul 14 10:43:07 2011 +0100 @@ -1,8 +1,10 @@ class ContextMenusController < ApplicationController helper :watchers + helper :issues def issues - @issues = Issue.find_all_by_id(params[:ids], :include => :project) + @issues = Issue.visible.all(:conditions => {:id => params[:ids]}, :include => :project) + if (@issues.size == 1) @issue = @issues.first @allowed_statuses = @issue.new_statuses_allowed_to(User.current) @@ -39,5 +41,18 @@ render :layout => false end - + + def time_entries + @time_entries = TimeEntry.all( + :conditions => {:id => params[:ids]}, :include => :project) + @projects = @time_entries.collect(&:project).compact.uniq + @project = @projects.first if @projects.size == 1 + @activities = TimeEntryActivity.shared.active + @can = {:edit => User.current.allowed_to?(:log_time, @projects), + :update => User.current.allowed_to?(:log_time, @projects), + :delete => User.current.allowed_to?(:log_time, @projects) + } + @back = back_url + render :layout => false + end end