Merge branch 'ent-11480-widget-de-estado-de-grupos-no-deberia-mostar-grupos-vacios' into 'develop'

Ent 11480 Widget de estado de grupos no deberia mostar grupos vacios

See merge request artica/pandorafms!6152
This commit is contained in:
Rafael Ameijeiras 2023-07-24 10:54:24 +00:00
commit 6b3b98ac04
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);
$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['groupRecursion'] === 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;';