MSIN-4424 Implement inter-epreuve duplicate handling and update version code to 4.72.750
This commit introduces functionality to allow the same bib numbers across different epreuves, enhancing the flexibility of event management. A new AJAX action, `save_allow_inter_epr`, is added to manage this setting, along with corresponding JavaScript to handle user interactions. The database functions are updated to support this feature, ensuring proper validation and anomaly reporting. The version code is incremented to reflect these changes.
This commit is contained in:
@ -2711,6 +2711,49 @@
|
||||
});
|
||||
});
|
||||
|
||||
// MSIN-4424 — Autoriser mêmes numéros entre épreuves (réglage événement).
|
||||
let chkAllowInterEpr = moduleBib.querySelector('.bib-event-allow-inter-epr');
|
||||
if (chkAllowInterEpr) {
|
||||
chkAllowInterEpr.addEventListener('change', function () {
|
||||
let eveId = moduleBib.dataset.eveId || '';
|
||||
if (!eveId) {
|
||||
return;
|
||||
}
|
||||
|
||||
bibFetch('/ajax_bib_range.php', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
body:
|
||||
'action=save_allow_inter_epr'
|
||||
+ '&eve_id=' + encodeURIComponent(eveId)
|
||||
+ '&allow=' + (chkAllowInterEpr.checked ? '1' : '0')
|
||||
+ bibAjaxLangSuffix()
|
||||
})
|
||||
.then(function (res) { return res.json(); })
|
||||
.then(function (data) {
|
||||
if (!data.success) {
|
||||
chkAllowInterEpr.checked = !chkAllowInterEpr.checked;
|
||||
alert(data.message || bibJs('jsErrGeneric'));
|
||||
return;
|
||||
}
|
||||
|
||||
moduleBib.dataset.allowInterEpr = data.allow_inter_epr ? '1' : '0';
|
||||
|
||||
let mount = document.getElementById('bib-anomalies-mount');
|
||||
if (mount && data.anomalies_html) {
|
||||
mount.innerHTML = data.anomalies_html;
|
||||
initModuleBibTippy(mount);
|
||||
}
|
||||
})
|
||||
.catch(function () {
|
||||
chkAllowInterEpr.checked = !chkAllowInterEpr.checked;
|
||||
alert(bibJs('jsErrGeneric'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// MSIN-4436 — Anomalies : coquille légère au chargement, détail en AJAX.
|
||||
if (document.querySelector('#bib-anomalies-panel[data-bib-anomalies-deferred="1"]')) {
|
||||
refreshBibAnomaliesPanel();
|
||||
|
||||
Reference in New Issue
Block a user