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, $object, $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.(!
isModEnabled(
'multicompany') ?
'' : $object->entity),
'0');
119 } elseif ($type ==
'contract') {
120 $securekeyseed = isset($conf->global->CONTRACT_ONLINE_SIGNATURE_SECURITY_TOKEN) ? $conf->global->CONTRACT_ONLINE_SIGNATURE_SECURITY_TOKEN :
'';
121 $out = $urltouse.
'/public/onlinesign/newonlinesign.php?source=contract&ref='.($mode ?
'<span style="color: #666666">' :
'');
123 $out .=
'contract_ref';
126 $out .= urlencode($ref);
128 $out .= ($mode ?
'</span>' :
'');
130 $out .=
"hash('".$securekeyseed.
"' + '".$type.
"' + contract_ref)";
132 $out .=
'&securekey='.dol_hash($securekeyseed.$type.$ref.(!
isModEnabled(
'multicompany') ?
'' : $object->entity),
'0');
134 } elseif ($type ==
'fichinter') {
135 $securekeyseed = isset($conf->global->FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN) ? $conf->global->FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN :
'';
136 $out = $urltouse.
'/public/onlinesign/newonlinesign.php?source=fichinter&ref='.($mode ?
'<span style="color: #666666">' :
'');
138 $out .=
'fichinter_ref';
141 $out .= urlencode($ref);
143 $out .= ($mode ?
'</span>' :
'');
145 $out .=
"hash('".$securekeyseed.
"' + '".$type.
"' + fichinter_ref)";
147 $out .=
'&securekey='.dol_hash($securekeyseed.$type.$ref.(!
isModEnabled(
'multicompany') ?
'' : $object->entity),
'0');
153 $out .=
"&entity=".$conf->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.
isModEnabled($module)
Is Dolibarr module enabled.