diff app/controllers/.svn/text-base/context_menus_controller.rb.svn-base @ 441:cbce1fd3b1b7 redmine-1.2

Update to Redmine 1.2-stable branch (Redmine SVN rev 6000)
author Chris Cannam
date Mon, 06 Jun 2011 14:24:13 +0100
parents 8661b858af72
children
line wrap: on
line diff
--- a/app/controllers/.svn/text-base/context_menus_controller.rb.svn-base	Thu Mar 03 11:42:28 2011 +0000
+++ b/app/controllers/.svn/text-base/context_menus_controller.rb.svn-base	Mon Jun 06 14:24:13 2011 +0100
@@ -1,5 +1,6 @@
 class ContextMenusController < ApplicationController
   helper :watchers
+  helper :issues
   
   def issues
     @issues = Issue.visible.all(:conditions => {:id => params[:ids]}, :include => :project)
@@ -40,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