CON-333 — Enhance static synchronization process by adding functionality to automatically remove excess entries during synchronization. Update user messaging to clarify that excess entries will be removed when possible, while ensuring no deletions occur. Revise documentation to reflect these changes in the workflow. Increment version code.

This commit is contained in:
2026-07-23 09:24:27 -04:00
parent 5ceeec7fdd
commit 88a8010a18
2 changed files with 22 additions and 2 deletions

View File

@ -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,
);
}

View File

@ -205,7 +205,7 @@ if ($strDetailTable !== '' && $strDetailEnv !== '') {
<li>Rafraîchir cette page (nouveau code déployé).</li>
<li>Cliquer <em>TOUT APPLIQUER</em> sous la colonne voulue (commencer par <strong>Dev prod</strong>).</li>
<li>Lire le message vert/rouge en haut : succès ou échec + détail table par table.</li>
<li>Recharger : Manque=0 et Diff=0 partout = OK. « En trop » peut rester (normal, on nefface pas).</li>
<li>Recharger : Manque=0 et Diff=0. Sur accès v2, En trop aussi → 0 (retirés auto). Sur <code>info</code>, En trop = à revoir via Détails (jamais DELETE auto).</li>
<li>Lignes SAUTÉES (structure / table absente) = à corriger en Navicat, puis re-cliquer.</li>
</ol>
<form method="post" style="margin-top:12px;" onsubmit="return confirm('CON-333 — TOUT APPLIQUER sur Dev prod ?\nToutes les tables : manquants + corrections.\nAucun DELETE.');">