X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/bf4f6db7b2772e4cc3a0e382a7af35a144ce1c78..8d68ecdd7b1c45cb2a5cf592b8d504d7e4614911:/WEB-INF/lib/ttRoleHelper.class.php diff --git a/WEB-INF/lib/ttRoleHelper.class.php b/WEB-INF/lib/ttRoleHelper.class.php index 3e6e73e1..329e0a82 100644 --- a/WEB-INF/lib/ttRoleHelper.class.php +++ b/WEB-INF/lib/ttRoleHelper.class.php @@ -129,13 +129,13 @@ class ttRoleHelper { } // getRoleByRank looks up a role by its rank. - static function getRoleByRank($rank) { + static function getRoleByRank($rank, $team_id) { global $user; $mdb2 = getConnection(); $rank = (int) $rank; // Cast to int just in case for better security. - $sql = "select id from tt_roles where team_id = $user->team_id and rank = $rank and (status = 1 or status = 0)"; + $sql = "select id from tt_roles where team_id = $team_id and rank = $rank and (status = 1 or status = 0)"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { @@ -195,22 +195,6 @@ class ttRoleHelper { return true; } - // rolesExist - checks whether roles for team already exist. - static function rolesExist() - { - $mdb2 = getConnection(); - global $user; - - $sql = "select count(*) as count from tt_roles where team_id = $user->team_id"; - $res = $mdb2->query($sql); - if (!is_a($res, 'PEAR_Error')) { - $val = $res->fetchRow(); - if ($val['count'] > 0) - return true; // Roles for team exist. - } - return false; - } - // createPredefinedRoles - creates a set of predefined roles for the team to use. static function createPredefinedRoles($team_id, $lang) {