diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-04-02 17:45:21 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-04-02 17:45:21 +0000 |
commit | bd8de9a6f84052f72930dac3c5ee2e353c249238 (patch) | |
tree | 263b6cb6d665f2451c62e467ed5a25dabed84bc1 /app/controllers/trackers_controller.rb | |
parent | 0a82489ddcc2f2603c11741f5b653e898170d9fd (diff) | |
download | redmine-bd8de9a6f84052f72930dac3c5ee2e353c249238.tar.gz redmine-bd8de9a6f84052f72930dac3c5ee2e353c249238.zip |
Added the ability to copy an existing workflow when creating a new tracker.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@399 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/trackers_controller.rb')
-rw-r--r-- | app/controllers/trackers_controller.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/trackers_controller.rb b/app/controllers/trackers_controller.rb index db30862c6..a473bcf41 100644 --- a/app/controllers/trackers_controller.rb +++ b/app/controllers/trackers_controller.rb @@ -35,9 +35,16 @@ class TrackersController < ApplicationController def new @tracker = Tracker.new(params[:tracker]) if request.post? and @tracker.save + # workflow copy + if params[:copy_workflow_from] && (copy_from = Tracker.find_by_id(params[:copy_workflow_from])) + copy_from.workflows.each do |w| + @tracker.workflows << w.clone + end + end flash[:notice] = l(:notice_successful_create) redirect_to :action => 'list' end + @trackers = Tracker.find :all end def edit |