35 require_once DOL_DOCUMENT_ROOT.
'/recruitment/core/modules/recruitment/modules_recruitmentjobposition.php';
36 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
39 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
65 public $update_main_doc_field;
76 public $phpmin = array(7, 0);
82 public $version =
'dolibarr';
93 public $situationinvoice;
98 public $tabTitleHeight;
103 public $defaultContentsFieldsStyle = array();
108 public $defaultTitlesFieldsStyle = array();
113 public $cols = array();
123 global $conf, $langs, $mysoc;
126 $langs->loadLangs(array(
"main",
"bills"));
129 $this->
name =
"standard";
130 $this->
description = $langs->trans(
'DocumentModelStandardPDF');
131 $this->update_main_doc_field = 1;
136 $this->page_largeur = $formatarray[
'width'];
137 $this->page_hauteur = $formatarray[
'height'];
138 $this->format = array($this->page_largeur, $this->page_hauteur);
144 $this->option_logo = 1;
145 $this->option_tva = 1;
146 $this->option_modereg = 1;
147 $this->option_condreg = 1;
148 $this->option_multilang = 1;
149 $this->option_escompte = 1;
150 $this->option_credit_note = 1;
151 $this->option_freetext = 1;
152 $this->option_draft_watermark = 1;
155 $this->emetteur = $mysoc;
156 if (empty($this->emetteur->country_code)) {
157 $this->emetteur->country_code = substr($langs->defaultlang, -2);
161 $this->posxdesc = $this->marge_gauche + 1;
164 $this->tabTitleHeight = 5;
173 $this->situationinvoice =
false;
189 public function write_file(
$object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
192 global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines;
195 dol_syslog(
"write_file outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang :
'null'));
197 if (!is_object($outputlangs)) {
198 $outputlangs = $langs;
202 $outputlangs->charset_output =
'ISO-8859-1';
206 $outputlangs->loadLangs(array(
"main",
"bills",
"products",
"dict",
"companies"));
209 global $outputlangsbis;
210 $outputlangsbis =
new Translate(
'', $conf);
212 $outputlangsbis->loadLangs(array(
"main",
"bills",
"products",
"dict",
"companies"));
215 $nblines = (is_array(
$object->lines) ? count(
$object->lines) : 0);
223 $realpatharray = array();
279 if ($conf->recruitment->dir_output.
'/recruitmentjobposition') {
284 $dir = $conf->recruitment->dir_output.
'/recruitmentjobposition';
285 $file = $dir.
"/SPECIMEN.pdf";
288 $dir = $conf->recruitment->dir_output.
'/recruitmentjobposition/'.$objectref;
289 $file = $dir.
"/".$objectref.
".pdf";
291 if (!file_exists($dir)) {
293 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
298 if (file_exists($dir)) {
300 $hookmanager->initHooks(array(
'pdfgeneration'));
301 $parameters = array(
'file' => $file,
'object' =>
$object,
'outputlangs' => $outputlangs);
302 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters,
$object, $action);
305 $nblines = (is_array(
$object->lines) ? count(
$object->lines) : 0);
310 $pdf->SetAutoPageBreak(1, 0);
312 $heightforinfotot = 50;
313 $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5);
314 $heightforfooter = $this->marge_basse + (!
getDolGlobalString(
'MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22);
316 if (class_exists(
'TCPDF')) {
317 $pdf->setPrintHeader(
false);
318 $pdf->setPrintFooter(
false);
324 $logodir = $conf->mycompany->dir_output;
325 if (!empty($conf->mycompany->multidir_output[
$object->entity])) {
326 $logodir = $conf->mycompany->multidir_output[
$object->entity];
328 $pagecount = $pdf->setSourceFile($logodir.
'/' .
getDolGlobalString(
'MAIN_ADD_PDF_BACKGROUND'));
329 $tplidx = $pdf->importPage(1);
334 $pdf->SetDrawColor(128, 128, 128);
336 $pdf->SetTitle($outputlangs->convToOutputCharset(
$object->ref));
337 $pdf->SetSubject(
$object->label);
338 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
339 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
340 $pdf->SetKeyWords($outputlangs->convToOutputCharset(
$object->ref).
" ".
$object->label.
" ".$outputlangs->convToOutputCharset(
$object->thirdparty->name));
342 $pdf->SetCompression(
false);
346 $cert = empty($user->conf->CERTIFICATE_CRT) ?
'' : $user->conf->CERTIFICATE_CRT;
354 'Name' => $this->emetteur->name,
355 'Location' =>
getCountry($this->emetteur->country_code, 0),
356 'Reason' =>
'MYOBJECT',
357 'ContactInfo' => $this->emetteur->email
359 $pdf->setSignature($cert, $cert, $this->emetteur->name,
'', 2, $info);
363 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
367 if (!empty($tplidx)) {
368 $pdf->useTemplate($tplidx);
372 $top_shift = $this->
_pagehead($pdf,
$object, 1, $outputlangs, $outputlangsbis);
373 $pdf->SetFont(
'',
'', $default_font_size - 1);
374 $pdf->MultiCell(0, 3,
'');
375 $pdf->SetTextColor(0, 0, 0);
377 $tab_top = 90 + $top_shift;
378 $tab_top_newpage = (!
getDolGlobalString(
'MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
379 $tab_height = 130 - $top_shift;
380 $tab_height_newpage = 150;
382 $tab_height_newpage -= $top_shift;
385 $nexY = $tab_top - 1;
388 $notetoshow = empty(
$object->note_public) ?
'' :
$object->note_public;
390 $extranote = $this->getExtrafieldsInHtml(
$object, $outputlangs);
391 if (!empty($extranote)) {
395 $pagenb = $pdf->getPage();
399 $tab_width = $this->page_largeur - $this->marge_gauche - $this->marge_droite;
400 $pageposbeforenote = $pagenb;
407 $pdf->startTransaction();
409 $pdf->SetFont(
'',
'', $default_font_size - 1);
410 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top,
dol_htmlentitiesbr($notetoshow), 0, 1);
412 $pageposafternote = $pdf->getPage();
413 $posyafter = $pdf->GetY();
415 if ($pageposafternote > $pageposbeforenote) {
416 $pdf->rollbackTransaction(
true);
419 while ($pagenb < $pageposafternote) {
422 if (!empty($tplidx)) {
423 $pdf->useTemplate($tplidx);
429 $pdf->setTopMargin($tab_top_newpage);
431 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext);
435 $pdf->setPage($pageposbeforenote);
436 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext);
437 $pdf->SetFont(
'',
'', $default_font_size - 1);
438 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top,
dol_htmlentitiesbr($notetoshow), 0, 1);
439 $pageposafternote = $pdf->getPage();
441 $posyafter = $pdf->GetY();
443 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) {
444 $pdf->AddPage(
'',
'',
true);
447 $pdf->setPage($pageposafternote);
448 $pdf->setTopMargin($tab_top_newpage);
450 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext);
456 $i = $pageposbeforenote;
457 while ($i < $pageposafternote) {
461 $pdf->SetDrawColor(128, 128, 128);
463 if ($i > $pageposbeforenote) {
464 $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter);
465 $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
467 $height_note = $this->page_hauteur - ($tab_top + $heightforfooter);
468 $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
472 $pdf->setPageOrientation(
'', 1, 0);
479 $pdf->setPage($pageposafternote);
480 if (!empty($tplidx)) {
481 $pdf->useTemplate($tplidx);
486 $height_note = $posyafter - $tab_top_newpage;
487 $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
489 $pdf->commitTransaction();
490 $posyafter = $pdf->GetY();
491 $height_note = $posyafter - $tab_top;
492 $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
494 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) {
496 $pdf->AddPage(
'',
'',
true);
499 $pdf->setPage($pageposafternote);
500 if (!empty($tplidx)) {
501 $pdf->useTemplate($tplidx);
507 $posyafter = $tab_top_newpage;
511 $tab_height = $tab_height - $height_note;
512 $tab_top = $posyafter + 6;
521 $pdf->startTransaction();
522 $this->
pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
523 $pdf->rollbackTransaction(
true);
525 $nexY = $tab_top + $this->tabTitleHeight;
528 $pageposbeforeprintlines = $pdf->getPage();
529 $pagenb = $pageposbeforeprintlines;
530 for ($i = 0; $i < $nblines; $i++) {
532 $pdf->SetFont(
'',
'', $default_font_size - 1);
533 $pdf->SetTextColor(0, 0, 0);
536 $imglinesize = array();
537 if (!empty($realpatharray[$i])) {
541 $pdf->setTopMargin($tab_top_newpage);
542 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
543 $pageposbefore = $pdf->getPage();
545 $showpricebeforepagebreak = 1;
550 if (isset($imglinesize[
'width']) && isset($imglinesize[
'height']) && ($curY + $imglinesize[
'height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
551 $pdf->AddPage(
'',
'',
true);
552 if (!empty($tplidx)) {
553 $pdf->useTemplate($tplidx);
555 $pdf->setPage($pageposbefore + 1);
557 $curY = $tab_top_newpage;
561 $showpricebeforepagebreak = 1;
563 $showpricebeforepagebreak = 0;
567 if (!empty($this->cols[
'photo']) && isset($imglinesize[
'width']) && isset($imglinesize[
'height'])) {
568 $pdf->Image($realpatharray[$i], $this->
getColumnContentXStart(
'photo'), $curY, $imglinesize[
'width'], $imglinesize[
'height'],
'',
'',
'', 2, 300);
570 $posYAfterImage = $curY + $imglinesize[
'height'];
576 $pdf->startTransaction();
579 $pageposafter = $pdf->getPage();
581 if ($pageposafter > $pageposbefore) {
582 $pdf->rollbackTransaction(
true);
583 $pdf->setPageOrientation(
'', 1, $heightforfooter);
587 $pageposafter = $pdf->getPage();
588 $posyafter = $pdf->GetY();
591 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
592 if ($i == ($nblines - 1)) {
593 $pdf->AddPage(
'',
'',
true);
594 if (!empty($tplidx)) {
595 $pdf->useTemplate($tplidx);
597 $pdf->setPage($pageposafter + 1);
603 $showpricebeforepagebreak = 1;
605 $showpricebeforepagebreak = 0;
609 $pdf->commitTransaction();
613 $nexY = $pdf->GetY();
614 $pageposafter = $pdf->getPage();
615 $pdf->setPage($pageposbefore);
616 $pdf->setTopMargin($this->marge_haute);
617 $pdf->setPageOrientation(
'', 1, 0);
620 if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
621 $pdf->setPage($pageposafter);
622 $curY = $tab_top_newpage;
625 $pdf->SetFont(
'',
'', $default_font_size - 1);
635 'outputlangs' => $outputlangs,
636 'hidedetails' => $hidedetails
638 $reshook = $hookmanager->executeHooks(
'printPDFline', $parameters, $this);
643 while ($pagenb < $pageposafter) {
644 $pdf->setPage($pagenb);
645 if ($pagenb == $pageposbeforeprintlines) {
646 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1,
$object->multicurrency_code, $outputlangsbis);
648 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1,
$object->multicurrency_code, $outputlangsbis);
652 $pdf->setPage($pagenb);
653 $pdf->setPageOrientation(
'', 1, 0);
657 if (!empty($tplidx)) {
658 $pdf->useTemplate($tplidx);
662 if (isset(
$object->lines[$i + 1]->pagebreak) &&
$object->lines[$i + 1]->pagebreak) {
663 if ($pagenb == $pageposafter) {
664 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1,
$object->multicurrency_code, $outputlangsbis);
666 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1,
$object->multicurrency_code, $outputlangsbis);
671 if (!empty($tplidx)) {
672 $pdf->useTemplate($tplidx);
682 if ($pagenb == $pageposbeforeprintlines) {
683 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0,
$object->multicurrency_code, $outputlangsbis);
684 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
686 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0,
$object->multicurrency_code, $outputlangsbis);
687 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
706 if (method_exists($pdf,
'AliasNbPages')) {
707 $pdf->AliasNbPages();
712 $pdf->Output($file,
'F');
715 $hookmanager->initHooks(array(
'pdfgeneration'));
716 $parameters = array(
'file' => $file,
'object' =>
$object,
'outputlangs' => $outputlangs);
718 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
720 $this->error = $hookmanager->error;
721 $this->errors = $hookmanager->errors;
726 $this->result = array(
'fullpath' => $file);
730 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
734 $this->error = $langs->transnoentities(
"ErrorConstantNotDefined",
"FAC_OUTPUTDIR");
750 return parent::liste_modeles($db, $maxfilenamelength);
768 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency =
'', $outputlangsbis =
null)
778 $currency = !empty($currency) ? $currency : $conf->currency;
782 $pdf->SetTextColor(0, 0, 0);
783 $pdf->SetFont(
'',
'', $default_font_size - 2);
785 if (empty($hidetop)) {
788 $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight,
'F',
null, explode(
',',
getDolGlobalString(
'MAIN_PDF_TITLE_BACKGROUND_COLOR')));
792 $pdf->SetDrawColor(128, 128, 128);
793 $pdf->SetFont(
'',
'', $default_font_size - 1);
796 $this->
printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom);
799 $this->
pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
801 if (empty($hidetop)) {
802 $pdf->line($this->marge_gauche, $tab_top + $this->tabTitleHeight, $this->page_largeur - $this->marge_droite, $tab_top + $this->tabTitleHeight);
817 protected function _pagehead(&$pdf,
$object, $showaddress, $outputlangs, $outputlangsbis =
null)
822 $outputlangs->loadLangs(array(
"main",
"bills",
"propal",
"companies"));
829 if (
$object->statut == $object::STATUS_DRAFT &&
getDolGlobalString(
'RECRUITMENT_RECRUITMENTJOBPOSITION_DRAFT_WATERMARK')) {
830 pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur,
'mm',
getDolGlobalString(
'RECRUITMENT_RECRUITMENTJOBPOSITION_DRAFT_WATERMARK'));
833 $pdf->SetTextColor(0, 0, 60);
834 $pdf->SetFont(
'',
'B', $default_font_size + 3);
838 $posy = $this->marge_haute;
839 $posx = $this->page_largeur - $this->marge_droite - $w;
841 $pdf->SetXY($this->marge_gauche, $posy);
845 if ($this->emetteur->logo) {
846 $logodir = $conf->mycompany->dir_output;
847 if (!empty($conf->mycompany->multidir_output[
$object->entity])) {
848 $logodir = $conf->mycompany->multidir_output[
$object->entity];
851 $logo = $logodir.
'/logos/thumbs/'.$this->emetteur->logo_small;
853 $logo = $logodir.
'/logos/'.$this->emetteur->logo;
855 if (is_readable($logo)) {
857 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
859 $pdf->SetTextColor(200, 0, 0);
860 $pdf->SetFont(
'',
'B', $default_font_size - 2);
861 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
862 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"ErrorGoToGlobalSetup"), 0,
'L');
865 $text = $this->emetteur->name;
866 $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0,
'L');
870 $pdf->SetFont(
'',
'B', $default_font_size + 3);
871 $pdf->SetXY($posx, $posy);
872 $pdf->SetTextColor(0, 0, 60);
874 $pdf->MultiCell($w, 3, $title,
'',
'R');
876 $pdf->SetFont(
'',
'B', $default_font_size);
879 $pdf->SetXY($posx, $posy);
880 $pdf->SetTextColor(0, 0, 60);
881 $textref = $outputlangs->transnoentities(
"Ref").
" : ".$outputlangs->convToOutputCharset(
$object->ref);
882 if (
$object->statut == $object::STATUS_DRAFT) {
883 $pdf->SetTextColor(128, 0, 0);
884 $textref .=
' - '.$outputlangs->transnoentities(
"NotValidated");
886 $pdf->MultiCell($w, 4, $textref,
'',
'R');
889 $pdf->SetFont(
'',
'', $default_font_size - 2);
893 $pdf->SetXY($posx, $posy);
894 $pdf->SetTextColor(0, 0, 60);
895 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"RefCustomer").
" : ".
dol_trunc($outputlangs->convToOutputCharset(
$object->ref_client), 65),
'',
'R');
900 if (!empty(
$object->project->ref)) {
902 $pdf->SetXY($posx, $posy);
903 $pdf->SetTextColor(0, 0, 60);
904 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"Project").
" : ".(empty(
$object->project->title) ?
'' :
$object->projet->title),
'',
'R');
910 if (!empty(
$object->project->ref)) {
912 $pdf->SetXY($posx, $posy);
913 $pdf->SetTextColor(0, 0, 60);
914 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"Project").
" : ".(empty(
$object->project->title) ?
'' :
$object->project->title),
'',
'R');
920 if (!empty(
$object->project->ref)) {
921 $outputlangs->load(
"projects");
923 $pdf->SetXY($posx, $posy);
924 $pdf->SetTextColor(0, 0, 60);
925 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"RefProject").
" : ".(empty(
$object->project->ref) ?
'' :
$object->project->ref),
'',
'R');
930 $pdf->SetXY($posx, $posy);
931 $pdf->SetTextColor(0, 0, 60);
933 $title = $outputlangs->transnoentities(
"Date");
935 $title .=
' - '.$outputlangsbis->transnoentities(
"Date");
937 $pdf->MultiCell($w, 3, $title.
" : ".
dol_print_date(
$object->date_creation,
"day",
false, $outputlangs),
'',
'R');
939 if (
$object->thirdparty->code_client) {
941 $pdf->SetXY($posx, $posy);
942 $pdf->SetTextColor(0, 0, 60);
943 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"CustomerCode").
" : ".$outputlangs->transnoentities(
$object->thirdparty->code_client),
'',
'R');
950 $current_y = $pdf->getY();
952 if ($current_y < $pdf->getY()) {
953 $top_shift = $pdf->getY() - $current_y;
963 $posx = $this->marge_gauche;
965 $posx = $this->page_largeur - $this->marge_droite - 80;
973 $pdf->SetTextColor(0, 0, 0);
974 $pdf->SetFont(
'',
'', $default_font_size - 2);
975 $pdf->SetXY($posx, $posy - 5);
976 $pdf->MultiCell(66, 5, $outputlangs->transnoentities(
"BillFrom").
":", 0,
'L');
977 $pdf->SetXY($posx, $posy);
978 $pdf->SetFillColor(230, 230, 230);
979 $pdf->MultiCell($widthrecbox, $hautcadre,
"", 0,
'R', 1);
980 $pdf->SetTextColor(0, 0, 60);
983 $pdf->SetXY($posx + 2, $posy + 3);
984 $pdf->SetFont(
'',
'B', $default_font_size);
985 $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0,
'L');
986 $posy = $pdf->getY();
989 $pdf->SetXY($posx + 2, $posy);
990 $pdf->SetFont(
'',
'', $default_font_size - 1);
991 $pdf->MultiCell($widthrecbox - 2, 4, $carac_emetteur, 0,
'L');
995 $arrayidcontact =
$object->getIdContact(
'external',
'BILLING');
996 if (count($arrayidcontact) > 0) {
998 $result =
$object->fetch_contact($arrayidcontact[0]);
1043 $pdf->SetTextColor(0, 0, 0);
1061 $showdetails = !
getDolGlobalString(
'MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
1062 return pdf_pagefoot($pdf, $outputlangs,
'INVOICE_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur,
$object, $showdetails, $hidefreetext);
1077 global $conf, $hookmanager;
1080 $this->defaultContentsFieldsStyle = array(
1082 'padding' => array(1, 0.5, 1, 0.5),
1086 $this->defaultTitlesFieldsStyle = array(
1088 'padding' => array(0.5, 0, 0.5, 0),
1250 $parameters = array(
1252 'outputlangs' => $outputlangs,
1253 'hidedetails' => $hidedetails,
1254 'hidedesc' => $hidedesc,
1255 'hideref' => $hideref
1258 $reshook = $hookmanager->executeHooks(
'defineColumnField', $parameters, $this);
1261 } elseif (empty($reshook)) {
1263 $this->cols = array_replace($this->cols, $hookmanager->resArray);
1265 $this->cols = $hookmanager->resArray;
if($user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
prepareArrayColumnField($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Prepare Array Column Field.
getColumnStatus($colKey)
get column status from column key
pdfTabTitles(&$pdf, $tab_top, $tab_height, $outputlangs, $hidetop=0)
Print standard column content.
printColDescContent($pdf, &$curY, $colKey, $object, $i, $outputlangs, $hideref=0, $hidedesc=0, $issupplierline=0)
print description column content
getColumnContentXStart($colKey)
get column content X (abscissa) left position from column key
printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
Rect pdf.
Parent class for documents models.
Class to manage translations.
Class to manage PDF template standard_recruitmentjobposition.
_pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
Show footer of page.
defineColumnField($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Define Array Column Field.
__construct($db)
Constructor.
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
_pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis=null)
Show top header of page.
_tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0, $currency='', $outputlangsbis=null)
Show table for lines.
write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build pdf onto disk.
getCountry($searchkey, $withcode='', $dbtouse=null, $outputlangs=null, $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
if(!function_exists('dolEscapeXML')) convertBackOfficeMediasLinksToPublicLinks($notetoshow)
Convert links to local wrapper to medias files into a string into a public external URL readable on i...
dolChmod($filepath, $newmask='')
Change mod of a file.
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).
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the "subst...
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
getDolGlobalString($key, $default='')
Return 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)
pdf_getSizeForImage($realpath)
Return dimensions to use for images onto PDF checking that width and height are not higher than maxim...
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
pdf_getFormat(Translate $outputlangs=null, $mode='setup')
Return array with format properties of default PDF format.
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails=0, $hidefreetext=0, $page_largeur=0, $watermark='')
Show footer of page for PDF generation.
pdf_pagehead(&$pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w, $h, $align, $default_font_size)
Show linked objects for PDF generation.
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
pdf_build_address($outputlangs, $sourcecompany, $targetcompany='', $targetcontact='', $usecontact=0, $mode='source', $object=null)
Return a string with full address formatted for output on PDF documents.
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0, $include=null)
Return array of possible substitutions for PDF content (without external module substitutions).
pdf_getInstance($format='', $metric='mm', $pagetype='P')
Return a PDF instance object.
pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
Add a draft watermark on PDF files.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
$conf db name
Only used if Module[ID]Name translation string is not found.