X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttTeamHelper.class.php;h=e306ced8722f2755bcb5c67f5d1d752030e1c2e5;hb=ad98b13400fdc2fa2299a22c9bd54c4cd27960c3;hp=e88492e511e4092537eda692fad419a2e0e93a2a;hpb=ebcf3daac421df8e3925e5fff52b26d4bb789286;p=timetracker.git diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index e88492e5..e306ced8 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -263,6 +263,41 @@ class ttTeamHelper { return false; } + // getActiveRoles - returns an array of active roles for team. + static function getActiveRoles($team_id) + { + $result = array(); + $mdb2 = getConnection(); + + $sql = "select id, name, description from tt_roles where team_id = $team_id and status = 1 order by upper(name)"; + $res = $mdb2->query($sql); + $result = array(); + if (!is_a($res, 'PEAR_Error')) { + while ($val = $res->fetchRow()) { + $result[] = $val; + } + } + return $result; + } + + // getInactiveRoles - returns an array of inactive roles for team. + static function getInactiveRoles($team_id) + { + $result = array(); + $mdb2 = getConnection(); + + $sql = "select id, name, description from tt_roles + where team_id = $team_id and status = 0 order by upper(name)"; + $res = $mdb2->query($sql); + $result = array(); + if (!is_a($res, 'PEAR_Error')) { + while ($val = $res->fetchRow()) { + $result[] = $val; + } + } + return $result; + } + // The getActiveClients returns an array of active clients for team. static function getActiveClients($team_id, $all_fields = false) { @@ -485,6 +520,23 @@ class ttTeamHelper { return false; } + // getRoles - obtains all roles defined for team. + static function getRoles($team_id) { + $mdb2 = getConnection(); + + $result = array(); + $sql = "select * from tt_roles where team_id = $team_id"; + $res = $mdb2->query($sql); + $result = array(); + if (!is_a($res, 'PEAR_Error')) { + while ($val = $res->fetchRow()) { + $result[] = $val; + } + return $result; + } + return false; + } + // getExpenseItems - obtains all expense items for all users in team. static function getExpenseItems($team_id) { $mdb2 = getConnection();