summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-10 09:10:51 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-10 09:10:51 +0000
commit52a7fa6176c8248033b4734773e15dd8b60b2f20 (patch)
tree48ad634039fb55622a2ebbe63f005baf5c2b5cb1 /app
parenta1ae0aed238d3b49af69c895ac72f9b39684f980 (diff)
downloadredmine-52a7fa6176c8248033b4734773e15dd8b60b2f20.tar.gz
redmine-52a7fa6176c8248033b4734773e15dd8b60b2f20.zip
Changed IssuesController#destroy to DELETE only.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8150 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/issues_controller.rb5
-rw-r--r--app/views/context_menus/issues.html.erb4
-rw-r--r--app/views/issues/_action_menu.html.erb2
3 files changed, 4 insertions, 7 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 7978bc001..3ce25a134 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -54,10 +54,6 @@ class IssuesController < ApplicationController
helper :gantt
include Redmine::Export::PDF
- verify :method => [:post, :delete],
- :only => :destroy,
- :render => { :nothing => true, :status => :method_not_allowed }
-
verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed }
verify :method => :post, :only => :bulk_update, :render => {:nothing => true, :status => :method_not_allowed }
verify :method => :put, :only => :update, :render => {:nothing => true, :status => :method_not_allowed }
@@ -225,6 +221,7 @@ class IssuesController < ApplicationController
redirect_back_or_default({:controller => 'issues', :action => 'index', :project_id => @project})
end
+ verify :method => :delete, :only => :destroy, :render => { :nothing => true, :status => :method_not_allowed }
def destroy
@hours = TimeEntry.sum(:hours, :conditions => ['issue_id IN (?)', @issues]).to_f
if @hours > 0
diff --git a/app/views/context_menus/issues.html.erb b/app/views/context_menus/issues.html.erb
index b4db0a1af..3e210814d 100644
--- a/app/views/context_menus/issues.html.erb
+++ b/app/views/context_menus/issues.html.erb
@@ -114,8 +114,8 @@
:class => 'icon-copy', :disabled => !@can[:move] %></li>
<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 => issues_destroy_confirmation_message(@issues), :class => 'icon-del', :disabled => !@can[:delete] %></li>
+ <li><%= context_menu_link l(:button_delete), issues_path(:ids => @issues.collect(&:id), :back_url => @back),
+ :method => :delete, :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>
diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb
index 02357751f..acbeb3617 100644
--- a/app/views/issues/_action_menu.html.erb
+++ b/app/views/issues/_action_menu.html.erb
@@ -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 => issues_destroy_confirmation_message(@issue), :method => :post, :class => 'icon icon-del' %>
+<%= link_to l(:button_delete), issue_path(@issue), :confirm => issues_destroy_confirmation_message(@issue), :method => :delete, :class => 'icon icon-del' if User.current.allowed_to?(:delete_issues, @project) %>
</div>