X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/2d4eeda71b7c65a7af5359cb1ec2f29537d43d3a..ee3957cfc30d8ba3ed92ac99f3e5b784df1a9c58:/WEB-INF/lib/ttUser.class.php diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 6bac7cb4..8e9a8f21 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -410,6 +410,20 @@ class ttUser { return $groups; } + // getSubgroups obtains a list of immediate subgroups. + function getSubgroups() { + $mdb2 = getConnection(); + + $sql = "select id, name, description from tt_groups where org_id = $this->org_id and parent_id = ".$this->getActiveGroup();; + $res = $mdb2->query($sql); + if (!is_a($res, 'PEAR_Error')) { + while ($val = $res->fetchRow()) { + $groups[] = $val; // array('id'=>$val['id'],'name'=>$val['name']); + } + } + return $groups; + } + // getUser function is used to manage users in group and returns user details. // At the moment, the function is used for user edits and deletes. function getUser($user_id) {