From 7bde4a55afc13742f3f25f79ed77e9de841d57e1 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sun, 10 Mar 2019 20:56:36 +0100 Subject: [PATCH] [form 1.6] envoi de groupe ok --- module/form/form.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/module/form/form.php b/module/form/form.php index 1a66193a..78f297fa 100755 --- a/module/form/form.php +++ b/module/form/form.php @@ -32,7 +32,7 @@ class form extends common { public static $pagination; - const FORM_VERSION = '1.5'; + const FORM_VERSION = '1.6'; const TYPE_MAIL = 'mail'; const TYPE_SELECT = 'select'; @@ -314,25 +314,26 @@ class form extends common { // Rechercher l'adresse en fonction du mail $sent = true; $singleuser = $this->getData(['user', - $this->getData(['module', $this->getUrl(0), 'config', 'user']), - 'mail']); + $this->getData(['module', $this->getUrl(0), 'config', 'user']), + 'mail']); $singlemail = $this->getData(['module', $this->getUrl(0), 'config', 'mail']); + $group = $this->getData(['module', $this->getUrl(0), 'config', 'group']); // Verification si le mail peut être envoyé if( self::$inputNotices === [] && ( - $group = $this->getData(['module', $this->getUrl(0), 'config', 'group']) || + $group > 0 || $singleuser !== '' || $singlemail !== '' ) ) { // Utilisateurs dans le groupe - if (!empty($user)){ - $to = []; + $to = []; + if ($group > 0){ foreach($this->getData(['user']) as $userId => $user) { if($user['group'] === $group) { $to[] = $user['mail']; } } - } + } // Utilisateur désigné if (!empty($singleuser)) { $to[] = $singleuser;