28function 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, 1, $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>';
62function 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.(isModEnabled(
'multicompany') ? (empty($obj->entity) ?
'' : $obj->entity) :
''),
'0');
132 } elseif ($type ==
'contract') {
133 $securekeyseed = isset($conf->global->CONTRACT_ONLINE_SIGNATURE_SECURITY_TOKEN) ? $conf->global->CONTRACT_ONLINE_SIGNATURE_SECURITY_TOKEN :
'';
134 $out = $urltouse.
'/public/onlinesign/newonlinesign.php?source=contract&ref='.($mode ?
'<span style="color: #666666">' :
'');
136 $out .=
'contract_ref';
139 $out .= urlencode($ref);
141 $out .= ($mode ?
'</span>' :
'');
143 $out .=
"hash('".$securekeyseed.
"' + '".$type.
"' + contract_ref)";
145 $out .=
'&securekey='.dol_hash($securekeyseed.$type.$ref.(isModEnabled(
'multicompany') ? (empty($obj->entity) ?
'' : (int) $obj->entity) :
''),
'0');
147 } elseif ($type ==
'fichinter') {
148 $securekeyseed = isset($conf->global->FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN) ? $conf->global->FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN :
'';
149 $out = $urltouse.
'/public/onlinesign/newonlinesign.php?source=fichinter&ref='.($mode ?
'<span style="color: #666666">' :
'');
151 $out .=
'fichinter_ref';
154 $out .= urlencode($ref);
156 $out .= ($mode ?
'</span>' :
'');
158 $out .=
"hash('".$securekeyseed.
"' + '".$type.
"' + fichinter_ref)";
160 $out .=
'&securekey='.dol_hash($securekeyseed.$type.$ref.(isModEnabled(
'multicompany') ? (empty($obj->entity) ?
'' : (int) $obj->entity) :
''),
'0');
165 if (!empty($out) && isModEnabled(
'multicompany')) {
166 $out .=
"&entity=".(empty($obj->entity) ?
'' : (int) $obj->entity);
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.