X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttUser.class.php;h=6bac7cb468232b622ac728c9709e694ac346bb83;hb=7051fc8c0f68618bbaff5f8bb48d3478ce93836a;hp=469345b75c2c7621e0a8f900f8801df4363bc360;hpb=5e861d92d6d758ba4888e35109cc6df4ab5e2df1;p=timetracker.git diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 469345b7..6bac7cb4 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -192,10 +192,11 @@ class ttUser { $result = array(); $mdb2 = getConnection(); + $group_id = $this->behalf_group_id ? $this->behalf_group_id : $this->group_id; // Do a query with inner join to get assigned projects. $sql = "select p.id, p.name, p.description, p.tasks, upb.rate from tt_projects p inner join tt_user_project_binds upb on (upb.user_id = ".$this->getActiveUser()." and upb.project_id = p.id and upb.status = 1) - where p.group_id = $this->group_id and p.status = 1 order by p.name"; + where p.group_id = $group_id and p.status = 1 order by p.name"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { while ($val = $res->fetchRow()) {