fix: Update xaiSyncStatus descriptions and default value; adjust microtime and cacheTimestamp in config and state files; add beforeSaveScript for x.AI sync status management

This commit is contained in:
2026-03-08 20:16:51 +01:00
parent 1d3eb86c6e
commit 3547f47fc3
6 changed files with 14 additions and 11 deletions

View File

@@ -42,7 +42,7 @@
"syncStatus": "Status der Synchronisation: pending_sync = Warte auf Sync, clean = erfolgreich, unclean = Abweichungen, failed = Fehler", "syncStatus": "Status der Synchronisation: pending_sync = Warte auf Sync, clean = erfolgreich, unclean = Abweichungen, failed = Fehler",
"xaiId": "Eindeutige ID für x.AI Synchronisation", "xaiId": "Eindeutige ID für x.AI Synchronisation",
"xaiCollections": "Liste der x.AI Collections für dieses Dokument", "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" "fileStatus": "Status der Datei: new = neu hochgeladen, changed = geändert, unchanged = unverändert"
}, },
"options": { "options": {

View File

@@ -45,7 +45,7 @@
"syncStatus": "Synchronization status: pending_sync = Waiting for sync, clean = successful, unclean = discrepancies, failed = error", "syncStatus": "Synchronization status: pending_sync = Waiting for sync, clean = successful, unclean = discrepancies, failed = error",
"xaiId": "Unique ID for x.AI synchronization", "xaiId": "Unique ID for x.AI synchronization",
"xaiCollections": "List of x.AI collections for this document", "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" "fileStatus": "File status: new = newly uploaded, changed = modified, unchanged = unchanged"
}, },
"options": { "options": {
@@ -56,11 +56,11 @@
"failed": "Failed" "failed": "Failed"
}, },
"xaiSyncStatus": { "xaiSyncStatus": {
"pending_sync": "Warte auf Sync", "pending_sync": "Waiting for Sync",
"clean": "Synchronisiert", "clean": "Synchronized",
"unclean": "Abweichungen", "unclean": "Changes Pending",
"failed": "Fehlgeschlagen", "failed": "Failed",
"no_sync": "Kein Sync" "no_sync": "No Sync"
}, },
"fileStatus": { "fileStatus": {
"new": "New", "new": "New",

View File

@@ -138,7 +138,7 @@
"failed": "danger", "failed": "danger",
"no_sync": null "no_sync": null
}, },
"default": "pending_sync", "default": "no_sync",
"tooltip": true, "tooltip": true,
"isCustom": true "isCustom": true
}, },

View File

@@ -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}"
}

View File

@@ -358,7 +358,7 @@ return [
0 => 'youtube.com', 0 => 'youtube.com',
1 => 'google.com' 1 => 'google.com'
], ],
'microtime' => 1772997255.867614, 'microtime' => 1772997342.745464,
'siteUrl' => 'https://crm.bitbylaw.com', 'siteUrl' => 'https://crm.bitbylaw.com',
'fullTextSearchMinLength' => 4, 'fullTextSearchMinLength' => 4,
'webSocketUrl' => 'ws://api.bitbylaw.com:5000/espocrm/ws', 'webSocketUrl' => 'ws://api.bitbylaw.com:5000/espocrm/ws',

View File

@@ -1,7 +1,7 @@
<?php <?php
return [ return [
'cacheTimestamp' => 1772997256, 'cacheTimestamp' => 1772997342,
'microtimeState' => 1772997256.02, 'microtimeState' => 1772997342.877304,
'currencyRates' => [ 'currencyRates' => [
'EUR' => 1.0 'EUR' => 1.0
], ],