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
This commit is contained in:
parent
0a82489ddc
commit
bd8de9a6f8
|
@ -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
|
||||
|
|
|
@ -4,5 +4,8 @@
|
|||
<p><%= f.text_field :name, :required => true %></p>
|
||||
<p><%= f.check_box :is_in_chlog %></p>
|
||||
<p><%= f.check_box :is_in_roadmap %></p>
|
||||
<% if @tracker.new_record? %>
|
||||
<p><label><%= l(:label_copy_workflow_from) %></label> <%= select_tag(:copy_workflow_from, content_tag("option") + options_from_collection_for_select(@trackers, :id, :name)) %></p>
|
||||
<% end %>
|
||||
<!--[eoform:tracker]-->
|
||||
</div>
|
||||
|
|
|
@ -354,6 +354,7 @@ label_view_diff: View differences
|
|||
label_diff_inline: inline
|
||||
label_diff_side_by_side: side by side
|
||||
label_options: Options
|
||||
label_copy_workflow_from: Copy workflow from
|
||||
|
||||
button_login: Einloggen
|
||||
button_submit: OK
|
||||
|
|
|
@ -354,6 +354,7 @@ label_view_diff: View differences
|
|||
label_diff_inline: inline
|
||||
label_diff_side_by_side: side by side
|
||||
label_options: Options
|
||||
label_copy_workflow_from: Copy workflow from
|
||||
|
||||
button_login: Login
|
||||
button_submit: Submit
|
||||
|
|
|
@ -354,6 +354,7 @@ label_view_diff: View differences
|
|||
label_diff_inline: inline
|
||||
label_diff_side_by_side: side by side
|
||||
label_options: Options
|
||||
label_copy_workflow_from: Copy workflow from
|
||||
|
||||
button_login: Conexión
|
||||
button_submit: Someter
|
||||
|
|
|
@ -354,6 +354,7 @@ label_view_diff: Voir les différences
|
|||
label_diff_inline: en ligne
|
||||
label_diff_side_by_side: côte à côte
|
||||
label_options: Options
|
||||
label_copy_workflow_from: Copier le workflow de
|
||||
|
||||
button_login: Connexion
|
||||
button_submit: Soumettre
|
||||
|
|
|
@ -354,6 +354,7 @@ label_view_diff: View differences
|
|||
label_diff_inline: inline
|
||||
label_diff_side_by_side: side by side
|
||||
label_options: Options
|
||||
label_copy_workflow_from: Copy workflow from
|
||||
|
||||
button_login: Login
|
||||
button_submit: Invia
|
||||
|
|
|
@ -355,6 +355,7 @@ label_view_diff: 差分を見る
|
|||
label_diff_inline: インライン
|
||||
label_diff_side_by_side: 横に並べる
|
||||
label_options: Options
|
||||
label_copy_workflow_from: Copy workflow from
|
||||
|
||||
button_login: ログイン
|
||||
button_submit: 変更
|
||||
|
|
|
@ -357,6 +357,7 @@ label_view_diff: View differences
|
|||
label_diff_inline: inline
|
||||
label_diff_side_by_side: side by side
|
||||
label_options: Options
|
||||
label_copy_workflow_from: Copy workflow from
|
||||
|
||||
button_login: 登录
|
||||
button_submit: 提交
|
||||
|
|
Loading…
Reference in New Issue