Enhance bib management functionality by adding sequence detection and improving UI state synchronization. Introduced a new helper function to check for saved sequences and updated button visibility logic based on sequence presence. Adjusted rendering of action buttons in the assignment interface to reflect the current state more accurately.

This commit is contained in:
2026-06-16 16:36:06 -04:00
parent bea4db8386
commit 780a1c140b
2 changed files with 65 additions and 30 deletions

View File

@ -2808,26 +2808,28 @@ function renderBibRangeHeader() {
}
/** Boutons assignation / reset / auto — fusionnés dans la boîte Assignation de dossard. */
function renderBibAssignActions($tabBibAssignments, $strLangue, $infoBib, $blnAutoActive, $blnTeamEpreuve) {
function renderBibAssignActions($tabBibAssignments, $strLangue, $infoBib, $blnAutoActive, $blnTeamEpreuve, $blnHasSequences = false) {
$strHideNoSeq = $blnHasSequences ? '' : 'display:none;';
$strHideReset = ($blnHasSequences && (int)$infoBib['avec_bib'] > 0) ? '' : 'display:none;';
ob_start();
?>
<div class="epr-actions">
<div class="epr-action-row epr-action-row-main">
<span class="epr-action-group">
<span class="epr-action-group epr-action-batch-group" style="<?php echo $strHideNoSeq; ?>">
<button type="button" class="btn btn-sm btn-secondary btn-assign-batch"<?php echo fxBibTippyAttr('bib_v4_tip_assign_seq'); ?>>
<?php fxBibTexte('bib_v4_assign_seq', 1); ?>
</button>
<?php echo fxBibAideButton('bib_v4_assign_seq', 'secondary'); ?>
</span>
<span class="epr-action-group epr-action-reset-group"
style="<?php echo ((int)$infoBib['avec_bib'] > 0 ? '' : 'display:none;'); ?>">
style="<?php echo $strHideReset; ?>">
<button type="button"
class="btn btn-sm btn-danger btn-reset"<?php echo fxBibTippyAttr('bib_v4_tip_reset'); ?>>
<?php fxBibTexte('bib_v4_reset', 1); ?>
</button>
<?php echo fxBibAideButton('bib_v4_reset', 'danger'); ?>
</span>
<span class="epr-action-group">
<span class="epr-action-group epr-action-auto-group" style="<?php echo $strHideNoSeq; ?>">
<button type="button"
class="btn btn-sm btn-auto <?php echo $blnAutoActive ? 'btn-success' : 'btn-secondary'; ?>"<?php echo fxBibTippyAttr('bib_v4_tip_auto'); ?>>
<?php echo fxBibEsc($blnAutoActive ? fxBibTexte('bib_v4_auto_config', 0) : fxBibTexte('bib_v4_auto', 0)); ?>
@ -3061,7 +3063,8 @@ if ($teamMode <= 0) {
$strLangue,
$infoBib,
$blnAutoActive,
(int)$tabEpreuves[$i]['epr_equipe'] === 1
(int)$tabEpreuves[$i]['epr_equipe'] === 1,
count($tabBibStats) > 0
); ?>
</div>