25if (!defined(
'NOTOKENRENEWAL')) {
26 define(
'NOTOKENRENEWAL',
'1');
28if (!defined(
'NOREQUIREHTML')) {
29 define(
'NOREQUIREHTML',
'1');
31if (!defined(
'NOREQUIREAJAX')) {
32 define(
'NOREQUIREAJAX',
'1');
39if (!defined(
'NOREQUIREMENU')) {
40 define(
'NOREQUIREMENU',
'1');
43if (!defined(
"NOLOGIN")) {
44 define(
"NOLOGIN",
'1');
46if (!defined(
'NOIPCHECK')) {
47 define(
'NOIPCHECK',
'1');
49if (!defined(
'NOBROWSERNOTIF')) {
50 define(
'NOBROWSERNOTIF',
'1');
52$entity = (!empty($_GET[
'entity']) ? (int) $_GET[
'entity'] : (!empty($_POST[
'entity']) ? (int) $_POST[
'entity'] : 1));
53if (is_numeric($entity)) {
54 define(
"DOLENTITY", $entity);
56include
'../../main.inc.php';
57require_once DOL_DOCUMENT_ROOT .
'/core/lib/files.lib.php';
66$action =
GETPOST(
'action',
'aZ09');
68$signature =
GETPOST(
'signaturebase64');
71$SECUREKEY =
GETPOST(
"securekey");
72$online_sign_name =
GETPOST(
"onlinesignname");
81if ($type ==
'proposal') {
83} elseif ($type ==
'contract') {
85} elseif ($type ==
'fichinter') {
88 $securekeyseed =
getDolGlobalString(strtoupper($type).
'_ONLINE_SIGNATURE_SECURITY_TOKEN');
91if (empty($SECUREKEY) || !
dol_verifyHash($securekeyseed . $type . $ref . (!isModEnabled(
'multicompany') ?
'' : $entity), $SECUREKEY,
'0')) {
96$hookmanager->initHooks(array(
'ajaxonlinesign'));
112if ($action ==
"importSignature") {
113 $issignatureok = (!empty($signature) && $signature[0] ==
"image/png;base64");
114 if ($issignatureok) {
115 $signature = $signature[1];
116 $data = base64_decode($signature);
118 if ($mode ==
"propale" || $mode ==
'proposal') {
119 require_once DOL_DOCUMENT_ROOT .
'/comm/propal/class/propal.class.php';
120 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
124 $upload_dir = !empty(
$conf->propal->multidir_output[
$object->entity]) ?
$conf->propal->multidir_output[
$object->entity] :
$conf->propal->dir_output;
129 $langs->loadLangs(array(
"main",
"companies"));
132 $filename =
"signatures/" . $date .
"_signature.png";
133 if (!is_dir($upload_dir .
"signatures/")) {
134 if (!
dol_mkdir($upload_dir .
"signatures/")) {
135 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
141 $return = file_put_contents($upload_dir . $filename, $data);
142 if ($return ==
false) {
144 $response =
'Error file_put_content: failed to create signature file.';
150 $last_main_doc_file =
$object->last_main_doc;
151 $directdownloadlink =
$object->getLastMainDocLink(
'proposal');
153 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
155 $newpdffilename = $upload_dir . $ref .
"_signed-" . $date .
".pdf";
156 $sourcefile = $upload_dir . $ref .
".pdf";
159 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
160 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
165 if (empty($reshook)) {
168 if (class_exists(
'TCPDF')) {
169 $pdf->setPrintHeader(
false);
170 $pdf->setPrintFooter(
false);
175 $pdf->SetCompression(
false);
179 $pagecount = $pdf->setSourceFile($sourcefile);
182 $param[
'online_sign_name'] = $online_sign_name;
183 $param[
'pathtoimage'] = $upload_dir . $filename;
186 for ($i = 1; $i < ($pagecount + 1); $i++) {
188 $tppl = $pdf->importPage($i);
189 $s = $pdf->getTemplatesize($tppl);
190 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
191 $pdf->useTemplate($tppl);
192 $propalsignonspecificpage =
getDolGlobalInt(
"PROPAL_SIGNATURE_ON_SPECIFIC_PAGE");
193 if ($propalsignonspecificpage < 0) {
194 $propalsignonspecificpage = $pagecount - abs($propalsignonspecificpage);
197 if (
getDolGlobalString(
"PROPAL_SIGNATURE_ON_ALL_PAGES") || $propalsignonspecificpage == $i) {
204 $param[
'xforimgstart'] = (empty($s[
'w']) ? 120 : round($s[
'w'] / 2) + 15);
209 $param[
'yforimgstart'] = (empty($s[
'h']) ? 240 : $s[
'h'] - 60);
214 $param[
'wforimg'] = $s[
'w'] - 20 - $param[
'xforimgstart'];
220 dol_syslog(
"Error when manipulating the PDF " . $sourcefile .
" by onlineSign: " . $e->getMessage(), LOG_ERR);
221 $response = $e->getMessage();
233 $param[
'xforimgstart'] = (empty($s[
'w']) ? 120 : round($s[
'w'] / 2) + 15);
238 $param[
'yforimgstart'] = (empty($s[
'h']) ? 240 : $s[
'h'] - 60);
243 $param[
'wforimg'] = $s[
'w'] - 20 - $param[
'xforimgstart'];
250 $pdf->Output($newpdffilename,
"F");
253 $object->indexFile($newpdffilename, 1);
256 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
270 $sql =
"UPDATE " . MAIN_DB_PREFIX .
"propal";
271 $sql .=
" SET fk_statut = " . ((int) $object::STATUS_SIGNED) .
", note_private = '" . $db->escape(
$object->note_private) .
"',";
272 $sql .=
" date_signature = '" . $db->idate(
dol_now()) .
"',";
273 $sql .=
" online_sign_ip = '" . $db->escape($online_sign_ip) .
"'";
274 if ($online_sign_name) {
275 $sql .=
", online_sign_name = '" . $db->escape($online_sign_name) .
"'";
277 $sql .=
" WHERE rowid = " . ((int)
$object->id);
280 $resql = $db->query($sql);
284 $num = $db->affected_rows($resql);
288 if (method_exists(
$object,
'call_trigger')) {
290 $user =
new User($db);
291 $user->fetch(
$object->user_validation_id);
292 $object->context = array(
'closedfromonlinesignature' =>
'closedfromonlinesignature');
293 $result =
$object->call_trigger(
'PROPAL_CLOSE_SIGNED', $user);
296 $response =
"error in trigger " .
$object->error;
300 $result = $soc->setAsCustomer();
303 $response = $db->lasterror();
305 $response =
"success";
309 $response =
"success";
313 $response =
"error sql";
318 $response =
"success";
324 } elseif ($mode ==
'contract') {
325 require_once DOL_DOCUMENT_ROOT .
'/contrat/class/contrat.class.php';
326 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
330 $upload_dir = !empty(
$conf->contrat->multidir_output[
$object->entity]) ?
$conf->contrat->multidir_output[
$object->entity] :
$conf->contrat->dir_output;
334 $filename =
"signatures/" . $date .
"_signature.png";
335 if (!is_dir($upload_dir .
"signatures/")) {
336 if (!
dol_mkdir($upload_dir .
"signatures/")) {
337 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
343 $return = file_put_contents($upload_dir . $filename, $data);
344 if ($return ==
false) {
346 $response =
'Error file_put_content: failed to create signature file.';
352 $last_main_doc_file =
$object->last_main_doc;
353 $directdownloadlink =
$object->getLastMainDocLink(
'contrat');
355 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
357 $newpdffilename = $upload_dir . $ref .
"_signed-" . $date .
".pdf";
358 $sourcefile = $upload_dir . $ref .
".pdf";
361 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
362 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
367 if (empty($reshook)) {
370 if (class_exists(
'TCPDF')) {
371 $pdf->setPrintHeader(
false);
372 $pdf->setPrintFooter(
false);
377 $pdf->SetCompression(
false);
381 $pagecount = $pdf->setSourceFile($sourcefile);
384 $param[
'online_sign_name'] = $online_sign_name;
385 $param[
'pathtoimage'] = $upload_dir . $filename;
388 for ($i = 1; $i < ($pagecount + 1); $i++) {
390 $tppl = $pdf->importPage($i);
391 $s = $pdf->getTemplatesize($tppl);
392 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
393 $pdf->useTemplate($tppl);
402 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : $s[
'w'] / 2 - 0);
407 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 62);
412 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
418 dol_syslog(
"Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
419 $response = $e->getMessage();
428 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : $s[
'w'] / 2 - 0);
429 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 62);
430 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
436 $pdf->Output($newpdffilename,
"F");
439 $object->indexFile($newpdffilename, 1);
443 $response =
"success";
445 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
452 $user =
new User($db);
453 $object->setSignedStatus($user, Contrat::$SIGNED_STATUSES[
'STATUS_SIGNED_RECEIVER_ONLINE'], 0,
'CONTRACT_MODIFY');
455 } elseif ($mode ==
'fichinter') {
456 require_once DOL_DOCUMENT_ROOT .
'/fichinter/class/fichinter.class.php';
457 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
461 $upload_dir = !empty(
$conf->ficheinter->multidir_output[
$object->entity]) ?
$conf->ficheinter->multidir_output[
$object->entity] :
$conf->ficheinter->dir_output;
462 $upload_dir .=
'/'.dol_sanitizeFileName(
$object->ref).
'/';
464 $langs->loadLangs(array(
"main",
"companies"));
470 $filename =
"signatures/" . $date .
"_signature.png";
471 if (!is_dir($upload_dir .
"signatures/")) {
472 if (!
dol_mkdir($upload_dir .
"signatures/")) {
473 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
479 $return = file_put_contents($upload_dir . $filename, $data);
480 if ($return ==
false) {
482 $response =
'Error file_put_content: failed to create signature file.';
488 $last_main_doc_file =
$object->last_main_doc;
489 $directdownloadlink =
$object->getLastMainDocLink(
'fichinter');
491 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
493 $newpdffilename = $upload_dir . $ref .
"_signed-" . $date .
".pdf";
494 $sourcefile = $upload_dir . $ref .
".pdf";
497 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
498 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
503 if (empty($reshook)) {
506 if (class_exists(
'TCPDF')) {
507 $pdf->setPrintHeader(
false);
508 $pdf->setPrintFooter(
false);
513 $pdf->SetCompression(
false);
517 $pagecount = $pdf->setSourceFile($sourcefile);
520 $param[
'online_sign_name'] = $online_sign_name;
521 $param[
'pathtoimage'] = $upload_dir . $filename;
524 for ($i = 1; $i < ($pagecount + 1); $i++) {
526 $tppl = $pdf->importPage($i);
527 $s = $pdf->getTemplatesize($tppl);
528 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
529 $pdf->useTemplate($tppl);
538 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : $s[
'w'] / 2 - 2);
543 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 38);
548 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 20);
554 dol_syslog(
"Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
555 $response = $e->getMessage();
564 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : $s[
'w'] / 2 - 2);
565 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 38);
566 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 20);
572 $pdf->Output($newpdffilename,
"F");
575 $object->indexFile($newpdffilename, 1);
579 $response =
"success";
581 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
588 $user =
new User($db);
589 $object->setSignedStatus($user, Fichinter::$SIGNED_STATUSES[
'STATUS_SIGNED_RECEIVER_ONLINE'], 0,
'FICHINTER_MODIFY');
591 } elseif ($mode ==
"societe_rib") {
592 $langs->load(
'withdrawals');
593 require_once DOL_DOCUMENT_ROOT .
'/societe/class/companybankaccount.class.php';
594 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
595 $modelpath =
"core/modules/bank/doc/";
605 $langs->loadLangs(array(
"main",
"companies"));
608 $filename =
"signatures/" . $date .
"_signature.png";
609 if (!
dol_is_dir($upload_dir .
"signatures/")) {
610 if (!
dol_mkdir($upload_dir .
"signatures/")) {
611 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
616 $response =
"Error directory " . $upload_dir .
"signatures/ is not writable";
620 $response =
"Error directory " . DOL_DATA_ROOT.
"/admin/temp/ is not writable";
625 $return = file_put_contents($upload_dir . $filename, $data);
626 if ($return ==
false) {
628 $response =
'Error file_put_content: failed to create signature file.';
634 $last_main_doc_file =
$object->last_main_doc;
635 $last_modelpdf =
$object->model_pdf;
636 $directdownloadlink =
$object->getLastMainDocLink(
'company');
638 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
640 $newpdffilename =
'';
641 if ($last_modelpdf ==
'sepamandate') {
646 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
647 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
652 if (empty($reshook)) {
655 if (class_exists(
'TCPDF')) {
656 $pdf->setPrintHeader(
false);
657 $pdf->setPrintFooter(
false);
662 $pdf->SetCompression(
false);
666 $pagecount = $pdf->setSourceFile($sourcefile);
669 for ($i = 1; $i < ($pagecount + 1); $i++) {
671 $tppl = $pdf->importPage($i);
672 $s = $pdf->getTemplatesize($tppl);
673 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
674 $pdf->useTemplate($tppl);
676 dol_syslog(
"Error when manipulating the PDF " . $sourcefile .
" by onlineSign: " . $e->getMessage(), LOG_ERR);
677 $response = $e->getMessage();
687 $dirmodels = array(
'/');
688 if (is_array(
$conf->modules_parts[
'models'])) {
689 $dirmodels = array_merge($dirmodels,
$conf->modules_parts[
'models']);
691 foreach ($dirmodels as $reldir) {
692 $file =
"pdf_" . $last_modelpdf .
".modules.php";
695 if (file_exists($file)) {
697 $classname =
'pdf_' . $last_modelpdf;
702 if ($filefound ===
'') {
703 $response = $langs->trans(
"Error") .
' Failed to load doc generator with modelpaths=' . $modelpath .
' - modele=' . $last_modelpdf;
708 if (!$error && $classname !==
'') {
712 $objPDF =
new $classname($db);
714 $pdf->SetFont($default_font,
'', $default_font_size - 1);
716 $xForDate = $objPDF->marge_gauche;
717 $yForDate = $objPDF->page_hauteur - $objPDF->heightforinfotot - $objPDF->heightforfreetext - $objPDF->heightforfooter + 10;
718 $pdf->SetXY($xForDate, $yForDate);
721 $xforimgstart = $objPDF->xPosSignArea;
722 $yforimgstart = $yForDate - 5;
723 $wforimg = $s[
'w'] - 20 - $xforimgstart;
726 $param[
'online_sign_name'] = $online_sign_name;
727 $param[
'pathtoimage'] = $upload_dir . $filename;
732 $param[
'xforimgstart'] = $xforimgstart;
733 $param[
'yforimgstart'] = $yforimgstart;
734 $param[
'wforimg'] = $wforimg;
739 $pdf->Output($newpdffilename,
"F");
742 $object->indexFile($newpdffilename, 1);
745 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
755 $response =
"cannot find BAN/RIB";
763 $sql =
"UPDATE " . MAIN_DB_PREFIX .
$object->table_element;
765 $sql .=
" date_signature = '" . $db->idate(
dol_now()) .
"',";
766 $sql .=
" online_sign_ip = '" . $db->escape($online_sign_ip) .
"'";
767 if ($online_sign_name) {
768 $sql .=
", online_sign_name = '" . $db->escape($online_sign_name) .
"'";
772 $sql .=
" WHERE rowid = " . ((int)
$object->id);
775 $resql = $db->query($sql);
779 $num = $db->affected_rows($resql);
783 $response =
"success";
786 $response =
"error sql";
791 $response =
"success";
797 } elseif ($mode ==
'expedition') {
798 require_once DOL_DOCUMENT_ROOT .
'/expedition/class/expedition.class.php';
799 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
804 $upload_dir =
$conf->expedition->dir_output.
"/sending/";
805 $upload_dir .=
'/'.dol_sanitizeFileName(
$object->ref).
'/';
807 $langs->loadLangs(array(
"main",
"companies"));
813 $filename =
"signatures/" . $date .
"_signature.png";
814 if (!is_dir($upload_dir .
"signatures/")) {
815 if (!
dol_mkdir($upload_dir .
"signatures/")) {
816 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
822 $return = file_put_contents($upload_dir . $filename, $data);
823 if ($return ==
false) {
825 $response =
'Error file_put_content: failed to create signature file.';
830 $last_main_doc_file =
$object->last_main_doc;
832 if (empty($last_main_doc_file) || !
dol_is_file(DOL_DATA_ROOT.
'/'.
$object->last_main_doc)) {
835 $defaulttemplate =
'';
836 $object->generateDocument($defaulttemplate, $langs);
838 $last_main_doc_file =
$object->last_main_doc;
839 $directdownloadlink =
$object->getLastMainDocLink(
'expedition');
841 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
843 $newpdffilename = $upload_dir . $ref .
"_signed-" . $date .
".pdf";
844 $sourcefile = $upload_dir . $ref .
".pdf";
847 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
848 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
853 if (empty($reshook)) {
856 if (class_exists(
'TCPDF')) {
857 $pdf->setPrintHeader(
false);
858 $pdf->setPrintFooter(
false);
863 $pdf->SetCompression(
false);
867 $pagecount = $pdf->setSourceFile($sourcefile);
870 $param[
'online_sign_name'] = $online_sign_name;
871 $param[
'pathtoimage'] = $upload_dir . $filename;
874 for ($i = 1; $i < ($pagecount + 1); $i++) {
876 $tppl = $pdf->importPage($i);
877 $s = $pdf->getTemplatesize($tppl);
878 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
879 $pdf->useTemplate($tppl);
885 $param[
'xforimgstart'] = 111;
886 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 60);
887 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
892 dol_syslog(
"Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
893 $response = $e->getMessage();
902 $param[
'xforimgstart'] = 111;
903 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 60);
904 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
910 $pdf->Output($newpdffilename,
"F");
913 $object->indexFile($newpdffilename, 1);
917 $response =
"success";
919 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
927 $user =
new User($db);
928 $object->setSignedStatus($user, Expedition::$SIGNED_STATUSES[
'STATUS_SIGNED_RECEIVER_ONLINE'], 0,
'SHIPPING_MODIFY');
932 $response =
'error signature_not_found';
937 http_response_code(501);
955 $xforimgstart = $params[
'xforimgstart'];
956 $yforimgstart = $params[
'yforimgstart'];
957 $wforimg = $params[
'wforimg'];
959 $pdf->SetXY($xforimgstart, $yforimgstart + round($wforimg / 4) - 4);
960 $pdf->SetFont($default_font,
'', $default_font_size - 1);
961 $pdf->SetTextColor(80, 80, 80);
962 $pdf->MultiCell($wforimg, 4, $langs->trans(
"Signature") .
': ' .
dol_print_date(
dol_now(),
"day",
false, $langs,
true).
' - '.$params[
'online_sign_name'], 0,
'L');
966 $pdf->Image($params[
'pathtoimage'], $xforimgstart, $yforimgstart, $wforimg, round($wforimg / 4));
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Class to manage bank accounts description of third parties.
Class to manage proposals.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
dol_is_writable($folderorfile)
Test if directory or filename is writable.
dol_is_file($pathoffile)
Return if path is a file.
dol_is_dir($folder)
Test if filename is a directory.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
dol_ucfirst($string, $encoding="UTF-8")
Convert first character of the first word of a string to upper.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
getUserRemoteIP()
Return the IP of remote user.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
dolPrintSignatureImage(TCPDF $pdf, $langs, $params)
Output the signature file into the PDF object.
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
pdf_getInstance($format='', $metric='mm', $pagetype='P')
Return a PDF instance object.
httponly_accessforbidden($message='1', $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.
dol_verifyHash($chain, $hash, $type='0')
Compute a hash and compare it to the given one For backward compatibility reasons,...