mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Debug v15
This commit is contained in:
parent
beee7fc5d3
commit
1dcfb88ad4
|
|
@ -109,6 +109,13 @@ NEW: External backups can be downloaded from the "About info page".
|
|||
NEW: Add massaction to switch status on sale / on purchase of a product.
|
||||
|
||||
|
||||
Modules
|
||||
NEW: Stable module Knowledge Management
|
||||
NEW: Experimental module Event Organization Management
|
||||
NEW: Experimental module Workstations Management
|
||||
NEW: Development of module Partnership Management
|
||||
|
||||
|
||||
For developers:
|
||||
---------------
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/eventorganization.lib.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
|
||||
// Translations
|
||||
$langs->loadLangs(array("admin", "eventorganization"));
|
||||
$langs->loadLangs(array("admin", "eventorganization", "categories"));
|
||||
|
||||
// Parameters
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
|
@ -54,11 +54,11 @@ $arrayofparameters = array(
|
|||
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1),
|
||||
//'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
//'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'SERVICE_BOOTH_LOCATION'=>array('type'=>'product', 'enabled'=>1),
|
||||
'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION'=>array('type'=>'product', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1),
|
||||
);
|
||||
|
||||
$error = 0;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ if (!$error && $massaction == 'confirm_presend') {
|
|||
$listofobjectref = array();
|
||||
$contactidtosend = array();
|
||||
$attachedfilesThirdpartyObj = array();
|
||||
$oneemailperrecipient = (GETPOST('oneemailperrecipient') == 'on' ? 1 : 0);
|
||||
$oneemailperrecipient = (GETPOST('oneemailperrecipient', 'int') ? 1 : 0);
|
||||
|
||||
if (!$error) {
|
||||
$thirdparty = new Societe($db);
|
||||
|
|
|
|||
|
|
@ -157,6 +157,7 @@ class FormMail extends Form
|
|||
|
||||
public $lines_model;
|
||||
|
||||
// -1 suggest the checkbox 'one email per recipient' not checked, 0 = no suggestion, 1 = suggest and checked
|
||||
public $withoptiononeemailperrecipient;
|
||||
|
||||
|
||||
|
|
@ -357,7 +358,7 @@ class FormMail extends Form
|
|||
// phpcs:enable
|
||||
global $conf, $langs, $user, $hookmanager, $form;
|
||||
|
||||
// Required to show preview of mail attachments
|
||||
// Required to show preview wof mail attachments
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
$formfile = new Formfile($this->db);
|
||||
|
||||
|
|
@ -366,7 +367,7 @@ class FormMail extends Form
|
|||
}
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('other', 'mails'));
|
||||
$langs->loadLangs(array('other', 'mails', 'members'));
|
||||
|
||||
// Clear temp files. Must be done before call of triggers, at beginning (mode = init), or when we select a new template
|
||||
if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelselected') && GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) {
|
||||
|
|
@ -464,11 +465,10 @@ class FormMail extends Form
|
|||
$modelmail_array = array();
|
||||
if ($this->param['models'] != 'none') {
|
||||
$result = $this->fetchAllEMailTemplate($this->param["models"], $user, $outputlangs);
|
||||
|
||||
if ($result < 0) {
|
||||
setEventMessages($this->error, $this->errors, 'errors');
|
||||
}
|
||||
$langs->trans("members");
|
||||
|
||||
foreach ($this->lines_model as $line) {
|
||||
$reg = array();
|
||||
if (preg_match('/\((.*)\)/', $line->label, $reg)) {
|
||||
|
|
@ -503,7 +503,7 @@ class FormMail extends Form
|
|||
}
|
||||
|
||||
$out .= ' ';
|
||||
$out .= '<input type="submit" class="button" value="'.$langs->trans('Apply').'" name="modelselected" id="modelselected">';
|
||||
$out .= '<input type="submit" class="button reposition" value="'.$langs->trans('Apply').'" name="modelselected" id="modelselected">';
|
||||
$out .= ' ';
|
||||
$out .= '</div>';
|
||||
} elseif (!empty($this->param['models']) && in_array($this->param['models'], array(
|
||||
|
|
@ -526,7 +526,7 @@ class FormMail extends Form
|
|||
}
|
||||
|
||||
|
||||
$out .= '<table class="tableforemailform boxtablenotop" width="100%">'."\n";
|
||||
$out .= '<table class="tableforemailform boxtablenotop centpercent">'."\n";
|
||||
|
||||
// Substitution array/string
|
||||
$helpforsubstitution = '';
|
||||
|
|
@ -688,16 +688,20 @@ class FormMail extends Form
|
|||
|
||||
// With option one email per recipient
|
||||
if (!empty($this->withoptiononeemailperrecipient)) {
|
||||
$out .= '<tr><td class="minwidth200">';
|
||||
$out .= $langs->trans("GroupEmails");
|
||||
$out .= '</td><td>';
|
||||
$out .= ' <input type="checkbox" id="oneemailperrecipient" name="oneemailperrecipient"'.($this->withoptiononeemailperrecipient > 0 ? ' checked="checked"' : '').'> ';
|
||||
$out .= '<label for="oneemailperrecipient">'.$langs->trans("OneEmailPerRecipient").'</label>';
|
||||
$out .= '<span class="hideonsmartphone opacitymedium">';
|
||||
$out .= ' - ';
|
||||
$out .= $langs->trans("WarningIfYouCheckOneRecipientPerEmail");
|
||||
$out .= '</span>';
|
||||
$out .= '</td></tr>';
|
||||
if (abs($this->withoptiononeemailperrecipient) == 1) {
|
||||
$out .= '<tr><td class="minwidth200">';
|
||||
$out .= $langs->trans("GroupEmails");
|
||||
$out .= '</td><td>';
|
||||
$out .= ' <input type="checkbox" id="oneemailperrecipient" value="1" name="oneemailperrecipient"'.($this->withoptiononeemailperrecipient > 0 ? ' checked="checked"' : '').'> ';
|
||||
$out .= '<label for="oneemailperrecipient">'.$langs->trans("OneEmailPerRecipient").'</label>';
|
||||
$out .= '<span class="hideonsmartphone opacitymedium">';
|
||||
$out .= ' - ';
|
||||
$out .= $langs->trans("WarningIfYouCheckOneRecipientPerEmail");
|
||||
$out .= '</span>';
|
||||
$out .= '</td></tr>';
|
||||
} else {
|
||||
$out .= '<tr><td><input type="hidden" name="oneemailperrecipient" value="1"></td><td></td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// CC
|
||||
|
|
@ -813,8 +817,7 @@ class FormMail extends Form
|
|||
$out .= '<br></div>';
|
||||
}
|
||||
} elseif (empty($this->withmaindocfile)) {
|
||||
// Do not show message if we asked to show the checkbox
|
||||
$out .= $langs->trans("NoAttachedFiles").'<br>';
|
||||
$out .= '<span class="opacitymedium">'.$langs->trans("NoAttachedFiles").'</span><br>';
|
||||
}
|
||||
if ($this->withfile == 2) {
|
||||
// Can add other files
|
||||
|
|
@ -1217,6 +1220,7 @@ class FormMail extends Form
|
|||
global $conf, $langs, $form;
|
||||
|
||||
$defaulttopic = GETPOST('subject', 'restricthtml');
|
||||
|
||||
if (!GETPOST('modelselected', 'alpha') || GETPOST('modelmailselected') != '-1') {
|
||||
if ($arraydefaultmessage && $arraydefaultmessage->topic) {
|
||||
$defaulttopic = $arraydefaultmessage->topic;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class modEventOrganization extends DolibarrModules
|
|||
$this->description = "EventOrganizationDescription";
|
||||
$this->descriptionlong = "EventOrganizationDescriptionLong";
|
||||
|
||||
$this->version = 'development';
|
||||
$this->version = 'experimental';
|
||||
|
||||
|
||||
// Key used in llx_const table to save module status enabled/disabled (where EVENTORGANIZATION is value of property name of module in uppercase)
|
||||
|
|
|
|||
|
|
@ -19,12 +19,17 @@
|
|||
*/
|
||||
|
||||
// Following var must be set:
|
||||
// $action
|
||||
// $arrayofselected = array of id selected
|
||||
// $object
|
||||
// $objecttmp=new Propal($db);
|
||||
// $objecttmp = new MyObject($db);
|
||||
// $topicmail="SendSupplierProposalRef";
|
||||
// $modelmail="supplier_proposal_send";
|
||||
// $trackid='ord'.$object->id;
|
||||
// $trackid='ord'.$objecttmp->id;
|
||||
//
|
||||
// Following var can be set
|
||||
// $object = Object fetched;
|
||||
// $sendto
|
||||
// $withmaindocfilemail
|
||||
|
||||
|
||||
if ($massaction == 'predeletedraft') {
|
||||
|
|
@ -41,6 +46,7 @@ if ($massaction == 'preaffecttag') {
|
|||
$categ_types = array();
|
||||
$categ_type_array = $categ->getMapList();
|
||||
foreach ($categ_type_array as $categdef) {
|
||||
// Test on $object (should be useless, we already check on $objecttmp just after)
|
||||
if (isset($object) && $categdef['obj_table'] == $object->table_element) {
|
||||
if (!array_key_exists($categdef['code'], $categ_types)) {
|
||||
$categ_types[$categdef['code']] = array('code'=>$categdef['code'], 'label'=>$langs->trans($categdef['obj_class']));
|
||||
|
|
@ -76,7 +82,7 @@ if ($massaction == 'presend') {
|
|||
$langs->load("mails");
|
||||
|
||||
$listofselectedid = array();
|
||||
$listofselectedthirdparties = array();
|
||||
$listofselectedrecipientobjid = array();
|
||||
$listofselectedref = array();
|
||||
|
||||
if (!GETPOST('cancel', 'alpha')) {
|
||||
|
|
@ -84,14 +90,19 @@ if ($massaction == 'presend') {
|
|||
$result = $objecttmp->fetch($toselectid);
|
||||
if ($result > 0) {
|
||||
$listofselectedid[$toselectid] = $toselectid;
|
||||
$thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid);
|
||||
if ($objecttmp->element == 'societe') {
|
||||
$thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid); // For proposal, order, invoice, conferenceorbooth, ...
|
||||
if (in_array($objecttmp->element, array('societe', 'conferenceorboothattendee'))) {
|
||||
$thirdpartyid = $objecttmp->id;
|
||||
}
|
||||
if ($objecttmp->element == 'expensereport') {
|
||||
$thirdpartyid = $objecttmp->fk_user_author;
|
||||
}
|
||||
$listofselectedthirdparties[$thirdpartyid] = $thirdpartyid;
|
||||
if (empty($thirdpartyid)) {
|
||||
$thirdpartyid = 0;
|
||||
}
|
||||
if ($thirdpartyid) {
|
||||
$listofselectedrecipientobjid[$thirdpartyid] = $thirdpartyid;
|
||||
}
|
||||
$listofselectedref[$thirdpartyid][$toselectid] = $objecttmp->ref;
|
||||
}
|
||||
}
|
||||
|
|
@ -113,9 +124,9 @@ if ($massaction == 'presend') {
|
|||
$formmail->trackid = $trackid;
|
||||
$formmail->withfrom = 1;
|
||||
$liste = $langs->trans("AllRecipientSelected", count($arrayofselected));
|
||||
if (count($listofselectedthirdparties) == 1) { // Only 1 different recipient selected, we can suggest contacts
|
||||
if (count($listofselectedrecipientobjid) == 1) { // Only 1 different recipient selected, we can suggest contacts
|
||||
$liste = array();
|
||||
$thirdpartyid = array_shift($listofselectedthirdparties);
|
||||
$thirdpartyid = array_shift($listofselectedrecipientobjid);
|
||||
if ($objecttmp->element == 'expensereport') {
|
||||
$fuser = new User($db);
|
||||
$fuser->fetch($thirdpartyid);
|
||||
|
|
@ -136,19 +147,31 @@ if ($massaction == 'presend') {
|
|||
$formmail->withtoreadonly = 1;
|
||||
}
|
||||
|
||||
$formmail->withoptiononeemailperrecipient = ((count($listofselectedref) == 1 && count(reset($listofselectedref)) == 1) || empty($liste)) ? 0 : ((GETPOST('oneemailperrecipient') == 'on') ? 1 : -1);
|
||||
|
||||
$formmail->withoptiononeemailperrecipient = ((count($listofselectedref) == 1 && count(reset($listofselectedref)) == 1) || empty($liste)) ? 0 : (GETPOST('oneemailperrecipient', 'int') ? 1 : -1);
|
||||
if (in_array($objecttmp->element, array('conferenceorboothattendee'))) {
|
||||
$formmail->withoptiononeemailperrecipient = 0;
|
||||
}
|
||||
|
||||
$formmail->withto = empty($liste) ? (GETPOST('sendto', 'alpha') ?GETPOST('sendto', 'alpha') : array()) : $liste;
|
||||
$formmail->withtofree = empty($liste) ? 1 : 0;
|
||||
$formmail->withtocc = 1;
|
||||
$formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC;
|
||||
$formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REF_CLIENT__');
|
||||
$formmail->withfile = 1;
|
||||
// $formmail->withfile = 2; Not yet supported in mass action
|
||||
$formmail->withmaindocfile = 1; // Add a checkbox "Attach also main document"
|
||||
if ($objecttmp->element != 'societe') {
|
||||
$formmail->withfile = '<span class="hideonsmartphone opacitymedium">'.$langs->trans("OnlyPDFattachmentSupported").'</span>';
|
||||
$formmail->withmaindocfile = - 1; // Add a checkbox "Attach also main document" but not checked by default
|
||||
if (!empty($topicmail)) {
|
||||
$formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REF_CLIENT__');
|
||||
} else {
|
||||
$formmail->withtopic = 1;
|
||||
}
|
||||
$formmail->withfile = 1; // $formmail->withfile = 2 to allow to upload files is not yet supported in mass action
|
||||
// Add a checkbox "Attach also main document"
|
||||
if (isset($withmaindocfilemail)) {
|
||||
$formmail->withmaindocfile = $withmaindocfilemail;
|
||||
} else { // Do an automatic definition of $formmail->withmaindocfile
|
||||
$formmail->withmaindocfile = 1;
|
||||
if ($objecttmp->element != 'societe') {
|
||||
$formmail->withfile = '<span class="hideonsmartphone opacitymedium">'.$langs->trans("OnlyPDFattachmentSupported").'</span>';
|
||||
$formmail->withmaindocfile = -1; // Add a checkbox "Attach also main document" but not checked by default
|
||||
}
|
||||
}
|
||||
$formmail->withbody = 1;
|
||||
$formmail->withdeliveryreceipt = 1;
|
||||
|
|
@ -167,16 +190,16 @@ if ($massaction == 'presend') {
|
|||
);
|
||||
complete_substitutions_array($substitutionarray, $langs, $object, $parameters);
|
||||
|
||||
// Tableau des substitutions
|
||||
// Array of substitutions
|
||||
$formmail->substit = $substitutionarray;
|
||||
|
||||
// Tableau des parametres complementaires du post
|
||||
$formmail->param['action'] = $action;
|
||||
$formmail->param['models'] = $modelmail;
|
||||
$formmail->param['models_id'] = GETPOST('modelmailselected', 'int');
|
||||
$formmail->param['models'] = $modelmail; // the filter to know which kind of template emails to show. 'none' means no template suggested.
|
||||
$formmail->param['models_id'] = GETPOST('modelmailselected', 'int') ? GETPOST('modelmailselected', 'int') : '-1';
|
||||
$formmail->param['id'] = join(',', $arrayofselected);
|
||||
// $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
|
||||
if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && count($listofselectedthirdparties) > $conf->global->MAILING_LIMIT_SENDBYWEB) {
|
||||
if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && count($listofselectedrecipientobjid) > $conf->global->MAILING_LIMIT_SENDBYWEB) {
|
||||
$langs->load("errors");
|
||||
print img_warning().' '.$langs->trans('WarningNumberOfRecipientIsRestrictedInMassAction', $conf->global->MAILING_LIMIT_SENDBYWEB);
|
||||
print ' - <a href="javascript: window.history.go(-1)">'.$langs->trans("GoBack").'</a>';
|
||||
|
|
|
|||
|
|
@ -621,8 +621,8 @@ $arrayofmassactions = array(
|
|||
//'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
|
||||
//'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").' - '.$langs->trans("ConferenceOrBooth"),
|
||||
'presend_attendees'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' - '.$langs->trans("Attendees"),
|
||||
'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' ('.$langs->trans("ToSpeakers").')',
|
||||
//'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");
|
||||
|
|
@ -650,12 +650,13 @@ $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle'
|
|||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
|
||||
// Add code for pre mass action (confirmation or email presend form)
|
||||
$topicmail = $object->ref;
|
||||
$topicmail = $projectstatic->title;
|
||||
$modelmail = "conferenceorbooth";
|
||||
$objecttmp = new ConferenceOrBooth($db);
|
||||
$trackid = 'conferenceorbooth_'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/eventorganization/tpl/massactions_mail_pre.tpl.php';
|
||||
$withmaindocfilemail = 0;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
|
||||
|
|
@ -689,6 +690,7 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
|||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -182,8 +182,8 @@ if (GETPOST('cancel', 'alpha')) {
|
|||
$massaction = '';
|
||||
}
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend'
|
||||
&& $massaction != 'presend_attendees'
|
||||
&& $massaction != 'confirm_presend_attendees') {
|
||||
&& $massaction != 'presend'
|
||||
&& $massaction != 'confirm_presend') {
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
|
|
@ -676,8 +676,7 @@ $arrayofmassactions = array(
|
|||
//'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
|
||||
//'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"),
|
||||
'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||
);
|
||||
if ($permissiontodelete) {
|
||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
|
|
@ -706,14 +705,16 @@ $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle'
|
|||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
|
||||
// Add code for pre mass action (confirmation or email presend form)
|
||||
$topicmail = "SendConferenceOrBoothAttendeeRef";
|
||||
$modelmail = "conferenceorboothattendee";
|
||||
$topicmail = $projectstatic->title;
|
||||
$modelmail = "conferenceorbooth";
|
||||
$objecttmp = new ConferenceOrBoothAttendee($db);
|
||||
$trackid = 'xxxx'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/eventorganization/tpl/massactions_mail_pre.tpl.php';
|
||||
$trackid = 'conferenceorbooth_'.$object->id;
|
||||
$withmaindocfilemail = 0;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
|
||||
if ($search_all) {
|
||||
foreach ($fieldstosearchall as $key => $val) {
|
||||
$fieldstosearchall[$key] = $langs->trans($val);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ if (!$error && $massaction == 'confirm_presend_attendees') {
|
|||
$listofobjectid = array();
|
||||
|
||||
$listofobjectref = array();
|
||||
$oneemailperrecipient = (GETPOST('oneemailperrecipient') == 'on' ? 1 : 0);
|
||||
$oneemailperrecipient = (GETPOST('oneemailperrecipient', 'int') ? 1 : 0);
|
||||
|
||||
if (!$error) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/eventorganization/class/conferenceorboothattendee.class.php';
|
||||
|
|
|
|||
|
|
@ -1,126 +0,0 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* or see https://www.gnu.org/
|
||||
*/
|
||||
|
||||
// Following var must be set:
|
||||
// $arrayofselected = array of id selected
|
||||
// $object
|
||||
// $objecttmp=new Propal($db);
|
||||
// $topicmail="SendSupplierProposalRef";
|
||||
// $modelmail="supplier_proposal_send";
|
||||
// $trackid='ord'.$object->id;
|
||||
|
||||
if ($massaction == 'presend_attendees') {
|
||||
$langs->load("mails");
|
||||
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
|
||||
$attendee = new ConferenceOrBoothAttendee($db);
|
||||
$listofselectedid = array();
|
||||
$listofselectedref = array();
|
||||
|
||||
if (!GETPOST('cancel', 'alpha')) {
|
||||
foreach ($arrayofselected as $toselectid) {
|
||||
$result = $objecttmp->fetch($toselectid);
|
||||
if ($result > 0) {
|
||||
$attendees = $attendee->fetchAll();
|
||||
if (is_array($attendees) && count($attendees)>0) {
|
||||
foreach ($attendees as $attmail) {
|
||||
if (!empty($attmail->email)) {
|
||||
$listofselectedid[$attmail->email] = $attmail->id;
|
||||
$listofselectedref[$attmail->id][$toselectid] = $objecttmp->ref;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '<input type="hidden" name="massaction" value="confirm_presend_attendees">';
|
||||
print '<input type="hidden" name="projectid" value="'.GETPOST('projectid', 'int').'">';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
|
||||
print dol_get_fiche_head(null, '', '');
|
||||
|
||||
// Create form for email
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->withform = -1;
|
||||
$formmail->fromtype = (GETPOST('fromtype') ? GETPOST('fromtype') : (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : 'user'));
|
||||
|
||||
if ($formmail->fromtype === 'user') {
|
||||
$formmail->fromid = $user->id;
|
||||
}
|
||||
$formmail->trackid = $trackid;
|
||||
$formmail->withfrom = 1;
|
||||
$liste = $langs->trans("AllRecipientSelected", count($listofselectedid));
|
||||
$formmail->withtoreadonly = 1;
|
||||
|
||||
$formmail->withoptiononeemailperrecipient = ((count($listofselectedref) == 1 && count(reset($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;
|
||||
$formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC;
|
||||
$formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REF_CLIENT__');
|
||||
$formmail->withfile = 0;
|
||||
// $formmail->withfile = 2; Not yet supported in mass action
|
||||
$formmail->withmaindocfile = 0; // Add a checkbox "Attach also main document"
|
||||
$formmail->withbody = 1;
|
||||
$formmail->withdeliveryreceipt = 1;
|
||||
$formmail->withcancel = 1;
|
||||
|
||||
// Make substitution in email content
|
||||
$substitutionarray = getCommonSubstitutionArray($langs, 0, null, $object);
|
||||
|
||||
$substitutionarray['__EMAIL__'] = $sendto;
|
||||
$substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.urlencode($object->thirdparty->tag).'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '';
|
||||
$substitutionarray['__PERSONALIZED__'] = ''; // deprecated
|
||||
$substitutionarray['__CONTACTCIVNAME__'] = '';
|
||||
|
||||
$parameters = array(
|
||||
'mode' => 'formemail'
|
||||
);
|
||||
complete_substitutions_array($substitutionarray, $langs, $object, $parameters);
|
||||
|
||||
// Tableau des substitutions
|
||||
$formmail->substit = $substitutionarray;
|
||||
|
||||
// Tableau des parametres complementaires du post
|
||||
$formmail->param['action'] = $action;
|
||||
$formmail->param['models'] = $modelmail;
|
||||
$formmail->param['models_id'] = empty(GETPOST('modelmailselected', 'int'))?$conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES:GETPOST('modelmailselected', 'int');
|
||||
$formmail->param['id'] = join(',', $arrayofselected);
|
||||
// $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
|
||||
if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && count($listofselectedid) > $conf->global->MAILING_LIMIT_SENDBYWEB) {
|
||||
$langs->load("errors");
|
||||
print img_warning().' '.$langs->trans('WarningNumberOfRecipientIsRestrictedInMassAction', $conf->global->MAILING_LIMIT_SENDBYWEB);
|
||||
print ' - <a href="javascript: window.history.go(-1)">'.$langs->trans("GoBack").'</a>';
|
||||
$arrayofmassactions = array();
|
||||
} else {
|
||||
print $formmail->get_form();
|
||||
}
|
||||
|
||||
print dol_get_fiche_end();
|
||||
}
|
||||
// Allow Pre-Mass-Action hook (eg for confirmation dialog)
|
||||
$parameters = array(
|
||||
'toselect' => $toselect,
|
||||
'uploaddir' => isset($uploaddir) ? $uploaddir : null
|
||||
);
|
||||
|
|
@ -72,11 +72,14 @@ ALTER TABLE llx_salary_extrafields ADD INDEX idx_salary_extrafields (fk_object);
|
|||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__,<br /><br />__(OrganizationEventConfRequestWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__,<br /><br />__(OrganizationEventBoothRequestWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
-- TODO Add message for registration only to event __ONLINE_PAYMENT_TEXT_AND_URL__
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsBooth)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__,<br /><br />__(OrganizationEventPaymentOfBoothWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsEvent)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__,<br /><br />__(OrganizationEventPaymentOfRegistrationWasReceived)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailBoothPayment)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__,<br /><br />__(OrganizationEventPaymentOfBoothWasReceived)__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailRegistrationPayment)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__,<br /><br />__(OrganizationEventPaymentOfRegistrationWasReceived)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__,<br /><br />__(OrganizationEventBulkMailToAttendees)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__,<br /><br />__(OrganizationEventBulkMailToSpeakers)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
|
||||
UPDATE llx_c_email_templates SET label = '(EventOrganizationEmailBoothPayment)' WHERE label = '(EventOrganizationEmailSubsBooth)';
|
||||
UPDATE llx_c_email_templates SET label = '(EventOrganizationEmailRegistrationPayment)' WHERE label = '(EventOrganizationEmailSubsEvent)';
|
||||
|
||||
|
||||
--Fix bad sign on multicompany column for customer invoice lines
|
||||
UPDATE llx_facturedet SET multicurrency_subprice = -multicurrency_subprice WHERE ((multicurrency_subprice < 0 and subprice > 0) OR (multicurrency_subprice > 0 and subprice < 0));
|
||||
|
|
|
|||
|
|
@ -42,12 +42,12 @@ EVENTORGANIZATION_CATEG_THIRDPARTY_CONF = Category to add to third-parties autom
|
|||
EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH = Category to add to third-parties automatically created when they suggests a booth
|
||||
EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF = Template of email to send after receiving a suggestion of a conference.
|
||||
EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH = Template of email to send after receiving a suggestion of a booth.
|
||||
EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH = Template of email to send after a registration to a booth has been paid.
|
||||
EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH = Template of email to send after a registration to a booth has been paid.
|
||||
EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT = Template of email to send after a registration to an event has been paid.
|
||||
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER = Template of email of massaction to attendes
|
||||
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Template of email of massaction to speakers
|
||||
EVENTORGANIZATION_FILTERATTENDEES_CAT = Filter thirdpartie's select list in attendees creation card/form with category
|
||||
EVENTORGANIZATION_FILTERATTENDEES_TYPE = Filter thirdpartie's select list in attendees creation card/form with customer type
|
||||
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER = Template of email to use when sending emails from the massaction "Send emails" to speakers
|
||||
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Template of email to use when sending emails from the massaction "Send emails" on attendee list
|
||||
EVENTORGANIZATION_FILTERATTENDEES_CAT = In the form to create/add an attendee, restricts the list of thirdparties to thirdparties in the category
|
||||
EVENTORGANIZATION_FILTERATTENDEES_TYPE = In the form to create/add an attendee, restricts the list of thirdparties to thirdparties with the nature
|
||||
|
||||
#
|
||||
# Object
|
||||
|
|
@ -71,6 +71,7 @@ EventOrganizationEmailBoothPayment = Payment of your booth
|
|||
EventOrganizationEmailRegistrationPayment = Registration for an event
|
||||
EventOrganizationMassEmailAttendees = Communication to attendees
|
||||
EventOrganizationMassEmailSpeakers = Communication to speakers
|
||||
ToSpeakers=To speakers
|
||||
|
||||
#
|
||||
# Event
|
||||
|
|
@ -83,14 +84,14 @@ PriceOfRegistration=Price of registration
|
|||
PriceOfRegistrationHelp=Price to pay to register or participate in the event
|
||||
PriceOfBooth=Subscription price to stand a booth
|
||||
PriceOfBoothHelp=Subscription price to stand a booth
|
||||
EventOrganizationICSLink=Link ICS for events
|
||||
EventOrganizationICSLink=Link ICS for conferences
|
||||
ConferenceOrBoothInformation=Conference Or Booth informations
|
||||
Attendees=Attendees
|
||||
ListOfAttendeesOfEvent=List of attendees of the event project
|
||||
DownloadICSLink = Download ICS link
|
||||
EVENTORGANIZATION_SECUREKEY = Secure Key of the public registration link to a conference
|
||||
EVENTORGANIZATION_SECUREKEY = Seed to secure the key for the public registration page to suggest a conference
|
||||
SERVICE_BOOTH_LOCATION = Service used for the invoice row about a booth location
|
||||
SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION = Service used for the invoice row about an attendee subscription to a conference
|
||||
SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION = Service used for the invoice row about an attendee subscription to an event
|
||||
NbVotes=Number of votes
|
||||
#
|
||||
# Status
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user