summaryrefslogtreecommitdiffstats
path: root/app/controllers/issue_statuses_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-01-31 19:53:24 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-01-31 19:53:24 +0000
commitfe22797d69273cc68b5d070416223e9c5f52f396 (patch)
treeae81cb18985a8693dbee64800756921212b037e2 /app/controllers/issue_statuses_controller.rb
parentd29ba0b80fac3600b3bde5adc20b4df5c2a9bb37 (diff)
downloadredmine-fe22797d69273cc68b5d070416223e9c5f52f396.tar.gz
redmine-fe22797d69273cc68b5d070416223e9c5f52f396.zip
added the ability to set the sort order for issue statuses
git-svn-id: http://redmine.rubyforge.org/svn/trunk@205 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issue_statuses_controller.rb')
-rw-r--r--app/controllers/issue_statuses_controller.rb20
1 files changed, 19 insertions, 1 deletions
diff --git a/app/controllers/issue_statuses_controller.rb b/app/controllers/issue_statuses_controller.rb
index 5c74fbd02..9180533c3 100644
--- a/app/controllers/issue_statuses_controller.rb
+++ b/app/controllers/issue_statuses_controller.rb
@@ -19,13 +19,16 @@ class IssueStatusesController < ApplicationController
layout 'base'
before_filter :require_admin
+ verify :method => :post, :only => [ :destroy, :create, :update, :move ],
+ :redirect_to => { :action => :list }
+
def index
list
render :action => 'list' unless request.xhr?
end
def list
- @issue_status_pages, @issue_statuses = paginate :issue_statuses, :per_page => 10
+ @issue_status_pages, @issue_statuses = paginate :issue_statuses, :per_page => 25, :order => "position"
render :action => "list", :layout => false if request.xhr?
end
@@ -55,6 +58,21 @@ class IssueStatusesController < ApplicationController
else
render :action => 'edit'
end
+ end
+
+ def move
+ @issue_status = IssueStatus.find(params[:id])
+ case params[:position]
+ when 'highest'
+ @issue_status.move_to_top
+ when 'higher'
+ @issue_status.move_higher
+ when 'lower'
+ @issue_status.move_lower
+ when 'lowest'
+ @issue_status.move_to_bottom
+ end if params[:position]
+ redirect_to :action => 'list'
end
def destroy