view.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  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. /**
  18. * \file htdocs/public/users/view.php
  19. * \ingroup user
  20. * \brief Public file to user profile
  21. */
  22. if (!defined('NOLOGIN')) {
  23. define("NOLOGIN", 1); // This means this output page does not require to be logged.
  24. }
  25. if (!defined('NOCSRFCHECK')) {
  26. define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
  27. }
  28. if (!defined('NOIPCHECK')) {
  29. define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
  30. }
  31. if (!defined('NOBROWSERNOTIF')) {
  32. define('NOBROWSERNOTIF', '1');
  33. }
  34. // Load Dolibarr environment
  35. require '../../main.inc.php';
  36. require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
  37. require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
  38. require_once DOL_DOCUMENT_ROOT.'/core/class/vcard.class.php';
  39. // Load translation files required by the page
  40. $langs->loadLangs(array("companies", "other", "recruitment"));
  41. // Get parameters
  42. $action = GETPOST('action', 'aZ09');
  43. $mode = GETPOST('mode', 'aZ09');
  44. $cancel = GETPOST('cancel', 'alpha');
  45. $backtopage = '';
  46. $id = GETPOST('id', 'int');
  47. $securekey = GETPOST('securekey', 'alpha');
  48. $suffix = GETPOST('suffix');
  49. $object = new User($db);
  50. $object->fetch($id, '', '', 1);
  51. // Define $urlwithroot
  52. //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
  53. //$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
  54. $urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost.
  55. // Security check
  56. global $conf;
  57. $encodedsecurekey = dol_hash($conf->file->instance_unique_id.'uservirtualcard'.$object->id.'-'.$object->login, 'md5');
  58. if ($encodedsecurekey != $securekey) {
  59. httponly_accessforbidden('Bad value for securitykey or public profile not enabled');
  60. }
  61. if (!getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
  62. httponly_accessforbidden('Bad value for securitykey or public profile not enabled');
  63. }
  64. /*
  65. * Actions
  66. */
  67. if ($cancel) {
  68. if (!empty($backtopage)) {
  69. header("Location: ".$backtopage);
  70. exit;
  71. }
  72. $action = 'view';
  73. }
  74. /*
  75. * View
  76. */
  77. $form = new Form($db);
  78. $v = new vCard();
  79. $company = $mysoc;
  80. $modulepart = 'userphotopublic';
  81. $dir = $conf->user->dir_output;
  82. // 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)
  83. // Define logo and logosmall
  84. $logo = '';
  85. $logosmall = '';
  86. if (!empty($object->photo)) {
  87. if (dolIsAllowedForPreview($object->photo)) {
  88. $logosmall = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small');
  89. $logo = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
  90. //$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo;
  91. }
  92. }
  93. //print '<!-- Show logo (logosmall='.$logosmall.' logo='.$logo.') -->'."\n";
  94. // Define urllogo
  95. $urllogo = '';
  96. $urllogofull = '';
  97. if (!empty($logosmall) && is_readable($dir.'/'.$logosmall)) {
  98. $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.($conf->entity > 1 ? '&amp;entity='.$conf->entity : '').'&amp;securekey='.urlencode($securekey).'&amp;file='.urlencode($logosmall);
  99. $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart='.$modulepart.($conf->entity > 1 ? '&entity='.$conf->entity : '').'&securekey='.urlencode($securekey).'&file='.urlencode($logosmall);
  100. } elseif (!empty($logo) && is_readable($dir.'/'.$logo)) {
  101. $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.($conf->entity > 1 ? '&amp;entity='.$conf->entity : '').'&amp;securekey='.urlencode($securekey).'&amp;file='.urlencode($logo);
  102. $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart='.$modulepart.($conf->entity > 1 ? '&entity='.$conf->entity : '').'&securekey='.urlencode($securekey).'&file='.urlencode($logo);
  103. }
  104. // Clean data we don't want on public page
  105. if (getDolUserInt('USER_PUBLIC_HIDE_PHOTO', 0, $object)) {
  106. $logo = '';
  107. $logosmall = '';
  108. $urllogo = '';
  109. $urllogofull = '';
  110. }
  111. if (getDolUserInt('USER_PUBLIC_HIDE_JOBPOSITION', 0, $object)) {
  112. $object->job = '';
  113. }
  114. if (getDolUserInt('USER_PUBLIC_HIDE_EMAIL', 0, $object)) {
  115. $object->email = '';
  116. }
  117. if (getDolUserInt('USER_PUBLIC_HIDE_EMAIL', 0, $object)) {
  118. $object->job = '';
  119. }
  120. if (getDolUserInt('USER_PUBLIC_HIDE_OFFICE_PHONE', 0, $object)) {
  121. $object->office_phone = '';
  122. }
  123. if (getDolUserInt('USER_PUBLIC_HIDE_OFFICE_FAX', 0, $object)) {
  124. $object->office_fax = '';
  125. }
  126. if (getDolUserInt('USER_PUBLIC_HIDE_USER_MOBILE', 0, $object)) {
  127. $object->user_mobile = '';
  128. }
  129. if (getDolUserInt('USER_PUBLIC_HIDE_SOCIALNETWORKS', 0, $object)) {
  130. $object->socialnetworks = '';
  131. }
  132. // By default, personal address not visible
  133. if (!getDolUserInt('USER_PUBLIC_SHOW_BIRTH', 0, $object)) {
  134. $object->birth = null;
  135. }
  136. if (!getDolUserInt('USER_PUBLIC_SHOW_ADDRESS', 0, $object)) {
  137. $object->address = '';
  138. $object->town = '';
  139. $object->zip = '';
  140. $object->state = '';
  141. $object->country = '';
  142. }
  143. if (getDolUserInt('USER_PUBLIC_HIDE_COMPANY', 0, $object)) {
  144. $company = null;
  145. }
  146. // Output vcard
  147. if ($mode == 'vcard') {
  148. // We create VCard
  149. $output = $v->buildVCardString($object, $company, $langs, $urllogofull);
  150. $filename = trim(urldecode($v->getFileName())); // "Nom prenom.vcf"
  151. $filenameurlencoded = dol_sanitizeFileName(urlencode($filename));
  152. //$filename = dol_sanitizeFileName($filename);
  153. top_httphead('text/vcard; name="'.$filename.'"');
  154. header("Content-Disposition: attachment; filename=\"".$filename."\"");
  155. header("Content-Length: ".dol_strlen($output));
  156. header("Connection: close");
  157. print $output;
  158. $db->close();
  159. exit;
  160. }
  161. $head = '';
  162. if (getDolGlobalString('MAIN_USER_PROFILE_CSS_URL')) {
  163. $head = '<link rel="stylesheet" type="text/css" href="' . getDolGlobalString('MAIN_USER_PROFILE_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n";
  164. }
  165. $conf->dol_hide_topmenu = 1;
  166. $conf->dol_hide_leftmenu = 1;
  167. if (!getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
  168. $langs->load("errors");
  169. print '<div class="error">'.$langs->trans('ErrorPublicInterfaceNotEnabled').'</div>';
  170. $db->close();
  171. exit();
  172. }
  173. $arrayofjs = array();
  174. $arrayofcss = array();
  175. $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
  176. llxHeader($head, $object->getFullName($langs).' - '.$langs->trans("PublicVirtualCard"), '', '', 0, 0, '', '', '', 'onlinepaymentbody'.(GETPOST('mode')=='preview' ? ' scalepreview cursorpointer virtualcardpreview' : ''), $replacemainarea, 1, 1);
  177. print '
  178. <style>
  179. @media (prefers-color-scheme: dark) {
  180. form {
  181. background-color: #CCC !important;
  182. }
  183. }
  184. </style>
  185. ';
  186. print '<span id="dolpaymentspan"></span>'."\n";
  187. print '<div class="center">'."\n";
  188. print '<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
  189. print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
  190. print '<input type="hidden" name="action" value="dosubmit">'."\n";
  191. print '<input type="hidden" name="securekey" value="'.$securekey.'">'."\n";
  192. print '<input type="hidden" name="entity" value="'.$conf->entity.'" />';
  193. print "\n";
  194. // Output html code for logo
  195. print '<div class="backgreypublicpayment">';
  196. print '<div class="logopublicpayment">';
  197. // Name
  198. print '<div class="double colortext">'.$object->getFullName($langs).'</div>';
  199. // User position
  200. if ($object->job && !getDolUserInt('USER_PUBLIC_HIDE_JOBPOSITION', 0, $object)) {
  201. print '<div class="">';
  202. print dol_escape_htmltag($object->job);
  203. print '</div>';
  204. }
  205. if (!getDolUserInt('USER_PUBLIC_HIDE_COMPANY', 0, $object)) {
  206. print '<div class="bold">';
  207. print dol_escape_htmltag($mysoc->name);
  208. print '</div>';
  209. }
  210. print '</div>';
  211. /*if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
  212. 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>';
  213. }*/
  214. print '</div>';
  215. if (getDolGlobalString('USER_IMAGE_PUBLIC_INTERFACE')) {
  216. print '<div class="backimagepublicrecruitment">';
  217. print '<img id="idUSER_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('USER_IMAGE_PUBLIC_INTERFACE').'">';
  218. print '</div>';
  219. }
  220. $urlforqrcode = $object->getOnlineVirtualCardUrl('vcard');
  221. $socialnetworksdict = getArrayOfSocialNetworks();
  222. // Show barcode
  223. $showbarcode = GETPOST('nobarcode') ? 0 : 1;
  224. if ($showbarcode) {
  225. $qrcodecontent = $output = $v->buildVCardString($object, $company, $langs);
  226. print '<br>';
  227. print '<div class="floatleft inline-block valignmiddle paddingleft paddingright">';
  228. 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($qrcodecontent).'">';
  229. print '</div>';
  230. print '<br>';
  231. }
  232. // Me section
  233. $usersection = '';
  234. // User email
  235. if ($object->email && !getDolUserInt('USER_PUBLIC_HIDE_EMAIL', 0, $object)) {
  236. $usersection .= '<div class="flexitemsmall">';
  237. $usersection .= dol_print_email($object->email, 0, 0, 1, 0, 1, 1);
  238. $usersection .= '</div>';
  239. }
  240. // User url
  241. if ($object->url && !getDolUserInt('USER_PUBLIC_HIDE_URL', 0, $object)) {
  242. $usersection .= '<div class="flexitemsmall">';
  243. $usersection .= img_picto('', 'globe', 'class="pictofixedwidth"');
  244. $usersection .= dol_print_url($object->url, '_blank', 0, 0, '');
  245. $usersection .= '</div>';
  246. }
  247. // User phone
  248. if ($object->office_phone && !getDolUserInt('USER_PUBLIC_HIDE_OFFICE_PHONE', 0, $object)) {
  249. $usersection .= '<div class="flexitemsmall">';
  250. $usersection .= img_picto('', 'phone', 'class="pictofixedwidth"');
  251. $usersection .= dol_print_phone($object->office_phone, $object->country_code, 0, $mysoc->id, 'tel', ' ', 0, '');
  252. $usersection .= '</div>';
  253. }
  254. if ($object->office_fax && !getDolUserInt('USER_PUBLIC_HIDE_OFFICE_FAX', 0, $object)) {
  255. $usersection .= '<div class="flexitemsmall">';
  256. $usersection .= img_picto('', 'phoning_fax', 'class="pictofixedwidth"');
  257. $usersection .= dol_print_phone($object->office_fax, $object->country_code, 0, $mysoc->id, 'fax', ' ', 0, '');
  258. $usersection .= '</div>';
  259. }
  260. if ($object->user_mobile && !getDolUserInt('USER_PUBLIC_HIDE_USER_MOBILE', 0, $object)) {
  261. $usersection .= '<div class="flexitemsmall">';
  262. $usersection .= img_picto('', 'phone', 'class="pictofixedwidth"');
  263. $usersection .= dol_print_phone($object->user_mobile, $object->country_code, 0, $mysoc->id, 'tel', ' ', 0, '');
  264. $usersection .= '</div>';
  265. }
  266. if (getDolUserInt('USER_PUBLIC_SHOW_BIRTH', 0, $object) && !is_null($object->birth)) {
  267. $usersection .= '<div class="flexitemsmall">';
  268. $usersection .= img_picto('', 'calendar', 'class="pictofixedwidth"');
  269. $usersection .= dol_print_date($object->birth);
  270. $usersection .= '</div>';
  271. }
  272. if (getDolUserInt('USER_PUBLIC_SHOW_ADDRESS', 0, $object) && $object->address) {
  273. $usersection .= '<div class="flexitemsmall">';
  274. $usersection .= img_picto('', 'state', 'class="pictofixedwidth"');
  275. $usersection .= dol_print_address(dol_format_address($object, 0, "\n", $langs), 'map', 'user', $object->id, 1);
  276. $usersection .= '</div>';
  277. }
  278. // Social networks
  279. if (!empty($object->socialnetworks) && is_array($object->socialnetworks) && count($object->socialnetworks) > 0) {
  280. if (!getDolUserInt('USER_PUBLIC_HIDE_SOCIALNETWORKS', 0, $object)) {
  281. foreach ($object->socialnetworks as $key => $value) {
  282. if ($value) {
  283. $usersection .= '<div class="flexitemsmall">'.dol_print_socialnetworks($value, 0, $mysoc->id, $key, $socialnetworksdict).'</div>';
  284. }
  285. }
  286. }
  287. }
  288. if ($usersection) {
  289. // Show photo
  290. if ($urllogo) {
  291. print '<img class="userphotopublicvcard" id="dolpaymentlogo" src="'.$urllogofull.'">';
  292. }
  293. print '<table id="dolpaymenttable" summary="Job position offer" class="center">'."\n";
  294. // Output payment summary form
  295. print '<tr><td class="left">';
  296. print '<div class="nowidthimp nopaddingtoponsmartphone" id="tablepublicpayment">';
  297. print $usersection;
  298. print '</div>'."\n";
  299. print "\n";
  300. print '</td></tr>'."\n";
  301. print '</table>'."\n";
  302. } else {
  303. // Show photo
  304. if ($urllogo) {
  305. print '<br><center><img class="userphotopublicvcard" style="position: unset !important;" id="dolpaymentlogo" src="'.$urllogofull.'"></center>';
  306. }
  307. }
  308. if (!getDolUserInt('USER_PUBLIC_HIDE_COMPANY', 0, $object)) {
  309. $companysection = '';
  310. if ($mysoc->email) {
  311. $companysection .= '<div class="flexitemsmall">';
  312. $companysection .= img_picto('', 'email', 'class="pictofixedwidth"');
  313. $companysection .= dol_print_email($mysoc->email, 0, 0, 1);
  314. $companysection .= '</div>';
  315. }
  316. if ($mysoc->url) {
  317. $companysection .= '<div class="flexitemsmall">';
  318. $companysection .= img_picto('', 'globe', 'class="pictofixedwidth"');
  319. $companysection .= dol_print_url($mysoc->url, '_blank', 0, 0, '');
  320. $companysection .= '</div>';
  321. }
  322. if ($mysoc->phone) {
  323. $companysection .= '<div class="flexitemsmall">';
  324. $companysection .= img_picto('', 'phone', 'class="pictofixedwidth"');
  325. $companysection .= dol_print_phone($mysoc->phone, $mysoc->country_code, 0, $mysoc->id, 'tel', ' ', 0, '');
  326. $companysection .= '</div>';
  327. }
  328. if ($mysoc->fax) {
  329. $companysection .= '<div class="flexitemsmall">';
  330. $companysection .= img_picto('', 'phoning_fax', 'class="pictofixedwidth"');
  331. $companysection .= dol_print_phone($mysoc->fax, $mysoc->country_code, 0, $mysoc->id, 'fax', ' ', 0, '');
  332. $companysection .= '</div>';
  333. }
  334. // Social networks
  335. if (!empty($mysoc->socialnetworks) && is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) {
  336. foreach ($mysoc->socialnetworks as $key => $value) {
  337. if ($value) {
  338. $companysection .= '<div class="flexitemsmall">'.dol_print_socialnetworks($value, 0, $mysoc->id, $key, $socialnetworksdict).'</div>';
  339. }
  340. }
  341. }
  342. // 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)
  343. // Define logo and logosmall
  344. $logosmall = $mysoc->logo_squarred_small ? $mysoc->logo_squarred_small : $mysoc->logo_small;
  345. $logo = $mysoc->logo_squarred ? $mysoc->logo_squarred : $mysoc->logo;
  346. $paramlogo = 'ONLINE_USER_LOGO_'.$suffix;
  347. if (getDolGlobalString($paramlogo)) {
  348. $logosmall = getDolGlobalString($paramlogo);
  349. } elseif (getDolGlobalString('ONLINE_USER_LOGO')) {
  350. $logosmall = getDolGlobalString('ONLINE_USER_LOGO');
  351. }
  352. //print '<!-- Show logo (logosmall='.$logosmall.' logo='.$logo.') -->'."\n";
  353. // Define urllogo
  354. $urllogo = '';
  355. $urllogofull = '';
  356. if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) {
  357. $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany'.($conf->entity > 1 ? '&amp;entity='.$conf->entity : '').'&amp;file='.urlencode('logos/thumbs/'.$logosmall);
  358. $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany'.($conf->entity > 1 ? '&entity='.$conf->entity : '').'&file='.urlencode('logos/thumbs/'.$logosmall);
  359. } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) {
  360. $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany'.($conf->entity > 1 ? '&amp;entity='.$conf->entity : '').'&amp;file='.urlencode('logos/'.$logo);
  361. $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany'.($conf->entity > 1 ? '&entity='.$conf->entity : '').'&file='.urlencode('logos/'.$logo);
  362. }
  363. // Output html code for logo
  364. if ($urllogo) {
  365. print '<div class="logopublicpayment center">';
  366. if (!empty($mysoc->url)) {
  367. print '<a href="'.$mysoc->url.'" target="_blank" rel="noopener">';
  368. }
  369. print '<img class="userphotopublicvcard" id="dolpaymentlogo" src="'.$urllogofull.'">';
  370. if (!empty($mysoc->url)) {
  371. print '</a>';
  372. }
  373. print '</div>';
  374. }
  375. print '<table id="dolpaymenttable" summary="Job position offer" class="center">'."\n";
  376. // Output payment summary form
  377. print '<tr><td class="left">';
  378. print '<div class="nowidthimp nopaddingtoponsmartphone" id="tablepublicpayment">';
  379. // Add company info
  380. if ($mysoc->name) {
  381. print '<div class="center bold">';
  382. print dol_escape_htmltag($mysoc->name);
  383. print '</div>';
  384. print '<br>';
  385. }
  386. print $companysection;
  387. print '</div>'."\n";
  388. print "\n";
  389. print '</td></tr>'."\n";
  390. print '</table>'."\n";
  391. }
  392. // Description
  393. $text = getDolUserString('USER_PUBLIC_MORE', '', $object);
  394. print $text;
  395. print '</form>'."\n";
  396. print '</div>'."\n";
  397. print '<br>';
  398. print '<div class="backgreypublicpayment">';
  399. print '<div class="center">';
  400. print '<a href="'.$urlforqrcode.'">';
  401. // Download / AddToContacts
  402. print img_picto($langs->trans("Download").' VCF', 'add').' ';
  403. print $langs->trans("Download").' VCF';
  404. print '</a>';
  405. print '</div>';
  406. //print '<div>';
  407. //print '</div>';
  408. print '</div>';
  409. $fullexternaleurltovirtualcard = $object->getOnlineVirtualCardUrl('', 'external');
  410. $fullinternalurltovirtualcard = $object->getOnlineVirtualCardUrl('', 'internal');
  411. print '<script>';
  412. print 'jQuery(document).ready(function() {
  413. jQuery(".virtualcardpreview").click(function(event) {
  414. event.preventDefault();
  415. console.log("We click on the card");
  416. window.open("'.$fullexternaleurltovirtualcard.'");
  417. });
  418. });';
  419. print '</script>';
  420. llxFooter('', 'public');
  421. $db->close();