]> source.dussan.org Git - redmine.git/commitdiff
Warn about subtasks before deleting a parent issue (#6562).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 17 Apr 2011 15:17:18 +0000 (15:17 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 17 Apr 2011 15:17:18 +0000 (15:17 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5495 e93f8b46-1217-0410-a6f0-8f06a7374b81

49 files changed:
app/controllers/context_menus_controller.rb
app/helpers/issues_helper.rb
app/views/context_menus/issues.html.erb
app/views/issues/_action_menu.rhtml
config/locales/bg.yml
config/locales/bs.yml
config/locales/ca.yml
config/locales/cs.yml
config/locales/da.yml
config/locales/de.yml
config/locales/el.yml
config/locales/en-GB.yml
config/locales/en.yml
config/locales/es.yml
config/locales/eu.yml
config/locales/fa.yml
config/locales/fi.yml
config/locales/fr.yml
config/locales/gl.yml
config/locales/he.yml
config/locales/hr.yml
config/locales/hu.yml
config/locales/id.yml
config/locales/it.yml
config/locales/ja.yml
config/locales/ko.yml
config/locales/lt.yml
config/locales/lv.yml
config/locales/mk.yml
config/locales/mn.yml
config/locales/nl.yml
config/locales/no.yml
config/locales/pl.yml
config/locales/pt-BR.yml
config/locales/pt.yml
config/locales/ro.yml
config/locales/ru.yml
config/locales/sk.yml
config/locales/sl.yml
config/locales/sr-YU.yml
config/locales/sr.yml
config/locales/sv.yml
config/locales/th.yml
config/locales/tr.yml
config/locales/uk.yml
config/locales/vi.yml
config/locales/zh-TW.yml
config/locales/zh.yml
test/unit/helpers/issues_helper_test.rb

index f2ff7020e41f5febb0839a77d0b3e0a359fc3001..4d69f4f04bea0ee9d59c2f4eed23b90fb53a7c01 100644 (file)
@@ -1,5 +1,6 @@
 class ContextMenusController < ApplicationController
   helper :watchers
+  helper :issues
   
   def issues
     @issues = Issue.visible.all(:conditions => {:id => params[:ids]}, :include => :project)
index 86f11c706db1e0558d05df8015938375bf5d8693..078fca65661bea440a818d7529d3c6eba40239a4 100644 (file)
@@ -109,6 +109,24 @@ module IssuesHelper
     s
   end
   
+  def issues_destroy_confirmation_message(issues)
+    issues = [issues] unless issues.is_a?(Array)
+    message = l(:text_issues_destroy_confirmation)
+    descendant_count = issues.inject(0) {|memo, i| memo += (i.right - i.left - 1)/2}
+    if descendant_count > 0
+      issues.each do |issue|
+        next if issue.root?
+        issues.each do |other_issue|
+          descendant_count -= 1 if issue.is_descendant_of?(other_issue)
+        end
+      end
+      if descendant_count > 0
+        message << "\n" + l(:text_issues_destroy_descendants_confirmation, :count => descendant_count)
+      end
+    end
+    message
+  end
+  
   def sidebar_queries
     unless @sidebar_queries
       # User can see public queries and his own queries
index f0fa350ac9066cc43ab5ae3fcea6d46762491c13..7b67c65c7eb2f719f1ba5dc9c2e7d9bf1794b853 100644 (file)
   <li><%= context_menu_link l(:button_move), new_issue_move_path(:ids => @issues.collect(&:id)),
                                :class => 'icon-move', :disabled => !@can[:move]  %></li>
   <li><%= context_menu_link l(:button_delete), {:controller => 'issues', :action => 'destroy', :ids => @issues.collect(&:id), :back_url => @back},
-                            :method => :post, :confirm => l(:text_issues_destroy_confirmation), :class => 'icon-del', :disabled => !@can[:delete] %></li>
+                            :method => :post, :confirm => issues_destroy_confirmation_message(@issues), :class => 'icon-del', :disabled => !@can[:delete] %></li>
 
   <%= call_hook(:view_issues_context_menu_end, {:issues => @issues, :can => @can, :back => @back }) %>
 </ul>
index 67eec6c7828ee604b167ef408d177f9fcb9bc652..02357751f7630b85f00d13dcfd8d06388fd4dbbb 100644 (file)
@@ -5,5 +5,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), {:controller => 'issue_moves', :action => 'new', :id => @issue, :copy_options => {:copy => 't'}}, :class => 'icon icon-copy' %>
 <%= link_to_if_authorized l(:button_move), {:controller => 'issue_moves', :action => 'new', :id => @issue}, :class => 'icon icon-move' %>
-<%= 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' %>
+<%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => issues_destroy_confirmation_message(@issue), :method => :post, :class => 'icon icon-del' %>
 </div>
index 1bbf8bd36b672161df57614adfdbde36db59e89d..821d594366c3a0d408ec713a6f178deccf881a1f 100644 (file)
@@ -960,3 +960,4 @@ bg:
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
 
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index e55019e982f5106f94e15409296a1eeda41f9d5c..4948d97a9c7a2522a3581dde17e1856d6b7058ee 100644 (file)
@@ -973,3 +973,4 @@ bs:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index d73b5846b8c34fd067b6bbfd496407e22ae8b65a..7157e4c5158b1ec5ff91b1b54b3afd42f362b8b2 100644 (file)
@@ -962,3 +962,4 @@ ca:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 19d79b70faf94f76576fdec4e1916feb333c845a..b80f590f22ff882982b9b8112db355130ba76266 100644 (file)
@@ -963,3 +963,4 @@ cs:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 2837d9937ad9b3daf00d3497356bd70f4c214453..cde883970ed9d177ab7ac3a20ada13e16c128815 100644 (file)
@@ -975,3 +975,4 @@ da:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 4b8777b74a754730b10ad5cf65e7fe0117d5e6ec..aae1495b80651264f64bb1ed96b3008cf466a96d 100644 (file)
@@ -976,3 +976,4 @@ de:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 9a1011481dcee368651525a910c24a129d038f55..a65cefbc44d8b40e5cfed64656bae25555d16a14 100644 (file)
@@ -959,3 +959,4 @@ el:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index f61d7f37222077676f773172994302db8303919e..7c11f7ebd36e35a461f4d0f4680f5e7b29805c2b 100644 (file)
@@ -962,3 +962,4 @@ en-GB:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 82c568f79690f2c10099fcc94874d8dc93855597..f5a3ffab11bb6ca2aa941e1eb3775e7f665042fa 100644 (file)
@@ -906,6 +906,7 @@ en:
   text_status_changed_by_changeset: "Applied in changeset %{value}."
   text_time_logged_by_changeset: "Applied in changeset %{value}."
   text_issues_destroy_confirmation: 'Are you sure you want to delete the selected issue(s)?'
+  text_issues_destroy_descendants_confirmation: "This will also delete %{count} subtask(s)."
   text_time_entries_destroy_confirmation: 'Are you sure you want to delete the selected time entr(y/ies)?'
   text_select_project_modules: 'Select modules to enable for this project:'
   text_default_administrator_account_changed: Default administrator account changed
index 381ff823493fd64f59bc2756f7a0d8ba94406ac5..924adfe50849a7291480a3949d8a16fc50bad8ba 100644 (file)
@@ -996,3 +996,4 @@ es:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 79028100c0ee01ce979054f5e305b58225cd6457..b35f02edbf68bb4da96df6840195c551741d0f81 100644 (file)
@@ -963,3 +963,4 @@ eu:
   field_is_private: Private\r
   permission_set_issues_private: Set issues public or private\r
   label_issues_visibility_public: All non private issues\r
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).\r
index 3ac9c72074abb23bd2425879c25556d78d50412e..477eebec9c3f897e1ab0dfb829668e2d56e4f9ff 100644 (file)
@@ -962,3 +962,4 @@ fa:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 08714a3ff8d81a84cf10dd9b2351afefb60951c2..78d43fdb170f49795bb408bc81ff8de7958751ec 100644 (file)
@@ -980,3 +980,4 @@ fi:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 7d799af81bd34c11845f52fdfc584fdb358957c3..687ce4b2caea8428666dddecba7cae5e174a8379 100644 (file)
@@ -883,7 +883,8 @@ fr:
   text_load_default_configuration: Charger le paramétrage par défaut
   text_status_changed_by_changeset: "Appliqué par commit %{value}."
   text_time_logged_by_changeset: "Appliqué par commit %{value}"
-  text_issues_destroy_confirmation: 'Êtes-vous sûr de vouloir supprimer le(s) demandes(s) selectionnée(s) ?'
+  text_issues_destroy_confirmation: 'Êtes-vous sûr de vouloir supprimer la ou les demandes(s) selectionnée(s) ?'
+  text_issues_destroy_descendants_confirmation: "Cela entrainera également la suppression de %{count} sous-tâche(s)."
   text_select_project_modules: 'Sélectionner les modules à activer pour ce projet :'
   text_default_administrator_account_changed: Compte administrateur par défaut changé
   text_file_repository_writable: Répertoire de stockage des fichiers accessible en écriture
index 4e75255ccaff6ef9eeaeb5314dbe95e48f73e533..95a6885fb08cebdddf60daf1b3886ebb9c1bcae7 100644 (file)
@@ -971,3 +971,4 @@ gl:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index a0416d291b5c10ebc7da4be55aaa0a3feafcf5fc..0f57e3ff6eb41bcf5cab1d0e3c02f0b475d03de9 100644 (file)
@@ -964,3 +964,4 @@ he:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 840a8f8a2b1d6fb3adad7008caeea8795d0e9a76..7dffacf1344debf1e87b9314545c9a92cfc95010 100644 (file)
@@ -966,3 +966,4 @@ hr:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 6232ce7dd498c661fb23042ab071429548230683..94e01d8de9b6614679a607f5b18893f835927569 100644 (file)
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index e6694b9bbba0d9da64c7fa1a47dc41d903c559d0..e362881f8ecefb8170ed3197f9a95342c319d8b5 100644 (file)
@@ -967,3 +967,4 @@ id:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index a3b724346fa6453127f531365fd384e852ae8c4c..0b164f66ba3ea67e086d7b8eb9a4deab132de065 100644 (file)
@@ -960,3 +960,4 @@ it:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 1e64fff94a5cbe3d458152bbb71684205fa4e46d..167d33613c4f816b72d32a251f948d55d5bdf669 100644 (file)
@@ -982,3 +982,4 @@ ja:
   field_is_private: プライベート
   permission_set_issues_private: チケットをプライベートに設定
   label_issues_visibility_public: プライベートチケット以外
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 0c205da9ae8b57c223d00338a7e1472e1820d9df..342022e94f8f4c083c54e12548e145b71c40aab8 100644 (file)
@@ -1011,3 +1011,4 @@ ko:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index a832d7045e89913201f0503c8657d173865b8b36..225bda2600aa3c7e25f50a74223501e11aae86e3 100644 (file)
@@ -1019,3 +1019,4 @@ lt:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 2089e715da58721b629f9301b1cbfb5844b0f371..124a15d192aa1603ef0c88cde79415488b5702be 100644 (file)
@@ -954,3 +954,4 @@ lv:
   field_is_private: Private\r
   permission_set_issues_private: Set issues public or private\r
   label_issues_visibility_public: All non private issues\r
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).\r
index 68168980609236baa148af91b36e8bc24be77f79..f9e09599b2166fa150580dc46103e23d1967ad2d 100644 (file)
@@ -959,3 +959,4 @@ mk:
   field_is_private: Private\r
   permission_set_issues_private: Set issues public or private\r
   label_issues_visibility_public: All non private issues\r
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).\r
index 7b29054cba651ba0e0dfc852b14ae65105657160..d79a248614af67be21768c12fc0c91682e2acf65 100644 (file)
@@ -960,3 +960,4 @@ mn:
   field_is_private: Private\r
   permission_set_issues_private: Set issues public or private\r
   label_issues_visibility_public: All non private issues\r
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).\r
index 2a4d63798050d19b1dcc92950dd1d0078123231a..4243701ef0d320ea18f68c0491baad12a2fdc8e7 100644 (file)
@@ -941,3 +941,4 @@ nl:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 7a0a17beb1b5a3d89b821c4d8e0dbe7f45d69c2e..273de20a99279e137c773d21e15e20bbfe405b89 100644 (file)
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 734768d4a85738ccc1d3248cc559af1ff8e6b9a2..64fc4465b1e39588ff2c2d2d0c033ce995321a6e 100644 (file)
@@ -976,3 +976,4 @@ pl:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index e0e27b485a3bf9e6fb6e8a1b0b488da3d6d8e3cc..4b902025cfa2b0996264aec939c0194470361e5e 100644 (file)
@@ -979,3 +979,4 @@ pt-BR:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 9916bcbfba9f20123c70a8aa02dacf69d687171b..de5a7557d3797486659359374c6057739022cef1 100644 (file)
@@ -964,3 +964,4 @@ pt:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 37ac673016b711f049d979b562f9e3cac43062b6..8a9062c46d90bd762970198bcbe7020bd20c4ebc 100644 (file)
@@ -952,3 +952,4 @@ ro:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 3395bbef91d365c4b04c8d53923658abaddc57ce..c56cc37b6f4dd789e6a92e3dcf621ae0567ab4da 100644 (file)
@@ -1072,3 +1072,4 @@ ru:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 41fc93861a7f446692078ea327986c27c8f3bd4d..1f00bb3e416fb8e277befd9d111b70575198b487 100644 (file)
@@ -954,3 +954,4 @@ sk:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 653a060657d6a033388192d3d8265f99198555db..5f8669c147927e5056daaf84a35a18f8ada9bb5e 100644 (file)
@@ -955,3 +955,4 @@ sl:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 3c9f2e174ef80c1e8ba0331f1f59f0b2381f49f4..71f919a337c99fe0c0fea8094b423db757313e4e 100644 (file)
@@ -959,3 +959,4 @@ sr-YU:
   field_is_private: Private\r
   permission_set_issues_private: Set issues public or private\r
   label_issues_visibility_public: All non private issues\r
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).\r
index 42bef34b4047b646683f857e02dd0466930e8201..b069f0e8fa6bca557617357102822dd91e2a2747 100644 (file)
@@ -960,3 +960,4 @@ sr:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 8be2c236785f0edaf8f6ecfc2f6c14f5334cc6c8..aace0e8cb293bb3b0e72fb461a53b828f258c95a 100644 (file)
@@ -1000,3 +1000,4 @@ sv:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 6b1afc7cb35e55d9f51f98e00e49d698aacd3453..8a9ddc868448a8e98682ce8eb2368f5955a0bfe9 100644 (file)
@@ -956,3 +956,4 @@ th:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 8ba316fb30bf6f6771c60f820e599aa62e3d3390..c5646f92da2173b31cbcfb2225f319c0d23a7ad5 100644 (file)
@@ -978,3 +978,4 @@ tr:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index a3c373f7834bada846c35d19d94a70504a2631ae..50b506430061f92a351af5e4c775878a8eb80fcb 100644 (file)
@@ -955,3 +955,4 @@ uk:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 2d9f6ca5298933ddb4ef09d35f3a5052fa3ffe1e..188b3e9e415eee6698a8088b264c15917643f301 100644 (file)
@@ -1010,3 +1010,4 @@ vi:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index cd6f208cc61d6f1ca814f5d72723227c2b6ddd9f..b2220e653596b245a46fe7c83f9dfb08ecb862ef 100644 (file)
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index 14e0fa907f148e65d875d5d3bbcb07dbae95e6cf..4b086265e85090324b7e5e565e8a396f559f3cca 100644 (file)
@@ -973,3 +973,4 @@ zh:
   field_is_private: Private
   permission_set_issues_private: Set issues public or private
   label_issues_visibility_public: All non private issues
+  text_issues_destroy_descendants_confirmation: This will also delete %{count} subtask(s).
index dcb1aed85a16e079d547ff871b3ec01cecbcdc69..7a40abe0871ceeaa617bd3ed6aab29da8a618e0e 100644 (file)
@@ -47,6 +47,25 @@ class IssuesHelperTest < HelperTestCase
   def test_issue_heading
     assert_equal "Bug #1", issue_heading(Issue.find(1))
   end
+  
+  def test_issues_destroy_confirmation_message_with_one_root_issue
+    assert_equal l(:text_issues_destroy_confirmation), issues_destroy_confirmation_message(Issue.find(1))
+  end
+  
+  def test_issues_destroy_confirmation_message_with_an_arrayt_of_root_issues
+    assert_equal l(:text_issues_destroy_confirmation), issues_destroy_confirmation_message(Issue.find([1, 2]))
+  end
+  
+  def test_issues_destroy_confirmation_message_with_one_parent_issue
+    Issue.find(2).update_attribute :parent_issue_id, 1
+    assert_equal l(:text_issues_destroy_confirmation) + "\n" + l(:text_issues_destroy_descendants_confirmation, :count => 1),
+      issues_destroy_confirmation_message(Issue.find(1))
+  end
+  
+  def test_issues_destroy_confirmation_message_with_one_parent_issue_and_its_child
+    Issue.find(2).update_attribute :parent_issue_id, 1
+    assert_equal l(:text_issues_destroy_confirmation), issues_destroy_confirmation_message(Issue.find([1, 2]))
+  end
 
   context "IssuesHelper#show_detail" do
     context "with no_html" do