summaryrefslogtreecommitdiffstats
path: root/app/controllers/issues_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-07 17:27:47 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-07 17:27:47 +0000
commit065376c160b0bc3ca6cd59707a0395b8bff23de9 (patch)
treedebe9c5202d915408485963e850307fa922e00f7 /app/controllers/issues_controller.rb
parent464cef8643e0bd5bf860e1fb7e4b65516dd12745 (diff)
downloadredmine-065376c160b0bc3ca6cd59707a0395b8bff23de9.tar.gz
redmine-065376c160b0bc3ca6cd59707a0395b8bff23de9.zip
Copy issues via bulk update action.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8538 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issues_controller.rb')
-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 ff8d2d0e1..4cbfa3c0a 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -206,9 +206,11 @@ class IssuesController < ApplicationController
end
end
- # Bulk edit a set of issues
+ # Bulk edit/copy a set of issues
def bulk_edit
@issues.sort!
+ @copy = params[:copy].present?
+ @notes = params[:notes]
if User.current.allowed_to?(:move_issues, @projects)
@allowed_projects = Issue.allowed_target_projects_on_move
@@ -226,18 +228,21 @@ class IssuesController < ApplicationController
@assignables = target_projects.map(&:assignable_users).inject{|memo,a| memo & a}
@trackers = target_projects.map(&:trackers).inject{|memo,t| memo & t}
- @notes = params[:notes]
render :layout => false if request.xhr?
end
def bulk_update
@issues.sort!
+ @copy = params[:copy].present?
attributes = parse_params_for_bulk_issue_attributes(params)
unsaved_issue_ids = []
moved_issues = []
@issues.each do |issue|
issue.reload
+ if @copy
+ issue = Issue.new.copy_from(issue)
+ end
journal = issue.init_journal(User.current, params[:notes])
issue.safe_attributes = attributes
call_hook(:controller_issues_bulk_edit_before_save, { :params => params, :issue => issue })