Merge branch '1699-Ordenar-alfabéticamente-los-grupos-de-agentes' into 'develop'

Alphabetic order in group selects - #1699

See merge request artica/pandorafms!1197
This commit is contained in:
vgilc 2018-02-06 11:56:17 +01:00
commit b6d145992c
1 changed files with 2 additions and 2 deletions

View File

@ -403,13 +403,13 @@ function old_users_get_groups ($id_user = false, $privilege = "AR", $returnAllGr
// Admin.
if (is_user_admin($id_user)) {
$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' ORDER BY nombre", $id_user);
AND tusuario_perfil.id_usuario = '%s' ORDER BY tgrupo.nombre", $id_user);
$groups = db_get_all_rows_sql ($query);
// Get children groups.