dolibarr 21.0.3
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
52// Load translation files required by the page
53$langs->loadLangs(array("companies", "other", "recruitment"));
54
55// Get parameters
56$action = GETPOST('action', 'aZ09');
57$mode = GETPOST('mode', 'aZ09');
58$cancel = GETPOST('cancel', 'alpha');
59$backtopage = '';
60
61$id = GETPOSTINT('id');
62$securekey = GETPOST('securekey', 'alpha');
63$suffix = GETPOST('suffix');
64
65$object = new User($db);
66$object->fetch($id, '', '', 1);
67
68// Define $urlwithroot
69//$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
70//$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
71$urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost.
72
73// Security check
74global $conf;
75$encodedsecurekey = dol_hash($conf->file->instance_unique_id.'uservirtualcard'.$object->id.'-'.$object->login, 'md5');
76if ($encodedsecurekey != $securekey) {
77 httponly_accessforbidden('Bad value for securitykey or public profile not enabled');
78}
79
80if (!getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
81 httponly_accessforbidden('Bad value for securitykey or public profile not enabled');
82}
83
84
85/*
86 * Actions
87 */
88
89if ($cancel) {
90 if (!empty($backtopage)) {
91 header("Location: ".$backtopage);
92 exit;
93 }
94 $action = 'view';
95}
96
97
98/*
99 * View
100 */
101
102$v = new vCard();
103
104$company = $mysoc;
105
106$modulepart = 'userphotopublic';
107$dir = $conf->user->dir_output;
108
109// 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)
110// Define logo and logosmall
111$logo = '';
112$logosmall = '';
113if (!empty($object->photo)) {
114 if (dolIsAllowedForPreview($object->photo)) {
115 $logosmall = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
116 $logo = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
117 //$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
118 }
119}
120//print '<!-- Show logo (logosmall='.$logosmall.' logo='.$logo.') -->'."\n";
121// Define urllogo
122$urllogo = '';
123$urllogofull = '';
124if (!empty($logosmall) && is_readable($dir.'/'.$logosmall)) {
125 $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart='.urlencode($modulepart).($conf->entity > 1 ? '&amp;entity='.$conf->entity : '').'&amp;securekey='.urlencode($securekey).'&amp;file='.urlencode($logosmall);
126 $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart='.$modulepart.($conf->entity > 1 ? '&entity='.$conf->entity : '').'&securekey='.urlencode($securekey).'&file='.urlencode($logosmall);
127} elseif (!empty($logo) && is_readable($dir.'/'.$logo)) {
128 $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart='.urlencode($modulepart).($conf->entity > 1 ? '&amp;entity='.$conf->entity : '').'&amp;securekey='.urlencode($securekey).'&amp;file='.urlencode($logo);
129 $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart='.$modulepart.($conf->entity > 1 ? '&entity='.$conf->entity : '').'&securekey='.urlencode($securekey).'&file='.urlencode($logo);
130}
131
132// Clean data we don't want on public page
133if (getDolUserInt('USER_PUBLIC_HIDE_PHOTO', 0, $object)) {
134 $logo = '';
135 $logosmall = '';
136 $urllogo = '';
137 $urllogofull = '';
138}
139if (getDolUserInt('USER_PUBLIC_HIDE_JOBPOSITION', 0, $object)) {
140 $object->job = '';
141}
142if (getDolUserInt('USER_PUBLIC_HIDE_EMAIL', 0, $object)) {
143 $object->email = '';
144}
145if (getDolUserInt('USER_PUBLIC_HIDE_EMAIL', 0, $object)) {
146 $object->job = '';
147}
148if (getDolUserInt('USER_PUBLIC_HIDE_OFFICE_PHONE', 0, $object)) {
149 $object->office_phone = '';
150}
151if (getDolUserInt('USER_PUBLIC_HIDE_OFFICE_FAX', 0, $object)) {
152 $object->office_fax = '';
153}
154if (getDolUserInt('USER_PUBLIC_HIDE_USER_MOBILE', 0, $object)) {
155 $object->user_mobile = '';
156}
157if (getDolUserInt('USER_PUBLIC_HIDE_SOCIALNETWORKS', 0, $object)) {
158 $object->socialnetworks = [];
159} else {
160 // Show list of social networks for company
161 $listofnetworks = $object->socialnetworks;
162
163 if (!empty($listofnetworks)) {
164 foreach ($listofnetworks as $key => $networkVal) {
165 if (getDolUserInt('USER_PUBLIC_HIDE_SOCIALNETWORKS_'.strtoupper($key), 0, $object)) {
166 unset($object->socialnetworks[$key]);
167 }
168 }
169 }
170}
171
172// By default, personal birthdate and address is not visible
173if (!getDolUserInt('USER_PUBLIC_SHOW_BIRTH', 0, $object)) {
174 $object->birth = null;
175}
176if (!getDolUserInt('USER_PUBLIC_SHOW_ADDRESS', 0, $object)) {
177 $object->address = '';
178 $object->town = '';
179 $object->zip = '';
180 $object->state = '';
181 $object->country = '';
182}
183
184if (getDolUserInt('USER_PUBLIC_HIDE_COMPANY', 0, $object)) {
185 $company = null;
186}
187if (getDolUserInt('SOCIETE_PUBLIC_HIDE_EMAIL', 0, $object)) {
188 $mysoc->email = '';
189}
190if (getDolUserInt('SOCIETE_PUBLIC_HIDE_OFFICE_PHONE', 0, $object)) {
191 $mysoc->phone = '';
192}
193if (getDolUserInt('SOCIETE_PUBLIC_HIDE_OFFICE_FAX', 0, $object)) {
194 $mysoc->fax = '';
195}
196if (getDolUserInt('SOCIETE_PUBLIC_HIDE_URL', 0, $object)) {
197 $mysoc->url = '';
198}
199if (getDolUserInt('USER_PUBLIC_HIDE_SOCIALNETWORKS_BUSINESS', 0, $object) && is_object($company)) {
200 $company->socialnetworks = [];
201} else {
202 // Show list of social networks for company
203 $listofnetworks = $mysoc->socialnetworks;
204
205 if (!empty($listofnetworks)) {
206 foreach ($listofnetworks as $key => $networkVal) {
207 if (getDolUserInt('SOCIETE_PUBLIC_HIDE_SOCIALNETWORKS_'.strtoupper($key), 0, $object)) {
208 unset($mysoc->socialnetworks[$key]);
209 }
210 }
211 }
212}
213
214// Output vcard
215if ($mode == 'vcard') {
216 // We create VCard
217 $output = $v->buildVCardString($object, $company, $langs, $urllogofull);
218
219 $filename = trim(urldecode($v->getFileName())); // "Nom prenom.vcf"
220 $filenameurlencoded = dol_sanitizeFileName(urlencode($filename));
221 //$filename = dol_sanitizeFileName($filename);
222
223 top_httphead('text/vcard; name="'.$filename.'"');
224
225 header("Content-Disposition: attachment; filename=\"".$filename."\"");
226 header("Content-Length: ".dol_strlen($output));
227 header("Connection: close");
228
229 print $output;
230
231 $db->close();
232
233 exit;
234}
235
236$head = '';
237if (getDolGlobalString('MAIN_USER_PROFILE_CSS_URL')) {
238 $head = '<link rel="stylesheet" type="text/css" href="' . getDolGlobalString('MAIN_USER_PROFILE_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n";
239}
240
241$conf->dol_hide_topmenu = 1;
242$conf->dol_hide_leftmenu = 1;
243
244if (!getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
245 $langs->load("errors");
246 print '<div class="error">'.$langs->trans('ErrorPublicInterfaceNotEnabled').'</div>';
247 $db->close();
248 exit();
249}
250
251$arrayofjs = array();
252$arrayofcss = array();
253
254$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
255llxHeader($head, $object->getFullName($langs).' - '.$langs->trans("PublicVirtualCard"), '', '', 0, 0, $arrayofjs, $arrayofcss, '', 'onlinepaymentbody'.(GETPOST('mode') == 'preview' ? ' scalepreview cursorpointer virtualcardpreview' : ''), $replacemainarea, 1, 1);
256
257print '
258<style>
259@media (prefers-color-scheme: dark) {
260 form {
261 background-color: #CCC !important;
262 }
263}
264</style>
265';
266
267print '<span id="dolpaymentspan"></span>'."\n";
268print '<div class="center">'."\n";
269
270print '<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
271print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
272print '<input type="hidden" name="action" value="dosubmit">'."\n";
273print '<input type="hidden" name="securekey" value="'.$securekey.'">'."\n";
274print '<input type="hidden" name="entity" value="'.$conf->entity.'" />';
275print "\n";
276
277// Output html code for logo
278print '<div class="backgreypublicpayment">';
279print '<div class="logopublicpayment">';
280
281// Name
282print '<div class="double colortext">'.$object->getFullName($langs).'</div>';
283// User position
284if ($object->job && !getDolUserInt('USER_PUBLIC_HIDE_JOBPOSITION', 0, $object)) {
285 print '<div class="">';
286 print dol_escape_htmltag($object->job);
287 print '</div>';
288}
289if (!getDolUserInt('USER_PUBLIC_HIDE_COMPANY', 0, $object)) {
290 print '<div class="bold">';
291 print dol_escape_htmltag($mysoc->name);
292 print '</div>';
293}
294
295
296
297print '</div>';
298/*if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
299 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>';
300}*/
301print '</div>';
302
303
304if (getDolGlobalString('USER_IMAGE_PUBLIC_INTERFACE')) {
305 print '<div class="backimagepublicrecruitment">';
306 print '<img id="idUSER_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('USER_IMAGE_PUBLIC_INTERFACE').'">';
307 print '</div>';
308}
309
310// url for the download .vcf file link
311$urlforqrcode = $object->getOnlineVirtualCardUrl('vcard');
312
313$socialnetworksdict = getArrayOfSocialNetworks();
314
315
316// Show barcode
317$showbarcode = GETPOST('nobarcode') ? 0 : 1;
318if ($showbarcode) {
319 $outdir = $conf->user->dir_temp;
320
321 $filename = $v->buildVCardString($object, $company, $langs, '', $outdir);
322
323 $encodedsecurekey = dol_hash($conf->file->instance_unique_id.'uservirtualcard'.$object->id.'-'.$object->login, 'md5');
324 if (isModEnabled('multicompany')) {
325 $entity_qr = '&entity='.((int) $conf->entity);
326 } else {
327 $entity_qr = '';
328 }
329
330 print '<br>';
331 print '<div class="floatleft inline-block valignmiddle paddingleft paddingright">';
332 //print '<!-- filename = '.dol_escape_htmltag($filename).' -->';
333 print '<img style="max-width: 100%" src="'.$dolibarr_main_url_root.'/viewimage.php?modulepart=barcode'.$entity_qr.'&generator=tcpdfbarcode&encoding=QRCODE&code='.urlencode(basename($filename)).'&securekey='.$encodedsecurekey.'">';
334 print '</div>';
335 print '<br>';
336}
337
338
339// Me section
340
341$usersection = '';
342
343// User email
344if ($object->email && !getDolUserInt('USER_PUBLIC_HIDE_EMAIL', 0, $object)) {
345 $usersection .= '<div class="flexitemsmall">';
346 $usersection .= dol_print_email($object->email, 0, 0, 1, 0, 1, 1);
347 $usersection .= '</div>';
348}
349
350// User url
351if ($object->url && !getDolUserInt('USER_PUBLIC_HIDE_URL', 0, $object)) {
352 $usersection .= '<div class="flexitemsmall">';
353 $usersection .= img_picto('', 'globe', 'class="pictofixedwidth"');
354 $usersection .= dol_print_url($object->url, '_blank', 0, 0, '');
355 $usersection .= '</div>';
356}
357
358// Office phone
359if ($object->office_phone && !getDolUserInt('USER_PUBLIC_HIDE_OFFICE_PHONE', 0, $object)) {
360 $usersection .= '<div class="flexitemsmall">';
361 $usersection .= img_picto('', 'phone', 'class="pictofixedwidth"');
362 $usersection .= dol_print_phone($object->office_phone, $object->country_code, 0, $mysoc->id, 'tel', ' ', '', '');
363 $usersection .= '</div>';
364}
365// Office fax
366if ($object->office_fax && !getDolUserInt('USER_PUBLIC_HIDE_OFFICE_FAX', 0, $object)) {
367 $usersection .= '<div class="flexitemsmall">';
368 $usersection .= img_picto('', 'phoning_fax', 'class="pictofixedwidth"');
369 $usersection .= dol_print_phone($object->office_fax, $object->country_code, 0, $mysoc->id, 'fax', ' ', '', '');
370 $usersection .= '</div>';
371}
372// Mobile
373if ($object->user_mobile && !getDolUserInt('USER_PUBLIC_HIDE_USER_MOBILE', 0, $object)) {
374 $usersection .= '<div class="flexitemsmall">';
375 $usersection .= img_picto('', 'phoning_mobile', 'class="pictofixedwidth"');
376 $usersection .= dol_print_phone($object->user_mobile, $object->country_code, 0, $mysoc->id, 'tel', ' ', '', '');
377 $usersection .= '</div>';
378}
379if (getDolUserInt('USER_PUBLIC_SHOW_BIRTH', 0, $object) && !is_null($object->birth)) {
380 $usersection .= '<div class="flexitemsmall">';
381 $usersection .= img_picto('', 'calendar', 'class="pictofixedwidth"');
382 $usersection .= dol_print_date($object->birth);
383 $usersection .= '</div>';
384}
385if (getDolUserInt('USER_PUBLIC_SHOW_ADDRESS', 0, $object) && $object->address) {
386 $usersection .= '<div class="flexitemsmall">';
387 $usersection .= img_picto('', 'state', 'class="pictofixedwidth"');
388 $usersection .= dol_print_address(dol_format_address($object, 0, "\n", $langs), 'map', 'user', $object->id, 1);
389 $usersection .= '</div>';
390}
391
392// Social networks
393if (!empty($object->socialnetworks) && is_array($object->socialnetworks)) {
394 if (!getDolUserString('USER_PUBLIC_HIDE_SOCIALNETWORKS', 0, $object)) {
395 $listOfSocialNetworks = $object->socialnetworks;
396 foreach ($listOfSocialNetworks as $key => $value) {
397 if (!getDolUserString('USER_HIDE_SOCIALNETWORK_'.strtoupper($key), 0, $object)) {
398 $usersection .= '<div class="flexitemsmall">'.dol_print_socialnetworks($value, 0, $object->id, strtolower($key), $socialnetworksdict).'</div>';
399 }
400 }
401 }
402}
403
404if ($usersection) {
405 // Show photo
406 if ($urllogo) {
407 print '<img class="userphotopublicvcard" id="dolpaymentlogo" src="'.$urllogofull.'">';
408 } else {
409 print '<br>';
410 }
411
412 print '<table id="dolpaymenttable" summary="Job position offer" class="center">'."\n";
413
414 // Output payment summary form
415 print '<tr><td class="left">';
416
417 print '<div class="nowidthimp nopaddingtoponsmartphone" id="tablepublicpayment">';
418
419 print $usersection;
420
421 print '</div>'."\n";
422 print "\n";
423
424 print '</td></tr>'."\n";
425
426 print '</table>'."\n";
427} else {
428 // Show photo
429 if ($urllogo) {
430 print '<br><center><img class="userphotopublicvcard" style="position: unset !important;" id="dolpaymentlogo" src="'.$urllogofull.'"></center>';
431 }
432}
433
434
435if (!getDolUserInt('USER_PUBLIC_HIDE_COMPANY', 0, $object)) {
436 $companysection = '';
437
438 if ($mysoc->email) {
439 $companysection .= '<div class="flexitemsmall">';
440 $companysection .= img_picto('', 'email', 'class="pictofixedwidth"');
441 $companysection .= dol_print_email($mysoc->email, 0, 0, 1);
442 $companysection .= '</div>';
443 }
444
445 if ($mysoc->url) {
446 $companysection .= '<div class="flexitemsmall">';
447 $companysection .= img_picto('', 'globe', 'class="pictofixedwidth"');
448 $companysection .= dol_print_url($mysoc->url, '_blank', 0, 0, '');
449 $companysection .= '</div>';
450 }
451
452 if ($mysoc->phone) {
453 $companysection .= '<div class="flexitemsmall">';
454 $companysection .= img_picto('', 'phone', 'class="pictofixedwidth"');
455 $companysection .= dol_print_phone($mysoc->phone, $mysoc->country_code, 0, $mysoc->id, 'tel', ' ', '', '');
456 $companysection .= '</div>';
457 }
458 if ($mysoc->fax) {
459 $companysection .= '<div class="flexitemsmall">';
460 $companysection .= img_picto('', 'phoning_fax', 'class="pictofixedwidth"');
461 $companysection .= dol_print_phone($mysoc->fax, $mysoc->country_code, 0, $mysoc->id, 'fax', ' ', '', '');
462 $companysection .= '</div>';
463 }
464
465 // Social networks
466 if (!empty($mysoc->socialnetworks) && is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) {
467 if (!getDolUserInt('USER_PUBLIC_HIDE_SOCIALNETWORKS_BUSINESS', 0, $object)) {
468 foreach ($mysoc->socialnetworks as $key => $value) {
469 if (!getDolUserInt('SOCIETE_PUBLIC_HIDE_SOCIALNETWORKS_'.strtoupper($key), 0, $object)) {
470 $companysection .= '<div class="flexitemsmall wordbreak">'.dol_print_socialnetworks($value, 0, $mysoc->id, $key, $socialnetworksdict).'</div>';
471 }
472 }
473 }
474 }
475
476 // 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)
477 // Define logo and logosmall
478 $logosmall = $mysoc->logo_squarred_small ? $mysoc->logo_squarred_small : $mysoc->logo_small;
479 $logo = $mysoc->logo_squarred ? $mysoc->logo_squarred : $mysoc->logo;
480 $paramlogo = 'ONLINE_USER_LOGO_'.$suffix;
481 if (getDolGlobalString($paramlogo)) {
482 $logosmall = getDolGlobalString($paramlogo);
483 } elseif (getDolGlobalString('ONLINE_USER_LOGO')) {
484 $logosmall = getDolGlobalString('ONLINE_USER_LOGO');
485 }
486 //print '<!-- Show logo (logosmall='.$logosmall.' logo='.$logo.') -->'."\n";
487 // Define urllogo
488 $urllogo = '';
489 $urllogofull = '';
490 if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) {
491 $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany'.($conf->entity > 1 ? '&amp;entity='.$conf->entity : '').'&amp;file='.urlencode('logos/thumbs/'.$logosmall);
492 $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany'.($conf->entity > 1 ? '&entity='.$conf->entity : '').'&file='.urlencode('logos/thumbs/'.$logosmall);
493 } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) {
494 $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany'.($conf->entity > 1 ? '&amp;entity='.$conf->entity : '').'&amp;file='.urlencode('logos/'.$logo);
495 $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany'.($conf->entity > 1 ? '&entity='.$conf->entity : '').'&file='.urlencode('logos/'.$logo);
496 }
497 // Output html code for logo
498 if ($urllogo) {
499 print '<div class="logopublicpayment center">';
500 if (!empty($mysoc->url)) {
501 print '<a href="'.$mysoc->url.'" target="_blank" rel="noopener">';
502 }
503 print '<img class="userphotopublicvcard" id="dolpaymentlogo" src="'.$urllogofull.'">';
504 if (!empty($mysoc->url)) {
505 print '</a>';
506 }
507 print '</div>';
508 }
509 print '<table id="dolpaymenttable" summary="Job position offer" class="center">'."\n";
510
511 // Output payment summary form
512 print '<tr><td class="left">';
513
514 print '<div class="nowidthimp nopaddingtoponsmartphone" id="tablepublicpayment">';
515
516 // Add company info
517 if ($mysoc->name) {
518 print '<div class="center bold">';
519 print dol_escape_htmltag($mysoc->name);
520 print '</div>';
521 print '<br>';
522 }
523
524 print $companysection;
525
526 print '</div>'."\n";
527 print "\n";
528
529 print '</td></tr>'."\n";
530
531 print '</table>'."\n";
532}
533
534
535// Description
536$text = getDolUserString('USER_PUBLIC_MORE', '', $object);
537print $text;
538
539
540print '</form>'."\n";
541print '</div>'."\n";
542print '<br>';
543
544
545print '<div class="backgreypublicpayment">';
546print '<div class="center">';
547print '<a href="'.$urlforqrcode.'">';
548// Download / AddToContacts
549print img_picto($langs->trans("Download").' VCF', 'add').' ';
550print $langs->trans("Download").' VCF';
551print '</a>';
552print '</div>';
553//print '<div>';
554//print '</div>';
555print '</div>';
556
557$fullexternaleurltovirtualcard = $object->getOnlineVirtualCardUrl('', 'external');
558$fullinternalurltovirtualcard = $object->getOnlineVirtualCardUrl('', 'internal');
559
560print '<script>';
561print 'jQuery(document).ready(function() {
562 jQuery(".virtualcardpreview").click(function(event) {
563 event.preventDefault();
564 console.log("We click on the card");
565 window.open("'.$fullexternaleurltovirtualcard.'");
566 });
567});';
568print '</script>';
569
570llxFooter('', 'public');
571
572$db->close();
$id
Definition account.php:48
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:87
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:71
Class to manage Dolibarr users.
Class to build vCard files.
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)
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.
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, $includequotes=0)
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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
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, $mode=0)
Returns a hash (non reversible encryption) of a string.