MSIN-4468 — Enhance quantity validation in AJAX and JavaScript for race management. Implement error handling for total quantity below registrations and update related UI elements. Increment version code to 4.72.853.

This commit is contained in:
2026-07-21 13:19:01 -04:00
parent 39c062eafc
commit 35f1a15fc7
5 changed files with 77 additions and 3 deletions

View File

@ -2294,6 +2294,12 @@
if (elInscrits) {
elInscrits.textContent = row.qte_inscrits;
}
let gestionPanel = document.querySelector(
'.epr-gestion-panel[data-epr-id="' + eprId + '"]'
);
if (gestionPanel && row.qte_inscrits !== undefined) {
gestionPanel.dataset.qteInscrits = row.qte_inscrits;
}
if (elCheckin) {
elCheckin.textContent = row.qte_checkin;
}
@ -2345,6 +2351,15 @@
return;
}
let gestionPanel = btn.closest('.epr-gestion-panel');
let intNbInscriptions = gestionPanel
? parseInt(gestionPanel.dataset.qteInscrits, 10) || 0
: 0;
if (intQteTotale < intNbInscriptions) {
alert(bibJsFmt('jsQteTotalMin', intNbInscriptions));
return;
}
bibLoaderShow();
fetch('/ajax_promoteur.php', {
method: 'POST',