From 7143cc6750a18461fcd29964c41f23b4cbd27d21 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 21 Nov 2018 18:23:49 +0000 Subject: [PATCH] Rolling back getUsers as previous commit broke export-import. --- WEB-INF/lib/ttGroupExportHelper.class.php | 19 ++++++++++++++++++- WEB-INF/templates/footer.tpl | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/ttGroupExportHelper.class.php b/WEB-INF/lib/ttGroupExportHelper.class.php index a520e7fb..54b8aaa1 100644 --- a/WEB-INF/lib/ttGroupExportHelper.class.php +++ b/WEB-INF/lib/ttGroupExportHelper.class.php @@ -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; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 7e7093dc..d6b001fa 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.25.4485 | Copyright © Anuko | +  Anuko Time Tracker 1.18.26.4486 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1