]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/ttGroupHelper.class.php
Wrote getGroups function for ttUser class.
[timetracker.git] / WEB-INF / lib / ttGroupHelper.class.php
index 9fcb8443e889fa847f4ab1f073f8f26397f78a18..d28c30670e8eb26c07d91d055f79c977ac51da3e 100644 (file)
@@ -35,8 +35,8 @@ class ttGroupHelper {
     $result = array();
     $mdb2 = getConnection();
 
-    // TODO: when we have subgroups, improve the query to return only top groups.
-    $sql =  "select id, name, created, lang from tt_teams where status = 1 order by id desc";
+    $sql =  "select id, name, created, lang from tt_groups".
+            " where status = 1 and org_id is NULL or org_id = id order by id desc";
     $res = $mdb2->query($sql);
     $result = array();
     if (!is_a($res, 'PEAR_Error')) {