From 51d9f7fa22c6f9a5ee07fb7f9495afcd5c1d2ebc Mon Sep 17 00:00:00 2001 From: bsiggel Date: Wed, 11 Mar 2026 22:45:42 +0100 Subject: [PATCH] Refactor Blake3 hashing implementation in CDokumente; update localization and metadata files --- .../Custom/Hooks/CDokumente/CDokumente.php | 2 +- .../Resources/i18n/de_DE/CDokumente.json | 12 +--- .../Resources/i18n/en_US/CDokumente.json | 13 +--- .../Resources/layouts/CDokumente/detail.json | 72 +------------------ .../metadata/entityDefs/CDokumente.json | 51 +++++-------- data/config.php | 2 +- data/state.php | 4 +- 7 files changed, 27 insertions(+), 129 deletions(-) diff --git a/custom/Espo/Custom/Hooks/CDokumente/CDokumente.php b/custom/Espo/Custom/Hooks/CDokumente/CDokumente.php index cf32dea9..4c2b5578 100644 --- a/custom/Espo/Custom/Hooks/CDokumente/CDokumente.php +++ b/custom/Espo/Custom/Hooks/CDokumente/CDokumente.php @@ -41,7 +41,7 @@ class CDokumente extends \Espo\Core\Hooks\Base return; } - $newBlake3 = bin2hex(blake3($fileContent)); + $newBlake3 = \blake3($fileContent); // Setze Hash $entity->set('blake3hash', $newBlake3); diff --git a/custom/Espo/Custom/Resources/i18n/de_DE/CDokumente.json b/custom/Espo/Custom/Resources/i18n/de_DE/CDokumente.json index 55703cc5..25be3a0f 100644 --- a/custom/Espo/Custom/Resources/i18n/de_DE/CDokumente.json +++ b/custom/Espo/Custom/Resources/i18n/de_DE/CDokumente.json @@ -2,9 +2,7 @@ "fields": { "dokument": "Download", "preview": "Vorschau", - "ydocumentuuid": "Y-Document-UUID", "blake3hash": "Blake3-Hash", - "fileStatus": "Datei-Status", "contactsvmhdokumente": "Freigegebene Nutzer", "vmhMietverhltnisesDokumente": "Mietverhältnisse", "vmhErstgespraechsdokumente": "Erstgespräche", @@ -40,14 +38,6 @@ "Create CDokumente": "Dokument erstellen" }, "tooltips": { - "blake3hash": "Kryptografischer Blake3-Hash der Datei (schneller und sicherer als MD5/SHA256)", - "fileStatus": "Status der Datei: new = neu hochgeladen, changed = geändert, synced = synchronisiert" - }, - "options": { - "fileStatus": { - "new": "Neu", - "changed": "Geändert", - "synced": "Synchronisiert" - } + "blake3hash": "Kryptografischer Blake3-Hash der Datei (schneller und sicherer als MD5/SHA256)" } } \ No newline at end of file diff --git a/custom/Espo/Custom/Resources/i18n/en_US/CDokumente.json b/custom/Espo/Custom/Resources/i18n/en_US/CDokumente.json index c1b6116a..da762c57 100644 --- a/custom/Espo/Custom/Resources/i18n/en_US/CDokumente.json +++ b/custom/Espo/Custom/Resources/i18n/en_US/CDokumente.json @@ -1,7 +1,6 @@ { "fields": { "dokument": "Download", - "ydocumentuuid": "Y-Document-UUID", "preview": "Preview", "contactsvmhdokumente": "Portal Users", "vmhMietverhltnisesDokumente": "Tenancies", @@ -13,8 +12,6 @@ "mietobjekt2dokumente": "Properties", "mietinkassosdokumente": "Rent Collection", "kndigungensdokumente": "Terminations", - "fileStatus": "File Status", - "advowareAktens": "Advoware Akten", "advowareAktens": "Advoware Akten", "aIKnowledges": "AI Knowledge", "advowareAktenHnr": "Advoware HNR", @@ -46,14 +43,6 @@ "listForAIKnowledge": "List for AI Knowledge" }, "tooltips": { - "blake3hash": "Cryptographic Blake3 hash of the file (faster and more secure than MD5/SHA256)", - "fileStatus": "File status: new = newly uploaded, changed = modified, synced = synchronized" - }, - "options": { - "fileStatus": { - "new": "New", - "changed": "Changed", - "synced": "Synchronized" - } + "blake3hash": "Cryptographic Blake3 hash of the file (faster and more secure than MD5/SHA256)" } } \ No newline at end of file diff --git a/custom/Espo/Custom/Resources/layouts/CDokumente/detail.json b/custom/Espo/Custom/Resources/layouts/CDokumente/detail.json index eb0ca04f..c4d84f36 100644 --- a/custom/Espo/Custom/Resources/layouts/CDokumente/detail.json +++ b/custom/Espo/Custom/Resources/layouts/CDokumente/detail.json @@ -40,9 +40,8 @@ "rows": [ [ { - "name": "ydocumentuuid" - }, - {} + "name": "blake3hash" + } ] ], "dynamicLogicVisible": null, @@ -52,73 +51,6 @@ "hidden": false, "noteText": null, "noteStyle": "info", - "customLabel": "Externe Identifikatoren" - }, - { - "rows": [ - [ - { - "name": "fileStatus" - }, - { - "name": "blake3hash" - }, - {} - ] - ], - "dynamicLogicVisible": null, - "style": "default", - "tabBreak": false, - "tabLabel": null, - "hidden": false, - "noteText": null, - "noteStyle": "info", "customLabel": "Technische Daten" - }, - { - "rows": [ - [ - { - "name": "aktennr" - }, - { - "name": "syncStatus" - }, - { - "name": "advowareLastSync" - } - ] - ], - "dynamicLogicVisible": null, - "style": "default", - "tabBreak": false, - "tabLabel": null, - "hidden": false, - "noteText": null, - "noteStyle": "info", - "customLabel": "Advoware Sync" - }, - { - "rows": [ - [ - { - "name": "xaiId" - }, - { - "name": "xaiCollections" - }, - { - "name": "xaiSyncStatus" - } - ] - ], - "dynamicLogicVisible": null, - "style": "default", - "tabBreak": false, - "tabLabel": null, - "hidden": false, - "noteText": null, - "noteStyle": "info", - "customLabel": "x.AI Sync" } ] \ No newline at end of file diff --git a/custom/Espo/Custom/Resources/metadata/entityDefs/CDokumente.json b/custom/Espo/Custom/Resources/metadata/entityDefs/CDokumente.json index 44840627..51d43bce 100644 --- a/custom/Espo/Custom/Resources/metadata/entityDefs/CDokumente.json +++ b/custom/Espo/Custom/Resources/metadata/entityDefs/CDokumente.json @@ -45,13 +45,6 @@ "isCustom": true, "audited": true }, - "ydocumentuuid": { - "type": "varchar", - "maxLength": 100, - "readOnlyAfterCreate": true, - "options": [], - "isCustom": true - }, "preview": { "type": "image", "previewSize": "medium", @@ -63,7 +56,7 @@ "type": "varchar", "maxLength": 64, "copyToClipboard": true, - "readOnlyAfterCreate": true, + "readOnlyAfterCreate": false, "options": [], "isCustom": true, "tooltip": true @@ -73,59 +66,53 @@ "entity": "CPuls", "isCustom": true }, - "fileStatus": { - "type": "enum", - "required": false, - "options": [ - "new", - "changed", - "synced" - ], - "style": { - "new": "info", - "changed": "warning", - "synced": "success" - }, - "default": "new", - "readOnly": false, - "tooltip": true, - "isCustom": true - }, "advowareAktenHnr": { "type": "int", "notStorable": true, "utility": true, - "layoutAvailabilityList": ["listForAdvowareAkten"] + "layoutAvailabilityList": [ + "listForAdvowareAkten" + ] }, "advowareAktenSyncstatus": { "type": "varchar", "notStorable": true, "utility": true, - "layoutAvailabilityList": ["listForAdvowareAkten"] + "layoutAvailabilityList": [ + "listForAdvowareAkten" + ] }, "advowareAktenLastSync": { "type": "datetime", "notStorable": true, "utility": true, - "layoutAvailabilityList": ["listForAdvowareAkten"] + "layoutAvailabilityList": [ + "listForAdvowareAkten" + ] }, "aiKnowledgeAiDocumentId": { "type": "varchar", "notStorable": true, "utility": true, - "layoutAvailabilityList": ["listForAIKnowledge"] + "layoutAvailabilityList": [ + "listForAIKnowledge" + ] }, "aiKnowledgeSyncstatus": { "type": "varchar", "notStorable": true, "utility": true, - "layoutAvailabilityList": ["listForAIKnowledge"] + "layoutAvailabilityList": [ + "listForAIKnowledge" + ] }, "aiKnowledgeLastSync": { "type": "datetime", "notStorable": true, "utility": true, - "layoutAvailabilityList": ["listForAIKnowledge"] + "layoutAvailabilityList": [ + "listForAIKnowledge" + ] } }, "links": { diff --git a/data/config.php b/data/config.php index 0fd3a8cc..606dbf92 100644 --- a/data/config.php +++ b/data/config.php @@ -360,7 +360,7 @@ return [ 0 => 'youtube.com', 1 => 'google.com' ], - 'microtime' => 1773264000.882682, + 'microtime' => 1773265335.978323, '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 be12685f..15c18623 100644 --- a/data/state.php +++ b/data/state.php @@ -1,7 +1,7 @@ 1773264001, - 'microtimeState' => 1773264001.003279, + 'cacheTimestamp' => 1773265336, + 'microtimeState' => 1773265336.114728, 'currencyRates' => [ 'EUR' => 1.0 ],