Fixed: Modules selection not remembered when new project creation fails (#1109).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1358 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
596de073f9
commit
a9f86444fc
app/controllers
|
@ -66,20 +66,20 @@ class ProjectsController < ApplicationController
|
||||||
:conditions => "parent_id IS NULL AND status = #{Project::STATUS_ACTIVE}",
|
:conditions => "parent_id IS NULL AND status = #{Project::STATUS_ACTIVE}",
|
||||||
:order => 'name')
|
:order => 'name')
|
||||||
@project = Project.new(params[:project])
|
@project = Project.new(params[:project])
|
||||||
@project.enabled_module_names = Redmine::AccessControl.available_project_modules
|
|
||||||
if request.get?
|
if request.get?
|
||||||
@custom_values = ProjectCustomField.find(:all, :order => "#{CustomField.table_name}.position").collect { |x| CustomValue.new(:custom_field => x, :customized => @project) }
|
@custom_values = ProjectCustomField.find(:all, :order => "#{CustomField.table_name}.position").collect { |x| CustomValue.new(:custom_field => x, :customized => @project) }
|
||||||
@project.trackers = Tracker.all
|
@project.trackers = Tracker.all
|
||||||
@project.is_public = Setting.default_projects_public?
|
@project.is_public = Setting.default_projects_public?
|
||||||
|
@project.enabled_module_names = Redmine::AccessControl.available_project_modules
|
||||||
else
|
else
|
||||||
@project.custom_fields = CustomField.find(params[:custom_field_ids]) if params[:custom_field_ids]
|
@project.custom_fields = CustomField.find(params[:custom_field_ids]) if params[:custom_field_ids]
|
||||||
@custom_values = ProjectCustomField.find(:all, :order => "#{CustomField.table_name}.position").collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => (params[:custom_fields] ? params["custom_fields"][x.id.to_s] : nil)) }
|
@custom_values = ProjectCustomField.find(:all, :order => "#{CustomField.table_name}.position").collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => (params[:custom_fields] ? params["custom_fields"][x.id.to_s] : nil)) }
|
||||||
@project.custom_values = @custom_values
|
@project.custom_values = @custom_values
|
||||||
|
@project.enabled_module_names = params[:enabled_modules]
|
||||||
if @project.save
|
if @project.save
|
||||||
@project.enabled_module_names = params[:enabled_modules]
|
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to :controller => 'admin', :action => 'projects'
|
redirect_to :controller => 'admin', :action => 'projects'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue