+<%= submit_tag l(:button_apply) %>
+<% end %>
diff --git a/lang/bg.yml b/lang/bg.yml
index 64fff5ae9..12d5dfa5f 100644
--- a/lang/bg.yml
+++ b/lang/bg.yml
@@ -602,3 +602,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/cs.yml b/lang/cs.yml
index 6de5ee01b..56b77d87b 100644
--- a/lang/cs.yml
+++ b/lang/cs.yml
@@ -602,3 +602,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/de.yml b/lang/de.yml
index f2b1c2023..9397cf892 100644
--- a/lang/de.yml
+++ b/lang/de.yml
@@ -602,3 +602,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/en.yml b/lang/en.yml
index b06977035..7ed2c8775 100644
--- a/lang/en.yml
+++ b/lang/en.yml
@@ -80,6 +80,7 @@ notice_default_data_loaded: Default configuration successfully loaded.
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
error_scm_not_found: "Entry and/or revision doesn't exist in the repository."
error_scm_command_failed: "An error occurred when trying to access the repository: %s"
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
mail_subject_lost_password: Your Redmine password
mail_body_lost_password: 'To change your Redmine password, click on the following link:'
@@ -577,6 +578,10 @@ text_select_project_modules: 'Select modules to enable for this project:'
text_default_administrator_account_changed: Default administrator account changed
text_file_repository_writable: File repository writable
text_rmagick_available: RMagick available (optional)
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+text_destroy_time_entries: Delete reported hours
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
default_role_manager: Manager
default_role_developper: Developer
diff --git a/lang/es.yml b/lang/es.yml
index 9c72af18d..9032d3599 100644
--- a/lang/es.yml
+++ b/lang/es.yml
@@ -605,3 +605,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/fi.yml b/lang/fi.yml
index 350e5ba44..dbcc3763c 100644
--- a/lang/fi.yml
+++ b/lang/fi.yml
@@ -606,3 +606,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/fr.yml b/lang/fr.yml
index c2baa3b7e..accd5c1bf 100644
--- a/lang/fr.yml
+++ b/lang/fr.yml
@@ -80,6 +80,7 @@ notice_default_data_loaded: Paramétrage par défaut chargé avec succès.
error_can_t_load_default_data: "Une erreur s'est produite lors du chargement du paramétrage: %s"
error_scm_not_found: "L'entrée et/ou la révision demandée n'existe pas dans le dépôt."
error_scm_command_failed: "Une erreur s'est produite lors de l'accès au dépôt: %s"
+error_issue_not_found_in_project: "La demande n'existe pas ou n'appartient pas à ce projet"
mail_subject_lost_password: Votre mot de passe redMine
mail_body_lost_password: 'Pour changer votre mot de passe Redmine, cliquez sur le lien suivant:'
@@ -565,7 +566,7 @@ text_issues_ref_in_commit_messages: Référencement et résolution des demandes
text_issue_added: La demande %s a été soumise par %s.
text_issue_updated: La demande %s a été mise à jour par %s.
text_wiki_destroy_confirmation: Etes-vous sûr de vouloir supprimer ce wiki et tout son contenu ?
-text_issue_category_destroy_question: Des demandes (%d) sont affectées à cette catégories. Que voulez-vous faire ?
+text_issue_category_destroy_question: %d demandes sont affectées à cette catégories. Que voulez-vous faire ?
text_issue_category_destroy_assignments: N'affecter les demandes à aucune autre catégorie
text_issue_category_reassign_to: Réaffecter les demandes à cette catégorie
text_user_mail_option: "Pour les projets non sélectionnés, vous recevrez seulement des notifications pour ce que vous surveillez ou à quoi vous participez (exemple: demandes dont vous êtes l'auteur ou la personne assignée)."
@@ -577,6 +578,10 @@ text_select_project_modules: 'Selectionner les modules à activer pour ce projec
text_default_administrator_account_changed: Compte administrateur par défaut changé
text_file_repository_writable: Répertoire de stockage des fichiers accessible en écriture
text_rmagick_available: Bibliothèque RMagick présente (optionnelle)
+text_destroy_time_entries_question: %.02f heures ont été enregistrées sur les demandes à supprimer. Que voulez-vous faire ?
+text_destroy_time_entries: Supprimer les heures
+text_assign_time_entries_to_project: Reporter les heures sur le projet
+text_reassign_time_entries: 'Reporter les heures sur cette demande:'
default_role_manager: Manager
default_role_developper: Développeur
diff --git a/lang/he.yml b/lang/he.yml
index 680364714..a43f1c022 100644
--- a/lang/he.yml
+++ b/lang/he.yml
@@ -602,3 +602,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/it.yml b/lang/it.yml
index b2eb1c9c6..80ffc5f6c 100644
--- a/lang/it.yml
+++ b/lang/it.yml
@@ -602,3 +602,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/ja.yml b/lang/ja.yml
index 2a742072d..d652f4b19 100644
--- a/lang/ja.yml
+++ b/lang/ja.yml
@@ -603,3 +603,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/ko.yml b/lang/ko.yml
index cce1480d8..12fa4b8fb 100644
--- a/lang/ko.yml
+++ b/lang/ko.yml
@@ -602,3 +602,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/lt.yml b/lang/lt.yml
index 7701280a0..5d26c7ea9 100644
--- a/lang/lt.yml
+++ b/lang/lt.yml
@@ -603,3 +603,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/nl.yml b/lang/nl.yml
index a0a5305e4..12563f2e4 100644
--- a/lang/nl.yml
+++ b/lang/nl.yml
@@ -603,3 +603,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/pl.yml b/lang/pl.yml
index 6de13aea4..575c8262a 100644
--- a/lang/pl.yml
+++ b/lang/pl.yml
@@ -602,3 +602,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/pt-br.yml b/lang/pt-br.yml
index 83b640a43..d128617da 100644
--- a/lang/pt-br.yml
+++ b/lang/pt-br.yml
@@ -602,3 +602,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/pt.yml b/lang/pt.yml
index e100d153e..33b76892b 100644
--- a/lang/pt.yml
+++ b/lang/pt.yml
@@ -602,3 +602,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/ro.yml b/lang/ro.yml
index 142a2a84f..b8b737e42 100644
--- a/lang/ro.yml
+++ b/lang/ro.yml
@@ -602,3 +602,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/ru.yml b/lang/ru.yml
index 83e63115f..93fbd3b74 100644
--- a/lang/ru.yml
+++ b/lang/ru.yml
@@ -606,3 +606,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/sr.yml b/lang/sr.yml
index 2cd92607f..16e870b76 100644
--- a/lang/sr.yml
+++ b/lang/sr.yml
@@ -603,3 +603,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/sv.yml b/lang/sv.yml
index a9b30ae2f..3375a6850 100644
--- a/lang/sv.yml
+++ b/lang/sv.yml
@@ -603,3 +603,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/uk.yml b/lang/uk.yml
index 0be41cf04..2fd3589f5 100644
--- a/lang/uk.yml
+++ b/lang/uk.yml
@@ -604,3 +604,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/zh-tw.yml b/lang/zh-tw.yml
index c63e6c3bf..070aa290c 100644
--- a/lang/zh-tw.yml
+++ b/lang/zh-tw.yml
@@ -602,3 +602,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/lang/zh.yml b/lang/zh.yml
index a50d8be48..6b2e64abd 100644
--- a/lang/zh.yml
+++ b/lang/zh.yml
@@ -605,3 +605,8 @@ label_yesterday: yesterday
label_last_month: last month
label_add_another_file: Add another file
label_optional_description: Optional description
+text_destroy_time_entries_question: %.02f hours were reported on the issues you are about to delete. What do you want to do ?
+error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
+text_assign_time_entries_to_project: Assign reported hours to the project
+text_destroy_time_entries: Delete reported hours
+text_reassign_time_entries: 'Reassign reported hours to this issue:'
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 34b030d98..da8118668 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -37,7 +37,8 @@ class IssuesControllerTest < Test::Unit::TestCase
:workflows,
:custom_fields,
:custom_values,
- :custom_fields_trackers
+ :custom_fields_trackers,
+ :time_entries
def setup
@controller = IssuesController.new
@@ -428,13 +429,48 @@ class IssuesControllerTest < Test::Unit::TestCase
:class => 'icon-del disabled' }
end
- def test_destroy
+ def test_destroy_issue_with_no_time_entries
@request.session[:user_id] = 2
- post :destroy, :id => 1
+ post :destroy, :id => 3
assert_redirected_to 'projects/ecookbook/issues'
- assert_nil Issue.find_by_id(1)
+ assert_nil Issue.find_by_id(3)
end
+ def test_destroy_issues_with_time_entries
+ @request.session[:user_id] = 2
+ post :destroy, :ids => [1, 3]
+ assert_response :success
+ assert_template 'destroy'
+ assert_not_nil assigns(:hours)
+ assert Issue.find_by_id(1) && Issue.find_by_id(3)
+ end
+
+ def test_destroy_issues_and_destroy_time_entries
+ @request.session[:user_id] = 2
+ post :destroy, :ids => [1, 3], :todo => 'destroy'
+ assert_redirected_to 'projects/ecookbook/issues'
+ assert !(Issue.find_by_id(1) || Issue.find_by_id(3))
+ assert_nil TimeEntry.find_by_id([1, 2])
+ end
+
+ def test_destroy_issues_and_assign_time_entries_to_project
+ @request.session[:user_id] = 2
+ post :destroy, :ids => [1, 3], :todo => 'nullify'
+ assert_redirected_to 'projects/ecookbook/issues'
+ assert !(Issue.find_by_id(1) || Issue.find_by_id(3))
+ assert_nil TimeEntry.find(1).issue_id
+ assert_nil TimeEntry.find(2).issue_id
+ end
+
+ def test_destroy_issues_and_reassign_time_entries_to_another_issue
+ @request.session[:user_id] = 2
+ post :destroy, :ids => [1, 3], :todo => 'reassign', :reassign_to_id => 2
+ assert_redirected_to 'projects/ecookbook/issues'
+ assert !(Issue.find_by_id(1) || Issue.find_by_id(3))
+ assert_equal 2, TimeEntry.find(1).issue_id
+ assert_equal 2, TimeEntry.find(2).issue_id
+ end
+
def test_destroy_attachment
issue = Issue.find(3)
a = issue.attachments.size
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index da91dd02c..7712b764e 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -70,4 +70,10 @@ class IssueTest < Test::Unit::TestCase
# Make sure time entries were move to the target project
assert_equal 2, issue.time_entries.first.project_id
end
+
+ def test_issue_destroy
+ Issue.find(1).destroy
+ assert_nil Issue.find_by_id(1)
+ assert_nil TimeEntry.find_by_issue_id(1)
+ end
end