From 0d01affb899e64dce4f23a33e6ec667e7e7e675b Mon Sep 17 00:00:00 2001 From: stephan Date: Thu, 9 Jul 2026 10:47:53 -0400 Subject: [PATCH] Refactor cancellation cause handling and localization for orphan bibs, update version code to 4.72.773 This commit simplifies the cancellation cause logic by removing references to 'modif' and updating related localization keys to focus on 'annule' and 'transfert'. CSS comments and SQL scripts are also adjusted to reflect these changes, enhancing clarity and consistency in the user interface. The version code is incremented to 4.72.773 to reflect these updates. --- css/style.css | 5 +---- php/inc_fonctions.php | 13 ++----------- php/inc_fx_inscriptions_gestion.php | 5 ++--- php/inc_fx_promoteur.php | 9 +++------ sql/MSIN-4405-bib-anomalies-orphan-cause.sql | 15 +++------------ sql/MSIN-4405-remove-statut-modif.sql | 7 +++++++ 6 files changed, 18 insertions(+), 36 deletions(-) create mode 100644 sql/MSIN-4405-remove-statut-modif.sql diff --git a/css/style.css b/css/style.css index adb23df..a94256b 100644 --- a/css/style.css +++ b/css/style.css @@ -3422,7 +3422,7 @@ a.ms1-trad-link.btn-aide-trad{ border-color:#f1b0b7; } -/* MSIN-4405 — pastille de cause d'annulation (annulee / transferee / modifiee) */ +/* MSIN-4405 — pastille de cause d'annulation (annulee / transferee) */ .inscr-gestion-cancel-badge{ display:inline-block; margin-left:6px; @@ -3439,9 +3439,6 @@ a.ms1-trad-link.btn-aide-trad{ .inscr-gestion-cancel-badge--transfert{ background:#0d6efd; } -.inscr-gestion-cancel-badge--modif{ - background:#fd7e14; -} .inscr-gestion-cancel-badge--annule{ background:#dc3545; } diff --git a/php/inc_fonctions.php b/php/inc_fonctions.php index e3b2d46..7ff2ddf 100644 --- a/php/inc_fonctions.php +++ b/php/inc_fonctions.php @@ -179,13 +179,12 @@ function fxcount($memarray) * porte ce statut. Aucune ecriture : on ne touche ni is_cancelled, ni pec_actif, ni la base. * * Regles (cf. fxMajEpreuvesCommandees / annuler_inscription.php) : - * - vraie annulation : l'ancien pec reste actif (pec_actif = 1) + * - vraie annulation : l'ancien pec reste actif (pec_actif = 1), ou defaut * - transfert complete: ligne dans inscriptions_transferts (ts_id = 2) pour ce pec - * - changement d'epreuve / upgrade : ligne dans inscriptions_panier_epreuves_commandees_upgrade * * @param int $intPecId pec_id_original de l'inscription * @param int|null $intPecActif valeur de pec_actif si deja connue (evite une requete) - * @return string 'annule' | 'transfert' | 'modif' + * @return string 'annule' | 'transfert' */ function fxGetAnnulationCause($intPecId, $intPecActif = null) { global $objDatabase; @@ -208,14 +207,6 @@ function fxGetAnnulationCause($intPecId, $intPecActif = null) { return 'transfert'; } - // Changement d'epreuve / upgrade (ancien pec remplace par un nouveau). - $varUpgrade = $objDatabase->fxGetVar( - "SELECT 1 FROM inscriptions_panier_epreuves_commandees_upgrade WHERE pec_id_old = " . $intPecId . " LIMIT 1" - ); - if ($varUpgrade) { - return 'modif'; - } - return 'annule'; } diff --git a/php/inc_fx_inscriptions_gestion.php b/php/inc_fx_inscriptions_gestion.php index 7369e9e..fd43573 100644 --- a/php/inc_fx_inscriptions_gestion.php +++ b/php/inc_fx_inscriptions_gestion.php @@ -361,11 +361,10 @@ function fxInscrGestionFallbackTexte($strClef, $strLangue) { 'inscr_gestion_search_prompt' => $blnFr ? 'Utilisez la recherche ci-dessus pour afficher les inscriptions. Laissez les champs vides et lancez la recherche pour toutes les afficher.' : 'Use the search above to display registrations. Leave the fields empty and search to show them all.', - // MSIN-4405 — Detail du statut annule (transfere / modifie / vraie annulation), derive en lecture. + // MSIN-4405 — Detail du statut annule (transferee / annulee), derive en lecture. 'inscr_gestion_annulation_titre' => $blnFr ? 'Statut de l\'inscription' : 'Registration status', 'inscr_gestion_statut_annule' => $blnFr ? 'Annulée' : 'Cancelled', 'inscr_gestion_statut_transfert' => $blnFr ? 'Transférée' : 'Transferred', - 'inscr_gestion_statut_modif' => $blnFr ? 'Modifiée (changement d\'épreuve)' : 'Modified (race change)', 'inscr_gestion_back_bib' => $blnFr ? 'Retour aux dossards' : 'Back to bibs', 'inscr_gestion_back_prev' => $blnFr ? 'Retour' : 'Back', ); @@ -1603,7 +1602,7 @@ function fxInscrGestionRenderFiche($intEveId, $strLangue, $strBaseUrl, $arrReq, fxInscrGestionRenderKvRow(fxInscrGestionT('inscr_gestion_epreuve'), fxInscrGestionEpreuveLabel($arrRow['epr_id'], $strLangue)); fxInscrGestionRenderKvRow(fxInscrGestionT('inscr_gestion_type'), $strDetailsType); if ($blnCancelled) { - // MSIN-4405 — Detail de l'annulation (transfere / modifie / annule) derive en lecture seule. + // MSIN-4405 — Detail de l'annulation (transferee / annulee) derive en lecture seule. $strCause = fxGetAnnulationCause($arrRow['pec_id_original'], $arrRow['pec_actif']); fxInscrGestionRenderKvRow( fxInscrGestionT('inscr_gestion_annulation_titre'), diff --git a/php/inc_fx_promoteur.php b/php/inc_fx_promoteur.php index e977826..25f886f 100644 --- a/php/inc_fx_promoteur.php +++ b/php/inc_fx_promoteur.php @@ -2061,12 +2061,10 @@ function fxShowColumnPromoteur($arrColonnes, $arrListeParticipants, $x, $strLang $strStyleEdit = $strStyleCancel = ' d-none'; $strStyleRetablir = ''; - // MSIN-4405 — Cause de l'annulation derivee en lecture seule (transfere / modifie / annule). + // MSIN-4405 — Cause de l'annulation derivee en lecture seule (transferee / annulee). $strCause = fxGetAnnulationCause($arrListeParticipants[$x]['pec_id_original'], isset($arrListeParticipants[$x]['pec_actif']) ? $arrListeParticipants[$x]['pec_actif'] : null); if ($strCause == 'transfert') { $strBadgeLbl = ($strLangue == 'fr') ? 'Transférée' : 'Transferred'; - } elseif ($strCause == 'modif') { - $strBadgeLbl = ($strLangue == 'fr') ? 'Modifiée (changement d\'épreuve)' : 'Modified (race change)'; } else { $strBadgeLbl = ($strLangue == 'fr') ? 'Annulée' : 'Cancelled'; } @@ -3320,7 +3318,6 @@ function fxBibStaticFallback($clef) { 'bib_v4_anomalies_order_fmt' => ['fr' => 'Commande %s', 'en' => 'Order %s'], 'bib_v4_anomalies_assign_link' => ['fr' => 'Assigner un dossard', 'en' => 'Assign a bib'], 'bib_v4_anomalies_orphan_annule' => ['fr' => 'Annulée — dossard encore en séquence', 'en' => 'Cancelled — bib still in sequence'], - 'bib_v4_anomalies_orphan_modif' => ['fr' => 'Modifiée (changement d\'épreuve) — dossard conservé', 'en' => 'Modified (race change) — bib kept'], 'bib_v4_anomalies_orphan_transfert'=> ['fr' => 'Transférée — dossard conservé', 'en' => 'Transferred — bib kept'], 'bib_v4_anomalies_view_inscription'=> ['fr' => "Voir l'inscription", 'en' => 'View registration'], 'bib_v4_js_loader_wait' => ['fr' => 'Chargement...', 'en' => 'Loading...'], @@ -5338,7 +5335,7 @@ function fxBibAnomalyDuplicateBibs($int_eve_id, $strLangue = 'fr') { /** * MSIN-4405 — Dossards orphelins : inscription annulée dont le no_bib occupe encore une séquence. - * Cause alignée sur fxGetAnnulationCause (annule / modif / transfert), pas de collision inter-épreuves. + * Cause alignée sur fxGetAnnulationCause (annule / transfert), pas de collision inter-épreuves. * * @return array> */ @@ -5419,7 +5416,7 @@ function fxBibAnomalyOrphanBibs($int_eve_id, $strLangue = 'fr') { /** MSIN-4405 — Clé i18n bib pour la cause d'orphelin (alignée fxGetAnnulationCause). */ function fxBibAnomalyOrphanCauseKey($strCause) { $strCause = trim((string)$strCause); - if (!in_array($strCause, ['annule', 'modif', 'transfert'], true)) { + if (!in_array($strCause, ['annule', 'transfert'], true)) { $strCause = 'annule'; } diff --git a/sql/MSIN-4405-bib-anomalies-orphan-cause.sql b/sql/MSIN-4405-bib-anomalies-orphan-cause.sql index 900db7a..e990039 100644 --- a/sql/MSIN-4405-bib-anomalies-orphan-cause.sql +++ b/sql/MSIN-4405-bib-anomalies-orphan-cause.sql @@ -1,23 +1,14 @@ --- MSIN-4405 — Orphelins dossards : libellés alignés sur fxGetAnnulationCause (annule / modif / transfert) --- Remplace l'ancienne clé bib_v4_anomalies_orphan_transferred (collision inter-épreuves) +-- MSIN-4405 — Orphelins dossards : libellés alignés sur fxGetAnnulationCause (annule / transfert) -- Idempotent INSERT INTO info (info_clef, info_langue, info_texte, info_aide, info_prg, info_description, info_trie, info_actif, info_option1, info_option2, info_option3, info_creation) -SELECT 'bib_v4_anomalies_orphan_annule', 'fr', 'Annulée — dossard encore en séquence', 'Inscription annulée (pec_actif=1) dont le numéro occupe encore une place dans la séquence.', 'compte.php', '', 0, 1, '', '', '', NOW() +SELECT 'bib_v4_anomalies_orphan_annule', 'fr', 'Annulée — dossard encore en séquence', 'Inscription annulée dont le numéro occupe encore une place dans la séquence.', 'compte.php', '', 0, 1, '', '', '', NOW() FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_anomalies_orphan_annule' AND info_langue = 'fr' AND info_prg = 'compte.php'); INSERT INTO info (info_clef, info_langue, info_texte, info_aide, info_prg, info_description, info_trie, info_actif, info_option1, info_option2, info_option3, info_creation) -SELECT 'bib_v4_anomalies_orphan_annule', 'en', 'Cancelled — bib still in sequence', 'Cancelled registration (pec_actif=1) whose bib number still occupies a slot in the sequence.', 'compte.php', '', 0, 1, '', '', '', NOW() +SELECT 'bib_v4_anomalies_orphan_annule', 'en', 'Cancelled — bib still in sequence', 'Cancelled registration whose bib number still occupies a slot in the sequence.', 'compte.php', '', 0, 1, '', '', '', NOW() FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_anomalies_orphan_annule' AND info_langue = 'en' AND info_prg = 'compte.php'); -INSERT INTO info (info_clef, info_langue, info_texte, info_aide, info_prg, info_description, info_trie, info_actif, info_option1, info_option2, info_option3, info_creation) -SELECT 'bib_v4_anomalies_orphan_modif', 'fr', 'Modifiée (changement d''épreuve) — dossard conservé', 'Ancienne transaction (upgrade) annulée, numéro encore dans la séquence de l''épreuve d''origine.', 'compte.php', '', 0, 1, '', '', '', NOW() -FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_anomalies_orphan_modif' AND info_langue = 'fr' AND info_prg = 'compte.php'); - -INSERT INTO info (info_clef, info_langue, info_texte, info_aide, info_prg, info_description, info_trie, info_actif, info_option1, info_option2, info_option3, info_creation) -SELECT 'bib_v4_anomalies_orphan_modif', 'en', 'Modified (race change) — bib kept', 'Former transaction (upgrade) cancelled, bib still in the original race sequence.', 'compte.php', '', 0, 1, '', '', '', NOW() -FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_anomalies_orphan_modif' AND info_langue = 'en' AND info_prg = 'compte.php'); - INSERT INTO info (info_clef, info_langue, info_texte, info_aide, info_prg, info_description, info_trie, info_actif, info_option1, info_option2, info_option3, info_creation) SELECT 'bib_v4_anomalies_orphan_transfert', 'fr', 'Transférée — dossard conservé', 'Ancienne transaction transférée, numéro encore dans la séquence.', 'compte.php', '', 0, 1, '', '', '', NOW() FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_anomalies_orphan_transfert' AND info_langue = 'fr' AND info_prg = 'compte.php'); diff --git a/sql/MSIN-4405-remove-statut-modif.sql b/sql/MSIN-4405-remove-statut-modif.sql new file mode 100644 index 0000000..b8730db --- /dev/null +++ b/sql/MSIN-4405-remove-statut-modif.sql @@ -0,0 +1,7 @@ +-- MSIN-4405 — Retrait du statut « modifiée (changement d'épreuve) » (cause non fiable) +-- Désactive les clés i18n modif ; fxGetAnnulationCause ne retourne plus que annule | transfert +-- Idempotent + +UPDATE info SET info_actif = 0 +WHERE info_clef IN ('inscr_gestion_statut_modif', 'bib_v4_anomalies_orphan_modif') + AND info_prg = 'compte.php';