From: Nik Okuntseff Date: Fri, 28 Jun 2019 13:35:10 +0000 (+0000) Subject: Adjusted export-import to work with entity type in custom fields. X-Git-Tag: timetracker_1.19-1~10 X-Git-Url: http://wagnertech.de/git?p=timetracker.git;a=commitdiff_plain;h=770d560338b34e0a869c78778d0cd838905fb192 Adjusted export-import to work with entity type in custom fields. --- diff --git a/WEB-INF/lib/ttGroupExportHelper.class.php b/WEB-INF/lib/ttGroupExportHelper.class.php index 8a7b7e77..cd38de9d 100644 --- a/WEB-INF/lib/ttGroupExportHelper.class.php +++ b/WEB-INF/lib/ttGroupExportHelper.class.php @@ -406,6 +406,7 @@ class ttGroupExportHelper { fwrite($this->file, $this->indentation." \n"); foreach ($custom_fields as $custom_field) { $custom_field_part = $this->indentation.' '."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']."\""; diff --git a/WEB-INF/lib/ttOrgImportHelper.class.php b/WEB-INF/lib/ttOrgImportHelper.class.php index b9c76620..20dd4176 100644 --- a/WEB-INF/lib/ttOrgImportHelper.class.php +++ b/WEB-INF/lib/ttOrgImportHelper.class.php @@ -352,6 +352,7 @@ class ttOrgImportHelper { $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'], @@ -1114,14 +1115,15 @@ class ttOrgImportHelper { $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". - " (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; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 11c4f8cb..3beac641 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.19.6.5019 | Copyright © Anuko | +  Anuko Time Tracker 1.19.6.5020 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve}