dolibarr  16.0.5
new.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2001-2002 Jean-Louis Bergamo <jlb@j1b.org>
4  * Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
5  * Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
6  * Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
7  * Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
8  * Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <https://www.gnu.org/licenses/>.
22  */
23 
30 if (!defined('NOLOGIN')) {
31  define("NOLOGIN", 1); // This means this output page does not require to be logged.
32 }
33 if (!defined('NOCSRFCHECK')) {
34  define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
35 }
36 if (!defined('NOIPCHECK')) {
37  define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
38 }
39 if (!defined('NOBROWSERNOTIF')) {
40  define('NOBROWSERNOTIF', '1');
41 }
42 if (!defined('NOIPCHECK')) {
43  define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
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));
49 if (is_numeric($entity)) {
50  define("DOLENTITY", $entity);
51 }
52 
53 require '../../main.inc.php';
54 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
55 require_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
56 require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
57 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
58 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
59 
60 // Init vars
61 $errmsg = '';
62 $error = 0;
63 $backtopage = GETPOST('backtopage', 'alpha');
64 $action = GETPOST('action', 'aZ09');
65 
66 // Load translation files
67 $langs->loadLangs(array("members", "companies", "install", "other", "projects"));
68 
69 if (empty($conf->global->PROJECT_ENABLE_PUBLIC)) {
70  print $langs->trans("Form for public lead registration has not been enabled");
71  exit;
72 }
73 
74 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
75 $hookmanager->initHooks(array('publicnewleadcard', 'globalcard'));
76 
77 $extrafields = new ExtraFields($db);
78 
79 $object = new Project($db);
80 
81 $user->loadDefaultValues();
82 
83 // Security check
84 if (empty($conf->project->enabled)) {
85  accessforbidden('', 0, 0, 1);
86 }
87 
88 
100 function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '')
101 {
102  global $user, $conf, $langs, $mysoc;
103 
104  top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
105 
106  print '<body id="mainbody" class="publicnewmemberform">';
107 
108  // Define urllogo
109  $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png';
110 
111  if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
112  $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_small);
113  } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
114  $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/'.$mysoc->logo);
115  } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
116  $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
117  }
118 
119  print '<div class="center">';
120 
121  // Output html code for logo
122  if ($urllogo) {
123  print '<div class="backgreypublicpayment">';
124  print '<div class="logopublicpayment">';
125  print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
126  print '>';
127  print '</div>';
128  if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
129  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>';
130  }
131  print '</div>';
132  }
133 
134  if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_NEWLEAD)) {
135  print '<div class="backimagepublicnewlead">';
136  print '<img id="idPROJECT_IMAGE_PUBLIC_NEWLEAD" src="'.$conf->global->PROJECT_IMAGE_PUBLIC_NEWLEAD.'">';
137  print '</div>';
138  }
139 
140  print '</div>';
141 
142  print '<div class="divmainbodylarge">';
143 }
144 
150 function llxFooterVierge()
151 {
152  print '</div>';
153 
154  printCommonFooter('public');
155 
156  print "</body>\n";
157  print "</html>\n";
158 }
159 
160 
161 
162 /*
163  * Actions
164  */
165 
166 $parameters = array();
167 // Note that $action and $object may have been modified by some hooks
168 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
169 if ($reshook < 0) {
170  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
171 }
172 
173 // Action called when page is submitted
174 if (empty($reshook) && $action == 'add') {
175  $error = 0;
176  $urlback = '';
177 
178  $db->begin();
179 
180  if (!GETPOST("lastname")) {
181  $error++;
182  $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."<br>\n";
183  }
184  if (!GETPOST("firstname")) {
185  $error++;
186  $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."<br>\n";
187  }
188  if (!GETPOST("email")) {
189  $error++;
190  $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\n";
191  }
192  if (!GETPOST("description")) {
193  $error++;
194  $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Message"))."<br>\n";
195  }
196  if (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
197  $error++;
198  $langs->load("errors");
199  $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."<br>\n";
200  }
201  // Set default opportunity status
202  $defaultoppstatus = getDolGlobalString('PROJECT_DEFAULT_OPPORTUNITY_STATUS_FOR_ONLINE_LEAD');
203  if (empty($defaultoppstatus)) {
204  $error++;
205  $langs->load("errors");
206  $errmsg .= $langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Project"))."<br>\n";
207  }
208 
209  $proj = new Project($db);
210  $thirdparty = new Societe($db);
211 
212  if (!$error) {
213  // Search thirdparty and set it if found to the new created project
214  $result = $thirdparty->fetch(0, '', '', '', '', '', '', '', '', '', $object->email);
215  if ($result > 0) {
216  $proj->socid = $thirdparty->id;
217  } else {
218  // Create the prospect
219  if (GETPOST('societe')) {
220  $thirdparty->name = GETPOST('societe');
221  $thirdparty->name_alias = dolGetFirstLastname(GETPOST('firstname'), GETPOST('lastname'));
222  } else {
223  $thirdparty->name = dolGetFirstLastname(GETPOST('firstname'), GETPOST('lastname'));
224  }
225  $thirdparty->address = GETPOST('address');
226  $thirdparty->zip = GETPOST('zip');
227  $thirdparty->town = GETPOST('town');
228  $thirdparty->country_id = GETPOST('country_id', 'int');
229  $thirdparty->state_id = GETPOST('state_id');
230  $thirdparty->client = $thirdparty::PROSPECT;
231  $thirdparty->code_client = 'auto';
232  $thirdparty->code_fournisseur = 'auto';
233 
234  // Fill array 'array_options' with data from the form
235  $extrafields->fetch_name_optionals_label($thirdparty->table_element);
236  $ret = $extrafields->setOptionalsFromPost(null, $thirdparty, '', 1);
237  //var_dump($thirdparty->array_options);exit;
238  if ($ret < 0) {
239  $error++;
240  $errmsg = ($extrafields->error ? $extrafields->error.'<br>' : '').join('<br>', $extrafields->errors);
241  }
242 
243  if (!$error) {
244  $result = $thirdparty->create($user);
245  if ($result <= 0) {
246  $error++;
247  $errmsg = ($thirdparty->error ? $thirdparty->error.'<br>' : '').join('<br>', $thirdparty->errors);
248  } else {
249  $proj->socid = $thirdparty->id;
250  }
251  }
252  }
253  }
254 
255  if (!$error) {
256  // Defined the ref into $defaultref
257  $defaultref = '';
258  $modele = empty($conf->global->PROJECT_ADDON) ? 'mod_project_simple' : $conf->global->PROJECT_ADDON;
259 
260  // Search template files
261  $file = ''; $classname = ''; $filefound = 0;
262  $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
263  foreach ($dirmodels as $reldir) {
264  $file = dol_buildpath($reldir."core/modules/project/".$modele.'.php', 0);
265  if (file_exists($file)) {
266  $filefound = 1;
267  $classname = $modele;
268  break;
269  }
270  }
271 
272  if ($filefound) {
273  $result = dol_include_once($reldir."core/modules/project/".$modele.'.php');
274  $modProject = new $classname;
275 
276  $defaultref = $modProject->getNextValue($thirdparty, $object);
277  }
278 
279  if (is_numeric($defaultref) && $defaultref <= 0) {
280  $defaultref = '';
281  }
282 
283  if (empty($defaultref)) {
284  $defaultref = 'PJ'.dol_print_date(dol_now(), 'dayrfc');
285  }
286 
287  $proj->ref = $defaultref;
288  $proj->statut = $proj::STATUS_DRAFT;
289  $proj->status = $proj::STATUS_DRAFT;
290  $proj->email = GETPOST("email");
291  $proj->public = 1;
292  $proj->usage_opportunity = 1;
293  $proj->title = $langs->trans("LeadFromPublicForm");
294  $proj->description = GETPOST("description", "alphanohtml");
295  $proj->opp_status = $defaultoppstatus;
296  $proj->fk_opp_status = $defaultoppstatus;
297 
298  // Fill array 'array_options' with data from the form
299  $extrafields->fetch_name_optionals_label($proj->table_element);
300  $ret = $extrafields->setOptionalsFromPost(null, $proj);
301  if ($ret < 0) {
302  $error++;
303  }
304 
305  // Create the project
306  $result = $proj->create($user);
307  if ($result > 0) {
308  require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
309  $object = $proj;
310 
311  if ($object->email) {
312  $subject = '';
313  $msg = '';
314 
315  // Send subscription email
316  include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
317  $formmail = new FormMail($db);
318  // Set output language
319  $outputlangs = new Translate('', $conf);
320  $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
321  // Load traductions files required by page
322  $outputlangs->loadLangs(array("main", "members", "projects"));
323  // Get email content from template
324  $arraydefaultmessage = null;
325  $labeltouse = $conf->global->PROJECT_EMAIL_TEMPLATE_AUTOLEAD;
326 
327  if (!empty($labeltouse)) {
328  $arraydefaultmessage = $formmail->getEMailTemplate($db, 'project', $user, $outputlangs, 0, 1, $labeltouse);
329  }
330 
331  if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
332  $subject = $arraydefaultmessage->topic;
333  $msg = $arraydefaultmessage->content;
334  }
335  if (empty($labeltosue)) {
336  $labeltouse = '['.$mysoc->name.'] '.$langs->trans("YourMessage");
337  $msg = $langs->trans("YourMessageHasBeenReceived");
338  }
339 
340  $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
341  complete_substitutions_array($substitutionarray, $outputlangs, $object);
342  $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
343  $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
344 
345  if ($subjecttosend && $texttosend) {
346  $moreinheader = 'X-Dolibarr-Info: send_an_email by public/lead/new.php'."\r\n";
347 
348  $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
349  }
350  /*if ($result < 0) {
351  $error++;
352  setEventMessages($object->error, $object->errors, 'errors');
353  }*/
354  }
355 
356  if (!empty($backtopage)) {
357  $urlback = $backtopage;
358  } elseif (!empty($conf->global->PROJECT_URL_REDIRECT_LEAD)) {
359  $urlback = $conf->global->PROJECT_URL_REDIRECT_LEAD;
360  // TODO Make replacement of __AMOUNT__, etc...
361  } else {
362  $urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken();
363  }
364 
365  if (!empty($entity)) {
366  $urlback .= '&entity='.$entity;
367  }
368 
369  dol_syslog("project lead ".$proj->ref." has been created, we redirect to ".$urlback);
370  } else {
371  $error++;
372  $errmsg .= $proj->error.'<br>'.join('<br>', $proj->errors);
373  }
374  }
375 
376  if (!$error) {
377  $db->commit();
378 
379  Header("Location: ".$urlback);
380  exit;
381  } else {
382  $db->rollback();
383  }
384 }
385 
386 // Action called after a submitted was send and member created successfully
387 // If MEMBER_URL_REDIRECT_SUBSCRIPTION is set to url we never go here because a redirect was done to this url.
388 // backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url.
389 if (empty($reshook) && $action == 'added') {
390  llxHeaderVierge($langs->trans("NewLeadForm"));
391 
392  // Si on a pas ete redirige
393  print '<br><br>';
394  print '<div class="center">';
395  print $langs->trans("NewLeadbyWeb");
396  print '</div>';
397 
398  llxFooterVierge();
399  exit;
400 }
401 
402 
403 
404 /*
405  * View
406  */
407 
408 $form = new Form($db);
409 $formcompany = new FormCompany($db);
410 
411 $extrafields->fetch_name_optionals_label($object->table_element); // fetch optionals attributes and labels
412 
413 llxHeaderVierge($langs->trans("NewContact"));
414 
415 
416 print load_fiche_titre($langs->trans("NewContact"), '', '', 0, 0, 'center');
417 
418 
419 print '<div align="center">';
420 print '<div id="divsubscribe">';
421 
422 print '<div class="center subscriptionformhelptext justify">';
423 if (!empty($conf->global->PROJECT_NEWFORM_TEXT)) {
424  print $langs->trans($conf->global->PROJECT_NEWFORM_TEXT)."<br>\n";
425 } else {
426  print $langs->trans("FormForNewLeadDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL)."<br>\n";
427 }
428 print '</div>';
429 
430 dol_htmloutput_errors($errmsg);
431 
432 // Print form
433 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="newlead">'."\n";
434 print '<input type="hidden" name="token" value="'.newToken().'" / >';
435 print '<input type="hidden" name="entity" value="'.$entity.'" />';
436 print '<input type="hidden" name="action" value="add" />';
437 
438 print '<br>';
439 
440 print '<br><span class="opacitymedium">'.$langs->trans("FieldsWithAreMandatory", '*').'</span><br>';
441 //print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
442 
443 print dol_get_fiche_head('');
444 
445 print '<script type="text/javascript">
446 jQuery(document).ready(function () {
447  jQuery(document).ready(function () {
448  jQuery("#selectcountry_id").change(function() {
449  document.newlead.action.value="create";
450  document.newlead.submit();
451  });
452  });
453 });
454 </script>';
455 
456 
457 print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."\n";
458 
459 // Lastname
460 print '<tr><td>'.$langs->trans("Lastname").' <span style="color: red">*</span></td><td><input type="text" name="lastname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('lastname')).'" required></td></tr>'."\n";
461 // Firstname
462 print '<tr><td>'.$langs->trans("Firstname").' <span style="color: red">*</span></td><td><input type="text" name="firstname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('firstname')).'" required></td></tr>'."\n";
463 // EMail
464 print '<tr><td>'.$langs->trans("Email").' <span style="color: red">*</span></td><td><input type="text" name="email" maxlength="255" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('email')).'" required></td></tr>'."\n";
465 // Company
466 print '<tr id="trcompany" class="trcompany"><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('societe')).'"></td></tr>'."\n";
467 // Address
468 print '<tr><td>'.$langs->trans("Address").'</td><td>'."\n";
469 print '<textarea name="address" id="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.'">'.dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1).'</textarea></td></tr>'."\n";
470 // Zip / Town
471 print '<tr><td>'.$langs->trans('Zip').' / '.$langs->trans('Town').'</td><td>';
472 print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1);
473 print ' / ';
474 print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1);
475 print '</td></tr>';
476 // Country
477 print '<tr><td>'.$langs->trans('Country').'</td><td>';
478 $country_id = GETPOST('country_id');
479 if (!$country_id && !empty($conf->global->PROJECT_NEWFORM_FORCECOUNTRYCODE)) {
480  $country_id = getCountry($conf->global->PROJECT_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs);
481 }
482 if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
483  $country_code = dol_user_country();
484  //print $country_code;
485  if ($country_code) {
486  $new_country_id = getCountry($country_code, 3, $db, $langs);
487  //print 'xxx'.$country_code.' - '.$new_country_id;
488  if ($new_country_id) {
489  $country_id = $new_country_id;
490  }
491  }
492 }
493 $country_code = getCountry($country_id, 2, $db, $langs);
494 print $form->select_country($country_id, 'country_id');
495 print '</td></tr>';
496 // State
497 if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
498  print '<tr><td>'.$langs->trans('State').'</td><td>';
499  if ($country_code) {
500  print $formcompany->select_state(GETPOST("state_id", 'int'), $country_code);
501  } else {
502  print '';
503  }
504  print '</td></tr>';
505 }
506 
507 // Other attributes
508 $tpl_context = 'public'; // define template context to public
509 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
510 // Comments
511 print '<tr>';
512 print '<td class="tdtop">'.$langs->trans("Message").' <span style="color: red">*</span></td>';
513 print '<td class="tdtop"><textarea name="description" id="description" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_5.'" required>'.dol_escape_htmltag(GETPOST('description', 'restricthtml'), 0, 1).'</textarea></td>';
514 print '</tr>'."\n";
515 
516 print "</table>\n";
517 
518 print dol_get_fiche_end();
519 
520 // Save
521 print '<div class="center">';
522 print '<input type="submit" value="'.$langs->trans("Submit").'" id="submitsave" class="button">';
523 if (!empty($backtopage)) {
524  print ' &nbsp; &nbsp; <input type="submit" value="'.$langs->trans("Cancel").'" id="submitcancel" class="button button-cancel">';
525 }
526 print '</div>';
527 
528 
529 print "</form>\n";
530 print "<br>";
531 print '</div></div>';
532 
533 
535 
536 $db->close();
make_substitutions
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
Definition: functions.lib.php:7839
Societe
Class to manage third parties objects (customers, suppliers, prospects...)
Definition: societe.class.php:48
dol_escape_htmltag
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
Definition: functions.lib.php:1468
Project
Class to manage projects.
Definition: project.class.php:35
dol_htmloutput_errors
dol_htmloutput_errors($mesgstring='', $mesgarray=array(), $keepembedded=0)
Print formated error messages to output (Used to show messages on html output).
Definition: functions.lib.php:8367
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
dol_include_once
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
Definition: functions.lib.php:1033
Translate
Class to manage translations.
Definition: translate.class.php:30
dol_buildpath
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
Definition: functions.lib.php:1062
top_htmlhead
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Ouput html header of a page.
Definition: main.inc.php:1482
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
printCommonFooter
printCommonFooter($zone='private')
Print common footer : conf->global->MAIN_HTML_FOOTER js for switch of menu hider js for conf->global-...
Definition: functions.lib.php:9150
FormCompany
Class to build HTML component for third parties management Only common components are here.
Definition: html.formcompany.class.php:40
dol_user_country
dol_user_country()
Return country code for current user.
Definition: functions.lib.php:3584
llxHeaderVierge
llxHeaderVierge($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='')
Show header for new member.
Definition: new.php:113
isValidEmail
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
Definition: functions.lib.php:3681
getCommonSubstitutionArray
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null)
Return array of possible common substitutions.
Definition: functions.lib.php:7275
dol_syslog
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Definition: functions.lib.php:1603
llxFooterVierge
llxFooterVierge()
Show footer for new member.
Definition: new.php:162
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1822
getDolGlobalString
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
Definition: functions.lib.php:80
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:10878
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2018
dolGetFirstLastname
dolGetFirstLastname($firstname, $lastname, $nameorder=-1)
Return firstname and lastname in correct order.
Definition: functions.lib.php:8062
ExtraFields
Class to manage standard extra fields.
Definition: extrafields.class.php:39
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
dol_now
dol_now($mode='auto')
Return date for now.
Definition: functions.lib.php:2845
getCountry
getCountry($searchkey, $withcode='', $dbtouse=0, $outputlangs='', $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
Definition: company.lib.php:489
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
FormMail
Classe permettant la generation du formulaire html d'envoi de mail unitaire Usage: $formail = new For...
Definition: html.formmail.class.php:38
complete_substitutions_array
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...
Definition: functions.lib.php:7961