Mercurial > hg > soundsoftware-site
comparison app/controllers/.svn/text-base/projects_controller.rb.svn-base @ 37:94944d00e43c
* Update to SVN trunk rev 4411
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Fri, 19 Nov 2010 13:24:41 +0000 |
parents | 40f7cfd4df19 |
children | af80e5618e9b |
comparison
equal
deleted
inserted
replaced
22:40f7cfd4df19 | 37:94944d00e43c |
---|---|
91 respond_to do |format| | 91 respond_to do |format| |
92 format.html { | 92 format.html { |
93 flash[:notice] = l(:notice_successful_create) | 93 flash[:notice] = l(:notice_successful_create) |
94 redirect_to :controller => 'projects', :action => 'settings', :id => @project | 94 redirect_to :controller => 'projects', :action => 'settings', :id => @project |
95 } | 95 } |
96 format.xml { head :created, :location => url_for(:controller => 'projects', :action => 'show', :id => @project.id) } | 96 format.xml { render :action => 'show', :status => :created, :location => url_for(:controller => 'projects', :action => 'show', :id => @project.id) } |
97 end | 97 end |
98 else | 98 else |
99 respond_to do |format| | 99 respond_to do |format| |
100 format.html { render :action => 'new' } | 100 format.html { render :action => 'new' } |
101 format.xml { render :xml => @project.errors, :status => :unprocessable_entity } | 101 format.xml { render :xml => @project.errors, :status => :unprocessable_entity } |
123 @project = Project.new(params[:project]) | 123 @project = Project.new(params[:project]) |
124 @project.enabled_module_names = params[:enabled_modules] | 124 @project.enabled_module_names = params[:enabled_modules] |
125 if validate_parent_id && @project.copy(@source_project, :only => params[:only]) | 125 if validate_parent_id && @project.copy(@source_project, :only => params[:only]) |
126 @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') | 126 @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') |
127 flash[:notice] = l(:notice_successful_create) | 127 flash[:notice] = l(:notice_successful_create) |
128 redirect_to :controller => 'admin', :action => 'projects' | 128 redirect_to :controller => 'projects', :action => 'settings' |
129 elsif !@project.new_record? | 129 elsif !@project.new_record? |
130 # Project was created | 130 # Project was created |
131 # But some objects were not copied due to validation failures | 131 # But some objects were not copied due to validation failures |
132 # (eg. issues from disabled trackers) | 132 # (eg. issues from disabled trackers) |
133 # TODO: inform about that | 133 # TODO: inform about that |
134 redirect_to :controller => 'admin', :action => 'projects' | 134 redirect_to :controller => 'projects', :action => 'settings' |
135 end | 135 end |
136 end | 136 end |
137 end | 137 end |
138 rescue ActiveRecord::RecordNotFound | 138 rescue ActiveRecord::RecordNotFound |
139 redirect_to :controller => 'admin', :action => 'projects' | 139 redirect_to :controller => 'admin', :action => 'projects' |