summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-14 21:54:16 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-14 21:54:16 +0000
commitb0a8888e356aa287fc9c968a5d9b05fc2aff0748 (patch)
tree25a0e1b36ad30fe85e6be57945588900802e1b1c /app
parent833c7bd659fea1c7ce9f7bdd85714c4ac7f877d5 (diff)
downloadredmine-b0a8888e356aa287fc9c968a5d9b05fc2aff0748.tar.gz
redmine-b0a8888e356aa287fc9c968a5d9b05fc2aff0748.zip
Fixed: admin should be able to move issues to any project.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@903 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects_controller.rb9
-rw-r--r--app/views/projects/move_issues.rhtml2
2 files changed, 8 insertions, 3 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index e708dd6fc..092e1dd00 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -295,10 +295,15 @@ class ProjectsController < ApplicationController
redirect_to :controller => 'issues', :action => 'index', :project_id => @project and return unless @issues
@projects = []
# find projects to which the user is allowed to move the issue
- User.current.memberships.each {|m| @projects << m.project if m.role.allowed_to?(:controller => 'projects', :action => 'move_issues')}
+ if User.current.admin?
+ # admin is allowed to move issues to any active (visible) project
+ @projects = Project.find(:all, :conditions => Project.visible_by(User.current), :order => 'name')
+ else
+ User.current.memberships.each {|m| @projects << m.project if m.role.allowed_to?(:controller => 'projects', :action => 'move_issues')}
+ end
# issue can be moved to any tracker
@trackers = Tracker.find(:all)
- if request.post? and params[:new_project_id] and params[:new_tracker_id]
+ if request.post? && params[:new_project_id] && @projects.collect(&:id).include?(params[:new_project_id].to_i) && params[:new_tracker_id]
new_project = Project.find_by_id(params[:new_project_id])
new_tracker = Tracker.find_by_id(params[:new_tracker_id])
@issues.each do |i|
diff --git a/app/views/projects/move_issues.rhtml b/app/views/projects/move_issues.rhtml
index e9e4bb787..b29653037 100644
--- a/app/views/projects/move_issues.rhtml
+++ b/app/views/projects/move_issues.rhtml
@@ -18,7 +18,7 @@
<%= select_tag "new_project_id", options_from_collection_for_select(@projects, "id", "name", @project.id) %></p>
<p><label for="new_tracker_id"><%=l(:field_tracker)%> :</label>
-<%= select_tag "new_tracker_id", '<option></option>' + options_from_collection_for_select(@trackers, "id", "name") %></p>
+<%= select_tag "new_tracker_id", "<option value=\"\">#{l(:label_no_change_option)}</option>" + options_from_collection_for_select(@trackers, "id", "name") %></p>
</div>
<%= submit_tag l(:button_move) %>
<% end %>