From 9934a32f7e02c484d6b122c9af860ab1ca9b2dca Mon Sep 17 00:00:00 2001 From: polo Date: Sat, 2 Aug 2025 17:03:42 +0200 Subject: =?UTF-8?q?r=C3=A9organisation=202=20requ=C3=AAtes=20"form":=20s?= =?UTF-8?q?=C3=A9paration=20routage=20et=20contr=C3=B4leurs=20avec=20des?= =?UTF-8?q?=20fonctions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.php | 11 ++++++++++- public/js/calendar_admin.js | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'public') diff --git a/public/index.php b/public/index.php index d05e799..09af532 100644 --- a/public/index.php +++ b/public/index.php @@ -54,9 +54,18 @@ if(!empty($_GET['id'])) } /* -- contrôleurs qui traitent les POST (formulaires ou AJAX) -- */ -require '../src/controller/post.php'; +require '../src/controller/post_router.php'; + /* -- affichage d'une page -- */ +// mode modification d'une page activé +if($_SESSION['admin'] && isset($_GET['page']) && isset($_GET['action']) && $_GET['action'] === 'modif_page' + && $_GET['page'] !== 'connexion' && $_GET['page'] !== 'article' && $_GET['page'] !== 'nouvelle_page' && $_GET['page'] !== 'menu_chemins') +{ + // les contrôles de la 2è ligne devraient utiliser un tableau + MainBuilder::$modif_mode = true; +} + // contrôleur accédant au modèle $director = new Director($entityManager, true); $director->makeRootNode($id); diff --git a/public/js/calendar_admin.js b/public/js/calendar_admin.js index 90e2942..a2fb1ac 100644 --- a/public/js/calendar_admin.js +++ b/public/js/calendar_admin.js @@ -229,7 +229,9 @@ document.addEventListener('DOMContentLoaded', function(){ event_end = new Date(event_end).toISOString(); } + // contrôle date/heure de fin après le début if(event_start > event_end || (!event_all_day && event_start == event_end)){ + toastNotify("Erreur: la fin de l'évènement doit se situer après son début."); return; } -- cgit v1.2.3