dolibarr 24.0.0-beta
view.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2020 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
4 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
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// Load Dolibarr environment
40require '../../main.inc.php';
52require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class.php';
53require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php';
54require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
55require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.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 . '/core/lib/public.lib.php';
59require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
60
61
62// Load translation files required by the page
63$langs->loadLangs(array("companies", "other", "recruitment", "mails"));
64
65// Get parameters
66$action = GETPOST('action', 'aZ09');
67$cancel = GETPOST('cancel', 'alpha');
68$email = GETPOST('email', 'alpha');
69$firstname = GETPOST('firstname', 'alpha');
70$lastname = GETPOST('lastname', 'alpha');
71$birthday = GETPOST('birthday', 'alpha');
72$phone = GETPOST('phone', 'alpha');
73$message = GETPOST('message', 'alpha');
74$SECUREKEY = GETPOST("securekey");
75$requestedremuneration = GETPOST('requestedremuneration', 'alpha');
76
77$ref = GETPOST('ref', 'alpha');
78
79if (GETPOST('btn_view')) {
80 unset($_SESSION['email_customer']);
81}
82if (isset($_SESSION['email_customer'])) {
83 $email = $_SESSION['email_customer'];
84}
85
87
88if (!$ref) {
89 print $langs->trans('ErrorBadParameters')." - ref missing";
90 exit;
91}
92
93
94// Define $urlwithroot
95// $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
96// $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
97$urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost.
98$backtopage = $urlwithroot.'/public/recruitment/index.php';
99
100// Security check
101if (!isModEnabled("recruitment")) {
102 httponly_accessforbidden('Module Recruitment not enabled');
103}
104
105$object->fetch(0, $ref);
106if (!is_object($user)) {
107 $user = new User($db);
108}
109$user->loadDefaultValues();
110$errmsg = "";
111
112$extrafields = new ExtraFields($db);
113
114$captchaobj = null;
115if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_RECRUITMENT')) {
116 require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
117 $captcha = getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_HANDLER', 'standard');
118 // List of directories where we can find captcha handlers
119 $dirModCaptcha = array_merge(
120 array(
121 'main' => '/core/modules/security/captcha/'
122 ),
123 is_array($conf->modules_parts['captcha']) ? $conf->modules_parts['captcha'] : array()
124 );
125 $fullpathclassfile = '';
126 foreach ($dirModCaptcha as $dir) {
127 $fullpathclassfile = dol_buildpath($dir."modCaptcha".ucfirst($captcha).'.class.php', 0, 2);
128 if ($fullpathclassfile) {
129 break;
130 }
131 }
132 if ($fullpathclassfile) {
133 include_once $fullpathclassfile;
134 // Charging the numbering class
135 $classname = "modCaptcha".ucfirst($captcha);
136 if (class_exists($classname)) {
137 $captchaobj = new $classname($db, $conf, $langs, $user);
138 '@phan-var-force ModeleCaptcha $captchaobj';
140 } else {
141 print 'Error, the captcha handler class '.$classname.' was not found after the include';
142 }
143 } else {
144 print 'Error, the captcha handler '.$captcha.' has no class file found modCaptcha'.ucfirst($captcha);
145 }
146}
147
148/*
149 * Actions
150 */
151
152if ($cancel) {
153 if (!empty($backtopage)) {
154 header("Location: ".$backtopage);
155 exit;
156 }
157}
158
159if ($action == "dosubmit") { // Test on permission not required here (anonymous action protected by mitigation of /public/... urls)
160 $error = 0;
161 $db->begin();
162 if (!strlen($ref)) {
163 $error++;
164 array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")));
165 $action = 'view';
166 }
167 if (!strlen($email)) {
168 $error++;
169 array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Email")));
170 $action = 'view';
171 } else {
172 if (!isValidEmail($email)) {
173 $error++;
174 array_push($object->errors, $langs->trans("ErrorEmailInvalid"));
175 $action = 'view';
176 }
177 }
178 if (!strlen($lastname)) {
179 $error++;
180 array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Lastname")));
181 $action = 'view';
182 }
183
184 // Check Captcha code if is enabled
185 $ok = false;
186 if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_RECRUITMENT') && is_object($captchaobj)) {
187 if (method_exists($captchaobj, 'validateCodeAfterLoginSubmit')) {
188 $ok = $captchaobj->validateCodeAfterLoginSubmit(); // @phan-suppress-current-line PhanUndeclaredMethod
189 } else {
190 print 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()';
191 }
192 if (!$ok) {
193 $error++;
194 $langs->load('errors');
195 array_push($object->errors, $langs->trans("ErrorBadValueForCode"));
196 $action = 'view';
197 }
198 }
199 if (!$error) {
200 $sql = "SELECT rrc.rowid FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rrc";
201 $sql .= " WHERE rrc.email = '". $db->escape($email)."'";
202 $sql .= " AND rrc.entity IN (". getEntity($object->element, 0).")";
203 $resql = $db->query($sql);
204 if ($resql) {
205 $num = $db->num_rows($resql);
206 if ($num > 0) {
207 $error++;
208 setEventMessages($langs->trans("ErrorRecruitmmentCandidatureAlreadyExists", $email), null, 'errors');
209 }
210 } else {
212 $error++;
213 }
214 } else {
215 setEventMessages($object->error, $object->errors, 'errors');
216 }
217
218 if (!$error) { // Test on permission not required here (anonymous action protected by mitigation of /public/... urls)
219 $candidature = new RecruitmentCandidature($db);
220
221 $candidature->firstname = GETPOST('firstname', 'alpha');
222 $candidature->lastname = GETPOST('lastname', 'alpha');
223 $candidature->email = GETPOST('email', 'alpha');
224 $candidature->phone = GETPOST('phone', 'alpha');
225 $candidature->date_birth = GETPOST('birthday', 'alpha');
226 $candidature->requestedremuneration = GETPOST('requestedremuneration', 'alpha');
227 $candidature->description = GETPOST('message', 'alpha');
228 $candidature->fk_recruitmentjobposition = $object->id;
229
230 $candidature->ip = getUserRemoteIP();
231
232 // Test MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS
233 $nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
234
235 if (checkNbPostsForASpeceificIp($candidature, $nb_post_max) <= 0) {
236 $error++;
237 $errmsg .= implode('<br>', $candidature->errors);
238 }
239
240 // Fill array 'array_options' with data from add form
241 $extrafields->fetch_name_optionals_label($candidature->table_element);
242 $ret = $extrafields->setOptionalsFromPost(null, $candidature);
243 if ($ret < 0) {
244 $error++;
245 $errmsg .= $candidature->error;
246 }
247
248 if (!$error) {
249 $result = $candidature->create($user);
250 if ($result <= 0) {
251 $error++;
252 $errmsg .= implode('<br>', $candidature->errors);
253 }
254 }
255 if (!$error) {
256 $candidature->validate($user);
257 if ($result <= 0) {
258 $error++;
259 $errmsg .= implode('<br>', $candidature->errors);
260 }
261 }
262 }
263
264 if (!$error) {
265 $db->commit();
266 setEventMessages($langs->trans("RecruitmentCandidatureSaved"), null);
267 header("Location: " . $backtopage);
268 exit;
269 } else {
270 $db->rollback();
271 $action = "view";
272 }
273}
274
275// Actions to send emails (for ticket, we need to manage the addfile and removefile only)
276$triggersendname = 'CANDIDATURE_SENTBYMAIL';
277$paramname = 'id';
278$autocopy = 'MAIN_MAIL_AUTOCOPY_CANDIDATURE_TO'; // used to know the automatic BCC to add
279$trackid = 'recruitmentcandidature'.$object->id;
280include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
281
282
283
284/*
285 * View
286 */
287
288$form = new Form($db);
289$now = dol_now();
290
291$head = '';
292if (getDolGlobalString('MAIN_RECRUITMENT_CSS_URL')) {
293 $head = '<link rel="stylesheet" type="text/css" href="' . getDolGlobalString('MAIN_RECRUITMENT_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n";
294}
295
296$conf->dol_hide_topmenu = 1;
297$conf->dol_hide_leftmenu = 1;
298
299if (!getDolGlobalInt('RECRUITMENT_ENABLE_PUBLIC_INTERFACE')) {
300 $langs->load("errors");
301 print '<div class="error">'.$langs->trans('ErrorPublicInterfaceNotEnabled').'</div>';
302 $db->close();
303 exit();
304}
305
306$arrayofjs = array();
307$arrayofcss = array();
308
309$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
310llxHeader($head, $langs->trans("PositionToBeFilled"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1, 1);
311dol_htmloutput_errors($errmsg);
312
313print '<span id="dolpaymentspan"></span>'."\n";
314print '<div class="center">'."\n";
315print '<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
316print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
317print '<input type="hidden" name="action" value="dosubmit">'."\n";
318print '<input type="hidden" name="tag" value="'.GETPOST("tag", 'alpha').'">'."\n";
319print '<input type="hidden" name="suffix" value="'.GETPOST("suffix", 'alpha').'">'."\n";
320print '<input type="hidden" name="securekey" value="'.$SECUREKEY.'">'."\n";
321print '<input type="hidden" name="entity" value="'.$entity.'" />';
322print "\n";
323print '<!-- Form to view job -->'."\n";
324
325// Show logo (search order: logo defined by ONLINE_SIGN_LOGO_suffix, then ONLINE_SIGN_LOGO_, then small company logo, large company logo, theme logo, common logo)
326// Define logo and logosmall
327$logosmall = $mysoc->logo_small;
328$logo = $mysoc->logo;
329$paramlogo = 'ONLINE_RECRUITMENT_LOGO_'.$suffix;
330if (getDolGlobalString($paramlogo)) {
331 $logosmall = getDolGlobalString($paramlogo);
332} elseif (getDolGlobalString('ONLINE_RECRUITMENT_LOGO')) {
333 $logosmall = getDolGlobalString('ONLINE_RECRUITMENT_LOGO');
334}
335//print '<!-- Show logo (logosmall='.$logosmall.' logo='.$logo.') -->'."\n";
336// Define urllogo
337$urllogo = '';
338$urllogofull = '';
339if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) {
340 $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;entity='.$conf->entity.'&amp;file='.urlencode('logos/thumbs/'.$logosmall);
341 $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall);
342} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) {
343 $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;entity='.$conf->entity.'&amp;file='.urlencode('logos/'.$logo);
344 $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo);
345}
346// Output html code for logo
347if ($urllogo) {
348 print '<div class="backgreypublicpayment">';
349 print '<div class="logopublicpayment">';
350 if (!empty($mysoc->url)) {
351 print '<a href="'.$mysoc->url.'" target="_blank" rel="noopener">';
352 }
353 print '<img id="dolpaymentlogo" src="'.$urllogofull.'">';
354 if (!empty($mysoc->url)) {
355 print '</a>';
356 }
357 print '</div>';
358 if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) {
359 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>';
360 }
361 print '</div>';
362}
363
364if (getDolGlobalString('RECRUITMENT_IMAGE_PUBLIC_INTERFACE')) {
365 print '<div class="backimagepublicrecruitment">';
366 print '<img id="idRECRUITMENT_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('RECRUITMENT_IMAGE_PUBLIC_INTERFACE').'">';
367 print '</div>';
368}
369
370
371print '<table id="dolpaymenttable" summary="Job position offer" class="center">'."\n";
372
373// Output introduction text
374$text = '';
375if (getDolGlobalString('RECRUITMENT_NEWFORM_TEXT')) {
376 $reg = array();
377 if (preg_match('/^\‍((.*)\‍)$/', $conf->global->RECRUITMENT_NEWFORM_TEXT, $reg)) {
378 $text .= $langs->trans($reg[1])."<br>\n";
379 } else {
380 $text .= getDolGlobalString('RECRUITMENT_NEWFORM_TEXT') . "<br>\n";
381 }
382 $text = '<tr><td align="center"><br>'.$text.'<br></td></tr>'."\n";
383}
384if (empty($text)) {
385 $text .= '<tr><td class="textpublicpayment" colspan=2><br>'.$langs->trans("JobOfferToBeFilled", $mysoc->name);
386 $text .= ' &nbsp; - &nbsp; <strong>'.$mysoc->name.'</strong>';
387 $text .= ' &nbsp; - &nbsp; <span class="nowraponall"><span class="fa fa-calendar secondary"></span> '.dol_print_date($object->date_creation).'</span>';
388 $text .= '</td></tr>'."\n";
389 $text .= '<tr><td class="textpublicpayment" colspan=2><h1 class="paddingleft paddingright">'.$object->label.'</h1><br></td></tr>'."\n";
390}
391print $text;
392
393// Output payment summary form
394print '<tr><td class="left" colspan=2>';
395
396print '<div with="100%" id="tablepublicpayment">';
397print '<div class="opacitymedium">'.$langs->trans("ThisIsInformationOnJobPosition").' :</div>'."\n";
398
399$error = 0;
400$found = true;
401
402print '<br>';
403
404// Label
405print $langs->trans("Label").' : ';
406print '<b>'.dol_escape_htmltag($object->label).'</b><br>';
407
408// Date
409print $langs->trans("DateExpected").' : ';
410print '<b>';
411if ($object->date_planned > $now) {
412 print dol_print_date($object->date_planned, 'day');
413} else {
414 print $langs->trans("ASAP");
415}
416print '</b><br>';
417
418// Remuneration
419print $langs->trans("Remuneration").' : ';
420print '<b>';
421print dol_escape_htmltag($object->remuneration_suggested);
422print '</b><br>';
423
424// Contact
425$tmpuser = new User($db);
426$tmpuser->fetch($object->fk_user_recruiter);
427
428print $langs->trans("ContactForRecruitment").' : ';
429$emailforcontact = $object->email_recruiter;
430if (empty($emailforcontact)) {
431 $emailforcontact = $tmpuser->email ?? '';
432 if (empty($emailforcontact)) {
433 $emailforcontact = $mysoc->email ?? '';
434 }
435}
436print '<b class="wordbreak">';
437print $tmpuser->getFullName($langs);
438print ' &nbsp; '.dol_print_email($emailforcontact, 0, 0, 1, 0, 0, 'envelope');
439print '</b>';
440print '</b><br>';
441
443 print info_admin($langs->trans("JobClosedTextCandidateFound"), 0, 0, '0', 'warning');
444}
446 print info_admin($langs->trans("JobClosedTextCanceled"), 0, 0, '0', 'warning');
447}
448
449print '<br>';
450
451// Description
452
453$text = $object->description;
454print $text;
455print '<input type="hidden" name="ref" value="'.$object->ref.'">';
456
457print '</div>'."\n";
458print "\n";
459
460
461if ($action != 'dosubmit') {
462 if ($found && !$error) {
463 // We are in a management option and no error
464 print '</td></tr>'."\n";
465 print '<tr><td class="titlefieldcreate fieldrequired left">'.$langs->trans("Lastname").'</td><td class="left">';
466 print '<input type="text" class="flat minwidth400 --success" name="lastname" maxlength="128" value="'.$lastname.'">';
467 print '</td></tr>'."\n";
468
469 print '<tr><td class="titlefieldcreate left">'.$langs->trans("Firstname").'</td><td class="left">';
470 print '<input type="text" class="flat minwidth400 --success" name="firstname" maxlength="128" value="'.$firstname.'">';
471 print '</td></tr>'."\n";
472
473 print '<tr><td class="titlefieldcreate fieldrequired left">'.$langs->trans("Email").'</td><td class="left">';
474 print img_picto("", "email", 'class="pictofixedwidth"').'<input type="text" class="flat minwidth100 --success" name="email" value="'.$email.'">';
475 print '</td></tr>'."\n";
476
477 print '<tr><td class="titlefieldcreate left">'.$langs->trans("Phone").'</td><td class="left">';
478 print img_picto("", "phone", 'class="pictofixedwidth"').'<input type="text" class="flat minwidth100 --success" name="phone" value="'.$phone.'">';
479 print '</td></tr>'."\n";
480
481 print '<tr><td class="titlefieldcreate left minwidth300">'.$langs->trans("DateOfBirth").'</td><td class="left">';
482 print $form->selectDate($birthday, 'birthday', 0, 0, 1, "", 1, 0);
483 print '</td></tr>'."\n";
484
485 print '<tr><td class="titlefieldcreate left">'.$langs->trans("RequestedRemuneration").'</td><td class="left">';
486 print '<input type="text" class="flat minwidth100 --success" name="requestedremuneration" value="'.$requestedremuneration.'">';
487 print '</td></tr>'."\n";
488
489 // Other attributes
491 $parameters['tpl_context'] = 'public'; // define template context to public
492 $parameters['tdclass'] = 'left';
493 $extrafields->fetch_name_optionals_label("recruitment_recruitmentcandidature");
494 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
495
496 print '<tr><td class="titlefieldcreate left">'.$langs->trans("Message").'</td><td class="left">';
497 print '<textarea class="flat quatrevingtpercent" rows="'.ROWS_5.'" name="message">'.$message.'</textarea>';
498 print '</td></tr>'."\n";
499
500 // Display Captcha code if is enabled
501 if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_RECRUITMENT') && is_object($captchaobj)) {
502 print '<tr><td class="titlefield"><label><span class="fieldrequired">'.$langs->trans($captchaobj->getFieldInputTitle()).'</span></label></td><td><br>';
503 if (method_exists($captchaobj, 'getCaptchaCodeForForm')) {
504 print $captchaobj->getCaptchaCodeForForm(''); // @phan-suppress-current-line PhanUndeclaredMethod
505 } else {
506 print 'Error, the captcha handler '.get_class($captchaobj).' does not have any method getCaptchaCodeForForm()';
507 }
508 print '<br></td></tr>';
509 }
510 print '<tr><td colspan=2>';
511 print $form->buttonsSaveCancel('Submit', 'Cancel');
512 print '</td></tr>'."\n";
513 } else {
514 dol_print_error_email('ERRORSUBMITAPPLICATION');
515 }
516} else {
517 // Print
518}
519
520print '</td></tr>'."\n";
521
522print '</table>'."\n";
523
524print '</form>'."\n";
525print '</div>'."\n";
526print '<br>';
527
528
530
531llxFooter('', 'public');
532
533$db->close();
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
global $dolibarr_main_url_root
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
Class for RecruitmentCandidature.
Class for RecruitmentJobPosition.
Class to manage Dolibarr users.
htmlPrintOnlineFooter($fromcompany, $langs, $addformmessage=0, $suffix='', $object=null)
Show footer of company in HTML public pages.
global $mysoc
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.
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, $allowothertags=array())
Show picto whatever it's its name (generic function)
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='')
Show information in HTML for admin users or standard users.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error_email($prefixcode, $errormessage='', $errormessages=array(), $morecss='error', $email='')
Show a public email and error code to contact if technical error.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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).
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
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...
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.