Wrote ttGroupHelper::getGroupAttrs function.
authorNik Okuntseff <support@anuko.com>
Fri, 23 Nov 2018 12:26:28 +0000 (12:26 +0000)
committerNik Okuntseff <support@anuko.com>
Fri, 23 Nov 2018 12:26:28 +0000 (12:26 +0000)
WEB-INF/lib/ttGroupHelper.class.php

index a6d5fea..21e62a6 100644 (file)
@@ -205,4 +205,18 @@ class ttGroupHelper {
     $affected = $mdb2->exec($sql);
     return (!is_a($affected, 'PEAR_Error'));
   }
+
+  // getGroupAttrs obtains all group attributes.
+  static function getGroupAttrs($group_id) {
+    global $user;
+    $mdb2 = getConnection();
+
+    $sql =  "select * from tt_groups".
+            " where status = 1 and id = $group_id and org_id = $user->org_id";
+    $res = $mdb2->query($sql);
+    if (!is_a($res, 'PEAR_Error')) {
+      $val = $res->fetchRow();
+    }
+    return $val;
+  }
 }