]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/ttUser.class.php
Removed group selector from tasks.php to keep things simple.
[timetracker.git] / WEB-INF / lib / ttUser.class.php
index d320e38156d2c03f662389b020c9addcd44ee257..2d7f1c9852f68bd18ba62dd4aaa2c91bcf0f6fad 100644 (file)
@@ -113,9 +113,9 @@ class ttUser {
       $this->role_id = $val['role_id'];
       $this->role_name = $val['role_name'];
       $this->rights = explode(',', $val['rights']);
-      $this->is_client = !in_array('track_own_time', $this->rights);
       $this->rank = $val['rank'];
       $this->client_id = $val['client_id'];
+      $this->is_client = $this->client_id && !in_array('track_own_time', $this->rights);
       $this->email = $val['email'];
       $this->lang = $val['lang'];
       $this->decimal_mark = $val['decimal_mark'];
@@ -294,8 +294,11 @@ class ttUser {
     $mdb2 = getConnection();
     $tasks = implode(',', $task_ids); // This is a comma-separated list of task ids.
 
+    $group_id = $this->getGroup();
+    $org_id = $this->org_id;
+
     $sql = "select id, name, description from tt_tasks".
-      " where group_id = $this->group_id and status = 1 and id in ($tasks) order by name";
+      " where group_id = $group_id and org_id = $org_id and status = 1 and id in ($tasks) order by name";
     $res = $mdb2->query($sql);
     if (!is_a($res, 'PEAR_Error')) {
       while ($val = $res->fetchRow()) {