26 if (!defined(
'NOLOGIN')) define(
"NOLOGIN", 1);
27 if (!defined(
'NOCSRFCHECK')) define(
"NOCSRFCHECK", 1);
28 if (!defined(
'NOIPCHECK')) define(
'NOIPCHECK',
'1');
29 if (!defined(
'NOBROWSERNOTIF')) define(
'NOBROWSERNOTIF',
'1');
34 $entity = (!empty($_GET[
'entity']) ? (int) $_GET[
'entity'] : (!empty($_POST[
'entity']) ? (int) $_POST[
'entity'] : 1));
35 if (is_numeric($entity)) define(
"DOLENTITY", $entity);
37 require
'../../main.inc.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
39 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
40 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
41 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
44 $langs->loadLangs(array(
"main",
"other",
"dict",
"bills",
"companies",
"errors",
"paybox"));
50 $action =
GETPOST(
'action',
'aZ09');
59 $suffix =
GETPOST(
"suffix",
'aZ09');
60 $source =
GETPOST(
"source",
'alpha');
61 $ref = $REF =
GETPOST(
"ref",
'alpha');
63 if (empty($source)) $source =
'proposal';
69 print $langs->trans(
'ErrorBadParameters').
" - ref missing";
78 $urlwithroot = DOL_MAIN_URL_ROOT;
82 $SECUREKEY =
GETPOST(
"securekey");
86 $urlok .=
'source='.urlencode($source).
'&';
87 $urlko .=
'source='.urlencode($source).
'&';
91 $urlok .=
'ref='.urlencode($REF).
'&';
92 $urlko .=
'ref='.urlencode($REF).
'&';
94 if (!empty($SECUREKEY))
96 $urlok .=
'securekey='.urlencode($SECUREKEY).
'&';
97 $urlko .=
'securekey='.urlencode($SECUREKEY).
'&';
101 $urlok .=
'entity='.urlencode($entity).
'&';
102 $urlko .=
'entity='.urlencode($entity).
'&';
104 $urlok = preg_replace(
'/&$/',
'', $urlok);
105 $urlko = preg_replace(
'/&$/',
'', $urlko);
107 $creditor = $mysoc->name;
115 if ($action ==
'dosign')
126 if (!empty($conf->global->MAIN_SIGN_CSS_URL)) $head =
'<link rel="stylesheet" type="text/css" href="'.$conf->global->MAIN_SIGN_CSS_URL.
'?lang='.$langs->defaultlang.
'">'.
"\n";
128 $conf->dol_hide_topmenu = 1;
129 $conf->dol_hide_leftmenu = 1;
131 $replacemainarea = (empty($conf->dol_hide_leftmenu) ?
'<div>' :
'').
'<div>';
132 llxHeader($head, $langs->trans(
"OnlineSignature"),
'',
'', 0, 0,
'',
'',
'',
'onlinepaymentbody', $replacemainarea, 1);
135 if (!empty($source) && in_array($ref, array(
'member_ref',
'contractline_ref',
'invoice_ref',
'order_ref',
'')))
137 $langs->load(
"errors");
138 dol_print_error_email(
'BADREFINONLINESIGNFORM', $langs->trans(
"ErrorBadLinkSourceSetButBadValueForRef", $source, $ref));
145 print '<span id="dolpaymentspan"></span>'.
"\n";
146 print '<div class="center">'.
"\n";
147 print '<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
148 print '<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
149 print '<input type="hidden" name="action" value="dosign">'.
"\n";
150 print '<input type="hidden" name="tag" value="'.GETPOST(
"tag",
'alpha').
'">'.
"\n";
151 print '<input type="hidden" name="suffix" value="'.GETPOST(
"suffix",
'alpha').
'">'.
"\n";
152 print '<input type="hidden" name="securekey" value="'.$SECUREKEY.
'">'.
"\n";
153 print '<input type="hidden" name="entity" value="'.$entity.
'" />';
155 print '<!-- Form to sign -->'.
"\n";
157 print '<table id="dolpaymenttable" summary="Payment form" class="center">'.
"\n";
161 $logosmall = $mysoc->logo_small;
162 $logo = $mysoc->logo;
163 $paramlogo =
'ONLINE_SIGN_LOGO_'.$suffix;
164 if (!empty($conf->global->$paramlogo)) $logosmall = $conf->global->$paramlogo;
165 elseif (!empty($conf->global->ONLINE_SIGN_LOGO)) $logosmall = $conf->global->ONLINE_SIGN_LOGO;
170 if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall))
172 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
173 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
174 } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.
'/logos/'.$logo))
176 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
177 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
182 print '<div class="backgreypublicpayment">';
183 print '<div class="logopublicpayment">';
184 print '<img id="dolpaymentlogo" src="'.$urllogo.
'"';
187 if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
188 print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans(
"PoweredBy").
'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.
'/theme/dolibarr_logo.svg" width="80px"></a></div>';
195 if (!empty($conf->global->ONLINE_SIGN_NEWFORM_TEXT))
197 $langs->load(
"members");
199 if (preg_match(
'/^\((.*)\)$/', $conf->global->ONLINE_SIGN_NEWFORM_TEXT, $reg)) $text .= $langs->trans($reg[1]).
"<br>\n";
200 else $text .= $conf->global->ONLINE_SIGN_NEWFORM_TEXT.
"<br>\n";
201 $text =
'<tr><td align="center"><br>'.$text.
'<br></td></tr>'.
"\n";
205 $text .=
'<tr><td class="textpublicpayment"><br><strong>'.$langs->trans(
"WelcomeOnOnlineSignaturePage", $mysoc->name).
'</strong></td></tr>'.
"\n";
206 $text .=
'<tr><td class="textpublicpayment">'.$langs->trans(
"ThisScreenAllowsYouToSignDocFrom", $creditor).
'<br><br></td></tr>'.
"\n";
211 print '<tr><td align="center">';
212 print '<table with="100%" id="tablepublicpayment">';
213 print '<tr><td align="left" colspan="2" class="opacitymedium">'.$langs->trans(
"ThisIsInformationOnDocumentToSign").
' :</td></tr>'.
"\n";
220 if ($source ==
'proposal')
223 $langs->load(
"proposal");
225 require_once DOL_DOCUMENT_ROOT.
'/comm/propal/class/propal.class.php';
227 $proposal =
new Propal($db);
228 $result = $proposal->fetch(
'', $ref);
231 $mesg = $proposal->error;
234 $result = $proposal->fetch_thirdparty($proposal->socid);
239 print '<tr class="CTableRow'.($var ?
'1' :
'2').
'"><td class="CTableRow'.($var ?
'1' :
'2').
'">'.$langs->trans(
"Creditor");
240 print '</td><td class="CTableRow'.($var ?
'1' :
'2').
'"><b>'.$creditor.
'</b>';
241 print '<input type="hidden" name="creditor" value="'.$creditor.
'">';
242 print '</td></tr>'.
"\n";
246 print '<tr class="CTableRow'.($var ?
'1' :
'2').
'"><td class="CTableRow'.($var ?
'1' :
'2').
'">'.$langs->trans(
"ThirdParty");
247 print
'</td><td class="CTableRow'.($var ?
'1' :
'2').
'"><b>'.$proposal->thirdparty->name.
'</b>';
251 $text =
'<b>'.$langs->trans(
"SignatureProposalRef", $proposal->ref).
'</b>';
252 print
'<tr class="CTableRow'.($var ?
'1' :
'2').
'"><td class="CTableRow'.($var ?
'1' :
'2').
'">'.$langs->trans(
"Designation");
253 print
'</td><td class="CTableRow'.($var ?
'1' :
'2').
'">'.$text;
254 print
'<input type="hidden" name="source" value="'.GETPOST(
"source",
'alpha').
'">';
255 print
'<input type="hidden" name="ref" value="'.$proposal->ref.
'">';
256 print
'</td></tr>'.
"\n";
261 if (!$found && !$mesg) $mesg = $langs->transnoentitiesnoconv(
"ErrorBadParameters");
263 if ($mesg) print
'<tr><td align="center" colspan="2"><br><div class="warning">'.dol_escape_htmltag($mesg).
'</div></td></tr>'.
"\n";
265 print
'</table>'.
"\n";
268 if ($action !=
'dosign') {
269 if ($found && !$error) {
278 print
'</td></tr>'.
"\n";
280 print
'</table>'.
"\n";
281 print
'</form>'.
"\n";
286 htmlPrintOnlinePaymentFooter($mysoc, $langs);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error_email($prefixcode, $errormessage= '', $errormessages=array(), $morecss= 'error', $email= '')
Show a public email and error code to contact if technical error.
print
Draft customers invoices.
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
Class to manage proposals.