diff --git a/css/style.css b/css/style.css index 6cd7597..682a4cd 100644 --- a/css/style.css +++ b/css/style.css @@ -2735,6 +2735,32 @@ a.ms1-trad-link.btn-aide-trad{ margin-top:4px; } +.bib-anomaly-detail--split{ + display:flex; + justify-content:space-between; + align-items:flex-start; + gap:10px; +} + +.bib-anomaly-detail__meta{ + min-width:0; +} + +.bib-anomaly-inscr-link{ + color:#c82333; + font-weight:700; + font-size:12px; + white-space:nowrap; + flex-shrink:0; + text-decoration:none; +} + +.bib-anomaly-inscr-link:hover, +.bib-anomaly-inscr-link:focus{ + color:#a71d2a; + text-decoration:underline; +} + .bib-anomalies-empty{ font-size:13px; } diff --git a/php/inc_fx_promoteur.php b/php/inc_fx_promoteur.php index 8d964d5..1db7dcc 100644 --- a/php/inc_fx_promoteur.php +++ b/php/inc_fx_promoteur.php @@ -3319,6 +3319,7 @@ function fxBibStaticFallback($clef) { 'bib_v4_anomalies_no_range' => ['fr' => 'Aucune séquence configurée', 'en' => 'No sequence configured'], '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_view_inscription'=> ['fr' => "Voir l'inscription", 'en' => 'View registration'], 'bib_v4_js_loader_wait' => ['fr' => 'Chargement...', 'en' => 'Loading...'], 'bib_v4_js_global_no_epr' => ['fr' => 'Sélectionnez au moins une épreuve solo.', 'en' => 'Select at least one solo race.'], 'bib_v4_js_global_no_seq' => ['fr' => 'Cochez au moins une séquence pour les épreuves sélectionnées.', 'en' => 'Check at least one sequence for the selected races.'], @@ -5240,6 +5241,7 @@ function fxBibAnomalyOrphanBibs($int_eve_id, $strLangue = 'fr') { e.epr_actif, $sqlBibNumP AS no_bib, p.par_id, + p.pec_id, p.par_prenom, p.par_nom, p.epr_id AS participant_epr_id, @@ -5298,6 +5300,7 @@ function fxBibAnomalyOrphanBibs($int_eve_id, $strLangue = 'fr') { 'participant_epr_id' => $participantEprId, 'participant_epr_label'=> $participantLabel, 'par_id' => (int)$row['par_id'], + 'pec_id' => (int)$row['pec_id'], 'par_prenom' => trim($row['par_prenom'] ?? ''), 'par_nom' => trim($row['par_nom'] ?? ''), ]; @@ -5413,6 +5416,7 @@ function fxBibAnomalyOutOfRangeBibs($int_eve_id, $strLangue = 'fr') { $sql = " SELECT p.par_id, + p.pec_id, p.par_prenom, p.par_nom, p.epr_id, @@ -5460,6 +5464,7 @@ function fxBibAnomalyOutOfRangeBibs($int_eve_id, $strLangue = 'fr') { 'epr_id' => (int)$row['epr_id'], 'epr_label' => fxBibAnomalyEprLabel($row, $strLangue), 'par_id' => (int)$row['par_id'], + 'pec_id' => (int)$row['pec_id'], 'par_prenom' => trim($row['par_prenom'] ?? ''), 'par_nom' => trim($row['par_nom'] ?? ''), 'no_bib' => (int)$row['no_bib'], @@ -5790,6 +5795,54 @@ function renderBibQtySummaryPanel($int_eve_id, $strLangue = 'fr', $tabSummary = return ob_get_clean(); } +/** + * MSIN-4436 — URL fiche gestion inscriptions v2 pour une anomalie dossard. + * Réutilise fxInscrGestionBuildUrl (même lien que la liste des inscriptions). + */ +function fxBibAnomalyInscrGestionUrl($int_eve_id, $int_pec_id, $strLangue = 'fr') { + $int_eve_id = (int)$int_eve_id; + $int_pec_id = (int)$int_pec_id; + + if ($int_eve_id <= 0 || $int_pec_id <= 0) { + return ''; + } + + if (!function_exists('fxInscrGestionCanAccess')) { + require_once __DIR__ . '/inc_fx_inscriptions_gestion.php'; + } + + $intComId = isset($_SESSION['com_id']) ? (int)$_SESSION['com_id'] : 0; + if ($intComId <= 0 || !fxInscrGestionCanAccess($intComId, $int_eve_id)) { + return ''; + } + + return fxInscrGestionBuildUrl( + fxInscrGestionBaseUrl($strLangue, false), + $int_eve_id, + fxInscrGestionEmptyListRequest(), + [ + 'pec_id' => $int_pec_id, + 'lng' => $strLangue, + ] + ); +} + +/** MSIN-4436 — Lien « voir l'inscription » (gestion inscriptions v2). */ +function fxBibAnomalyRenderInscrLink($int_eve_id, $int_pec_id, $strLangue = 'fr') { + $strUrl = fxBibAnomalyInscrGestionUrl($int_eve_id, $int_pec_id, $strLangue); + if ($strUrl === '') { + return ''; + } + + $strLabel = fxBibTexte('bib_v4_anomalies_view_inscription', 0); + if ($strLabel === '' || $strLabel === 'bib_v4_anomalies_view_inscription') { + $strLabel = ($strLangue === 'en') ? 'View registration' : "Voir l'inscription"; + } + + return '' + . fxBibEsc($strLabel) . ''; +} + /** * MSIN-4436 — Coquille anomalies au chargement page (détail via AJAX). * Évite 4 requêtes lourdes avant le premier affichage des épreuves. @@ -5946,8 +5999,11 @@ function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies = 'bib_v4_anomalies_bib_fmt', (int)$item['no_bib'] ); ?> -
- +
+ + + +
@@ -5979,12 +6035,15 @@ function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies = 'bib_v4_anomalies_bib_fmt', (int)$item['no_bib'] ); ?> -
- - — - - () - +
+ + + — + + () + + +
diff --git a/sql/MSIN-4436-bib-anomalies-view-inscription.sql b/sql/MSIN-4436-bib-anomalies-view-inscription.sql new file mode 100644 index 0000000..d201f2c --- /dev/null +++ b/sql/MSIN-4436-bib-anomalies-view-inscription.sql @@ -0,0 +1,11 @@ +-- MSIN-4436 — Lien « voir l'inscription » sur les anomalies dossards +-- Prérequis : gestion inscriptions v2 (inc_tableau_inscriptions_gestion) +-- 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_view_inscription', 'fr', 'Voir l''inscription', '', 'compte.php', '', 0, 1, '', '', '', NOW() +FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_anomalies_view_inscription' 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_view_inscription', 'en', 'View registration', '', 'compte.php', '', 0, 1, '', '', '', NOW() +FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_anomalies_view_inscription' AND info_langue = 'en' AND info_prg = 'compte.php');