View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0010130 | mantisbt | filters | public | 2009-02-11 12:40 | 2015-03-23 12:27 |
Reporter | atrol | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.1.6 | ||||
Target Version | 1.2.13 | Fixed in Version | 1.2.13 | ||
Summary | 0010130: Filter "Assigned to" does not display usernames when project "All Projects" is selected | ||||
Description | I want to see all issues that are assigned to one person, who is working in more than one project. I select "All Projects" from projects. Trying this, I get no list of users in field "Assigned to" | ||||
Tags | patch | ||||
Attached Files | filter-users-in-list-when-all_projects-selected.patch (4,365 bytes)
From 66ed07f63445a6ae7884cc1a1db8ffa109d90863 Mon Sep 17 00:00:00 2001 From: Lapinkiller <lapinkiller@hotmail.fr> Date: Tue, 14 Jun 2011 13:29:09 +0200 Subject: [PATCH] filter: users in list when all_projects selected --- core/filter_api.php | 22 ++++++++++++---------- core/print_api.php | 26 +++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/core/filter_api.php b/core/filter_api.php index 7680e5b..1172f44 100644 --- a/core/filter_api.php +++ b/core/filter_api.php @@ -18,7 +18,7 @@ * @package CoreAPI * @subpackage FilterAPI * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org - * @copyright Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net + * @copyright Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge.net * @link http://www.mantisbt.org */ @@ -3530,21 +3530,23 @@ function print_filter_user_monitor() { */ function print_filter_handler_id() { global $t_select_modifier, $t_filter, $f_view_type; + $t_current_project = helper_get_current_project(); ?> <!-- Handler --> <select <?php echo $t_select_modifier;?> name="handler_id[]"> <option value="<?php echo META_FILTER_ANY?>" <?php check_selected( $t_filter[FILTER_PROPERTY_HANDLER_ID], META_FILTER_ANY );?>>[<?php echo lang_get( 'any' )?>]</option> - <?php if( access_has_project_level( config_get( 'view_handler_threshold' ) ) ) {?> - <option value="<?php echo META_FILTER_NONE?>" <?php check_selected( $t_filter[FILTER_PROPERTY_HANDLER_ID], META_FILTER_NONE );?>>[<?php echo lang_get( 'none' )?>]</option> + <?php + if( access_has_project_level(config_get( 'view_handler_threshold'))|| $t_current_project == ALL_PROJECTS) {?> + <option value="<?php echo META_FILTER_NONE?>" <?php check_selected( $t_filter[FILTER_PROPERTY_HANDLER_ID], META_FILTER_NONE );?>>[<?php echo lang_get( 'none' )?>]</option> <?php - if( access_has_project_level( config_get( 'handle_bug_threshold' )) || $t_filter[FILTER_PROPERTY_HANDLER_ID][0] == ALL_PROJECTS) { - echo '<option value="' . META_FILTER_MYSELF . '" '; - check_selected( $t_filter[FILTER_PROPERTY_HANDLER_ID], META_FILTER_MYSELF ); - echo '>[' . lang_get( 'myself' ) . ']</option>'; - } + if( access_has_project_level( config_get( 'handle_bug_threshold' )) || $t_current_project == ALL_PROJECTS) { + echo '<option value="' . META_FILTER_MYSELF . '" '; + check_selected( $t_filter[FILTER_PROPERTY_HANDLER_ID], META_FILTER_MYSELF ); + echo '>[' . lang_get( 'myself' ) . ']</option>'; + } - print_assign_to_option_list( $t_filter[FILTER_PROPERTY_HANDLER_ID] ); - }?> + print_assign_to_option_list( $t_filter[FILTER_PROPERTY_HANDLER_ID], $t_current_project); + }?> </select> <?php } diff --git a/core/print_api.php b/core/print_api.php index 704c48c..c4d9062 100644 --- a/core/print_api.php +++ b/core/print_api.php @@ -19,7 +19,7 @@ * @package CoreAPI * @subpackage PrintAPI * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org - * @copyright Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net + * @copyright Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge.net * @link http://www.mantisbt.org */ @@ -219,9 +219,29 @@ function print_user_option_list( $p_user_id, $p_project_id = null, $p_access = A $p_project_id = helper_get_current_project(); } - $t_users = project_get_all_user_rows( $p_project_id, $p_access ); + if($p_project_id === ALL_PROJECTS){ + $t_projects = user_get_accessible_projects(auth_get_current_user_id()); - # handles ALL_PROJECTS case + foreach($t_projects as $t_project_id){ + $t_project_users_list = project_get_all_user_rows($t_project_id,$p_access); + + $t_users_temp = array_merge($t_users_temp,$t_project_users_list); + } + + $t_users_id_list = array(); + //Remove user from list (there is a "myself" value) + $t_users_id_list[] = auth_get_current_user_id(); + + //Deleting duplicate + foreach($t_users_temp as $t_user){ + if(!in_array($t_user['id'],$t_users_id_list)){ + $t_users_id_list[] = $t_user['id']; + $t_users[] = $t_user; + } + } + }else{ + $t_users = project_get_all_user_rows( $p_project_id, $p_access,false ); + } $t_display = array(); $t_sort = array(); -- 1.7.4.msysgit.0 | ||||
related to | 0015721 | closed | grangeway | Functionality to consider porting to master-2.0.x |
has duplicate | 0010280 | closed | atrol | Option to show all users in All Projects filter |
has duplicate | 0012501 | closed | atrol | Can not use the "assigned to" filter properly when "all project" is selected |
related to | 0015411 | closed | dregad | Huge memory consumption for print_user_option_list() |
related to | 0019540 | acknowledged | Filter "Assigned To:" doesn't show all usernames when "All Projects" is selected |
Still the same behaviour in 1.2RC2, |
|
When you're reproducing this problem, how many projects do you have in your MantisBT installation? If the answer is 1 (one), perhaps this issue is the same as 0011509 ? |
|
The answer is 22 (5 of them as subprojects) |
|
face the same issue in version 1.1.7. I can see a list of users in "Reported" & "Monitored By" field but only 2 users in the "Assigned To" field who are administrators. There are over 50 projects and sub projects with varying users access permissions to each projects. |
|
Same issue on 1.2.1 - only global developers or above are selectable in all projects view. |
|
same in version 1.2.3, running 30 projects of which 10 sub-projects |
|
Click to the "Main" page and click the number after the "Open and assigned to me:" this will list all of your issues and also you can sort them. It would be much better though if this could be a filter option |
|
Istvan, this is no workaround. I want to know which issues are assigned to other users. |
|
Its not, but maybe it helps for some of the users. It doesnt help if you are a manager and want to see how much issue a user has, but it help if you want to see all your issues at once. |
|
The problem occurs in project api function project_get_all_user_rows. If project id is ALL_PROJECTS it only checks the global level so users with a global level lower than developer but are developers or above on specific projects are excluded. The email_notify_new_account function calls this and requires using the global level only. The mc_project_get_users function also calls it and MAY require the global level. The other calls specify a project id. I wonder if we shouldn't have an ANY_PROJECT option as well as ALL_PROJECTS. This of course would likely wreak havoc through the rest of the code as ALL_PROJECTS seems to be everywhere. |
|
as soon as i find time, i will submit a patch to resolve this problem ;) EDIT : patch submitted |
|
Sorry, show-users-in-userlist-selection-when-ALL-PROJECTS-.patch doesn't work. use filter-users-in-list-when-all_projects-selected.patch instead. (@admins please delete first patch) |
|
Thank you for the patch but it doesn't work for me. |
|
which patch have you used ? the first one i have submitted (and which is not longer attached to this bug) : show-users-in-userlist-selection-when-ALL-PROJECTS-.patch or the second : filter-users-in-list-when-all_projects-selected.patch ? NB : the patch is for mantis 1.2.5 |
|
I used the second one but my mantis version is 1.2.3. Do you think the version I use is in conflict with your patch ? |
|
maybe, i don't know... can you try to upgrade your mantis or a copy of your mantis to 1.2.5 ? |
|
push |
|
@M.C.S.
Yes, and yes. Please report details of your test cases and results here. You should ensure the fix works as it should, and does not cause any regression issues (filter api is quite complex, so be careful). One of the developers can then review the results and push the commit. |
|
Well, I tried to apply the patch under Windows XP with "git version 1.7.8.msysgit.0" on branch "master-1.2.x" and also on the clean "release-1.2.5", but I always get these error messages when trying to apply the patch: $git apply --check ../filter-users-in-list-when-all_projects-selected.patch I called the git command from within my MantisBT root folder. Anything wrong on that? |
|
i have made a new patch based on 1.2.11/1.2.x (the patch attached here was for 1.2.5 and not fully working...) |
|
have you seen my patch/pull request ? |
|
yes but did not have time to test it yet |
|
ok, no problem, i just wasn't sure you have seen it ^^ |
|
I merged (& squashed) your commit, then made some improvements - see https://github.com/dregad/mantisbt/tree/fix-10130 |
|
Removing the current user from list is no good idea as we lose functionality. |
|
Good point, did not think about that. I'll revert the change. |
|
MantisBT: master-1.2.x 21746dd1 2012-09-24 09:19 JGuilbaud Committer: Damien Regad Details Diff |
Show all users in assign filter when ALL PROJECTS is selected Fixes 0010130 Signed-off-by: Damien Regad <damien.regad@merckgroup.com> |
Affected Issues 0010130 |
|
mod - core/filter_api.php | Diff File | ||
mod - core/print_api.php | Diff File | ||
MantisBT: master 048dc22c 2012-09-24 09:19 JGuilbaud Committer: Damien Regad Details Diff |
Show all users in assign filter when ALL PROJECTS is selected Fixes 0010130 Signed-off-by: Damien Regad <damien.regad@merckgroup.com> |
Affected Issues 0010130 |
|
mod - core/filter_api.php | Diff File | ||
mod - core/print_api.php | Diff File | ||
MantisBT: master-1.2.x dab0021e 2012-12-12 12:39 Details Diff |
Optimise code in print_user_option_list() Improve performance of code building the list of users for all projects introduced in commit 21746dd1a6a7e4c6df8baa9cbfc3dac48c82899c. By using an associative array, the foreach loop to remove duplicates can be simplified (no need for an if statement) and we can also remove the current user from the list more easily. Affects issue 0010130 |
Affected Issues 0010130 |
|
mod - core/print_api.php | Diff File | ||
MantisBT: master dba4f3e5 2012-12-12 12:39 Details Diff |
Optimise code in print_user_option_list() Improve performance of code building the list of users for all projects introduced in commit 21746dd1a6a7e4c6df8baa9cbfc3dac48c82899c. By using an associative array, the foreach loop to remove duplicates can be simplified (no need for an if statement) and we can also remove the current user from the list more easily. Affects issue 0010130 |
Affected Issues 0010130 |
|
mod - core/print_api.php | Diff File | ||
MantisBT: master-1.2.x 748c4cec 2012-12-12 12:56 Details Diff |
Removing current user from list built by print_user_option_list() Since there is a [myself] value in the list, the current user should be removed. This was done for ALL_PROJECTS with the fix for issue 0010130, but the single-project code still listed the current user. By moving the code to remove the current user to the foreach loop that builds the sort arrays, we ensure that it is removed in both cases. |
Affected Issues 0010130 |
|
mod - core/print_api.php | Diff File | ||
MantisBT: master c7e261e1 2012-12-12 12:56 Details Diff |
Removing current user from list built by print_user_option_list() Since there is a [myself] value in the list, the current user should be removed. This was done for ALL_PROJECTS with the fix for issue 0010130, but the single-project code still listed the current user. By moving the code to remove the current user to the foreach loop that builds the sort arrays, we ensure that it is removed in both cases. |
Affected Issues 0010130 |
|
mod - core/print_api.php | Diff File | ||
MantisBT: master-1.2.x 07351732 2012-12-14 08:37 Details Diff |
Do not remove current user from list As mentioned by atrol in issue 0010130, removing the current user causes potential loss of functionality when using filters because [myself] (handler_id = -1) is not the same as a specific handler_id. This is a partial revert of 748c4cec6457475673f21ad554ba1791c90222c7. |
Affected Issues 0010130 |
|
mod - core/print_api.php | Diff File | ||
MantisBT: master 0dfe2549 2012-12-14 08:37 Details Diff |
Do not remove current user from list As mentioned by atrol in issue 0010130, removing the current user causes potential loss of functionality when using filters because [myself] (handler_id = -1) is not the same as a specific handler_id. This is a partial revert of 748c4cec6457475673f21ad554ba1791c90222c7. |
Affected Issues 0010130 |
|
mod - core/print_api.php | Diff File |