Merge branch 'ent-10152-no-permite-agregar-grupos-a-notificaciones' into 'develop'

Ent 10152 no permite agregar grupos a notificaciones

See merge request artica/pandorafms!5424
This commit is contained in:
Rafael Ameijeiras 2023-01-26 07:03:33 +00:00
commit c18ace2aae
1 changed files with 13 additions and 5 deletions

View File

@ -142,13 +142,21 @@ function users_get_groups_for_select(
null
);
if ($id_groups !== null) {
$children = groups_get_children($id_groups);
foreach ($children as $child) {
unset($user_groups[$child['id_grupo']]);
if ($id_groups !== null && empty($id_groups) === false) {
$children = [];
foreach ($id_groups as $key => $id_group) {
$children[] = groups_get_children($id_group);
}
unset($user_groups[$id_groups]);
if (empty($children) === false) {
foreach ($children as $child) {
unset($user_groups[$child['id_grupo']]);
}
}
foreach ($id_groups as $key => $id_group) {
unset($user_groups[$id_group]);
}
}
if (empty($user_groups)) {