summaryrefslogtreecommitdiffstats
path: root/app/controllers/issues_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-29 15:10:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-29 15:10:59 +0000
commit30d65829b859c934c266b0862b30aa4b57d11677 (patch)
tree826b6103151bd967edfae19b131acfad75e866a8 /app/controllers/issues_controller.rb
parent749d703881c6f0c44db6724d7606189aaf69eb6a (diff)
downloadredmine-30d65829b859c934c266b0862b30aa4b57d11677.tar.gz
redmine-30d65829b859c934c266b0862b30aa4b57d11677.zip
Configurable behavour for linking issues on copy (#18500).
git-svn-id: http://svn.redmine.org/redmine/trunk@13668 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issues_controller.rb')
-rw-r--r--app/controllers/issues_controller.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 78f7c27ea..ff04d0504 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -273,7 +273,8 @@ class IssuesController < ApplicationController
if @copy
issue = orig_issue.copy({},
:attachments => params[:copy_attachments].present?,
- :subtasks => params[:copy_subtasks].present?
+ :subtasks => params[:copy_subtasks].present?,
+ :link => link_copy?(params[:link_copy])
)
else
issue = orig_issue
@@ -410,9 +411,10 @@ class IssuesController < ApplicationController
if params[:copy_from]
begin
@copy_from = Issue.visible.find(params[:copy_from])
+ @link_copy = link_copy?(params[:link_copy]) || request.get?
@copy_attachments = params[:copy_attachments].present? || request.get?
@copy_subtasks = params[:copy_subtasks].present? || request.get?
- @issue.copy_from(@copy_from, :attachments => @copy_attachments, :subtasks => @copy_subtasks)
+ @issue.copy_from(@copy_from, :attachments => @copy_attachments, :subtasks => @copy_subtasks, :link => @link_copy)
rescue ActiveRecord::RecordNotFound
render_404
return
@@ -486,4 +488,15 @@ class IssuesController < ApplicationController
end
end
end
+
+ def link_copy?(param)
+ case Setting.link_copied_issue
+ when 'yes'
+ true
+ when 'no'
+ false
+ when 'ask'
+ param == '1'
+ end
+ end
end