#11480 fixed widget status group

This commit is contained in:
Daniel Cebrian 2023-06-20 15:09:50 +02:00
parent 305f9a9d5c
commit 50dca5f8e6
1 changed files with 8 additions and 1 deletions

View File

@ -395,7 +395,9 @@ class SystemGroupStatusWidget extends Widget
$user_groups = users_get_groups(false, 'AR', $return_all_group); $user_groups = users_get_groups(false, 'AR', $return_all_group);
$selected_groups = explode(',', $this->values['groupId'][0]); $selected_groups = explode(',', $this->values['groupId'][0]);
$all_group_selected = false;
if (in_array(0, $selected_groups) === true) { if (in_array(0, $selected_groups) === true) {
$all_group_selected = true;
$selected_groups = []; $selected_groups = [];
foreach (groups_get_all() as $key => $name_group) { foreach (groups_get_all() as $key => $name_group) {
$selected_groups[] = groups_get_id($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]); $this->values['status'] = explode(',', $this->values['status'][0]);
$style = 'font-size: 1.5em; font-weight: bolder;text-align: center;'; $style = 'font-size: 1.5em; font-weight: bolder;text-align: center;';