Mercurial > hg > soundsoftware-site
comparison app/controllers/.svn/text-base/roles_controller.rb.svn-base @ 441:cbce1fd3b1b7 redmine-1.2
Update to Redmine 1.2-stable branch (Redmine SVN rev 6000)
author | Chris Cannam |
---|---|
date | Mon, 06 Jun 2011 14:24:13 +0100 |
parents | 513646585e45 |
children |
comparison
equal
deleted
inserted
replaced
245:051f544170fe | 441:cbce1fd3b1b7 |
---|---|
36 if !params[:copy_workflow_from].blank? && (copy_from = Role.find_by_id(params[:copy_workflow_from])) | 36 if !params[:copy_workflow_from].blank? && (copy_from = Role.find_by_id(params[:copy_workflow_from])) |
37 @role.workflows.copy(copy_from) | 37 @role.workflows.copy(copy_from) |
38 end | 38 end |
39 flash[:notice] = l(:notice_successful_create) | 39 flash[:notice] = l(:notice_successful_create) |
40 redirect_to :action => 'index' | 40 redirect_to :action => 'index' |
41 else | |
42 @permissions = @role.setable_permissions | |
43 @roles = Role.find :all, :order => 'builtin, position' | |
41 end | 44 end |
42 @permissions = @role.setable_permissions | |
43 @roles = Role.find :all, :order => 'builtin, position' | |
44 end | 45 end |
45 | 46 |
46 def edit | 47 def edit |
47 @role = Role.find(params[:id]) | 48 @role = Role.find(params[:id]) |
48 if request.post? and @role.update_attributes(params[:role]) | 49 if request.post? and @role.update_attributes(params[:role]) |
49 flash[:notice] = l(:notice_successful_update) | 50 flash[:notice] = l(:notice_successful_update) |
50 redirect_to :action => 'index' | 51 redirect_to :action => 'index' |
52 else | |
53 @permissions = @role.setable_permissions | |
51 end | 54 end |
52 @permissions = @role.setable_permissions | |
53 end | 55 end |
54 | 56 |
55 def destroy | 57 def destroy |
56 @role = Role.find(params[:id]) | 58 @role = Role.find(params[:id]) |
57 @role.destroy | 59 @role.destroy |