From 21682f141034f82653bc41b56eaabdf490d5a9dc Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 17 Mar 2018 21:36:21 +0000 Subject: [PATCH] Fixed export and import. Now teams should be imported with roles. --- WEB-INF/lib/ttTeamHelper.class.php | 18 ++++++++++++++++++ WEB-INF/templates/footer.tpl | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index bbca70e8..bbd188fc 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -139,6 +139,24 @@ class ttTeamHelper { return false; } + // The getAllUsers obtains all users in a given team. + static function getAllUsers($team_id, $all_fields = false) { + $mdb2 = getConnection(); + if ($all_fields) + $sql = "select * from tt_users where team_id = $team_id order by upper(name)"; + else + $sql = "select id, name from tt_users where team_id = $team_id order by upper(name)"; + $res = $mdb2->query($sql); + $result = array(); + if (!is_a($res, 'PEAR_Error')) { + while ($val = $res->fetchRow()) { + $result[] = $val; + } + return $result; + } + return false; + } + // getActiveProjects - returns an array of active projects for team. static function getActiveProjects($team_id) { diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index bdd8e576..8f6d687b 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.17.51.4095 | Copyright © Anuko | +  Anuko Time Tracker 1.17.52.4096 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1