Enhance bib production fields by implementing a new builder for Face, Endos, and Info selections. Update UI components and backend logic for improved data handling, including serialization of field keys and sides. Increment version code to 4.72.873.
This commit is contained in:
@ -136,11 +136,10 @@ function fxBibProductionCollectSelectableFields($intEveId, $intEprId, $strLangue
|
||||
return $tabOut;
|
||||
}
|
||||
|
||||
/** MSIN-4515 — Défaut = comportement Excel actuel (n° face, épreuve info). */
|
||||
/** MSIN-4515 — Défaut = seulement le n° dossard en Face. */
|
||||
function fxBibProductionDefaultFields() {
|
||||
return [
|
||||
['key' => 'no_bib', 'side' => 'face'],
|
||||
['key' => 'epr_nom', 'side' => 'info'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -5023,7 +5023,7 @@ function renderBibPreparationOverview(array $tabEpreuves, $strAnomBadges = '') {
|
||||
}
|
||||
|
||||
/**
|
||||
* MSIN-4515 — Ligne « information sur le dossard » (+ champ + Face/Endos/Info).
|
||||
* MSIN-4515 — Ligne affichée : libellé + pastille Face/Endos/Info + poubelle (pas de select).
|
||||
*
|
||||
* @param array<int, array{key:string,label:string}> $tabSelectable
|
||||
*/
|
||||
@ -5038,57 +5038,29 @@ function renderBibProductionBuilderRow(
|
||||
$intEprId = (int)$intEprId;
|
||||
$strKey = (string)$strKey;
|
||||
$strSide = in_array($strSide, ['face', 'endos', 'info'], true) ? $strSide : 'face';
|
||||
$intRowIndex = (int)$intRowIndex;
|
||||
$strRowId = 'prod_row_' . $intEprId . '_' . $intRowIndex;
|
||||
$tabSides = [
|
||||
'face' => ['class' => 'face', 'label_key' => 'bib_v5_production_fields_side_face'],
|
||||
'endos' => ['class' => 'endos', 'label_key' => 'bib_v5_production_fields_side_endos'],
|
||||
'info' => ['class' => 'info', 'label_key' => 'bib_v5_production_fields_side_info'],
|
||||
$strLabel = $strKey;
|
||||
foreach ($tabSelectable as $tabOpt) {
|
||||
if ((string)($tabOpt['key'] ?? '') === $strKey) {
|
||||
$strLabel = (string)($tabOpt['label'] ?? $strKey);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$tabSideKeys = [
|
||||
'face' => 'bib_v5_production_fields_side_face',
|
||||
'endos' => 'bib_v5_production_fields_side_endos',
|
||||
'info' => 'bib_v5_production_fields_side_info',
|
||||
];
|
||||
$strSideLabel = fxBibTexte($tabSideKeys[$strSide], 0);
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<li class="bib-prod-builder-row" data-epr-id="<?php echo $intEprId; ?>">
|
||||
<label class="sr-only" for="<?php echo fxBibEsc($strRowId); ?>_field">
|
||||
<?php echo fxBibEsc(fxBibTexte('bib_v5_production_fields_pick', 0)); ?>
|
||||
</label>
|
||||
<select id="<?php echo fxBibEsc($strRowId); ?>_field"
|
||||
class="form-control form-control-sm bib-prod-builder-field"
|
||||
<?php echo $blnLocked ? 'disabled' : ''; ?>>
|
||||
<option value=""><?php echo fxBibEsc(fxBibTexte('bib_v5_production_fields_pick', 0)); ?></option>
|
||||
<?php foreach ($tabSelectable as $tabOpt) {
|
||||
$strOptKey = (string)($tabOpt['key'] ?? '');
|
||||
if ($strOptKey === '') {
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
<option value="<?php echo fxBibEsc($strOptKey); ?>"
|
||||
<?php echo ($strOptKey === $strKey) ? 'selected' : ''; ?>>
|
||||
<?php echo fxBibEsc((string)($tabOpt['label'] ?? $strOptKey)); ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
|
||||
<div class="bib-prod-field-sides" role="radiogroup"
|
||||
aria-label="<?php echo fxBibEsc(fxBibTexte('bib_v5_production_fields_side_face', 0)); ?>">
|
||||
<?php foreach ($tabSides as $strSideVal => $tabMeta) {
|
||||
$strId = $strRowId . '_' . $strSideVal;
|
||||
$blnChecked = ($strSide === $strSideVal);
|
||||
?>
|
||||
<label class="bib-prod-field-side bib-prod-field-side--<?php echo fxBibEsc($tabMeta['class']); ?><?php echo $blnChecked ? ' is-selected' : ''; ?>"
|
||||
for="<?php echo fxBibEsc($strId); ?>">
|
||||
<input type="radio"
|
||||
id="<?php echo fxBibEsc($strId); ?>"
|
||||
class="bib-prod-field-side-input"
|
||||
name="<?php echo fxBibEsc($strRowId); ?>_side"
|
||||
value="<?php echo fxBibEsc($strSideVal); ?>"
|
||||
<?php echo $blnChecked ? 'checked' : ''; ?>
|
||||
<?php echo $blnLocked ? 'disabled' : ''; ?>>
|
||||
<span><?php echo fxBibEsc(fxBibTexte($tabMeta['label_key'], 0)); ?></span>
|
||||
</label>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<li class="bib-prod-builder-row"
|
||||
data-epr-id="<?php echo $intEprId; ?>"
|
||||
data-field-key="<?php echo fxBibEsc($strKey); ?>"
|
||||
data-field-side="<?php echo fxBibEsc($strSide); ?>">
|
||||
<span class="bib-prod-builder-label"><?php echo fxBibEsc($strLabel); ?></span>
|
||||
<span class="bib-prod-field-side bib-prod-field-side--<?php echo fxBibEsc($strSide); ?> is-selected bib-prod-builder-side-pill"
|
||||
aria-hidden="true"><?php echo fxBibEsc($strSideLabel); ?></span>
|
||||
<?php if (!$blnLocked) { ?>
|
||||
<button type="button"
|
||||
class="btn btn-sm btn-outline-secondary bib-prod-builder-remove"
|
||||
@ -5102,7 +5074,7 @@ function renderBibProductionBuilderRow(
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/** @deprecated alias — conserver signature pour appels résiduels */
|
||||
/** @deprecated */
|
||||
function renderBibProductionFieldSideRow($intEprId, $strKey, $strLabel, $strSelectedSide, $blnLocked) {
|
||||
return renderBibProductionBuilderRow(
|
||||
$intEprId,
|
||||
@ -5217,10 +5189,15 @@ function renderBibProductionPreview(array $tabEpreuves, $strLangue = 'fr') {
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php // MSIN-4515 — Ajouter une information sur le dossard (peu de lignes, pas un mur). ?>
|
||||
<?php // MSIN-4515 — Visuel validé : titre épreuve, n° Face, +, panneau choisir puis Face/Endos/Info. ?>
|
||||
<section class="bib-production-fields epr-block"
|
||||
data-eve-id="<?php echo $intEveId; ?>"
|
||||
data-locked="<?php echo $blnProductionLocked ? '1' : '0'; ?>">
|
||||
data-locked="<?php echo $blnProductionLocked ? '1' : '0'; ?>"
|
||||
data-label-face="<?php echo fxBibEsc(fxBibTexte('bib_v5_production_fields_side_face', 0)); ?>"
|
||||
data-label-endos="<?php echo fxBibEsc(fxBibTexte('bib_v5_production_fields_side_endos', 0)); ?>"
|
||||
data-label-info="<?php echo fxBibEsc(fxBibTexte('bib_v5_production_fields_side_info', 0)); ?>"
|
||||
data-label-remove="<?php echo fxBibEsc(fxBibTexte('bib_v5_production_fields_remove', 0)); ?>"
|
||||
data-label-pick="<?php echo fxBibEsc(fxBibTexte('bib_v5_production_fields_pick', 0)); ?>">
|
||||
<div class="epr-header">
|
||||
<span class="epr-header-label">
|
||||
<?php fxBibTexteTrad('bib_v5_production_fields_title', 1); ?>
|
||||
@ -5228,11 +5205,6 @@ function renderBibProductionPreview(array $tabEpreuves, $strLangue = 'fr') {
|
||||
</div>
|
||||
<div class="epr-content">
|
||||
<p class="bib-production-fields-intro"><?php fxBibTexteTrad('bib_v5_production_fields_intro', 1); ?></p>
|
||||
<ul class="bib-production-fields-legend list-unstyled">
|
||||
<li><span class="bib-prod-swatch bib-prod-swatch--face" aria-hidden="true"></span><?php fxBibTexteTrad('bib_v5_production_fields_legend_face', 1); ?></li>
|
||||
<li><span class="bib-prod-swatch bib-prod-swatch--endos" aria-hidden="true"></span><?php fxBibTexteTrad('bib_v5_production_fields_legend_endos', 1); ?></li>
|
||||
<li><span class="bib-prod-swatch bib-prod-swatch--info" aria-hidden="true"></span><?php fxBibTexteTrad('bib_v5_production_fields_legend_info', 1); ?></li>
|
||||
</ul>
|
||||
<?php if ($blnProductionLocked) { ?>
|
||||
<p class="text-muted small"><?php fxBibTexteTrad('bib_v5_production_fields_locked', 1); ?></p>
|
||||
<?php } ?>
|
||||
@ -5247,11 +5219,16 @@ function renderBibProductionPreview(array $tabEpreuves, $strLangue = 'fr') {
|
||||
if ($intEprId <= 0) {
|
||||
continue;
|
||||
}
|
||||
$intRangeCount = fxBibCountSavedRanges(fxInfosBibRange($intEprId, 0, false));
|
||||
$tabSelectable = fxBibProductionCollectSelectableFields($intEveId, $intEprId, $strLangue);
|
||||
$tabAllowed = [];
|
||||
$tabLabelByKey = [];
|
||||
foreach ($tabSelectable as $tabOpt) {
|
||||
$tabAllowed[(string)$tabOpt['key']] = true;
|
||||
$strOptKey = (string)($tabOpt['key'] ?? '');
|
||||
if ($strOptKey === '') {
|
||||
continue;
|
||||
}
|
||||
$tabAllowed[$strOptKey] = true;
|
||||
$tabLabelByKey[$strOptKey] = (string)($tabOpt['label'] ?? $strOptKey);
|
||||
}
|
||||
|
||||
$tabRows = [];
|
||||
@ -5268,8 +5245,8 @@ function renderBibProductionPreview(array $tabEpreuves, $strLangue = 'fr') {
|
||||
];
|
||||
}
|
||||
}
|
||||
// Première visite : une seule ligne (n° Face) — pas tout le catalogue.
|
||||
if (empty($tabRows) && !$blnProductionLocked) {
|
||||
// Arrivée : UNIQUEMENT n° dossard Face.
|
||||
if (empty($tabRows)) {
|
||||
$tabRows[] = ['key' => 'no_bib', 'side' => 'face'];
|
||||
}
|
||||
|
||||
@ -5279,12 +5256,11 @@ function renderBibProductionPreview(array $tabEpreuves, $strLangue = 'fr') {
|
||||
'UTF-8'
|
||||
);
|
||||
?>
|
||||
<section class="bib-dist-print-epr bib-prod-fields-epr bib-production-category"
|
||||
<section class="bib-prod-fields-epr bib-production-category"
|
||||
data-epr-id="<?php echo $intEprId; ?>"
|
||||
data-field-options="<?php echo $strOptionsJson; ?>">
|
||||
<h3 class="bib-dist-print-epr-title">
|
||||
<h3 class="bib-prod-fields-epr-title">
|
||||
<?php echo fxBibEsc(fxBibEpreuveDisplayName($tabEpreuve, $strLangue)); ?>
|
||||
<span class="text-muted small">(<span class="bib-production-range-count"><?php echo $intRangeCount; ?></span>)</span>
|
||||
</h3>
|
||||
|
||||
<?php if (empty($tabSelectable)) { ?>
|
||||
@ -5304,12 +5280,32 @@ function renderBibProductionPreview(array $tabEpreuves, $strLangue = 'fr') {
|
||||
);
|
||||
} ?>
|
||||
</ul>
|
||||
|
||||
<?php if (!$blnProductionLocked) { ?>
|
||||
<button type="button"
|
||||
class="btn btn-outline-primary btn-sm bib-prod-builder-add">
|
||||
<i class="fa fa-plus mr-1" aria-hidden="true"></i>
|
||||
<?php fxBibTexteTrad('bib_v5_production_fields_add', 1); ?>
|
||||
class="btn btn-outline-primary btn-sm bib-prod-builder-add"
|
||||
aria-expanded="false">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
<span class="sr-only"><?php fxBibTexteTrad('bib_v5_production_fields_add', 1); ?></span>
|
||||
</button>
|
||||
|
||||
<div class="bib-prod-add-panel" hidden>
|
||||
<p class="bib-prod-add-panel__title">
|
||||
<?php fxBibTexteTrad('bib_v5_production_fields_pick', 1); ?>
|
||||
</p>
|
||||
<ul class="bib-prod-add-choices list-unstyled"></ul>
|
||||
<div class="bib-prod-add-sides" hidden>
|
||||
<button type="button" class="bib-prod-field-side bib-prod-field-side--face bib-prod-add-side" data-side="face">
|
||||
<?php fxBibTexteTrad('bib_v5_production_fields_side_face', 1); ?>
|
||||
</button>
|
||||
<button type="button" class="bib-prod-field-side bib-prod-field-side--endos bib-prod-add-side" data-side="endos">
|
||||
<?php fxBibTexteTrad('bib_v5_production_fields_side_endos', 1); ?>
|
||||
</button>
|
||||
<button type="button" class="bib-prod-field-side bib-prod-field-side--info bib-prod-add-side" data-side="info">
|
||||
<?php fxBibTexteTrad('bib_v5_production_fields_side_info', 1); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</section>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* Constantes *
|
||||
*
|
||||
**************/
|
||||
define('_VERSION_CODE', '4.72.872'); // MSIN-4515 — UI + ajouter info dossard
|
||||
define('_VERSION_CODE', '4.72.873'); // MSIN-4515 — builder Face/Endos/Info (liste +)
|
||||
define('_DATE_CODE', '2026-07-27');
|
||||
//MSIN-4290
|
||||
define('QR_SECRET_KEY', 'ms1_qr_2026_cle_secrete_longue_et_fixe');
|
||||
|
||||
Reference in New Issue
Block a user