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