]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/ttGroupHelper.class.php
A bit more work in progress on subgroups.
[timetracker.git] / WEB-INF / lib / ttGroupHelper.class.php
index d28c30670e8eb26c07d91d055f79c977ac51da3e..22362b5b901b2bc933c9b00dbeb101540072e7a7 100644 (file)
@@ -48,4 +48,18 @@ class ttGroupHelper {
     }
     return false;
   }
+
+  // The getGroupName function returns group name.
+  static function getGroupName($group_id) {
+    $mdb2 = getConnection();
+
+    $sql = "select name from tt_groups where id = $group_id and (status = 1 or status = 0)";
+    $res = $mdb2->query($sql);
+
+    if (!is_a($res, 'PEAR_Error')) {
+      $val = $res->fetchRow();
+      return $val['name'];
+    }
+    return false;
+  }
 }