comparison app/controllers/context_menus_controller.rb @ 1295:622f24f53b42 redmine-2.3

Update to Redmine SVN revision 11972 on 2.3-stable branch
author Chris Cannam
date Fri, 14 Jun 2013 09:02:21 +0100
parents 433d4f72a19b
children
comparison
equal deleted inserted replaced
1294:3e4c3460b6ca 1295:622f24f53b42
1 # Redmine - project management software 1 # Redmine - project management software
2 # Copyright (C) 2006-2012 Jean-Philippe Lang 2 # Copyright (C) 2006-2013 Jean-Philippe Lang
3 # 3 #
4 # This program is free software; you can redistribute it and/or 4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License 5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2 6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version. 7 # of the License, or (at your option) any later version.
19 helper :watchers 19 helper :watchers
20 helper :issues 20 helper :issues
21 21
22 def issues 22 def issues
23 @issues = Issue.visible.all(:conditions => {:id => params[:ids]}, :include => :project) 23 @issues = Issue.visible.all(:conditions => {:id => params[:ids]}, :include => :project)
24 (render_404; return) unless @issues.present?
24 if (@issues.size == 1) 25 if (@issues.size == 1)
25 @issue = @issues.first 26 @issue = @issues.first
26 end 27 end
27 @issue_ids = @issues.map(&:id).sort 28 @issue_ids = @issues.map(&:id).sort
28 29
72 end 73 end
73 74
74 def time_entries 75 def time_entries
75 @time_entries = TimeEntry.all( 76 @time_entries = TimeEntry.all(
76 :conditions => {:id => params[:ids]}, :include => :project) 77 :conditions => {:id => params[:ids]}, :include => :project)
78 (render_404; return) unless @time_entries.present?
79
77 @projects = @time_entries.collect(&:project).compact.uniq 80 @projects = @time_entries.collect(&:project).compact.uniq
78 @project = @projects.first if @projects.size == 1 81 @project = @projects.first if @projects.size == 1
79 @activities = TimeEntryActivity.shared.active 82 @activities = TimeEntryActivity.shared.active
80 @can = {:edit => User.current.allowed_to?(:edit_time_entries, @projects), 83 @can = {:edit => User.current.allowed_to?(:edit_time_entries, @projects),
81 :delete => User.current.allowed_to?(:edit_time_entries, @projects) 84 :delete => User.current.allowed_to?(:edit_time_entries, @projects)