if(!$user->rights->societe->client->voir||$socid)$diroutputpdf.='/private/'.$user->id;// If user has no permission to see all, output dir is specific to user
$resultmasssend='';
if(GETPOST('buttonsendremind'))
{
$action='presend';
$mode='sendmassremind';
}
if(GETPOST("button_removefilter_x")||GETPOST("button_removefilter"))// Both test must be present to be compatible with all browsers
{
...
...
@@ -122,15 +127,90 @@ if ($action == 'presend' && GETPOST('sendmail'))
$nbsent=0;
$nbignored=0;
for($i=0;$i<$countToSend;$i++)
$arrayofinvoices=GETPOST('toSend','array');
$thirdparty=newSociete($db);
$invoicetmp=newFacture($db);
$listofinvoicesid=array();
$listofinvoicesthirdparties=array();
$listofinvoicesref=array();
foreach($arrayofinvoicesas$invoiceid)
{
$object=newFacture($db);
$result=$object->fetch($_POST['toSend'][$i]);
if($result>0)// Invoice was found
$invoicetmp=newFacture($db);// must create new instance because instance is saved into $listofinvoicesref array for future use