Adjusted export-import to work with groups keys.
authorNik Okuntseff <support@anuko.com>
Tue, 19 Mar 2019 16:02:38 +0000 (16:02 +0000)
committerNik Okuntseff <support@anuko.com>
Tue, 19 Mar 2019 16:02:38 +0000 (16:02 +0000)
WEB-INF/lib/ttGroupExportHelper.class.php
WEB-INF/lib/ttOrgImportHelper.class.php
WEB-INF/templates/footer.tpl

index 9f0465d..8a7b7e7 100644 (file)
@@ -123,7 +123,8 @@ class ttGroupExportHelper {
 
     // Write group info.
     $group = $this->getGroupAttrs();
-    $group_part = "<group name=\"".htmlspecialchars($group['name'])."\"";
+    $group_part = "<group group_key=\"".htmlspecialchars($group['group_key'])."\"";
+    $group_part .= " name=\"".htmlspecialchars($group['name'])."\"";
     $group_part .= " description=\"".htmlspecialchars($group['description'])."\"";
     $group_part .= " currency=\"".htmlspecialchars($group['currency'])."\"";
     $group_part .= " decimal_mark=\"".$group['decimal_mark']."\"";
index 2a54473..b9c7662 100644 (file)
@@ -102,6 +102,7 @@ class ttOrgImportHelper {
         $this->current_group_id = $this->createGroup(array(
           'parent_id' => $this->current_group_id, // Note: after insert current_group_id changes.
           'org_id' => $this->org_id,
+          'group_key' => $attrs['GROUP_KEY'],
           'name' => $attrs['NAME'],
           'description' => $attrs['DESCRIPTION'],
           'currency' => $attrs['CURRENCY'],
@@ -686,14 +687,15 @@ class ttOrgImportHelper {
     global $i18n;
     $mdb2 = getConnection();
 
-    $columns = '(parent_id, org_id, name, description, currency, decimal_mark, lang, date_format, time_format'.
-      ', week_start, tracking_mode, project_required, task_required, record_type, bcc_email'.
-      ', allow_ip, password_complexity, plugins, lock_spec'.
-      ', workday_minutes, config, created, created_ip, created_by)';
+    $columns = '(parent_id, org_id, group_key, name, description, currency, decimal_mark, lang, date_format, time_format,'.
+      ' week_start, tracking_mode, project_required, task_required, record_type, bcc_email,'.
+      ' allow_ip, password_complexity, plugins, lock_spec,'.
+      ' workday_minutes, config, created, created_ip, created_by)';
 
     $values = ' values (';
     $values .= $mdb2->quote($fields['parent_id']);
     $values .= ', '.$mdb2->quote($fields['org_id']);
+    $values .= ', '.$mdb2->quote(trim($fields['group_key']));
     $values .= ', '.$mdb2->quote(trim($fields['name']));
     $values .= ', '.$mdb2->quote(trim($fields['description']));
     $values .= ', '.$mdb2->quote(trim($fields['currency']));
index 4054a4a..060b8e0 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.18.61.4880 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.18.61.4881 | Copyright &copy; <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>