From 0f159e0fced0fa8e9fd1615c47bdd6c118d282e9 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 17 Jan 2024 09:50:06 +0100 Subject: [PATCH] #12768 group all no show all inventory --- pandora_console/include/functions_inventory.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pandora_console/include/functions_inventory.php b/pandora_console/include/functions_inventory.php index afa61c3811..46c0c0c7a8 100644 --- a/pandora_console/include/functions_inventory.php +++ b/pandora_console/include/functions_inventory.php @@ -890,6 +890,15 @@ function get_data_basic_info_sql($params, $count=false) if ($params['id_group'] > 0) { $where .= sprintf(' AND id_grupo = %d', $params['id_group']); + } else { + global $config; + $user_groups = implode(',', array_keys(users_get_groups($config['id_user']))); + // Avoid errors if there are no groups. + if (empty($user_groups) === true) { + $user_groups = '"0"'; + } + + $where .= sprintf(' AND id_grupo IN (%s)', $user_groups); } if ($params['search'] > 0) {