dolibarr 24.0.0-beta
suggestconference.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2021 Dorian Vabre <dorian.vabre@gmail.com>
3 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
4 * Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
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
26if (!defined('NOLOGIN')) {
27 define("NOLOGIN", 1); // This means this output page does not require to be logged.
28}
29if (!defined('NOCSRFCHECK')) {
30 define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
31}
32if (!defined('NOIPCHECK')) {
33 define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
34}
35if (!defined('NOBROWSERNOTIF')) {
36 define('NOBROWSERNOTIF', '1');
37}
38
39
40// For MultiCompany module.
41// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
42// Because 2 entities can have the same ref.
43$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
44if (is_numeric($entity)) {
45 define("DOLENTITY", $entity);
46}
47
48// Load Dolibarr environment
49require '../../main.inc.php';
50require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
51require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php';
52require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
53require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
54require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
55require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
56require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php';
57require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
58require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
59
61
71// Init vars
72$errmsg = '';
73$num = 0;
74$error = 0;
75$backtopage = GETPOST('backtopage', 'alpha');
76$action = GETPOST('action', 'aZ09');
77
78$eventtype = GETPOSTINT("eventtype");
79$email = GETPOST("email");
80$societe = GETPOST("societe");
81$label = GETPOST("label");
82$note = GETPOST("note");
83$datestart = dol_mktime(0, 0, 0, GETPOSTINT('datestartmonth'), GETPOSTINT('datestartday'), GETPOSTINT('datestartyear'));
84$dateend = dol_mktime(23, 59, 59, GETPOSTINT('dateendmonth'), GETPOSTINT('dateendday'), GETPOSTINT('dateendyear'));
85
86$id = GETPOST('id');
87
88$project = new Project($db);
89$resultproject = $project->fetch((int) $id);
90if ($resultproject < 0) {
91 $error++;
92 $errmsg .= $project->error;
93}
94
95// Security check
96$securekeyreceived = GETPOST('securekey', 'alpha');
97$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5');
98
99if ($securekeytocompare != $securekeyreceived) {
100 print $langs->trans('MissingOrBadSecureKey');
101 exit;
102}
103
104// Load translation files
105$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization"));
106
107// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
108$hookmanager->initHooks(array('publicnewmembercard', 'globalcard'));
109
110$user->loadDefaultValues();
111
112$cactioncomm = new CActionComm($db);
113$arrayofconfboothtype = $cactioncomm->liste_array('', 'id', '', 0, "module:=:'conference@eventorganization'");
114if ($arrayofconfboothtype == -1) {
115 $arrayofconfboothtype = [];
116}
117
118// Security check
119if (!isModEnabled('eventorganization')) {
120 httponly_accessforbidden('Module Event organization not enabled');
121}
122
123
138function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = [], $ws = '') // @phan-suppress-current-line PhanRedefineFunction
139{
140 global $conf, $langs, $mysoc;
141
142 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
143
144 print '<body id="mainbody" class="publicnewmemberform">';
145
146 // Define urllogo
147 $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png';
148
149 if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
150 $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_small);
151 } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
152 $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/'.$mysoc->logo);
153 } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
154 $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
155 }
156
157 print '<div class="center">';
158
159 // Output html code for logo
160 if ($urllogo) {
161 print '<div class="backgreypublicpayment">';
162 print '<div class="logopublicpayment">';
163 print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
164 print '>';
165 print '</div>';
166 if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) {
167 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>';
168 }
169 print '</div>';
170 }
171
172 if (getDolGlobalString('PROJECT_IMAGE_PUBLIC_SUGGEST_CONFERENCE')) {
173 print '<div class="backimagepublicsuggestconference">';
174 print '<img id="idPROJECT_IMAGE_PUBLIC_SUGGEST_CONFERENCE" src="' . getDolGlobalString('PROJECT_IMAGE_PUBLIC_SUGGEST_CONFERENCE').'">';
175 print '</div>';
176 }
177
178 print '</div>';
179
180 print '<div class="divmainbodylarge">';
181}
182
190function llxFooterVierge() // @phan-suppress-current-line PhanRedefineFunction
191{
192 print '</div>';
193
194 printCommonFooter('public');
195
196 print "</body>\n";
197 print "</html>\n";
198}
199
200
201
202/*
203 * Actions
204 */
205
206$parameters = array();
207// Note that $action and $object may have been modified by some hooks
208$reshook = $hookmanager->executeHooks('doActions', $parameters, $project, $action);
209if ($reshook < 0) {
210 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
211}
212
213// Action called when page is submitted
214if (empty($reshook) && $action == 'add') { // Test on permission not required here. This is an anonymous public ssubmission. Check is done on the secureket + mitigation.
215 $error = 0;
216 $errors = [];
217
218 $urlback = '';
219
220 $db->begin();
221
222 if (!GETPOST("lastname")) {
223 $error++;
224 $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."<br>\n";
225 }
226 if (!GETPOST("firstname")) {
227 $error++;
228 $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."<br>\n";
229 }
230 if (!GETPOST("email")) {
231 $error++;
232 $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\n";
233 }
234 if (!GETPOST("societe")) {
235 $error++;
236 $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdParty"))."<br>\n";
237 }
238 if (!GETPOST("label")) {
239 $error++;
240 $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."<br>\n";
241 }
242 if (!GETPOST("note")) {
243 $error++;
244 $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."<br>\n";
245 }
246 if (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
247 $error++;
248 $langs->load("errors");
249 $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."<br>\n";
250 }
251
252 if (!$error) {
253 // Getting the thirdparty or creating it
254 $thirdparty = new Societe($db);
255 $resultfetchthirdparty = $thirdparty->fetch(0, $societe);
256
257 if ($resultfetchthirdparty < 0) {
258 // If an error was found
259 $error++;
260 $errmsg .= $thirdparty->error;
261 $errors = array_merge($errors, $thirdparty->errors);
262 } elseif ($resultfetchthirdparty == 0) { // No thirdparty found + a payment is expected
263 // Creation of a new thirdparty
264 $genericcompanyname = 'Unknown company';
265
266 if (!empty($societe)) {
267 $thirdparty->name = $societe;
268 } else {
269 $thirdparty->name = $genericcompanyname;
270 }
271 $thirdparty->address = GETPOST("address");
272 $thirdparty->zip = GETPOST("zipcode");
273 $thirdparty->town = GETPOST("town");
274 $thirdparty->client = $thirdparty::PROSPECT;
275 $thirdparty->fournisseur = 0;
276 $thirdparty->country_id = GETPOSTINT("country_id");
277 $thirdparty->state_id = GETPOSTINT("state_id");
278 $thirdparty->email = ($emailcompany ? $emailcompany : $email);
279
280 // Load object modCodeTiers
281 $module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
282 if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
283 $module = substr($module, 0, dol_strlen($module) - 4);
284 }
285 $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']);
286 foreach ($dirsociete as $dirroot) {
287 $res = dol_include_once($dirroot.$module.'.php');
288 if ($res) {
289 break;
290 }
291 }
292 $modCodeClient = new $module($db);
293 '@phan-var-force ModeleThirdPartyCode $modCodeClient';
296 if (empty($tmpcode) && !empty($modCodeClient->code_auto)) {
297 $tmpcode = $modCodeClient->getNextValue($thirdparty, 0);
298 }
299 $thirdparty->code_client = $tmpcode;
300 $readythirdparty = $thirdparty->create($user);
301 if ($readythirdparty < 0) {
302 $error++;
303 $errmsg .= $thirdparty->error;
304 $errors = array_merge($errors, $thirdparty->errors);
305 } else {
306 $thirdparty->country_code = getCountry($thirdparty->country_id, '2', $db, $langs);
307 $thirdparty->country = getCountry($thirdparty->country_code, '', $db, $langs);
308 }
309 }
310 // From there we have a thirdparty, now looking for the contact
311 $contact = null;
312 if (!$error) {
313 $contact = new Contact($db);
314 $resultcontact = $contact->fetch(0, null, '', $email);
315 if ($resultcontact <= 0) {
316 // Need to create a contact
317 $contact->socid = $thirdparty->id;
318 $contact->lastname = (string) GETPOST("lastname", 'alpha');
319 $contact->firstname = (string) GETPOST("firstname", 'alpha');
320 $contact->address = (string) GETPOST("address", 'alpha');
321 $contact->zip = (string) GETPOST("zipcode", 'alpha');
322 $contact->town = (string) GETPOST("town", 'alpha');
323 $contact->country_id = GETPOSTINT("country_id");
324 $contact->state_id = GETPOSTINT("state_id");
325 $contact->email = $email;
326 $contact->status = 1; //Default status to Actif
327 $contact->statut = 1; //Default status to Actif
328 $resultcreatecontact = $contact->create($user);
329 if ($resultcreatecontact < 0) {
330 $error++;
331 $errmsg .= $contact->error;
332 }
333 }
334 }
335
336 if (!$error) {
337 // Adding supplier tag and tag from setup to thirdparty
338 $category = new Categorie($db);
339
340 $resultcategory = $category->fetch(getDolGlobalInt('EVENTORGANIZATION_CATEG_THIRDPARTY_CONF'));
341
342 if ($resultcategory <= 0) {
343 $error++;
344 $errmsg .= $category->error;
345 } else {
346 $resultsetcategory = $thirdparty->setCategoriesCommon(array($category->id), Categorie::TYPE_CUSTOMER, false);
347 if ($resultsetcategory < 0) {
348 $error++;
349 $errmsg .= $thirdparty->error;
350 } else {
351 $thirdparty->fournisseur = 1;
352
353 // Load object modCodeFournisseur
354 $module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
355 if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
356 $module = substr($module, 0, dol_strlen($module) - 4);
357 }
358 $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']);
359 foreach ($dirsociete as $dirroot) {
360 $res = dol_include_once($dirroot.$module.'.php');
361 if ($res) {
362 break;
363 }
364 }
365 $modCodeFournisseur = new $module($db);
366 '@phan-var-force ModeleThirdPartyCode $modCodeFournisseur';
369 if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) {
370 $tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 1);
371 }
372 $thirdparty->code_fournisseur = $tmpcode;
373
374 $res = $thirdparty->update(0, $user, 1, 1, 1);
375
376 if ($res <= 0) {
377 $error++;
378 }
379 }
380 }
381 }
382
383 if (!$error && !is_null($contact)) {
384 // We have the contact and the thirdparty
385 $conforbooth = new ConferenceOrBooth($db);
386 $conforbooth->label = $label;
387 $conforbooth->fk_soc = $thirdparty->id;
388 $conforbooth->fk_project = $project->id;
389 $conforbooth->note = $note;
390 $conforbooth->fk_action = $eventtype;
391 $conforbooth->datep = $datestart;
392 $conforbooth->datep2 = $dateend;
393 $conforbooth->datec = dol_now();
394 $conforbooth->tms = dol_now();
395 $conforbooth->firstname = $contact->firstname;
396 $conforbooth->lastname = $contact->lastname;
397 $conforbooth->ip = getUserRemoteIP();
398
399 $nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
400 $now = dol_now();
401 $minmonthpost = dol_time_plus_duree($now, -1, "m");
402
403 // Calculate nb of post for IP
404 $nb_post_ip = 0;
405 if ($nb_post_max > 0) { // Calculate only if there is a limit to check
406 $sql = "SELECT COUNT(ref) as nb_confs";
407 $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm";
408 $sql .= " WHERE ip = '".$db->escape($conforbooth->ip)."'";
409 $sql .= " AND datec > '".$db->idate($minmonthpost)."'";
410 $resql = $db->query($sql);
411 if ($resql) {
412 $num = $db->num_rows($resql);
413 $i = 0;
414 while ($i < $num) {
415 $i++;
416 $obj = $db->fetch_object($resql);
417 $nb_post_ip = $obj->nb_confs;
418 }
419 }
420 }
421
422 $resultconforbooth = 0;
423
424 if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
425 $error++;
426 $errmsg .= $langs->trans("AlreadyTooMuchPostOnThisIPAdress");
427 array_push($conforbooth->errors, $langs->trans("AlreadyTooMuchPostOnThisIPAdress"));
428 setEventMessage($errmsg, 'errors');
429 } else {
430 $resultconforbooth = $conforbooth->create($user);
431 }
432 if ($resultconforbooth <= 0) {
433 $error++;
434 $errmsg .= $conforbooth->error;
435 } else {
436 // Adding the contact to the project
437 $resultaddcontact = $conforbooth->add_contact($contact->id, 'SPEAKER');
438 if ($resultaddcontact < 0) {
439 $error++;
440 $errmsg .= $conforbooth->error;
441 } else {
442 $conforbooth->status = ConferenceOrBooth::STATUS_SUGGESTED;
443 $conforbooth->update($user);
444
445 // Sending mail
446 require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
447 include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
448 $formmail = new FormMail($db);
449 // Set output language
450 $outputlangs = new Translate('', $conf);
451 $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang);
452 // Load traductions files required by page
453 $outputlangs->loadLangs(array("main", "members", "eventorganization"));
454 // Get email content from template
455 $arraydefaultmessage = null;
456
457 $labeltouse = getDolGlobalInt('EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF');
458 if (!empty($labeltouse)) {
459 $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, '');
460 }
461
462 $subject = '';
463 $msg = '';
464 if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
465 $subject = $arraydefaultmessage->topic;
466 $msg = $arraydefaultmessage->content;
467 }
468
469 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty);
470 complete_substitutions_array($substitutionarray, $outputlangs, $project);
471
472 $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
473 $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
474
475 $sendto = $thirdparty->email;
476 $from = getDolGlobalString('MAILING_EMAIL_FROM');
477 $urlback = $_SERVER["REQUEST_URI"];
478 $trackid = 'proj'.$project->id;
479
480 $ishtml = dol_textishtml($texttosend); // May contain urls
481
482 $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml ? 1 : 0, '', '', $trackid);
483
484 $result = $mailfile->sendfile();
485 if ($result) {
486 dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
487 } else {
488 dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
489 }
490 }
491 }
492 }
493 }
494
495 if (!$error) {
496 $db->commit();
497 $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5');
498 $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl);
499 header("Location: ".$redirection);
500 exit;
501 } else {
502 $db->rollback();
503 }
504}
505
506
507/*
508 * View
509 */
510
511$form = new Form($db);
512$formcompany = new FormCompany($db);
513
514llxHeaderVierge($langs->trans("NewSuggestionOfConference"));
515
516
517print '<div align="center">';
518print '<div id="divsubscribe">';
519
520print '<br>';
521
522// Sub banner
523print '<div class="center subscriptionformbanner subbanner justify margintoponly paddingtop marginbottomonly padingbottom">';
524print load_fiche_titre($langs->trans("NewSuggestionOfConference"), '', '', 0, '', 'center');
525// Welcome message
526print '<br>';
527print '<span class="opacitymedium">'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'</span>';
528print '<br>';
529// Title
530print '<span class="eventlabel large">'.dol_escape_htmltag($project->title . ' '. $project->label).'</span><br>';
531print '</div>';
532
533// Help text
534print '<div class="justify subscriptionformhelptext">';
535
536if ($project->date_start_event || $project->date_end_event) {
537 print '<br><span class="fa fa-calendar pictofixedwidth opacitymedium"></span>';
538}
539if ($project->date_start_event) {
540 $format = 'day';
541 $tmparray = dol_getdate($project->date_start_event, false, '');
542 if ($tmparray['hours'] || $tmparray['minutes'] || $tmparray['minutes']) {
543 $format = 'dayhour';
544 }
545 print dol_print_date($project->date_start_event, $format);
546}
547if ($project->date_start_event && $project->date_end_event) {
548 print ' - ';
549}
550if ($project->date_end_event) {
551 $format = 'day';
552 $tmparray = dol_getdate($project->date_end_event, false, '');
553 if ($tmparray['hours'] || $tmparray['minutes'] || $tmparray['minutes']) {
554 $format = 'dayhour';
555 }
556 print dol_print_date($project->date_end_event, $format);
557}
558if ($project->date_start_event || $project->date_end_event) {
559 print '<br>';
560}
561if ($project->location) {
562 print '<span class="fa fa-map-marked-alt pictofixedwidth opacitymedium"></span>'.dol_escape_htmltag($project->location).'<br>';
563}
564if ($project->note_public) {
565 print '<br><!-- note public --><span class="opacitymedium">'.dol_htmlentitiesbr($project->note_public).'</span><br>';
566}
567
568print '</div>';
569
570print '<br>';
571
572
573dol_htmloutput_errors($errmsg, $errors);
574
575// Print form
576print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="newmember">'."\n";
577print '<input type="hidden" name="token" value="'.newToken().'" / >';
578print '<input type="hidden" name="entity" value="'.$entity.'" />';
579print '<input type="hidden" name="action" value="add" />';
580print '<input type="hidden" name="id" value="'.$id.'" />';
581print '<input type="hidden" name="securekey" value="'.$securekeyreceived.'" />';
582
583//print '<br><span class="opacitymedium small">'.$langs->trans("FieldsWithAreMandatory", '*').'</span><br>';
584//print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
585
586print dol_get_fiche_head();
587
588print '<script type="text/javascript">
589jQuery(document).ready(function () {
590 jQuery(document).ready(function () {
591 jQuery("#selectcountry_id").change(function() {
592 document.newmember.action.value="create";
593 document.newmember.submit();
594 });
595 });
596});
597</script>';
598
599print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."\n";
600
601// Last Name
602print '<tr><td><label for="lastname">'.$langs->trans("Lastname").'<span class="star" title="'.dolPrintHTMLForAttribute("Mandatory").'">*</span></label></td>';
603print '<td colspan="3"><input name="lastname" id="lastname" type="text" class="maxwidth100onsmartphone" maxlength="80" value="'.dol_escape_htmltag(GETPOST("lastname", 'alpha') ? GETPOST("lastname", 'alpha') : $object->lastname).'" autofocus="autofocus"></td>';
604print '</tr>';
605// First Name
606print '<tr><td><label for="firstname">'.$langs->trans("Firstname").'<span class="star" title="'.dolPrintHTMLForAttribute("Mandatory").'">*</span></label></td>';
607print '<td colspan="3"><input name="firstname" id="firstname" type="text" class="maxwidth100onsmartphone" maxlength="80" value="'.dol_escape_htmltag(GETPOST("firstname", 'alpha') ? GETPOST("firstname", 'alpha') : $object->firstname).'" autofocus="autofocus"></td>';
608print '</tr>';
609// Email
610print '<tr><td>'.$langs->trans("Email").'<span class="star" title="'.dolPrintHTMLForAttribute("Mandatory").'">*</span></td><td><input type="text" name="email" maxlength="255" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n";
611// Company
612print '<tr id="trcompany" class="trcompany"><td>'.$langs->trans("Company").'<span class="star" title="'.dolPrintHTMLForAttribute("Mandatory").'">*</span>';
613print ' </td><td><input type="text" name="societe" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('societe')).'"></td></tr>'."\n";
614// Address
615print '<tr><td>'.$langs->trans("Address").'</td><td>'."\n";
616print '<textarea name="address" id="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1).'</textarea></td></tr>'."\n";
617// Zip / Town
618print '<tr><td>'.$langs->trans('Zip').' / '.$langs->trans('Town').'</td><td>';
619print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1);
620print ' / ';
621print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1);
622print '</td></tr>';
623// Country
624print '<tr><td>'.$langs->trans('Country').'</td><td>';
625$country_id = GETPOST('country_id');
626if (!$country_id && getDolGlobalString('MEMBER_NEWFORM_FORCECOUNTRYCODE')) {
627 $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, '2', $db, $langs);
628}
629if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
630 $country_code = dol_user_country();
631 //print $country_code;
632 if ($country_code) {
633 $new_country_id = getCountry($country_code, '3', $db, $langs);
634 //print 'xxx'.$country_code.' - '.$new_country_id;
635 if ($new_country_id) {
636 $country_id = $new_country_id;
637 }
638 }
639}
640$country_code = getCountry($country_id, '2', $db, $langs);
641print $form->select_country($country_id, 'country_id');
642print '</td></tr>';
643// State
644if (!getDolGlobalString('SOCIETE_DISABLE_STATE')) {
645 print '<tr><td>'.$langs->trans('State').'</td><td>';
646 if ($country_code) {
647 print $formcompany->select_state(GETPOSTINT("state_id"), $country_code);
648 } else {
649 print '';
650 }
651 print '</td></tr>';
652}
653// Type of event
654print '<tr><td>'.$langs->trans("Format").'<span class="star" title="'.dolPrintHTMLForAttribute("Mandatory").'">*</span></td>'."\n";
655print '<td>'.Form::selectarray('eventtype', $arrayofconfboothtype, $eventtype, 1).'</td>';
656// Label
657print '<tr><td>'.$langs->trans("LabelOfconference").'<span class="star" title="'.dolPrintHTMLForAttribute("Mandatory").'">*</span></td>'."\n";
658print '</td><td><input type="text" name="label" class="minwidth300" value="'.dol_escape_htmltag(GETPOST('label')).'"></td></tr>'."\n";
659// Note
660print '<tr><td>'.$langs->trans("Description").'<span class="star" title="'.dolPrintHTMLForAttribute("Mandatory").'">*</span></td>'."\n";
661print '<td><textarea name="note" id="note" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_4.'">'.dol_escape_htmltag(GETPOST('note', 'restricthtml'), 0, 1).'</textarea></td></tr>'."\n";
662
663print "</table>\n";
664
665print dol_get_fiche_end();
666
667
668// Show all action buttons
669print '<div class="center">';
670print '<br>';
671print '<input type="submit" value="'.$langs->trans("SuggestConference").'" name="suggestconference" id="suggestconference" class="button">';
672print '<br><br>';
673
674
675
676
677print "</form>\n";
678print "<br>";
679print '</div></div>';
680
681
683
684$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
llxFooterVierge()
Footer function.
Class to manage different types of events.
Class to send emails (with attachments or not) Usage: $mailfile = new CMailFile($subject,...
Class to manage categories.
Class for ConferenceOrBooth.
Class to manage contact/addresses.
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 projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage translations.
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:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
dol_user_country()
Return country code for current user.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0, $attop=0)
Set event message in dol_events session object.
printCommonFooter($zone='private')
Print common footer : conf->global->MAIN_HTML_FOOTER js for switch of menu hider js for conf->global-...
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.
dolPrintHTMLForAttribute($s, $escapeonlyhtmltags=0, $allowothertags=array())
Return a string ready to be output into an HTML attribute (alt, title, data-html, ....
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_htmloutput_errors($mesgstring='', $mesgarray=array(), $keepembedded=0)
Print formatted error messages to output (Used to show messages on html output).
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_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
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.
if($arrayofconfboothtype==-1) if(!isModEnabled( 'eventorganization')) llxHeaderVierge($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs=[], $arrayofcss=[], $ws='')
Show header for new member.