fwrite($file, "</team>\n");
// Prepare role map.
- $roles = ttExportHelper::getAllRoles();
+ $roles = $this->getRoles();
foreach ($roles as $key=>$role_item)
$this->roleMap[$role_item['id']] = $key + 1;
// Prepare user map.
- $users = ttExportHelper::getAllUsers();
+ $users = $this->getUsers();
foreach ($users as $key=>$user_item)
$this->userMap[$user_item['id']] = $key + 1;
return true;
}
- // getAllRoles - obtains all roles defined for team.
- static function getAllRoles() {
+ /*
+ * Note about the utility functions below.
+ * We have roughly 3 groups of operations:
+ * 1) Regular system usage for tracking time, etc.
+ * 2) Admin usage - used infrequently.
+ * 3) Export - used infrequently.
+ *
+ * It is tempting to have a generic function to get things done for
+ * all situations. However, as export and admin access are one-off
+ * operations, while regular system usage is daily and must be efficient,
+ * the current approach is to have SEPARATE functions for each mode.
+ *
+ * This is because each mode requires a slightly different approach,
+ * and we don't want to over-complicate things.
+ */
+
+ // getRoles - obtains all roles defined for team.
+ function getRoles() {
global $user;
$mdb2 = getConnection();
return false;
}
- // The getAllUsers obtains all users in team for the purpose of export.
- static function getAllUsers() {
+ // The getUsers obtains all users in team for the purpose of export.
+ function getUsers() {
global $user;
$mdb2 = getConnection();
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.52.4096 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.52.4097 | Copyright © <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>