From 88a8010a184f74ecb589e247512ec5f5c4c0dd4c Mon Sep 17 00:00:00 2001 From: stephan Date: Thu, 23 Jul 2026 09:24:27 -0400 Subject: [PATCH] =?UTF-8?q?CON-333=20=E2=80=94=20Enhance=20static=20synchr?= =?UTF-8?q?onization=20process=20by=20adding=20functionality=20to=20automa?= =?UTF-8?q?tically=20remove=20excess=20entries=20during=20synchronization.?= =?UTF-8?q?=20Update=20user=20messaging=20to=20clarify=20that=20excess=20e?= =?UTF-8?q?ntries=20will=20be=20removed=20when=20possible,=20while=20ensur?= =?UTF-8?q?ing=20no=20deletions=20occur.=20Revise=20documentation=20to=20r?= =?UTF-8?q?eflect=20these=20changes=20in=20the=20workflow.=20Increment=20v?= =?UTF-8?q?ersion=20code.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- php/inc_fx_static_sync.php | 22 +++++++++++++++++++++- php/sync_static_db.php | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/php/inc_fx_static_sync.php b/php/inc_fx_static_sync.php index 600c0e3..6338f41 100644 --- a/php/inc_fx_static_sync.php +++ b/php/inc_fx_static_sync.php @@ -1233,11 +1233,31 @@ function fxStaticSyncApplyAllSoft($objSource, $objTarget, $strEnvId) { } else { $tabLines[] = $tabDef['label'] . ' corrections : 0'; } + + // CON-333 — catalogues accès v2 : retirer les en trop dans le même passage (pas les laisser). + if (!empty($tabDef['allow_remove_extras'])) { + $tabCmp3 = fxStaticSyncCompareEnvPair($objSource, $objTarget, $tabDef); + $intExtra3 = count($tabCmp3['extra_keys']); + if ($intExtra3 > 0) { + $tabRem = fxStaticSyncRemoveExtras($objSource, $objTarget, $strTable, $tabDef); + if (empty($tabRem['ok'])) { + return array( + 'ok' => false, + 'message' => 'ÉCHEC sur ' . $tabDef['label'] . ' (retirer en trop) : ' . $tabRem['message'], + 'lines' => $tabLines, + ); + } + $tabLines[] = $tabDef['label'] . ' en trop : ' . $tabRem['message']; + } else { + $tabLines[] = $tabDef['label'] . ' en trop : 0'; + } + } } return array( 'ok' => true, - 'message' => 'Tout appliquer terminé sur ' . $strEnvId . ' (aucun DELETE). Voir détail ci-dessous.', + 'message' => 'Tout appliquer terminé sur ' . $strEnvId + . ' (info : jamais DELETE ; catalogues accès v2 : en trop retirés si possible). Voir détail.', 'lines' => $tabLines, ); } diff --git a/php/sync_static_db.php b/php/sync_static_db.php index c64afae..8a485db 100644 --- a/php/sync_static_db.php +++ b/php/sync_static_db.php @@ -205,7 +205,7 @@ if ($strDetailTable !== '' && $strDetailEnv !== '') {
  • Rafraîchir cette page (nouveau code déployé).
  • Cliquer TOUT APPLIQUER sous la colonne voulue (commencer par Dev prod).
  • Lire le message vert/rouge en haut : succès ou échec + détail table par table.
  • -
  • Recharger : Manque=0 et Diff=0 partout = OK. « En trop » peut rester (normal, on n’efface pas).
  • +
  • Recharger : Manque=0 et Diff=0. Sur accès v2, En trop aussi → 0 (retirés auto). Sur info, En trop = à revoir via Détails (jamais DELETE auto).
  • Lignes SAUTÉES (structure / table absente) = à corriger en Navicat, puis re-cliquer.