diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-01-24 11:31:15 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-01-24 11:31:15 +0000 |
commit | c9906480d3f279977720dc3f61534f4a5b77d1d2 (patch) | |
tree | 23d1ad1fc0a9435bcb703033dd7b5069ac565005 /app/helpers/users_helper.rb | |
parent | 51b745470c1d71b92072210a008f29c5d5a945d1 (diff) | |
download | redmine-c9906480d3f279977720dc3f61534f4a5b77d1d2.tar.gz redmine-c9906480d3f279977720dc3f61534f4a5b77d1d2.zip |
Merged nested projects branch. Removes limit on subproject nesting (#594).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2304 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/users_helper.rb')
-rw-r--r-- | app/helpers/users_helper.rb | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 5b113e880..b9e990d6e 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -25,15 +25,10 @@ module UsersHelper end # Options for the new membership projects combo-box - def projects_options_for_select(projects) + def options_for_membership_project_select(user, projects) options = content_tag('option', "--- #{l(:actionview_instancetag_blank_option)} ---") - projects_by_root = projects.group_by(&:root) - projects_by_root.keys.sort.each do |root| - options << content_tag('option', h(root.name), :value => root.id, :disabled => (!projects.include?(root))) - projects_by_root[root].sort.each do |project| - next if project == root - options << content_tag('option', '» ' + h(project.name), :value => project.id) - end + options << project_tree_options_for_select(projects) do |p| + {:disabled => (user.projects.include?(p))} end options end |