27require_once DOL_DOCUMENT_ROOT.
'/core/modules/fichinter/modules_fichinter.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
61 public $update_main_doc_field;
71 public $version =
'dolibarr';
84 $this->
name =
'helios';
85 $this->
description = $langs->trans(
"DocumentModelStandardPDF");
86 $this->update_main_doc_field = 1;
91 $this->page_largeur = $formatarray[
'width'];
92 $this->page_hauteur = $formatarray[
'height'];
93 $this->format = array($this->page_largeur, $this->page_hauteur);
98 $this->corner_radius =
getDolGlobalInt(
'MAIN_PDF_FRAME_CORNER_RADIUS', 0);
99 $this->option_logo = 1;
100 $this->option_tva = 0;
101 $this->option_modereg = 0;
102 $this->option_condreg = 0;
103 $this->option_multilang = 1;
104 $this->option_draft_watermark = 1;
105 $this->watermark =
'';
107 $this->tabTitleHeight = 5;
110 $this->posxdesc = $this->marge_gauche + 1;
119 if (empty($this->emetteur->country_code)) {
120 $this->emetteur->country_code = substr($langs->defaultlang, -2);
136 public function write_file(
$object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
141 if (!is_object($outputlangs)) {
142 $outputlangs = $langs;
146 $outputlangs->charset_output =
'ISO-8859-1';
150 $outputlangs->loadLangs(array(
"main",
"interventions",
"dict",
"companies",
"compta"));
157 if (
$conf->ficheinter->dir_output) {
162 $dir =
$conf->ficheinter->dir_output;
163 $file = $dir.
"/SPECIMEN.pdf";
166 $dir =
$conf->ficheinter->dir_output.
"/".$objectref;
167 $file = $dir.
"/".$objectref.
".pdf";
170 if (!file_exists($dir)) {
172 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
177 if (file_exists($dir)) {
179 if (!is_object($hookmanager)) {
180 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
183 $hookmanager->initHooks(array(
'pdfgeneration'));
184 $parameters = array(
'file' => $file,
'object' =>
$object,
'outputlangs' => $outputlangs);
186 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters,
$object, $action);
193 $heightforinfotot = 40;
195 $heightforfooter = $this->marge_basse + 8;
197 $heightforfooter += 6;
199 $pdf->setAutoPageBreak(
true, 0);
201 if (class_exists(
'TCPDF')) {
202 $pdf->setPrintHeader(
false);
203 $pdf->setPrintFooter(
false);
208 $pagecount = $pdf->setSourceFile(
$conf->mycompany->dir_output.
'/'.
getDolGlobalString(
'MAIN_ADD_PDF_BACKGROUND'));
209 $tplidx = $pdf->importPage(1);
214 $pdf->SetDrawColor(128, 128, 128);
216 $pdf->SetTitle($outputlangs->convToOutputCharset(
$object->ref));
217 $pdf->SetSubject($outputlangs->transnoentities(
"InterventionCard"));
218 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
219 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getAnonymisableFullName($outputlangs)));
220 $pdf->SetKeyWords($outputlangs->convToOutputCharset(
$object->ref).
" ".$outputlangs->transnoentities(
"InterventionCard"));
222 $pdf->SetCompression(
false);
226 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
230 if (!empty($tplidx)) {
231 $pdf->useTemplate($tplidx);
235 $pdf->SetFont(
'',
'', $default_font_size - 1);
236 $pdf->SetTextColor(0, 0, 0);
238 $tab_top = 80 + $this->marge_haute;
239 $tab_top_newpage = (!
getDolGlobalInt(
'MAIN_PDF_DONOTREPEAT_HEAD') ? 32 + $this->marge_haute : $this->marge_haute);
241 $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext;
244 $notetoshow = empty(
$object->note_public) ?
'' :
$object->note_public;
245 $extranote = $this->getExtrafieldsInHtml(
$object, $outputlangs);
246 if (!empty($extranote)) {
252 $notetoshow =
make_substitutions((
string) $notetoshow, $substitutionarray, $outputlangs);
257 $pdf->SetFont(
'',
'', $default_font_size - 1);
258 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top,
dol_htmlentitiesbr($notetoshow), 0, 1);
259 $nexY = $pdf->GetY();
260 $height_note = $nexY - $tab_top;
263 $pdf->SetDrawColor(192, 192, 192);
264 $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius,
'1234',
'D');
266 $tab_height -= $height_note;
267 $tab_top = $nexY + 6;
276 $pdf->startTransaction();
277 $this->
pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs);
278 $pdf->rollbackTransaction(
true);
280 $nexY = $tab_top + $this->tabTitleHeight;
283 $pageposbeforeprintlines = $pdf->getPage();
284 $pagenb = $pageposbeforeprintlines;
285 for ($i = 0; $i < $nblines; $i++) {
286 $objectligne =
$object->lines[$i];
290 $issubtotalline = (defined(
'SUBTOTALS_SPECIAL_CODE') && $objectligne->special_code == SUBTOTALS_SPECIAL_CODE);
291 $sub_options = is_array($objectligne->extraparams) ? ($objectligne->extraparams[
"subtotal"] ?? array()) : array();
295 if ($issubtotalline && empty($objectligne->qty)) {
296 $objectligne->qty = (int) $objectligne->duration;
299 if (($curY + 6) > ($this->page_hauteur - $heightforfooter)
300 || (isset($sub_options[
'titleforcepagebreak']) && !($pdf->getNumPages() == 1 && $curY == $tab_top + $this->tabTitleHeight))) {
302 if (!empty($tplidx)) {
303 $pdf->useTemplate($tplidx);
305 $pdf->setPage($pdf->getNumPages());
306 $nexY = $curY = $tab_top_newpage;
309 $pdf->SetFont(
'',
'', $default_font_size - 1);
310 $pdf->SetTextColor(0, 0, 0);
312 $pdf->setTopMargin($tab_top_newpage);
313 $pdf->setPageOrientation(
'',
true, $heightforfooter + $heightforfreetext + $heightforinfotot);
314 $pageposbefore = $pdf->getPage();
318 if ($issubtotalline) {
320 pdf_render_subtotals($pdf, $this, $curY,
$object, $i, $outputlangs, $hideref, $hidedesc, $bg_color,
true,
true);
322 $pdf->startTransaction();
326 $pageposafter = $pdf->getPage();
327 if ($pageposafter > $pageposbefore) {
328 $pdf->rollbackTransaction(
true);
332 $pageposafter = $pdf->getPage();
333 $posyafter = $pdf->GetY();
334 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
335 if ($i == ($nblines - 1)) {
336 $pdf->AddPage(
'',
'',
true);
337 if (!empty($tplidx)) {
338 $pdf->useTemplate($tplidx);
340 $pdf->setPage($pageposafter + 1);
344 $pdf->commitTransaction();
349 $nexY = $pdf->GetY();
350 $pageposafter = $pdf->getPage();
352 $pdf->setPage($pageposbefore);
353 $pdf->setTopMargin($this->marge_haute);
354 $pdf->setPageOrientation(
'',
true, 0);
357 if ($pageposafter > $pageposbefore) {
358 $pdf->setPage($pageposafter);
359 $curY = $tab_top_newpage;
362 $pdf->SetFont(
'',
'', $default_font_size - 1);
370 if (!$issubtotalline) {
375 if ($this->
getColumnStatus(
'duration') && $objectligne->duration > 0) {
380 if (!empty($objectligne->array_options)) {
381 foreach ($objectligne->array_options as $extrafieldColKey => $extrafieldValue) {
396 'outputlangs' => $outputlangs,
397 'hidedetails' => $hidedetails
399 $hookmanager->executeHooks(
'printPDFline', $parameters, $this);
403 $pdf->setPage($pageposafter);
404 $pdf->SetLineStyle(array(
'dash' =>
'1,1',
'color' => array(80, 80, 80)));
405 $pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY);
406 $pdf->SetLineStyle(array(
'dash' => 0));
410 while ($pagenb < $pageposafter) {
411 $pdf->setPage($pagenb);
412 if ($pagenb == $pageposbeforeprintlines) {
413 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
415 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
419 $pdf->setPage($pagenb);
420 $pdf->setPageOrientation(
'',
true, 0);
424 if (!empty($tplidx)) {
425 $pdf->useTemplate($tplidx);
431 if ($pagenb == $pageposbeforeprintlines) {
432 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
433 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
435 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
436 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
446 if (method_exists($pdf,
'AliasNbPages')) {
447 $pdf->AliasNbPages();
451 $pdf->Output($file,
'F');
454 $hookmanager->initHooks(array(
'pdfgeneration'));
455 $parameters = array(
'file' => $file,
'object' =>
$object,
'outputlangs' => $outputlangs);
456 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
457 $this->warnings = $hookmanager->warnings;
459 $this->error = $hookmanager->error;
460 $this->errors = $hookmanager->errors;
467 $this->result = array(
'fullpath' => $file);
471 $this->error = $langs->trans(
"ErrorCanNotCreateDir", $dir);
475 $this->error = $langs->trans(
"ErrorConstantNotDefined",
"FICHEINTER_OUTPUTDIR");
497 $pdf->SetFont(
'',
'B', $default_font_size - 1);
498 $pdf->SetTextColor(0, 0, 0);
508 $pdf->SetFont(
'',
'', $default_font_size - 1);
528 $pdf->SetFont(
'',
'', $default_font_size - 1);
529 $pdf->SetTextColor(0, 0, 0);
532 $arrayidcontact =
$object->getIdContact(
'internal',
'INTERVENING');
533 if (count($arrayidcontact) > 0) {
534 $object->fetch_user($arrayidcontact[0]);
535 $employee_name =
$object->user->getFullName($outputlangs);
538 $boxwidth = ($this->page_largeur - $this->marge_gauche - $this->marge_droite - 10) / 2;
540 $pdf->SetXY($this->marge_gauche, $posy);
541 $pdf->MultiCell($boxwidth, 5, $outputlangs->transnoentities(
"NameAndSignatureOfInternalContact"), 0,
'L',
false);
542 $pdf->SetXY($this->marge_gauche, $posy + 5);
543 $pdf->MultiCell($boxwidth, 20, $employee_name, 1,
'L');
545 $pdf->SetXY($this->marge_gauche + $boxwidth + 10, $posy);
546 $pdf->MultiCell($boxwidth, 5, $outputlangs->transnoentities(
"NameAndSignatureOfExternalContact"), 0,
'L',
false);
547 $pdf->SetXY($this->marge_gauche + $boxwidth + 10, $posy + 5);
548 $pdf->MultiCell($boxwidth, 20,
'', 1);
564 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
576 $pdf->SetTextColor(0, 0, 0);
577 $pdf->SetFont(
'',
'', $default_font_size - 2);
580 $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius,
'1001',
'F', array(), explode(
',',
getDolGlobalString(
'MAIN_PDF_TITLE_BACKGROUND_COLOR')));
583 $pdf->SetDrawColor(128, 128, 128);
584 $pdf->SetFont(
'',
'', $default_font_size - 1);
587 $this->
printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom,
'D');
589 $this->
pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
591 if (empty($hidetop)) {
592 $pdf->line($this->marge_gauche, $tab_top + $this->tabTitleHeight, $this->page_largeur - $this->marge_droite, $tab_top + $this->tabTitleHeight);
608 global
$conf, $langs;
613 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"interventions"));
617 $pdf->SetTextColor(0, 0, 60);
618 $pdf->SetFont(
'',
'B', $default_font_size + 3);
620 $posx = $this->page_largeur - $this->marge_droite - 100;
621 $posy = $this->marge_haute;
623 $pdf->SetXY($this->marge_gauche, $posy);
626 $logo =
$conf->mycompany->dir_output.
'/logos/'.$this->emetteur->logo;
627 if ($this->emetteur->logo) {
628 if (is_readable($logo)) {
630 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
632 $pdf->SetTextColor(200, 0, 0);
633 $pdf->SetFont(
'',
'B', $default_font_size - 2);
634 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
635 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorGoToGlobalSetup"), 0,
'L');
638 $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0,
'L');
641 $pdf->SetFont(
'',
'B', $default_font_size + 3);
642 $pdf->SetXY($posx, $posy);
643 $pdf->SetTextColor(0, 0, 60);
644 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"InterventionCard"),
'',
'R');
646 $pdf->SetFont(
'',
'B', $default_font_size + 2);
649 $pdf->SetXY($posx, $posy);
650 $pdf->SetTextColor(0, 0, 60);
651 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"Ref").
" : ".$outputlangs->convToOutputCharset(
$object->ref),
'',
'R');
654 $pdf->SetFont(
'',
'', $default_font_size);
657 $pdf->SetXY($posx, $posy);
658 $pdf->SetTextColor(0, 0, 60);
659 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"Date").
" : ".
dol_print_date(
$object->datec,
"day",
false, $outputlangs,
true),
'',
'R');
661 if (!empty(
$object->ref_client)) {
663 $pdf->SetXY($posx, $posy);
664 $pdf->SetTextColor(0, 0, 60);
665 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"RefCustomer").
" : ".
dol_trunc($outputlangs->convToOutputCharset(
$object->ref_client), 65),
'',
'R');
670 $pdf->SetXY($posx, $posy);
671 $pdf->SetTextColor(0, 0, 60);
672 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"CustomerCode").
" : ".$outputlangs->transnoentities((
string)
$object->thirdparty->code_client),
'',
'R');
677 $carac_emetteur =
'';
678 $arrayidcontact =
$object->getIdContact(
'internal',
'INTERREPFOLL');
679 if (count($arrayidcontact) > 0) {
680 $object->fetch_user($arrayidcontact[0]);
681 $labelbeforecontactname = ($outputlangs->transnoentities(
"FromContactName") !=
'FromContactName' ? $outputlangs->transnoentities(
"FromContactName") : $outputlangs->transnoentities(
"Name"));
682 $carac_emetteur .= $labelbeforecontactname.
": ".$outputlangs->convToOutputCharset(
$object->user->getFullName($outputlangs)).
"\n";
688 $posy = 32 + $this->marge_haute;
689 $posx = $this->marge_gauche;
691 $posx = $this->page_largeur - $this->marge_droite - 80;
697 $pdf->SetTextColor(0, 0, 0);
698 $pdf->SetFont(
'',
'', $default_font_size - 2);
699 $pdf->SetXY($posx, $posy);
700 $pdf->SetFillColor(230, 230, 230);
701 $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius,
'1234',
'F');
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');
720 $arrayidcontact =
$object->getIdContact(
'external',
'CUSTOMER');
721 if (count($arrayidcontact) > 0) {
723 $result =
$object->fetch_contact($arrayidcontact[0]);
727 if ($usecontact && (
$object->contact->socid !=
$object->thirdparty->id && (!isset(
$conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) ||
getDolGlobalString(
'MAIN_USE_COMPANY_NAME_OF_CONTACT')))) {
728 $thirdparty =
$object->contact;
730 $thirdparty =
$object->thirdparty;
739 if ($this->page_largeur < 210) {
742 $posy = 32 + $this->marge_haute;
743 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
745 $posx = $this->marge_gauche;
750 $pdf->SetTextColor(0, 0, 0);
751 $pdf->SetFont(
'',
'', $default_font_size - 2);
752 $pdf->SetXY($posx + 2, $posy - 5);
753 $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius,
'1234',
'D');
754 $pdf->SetTextColor(0, 0, 0);
758 $pdf->SetXY($posx + 2, $posy + 3);
759 $pdf->SetFont(
'',
'B', $default_font_size);
760 $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0,
'L');
762 $posy = $pdf->getY();
765 $pdf->SetFont(
'',
'', $default_font_size - 1);
766 $pdf->SetXY($posx + 2, $posy);
767 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0,
'L');
785 $showdetails =
getDolGlobalInt(
'MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
786 return pdf_pagefoot($pdf, $outputlangs,
'FICHINTER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur,
$object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark);
806 $this->defaultContentsFieldsStyle = array(
808 'padding' => array(1, 0.5, 1, 0.5),
812 $this->defaultTitlesFieldsStyle = array(
814 'padding' => array(0.5, 0, 0.5, 0),
818 $this->cols[
'position'] = array(
825 'padding' => array(0.5, 0.5, 0.5, 0.5),
829 'padding' => array(1, 0.5, 1, 1.5),
834 $this->cols[
'desc'] = array(
839 'textkey' =>
'Designation',
841 'padding' => array(0.5, 0.5, 0.5, 0.5),
845 'padding' => array(1, 0.5, 1, 1.5),
850 $this->cols[
'date'] = array(
857 'border-left' =>
true,
864 $this->cols[
'duration'] = array(
869 'textkey' =>
'Duration',
871 'border-left' =>
true,
885 'outputlangs' => $outputlangs,
886 'hidedetails' => $hidedetails,
887 'hidedesc' => $hidedesc,
888 'hideref' => $hideref
891 $reshook = $hookmanager->executeHooks(
'defineColumnField', $parameters, $this);
894 } elseif (empty($reshook)) {
896 $this->cols = array_replace($this->cols, $hookmanager->resArray);
898 $this->cols = $hookmanager->resArray;
if(! $sortfield) if(! $sortorder) $object
prepareArrayColumnField($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Prepare Array Column Field.
getColumnStatus($colKey)
get column status from column key
printStdColumnContent($pdf, &$curY, $colKey, $columnText='')
print standard column content
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
getExtrafieldContent($object, $extrafieldKey, $outputlangs=null)
get extrafield content for pdf writeHtmlCell compatibility usage for PDF line columns and object note...
printRoundedRect($pdf, $x, $y, $w, $h, $r, $hidetop=0, $hidebottom=0, $style='D')
Print a rounded rectangle on the PDF.
defineColumnExtrafield($object, $outputlangs, $hidedetails=0)
Define Array Column Field for extrafields.
Parent class to manage intervention document templates.
Class to build intervention documents with model Helios.
_tableau_tot(&$pdf, $object, $posy, $outputlangs)
Show total line (total duration of the intervention)
__construct($db)
Constructor.
_pagehead(&$pdf, $object, $showaddress, $outputlangs)
Show top header of page.
_pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
Show footer of page.
write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build pdf onto disk.
_tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
Show table for lines.
defineColumnField($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Define Array Column Field.
_tableau_signature(&$pdf, $object, $posy, $outputlangs)
Show name / signature boxes for the internal and external contacts.
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 $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after 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...
colorStringToArray($stringcolor, $colorifnotfound=array(88, 88, 88))
Convert a string RGB value ('FFFFFF', '255,255,255') into an array RGB array(255,255,...
getCallerInfoString()
Get caller info as a string that can be appended to a log message.
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.
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...
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).
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 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)
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session 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.
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
pdf_pagehead($pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
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_getPDFFont($outputlangs)
Return font name to use for PDF generation.
pdf_render_subtotals(TCPDF $pdf, CommonDocGenerator $generator, float $curY, CommonObject $object, int $i, Translate $outputlangs, int $hideref, int $hidedesc, array $bgColor, bool $isSubtotal=false, bool $applySubtotalLogic=true)
Render subtotals line with a colored background and adapted text color .
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.
pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0)
Returns the name of the thirdparty.
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
$conf db name
Only used if Module[ID]Name translation string is not found.