From c6bc9ce4b052411250413710e87ffc013c459f4d Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 14 Jul 2026 08:25:59 -0400 Subject: [PATCH] Update bib matching logic in inscription management to set 'exact' as the default option and adjust related comments for clarity. Enhance search reset functionality to include a query parameter for all inscriptions. Refactor conditions for matching to improve consistency in handling exact and partial matches. --- php/inc_fx_inscriptions_gestion.php | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/php/inc_fx_inscriptions_gestion.php b/php/inc_fx_inscriptions_gestion.php index 43022e8..b2e8917 100644 --- a/php/inc_fx_inscriptions_gestion.php +++ b/php/inc_fx_inscriptions_gestion.php @@ -763,8 +763,8 @@ function fxInscrGestionParseRequest() { 'rech_nom' => isset($_GET['rech_nom']) ? trim($_GET['rech_nom']) : '', 'rech_no_commande' => isset($_GET['rech_no_commande']) ? trim($_GET['rech_no_commande']) : '', 'rech_nom_equipe' => isset($_GET['rech_nom_equipe']) ? trim($_GET['rech_nom_equipe']) : '', - // MSIN-4401 — Match dossard : exact | partial (défaut). - 'bib_match' => (isset($_GET['bib_match']) && $_GET['bib_match'] === 'exact') ? 'exact' : 'partial', + // MSIN-4399 — Match dossard : exact (défaut) | partial. + 'bib_match' => (isset($_GET['bib_match']) && $_GET['bib_match'] === 'partial') ? 'partial' : 'exact', 'chk_bib' => !empty($_GET['chk_bib']) ? 1 : 0, 'chk_cancelled' => !empty($_GET['chk_cancelled']) ? 1 : 0, 'sel_rech_epreuve' => 0, @@ -823,7 +823,7 @@ function fxInscrGestionEmptyListRequest() { 'rech_nom' => '', 'rech_no_commande' => '', 'rech_nom_equipe' => '', - 'bib_match' => 'partial', + 'bib_match' => 'exact', 'chk_bib' => 0, 'chk_cancelled' => 0, 'sel_rech_epreuve' => 0, @@ -836,7 +836,9 @@ function fxInscrGestionEmptyListRequest() { } function fxInscrGestionSearchResetUrl($strBaseUrl, $intEveId) { - return fxInscrGestionBuildUrl($strBaseUrl, $intEveId, fxInscrGestionEmptyListRequest(), array('pg' => 1)); + // MSIN-4399 — Réinit = champs vides + toutes les inscriptions (q=1). + // Distinct de la 1re visite (sans q) qui n'affiche que l'invite. + return fxInscrGestionBuildUrl($strBaseUrl, $intEveId, fxInscrGestionEmptyListRequest(), array('pg' => 1, 'q' => 1)); } function fxInscrGestionBuildWhere($intEveId, $arrReq) { @@ -856,8 +858,8 @@ function fxInscrGestionBuildWhere($intEveId, $arrReq) { } if ($arrReq['rech_nom_equipe'] !== '') { $strEscBibEquipe = $objDatabase->fxEscape($arrReq['rech_nom_equipe']); - // MSIN-4401 — Exact = égalité TRIM ; Partiel = LIKE %…% (défaut). - if (!empty($arrReq['bib_match']) && $arrReq['bib_match'] === 'exact') { + // MSIN-4399 — Exact = égalité TRIM (défaut) ; Partiel = LIKE %…%. + if (empty($arrReq['bib_match']) || $arrReq['bib_match'] !== 'partial') { $strWhere .= ' AND (' . " TRIM(IFNULL(p.no_bib, '')) = '" . $strEscBibEquipe . "'" . " OR TRIM(IFNULL(e.no_equipe, '')) = '" . $strEscBibEquipe . "'" @@ -1387,9 +1389,9 @@ function fxInscrGestionQueryParams($intEveId, $arrReq, $arrExtra = array()) { if ($arrReq['rech_nom_equipe'] !== '') { $tab['rech_nom_equipe'] = $arrReq['rech_nom_equipe']; } - // MSIN-4401 — Conserver le mode exact dans pagination / fiche (partiel = défaut, pas dans l’URL). - if (!empty($arrReq['bib_match']) && $arrReq['bib_match'] === 'exact') { - $tab['bib_match'] = 'exact'; + // MSIN-4399 — Conserver le mode partiel dans pagination / fiche (exact = défaut, pas dans l’URL). + if (!empty($arrReq['bib_match']) && $arrReq['bib_match'] === 'partial') { + $tab['bib_match'] = 'partial'; } if ($arrReq['chk_bib']) { $tab['chk_bib'] = 1; @@ -1804,8 +1806,9 @@ function fxInscrGestionActiveFilterLabels($arrReq, $strLangue) { fxInscrGestionT('inscr_gestion_rech_bib_equipe'), $arrReq['rech_nom_equipe'] ); - if (!empty($arrReq['bib_match']) && $arrReq['bib_match'] === 'exact') { - $tab[] = fxInscrGestionT('inscr_gestion_bib_match_exact'); + // MSIN-4399 — Chip seulement si hors défaut (partiel). + if (!empty($arrReq['bib_match']) && $arrReq['bib_match'] === 'partial') { + $tab[] = fxInscrGestionT('inscr_gestion_bib_match_partial'); } } if ($arrReq['sel_rech_epreuve'] > 0) { @@ -1930,7 +1933,8 @@ function fxInscrGestionRenderList($intEveId, $strLangue, $strBaseUrl, $arrReq) { echo ''; // MSIN-4401 — Exact vs Partiel (entre champ et caméra). - $blnBibExact = (!empty($arrReq['bib_match']) && $arrReq['bib_match'] === 'exact'); + // MSIN-4399 — Exact sélectionné par défaut. + $blnBibExact = (empty($arrReq['bib_match']) || $arrReq['bib_match'] !== 'partial'); echo '
'; echo '