Permalink
Browse files

Show all users in assign filter when ALL PROJECTS is selected

Fixes #10130

Signed-off-by: Damien Regad <damien.regad@merckgroup.com>
  • Loading branch information...
JGuilbaud authored and dregad committed Sep 24, 2012
1 parent f92f1a0 commit 048dc22cf56151554c6dd34060fb406c318155fb
Showing with 23 additions and 4 deletions.
  1. +1 −1 core/filter_api.php
  2. +22 −3 core/print_api.php
View
@@ -2218,7 +2218,7 @@ function filter_draw_selection_area2( $p_page_number, $p_for_screen = true, $p_e
$t_show_build = $t_show_product_version && ( config_get( 'enable_product_build' ) == ON );
# overload handler_id setting if user isn't supposed to see them (ref #6189)
- if( !access_has_project_level( config_get( 'view_handler_threshold' ), $t_project_id ) ) {
+ if( !access_has_any_project( config_get( 'view_handler_threshold' ) ) ) {
$t_filter[FILTER_PROPERTY_HANDLER_ID] = array(
META_FILTER_ANY,
);
View
@@ -245,14 +245,33 @@ function print_captcha_input( $p_field_name ) {
# @todo from print_reporter_option_list
function print_user_option_list( $p_user_id, $p_project_id = null, $p_access = ANYBODY ) {
$t_users = array();
-
+ $t_users_temp = array();
if( null === $p_project_id ) {
$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() );
+ 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 current 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 );
+ }
- # handles ALL_PROJECTS case
$t_display = array();
$t_sort = array();

0 comments on commit 048dc22

Please sign in to comment.