X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttTeamHelper.class.php;h=2344fe321e63b8cc5da0b2a5ea3846ad99dacbf6;hb=a46ca9f2c279305fc8a6c7456e23f4ef46fd6fe4;hp=3b01415ecd8740a00513723a47303ba325d3ee4f;hpb=1ad0313b11df884c04ca0354abcbc18e4b334537;p=timetracker.git diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index 3b01415e..2344fe32 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -263,6 +263,58 @@ 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, rank, description from tt_roles where team_id = $team_id and status = 1 order by rank"; + $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, rank, description from tt_roles + where team_id = $team_id and status = 0 order by rank"; + $res = $mdb2->query($sql); + $result = array(); + if (!is_a($res, 'PEAR_Error')) { + while ($val = $res->fetchRow()) { + $result[] = $val; + } + } + return $result; + } + + // getAllRoles - obtains all roles defined for team. + static function getAllRoles($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; + } + // The getActiveClients returns an array of active clients for team. static function getActiveClients($team_id, $all_fields = false) { @@ -485,23 +537,6 @@ 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();