From 8a47b340fd212894ebb7b4456f3f0cb647c9ac68 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 23 Nov 2018 12:26:28 +0000 Subject: [PATCH] Wrote ttGroupHelper::getGroupAttrs function. --- WEB-INF/lib/ttGroupHelper.class.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/WEB-INF/lib/ttGroupHelper.class.php b/WEB-INF/lib/ttGroupHelper.class.php index a6d5fea7..21e62a60 100644 --- a/WEB-INF/lib/ttGroupHelper.class.php +++ b/WEB-INF/lib/ttGroupHelper.class.php @@ -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; + } } -- 2.20.1