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