How to hide an unassigned project

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
testing
Posts: 2
Joined: 24 Apr 2008, 09:23

How to hide an unassigned project

Post by testing »

Hello,

1)we have created an mantis account for an user as reporter/updater and assigning the project for that user...In that user account if we login, it should display that assigned project details only..rather it displays all the projects and its details ..How should we hide the unassigned project from that user..

2)And also in projects dropdown only the assigned project should display..how to do that..

please reply as soon as possible..awaiting for the reply...

Thanks and regards,

Ani
phil mantis
Posts: 3
Joined: 22 Dec 2009, 15:41

Re: How to hide an unassigned project

Post by phil mantis »

Hello,
i'd like to do the same.

Well, i know that the lang/strings_french (for me) contains
$s_all_projects = 'Tous les projets';

the core/html_api.php is calling it
function print_project_menu_bar() {
$t_project_ids = current_user_get_accessible_projects();

PRINT '<table class="width100" cellspacing="0">';
PRINT '<tr>';
PRINT '<td class="menu">';
PRINT '<a href="set_project.php?project_id=' . ALL_PROJECTS . '">' . lang_get( 'all_projects' ) . '</a>';

foreach ( $t_project_ids as $t_id ) {
PRINT " | <a href=\"set_project.php?project_id=$t_id\">" . string_display( project_get_field( $t_id, 'name' ) ) . '</a>';
print_subproject_menu_bar( $t_id, $t_id . ';' );
}

PRINT '</td>';
PRINT '</tr>';
PRINT '</table>';
}


but i don't know exactly what to do....using a # on the line header ?

Regards
phil mantis
Posts: 3
Joined: 22 Dec 2009, 15:41

Re: How to hide an unassigned project

Post by phil mantis »

Hello,

i want to do something like that: w<ant to hide the first 'project dropdown list' : All Projects

I already found the $s_all_project variable in the translation file - lang/strings_french.txt

and a call in core/html_api.php

# Print the menu bar with a list of projects to which the user has access
function print_project_menu_bar() {
$t_project_ids = current_user_get_accessible_projects();

PRINT '<table class="width100" cellspacing="0">';
PRINT '<tr>';
PRINT '<td class="menu">';
PRINT '<a href="set_project.php?project_id=' . ALL_PROJECTS . '">' . lang_get( 'all_projects' ) . '</a>';

foreach ( $t_project_ids as $t_id ) {
PRINT " | <a href=\"set_project.php?project_id=$t_id\">" . string_display( project_get_field( $t_id, 'name' ) ) . '</a>';
print_subproject_menu_bar( $t_id, $t_id . ';' );
}

PRINT '</td>';
PRINT '</tr>';
PRINT '</table>';
}


can you explain how i can do it please?

Thanks.
AmirS
Posts: 11
Joined: 05 Mar 2010, 09:59

Re: How to hide an unassigned project

Post by AmirS »

Hi, please help we !!! I have the same case. thx in advance !!!
atrol
Site Admin
Posts: 8536
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: How to hide an unassigned project

Post by atrol »

testing wrote:we have created an mantis account for an user as reporter/updater and assigning the project for that user...In that user account if we login, it should display that assigned project details only..rather it displays all the projects and its details ..How should we hide the unassigned project from that user..
Your user should not see more than the one assigned project if you don't set your projects to "public"
Please use Search before posting and read the Manual
AmirS
Posts: 11
Joined: 05 Mar 2010, 09:59

Re: How to hide an unassigned project

Post by AmirS »

Thank a lot it works! finnallyyyy !!! thxxxxxx .......
devil72
Posts: 1
Joined: 12 May 2011, 22:03

Re: How to hide an unassigned project

Post by devil72 »

Hello, the proposal solution works fine if you have only one public project;
what about if you need to hide different projects for different users?
Thanks
Post Reply