Refactor registration management styles and enhance AJAX handling, update version code to 4.72.773

This commit refines the CSS styles for the registration management form, adjusting margins and padding for better layout. It also updates the JavaScript to include the epr_id in the delete action, improving the handling of AJAX requests. Additionally, the version code is incremented to 4.72.773 to reflect these changes.
This commit is contained in:
2026-07-09 11:16:12 -04:00
parent e5f8ca953e
commit fdecff66d5
5 changed files with 31 additions and 54 deletions

View File

@ -3340,19 +3340,13 @@ a.ms1-trad-link.btn-aide-trad{
}
.inscr-gestion-form-subsection{
margin-top:12px;
padding-top:12px;
margin-top:4px;
padding-top:4px;
border-top:1px solid #e9ecef;
}
.inscr-gestion-form-subsection__title{
display:flex;
align-items:center;
gap:8px;
font-weight:600;
font-size:13px;
margin-bottom:8px;
color:#495057;
.inscr-gestion-label--subsection{
margin-top:10px;
}
.inscr-gestion-check{
@ -3365,13 +3359,10 @@ a.ms1-trad-link.btn-aide-trad{
.inscr-gestion-form-actions{
display:flex;
flex-wrap:wrap;
gap:8px;
}
.inscr-gestion-form-actions .btn{
flex:1;
}
.inscr-gestion-list-head{
display:flex;
justify-content:space-between;

View File

@ -2530,12 +2530,18 @@
let id = btnDelete.dataset.id;
if (!id) return;
let rowDelete = btnDelete.closest('.epr-row');
let eprIdDelete = rowDelete ? rowDelete.dataset.eprId : '';
bibFetch('/ajax_bib_range.php', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: 'action=delete&id=' + encodeURIComponent(id) + bibAjaxLangSuffix()
body: 'action=delete'
+ '&id=' + encodeURIComponent(id)
+ '&epr_id=' + encodeURIComponent(eprIdDelete)
+ bibAjaxLangSuffix()
})
.then(res => res.text())
.then(raw => {

View File

@ -1387,10 +1387,7 @@ function fxInscrGestionRenderList($intEveId, $strLangue, $strBaseUrl, $arrReq) {
$strFilterLabel .= ' (' . $intFilterCount . ')';
}
echo '<div class="inscr-gestion-form-subsection">';
echo '<div class="inscr-gestion-form-subsection__title">';
echo '<i class="fa fa-filter inscr-gestion-panel__icon" aria-hidden="true"></i>';
echo '<span>' . fxInscrGestionEsc($strFilterLabel) . '</span>';
echo '</div>';
echo '<div class="inscr-gestion-label inscr-gestion-label--subsection">' . fxInscrGestionEsc($strFilterLabel) . '</div>';
echo '<label class="inscr-gestion-label" for="sel_rech_epreuve">' . fxInscrGestionEsc(fxInscrGestionT('sel_rech_epreuve')) . '</label>';
echo '<select class="form-control form-control-sm rounded-0" id="sel_rech_epreuve" name="sel_rech_epreuve">';

View File

@ -3159,7 +3159,7 @@ function fxBibSetEventAllowsInterEprDuplicates($int_eve_id, $blnAllow) {
return ['success' => true, 'allow_inter_epr' => ($intAllow === 1)];
}
/** Resout eve_id depuis la requete AJAX bib (eve_id direct ou via epr_id). */
/** Resout eve_id depuis la requete AJAX bib (eve_id, epr_id ou epr_bib_id / id). */
function fxBibResolveEveIdFromRequest() {
global $objDatabase;
@ -3168,18 +3168,30 @@ function fxBibResolveEveIdFromRequest() {
}
$intEprId = intval($_REQUEST['epr_id'] ?? 0);
if ($intEprId <= 0) {
if ($intEprId > 0) {
$intEveId = intval($objDatabase->fxGetVar(
'SELECT eve_id FROM inscriptions_epreuves WHERE epr_id = ' . $intEprId . ' LIMIT 1'
));
return ($intEveId > 0) ? $intEveId : 0;
}
// delete n'envoyait que id (epr_bib_id) — seule action sans epr_id ni eve_id
$intBibId = intval($_REQUEST['epr_bib_id'] ?? $_REQUEST['id'] ?? 0);
if ($intBibId <= 0) {
return 0;
}
$intEveId = intval($objDatabase->fxGetVar(
'SELECT eve_id FROM inscriptions_epreuves WHERE epr_id = ' . $intEprId . ' LIMIT 1'
'SELECT e.eve_id FROM inscriptions_epreuves_bib b '
. 'INNER JOIN inscriptions_epreuves e ON e.epr_id = b.epr_id '
. 'WHERE b.epr_bib_id = ' . $intBibId . ' LIMIT 1'
));
return ($intEveId > 0) ? $intEveId : 0;
}
/** Gate AJAX bib v4 — session, droits v2 par evenement (usa_id = bypass), CSRF. */
/** Gate AJAX bib v4 — session promoteur + CSRF (pas de granularite v2 pour l'instant). */
function fxBibRequireAjaxAccess() {
if (!fxBibRequirePromoteurSession()) {
echo json_encode([
@ -3189,21 +3201,6 @@ function fxBibRequireAjaxAccess() {
exit;
}
if (empty($_SESSION['usa_id'])) {
require_once __DIR__ . '/inc_fx_eve_acces.php';
$intComId = intval($_SESSION['com_id'] ?? 0);
$intEveId = fxBibResolveEveIdFromRequest();
if ($intComId <= 0 || $intEveId <= 0
|| !fxEveAccesHasAnyPermission($intComId, $intEveId, array('dossards.manage', 'epreuves.edit_qte'))) {
echo json_encode([
'success' => false,
'message' => fxBibMsg('bib_v4_ajax_unauthorized'),
]);
exit;
}
}
$strToken = $_POST['csrf_token'] ?? $_REQUEST['csrf_token'] ?? '';
if (!fxBibValidateCsrf($strToken)) {
echo json_encode([
@ -7865,7 +7862,7 @@ function fxBibGetCurrentPromoteurDisplayName() {
return trim((string)($_SESSION['com_prenom'] ?? '') . ' ' . (string)($_SESSION['com_nom'] ?? ''));
}
/** MSIN-4433 — Accès génération PDF (session, permissions, CSRF). */
/** MSIN-4433 — Accès génération PDF (session promoteur + CSRF, pas de granularite v2 pour l'instant). */
function fxBibRequireDistPrintAccess() {
if (!fxBibRequirePromoteurSession()) {
http_response_code(403);
@ -7874,20 +7871,6 @@ function fxBibRequireDistPrintAccess() {
exit;
}
if (empty($_SESSION['usa_id'])) {
require_once __DIR__ . '/inc_fx_eve_acces.php';
$intComId = (int)($_SESSION['com_id'] ?? 0);
$intEveId = (int)($_REQUEST['eve_id'] ?? $_POST['eve_id'] ?? 0);
if ($intComId <= 0 || $intEveId <= 0
|| !fxEveAccesHasAnyPermission($intComId, $intEveId, array('dossards.manage', 'epreuves.edit_qte'))) {
http_response_code(403);
header('Content-Type: text/plain; charset=utf-8');
echo fxBibMsg('bib_v4_ajax_unauthorized');
exit;
}
}
$strToken = $_POST['csrf_token'] ?? $_REQUEST['csrf_token'] ?? '';
if (!fxBibValidateCsrf($strToken)) {
http_response_code(403);

View File

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