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')) {
104$hookmanager->initHooks(array(
'ajaxonlinesign'));
120if ($action ==
"importSignature") {
121 $issignatureok = (!empty($signature) && $signature[0] ==
"image/png;base64");
122 if ($issignatureok) {
123 $signature = $signature[1];
124 $data = base64_decode($signature);
126 if ($mode ==
"propale" || $mode ==
'proposal') {
127 require_once DOL_DOCUMENT_ROOT .
'/comm/propal/class/propal.class.php';
128 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
132 if (
$object->status != $object::STATUS_VALIDATED) {
135 $langs->load(
"errors");
136 print $langs->transnoentitiesnoconv(
"ErrorCantSignDocument");
145 $langs->loadLangs(array(
"main",
"companies"));
148 $filename =
"signatures/" . $date .
"_signature.png";
149 if (!$error && !is_dir($upload_dir .
"signatures/")) {
150 if (!
dol_mkdir($upload_dir .
"signatures/")) {
151 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
157 $return = file_put_contents($upload_dir.$filename, $data);
158 if ($return ===
false) {
160 $response =
'Error file_put_content: failed to create signature file.';
168 $last_main_doc_file =
$object->last_main_doc;
169 $directdownloadlink =
$object->getLastMainDocLink(
'proposal');
171 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
172 $ref_pdf = pathinfo($last_main_doc_file, PATHINFO_FILENAME);
173 $ref_pdf = preg_replace(
'/_signed-(\d+)/',
'', $ref_pdf);
175 $newpdffilename = $upload_dir . $ref_pdf .
"_signed-" . $date .
".pdf";
176 $sourcefile = $upload_dir . $ref_pdf .
".pdf";
179 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
180 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
185 if (empty($reshook)) {
188 $page_largeur = $formatarray[
'width'];
189 $page_hauteur = $formatarray[
'height'];
190 $format = array($page_largeur, $page_hauteur);
193 if (class_exists(
'TCPDF')) {
194 $pdf->setPrintHeader(
false);
195 $pdf->setPrintFooter(
false);
200 $pdf->SetCompression(
false);
204 $pagecount = $pdf->setSourceFile($sourcefile);
207 $param[
'online_sign_name'] = $online_sign_name;
208 $param[
'pathtoimage'] = $upload_dir . $filename;
210 $propalsignonspecificpage =
getDolGlobalInt(
"PROPAL_SIGNATURE_ON_SPECIFIC_PAGE");
213 for ($i = 1; $i < ($pagecount + 1); $i++) {
215 $tppl = $pdf->importPage($i);
216 $s = $pdf->getTemplatesize($tppl);
217 $format = array($s[
'w'], $s[
'h']);
218 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L', $format);
219 $pdf->useTemplate($tppl);
221 if ($propalsignonspecificpage < 0) {
222 $propalsignonspecificpage = $pagecount - abs($propalsignonspecificpage);
225 if (empty($propalsignonspecificpage)) {
230 if (preg_match(
'/PAGESIGN=(\d+)/', $keywords, $reg)) {
231 $propalsignonspecificpage = (int) $reg[1];
235 if (
getDolGlobalString(
"PROPAL_SIGNATURE_ON_ALL_PAGES") || $propalsignonspecificpage == $i) {
242 $param[
'xforimgstart'] = (empty($s[
'w']) ? 120 : round($s[
'w'] / 2) + 15);
247 $param[
'yforimgstart'] = (empty($s[
'h']) ? 240 : $s[
'h'] - 60);
252 $param[
'wforimg'] = $s[
'w'] - 20 - $param[
'xforimgstart'];
258 dol_syslog(
"Error when manipulating the PDF " . $sourcefile .
" by onlineSign: " . $e->getMessage(), LOG_ERR);
259 $response = $e->getMessage();
264 if (!
getDolGlobalString(
"PROPAL_SIGNATURE_ON_ALL_PAGES") && !$propalsignonspecificpage) {
270 $param[
'xforimgstart'] = (empty($s[
'w']) ? 120 : round($s[
'w'] / 2) + 15);
275 $param[
'yforimgstart'] = (empty($s[
'h']) ? 240 : $s[
'h'] - 60);
280 $param[
'wforimg'] = $s[
'w'] - 20 - $param[
'xforimgstart'];
287 $pdf->Output($newpdffilename,
"F");
290 $object->indexFile($newpdffilename, 1);
293 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
307 $sql =
"UPDATE " . MAIN_DB_PREFIX .
"propal";
308 $sql .=
" SET fk_statut = " . ((int) $object::STATUS_SIGNED) .
", note_private = '" .
$db->escape(
$object->note_private) .
"',";
309 $sql .=
" date_signature = '" .
$db->idate(
dol_now()) .
"',";
310 $sql .=
" online_sign_ip = '" .
$db->escape($online_sign_ip) .
"'";
311 if ($online_sign_name) {
312 $sql .=
", online_sign_name = '" .
$db->escape($online_sign_name) .
"'";
314 $sql .=
" WHERE rowid = " . ((int)
$object->id);
315 $sql .=
" AND fk_statut = ".((int) $object::STATUS_VALIDATED);
318 $resql =
$db->query($sql);
321 $response =
"error sql";
323 $num =
$db->affected_rows($resql);
326 $langs->load(
"errors");
328 print $langs->transnoentitiesnoconv(
"ErrorCantSignDocument");
333 if (method_exists(
$object,
'call_trigger')) {
334 $object->context = array(
'closedfromonlinesignature' =>
'closedfromonlinesignature');
336 $result =
$object->call_trigger(
'PROPAL_CLOSE_SIGNED', $user);
339 $response =
"error in trigger " .
$object->error;
343 $result = $soc->setAsCustomer();
346 $response =
$db->lasterror();
348 $response =
"success";
352 $response =
"success";
358 $response =
"success";
364 } elseif ($mode ==
'contract') {
365 require_once DOL_DOCUMENT_ROOT .
'/contrat/class/contrat.class.php';
366 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
374 $filename =
"signatures/" . $date .
"_signature.png";
375 if (!is_dir($upload_dir .
"signatures/")) {
376 if (!
dol_mkdir($upload_dir .
"signatures/")) {
377 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
383 $return = file_put_contents($upload_dir . $filename, $data);
384 if ($return ===
false) {
386 $response =
'Error file_put_content: failed to create signature file.';
394 $last_main_doc_file =
$object->last_main_doc;
395 $directdownloadlink =
$object->getLastMainDocLink(
'contrat');
397 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
398 $ref_pdf = pathinfo($last_main_doc_file, PATHINFO_FILENAME);
400 $newpdffilename = $upload_dir . $ref_pdf .
"_signed-" . $date .
".pdf";
401 $sourcefile = $upload_dir . $ref_pdf .
".pdf";
404 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
405 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
410 if (empty($reshook)) {
413 if (class_exists(
'TCPDF')) {
414 $pdf->setPrintHeader(
false);
415 $pdf->setPrintFooter(
false);
420 $pdf->SetCompression(
false);
424 $pagecount = $pdf->setSourceFile($sourcefile);
427 $param[
'online_sign_name'] = $online_sign_name;
428 $param[
'pathtoimage'] = $upload_dir . $filename;
431 for ($i = 1; $i < ($pagecount + 1); $i++) {
433 $tppl = $pdf->importPage($i);
434 $s = $pdf->getTemplatesize($tppl);
435 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
436 $pdf->useTemplate($tppl);
445 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : $s[
'w'] / 2 - 0);
450 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 62);
455 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
461 dol_syslog(
"Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
462 $response = $e->getMessage();
471 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : $s[
'w'] / 2 - 0);
472 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 62);
473 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
479 $pdf->Output($newpdffilename,
"F");
482 $object->indexFile($newpdffilename, 1);
486 $response =
"success";
488 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
496 $object->setSignedStatus($user, Contrat::$SIGNED_STATUSES[
'STATUS_SIGNED_RECEIVER_ONLINE'], 0,
'CONTRACT_MODIFY');
498 } elseif ($mode ==
'fichinter') {
499 require_once DOL_DOCUMENT_ROOT .
'/fichinter/class/fichinter.class.php';
500 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
504 $upload_dir = !empty(
$conf->ficheinter->multidir_output[
$object->entity ??
$conf->entity]) ?
$conf->ficheinter->multidir_output[
$object->entity ??
$conf->entity] :
$conf->ficheinter->dir_output;
505 $upload_dir .=
'/'.dol_sanitizeFileName(
$object->ref).
'/';
507 $langs->loadLangs(array(
"main",
"companies"));
513 $filename =
"signatures/" . $date .
"_signature.png";
514 if (!is_dir($upload_dir .
"signatures/")) {
515 if (!
dol_mkdir($upload_dir .
"signatures/")) {
516 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
522 $return = file_put_contents($upload_dir . $filename, $data);
523 if ($return ===
false) {
525 $response =
'Error file_put_content: failed to create signature file.';
533 $last_main_doc_file =
$object->last_main_doc;
534 $directdownloadlink =
$object->getLastMainDocLink(
'fichinter');
536 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
537 $ref_pdf = pathinfo($last_main_doc_file, PATHINFO_FILENAME);
539 $newpdffilename = $upload_dir . $ref_pdf .
"_signed-" . $date .
".pdf";
540 $sourcefile = $upload_dir . $ref_pdf .
".pdf";
543 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
544 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
549 if (empty($reshook)) {
552 if (class_exists(
'TCPDF')) {
553 $pdf->setPrintHeader(
false);
554 $pdf->setPrintFooter(
false);
559 $pdf->SetCompression(
false);
563 $pagecount = $pdf->setSourceFile($sourcefile);
566 $param[
'online_sign_name'] = $online_sign_name;
567 $param[
'pathtoimage'] = $upload_dir . $filename;
570 for ($i = 1; $i < ($pagecount + 1); $i++) {
572 $tppl = $pdf->importPage($i);
573 $s = $pdf->getTemplatesize($tppl);
574 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
575 $pdf->useTemplate($tppl);
584 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : round($s[
'w'] * 0.53));
589 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 60);
594 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
600 dol_syslog(
"Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
601 $response = $e->getMessage();
610 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : round($s[
'w'] * 0.53));
611 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 60);
612 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
618 $pdf->Output($newpdffilename,
"F");
621 $object->indexFile($newpdffilename, 1);
625 $response =
"success";
627 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
635 $object->setSignedStatus($user, Fichinter::$SIGNED_STATUSES[
'STATUS_SIGNED_RECEIVER_ONLINE'], 0,
'FICHINTER_MODIFY');
637 } elseif ($mode ==
"societe_rib") {
638 $langs->load(
'withdrawals');
639 require_once DOL_DOCUMENT_ROOT .
'/societe/class/companybankaccount.class.php';
640 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
641 $modelpath =
"core/modules/bank/doc/";
651 $langs->loadLangs(array(
"main",
"companies"));
654 $filename =
"signatures/" . $date .
"_signature.png";
655 if (!
dol_is_dir($upload_dir .
"signatures/")) {
656 if (!
dol_mkdir($upload_dir .
"signatures/")) {
657 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
662 $response =
"Error directory " . $upload_dir .
"signatures/ is not writable";
666 $response =
"Error directory " . DOL_DATA_ROOT.
"/admin/temp/ is not writable";
671 $return = file_put_contents($upload_dir . $filename, $data);
672 if ($return ===
false) {
674 $response =
'Error file_put_content: failed to create signature file.';
682 $last_main_doc_file =
$object->last_main_doc;
683 $last_modelpdf =
$object->model_pdf;
684 $directdownloadlink =
$object->getLastMainDocLink(
'company');
686 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
688 $newpdffilename =
'';
689 if ($last_modelpdf ==
'sepamandate') {
697 $sourcefile = DOL_DATA_ROOT .
'/' . $last_main_doc_file;
698 $newpdffilename = preg_replace(
'/\.pdf$/i',
'_signed-' . $date .
'.pdf', $sourcefile);
701 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
702 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
707 if (empty($reshook)) {
710 if (class_exists(
'TCPDF')) {
711 $pdf->setPrintHeader(
false);
712 $pdf->setPrintFooter(
false);
717 $pdf->SetCompression(
false);
721 $pagecount = $pdf->setSourceFile($sourcefile);
724 for ($i = 1; $i < ($pagecount + 1); $i++) {
726 $tppl = $pdf->importPage($i);
727 $s = $pdf->getTemplatesize($tppl);
728 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
729 $pdf->useTemplate($tppl);
731 dol_syslog(
"Error when manipulating the PDF " . $sourcefile .
" by onlineSign: " . $e->getMessage(), LOG_ERR);
732 $response = $e->getMessage();
742 $dirmodels = array(
'/');
743 if (is_array(
$conf->modules_parts[
'models'])) {
744 $dirmodels = array_merge($dirmodels,
$conf->modules_parts[
'models']);
746 foreach ($dirmodels as $reldir) {
747 $file =
"pdf_" . $last_modelpdf .
".modules.php";
750 if (file_exists($file)) {
752 $classname =
'pdf_' . $last_modelpdf;
757 if ($filefound ===
'') {
758 $response = $langs->trans(
"Error") .
' Failed to load doc generator with modelpaths=' . $modelpath .
' - modele=' . $last_modelpdf;
763 if (!$error && $classname !==
'') {
767 $objPDF =
new $classname(
$db);
769 $pdf->SetFont($default_font,
'', $default_font_size - 1);
771 $xForDate = $objPDF->marge_gauche;
772 $yForDate = $objPDF->page_hauteur - $objPDF->heightforinfotot - $objPDF->heightforfreetext - $objPDF->heightforfooter + 10;
773 $pdf->SetXY($xForDate, $yForDate);
776 $xforimgstart = $objPDF->xPosSignArea;
777 $yforimgstart = $yForDate - 5;
778 $wforimg = $s[
'w'] - 20 - $xforimgstart;
781 $param[
'online_sign_name'] = $online_sign_name;
782 $param[
'pathtoimage'] = $upload_dir . $filename;
787 $param[
'xforimgstart'] = $xforimgstart;
788 $param[
'yforimgstart'] = $yforimgstart;
789 $param[
'wforimg'] = $wforimg;
794 $pdf->Output($newpdffilename,
"F");
797 $object->indexFile($newpdffilename, 1);
800 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
810 $response =
"cannot find BAN/RIB";
818 $sql =
"UPDATE " . MAIN_DB_PREFIX .
$db->sanitize(
$object->table_element);
820 $sql .=
" date_signature = '" .
$db->idate(
dol_now()) .
"',";
821 $sql .=
" online_sign_ip = '" .
$db->escape($online_sign_ip) .
"'";
822 if ($online_sign_name) {
823 $sql .=
", online_sign_name = '" .
$db->escape($online_sign_name) .
"'";
827 $sql .=
" WHERE rowid = " . ((int)
$object->id);
830 $resql =
$db->query($sql);
834 $num =
$db->affected_rows($resql);
838 $response =
"success";
841 $response =
"error sql";
846 $response =
"success";
852 } elseif ($mode ==
'expedition') {
853 require_once DOL_DOCUMENT_ROOT .
'/expedition/class/expedition.class.php';
854 require_once DOL_DOCUMENT_ROOT .
'/core/lib/pdf.lib.php';
859 $upload_dir =
$conf->expedition->dir_output.
"/sending/";
860 $upload_dir .=
'/'.dol_sanitizeFileName(
$object->ref).
'/';
862 $langs->loadLangs(array(
"main",
"companies"));
868 $filename =
"signatures/" . $date .
"_signature.png";
869 if (!is_dir($upload_dir .
"signatures/")) {
870 if (!
dol_mkdir($upload_dir .
"signatures/")) {
871 $response =
"Error mkdir. Failed to create dir " . $upload_dir .
"signatures/";
877 $return = file_put_contents($upload_dir . $filename, $data);
878 if ($return ===
false) {
880 $response =
'Error file_put_content: failed to create signature file.';
887 $last_main_doc_file =
$object->last_main_doc;
889 if (empty($last_main_doc_file) || !
dol_is_file(DOL_DATA_ROOT.
'/'.
$object->last_main_doc)) {
892 $defaulttemplate =
'';
893 $object->generateDocument($defaulttemplate, $langs);
895 $last_main_doc_file =
$object->last_main_doc;
896 $directdownloadlink =
$object->getLastMainDocLink(
'expedition');
898 if (preg_match(
'/\.pdf/i', $last_main_doc_file)) {
899 $ref_pdf = pathinfo($last_main_doc_file, PATHINFO_FILENAME);
901 $newpdffilename = $upload_dir . $ref_pdf .
"_signed-" . $date .
".pdf";
902 $sourcefile = $upload_dir . $ref_pdf .
".pdf";
905 $parameters = array(
'sourcefile' => $sourcefile,
'newpdffilename' => $newpdffilename);
906 $reshook = $hookmanager->executeHooks(
'AddSignature', $parameters,
$object, $action);
911 if (empty($reshook)) {
914 if (class_exists(
'TCPDF')) {
915 $pdf->setPrintHeader(
false);
916 $pdf->setPrintFooter(
false);
921 $pdf->SetCompression(
false);
925 $pagecount = $pdf->setSourceFile($sourcefile);
928 $param[
'online_sign_name'] = $online_sign_name;
929 $param[
'pathtoimage'] = $upload_dir . $filename;
932 for ($i = 1; $i < ($pagecount + 1); $i++) {
934 $tppl = $pdf->importPage($i);
935 $s = $pdf->getTemplatesize($tppl);
936 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
937 $pdf->useTemplate($tppl);
943 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : round($s[
'w'] * 0.53));
944 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 60);
945 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
950 dol_syslog(
"Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
951 $response = $e->getMessage();
960 $param[
'xforimgstart'] = (empty($s[
'w']) ? 110 : round($s[
'w'] * 0.53));
961 $param[
'yforimgstart'] = (empty($s[
'h']) ? 250 : $s[
'h'] - 60);
962 $param[
'wforimg'] = $s[
'w'] - ($param[
'xforimgstart'] + 16);
968 $pdf->Output($newpdffilename,
"F");
971 $object->indexFile($newpdffilename, 1);
975 $response =
"success";
977 } elseif (preg_match(
'/\.odt/i', $last_main_doc_file)) {
986 $object->setSignedStatus($user, Expedition::$SIGNED_STATUSES[
'STATUS_SIGNED_RECEIVER_ONLINE'], 0,
'SHIPPING_MODIFY');
990 $response =
'error signature_not_found';
995 http_response_code(501);
1013 $xforimgstart = $params[
'xforimgstart'];
1014 $yforimgstart = $params[
'yforimgstart'];
1015 $wforimg = $params[
'wforimg'];
1017 $pdf->SetXY($xforimgstart, $yforimgstart + round($wforimg / 4) - 4);
1018 $pdf->SetFont($default_font,
'', $default_font_size - 1);
1019 $pdf->SetTextColor(80, 80, 80);
1020 $pdf->MultiCell($wforimg, 4, $langs->transnoentities(
"Signature") .
': ' .
dol_print_date(
dol_now(),
"day",
false, $langs,
true).
' - '.$params[
'online_sign_name'], 0,
'L');
1024 $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, $nodefault=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_getFormat($outputlangs=null, $mode='setup')
Return array with format properties of default PDF format.
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,...