Rolling back getUsers as previous commit broke export-import.
authorNik Okuntseff <support@anuko.com>
Wed, 21 Nov 2018 18:23:49 +0000 (18:23 +0000)
committerNik Okuntseff <support@anuko.com>
Wed, 21 Nov 2018 18:23:49 +0000 (18:23 +0000)
WEB-INF/lib/ttGroupExportHelper.class.php
WEB-INF/templates/footer.tpl

index a520e7f..54b8aaa 100644 (file)
@@ -82,6 +82,23 @@ class ttGroupExportHelper {
     return $val;
   }
 
+  // The getUsers obtains all users in group for the purpose of export.
+  private function getUsers() {
+    global $user;
+    $mdb2 = getConnection();
+    $sql = "select u.*, r.rank from tt_users u left join tt_roles r on (u.role_id = r.id)".
+      " where u.group_id = $this->group_id and u.org_id = $user->org_id order by upper(u.name)"; // Note: deleted users are included.
+    $res = $mdb2->query($sql);
+    $result = array();
+    if (!is_a($res, 'PEAR_Error')) {
+      while ($val = $res->fetchRow()) {
+        $result[] = $val;
+      }
+      return $result;
+    }
+    return false;
+  }
+
   // getRecordsFromTable - obtains all fields from a given table for a group.
   function getRecordsFromTable($table_name) {
     global $user;
@@ -132,7 +149,7 @@ class ttGroupExportHelper {
     unset($group_part);
 
     // Prepare user map.
-    $users = $this->getRecordsFromTable('tt_users');
+    $users = $this->getUsers();
     foreach ($users as $key=>$user_item)
       $this->userMap[$user_item['id']] = $key + 1;
 
index 7e7093d..d6b001f 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.25.4485 | 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.26.4486 | 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>