Add bib anomaly registration link and update styles for anomaly details

This commit introduces a new feature to display a registration link for bib anomalies, enhancing user navigation. It includes new CSS styles for better layout and presentation of anomaly details. Additionally, the PHP functions are updated to support the rendering of the registration link, improving the overall functionality of the bib anomaly management system.
This commit is contained in:
2026-07-08 11:26:19 -04:00
parent 17611a9009
commit dbffb288d6
3 changed files with 104 additions and 8 deletions

View File

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

View File

@ -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 '<a class="bib-anomaly-inscr-link" href="' . fxBibEsc($strUrl) . '">'
. fxBibEsc($strLabel) . '</a>';
}
/**
* 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']
); ?>
<div class="bib-anomaly-detail text-muted small">
<?php echo fxBibEsc(trim($item['par_prenom'] . ' ' . $item['par_nom'])); ?>
<div class="bib-anomaly-detail text-muted small bib-anomaly-detail--split">
<span class="bib-anomaly-detail__meta">
<?php echo fxBibEsc(trim($item['par_prenom'] . ' ' . $item['par_nom'])); ?>
</span>
<?php echo fxBibAnomalyRenderInscrLink($int_eve_id, (int)($item['pec_id'] ?? 0), $strLangue); ?>
</div>
</li>
<?php } ?>
@ -5979,12 +6035,15 @@ function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies =
'bib_v4_anomalies_bib_fmt',
(int)$item['no_bib']
); ?>
<div class="bib-anomaly-detail text-muted small">
<?php echo fxBibEsc(trim($item['par_prenom'] . ' ' . $item['par_nom'])); ?>
<?php fxBibTexteTrad($strTypeKey, 1); ?>
<?php if ($item['orphan_type'] === 'transferred' && $item['participant_epr_label'] !== '') { ?>
(<?php echo fxBibEsc($item['participant_epr_label']); ?>)
<?php } ?>
<div class="bib-anomaly-detail text-muted small bib-anomaly-detail--split">
<span class="bib-anomaly-detail__meta">
<?php echo fxBibEsc(trim($item['par_prenom'] . ' ' . $item['par_nom'])); ?>
— <?php fxBibTexteTrad($strTypeKey, 1); ?>
<?php if ($item['orphan_type'] === 'transferred' && $item['participant_epr_label'] !== '') { ?>
(<?php echo fxBibEsc($item['participant_epr_label']); ?>)
<?php } ?>
</span>
<?php echo fxBibAnomalyRenderInscrLink($int_eve_id, (int)($item['pec_id'] ?? 0), $strLangue); ?>
</div>
</li>
<?php } ?>

View File

@ -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');