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)) {
154 $ref_pdf = pathinfo($last_main_doc_file, PATHINFO_FILENAME);
155 $ref_pdf = preg_replace(
'/_signed-(\d+)/',
'', $ref_pdf);
157 $newpdffilename = $upload_dir . $ref_pdf .
"_signed-" . $date .
".pdf";
158 $sourcefile = $upload_dir . $ref_pdf .
".pdf";
161 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
162 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
167 if (empty($reshook)) {
170 if (class_exists(
'TCPDF')) {
171 $pdf->setPrintHeader(
false);
172 $pdf->setPrintFooter(
false);
177 $pdf->SetCompression(
false);
181 $pagecount = $pdf->setSourceFile($sourcefile);
184 $param[
'online_sign_name'] = $online_sign_name;
185 $param[
'pathtoimage'] = $upload_dir . $filename;
187 $propalsignonspecificpage =
getDolGlobalInt(
"PROPAL_SIGNATURE_ON_SPECIFIC_PAGE");
190 for ($i = 1; $i < ($pagecount + 1); $i++) {
192 $tppl = $pdf->importPage($i);
193 $s = $pdf->getTemplatesize($tppl);
194 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
195 $pdf->useTemplate($tppl);
196 if ($propalsignonspecificpage < 0) {
197 $propalsignonspecificpage = $pagecount - abs($propalsignonspecificpage);
200 if (empty($propalsignonspecificpage)) {
205 if (preg_match(
'/PAGESIGN=(\d+)/', $keywords, $reg)) {
206 $propalsignonspecificpage = (int) $reg[1];
210 if (
getDolGlobalString(
"PROPAL_SIGNATURE_ON_ALL_PAGES") || $propalsignonspecificpage == $i) {
217 $param[
'xforimgstart'] = (empty($s[
'w']) ? 120 : round($s[
'w'] / 2) + 15);
222 $param[
'yforimgstart'] = (empty($s[
'h']) ? 240 : $s[
'h'] - 60);
227 $param[
'wforimg'] = $s[
'w'] - 20 - $param[
'xforimgstart'];
233 dol_syslog(
"Error when manipulating the PDF " . $sourcefile .
" by onlineSign: " . $e->getMessage(), LOG_ERR);
234 $response = $e->getMessage();
239 if (!
getDolGlobalString(
"PROPAL_SIGNATURE_ON_ALL_PAGES") && !$propalsignonspecificpage) {
245 $param[
'xforimgstart'] = (empty($s[
'w']) ? 120 : round($s[
'w'] / 2) + 15);
250 $param[
'yforimgstart'] = (empty($s[
'h']) ? 240 : $s[
'h'] - 60);
255 $param[
'wforimg'] = $s[
'w'] - 20 - $param[
'xforimgstart'];
262 $pdf->Output($newpdffilename,
"F");
265 $object->indexFile($newpdffilename, 1);
268 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
282 $sql =
"UPDATE " . MAIN_DB_PREFIX .
"propal";
283 $sql .=
" SET fk_statut = " . ((int) $object::STATUS_SIGNED) .
", note_private = '" . $db->escape(
$object->note_private) .
"',";
284 $sql .=
" date_signature = '" . $db->idate(
dol_now()) .
"',";
285 $sql .=
" online_sign_ip = '" . $db->escape($online_sign_ip) .
"'";
286 if ($online_sign_name) {
287 $sql .=
", online_sign_name = '" . $db->escape($online_sign_name) .
"'";
289 $sql .=
" WHERE rowid = " . ((int)
$object->id);
292 $resql = $db->query($sql);
296 $num = $db->affected_rows($resql);
300 if (method_exists(
$object,
'call_trigger')) {
302 $user =
new User($db);
303 $user->fetch(
$object->user_validation_id);
304 $object->context = array(
'closedfromonlinesignature' =>
'closedfromonlinesignature');
305 $result =
$object->call_trigger(
'PROPAL_CLOSE_SIGNED', $user);
308 $response =
"error in trigger " .
$object->error;
312 $result = $soc->setAsCustomer();
315 $response = $db->lasterror();
317 $response =
"success";
321 $response =
"success";
325 $response =
"error sql";
330 $response =
"success";
336 } elseif ($mode ==
'contract') {
337 require_once DOL_DOCUMENT_ROOT .
'/contrat/class/contrat.class.php';
338 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
342 $upload_dir = !empty(
$conf->contrat->multidir_output[
$object->entity]) ?
$conf->contrat->multidir_output[
$object->entity] :
$conf->contrat->dir_output;
346 $filename =
"signatures/" . $date .
"_signature.png";
347 if (!is_dir($upload_dir .
"signatures/")) {
348 if (!
dol_mkdir($upload_dir .
"signatures/")) {
349 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
355 $return = file_put_contents($upload_dir . $filename, $data);
356 if ($return ==
false) {
358 $response =
'Error file_put_content: failed to create signature file.';
364 $last_main_doc_file =
$object->last_main_doc;
365 $directdownloadlink =
$object->getLastMainDocLink(
'contrat');
367 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
368 $ref_pdf = pathinfo($last_main_doc_file, PATHINFO_FILENAME);
370 $newpdffilename = $upload_dir . $ref_pdf .
"_signed-" . $date .
".pdf";
371 $sourcefile = $upload_dir . $ref_pdf .
".pdf";
374 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
375 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
380 if (empty($reshook)) {
383 if (class_exists(
'TCPDF')) {
384 $pdf->setPrintHeader(
false);
385 $pdf->setPrintFooter(
false);
390 $pdf->SetCompression(
false);
394 $pagecount = $pdf->setSourceFile($sourcefile);
397 $param[
'online_sign_name'] = $online_sign_name;
398 $param[
'pathtoimage'] = $upload_dir . $filename;
401 for ($i = 1; $i < ($pagecount + 1); $i++) {
403 $tppl = $pdf->importPage($i);
404 $s = $pdf->getTemplatesize($tppl);
405 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
406 $pdf->useTemplate($tppl);
415 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : $s[
'w'] / 2 - 0);
420 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 62);
425 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
431 dol_syslog(
"Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
432 $response = $e->getMessage();
441 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : $s[
'w'] / 2 - 0);
442 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 62);
443 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
449 $pdf->Output($newpdffilename,
"F");
452 $object->indexFile($newpdffilename, 1);
456 $response =
"success";
458 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
465 $user =
new User($db);
466 $object->setSignedStatus($user, Contrat::$SIGNED_STATUSES[
'STATUS_SIGNED_RECEIVER_ONLINE'], 0,
'CONTRACT_MODIFY');
468 } elseif ($mode ==
'fichinter') {
469 require_once DOL_DOCUMENT_ROOT .
'/fichinter/class/fichinter.class.php';
470 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
474 $upload_dir = !empty(
$conf->ficheinter->multidir_output[
$object->entity]) ?
$conf->ficheinter->multidir_output[
$object->entity] :
$conf->ficheinter->dir_output;
475 $upload_dir .=
'/'.dol_sanitizeFileName(
$object->ref).
'/';
477 $langs->loadLangs(array(
"main",
"companies"));
483 $filename =
"signatures/" . $date .
"_signature.png";
484 if (!is_dir($upload_dir .
"signatures/")) {
485 if (!
dol_mkdir($upload_dir .
"signatures/")) {
486 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
492 $return = file_put_contents($upload_dir . $filename, $data);
493 if ($return ==
false) {
495 $response =
'Error file_put_content: failed to create signature file.';
501 $last_main_doc_file =
$object->last_main_doc;
502 $directdownloadlink =
$object->getLastMainDocLink(
'fichinter');
504 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
505 $ref_pdf = pathinfo($last_main_doc_file, PATHINFO_FILENAME);
507 $newpdffilename = $upload_dir . $ref_pdf .
"_signed-" . $date .
".pdf";
508 $sourcefile = $upload_dir . $ref_pdf .
".pdf";
511 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
512 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
517 if (empty($reshook)) {
520 if (class_exists(
'TCPDF')) {
521 $pdf->setPrintHeader(
false);
522 $pdf->setPrintFooter(
false);
527 $pdf->SetCompression(
false);
531 $pagecount = $pdf->setSourceFile($sourcefile);
534 $param[
'online_sign_name'] = $online_sign_name;
535 $param[
'pathtoimage'] = $upload_dir . $filename;
538 for ($i = 1; $i < ($pagecount + 1); $i++) {
540 $tppl = $pdf->importPage($i);
541 $s = $pdf->getTemplatesize($tppl);
542 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
543 $pdf->useTemplate($tppl);
552 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : $s[
'w'] / 2 - 2);
557 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 38);
562 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 20);
568 dol_syslog(
"Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
569 $response = $e->getMessage();
578 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : $s[
'w'] / 2 - 2);
579 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 38);
580 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 20);
586 $pdf->Output($newpdffilename,
"F");
589 $object->indexFile($newpdffilename, 1);
593 $response =
"success";
595 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
602 $user =
new User($db);
603 $object->setSignedStatus($user, Fichinter::$SIGNED_STATUSES[
'STATUS_SIGNED_RECEIVER_ONLINE'], 0,
'FICHINTER_MODIFY');
605 } elseif ($mode ==
"societe_rib") {
606 $langs->load(
'withdrawals');
607 require_once DOL_DOCUMENT_ROOT .
'/societe/class/companybankaccount.class.php';
608 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
609 $modelpath =
"core/modules/bank/doc/";
619 $langs->loadLangs(array(
"main",
"companies"));
622 $filename =
"signatures/" . $date .
"_signature.png";
623 if (!
dol_is_dir($upload_dir .
"signatures/")) {
624 if (!
dol_mkdir($upload_dir .
"signatures/")) {
625 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
630 $response =
"Error directory " . $upload_dir .
"signatures/ is not writable";
634 $response =
"Error directory " . DOL_DATA_ROOT.
"/admin/temp/ is not writable";
639 $return = file_put_contents($upload_dir . $filename, $data);
640 if ($return ==
false) {
642 $response =
'Error file_put_content: failed to create signature file.';
648 $last_main_doc_file =
$object->last_main_doc;
649 $last_modelpdf =
$object->model_pdf;
650 $directdownloadlink =
$object->getLastMainDocLink(
'company');
652 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
654 $newpdffilename =
'';
655 if ($last_modelpdf ==
'sepamandate') {
660 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
661 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
666 if (empty($reshook)) {
669 if (class_exists(
'TCPDF')) {
670 $pdf->setPrintHeader(
false);
671 $pdf->setPrintFooter(
false);
676 $pdf->SetCompression(
false);
680 $pagecount = $pdf->setSourceFile($sourcefile);
683 for ($i = 1; $i < ($pagecount + 1); $i++) {
685 $tppl = $pdf->importPage($i);
686 $s = $pdf->getTemplatesize($tppl);
687 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
688 $pdf->useTemplate($tppl);
690 dol_syslog(
"Error when manipulating the PDF " . $sourcefile .
" by onlineSign: " . $e->getMessage(), LOG_ERR);
691 $response = $e->getMessage();
701 $dirmodels = array(
'/');
702 if (is_array(
$conf->modules_parts[
'models'])) {
703 $dirmodels = array_merge($dirmodels,
$conf->modules_parts[
'models']);
705 foreach ($dirmodels as $reldir) {
706 $file =
"pdf_" . $last_modelpdf .
".modules.php";
709 if (file_exists($file)) {
711 $classname =
'pdf_' . $last_modelpdf;
716 if ($filefound ===
'') {
717 $response = $langs->trans(
"Error") .
' Failed to load doc generator with modelpaths=' . $modelpath .
' - modele=' . $last_modelpdf;
722 if (!$error && $classname !==
'') {
726 $objPDF =
new $classname($db);
728 $pdf->SetFont($default_font,
'', $default_font_size - 1);
730 $xForDate = $objPDF->marge_gauche;
731 $yForDate = $objPDF->page_hauteur - $objPDF->heightforinfotot - $objPDF->heightforfreetext - $objPDF->heightforfooter + 10;
732 $pdf->SetXY($xForDate, $yForDate);
735 $xforimgstart = $objPDF->xPosSignArea;
736 $yforimgstart = $yForDate - 5;
737 $wforimg = $s[
'w'] - 20 - $xforimgstart;
740 $param[
'online_sign_name'] = $online_sign_name;
741 $param[
'pathtoimage'] = $upload_dir . $filename;
746 $param[
'xforimgstart'] = $xforimgstart;
747 $param[
'yforimgstart'] = $yforimgstart;
748 $param[
'wforimg'] = $wforimg;
753 $pdf->Output($newpdffilename,
"F");
756 $object->indexFile($newpdffilename, 1);
759 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
769 $response =
"cannot find BAN/RIB";
777 $sql =
"UPDATE " . MAIN_DB_PREFIX .
$object->table_element;
779 $sql .=
" date_signature = '" . $db->idate(
dol_now()) .
"',";
780 $sql .=
" online_sign_ip = '" . $db->escape($online_sign_ip) .
"'";
781 if ($online_sign_name) {
782 $sql .=
", online_sign_name = '" . $db->escape($online_sign_name) .
"'";
786 $sql .=
" WHERE rowid = " . ((int)
$object->id);
789 $resql = $db->query($sql);
793 $num = $db->affected_rows($resql);
797 $response =
"success";
800 $response =
"error sql";
805 $response =
"success";
811 } elseif ($mode ==
'expedition') {
812 require_once DOL_DOCUMENT_ROOT .
'/expedition/class/expedition.class.php';
813 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
818 $upload_dir =
$conf->expedition->dir_output.
"/sending/";
819 $upload_dir .=
'/'.dol_sanitizeFileName(
$object->ref).
'/';
821 $langs->loadLangs(array(
"main",
"companies"));
827 $filename =
"signatures/" . $date .
"_signature.png";
828 if (!is_dir($upload_dir .
"signatures/")) {
829 if (!
dol_mkdir($upload_dir .
"signatures/")) {
830 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
836 $return = file_put_contents($upload_dir . $filename, $data);
837 if ($return ==
false) {
839 $response =
'Error file_put_content: failed to create signature file.';
844 $last_main_doc_file =
$object->last_main_doc;
846 if (empty($last_main_doc_file) || !
dol_is_file(DOL_DATA_ROOT.
'/'.
$object->last_main_doc)) {
849 $defaulttemplate =
'';
850 $object->generateDocument($defaulttemplate, $langs);
852 $last_main_doc_file =
$object->last_main_doc;
853 $directdownloadlink =
$object->getLastMainDocLink(
'expedition');
855 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
856 $ref_pdf = pathinfo($last_main_doc_file, PATHINFO_FILENAME);
858 $newpdffilename = $upload_dir . $ref_pdf .
"_signed-" . $date .
".pdf";
859 $sourcefile = $upload_dir . $ref_pdf .
".pdf";
862 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
863 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
868 if (empty($reshook)) {
871 if (class_exists(
'TCPDF')) {
872 $pdf->setPrintHeader(
false);
873 $pdf->setPrintFooter(
false);
878 $pdf->SetCompression(
false);
882 $pagecount = $pdf->setSourceFile($sourcefile);
885 $param[
'online_sign_name'] = $online_sign_name;
886 $param[
'pathtoimage'] = $upload_dir . $filename;
889 for ($i = 1; $i < ($pagecount + 1); $i++) {
891 $tppl = $pdf->importPage($i);
892 $s = $pdf->getTemplatesize($tppl);
893 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
894 $pdf->useTemplate($tppl);
900 $param[
'xforimgstart'] = 111;
901 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 60);
902 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
907 dol_syslog(
"Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
908 $response = $e->getMessage();
917 $param[
'xforimgstart'] = 111;
918 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 60);
919 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
925 $pdf->Output($newpdffilename,
"F");
928 $object->indexFile($newpdffilename, 1);
932 $response =
"success";
934 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
942 $user =
new User($db);
943 $object->setSignedStatus($user, Expedition::$SIGNED_STATUSES[
'STATUS_SIGNED_RECEIVER_ONLINE'], 0,
'SHIPPING_MODIFY');
947 $response =
'error signature_not_found';
952 http_response_code(501);
970 $xforimgstart = $params[
'xforimgstart'];
971 $yforimgstart = $params[
'yforimgstart'];
972 $wforimg = $params[
'wforimg'];
974 $pdf->SetXY($xforimgstart, $yforimgstart + round($wforimg / 4) - 4);
975 $pdf->SetFont($default_font,
'', $default_font_size - 1);
976 $pdf->SetTextColor(80, 80, 80);
977 $pdf->MultiCell($wforimg, 4, $langs->trans(
"Signature") .
': ' .
dol_print_date(
dol_now(),
"day",
false, $langs,
true).
' - '.$params[
'online_sign_name'], 0,
'L');
981 $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.
getUserRemoteIP($trusted=0)
Return the real IP of remote user.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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.
pdfExtractMetadata($file, $field='Keywords')
Function to extract metadata from a PDF file by doing a binary parsing of the PDF file.
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,...