Moves enabled_module_names param to project attribute so that it can be set through the Project API.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4645 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -77,7 +77,6 @@ class ProjectsController < ApplicationController
|
||||
@project = Project.new
|
||||
@project.safe_attributes = params[:project]
|
||||
|
||||
@project.enabled_module_names = params[:enabled_modules] if params[:enabled_modules]
|
||||
if validate_parent_id && @project.save
|
||||
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
|
||||
# Add current user as a project member if he is not admin
|
||||
|
||||
@@ -66,7 +66,7 @@ class Project < ActiveRecord::Base
|
||||
:url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o}},
|
||||
:author => nil
|
||||
|
||||
attr_protected :status, :enabled_module_names
|
||||
attr_protected :status
|
||||
|
||||
validates_presence_of :name, :identifier
|
||||
validates_uniqueness_of :identifier
|
||||
@@ -533,6 +533,9 @@ class Project < ActiveRecord::Base
|
||||
'tracker_ids',
|
||||
'issue_custom_field_ids'
|
||||
|
||||
safe_attributes 'enabled_module_names',
|
||||
:if => lambda {|project, user| project.new_record? || user.allowed_to?(:select_project_modules, project) }
|
||||
|
||||
# Returns an array of projects that are in this project's hierarchy
|
||||
#
|
||||
# Example: parents, children, siblings
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
<fieldset class="box"><legend><%= l(:label_module_plural) %></legend>
|
||||
<% Redmine::AccessControl.available_project_modules.each do |m| %>
|
||||
<label class="floating">
|
||||
<%= check_box_tag 'enabled_modules[]', m, @project.module_enabled?(m) %>
|
||||
<%= check_box_tag 'project[enabled_module_names][]', m, @project.module_enabled?(m) %>
|
||||
<%= l_or_humanize(m, :prefix => "project_module_") %>
|
||||
</label>
|
||||
<% end %>
|
||||
<%= hidden_field_tag 'enabled_modules[]', '' %>
|
||||
<%= hidden_field_tag 'project[enabled_module_names][]', '' %>
|
||||
|
||||
</fieldset>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user