dolibarr 20.0.0
view.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2020-2022 Laurent Destailleur <eldy@users.sourceforge.net>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
24if (!defined('NOLOGIN')) {
25 define("NOLOGIN", 1); // This means this output page does not require to be logged.
26}
27if (!defined('NOCSRFCHECK')) {
28 define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
29}
30if (!defined('NOIPCHECK')) {
31 define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
32}
33if (!defined('NOBROWSERNOTIF')) {
34 define('NOBROWSERNOTIF', '1');
35}
36
37// Load Dolibarr environment
38require '../../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
40require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
41require_once DOL_DOCUMENT_ROOT.'/core/class/vcard.class.php';
42
43// Load translation files required by the page
44$langs->loadLangs(array("companies", "other", "recruitment"));
45
46// Get parameters
47$action = GETPOST('action', 'aZ09');
48$mode = GETPOST('mode', 'aZ09');
49$cancel = GETPOST('cancel', 'alpha');
50$backtopage = '';
51
52$id = GETPOSTINT('id');
53$securekey = GETPOST('securekey', 'alpha');
54$suffix = GETPOST('suffix');
55
56$object = new User($db);
57$object->fetch($id, '', '', 1);
58
59// Define $urlwithroot
60//$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
61//$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
62$urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost.
63
64// Security check
65global $conf;
66$encodedsecurekey = dol_hash($conf->file->instance_unique_id.'uservirtualcard'.$object->id.'-'.$object->login, 'md5');
67if ($encodedsecurekey != $securekey) {
68 httponly_accessforbidden('Bad value for securitykey or public profile not enabled');
69}
70
71if (!getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
72 httponly_accessforbidden('Bad value for securitykey or public profile not enabled');
73}
74
75
76/*
77 * Actions
78 */
79
80if ($cancel) {
81 if (!empty($backtopage)) {
82 header("Location: ".$backtopage);
83 exit;
84 }
85 $action = 'view';
86}
87
88
89/*
90 * View
91 */
92
93$form = new Form($db);
94$v = new vCard();
95
96$company = $mysoc;
97
98$modulepart = 'userphotopublic';
99$dir = $conf->user->dir_output;
100
101// 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)
102// Define logo and logosmall
103$logo = '';
104$logosmall = '';
105if (!empty($object->photo)) {
106 if (dolIsAllowedForPreview($object->photo)) {
107 $logosmall = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
108 $logo = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
109 //$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
110 }
111}
112//print '<!-- Show logo (logosmall='.$logosmall.' logo='.$logo.') -->'."\n";
113// Define urllogo
114$urllogo = '';
115$urllogofull = '';
116if (!empty($logosmall) && is_readable($dir.'/'.$logosmall)) {
117 $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart='.urlencode($modulepart).($conf->entity > 1 ? '&amp;entity='.$conf->entity : '').'&amp;securekey='.urlencode($securekey).'&amp;file='.urlencode($logosmall);
118 $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart='.$modulepart.($conf->entity > 1 ? '&entity='.$conf->entity : '').'&securekey='.urlencode($securekey).'&file='.urlencode($logosmall);
119} elseif (!empty($logo) && is_readable($dir.'/'.$logo)) {
120 $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart='.urlencode($modulepart).($conf->entity > 1 ? '&amp;entity='.$conf->entity : '').'&amp;securekey='.urlencode($securekey).'&amp;file='.urlencode($logo);
121 $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart='.$modulepart.($conf->entity > 1 ? '&entity='.$conf->entity : '').'&securekey='.urlencode($securekey).'&file='.urlencode($logo);
122}
123
124// Clean data we don't want on public page
125if (getDolUserInt('USER_PUBLIC_HIDE_PHOTO', 0, $object)) {
126 $logo = '';
127 $logosmall = '';
128 $urllogo = '';
129 $urllogofull = '';
130}
131if (getDolUserInt('USER_PUBLIC_HIDE_JOBPOSITION', 0, $object)) {
132 $object->job = '';
133}
134if (getDolUserInt('USER_PUBLIC_HIDE_EMAIL', 0, $object)) {
135 $object->email = '';
136}
137if (getDolUserInt('USER_PUBLIC_HIDE_EMAIL', 0, $object)) {
138 $object->job = '';
139}
140if (getDolUserInt('USER_PUBLIC_HIDE_OFFICE_PHONE', 0, $object)) {
141 $object->office_phone = '';
142}
143if (getDolUserInt('USER_PUBLIC_HIDE_OFFICE_FAX', 0, $object)) {
144 $object->office_fax = '';
145}
146if (getDolUserInt('USER_PUBLIC_HIDE_USER_MOBILE', 0, $object)) {
147 $object->user_mobile = '';
148}
149if (getDolUserInt('USER_PUBLIC_HIDE_SOCIALNETWORKS', 0, $object)) {
150 $object->socialnetworks = [];
151}
152// By default, personal address not visible
153if (!getDolUserInt('USER_PUBLIC_SHOW_BIRTH', 0, $object)) {
154 $object->birth = null;
155}
156if (!getDolUserInt('USER_PUBLIC_SHOW_ADDRESS', 0, $object)) {
157 $object->address = '';
158 $object->town = '';
159 $object->zip = '';
160 $object->state = '';
161 $object->country = '';
162}
163if (getDolUserInt('USER_PUBLIC_HIDE_COMPANY', 0, $object)) {
164 $company = null;
165}
166
167
168// Output vcard
169if ($mode == 'vcard') {
170 // We create VCard
171 $output = $v->buildVCardString($object, $company, $langs, $urllogofull);
172
173 $filename = trim(urldecode($v->getFileName())); // "Nom prenom.vcf"
174 $filenameurlencoded = dol_sanitizeFileName(urlencode($filename));
175 //$filename = dol_sanitizeFileName($filename);
176
177 top_httphead('text/vcard; name="'.$filename.'"');
178
179 header("Content-Disposition: attachment; filename=\"".$filename."\"");
180 header("Content-Length: ".dol_strlen($output));
181 header("Connection: close");
182
183 print $output;
184
185 $db->close();
186
187 exit;
188}
189
190$head = '';
191if (getDolGlobalString('MAIN_USER_PROFILE_CSS_URL')) {
192 $head = '<link rel="stylesheet" type="text/css" href="' . getDolGlobalString('MAIN_USER_PROFILE_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n";
193}
194
195$conf->dol_hide_topmenu = 1;
196$conf->dol_hide_leftmenu = 1;
197
198if (!getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
199 $langs->load("errors");
200 print '<div class="error">'.$langs->trans('ErrorPublicInterfaceNotEnabled').'</div>';
201 $db->close();
202 exit();
203}
204
205$arrayofjs = array();
206$arrayofcss = array();
207
208$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
209llxHeader($head, $object->getFullName($langs).' - '.$langs->trans("PublicVirtualCard"), '', '', 0, 0, '', '', '', 'onlinepaymentbody'.(GETPOST('mode')=='preview' ? ' scalepreview cursorpointer virtualcardpreview' : ''), $replacemainarea, 1, 1);
210
211print '
212<style>
213@media (prefers-color-scheme: dark) {
214 form {
215 background-color: #CCC !important;
216 }
217}
218</style>
219';
220
221print '<span id="dolpaymentspan"></span>'."\n";
222print '<div class="center">'."\n";
223
224print '<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
225print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
226print '<input type="hidden" name="action" value="dosubmit">'."\n";
227print '<input type="hidden" name="securekey" value="'.$securekey.'">'."\n";
228print '<input type="hidden" name="entity" value="'.$conf->entity.'" />';
229print "\n";
230
231// Output html code for logo
232print '<div class="backgreypublicpayment">';
233print '<div class="logopublicpayment">';
234
235// Name
236print '<div class="double colortext">'.$object->getFullName($langs).'</div>';
237// User position
238if ($object->job && !getDolUserInt('USER_PUBLIC_HIDE_JOBPOSITION', 0, $object)) {
239 print '<div class="">';
240 print dol_escape_htmltag($object->job);
241 print '</div>';
242}
243if (!getDolUserInt('USER_PUBLIC_HIDE_COMPANY', 0, $object)) {
244 print '<div class="bold">';
245 print dol_escape_htmltag($mysoc->name);
246 print '</div>';
247}
248
249
250
251print '</div>';
252/*if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
253 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>';
254}*/
255print '</div>';
256
257
258if (getDolGlobalString('USER_IMAGE_PUBLIC_INTERFACE')) {
259 print '<div class="backimagepublicrecruitment">';
260 print '<img id="idUSER_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('USER_IMAGE_PUBLIC_INTERFACE').'">';
261 print '</div>';
262}
263
264$urlforqrcode = $object->getOnlineVirtualCardUrl('vcard');
265
266$socialnetworksdict = getArrayOfSocialNetworks();
267
268
269
270// Show barcode
271$showbarcode = GETPOST('nobarcode') ? 0 : 1;
272if ($showbarcode) {
273 $outdir = '/tmp';
274 if ($object instanceof User) {
275 $outdir = $conf->user->dir_temp;
276 } elseif ($object instanceof Contact) {
277 $outdir = $conf->contact->dir_temp;
278 }
279
280 $filename = $v->buildVCardString($object, $company, $langs, '', $outdir);
281
282 print '<br>';
283 print '<div class="floatleft inline-block valignmiddle paddingleft paddingright">';
284 print '<img style="max-width: 100%" src="'.$dolibarr_main_url_root.'/viewimage.php?modulepart=barcode&entity='.((int) $conf->entity).'&generator=tcpdfbarcode&encoding=QRCODE&code='.urlencode(basename($filename)).'">';
285 print '</div>';
286 print '<br>';
287}
288
289
290// Me section
291
292$usersection = '';
293
294// User email
295if ($object->email && !getDolUserInt('USER_PUBLIC_HIDE_EMAIL', 0, $object)) {
296 $usersection .= '<div class="flexitemsmall">';
297 $usersection .= dol_print_email($object->email, 0, 0, 1, 0, 1, 1);
298 $usersection .= '</div>';
299}
300
301// User url
302if ($object->url && !getDolUserInt('USER_PUBLIC_HIDE_URL', 0, $object)) {
303 $usersection .= '<div class="flexitemsmall">';
304 $usersection .= img_picto('', 'globe', 'class="pictofixedwidth"');
305 $usersection .= dol_print_url($object->url, '_blank', 0, 0, '');
306 $usersection .= '</div>';
307}
308
309// User phone
310if ($object->office_phone && !getDolUserInt('USER_PUBLIC_HIDE_OFFICE_PHONE', 0, $object)) {
311 $usersection .= '<div class="flexitemsmall">';
312 $usersection .= img_picto('', 'phone', 'class="pictofixedwidth"');
313 $usersection .= dol_print_phone($object->office_phone, $object->country_code, 0, $mysoc->id, 'tel', ' ', 0, '');
314 $usersection .= '</div>';
315}
316if ($object->office_fax && !getDolUserInt('USER_PUBLIC_HIDE_OFFICE_FAX', 0, $object)) {
317 $usersection .= '<div class="flexitemsmall">';
318 $usersection .= img_picto('', 'phoning_fax', 'class="pictofixedwidth"');
319 $usersection .= dol_print_phone($object->office_fax, $object->country_code, 0, $mysoc->id, 'fax', ' ', 0, '');
320 $usersection .= '</div>';
321}
322if ($object->user_mobile && !getDolUserInt('USER_PUBLIC_HIDE_USER_MOBILE', 0, $object)) {
323 $usersection .= '<div class="flexitemsmall">';
324 $usersection .= img_picto('', 'phone', 'class="pictofixedwidth"');
325 $usersection .= dol_print_phone($object->user_mobile, $object->country_code, 0, $mysoc->id, 'tel', ' ', 0, '');
326 $usersection .= '</div>';
327}
328if (getDolUserInt('USER_PUBLIC_SHOW_BIRTH', 0, $object) && !is_null($object->birth)) {
329 $usersection .= '<div class="flexitemsmall">';
330 $usersection .= img_picto('', 'calendar', 'class="pictofixedwidth"');
331 $usersection .= dol_print_date($object->birth);
332 $usersection .= '</div>';
333}
334if (getDolUserInt('USER_PUBLIC_SHOW_ADDRESS', 0, $object) && $object->address) {
335 $usersection .= '<div class="flexitemsmall">';
336 $usersection .= img_picto('', 'state', 'class="pictofixedwidth"');
337 $usersection .= dol_print_address(dol_format_address($object, 0, "\n", $langs), 'map', 'user', $object->id, 1);
338 $usersection .= '</div>';
339}
340
341// Social networks
342if (!empty($object->socialnetworks) && is_array($object->socialnetworks) && count($object->socialnetworks) > 0) {
343 if (!getDolUserInt('USER_PUBLIC_HIDE_SOCIALNETWORKS', 0, $object)) {
344 foreach ($object->socialnetworks as $key => $value) {
345 if ($value) {
346 $usersection .= '<div class="flexitemsmall">'.dol_print_socialnetworks($value, 0, $mysoc->id, $key, $socialnetworksdict).'</div>';
347 }
348 }
349 }
350}
351
352if ($usersection) {
353 // Show photo
354 if ($urllogo) {
355 print '<img class="userphotopublicvcard" id="dolpaymentlogo" src="'.$urllogofull.'">';
356 }
357
358 print '<table id="dolpaymenttable" summary="Job position offer" class="center">'."\n";
359
360 // Output payment summary form
361 print '<tr><td class="left">';
362
363 print '<div class="nowidthimp nopaddingtoponsmartphone" id="tablepublicpayment">';
364
365 print $usersection;
366
367 print '</div>'."\n";
368 print "\n";
369
370 print '</td></tr>'."\n";
371
372 print '</table>'."\n";
373} else {
374 // Show photo
375 if ($urllogo) {
376 print '<br><center><img class="userphotopublicvcard" style="position: unset !important;" id="dolpaymentlogo" src="'.$urllogofull.'"></center>';
377 }
378}
379
380
381if (!getDolUserInt('USER_PUBLIC_HIDE_COMPANY', 0, $object)) {
382 $companysection = '';
383
384 if ($mysoc->email) {
385 $companysection .= '<div class="flexitemsmall">';
386 $companysection .= img_picto('', 'email', 'class="pictofixedwidth"');
387 $companysection .= dol_print_email($mysoc->email, 0, 0, 1);
388 $companysection .= '</div>';
389 }
390
391 if ($mysoc->url) {
392 $companysection .= '<div class="flexitemsmall">';
393 $companysection .= img_picto('', 'globe', 'class="pictofixedwidth"');
394 $companysection .= dol_print_url($mysoc->url, '_blank', 0, 0, '');
395 $companysection .= '</div>';
396 }
397
398 if ($mysoc->phone) {
399 $companysection .= '<div class="flexitemsmall">';
400 $companysection .= img_picto('', 'phone', 'class="pictofixedwidth"');
401 $companysection .= dol_print_phone($mysoc->phone, $mysoc->country_code, 0, $mysoc->id, 'tel', ' ', 0, '');
402 $companysection .= '</div>';
403 }
404 if ($mysoc->fax) {
405 $companysection .= '<div class="flexitemsmall">';
406 $companysection .= img_picto('', 'phoning_fax', 'class="pictofixedwidth"');
407 $companysection .= dol_print_phone($mysoc->fax, $mysoc->country_code, 0, $mysoc->id, 'fax', ' ', 0, '');
408 $companysection .= '</div>';
409 }
410
411 // Social networks
412 if (!empty($mysoc->socialnetworks) && is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) {
413 foreach ($mysoc->socialnetworks as $key => $value) {
414 if ($value) {
415 $companysection .= '<div class="flexitemsmall wordbreak">'.dol_print_socialnetworks($value, 0, $mysoc->id, $key, $socialnetworksdict).'</div>';
416 }
417 }
418 }
419
420 // 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)
421 // Define logo and logosmall
422 $logosmall = $mysoc->logo_squarred_small ? $mysoc->logo_squarred_small : $mysoc->logo_small;
423 $logo = $mysoc->logo_squarred ? $mysoc->logo_squarred : $mysoc->logo;
424 $paramlogo = 'ONLINE_USER_LOGO_'.$suffix;
425 if (getDolGlobalString($paramlogo)) {
426 $logosmall = getDolGlobalString($paramlogo);
427 } elseif (getDolGlobalString('ONLINE_USER_LOGO')) {
428 $logosmall = getDolGlobalString('ONLINE_USER_LOGO');
429 }
430 //print '<!-- Show logo (logosmall='.$logosmall.' logo='.$logo.') -->'."\n";
431 // Define urllogo
432 $urllogo = '';
433 $urllogofull = '';
434 if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) {
435 $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany'.($conf->entity > 1 ? '&amp;entity='.$conf->entity : '').'&amp;file='.urlencode('logos/thumbs/'.$logosmall);
436 $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany'.($conf->entity > 1 ? '&entity='.$conf->entity : '').'&file='.urlencode('logos/thumbs/'.$logosmall);
437 } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) {
438 $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany'.($conf->entity > 1 ? '&amp;entity='.$conf->entity : '').'&amp;file='.urlencode('logos/'.$logo);
439 $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany'.($conf->entity > 1 ? '&entity='.$conf->entity : '').'&file='.urlencode('logos/'.$logo);
440 }
441 // Output html code for logo
442 if ($urllogo) {
443 print '<div class="logopublicpayment center">';
444 if (!empty($mysoc->url)) {
445 print '<a href="'.$mysoc->url.'" target="_blank" rel="noopener">';
446 }
447 print '<img class="userphotopublicvcard" id="dolpaymentlogo" src="'.$urllogofull.'">';
448 if (!empty($mysoc->url)) {
449 print '</a>';
450 }
451 print '</div>';
452 }
453 print '<table id="dolpaymenttable" summary="Job position offer" class="center">'."\n";
454
455 // Output payment summary form
456 print '<tr><td class="left">';
457
458 print '<div class="nowidthimp nopaddingtoponsmartphone" id="tablepublicpayment">';
459
460 // Add company info
461 if ($mysoc->name) {
462 print '<div class="center bold">';
463 print dol_escape_htmltag($mysoc->name);
464 print '</div>';
465 print '<br>';
466 }
467
468 print $companysection;
469
470 print '</div>'."\n";
471 print "\n";
472
473 print '</td></tr>'."\n";
474
475 print '</table>'."\n";
476}
477
478
479// Description
480$text = getDolUserString('USER_PUBLIC_MORE', '', $object);
481print $text;
482
483
484print '</form>'."\n";
485print '</div>'."\n";
486print '<br>';
487
488
489print '<div class="backgreypublicpayment">';
490print '<div class="center">';
491print '<a href="'.$urlforqrcode.'">';
492// Download / AddToContacts
493print img_picto($langs->trans("Download").' VCF', 'add').' ';
494print $langs->trans("Download").' VCF';
495print '</a>';
496print '</div>';
497//print '<div>';
498//print '</div>';
499print '</div>';
500
501$fullexternaleurltovirtualcard = $object->getOnlineVirtualCardUrl('', 'external');
502$fullinternalurltovirtualcard = $object->getOnlineVirtualCardUrl('', 'internal');
503
504print '<script>';
505print 'jQuery(document).ready(function() {
506 jQuery(".virtualcardpreview").click(function(event) {
507 event.preventDefault();
508 console.log("We click on the card");
509 window.open("'.$fullexternaleurltovirtualcard.'");
510 });
511});';
512print '</script>';
513
514llxFooter('', 'public');
515
516$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage contact/addresses.
Class to manage generation of HTML components Only common components must be here.
Class to manage Dolibarr users.
Class to build vCard files.
dol_print_phone($phone, $countrycode='', $cid=0, $socid=0, $addlink='', $separ="&nbsp;", $withpicto='', $titlealt='', $adddivfloat=0, $morecss='')
Format phone numbers according to country.
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_format_address($object, $withcountry=0, $sep="\n", $outputlangs=null, $mode=0, $extralangcode='')
Return a formatted address (part address/zip/town/state) according to country rules.
getDolUserInt($key, $default=0, $tmpuser=null)
Return Dolibarr user constant int value.
dol_print_url($url, $target='_blank', $max=32, $withpicto=0, $morecss='')
Show Url link.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolUserString($key, $default='', $tmpuser=null)
Return Dolibarr user constant string value.
dol_print_email($email, $cid=0, $socid=0, $addlink=0, $max=64, $showinvalid=1, $withpicto=0)
Show EMail link formatted for HTML output.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
getImageFileNameForSize($file, $extName, $extImgTarget='')
Return the filename of file to get the thumbs.
getArrayOfSocialNetworks()
Get array of social network dictionary.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dolIsAllowedForPreview($file)
Return if a file is qualified for preview.
dol_print_address($address, $htmlid, $element, $id, $noprint=0, $charfornl='')
Format address string.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
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...
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
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)
Returns a hash (non reversible encryption) of a string.