From 7c11c8350b59c11f5fc59d8cd54fecd04cd75275 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 6 May 2019 22:38:39 +0200 Subject: [PATCH] =?UTF-8?q?[9.1.00]=20Form=20=20:=20=20pb=20avec=20d=C3=A9?= =?UTF-8?q?sactivation=20option=20de=20redirection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/form/form.php | 8 +++++++- module/form/view/config/config.js.php | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/module/form/form.php b/module/form/form.php index db05a96c..fb6408b1 100644 --- a/module/form/form.php +++ b/module/form/form.php @@ -68,6 +68,12 @@ class form extends common { // Soumission du formulaire if($this->isPost()) { // Configuration + // Option sélectionnée sans page choisie + $pageId = ''; + if ($this->getInput('formConfigPageId', helper::FILTER_ID) !== null) { + // Option désactivée, réinitialiser l'id de la page sélectionnée. + $pageId = $this->getInput('formConfigPageIdToggle', helper::FILTER_BOOLEAN) === true ? $this->getInput('formConfigPageId', helper::FILTER_ID) : ''; + } $this->setData([ 'module', $this->getUrl(0), @@ -78,7 +84,7 @@ class form extends common { 'group' => $this->getInput('formConfigGroup', helper::FILTER_INT), 'user' => self::$listUsers [$this->getInput('formConfigUser', helper::FILTER_INT)], 'mail' => $this->getInput('formConfigMail') , - 'pageId' => $this->getInput('formConfigPageId', helper::FILTER_ID), + 'pageId' => $pageId, 'subject' => $this->getInput('formConfigSubject') ] ]); diff --git a/module/form/view/config/config.js.php b/module/form/view/config/config.js.php index 41a9fbbb..94175ae4 100644 --- a/module/form/view/config/config.js.php +++ b/module/form/view/config/config.js.php @@ -158,6 +158,8 @@ $("#formConfigPageIdToggle").on("change", function() { else { $("#formConfigPageIdWrapper").slideUp(function() { $("#formConfigPageId").val(""); + console.log($("#formConfigPageId").val()); }); } -}).trigger("change"); \ No newline at end of file +}).trigger("change"); +