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');
75$SECUREKEY =
GETPOST(
"securekey");
76$online_sign_name =
GETPOST(
"onlinesignname");
83global $dolibarr_main_instance_unique_id;
84$defaultsalt = substr(
dol_hash(
'dolibarr'.$dolibarr_main_instance_unique_id,
'sha256'), 0, 32);
88if ($type ==
'proposal') {
89 $securekeyseed =
getDolGlobalString(
'PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN', $defaultsalt);
90} elseif ($type ==
'contract') {
91 $securekeyseed =
getDolGlobalString(
'CONTRACT_ONLINE_SIGNATURE_SECURITY_TOKEN', $defaultsalt);
92} elseif ($type ==
'fichinter') {
93 $securekeyseed =
getDolGlobalString(
'FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN', $defaultsalt);
95 $securekeyseed =
getDolGlobalString(strtoupper($type).
'_ONLINE_SIGNATURE_SECURITY_TOKEN', $defaultsalt);
98if (empty($SECUREKEY) || !
dol_verifyHash($securekeyseed . $type . $ref . (!
isModEnabled(
'multicompany') ?
'' : $entity), $SECUREKEY,
'0')) {
103$hookmanager->initHooks(array(
'ajaxonlinesign'));
119if ($action ==
"importSignature") {
120 $issignatureok = (!empty($signature) && $signature[0] ==
"image/png;base64");
121 if ($issignatureok) {
122 $signature = $signature[1];
123 $data = base64_decode($signature);
125 if ($mode ==
"propale" || $mode ==
'proposal') {
126 require_once DOL_DOCUMENT_ROOT .
'/comm/propal/class/propal.class.php';
127 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
136 $langs->loadLangs(array(
"main",
"companies"));
139 $filename =
"signatures/" . $date .
"_signature.png";
140 if (!is_dir($upload_dir .
"signatures/")) {
141 if (!
dol_mkdir($upload_dir .
"signatures/")) {
142 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
148 $return = file_put_contents($upload_dir.$filename, $data);
149 if ($return ===
false) {
151 $response =
'Error file_put_content: failed to create signature file.';
159 $last_main_doc_file =
$object->last_main_doc;
160 $directdownloadlink =
$object->getLastMainDocLink(
'proposal');
162 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
163 $ref_pdf = pathinfo($last_main_doc_file, PATHINFO_FILENAME);
164 $ref_pdf = preg_replace(
'/_signed-(\d+)/',
'', $ref_pdf);
166 $newpdffilename = $upload_dir . $ref_pdf .
"_signed-" . $date .
".pdf";
167 $sourcefile = $upload_dir . $ref_pdf .
".pdf";
170 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
171 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
176 if (empty($reshook)) {
179 if (class_exists(
'TCPDF')) {
180 $pdf->setPrintHeader(
false);
181 $pdf->setPrintFooter(
false);
186 $pdf->SetCompression(
false);
190 $pagecount = $pdf->setSourceFile($sourcefile);
193 $param[
'online_sign_name'] = $online_sign_name;
194 $param[
'pathtoimage'] = $upload_dir . $filename;
196 $propalsignonspecificpage =
getDolGlobalInt(
"PROPAL_SIGNATURE_ON_SPECIFIC_PAGE");
199 for ($i = 1; $i < ($pagecount + 1); $i++) {
201 $tppl = $pdf->importPage($i);
202 $s = $pdf->getTemplatesize($tppl);
203 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
204 $pdf->useTemplate($tppl);
205 if ($propalsignonspecificpage < 0) {
206 $propalsignonspecificpage = $pagecount - abs($propalsignonspecificpage);
209 if (empty($propalsignonspecificpage)) {
214 if (preg_match(
'/PAGESIGN=(\d+)/', $keywords, $reg)) {
215 $propalsignonspecificpage = (int) $reg[1];
219 if (
getDolGlobalString(
"PROPAL_SIGNATURE_ON_ALL_PAGES") || $propalsignonspecificpage == $i) {
226 $param[
'xforimgstart'] = (empty($s[
'w']) ? 120 : round($s[
'w'] / 2) + 15);
231 $param[
'yforimgstart'] = (empty($s[
'h']) ? 240 : $s[
'h'] - 60);
236 $param[
'wforimg'] = $s[
'w'] - 20 - $param[
'xforimgstart'];
242 dol_syslog(
"Error when manipulating the PDF " . $sourcefile .
" by onlineSign: " . $e->getMessage(), LOG_ERR);
243 $response = $e->getMessage();
248 if (!
getDolGlobalString(
"PROPAL_SIGNATURE_ON_ALL_PAGES") && !$propalsignonspecificpage) {
254 $param[
'xforimgstart'] = (empty($s[
'w']) ? 120 : round($s[
'w'] / 2) + 15);
259 $param[
'yforimgstart'] = (empty($s[
'h']) ? 240 : $s[
'h'] - 60);
264 $param[
'wforimg'] = $s[
'w'] - 20 - $param[
'xforimgstart'];
271 $pdf->Output($newpdffilename,
"F");
274 $object->indexFile($newpdffilename, 1);
277 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
291 $sql =
"UPDATE " . MAIN_DB_PREFIX .
"propal";
292 $sql .=
" SET fk_statut = " . ((int) $object::STATUS_SIGNED) .
", note_private = '" .
$db->escape(
$object->note_private) .
"',";
293 $sql .=
" date_signature = '" .
$db->idate(
dol_now()) .
"',";
294 $sql .=
" online_sign_ip = '" .
$db->escape($online_sign_ip) .
"'";
295 if ($online_sign_name) {
296 $sql .=
", online_sign_name = '" .
$db->escape($online_sign_name) .
"'";
298 $sql .=
" WHERE rowid = " . ((int)
$object->id);
301 $resql =
$db->query($sql);
305 $num =
$db->affected_rows($resql);
309 if (method_exists(
$object,
'call_trigger')) {
310 $object->context = array(
'closedfromonlinesignature' =>
'closedfromonlinesignature');
312 $result =
$object->call_trigger(
'PROPAL_CLOSE_SIGNED', $user);
315 $response =
"error in trigger " .
$object->error;
319 $result = $soc->setAsCustomer();
322 $response =
$db->lasterror();
324 $response =
"success";
328 $response =
"success";
332 $response =
"error sql";
337 $response =
"success";
343 } elseif ($mode ==
'contract') {
344 require_once DOL_DOCUMENT_ROOT .
'/contrat/class/contrat.class.php';
345 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
353 $filename =
"signatures/" . $date .
"_signature.png";
354 if (!is_dir($upload_dir .
"signatures/")) {
355 if (!
dol_mkdir($upload_dir .
"signatures/")) {
356 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
362 $return = file_put_contents($upload_dir . $filename, $data);
363 if ($return ===
false) {
365 $response =
'Error file_put_content: failed to create signature file.';
373 $last_main_doc_file =
$object->last_main_doc;
374 $directdownloadlink =
$object->getLastMainDocLink(
'contrat');
376 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
377 $ref_pdf = pathinfo($last_main_doc_file, PATHINFO_FILENAME);
379 $newpdffilename = $upload_dir . $ref_pdf .
"_signed-" . $date .
".pdf";
380 $sourcefile = $upload_dir . $ref_pdf .
".pdf";
383 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
384 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
389 if (empty($reshook)) {
392 if (class_exists(
'TCPDF')) {
393 $pdf->setPrintHeader(
false);
394 $pdf->setPrintFooter(
false);
399 $pdf->SetCompression(
false);
403 $pagecount = $pdf->setSourceFile($sourcefile);
406 $param[
'online_sign_name'] = $online_sign_name;
407 $param[
'pathtoimage'] = $upload_dir . $filename;
410 for ($i = 1; $i < ($pagecount + 1); $i++) {
412 $tppl = $pdf->importPage($i);
413 $s = $pdf->getTemplatesize($tppl);
414 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
415 $pdf->useTemplate($tppl);
424 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : $s[
'w'] / 2 - 0);
429 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 62);
434 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
440 dol_syslog(
"Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
441 $response = $e->getMessage();
450 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : $s[
'w'] / 2 - 0);
451 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 62);
452 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
458 $pdf->Output($newpdffilename,
"F");
461 $object->indexFile($newpdffilename, 1);
465 $response =
"success";
467 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
475 $object->setSignedStatus($user, Contrat::$SIGNED_STATUSES[
'STATUS_SIGNED_RECEIVER_ONLINE'], 0,
'CONTRACT_MODIFY');
477 } elseif ($mode ==
'fichinter') {
478 require_once DOL_DOCUMENT_ROOT .
'/fichinter/class/fichinter.class.php';
479 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
483 $upload_dir = !empty(
$conf->ficheinter->multidir_output[
$object->entity ??
$conf->entity]) ?
$conf->ficheinter->multidir_output[
$object->entity ??
$conf->entity] :
$conf->ficheinter->dir_output;
484 $upload_dir .=
'/'.dol_sanitizeFileName(
$object->ref).
'/';
486 $langs->loadLangs(array(
"main",
"companies"));
492 $filename =
"signatures/" . $date .
"_signature.png";
493 if (!is_dir($upload_dir .
"signatures/")) {
494 if (!
dol_mkdir($upload_dir .
"signatures/")) {
495 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
501 $return = file_put_contents($upload_dir . $filename, $data);
502 if ($return ===
false) {
504 $response =
'Error file_put_content: failed to create signature file.';
512 $last_main_doc_file =
$object->last_main_doc;
513 $directdownloadlink =
$object->getLastMainDocLink(
'fichinter');
515 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
516 $ref_pdf = pathinfo($last_main_doc_file, PATHINFO_FILENAME);
518 $newpdffilename = $upload_dir . $ref_pdf .
"_signed-" . $date .
".pdf";
519 $sourcefile = $upload_dir . $ref_pdf .
".pdf";
522 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
523 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
528 if (empty($reshook)) {
531 if (class_exists(
'TCPDF')) {
532 $pdf->setPrintHeader(
false);
533 $pdf->setPrintFooter(
false);
538 $pdf->SetCompression(
false);
542 $pagecount = $pdf->setSourceFile($sourcefile);
545 $param[
'online_sign_name'] = $online_sign_name;
546 $param[
'pathtoimage'] = $upload_dir . $filename;
549 for ($i = 1; $i < ($pagecount + 1); $i++) {
551 $tppl = $pdf->importPage($i);
552 $s = $pdf->getTemplatesize($tppl);
553 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
554 $pdf->useTemplate($tppl);
563 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : $s[
'w'] / 2 - 2);
568 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 62);
573 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 20);
579 dol_syslog(
"Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
580 $response = $e->getMessage();
589 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : $s[
'w'] / 2 - 2);
590 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 62);
591 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 20);
597 $pdf->Output($newpdffilename,
"F");
600 $object->indexFile($newpdffilename, 1);
604 $response =
"success";
606 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
614 $object->setSignedStatus($user, Fichinter::$SIGNED_STATUSES[
'STATUS_SIGNED_RECEIVER_ONLINE'], 0,
'FICHINTER_MODIFY');
616 } elseif ($mode ==
"societe_rib") {
617 $langs->load(
'withdrawals');
618 require_once DOL_DOCUMENT_ROOT .
'/societe/class/companybankaccount.class.php';
619 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
620 $modelpath =
"core/modules/bank/doc/";
630 $langs->loadLangs(array(
"main",
"companies"));
633 $filename =
"signatures/" . $date .
"_signature.png";
634 if (!
dol_is_dir($upload_dir .
"signatures/")) {
635 if (!
dol_mkdir($upload_dir .
"signatures/")) {
636 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
641 $response =
"Error directory " . $upload_dir .
"signatures/ is not writable";
645 $response =
"Error directory " . DOL_DATA_ROOT.
"/admin/temp/ is not writable";
650 $return = file_put_contents($upload_dir . $filename, $data);
651 if ($return ===
false) {
653 $response =
'Error file_put_content: failed to create signature file.';
661 $last_main_doc_file =
$object->last_main_doc;
662 $last_modelpdf =
$object->model_pdf;
663 $directdownloadlink =
$object->getLastMainDocLink(
'company');
665 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
667 $newpdffilename =
'';
668 if ($last_modelpdf ==
'sepamandate') {
676 $sourcefile = DOL_DATA_ROOT .
'/' . $last_main_doc_file;
677 $newpdffilename = preg_replace(
'/\.pdf$/i',
'_signed-' . $date .
'.pdf', $sourcefile);
680 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
681 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
686 if (empty($reshook)) {
689 if (class_exists(
'TCPDF')) {
690 $pdf->setPrintHeader(
false);
691 $pdf->setPrintFooter(
false);
696 $pdf->SetCompression(
false);
700 $pagecount = $pdf->setSourceFile($sourcefile);
703 for ($i = 1; $i < ($pagecount + 1); $i++) {
705 $tppl = $pdf->importPage($i);
706 $s = $pdf->getTemplatesize($tppl);
707 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
708 $pdf->useTemplate($tppl);
710 dol_syslog(
"Error when manipulating the PDF " . $sourcefile .
" by onlineSign: " . $e->getMessage(), LOG_ERR);
711 $response = $e->getMessage();
721 $dirmodels = array(
'/');
722 if (is_array(
$conf->modules_parts[
'models'])) {
723 $dirmodels = array_merge($dirmodels,
$conf->modules_parts[
'models']);
725 foreach ($dirmodels as $reldir) {
726 $file =
"pdf_" . $last_modelpdf .
".modules.php";
729 if (file_exists($file)) {
731 $classname =
'pdf_' . $last_modelpdf;
736 if ($filefound ===
'') {
737 $response = $langs->trans(
"Error") .
' Failed to load doc generator with modelpaths=' . $modelpath .
' - modele=' . $last_modelpdf;
742 if (!$error && $classname !==
'') {
746 $objPDF =
new $classname(
$db);
748 $pdf->SetFont($default_font,
'', $default_font_size - 1);
750 $xForDate = $objPDF->marge_gauche;
751 $yForDate = $objPDF->page_hauteur - $objPDF->heightforinfotot - $objPDF->heightforfreetext - $objPDF->heightforfooter + 10;
752 $pdf->SetXY($xForDate, $yForDate);
755 $xforimgstart = $objPDF->xPosSignArea;
756 $yforimgstart = $yForDate - 5;
757 $wforimg = $s[
'w'] - 20 - $xforimgstart;
760 $param[
'online_sign_name'] = $online_sign_name;
761 $param[
'pathtoimage'] = $upload_dir . $filename;
766 $param[
'xforimgstart'] = $xforimgstart;
767 $param[
'yforimgstart'] = $yforimgstart;
768 $param[
'wforimg'] = $wforimg;
773 $pdf->Output($newpdffilename,
"F");
776 $object->indexFile($newpdffilename, 1);
779 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
789 $response =
"cannot find BAN/RIB";
797 $sql =
"UPDATE " . MAIN_DB_PREFIX .
$db->sanitize(
$object->table_element);
799 $sql .=
" date_signature = '" .
$db->idate(
dol_now()) .
"',";
800 $sql .=
" online_sign_ip = '" .
$db->escape($online_sign_ip) .
"'";
801 if ($online_sign_name) {
802 $sql .=
", online_sign_name = '" .
$db->escape($online_sign_name) .
"'";
806 $sql .=
" WHERE rowid = " . ((int)
$object->id);
809 $resql =
$db->query($sql);
813 $num =
$db->affected_rows($resql);
817 $response =
"success";
820 $response =
"error sql";
825 $response =
"success";
831 } elseif ($mode ==
'expedition') {
832 require_once DOL_DOCUMENT_ROOT .
'/expedition/class/expedition.class.php';
833 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
838 $upload_dir =
$conf->expedition->dir_output.
"/sending/";
839 $upload_dir .=
'/'.dol_sanitizeFileName(
$object->ref).
'/';
841 $langs->loadLangs(array(
"main",
"companies"));
847 $filename =
"signatures/" . $date .
"_signature.png";
848 if (!is_dir($upload_dir .
"signatures/")) {
849 if (!
dol_mkdir($upload_dir .
"signatures/")) {
850 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
856 $return = file_put_contents($upload_dir . $filename, $data);
857 if ($return ===
false) {
859 $response =
'Error file_put_content: failed to create signature file.';
866 $last_main_doc_file =
$object->last_main_doc;
868 if (empty($last_main_doc_file) || !
dol_is_file(DOL_DATA_ROOT.
'/'.
$object->last_main_doc)) {
871 $defaulttemplate =
'';
872 $object->generateDocument($defaulttemplate, $langs);
874 $last_main_doc_file =
$object->last_main_doc;
875 $directdownloadlink =
$object->getLastMainDocLink(
'expedition');
877 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
878 $ref_pdf = pathinfo($last_main_doc_file, PATHINFO_FILENAME);
880 $newpdffilename = $upload_dir . $ref_pdf .
"_signed-" . $date .
".pdf";
881 $sourcefile = $upload_dir . $ref_pdf .
".pdf";
884 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
885 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
890 if (empty($reshook)) {
893 if (class_exists(
'TCPDF')) {
894 $pdf->setPrintHeader(
false);
895 $pdf->setPrintFooter(
false);
900 $pdf->SetCompression(
false);
904 $pagecount = $pdf->setSourceFile($sourcefile);
907 $param[
'online_sign_name'] = $online_sign_name;
908 $param[
'pathtoimage'] = $upload_dir . $filename;
911 for ($i = 1; $i < ($pagecount + 1); $i++) {
913 $tppl = $pdf->importPage($i);
914 $s = $pdf->getTemplatesize($tppl);
915 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
916 $pdf->useTemplate($tppl);
922 $param[
'xforimgstart'] = 111;
923 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 60);
924 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
929 dol_syslog(
"Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
930 $response = $e->getMessage();
939 $param[
'xforimgstart'] = 111;
940 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 60);
941 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
947 $pdf->Output($newpdffilename,
"F");
950 $object->indexFile($newpdffilename, 1);
954 $response =
"success";
956 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
965 $object->setSignedStatus($user, Expedition::$SIGNED_STATUSES[
'STATUS_SIGNED_RECEIVER_ONLINE'], 0,
'SHIPPING_MODIFY');
969 $response =
'error signature_not_found';
974 http_response_code(501);
992 $xforimgstart = $params[
'xforimgstart'];
993 $yforimgstart = $params[
'yforimgstart'];
994 $wforimg = $params[
'wforimg'];
996 $pdf->SetXY($xforimgstart, $yforimgstart + round($wforimg / 4) - 4);
997 $pdf->SetFont($default_font,
'', $default_font_size - 1);
998 $pdf->SetTextColor(80, 80, 80);
999 $pdf->MultiCell($wforimg, 4, $langs->transnoentities(
"Signature") .
': ' .
dol_print_date(
dol_now(),
"day",
false, $langs,
true).
' - '.$params[
'online_sign_name'], 0,
'L');
1003 $pdf->Image($params[
'pathtoimage'], $xforimgstart, $yforimgstart, $wforimg, round($wforimg / 4));
if(! $sortfield) if(! $sortorder) $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.
dol_now($mode='gmt')
Return date for now.
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_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
dolChmod($filepath, $newmask='')
Change mod of a file.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
getUserRemoteIP($trusted=0)
Return the real IP of remote user.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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.
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_hash($chain, $type='0', $nosalt=0, $mode=0)
Returns a hash (non reversible encryption) of a string.
dol_verifyHash($chain, $hash, $type='0')
Compute a hash and compare it to the given one For backward compatibility reasons,...