dolibarr  16.0.5
newonlinesign.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2006-2017 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
27 if (!defined('NOLOGIN')) {
28  define("NOLOGIN", 1); // This means this output page does not require to be logged.
29 }
30 if (!defined('NOCSRFCHECK')) {
31  define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
32 }
33 if (!defined('NOIPCHECK')) {
34  define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
35 }
36 if (!defined('NOBROWSERNOTIF')) {
37  define('NOBROWSERNOTIF', '1');
38 }
39 
40 // For MultiCompany module.
41 // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
42 // Because 2 entities can have the same ref.
43 $entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
44 if (is_numeric($entity)) {
45  define("DOLENTITY", $entity);
46 }
47 
48 require '../../main.inc.php';
49 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
50 require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
51 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
52 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
53 require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
54 
55 // Load translation files
56 $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "members", "paybox", "propal"));
57 
58 // Security check
59 // No check on module enabled. Done later according to $validpaymentmethod
60 
61 // Get parameters
62 $action = GETPOST('action', 'aZ09');
63 $cancel = GETPOST('cancel', 'alpha');
64 $confirm = GETPOST('confirm', 'alpha');
65 
66 
67 $refusepropal = GETPOST('refusepropal', 'alpha');
68 $message = GETPOST('message', 'aZ09');
69 
70 // Input are:
71 // type ('invoice','order','contractline'),
72 // id (object id),
73 // amount (required if id is empty),
74 // tag (a free text, required if type is empty)
75 // currency (iso code)
76 
77 $suffix = GETPOST("suffix", 'aZ09');
78 $source = GETPOST("source", 'alpha');
79 $ref = $REF = GETPOST("ref", 'alpha');
80 
81 if (empty($source)) {
82  $source = 'proposal';
83 }
84 
85 if (!$action) {
86  if ($source && !$ref) {
87  print $langs->trans('ErrorBadParameters')." - ref missing";
88  exit;
89  }
90 }
91 if (!empty($refusepropal)) {
92  $action = "refusepropal";
93 }
94 
95 // Define $urlwithroot
96 //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
97 //$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
98 $urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost.
99 
100 
101 // Complete urls for post treatment
102 $SECUREKEY = GETPOST("securekey"); // Secure key
103 
104 if (!empty($source)) {
105  $urlok .= 'source='.urlencode($source).'&';
106  $urlko .= 'source='.urlencode($source).'&';
107 }
108 if (!empty($REF)) {
109  $urlok .= 'ref='.urlencode($REF).'&';
110  $urlko .= 'ref='.urlencode($REF).'&';
111 }
112 if (!empty($SECUREKEY)) {
113  $urlok .= 'securekey='.urlencode($SECUREKEY).'&';
114  $urlko .= 'securekey='.urlencode($SECUREKEY).'&';
115 }
116 if (!empty($entity)) {
117  $urlok .= 'entity='.urlencode($entity).'&';
118  $urlko .= 'entity='.urlencode($entity).'&';
119 }
120 $urlok = preg_replace('/&$/', '', $urlok); // Remove last &
121 $urlko = preg_replace('/&$/', '', $urlko); // Remove last &
122 
123 $creditor = $mysoc->name;
124 
125 $type = $source;
126 if ($source == 'proposal') {
127  require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
128  $object = new Propal($db);
129  $result= $object->fetch(0, $ref, '', $entity);
130 } else {
131  accessforbidden('Bad value for source');
132  exit;
133 }
134 
135 
136 // Check securitykey
137 $securekeyseed = '';
138 if ($source == 'proposal') {
139  $securekeyseed = $conf->global->PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN;
140 }
141 
142 if (!dol_verifyHash($securekeyseed.$type.$ref.(empty($conf->multicompany->enabled) ? '' : $entity), $SECUREKEY, '0')) {
143  http_response_code(403);
144  print 'Bad value for securitykey. Value provided '.dol_escape_htmltag($SECUREKEY).' does not match expected value for ref='.dol_escape_htmltag($ref);
145  exit(-1);
146 }
147 
148 
149 /*
150  * Actions
151  */
152 
153 if ($action == 'confirm_refusepropal' && $confirm == 'yes') {
154  $db->begin();
155 
156  $sql = "UPDATE ".MAIN_DB_PREFIX."propal";
157  $sql .= " SET fk_statut = ".((int) $object::STATUS_NOTSIGNED).", note_private = '".$db->escape($object->note_private)."', date_signature='".$db->idate(dol_now())."'";
158  $sql .= " WHERE rowid = ".((int) $object->id);
159 
160  dol_syslog(__METHOD__, LOG_DEBUG);
161  $resql = $db->query($sql);
162  if (!$resql) {
163  $error++;
164  }
165 
166  if (!$error) {
167  $db->commit();
168 
169  $message = 'refused';
170  setEventMessages("PropalRefused", null, 'warnings');
171  if (method_exists($object, 'call_trigger')) {
172  // Online customer is not a user, so we use the use that validates the documents
173  $user = new User($db);
174  $user->fetch($object->user_valid_id);
175  $result = $object->call_trigger('PROPAL_CLOSE_REFUSED', $user);
176  if ($result < 0) {
177  $error++;
178  }
179  }
180  } else {
181  $db->rollback();
182  }
183 
184  $object->fetch(0, $ref);
185 }
186 
187 
188 /*
189  * View
190  */
191 
192 $form = new Form($db);
193 $head = '';
194 if (!empty($conf->global->MAIN_SIGN_CSS_URL)) {
195  $head = '<link rel="stylesheet" type="text/css" href="'.$conf->global->MAIN_SIGN_CSS_URL.'?lang='.$langs->defaultlang.'">'."\n";
196 }
197 
198 $conf->dol_hide_topmenu = 1;
199 $conf->dol_hide_leftmenu = 1;
200 
201 $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
202 llxHeader($head, $langs->trans("OnlineSignature"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1);
203 
204 if ($action == 'refusepropal') {
205  print $form->formconfirm($_SERVER["PHP_SELF"].'?ref='.urlencode($ref).'&securekey='.urlencode($SECUREKEY).($conf->multicompany->enabled?'&entity='.$entity:''), $langs->trans('RefusePropal'), $langs->trans('ConfirmRefusePropal', $object->ref), 'confirm_refusepropal', '', '', 1);
206 }
207 
208 // Check link validity for param 'source' to avoid use of the examples as value
209 if (!empty($source) && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', 'proposal_ref', ''))) {
210  $langs->load("errors");
211  dol_print_error_email('BADREFINONLINESIGNFORM', $langs->trans("ErrorBadLinkSourceSetButBadValueForRef", $source, $ref));
212  // End of page
213  llxFooter();
214  $db->close();
215  exit;
216 }
217 
218 print '<span id="dolpaymentspan"></span>'."\n";
219 print '<div class="center">'."\n";
220 print '<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
221 print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
222 print '<input type="hidden" name="action" value="dosign">'."\n";
223 print '<input type="hidden" name="tag" value="'.GETPOST("tag", 'alpha').'">'."\n";
224 print '<input type="hidden" name="suffix" value="'.GETPOST("suffix", 'alpha').'">'."\n";
225 print '<input type="hidden" name="securekey" value="'.$SECUREKEY.'">'."\n";
226 print '<input type="hidden" name="entity" value="'.$entity.'" />';
227 print '<input type="hidden" name="page_y" value="" />';
228 print "\n";
229 print '<!-- Form to sign -->'."\n";
230 
231 print '<table id="dolpublictable" summary="Payment form" class="center">'."\n";
232 
233 // Show logo (search order: logo defined by ONLINE_SIGN_LOGO_suffix, then ONLINE_SIGN_LOGO_, then small company logo, large company logo, theme logo, common logo)
234 // Define logo and logosmall
235 $logosmall = $mysoc->logo_small;
236 $logo = $mysoc->logo;
237 $paramlogo = 'ONLINE_SIGN_LOGO_'.$suffix;
238 if (!empty($conf->global->$paramlogo)) {
239  $logosmall = $conf->global->$paramlogo;
240 } elseif (!empty($conf->global->ONLINE_SIGN_LOGO)) {
241  $logosmall = $conf->global->ONLINE_SIGN_LOGO;
242 }
243 //print '<!-- Show logo (logosmall='.$logosmall.' logo='.$logo.') -->'."\n";
244 // Define urllogo
245 $urllogo = '';
246 $urllogofull = '';
247 if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) {
248  $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;entity='.$conf->entity.'&amp;file='.urlencode('logos/thumbs/'.$logosmall);
249  $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall);
250 } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) {
251  $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;entity='.$conf->entity.'&amp;file='.urlencode('logos/'.$logo);
252  $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo);
253 }
254 // Output html code for logo
255 if ($urllogo) {
256  print '<div class="backgreypublicpayment">';
257  print '<div class="logopublicpayment">';
258  print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
259  print '>';
260  print '</div>';
261  if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
262  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>';
263  }
264  print '</div>';
265 }
266 if ($source == 'proposal' && !empty($conf->global->PROPOSAL_IMAGE_PUBLIC_SIGN)) {
267  print '<div class="backimagepublicproposalsign">';
268  print '<img id="idPROPOSAL_IMAGE_PUBLIC_INTERFACE" src="'.$conf->global->PROPOSAL_IMAGE_PUBLIC_SIGN.'">';
269  print '</div>';
270 }
271 
272 // Output introduction text
273 $text = '';
274 if (!empty($conf->global->ONLINE_SIGN_NEWFORM_TEXT)) {
275  $reg = array();
276  if (preg_match('/^\((.*)\)$/', $conf->global->ONLINE_SIGN_NEWFORM_TEXT, $reg)) {
277  $text .= $langs->trans($reg[1])."<br>\n";
278  } else {
279  $text .= $conf->global->ONLINE_SIGN_NEWFORM_TEXT."<br>\n";
280  }
281  $text = '<tr><td align="center"><br>'.$text.'<br></td></tr>'."\n";
282 }
283 if (empty($text)) {
284  $text .= '<tr><td class="textpublicpayment"><br><strong>'.$langs->trans("WelcomeOnOnlineSignaturePage", $mysoc->name).'</strong></td></tr>'."\n";
285  $text .= '<tr><td class="textpublicpayment opacitymedium">'.$langs->trans("ThisScreenAllowsYouToSignDocFrom", $creditor).'<br><br></td></tr>'."\n";
286 }
287 print $text;
288 
289 // Output payment summary form
290 print '<tr><td align="center">';
291 print '<table with="100%" id="tablepublicpayment">';
292 print '<tr><td align="left" colspan="2" class="opacitymedium">'.$langs->trans("ThisIsInformationOnDocumentToSign").' :</td></tr>'."\n";
293 
294 $found = false;
295 $error = 0;
296 
297 // Signature on commercial proposal
298 if ($source == 'proposal') {
299  $found = true;
300  $langs->load("proposal");
301 
302  $result = $object->fetch_thirdparty($object->socid);
303 
304  // Creditor
305  print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Creditor");
306  print '</td><td class="CTableRow2">';
307  print img_picto('', 'company', 'class="pictofixedwidth"');
308  print '<b>'.$creditor.'</b>';
309  print '<input type="hidden" name="creditor" value="'.$creditor.'">';
310  print '</td></tr>'."\n";
311 
312  // Debitor
313  print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("ThirdParty");
314  print '</td><td class="CTableRow2">';
315  print img_picto('', 'company', 'class="pictofixedwidth"');
316  print '<b>'.$object->thirdparty->name.'</b>';
317  print '</td></tr>'."\n";
318 
319  // Amount
320  print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Amount");
321  print '</td><td class="CTableRow2">';
322  print '<b>'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</b>';
323  print '</td></tr>'."\n";
324 
325  // Object
326  $text = '<b>'.$langs->trans("SignatureProposalRef", $object->ref).'</b>';
327  print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Designation");
328  print '</td><td class="CTableRow2">'.$text;
329 
330  $last_main_doc_file = $object->last_main_doc;
331 
332  if ($object->status == $object::STATUS_VALIDATED) {
333  if (empty($last_main_doc_file) || !dol_is_file(DOL_DATA_ROOT.'/'.$object->last_main_doc)) {
334  // It seems document has never been generated, or was generated and then deleted.
335  // So we try to regenerate it with its default template.
336  $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used.
337  $object->generateDocument($defaulttemplate, $langs);
338  }
339 
340  $directdownloadlink = $object->getLastMainDocLink('proposal');
341  if ($directdownloadlink) {
342  print '<br><a href="'.$directdownloadlink.'">';
343  print img_mime($object->last_main_doc, '');
344  print $langs->trans("DownloadDocument").'</a>';
345  }
346  } else {
347  if ($object->status == $object::STATUS_NOTSIGNED) {
348  $directdownloadlink = $object->getLastMainDocLink('proposal');
349  if ($directdownloadlink) {
350  print '<br><a href="'.$directdownloadlink.'">';
351  print img_mime($last_main_doc_file, '');
352  print $langs->trans("DownloadDocument").'</a>';
353  }
354  } elseif ($object->status == $object::STATUS_SIGNED || $object->status == $object::STATUS_BILLED) {
355  if (preg_match('/_signed-(\d+)/', $last_main_doc_file)) { // If the last main doc has been signed
356  $last_main_doc_file_not_signed = preg_replace('/_signed-(\d+)/', '', $last_main_doc_file);
357 
358  $datefilesigned = dol_filemtime($last_main_doc_file);
359  $datefilenotsigned = dol_filemtime($last_main_doc_file_not_signed);
360 
361  if (empty($datefilenotsigned) || $datefilesigned > $datefilenotsigned) {
362  $directdownloadlink = $object->getLastMainDocLink('proposal');
363  if ($directdownloadlink) {
364  print '<br><a href="'.$directdownloadlink.'">';
365  print img_mime($object->last_main_doc, '');
366  print $langs->trans("DownloadDocument").'</a>';
367  }
368  }
369  }
370  }
371  }
372 
373  print '<input type="hidden" name="source" value="'.GETPOST("source", 'alpha').'">';
374  print '<input type="hidden" name="ref" value="'.$object->ref.'">';
375  print '</td></tr>'."\n";
376 }
377 
378 
379 
380 if (!$found && !$mesg) {
381  $mesg = $langs->transnoentitiesnoconv("ErrorBadParameters");
382 }
383 
384 if ($mesg) {
385  print '<tr><td class="center" colspan="2"><br><div class="warning">'.dol_escape_htmltag($mesg).'</div></td></tr>'."\n";
386 }
387 
388 print '</table>'."\n";
389 print "\n";
390 
391 if ($action != 'dosign') {
392  if ($found && !$error) {
393  // We are in a management option and no error
394  } else {
395  dol_print_error_email('ERRORNEWONLINESIGN');
396  }
397 } else {
398  // Print
399 }
400 
401 print '</td></tr>'."\n";
402 print '<tr><td class="center">';
403 
404 
405 if ($action == "dosign" && empty($cancel)) {
406  print '<div class="tablepublicpayment">';
407  print '<input type="button" class="buttonDelete small" id="clearsignature" value="'.$langs->trans("ClearSignature").'">';
408  print '<div id="signature" style="border:solid;"></div>';
409  print '</div>';
410  // Do not use class="reposition" here: It breaks the submit and there is a message on top to say it's ok, so going back top is better.
411  print '<input type="button" class="button" id="signbutton" value="'.$langs->trans("Sign").'">';
412  print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
413 
414  // Add js code managed into the div #signature
415  print '<script language="JavaScript" type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jSignature/jSignature.js"></script>
416  <script type="text/javascript">
417  $(document).ready(function() {
418  $("#signature").jSignature({ color:"#000", lineWidth:4, '.(empty($conf->dol_optimize_smallscreen) ? '' : 'width: 280, ' ).'height: 180});
419 
420  $("#signature").on("change",function(){
421  $("#clearsignature").css("display","");
422  $("#signbutton").attr("disabled",false);
423  if(!$._data($("#signbutton")[0], "events")){
424  $("#signbutton").on("click",function(){
425  var signature = $("#signature").jSignature("getData", "image");
426  $.ajax({
427  type: "POST",
428  url: "'.DOL_URL_ROOT.'/core/ajax/onlineSign.php",
429  dataType: "text",
430  data: {
431  "action" : "importSignature",
432  "signaturebase64" : signature,
433  "ref" : \''.dol_escape_js($REF).'\',
434  "securekey" : \''.dol_escape_js($SECUREKEY).'\',
435  "mode" : \''.dol_escape_htmltag($source).'\',
436  "entity" : \''.dol_escape_htmltag($entity).'\',
437  },
438  success: function(response) {
439  if(response == "success"){
440  console.log("Success on saving signature");
441  window.location.replace("'.$_SERVER["PHP_SELF"].'?ref='.urlencode($ref).'&message=signed&securekey='.urlencode($SECUREKEY).($conf->multicompany->enabled?'&entity='.$entity:'').'");
442  }else{
443  console.error(response);
444  }
445  },
446  });
447  });
448  }
449  });
450 
451  $("#clearsignature").on("click",function(){
452  $("#signature").jSignature("clear");
453  $("#signbutton").attr("disabled",true);
454  });
455 
456  $("#signbutton").attr("disabled",true);
457  });
458  </script>';
459 } else {
460  if ($source == 'proposal') {
461  if ($object->status == $object::STATUS_SIGNED) {
462  print '<br>';
463  if ($message == 'signed') {
464  print '<span class="ok">'.$langs->trans("PropalSigned").'</span>';
465  } else {
466  print '<span class="ok">'.$langs->trans("PropalAlreadySigned").'</span>';
467  }
468  } elseif ($object->status == $object::STATUS_NOTSIGNED) {
469  print '<br>';
470  if ($message == 'refused') {
471  print '<span class="ok">'.$langs->trans("PropalRefused").'</span>';
472  } else {
473  print '<span class="warning">'.$langs->trans("PropalAlreadyRefused").'</span>';
474  }
475  } else {
476  print '<input type="submit" class="butAction small wraponsmartphone marginbottomonly marginleftonly marginrightonly reposition" value="'.$langs->trans("SignPropal").'">';
477  print '<input name="refusepropal" type="submit" class="butActionDelete small wraponsmartphone marginbottomonly marginleftonly marginrightonly reposition" value="'.$langs->trans("RefusePropal").'">';
478  }
479  }
480 }
481 print '</td></tr>'."\n";
482 print '</table>'."\n";
483 print '</form>'."\n";
484 print '</div>'."\n";
485 print '<br>';
486 
487 
488 htmlPrintOnlinePaymentFooter($mysoc, $langs);
489 
490 llxFooter('', 'public');
491 
492 $db->close();
dol_escape_htmltag
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
Definition: functions.lib.php:1468
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
dol_filemtime
dol_filemtime($pathoffile)
Return time of a file.
Definition: files.lib.php:593
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
dol_verifyHash
dol_verifyHash($chain, $hash, $type='0')
Compute a hash and compare it to the given one For backward compatibility reasons,...
Definition: security.lib.php:151
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
name
$conf db name
Definition: repair.php:122
dol_is_file
dol_is_file($pathoffile)
Return if path is a file.
Definition: files.lib.php:477
dol_print_error_email
dol_print_error_email($prefixcode, $errormessage='', $errormessages=array(), $morecss='error', $email='')
Show a public email and error code to contact if technical error.
Definition: functions.lib.php:4986
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:3880
dol_escape_js
dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
Returns text escaped for inclusion into javascript code.
Definition: functions.lib.php:1423
dol_syslog
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Definition: functions.lib.php:1603
User
Class to manage Dolibarr users.
Definition: user.class.php:44
img_mime
img_mime($file, $titlealt='', $morecss='')
Show MIME img of a file.
Definition: functions.lib.php:4726
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
dol_now
dol_now($mode='auto')
Return date for now.
Definition: functions.lib.php:2845
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
Propal
Class to manage proposals.
Definition: propal.class.php:52
type
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition: repair.php:119
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59