From 4fefc8c053d739c57d773064b222d35c4587282c Mon Sep 17 00:00:00 2001 From: stephan Date: Thu, 9 Jul 2026 12:23:11 -0400 Subject: [PATCH] Refactor global batch section handling in JavaScript, enhance CSS for collapsible sections, and increment version code to 4.72.782 This commit refines the JavaScript functions for managing global batch sections, improving the retrieval of section bodies and ensuring proper toggling functionality. The CSS is updated to support collapsible sections, allowing for better organization of content. Additionally, the version code is incremented to 4.72.782 to reflect these changes. --- css/style.css | 7 ++++++- js/v2/bib-assignments.js | 37 +++++++++++++++++++++++++------------ php/inc_settings.php | 2 +- 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/css/style.css b/css/style.css index 335c31f..7bbff77 100644 --- a/css/style.css +++ b/css/style.css @@ -1320,7 +1320,6 @@ ul.ms1-menu-compte li a:hover, ul.ms1-menu-compte li a:active { background:#f4f8fc; } -#module-bib .bib-tool-detail__body .epr-content, #module-bib .bib-tool-detail__body .bib-global-batch__body{ display:block !important; background:transparent; @@ -1335,6 +1334,12 @@ ul.ms1-menu-compte li a:hover, ul.ms1-menu-compte li a:active { background:transparent; } +/* MSIN-4443 — Contenu des sections assignation globale : repliable malgré display:block sur .epr-content */ +#module-bib .bib-tool-detail__body .bib-global-batch__section.is-collapsed .bib-global-batch__section-content, +#module-bib .bib-tool-detail__body .bib-global-batch__section.is-collapsed .epr-content{ + display:none !important; +} + /* (?) dans le panneau de détail : rond blanc bien visible sur fond teinté. */ #module-bib .bib-tool-detail .btn-aide-bib, #module-bib .bib-tool-detail .bib-aide-trigger{ diff --git a/js/v2/bib-assignments.js b/js/v2/bib-assignments.js index cfb65d5..ecbea7a 100644 --- a/js/v2/bib-assignments.js +++ b/js/v2/bib-assignments.js @@ -342,14 +342,28 @@ return document.getElementById('bib-global-batch'); } - function bibGetGlobalBatchExistingSection() { + /** Corps du panneau (dans #bib-tool-detail-body une fois l'outil ouvert). */ + function bibGetGlobalBatchBody() { + var detailBody = document.getElementById('bib-tool-detail-body'); + if (detailBody) { + var inDetail = detailBody.querySelector('.bib-global-batch__body'); + if (inDetail) { + return inDetail; + } + } + var panel = bibGetGlobalBatchPanel(); - return panel ? panel.querySelector('.bib-global-batch--existing') : null; + return panel ? panel.querySelector('.bib-global-batch__body') : null; + } + + function bibGetGlobalBatchExistingSection() { + var body = bibGetGlobalBatchBody(); + return body ? body.querySelector('.bib-global-batch--existing') : null; } function bibGetGlobalBatchGeneratedSection() { - var panel = bibGetGlobalBatchPanel(); - return panel ? panel.querySelector('.bib-global-batch--generated') : null; + var body = bibGetGlobalBatchBody(); + return body ? body.querySelector('.bib-global-batch--generated') : null; } function bibInvalidateGlobalBatchPanel() { @@ -1300,7 +1314,7 @@ existing.remove(); } - var anchor = bibGetGlobalBatchPanel(); + var anchor = bibGetGlobalBatchBody() || bibGetGlobalBatchPanel(); if (anchor) { anchor.insertAdjacentHTML('afterend', data.html); } @@ -1346,7 +1360,7 @@ existing.remove(); } - var anchor = bibGetGlobalBatchPanel(); + var anchor = bibGetGlobalBatchBody() || bibGetGlobalBatchPanel(); if (anchor) { anchor.insertAdjacentHTML('afterend', data.html); } @@ -1375,7 +1389,7 @@ return; } - var bibGlobalBatchPanel = bibGetGlobalBatchPanel(); + var bibGlobalBatchPanel = bibGetGlobalBatchBody(); if (!bibGlobalBatchPanel || !bibGlobalBatchPanel.contains(e.target)) { return; } @@ -1596,10 +1610,10 @@ } var willExpand = section.classList.contains('is-collapsed'); - var panel = bibGetGlobalBatchPanel(); + var root = bibGetGlobalBatchBody(); - if (willExpand && panel) { - panel.querySelectorAll('.bib-global-batch__section').forEach(function (other) { + if (willExpand && root) { + root.querySelectorAll('.bib-global-batch__section').forEach(function (other) { if (other !== section) { bibCollapseGlobalBatchSection(other); } @@ -1651,8 +1665,7 @@ } let globalBatchSection = btnToggle.closest('.bib-global-batch__section'); - if (globalBatchSection && bibGetGlobalBatchPanel() - && bibGetGlobalBatchPanel().contains(globalBatchSection)) { + if (globalBatchSection && moduleBib.contains(globalBatchSection)) { e.preventDefault(); bibToggleGlobalBatchSection(globalBatchSection, btnToggle); return; diff --git a/php/inc_settings.php b/php/inc_settings.php index ab65353..4a277b3 100644 --- a/php/inc_settings.php +++ b/php/inc_settings.php @@ -7,7 +7,7 @@ * Constantes * * **************/ -define('_VERSION_CODE', '4.72.781'); +define('_VERSION_CODE', '4.72.782'); define('_DATE_CODE', '2026-07-09'); //MSIN-4290 define('QR_SECRET_KEY', 'ms1_qr_2026_cle_secrete_longue_et_fixe');