dolibarr 19.0.4
interface_50_modTicket_TicketEmail.class.php
Go to the documentation of this file.
1<?php
2/*
3 * Copyright (C) 2014-2016 Jean-François Ferry <hello@librethic.io>
4 * 2016 Christophe Battarel <christophe@altairis.fr>
5 * Copyright (C) 2023 Benjamin Falière <benjamin.faliere@altairis.fr>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
26require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
27
28
33{
39 public function __construct($db)
40 {
41 $this->db = $db;
42
43 $this->name = preg_replace('/^Interface/i', '', get_class($this));
44 $this->family = "ticket";
45 $this->description = "Triggers of the module ticket to send notifications to internal users and to third-parties";
46 $this->version = self::VERSION_DOLIBARR; // 'development', 'experimental', 'dolibarr' or version
47 $this->picto = 'ticket';
48 }
49
61 public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
62 {
63 global $mysoc;
64
65 $ok = 0;
66
67 if (empty($conf->ticket) || !isModEnabled('ticket')) {
68 return 0; // Module not active, we do nothing
69 }
70
71 switch ($action) {
72 case 'TICKET_ASSIGNED':
73 dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
74
75 if ($object->fk_user_assign > 0) {
76 if ($object->fk_user_assign != $user->id) {
77 $userstat = new User($this->db);
78 $res = $userstat->fetch($object->fk_user_assign);
79 if ($res > 0) {
80 // Send email to notification email
81 if (!getDolGlobalString('TICKET_DISABLE_ALL_MAILS')) {
82 // Init to avoid errors
83 $filepath = array();
84 $filename = array();
85 $mimetype = array();
86
87 $appli = $mysoc->name;
88
89 // Send email to assigned user
90 $sendto = $userstat->email;
91 $subject_assignee = 'TicketAssignedToYou';
92 $body_assignee = 'TicketAssignedEmailBody';
93 $see_ticket_assignee = 'SeeThisTicketIntomanagementInterface';
94
95 if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
96 $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
97 $conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
98 }
99 if (!empty($sendto)) {
100 $this->composeAndSendAssigneeMessage($sendto, $subject_assignee, $body_assignee, $see_ticket_assignee, $object, $langs);
101 }
102 if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
103 $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
104 }
105 }
106 } else {
107 $this->error = $userstat->error;
108 $this->errors = $userstat->errors;
109 }
110 }
111
112 // Send an email to the Customer to inform him that his ticket has been taken in charge.
113 if (getDolGlobalString('TICKET_NOTIFY_CUSTOMER_TICKET_ASSIGNED') && empty($object->oldcopy->fk_user_assign)) {
114 $langs->load('ticket');
115
116 $subject_customer = 'TicketAssignedCustomerEmail';
117 $body_customer = 'TicketAssignedCustomerBody';
118 $see_ticket_customer = 'TicketNewEmailBodyInfosTrackUrlCustomer';
119
120 // Get all external contacts linked to the ticket
121 $linked_contacts = $object->listeContact(-1, 'thirdparty');
122
123 // Initialize and fill recipient addresses at least with origin_email
124 $sendto = '';
125 $temp_emails = [];
126 if ($object->origin_email) {
127 $temp_emails[] = $object->origin_email;
128 }
129
130 if (!empty($linked_contacts)) {
131 foreach ($linked_contacts as $contact) {
132 // Avoid the email from being sent twice in case of duplicated contact
133 if (!in_array($contact['email'], $temp_emails)) {
134 $temp_emails[] = $contact['email'];
135 }
136 }
137 }
138
139 $sendto = implode(", ", $temp_emails);
140 unset($temp_emails);
141 unset($linked_contacts);
142
143 // If recipients, we send the email
144 if ($sendto) {
145 $this->composeAndSendCustomerMessage($sendto, $subject_customer, $body_customer, $see_ticket_customer, $object, $langs);
146 }
147 }
148 $ok = 1;
149 }
150 break;
151
152 case 'TICKET_CREATE':
153 dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
154
155 $langs->load('ticket');
156
157 $subject_admin = 'TicketNewEmailSubjectAdmin';
158 $body_admin = 'TicketNewEmailBodyAdmin';
159
160 $subject_customer = 'TicketNewEmailSubjectCustomer';
161 $body_customer = 'TicketNewEmailBodyCustomer';
162 $see_ticket_customer = 'TicketNewEmailBodyInfosTrackUrlCustomer';
163
164 $subject_assignee = 'TicketAssignedToYou';
165 $body_assignee = 'TicketAssignedEmailBody';
166 $see_ticket_assignee = 'SeeThisTicketIntomanagementInterface';
167
168 // Send email to notification email
169 if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') && empty($object->context['disableticketemail'])) {
170 $sendto = !getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') ? '' : $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
171 if ($sendto) {
172 $this->composeAndSendAdminMessage($sendto, $subject_admin, $body_admin, $object, $langs);
173 }
174 }
175
176 // Send email to assignee if an assignee was set at creation
177 if ($object->fk_user_assign > 0 && $object->fk_user_assign != $user->id && empty($object->context['disableticketemail'])) {
178 $userstat = new User($this->db);
179 $res = $userstat->fetch($object->fk_user_assign);
180 if ($res > 0) {
181 // Send email to notification email
182 if (!getDolGlobalString('TICKET_DISABLE_ALL_MAILS')) {
183 // Send email to assigned user
184 $sendto = $userstat->email;
185 if (!getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
186 $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
187 $conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
188 }
189
190 if (!empty($sendto)) {
191 $this->composeAndSendAssigneeMessage($sendto, $subject_assignee, $body_assignee, $see_ticket_assignee, $object, $langs);
192 }
193
194 if (!getDolUserString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
195 $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
196 }
197 }
198 } else {
199 $this->error = $userstat->error;
200 $this->errors = $userstat->errors;
201 }
202 }
203
204 // Send email to customer
205 if (!getDolGlobalString('TICKET_DISABLE_CUSTOMER_MAILS') && empty($object->context['disableticketemail']) && $object->notify_tiers_at_create) {
206 $sendto = '';
207
208 //if contact selected send to email's contact else send to email's thirdparty
209
210 $contactid = GETPOST('contactid', 'alpha');
211 $res = 0;
212
213 if (!empty($contactid)) {
214 $contact = new Contact($this->db);
215 $res = $contact->fetch($contactid);
216 }
217
218 if ($res > 0 && !empty($contact->email) && !empty($contact->statut)) {
219 $sendto = $contact->email;
220 } elseif (!empty($object->fk_soc)) {
221 $object->fetch_thirdparty();
222 $sendto = $object->thirdparty->email;
223 }
224
225 if ($sendto) {
226 $this->composeAndSendCustomerMessage($sendto, $subject_customer, $body_customer, $see_ticket_customer, $object, $langs);
227 }
228 }
229
230 $ok = 1;
231 break;
232
233 case 'TICKET_DELETE':
234 dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
235 break;
236
237 case 'TICKET_MODIFY':
238 dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
239 break;
240
241 case 'TICKET_CLOSE':
242 dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
243 $langs->load('ticket');
244
245 $subject_admin = 'TicketCloseEmailSubjectAdmin';
246 $body_admin = 'TicketCloseEmailBodyAdmin';
247 $subject_customer = 'TicketCloseEmailSubjectCustomer';
248 $body_customer = 'TicketCloseEmailBodyCustomer';
249 $see_ticket_customer = 'TicketCloseEmailBodyInfosTrackUrlCustomer';
250
251 // Send email to notification email
252 if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') && empty($object->context['disableticketemail'])) {
253 $sendto = !getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') ? '' : $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
254 if ($sendto) {
255 $this->composeAndSendAdminMessage($sendto, $subject_admin, $body_admin, $object, $langs);
256 }
257 }
258
259 // Send email to customer.
260 if (!getDolGlobalString('TICKET_DISABLE_CUSTOMER_MAILS') && empty($object->context['disableticketemail'])) {
261 $linked_contacts = $object->listeContact(-1, 'thirdparty');
262 $linked_contacts = array_merge($linked_contacts, $object->listeContact(-1, 'internal'));
263 if (empty($linked_contacts) && getDolGlobalString('TICKET_NOTIFY_AT_CLOSING') && !empty($object->fk_soc)) {
264 $object->fetch_thirdparty();
265 $linked_contacts[]['email'] = $object->thirdparty->email;
266 }
267
268 $contactid = GETPOST('contactid', 'int');
269 $res = 0;
270
271 if ($contactid > 0) {
272 // TODO This security test has no sens. We must check that $contactid is inside $linked_contacts[]['id'] when $linked_contacts[]['source'] = 'external' or 'thirdparty'
273 // Refuse email if not
274 $contact = new Contact($this->db);
275 $res = $contact->fetch($contactid);
276 if (! in_array($contact, $linked_contacts)) {
277 $error_msg = $langs->trans('Error'). ': ';
278 $error_msg .= $langs->transnoentities('TicketWrongContact');
279 setEventMessages($error_msg, [], 'errors');
280 $ok = 0;
281 break;
282 }
283 }
284
285 $sendto = '';
286 if ($res > 0 && !empty($contact->email) && !empty($contact->statut)) {
287 $sendto = $contact->email;
288 } elseif (!empty($linked_contacts) && ($contactid == -2 || (GETPOST('massaction', 'alpha') == 'close' && GETPOST('confirm', 'alpha') == 'yes'))) {
289 // if sending to all contacts or sending to contacts while mass closing
290 $temp_emails = [];
291 foreach ($linked_contacts as $contact) {
292 $temp_emails[] = $contact['email'];
293 }
294 $sendto = implode(", ", $temp_emails);
295 unset($temp_emails);
296 unset($linked_contacts);
297 }
298 if ($sendto) {
299 $this->composeAndSendCustomerMessage($sendto, $subject_customer, $body_customer, $see_ticket_customer, $object, $langs);
300 }
301 }
302 $ok = 1;
303 break;
304 }
305
306 return $ok;
307 }
308
319 private function composeAndSendAdminMessage($sendto, $base_subject, $body, Ticket $object, Translate $langs)
320 {
321 global $conf, $mysoc;
322
323 // Init to avoid errors
324 $filepath = array();
325 $filename = array();
326 $mimetype = array();
327
328 $appli = $mysoc->name;
329
330 /* Send email to admin */
331 $subject = '['.$appli.'] '.$langs->transnoentities($base_subject, $object->ref, $object->track_id);
332 $message_admin = $langs->transnoentities($body, $object->track_id).'<br>';
333 $message_admin .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
334 $message_admin .= '<li>'.$langs->trans('Type').' : '.$langs->getLabelFromKey($this->db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code).'</li>';
335 $message_admin .= '<li>'.$langs->trans('TicketCategory').' : '.$langs->getLabelFromKey($this->db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code).'</li>';
336 $message_admin .= '<li>'.$langs->trans('Severity').' : '.$langs->getLabelFromKey($this->db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code).'</li>';
337 $message_admin .= '<li>'.$langs->trans('From').' : '.($object->email_from ? $object->email_from : ($object->fk_user_create > 0 ? $langs->trans('Internal') : '')).'</li>';
338 // Extrafields
339 $extraFields = new ExtraFields($this->db);
340 $extraFields->fetch_name_optionals_label($object->table_element);
341 if (is_array($object->array_options) && count($object->array_options) > 0) {
342 foreach ($object->array_options as $key => $value) {
343 $key = substr($key, 8); // remove "options_"
344 $message_admin .= '<li>'.$langs->trans($extraFields->attributes[$object->element]['label'][$key]).' : '.$extraFields->showOutputField($key, $value, '', $object->table_element).'</li>';
345 }
346 }
347 if ($object->fk_soc > 0) {
348 $object->fetch_thirdparty();
349 $message_admin .= '<li>'.$langs->trans('Company').' : '.$object->thirdparty->name.'</li>';
350 }
351 $message_admin .= '</ul>';
352
353 $message = $object->message;
354 if (!dol_textishtml($message)) {
355 $message = dol_nl2br($message);
356 }
357 $message_admin .= '<p>'.$langs->trans('Message').' : <br><br>'.$message.'</p><br>';
358 $message_admin .= '<p><a href="'.dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id.'">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
359
360 $from = getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . '<' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>';
361
362 $trackid = 'tic'.$object->id;
363
364 if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
365 $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
366 $conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
367 }
368 include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
369 $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, '', '', 0, -1, '', '', $trackid, '', 'ticket');
370 if ($mailfile->error) {
371 dol_syslog($mailfile->error, LOG_DEBUG);
372 } else {
373 $result = $mailfile->sendfile();
374 }
375 if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
376 $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
377 }
378 }
379
391 private function composeAndSendCustomerMessage($sendto, $base_subject, $body, $see_ticket, Ticket $object, Translate $langs)
392 {
393 global $conf, $extrafields, $mysoc, $user;
394
395 // Init to avoid errors
396 $filepath = array();
397 $filename = array();
398 $mimetype = array();
399
400 $appli = $mysoc->name;
401
402 $subject = '['.$appli.'] '.$langs->transnoentities($base_subject);
403 $message_customer = $langs->transnoentities($body, $object->track_id).'<br>';
404 $message_customer .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
405 $message_customer .= '<li>'.$langs->trans('Type').' : '.$langs->getLabelFromKey($this->db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code).'</li>';
406 $message_customer .= '<li>'.$langs->trans('TicketCategory').' : '.$langs->getLabelFromKey($this->db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code).'</li>';
407 $message_customer .= '<li>'.$langs->trans('Severity').' : '.$langs->getLabelFromKey($this->db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code).'</li>';
408
409 // Extrafields
410 if (is_array($extrafields->attributes[$object->table_element]['label'])) {
411 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $value) {
412 $enabled = 1;
413 if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$key])) {
414 $enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1);
415 }
416 $perms = 1;
417 if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key])) {
418 $perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1);
419 }
420
421 $qualified = true;
422 if (empty($enabled)) {
423 $qualified = false;
424 }
425 if (empty($perms)) {
426 $qualified = false;
427 }
428
429 if ($qualified) {
430 $message_customer .= '<li>' . $langs->trans($key) . ' : ' . $value . '</li>';
431 }
432 }
433 }
434
435 $message_customer .= '</ul>';
436
437 $message = $object->message;
438 if (!dol_textishtml($message)) {
439 $message = dol_nl2br($message);
440 }
441 $message_customer .= '<p>'.$langs->trans('Message').' : <br><br>'.$message.'</p><br>';
442
443 $url_public_ticket = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', dol_buildpath('/public/ticket/', 2)).'view.php?track_id='.$object->track_id;
444
445 $message_customer .= '<p>'.$langs->trans($see_ticket).' : <a href="'.$url_public_ticket.'">'.$url_public_ticket.'</a></p>';
446 $message_customer .= '<p>'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'</p>';
447
448 $from = (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? '' : getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' ').'<' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>';
449
450 $trackid = 'tic'.$object->id;
451
452 $old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('MAIN_MAIL_AUTOCOPY_TO');
453
454 if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
455 $conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
456 }
457
458 include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
459 $mailfile = new CMailFile($subject, $sendto, $from, $message_customer, $filepath, $mimetype, $filename, '', '', 0, -1, '', '', $trackid, '', 'ticket');
460 if ($mailfile->error) {
461 dol_syslog($mailfile->error, LOG_DEBUG);
462 } else {
463 $result = $mailfile->sendfile();
464 if ($result) {
465 // update last_msg_sent date
466 $object->fetch($object->id);
467 $object->date_last_msg_sent = dol_now();
468 $object->update($user);
469 }
470 }
471 if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
472 $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
473 }
474 }
475
487 private function composeAndSendAssigneeMessage($sendto, $base_subject, $body, $see_ticket, Ticket $object, Translate $langs)
488 {
489 global $conf, $user, $mysoc;
490
491 // Init to avoid errors
492 $filepath = array();
493 $filename = array();
494 $mimetype = array();
495
496 // Send email to assigned user
497 $appli = $mysoc->name;
498
499 $subject = '['.$appli.'] '.$langs->transnoentities($base_subject);
500 $message = '<p>'.$langs->transnoentities($body, $object->track_id, dolGetFirstLastname($user->firstname, $user->lastname))."</p>";
501 $message .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
502 $message .= '<li>'.$langs->trans('Type').' : '.$object->type_label.'</li>';
503 $message .= '<li>'.$langs->trans('Category').' : '.$object->category_label.'</li>';
504 $message .= '<li>'.$langs->trans('Severity').' : '.$object->severity_label.'</li>';
505 // Extrafields
506 if (is_array($object->array_options) && count($object->array_options) > 0) {
507 foreach ($object->array_options as $key => $value) {
508 $message .= '<li>'.$langs->trans($key).' : '.$value.'</li>';
509 }
510 }
511
512 $message .= '</ul>';
513 $message .= '<p>'.$langs->trans('Message').' : <br>'.$object->message.'</p>';
514 $message .= '<p><a href="'.dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id.'">'.$langs->trans($see_ticket).'</a></p>';
515
516 $from = dolGetFirstLastname($user->firstname, $user->lastname).'<'.$user->email.'>';
517
518 $message = dol_nl2br($message);
519
520 $old_MAIN_MAIL_AUTOCOPY_TO = null;
521 if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
522 $old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('MAIN_MAIL_AUTOCOPY_TO');
523 $conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
524 }
525
526 include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
527 $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1);
528 if ($mailfile->error) {
529 setEventMessages($mailfile->error, $mailfile->errors, 'errors');
530 } else {
531 $result = $mailfile->sendfile();
532 if ($result) {
533 // update last_msg_sent date
534 $object->fetch($object->id);
535 $object->date_last_msg_sent = dol_now();
536 $object->update($user);
537 }
538 }
539 if (!getDolUserString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
540 $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
541 }
542 }
543}
Class to send emails (with attachments or not) Usage: $mailfile = new CMailFile($subject,...
Class to stock current configuration.
Class that all the triggers must extend.
Class to manage standard extra fields.
Class of triggers for ticket module.
composeAndSendAssigneeMessage($sendto, $base_subject, $body, $see_ticket, Ticket $object, Translate $langs)
Composes and sends a message concerning a ticket, to be sent to user assigned to the ticket.
composeAndSendCustomerMessage($sendto, $base_subject, $body, $see_ticket, Ticket $object, Translate $langs)
Composes and sends a message concerning a ticket, to be sent to customer addresses.
runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
Function called when a Dolibarrr business event is done.
composeAndSendAdminMessage($sendto, $base_subject, $body, Ticket $object, Translate $langs)
Composes and sends a message concerning a ticket, to be sent to admin address.
Class to manage translations.
Class to manage Dolibarr users.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_nl2br($stringtoencode, $nl2brmode=0, $forxml=false)
Replace CRLF in string with a HTML BR tag.
getDolUserString($key, $default='', $tmpuser=null)
Return Dolibarr user constant string value.
dol_now($mode='auto')
Return date for now.
dol_eval($s, $returnvalue=0, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
dolGetFirstLastname($firstname, $lastname, $nameorder=-1)
Return firstname and lastname in correct order.
dol_textishtml($msg, $option=0)
Return if a text is a html content.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Class to generate the form for creating a new ticket.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:124
Contact()
Old copy.
Definition index.php:572