Project

General

Profile

Modify View of Project Hierarchy

Added by Slava Karg about 14 years ago

Hello!
Our company has begun using Redmine for managing projects. We created hierarchy of projects and I cant figure out how it is being sorted. And I cant find any way to customize view of projects tree, I mean a page which appears when you click on the button "Projects" in the top panel of Redmine interface.
I attached a screenshot (slightly modified :] ) - as you can see there is no logic how it is being sorted.
So does anybody know if there is a way to customize this view?


Replies (15)

RE: Modify View of Project Hierarchy - Added by Slava Karg about 14 years ago

Forgot to mention that we have 1.0.1 Redmine

RE: Modify View of Project Hierarchy - Added by Felix Schäfer about 14 years ago

The projects are ordered in the DB in a nested set and read according to this nested set so that the tree can be rebuilt "easily", that amounts to projects of the same branch at the same level are roughly ordered in creation date order (well, last move time to be precise).

RE: Modify View of Project Hierarchy - Added by Slava Karg about 14 years ago

I found such fields in "Projects" table of Redmine database: "lft" and "rgt". So I suppose that these values influence to the order of Projects, but I dont understand the logic of it, because I didn't find any relation to the creation date as u said. And it seems like these values "lft" and "rgt" are modified every time new project is created...

Is there any solution to manage the view of projects without working with database directly?

RE: Modify View of Project Hierarchy - Added by Felix Schäfer about 14 years ago

The lft, rgt and root_id columns are for the already mentioned nested set, there's a good explanation on wikipedia you can read if you want more information on that. The projects are then loaded ordered by the lft column and the tree is rebuilt from there.

RE: Modify View of Project Hierarchy - Added by Slava Karg about 14 years ago

Ok, but the question is still open - how to modify the tree of projects? The modification of database everytime new project is created is not the solution...

RE: Modify View of Project Hierarchy - Added by Felix Schäfer about 14 years ago

As you already have discovered there is no way in stock redmine to rearrange them. If you really need it, it could probably be done by a plugin though.

RE: Modify View of Project Hierarchy - Added by Felix Schäfer about 14 years ago

I said one could be made, not that one existed.

RE: Modify View of Project Hierarchy - Added by Stéphane Atlani about 14 years ago

Hello!

I have same "Problem".

If change on database lft order ? this is dangerous ?
What will be the consequence ?

Sorry for my very bad English ^^

Thank you,

RE: Modify View of Project Hierarchy - Added by Felix Schäfer about 14 years ago

Stéphane Atlani wrote:

If change on database lft order ? this is dangerous ?
What will be the consequence ?

If not done properly, it will make the nested set the projects are in inconsistent, effectively destroying your project hierarchy.

By "not done properly", I mean "without a proper understanding of what a nested set is", which seems to be your case as changing the order in the nested set would require changing the lft and rgt fields of a project, as well as those of all the projects underneath it.

RE: Modify View of Project Hierarchy - Added by Stéphane Atlani about 14 years ago

Ok thank you.

I'll wait ;)

RE: Modify View of Project Hierarchy - Added by Juan Alvarez about 14 years ago

Hi guys,

I'm using Redmine 1.0.1.stable.70 with MySQL, and I'm having some problems with the Projects view. The projects are not correctly nested (see attached image).

I checked lft and rgt, and they seems right:

mysql> SELECT name,id,lft,rgt FROM `projects` WHERE (projects.status=1);
-----------------------+------+------+ | name | id | lft | rgt |
-----------------------+------+------+ | Proyecto 1 | 7 | 13 | 26 | | Proyecto 111 | 18 | 15 | 16 | | Proyecto 12 | 17 | 20 | 25 | | Proyecto 11 | 16 | 14 | 19 | | Proyecto 112 | 19 | 17 | 18 | | Proyecto 121 | 20 | 21 | 22 | | Proyecto 122 | 21 | 23 | 24 |
-----------------------+------+------+
15 rows in set (0.00 sec)

I didn't see in the Redmine 1.0.2 changelog any related and fixed issue, so I have not yet updated Redmine.

Any help would be appreciated. Thanks

Juan Álvarez

projects.png (15 KB) projects.png Bad projects nesting

RE: Modify View of Project Hierarchy - Added by Juan Alvarez about 14 years ago

Sorry, that happened to me for not using the preview...

mysql> SELECT name,id,lft,rgt FROM `projects` WHERE (projects.status=1);

name id lft rgt
Proyecto 1 7 13 26
Proyecto 111 18 15 16
Proyecto 12 17 20 25
Proyecto 11 16 14 19
Proyecto 112 19 17 18
Proyecto 121 20 21 22
Proyecto 122 21 23 24

Thanks again

Juan Álvarez

RE: Modify View of Project Hierarchy - Added by Felix Schäfer about 14 years ago

Please open a new bug report for that, I can't seem to find anything bad with the data you have provided, and if it really is a bug, it should be on the tracker.

RE: Modify View of Project Hierarchy - Added by Juan Alvarez about 14 years ago

Solved. It was a plugin related problem.

Thanks for your support.

Juan Álvarez

    (1-15/15)