From 55014b3338d908b4ef48d112ff1b941ab1cf70d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Mon, 6 Jan 2014 05:29:07 +0100 Subject: [PATCH] =?UTF-8?q?If=20user=20does=20not=20have=20an=20email=20an?= =?UTF-8?q?d=20option=20=E2=80=9CMailsonde=E2=80=9D=20is=20active,=20then?= =?UTF-8?q?=20we=20show=20a=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/opensurvey/card.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 1fac0c16ed8..7bd3471c825 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -156,6 +156,11 @@ if ($action == 'edit') { * View */ +if ($object->fk_user_creat) { + $userstatic = new User($db); + $userstatic->fetch($object->fk_user_creat); +} + $form=new Form($db); $arrayofjs=array(); @@ -215,9 +220,6 @@ print ''; print ''; print $langs->trans("Author") .''; if ($object->fk_user_creat) { - $userstatic = new User($db); - $userstatic->fetch($object->fk_user_creat); - print $userstatic->getLoginUrl(1); } else { print dol_htmlentities($object->nom_admin); @@ -251,7 +253,16 @@ if ($action == 'edit') { print 'mailsonde?' checked="true"':'').'">'; } -else print yn($object->mailsonde); +else { + print yn($object->mailsonde); + + //If option is active and linked user does not have an email, we show a warning + if ($object->fk_user_creat && $object->mailsonde) { + if (!$userstatic->email) { + print ' '.img_warning($langs->trans('NoEMail')); + } + } +} print ''; // Users can comment