diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-05-27 17:42:04 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-05-27 17:42:04 +0000 |
commit | 413247ee5b1643dff7923687711c77a5d90d41f5 (patch) | |
tree | 3ab2e5d182fee99cbb145f1783732db5bb46e7bc /app/controllers/admin_controller.rb | |
parent | 70374d084e19dba21e83e8a360a62ff0168ff207 (diff) | |
download | redmine-413247ee5b1643dff7923687711c77a5d90d41f5.tar.gz redmine-413247ee5b1643dff7923687711c77a5d90d41f5.zip |
Added the ability to archive projects:
* Only administrators can archive/unarchive projects.
* Once archived, the project is visible on the admin project listing only. It doesn't show up anywhere else in the app. Subprojects are also archived.
* Archive/unarchive preserve everything on the project (issues, members, ...).
* A subproject can not be unarchived if its parent project is archived.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@549 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/admin_controller.rb')
-rw-r--r-- | app/controllers/admin_controller.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 1c10722de..19efb28cc 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -27,12 +27,18 @@ class AdminController < ApplicationController def projects sort_init 'name', 'asc' - sort_update - @project_count = Project.count + sort_update + + @status = params[:status] ? params[:status].to_i : 0 + conditions = nil + conditions = ["status=?", @status] unless @status == 0 + + @project_count = Project.count(:conditions => conditions) @project_pages = Paginator.new self, @project_count, - 15, + 25, params['page'] @projects = Project.find :all, :order => sort_clause, + :conditions => conditions, :limit => @project_pages.items_per_page, :offset => @project_pages.current.offset |