Merge branch 'ent-12465-guardia-16501-fallo-en-edicion-de-grupo-ldap' into 'develop'

Ent 12465 guardia 16501 fallo en edicion de grupo ldap

See merge request artica/pandorafms!6685
This commit is contained in:
Rafael Ameijeiras 2023-12-18 14:52:25 +00:00
commit 2fef90895e
1 changed files with 27 additions and 0 deletions

View File

@ -49,6 +49,7 @@ class Group extends Entity
'groupEventsByAgent',
'loadInfoAgent',
'getAgentsByGroup',
'getGroupsName',
];
@ -751,4 +752,30 @@ class Group extends Entity
}
/**
* Get groups name.
*
* @return void
*/
public static function getGroupsName()
{
$groups = get_parameter('groups', []);
$sql = sprintf(
'SELECT id_grupo, nombre FROM tgrupo WHERE id_grupo IN (%s)',
implode(',', $groups)
);
$result = db_get_all_rows_sql($sql);
$array_groups = [];
foreach ($result as $value) {
$array_groups[$value['id_grupo']] = $value['nombre'];
}
echo json_encode($array_groups);
exit;
}
}