From ffb679626ead3926d348c2daf2e6c1f12b6ba05b Mon Sep 17 00:00:00 2001 From: stephan Date: Wed, 15 Jul 2026 13:06:05 -0400 Subject: [PATCH] =?UTF-8?q?MSIN-4464=20=E2=80=94=20Refactor=20audit=20even?= =?UTF-8?q?t=20selection=20in=20admin=20interface.=20Update=20SQL=20query?= =?UTF-8?q?=20to=20improve=20sorting=20logic=20for=20events=20and=20enhanc?= =?UTF-8?q?e=20the=20event=20selection=20form=20with=20a=20live=20search?= =?UTF-8?q?=20feature.=20Adjust=20layout=20and=20add=20direct=20input=20fo?= =?UTF-8?q?r=20event=20IDs,=20improving=20usability=20and=20accessibility?= =?UTF-8?q?=20for=20users=20managing=20audit=20logs.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- php/inc_fx_fiche_audit.php | 6 ++- superadm/php/inc_fx_fiche_audit_admin.php | 63 ++++++++++++++++++++--- 2 files changed, 59 insertions(+), 10 deletions(-) diff --git a/php/inc_fx_fiche_audit.php b/php/inc_fx_fiche_audit.php index fa76c4d..791baaf 100644 --- a/php/inc_fx_fiche_audit.php +++ b/php/inc_fx_fiche_audit.php @@ -405,13 +405,15 @@ function fxFicheAuditAdminListEvents() return array(); } + // Pas de LIMIT : le select admin a une recherche (bootstrap-select). $sql = 'SELECT e.eve_id, e.eve_nom_fr, e.eve_date_debut,' . ' (SELECT COUNT(*) FROM inscriptions_fiche_audit_log l WHERE l.eve_id = e.eve_id) AS fal_nb' . ' FROM inscriptions_evenements e' . ' WHERE e.eve_actif = 1' . ' OR EXISTS (SELECT 1 FROM inscriptions_fiche_audit_log l2 WHERE l2.eve_id = e.eve_id)' - . ' ORDER BY e.eve_date_debut DESC, e.eve_id DESC' - . ' LIMIT 300'; + . ' ORDER BY' + . ' CASE WHEN EXISTS (SELECT 1 FROM inscriptions_fiche_audit_log lx WHERE lx.eve_id = e.eve_id) THEN 0 ELSE 1 END,' + . ' e.eve_date_debut DESC, e.eve_id DESC'; $arrRows = $objDatabase->fxGetResults($sql); return is_array($arrRows) ? $arrRows : array(); diff --git a/superadm/php/inc_fx_fiche_audit_admin.php b/superadm/php/inc_fx_fiche_audit_admin.php index 28a3afb..fd6d8b6 100644 --- a/superadm/php/inc_fx_fiche_audit_admin.php +++ b/superadm/php/inc_fx_fiche_audit_admin.php @@ -156,11 +156,19 @@ function fxFicheAuditAdminRenderPage($strFlash = '', $strError = '')

Tables absentes — impossible d'afficher les logs.

-
+ -
+
- 0 ? ' · ' . $intNb . ' log(s)' : ''); + // data-tokens : recherche aussi par #id / numéro + $strTokens = $strNomEve . ' ' . $intEveOpt; ?> - + Tape un nom ou un #id pour filtrer la liste.
-
-
+