Page 1 of 1

Projectdepended Configuration

Posted: 03 Mar 2005, 12:58
by polzin
Hi,

I am looking for a possibility to have the configuration (e.g. status, some strings) depended of the currently selected project, because I have different projects where there is need for different statuses etc.

What I do currently is to have some

if ( auth_is_user_authenticated() ) {
$t_project_id = helper_get_current_project();
if ( $t_project_id == 5 ) {
...

} else if ( $t_project_id == 7 ) {
...
}}}

switches in custom_strings_inc.php.

a) this does not seem to be the right place :-), but in config_inc.php auth_is_user_authenticated is not available.
b) there are problems obviously when displaying "all projects", but also if I am "in" one project (the project displayed in the upper right corner) and then display an issue of a different project. (This can occur e.g. by searching for the issue id).

Any suggestions?

Tobias

Posted: 03 Mar 2005, 18:15
by thraxisp
This is part of what is being implemented with moving the configuration to the database (see #4416). The example screens shown there are done on a per project basis.

Posted: 04 Mar 2005, 08:57
by polzin
@thraxisp

If I got it right... Not quite. I have to configure the names of the statuses and the available priorities. This can´t be done by this database configuration, right?

Tobias

What I did...

Posted: 04 Mar 2005, 16:32
by polzin
As some parts (e.g. bug_change_page) need a change of configuration before custom_strings is called the first time, I had to split up the changes:

a) project depended string changes go into custom_strings
b) project depended config changes go into a config_project_inc.php that is required_once at the end of core.php

The original problem that e.g. after jumping to an issue that helper_get_current_project() may not return the correct project (it returns the selected project which is not necessary the project of the issue) remains.

Any hint for this???

Tobias

Change of "current project" could be interesting..

Posted: 07 Mar 2005, 17:09
by polzin
How do you currently treat the issue, that if a user jumps to a bug e.g. by entering the bug-number and pressing "JUMP", the project of the displayed bug and the "current project" do not necessarily match?
Wouldn´t it be also for your changes a good thing to automatically adjust the "current project"?

Tobias[/quote]