diff --git a/pandora_console/include/functions_groupview.php b/pandora_console/include/functions_groupview.php index 286c24b689..a87bea1650 100644 --- a/pandora_console/include/functions_groupview.php +++ b/pandora_console/include/functions_groupview.php @@ -86,7 +86,8 @@ function groupview_get_modules_counters($groups_ids=false) WHERE tasg.id_group IN ($groups_ids) GROUP BY tasg.id_group ) x GROUP BY g"; - return db_get_all_rows_sql($sql); + $data = db_get_all_rows_sql($sql); + return $data; } diff --git a/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php b/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php index af97de17ac..6bdcae1179 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php +++ b/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php @@ -392,6 +392,14 @@ class SystemGroupStatusWidget extends Widget $selected_groups = explode(',', $this->values['groupId'][0]); + // Recursion. + if ($this->values['groupRecursion'] === true) { + foreach ($selected_groups as $father) { + $children = \groups_get_children_ids($father); + $selected_groups = ($selected_groups + $children); + } + } + if ($selected_groups[0] === '') { return false; } @@ -456,10 +464,10 @@ class SystemGroupStatusWidget extends Widget $keys = array_column($module_counters, 'g'); $values = array_values($module_counters); $result_groups = array_combine($keys, $values); - } - if (empty($all_counters) === false) { - $result_groups[0] = $all_counters; + if (empty($all_counters) === false) { + $result_groups[0] = $all_counters; + } } $this->values['groupId'] = explode(',', $this->values['groupId'][0]);