27 function showOnlineSignatureUrl($type, $ref)
32 $langs->loadLangs(array(
"payment",
"paybox"));
34 $servicename =
'Online';
36 $out =
img_picto(
'',
'globe').
' <span class="opacitymedium">'.$langs->trans(
"ToOfferALinkForOnlineSignature", $servicename).
'</span><br>';
37 $url = getOnlineSignatureUrl(0, $type, $ref);
38 $out .=
'<div class="urllink">';
39 if ($url == $langs->trans(
"FeatureOnlineSignDisabled")) {
42 $out .=
'<input type="text" id="onlinesignatureurl" class="quatrevingtpercentminusx" value="'.$url.
'">';
44 $out .=
'<a class="" href="'.$url.
'" target="_blank" rel="noopener noreferrer">'.
img_picto(
'',
'globe',
'class="paddingleft"').
'</a>';
60 function getOnlineSignatureUrl($mode, $type, $ref =
'', $localorexternal = 1)
62 global $conf, $db, $langs, $dolibarr_main_url_root;
64 $ref = str_replace(
' ',
'', $ref);
68 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
69 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
72 $urltouse = DOL_MAIN_URL_ROOT;
73 if ($localorexternal) {
74 $urltouse = $urlwithroot;
79 if ($type ==
'proposal') {
80 $securekeyseed = isset($conf->global->PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN) ? $conf->global->PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN :
'';
82 $out = $urltouse.
'/public/onlinesign/newonlinesign.php?source=proposal&ref='.($mode ?
'<span style="color: #666666">' :
'');
84 $out .=
'proposal_ref';
87 $out .= urlencode($ref);
89 $out .= ($mode ?
'</span>' :
'');
91 $out .=
"hash('".$securekeyseed.
"' + '".$type.
"' + proposal_ref)";
93 $out .=
'&securekey='.dol_hash($securekeyseed.$type.$ref.(empty($conf->multicompany->enabled) ?
'' : $object->entity),
'0');
122 if (!empty($out) && !empty($conf->multicompany->enabled)) {
123 $out .=
"&entity=".$conf->entity;
ajax_autoselect($htmlname, $addlink= '', $textonlink= 'Link')
Make content of an input box selected when we click into input field.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)