X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttAdmin.class.php;h=a2388edf61db4cf844180eca1f853546c0a00165;hb=7961e2909a8c8c456c1b0d6bee2944cabde592c0;hp=30c78f94b8eb9b22b86d10a95b54045a1f3c5804;hpb=95356f167c97ca1a70fc78d91a9dbc7b1d258b31;p=timetracker.git diff --git a/WEB-INF/lib/ttAdmin.class.php b/WEB-INF/lib/ttAdmin.class.php index 30c78f94..a2388edf 100644 --- a/WEB-INF/lib/ttAdmin.class.php +++ b/WEB-INF/lib/ttAdmin.class.php @@ -41,7 +41,17 @@ class ttAdmin { // getSubgroups rerurns an array of subgroups for a group. function getSubgroups($group_id) { - return array(); // TODO: not yet implemented. + $mdb2 = getConnection(); + + $subgroups = array(); + $sql = "select id from tt_groups where parent_id = $group_id"; + $res = $mdb2->query($sql); + if (!is_a($res, 'PEAR_Error')) { + while ($val = $res->fetchRow()) { + $subgroups[] = $val; + } + } + return $subgroups; } // getUsers obtains user ids in a group. @@ -105,7 +115,7 @@ class ttAdmin { return true; } - // markGroupDeleted marks the group and everything in it as deleted. + // markGroupDeleted marks a group and everything in it as deleted. function markGroupDeleted($group_id) { // Keep the logic simple by returning false on first error. @@ -166,7 +176,7 @@ class ttAdmin { // // 1) Users may mark some of them deleted during their work. // If we mark all of them deleted here, we can't recover nicely - // as we'll lose track of what was deleted by user. + // as we'll lose track of what was accidentally deleted by user. // // 2) DB maintenance script (Clean up DB from inactive groups) should // get rid of these items permanently eventually.