fixed widget alert pandora_enterprise#9229

This commit is contained in:
Daniel Barbero 2022-09-20 09:05:13 +02:00
parent c4d085c24c
commit 9ac30676b6
2 changed files with 13 additions and 4 deletions

View File

@ -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;
}

View File

@ -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]);