28 function showOnlineSignatureUrl($type, $ref, $obj =
null)
33 $langs->loadLangs(array(
"payment",
"paybox"));
35 $servicename =
'Online';
37 $out =
img_picto(
'',
'globe').
' <span class="opacitymedium">'.$langs->trans(
"ToOfferALinkForOnlineSignature", $servicename).
'</span><br>';
38 $url = getOnlineSignatureUrl(0, $type, $ref, $obj);
39 $out .=
'<div class="urllink">';
40 if ($url == $langs->trans(
"FeatureOnlineSignDisabled")) {
43 $out .=
'<input type="text" id="onlinesignatureurl" class="quatrevingtpercentminusx" value="'.$url.
'">';
45 $out .=
'<a class="" href="'.$url.
'" target="_blank" rel="noopener noreferrer">'.
img_picto(
'',
'globe',
'class="paddingleft"').
'</a>';
62 function getOnlineSignatureUrl($mode, $type, $ref =
'', $localorexternal = 1, $obj =
null)
64 global $conf, $dolibarr_main_url_root;
70 $obj =
new stdClass();
72 dol_syslog(__METHOD__.
" using global object is deprecated, please give obj as argument", LOG_WARNING);
77 $ref = str_replace(
' ',
'', $ref);
81 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
82 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
85 $urltouse = DOL_MAIN_URL_ROOT;
86 if ($localorexternal) {
87 $urltouse = $urlwithroot;
92 if ($type ==
'proposal') {
95 $out = $urltouse.
'/public/onlinesign/newonlinesign.php?source=proposal&ref='.($mode ?
'<span style="color: #666666">' :
'');
97 $out .=
'proposal_ref';
100 $out .= urlencode($ref);
102 $out .= ($mode ?
'</span>' :
'');
104 $out .=
"hash('".$securekeyseed.
"' + '".$type.
"' + proposal_ref)";
106 $out .=
'&securekey='.dol_hash($securekeyseed.$type.$ref.(empty($conf->multicompany->enabled) ?
'' : $obj->entity),
'0');
135 if (!empty($out) && !empty($conf->multicompany->enabled)) {
136 $out .=
"&entity=".((int) $obj->entity);