From ffa6c5fe3e1eb67fca0d965ca45a06c56921276d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 16 Jan 2009 17:20:41 +0000 Subject: [PATCH] Adds a 'Create and continue' button on the new issue form, that will create the issue and display the form again (#2523). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2265 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/issues_controller.rb | 3 ++- app/views/issues/new.rhtml | 1 + lang/bg.yml | 1 + lang/ca.yml | 1 + lang/cs.yml | 1 + lang/da.yml | 1 + lang/de.yml | 1 + lang/en.yml | 1 + lang/es.yml | 1 + lang/fi.yml | 1 + lang/fr.yml | 1 + lang/he.yml | 1 + lang/hu.yml | 1 + lang/it.yml | 1 + lang/ja.yml | 1 + lang/ko.yml | 1 + lang/lt.yml | 1 + lang/nl.yml | 1 + lang/no.yml | 1 + lang/pl.yml | 1 + lang/pt-br.yml | 1 + lang/pt.yml | 1 + lang/ro.yml | 1 + lang/ru.yml | 1 + lang/sk.yml | 1 + lang/sr.yml | 1 + lang/sv.yml | 1 + lang/th.yml | 1 + lang/tr.yml | 1 + lang/uk.yml | 1 + lang/vn.yml | 1 + lang/zh-tw.yml | 1 + lang/zh.yml | 1 + test/functional/issues_controller_test.rb | 10 ++++++++++ 34 files changed, 44 insertions(+), 1 deletion(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index a2b659f9..3b7587c1 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -148,7 +148,8 @@ class IssuesController < ApplicationController flash[:notice] = l(:notice_successful_create) Mailer.deliver_issue_add(@issue) if Setting.notified_events.include?('issue_added') call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue}) - redirect_to :controller => 'issues', :action => 'show', :id => @issue + redirect_to(params[:continue] ? { :action => 'new', :tracker_id => @issue.tracker } : + { :action => 'show', :id => @issue }) return end end diff --git a/app/views/issues/new.rhtml b/app/views/issues/new.rhtml index 732a562a..1bae6aba 100644 --- a/app/views/issues/new.rhtml +++ b/app/views/issues/new.rhtml @@ -7,6 +7,7 @@ <%= render :partial => 'issues/form', :locals => {:f => f} %> <%= submit_tag l(:button_create) %> + <%= submit_tag l(:button_create_and_continue), :name => 'continue' %> <%= link_to_remote l(:label_preview), { :url => { :controller => 'issues', :action => 'preview', :project_id => @project }, :method => 'post', diff --git a/lang/bg.yml b/lang/bg.yml index df186904..61f75209 100644 --- a/lang/bg.yml +++ b/lang/bg.yml @@ -698,3 +698,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/ca.yml b/lang/ca.yml index d0d6b827..0ce265f9 100644 --- a/lang/ca.yml +++ b/lang/ca.yml @@ -699,3 +699,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/cs.yml b/lang/cs.yml index 16fde627..534da679 100644 --- a/lang/cs.yml +++ b/lang/cs.yml @@ -703,3 +703,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/da.yml b/lang/da.yml index 8f1049d0..2edbc524 100644 --- a/lang/da.yml +++ b/lang/da.yml @@ -699,3 +699,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/de.yml b/lang/de.yml index 4697aae6..c403b481 100644 --- a/lang/de.yml +++ b/lang/de.yml @@ -700,3 +700,4 @@ enumeration_doc_categories: Dokumentenkategorien enumeration_activities: Aktivitäten (Zeiterfassung) text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/en.yml b/lang/en.yml index 01a7fcee..01ac078c 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -592,6 +592,7 @@ button_check_all: Check all button_uncheck_all: Uncheck all button_delete: Delete button_create: Create +button_create_and_continue: Create and continue button_test: Test button_edit: Edit button_add: Add diff --git a/lang/es.yml b/lang/es.yml index 83c51e6c..1729292e 100644 --- a/lang/es.yml +++ b/lang/es.yml @@ -683,3 +683,4 @@ text_wiki_destroy_confirmation: ¿Seguro que quiere borrar el wiki y todo su con text_workflow_edit: Seleccionar un flujo de trabajo para actualizar text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/fi.yml b/lang/fi.yml index 23633860..244f858e 100644 --- a/lang/fi.yml +++ b/lang/fi.yml @@ -698,3 +698,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/fr.yml b/lang/fr.yml index c3210a55..374a0d86 100644 --- a/lang/fr.yml +++ b/lang/fr.yml @@ -592,6 +592,7 @@ button_check_all: Tout cocher button_uncheck_all: Tout décocher button_delete: Supprimer button_create: Créer +button_create_and_continue: Créer et continuer button_test: Tester button_edit: Modifier button_add: Ajouter diff --git a/lang/he.yml b/lang/he.yml index 617b3acb..b10b7329 100644 --- a/lang/he.yml +++ b/lang/he.yml @@ -698,3 +698,4 @@ setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/hu.yml b/lang/hu.yml index 1768cedb..059b3ee6 100644 --- a/lang/hu.yml +++ b/lang/hu.yml @@ -699,3 +699,4 @@ text_diff_truncated: '... A diff fájl vége nem jelenik meg, mert hosszab, mint setting_diff_max_lines_displayed: A megjelenítendő sorok száma (maximum) a diff fájloknál text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/it.yml b/lang/it.yml index 134096ba..f3798b47 100644 --- a/lang/it.yml +++ b/lang/it.yml @@ -698,3 +698,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/ja.yml b/lang/ja.yml index 2ca1a4e4..c1279b3f 100644 --- a/lang/ja.yml +++ b/lang/ja.yml @@ -699,3 +699,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/ko.yml b/lang/ko.yml index cc072e10..f7958f97 100644 --- a/lang/ko.yml +++ b/lang/ko.yml @@ -698,3 +698,4 @@ text_diff_truncated: '... 이 차이점은 표시할 수 있는 최대 줄수를 setting_diff_max_lines_displayed: 차이점보기에 표시할 최대 줄수 text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/lt.yml b/lang/lt.yml index ef2978e8..3cdbcf09 100644 --- a/lang/lt.yml +++ b/lang/lt.yml @@ -700,3 +700,4 @@ enumeration_doc_categories: Dokumento kategorijos enumeration_activities: Veiklos (laiko sekimas) text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/nl.yml b/lang/nl.yml index bbffbf11..ed10b4db 100644 --- a/lang/nl.yml +++ b/lang/nl.yml @@ -700,3 +700,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/no.yml b/lang/no.yml index 9d0ccc93..c8f131ff 100644 --- a/lang/no.yml +++ b/lang/no.yml @@ -699,3 +699,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/pl.yml b/lang/pl.yml index 9742e19a..6b28f0e0 100644 --- a/lang/pl.yml +++ b/lang/pl.yml @@ -717,3 +717,4 @@ text_diff_truncated: '... Ten plik różnic został przycięty ponieważ jest zb setting_diff_max_lines_displayed: Maksymalna liczba linii różnicy do pokazania text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/pt-br.yml b/lang/pt-br.yml index 90e7e770..ecbbc0ce 100644 --- a/lang/pt-br.yml +++ b/lang/pt-br.yml @@ -699,3 +699,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/pt.yml b/lang/pt.yml index 17cc36b0..ec42386d 100644 --- a/lang/pt.yml +++ b/lang/pt.yml @@ -700,3 +700,4 @@ text_diff_truncated: '... Este diff foi truncado porque excede o tamanho máximo setting_diff_max_lines_displayed: Número máximo de linhas de diff mostradas text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/ro.yml b/lang/ro.yml index 25684ced..b0df48d2 100644 --- a/lang/ro.yml +++ b/lang/ro.yml @@ -698,3 +698,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/ru.yml b/lang/ru.yml index 2a8bd3c6..4943eea0 100644 --- a/lang/ru.yml +++ b/lang/ru.yml @@ -732,3 +732,4 @@ text_workflow_edit: Выберите роль и трекер для редак text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/sk.yml b/lang/sk.yml index f1a96fcc..ffae2d64 100644 --- a/lang/sk.yml +++ b/lang/sk.yml @@ -704,3 +704,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/sr.yml b/lang/sr.yml index dbe5c5ef..7070c4a2 100644 --- a/lang/sr.yml +++ b/lang/sr.yml @@ -699,3 +699,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/sv.yml b/lang/sv.yml index 8cd5cbe1..852c7fe5 100644 --- a/lang/sv.yml +++ b/lang/sv.yml @@ -699,3 +699,4 @@ enumeration_doc_categories: Dokumentkategorier enumeration_activities: Aktiviteter (tidsuppföljning) text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/th.yml b/lang/th.yml index cd3c481c..c0a38592 100644 --- a/lang/th.yml +++ b/lang/th.yml @@ -701,3 +701,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/tr.yml b/lang/tr.yml index d6f32ce3..81363678 100644 --- a/lang/tr.yml +++ b/lang/tr.yml @@ -699,3 +699,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/uk.yml b/lang/uk.yml index 845fdece..be121cb5 100644 --- a/lang/uk.yml +++ b/lang/uk.yml @@ -700,3 +700,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/vn.yml b/lang/vn.yml index 59176772..908e2326 100644 --- a/lang/vn.yml +++ b/lang/vn.yml @@ -701,3 +701,4 @@ text_diff_truncated: '... This diff was truncated because it exceeds the maximum setting_diff_max_lines_displayed: Max number of diff lines displayed text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/zh-tw.yml b/lang/zh-tw.yml index 5679069a..50eccf43 100644 --- a/lang/zh-tw.yml +++ b/lang/zh-tw.yml @@ -700,3 +700,4 @@ enumeration_doc_categories: 文件分類 enumeration_activities: 活動 (時間追蹤) text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/lang/zh.yml b/lang/zh.yml index e1e30d27..989f329c 100644 --- a/lang/zh.yml +++ b/lang/zh.yml @@ -700,3 +700,4 @@ enumeration_doc_categories: 文档类别 enumeration_activities: 活动(时间跟踪) text_plugin_assets_writable: Plugin assets directory writable warning_attachments_not_saved: "%d file(s) could not be saved." +button_create_and_continue: Create and continue diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 14afd68d..093797e3 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -313,6 +313,16 @@ class IssuesControllerTest < Test::Unit::TestCase assert_equal 'Value for field 2', v.value end + def test_post_new_and_continue + @request.session[:user_id] = 2 + post :new, :project_id => 1, + :issue => {:tracker_id => 3, + :subject => 'This is first issue', + :priority_id => 5}, + :continue => '' + assert_redirected_to :controller => 'issues', :action => 'new', :tracker_id => 3 + end + def test_post_new_without_custom_fields_param @request.session[:user_id] = 2 post :new, :project_id => 1,