X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/c059d4ceb33fc1a959028abd85808e33b910cf7e..29d6481a7dc9e1538be50a942e4891db17467ec4:/WEB-INF/lib/ttGroupHelper.class.php diff --git a/WEB-INF/lib/ttGroupHelper.class.php b/WEB-INF/lib/ttGroupHelper.class.php index 780e39ed..ad231675 100644 --- a/WEB-INF/lib/ttGroupHelper.class.php +++ b/WEB-INF/lib/ttGroupHelper.class.php @@ -564,4 +564,23 @@ class ttGroupHelper { return true; // All is good. } + + // The getUsers obtains all active and inactive (but not deleted) users in a group. + static function getUsers() { + global $user; + $mdb2 = getConnection(); + + $group_id = $user->getGroup(); + $org_id = $user->org_id; + + $sql = "select id, name from tt_users where group_id = $group_id and org_id = $org_id and (status = 1 or status = 0) order by upper(name)"; + $res = $mdb2->query($sql); + $user_list = array(); + if (is_a($res, 'PEAR_Error')) + return false; + while ($val = $res->fetchRow()) { + $user_list[] = $val; + } + return $user_list; + } }