dolibarr 19.0.3
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$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
49if (is_numeric($entity)) {
50 define("DOLENTITY", $entity);
51}
52
53// Load Dolibarr environment
54require '../../main.inc.php';
55require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
56require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticket.class.php';
57require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
58require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
59require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
60require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
61require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
62require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
63require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
64require_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$socid = GETPOST('socid', 'int');
73$suffix = "";
74
75$action = GETPOST('action', 'aZ09');
76$cancel = GETPOST('cancel', 'aZ09');
77
78
79$backtopage = '';
80
81// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
82$hookmanager->initHooks(array('publicnewticketcard', 'globalcard'));
83
84$object = new Ticket($db);
85$extrafields = new ExtraFields($db);
86$contacts = array();
87$with_contact = null;
88if (getDolGlobalInt('TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST')) {
89 $with_contact = new Contact($db);
90}
91
92$extrafields->fetch_name_optionals_label($object->table_element);
93
94if (!isModEnabled('ticket')) {
95 httponly_accessforbidden('Module Ticket not enabled');
96}
97
98
99/*
100 * Actions
101 */
102
103$parameters = array(
104 'id' => $id,
105);
106// Note that $action and $object may have been modified by some hooks
107$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
108if ($reshook < 0) {
109 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
110}
111// Add file in email form
112if (empty($reshook)) {
113 if ($cancel) {
114 $backtopage = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', DOL_URL_ROOT.'/public/ticket/');
115
116 header("Location: ".$backtopage);
117 exit;
118 }
119
120 if (GETPOST('addfile', 'alpha') && !GETPOST('save', 'alpha')) {
121 include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
122
123 // Set tmp directory
124 // TODO Use a dedicated directory for temporary emails files
125 $vardir = $conf->ticket->dir_output;
126 $upload_dir_tmp = $vardir.'/temp/'.session_id();
127 if (!dol_is_dir($upload_dir_tmp)) {
128 dol_mkdir($upload_dir_tmp);
129 }
130
131 dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, '', 0);
132 $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 // TODO Use a dedicated directory for temporary emails files
141 $vardir = $conf->ticket->dir_output.'/';
142 $upload_dir_tmp = $vardir.'/temp/'.session_id();
143
144 // TODO Delete only files that was uploaded from form
145 dol_remove_file_process(GETPOST('removedfile'), 0, 0);
146 $action = 'create_ticket';
147 }
148
149 if ($action == 'create_ticket' && GETPOST('save', 'alpha')) {
150 $error = 0;
151 $origin_email = GETPOST('email', 'alpha');
152 if (empty($origin_email)) {
153 $error++;
154 array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Email")));
155 $action = '';
156 } else {
157 // Search company saved with email
158 $searched_companies = $object->searchSocidByEmail($origin_email, '0');
159
160 // Chercher un contact existant avec cette adresse email
161 // Le premier contact trouvé est utilisé pour déterminer le contact suivi
162 $contacts = $object->searchContactByEmail($origin_email);
163
164 // Ensure that contact is active and select first active contact
165 $cid = -1;
166 foreach ($contacts as $key => $contact) {
167 if ((int) $contact->statut == 1) {
168 $cid = $key;
169 break;
170 }
171 }
172
173 // Option to require email exists to create ticket
174 if (getDolGlobalInt('TICKET_EMAIL_MUST_EXISTS') && ($cid < 0 || empty($contacts[$cid]->socid))) {
175 $error++;
176 array_push($object->errors, $langs->trans("ErrorEmailMustExistToCreateTicket"));
177 $action = '';
178 }
179 }
180
181 $contact_lastname = '';
182 $contact_firstname = '';
183 $company_name = '';
184 $contact_phone = '';
185 if ($with_contact) {
186 // set linked contact to add in form
187 if (is_array($contacts) && count($contacts) == 1) {
188 $with_contact = current($contacts);
189 }
190
191 // check mandatory fields on contact
192 $contact_lastname = trim(GETPOST('contact_lastname', 'alphanohtml'));
193 $contact_firstname = trim(GETPOST('contact_firstname', 'alphanohtml'));
194 $company_name = trim(GETPOST('company_name', 'alphanohtml'));
195 $contact_phone = trim(GETPOST('contact_phone', 'alphanohtml'));
196 if (!($with_contact->id > 0)) {
197 // check lastname
198 if (empty($contact_lastname)) {
199 $error++;
200 array_push($object->errors, $langs->trans('ErrorFieldRequired', $langs->transnoentities('Lastname')));
201 $action = '';
202 }
203 // check firstname
204 if (empty($contact_firstname)) {
205 $error++;
206 array_push($object->errors, $langs->trans('ErrorFieldRequired', $langs->transnoentities('Firstname')));
207 $action = '';
208 }
209 }
210 }
211
212 if (!GETPOST("subject", "restricthtml")) {
213 $error++;
214 array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Subject")));
215 $action = '';
216 }
217 if (!GETPOST("message", "restricthtml")) {
218 $error++;
219 array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Message")));
220 $action = '';
221 }
222
223 // Check email address
224 if (!empty($origin_email) && !isValidEmail($origin_email)) {
225 $error++;
226 array_push($object->errors, $langs->trans("ErrorBadEmailAddress", $langs->transnoentities("email")));
227 $action = '';
228 }
229
230 // Check Captcha code if is enabled
231 if (getDolGlobalInt('MAIN_SECURITY_ENABLECAPTCHA_TICKET')) {
232 $sessionkey = 'dol_antispam_value';
233 $ok = (array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) === strtolower(GETPOST('code', 'restricthtml'))));
234 if (!$ok) {
235 $error++;
236 array_push($object->errors, $langs->trans("ErrorBadValueForCode"));
237 $action = '';
238 }
239 }
240
241 if (!$error) {
242 $object->type_code = GETPOST("type_code", 'aZ09');
243 $object->category_code = GETPOST("category_code", 'aZ09');
244 $object->severity_code = GETPOST("severity_code", 'aZ09');
245 $object->ip = getUserRemoteIP();
246
247 $nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
248 $now = dol_now();
249 $minmonthpost = dol_time_plus_duree($now, -1, "m");
250
251 // Calculate nb of post for IP
252 $nb_post_ip = 0;
253 if ($nb_post_max > 0) { // Calculate only if there is a limit to check
254 $sql = "SELECT COUNT(ref) as nb_tickets";
255 $sql .= " FROM ".MAIN_DB_PREFIX."ticket";
256 $sql .= " WHERE ip = '".$db->escape($object->ip)."'";
257 $sql .= " AND datec > '".$db->idate($minmonthpost)."'";
258 $resql = $db->query($sql);
259 if ($resql) {
260 $num = $db->num_rows($resql);
261 $i = 0;
262 while ($i < $num) {
263 $i++;
264 $obj = $db->fetch_object($resql);
265 $nb_post_ip = $obj->nb_tickets;
266 }
267 }
268 }
269
270 $object->track_id = generate_random_id(16);
271
272 $object->db->begin();
273
274 $object->subject = GETPOST("subject", "restricthtml");
275 $object->message = GETPOST("message", "restricthtml");
276 $object->origin_email = $origin_email;
277
278 $object->type_code = GETPOST("type_code", 'aZ09');
279 $object->category_code = GETPOST("category_code", 'aZ09');
280 $object->severity_code = GETPOST("severity_code", 'aZ09');
281
282 if (!is_object($user)) {
283 $user = new User($db);
284 }
285
286 // create third-party with contact
287 $usertoassign = 0;
288 if ($with_contact && !($with_contact->id > 0)) {
289 $company = new Societe($db);
290 if (!empty($company_name)) {
291 $company->name = $company_name;
292 } else {
293 $company->particulier = 1;
294 $company->name = dolGetFirstLastname($contact_firstname, $contact_lastname);
295 }
296 $result = $company->create($user);
297 if ($result < 0) {
298 $error++;
299 $errors = ($company->error ? array($company->error) : $company->errors);
300 array_push($object->errors, $errors);
301 $action = 'create_ticket';
302 }
303
304 // create contact and link to this new company
305 if (!$error) {
306 $with_contact->email = $origin_email;
307 $with_contact->lastname = $contact_lastname;
308 $with_contact->firstname = $contact_firstname;
309 $with_contact->socid = $company->id;
310 $with_contact->phone_pro = $contact_phone;
311 $result = $with_contact->create($user);
312 if ($result < 0) {
313 $error++;
314 $errors = ($with_contact->error ? array($with_contact->error) : $with_contact->errors);
315 array_push($object->errors, $errors);
316 $action = 'create_ticket';
317 } else {
318 $contacts = array($with_contact);
319 }
320 }
321 }
322
323 if (!empty($searched_companies) && is_array($searched_companies)) {
324 $object->fk_soc = $searched_companies[0]->id;
325 }
326
327 if (is_array($contacts) && count($contacts) > 0 && $cid >= 0) {
328 $object->fk_soc = $contacts[$cid]->socid;
329 $usertoassign = $contacts[$cid]->id;
330 }
331
332 $ret = $extrafields->setOptionalsFromPost(null, $object);
333
334 // Generate new ref
335 $object->ref = $object->getDefaultRef();
336
337 $object->context['disableticketemail'] = 1; // Disable emails sent by ticket trigger when creation is done from this page, emails are already sent later
338
339 if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
340 $error++;
341 array_push($object->errors, $langs->trans("AlreadyTooMuchPostOnThisIPAdress"));
342 $action = 'create_ticket';
343 }
344
345 if (!$error) {
346 // Creation of the ticket
347 $id = $object->create($user);
348 if ($id <= 0) {
349 $error++;
350 $errors = ($object->error ? array($object->error) : $object->errors);
351 array_push($object->errors, $object->error ? array($object->error) : $object->errors);
352 $action = 'create_ticket';
353 }
354 }
355
356 if (!$error && $id > 0) {
357 if ($usertoassign > 0) {
358 $object->add_contact($usertoassign, "SUPPORTCLI", 'external', 0);
359 }
360
361 if (!$error) {
362 $object->db->commit();
363 $action = "infos_success";
364 } else {
365 $object->db->rollback();
366 setEventMessages($object->error, $object->errors, 'errors');
367 $action = 'create_ticket';
368 }
369
370 if (!$error) {
371 $res = $object->fetch($id);
372 if ($res) {
373 // Create form object
374 include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
375 include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
376 $formmail = new FormMail($db);
377
378 // Init to avoid errors
379 $filepath = array();
380 $filename = array();
381 $mimetype = array();
382
383 $attachedfiles = $formmail->get_attached_files();
384 $filepath = $attachedfiles['paths'];
385 $filename = $attachedfiles['names'];
386 $mimetype = $attachedfiles['mimes'];
387
388 // Send email to customer
389 $appli = $mysoc->name;
390
391 $subject = '['.$appli.'] '.$langs->transnoentities('TicketNewEmailSubject', $object->ref, $object->track_id);
392 $message = (getDolGlobalString('TICKET_MESSAGE_MAIL_NEW') !== '' ? getDolGlobalString('TICKET_MESSAGE_MAIL_NEW') : $langs->transnoentities('TicketNewEmailBody')).'<br><br>';
393 $message .= $langs->transnoentities('TicketNewEmailBodyInfosTicket').'<br>';
394
395 $url_public_ticket = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', dol_buildpath('/public/ticket/', 2)).'view.php?track_id='.$object->track_id;
396 $infos_new_ticket = $langs->transnoentities('TicketNewEmailBodyInfosTrackId', '<a href="'.$url_public_ticket.'" rel="nofollow noopener">'.$object->track_id.'</a>').'<br>';
397 $infos_new_ticket .= $langs->transnoentities('TicketNewEmailBodyInfosTrackUrl').'<br><br>';
398
399 $message .= $infos_new_ticket;
400 $message .= getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE', $langs->transnoentities('TicketMessageMailSignatureText', $mysoc->name));
401
402 $sendto = GETPOST('email', 'alpha');
403
404 $from = getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' <'.getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>';
405 $replyto = $from;
406 $sendtocc = '';
407 $deliveryreceipt = 0;
408
409 if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO') !== '') {
410 $old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO');
411 $conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
412 }
413 include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
414 $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', 'tic'.$object->id, '', 'ticket');
415 if ($mailfile->error || !empty($mailfile->errors)) {
416 setEventMessages($mailfile->error, $mailfile->errors, 'errors');
417 } else {
418 $result = $mailfile->sendfile();
419 }
420 if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO') !== '') {
421 $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
422 }
423
424 // Send email to TICKET_NOTIFICATION_EMAIL_TO
425 $sendto = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO');
426 if ($sendto) {
427 $appli = $mysoc->name;
428
429 $subject = '['.$appli.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin', $object->ref, $object->track_id);
430 $message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id).'<br><br>';
431 $message_admin .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
432 $message_admin .= '<li>'.$langs->trans('Type').' : '.$object->type_label.'</li>';
433 $message_admin .= '<li>'.$langs->trans('Category').' : '.$object->category_label.'</li>';
434 $message_admin .= '<li>'.$langs->trans('Severity').' : '.$object->severity_label.'</li>';
435 $message_admin .= '<li>'.$langs->trans('From').' : '.$object->origin_email.'</li>';
436 // Extrafields
437 $extrafields->fetch_name_optionals_label($object->table_element);
438 if (is_array($object->array_options) && count($object->array_options) > 0) {
439 foreach ($object->array_options as $key => $value) {
440 $key = substr($key, 8); // remove "options_"
441 $message_admin .= '<li>'.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' : '.$extrafields->showOutputField($key, $value, '', $object->table_element).'</li>';
442 }
443 }
444 $message_admin .= '</ul>';
445
446 $message_admin .= '<p>'.$langs->trans('Message').' : <br>'.$object->message.'</p>';
447 $message_admin .= '<p><a href="'.dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id.'" rel="nofollow noopener">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
448
449 $from = getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' <' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>';
450 $replyto = $from;
451
452 if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO') !== '') {
453 $old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO');
454 $conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
455 }
456 include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
457 $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', 'tic'.$object->id, '', 'ticket');
458 if ($mailfile->error || !empty($mailfile->errors)) {
459 setEventMessages($mailfile->error, $mailfile->errors, 'errors');
460 } else {
461 $result = $mailfile->sendfile();
462 }
463 if ((getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO') !== '')) {
464 $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
465 }
466 }
467 }
468
469 // Copy files into ticket directory
470 $object->copyFilesForTicket('');
471
472 //setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs');
473
474 // Make a redirect to avoid to have ticket submitted twice if we make back
475 $messagetoshow = $langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '{s1}', '{s2}');
476 $messagetoshow = str_replace(array('{s1}', '{s2}'), array('<strong>'.$object->track_id.'</strong>', '<strong>'.$object->ref.'</strong>'), $messagetoshow);
477 setEventMessages($messagetoshow, null, 'warnings');
478 setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings');
479
480 header("Location: index.php".(!empty($entity) && isModEnabled('multicompany') ? '?entity='.$entity : ''));
481 exit;
482 }
483 } else {
484 setEventMessages($object->error, $object->errors, 'errors');
485 }
486 }
487 }
488}
489if (!empty($object->errors) || !empty($object->error)) {
490 setEventMessages($object->error, $object->errors, 'errors');
491}
492
493
494/*
495 * View
496 */
497
498$form = new Form($db);
499$formticket = new FormTicket($db);
500
501if (!getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) {
502 print '<div class="error">'.$langs->trans('TicketPublicInterfaceForbidden').'</div>';
503 $db->close();
504 exit();
505}
506
507$arrayofjs = array();
508
509$arrayofcss = array('/opensurvey/css/style.css', getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', '/ticket/').'css/styles.css.php');
510
511llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss);
512
513
514print '<div class="ticketpublicarea ticketlargemargin centpercent">';
515
516if ($action != "infos_success") {
517 $formticket->withfromsocid = isset($socid) ? $socid : $user->socid;
518 $formticket->withtitletopic = 1;
519 $formticket->withcompany = 0;
520 $formticket->withusercreate = 1;
521 $formticket->fk_user_create = 0;
522 $formticket->withemail = 1;
523 $formticket->ispublic = 1;
524 $formticket->withfile = 2;
525 $formticket->action = 'create_ticket';
526 $formticket->withcancel = 1;
527
528 $formticket->param = array('returnurl' => $_SERVER['PHP_SELF'].($conf->entity > 1 ? '?entity='.$conf->entity : ''));
529
530 print load_fiche_titre($langs->trans('NewTicket'), '', '', 0, 0, 'marginleftonly');
531
532 if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM')=='') {
533 $langs->load("errors");
534 print '<div class="error">';
535 print $langs->trans("ErrorFieldRequired", $langs->transnoentities("TicketEmailNotificationFrom")).'<br>';
536 print $langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentities("Ticket"));
537 print '</div>';
538 } else {
539 //print '<div class="info marginleftonly marginrightonly">'.$langs->trans('TicketPublicInfoCreateTicket').'</div>';
540 $formticket->showForm(0, 'edit', 1, $with_contact);
541 }
542}
543
544print '</div>';
545
546if (getDolGlobalInt('TICKET_SHOW_COMPANY_FOOTER')) {
547 // End of page
548 htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix, $object);
549}
550
551llxFooter('', 'public');
552
553$db->close();
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to send emails (with attachments or not) Usage: $mailfile = new CMailFile($subject,...
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
Classe permettant la generation du formulaire html d'envoi de mail unitaire Usage: $formail = new For...
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:125
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.
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).
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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.
Contact()
Old copy.
Definition index.php:572
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.