dolibarr  16.0.1
create_ticket.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
3  * Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
25 /* We need object $user->default_values
26 if (!defined('NOREQUIREUSER')) {
27  define('NOREQUIREUSER', '1');
28 }*/
29 if (!defined('NOTOKENRENEWAL')) {
30  define('NOTOKENRENEWAL', '1');
31 }
32 if (!defined('NOREQUIREMENU')) {
33  define('NOREQUIREMENU', '1');
34 }
35 if (!defined('NOREQUIREHTML')) {
36  define('NOREQUIREHTML', '1');
37 }
38 if (!defined('NOLOGIN')) {
39  define("NOLOGIN", 1); // This means this output page does not require to be logged.
40 }
41 if (!defined('NOIPCHECK')) {
42  define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
43 }
44 if (!defined('NOBROWSERNOTIF')) {
45  define('NOBROWSERNOTIF', '1');
46 }
47 
48 // For MultiCompany module.
49 // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
50 $entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
51 if (is_numeric($entity)) {
52  define("DOLENTITY", $entity);
53 }
54 
55 require '../../main.inc.php';
56 require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
57 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticket.class.php';
58 require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
59 require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
60 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
61 require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
62 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
63 require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
64 require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
65 
66 // Load translation files required by the page
67 $langs->loadLangs(array('companies', 'other', 'mails', 'ticket'));
68 
69 // Get parameters
70 $id = GETPOST('id', 'int');
71 $msg_id = GETPOST('msg_id', 'int');
72 
73 $action = GETPOST('action', 'aZ09');
74 $cancel = GETPOST('cancel', 'aZ09');
75 
76 $backtopage = '';
77 
78 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
79 $hookmanager->initHooks(array('publicnewticketcard', 'globalcard'));
80 
81 $object = new Ticket($db);
82 $extrafields = new ExtraFields($db);
83 $contacts = array();
84 $with_contact = null;
85 if (!empty($conf->global->TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST)) {
86  $with_contact = new Contact($db);
87 }
88 
89 $extrafields->fetch_name_optionals_label($object->table_element);
90 
91 if (empty($conf->ticket->enabled)) {
92  accessforbidden('', 0, 0, 1);
93 }
94 
95 
96 /*
97  * Actions
98  */
99 
100 $parameters = array(
101  'id' => $id,
102 );
103 // Note that $action and $object may have been modified by some hooks
104 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
105 if ($reshook < 0) {
106  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
107 }
108 // Add file in email form
109 if (empty($reshook)) {
110  if ($cancel) {
111  $backtopage = DOL_URL_ROOT.'/public/ticket/index.php';
112 
113  header("Location: ".$backtopage);
114  exit;
115  }
116 
117  if (GETPOST('addfile', 'alpha') && !GETPOST('save', 'alpha')) {
121  include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
122 
123  // Set tmp directory TODO Use a dedicated directory for temp mails files
124  $vardir = $conf->ticket->dir_output;
125  $upload_dir_tmp = $vardir.'/temp/'.session_id();
126  if (!dol_is_dir($upload_dir_tmp)) {
127  dol_mkdir($upload_dir_tmp);
128  }
129 
130  dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, '', 0);
131  $action = 'create_ticket';
133  }
134 
135  // Remove file
136  if (GETPOST('removedfile', 'alpha') && !GETPOST('save', 'alpha')) {
137  include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
138 
139  // Set tmp directory
140  $vardir = $conf->ticket->dir_output.'/';
141  $upload_dir_tmp = $vardir.'/temp/'.session_id();
142 
143  // TODO Delete only files that was uploaded from email form
144  dol_remove_file_process(GETPOST('removedfile'), 0, 0);
145  $action = 'create_ticket';
146  }
147 
148  if ($action == 'create_ticket' && GETPOST('save', 'alpha')) {
149  $error = 0;
150  $origin_email = GETPOST('email', 'alpha');
151  if (empty($origin_email)) {
152  $error++;
153  array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Email")));
154  $action = '';
155  } else {
156  // Search company saved with email
157  $searched_companies = $object->searchSocidByEmail($origin_email, '0');
158 
159  // Chercher un contact existant avec cette adresse email
160  // Le premier contact trouvé est utilisé pour déterminer le contact suivi
161  $contacts = $object->searchContactByEmail($origin_email);
162 
163  // Option to require email exists to create ticket
164  if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && !$contacts[0]->socid) {
165  $error++;
166  array_push($object->errors, $langs->trans("ErrorEmailMustExistToCreateTicket"));
167  $action = '';
168  }
169  }
170 
171  $contact_lastname = '';
172  $contact_firstname = '';
173  $company_name = '';
174  $contact_phone = '';
175  if ($with_contact) {
176  // set linked contact to add in form
177  if (is_array($contacts) && count($contacts) == 1) {
178  $with_contact = current($contacts);
179  }
180 
181  // check mandatory fields on contact
182  $contact_lastname = trim(GETPOST('contact_lastname', 'alphanohtml'));
183  $contact_firstname = trim(GETPOST('contact_firstname', 'alphanohtml'));
184  $company_name = trim(GETPOST('company_name', 'alphanohtml'));
185  $contact_phone = trim(GETPOST('contact_phone', 'alphanohtml'));
186  if (!($with_contact->id > 0)) {
187  // check lastname
188  if (empty($contact_lastname)) {
189  $error++;
190  array_push($object->errors, $langs->trans('ErrorFieldRequired', $langs->transnoentities('Lastname')));
191  $action = '';
192  }
193  // check firstname
194  if (empty($contact_firstname)) {
195  $error++;
196  array_push($object->errors, $langs->trans('ErrorFieldRequired', $langs->transnoentities('Firstname')));
197  $action = '';
198  }
199  }
200  }
201 
202  if (!GETPOST("subject", "restricthtml")) {
203  $error++;
204  array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Subject")));
205  $action = '';
206  }
207  if (!GETPOST("message", "restricthtml")) {
208  $error++;
209  array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Message")));
210  $action = '';
211  }
212 
213  // Check email address
214  if (!empty($origin_email) && !isValidEmail($origin_email)) {
215  $error++;
216  array_push($object->errors, $langs->trans("ErrorBadEmailAddress", $langs->transnoentities("email")));
217  $action = '';
218  }
219 
220  // Check Captcha code if is enabled
221  if (!empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA_TICKET)) {
222  $sessionkey = 'dol_antispam_value';
223  $ok = (array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) === strtolower(GETPOST('code', 'restricthtml'))));
224  if (!$ok) {
225  $error++;
226  array_push($object->errors, $langs->trans("ErrorBadValueForCode"));
227  $action = '';
228  }
229  }
230 
231  if (!$error) {
232  $object->db->begin();
233 
234  $object->track_id = generate_random_id(16);
235 
236  $object->subject = GETPOST("subject", "restricthtml");
237  $object->message = GETPOST("message", "restricthtml");
238  $object->origin_email = $origin_email;
239 
240  $object->type_code = GETPOST("type_code", 'aZ09');
241  $object->category_code = GETPOST("category_code", 'aZ09');
242  $object->severity_code = GETPOST("severity_code", 'aZ09');
243 
244  if (!is_object($user)) {
245  $user = new User($db);
246  }
247 
248  // create third-party with contact
249  $usertoassign = 0;
250  if ($with_contact && !($with_contact->id > 0)) {
251  $company = new Societe($db);
252  if (!empty($company_name)) {
253  $company->name = $company_name;
254  } else {
255  $company->particulier = 1;
256  $company->name = dolGetFirstLastname($contact_firstname, $contact_lastname);
257  }
258  $result = $company->create($user);
259  if ($result < 0) {
260  $error++;
261  $errors = ($company->error ? array($company->error) : $company->errors);
262  array_push($object->errors, $errors);
263  $action = 'create_ticket';
264  }
265 
266  // create contact and link to this new company
267  if (!$error) {
268  $with_contact->email = $origin_email;
269  $with_contact->lastname = $contact_lastname;
270  $with_contact->firstname = $contact_firstname;
271  $with_contact->socid = $company->id;
272  $with_contact->phone_pro = $contact_phone;
273  $result = $with_contact->create($user);
274  if ($result < 0) {
275  $error++;
276  $errors = ($with_contact->error ? array($with_contact->error) : $with_contact->errors);
277  array_push($object->errors, $errors);
278  $action = 'create_ticket';
279  } else {
280  $contacts = array($with_contact);
281  }
282  }
283  }
284 
285  if (is_array($searched_companies)) {
286  $object->fk_soc = $searched_companies[0]->id;
287  }
288 
289  if (is_array($contacts) and count($contacts) > 0) {
290  $object->fk_soc = $contacts[0]->socid;
291  $usertoassign = $contacts[0]->id;
292  }
293 
294  $ret = $extrafields->setOptionalsFromPost(null, $object);
295 
296  // Generate new ref
297  $object->ref = $object->getDefaultRef();
298 
299  $object->context['disableticketemail'] = 1; // Disable emails sent by ticket trigger when creation is done from this page, emails are already sent later
300 
301  $id = $object->create($user);
302  if ($id <= 0) {
303  $error++;
304  $errors = ($object->error ? array($object->error) : $object->errors);
305  array_push($object->errors, $object->error ? array($object->error) : $object->errors);
306  $action = 'create_ticket';
307  }
308 
309  if (!$error && $id > 0) {
310  if ($usertoassign > 0) {
311  $object->add_contact($usertoassign, "SUPPORTCLI", 'external', 0);
312  }
313  }
314 
315  if (!$error) {
316  $object->db->commit();
317  $action = "infos_success";
318  } else {
319  $object->db->rollback();
320  setEventMessages($object->error, $object->errors, 'errors');
321  $action = 'create_ticket';
322  }
323 
324  if (!$error) {
325  $res = $object->fetch($id);
326  if ($res) {
327  // Create form object
328  include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
329  include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
330  $formmail = new FormMail($db);
331 
332  // Init to avoid errors
333  $filepath = array();
334  $filename = array();
335  $mimetype = array();
336 
337  $attachedfiles = $formmail->get_attached_files();
338  $filepath = $attachedfiles['paths'];
339  $filename = $attachedfiles['names'];
340  $mimetype = $attachedfiles['mimes'];
341 
342  // Send email to customer
343 
344  $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubject', $object->ref, $object->track_id);
345  $message = ($conf->global->TICKET_MESSAGE_MAIL_NEW ? $conf->global->TICKET_MESSAGE_MAIL_NEW : $langs->transnoentities('TicketNewEmailBody')).'<br><br>';
346  $message .= $langs->transnoentities('TicketNewEmailBodyInfosTicket').'<br>';
347 
348  $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id;
349  $infos_new_ticket = $langs->transnoentities('TicketNewEmailBodyInfosTrackId', '<a href="'.$url_public_ticket.'" rel="nofollow noopener">'.$object->track_id.'</a>').'<br>';
350  $infos_new_ticket .= $langs->transnoentities('TicketNewEmailBodyInfosTrackUrl').'<br><br>';
351 
352  $message .= $infos_new_ticket;
353  $message .= getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE', $langs->transnoentities('TicketMessageMailSignatureText', $mysoc->name));
354 
355  $sendto = GETPOST('email', 'alpha');
356 
357  $from = $conf->global->MAIN_INFO_SOCIETE_NOM.' <'.getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>';
358  $replyto = $from;
359  $sendtocc = '';
360  $deliveryreceipt = 0;
361 
362  if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
363  $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
364  $conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
365  }
366  include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
367  $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', 'tic'.$object->id, '', 'ticket');
368  if ($mailfile->error || $mailfile->errors) {
369  setEventMessages($mailfile->error, $mailfile->errors, 'errors');
370  } else {
371  $result = $mailfile->sendfile();
372  }
373  if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
374  $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
375  }
376 
377  // Send email to TICKET_NOTIFICATION_EMAIL_TO
378  $sendto = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
379  if ($sendto) {
380  $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin', $object->ref, $object->track_id);
381  $message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id).'<br><br>';
382  $message_admin .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
383  $message_admin .= '<li>'.$langs->trans('Type').' : '.$object->type_label.'</li>';
384  $message_admin .= '<li>'.$langs->trans('Category').' : '.$object->category_label.'</li>';
385  $message_admin .= '<li>'.$langs->trans('Severity').' : '.$object->severity_label.'</li>';
386  $message_admin .= '<li>'.$langs->trans('From').' : '.$object->origin_email.'</li>';
387  // Extrafields
388  $extrafields->fetch_name_optionals_label($object->table_element);
389  if (is_array($object->array_options) && count($object->array_options) > 0) {
390  foreach ($object->array_options as $key => $value) {
391  $key = substr($key, 8); // remove "options_"
392  $message_admin .= '<li>'.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' : '.$extrafields->showOutputField($key, $value, '', $object->table_element).'</li>';
393  }
394  }
395  $message_admin .= '</ul>';
396 
397  $message_admin .= '<p>'.$langs->trans('Message').' : <br>'.$object->message.'</p>';
398  $message_admin .= '<p><a href="'.dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id.'" rel="nofollow noopener">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
399 
400  $from = $conf->global->MAIN_INFO_SOCIETE_NOM.' <'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>';
401  $replyto = $from;
402 
403  if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
404  $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
405  $conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
406  }
407  include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
408  $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', 'tic'.$object->id, '', 'ticket');
409  if ($mailfile->error || $mailfile->errors) {
410  setEventMessages($mailfile->error, $mailfile->errors, 'errors');
411  } else {
412  $result = $mailfile->sendfile();
413  }
414  if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
415  $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
416  }
417  }
418  }
419 
420  // Copy files into ticket directory
421  $destdir = $conf->ticket->dir_output.'/'.$object->ref;
422  if (!dol_is_dir($destdir)) {
423  dol_mkdir($destdir);
424  }
425  foreach ($filename as $i => $val) {
426  dol_move($filepath[$i], $destdir.'/'.$filename[$i], 0, 1);
427  $formmail->remove_attached_files($i);
428  }
429 
430  //setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs');
431 
432  // Make a redirect to avoid to have ticket submitted twice if we make back
433  $messagetoshow = $langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '{s1}', '{s2}');
434  $messagetoshow = str_replace(array('{s1}', '{s2}'), array('<strong>'.$object->track_id.'</strong>', '<strong>'.$object->ref.'</strong>'), $messagetoshow);
435  setEventMessages($messagetoshow, null, 'warnings');
436  setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings');
437  header("Location: index.php".(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:''));
438  exit;
439  }
440  } else {
441  setEventMessages($object->error, $object->errors, 'errors');
442  }
443  }
444 }
445 
446 
447 /*
448  * View
449  */
450 
451 $form = new Form($db);
452 $formticket = new FormTicket($db);
453 
454 if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) {
455  print '<div class="error">'.$langs->trans('TicketPublicInterfaceForbidden').'</div>';
456  $db->close();
457  exit();
458 }
459 
460 $arrayofjs = array();
461 $arrayofcss = array('/opensurvey/css/style.css', '/ticket/css/styles.css.php');
462 
463 llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss);
464 
465 
466 print '<div class="ticketpublicarea">';
467 
468 if ($action != "infos_success") {
469  $formticket->withfromsocid = isset($socid) ? $socid : $user->socid;
470  $formticket->withtitletopic = 1;
471  $formticket->withcompany = 0;
472  $formticket->withusercreate = 1;
473  $formticket->fk_user_create = 0;
474  $formticket->withemail = 1;
475  $formticket->ispublic = 1;
476  $formticket->withfile = 2;
477  $formticket->action = 'create_ticket';
478  $formticket->withcancel = 1;
479 
480  $formticket->param = array('returnurl' => $_SERVER['PHP_SELF'].($conf->entity > 1 ? '?entity='.$conf->entity : ''));
481 
482  print load_fiche_titre($langs->trans('NewTicket'), '', '', 0, 0, 'marginleftonly');
483 
484  if (empty($conf->global->TICKET_NOTIFICATION_EMAIL_FROM)) {
485  $langs->load("errors");
486  print '<div class="error">';
487  print $langs->trans("ErrorFieldRequired", $langs->transnoentities("TicketEmailNotificationFrom")).'<br>';
488  print $langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentities("Ticket"));
489  print '</div>';
490  } else {
491  //print '<div class="info marginleftonly marginrightonly">'.$langs->trans('TicketPublicInfoCreateTicket').'</div>';
492  $formticket->showForm(0, 'edit', 1, $with_contact);
493  }
494 }
495 
496 print '</div>';
497 
498 // End of page
499 htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object);
500 
501 llxFooter('', 'public');
502 
503 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Classe permettant la generation du formulaire html d&#39;envoi de mail unitaire Usage: $formail = new For...
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
Definition: card.php:142
dol_mkdir($dir, $dataroot= '', $newmask= '')
Creation of a directory (this can create recursive subdir)
Class to manage contact/addresses.
Class to manage Dolibarr users.
Definition: user.class.php:44
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default= '')
Return dolibarr global constant string value.
dol_is_dir($folder)
Test if filename is a directory.
Definition: files.lib.php:446
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
Class to manage ticket.
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1, $testvirus=0, $indexdatabase=1)
Move a file into another name.
Definition: files.lib.php:854
Class to manage standard extra fields.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage generation of HTML components Only common components must be here.
Class to manage third parties objects (customers, suppliers, prospects...)
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
llxHeaderTicket($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs= '', $arrayofcss= '')
Show header for public pages.
Definition: ticket.lib.php:206
Class to send emails (with attachments or not) Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to,$css,$trackid,$moreinheader,$sendcontext,$replyto); $mailfile-&gt;sendfile();.
generate_random_id($car=16)
Generate a random id.
Definition: ticket.lib.php:184
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
dol_remove_file_process($filenb, $donotupdatesession=0, $donotdeletefile=1, $trackid= '')
Remove an uploaded file (for example after submitting a new file a mail form).
Definition: files.lib.php:1785
dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesession=0, $varfiles= 'addedfile', $savingdocmask= '', $link=null, $trackid= '', $generatethumbs=1, $object=null)
Get and save an upload file (for example after submitting a new file a mail form).
Definition: files.lib.php:1633
llxFooter()
Empty footer.
Definition: wrapper.php:73
dolGetFirstLastname($firstname, $lastname, $nameorder=-1)
Return firstname and lastname in correct order.