From 50dca5f8e6d14df9284d313637d77ec45ff14865 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 20 Jun 2023 15:09:50 +0200 Subject: [PATCH 1/2] #11480 fixed widget status group --- .../lib/Dashboard/Widgets/system_group_status.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 02df4c2888..4782dc883f 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php +++ b/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php @@ -395,7 +395,9 @@ class SystemGroupStatusWidget extends Widget $user_groups = users_get_groups(false, 'AR', $return_all_group); $selected_groups = explode(',', $this->values['groupId'][0]); + $all_group_selected = false; if (in_array(0, $selected_groups) === true) { + $all_group_selected = true; $selected_groups = []; foreach (groups_get_all() as $key => $name_group) { $selected_groups[] = groups_get_id($name_group); @@ -480,7 +482,12 @@ class SystemGroupStatusWidget extends Widget } } - $this->values['groupId'] = $selected_groups; + if ($all_group_selected === true) { + $this->values['groupId'] = array_keys($result_groups); + } else { + $this->values['groupId'] = $selected_groups; + } + $this->values['status'] = explode(',', $this->values['status'][0]); $style = 'font-size: 1.5em; font-weight: bolder;text-align: center;'; From 5ee902902aedc32fd976875bdea9647c1c45376d Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 20 Jun 2023 15:20:43 +0200 Subject: [PATCH 2/2] #11480 added recursion in condition --- .../include/lib/Dashboard/Widgets/system_group_status.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4782dc883f..b648796ca8 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php +++ b/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php @@ -482,7 +482,7 @@ class SystemGroupStatusWidget extends Widget } } - if ($all_group_selected === true) { + if ($all_group_selected === true && $this->values['groupRecursion'] === true) { $this->values['groupId'] = array_keys($result_groups); } else { $this->values['groupId'] = $selected_groups;