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