@@ -295,10 +295,15 class ProjectsController < ApplicationController | |||||
295 | redirect_to :controller => 'issues', :action => 'index', :project_id => @project and return unless @issues |
|
295 | redirect_to :controller => 'issues', :action => 'index', :project_id => @project and return unless @issues | |
296 | @projects = [] |
|
296 | @projects = [] | |
297 | # find projects to which the user is allowed to move the issue |
|
297 | # find projects to which the user is allowed to move the issue | |
298 | User.current.memberships.each {|m| @projects << m.project if m.role.allowed_to?(:controller => 'projects', :action => 'move_issues')} |
|
298 | if User.current.admin? | |
|
299 | # admin is allowed to move issues to any active (visible) project | |||
|
300 | @projects = Project.find(:all, :conditions => Project.visible_by(User.current), :order => 'name') | |||
|
301 | else | |||
|
302 | User.current.memberships.each {|m| @projects << m.project if m.role.allowed_to?(:controller => 'projects', :action => 'move_issues')} | |||
|
303 | end | |||
299 | # issue can be moved to any tracker |
|
304 | # issue can be moved to any tracker | |
300 | @trackers = Tracker.find(:all) |
|
305 | @trackers = Tracker.find(:all) | |
301 |
if request.post? |
|
306 | if request.post? && params[:new_project_id] && @projects.collect(&:id).include?(params[:new_project_id].to_i) && params[:new_tracker_id] | |
302 | new_project = Project.find_by_id(params[:new_project_id]) |
|
307 | new_project = Project.find_by_id(params[:new_project_id]) | |
303 | new_tracker = Tracker.find_by_id(params[:new_tracker_id]) |
|
308 | new_tracker = Tracker.find_by_id(params[:new_tracker_id]) | |
304 | @issues.each do |i| |
|
309 | @issues.each do |i| |
@@ -18,7 +18,7 | |||||
18 | <%= select_tag "new_project_id", options_from_collection_for_select(@projects, "id", "name", @project.id) %></p> |
|
18 | <%= select_tag "new_project_id", options_from_collection_for_select(@projects, "id", "name", @project.id) %></p> | |
19 |
|
19 | |||
20 | <p><label for="new_tracker_id"><%=l(:field_tracker)%> :</label> |
|
20 | <p><label for="new_tracker_id"><%=l(:field_tracker)%> :</label> | |
21 |
<%= select_tag "new_tracker_id", |
|
21 | <%= select_tag "new_tracker_id", "<option value=\"\">#{l(:label_no_change_option)}</option>" + options_from_collection_for_select(@trackers, "id", "name") %></p> | |
22 | </div> |
|
22 | </div> | |
23 | <%= submit_tag l(:button_move) %> |
|
23 | <%= submit_tag l(:button_move) %> | |
24 | <% end %> |
|
24 | <% end %> |
General Comments 0
You need to be logged in to leave comments.
Login now