summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-08 05:34:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-08 05:34:07 +0000
commit5003927f13f54850ca9eeac48e353df5e4e325a1 (patch)
tree6af9692d3604e9520af7268f14b728eeed87a120 /app/controllers
parentffcf1925e3974e2907aa7baa180bbb2a71952a9d (diff)
downloadredmine-5003927f13f54850ca9eeac48e353df5e4e325a1.tar.gz
redmine-5003927f13f54850ca9eeac48e353df5e4e325a1.zip
Option to copy subtasks when copying issue(s) (#6965).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10327 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/issues_controller.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index e443fac55..c2ab10e61 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -221,6 +221,7 @@ class IssuesController < ApplicationController
@categories = target_projects.map {|p| p.issue_categories}.reduce(:&)
if @copy
@attachments_present = @issues.detect {|i| i.attachments.any?}.present?
+ @subtasks_present = @issues.detect {|i| !i.leaf?}.present?
end
@safe_attributes = @issues.map(&:safe_attribute_names).reduce(:&)
@@ -237,7 +238,10 @@ class IssuesController < ApplicationController
@issues.each do |issue|
issue.reload
if @copy
- issue = issue.copy({}, :attachments => params[:copy_attachments].present?)
+ issue = issue.copy({},
+ :attachments => params[:copy_attachments].present?,
+ :subtasks => params[:copy_subtasks].present?
+ )
end
journal = issue.init_journal(User.current, params[:notes])
issue.safe_attributes = attributes
@@ -374,7 +378,8 @@ private
begin
@copy_from = Issue.visible.find(params[:copy_from])
@copy_attachments = params[:copy_attachments].present? || request.get?
- @issue.copy_from(@copy_from, :attachments => @copy_attachments)
+ @copy_subtasks = params[:copy_subtasks].present? || request.get?
+ @issue.copy_from(@copy_from, :attachments => @copy_attachments, :subtasks => @copy_subtasks)
rescue ActiveRecord::RecordNotFound
render_404
return