Order by name group select in manage agent view - #1596

This commit is contained in:
enriquecd 2017-11-15 17:03:16 +01:00
parent 0618a2fd97
commit 2a13f5fbf6
1 changed files with 2 additions and 2 deletions

View File

@ -169,14 +169,14 @@ function users_get_groups ($id_user = false, $privilege = "AR", $returnAllGroup
} else {
// Admin.
if (is_user_admin($id_user)) {
$groups = db_get_all_rows_sql ("SELECT * FROM tgrupo");
$groups = db_get_all_rows_sql ("SELECT * FROM tgrupo ORDER BY nombre");
}
// Per-group permissions.
else {
$query = sprintf("SELECT tgrupo.*, tperfil.*, tusuario_perfil.tags FROM tgrupo, tusuario_perfil, tperfil
WHERE (tgrupo.id_grupo = tusuario_perfil.id_grupo OR tusuario_perfil.id_grupo = 0)
AND tusuario_perfil.id_perfil = tperfil.id_perfil
AND tusuario_perfil.id_usuario = '%s'", $id_user);
AND tusuario_perfil.id_usuario = '%s' ORDER BY nombre", $id_user);
$groups = db_get_all_rows_sql ($query);
// Get children groups.