summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/trackers_controller.rb7
-rw-r--r--app/views/trackers/_form.rhtml3
-rw-r--r--lang/de.yml1
-rw-r--r--lang/en.yml1
-rw-r--r--lang/es.yml1
-rw-r--r--lang/fr.yml1
-rw-r--r--lang/it.yml1
-rw-r--r--lang/ja.yml1
-rw-r--r--lang/zh.yml1
9 files changed, 17 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
diff --git a/app/views/trackers/_form.rhtml b/app/views/trackers/_form.rhtml
index 3dea238d8..26a34443c 100644
--- a/app/views/trackers/_form.rhtml
+++ b/app/views/trackers/_form.rhtml
@@ -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>
diff --git a/lang/de.yml b/lang/de.yml
index a98947d77..39b3ea1f5 100644
--- a/lang/de.yml
+++ b/lang/de.yml
@@ -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
diff --git a/lang/en.yml b/lang/en.yml
index d4c589299..4f0cbe9f0 100644
--- a/lang/en.yml
+++ b/lang/en.yml
@@ -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
diff --git a/lang/es.yml b/lang/es.yml
index aad0b95a0..7b05f3707 100644
--- a/lang/es.yml
+++ b/lang/es.yml
@@ -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
diff --git a/lang/fr.yml b/lang/fr.yml
index 4218ca4f4..564b5fe78 100644
--- a/lang/fr.yml
+++ b/lang/fr.yml
@@ -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
diff --git a/lang/it.yml b/lang/it.yml
index d5c0f43dd..fc2d405a3 100644
--- a/lang/it.yml
+++ b/lang/it.yml
@@ -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
diff --git a/lang/ja.yml b/lang/ja.yml
index 127dbbe51..db4335c38 100644
--- a/lang/ja.yml
+++ b/lang/ja.yml
@@ -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: 変更
diff --git a/lang/zh.yml b/lang/zh.yml
index 1496583fa..a0508d34b 100644
--- a/lang/zh.yml
+++ b/lang/zh.yml
@@ -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: 提交