dolibarr 25.0.0-alpha
attendee_new.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2021 Dorian Vabre <dorian.vabre@gmail.com>
3 * Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
5 * Copyright (C) 2024-2026 Frédéric France <frederic.france@free.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
27if (!defined('NOLOGIN')) {
28 define("NOLOGIN", 1); // This means this output page does not require to be logged.
29}
30if (!defined('NOCSRFCHECK')) {
31 define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
32}
33if (!defined('NOIPCHECK')) {
34 define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
35}
36if (!defined('NOBROWSERNOTIF')) {
37 define('NOBROWSERNOTIF', '1');
38}
39if (!defined('NOIPCHECK')) {
40 define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
41}
42
43
44// For MultiCompany module.
45// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
46// Because 2 entities can have the same ref
47$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
48if (is_numeric($entity)) {
49 define("DOLENTITY", $entity);
50}
51
52// Load Dolibarr environment
53require '../../main.inc.php';
54require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
55require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
56require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php';
57require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
58require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
59require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
60require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php';
61require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
62require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
63require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
64
66
78// Init vars
79$errmsg = '';
80$errors = array();
81$error = 0;
82$backtopage = GETPOST('backtopage', 'alpha');
83$action = GETPOST('action', 'aZ09');
84
85$email = GETPOST("email");
86$societe = GETPOST("societe");
87$emailcompany = GETPOST("emailcompany");
88$note_public = GETPOST('note_public', "restricthtml");
89$firstname = GETPOST('firstname');
90$lastname = GETPOST('lastname');
91
92// Getting id from Post and decoding it
93$type = GETPOST('type', 'aZ09');
94if ($type == 'conf') {
95 $id = GETPOSTINT('id');
96} else {
97 $id = GETPOSTINT('fk_project') ? GETPOSTINT('fk_project') : GETPOSTINT('id');
98}
99
100$conference = new ConferenceOrBooth($db);
101$confattendee = new ConferenceOrBoothAttendee($db);
102$project = new Project($db);
103$object = $confattendee;
104
105if ($type == 'conf') {
106 $resultconf = $conference->fetch($id);
107 if ($resultconf < 0) {
108 print 'Bad value for parameter id';
109 exit;
110 }
111 $resultproject = $project->fetch($conference->fk_project);
112 if ($resultproject < 0) {
113 $error++;
114 $errmsg .= $project->error;
115 $errors = array_merge($errors, $project->errors);
116 }
117}
118
119$currentnbofattendees = 0;
120if ($type == 'global') {
121 $resultproject = $project->fetch($id);
122 if ($resultproject < 0) {
123 $error++;
124 $errmsg .= $project->error;
125 $errors = array_merge($errors, $project->errors);
126 } else {
127 $sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee";
128 $sql .= " WHERE fk_project = ".((int) $project->id);
129 $sql .= " AND status IN (0, 1)";
130
131 $resql = $db->query($sql);
132 if ($resql) {
133 $obj = $db->fetch_object($resql);
134 if ($obj) {
135 $currentnbofattendees = $obj->nb;
136 } else {
137 dol_print_error($db);
138 }
139 }
140 }
141}
142if ($type == 'conf' && $conference->id > 0) {
143 $sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee";
144 $sql .= " WHERE fk_actioncomm = ".((int) $conference->id);
145 $sql .= " AND status IN (0, 1)";
146
147 $resql = $db->query($sql);
148 if ($resql) {
149 $obj = $db->fetch_object($resql);
150 if ($obj) {
151 $currentnbofattendees = $obj->nb;
152 } else {
153 dol_print_error($db);
154 }
155 }
156}
157
158// Security check
159$securekeyreceived = GETPOST('securekey', 'alpha');
160$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.((int) $id), 'md5');
161
162// We check if the securekey collected is OK
163if (!hash_equals($securekeytocompare, $securekeyreceived)) {
164 print $langs->trans('MissingOrBadSecureKey');
165 exit;
166}
167
168// Load translation files
169$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization"));
170
171// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
172$hookmanager->initHooks(array('publicnewmembercard', 'globalcard'));
173
174$extrafields = new ExtraFields($db);
175
176$user->loadDefaultValues();
177
178// Security check
179if (empty($conf->eventorganization->enabled)) {
180 httponly_accessforbidden('Module Event organization not enabled');
181}
182
183$extrafields->fetch_name_optionals_label($object->table_element); // fetch optionals attributes and labels
184
185
200function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = [], $ws = '') // @phan-suppress-current-line PhanRedefineFunction
201{
202 global $conf, $langs, $mysoc;
203
204 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
205
206 print '<body id="mainbody" class="publicnewmemberform">';
207
208 // Define urllogo
209 $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png';
210
211 if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
212 $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_small);
213 } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
214 $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/'.$mysoc->logo);
215 } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
216 $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
217 }
218
219 print '<div class="center">';
220 // Output html code for logo
221 if ($urllogo) {
222 print '<div class="backgreypublicpayment">';
223 print '<div class="logopublicpayment">';
224 print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
225 print '>';
226 print '</div>';
227 if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) {
228 print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
229 }
230 print '</div>';
231 }
232
233 if (getDolGlobalString('EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE')) {
234 print '<div class="backimagepubliceventorganizationsubscription">';
235 print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE').'">';
236 print '</div>';
237 }
238
239 print '</div>';
240
241 print '<div class="divmainbodylarge">';
242}
243
251function llxFooterVierge() // @phan-suppress-current-line PhanRedefineFunction
252{
253 print '</div>';
254
255 printCommonFooter('public');
256
257 print "</body>\n";
258 print "</html>\n";
259}
260
261
262
263/*
264 * Actions
265 */
266
267$parameters = array();
268// Note that $action and $object may have been modified by some hooks
269$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
270if ($reshook < 0) {
271 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
272}
273
274// Action called when page is submitted
275if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conference->status == 2 || !empty($project->id) && $project->status == Project::STATUS_VALIDATED)) { // Test on permission not required. Check are done on securitykey and mitigation
276 $error = 0;
277
278 $urlback = '';
279
280 $db->begin();
281
282 if (!GETPOST("email")) {
283 $error++;
284 $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\n";
285 }
286 // If the price has been set, name is required for the invoice
287 if (!GETPOST("societe") && !empty((float) $project->price_registration)) {
288 $error++;
289 $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Company"))."<br>\n";
290 }
291 if (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
292 $error++;
293 $langs->load("errors");
294 $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."<br>\n";
295 }
296 if (!GETPOST("country_id")) {
297 $error++;
298 $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."<br>\n";
299 }
300
301 $thirdparty = null;
302
303 if (!$error) {
304 // Check if attendee already exists (by email and for this event)
305 $filter = array();
306
307 if ($type == 'global') {
308 $filter = "(t.fk_project:=:".((int) $id).") AND (t.email:=:'".$db->escape($email)."')";
309 }
310 if ($type == 'conf') {
311 $filter = "(t.fk_actioncomm:=:".((int) $id).") AND (t.email:=:'".$db->escape($email)."')";
312 }
313
314 // Check if there is already an attendee into table eventorganization_conferenceorboothattendee for same event (or conference/booth)
315 $resultfetchconfattendee = $confattendee->fetchAll('', '', 0, 0, $filter);
316
317 $attendeealreadyexists = false;
318 if ($resultfetchconfattendee < 0) {
319 $error++;
320 $errmsg .= $confattendee->error;
321 $errors = array_merge($errors, $confattendee->errors);
322 } elseif (is_array($resultfetchconfattendee) && count($resultfetchconfattendee) > 0) {
323 // Found confattendee
324 $confattendee = array_shift($resultfetchconfattendee);
325 $attendeealreadyexists = true;
326 } else {
327 // Need to create a confattendee
328 $confattendee->date_creation = dol_now();
329 }
330
331 // An unpaid registration can be submitted again to update attendee details
332 // and extrafields. A paid registration remains immutable here.
333 if (!$error && (!$attendeealreadyexists || empty((float) $confattendee->amount))) {
334 $confattendee->date_subscription = dol_now();
335 $confattendee->email = $email;
336 $confattendee->fk_project = $project->id;
337 $confattendee->fk_actioncomm = $id;
338 $confattendee->note_public = $note_public;
339 $confattendee->firstname = $firstname;
340 $confattendee->lastname = $lastname;
341
342 // Fill array 'array_options' with data from add form
343 $extrafields->fetch_name_optionals_label($confattendee->table_element);
344 $ret = $extrafields->setOptionalsFromPost(null, $confattendee);
345 if ($ret < 0) {
346 $error++;
347 $errmsg .= $confattendee->error;
348 }
349
350 if (!$error && $attendeealreadyexists) {
351 $resultconfattendee = $confattendee->update($user);
352 if ($resultconfattendee < 0) {
353 $error++;
354 $errmsg .= $confattendee->error;
355 $errors = array_merge($errors, $confattendee->errors);
356 }
357 }
358 }
359
360 if (!$error && !$attendeealreadyexists) {
361 // Count recent already posted event
362 $confattendee->ip = getUserRemoteIP();
363 $nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
364 $now = dol_now();
365 $minmonthpost = dol_time_plus_duree($now, -1, "m");
366 // Calculate nb of post for IP
367 $nb_post_ip = 0;
368 if ($nb_post_max > 0) { // Calculate only if there is a limit to check
369 $sql = "SELECT COUNT(ref) as nb_attendee";
370 $sql .= " FROM ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee";
371 $sql .= " WHERE ip = '".$db->escape($confattendee->ip)."'";
372 $sql .= " AND date_creation > '".$db->idate($minmonthpost)."'";
373 $resql = $db->query($sql);
374 if ($resql) {
375 $num = $db->num_rows($resql);
376 $i = 0;
377 while ($i < $num) {
378 $i++;
379 $obj = $db->fetch_object($resql);
380 $nb_post_ip = $obj->nb_attendee;
381 }
382 }
383 }
384
385 $resultconfattendee = -1;
386
387 if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
388 $error++;
389 $errmsg .= $langs->trans("AlreadyTooMuchPostOnThisIPAdress");
390 array_push($confattendee->errors, $langs->trans("AlreadyTooMuchPostOnThisIPAdress"));
391 setEventMessage($errmsg, 'errors');
392 } else {
393 $resultconfattendee = $confattendee->create($user);
394 }
395 if ($resultconfattendee < 0) {
396 $error++;
397 $errmsg .= $confattendee->error;
398 $errors = array_merge($errors, $confattendee->errors);
399 }
400 }
401
402 // At this point, we have an existing $confattendee. It may not be linked to a thirdparty.
403 //var_dump($confattendee);
404
405 // If the registration has already been paid for this attendee
406 if (!$error && !empty($confattendee->date_subscription) && !empty((float) $confattendee->amount)) {
407 $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5');
408 $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl);
409
410 $mesg = $langs->trans("RegistrationAndPaymentWereAlreadyRecorded", $email);
411 setEventMessages($mesg, null, 'mesgs');
412
413 $db->commit();
414
415 header("Location: ".$redirection);
416 exit;
417 }
418
419 $resultfetchthirdparty = 0;
420
421 $genericcompanyname = $langs->trans('EventParticipant').' '.($emailcompany ? $emailcompany : $email); // Keep this label simple so we can retrieve same thirdparty for another event
422
423 // Getting the thirdparty or creating it
424 $thirdparty = new Societe($db);
425 $contact = new Contact($db);
426 // Fetch using fk_soc if the attendee was already found
427 if (!empty($confattendee->fk_soc) && $confattendee->fk_soc > 0) {
428 $resultfetchthirdparty = $thirdparty->fetch($confattendee->fk_soc);
429 } else {
430 if (!getDolGlobalString('EVENTORGANIZATION_DISABLE_RETREIVE_THIRDPARTY_FROM_NAME')) {
431 // Fetch using the field input by end user if we have just created the attendee
432 if ($resultfetchthirdparty <= 0 && !empty($societe) && !empty($emailcompany)) {
433 $resultfetchthirdparty = $thirdparty->fetch(0, $societe, '', '', '', '', '', '', '', '', $emailcompany);
434 if ($resultfetchthirdparty > 0) {
435 // We found a unique result with the name + emailcompany, so we set the fk_soc of attendee
436 $confattendee->fk_soc = $thirdparty->id;
437 $confattendee->update($user);
438 } elseif ($resultfetchthirdparty == -2) {
439 $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email);
440 }
441 }
442 // Fetch using the field input by end user if we have just created the attendee
443 if ($resultfetchthirdparty <= 0 && !empty($societe) && !empty($email) && $email != $emailcompany) {
444 $resultfetchthirdparty = $thirdparty->fetch(0, $societe, '', '', '', '', '', '', '', '', $email);
445 if ($resultfetchthirdparty > 0) {
446 // We found a unique result with the name + email, so we set the fk_soc of attendee
447 $confattendee->fk_soc = $thirdparty->id;
448 $confattendee->update($user);
449 } elseif ($resultfetchthirdparty == -2) {
450 $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email);
451 }
452 }
453 }
454 if ($resultfetchthirdparty <= 0 && !empty($emailcompany)) {
455 // Try to find thirdparty from the email only
456 $resultfetchthirdparty = $thirdparty->fetch(0, '', '', '', '', '', '', '', '', '', $emailcompany);
457 if ($resultfetchthirdparty > 0) {
458 // We found a unique result with that email only, so we set the fk_soc of attendee
459 $confattendee->fk_soc = $thirdparty->id;
460 $confattendee->update($user);
461 } elseif ($resultfetchthirdparty == -2) {
462 $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithEmailContactUs", $mysoc->email);
463 }
464 }
465 if ($resultfetchthirdparty <= 0 && !empty($email) && $email != $emailcompany) {
466 // Try to find thirdparty from the email only
467 $resultfetchthirdparty = $thirdparty->fetch(0, '', '', '', '', '', '', '', '', '', $email);
468 if ($resultfetchthirdparty > 0) {
469 // We found a unique result with that email only, so we set the fk_soc of attendee
470 $confattendee->fk_soc = $thirdparty->id;
471 $confattendee->update($user);
472 } elseif ($resultfetchthirdparty == -2) {
473 $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithEmailContactUs", $mysoc->email);
474 }
475 }
476 if ($resultfetchthirdparty <= 0 && !empty($genericcompanyname)) {
477 // Try to find thirdparty from the generic mail only
478 $resultfetchthirdparty = $thirdparty->fetch(0, $genericcompanyname, '', '', '', '', '', '', '', '', '');
479 if ($resultfetchthirdparty > 0) {
480 // We found a unique result with that name + email, so we set the fk_soc of attendee
481 $confattendee->fk_soc = $thirdparty->id;
482 $confattendee->update($user);
483 } elseif ($resultfetchthirdparty == -2) {
484 $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email);
485 }
486 }
487
488 // TODO Add more tests on a VAT number, profid or a name ?
489
490 if ($resultfetchthirdparty <= 0 && !empty($email)) {
491 // Try to find the thirdparty from the contact
492 $resultfetchcontact = $contact->fetch(0, null, '', $email);
493 if ($resultfetchcontact > 0 && $contact->fk_soc > 0) {
494 $thirdparty->fetch($contact->fk_soc);
495 $confattendee->fk_soc = $thirdparty->id;
496 $confattendee->update($user);
497 $resultfetchthirdparty = 1;
498 }
499 }
500
501 if ($resultfetchthirdparty <= 0 && !empty($societe)) {
502 // Try to find thirdparty from the company name only
503 $resultfetchthirdparty = $thirdparty->fetch(0, $societe, '', '', '', '', '', '', '', '', '');
504 if ($resultfetchthirdparty > 0) {
505 // We found a unique result with that name only, so we set the fk_soc of attendee
506 $confattendee->fk_soc = $thirdparty->id;
507 $confattendee->update($user);
508 } elseif ($resultfetchthirdparty == -2) {
509 $thirdparty->error = "ErrorSeveralCompaniesWithNameContactUs";
510 }
511 }
512 }
513
514 // If price is empty, no need to create a thirdparty, so we force $resultfetchthirdparty as if we have already found thirdp party.
515 if (empty((float) $project->price_registration)) {
516 $resultfetchthirdparty = 1;
517 }
518
519 if ($resultfetchthirdparty < 0) {
520 // If an error was found
521 $error++;
522 $errmsg .= $thirdparty->error;
523 $errors = array_merge($errors, $thirdparty->errors);
524 } elseif ($resultfetchthirdparty == 0) { // No thirdparty found + a payment is expected
525 // Creation of a new thirdparty
526 if (!empty($societe)) {
527 $thirdparty->name = $societe;
528 } else {
529 $thirdparty->name = $genericcompanyname;
530 }
531 $thirdparty->address = GETPOST("address");
532 $thirdparty->zip = GETPOST("zipcode");
533 $thirdparty->town = GETPOST("town");
534 $thirdparty->client = $thirdparty::PROSPECT;
535 $thirdparty->fournisseur = 0;
536 $thirdparty->country_id = GETPOSTINT("country_id");
537 $thirdparty->state_id = GETPOSTINT("state_id");
538 $thirdparty->email = ($emailcompany ? $emailcompany : $email);
539
540 // Load object modCodeTiers
541 $module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
542 if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
543 $module = substr($module, 0, dol_strlen($module) - 4);
544 }
545 $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']);
546 foreach ($dirsociete as $dirroot) {
547 $res = dol_include_once($dirroot.$module.'.php');
548 if ($res) {
549 break;
550 }
551 }
552 $modCodeClient = new $module($db);
553 '@phan-var-force ModeleThirdPartyCode $modCodeClient';
554
555 $tmpcode = '';
556 if (empty($tmpcode) && !empty($modCodeClient->code_auto)) {
557 $tmpcode = $modCodeClient->getNextValue($thirdparty, 0);
558 }
559 $thirdparty->code_client = $tmpcode;
560
561 $readythirdparty = $thirdparty->create($user);
562 if ($readythirdparty < 0) {
563 $error++;
564 $errmsg .= $thirdparty->error;
565 $errors = array_merge($errors, $thirdparty->errors);
566 } else {
567 $thirdparty->country_code = getCountry($thirdparty->country_id, '2', $db, $langs);
568 $thirdparty->country = getCountry($thirdparty->country_code, '', $db, $langs);
569
570 // Update attendee country to match country of thirdparty
571 $confattendee->fk_soc = $thirdparty->id;
572 $confattendee->update($user);
573 }
574 }
575 }
576
577 if (!$error && is_object($thirdparty)) {
578 // If the registration needs a payment
579 if (!empty((float) $project->price_registration)) {
580 $outputlangs = $langs;
581
582 // TODO Use default language of $thirdparty->default_lang to build $outputlang
583
584 $outputlangs->loadLangs(array("eventorganization"));
585
586 // Get product to use for invoice
587 $productforinvoicerow = new Product($db);
588 $productforinvoicerow->id = 0;
589
590 $resultprod = 0;
591 if (getDolGlobalInt('SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION') > 0) {
592 $resultprod = $productforinvoicerow->fetch(getDolGlobalInt('SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION'));
593 }
594
595 $facture = null;
596 // Create the draft invoice for the payment
597 if ($resultprod < 0) {
598 $error++;
599 $errmsg .= $productforinvoicerow->error;
600 $errors = array_merge($errors, $productforinvoicerow->errors);
601 } else {
602 $facture = new Facture($db);
603 if (empty($confattendee->fk_invoice)) {
604 $facture->type = Facture::TYPE_STANDARD;
605 $facture->socid = $thirdparty->id;
606 $facture->paye = 0;
607 $facture->date = dol_now();
608 $facture->cond_reglement_id = $confattendee->cond_reglement_id;
609 $facture->fk_project = $project->id;
610 $facture->status = Facture::STATUS_DRAFT;
611
612 if (empty($facture->cond_reglement_id)) {
613 $paymenttermstatic = new PaymentTerm($confattendee->db);
614 $facture->cond_reglement_id = $paymenttermstatic->getDefaultId();
615 if (empty($facture->cond_reglement_id)) {
616 $error++;
617 $confattendee->error = 'ErrorNoPaymentTermRECEPFound';
618 $confattendee->errors[] = $confattendee->error;
619 }
620 }
621 $resultfacture = $facture->create($user);
622 if ($resultfacture <= 0) {
623 $confattendee->error = $facture->error;
624 $confattendee->errors = $facture->errors;
625 $error++;
626 } else {
627 $confattendee->fk_invoice = $resultfacture;
628 $confattendee->update($user);
629 }
630 } else {
631 $facture->fetch($confattendee->fk_invoice);
632 }
633
634 // Add link between invoice and the attendee registration
635 /*if (!$error) {
636 $facture->add_object_linked($confattendee->element, $confattendee->id);
637 }*/
638 }
639
640 if (!$error) {
641 // Add line to draft invoice
642 $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id);
643
644 $labelforproduct = $outputlangs->trans("EventFee", $project->title);
645 if ($project->location) {
646 $labelforproduct .= ' - '.$project->location;
647 }
648 $date_start = $project->date_start_event;
649 $date_end = $project->date_end_event;
650
651 // If there is no lines yet, we add one
652 if (empty($facture->lines)) {
653 $pu_ttc = (float) $project->price_registration;
654 $pu_ht = 0;
655 $price_base_type = 'TTC';
656
657 $result = $facture->addline($labelforproduct, $pu_ht, 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, $date_start, $date_end, 0, 0, 0, $price_base_type, $pu_ttc, 1);
658 if ($result <= 0) {
659 $confattendee->error = $facture->error;
660 $confattendee->errors = $facture->errors;
661 $error++;
662 }
663 }
664 }
665
666 if (!$error && is_object($facture)) {
667 $db->commit();
668
669 // Registration was recorded and invoice was generated, but payment not yet done.
670 // TODO
671 // Send an email to says registration shas been received and that we are waiting for the payment.
672 // Should send email template (EventOrganizationEmailRegistrationEvent) saved into conf EVENTORGANIZATION_TEMPLATE_EMAIL_REGISTRATION_EVENT.
673
674 // Now we redirect to the payment page
675 $sourcetouse = 'organizedeventregistration';
676 $reftouse = $facture->id;
677 $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.urlencode((string) ($sourcetouse)).'&ref='.urlencode((string) ($reftouse));
678 if (getDolGlobalString('PAYMENT_SECURITY_TOKEN')) {
679 $redirection .= '&securekey='.dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $sourcetouse . $reftouse, '2'); // Use the source in the hash to avoid duplicates if the references are identical
680 }
681
682 header("Location: ".$redirection);
683 exit;
684 } else {
685 $db->rollback();
686 }
687 } else {
688 // No price has been set. Validate the subscription before committing.
689 $resultsetstatus = $confattendee->setStatut(1);
690 if ($resultsetstatus < 0) {
691 $error++;
692 $errmsg .= $confattendee->error;
693 $errors = array_merge($errors, $confattendee->errors);
694 }
695
696 if (!$error) {
697 $db->commit();
698
699 // Sending mail
700 require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
701 include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
702 $formmail = new FormMail($db);
703 // Set output language
704 $outputlangs = new Translate('', $conf);
705 $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang);
706 // Load traductions files required by page
707 $outputlangs->loadLangs(array("main", "members", "eventorganization"));
708 // Get email content from template
709 $arraydefaultmessage = null;
710
711 $labeltouse = getDolGlobalInt('EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT');
712 if (!empty($labeltouse)) {
713 $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, '');
714 }
715
716 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
717 $subject = $arraydefaultmessage->topic;
718 $msg = $arraydefaultmessage->content;
719 } else {
720 $subject = '';
721 $msg = '';
722 }
723
724 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty);
725 complete_substitutions_array($substitutionarray, $outputlangs, $object);
726
727 $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
728 $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
729
730 $sendto = !empty($thirdparty->email) ? $thirdparty->email :
731 $confattendee->email;
732
733 $from = getDolGlobalString('MAILING_EMAIL_FROM');
734 $urlback = $_SERVER["REQUEST_URI"];
735
736 $ishtml = dol_textishtml($texttosend); // May contain urls
737
738 if (!empty($sendto)) {
739 $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, ($ishtml ? 1 : 0));
740 $result = $mailfile->sendfile();
741 if ($result) {
742 dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
743 } else {
744 dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
745 }
746 }
747
748 $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5');
749 $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl);
750
751 header("Location: ".$redirection);
752 exit;
753 } else {
754 $db->rollback();
755 }
756 }
757 //Header("Location: ".$urlback);
758 //exit;
759 } else {
760 $db->rollback();
761 }
762}
763
764
765/*
766 * View
767 */
768
769$form = new Form($db);
770$formcompany = new FormCompany($db);
771
772llxHeaderVierge($langs->trans("NewRegistration"));
773
774
775print '<div align="center">';
776print '<div id="divsubscribe">';
777
778// Sub banner
779print '<div class="center subscriptionformbanner subbanner justify margintoponly paddingtop marginbottomonly padingbottom">';
780print load_fiche_titre($langs->trans("NewRegistration"), '', '', 0, '', 'center');
781// Welcome message
782print '<span class="opacitymedium">'.$langs->trans("EvntOrgWelcomeMessage").'</span>';
783print '<br>';
784// Title
785print '<span class="eventlabel large">'.dolPrintHTML($project->title . ' '. $conference->label).'</span><br>';
786print '</div>';
787
788// Help text
789print '<div class="justify subscriptionformhelptext">';
790
791$eventdatestart = ($conference->id > 0 ? $conference->datep : $project->date_start_event);
792$eventdateend = ($conference->id > 0 ? $conference->datep2 : $project->date_end_event);
793$eventlocation = ($conference->id > 0 && !empty($conference->location) ? $conference->location : $project->location);
794
795if ($eventdatestart || $eventdateend) {
796 print '<br><span class="fa fa-calendar pictofixedwidth opacitymedium"></span>';
797}
798if ($eventdatestart) {
799 $format = 'day';
800 $tmparray = dol_getdate($eventdatestart, false, '');
801 if ($tmparray['hours'] || $tmparray['minutes'] || $tmparray['seconds']) {
802 $format = 'dayhour';
803 }
804 print dol_print_date($eventdatestart, $format);
805}
806if ($eventdatestart && $eventdateend) {
807 print ' - ';
808}
809if ($eventdateend) {
810 $format = 'day';
811 $tmparray = dol_getdate($eventdateend, false, '');
812 if ($tmparray['hours'] || $tmparray['minutes'] || $tmparray['seconds']) {
813 $format = 'dayhour';
814 }
815 print dol_print_date($eventdateend, $format);
816}
817if ($eventdatestart || $eventdateend) {
818 print '<br>';
819}
820if ($eventlocation) {
821 print '<span class="fa fa-map-marked-alt pictofixedwidth opacitymedium"></span>'.dolPrintHTML($eventlocation).'<br>';
822}
823if ($project->note_public) {
824 print '<br><span class="opacitymedium">'.dol_htmlentitiesbr($project->note_public).'</span><br>';
825}
826
827print '</div>';
828
829
830$maxattendees = 0;
831if ($conference->id > 0) {
832 $maxattendees = $conference->max_participants;
833} else {
834 $maxattendees = $project->max_attendees; // Max attendeed for the project/event
835}
836
837if ($maxattendees) {
838 print '<br>';
839 print '<div class="opacitymedium">'.$langs->trans("Attendees").': '.((int) $currentnbofattendees).' / '.((int) $maxattendees).'</div>';
840}
841
842if ($maxattendees && $currentnbofattendees >= $maxattendees) {
843 print '<br>';
844 print '<div class="warning">'.$langs->trans("MaxNbOfAttendeesReached").'</div>';
845 print '<br>';
846}
847
848
849
850dol_htmloutput_errors($errmsg, $errors);
851
852if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS_CONFIRMED) || (!empty($project->id) && $project->status == Project::STATUS_VALIDATED)) {
853 if (empty($maxattendees) ||
854 ($currentnbofattendees < $maxattendees &&
855 (!getDolGlobalString('EVENTORGANIZATION_ALLOW_REGISTRATION_WHEN_MAX_REACHED') || (getDolGlobalString('EVENTORGANIZATION_ALLOW_REGISTRATION_WHEN_MAX_REACHED') == GETPOST('EVENTORGANIZATION_ALLOW_REGISTRATION_WHEN_MAX_REACHED')))
856 )) {
857 // Print form
858 print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="newmember">' . "\n";
859 print '<input type="hidden" name="token" value="' . newToken() . '" / >';
860 print '<input type="hidden" name="entity" value="' . $entity . '" />';
861 print '<input type="hidden" name="action" value="add" />';
862 print '<input type="hidden" name="type" value="' . $type . '" />';
863 print '<input type="hidden" name="id" value="' . $conference->id . '" />';
864 print '<input type="hidden" name="fk_project" value="' . $project->id . '" />';
865 print '<input type="hidden" name="securekey" value="' . $securekeyreceived . '" />';
866 if (GETPOST('EVENTORGANIZATION_ALLOW_REGISTRATION_WHEN_MAX_REACHED')) {
867 print '<input type="hidden" name="EVENTORGANIZATION_ALLOW_REGISTRATION_WHEN_MAX_REACHED" value="' . GETPOST('EVENTORGANIZATION_ALLOW_REGISTRATION_WHEN_MAX_REACHED') . '" />';
868 }
869
870 print '<br>';
871 print '<br>';
872 //print '<span class="opacitymedium">' . $langs->trans("FieldsWithAreMandatory", '*') . '</span><br>';
873 //print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
874
875 print dol_get_fiche_head();
876
877 print '<script type="text/javascript">
878 jQuery(document).ready(function () {
879 jQuery(document).ready(function () {
880 jQuery("#selectcountry_id").change(function() {
881 document.newmember.action.value="create";
882 document.newmember.submit();
883 });
884 });
885 });
886 </script>';
887
888 print '<table class="border" summary="form to subscribe" id="tablesubscribe">' . "\n";
889
890 // Firstname
891 print '<tr><td><span class="fieldrequired">';
892 print $langs->trans("Firstname") . '</span></td><td>';
893 print img_picto('', 'user', 'class="pictofixedwidth"');
894 print '<input type="text" name="firstname" maxlength="255" class="minwidth200 widthcentpercentminusx maxwidth300" value="' . dol_escape_htmltag($firstname) . '" required autofocus></td></tr>' . "\n";
895
896 // Lastname
897 print '<tr><td><span class="fieldrequired">';
898 print $langs->trans("Lastname") . '</span></td><td>';
899 print img_picto('', 'user', 'class="pictofixedwidth"');
900 print '<input type="text" name="lastname" maxlength="255" class="minwidth200 widthcentpercentminusx maxwidth300" value="' . dol_escape_htmltag($lastname) . '" required></td></tr>' . "\n";
901
902 // Email
903 print '<tr><td><span class="fieldrequired">' . $langs->trans("EmailAttendee") . '</span></td><td>';
904 print img_picto('', 'email', 'class="pictofixedwidth"');
905 print '<input type="text" name="email" maxlength="255" class="minwidth200 widthcentpercentminusx maxwidth300" value="' . dol_escape_htmltag(GETPOST('email')) . '" required></td></tr>' . "\n";
906
907 // Company
908 print '<tr id="trcompany" class="trcompany"><td>';
909 if (!empty((float) $project->price_registration)) {
910 print '<span class="fieldrequired">';
911 }
912 print $langs->trans("Company");
913 if (!empty((float) $project->price_registration)) {
914 print '</span>';
915 }
916 print '</td><td>';
917 print img_picto('', 'company', 'class="pictofixedwidth"');
918 print '<input type="text" name="societe" class="minwidth200 widthcentpercentminusx maxwidth300" value="' . dol_escape_htmltag(GETPOST('societe')) . '"'.(empty((float) $project->price_registration) ? '' : ' required').'></td></tr>' . "\n";
919
920 // Email company for invoice
921 if (!empty((float) $project->price_registration)) {
922 print '<tr><td>' . $form->textwithpicto($langs->trans("EmailCompany"), $langs->trans("EmailCompanyForInvoice")) . '</td><td>';
923 print img_picto('', 'email', 'class="pictofixedwidth"');
924 print '<input type="text" name="emailcompany" maxlength="255" class="minwidth200 widthcentpercentminusx maxwidth300" value="' . dol_escape_htmltag(GETPOST('emailcompany')) . '"></td></tr>' . "\n";
925 }
926
927 // Address
928 print '<tr><td>' . $langs->trans("Address") . '</td><td>' . "\n";
929 print '<textarea name="address" id="address" wrap="soft" class="centpercent" rows="' . ROWS_2 . '">' . dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1) . '</textarea></td></tr>' . "\n";
930
931 // Zip / Town
932 print '<tr><td>' . $langs->trans('Zip') . ' / ' . $langs->trans('Town') . '</td><td>';
933 print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1);
934 print ' / ';
935 print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1);
936 print '</td></tr>';
937
938 // Country
939 print '<tr><td><span class="fieldrequired">'.$langs->trans('Country').'</span></td><td>';
940 print img_picto('', 'country', 'class="pictofixedwidth"');
941 $country_id = GETPOST('country_id');
942 if (!$country_id && getDolGlobalString('MEMBER_NEWFORM_FORCECOUNTRYCODE')) {
943 $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, '2', $db, $langs);
944 }
945 if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
946 $country_code = dol_user_country();
947 //print $country_code;
948 if ($country_code) {
949 $new_country_id = getCountry($country_code, '3', $db, $langs);
950 //print 'xxx'.$country_code.' - '.$new_country_id;
951 if ($new_country_id) {
952 $country_id = $new_country_id;
953 }
954 }
955 }
956 $country_code = getCountry($country_id, '2', $db, $langs);
957 print $form->select_country($country_id, 'country_id', '', 0, 'minwidth200 widthcentpercentminusx maxwidth300');
958 print '</td></tr>';
959 // State
960 if (!getDolGlobalString('SOCIETE_DISABLE_STATE')) {
961 print '<tr><td>' . $langs->trans('State') . '</td><td>';
962 if ($country_code) {
963 print img_picto('', 'state', 'class="pictofixedwidth"');
964 print $formcompany->select_state(GETPOSTINT("state_id"), $country_code);
965 } else {
966 print '';
967 }
968 print '</td></tr>';
969 }
970
971 if (!empty((float) $project->price_registration)) {
972 print '<tr><td>' . $langs->trans('Price') . '</td><td>';
973 print '<span class="amount price-registration">'.price($project->price_registration, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
974 print '</td></tr>';
975 }
976
977 // Other attributes
978 $parameters['tpl_context'] = 'public'; // define template context to public
979 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
980
981 $notetoshow = $note_public;
982 print '<tr><td>' . $langs->trans('Note') . '</td><td>';
983 if (getDolGlobalString('EVENTORGANIZATION_DEFAULT_NOTE_ON_REGISTRATION')) {
984 $notetoshow = str_replace('\n', "\n", getDolGlobalString('EVENTORGANIZATION_DEFAULT_NOTE_ON_REGISTRATION'));
985 }
986 print '<textarea name="note_public" class="centpercent" rows="'.ROWS_9.'">'.dol_escape_htmltag($notetoshow, 0, 1).'</textarea>';
987 print '</td></tr>';
988
989
990
991 print "</table>\n";
992
993 print dol_get_fiche_end();
994
995 // Save
996 print '<div class="center">';
997 print '<input type="submit" value="' . $langs->trans("Submit") . '" id="submitsave" class="button">';
998 if (!empty($backtopage)) {
999 print ' &nbsp; &nbsp; <input type="submit" value="' . $langs->trans("Cancel") . '" id="submitcancel" class="button button-cancel">';
1000 }
1001 print '</div>';
1002
1003 print "</form>\n";
1004
1005 print "<br>";
1006 }
1007} else {
1008 print '<br><br>';
1009 if ($project->status == $project::STATUS_DRAFT) {
1010 print $langs->trans("ConferenceIsNotConfirmed");
1011 } else {
1012 print $langs->trans("EventRegistrationAreClosed");
1013 }
1014 print '<br><br>';
1015}
1016
1017print '</div></div>';
1018
1020
1021$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
global $dolibarr_main_url_root
llxHeaderVierge($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs=[], $arrayofcss=[], $ws='')
Show header for new member.
llxFooterVierge()
Show footer for new member.
Class to send emails (with attachments or not) Usage: $mailfile = new CMailFile($subject,...
Class for ConferenceOrBoothAttendee.
Class for ConferenceOrBooth.
Class to manage contact/addresses.
Class to manage standard extra fields.
Class to manage invoices.
const STATUS_DRAFT
Draft status.
const TYPE_STANDARD
Standard invoice.
Class to build HTML component for third parties management Only common components are here.
Class to manage generation of HTML components Only common components must be here.
Class to manage a HTML form to send a unitary email Usage: $formail = new FormMail($db) $formmail->pr...
Class to manage payment terms records in dictionary.
Class to manage products or services.
Class to manage projects.
const STATUS_VALIDATED
Open/Validated status.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage translations.
if(! $sortfield) if(! $sortorder) $module
Definition list.php:193
getCountry($searchkey, $withcode='', $dbtouse=null, $outputlangs=null, $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
global $mysoc
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
Definition date.lib.php:126
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
$date_start
Variables from include:
dol_now($mode='gmt')
Return date for now.
dol_user_country()
Return country code for current user.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the "subst...
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
dol_textishtml($msg, $option=0)
Return if a text is a html content.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
getUserRemoteIP($trusted=0)
Return the real IP of remote user.
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod=0, $idprodfournprice=0)
Function that return vat rate of a product line (according to seller, buyer and product vat rate) VAT...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
Definition html.lib.php:540
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition html.lib.php:738
printCommonFooter($zone='private')
Print common footer : conf->global->MAIN_HTML_FOOTER js for switch of menu hider js for conf->global-...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
dol_htmloutput_errors($mesgstring='', $mesgarray=array(), $keepembedded=0)
Print formatted error messages to output (Used to show messages on html output).
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Definition html.lib.php:181
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Output html header of a page.
httponly_accessforbidden($message='1', $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.
dol_hash($chain, $type='0', $nosalt=0, $mode=0)
Returns a hash (non reversible encryption) of a string.