Implement collapsible sections for global batch assignments, enhance styles, and increment version code to 4.72.781

This commit introduces collapsible sections for global batch assignments in the user interface, improving organization and user experience. The CSS is updated to style these sections, including headers and content areas, while the JavaScript is modified to handle the toggling functionality. Additionally, the version code is incremented to 4.72.781 to reflect these changes.
This commit is contained in:
2026-07-09 12:20:08 -04:00
parent 91ee36c121
commit 2aa398b1f0
4 changed files with 145 additions and 24 deletions

View File

@ -1394,12 +1394,37 @@ ul.ms1-menu-compte li a:hover, ul.ms1-menu-compte li a:active {
flex-wrap:wrap;
}
.bib-global-batch__body{
margin-top:12px;
padding-top:12px;
border-top:1px solid #d8e3ef;
margin-top:0;
padding-top:0;
border-top:none;
display:flex;
flex-direction:column;
gap:10px;
}
.bib-global-batch__section{
margin-bottom:0;
border:1px solid #c5d9f5;
border-radius:8px;
overflow:hidden;
background:#fff;
}
.bib-global-batch__section-header{
margin:0;
padding:8px 10px;
cursor:pointer;
user-select:none;
}
.bib-global-batch__section-header .epr-header-label{
font-size:13px;
font-weight:700;
}
.bib-global-batch__section-header .btn-aide-bib{
color:#fff;
}
.bib-global-batch__section-content{
padding:10px 12px;
border-top:1px solid #c5d9f5;
background:#f8fbfe;
}
.bib-global-batch__section-title{
font-size:1rem;

View File

@ -621,8 +621,7 @@
}
if (toolId === 'global_batch') {
updateGlobalBatchAnalysis();
updateGlobalBatchGeneratedAnalysis();
/* Sections repliées à l'arrivée — analyse au déploiement d'une section. */
}
bibSyncToolNavBadges(toolId);
@ -640,8 +639,7 @@
initModuleBibTippy(document.getElementById('bib-tool-detail'));
if (toolId === 'global_batch') {
updateGlobalBatchAnalysis();
updateGlobalBatchGeneratedAnalysis();
/* Sections repliées à l'arrivée — analyse au déploiement d'une section. */
}
}
@ -717,8 +715,6 @@
body.classList.remove('bib-ui-hidden');
}
bibGlobalBatchSetToggleState(toggle, true);
updateGlobalBatchAnalysis();
updateGlobalBatchGeneratedAnalysis();
}
function bibSetGlobalBatchInfo(infoEl, text, state) {
@ -1558,7 +1554,8 @@
}
let collapsed = block.classList.toggle('is-collapsed');
btnToggle.setAttribute('aria-expanded', collapsed ? 'false' : 'true');
let hdr = block.querySelector('.bib-anomaly-block-header');
let hdr = block.querySelector('.bib-anomaly-block-header')
|| block.querySelector('.bib-global-batch__section-header');
if (hdr) {
hdr.setAttribute('aria-expanded', collapsed ? 'false' : 'true');
}
@ -1576,6 +1573,50 @@
}
}
function bibCollapseGlobalBatchSection(section) {
if (!section || section.classList.contains('is-collapsed')) {
return;
}
var btnToggle = section.querySelector('.epr-block-toggle');
if (btnToggle) {
bibToggleCollapsibleBlock(section, btnToggle);
} else {
section.classList.add('is-collapsed');
var hdr = section.querySelector('.bib-global-batch__section-header');
if (hdr) {
hdr.setAttribute('aria-expanded', 'false');
}
}
}
function bibToggleGlobalBatchSection(section, btnToggle) {
if (!section || !btnToggle) {
return;
}
var willExpand = section.classList.contains('is-collapsed');
var panel = bibGetGlobalBatchPanel();
if (willExpand && panel) {
panel.querySelectorAll('.bib-global-batch__section').forEach(function (other) {
if (other !== section) {
bibCollapseGlobalBatchSection(other);
}
});
}
bibToggleCollapsibleBlock(section, btnToggle);
if (!section.classList.contains('is-collapsed')) {
if (section.classList.contains('bib-global-batch--existing')) {
updateGlobalBatchAnalysis();
} else if (section.classList.contains('bib-global-batch--generated')) {
updateGlobalBatchGeneratedAnalysis();
}
}
}
moduleBib.addEventListener('click', function (e) {
if (e.target.closest('.btn-aide-bib, .bib-aide-trigger, .btn-aide-trad, .btn-doc-trigger, .btn-admin-doc, .btn-trad-admin, .ms1-trad-link')) {
return;
@ -1592,11 +1633,31 @@
return;
}
let globalBatchHdr = e.target.closest('.bib-global-batch__section-header');
if (globalBatchHdr && moduleBib.contains(globalBatchHdr)
&& !e.target.closest('.epr-block-toggle, .btn-aide-bib, .bib-aide-trigger, .btn-aide-trad, .btn-trad-admin')) {
e.preventDefault();
let globalBatchSection = globalBatchHdr.closest('.bib-global-batch__section');
let globalBatchBtn = globalBatchHdr.querySelector('.epr-block-toggle');
if (globalBatchSection && globalBatchBtn) {
bibToggleGlobalBatchSection(globalBatchSection, globalBatchBtn);
}
return;
}
let btnToggle = e.target.closest('.epr-block-toggle');
if (!btnToggle || !moduleBib.contains(btnToggle)) {
return;
}
let globalBatchSection = btnToggle.closest('.bib-global-batch__section');
if (globalBatchSection && bibGetGlobalBatchPanel()
&& bibGetGlobalBatchPanel().contains(globalBatchSection)) {
e.preventDefault();
bibToggleGlobalBatchSection(globalBatchSection, btnToggle);
return;
}
let anomalyBlock = btnToggle.closest('.bib-anomaly-block');
if (anomalyBlock) {
e.preventDefault();
@ -1627,6 +1688,18 @@
if (e.key !== 'Enter' && e.key !== ' ') {
return;
}
let globalBatchHdr = e.target.closest('.bib-global-batch__section-header');
if (globalBatchHdr && moduleBib.contains(globalBatchHdr)) {
e.preventDefault();
let globalBatchSection = globalBatchHdr.closest('.bib-global-batch__section');
let globalBatchBtn = globalBatchHdr.querySelector('.epr-block-toggle');
if (globalBatchSection && globalBatchBtn) {
bibToggleGlobalBatchSection(globalBatchSection, globalBatchBtn);
}
return;
}
let anomalyHdr = e.target.closest('.bib-anomaly-block-header');
if (!anomalyHdr || !moduleBib.contains(anomalyHdr)) {
return;

View File

@ -4568,6 +4568,35 @@ function renderBibGlobalBatchPanelShell($int_eve_id, $tabEpreuves, $strLangue) {
return ob_get_clean();
}
/**
* MSIN-4443 — En-tête repliable d'une section assignation globale.
*/
function fxBibGlobalBatchSectionOpen($strMode, $strTitleClef, $strLangue = 'fr') {
$strMode = preg_replace('/[^a-z_]/', '', (string)$strMode);
ob_start();
?>
<section class="bib-global-batch__section bib-global-batch--<?php echo fxBibEsc($strMode); ?> epr-block is-collapsed"
data-global-batch-section="<?php echo fxBibEsc($strMode); ?>">
<div class="epr-header bib-global-batch__section-header epr-header--collapsible"
role="button"
tabindex="0"
aria-expanded="false">
<span class="epr-header-label bib-global-batch__section-header-label">
<?php fxBibTexteTrad($strTitleClef, 1); ?>
<?php echo fxBibAideButton($strTitleClef); ?>
</span>
<?php echo fxBibBlockCollapseToggle($strLangue, true); ?>
</div>
<div class="epr-content bib-global-batch__section-content">
<?php
return ob_get_clean();
}
/** MSIN-4443 — Fermeture section repliable assignation globale. */
function fxBibGlobalBatchSectionClose() {
return '</div></section>';
}
/**
* MSIN-4436 — Bloc assignation avec séquences existantes.
*/
@ -4592,11 +4621,9 @@ function renderBibGlobalBatchPanelExisting($int_eve_id, $tabEpreuves, $strLangue
}
ob_start();
?>
<section class="bib-global-batch__section bib-global-batch--existing">
<h3 class="bib-global-batch__section-title"><?php fxBibTexteTrad('bib_v4_global_batch_existing_title', 1); ?></h3>
echo fxBibGlobalBatchSectionOpen('existing', 'bib_v4_global_batch_existing_title', $strLangue);
<?php if (count($tabSolo) < 2) { ?>
if (count($tabSolo) < 2) { ?>
<p class="bib-global-batch__unavailable text-muted small mb-0">
<?php fxBibTexteTrad('bib_v4_global_batch_need_two', 1); ?>
</p>
@ -4680,9 +4707,9 @@ function renderBibGlobalBatchPanelExisting($int_eve_id, $tabEpreuves, $strLangue
<?php echo fxBibBtnAideSegmentClose('bib_v4_batch_go'); ?>
<?php echo fxBibActionGroupClose(); ?>
</div>
<?php } ?>
</section>
<?php
<?php }
echo fxBibGlobalBatchSectionClose();
return ob_get_clean();
}
@ -4700,9 +4727,8 @@ function renderBibGlobalBatchPanelGenerated($int_eve_id, $tabEpreuves, $strLangu
$tabGlobalSort = fxBibGetSortOptionsForEpreuve(0, $int_eve_id, $strLangue, false, false);
ob_start();
echo fxBibGlobalBatchSectionOpen('generated', 'bib_v4_global_batch_generated_title', $strLangue);
?>
<section class="bib-global-batch__section bib-global-batch--generated">
<h3 class="bib-global-batch__section-title"><?php fxBibTexteTrad('bib_v4_global_batch_generated_title', 1); ?></h3>
<p class="bib-global-batch__hint text-muted small mb-2"><?php fxBibTexteTrad('bib_v4_global_batch_gen_hint', 1); ?></p>
<p class="bib-global-batch__team-note text-muted small mb-3"><?php fxBibTexteTrad('bib_v4_global_batch_team_note', 1); ?></p>
@ -4775,8 +4801,8 @@ function renderBibGlobalBatchPanelGenerated($int_eve_id, $tabEpreuves, $strLangu
<?php echo fxBibBtnAideSegmentClose('bib_v4_batch_go'); ?>
<?php echo fxBibActionGroupClose(); ?>
</div>
</section>
<?php
echo fxBibGlobalBatchSectionClose();
return ob_get_clean();
}
@ -4804,9 +4830,6 @@ function renderBibGlobalBatchPanel($int_eve_id, $tabEpreuves, $tabBibAssignments
echo $strExisting;
}
if ($strGenerated !== '') {
if ($strExisting !== '') {
echo '<hr class="bib-global-batch__section-sep">';
}
echo $strGenerated;
}
?>

View File

@ -7,7 +7,7 @@
* Constantes *
*
**************/
define('_VERSION_CODE', '4.72.780');
define('_VERSION_CODE', '4.72.781');
define('_DATE_CODE', '2026-07-09');
//MSIN-4290
define('QR_SECRET_KEY', 'ms1_qr_2026_cle_secrete_longue_et_fixe');