diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 9b997c8b0e9..4d5e6eb2794 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -628,7 +628,7 @@ $arrayofmassactions = array( if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'presend_attendees', 'predelete'))) { +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index a9422f8ddd7..de09a9dade8 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -181,7 +181,9 @@ if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } -if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' +&& $massaction != 'presend_attendees' +&& $massaction != 'confirm_presend_attendees') { $massaction = ''; } @@ -216,6 +218,7 @@ if (empty($reshook)) { $objectclass = 'ConferenceOrBoothAttendee'; $objectlabel = 'ConferenceOrBoothAttendee'; $uploaddir = $conf->eventorganization->dir_output; + include DOL_DOCUMENT_ROOT.'/eventorganization/core/actions_massactions_mail.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -676,6 +679,7 @@ $arrayofmassactions = array( //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + 'presend_attendees'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' - '.$langs->trans("Attendees"), ); if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); @@ -709,6 +713,7 @@ $topicmail = "SendConferenceOrBoothAttendeeRef"; $modelmail = "conferenceorboothattendee"; $objecttmp = new ConferenceOrBoothAttendee($db); $trackid = 'xxxx'.$object->id; +include DOL_DOCUMENT_ROOT.'/eventorganization/tpl/massactions_mail_pre.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if ($search_all) { diff --git a/htdocs/eventorganization/core/actions_massactions_mail.inc.php b/htdocs/eventorganization/core/actions_massactions_mail.inc.php index 2f8e2959f2b..5fcada893f9 100644 --- a/htdocs/eventorganization/core/actions_massactions_mail.inc.php +++ b/htdocs/eventorganization/core/actions_massactions_mail.inc.php @@ -90,7 +90,7 @@ if (!$error && $massaction == 'confirm_presend_attendees') { foreach ($toselect as $toselectid) { $result = $objecttmp->fetch($toselectid); if ($result > 0) { - $attendees = $attendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm' => $objecttmp->id)); + $attendees = $attendee->fetchAll(); if (is_array($attendees) && count($attendees) > 0) { foreach ($attendees as $attmail) { if (!empty($attmail->email)) { @@ -119,7 +119,7 @@ if (!$error && $massaction == 'confirm_presend_attendees') { $receiver = array($receiver); } } - if (!trim($_POST['sendto']) && count($receiver) == 0 && count($listofselectedid) == 1) { // if only one recipient, receiver is mandatory + if (!trim($_POST['sendto']) && count($receiver) == 0 && count($listofselectedid) == 0) { // if only one recipient, receiver is mandatory $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Recipient")), null, 'warnings'); $massaction = 'presend_attendees'; diff --git a/htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php b/htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php index e4990da6424..8d0836b080e 100644 --- a/htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php +++ b/htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php @@ -37,7 +37,7 @@ if ($massaction == 'presend_attendees') { foreach ($arrayofselected as $toselectid) { $result = $objecttmp->fetch($toselectid); if ($result > 0) { - $attendees = $attendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm'=>$objecttmp->id)); + $attendees = $attendee->fetchAll(); if (is_array($attendees) && count($attendees)>0) { foreach ($attendees as $attmail) { if (!empty($attmail->email)) {