dolibarr 21.0.0-beta
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-2024 Frédéric France <frederic.france@free.fr>
8 * Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
9 * Copyright (C) 2021 Waël Almoman <info@almoman.com>
10 * Copyright (C) 2022 Udo Tamm <dev@dolibit.de>
11 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <https://www.gnu.org/licenses/>.
25 */
26
34if (!defined('NOLOGIN')) {
35 define("NOLOGIN", 1); // This means this output page does not require to be logged.
36}
37if (!defined('NOCSRFCHECK')) {
38 define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
39}
40if (!defined('NOBROWSERNOTIF')) {
41 define('NOBROWSERNOTIF', '1');
42}
43
44
45// For MultiCompany module.
46// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
47// Because 2 entities can have the same ref
48$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
49if (is_numeric($entity)) {
50 define("DOLENTITY", $entity);
51}
52
53
54// Load Dolibarr environment
55require '../../main.inc.php';
56require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
57require_once DOL_DOCUMENT_ROOT . '/core/lib/payments.lib.php';
58require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
59require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent_type.class.php';
60require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
61require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
62require_once DOL_DOCUMENT_ROOT . '/core/class/cunits.class.php';
63require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
64require_once DOL_DOCUMENT_ROOT . '/core/class/html.formadmin.class.php';
65require_once DOL_DOCUMENT_ROOT . '/core/lib/public.lib.php';
66// Init vars
67$backtopage = GETPOST('backtopage', 'alpha');
68$action = GETPOST('action', 'aZ09');
69
70$errmsg = '';
71$num = 0;
72$error = 0;
73
74// Load translation files
75$langs->loadLangs(array("main", "members", "companies", "install", "other", "errors"));
76
77// Security check
78if (!isModEnabled('societe')) {
79 httponly_accessforbidden('Module Thirdparty not enabled');
80}
81
82if (!getDolGlobalString('SOCIETE_ENABLE_PUBLIC')) {
83 httponly_accessforbidden("Online form for contact for public visitors has not been enabled");
84}
85
86
87//permissions
88
89$permissiontoadd = $user->hasRight('societe', 'creer');
90
91// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
92$hookmanager->initHooks(array('publicnewmembercard', 'globalcard'));
93
94$extrafields = new ExtraFields($db);
95
96$objectsoc = new Societe($db);
97$user->loadDefaultValues();
98
99$extrafields->fetch_name_optionals_label($objectsoc->table_element); // fetch optionals attributes and labels
100
101
113function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = [])
114{
115 global $conf, $langs, $mysoc;
116
117 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
118
119 print '<body id="mainbody" class="publicnewmemberform">';
120
121 // Define urllogo
122 $urllogo = DOL_URL_ROOT . '/theme/common/login_logo.png';
123
124 if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output . '/logos/thumbs/' . $mysoc->logo_small)) {
125 $urllogo = DOL_URL_ROOT . '/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file=' . urlencode('logos/thumbs/' . $mysoc->logo_small);
126 } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output . '/logos/' . $mysoc->logo)) {
127 $urllogo = DOL_URL_ROOT . '/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file=' . urlencode('logos/' . $mysoc->logo);
128 } elseif (is_readable(DOL_DOCUMENT_ROOT . '/theme/dolibarr_logo.svg')) {
129 $urllogo = DOL_URL_ROOT . '/theme/dolibarr_logo.svg';
130 }
131
132 print '<header class="center">';
133
134 // Output html code for logo
135 if ($urllogo) {
136 print '<div class="backgreypublicpayment">';
137 print '<div class="logopublicpayment">';
138 print '<img id="dolpaymentlogo" src="' . $urllogo . '">';
139 print '</div>';
140 if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) {
141 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>';
142 }
143 print '</div>';
144 }
145
146 if (getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION')) {
147 print '<div class="backimagepublicregistration">';
148 print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION') . '">';
149 print '</div>';
150 }
151
152 print '</header>';
153
154 print '<div class="divmainbodylarge">';
155}
156
163{
164 global $conf, $langs;
165
166 $ext = '';
167
168 print '</div>';
169
170 printCommonFooter('public');
171
172 if (!empty($conf->use_javascript_ajax)) {
173 print "\n" . '<!-- Includes JS Footer of Dolibarr -->' . "\n";
174 print '<script src="' . DOL_URL_ROOT . '/core/js/lib_foot.js.php?lang=' . $langs->defaultlang . (!empty($ext) ? '&' . $ext : '') . '"></script>' . "\n";
175 }
176
177 print "</body>\n";
178 print "</html>\n";
179}
180
181
182
183/*
184 * Actions
185 */
186
187$parameters = array();
188// Note that $action and $object may have been modified by some hooks
189$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
190if ($reshook < 0) {
191 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
192}
193
194// Action called when page is submitted
195if (empty($reshook) && $action == 'add') { // Test on permission not required here. This is a public page. Security is done on constant and mitigation.
196 $error = 0;
197 $urlback = '';
198
199 $db->begin();
200
201 if (!GETPOST('name')) {
202 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Company")), null, 'errors');
203 $error++;
204 }
205
206 // Check Captcha code if is enabled
207 if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) {
208 $sessionkey = 'dol_antispam_value';
209 $ok = (array_key_exists($sessionkey, $_SESSION) && (strtolower($_SESSION[$sessionkey]) == strtolower(GETPOST('code'))));
210 if (!$ok) {
211 $error++;
212 $errmsg .= $langs->trans("ErrorBadValueForCode") . "<br>\n";
213 $action = '';
214 }
215 }
216
217 if (!$error) {
218 $societe = new Societe($db);
219
220 $societe->name = GETPOST('name', 'alphanohtml');
221 $societe->client = GETPOSTINT('client') ? GETPOSTINT('client') : $societe->client;
222 $societe->address = GETPOST('address', 'alphanohtml');
223 $societe->country_id = GETPOSTINT('country_id');
224 $societe->phone = GETPOST('phone', 'alpha');
225 $societe->fax = GETPOST('fax', 'alpha');
226 $societe->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL));
227 $societe->client = 2 ; // our client is a prospect
228 $societe->code_client = '-1';
229 $societe->name_alias = GETPOST('name_alias', 'alphanohtml');
230 $societe->note_private = GETPOST('note_private', 'alphanohtml');
231
232 // Fill array 'array_options' with data from add form
233 /*
234 $extrafields->fetch_name_optionals_label($societe->table_element);
235 $ret = $extrafields->setOptionalsFromPost(null, $societe);
236 if ($ret < 0) {
237 $error++;
238 $errmsg .= $societe->error;
239 }
240 */
241
242 $nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
243
244 if (checkNbPostsForASpeceificIp($societe, $nb_post_max) <= 0) {
245 $error++;
246 $errmsg .= implode('<br>', $societe->errors);
247 }
248
249 if (!$error) {
250 $result = $societe->create($user);
251 if ($result > 0) {
252 require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
253 $objectsoc = $societe;
254
255 if (!empty($backtopage)) {
256 $urlback = $backtopage;
257 } elseif (getDolGlobalString('MEMBER_URL_REDIRECT_SUBSCRIPTION')) {
258 $urlback = getDolGlobalString('MEMBER_URL_REDIRECT_SUBSCRIPTION');
259 // TODO Make replacement of __AMOUNT__, etc...
260 } else {
261 $urlback = $_SERVER["PHP_SELF"] . "?action=added&token=" . newToken();
262 }
263 } else {
264 $error++;
265 $errmsg .= implode('<br>', $societe->errors);
266 }
267 }
268 }
269
270 if (!$error) {
271 $db->commit();
272
273 header("Location: " . $urlback);
274 exit;
275 } else {
276 $db->rollback();
277 $action = "create";
278 }
279}
280
281// Action called after a submitted was send and prospect created successfully
282// If MEMBER_URL_REDIRECT_SUBSCRIPTION is set to an url, we never go here because a redirect was done to this url. Same if we ask to redirect to the payment page.
283// backtopage parameter with an url was set on prospect submit page, we never go here because a redirect was done to this url.
284
285if (empty($reshook) && $action == 'added') { // Test on permission not required here
286 llxHeaderVierge("newSocieteAdded");
287
288 // If we have not been redirected
289 print '<br><br>';
290 print '<div class="center">';
291 print $langs->trans("newSocieteAdded");
292 print '</div>';
293
295 exit;
296}
297
298
299
300/*
301 * View
302 */
303
304$form = new Form($db);
305$formcompany = new FormCompany($db);
306$adht = new AdherentType($db);
307$formadmin = new FormAdmin($db);
308
309
310llxHeaderVierge($langs->trans("ContactUs"));
311
312print '<br>';
313print load_fiche_titre(img_picto('', 'member_nocolor', 'class="pictofixedwidth"') . ' &nbsp; ' . $langs->trans("ContactUs"), '', '', 0, '', 'center');
314
315
316print '<div align="center">';
317print '<div id="divsubscribe">';
318
319print '<div class="center subscriptionformhelptext opacitymedium justify">';
320if (getDolGlobalString('COMPANY_NEWFORM_TEXT')) {
321 print $langs->trans(getDolGlobalString('COMPANY_NEWFORM_TEXT')) . "<br>\n";
322} else {
323 print $langs->trans("ContactUsDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL")) . "<br>\n";
324}
325print '</div>';
326
327dol_htmloutput_errors($errmsg);
329
330// Print form
331print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="newprospect">' . "\n";
332print '<input type="hidden" name="token" value="' . newToken() . '" / >';
333print '<input type="hidden" name="entity" value="' . $entity . '" />';
334print '<input type="hidden" name="action" value="add" />';
335print '<br>';
336
337$messagemandatory = '<span class="">' . $langs->trans("FieldsWithAreMandatory", '*') . '</span>';
338//print '<br><span class="opacitymedium">'.$langs->trans("FieldsWithAreMandatory", '*').'</span><br>';
339//print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
340
341print dol_get_fiche_head();
342
343print '<script type="text/javascript">
344jQuery(document).ready(function () {
345 jQuery(document).ready(function () {
346 function initmorphy()
347 {
348 console.log("Call initmorphy");
349 if (jQuery("#morphy").val() == \'phy\') {
350 jQuery("#trcompany").hide();
351 }
352 if (jQuery("#morphy").val() == \'mor\') {
353 jQuery("#trcompany").show();
354 }
355 }
356 initmorphy();
357 jQuery("#morphy").change(function() {
358 initmorphy();
359 });
360 jQuery("#selectcountry_id").change(function() {
361 document.newprospect.action.value="create";
362 document.newprospect.submit();
363 });
364 jQuery("#typeid").change(function() {
365 document.newprospect.action.value="create";
366 document.newprospect.submit();
367 });
368 });
369});
370</script>';
371
372
373print '<table class="border" summary="form to subscribe" id="tablesubscribe">' . "\n";
374//Third party name
375/*
376if ($objectsoc->particulier || $private) {
377 print '<span id="TypeName" class="fieldrequired">'.$langs->trans('ThirdPartyName').' / '.$langs->trans('LastName', 'name').'</span>';
378} else {
379 print '<span id="TypeName" class="fieldrequired">'.$form->editfieldkey('ThirdPartyName', 'name', '', $objectsoc, 0).'</span>';
380}
381*/
382print '<tr class="tr-field-thirdparty-name"><td class="titlefieldcreate">'; // text appreas left
383print '<input type="hidden" name="ThirdPartyName" value="' . $langs->trans('ThirdPartyName') . '">';
384print '<span id="TypeName" class="fieldrequired" title="' .dol_escape_htmltag($langs->trans("FieldsWithAreMandatory", '*')) . '" >' . $form->editfieldkey('Company', 'name', '', $objectsoc, 0) . '<span class="star"> *</span></span>';
385print '</td><td>'; // inline input
386print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="' . dol_escape_htmltag($objectsoc->name) . '" autofocus="autofocus">';
387//
388
389// Name and lastname
390print '<tr><td class="classfortooltip" title="' . dol_escape_htmltag($messagemandatory) . '">' . $langs->trans("Firstname") . ' <span class="star">*</span></td><td><input type="text" name="firstname" class="minwidth150" value="' . dol_escape_htmltag(GETPOST('firstname')) . '"></td></tr>' . "\n";
391
392print '<tr><td class="classfortooltip" title="' . dol_escape_htmltag($messagemandatory) . '">' . $langs->trans("Lastname") . ' <span class="star">*</span></td><td><input type="text" name="lastname" class="minwidth150" value="' . dol_escape_htmltag(GETPOST('lastname')) . '"></td></tr>' . "\n";
393
394// Address
395print '<tr><td class="tdtop">';
396print $form->editfieldkey('Address', 'address', '', $objectsoc, 0);
397print '</td>';
398print '<td>';
399print '<textarea name="address" id="address" class="quatrevingtpercent" rows="' . ROWS_2 . '" wrap="soft">';
400print dol_escape_htmltag($objectsoc->address, 0, 1);
401print '</textarea>';
402print $form->widgetForTranslation("address", $objectsoc, $permissiontoadd, 'textarea', 'alphanohtml', 'quatrevingtpercent');
403print '</td></tr>';
404
405// Country
406print '<tr><td>' . $form->editfieldkey('Country', 'selectcountry_id', '', $objectsoc, 0) . '</td><td class="maxwidthonsmartphone">';
407print img_picto('', 'country', 'class="pictofixedwidth"');
408print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $objectsoc->country_id), 'country_id', '', 0, 'minwidth300 maxwidth500 widthcentpercentminusx');
409if ($user->admin) {
410 print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
411}
412print '</td></tr>';
413
414// Phone / Fax
415print '<tr><td>' . $form->editfieldkey('Phone', 'phone', '', $objectsoc, 0) . '</td>';
416print '<td>' . img_picto('', 'object_phoning', 'class="pictofixedwidth"') . ' <input type="text" name="phone" id="phone" class="maxwidth200 widthcentpercentminusx" value="' . (GETPOSTISSET('phone') ? GETPOST('phone', 'alpha') : $objectsoc->phone) . '"></td>';
417print '</tr>';
418
419print '<tr>';
420print '<td>' . $form->editfieldkey('Fax', 'fax', '', $objectsoc, 0) . '</td>';
421print '<td>' . img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"') . ' <input type="text" name="fax" id="fax" class="maxwidth200 widthcentpercentminusx" value="' . (GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : $objectsoc->fax) . '"></td>';
422print '</tr>';
423
424// Email / Web
425print '<tr><td>' . $form->editfieldkey('EMail', 'email', '', $objectsoc, 0, 'string', '', !getDolGlobalString('SOCIETE_EMAIL_MANDATORY') ? '' : $conf->global->SOCIETE_EMAIL_MANDATORY) . '</td>';
426print '<td>' . img_picto('', 'object_email', 'class="pictofixedwidth"') . ' <input type="text" class="maxwidth200 widthcentpercentminusx" name="email" id="email" value="' . $objectsoc->email . '"></td>';
427if (isModEnabled('mailing') && getDolGlobalString('THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION')) {
428 if ($conf->browser->layout == 'phone') {
429 print '</tr><tr>';
430 }
431 print '<td class="individualline noemail">' . $form->editfieldkey($langs->trans('No_Email') . ' (' . $langs->trans('Contact') . ')', 'contact_no_email', '', $objectsoc, 0) . '</td>';
432 print '<td class="individualline" ' . (($conf->browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '') . '>' . $form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($objectsoc->no_email) ? 0 : 1)), 1, false, 1) . '</td>';
433}
434print '</tr>';
435
436print '<tr><td>' . $form->editfieldkey('Web', 'url', '', $objectsoc, 0) . '</td>';
437print '<td>' . img_picto('', 'globe', 'class="pictofixedwidth"') . ' <input type="text" class="maxwidth500 widthcentpercentminusx" name="url" id="url" value="' . $objectsoc->url . '"></td></tr>';
438
439
440// Comments
441print '<tr>';
442print '<td class="tdtop">' . $langs->trans("Comments") . '</td>';
443print '<td class="tdtop"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="' . ROWS_3 . '">' . dol_escape_htmltag(GETPOST('note_private', 'restricthtml'), 0, 1) . '</textarea></td>';
444print '</tr>' . "\n";
445
446
447// Other attributes
448$parameters['tpl_context'] = 'public'; // define template context to public
449include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
450
451
452// TODO Move this into generic feature.
453
454// Display Captcha code if is enabled
455if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) {
456 require_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php';
457 print '<tr><td class="titlefield"><label for="email"><span class="fieldrequired">' . $langs->trans("SecurityCode") . '</span></label></td><td>';
458 print '<span class="span-icon-security inline-block">';
459 print '<input id="securitycode" placeholder="' . $langs->trans("SecurityCode") . '" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" />';
460 print '</span>';
461 print '<span class="nowrap inline-block">';
462 print '<img class="inline-block valignmiddle" src="' . DOL_URL_ROOT . '/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />';
463 print '<a class="inline-block valignmiddle" href="' . $php_self . '" tabindex="4" data-role="button">' . img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"') . '</a>';
464 print '</span>';
465 print '</td></tr>';
466}
467
468print "</table>\n";
469
470print dol_get_fiche_end();
471
472// Save / Submit
473print '<div class="center">';
474print '<input type="submit" value="' . $langs->trans("Send") . '" id="submitsave" class="button">';
475if (!empty($backtopage)) {
476 print ' &nbsp; &nbsp; <input type="submit" value="' . $langs->trans("Cancel") . '" id="submitcancel" class="button button-cancel">';
477}
478print '</div>';
479
480
481print "</form>\n";
482print "<br>";
483print '</div></div>';
484
485
486
488
489$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
Class to manage members type.
Class to manage standard extra fields.
Class to generate html code for admin pages.
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 third parties objects (customers, suppliers, prospects...)
llxHeaderVierge($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs=[], $arrayofcss=[])
Show header for new prospect.
Definition new.php:113
llxFooterVierge()
Show footer for new societe.
Definition new.php:162
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
printCommonFooter($zone='private')
Print common footer : conf->global->MAIN_HTML_FOOTER js for switch of menu hider js for conf->global-...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_htmloutput_events($disabledoutputofmessages=0)
Print formatted messages to output (Used to show messages on html output).
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
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)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Output html header of a page.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
checkNbPostsForASpeceificIp($object, $nb_post_max)
Check if the object exceeded the number of posts for a specific ip in the same week.
httponly_accessforbidden($message='1', $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.