Adds a 'Add subprojects' permission.

* 'Add project' permission will let user create a root project
* 'Add subprojects' permission will let project members create subprojects

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3238 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-12-24 16:18:15 +00:00
parent 24fde6f109
commit 62c83bdd2e
44 changed files with 269 additions and 70 deletions
+10 -1
View File
@@ -36,7 +36,16 @@ module ProjectsHelper
end
def parent_project_select_tag(project)
options = '<option></option>' + project_tree_options_for_select(project.allowed_parents, :selected => project.parent)
selected = project.parent
# retrieve the requested parent project
parent_id = (params[:project] && params[:project][:parent_id]) || params[:parent_id]
if parent_id
selected = (parent_id.blank? ? nil : Project.find(parent_id))
end
options = ''
options << "<option value=''></option>" if project.allowed_parents.include?(nil)
options << project_tree_options_for_select(project.allowed_parents.compact, :selected => selected)
content_tag('select', options, :name => 'project[parent_id]')
end