+ // isClientRole determines if the role is a "client" role.
+ // This simply means the role has no "track_own_time" right.
+ static function isClientRole($role_id) {
+ global $user;
+ $mdb2 = getConnection();
+
+ $sql = "select rights from tt_roles where team_id = $user->team_id and id = $role_id";
+ $res = $mdb2->query($sql);
+
+ if (!is_a($res, 'PEAR_Error')) {
+ $val = $res->fetchRow();
+ if ($val['rights']) {
+ return !in_array('track_own_time', explode(',', $val['rights']));
+ }
+ }
+ return false;
+ }
+
+ // getRoleByRank looks up a role by its rank.
+ static function getRoleByRank($rank, $team_id) {