31 require_once DOL_DOCUMENT_ROOT.
'/core/modules/contract/modules_contract.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
61 public $update_main_doc_field;
72 public $phpmin = array(7, 0);
78 public $version =
'dolibarr';
103 public $marge_droite;
134 global $conf, $langs, $mysoc;
137 $this->
name =
'strato';
138 $this->
description = $langs->trans(
"StandardContractsTemplate");
139 $this->update_main_doc_field = 1;
145 $this->page_largeur = $formatarray[
'width'];
146 $this->page_hauteur = $formatarray[
'height'];
147 $this->format = array($this->page_largeur, $this->page_hauteur);
153 $this->option_logo = 1;
154 $this->option_tva = 0;
155 $this->option_modereg = 0;
156 $this->option_condreg = 0;
157 $this->option_multilang = 0;
158 $this->option_draft_watermark = 1;
161 $this->emetteur = $mysoc;
162 if (empty($this->emetteur->country_code)) {
163 $this->emetteur->country_code = substr($langs->defaultlang, -2);
167 $this->posxdesc = $this->marge_gauche + 1;
182 public function write_file($object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
185 global $user, $langs, $conf, $hookmanager, $mysoc;
187 if (!is_object($outputlangs)) {
188 $outputlangs = $langs;
191 if (!empty($conf->global->MAIN_USE_FPDF)) {
192 $outputlangs->charset_output =
'ISO-8859-1';
196 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"contracts"));
198 if ($conf->contrat->dir_output) {
199 $object->fetch_thirdparty();
202 if ($object->specimen) {
203 $dir = $conf->contrat->dir_output;
204 $file = $dir.
"/SPECIMEN.pdf";
207 $dir = $conf->contrat->multidir_output[$object->entity].
"/".$objectref;
208 $file = $dir.
"/".$objectref.
".pdf";
211 if (!file_exists($dir)) {
213 $this->error = $outputlangs->trans(
"ErrorCanNotCreateDir", $dir);
218 if (file_exists($dir)) {
220 if (!is_object($hookmanager)) {
221 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
224 $hookmanager->initHooks(array(
'pdfgeneration'));
225 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
227 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters, $object, $action);
231 $heightforinfotot = 50;
232 $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5);
233 $heightforfooter = $this->marge_basse + 8;
234 if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS)) {
235 $heightforfooter += 6;
237 $pdf->SetAutoPageBreak(1, 0);
239 if (class_exists(
'TCPDF')) {
240 $pdf->setPrintHeader(
false);
241 $pdf->setPrintFooter(
false);
245 if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) {
246 $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.
'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
247 $tplidx = $pdf->importPage(1);
252 $pdf->SetDrawColor(128, 128, 128);
254 $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
255 $pdf->SetSubject($outputlangs->transnoentities(
"ContractCard"));
256 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
257 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
258 $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref).
" ".$outputlangs->transnoentities(
"ContractCard").
" ".$outputlangs->convToOutputCharset($object->thirdparty->name));
260 $pdf->SetCompression(
false);
263 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
267 if (!empty($tplidx)) {
268 $pdf->useTemplate($tplidx);
271 $this->
_pagehead($pdf, $object, 1, $outputlangs);
272 $pdf->SetFont(
'',
'', $default_font_size - 1);
273 $pdf->MultiCell(0, 3,
'');
274 $pdf->SetTextColor(0, 0, 0);
277 $tab_top_newpage = (!
getDolGlobalInt(
'MAIN_PDF_DONOTREPEAT_HEAD') ? 42 : 10);
280 if (!empty($object->note_public)) {
283 $pdf->SetFont(
'',
'', $default_font_size - 1);
284 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1,
dol_htmlentitiesbr($object->note_public), 0, 1);
285 $nexY = $pdf->GetY();
286 $height_note = $nexY - $tab_top;
289 $pdf->SetDrawColor(192, 192, 192);
290 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1);
292 $tab_top = $nexY + 6;
295 $iniY = $tab_top + 7;
296 $curY = $tab_top + 7;
297 $nexY = $tab_top + 2;
299 $pdf->SetXY($this->marge_gauche, $tab_top);
301 $pdf->MultiCell(0, 2,
'');
303 $nblines = count($object->lines);
306 for ($i = 0; $i < $nblines; $i++) {
307 $objectligne = $object->lines[$i];
309 $valide = $objectligne->id ? 1 : 0;
311 if ($valide > 0 || $object->specimen) {
312 $curX = $this->posxdesc - 1;
314 $pdf->SetFont(
'',
'', $default_font_size - 1);
315 $pdf->SetTextColor(0, 0, 0);
317 $pdf->setTopMargin($tab_top_newpage);
318 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
319 $pageposbefore = $pdf->getPage();
323 if (!empty($objectligne->date_start)) {
324 $datei =
dol_print_date((
int) $objectligne->date_start,
'day',
false, $outputlangs,
true);
326 $datei = $langs->trans(
"Unknown");
329 if (!empty($objectligne->date_end)) {
330 $durationi =
convertSecondToTime((
int) $objectligne->date_end - (
int) $objectligne->date_start,
'allwithouthour');
331 $datee =
dol_print_date($objectligne->date_end,
'day',
false, $outputlangs,
true);
333 $durationi = $langs->trans(
"Unknown");
334 $datee = $langs->trans(
"Unknown");
337 if (!empty($objectligne->date_start_real)) {
338 $daters =
dol_print_date((
int) $objectligne->date_start_real,
'day',
false, $outputlangs,
true);
340 $daters = $langs->trans(
"Unknown");
343 if (!empty($objectligne->date_end_real)) {
344 $datere =
dol_print_date((
int) $objectligne->date_end_real,
'day',
false, $outputlangs,
true);
346 $datere = $langs->trans(
"Unknown");
349 $txtpredefinedservice = $objectligne->product_ref;
350 if ($objectligne->product_label) {
351 $txtpredefinedservice .=
' - ';
352 $txtpredefinedservice .= $objectligne->product_label;
357 if (empty($conf->global->CONTRACT_HIDE_QTY_ON_PDF)) {
358 $txt .= $outputlangs->transnoentities(
"Quantity") .
' : <strong>' . $objectligne->qty .
'</strong>';
360 if (empty($conf->global->CONTRACT_HIDE_PRICE_ON_PDF)) {
361 $txt .=
' - ' . $outputlangs->transnoentities(
"UnitPrice") .
' : <strong>' .
price($objectligne->subprice) .
'</strong>';
363 if (empty($conf->global->CONTRACT_HIDE_PLANNED_DATE_ON_PDF)) {
365 $txt .= $outputlangs->transnoentities(
"DateStartPlannedShort").
" : <strong>".$datei.
"</strong> - ".$outputlangs->transnoentities(
"DateEndPlanned").
" : <strong>".$datee.
'</strong>';
367 if (empty($conf->global->CONTRACT_HIDE_REAL_DATE_ON_PDF)) {
369 $txt .= $outputlangs->transnoentities(
"DateStartRealShort").
" : <strong>".$daters.
'</strong>';
370 if (!empty($objectligne->date_end_real)) {
371 $txt .=
" - ".$outputlangs->transnoentities(
"DateEndRealShort").
" : '<strong>'".$datere.
'</strong>';
375 $pdf->startTransaction();
377 $pageposafter = $pdf->getPage();
378 if ($pageposafter > $pageposbefore) {
379 $pdf->rollbackTransaction(
true);
380 $pageposafter = $pageposbefore;
382 $pdf->setPageOrientation(
'', 1, $heightforfooter);
384 $pageposafter = $pdf->getPage();
385 $posyafter = $pdf->GetY();
387 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
388 if ($i == ($nblines - 1)) {
389 $pdf->AddPage(
'',
'',
true);
390 if (!empty($tplidx)) {
391 $pdf->useTemplate($tplidx);
394 $this->
_pagehead($pdf, $object, 0, $outputlangs);
396 $pdf->setPage($pageposafter + 1);
402 if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) {
403 $showpricebeforepagebreak = 1;
405 $showpricebeforepagebreak = 0;
410 $pdf->commitTransaction();
413 $nexY = $pdf->GetY() + 2;
414 $pageposafter = $pdf->getPage();
416 $pdf->setPage($pageposbefore);
417 $pdf->setTopMargin($this->marge_haute);
418 $pdf->setPageOrientation(
'', 1, 0);
421 if ($pageposafter > $pageposbefore) {
422 $pdf->setPage($pageposafter);
423 $curY = $tab_top_newpage;
426 $pdf->SetFont(
'',
'', $default_font_size - 1);
429 while ($pagenb < $pageposafter) {
430 $pdf->setPage($pagenb);
432 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext, 0, $outputlangs, 0, 1);
434 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforfreetext, 0, $outputlangs, 1, 1);
436 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
438 $pdf->setPage($pagenb);
439 $pdf->setPageOrientation(
'', 1, 0);
440 if (!empty($tplidx)) {
441 $pdf->useTemplate($tplidx);
445 if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
447 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext, 0, $outputlangs, 0, 1);
449 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforfreetext, 0, $outputlangs, 1, 1);
451 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
454 if (!empty($tplidx)) {
455 $pdf->useTemplate($tplidx);
464 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
465 $this->
tabSignature($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, $outputlangs);
466 $bottomlasttab = $this->page_hauteur - $heightforfooter - $heightforfooter + 1;
468 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
469 $this->
tabSignature($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, $outputlangs);
470 $bottomlasttab = $this->page_hauteur - $heightforfooter - $heightforfooter + 1;
473 $this->
_pagefoot($pdf, $object, $outputlangs);
474 if (method_exists($pdf,
'AliasNbPages')) {
475 $pdf->AliasNbPages();
480 $pdf->Output($file,
'F');
483 if (!is_object($hookmanager)) {
484 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
487 $hookmanager->initHooks(array(
'pdfgeneration'));
488 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
490 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
492 $this->error = $hookmanager->error;
493 $this->errors = $hookmanager->errors;
496 if (!empty($conf->global->MAIN_UMASK)) {
497 @chmod($file, octdec($conf->global->MAIN_UMASK));
500 $this->result = array(
'fullpath'=>$file);
504 $this->error = $langs->trans(
"ErrorCanNotCreateDir", $dir);
508 $this->error = $langs->trans(
"ErrorConstantNotDefined",
"CONTRACT_OUTPUTDIR");
526 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
564 $this->
printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height + 3);
575 protected function tabSignature(&$pdf, $tab_top, $tab_height, $outputlangs)
577 $pdf->SetDrawColor(128, 128, 128);
578 $posmiddle = $this->marge_gauche + round(($this->page_largeur - $this->marge_gauche - $this->marge_droite) / 2);
579 $posy = $tab_top + $tab_height + 3 + 3;
581 $pdf->SetXY($this->marge_gauche, $posy);
582 $pdf->MultiCell($posmiddle - $this->marge_gauche - 5, 5, $outputlangs->transnoentities(
"ContactNameAndSignature", $this->emetteur->name), 0,
'L', 0);
584 $pdf->SetXY($this->marge_gauche, $posy + 5);
585 $pdf->MultiCell($posmiddle - $this->marge_gauche - 5, 20,
'', 1);
587 $pdf->SetXY($posmiddle + 5, $posy);
588 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posmiddle - 5, 5, $outputlangs->transnoentities(
"ContactNameAndSignature", $this->recipient->name), 0,
'L', 0);
590 $pdf->SetXY($posmiddle + 5, $posy + 5);
591 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posmiddle - 5, 20,
'', 1);
604 protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
606 global $conf, $langs;
611 $outputlangs->loadLangs(array(
"main",
"dict",
"contract",
"companies"));
616 if ($object->statut == 0 && (!empty($conf->global->CONTRACT_DRAFT_WATERMARK))) {
617 pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur,
'mm', $conf->global->CONTRACT_DRAFT_WATERMARK);
621 $pdf->SetTextColor(0, 0, 60);
622 $pdf->SetFont(
'',
'B', $default_font_size + 3);
624 $posx = $this->page_largeur - $this->marge_droite - 100;
625 $posy = $this->marge_haute;
627 $pdf->SetXY($this->marge_gauche, $posy);
630 $logo = $conf->mycompany->dir_output.
'/logos/'.$this->emetteur->logo;
631 if ($this->emetteur->logo) {
632 if (is_readable($logo)) {
634 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
636 $pdf->SetTextColor(200, 0, 0);
637 $pdf->SetFont(
'',
'B', $default_font_size - 2);
638 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
639 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorGoToGlobalSetup"), 0,
'L');
642 $text = $this->emetteur->name;
643 $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0,
'L');
646 $pdf->SetFont(
'',
'B', $default_font_size + 3);
647 $pdf->SetXY($posx, $posy);
648 $pdf->SetTextColor(0, 0, 60);
649 $title = $outputlangs->transnoentities(
"ContractCard");
650 $pdf->MultiCell(100, 4, $title,
'',
'R');
652 $pdf->SetFont(
'',
'B', $default_font_size + 2);
655 $pdf->SetXY($posx, $posy);
656 $pdf->SetTextColor(0, 0, 60);
657 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"Ref").
" : ".$outputlangs->convToOutputCharset($object->ref),
'',
'R');
660 $pdf->SetFont(
'',
'', $default_font_size);
663 $pdf->SetXY($posx, $posy);
664 $pdf->SetTextColor(0, 0, 60);
665 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"Date").
" : ".
dol_print_date($object->date_contrat,
"day",
false, $outputlangs,
true),
'',
'R');
667 if (empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && $object->thirdparty->code_client) {
669 $pdf->SetXY($posx, $posy);
670 $pdf->SetTextColor(0, 0, 60);
671 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"CustomerCode").
" : ".$outputlangs->transnoentities($object->thirdparty->code_client),
'',
'R');
676 $carac_emetteur =
'';
678 $arrayidcontact = $object->getIdContact(
'internal',
'INTERREPFOLL');
679 if (count($arrayidcontact) > 0) {
680 $object->fetch_user($arrayidcontact[0]);
681 $carac_emetteur .= ($carac_emetteur ?
"\n" :
'').$outputlangs->transnoentities(
"Name").
": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs)).
"\n";
684 $carac_emetteur .=
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty,
'', 0,
'source', $object);
688 $posx = $this->marge_gauche;
689 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
690 $posx = $this->page_largeur - $this->marge_droite - 80;
695 if (empty($conf->global->MAIN_PDF_NO_SENDER_FRAME)) {
696 $pdf->SetTextColor(0, 0, 0);
697 $pdf->SetFont(
'',
'', $default_font_size - 2);
698 $pdf->SetXY($posx, $posy - 5);
699 $pdf->SetXY($posx, $posy);
700 $pdf->SetFillColor(230, 230, 230);
701 $pdf->MultiCell(82, $hautcadre,
"", 0,
'R', 1);
705 if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) {
706 $pdf->SetXY($posx + 2, $posy + 3);
707 $pdf->SetTextColor(0, 0, 60);
708 $pdf->SetFont(
'',
'B', $default_font_size);
709 $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0,
'L');
710 $posy = $pdf->getY();
714 $pdf->SetFont(
'',
'', $default_font_size - 1);
715 $pdf->SetXY($posx + 2, $posy);
716 $pdf->MultiCell(80, 4, $carac_emetteur, 0,
'L');
721 $arrayidcontact = $object->getIdContact(
'external',
'CUSTOMER');
722 if (count($arrayidcontact) > 0) {
724 $result = $object->fetch_contact($arrayidcontact[0]);
727 $this->recipient = $object->thirdparty;
730 if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
731 $thirdparty = $object->contact;
733 $thirdparty = $object->thirdparty;
738 $carac_client =
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (isset($object->contact) ? $object->contact :
''), $usecontact,
'target', $object);
742 if ($this->page_largeur < 210) {
746 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
747 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
748 $posx = $this->marge_gauche;
752 if (empty($conf->global->MAIN_PDF_NO_RECIPENT_FRAME)) {
753 $pdf->SetTextColor(0, 0, 0);
754 $pdf->SetFont(
'',
'', $default_font_size - 2);
755 $pdf->SetXY($posx + 2, $posy - 5);
756 $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
757 $pdf->SetTextColor(0, 0, 0);
761 $pdf->SetXY($posx + 2, $posy + 3);
762 $pdf->SetFont(
'',
'B', $default_font_size);
763 $pdf->MultiCell($widthrecbox, 4, $this->recipient->name, 0,
'L');
765 $posy = $pdf->getY();
768 $pdf->SetFont(
'',
'', $default_font_size - 1);
769 $pdf->SetXY($posx + 2, $posy);
770 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0,
'L');
784 protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
786 $showdetails =
getDolGlobalInt(
'MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
787 return pdf_pagefoot($pdf, $outputlangs,
'CONTRACT_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
Rect pdf.
Parent class to manage intervention document templates.
Class to build contracts documents with model Strato.
write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build pdf onto disk.
tabSignature(&$pdf, $tab_top, $tab_height, $outputlangs)
Show footer signature of page.
_pagehead(&$pdf, $object, $showaddress, $outputlangs)
Show top header of page.
_pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
Show footer of page.
__construct($db)
Constructor.
_tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
Show table for lines.
convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengthOfWeek=7)
Return, in clear text, value of a number of seconds in days, hours and minutes.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
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...
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
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...
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
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_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 formated for output on documents.
pdf_getInstance($format='', $metric='mm', $pagetype='P')
Return a PDF instance object.
pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0)
Returns the name of the thirdparty.
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.
$conf db
API class for accounts.