diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-11-20 14:25:58 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-11-20 14:25:58 +0000 |
commit | 248b7258751cd7e41bc84f5ed9d18f05dc8413c3 (patch) | |
tree | 1114c99868803ac2d35535d98f4287f7fac6abcc /app/controllers/issue_statuses_controller.rb | |
parent | 053adaef52d795e5a3ef134381dd378e40856775 (diff) | |
download | redmine-248b7258751cd7e41bc84f5ed9d18f05dc8413c3.tar.gz redmine-248b7258751cd7e41bc84f5ed9d18f05dc8413c3.zip |
Adds API response to /issue_statuses to get the list of all available statuses (#7180).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7878 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issue_statuses_controller.rb')
-rw-r--r-- | app/controllers/issue_statuses_controller.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/app/controllers/issue_statuses_controller.rb b/app/controllers/issue_statuses_controller.rb index 0be67f401..1f747a4f3 100644 --- a/app/controllers/issue_statuses_controller.rb +++ b/app/controllers/issue_statuses_controller.rb @@ -18,14 +18,23 @@ class IssueStatusesController < ApplicationController layout 'admin' - before_filter :require_admin + before_filter :require_admin, :except => :index + before_filter :require_admin_or_api_request, :only => :index + accept_api_auth :index verify :method => :post, :only => [ :destroy, :create, :update, :move, :update_issue_done_ratio ], :redirect_to => { :action => :index } def index - @issue_status_pages, @issue_statuses = paginate :issue_statuses, :per_page => 25, :order => "position" - render :action => "index", :layout => false if request.xhr? + respond_to do |format| + format.html { + @issue_status_pages, @issue_statuses = paginate :issue_statuses, :per_page => 25, :order => "position" + render :action => "index", :layout => false if request.xhr? + } + format.api { + @issue_statuses = IssueStatus.all(:order => 'position') + } + end end def new |