More use of getActiveGroup as part of ongoing subgroup support.
authorNik Okuntseff <support@anuko.com>
Tue, 6 Nov 2018 15:25:31 +0000 (15:25 +0000)
committerNik Okuntseff <support@anuko.com>
Tue, 6 Nov 2018 15:25:31 +0000 (15:25 +0000)
WEB-INF/lib/ttClientHelper.class.php
WEB-INF/templates/footer.tpl

index afa7afb..8554589 100644 (file)
@@ -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();
index bd83dd6..cca966e 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.18.08.4373 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.18.08.4374 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>