X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=WEB-INF%2Flib%2FttUser.class.php;h=f163e58148146d9df290029bff29528ac15e3862;hb=d4834198f5649729ae58b220ba2fce6e11734607;hp=4145f6030f9871e84667b56ef45ceec391d8479a;hpb=d74142948db5d27a3bf144a8ee485318cc1330c3;p=timetracker.git diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 4145f603..f163e581 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -162,9 +162,14 @@ class ttUser { } } - // The getUser returns user id on behalf of whom the current user is operating. + // getUser returns user id on behalf of whom the current user is operating. function getUser() { - return ($this->behalf_id ? $this->behalf_id : $this->id); + return ($this->behalfUser ? $this->behalfUser->id : $this->id); + } + + // getQuotaPercent returns quota percent for active user. + function getQuotaPercent() { + return ($this->behalfUser ? $this->behalfUser->quota_percent : $this->quota_percent); } // The getGroup returns group id on behalf of which the current user is operating. @@ -537,7 +542,7 @@ class ttUser { // then rank restriction does not apply. $max_rank = $this->behalfGroup ? MAX_RANK : $this->rank; - $sql = "select u.id, u.name, u.login, u.role_id, u.client_id, u.status, u.rate, u.email from tt_users u". + $sql = "select u.id, u.name, u.login, u.role_id, u.client_id, u.status, u.rate, u.quota_percent, u.email from tt_users u". " left join tt_roles r on (u.role_id = r.id)". " where u.id = $user_id and u.group_id = $group_id and u.org_id = $org_id and u.status is not null". " and (r.rank < $max_rank or (r.rank = $max_rank and u.id = $this->id))"; // Users with lesser roles or self.