Implement global batch completion UI, enhance JavaScript handling, and increment version code to 4.72.784

This commit introduces a new user interface for displaying the completion status of global batch assignments, including success, warning, and error states. The CSS is updated to style the completion messages appropriately. Additionally, JavaScript functions are added to manage the display of these messages based on assignment results. Localization keys are also added for improved user feedback. The version code is incremented to 4.72.784 to reflect these changes.
This commit is contained in:
2026-07-09 12:48:02 -04:00
parent 9e8055bfee
commit 33706bb195
5 changed files with 187 additions and 83 deletions

View File

@ -1524,6 +1524,54 @@ ul.ms1-menu-compte li a:hover, ul.ms1-menu-compte li a:active {
margin-bottom:8px; margin-bottom:8px;
} }
/* MSIN-4443 — Écran de fin assignation globale GO */
.bib-global-batch-complete{
margin:0;
padding:28px 24px 32px;
text-align:center;
background:#fff;
border:1px solid #c5d9f5;
border-radius:10px;
box-shadow:0 4px 18px rgba(47,95,208,.08);
}
.bib-global-batch-complete--ok{
border-color:#9fd4b0;
background:linear-gradient(180deg,#f3fbf5 0%,#fff 55%);
}
.bib-global-batch-complete--warning{
border-color:#f0d58a;
background:linear-gradient(180deg,#fffbf0 0%,#fff 55%);
}
.bib-global-batch-complete--error{
border-color:#efb8b8;
background:linear-gradient(180deg,#fff5f5 0%,#fff 55%);
}
.bib-global-batch-complete__icon{
font-size:2.5rem;
line-height:1;
margin-bottom:12px;
}
.bib-global-batch-complete__title{
font-size:1.35rem;
font-weight:700;
margin:0 0 10px;
color:#1a3a6b;
}
.bib-global-batch-complete__message{
font-size:1.05rem;
margin:0 0 8px;
color:#333;
}
.bib-global-batch-complete__summary{
font-size:.95rem;
color:#5a6c7d;
margin:0 0 24px;
}
.bib-global-batch-complete__reload{
min-width:220px;
font-weight:600;
}
/* Typographie cohérente — module bib v4 */ /* Typographie cohérente — module bib v4 */
#module-bib .epr-header{ #module-bib .epr-header{
font-size:15px; font-size:15px;

View File

@ -386,6 +386,82 @@
} }
} }
function bibEscHtml(str) {
return String(str == null ? '' : str)
.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;');
}
function bibFinishGlobalBatchGo(runResults) {
var totalAssigned = 0;
var totalExpected = 0;
var nbEpreuves = runResults ? runResults.length : 0;
(runResults || []).forEach(function (result) {
totalAssigned += result.assigned || 0;
totalExpected += result.total || 0;
});
var remaining = Math.max(0, totalExpected - totalAssigned);
var state = 'ok';
var icon = '\u2713';
var title = bibJs('jsGlobalBatchCompleteTitle') || 'Assignation terminée';
var message = '';
var summary = bibJsFmt(
'jsGlobalBatchCompleteSummary',
totalAssigned,
totalExpected,
nbEpreuves
);
if (totalAssigned === 0 && totalExpected > 0) {
state = 'error';
icon = '!';
message = bibJs('jsAssignNone') || bibJs('jsErrGeneric');
} else if (remaining > 0) {
state = 'warning';
icon = '!';
message = bibJsFmt('jsAssignPartial', totalAssigned, remaining);
} else if (totalAssigned > 0) {
message = bibJsFmt('jsAssignFull', totalAssigned);
} else {
state = 'error';
icon = '!';
message = bibJs('jsErrGeneric');
}
bibBatchProgressForceHide();
bibRemoveGlobalSimViews();
var reloadLabel = bibJs('jsGlobalBatchCompleteReload') || 'OK';
var html = '<div class="bib-global-batch-complete bib-global-batch-complete--'
+ bibEscHtml(state)
+ '" role="status" aria-live="polite">'
+ '<div class="bib-global-batch-complete__icon" aria-hidden="true">' + icon + '</div>'
+ '<h3 class="bib-global-batch-complete__title">' + bibEscHtml(title) + '</h3>'
+ '<p class="bib-global-batch-complete__message">' + bibEscHtml(message) + '</p>'
+ '<p class="bib-global-batch-complete__summary">' + bibEscHtml(summary) + '</p>'
+ '<button type="button" class="btn btn-primary bib-global-batch-complete__reload btn-global-batch-complete-reload">'
+ bibEscHtml(reloadLabel)
+ '</button>'
+ '</div>';
var detailBody = document.getElementById('bib-tool-detail-body');
if (detailBody) {
detailBody.innerHTML = html;
var detail = document.getElementById('bib-tool-detail');
if (detail) {
detail.classList.remove('bib-ui-hidden');
detail.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
return;
}
location.reload();
}
function bibRemoveGlobalSimViews() { function bibRemoveGlobalSimViews() {
document.querySelectorAll('.bib-global-sim-view').forEach(function (el) { document.querySelectorAll('.bib-global-sim-view').forEach(function (el) {
el.remove(); el.remove();
@ -1054,7 +1130,11 @@
}); });
return chain.then(function () { return chain.then(function () {
bibBatchProgressShow(globalTotal, globalTotal); bibBatchProgressShow(
globalTotal,
globalTotal,
bibJs('jsGlobalBatchFinalizing') || bibJs('jsLoaderWait')
);
var refreshChain = Promise.resolve(); var refreshChain = Promise.resolve();
runResults.forEach(function (result) { runResults.forEach(function (result) {
@ -1072,56 +1152,10 @@
return refreshChain.then(function () { return refreshChain.then(function () {
if (typeof refreshBibAnomaliesPanel === 'function') { if (typeof refreshBibAnomaliesPanel === 'function') {
refreshBibAnomaliesPanel(); return refreshBibAnomaliesPanel();
} }
}).then(function () {
var totalAssigned = 0; bibFinishGlobalBatchGo(runResults);
var totalExpected = 0;
runResults.forEach(function (result) {
totalAssigned += result.assigned;
totalExpected += result.total;
});
var remaining = Math.max(0, totalExpected - totalAssigned);
bibInvalidateGlobalBatchPanel();
return bibEnsureGlobalBatchPanelLoaded().then(function () {
if (bibActiveTool === 'global_batch') {
bibInvalidateToolSlot('global_batch');
bibMountToolContent('global_batch');
initModuleBibTippy(document.getElementById('bib-tool-detail'));
}
return Promise.all([
updateGlobalBatchAnalysis(),
updateGlobalBatchGeneratedAnalysis()
]).then(function () {
var genSection = bibGetGlobalBatchGeneratedSection();
var infoEl = genSection
? genSection.querySelector('.bib-global-gen-batch__info')
: null;
if (totalAssigned === 0 && totalExpected > 0) {
var msgNone = bibJs('jsAssignNone') || bibJs('jsErrGeneric');
if (infoEl) {
bibSetGlobalBatchInfo(infoEl, msgNone, 'error');
}
alert(msgNone);
} else if (remaining > 0) {
var msgPartial = bibJsFmt('jsAssignPartial', totalAssigned, remaining);
if (infoEl) {
bibSetGlobalBatchInfo(infoEl, msgPartial, 'warning');
}
alert(msgPartial);
} else if (totalAssigned > 0) {
var msgFull = bibJsFmt('jsAssignFull', totalAssigned);
if (infoEl) {
bibSetGlobalBatchInfo(infoEl, msgFull, 'ok');
}
}
});
});
}); });
}); });
}) })
@ -1213,7 +1247,11 @@
}); });
return chain.then(function () { return chain.then(function () {
bibBatchProgressShow(globalTotal, globalTotal); bibBatchProgressShow(
globalTotal,
globalTotal,
bibJs('jsGlobalBatchFinalizing') || bibJs('jsLoaderWait')
);
var refreshChain = Promise.resolve(); var refreshChain = Promise.resolve();
runResults.forEach(function (result) { runResults.forEach(function (result) {
@ -1231,38 +1269,10 @@
return refreshChain.then(function () { return refreshChain.then(function () {
if (typeof refreshBibAnomaliesPanel === 'function') { if (typeof refreshBibAnomaliesPanel === 'function') {
refreshBibAnomaliesPanel(); return refreshBibAnomaliesPanel();
} }
}).then(function () {
var panelRef = bibGetGlobalBatchExistingSection(); bibFinishGlobalBatchGo(runResults);
var infoEl = panelRef ? panelRef.querySelector('.bib-global-batch__info') : null;
var totalAssigned = 0;
var totalExpected = 0;
runResults.forEach(function (result) {
totalAssigned += result.assigned;
totalExpected += result.total;
});
var remaining = Math.max(0, totalExpected - totalAssigned);
return updateGlobalBatchAnalysis().then(function () {
if (totalAssigned === 0 && totalExpected > 0) {
var msgNone = bibJs('jsAssignNone') || bibJs('jsErrGeneric');
bibSetGlobalBatchInfo(infoEl, msgNone, 'error');
alert(msgNone);
} else if (remaining > 0) {
var msgPartial = bibJsFmt('jsAssignPartial', totalAssigned, remaining);
bibSetGlobalBatchInfo(infoEl, msgPartial, 'warning');
alert(msgPartial);
} else if (totalAssigned > 0) {
bibSetGlobalBatchInfo(
infoEl,
bibJsFmt('jsAssignFull', totalAssigned),
'ok'
);
}
});
}); });
}); });
}) })
@ -1287,6 +1297,12 @@
}); });
moduleBib.addEventListener('click', function (e) { moduleBib.addEventListener('click', function (e) {
if (e.target.closest('.btn-global-batch-complete-reload')) {
e.preventDefault();
location.reload();
return;
}
if (e.target.closest('.bib-tool-detail__close')) { if (e.target.closest('.bib-tool-detail__close')) {
e.preventDefault(); e.preventDefault();
bibCloseTool(); bibCloseTool();

View File

@ -3334,6 +3334,10 @@ function fxBibStaticFallback($clef) {
'bib_v4_global_batch_unavailable' => ['fr' => 'Aucune assignation globale disponible pour cet événement.', 'en' => 'No global assignment available for this event.'], 'bib_v4_global_batch_unavailable' => ['fr' => 'Aucune assignation globale disponible pour cet événement.', 'en' => 'No global assignment available for this event.'],
'bib_v4_ajax_global_gen_sim_summary' => ['fr' => '%d épreuve(s) · %d dossards · %d à assigner', 'en' => '%d race(s) · %d bibs · %d to assign'], 'bib_v4_ajax_global_gen_sim_summary' => ['fr' => '%d épreuve(s) · %d dossards · %d à assigner', 'en' => '%d race(s) · %d bibs · %d to assign'],
'bib_v4_ajax_global_gen_analysis' => ['fr' => '%d épreuve(s) · plage %d → %d · %d à assigner', 'en' => '%d race(s) · range %d → %d · %d to assign'], 'bib_v4_ajax_global_gen_analysis' => ['fr' => '%d épreuve(s) · plage %d → %d · %d à assigner', 'en' => '%d race(s) · range %d → %d · %d to assign'],
'bib_v4_js_global_batch_finalizing' => ['fr' => 'Finalisation — mise à jour de l\'affichage…', 'en' => 'Finishing — refreshing the display…'],
'bib_v4_global_batch_go_complete_title' => ['fr' => 'Assignation terminée', 'en' => 'Assignment complete'],
'bib_v4_global_batch_go_complete_summary' => ['fr' => '%d dossard(s) assigné(s) sur %d · %d épreuve(s)', 'en' => '%d bib(s) assigned of %d · %d race(s)'],
'bib_v4_global_batch_go_complete_reload' => ['fr' => 'OK — Recharger la page', 'en' => 'OK — Reload page'],
'bib_v4_batch_order_2' => ['fr' => 'Tri secondaire', 'en' => 'Secondary sort'], 'bib_v4_batch_order_2' => ['fr' => 'Tri secondaire', 'en' => 'Secondary sort'],
'bib_v4_batch_order_none' => ['fr' => '— Aucun —', 'en' => '— None —'], 'bib_v4_batch_order_none' => ['fr' => '— Aucun —', 'en' => '— None —'],
'bib_v4_batch_sort_group_fixed' => ['fr' => 'Critères fixes', 'en' => 'Fixed criteria'], 'bib_v4_batch_sort_group_fixed' => ['fr' => 'Critères fixes', 'en' => 'Fixed criteria'],
@ -3586,6 +3590,10 @@ function fxBibModuleJsDataAttrs() {
'global-no-seq' => 'bib_v4_js_global_no_seq', 'global-no-seq' => 'bib_v4_js_global_no_seq',
'global-gen-no-start' => 'bib_v4_global_batch_gen_no_start', 'global-gen-no-start' => 'bib_v4_global_batch_gen_no_start',
'global-gen-no-epr' => 'bib_v4_js_global_no_epr', 'global-gen-no-epr' => 'bib_v4_js_global_no_epr',
'global-batch-finalizing' => 'bib_v4_js_global_batch_finalizing',
'global-batch-complete-title' => 'bib_v4_global_batch_go_complete_title',
'global-batch-complete-summary' => 'bib_v4_global_batch_go_complete_summary',
'global-batch-complete-reload' => 'bib_v4_global_batch_go_complete_reload',
'reset-all-confirm' => 'bib_v4_js_reset_all_confirm', 'reset-all-confirm' => 'bib_v4_js_reset_all_confirm',
'reset-all-locked' => 'bib_v4_js_reset_all_locked', 'reset-all-locked' => 'bib_v4_js_reset_all_locked',
'assign-full' => 'bib_v4_ajax_assign_full', 'assign-full' => 'bib_v4_ajax_assign_full',

View File

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

View File

@ -96,3 +96,35 @@ FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_ajax_gl
INSERT INTO info (info_clef, info_langue, info_texte, info_aide, info_prg, info_description, info_trie, info_actif, info_option1, info_option2, info_option3, info_creation) INSERT INTO info (info_clef, info_langue, info_texte, info_aide, info_prg, info_description, info_trie, info_actif, info_option1, info_option2, info_option3, info_creation)
SELECT 'bib_v4_ajax_global_gen_analysis', 'en', '%d race(s) · range %d → %d · %d to assign', '', 'compte.php', '', 0, 1, '', '', '', NOW() SELECT 'bib_v4_ajax_global_gen_analysis', 'en', '%d race(s) · range %d → %d · %d to assign', '', 'compte.php', '', 0, 1, '', '', '', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_ajax_global_gen_analysis' AND info_langue = 'en' AND info_prg = 'compte.php'); FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_ajax_global_gen_analysis' AND info_langue = 'en' AND info_prg = 'compte.php');
INSERT INTO info (info_clef, info_langue, info_texte, info_aide, info_prg, info_description, info_trie, info_actif, info_option1, info_option2, info_option3, info_creation)
SELECT 'bib_v4_js_global_batch_finalizing', 'fr', 'Finalisation — mise à jour de l''affichage…', '', 'compte.php', '', 0, 1, '', '', '', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_js_global_batch_finalizing' AND info_langue = 'fr' AND info_prg = 'compte.php');
INSERT INTO info (info_clef, info_langue, info_texte, info_aide, info_prg, info_description, info_trie, info_actif, info_option1, info_option2, info_option3, info_creation)
SELECT 'bib_v4_js_global_batch_finalizing', 'en', 'Finishing — refreshing the display…', '', 'compte.php', '', 0, 1, '', '', '', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_js_global_batch_finalizing' AND info_langue = 'en' AND info_prg = 'compte.php');
INSERT INTO info (info_clef, info_langue, info_texte, info_aide, info_prg, info_description, info_trie, info_actif, info_option1, info_option2, info_option3, info_creation)
SELECT 'bib_v4_global_batch_go_complete_title', 'fr', 'Assignation terminée', '', 'compte.php', '', 0, 1, '', '', '', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_global_batch_go_complete_title' AND info_langue = 'fr' AND info_prg = 'compte.php');
INSERT INTO info (info_clef, info_langue, info_texte, info_aide, info_prg, info_description, info_trie, info_actif, info_option1, info_option2, info_option3, info_creation)
SELECT 'bib_v4_global_batch_go_complete_title', 'en', 'Assignment complete', '', 'compte.php', '', 0, 1, '', '', '', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_global_batch_go_complete_title' AND info_langue = 'en' AND info_prg = 'compte.php');
INSERT INTO info (info_clef, info_langue, info_texte, info_aide, info_prg, info_description, info_trie, info_actif, info_option1, info_option2, info_option3, info_creation)
SELECT 'bib_v4_global_batch_go_complete_summary', 'fr', '%d dossard(s) assigné(s) sur %d · %d épreuve(s)', '', 'compte.php', '', 0, 1, '', '', '', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_global_batch_go_complete_summary' AND info_langue = 'fr' AND info_prg = 'compte.php');
INSERT INTO info (info_clef, info_langue, info_texte, info_aide, info_prg, info_description, info_trie, info_actif, info_option1, info_option2, info_option3, info_creation)
SELECT 'bib_v4_global_batch_go_complete_summary', 'en', '%d bib(s) assigned of %d · %d race(s)', '', 'compte.php', '', 0, 1, '', '', '', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_global_batch_go_complete_summary' AND info_langue = 'en' AND info_prg = 'compte.php');
INSERT INTO info (info_clef, info_langue, info_texte, info_aide, info_prg, info_description, info_trie, info_actif, info_option1, info_option2, info_option3, info_creation)
SELECT 'bib_v4_global_batch_go_complete_reload', 'fr', 'OK — Recharger la page', '', 'compte.php', '', 0, 1, '', '', '', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_global_batch_go_complete_reload' AND info_langue = 'fr' AND info_prg = 'compte.php');
INSERT INTO info (info_clef, info_langue, info_texte, info_aide, info_prg, info_description, info_trie, info_actif, info_option1, info_option2, info_option3, info_creation)
SELECT 'bib_v4_global_batch_go_complete_reload', 'en', 'OK — Reload page', '', 'compte.php', '', 0, 1, '', '', '', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_global_batch_go_complete_reload' AND info_langue = 'en' AND info_prg = 'compte.php');