Fixed that the bulk edit/copy form does not propose versions and categories for the target project (#10350).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9046 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-03-01 20:22:08 +00:00
parent ac46497f1a
commit 7448e0dbc4
3 changed files with 27 additions and 8 deletions

View File

@@ -221,7 +221,7 @@ class IssuesController < ApplicationController
if User.current.allowed_to?(:move_issues, @projects)
@allowed_projects = Issue.allowed_target_projects_on_move
if params[:issue]
@target_project = @allowed_projects.detect {|p| p.id.to_s == params[:issue][:project_id]}
@target_project = @allowed_projects.detect {|p| p.id.to_s == params[:issue][:project_id].to_s}
if @target_project
target_projects = [@target_project]
end
@@ -233,6 +233,8 @@ class IssuesController < ApplicationController
@custom_fields = target_projects.map{|p|p.all_issue_custom_fields}.reduce(:&)
@assignables = target_projects.map(&:assignable_users).reduce(:&)
@trackers = target_projects.map(&:trackers).reduce(:&)
@versions = target_projects.map {|p| p.shared_versions.open}.reduce(:&)
@categories = target_projects.map {|p| p.issue_categories}.reduce(:&)
@safe_attributes = @issues.map(&:safe_attribute_names).reduce(:&)
render :layout => false if request.xhr?