26require 
'../main.inc.php';
 
   27require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
 
   28require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
 
   29require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
 
   32$langs->loadLangs(array(
"users", 
"companies", 
"admin", 
"website"));
 
   37$action = 
GETPOST(
'action', 
'aZ09');
 
   38$dol_openinpopup = 
GETPOST(
'dol_openinpopup', 
'aZ09');
 
   40if (empty($id) && empty($ref)) {
 
   45if ($id > 0 || !empty($ref)) {
 
   46  $result = 
$object->fetch($id, $ref, 
'', 1);
 
   52if ($user->socid > 0) {
 
   53  $socid = $user->socid;
 
   55$feature2 = (($socid && $user->hasRight(
'user', 
'self', 
'creer')) ? 
'' : 
'user');
 
   57$result = 
restrictedArea($user, 
'user', $id, 
'user&user', $feature2);
 
   60if ((
$object->id != $user->id) && !$user->hasRight(
'user', 
'user', 
'lire')) {
 
   68if ($action == 
'update') {
 
   70  $tmparray[
'USER_PUBLIC_HIDE_PHOTO'] = (
GETPOST(
'USER_PUBLIC_HIDE_PHOTO') ? 1 : 0);
 
   71  $tmparray[
'USER_PUBLIC_HIDE_JOBPOSITION'] = (
GETPOST(
'USER_PUBLIC_HIDE_JOBPOSITION') ? 1 : 0);
 
   72  $tmparray[
'USER_PUBLIC_HIDE_EMAIL'] = (
GETPOST(
'USER_PUBLIC_HIDE_EMAIL') ? 1 : 0);
 
   73  $tmparray[
'USER_PUBLIC_HIDE_OFFICE_PHONE'] = (
GETPOST(
'USER_PUBLIC_HIDE_OFFICE_PHONE') ? 1 : 0);
 
   74  $tmparray[
'USER_PUBLIC_HIDE_OFFICE_FAX'] = (
GETPOST(
'USER_PUBLIC_HIDE_OFFICE_FAX') ? 1 : 0);
 
   75  $tmparray[
'USER_PUBLIC_HIDE_USER_MOBILE'] = (
GETPOST(
'USER_PUBLIC_HIDE_USER_MOBILE') ? 1 : 0);
 
   76  $tmparray[
'USER_PUBLIC_HIDE_SOCIALNETWORKS'] = (
GETPOST(
'USER_PUBLIC_HIDE_SOCIALNETWORKS') ? 1 : 0);
 
   77  $tmparray[
'USER_PUBLIC_SHOW_BIRTH'] = (
GETPOST(
'USER_PUBLIC_SHOW_BIRTH') ? 1 : 0);
 
   78  $tmparray[
'USER_PUBLIC_SHOW_ADDRESS'] = (
GETPOST(
'USER_PUBLIC_SHOW_ADDRESS') ? 1 : 0);
 
   79  $tmparray[
'USER_PUBLIC_HIDE_COMPANY'] = (
GETPOST(
'USER_PUBLIC_HIDE_COMPANY') ? 1 : 0);
 
   80  $tmparray[
'USER_PUBLIC_MORE'] = (
GETPOST(
'USER_PUBLIC_MORE') ? 
GETPOST(
'USER_PUBLIC_MORE') : 
'');
 
   85if ($action == 
'setUSER_ENABLE_PUBLIC') {
 
   87    $tmparray = array(
'USER_ENABLE_PUBLIC' => 1);
 
   89    $tmparray = array(
'USER_ENABLE_PUBLIC' => 0);
 
  102$title = $person_name.
" - ".$langs->trans(
'Info');
 
  104llxHeader(
'', $title, $help_url, 
'', 0, 0, 
'', 
'', 
'', 
'mod-user page-virtualcard');
 
  108$title = $langs->trans(
"User");
 
  120$morehtmlref = 
'<a href="'.DOL_URL_ROOT.
'/user/vcard.php?id='.
$object->id.
'&output=file&file='.urlencode(
dol_sanitizeFileName(
$object->getFullName($langs).
'.vcf')).
'" class="refid" rel="noopener">';
 
  121$morehtmlref .= 
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"), 
'vcard.png', 
'class="valignmiddle marginleftonly paddingrightonly"');
 
  122$morehtmlref .= 
'</a>';
 
  124$urltovirtualcard = 
'/user/virtualcard.php?id='.((int) 
$object->id);
 
  125$morehtmlref .= 
dolButtonToOpenUrlInDialogPopup(
'publicvirtualcard', $langs->transnoentitiesnoconv(
"PublicVirtualCardUrl").
' - '.
$object->getFullName($langs), 
img_picto($langs->trans(
"PublicVirtualCardUrl"), 
'card', 
'class="valignmiddle marginleftonly paddingrightonly"'), $urltovirtualcard, 
'', 
'nohover');
 
  128print 
'<div class="fichecenter">';
 
  132$param = 
'&id='.((int) 
$object->id);
 
  133if (GETPOSTISSET(
'dol_openinpopup')) {
 
  134  $param .= 
'&dol_openinpopup='.urlencode(
GETPOST(
'dol_openinpopup', 
'aZ09'));
 
  137$enabledisablehtml = $langs->trans(
"EnablePublicVirtualCard").
' ';
 
  140  $enabledisablehtml .= 
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?action=setUSER_ENABLE_PUBLIC&token='.
newToken().
'&value=1'.$param.
'">';
 
  141  $enabledisablehtml .= 
img_picto($langs->trans(
"Disabled"), 
'switch_off');
 
  142  $enabledisablehtml .= 
'</a>';
 
  144  $enabledisablehtml .= 
'<br><br><span class="opacitymedium">'.$langs->trans(
"UserPublicPageDesc").
'</span><br><br>';
 
  147  $enabledisablehtml .= 
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?action=setUSER_ENABLE_PUBLIC&token='.
newToken().
'&value=0'.$param.
'">';
 
  148  $enabledisablehtml .= 
img_picto($langs->trans(
"Activated"), 
'switch_on');
 
  149  $enabledisablehtml .= 
'</a>';
 
  151print $enabledisablehtml;
 
  152print 
'<input type="hidden" id="USER_ENABLE_PUBLIC" name="USER_ENABLE_PUBLIC" value="'.(!
getDolGlobalString(
'USER_ENABLE_PUBLIC') ? 0 : 1).
'">';
 
  156print 
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
 
  159  print 
'<input type="hidden" name="action" value="update">';
 
  160  print 
'<input type="hidden" name="id" value="'.$object->id.
'">';
 
  161  print 
'<input type="hidden" name="token" value="'.newToken().
'">';
 
  164  print 
img_picto(
'', 
'globe').
' <span class="opacitymedium">'.$langs->trans(
'PublicVirtualCardUrl').
'</span><br>';
 
  166  $fullexternaleurltovirtualcard = 
$object->getOnlineVirtualCardUrl(
'', 
'external');
 
  167  $fullinternalurltovirtualcard = 
$object->getOnlineVirtualCardUrl(
'', 
'internal');
 
  169  print 
'<div class="urllink">';
 
  170  print 
'<input type="text" id="publicurluser" class="quatrevingtpercentminusx" value="'.$fullexternaleurltovirtualcard.
'">';
 
  171  print 
'<a target="_blank" rel="noopener noreferrer" href="'.$fullexternaleurltovirtualcard.
'">'.
img_picto(
'', 
'globe', 
'class="paddingleft marginrightonly paddingright"').$langs->trans(
"GoTo").
'...</a>';
 
  179  print 
'<div class="centpercent margintoponly marginbottomonly">';
 
  180  print 
img_picto(
'', 
'setup', 
'class="pictofixedwidth"').
'<a id="lnk" href="#">'.$langs->trans(
"ShowAdvancedOptions").
'...</a>';
 
  183  print 
'<script type="text/javascript"> 
  184  jQuery(document).ready(function() { 
  185    jQuery("#lnk").click(function(event) { 
  186      event.preventDefault(); 
  187      console.log("We click on link to show virtual card options"); 
  192  function hideoptions(domelem) { 
  193    const div = document.getElementById("div_container_sub_exportoptions"); 
  195      if (div.style.display === "none") { 
  196        div.style.display = "block"; 
  197      domelem.innerText="'.dol_escape_js($langs->transnoentitiesnoconv(
"HideAdvancedoptions")).
'"; 
  199        div.style.display = "none"; 
  200      domelem.innerText="'.
dol_escape_js($langs->transnoentitiesnoconv(
"ShowAdvancedOptions")).
'..."; 
  206  print 
'<div id="div_container_sub_exportoptions" style="display: none;">';
 
  208  print 
'<div class="div-table-responsive-no-min">';
 
  209  print 
'<table class="noborder centpercent">';
 
  211  print 
'<tr class="liste_titre">';
 
  212  print 
'<td>'.$langs->trans(
"Options").
'</td>';
 
  213  print 
'<td>'.$langs->trans(
"Value").
'</td>';
 
  217  print 
'<tr class="oddeven" id="tredit"><td>';
 
  218  print $langs->trans(
"HideOnVCard", $langs->transnoentitiesnoconv(
"Photo"));
 
  220  print $form->selectyesno(
"USER_PUBLIC_HIDE_PHOTO", (
getDolUserInt(
'USER_PUBLIC_HIDE_PHOTO', 0, $object) ? 
getDolUserInt(
'USER_PUBLIC_HIDE_PHOTO', 0, $object) : 0), 1);
 
  221  print 
"</td></tr>\n";
 
  224  print 
'<tr class="oddeven" id="tredit"><td>';
 
  225  print $langs->trans(
"HideOnVCard", $langs->transnoentitiesnoconv(
"PostOrFunction"));
 
  227  print $form->selectyesno(
"USER_PUBLIC_HIDE_JOBPOSITION", (
getDolUserInt(
'USER_PUBLIC_HIDE_JOBPOSITION', 0, $object) ? 
getDolUserInt(
'USER_PUBLIC_HIDE_JOBPOSITION', 0, $object) : 0), 1);
 
  228  print 
"</td></tr>\n";
 
  231  print 
'<tr class="oddeven" id="tredit"><td>';
 
  232  print $langs->trans(
"HideOnVCard", $langs->transnoentitiesnoconv(
"Email"));
 
  234  print $form->selectyesno(
"USER_PUBLIC_HIDE_EMAIL", (
getDolUserInt(
'USER_PUBLIC_HIDE_EMAIL', 0, $object) ? 
getDolUserInt(
'USER_PUBLIC_HIDE_EMAIL', 0, $object) : 0), 1);
 
  235  print 
"</td></tr>\n";
 
  238  print 
'<tr class="oddeven" id="tredit"><td>';
 
  239  print $langs->trans(
"HideOnVCard", $langs->transnoentitiesnoconv(
"PhonePro"));
 
  241  print $form->selectyesno(
"USER_PUBLIC_HIDE_OFFICE_PHONE", (
getDolUserInt(
'USER_PUBLIC_HIDE_OFFICE_PHONE', 0, $object) ? 
getDolUserInt(
'USER_PUBLIC_HIDE_OFFICE_PHONE', 0, $object) : 0), 1);
 
  242  print 
"</td></tr>\n";
 
  245  print 
'<tr class="oddeven" id="tredit"><td>';
 
  246  print $langs->trans(
"HideOnVCard", $langs->transnoentitiesnoconv(
"Fax"));
 
  248  print $form->selectyesno(
"USER_PUBLIC_HIDE_OFFICE_FAX", (
getDolUserInt(
'USER_PUBLIC_HIDE_OFFICE_FAX', 0, $object) ? 
getDolUserInt(
'USER_PUBLIC_HIDE_OFFICE_FAX', 0, $object) : 0), 1);
 
  249  print 
"</td></tr>\n";
 
  252  print 
'<tr class="oddeven" id="tredit"><td>';
 
  253  print $langs->trans(
"HideOnVCard", $langs->transnoentitiesnoconv(
"PhoneMobile"));
 
  255  print $form->selectyesno(
"USER_PUBLIC_HIDE_USER_MOBILE", (
getDolUserInt(
'USER_PUBLIC_HIDE_USER_MOBILE', 0, $object) ? 
getDolUserInt(
'USER_PUBLIC_HIDE_USER_MOBILE', 0, $object) : 0), 1);
 
  256  print 
"</td></tr>\n";
 
  259  print 
'<tr class="oddeven" id="tredit"><td>';
 
  260  print $langs->trans(
"HideOnVCard", $langs->transnoentitiesnoconv(
"SocialNetworksInformation"));
 
  262  print $form->selectyesno(
"USER_PUBLIC_HIDE_SOCIALNETWORKS", (
getDolUserInt(
'USER_PUBLIC_HIDE_SOCIALNETWORKS', 0, $object) ? 
getDolUserInt(
'USER_PUBLIC_HIDE_SOCIALNETWORKS', 0, $object) : 0), 1);
 
  263  print 
"</td></tr>\n";
 
  266  print 
'<tr class="oddeven" id="tredit"><td>';
 
  267  print $langs->trans(
"ShowOnVCard", $langs->transnoentitiesnoconv(
"Birthdate"));
 
  269  print $form->selectyesno(
"USER_PUBLIC_SHOW_BIRTH", (
getDolUserInt(
'USER_PUBLIC_SHOW_BIRTH', 0, $object) ? 
getDolUserInt(
'USER_PUBLIC_SHOW_BIRTH', 0, $object) : 0), 1);
 
  270  print 
"</td></tr>\n";
 
  273  print 
'<tr class="oddeven" id="tredit"><td>';
 
  274  print $langs->trans(
"ShowOnVCard", $langs->transnoentitiesnoconv(
"Address"));
 
  276  print $form->selectyesno(
"USER_PUBLIC_SHOW_ADDRESS", (
getDolUserInt(
'USER_PUBLIC_SHOW_ADDRESS', 0, $object) ? 
getDolUserInt(
'USER_PUBLIC_SHOW_ADDRESS', 0, $object) : 0), 1);
 
  277  print 
"</td></tr>\n";
 
  280  print 
'<tr class="oddeven" id="tramount"><td>';
 
  281  print $langs->trans(
"HideOnVCard", $langs->transnoentitiesnoconv(
"CompanySection"));
 
  283  print $form->selectyesno(
"USER_PUBLIC_HIDE_COMPANY", (
getDolUserInt(
'USER_PUBLIC_HIDE_COMPANY', 0, $object) ? 
getDolUserInt(
'USER_PUBLIC_HIDE_COMPANY', 0, $object) : 0), 1);
 
  284  print 
"</td></tr>\n";
 
  287  print 
'<tr class="oddeven" id="tredit"><td>';
 
  288  print $langs->trans(
"Text");
 
  290  require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
 
  292  $doleditor = 
new DolEditor(
'USER_PUBLIC_MORE', 
getDolUserString(
'USER_PUBLIC_MORE', 
'', $object), 
'', 160, 
'dolibarr_notes', 
'', 
false, 
false, $extendededitor, ROWS_5, 
'90%');
 
  293  $doleditor->Create();
 
  294  print 
"</td></tr>\n";
 
  299  print 
'<div class="center">';
 
  300  print $form->buttonsSaveCancel(
"Save", 
'', array(), 0, 
'', $dol_openinpopup);
 
  310  print 
'<div class="center">';
 
  311  print 
'<span class="opacitymedium">'.$langs->trans(
"Preview").
'</span><br>';
 
  312  print 
'<div class="virtualcard-div">';
 
  313  print 
'<a target="_blank" rel="noopener noreferrer cursorpointer" href="'.$fullexternaleurltovirtualcard.
'">'.
"\n";
 
  314  print 
'<iframe id="virtualcard-iframe" title="" class="center" src="'.$fullinternalurltovirtualcard.
'&mode=preview">';
 
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()
Empty header.
 
Class to manage a WYSIWYG editor.
 
Class to manage Dolibarr users.
 
dol_set_user_param($db, $conf, &$user, $tab)
Save personal parameter.
 
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.
 
getDolUserInt($key, $default=0, $tmpuser=null)
Return Dolibarr user constant int value.
 
dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $disabled='', $morecss='classlink button bordertransp', $jsonopen='', $backtopagejsfields='', $accesskey='')
Return HTML code to output a button to open a dialog popup box.
 
getDolUserString($key, $default='', $tmpuser=null)
Return Dolibarr user constant string value.
 
dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
Returns text escaped for inclusion into javascript code.
 
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
 
newToken()
Return the value of token currently saved into session with name 'newtoken'.
 
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
 
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.
 
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
 
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
 
user_prepare_head(User $object)
Prepare array with list of tabs.