Use acts_as_nested_set instead of acts_as_tree for project hierarchy.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/work@2149 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -46,8 +46,7 @@ class ProjectsController < ApplicationController
|
||||
# Lists visible projects
|
||||
def index
|
||||
projects = Project.find :all,
|
||||
:conditions => Project.visible_by(User.current),
|
||||
:include => :parent
|
||||
:conditions => Project.visible_by(User.current)
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
@project_tree = projects.group_by {|p| p.parent || p}
|
||||
|
||||
@@ -43,7 +43,7 @@ class Project < ActiveRecord::Base
|
||||
:join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}",
|
||||
:association_foreign_key => 'custom_field_id'
|
||||
|
||||
acts_as_tree :order => "name", :counter_cache => true
|
||||
acts_as_nested_set :dependent => :nullify
|
||||
acts_as_attachable :view_permission => :view_files,
|
||||
:delete_permission => :manage_files
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<% user_projects_by_root = User.current.projects.find(:all, :include => :parent).group_by(&:root) %>
|
||||
<% user_projects_by_root = User.current.projects.find(:all).group_by(&:root) %>
|
||||
<select onchange="if (this.value != '') { window.location = this.value; }">
|
||||
<option selected="selected"><%= l(:label_jump_to_a_project) %></option>
|
||||
<option disabled="disabled">---</option>
|
||||
|
||||
Reference in New Issue
Block a user