Update bib management for MSIN-4429: Refine quantity and end input handling

This commit enhances the bib management system by updating the CSS layout for quantity and end inputs, ensuring proper alignment and display. It also modifies PHP functions to introduce a new column for the "or" separator between quantity and end values, improving the user interface. Additionally, new SQL entries are added to support the updated functionality, including localized labels and hints for user guidance. These changes aim to improve usability and clarity in the bib input process.
This commit is contained in:
2026-07-07 14:53:02 -04:00
parent ec024e6fba
commit eca8b34d88
4 changed files with 112 additions and 56 deletions

View File

@ -3629,11 +3629,7 @@ function renderBibAddRangeButton($epr_id) {
return ob_get_clean();
}
/**
* MSIN-4429 — Bloc Qté / ou / Fin (saisie pilote + champ calculé).
*
* @return array{qty:int|string,start:int,end:int,has_values:bool}
*/
/** MSIN-4429 — Valeurs dérivées pour affichage Qté (colonne séparée de Fin). */
function fxBibRangeSpecValues(array $range) {
$intStart = (int)($range['epr_bib_start'] ?? 0);
$intEnd = (int)($range['epr_bib_finish'] ?? 0);
@ -3652,31 +3648,12 @@ function fxBibRangeSpecValues(array $range) {
];
}
/** MSIN-4429 — Inputs quantité + fin avec séparateur « ou ». */
function fxBibRenderRangeQtyEndInputs(array $range, $blnRangeLocked) {
$tabSpec = fxBibRangeSpecValues($range);
$strQty = ($tabSpec['qty'] !== '') ? (int)$tabSpec['qty'] : '';
$strEnd = ($tabSpec['end'] > 0) ? (int)$tabSpec['end'] : '';
$strReadonly = $blnRangeLocked ? 'readonly' : '';
/** MSIN-4429 — Colonne « ou » entre Qté et Fin. */
function fxBibRenderRangeOrCell() {
ob_start();
?>
<div class="bib-range-spec">
<input type="number"
class="form-control form-control-sm bib-qty"
min="1"
value="<?php echo $strQty; ?>"
placeholder="<?php echo fxBibEsc(fxBibTexte('bib_v4_range_qty_ph', 0)); ?>"
<?php echo $strReadonly; ?>
<?php echo fxBibAideTippyAttr('bib_v4_col_qty'); ?>>
<span class="bib-range-or" aria-hidden="true"><?php fxBibTexte('bib_v4_range_or', 1); ?></span>
<input type="number"
class="form-control form-control-sm bib-end"
min="1"
value="<?php echo $strEnd; ?>"
placeholder="<?php echo fxBibEsc(fxBibTexte('bib_v4_range_end_ph', 0)); ?>"
<?php echo $strReadonly; ?>
<?php echo fxBibAideTippyAttr('bib_v4_col_end'); ?>>
<div class="epr-col-or" aria-hidden="true">
<span class="bib-range-or"><?php fxBibTexte('bib_v4_range_or', 1); ?></span>
</div>
<?php
return ob_get_clean();
@ -3690,11 +3667,9 @@ function renderBibRangeHeader() {
<div class="epr-col-lock"><?php echo fxBibColHeader('bib_v4_col_lock'); ?></div>
<div><?php echo fxBibColHeader('bib_v4_col_view'); ?></div>
<div><?php echo fxBibColHeader('bib_v4_col_start'); ?></div>
<div class="epr-col-range-spec">
<div><?php echo fxBibColHeader('bib_v4_col_qty'); ?></div>
<div class="bib-range-or bib-range-or--header" aria-hidden="true"><?php fxBibTexte('bib_v4_range_or', 1); ?></div>
<div><?php echo fxBibColHeader('bib_v4_col_end'); ?></div>
</div>
<div><?php echo fxBibColHeader('bib_v4_col_qty'); ?></div>
<?php echo fxBibRenderRangeOrCell(); ?>
<div><?php echo fxBibColHeader('bib_v4_col_end'); ?></div>
<div><?php echo fxBibColHeader('bib_v4_col_ok'); ?></div>
<div><?php echo fxBibColHeader('bib_v4_col_del'); ?></div>
<div class="epr-col-stats">
@ -5235,7 +5210,23 @@ $tabSpec = fxBibRangeSpecValues($range);
<?php echo $blnRangeLocked ? 'readonly' : ''; ?>
<?php echo fxBibAideTippyAttr('bib_v4_col_start'); ?>>
<?php echo fxBibRenderRangeQtyEndInputs($range, $blnRangeLocked); ?>
<input type="number"
class="form-control form-control-sm bib-qty"
min="1"
value="<?php echo ($tabSpec['qty'] !== '') ? (int)$tabSpec['qty'] : ''; ?>"
placeholder="<?php echo fxBibEsc(fxBibTexte('bib_v4_range_qty_ph', 0)); ?>"
<?php echo $blnRangeLocked ? 'readonly' : ''; ?>
<?php echo fxBibAideTippyAttr('bib_v4_col_qty'); ?>>
<?php echo fxBibRenderRangeOrCell(); ?>
<input type="number"
class="form-control form-control-sm bib-end"
min="1"
value="<?php echo ($tabSpec['end'] > 0) ? (int)$tabSpec['end'] : ''; ?>"
placeholder="<?php echo fxBibEsc(fxBibTexte('bib_v4_range_end_ph', 0)); ?>"
<?php echo $blnRangeLocked ? 'readonly' : ''; ?>
<?php echo fxBibAideTippyAttr('bib_v4_col_end'); ?>>
<?php echo fxBibBtnAideSegmentOpen(); ?>
<button type="button"