From 3c0188fba4fd1f0205a2e6eb36c767348026fd6e Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 6 Jul 2026 15:24:07 -0400 Subject: [PATCH] Remove database confirmation requirement for client environments in synchronization process This commit eliminates the need for database name confirmation when syncing to client environments, simplifying the user experience. The `fxStaticSyncRequiresDbConfirm` function is removed, and related logic is adjusted in the synchronization workflow. Additionally, the user interface is updated to reflect these changes, providing clearer messaging about the synchronization process and reinforcing the read-only nature of the client production environment. --- php/inc_fx_static_sync.php | 5 --- php/sync_static_db.php | 66 ++------------------------------------ 2 files changed, 3 insertions(+), 68 deletions(-) diff --git a/php/inc_fx_static_sync.php b/php/inc_fx_static_sync.php index be6f367..a9dc986 100644 --- a/php/inc_fx_static_sync.php +++ b/php/inc_fx_static_sync.php @@ -249,11 +249,6 @@ function fxStaticSyncWriteAllowed($strEnvId) { return $strEnvId !== 'client_prod'; } -/** Environnements client : confirmation renforcée (nom de BD à retaper). */ -function fxStaticSyncRequiresDbConfirm($strEnvId) { - return ($strEnvId === 'client_preprod' || $strEnvId === 'client_prod'); -} - function fxStaticSyncFinalizeCompareResult(array $tabCmp) { if (in_array($tabCmp['status'], array('missing_table', 'schema_mismatch', 'no_connection'), true)) { return $tabCmp; diff --git a/php/sync_static_db.php b/php/sync_static_db.php index 7379c33..23f2a95 100644 --- a/php/sync_static_db.php +++ b/php/sync_static_db.php @@ -42,20 +42,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST[' } elseif (!fxStaticSyncWriteAllowed($strEnvId)) { $strFlash = 'Sync désactivée vers client prod — comparaison seule.'; $strFlashType = 'bad'; - } elseif (fxStaticSyncRequiresDbConfirm($strEnvId)) { - $strConfirmDb = trim($_POST['confirm_db'] ?? ''); - $strExpectedDb = $tabEnv['config']['db'] ?? ''; - if ($strConfirmDb !== $strExpectedDb) { - $strFlash = 'Sync annulée — nom de base incorrect (attendu : ' . $strExpectedDb . ').'; - $strFlashType = 'bad'; - } else { - $blnDbConfirmed = true; - } } else { - $blnDbConfirmed = true; - } - - if (!empty($blnDbConfirmed)) { $tabConnections = fxStaticSyncOpenConnections(); $objSource = $tabConnections['dev_preprod']; $objTarget = $tabConnections[$strEnvId]; @@ -141,10 +128,8 @@ if ($strDetailTable !== '' && $strDetailEnv !== '') {

Sync tables statiques

Attention — opération destructive. - Sync = DELETE puis recopie complète depuis dev préprod. - Client prod : lecture seule (aucun bouton Sync). - Client préprod : confirmation avec le nom exact de la base. - Structures non alignées : corriger via Navicat avant toute sync. + Sync = recopie complète depuis dev préprod (efface la cible). + Client prod : lecture seule. Un clic sur Sync — pas de confirmation à taper.

Source de vérité : dev préprod (). @@ -198,7 +183,6 @@ if ($strDetailTable !== '' && $strDetailEnv !== '') { } $strClass = fxStaticSyncStatusClass($tabCmp['status']); $strLabel = fxStaticSyncStatusLabel($tabCmp['status'], $tabCmp); - $strDbName = $tabEnv['config']['db'] ?? ''; ?> @@ -218,12 +202,7 @@ if ($strDetailTable !== '' && $strDetailEnv !== '') { Détails -

+ @@ -295,43 +274,4 @@ if ($strDetailTable !== '' && $strDetailEnv !== '') { -