summaryrefslogtreecommitdiffstats
path: root/app/controllers/issues_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-20 18:22:43 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-20 18:22:43 +0000
commitfbf30eec7c58786d615852bc17ffe5a1c49229b6 (patch)
treeff3e3183f87dcb2f18ea02e33b3a154501c5b980 /app/controllers/issues_controller.rb
parent8a3623733fa2ef879bb2a3f4355e0ce0df49b278 (diff)
downloadredmine-fbf30eec7c58786d615852bc17ffe5a1c49229b6.tar.gz
redmine-fbf30eec7c58786d615852bc17ffe5a1c49229b6.zip
Adds an option of the copy form to enable/disable attachments copy (#3055).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8677 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issues_controller.rb')
-rw-r--r--app/controllers/issues_controller.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 82fa5f8ea..e3e6ffedc 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -360,11 +360,15 @@ private
def build_new_issue_from_params
if params[:id].blank?
@issue = Issue.new
- begin
- @issue.copy_from(params[:copy_from]) if params[:copy_from]
- rescue ActiveRecord::RecordNotFound
- render_404
- return
+ if params[:copy_from]
+ 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)
+ rescue ActiveRecord::RecordNotFound
+ render_404
+ return
+ end
end
@issue.project = @project
else