summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-09-20 02:55:26 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-09-20 02:55:26 +0000
commitf62a1827f33f9d3d2fa5e990a9f6c9475d4bdc71 (patch)
tree24f17954ed114c119811644e0842636fb8d2c63d /app
parent1809eefe4cd10b47c72bac3bed0c336ac0db206b (diff)
downloadredmine-f62a1827f33f9d3d2fa5e990a9f6c9475d4bdc71.tar.gz
redmine-f62a1827f33f9d3d2fa5e990a9f6c9475d4bdc71.zip
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
Diffstat (limited to 'app')
-rw-r--r--app/models/issue.rb5
-rw-r--r--app/views/issues/_action_menu.rhtml2
2 files changed, 6 insertions, 1 deletions
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>