From cc89430b244535c67dbb7d1f8813a4ba56b1ffc0 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 6 Nov 2018 15:25:31 +0000 Subject: [PATCH] More use of getActiveGroup as part of ongoing subgroup support. --- WEB-INF/lib/ttClientHelper.class.php | 15 +++++++-------- WEB-INF/templates/footer.tpl | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/WEB-INF/lib/ttClientHelper.class.php b/WEB-INF/lib/ttClientHelper.class.php index afa7afbd..85545898 100644 --- a/WEB-INF/lib/ttClientHelper.class.php +++ b/WEB-INF/lib/ttClientHelper.class.php @@ -41,8 +41,8 @@ class ttClientHelper { else $sql .= 'name '; - $sql .= "from tt_clients where group_id = $user->group_id - and id = $client_id and (status = 1 or status = 0)"; + $sql .= "from tt_clients where group_id = ".$user->getActiveGroup(). + " and id = $client_id and (status = 1 or status = 0)"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { $val = $res->fetchRow(); @@ -59,8 +59,7 @@ class ttClientHelper { $result = array(); $mdb2 = getConnection(); - $sql = "select id, name from tt_clients - where group_id = $user->group_id and (status = 0 or status = 1) order by upper(name)"; + $sql = "select id, name from tt_clients where group_id = ".$user->getActiveGroup()." and (status = 0 or status = 1) order by upper(name)"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { while ($val = $res->fetchRow()) { @@ -76,8 +75,8 @@ class ttClientHelper { $mdb2 = getConnection(); global $user; - $sql = "select id from tt_clients where group_id = $user->group_id and name = ". - $mdb2->quote($client_name)." and (status = 1 or status = 0)"; + $sql = "select id from tt_clients where group_id = ".$user->getActiveGroup(). + " and name = ".$mdb2->quote($client_name)." and (status = 1 or status = 0)"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { @@ -95,8 +94,8 @@ class ttClientHelper { $mdb2 = getConnection(); global $user; - $sql = "select name, address from tt_clients where group_id = $user->group_id - and id = $client_id and status is NULL"; + $sql = "select name, address from tt_clients where group_id = ".$user->getActiveGroup(). + " and id = $client_id and status is NULL"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { $val = $res->fetchRow(); diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index bd83dd66..cca966e6 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.08.4373 | Copyright © Anuko | +  Anuko Time Tracker 1.18.08.4374 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.39.5