From 37b05bfe6ab828b0e84b2ac430cf0520a7c6eaaa Mon Sep 17 00:00:00 2001 From: engel <> Date: Sat, 23 Dec 2023 15:36:57 +0000 Subject: [PATCH] =?UTF-8?q?Changement=20d'ann=C3=A9e=20fiscale=20avec=20bo?= =?UTF-8?q?=C3=AEte=20dialogue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FossilOrigin-Name: 605e1489aaf780359cba3fd9519cf53b1cc936abc5891e09e28693e35102cf30 --- admin/choix_annee.php | 11 +++++------ templates/choix_annee.tpl | 3 +-- templates/index.tpl | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/admin/choix_annee.php b/admin/choix_annee.php index f63797d..4a95bdb 100644 --- a/admin/choix_annee.php +++ b/admin/choix_annee.php @@ -12,14 +12,13 @@ if ($anneesFiscales[0] < $anneeCourante) { array_unshift($anneesFiscales, $anneeCourante); } -if (f('change')) -{ +$csrf_key = 'acc_select_year'; +$form->runIf('change', function () { $_SESSION['annee_recu'] = f('annee_recu'); - \Paheko\Utils::redirect(f('from') ?: \Paheko\Utils::plugin_url()); -} +}, $csrf_key, PLUGIN_ROOT . '/admin/index.php'); + +$tpl->assign(compact('anneesFiscales', 'csrf_key')); -$tpl->assign('anneesFiscales', $anneesFiscales); $tpl->assign('annee_recu', $_SESSION['annee_recu']); -$tpl->assign('from', qg('from')); $tpl->display(PLUGIN_ROOT . '/templates/choix_annee.tpl'); diff --git a/templates/choix_annee.tpl b/templates/choix_annee.tpl index e834159..796a3b8 100644 --- a/templates/choix_annee.tpl +++ b/templates/choix_annee.tpl @@ -11,8 +11,7 @@

- {csrf_field key="acc_select_year"} - + {csrf_field key=$csrf_key} {button type="submit" name="change" label="Changer" shape="right" class="main"}

diff --git a/templates/index.tpl b/templates/index.tpl index 1f6ca84..d04af70 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -4,7 +4,7 @@