@@ -248,7 +248,10 class IssuesController < ApplicationController | |||
|
248 | 248 | def bulk_update |
|
249 | 249 | @issues.sort! |
|
250 | 250 | @copy = params[:copy].present? |
|
251 | ||
|
251 | 252 | attributes = parse_params_for_bulk_issue_attributes(params) |
|
253 | copy_subtasks = (params[:copy_subtasks] == '1') | |
|
254 | copy_attachments = (params[:copy_attachments] == '1') | |
|
252 | 255 | |
|
253 | 256 | if @copy |
|
254 | 257 | unless User.current.allowed_to?(:copy_issues, @projects) |
@@ -266,7 +269,7 class IssuesController < ApplicationController | |||
|
266 | 269 | unsaved_issues = [] |
|
267 | 270 | saved_issues = [] |
|
268 | 271 | |
|
269 |
if @copy && |
|
|
272 | if @copy && copy_subtasks | |
|
270 | 273 | # Descendant issues will be copied with the parent task |
|
271 | 274 | # Don't copy them twice |
|
272 | 275 | @issues.reject! {|issue| @issues.detect {|other| issue.is_descendant_of?(other)}} |
@@ -276,8 +279,8 class IssuesController < ApplicationController | |||
|
276 | 279 | orig_issue.reload |
|
277 | 280 | if @copy |
|
278 | 281 | issue = orig_issue.copy({}, |
|
279 |
:attachments => |
|
|
280 |
:subtasks => |
|
|
282 | :attachments => copy_attachments, | |
|
283 | :subtasks => copy_subtasks, | |
|
281 | 284 | :link => link_copy?(params[:link_copy]) |
|
282 | 285 | ) |
|
283 | 286 | else |
@@ -4025,7 +4025,7 class IssuesControllerTest < ActionController::TestCase | |||
|
4025 | 4025 | |
|
4026 | 4026 | assert_difference 'Issue.count', 1 do |
|
4027 | 4027 | assert_no_difference 'Attachment.count' do |
|
4028 | post :bulk_update, :ids => [3], :copy => '1', | |
|
4028 | post :bulk_update, :ids => [3], :copy => '1', :copy_attachments => '0', | |
|
4029 | 4029 | :issue => { |
|
4030 | 4030 | :project_id => '' |
|
4031 | 4031 | } |
@@ -4066,7 +4066,7 class IssuesControllerTest < ActionController::TestCase | |||
|
4066 | 4066 | @request.session[:user_id] = 2 |
|
4067 | 4067 | |
|
4068 | 4068 | assert_difference 'Issue.count', 1 do |
|
4069 | post :bulk_update, :ids => [issue.id], :copy => '1', | |
|
4069 | post :bulk_update, :ids => [issue.id], :copy => '1', :copy_subtasks => '0', | |
|
4070 | 4070 | :issue => { |
|
4071 | 4071 | :project_id => '' |
|
4072 | 4072 | } |
General Comments 0
You need to be logged in to leave comments.
Login now