Refactor global simulation view handling, enhance styles, and increment version code to 4.72.783

This commit refines the rendering of the global simulation view by introducing a new wrapper function for better structure and maintainability. The CSS is updated to improve the layout and appearance of the simulation toolbar and title. Additionally, JavaScript functions are added to manage the insertion and removal of global simulation views. The version code is incremented to 4.72.783 to reflect these changes.
This commit is contained in:
2026-07-09 12:30:17 -04:00
parent 4fefc8c053
commit 9e8055bfee
6 changed files with 77 additions and 27 deletions

View File

@ -568,10 +568,7 @@ if ($action == 'batch_global_simulate') {
$intManque
);
$html = '<div class="epr-row-view bib-global-sim-view">'
. '<div class="bib-global-sim-view__summary">' . fxBibEsc($info) . '</div>'
. implode('', $htmlParts)
. '</div>';
$html = fxBibWrapGlobalSimView($info, implode('', $htmlParts));
echo json_encode([
'success' => true,

View File

@ -1495,6 +1495,25 @@ ul.ms1-menu-compte li a:hover, ul.ms1-menu-compte li a:active {
font-weight:600;
margin-bottom:12px;
}
.bib-global-sim-view__toolbar{
display:flex;
align-items:center;
justify-content:space-between;
gap:12px;
flex-wrap:wrap;
margin-bottom:12px;
padding-bottom:10px;
border-bottom:1px solid #dee2e6;
}
.bib-global-sim-view__title{
font-size:1rem;
font-weight:700;
margin:0;
}
/* Un seul Fermer en tête — pas les boutons par épreuve dans la simulation globale */
.bib-global-sim-view .bib-global-sim-section .btn-close-view{
display:none;
}
.bib-global-sim-section{
margin-top:16px;
padding-top:12px;

View File

@ -386,6 +386,28 @@
}
}
function bibRemoveGlobalSimViews() {
document.querySelectorAll('.bib-global-sim-view').forEach(function (el) {
el.remove();
});
}
function bibInsertGlobalSimView(html) {
bibRemoveGlobalSimViews();
var detailBody = document.getElementById('bib-tool-detail-body');
var anchor = bibGetGlobalBatchBody() || bibGetGlobalBatchPanel();
if (detailBody) {
detailBody.insertAdjacentHTML('beforeend', html);
return;
}
if (anchor) {
anchor.insertAdjacentHTML('afterend', html);
}
}
// MSIN-4440 — Grille outils : un panneau de détail, contenu déplacé depuis #bib-tool-store.
var bibActiveTool = null;
var bibToolContentSlots = {};
@ -484,6 +506,7 @@
bibActiveTool = null;
bibSetActiveToolButton(null);
bibSetToolDetailTitle(null);
bibRemoveGlobalSimViews();
var detail = document.getElementById('bib-tool-detail');
var detailBody = document.getElementById('bib-tool-detail-body');
@ -617,6 +640,7 @@
bibRestoreToolContent(prevTool);
bibInvalidateToolSlot(prevTool);
}
bibRemoveGlobalSimViews();
return bibEnsureToolLoaded(toolId).then(function () {
var panel = bibGetToolPanel(toolId);
@ -1309,15 +1333,7 @@
return;
}
var existing = document.querySelector('.epr-row-view');
if (existing) {
existing.remove();
}
var anchor = bibGetGlobalBatchBody() || bibGetGlobalBatchPanel();
if (anchor) {
anchor.insertAdjacentHTML('afterend', data.html);
}
bibInsertGlobalSimView(data.html);
});
return;
@ -1355,15 +1371,7 @@
return;
}
var existing = document.querySelector('.epr-row-view');
if (existing) {
existing.remove();
}
var anchor = bibGetGlobalBatchBody() || bibGetGlobalBatchPanel();
if (anchor) {
anchor.insertAdjacentHTML('afterend', data.html);
}
bibInsertGlobalSimView(data.html);
});
return;

View File

@ -423,10 +423,7 @@ function fxBibSimulateGlobalBatchGenerated($int_eve_id, $tabPlan, $strSort1, $st
$intParticipants
);
$html = '<div class="epr-row-view bib-global-sim-view bib-global-sim-view--generated">'
. '<div class="bib-global-sim-view__summary">' . fxBibEsc($info) . '</div>'
. implode('', $htmlParts)
. '</div>';
$html = fxBibWrapGlobalSimView($info, implode('', $htmlParts), 'bib-global-sim-view--generated');
return [
'success' => true,

View File

@ -4597,6 +4597,35 @@ function fxBibGlobalBatchSectionClose() {
return '</div></section>';
}
/**
* MSIN-4443 — Enveloppe résultats simulation assignation globale (bouton Fermer).
*/
function fxBibWrapGlobalSimView($strSummary, $strSectionsHtml, $strExtraClass = '') {
$strExtraClass = trim((string)$strExtraClass);
$strClass = 'epr-row-view bib-global-sim-view';
if ($strExtraClass !== '') {
$strClass .= ' ' . preg_replace('/[^a-z0-9 _-]/', '', $strExtraClass);
}
ob_start();
?>
<div class="<?php echo fxBibEsc($strClass); ?>">
<div class="bib-global-sim-view__toolbar">
<span class="bib-global-sim-view__title"><?php fxBibTexte('bib_v4_ajax_title_simulation', 1); ?></span>
<?php echo fxBibBtnAideSegmentOpen(); ?>
<button type="button" class="btn btn-sm btn-secondary btn-close-view">
<?php fxBibTexte('bib_v4_view_close', 1); ?>
</button>
<?php echo fxBibAideButton('bib_v4_view_close', 'secondary', false); ?>
<?php echo fxBibBtnAideSegmentClose('bib_v4_view_close'); ?>
</div>
<div class="bib-global-sim-view__summary"><?php echo fxBibEsc($strSummary); ?></div>
<?php echo $strSectionsHtml; ?>
</div>
<?php
return ob_get_clean();
}
/**
* MSIN-4436 — Bloc assignation avec séquences existantes.
*/

View File

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