diff --git a/custom/Espo/Custom/Resources/i18n/de_DE/CDokumente.json b/custom/Espo/Custom/Resources/i18n/de_DE/CDokumente.json index 07712685..54617d02 100644 --- a/custom/Espo/Custom/Resources/i18n/de_DE/CDokumente.json +++ b/custom/Espo/Custom/Resources/i18n/de_DE/CDokumente.json @@ -42,7 +42,7 @@ "syncStatus": "Status der Synchronisation: pending_sync = Warte auf Sync, clean = erfolgreich, unclean = Abweichungen, failed = Fehler", "xaiId": "Eindeutige ID für x.AI Synchronisation", "xaiCollections": "Liste der x.AI Collections für dieses Dokument", - "xaiSyncStatus": "Status der x.AI Synchronisation: pending_sync = Warte auf Sync, clean = erfolgreich, unclean = Abweichungen, failed = Fehler", + "xaiSyncStatus": "Status der x.AI Synchronisation: pending_sync = Warte auf Sync, clean = erfolgreich synchronisiert, unclean = Änderungen ausstehend, failed = Fehler, no_sync = Nicht synchronisiert", "fileStatus": "Status der Datei: new = neu hochgeladen, changed = geändert, unchanged = unverändert" }, "options": { diff --git a/custom/Espo/Custom/Resources/i18n/en_US/CDokumente.json b/custom/Espo/Custom/Resources/i18n/en_US/CDokumente.json index dac7fc10..668a136b 100644 --- a/custom/Espo/Custom/Resources/i18n/en_US/CDokumente.json +++ b/custom/Espo/Custom/Resources/i18n/en_US/CDokumente.json @@ -45,7 +45,7 @@ "syncStatus": "Synchronization status: pending_sync = Waiting for sync, clean = successful, unclean = discrepancies, failed = error", "xaiId": "Unique ID for x.AI synchronization", "xaiCollections": "List of x.AI collections for this document", - "xaiSyncStatus": "x.AI synchronization status: pending_sync = Waiting for sync, clean = successful, unclean = discrepancies, failed = error", + "xaiSyncStatus": "x.AI synchronization status: pending_sync = Waiting for sync, clean = successfully synchronized, unclean = changes pending, failed = error, no_sync = Not synchronized", "fileStatus": "File status: new = newly uploaded, changed = modified, unchanged = unchanged" }, "options": { @@ -56,11 +56,11 @@ "failed": "Failed" }, "xaiSyncStatus": { - "pending_sync": "Warte auf Sync", - "clean": "Synchronisiert", - "unclean": "Abweichungen", - "failed": "Fehlgeschlagen", - "no_sync": "Kein Sync" + "pending_sync": "Waiting for Sync", + "clean": "Synchronized", + "unclean": "Changes Pending", + "failed": "Failed", + "no_sync": "No Sync" }, "fileStatus": { "new": "New", diff --git a/custom/Espo/Custom/Resources/metadata/entityDefs/CDokumente.json b/custom/Espo/Custom/Resources/metadata/entityDefs/CDokumente.json index 57e7cb4a..e75afd0f 100644 --- a/custom/Espo/Custom/Resources/metadata/entityDefs/CDokumente.json +++ b/custom/Espo/Custom/Resources/metadata/entityDefs/CDokumente.json @@ -138,7 +138,7 @@ "failed": "danger", "no_sync": null }, - "default": "pending_sync", + "default": "no_sync", "tooltip": true, "isCustom": true }, diff --git a/custom/Espo/Custom/Resources/metadata/formula/CDokumente.json b/custom/Espo/Custom/Resources/metadata/formula/CDokumente.json new file mode 100644 index 00000000..1609b504 --- /dev/null +++ b/custom/Espo/Custom/Resources/metadata/formula/CDokumente.json @@ -0,0 +1,3 @@ +{ + "beforeSaveScript": "// Automatische x.AI Sync-Status Verwaltung\n\n// Fall 1: xaiId wurde gelöscht (war vorher vorhanden, jetzt leer)\nif (\n attribute\\fetched('xaiId') != null &&\n xaiId == null\n) {\n xaiSyncStatus = 'no_sync';\n}\n// Fall 2: xaiId wird neu gesetzt (war vorher leer, jetzt gefüllt)\nelse if (\n attribute\\fetched('xaiId') == null &&\n xaiId != null\n) {\n xaiSyncStatus = 'pending_sync';\n}\n// Fall 3: Dokument hat xaiId und relevante Felder haben sich geändert\nelse if (\n xaiId != null &&\n xaiSyncStatus != 'no_sync' &&\n (\n attribute\\isChanged('name') ||\n attribute\\isChanged('description') ||\n attribute\\isChanged('dokumentId') ||\n attribute\\isChanged('md5sum') ||\n attribute\\isChanged('sha256')\n )\n) {\n xaiSyncStatus = 'unclean';\n}\n// Fall 4: Bei neuem Dokument MIT xaiId → pending_sync\nelse if (\n entity\\isNew() &&\n xaiId != null\n) {\n xaiSyncStatus = 'pending_sync';\n}\n// Fall 5: Bei neuem Dokument OHNE xaiId → no_sync\nelse if (\n entity\\isNew() &&\n xaiId == null\n) {\n xaiSyncStatus = 'no_sync';\n}" +} diff --git a/data/config.php b/data/config.php index c1b39817..266d2bc6 100644 --- a/data/config.php +++ b/data/config.php @@ -358,7 +358,7 @@ return [ 0 => 'youtube.com', 1 => 'google.com' ], - 'microtime' => 1772997255.867614, + 'microtime' => 1772997342.745464, 'siteUrl' => 'https://crm.bitbylaw.com', 'fullTextSearchMinLength' => 4, 'webSocketUrl' => 'ws://api.bitbylaw.com:5000/espocrm/ws', diff --git a/data/state.php b/data/state.php index fe506da5..6a6d4dc2 100644 --- a/data/state.php +++ b/data/state.php @@ -1,7 +1,7 @@ 1772997256, - 'microtimeState' => 1772997256.02, + 'cacheTimestamp' => 1772997342, + 'microtimeState' => 1772997342.877304, 'currencyRates' => [ 'EUR' => 1.0 ],