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