2014-08-25 Vanessa Gil <vanessa.gil@artica.es>
* godmode/groups/group_list.php: Fixed bug listing group hierarchy. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10453 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
5d4b94466e
commit
f363dd19fc
|
@ -1,3 +1,8 @@
|
|||
2014-08-25 Vanessa Gil <vanessa.gil@artica.es>
|
||||
|
||||
* godmode/groups/group_list.php: Fixed bug listing
|
||||
group hierarchy.
|
||||
|
||||
2014-08-25 Vanessa Gil <vanessa.gil@artica.es>
|
||||
|
||||
* godmode/groups/configure_group.php
|
||||
|
|
|
@ -291,36 +291,26 @@ $groups = users_get_groups_tree ($config['id_user'], "AR", true);
|
|||
|
||||
$table->width = '98%';
|
||||
|
||||
$all_parents = array();
|
||||
$groups_count = 0;
|
||||
$sons = array();
|
||||
$groups_aux = array();
|
||||
foreach ($groups as $k => $g) {
|
||||
if ($g['parent'] == 0) {
|
||||
$groups_count++;
|
||||
if ($g['parent'] != 0) {
|
||||
$all_parents[$g['parent']] = $g['parent'];
|
||||
}
|
||||
else if ($g['parent'] != 0) {
|
||||
|
||||
//Check the group has the parent in the list
|
||||
//else the group chage to hook in the all group
|
||||
$found = false;
|
||||
foreach ($groups as $check_g) {
|
||||
if ($check_g['id_grupo'] == $g['parent']) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($found) {
|
||||
}
|
||||
krsort($all_parents);
|
||||
foreach ($all_parents as $parent) {
|
||||
foreach ($groups as $k => $g) {
|
||||
if ($g['parent'] == $parent) {
|
||||
$sons[$g['parent']][] = $g;
|
||||
unset($groups[$k]);
|
||||
}
|
||||
else {
|
||||
$groups_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$groups_count = count($groups_aux);
|
||||
|
||||
if (check_acl($config['id_user'], 0, "PM")) {
|
||||
echo '<br />';
|
||||
|
|
Loading…
Reference in New Issue