From 78c38167b9e4385f880d46efa05d7b4d8228dd38 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Apr 2005 23:23:01 +0000 Subject: [PATCH] Qual: Meilleure gestion erreur gestion des destinataires d'un mailing --- htdocs/comm/mailing/cibles.php | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index f7ea88d9c7a..8c48d0314e0 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -21,7 +21,8 @@ * */ -/** \file htdocs/comm/mailing/cibles.php +/** + \file htdocs/comm/mailing/cibles.php \brief Page des cibles de mailing \version $Revision$ */ @@ -63,9 +64,22 @@ if ($_GET["action"] == 'add') require_once($file); $obj = new $classname($db); - $obj->add_to_target($_GET["rowid"]); + $result=$obj->add_to_target($_GET["rowid"]); - Header("Location: cibles.php?id=".$_GET["rowid"]); + if ($result > 0) + { + Header("Location: cibles.php?id=".$_GET["rowid"]); + } + if ($result == 0) + { +print $obj->aaa; + $mesg='
'.$langs->trans("WarningNoEMailsAdded").'
'; + } + if ($result < 0) + { + $mesg='
'.$obj->error.'
'; + } + $_GET["id"]=$_GET["rowid"]; } if ($_GET["action"] == 'clear') @@ -123,13 +137,14 @@ if ($mil->fetch($_GET["id"]) == 0) print ""; + if ($mesg) print "$mesg
\n"; // Affiche les listes de sélection if ($mil->statut == 0) { print ''; print ''; print ''; - print ''; + print ''; print '
'.$langs->trans("RecipientSelectionModules").''.$langs->trans("NbOfRecipients").''.$langs->trans("NbOfUniqueEMails").''; if ($mil->statut == 0) { print $langs->trans("Actions");