mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
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:
commit
2fef90895e
@ -49,6 +49,7 @@ class Group extends Entity
|
|||||||
'groupEventsByAgent',
|
'groupEventsByAgent',
|
||||||
'loadInfoAgent',
|
'loadInfoAgent',
|
||||||
'getAgentsByGroup',
|
'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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user