30 require_once DOL_DOCUMENT_ROOT.
'/core/modules/fichinter/modules_fichinter.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
66 public $phpmin = array(5, 6);
72 public $version =
'dolibarr';
122 global $conf, $langs, $mysoc;
125 $this->
name =
'soleil';
126 $this->
description = $langs->trans(
"DocumentModelStandardPDF");
131 $this->page_largeur = $formatarray[
'width'];
132 $this->page_hauteur = $formatarray[
'height'];
133 $this->format = array($this->page_largeur, $this->page_hauteur);
134 $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
135 $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
136 $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
137 $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
139 $this->option_logo = 1;
140 $this->option_tva = 0;
141 $this->option_modereg = 0;
142 $this->option_condreg = 0;
143 $this->option_codeproduitservice = 0;
144 $this->option_multilang = 1;
145 $this->option_draft_watermark = 1;
148 $this->emetteur = $mysoc;
149 if (empty($this->emetteur->country_code)) $this->emetteur->country_code = substr($langs->defaultlang, -2);
152 $this->posxdesc = $this->marge_gauche + 1;
167 public function write_file($object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
170 global $user, $langs, $conf, $mysoc, $db, $hookmanager;
172 if (!is_object($outputlangs)) $outputlangs = $langs;
174 if (!empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output =
'ISO-8859-1';
177 $outputlangs->loadLangs(array(
"main",
"interventions",
"dict",
"companies"));
179 if ($conf->ficheinter->dir_output)
181 $object->fetch_thirdparty();
184 if ($object->specimen)
186 $dir = $conf->ficheinter->dir_output;
187 $file = $dir.
"/SPECIMEN.pdf";
190 $dir = $conf->ficheinter->dir_output.
"/".$objectref;
191 $file = $dir.
"/".$objectref.
".pdf";
194 if (!file_exists($dir))
198 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
203 if (file_exists($dir))
206 if (!is_object($hookmanager))
208 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
212 $hookmanager->initHooks(array(
'pdfgeneration'));
213 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
215 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters, $object, $action);
217 $nblines = count($object->lines);
222 $heightforinfotot = 50;
223 $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5);
224 $heightforfooter = $this->marge_basse + 8;
225 if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS)) $heightforfooter += 6;
226 $pdf->SetAutoPageBreak(1, 0);
228 if (class_exists(
'TCPDF'))
230 $pdf->setPrintHeader(
false);
231 $pdf->setPrintFooter(
false);
235 if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
237 $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.
'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
238 $tplidx = $pdf->importPage(1);
243 $pdf->SetDrawColor(128, 128, 128);
245 $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
246 $pdf->SetSubject($outputlangs->transnoentities(
"InterventionCard"));
247 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
248 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
249 $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref).
" ".$outputlangs->transnoentities(
"InterventionCard"));
250 if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(
false);
252 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
256 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
258 $this->
_pagehead($pdf, $object, 1, $outputlangs);
259 $pdf->SetFont(
'',
'', $default_font_size - 1);
260 $pdf->SetTextColor(0, 0, 0);
263 $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 : 10);
265 $tab_height_newpage = 150;
268 $notetoshow = empty($object->note_public) ?
'' : $object->note_public;
278 $pdf->SetFont(
'',
'', $default_font_size - 1);
279 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top,
dol_htmlentitiesbr($notetoshow), 0, 1);
280 $nexY = $pdf->GetY();
281 $height_note = $nexY - $tab_top;
284 $pdf->SetDrawColor(192, 192, 192);
285 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1);
287 $tab_height = $tab_height - $height_note;
288 $tab_top = $nexY + 6;
293 $iniY = $tab_top + 7;
294 $curY = $tab_top + 7;
295 $nexY = $tab_top + 7;
297 $pdf->SetXY($this->marge_gauche, $tab_top);
298 $pdf->MultiCell(190, 5, $outputlangs->transnoentities(
"Description"), 0,
'L', 0);
299 $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5);
301 $pdf->SetFont(
'',
'', $default_font_size - 1);
303 $pdf->SetXY($this->marge_gauche, $tab_top + 5);
304 $text = $object->description;
305 if ($object->duration > 0)
307 $totaltime =
convertSecondToTime($object->duration,
'all', $conf->global->MAIN_DURATION_OF_WORKDAY);
308 $text .= ($text ?
' - ' :
'').$langs->trans(
"Total").
": ".$totaltime;
313 $pdf->writeHTMLCell(180, 3, 10, $tab_top + 5, $outputlangs->convToOutputCharset($desc), 0, 1);
314 $nexY = $pdf->GetY();
316 $pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY);
318 $nblines = count($object->lines);
321 for ($i = 0; $i < $nblines; $i++)
323 $objectligne = $object->lines[$i];
325 $valide = empty($objectligne->id) ? 0 : $objectligne->fetch($objectligne->id);
326 if ($valide > 0 || $object->specimen)
329 $pdf->SetFont(
'',
'', $default_font_size - 1);
330 $pdf->SetTextColor(0, 0, 0);
332 $pdf->setTopMargin($tab_top_newpage);
333 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
334 $pageposbefore = $pdf->getPage();
337 $curX = $this->posxdesc - 1;
340 if (empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)) {
341 $txt = $outputlangs->transnoentities(
"Date").
" : ".
dol_print_date($objectligne->datei,
'dayhour',
false, $outputlangs,
true);
343 $txt = $outputlangs->transnoentities(
"Date").
" : ".
dol_print_date($objectligne->datei,
'day',
false, $outputlangs,
true);
346 if ($objectligne->duration > 0)
348 $txt .=
" - ".$outputlangs->transnoentities(
"Duration").
" : ".
convertSecondToTime($objectligne->duration);
350 $txt =
'<strong>'.dol_htmlentitiesbr($txt, 1, $outputlangs->charset_output).
'</strong>';
353 $pdf->startTransaction();
354 $pdf->writeHTMLCell(0, 0, $curX, $curY + 1,
dol_concatdesc($txt, $desc), 0, 1, 0);
355 $pageposafter = $pdf->getPage();
356 if ($pageposafter > $pageposbefore)
358 $pdf->rollbackTransaction(
true);
359 $pageposafter = $pageposbefore;
361 $pdf->setPageOrientation(
'', 1, $heightforfooter);
362 $pdf->writeHTMLCell(0, 0, $curX, $curY,
dol_concatdesc($txt, $desc), 0, 1, 0);
363 $pageposafter = $pdf->getPage();
364 $posyafter = $pdf->GetY();
366 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)))
368 if ($i == ($nblines - 1))
370 $pdf->AddPage(
'',
'',
true);
371 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
372 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->
_pagehead($pdf, $object, 0, $outputlangs);
373 $pdf->setPage($pageposafter + 1);
378 $pdf->commitTransaction();
381 $nexY = $pdf->GetY();
382 $pageposafter = $pdf->getPage();
383 $pdf->setPage($pageposbefore);
384 $pdf->setTopMargin($this->marge_haute);
385 $pdf->setPageOrientation(
'', 1, 0);
388 if ($pageposafter > $pageposbefore) {
389 $pdf->setPage($pageposafter); $curY = $tab_top_newpage;
392 $pdf->SetFont(
'',
'', $default_font_size - 1);
395 while ($pagenb < $pageposafter)
397 $pdf->setPage($pagenb);
400 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
402 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
404 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
406 $pdf->setPage($pagenb);
407 $pdf->setPageOrientation(
'', 1, 0);
408 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->
_pagehead($pdf, $object, 0, $outputlangs);
410 if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak)
414 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
416 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
418 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
421 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
423 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->
_pagehead($pdf, $object, 0, $outputlangs);
431 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
432 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
434 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
435 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
438 $this->
_pagefoot($pdf, $object, $outputlangs);
439 if (method_exists($pdf,
'AliasNbPages')) $pdf->AliasNbPages();
442 $pdf->Output($file,
'F');
445 $hookmanager->initHooks(array(
'pdfgeneration'));
446 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
448 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
451 $this->error = $hookmanager->error;
452 $this->errors = $hookmanager->errors;
455 if (!empty($conf->global->MAIN_UMASK))
456 @chmod($file, octdec($conf->global->MAIN_UMASK));
458 $this->result = array(
'fullpath'=>$file);
462 $this->error = $langs->trans(
"ErrorCanNotCreateDir", $dir);
466 $this->error = $langs->trans(
"ErrorConstantNotDefined",
"FICHEINTER_OUTPUTDIR");
484 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
517 $this->
printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height + 1, 0, 0);
519 if (empty($hidebottom))
521 $pdf->SetXY(20, 230);
522 $pdf->MultiCell(66, 5, $outputlangs->transnoentities(
"NameAndSignatureOfInternalContact"), 0,
'L', 0);
524 $pdf->SetXY(20, 235);
525 $pdf->MultiCell(80, 25,
'', 1);
527 $pdf->SetXY(110, 230);
528 $pdf->MultiCell(80, 5, $outputlangs->transnoentities(
"NameAndSignatureOfExternalContact"), 0,
'L', 0);
530 $pdf->SetXY(110, 235);
531 $pdf->MultiCell(80, 25,
'', 1);
545 protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
547 global $conf, $langs;
551 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"interventions"));
556 if ($object->statut == 0 && (!empty($conf->global->FICHINTER_DRAFT_WATERMARK)))
558 pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur,
'mm', $conf->global->FICHINTER_DRAFT_WATERMARK);
562 $pdf->SetTextColor(0, 0, 60);
563 $pdf->SetFont(
'',
'B', $default_font_size + 3);
565 $posx = $this->page_largeur - $this->marge_droite - 100;
566 $posy = $this->marge_haute;
568 $pdf->SetXY($this->marge_gauche, $posy);
571 $logo = $conf->mycompany->dir_output.
'/logos/'.$this->emetteur->logo;
572 if ($this->emetteur->logo)
574 if (is_readable($logo))
577 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
579 $pdf->SetTextColor(200, 0, 0);
580 $pdf->SetFont(
'',
'B', $default_font_size - 2);
581 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
582 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorGoToGlobalSetup"), 0,
'L');
585 $text = $this->emetteur->name;
586 $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0,
'L');
589 $pdf->SetFont(
'',
'B', $default_font_size + 3);
590 $pdf->SetXY($posx, $posy);
591 $pdf->SetTextColor(0, 0, 60);
592 $title = $outputlangs->transnoentities(
"InterventionCard");
593 $pdf->MultiCell(100, 4, $title,
'',
'R');
595 $pdf->SetFont(
'',
'B', $default_font_size + 2);
598 $pdf->SetXY($posx, $posy);
599 $pdf->SetTextColor(0, 0, 60);
600 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"Ref").
" : ".$outputlangs->convToOutputCharset($object->ref),
'',
'R');
603 $pdf->SetFont(
'',
'', $default_font_size);
606 $pdf->SetXY($posx, $posy);
607 $pdf->SetTextColor(0, 0, 60);
608 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"Date").
" : ".
dol_print_date($object->datec,
"day",
false, $outputlangs,
true),
'',
'R');
610 if ($object->thirdparty->code_client)
613 $pdf->SetXY($posx, $posy);
614 $pdf->SetTextColor(0, 0, 60);
615 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"CustomerCode").
" : ".$outputlangs->transnoentities($object->thirdparty->code_client),
'',
'R');
621 $carac_emetteur =
'';
623 $arrayidcontact = $object->getIdContact(
'internal',
'INTERREPFOLL');
624 if (count($arrayidcontact) > 0)
626 $object->fetch_user($arrayidcontact[0]);
627 $carac_emetteur .= ($carac_emetteur ?
"\n" :
'').$outputlangs->transnoentities(
"Name").
": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs)).
"\n";
630 $carac_emetteur .=
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty,
'', 0,
'source', $object);
634 $posx = $this->marge_gauche;
635 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx = $this->page_largeur - $this->marge_droite - 80;
639 $pdf->SetTextColor(0, 0, 0);
640 $pdf->SetFont(
'',
'', $default_font_size - 2);
641 $pdf->SetXY($posx, $posy - 5);
642 $pdf->SetXY($posx, $posy);
643 $pdf->SetFillColor(230, 230, 230);
644 $pdf->MultiCell(82, $hautcadre,
"", 0,
'R', 1);
647 $pdf->SetXY($posx + 2, $posy + 3);
648 $pdf->SetTextColor(0, 0, 60);
649 $pdf->SetFont(
'',
'B', $default_font_size);
650 $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0,
'L');
651 $posy = $pdf->getY();
654 $pdf->SetFont(
'',
'', $default_font_size - 1);
655 $pdf->SetXY($posx + 2, $posy);
656 $pdf->MultiCell(80, 4, $carac_emetteur, 0,
'L');
661 $arrayidcontact = $object->getIdContact(
'external',
'CUSTOMER');
662 if (count($arrayidcontact) > 0)
665 $result = $object->fetch_contact($arrayidcontact[0]);
669 if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
670 $thirdparty = $object->contact;
672 $thirdparty = $object->thirdparty;
677 $carac_client =
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (isset($object->contact) ? $object->contact :
''), $usecontact,
'target', $object);
681 if ($this->page_largeur < 210) $widthrecbox = 84;
683 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
684 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx = $this->marge_gauche;
687 $pdf->SetTextColor(0, 0, 0);
688 $pdf->SetFont(
'',
'', $default_font_size - 2);
689 $pdf->SetXY($posx + 2, $posy - 5);
690 $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
691 $pdf->SetTextColor(0, 0, 0);
694 $pdf->SetXY($posx + 2, $posy + 3);
695 $pdf->SetFont(
'',
'B', $default_font_size);
696 $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0,
'L');
698 $posy = $pdf->getY();
701 $pdf->SetFont(
'',
'', $default_font_size - 1);
702 $pdf->SetXY($posx + 2, $posy);
703 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0,
'L');
717 protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
720 $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
721 return pdf_pagefoot($pdf, $outputlangs,
'FICHINTER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
pdf_getFormat(Translate $outputlangs=null, $mode= 'setup')
Return array with format properties of default PDF format.
pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0)
Returns the name of the thirdparty.
pdf_pagehead(&$pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
__construct($db)
Constructor.
Class to build interventions documents with model Soleil.
_tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
Show table for lines.
pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
Add a draft watermark on PDF files.
_pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
Show footer of page.
_pagehead(&$pdf, $object, $showaddress, $outputlangs)
Show top header of page.
</td > param sortfield sortorder printFieldListOption< tdclass="liste_titremaxwidthsearchright"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration center DesiredStock p desiredstock right StockLimitShort p seuil_stock_alerte right stock_physique right stock_real_warehouse right Ordered right StockToBuy right SupplierRef right param sortfield sortorder printFieldListTitle warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow StockTooLow help help help< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"> stock</td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
write_file($object, $outputlangs, $srctemplatepath= '', $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build pdf onto disk.
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...
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
$conf db name
Only used if Module[ID]Name translation string is not found.
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...
$conf db
API class for accounts.
pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails=0, $hidefreetext=0)
Show footer of page for PDF generation.
Parent class to manage intervention document templates.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
Rect pdf.
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
convertBackOfficeMediasLinksToPublicLinks($notetoshow)
Convert links to local wrapper to medias files into a string into a public external URL readable on i...
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0)
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_build_address($outputlangs, $sourcecompany, $targetcompany= '', $targetcontact= '', $usecontact=0, $mode= 'source', $object=null)
Return a string with full address formated for output on documents.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
make_substitutions($text, $substitutionarray, $outputlangs=null)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)
convertSecondToTime($iSecond, $format= 'all', $lengthOfDay=86400, $lengthOfWeek=7)
Return, in clear text, value of a number of seconds in days, hours and minutes.
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...