Enhance anomaly block styles and functionality, increment version code to 4.72.779

This commit introduces new styles for the anomaly blocks, including collapsible sections and improved padding. The JavaScript is updated to handle click and keyboard events for toggling these sections, enhancing user interaction. The version code is incremented to 4.72.779 to reflect these changes.
This commit is contained in:
2026-07-09 11:44:15 -04:00
parent 1f96cce839
commit dc55a855c3
4 changed files with 161 additions and 61 deletions

View File

@ -3003,6 +3003,7 @@ a.ms1-trad-link.btn-aide-trad{
.bib-anomalies-content{
background:#fff;
padding:8px;
}
.bib-dist-print-panel{
@ -3048,12 +3049,50 @@ a.ms1-trad-link.btn-aide-trad{
}
.bib-anomaly-block{
padding:10px 12px;
border-top:1px solid #e9ecef;
margin-bottom:8px;
border:1px solid #c5d9f5;
border-radius:6px;
overflow:hidden;
background:#fff;
}
.bib-anomaly-block:first-child{
border-top:none;
.bib-anomaly-block:last-child{
margin-bottom:0;
}
.bib-anomaly-block-header{
margin:0;
padding:8px 10px;
font-size:13px;
font-weight:700;
cursor:pointer;
user-select:none;
}
.bib-anomaly-block-header .epr-header-label{
font-size:13px;
font-weight:700;
}
.bib-anomaly-block-header .btn-aide-bib{
color:#fff;
}
.bib-anomaly-block-count{
font-size:11px;
min-width:1.6em;
justify-content:center;
text-align:center;
}
.bib-anomaly-block.is-collapsed .bib-anomaly-block-content{
display:none;
}
.bib-anomaly-block-content{
padding:10px 12px;
border-top:1px solid #c5d9f5;
background:#fff;
}
.bib-anomaly-block-title{

View File

@ -1192,18 +1192,17 @@
});
}
// MSIN-4379 — Réduire / développer les blocs gestion et assignation (en-tête seul visible).
moduleBib.addEventListener('click', function (e) {
let btnToggle = e.target.closest('.epr-block-toggle');
if (!btnToggle || !moduleBib.contains(btnToggle)) {
return;
}
let block = btnToggle.closest('.epr-block');
if (!block || block.closest('#bib-tool-store')) {
// MSIN-4379 — Réduire / développer les blocs gestion, assignation et sections anomalies.
function bibToggleCollapsibleBlock(block, btnToggle) {
if (!block || !btnToggle) {
return;
}
let collapsed = block.classList.toggle('is-collapsed');
btnToggle.setAttribute('aria-expanded', collapsed ? 'false' : 'true');
let hdr = block.querySelector('.bib-anomaly-block-header');
if (hdr) {
hdr.setAttribute('aria-expanded', collapsed ? 'false' : 'true');
}
let label = collapsed
? (btnToggle.getAttribute('data-label-expand') || '')
: (btnToggle.getAttribute('data-label-collapse') || '');
@ -1216,20 +1215,71 @@
icon.classList.toggle('fa-chevron-up', !collapsed);
icon.classList.toggle('fa-chevron-down', collapsed);
}
}
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;
}
let anomalyHdr = e.target.closest('.bib-anomaly-block-header');
if (anomalyHdr && moduleBib.contains(anomalyHdr) && !e.target.closest('.epr-block-toggle')) {
e.preventDefault();
let anomalyBlock = anomalyHdr.closest('.bib-anomaly-block');
let anomalyBtn = anomalyHdr.querySelector('.epr-block-toggle');
if (anomalyBlock && anomalyBtn) {
bibToggleCollapsibleBlock(anomalyBlock, anomalyBtn);
}
return;
}
let btnToggle = e.target.closest('.epr-block-toggle');
if (!btnToggle || !moduleBib.contains(btnToggle)) {
return;
}
let anomalyBlock = btnToggle.closest('.bib-anomaly-block');
if (anomalyBlock) {
e.preventDefault();
bibToggleCollapsibleBlock(anomalyBlock, btnToggle);
return;
}
let block = btnToggle.closest('.epr-block');
if (!block || block.closest('#bib-tool-store')) {
return;
}
bibToggleCollapsibleBlock(block, btnToggle);
// MSIN-4424 — Sommaire quantités : chargement à la première ouverture (accordéon épreuve).
if (!collapsed && block.id === 'bib-qty-summary-panel'
if (!block.classList.contains('is-collapsed') && block.id === 'bib-qty-summary-panel'
&& block.getAttribute('data-bib-qty-summary-deferred') === '1') {
refreshBibQtySummaryPanel();
}
// MSIN-4433 — Impression PDF : chargement à la première ouverture (accordéon épreuve).
if (!collapsed && block.id === 'bib-dist-print-panel'
if (!block.classList.contains('is-collapsed') && block.id === 'bib-dist-print-panel'
&& block.getAttribute('data-bib-dist-print-deferred') === '1') {
refreshBibDistPrintPanel();
}
});
moduleBib.addEventListener('keydown', function (e) {
if (e.key !== 'Enter' && e.key !== ' ') {
return;
}
let anomalyHdr = e.target.closest('.bib-anomaly-block-header');
if (!anomalyHdr || !moduleBib.contains(anomalyHdr)) {
return;
}
e.preventDefault();
let anomalyBlock = anomalyHdr.closest('.bib-anomaly-block');
let anomalyBtn = anomalyHdr.querySelector('.epr-block-toggle');
if (anomalyBlock && anomalyBtn) {
bibToggleCollapsibleBlock(anomalyBlock, anomalyBtn);
}
});
// ============================================================
// MSIN-4379 — Tippy.js (module #module-bib uniquement)
// info_texte → data-tippy-content (tip court)

View File

@ -4509,7 +4509,7 @@ function renderBibToolNav($int_eve_id, $tabEpreuves, $strLangue = 'fr') {
<?php echo renderBibToolNavBtn('anomalies', 'bib_v4_anomalies_title', $strAnomBadges); ?>
<?php echo renderBibToolNavBtn('dist_print', 'bib_v4_dist_print_title'); ?>
<?php if ($intSolo >= 2) {
echo renderBibToolNavBtn('global_batch', 'bib_v4_global_batch_title', '', false, 'bib_v4_global_batch_doc');
echo renderBibToolNavBtn('global_batch', 'bib_v4_global_batch_title');
} ?>
</nav>
<div id="bib-tool-detail" class="bib-tool-detail bib-ui-hidden" aria-live="polite">
@ -6040,6 +6040,32 @@ function renderBibAnomaliesPanelShell($int_eve_id, $strLangue = 'fr') {
return ob_get_clean();
}
/** MSIN-4379 — Ouverture section anomalies repliable (fermée par défaut). */
function fxBibAnomalySectionOpen($strVariant, $strTitleClef, $intCount, $strLangue = 'fr') {
$strVariant = preg_replace('/[^a-z0-9-]/', '', (string)$strVariant);
?>
<section class="bib-anomaly-block bib-anomaly-block--<?php echo fxBibEsc($strVariant); ?> is-collapsed">
<div class="bib-anomaly-block-header epr-header epr-header--collapsible" role="button" tabindex="0"
aria-expanded="false">
<span class="epr-header-label bib-anomaly-block-header-label">
<?php fxBibTexte($strTitleClef, 1); ?>
<?php echo fxBibAideButton($strTitleClef); ?>
<span class="epr-header-summary bib-anomaly-block-count"><?php echo (int)$intCount; ?></span>
</span>
<?php echo fxBibBlockCollapseToggle($strLangue, true); ?>
</div>
<div class="bib-anomaly-block-content">
<?php
}
/** MSIN-4379 — Fermeture section anomalies repliable. */
function fxBibAnomalySectionClose() {
?>
</div>
</section>
<?php
}
/** MSIN-4379 — Panneau dashboard anomalies (HTML). */
function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies = null) {
$int_eve_id = (int)$int_eve_id;
@ -6072,13 +6098,9 @@ function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies =
<?php fxBibTexteTrad('bib_v4_anomalies_none', 1); ?>
</p>
<?php } else { ?>
<?php if (!empty($tabAnomalies['dupes'])) { ?>
<section class="bib-anomaly-block bib-anomaly-block--dupes">
<h3 class="bib-anomaly-block-title">
<?php fxBibTexte('bib_v4_anomalies_dupes_title', 1); ?>
<?php echo fxBibAideButton('bib_v4_anomalies_dupes_title'); ?>
<span class="badge badge-secondary"><?php echo count($tabAnomalies['dupes']); ?></span>
</h3>
<?php if (!empty($tabAnomalies['dupes'])) {
fxBibAnomalySectionOpen('dupes', 'bib_v4_anomalies_dupes_title', count($tabAnomalies['dupes']), $strLangue);
?>
<ul class="bib-anomaly-list list-unstyled mb-0">
<?php foreach ($tabAnomalies['dupes'] as $item) { ?>
<li class="bib-anomaly-item">
@ -6107,16 +6129,13 @@ function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies =
</li>
<?php } ?>
</ul>
</section>
<?php } ?>
<?php
fxBibAnomalySectionClose();
} ?>
<?php if (!empty($tabAnomalies['inter_epr_dupes'])) { ?>
<section class="bib-anomaly-block bib-anomaly-block--inter-epr-dupes">
<h3 class="bib-anomaly-block-title">
<?php fxBibTexte('bib_v4_anomalies_inter_epr_dupes_title', 1); ?>
<?php echo fxBibAideButton('bib_v4_anomalies_inter_epr_dupes_title'); ?>
<span class="badge badge-secondary"><?php echo count($tabAnomalies['inter_epr_dupes']); ?></span>
</h3>
<?php if (!empty($tabAnomalies['inter_epr_dupes'])) {
fxBibAnomalySectionOpen('inter-epr-dupes', 'bib_v4_anomalies_inter_epr_dupes_title', count($tabAnomalies['inter_epr_dupes']), $strLangue);
?>
<ul class="bib-anomaly-list list-unstyled mb-0">
<?php foreach ($tabAnomalies['inter_epr_dupes'] as $item) { ?>
<li class="bib-anomaly-item">
@ -6136,16 +6155,13 @@ function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies =
</li>
<?php } ?>
</ul>
</section>
<?php } ?>
<?php
fxBibAnomalySectionClose();
} ?>
<?php if (!empty($tabAnomalies['out_of_range'])) { ?>
<section class="bib-anomaly-block bib-anomaly-block--out-of-range">
<h3 class="bib-anomaly-block-title">
<?php fxBibTexte('bib_v4_anomalies_out_of_range_title', 1); ?>
<?php echo fxBibAideButton('bib_v4_anomalies_out_of_range_title'); ?>
<span class="badge badge-secondary"><?php echo count($tabAnomalies['out_of_range']); ?></span>
</h3>
<?php if (!empty($tabAnomalies['out_of_range'])) {
fxBibAnomalySectionOpen('out-of-range', 'bib_v4_anomalies_out_of_range_title', count($tabAnomalies['out_of_range']), $strLangue);
?>
<ul class="bib-anomaly-list list-unstyled mb-0">
<?php foreach ($tabAnomalies['out_of_range'] as $item) { ?>
<li class="bib-anomaly-item">
@ -6163,16 +6179,13 @@ function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies =
</li>
<?php } ?>
</ul>
</section>
<?php } ?>
<?php
fxBibAnomalySectionClose();
} ?>
<?php if (!empty($tabAnomalies['orphans'])) { ?>
<section class="bib-anomaly-block bib-anomaly-block--orphans">
<h3 class="bib-anomaly-block-title">
<?php fxBibTexte('bib_v4_anomalies_orphans_title', 1); ?>
<?php echo fxBibAideButton('bib_v4_anomalies_orphans_title'); ?>
<span class="badge badge-secondary"><?php echo count($tabAnomalies['orphans']); ?></span>
</h3>
<?php if (!empty($tabAnomalies['orphans'])) {
fxBibAnomalySectionOpen('orphans', 'bib_v4_anomalies_orphans_title', count($tabAnomalies['orphans']), $strLangue);
?>
<ul class="bib-anomaly-list list-unstyled mb-0">
<?php foreach ($tabAnomalies['orphans'] as $item) {
$strTypeKey = fxBibAnomalyOrphanCauseKey($item['orphan_cause'] ?? 'annule');
@ -6198,16 +6211,13 @@ function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies =
</li>
<?php } ?>
</ul>
</section>
<?php } ?>
<?php
fxBibAnomalySectionClose();
} ?>
<?php if (!empty($tabAnomalies['auto_miss'])) { ?>
<section class="bib-anomaly-block bib-anomaly-block--auto-miss">
<h3 class="bib-anomaly-block-title">
<?php fxBibTexte('bib_v4_anomalies_auto_miss_title', 1); ?>
<?php echo fxBibAideButton('bib_v4_anomalies_auto_miss_title'); ?>
<span class="badge badge-secondary"><?php echo count($tabAnomalies['auto_miss']); ?></span>
</h3>
<?php if (!empty($tabAnomalies['auto_miss'])) {
fxBibAnomalySectionOpen('auto-miss', 'bib_v4_anomalies_auto_miss_title', count($tabAnomalies['auto_miss']), $strLangue);
?>
<ul class="bib-anomaly-list list-unstyled mb-0">
<?php foreach ($tabAnomalies['auto_miss'] as $item) { ?>
<li class="bib-anomaly-item">
@ -6227,8 +6237,9 @@ function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies =
</li>
<?php } ?>
</ul>
</section>
<?php } ?>
<?php
fxBibAnomalySectionClose();
} ?>
<?php } ?>
</div>
</div>

View File

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