mirror of
https://github.com/redmine/redmine.git
synced 2025-11-01 19:05:51 +01:00
Ability to close projects (read-only) (#3640).
A new permission (Close/reopen project) is available to give non-admin users the ability to close their projects. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9883 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -48,7 +48,11 @@ class ProjectsController < ApplicationController
|
||||
def index
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
@projects = Project.visible.find(:all, :order => 'lft')
|
||||
scope = Project
|
||||
unless params[:closed]
|
||||
scope = scope.active
|
||||
end
|
||||
@projects = scope.visible.order('lft').all
|
||||
}
|
||||
format.api {
|
||||
@offset, @limit = api_offset_and_limit
|
||||
@@ -224,6 +228,16 @@ class ProjectsController < ApplicationController
|
||||
redirect_to(url_for(:controller => 'admin', :action => 'projects', :status => params[:status]))
|
||||
end
|
||||
|
||||
def close
|
||||
@project.close
|
||||
redirect_to project_path(@project)
|
||||
end
|
||||
|
||||
def reopen
|
||||
@project.reopen
|
||||
redirect_to project_path(@project)
|
||||
end
|
||||
|
||||
# Delete @project
|
||||
def destroy
|
||||
@project_to_destroy = @project
|
||||
|
||||
Reference in New Issue
Block a user