$sql = 'insert into tt_groups '.$columns.$values;
$affected = $mdb2->exec($sql);
- if (!is_a($affected, 'PEAR_Error')) {
- $group_id = $mdb2->lastInsertID('tt_groups', 'id');
- return $group_id;
- }
- return false;
+ if (is_a($affected, 'PEAR_Error')) return false;
+
+ $group_id = $mdb2->lastInsertID('tt_groups', 'id');
+
+ // Update org_id with group_id.
+ // NOTE: Both export and import need an additional effort to properly operate on subgroups.
+ // Currently we are importing one group only, which becomes a top level group.
+ $sql = "update tt_groups set org_id = $group_id where org_id is NULL and id = $group_id";
+ $affected = $mdb2->exec($sql);
+ if (is_a($affected, 'PEAR_Error')) return false;
+
+ return $group_id;
}
// insertMonthlyQuota - a helper function to insert a monthly quota.
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.06.4348 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.06.4349 | 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>