FIX condition

This commit is contained in:
John Botella 2019-06-20 09:48:08 +02:00
parent 7c29fb614c
commit 252bd6d9ba

View File

@ -36,11 +36,12 @@ if ($massaction == 'presend')
{
$langs->load("mails");
$listofselectedid = array();
$listofselectedthirdparties = array();
$listofselectedref = array();
if (! GETPOST('cancel', 'alpha'))
{
$listofselectedid = array();
$listofselectedthirdparties = array();
$listofselectedref = array();
foreach ($arrayofselected as $toselectid)
{
$result = $objecttmp->fetch($toselectid);
@ -106,7 +107,7 @@ if ($massaction == 'presend')
$formmail->withtoreadonly = 1;
}
$formmail->withoptiononeemailperrecipient = empty($liste)?0:((GETPOST('oneemailperrecipient')=='on')?1:-1);
$formmail->withoptiononeemailperrecipient = (count($listofselectedref) == 1 || empty($liste))? 0 : ((GETPOST('oneemailperrecipient')=='on')?1:-1);
$formmail->withto = empty($liste)?(GETPOST('sendto','alpha')?GETPOST('sendto','alpha'):array()):$liste;
$formmail->withtofree = empty($liste)?1:0;
$formmail->withtocc = 1;