29function showOnlineSignatureUrl($type, $ref, $obj =
null, $mode =
'')
34 $langs->loadLangs(array(
"payment",
"paybox",
"stripe"));
36 $servicename =
'Online';
39 if ($mode !=
'short') {
40 $out .=
img_picto(
'',
'globe',
'class="pictofixedwidth"');
42 $out .=
'<span class="opacitymedium">'.$langs->trans(
"ToOfferALinkForOnlineSignature", $servicename).
'</span><br>';
43 $url = getOnlineSignatureUrl(0, $type, $ref, 1, $obj);
44 $out .=
'<div class="urllink">';
45 if ($url == $langs->trans(
"FeatureOnlineSignDisabled")) {
48 $out .=
'<input type="text" id="onlinesignatureurl" class="'.($mode ==
'short' ?
'centpercentminusx' :
'quatrevingtpercentminusx').
'" value="'.$url.
'">';
50 $out .=
'<a class="" href="'.$url.
'" target="_blank" rel="noopener noreferrer">'.
img_picto(
'',
'globe',
'class="paddingleft"').
'</a>';
67function getOnlineSignatureUrl($mode, $type, $ref =
'', $localorexternal = 1, $obj =
null)
69 global $dolibarr_main_url_root;
77 dol_syslog(__FUNCTION__.
" using global object is deprecated, please give obj as argument", LOG_WARNING);
85 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
86 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
89 $urltouse = DOL_MAIN_URL_ROOT;
90 if ($localorexternal) {
91 $urltouse = $urlwithroot;
96 if ($type ==
'proposal') {
99 $out = $urltouse.
'/public/onlinesign/newonlinesign.php?source=proposal&ref='.($mode ?
'<span style="color: #666666">' :
'');
101 $out .=
'proposal_ref';
104 $out .= urlencode($ref);
106 $out .= ($mode ?
'</span>' :
'');
108 $out .=
"hash('".$securekeyseed.
"' + '".$type.
"' + proposal_ref)";
110 $out .=
'&securekey='.dol_hash($securekeyseed.$type.$ref.(isModEnabled(
'multicompany') ? (empty($obj->entity) ?
'' : $obj->entity) :
''),
'0');
136 } elseif ($type ==
'contract') {
138 $out = $urltouse.
'/public/onlinesign/newonlinesign.php?source=contract&ref='.($mode ?
'<span style="color: #666666">' :
'');
140 $out .=
'contract_ref';
143 $out .= urlencode($ref);
145 $out .= ($mode ?
'</span>' :
'');
147 $out .=
"hash('".$securekeyseed.
"' + '".$type.
"' + contract_ref)";
149 $out .=
'&securekey='.dol_hash($securekeyseed.$type.$ref.(isModEnabled(
'multicompany') ? (empty($obj->entity) ?
'' : (int) $obj->entity) :
''),
'0');
151 } elseif ($type ==
'fichinter') {
153 $out = $urltouse.
'/public/onlinesign/newonlinesign.php?source=fichinter&ref='.($mode ?
'<span style="color: #666666">' :
'');
155 $out .=
'fichinter_ref';
158 $out .= urlencode($ref);
160 $out .= ($mode ?
'</span>' :
'');
162 $out .=
"hash('".$securekeyseed.
"' + '".$type.
"' + fichinter_ref)";
164 $out .=
'&securekey='.dol_hash($securekeyseed.$type.$ref.(isModEnabled(
'multicompany') ? (empty($obj->entity) ?
'' : (int) $obj->entity) :
''),
'0');
168 $out = $urltouse.
'/public/onlinesign/newonlinesign.php?source='.$type.
'&ref='.($mode ?
'<span style="color: #666666">' :
'');
170 $out .= $type.
'_ref';
173 $out .= urlencode($ref);
175 $out .= ($mode ?
'</span>' :
'');
177 $out .=
"hash('".$securekeyseed.
"' + '".$type.
"' + $type + '_ref)";
179 $out .=
'&securekey='.dol_hash($securekeyseed.$type.$ref.(!isModEnabled(
'multicompany') ?
'' :
$object->entity),
'0');
184 if (!empty($out) && isModEnabled(
'multicompany')) {
185 $out .=
"&entity=".(empty($obj->entity) ?
'' : (int) $obj->entity);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $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.
dol_strtoupper($string, $encoding="UTF-8")
Convert a string to upper.
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.