Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2021-10-12 15:26:37 +02:00
4 changed files with 10 additions and 5 deletions

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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';

View File

@@ -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)) {