Added conditional display of pages depending on subgroup active users.
[timetracker.git] / WEB-INF / lib / ttFavReportHelper.class.php
index ab9fa0e..36600e2 100644 (file)
@@ -80,7 +80,7 @@ class ttFavReportHelper {
     global $user;
     $mdb2 = getConnection();
 
-    $group_id = $user->getActiveGroup();
+    $group_id = $user->getGroup();
     $org_id = $user->org_id;
 
     $sql = "insert into tt_fav_reports".
@@ -107,13 +107,8 @@ class ttFavReportHelper {
     if (is_a($affected, 'PEAR_Error'))
       return false;
 
-    $sql = "select last_insert_id() as last_id";
-    $res = $mdb2->query($sql);
-    if (is_a($res, 'PEAR_Error'))
-      return false;
-
-    $val = $res->fetchRow();
-    return $val['last_id'];
+    $last_id = $mdb2->lastInsertID('tt_fav_reports', 'id');
+    return $last_id;
   }
 
   // updateReport - updates report options in the database.