2011-12-13 Sergio Martin <sergio.martin@artica.es>

* include/functions_users.php: Change the get user groups
	to return the groups orderer by name



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5249 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2011-12-13 13:11:39 +00:00
parent 6e333e3e22
commit 7872dcde1e
2 changed files with 12 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2011-12-13 Sergio Martin <sergio.martin@artica.es>
* include/functions_users.php: Change the get user groups
to return the groups orderer by name
2011-12-13 Sergio Martin <sergio.martin@artica.es>
* include/functions_graph.php: Fixed a bug of the

View File

@ -87,10 +87,10 @@ function users_get_groups ($id_user = false, $privilege = "AR", $returnAllGroup
$list_id_groups = array_unique($list_id_groups);
$groups = db_get_all_rows_filter('tgrupo', array('id_grupo' => $list_id_groups));
$groups = db_get_all_rows_filter('tgrupo', array('id_grupo' => $list_id_groups, 'order' => 'parent, nombre'));
}
else {
$groups = db_get_all_rows_in_table ('tgrupo', 'nombre');
$groups = db_get_all_rows_in_table ('tgrupo', 'parent, nombre');
}
$user_groups = array ();
@ -100,13 +100,16 @@ function users_get_groups ($id_user = false, $privilege = "AR", $returnAllGroup
if ($returnAllGroup) { //All group
if ($returnAllColumns) {
$groups[] = array('id_grupo' => 0, 'nombre' => __('All'),
$groupall = array('id_grupo' => 0, 'nombre' => __('All'),
'icon' => 'world', 'parent' => 0, 'disabled' => 0,
'custom_id' => null, 'propagate' => 0);
}
else {
$groups[] = array('id_grupo' => 0, 'nombre' => __("All"));
$groupall = array('id_grupo' => 0, 'nombre' => __("All"));
}
// Add the All group to the beginning to be always the first
array_unshift($groups, $groupall);
}
foreach ($groups as $group) {
@ -128,8 +131,6 @@ function users_get_groups ($id_user = false, $privilege = "AR", $returnAllGroup
}
}
ksort($user_groups);
return $user_groups;
}