25if (!defined(
'NOLOGIN')) {
28if (!defined(
'NOCSRFCHECK')) {
29 define(
"NOCSRFCHECK", 1);
31if (!defined(
'NOIPCHECK')) {
32 define(
'NOIPCHECK',
'1');
34if (!defined(
'NOBROWSERNOTIF')) {
35 define(
'NOBROWSERNOTIF',
'1');
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';
45$langs->loadLangs(array(
"companies",
"other",
"recruitment"));
48$action =
GETPOST(
'action',
'aZ09');
50$cancel =
GETPOST(
'cancel',
'alpha');
54$securekey =
GETPOST(
'securekey',
'alpha');
63$urlwithroot = DOL_MAIN_URL_ROOT;
67$encodedsecurekey =
dol_hash($conf->file->instance_unique_id.
'uservirtualcard'.
$object->id.
'-'.
$object->login,
'md5');
68if ($encodedsecurekey != $securekey) {
82 if (!empty($backtopage)) {
83 header(
"Location: ".$backtopage);
99$modulepart =
'userphotopublic';
100$dir = $conf->user->dir_output;
117if (!empty($logosmall) && is_readable($dir.
'/'.$logosmall)) {
118 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart='.urlencode($modulepart).($conf->entity > 1 ?
'&entity='.$conf->entity :
'').
'&securekey='.urlencode($securekey).
'&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 ?
'&entity='.$conf->entity :
'').
'&securekey='.urlencode($securekey).
'&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);
132if (
getDolUserInt(
'USER_PUBLIC_HIDE_JOBPOSITION', 0, $object)) {
141if (
getDolUserInt(
'USER_PUBLIC_HIDE_OFFICE_PHONE', 0, $object)) {
144if (
getDolUserInt(
'USER_PUBLIC_HIDE_OFFICE_FAX', 0, $object)) {
147if (
getDolUserInt(
'USER_PUBLIC_HIDE_USER_MOBILE', 0, $object)) {
150if (
getDolUserInt(
'USER_PUBLIC_HIDE_SOCIALNETWORKS', 0, $object)) {
170if ($mode ==
'vcard') {
172 $output = $v->buildVCardString($object, $company, $langs, $urllogofull);
174 $filename = trim(urldecode($v->getFileName()));
180 header(
"Content-Disposition: attachment; filename=\"".$filename.
"\"");
181 header(
"Content-Length: ".
dol_strlen($output));
182 header(
"Connection: close");
193 $head =
'<link rel="stylesheet" type="text/css" href="' .
getDolGlobalString(
'MAIN_USER_PROFILE_CSS_URL').
'?lang='.$langs->defaultlang.
'">'.
"\n";
196$conf->dol_hide_topmenu = 1;
197$conf->dol_hide_leftmenu = 1;
200 $langs->load(
"errors");
201 print
'<div class="error">'.$langs->trans(
'ErrorPublicInterfaceNotEnabled').
'</div>';
207$arrayofcss = array();
209$replacemainarea = (empty($conf->dol_hide_leftmenu) ?
'<div>' :
'').
'<div>';
210llxHeader($head,
$object->getFullName($langs).
' - '.$langs->trans(
"PublicVirtualCard"),
'',
'', 0, 0,
'',
'',
'',
'onlinepaymentbody'.(GETPOST(
'mode')==
'preview' ?
' scalepreview cursorpointer virtualcardpreview' :
''), $replacemainarea, 1, 1);
214@media (prefers-color-scheme: dark) {
216 background-color: #CCC !important;
222print
'<span id="dolpaymentspan"></span>'.
"\n";
223print
'<div class="center">'.
"\n";
225print
'<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
226print
'<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
227print
'<input type="hidden" name="action" value="dosubmit">'.
"\n";
228print
'<input type="hidden" name="securekey" value="'.$securekey.
'">'.
"\n";
229print
'<input type="hidden" name="entity" value="'.$conf->entity.
'" />';
233print
'<div class="backgreypublicpayment">';
234print
'<div class="logopublicpayment">';
237print
'<div class="double colortext">'.$object->getFullName($langs).
'</div>';
240 print
'<div class="">';
245 print
'<div class="bold">';
260 print
'<div class="backimagepublicrecruitment">';
261 print
'<img id="idUSER_IMAGE_PUBLIC_INTERFACE" src="' .
getDolGlobalString(
'USER_IMAGE_PUBLIC_INTERFACE').
'">';
265$urlforqrcode =
$object->getOnlineVirtualCardUrl(
'vcard');
272$showbarcode =
GETPOST(
'nobarcode') ? 0 : 1;
274 $outdir = $conf->user->dir_temp;
276 $filename = $v->buildVCardString($object, $company, $langs,
'', $outdir);
279 print
'<div class="floatleft inline-block valignmiddle paddingleft paddingright">';
280 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)).
'">';
292 $usersection .=
'<div class="flexitemsmall">';
294 $usersection .=
'</div>';
299 $usersection .=
'<div class="flexitemsmall">';
300 $usersection .=
img_picto(
'',
'globe',
'class="pictofixedwidth"');
302 $usersection .=
'</div>';
307 $usersection .=
'<div class="flexitemsmall">';
308 $usersection .=
img_picto(
'',
'phone',
'class="pictofixedwidth"');
310 $usersection .=
'</div>';
313 $usersection .=
'<div class="flexitemsmall">';
314 $usersection .=
img_picto(
'',
'phoning_fax',
'class="pictofixedwidth"');
316 $usersection .=
'</div>';
319 $usersection .=
'<div class="flexitemsmall">';
320 $usersection .=
img_picto(
'',
'phone',
'class="pictofixedwidth"');
322 $usersection .=
'</div>';
325 $usersection .=
'<div class="flexitemsmall">';
326 $usersection .=
img_picto(
'',
'calendar',
'class="pictofixedwidth"');
328 $usersection .=
'</div>';
331 $usersection .=
'<div class="flexitemsmall">';
332 $usersection .=
img_picto(
'',
'state',
'class="pictofixedwidth"');
334 $usersection .=
'</div>';
338if (!empty(
$object->socialnetworks) && is_array(
$object->socialnetworks) && count(
$object->socialnetworks) > 0) {
339 if (!
getDolUserInt(
'USER_PUBLIC_HIDE_SOCIALNETWORKS', 0, $object)) {
340 foreach (
$object->socialnetworks as $key => $value) {
342 $usersection .=
'<div class="flexitemsmall">'.dol_print_socialnetworks($value, 0, $mysoc->id, $key, $socialnetworksdict).
'</div>';
351 print
'<img class="userphotopublicvcard" id="dolpaymentlogo" src="'.$urllogofull.
'">';
354 print
'<table id="dolpaymenttable" summary="Job position offer" class="center">'.
"\n";
357 print
'<tr><td class="left">';
359 print
'<div class="nowidthimp nopaddingtoponsmartphone" id="tablepublicpayment">';
366 print
'</td></tr>'.
"\n";
368 print
'</table>'.
"\n";
372 print
'<br><center><img class="userphotopublicvcard" style="position: unset !important;" id="dolpaymentlogo" src="'.$urllogofull.
'"></center>';
378 $companysection =
'';
381 $companysection .=
'<div class="flexitemsmall">';
382 $companysection .=
img_picto(
'',
'email',
'class="pictofixedwidth"');
384 $companysection .=
'</div>';
388 $companysection .=
'<div class="flexitemsmall">';
389 $companysection .=
img_picto(
'',
'globe',
'class="pictofixedwidth"');
390 $companysection .=
dol_print_url($mysoc->url,
'_blank', 0, 0,
'');
391 $companysection .=
'</div>';
395 $companysection .=
'<div class="flexitemsmall">';
396 $companysection .=
img_picto(
'',
'phone',
'class="pictofixedwidth"');
397 $companysection .=
dol_print_phone($mysoc->phone, $mysoc->country_code, 0, $mysoc->id,
'tel',
' ',
'',
'');
398 $companysection .=
'</div>';
401 $companysection .=
'<div class="flexitemsmall">';
402 $companysection .=
img_picto(
'',
'phoning_fax',
'class="pictofixedwidth"');
403 $companysection .=
dol_print_phone($mysoc->fax, $mysoc->country_code, 0, $mysoc->id,
'fax',
' ',
'',
'');
404 $companysection .=
'</div>';
408 if (!empty($mysoc->socialnetworks) && is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) {
409 foreach ($mysoc->socialnetworks as $key => $value) {
411 $companysection .=
'<div class="flexitemsmall wordbreak">'.dol_print_socialnetworks($value, 0, $mysoc->id, $key, $socialnetworksdict).
'</div>';
418 $logosmall = $mysoc->logo_squarred_small ? $mysoc->logo_squarred_small : $mysoc->logo_small;
419 $logo = $mysoc->logo_squarred ? $mysoc->logo_squarred : $mysoc->logo;
420 $paramlogo =
'ONLINE_USER_LOGO_'.$suffix;
430 if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.
'/logos/thumbs/'.$logosmall)) {
431 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany'.($conf->entity > 1 ?
'&entity='.$conf->entity :
'').
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
432 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany'.($conf->entity > 1 ?
'&entity='.$conf->entity :
'').
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
433 } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.
'/logos/'.$logo)) {
434 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany'.($conf->entity > 1 ?
'&entity='.$conf->entity :
'').
'&file='.urlencode(
'logos/'.$logo);
435 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany'.($conf->entity > 1 ?
'&entity='.$conf->entity :
'').
'&file='.urlencode(
'logos/'.$logo);
439 print
'<div class="logopublicpayment center">';
440 if (!empty($mysoc->url)) {
441 print
'<a href="'.$mysoc->url.
'" target="_blank" rel="noopener">';
443 print
'<img class="userphotopublicvcard" id="dolpaymentlogo" src="'.$urllogofull.
'">';
444 if (!empty($mysoc->url)) {
449 print
'<table id="dolpaymenttable" summary="Job position offer" class="center">'.
"\n";
452 print
'<tr><td class="left">';
454 print
'<div class="nowidthimp nopaddingtoponsmartphone" id="tablepublicpayment">';
458 print
'<div class="center bold">';
464 print $companysection;
469 print
'</td></tr>'.
"\n";
471 print
'</table>'.
"\n";
485print
'<div class="backgreypublicpayment">';
486print
'<div class="center">';
487print
'<a href="'.$urlforqrcode.
'">';
489print
img_picto($langs->trans(
"Download").
' VCF',
'add').
' ';
490print $langs->trans(
"Download").
' VCF';
497$fullexternaleurltovirtualcard =
$object->getOnlineVirtualCardUrl(
'',
'external');
498$fullinternalurltovirtualcard =
$object->getOnlineVirtualCardUrl(
'',
'internal');
501print
'jQuery(document).ready(function() {
502 jQuery(".virtualcardpreview").click(function(event) {
503 event.preventDefault();
504 console.log("We click on the card");
505 window.open("'.$fullexternaleurltovirtualcard.
'");
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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.
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)
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=" ", $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)
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.