OSDN Git Service

add controller for bulk edit time entries (#7996).
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 4 Apr 2011 11:53:03 +0000 (11:53 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 4 Apr 2011 11:53:03 +0000 (11:53 +0000)
Contributed by Adam Soltys.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5312 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/context_menus_controller.rb

index 373938a..f2ff702 100644 (file)
@@ -40,5 +40,18 @@ class ContextMenusController < ApplicationController
     
     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