Adjusted export-import to work with entity type in custom fields.
authorNik Okuntseff <support@anuko.com>
Fri, 28 Jun 2019 13:35:10 +0000 (13:35 +0000)
committerNik Okuntseff <support@anuko.com>
Fri, 28 Jun 2019 13:35:10 +0000 (13:35 +0000)
WEB-INF/lib/ttGroupExportHelper.class.php
WEB-INF/lib/ttOrgImportHelper.class.php
WEB-INF/templates/footer.tpl

index 8a7b7e7..cd38de9 100644 (file)
@@ -406,6 +406,7 @@ class ttGroupExportHelper {
       fwrite($this->file, $this->indentation."  <custom_fields>\n");
       foreach ($custom_fields as $custom_field) {
         $custom_field_part = $this->indentation.'    '."<custom_field id=\"".$this->customFieldMap[$custom_field['id']]."\"";
       fwrite($this->file, $this->indentation."  <custom_fields>\n");
       foreach ($custom_fields as $custom_field) {
         $custom_field_part = $this->indentation.'    '."<custom_field id=\"".$this->customFieldMap[$custom_field['id']]."\"";
+        $custom_field_part .= " entity_type=\"".$custom_field['entity_type']."\"";
         $custom_field_part .= " type=\"".$custom_field['type']."\"";
         $custom_field_part .= " label=\"".htmlspecialchars($custom_field['label'])."\"";
         $custom_field_part .= " required=\"".$custom_field['required']."\"";
         $custom_field_part .= " type=\"".$custom_field['type']."\"";
         $custom_field_part .= " label=\"".htmlspecialchars($custom_field['label'])."\"";
         $custom_field_part .= " required=\"".$custom_field['required']."\"";
index b9c7662..20dd417 100644 (file)
@@ -352,6 +352,7 @@ class ttOrgImportHelper {
         $custom_field_id = $this->insertCustomField(array(
           'group_id' => $this->current_group_id,
           'org_id' => $this->org_id,
         $custom_field_id = $this->insertCustomField(array(
           'group_id' => $this->current_group_id,
           'org_id' => $this->org_id,
+          'entity_type' => $attrs['ENTITY_TYPE'],
           'type' => $attrs['TYPE'],
           'label' => $attrs['LABEL'],
           'required' => $attrs['REQUIRED'],
           'type' => $attrs['TYPE'],
           'label' => $attrs['LABEL'],
           'required' => $attrs['REQUIRED'],
@@ -1114,14 +1115,15 @@ class ttOrgImportHelper {
 
     $group_id = (int) $fields['group_id'];
     $org_id = (int) $fields['org_id'];
 
     $group_id = (int) $fields['group_id'];
     $org_id = (int) $fields['org_id'];
+    $entity_type = (int) $fields['entity_type'];
     $type = (int) $fields['type'];
     $label = $fields['label'];
     $required = (int) $fields['required'];
     $status = $fields['status'];
 
     $sql = "insert into tt_custom_fields".
     $type = (int) $fields['type'];
     $label = $fields['label'];
     $required = (int) $fields['required'];
     $status = $fields['status'];
 
     $sql = "insert into tt_custom_fields".
-      " (group_id, org_id, type, label, required, status)".
-      " values($group_id, $org_id, $type, ".$mdb2->quote($label).", $required, ".$mdb2->quote($status).")";
+      " (group_id, org_id, entity_type, type, label, required, status)".
+      " values($group_id, $org_id, $entity_type, $type, ".$mdb2->quote($label).", $required, ".$mdb2->quote($status).")";
     $affected = $mdb2->exec($sql);
     if (is_a($affected, 'PEAR_Error'))
       return false;
     $affected = $mdb2->exec($sql);
     if (is_a($affected, 'PEAR_Error'))
       return false;
index 11c4f8c..3beac64 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.19.6.5019 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.19.6.5020 | 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>
             <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>