From f62a1827f33f9d3d2fa5e990a9f6c9475d4bdc71 Mon Sep 17 00:00:00 2001
From: Eric Davis <edavis@littlestreamsoftware.com>
Date: Mon, 20 Sep 2010 02:55:26 +0000
Subject: [PATCH] Updated issue delete confirmation when it has child issues.
 #6191

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4105 e93f8b46-1217-0410-a6f0-8f06a7374b81
---
 app/models/issue.rb                 | 5 +++++
 app/views/issues/_action_menu.rhtml | 2 +-
 config/locales/bg.yml               | 1 +
 config/locales/bs.yml               | 1 +
 config/locales/ca.yml               | 1 +
 config/locales/cs.yml               | 1 +
 config/locales/da.yml               | 1 +
 config/locales/de.yml               | 1 +
 config/locales/el.yml               | 1 +
 config/locales/en-GB.yml            | 1 +
 config/locales/en.yml               | 1 +
 config/locales/es.yml               | 1 +
 config/locales/eu.yml               | 1 +
 config/locales/fi.yml               | 1 +
 config/locales/fr.yml               | 1 +
 config/locales/gl.yml               | 1 +
 config/locales/he.yml               | 1 +
 config/locales/hr.yml               | 1 +
 config/locales/hu.yml               | 1 +
 config/locales/id.yml               | 1 +
 config/locales/it.yml               | 1 +
 config/locales/ja.yml               | 1 +
 config/locales/ko.yml               | 1 +
 config/locales/lt.yml               | 1 +
 config/locales/lv.yml               | 1 +
 config/locales/mk.yml               | 1 +
 config/locales/mn.yml               | 1 +
 config/locales/nl.yml               | 1 +
 config/locales/no.yml               | 1 +
 config/locales/pl.yml               | 1 +
 config/locales/pt-BR.yml            | 1 +
 config/locales/pt.yml               | 1 +
 config/locales/ro.yml               | 1 +
 config/locales/ru.yml               | 1 +
 config/locales/sk.yml               | 1 +
 config/locales/sl.yml               | 1 +
 config/locales/sr-YU.yml            | 1 +
 config/locales/sr.yml               | 1 +
 config/locales/sv.yml               | 1 +
 config/locales/th.yml               | 1 +
 config/locales/tr.yml               | 1 +
 config/locales/uk.yml               | 1 +
 config/locales/vi.yml               | 1 +
 config/locales/zh-TW.yml            | 1 +
 config/locales/zh.yml               | 1 +
 45 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/app/models/issue.rb b/app/models/issue.rb
index 2b7362589..c49952306 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -382,6 +382,11 @@ class Issue < ActiveRecord::Base
     done_date = start_date + ((due_date - start_date+1)* done_ratio/100).floor
     return done_date <= Date.today
   end
+
+  # Does this issue have children?
+  def children?
+    !leaf?
+  end
   
   # Users the issue can be assigned to
   def assignable_users
diff --git a/app/views/issues/_action_menu.rhtml b/app/views/issues/_action_menu.rhtml
index c5d17511a..30c63ec66 100644
--- a/app/views/issues/_action_menu.rhtml
+++ b/app/views/issues/_action_menu.rhtml
@@ -6,5 +6,5 @@
 <%= link_to_if_authorized l(:button_duplicate), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue }, :class => 'icon icon-duplicate' %>
 <%= link_to_if_authorized l(:button_copy), new_issue_move_path(:id => @issue, :copy_options => {:copy => 't'}), :class => 'icon icon-copy' %>
 <%= link_to_if_authorized l(:button_move), new_issue_move_path(:id => @issue), :class => 'icon icon-move' %>
-<%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
+<%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => (@issue.leaf? ? l(:text_are_you_sure) : l(:text_are_you_sure_with_children)), :method => :post, :class => 'icon icon-del' %>
 </div>
diff --git a/config/locales/bg.yml b/config/locales/bg.yml
index ceee5c3cf..e99da7062 100644
--- a/config/locales/bg.yml
+++ b/config/locales/bg.yml
@@ -910,3 +910,4 @@ bg:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/bs.yml b/config/locales/bs.yml
index b855be9e9..bef17900e 100644
--- a/config/locales/bs.yml
+++ b/config/locales/bs.yml
@@ -930,3 +930,4 @@ bs:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/ca.yml b/config/locales/ca.yml
index 6ba0a8bea..38092a2a7 100644
--- a/config/locales/ca.yml
+++ b/config/locales/ca.yml
@@ -919,3 +919,4 @@ ca:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/cs.yml b/config/locales/cs.yml
index 71591fa46..d3cdae5ef 100644
--- a/config/locales/cs.yml
+++ b/config/locales/cs.yml
@@ -916,3 +916,4 @@ cs:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/da.yml b/config/locales/da.yml
index b6270f0d1..25d288336 100644
--- a/config/locales/da.yml
+++ b/config/locales/da.yml
@@ -932,3 +932,4 @@ da:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/de.yml b/config/locales/de.yml
index 3a5ee094e..f9847c3f5 100644
--- a/config/locales/de.yml
+++ b/config/locales/de.yml
@@ -935,3 +935,4 @@ de:
 
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/el.yml b/config/locales/el.yml
index d0608e851..2b6e3493d 100644
--- a/config/locales/el.yml
+++ b/config/locales/el.yml
@@ -916,3 +916,4 @@ el:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml
index c0b520dfd..4f5aec111 100644
--- a/config/locales/en-GB.yml
+++ b/config/locales/en-GB.yml
@@ -920,3 +920,4 @@ en-GB:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 81a26c82c..2930d8079 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -838,6 +838,7 @@ en:
   text_subprojects_destroy_warning: "Its subproject(s): {{value}} will be also deleted."
   text_workflow_edit: Select a role and a tracker to edit the workflow
   text_are_you_sure: Are you sure ?
+  text_are_you_sure_with_children: "Delete issue and all child issues?"
   text_journal_changed: "{{label}} changed from {{old}} to {{new}}"
   text_journal_set_to: "{{label}} set to {{value}}"
   text_journal_deleted: "{{label}} deleted ({{old}})"
diff --git a/config/locales/es.yml b/config/locales/es.yml
index 1828558bf..18d56ae3e 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -956,3 +956,4 @@ es:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/eu.yml b/config/locales/eu.yml
index 64881fe6f..983fe1482 100644
--- a/config/locales/eu.yml
+++ b/config/locales/eu.yml
@@ -920,3 +920,4 @@ eu:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/fi.yml b/config/locales/fi.yml
index 8b56c94da..ea14a5c0d 100644
--- a/config/locales/fi.yml
+++ b/config/locales/fi.yml
@@ -941,3 +941,4 @@ fi:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index 0a1ee46ea..0654ee736 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -934,3 +934,4 @@ fr:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Modifier la page de Wiki associée: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/gl.yml b/config/locales/gl.yml
index b5345de69..5360095f6 100644
--- a/config/locales/gl.yml
+++ b/config/locales/gl.yml
@@ -932,3 +932,4 @@ gl:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/he.yml b/config/locales/he.yml
index 8c55b2351..0129eff88 100644
--- a/config/locales/he.yml
+++ b/config/locales/he.yml
@@ -921,3 +921,4 @@ he:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/hr.yml b/config/locales/hr.yml
index 77cda672a..9219ac660 100644
--- a/config/locales/hr.yml
+++ b/config/locales/hr.yml
@@ -923,3 +923,4 @@ hr:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/hu.yml b/config/locales/hu.yml
index 84e714a6b..e099cb9bc 100644
--- a/config/locales/hu.yml
+++ b/config/locales/hu.yml
@@ -939,3 +939,4 @@
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/id.yml b/config/locales/id.yml
index ca6444b0c..185d4f21d 100644
--- a/config/locales/id.yml
+++ b/config/locales/id.yml
@@ -924,3 +924,4 @@ id:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/it.yml b/config/locales/it.yml
index 6bd4096a9..be0da6a48 100644
--- a/config/locales/it.yml
+++ b/config/locales/it.yml
@@ -920,3 +920,4 @@ it:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/ja.yml b/config/locales/ja.yml
index fa3346f17..2ea6b009f 100644
--- a/config/locales/ja.yml
+++ b/config/locales/ja.yml
@@ -941,3 +941,4 @@ ja:
   enumeration_activities: 作業分類 (時間トラッキング)
   enumeration_system_activity: システム作業分類
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/ko.yml b/config/locales/ko.yml
index 771f91cef..e4dc36fb6 100644
--- a/config/locales/ko.yml
+++ b/config/locales/ko.yml
@@ -972,3 +972,4 @@ ko:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/lt.yml b/config/locales/lt.yml
index 27c5466fd..40e58b980 100644
--- a/config/locales/lt.yml
+++ b/config/locales/lt.yml
@@ -980,3 +980,4 @@ lt:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/lv.yml b/config/locales/lv.yml
index 5a628e5c5..6162f60ef 100644
--- a/config/locales/lv.yml
+++ b/config/locales/lv.yml
@@ -911,3 +911,4 @@ lv:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/mk.yml b/config/locales/mk.yml
index ac2a043d4..fb2f78d29 100644
--- a/config/locales/mk.yml
+++ b/config/locales/mk.yml
@@ -916,3 +916,4 @@ mk:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/mn.yml b/config/locales/mn.yml
index 908e8a844..5358657eb 100644
--- a/config/locales/mn.yml
+++ b/config/locales/mn.yml
@@ -917,3 +917,4 @@ mn:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/nl.yml b/config/locales/nl.yml
index b5933d222..071b3919e 100644
--- a/config/locales/nl.yml
+++ b/config/locales/nl.yml
@@ -898,3 +898,4 @@ nl:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/no.yml b/config/locales/no.yml
index 24be1a06e..4b76683fc 100644
--- a/config/locales/no.yml
+++ b/config/locales/no.yml
@@ -907,3 +907,4 @@
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/pl.yml b/config/locales/pl.yml
index aade4af0e..b56fd71eb 100644
--- a/config/locales/pl.yml
+++ b/config/locales/pl.yml
@@ -937,3 +937,4 @@ pl:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml
index 7fa9ae2f5..ee1aefac5 100644
--- a/config/locales/pt-BR.yml
+++ b/config/locales/pt-BR.yml
@@ -940,3 +940,4 @@ pt-BR:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/pt.yml b/config/locales/pt.yml
index 9a7547ab4..cb336e25a 100644
--- a/config/locales/pt.yml
+++ b/config/locales/pt.yml
@@ -924,3 +924,4 @@ pt:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/ro.yml b/config/locales/ro.yml
index aac64cc2b..2e8f7a1ca 100644
--- a/config/locales/ro.yml
+++ b/config/locales/ro.yml
@@ -909,3 +909,4 @@ ro:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/ru.yml b/config/locales/ru.yml
index 827ed52ee..08e1acb95 100644
--- a/config/locales/ru.yml
+++ b/config/locales/ru.yml
@@ -1033,3 +1033,4 @@ ru:
   notice_unable_delete_time_entry: Невозможно удалить запись журнала.
   label_overall_spent_time: Всего затрачено времени
 
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/sk.yml b/config/locales/sk.yml
index 87c50e27a..37c5ea6b1 100644
--- a/config/locales/sk.yml
+++ b/config/locales/sk.yml
@@ -911,3 +911,4 @@ sk:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/sl.yml b/config/locales/sl.yml
index 3b579a824..6732ef98d 100644
--- a/config/locales/sl.yml
+++ b/config/locales/sl.yml
@@ -912,3 +912,4 @@ sl:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/sr-YU.yml b/config/locales/sr-YU.yml
index b48e90223..d73fd0340 100644
--- a/config/locales/sr-YU.yml
+++ b/config/locales/sr-YU.yml
@@ -916,3 +916,4 @@ sr-YU:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/sr.yml b/config/locales/sr.yml
index 8282a37bf..1b6a8d334 100644
--- a/config/locales/sr.yml
+++ b/config/locales/sr.yml
@@ -917,3 +917,4 @@ sr:
   field_assigned_to_role: Member of Role
 
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/sv.yml b/config/locales/sv.yml
index 28ce75e21..439f9c7cd 100644
--- a/config/locales/sv.yml
+++ b/config/locales/sv.yml
@@ -961,3 +961,4 @@ sv:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/th.yml b/config/locales/th.yml
index 859cf0f08..bc936f709 100644
--- a/config/locales/th.yml
+++ b/config/locales/th.yml
@@ -913,3 +913,4 @@ th:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/tr.yml b/config/locales/tr.yml
index 9244d983d..4b0e6022c 100644
--- a/config/locales/tr.yml
+++ b/config/locales/tr.yml
@@ -939,3 +939,4 @@ tr:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/uk.yml b/config/locales/uk.yml
index eade7c4a2..146454da4 100644
--- a/config/locales/uk.yml
+++ b/config/locales/uk.yml
@@ -912,3 +912,4 @@ uk:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/vi.yml b/config/locales/vi.yml
index 94fbad869..8cf978d09 100644
--- a/config/locales/vi.yml
+++ b/config/locales/vi.yml
@@ -971,3 +971,4 @@ vi:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml
index 3cfa4248a..38efcfa9d 100644
--- a/config/locales/zh-TW.yml
+++ b/config/locales/zh-TW.yml
@@ -1002,3 +1002,4 @@
   enumeration_activities: 活動 (時間追蹤)
   enumeration_system_activity: 系統活動
 
+  text_are_you_sure_with_children: Delete issue and all child issues?
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 3b788860d..a7611bf1d 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -934,3 +934,4 @@ zh:
   field_member_of_group: Member of Group
   field_assigned_to_role: Member of Role
   button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
+  text_are_you_sure_with_children: Delete issue and all child issues?
-- 
GitLab