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:
vgilc 2014-08-25 09:05:48 +00:00
parent 539efb3151
commit 4e1fb18412
2 changed files with 15 additions and 20 deletions

View File

@ -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> 2014-08-25 Vanessa Gil <vanessa.gil@artica.es>
* godmode/groups/configure_group.php * godmode/groups/configure_group.php

View File

@ -291,36 +291,26 @@ $groups = users_get_groups_tree ($config['id_user'], "AR", true);
$table->width = '98%'; $table->width = '98%';
$all_parents = array();
$groups_count = 0; $groups_count = 0;
$sons = array(); $sons = array();
$groups_aux = array();
foreach ($groups as $k => $g) { foreach ($groups as $k => $g) {
if ($g['parent'] == 0) { if ($g['parent'] != 0) {
$groups_count++; $all_parents[$g['parent']] = $g['parent'];
} }
else if ($g['parent'] != 0) { }
krsort($all_parents);
//Check the group has the parent in the list foreach ($all_parents as $parent) {
//else the group chage to hook in the all group foreach ($groups as $k => $g) {
$found = false; if ($g['parent'] == $parent) {
foreach ($groups as $check_g) {
if ($check_g['id_grupo'] == $g['parent']) {
$found = true;
break;
}
}
if ($found) {
$sons[$g['parent']][] = $g; $sons[$g['parent']][] = $g;
unset($groups[$k]); unset($groups[$k]);
} }
else {
$groups_count++;
}
} }
} }
$groups_count = count($groups_aux);
if (check_acl($config['id_user'], 0, "PM")) { if (check_acl($config['id_user'], 0, "PM")) {
echo '<br />'; echo '<br />';