// +----------------------------------------------------------------------+
import('ttUserHelper');
-import('ttRoleHelper');
import('ttTaskHelper');
-import('ttClientHelper');
import('ttInvoiceHelper');
-import('ttTimeHelper');
-import('ttExpenseHelper');
-import('ttFavReportHelper');
// ttOrgImportHelper class is used to import organization data from an XML file
// prepared by ttOrgExportHelper and consisting of nested groups with their info.
// Constructor.
function __construct(&$errors) {
$this->errors = &$errors;
- $this->top_role_id = ttRoleHelper::getRoleByRank(512, 0);
+ $this->top_role_id = $this->getTopRole();
}
// startElement - callback handler for opening tags in XML.
$affected = $mdb2->exec($sql);
return (!is_a($affected, 'PEAR_Error'));
}
+
+ // getTopRole returns top role id.
+ private function getTopRole() {
+ global $user;
+ $mdb2 = getConnection();
+
+ $sql = "select id from tt_roles where group_id = 0 and rank = ".MAX_RANK." and status = 1";
+ $res = $mdb2->query($sql);
+
+ if (!is_a($res, 'PEAR_Error')) {
+ $val = $res->fetchRow();
+ if ($val['id'])
+ return $val['id'];
+ }
+ return false;
+ }
}
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.28.4546 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.28.4547 | 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>