dolibarr 24.0.0-beta
pdf_storm.modules.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
4 * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
5 * Copyright (C) 2008 Chiptronik
6 * Copyright (C) 2011-2021 Philippe Grand <philippe.grand@atoo-net.com>
7 * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
8 * Copyright (C) 2020 John BOTELLA
9 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
10 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
11 * Copyright (C) 2024 Nick Fragoulis
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <https://www.gnu.org/licenses/>.
25 * or see https://www.gnu.org/
26 */
27
34require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php';
35require_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php';
36require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
37require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
38
39
44{
48 public $db;
49
53 public $name;
54
58 public $description;
59
63 public $update_main_doc_field;
64
68 public $type;
69
74 public $version = 'dolibarr';
75
76
82 public function __construct($db)
83 {
84 global $langs, $mysoc;
85
86 // Translations
87 $langs->loadLangs(array("main", "bills", "sendings", "companies"));
88
89 $this->db = $db;
90 $this->name = "Storm";
91 $this->description = $langs->trans("DocumentModelStorm");
92 $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template
93
94 // Page size for A4 format
95 $this->type = 'pdf';
96 $formatarray = pdf_getFormat();
97 $this->page_largeur = $formatarray['width'];
98 $this->page_hauteur = $formatarray['height'];
99 $this->format = array($this->page_largeur, $this->page_hauteur);
100 $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
101 $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
102 $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
103 $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
104 $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0);
105 $this->option_logo = 1; // Display logo FAC_PDF_LOGO
106 $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
107
108 if ($mysoc === null) {
109 dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
110 return;
111 }
112
113 // Get source company
114 $this->emetteur = $mysoc;
115 if (empty($this->emetteur->country_code)) {
116 $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
117 }
118 }
119
120
121 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
133 public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
134 {
135 // phpcs:enable
136 global $user, $langs, $conf, $mysoc, $hookmanager;
137
138 if (!is_object($outputlangs)) {
139 $outputlangs = $langs;
140 }
141 // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
142 if (getDolGlobalString('MAIN_USE_FPDF')) {
143 $outputlangs->charset_output = 'ISO-8859-1';
144 }
145
146 // Load translation files required by the page
147 $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "sendings"));
148
149 if ($conf->expedition->dir_output) {
150 $object->fetch_thirdparty();
151
152 // Definition of $dir and $file
153 if ($object->specimen) {
154 $dir = $conf->expedition->dir_output."/receipt";
155 $file = $dir."/SPECIMEN.pdf";
156 } else {
157 $objectref = dol_sanitizeFileName($object->ref);
158 $dir = $conf->expedition->dir_output."/receipt/".$objectref;
159 $file = $dir."/".$objectref.".pdf";
160 }
161
162 if (!file_exists($dir)) {
163 if (dol_mkdir($dir) < 0) {
164 $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
165 return 0;
166 }
167 }
168
169 if (file_exists($dir)) {
170 // Add pdfgeneration hook
171 if (!is_object($hookmanager)) {
172 include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
173 $hookmanager = new HookManager($this->db);
174 }
175 $hookmanager->initHooks(array('pdfgeneration'));
176 $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
177 global $action;
178 $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
179
180 $nblines = count($object->lines);
181
182
183 // Loop on each lines to detect if there is at least one image to show
184 $realpatharray = array();
185 $this->atleastonephoto = false;
186 if (getDolGlobalString('MAIN_GENERATE_DELIVERY_WITH_PICTURE')) {
187 $objphoto = new Product($this->db);
188
189 for ($i = 0; $i < $nblines; $i++) {
190 if (empty($object->lines[$i]->fk_product)) {
191 continue;
192 }
193
194 $objphoto->fetch($object->lines[$i]->fk_product);
195 $pdir = array();
196
197 if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) {
198 $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
199 $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
200 } else {
201 $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default
202 $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative
203 }
204
205 $arephoto = false;
206 $realpath = false;
207 foreach ($pdir as $midir) {
208 if (!$arephoto) {
209 $dir = $conf->product->dir_output.'/'.$midir;
210
211 foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
212 if (!getDolGlobalInt('CAT_HIGH_QUALITY_IMAGES')) { // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo
213 if ($obj['photo_vignette']) {
214 $filename = $obj['photo_vignette'];
215 } else {
216 $filename = $obj['photo'];
217 }
218 } else {
219 $filename = $obj['photo'];
220 }
221
222 $realpath = $dir.$filename;
223 $arephoto = true;
224 $this->atleastonephoto = true;
225 }
226 }
227 }
228
229 if ($realpath && $arephoto) {
230 $realpatharray[$i] = $realpath;
231 }
232 }
233 }
234
235
236 // Create pdf instance
237 $pdf = pdf_getInstance($this->format);
238 $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
239 $heightforinfotot = 30; // Height reserved to output the info and total part
240 $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page
241 $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
242 if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) {
243 $heightforfooter += 6;
244 }
245 $pdf->setAutoPageBreak(true, 0);
246
247 if (class_exists('TCPDF')) {
248 $pdf->setPrintHeader(false);
249 $pdf->setPrintFooter(false);
250 }
251 $pdf->SetFont(pdf_getPDFFont($outputlangs));
252 // Set path to the background PDF File
253 if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) {
254 $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
255 $tplidx = $pdf->importPage(1);
256 }
257
258 // We get the shipment that is the origin of delivery receipt
259 $expedition = new Expedition($this->db);
260 $result = $expedition->fetch($object->origin_id);
261 // Now we get the order that is origin of shipment
262 $commande = new Commande($this->db);
263 if ($expedition->origin == 'commande') {
264 $commande->fetch($expedition->origin_id);
265 }
266 $object->commande = $commande; // We set order of shipment onto delivery.
267 $object->commande->loadExpeditions();
268
269
270 $pdf->Open();
271 $pagenb = 0;
272 $pdf->SetDrawColor(128, 128, 128);
273
274 $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
275 $pdf->SetSubject($outputlangs->transnoentities("DeliveryOrder"));
276 $pdf->SetCreator("Dolibarr ".DOL_VERSION);
277 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getAnonymisableFullName($outputlangs)));
278 $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("DeliveryOrder"));
279 if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) {
280 $pdf->SetCompression(false);
281 }
282
283 // @phan-suppress-next-line PhanPluginSuspiciousParamOrder
284 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
285
286
287 // New page
288 $pdf->AddPage();
289 if (!empty($tplidx)) {
290 $pdf->useTemplate($tplidx);
291 }
292 $pagenb++;
293 $this->_pagehead($pdf, $object, 1, $outputlangs);
294 $pdf->SetFont('', '', $default_font_size - 1);
295 $pdf->MultiCell(0, 3, ''); // Set interline to 3
296 $pdf->SetTextColor(0, 0, 0);
297
298 $tab_top = 90;
299 $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 : 10);
300
301 $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext;
302
303 $this->posxdesc = $this->marge_gauche + 1;
304
305 // Incoterm
306 $height_incoterms = 0;
307 if (isModEnabled('incoterm')) {
308 $desc_incoterms = $object->getIncotermsForPDF();
309 if ($desc_incoterms) {
310 $tab_top -= 2;
311
312 $pdf->SetFont('', '', $default_font_size - 1);
313 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
314 $nexY = $pdf->GetY();
315 $height_incoterms = $nexY - $tab_top;
316
317 // Rect takes a length in 3rd parameter
318 $pdf->SetDrawColor(192, 192, 192);
319 $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D');
320
321 $tab_top = $nexY + 6;
322 $height_incoterms += 4;
323 }
324 }
325
326 // display note
327 $notetoshow = empty($object->note_public) ? '' : $object->note_public;
328
329 // Extrafields in note
330 $extranote = $this->getExtrafieldsInHtml($object, $outputlangs);
331 if (!empty($extranote)) {
332 $notetoshow = dol_concatdesc($notetoshow, $extranote);
333 }
334
335 if (!empty($notetoshow)) {
336 $tab_top = 88 + $height_incoterms;
337
338 $pdf->SetFont('', '', $default_font_size - 1);
339 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
340 $nexY = $pdf->GetY();
341 $height_note = $nexY - $tab_top;
342
343 // Rect takes a length in 3rd parameter
344 $pdf->SetDrawColor(192, 192, 192);
345 $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');
346
347 $tab_height -= $height_note;
348 $tab_top = $nexY + 6;
349 } else {
350 $height_note = 0;
351 }
352
353 // Use new auto column system
354 $this->prepareArrayColumnField($object, $outputlangs, $hidedetails, $hidedesc, $hideref);
355
356 // Table simulation to know the height of the title line
357 $pdf->startTransaction();
358 $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, 0);
359 $pdf->rollbackTransaction(true);
360
361 $iniY = $tab_top + $this->tabTitleHeight + 2;
362 $curY = $tab_top + $this->tabTitleHeight + 2;
363 $nexY = $tab_top + $this->tabTitleHeight + 2;
364
365 // Loop on each lines
366 for ($i = 0; $i < $nblines; $i++) {
367 // Fetch optionals
368 if (empty($object->lines[$i]->array_options)) {
369 $object->lines[$i]->fetch_optionals();
370 }
371
372 $curY = $nexY;
373 $pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage
374 $pdf->SetTextColor(0, 0, 0);
375
376 // Define size of image if we need it
377 $imglinesize = array();
378 if (!empty($realpatharray[$i])) {
379 $imglinesize = pdf_getSizeForImage($realpatharray[$i]);
380 }
381
382
383 $pdf->setTopMargin($tab_top_newpage);
384 $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it.
385 $pageposbefore = $pdf->getPage();
386
387 // Description of product line
388 $curX = $this->posxdesc - 1;
389
390 $showpricebeforepagebreak = 1;
391
392 $posYAfterImage = 0;
393 $posYAfterDescription = 0;
394 if ($this->getColumnStatus('photo')) {
395 // We start with Photo of product line
396 if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // If photo too high, we moved completely on new page
397 $pdf->AddPage('', '', true);
398 if (!empty($tplidx)) {
399 $pdf->useTemplate($tplidx);
400 }
401 //if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) $this->_pagehead($pdf, $object, 0, $outputlangs);
402 $pdf->setPage($pageposbefore + 1);
403
404 $curY = $tab_top_newpage;
405
406 // Allows data in the first page if description is long enough to break in multiples pages
407 if (getDolGlobalString('MAIN_PDF_DATA_ON_FIRST_PAGE')) {
408 $showpricebeforepagebreak = 1;
409 } else {
410 $showpricebeforepagebreak = 0;
411 }
412 }
413
414
415 if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) {
416 $pdf->Image($realpatharray[$i], $this->getColumnContentXStart('photo'), $curY + 1, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi
417 // $pdf->Image does not increase value return by getY, so we save it manually
418 $posYAfterImage = $curY + $imglinesize['height'];
419 }
420 }
421
422
423 // Description of product line
424 if ($this->getColumnStatus('desc')) {
425 $pdf->startTransaction();
426 pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->getColumnContentWidth('desc'), 3, $this->getColumnContentXStart('desc'), $curY, $hideref, $hidedesc);
427 $pageposafter = $pdf->getPage();
428 if ($pageposafter > $pageposbefore) { // There is a pagebreak
429 $pdf->rollbackTransaction(true);
430 $pageposafter = $pageposbefore;
431 //print $pageposafter.'-'.$pageposbefore;exit;
432 $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
433 pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->getColumnContentWidth('desc'), 4, $this->getColumnContentXStart('desc'), $curY, $hideref, $hidedesc);
434 $posyafter = $pdf->GetY();
435 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // There is no space left for total+free text
436 if ($i == ($nblines - 1)) { // No more lines, and no space left to show total, so we create a new page
437 $pdf->AddPage('', '', true);
438 if (!empty($tplidx)) {
439 $pdf->useTemplate($tplidx);
440 }
441 if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
442 $this->_pagehead($pdf, $object, 0, $outputlangs);
443 }
444 $pdf->setPage($pageposafter + 1);
445 }
446 } else {
447 // We found a page break
448 // Allows data in the first page if description is long enough to break in multiples pages
449 if (getDolGlobalString('MAIN_PDF_DATA_ON_FIRST_PAGE')) {
450 $showpricebeforepagebreak = 1;
451 } else {
452 $showpricebeforepagebreak = 0;
453 }
454 }
455 } else { // No pagebreak
456 $pdf->commitTransaction();
457 }
458
459 $posYAfterDescription = $pdf->GetY();
460 }
461
462 $nexY = $pdf->GetY();
463 $pageposafter = $pdf->getPage();
464 $pdf->setPage($pageposbefore);
465 $pdf->setTopMargin($this->marge_haute);
466 $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it.
467
468 // We suppose that a too long description is moved completely on next page
469 if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
470 $pdf->setPage($pageposafter);
471 $curY = $tab_top_newpage;
472 }
473
474 $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default
475
476
477 // Quantity
478 if ($this->getColumnStatus('qty_shipped')) {
479 $this->printStdColumnContent($pdf, $curY, 'qty_shipped', (string) $object->lines[$i]->qty_shipped);
480 $nexY = max($pdf->GetY(), $nexY);
481 }
482
483 // Remaining to ship
484 if ($this->getColumnStatus('qty_remaining')) {
485 $qtyRemaining = $object->lines[$i]->qty_asked - $object->commande->expeditions[$object->lines[$i]->fk_origin_line];
486 $this->printStdColumnContent($pdf, $curY, 'qty_remaining', (string) $qtyRemaining);
487 $nexY = max($pdf->GetY(), $nexY);
488 }
489
490 $nexY = max($nexY, $posYAfterImage);
491
492 // Extrafields
493 if (!empty($object->lines[$i]->array_options)) {
494 foreach ($object->lines[$i]->array_options as $extrafieldColKey => $extrafieldValue) {
495 if ($this->getColumnStatus($extrafieldColKey)) {
496 $extrafieldValue = $this->getExtrafieldContent($object->lines[$i], $extrafieldColKey, $outputlangs);
497 $this->printStdColumnContent($pdf, $curY, $extrafieldColKey, $extrafieldValue);
498 $nexY = max($pdf->GetY(), $nexY);
499 }
500 }
501 }
502
503 // Add line
504 if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) {
505 $pdf->setPage($pageposafter);
506 $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80)));
507 //$pdf->SetDrawColor(190,190,200);
508 $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1);
509 $pdf->SetLineStyle(array('dash' => 0));
510 }
511
512 $nexY += 2; // Add space between lines
513
514 // Detect if some page were added automatically and output _tableau for past pages
515 while ($pagenb < $pageposafter) {
516 $pdf->setPage($pagenb);
517 if ($pagenb == 1) {
518 $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
519 } else {
520 $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
521 }
522 $this->_pagefoot($pdf, $object, $outputlangs, 1);
523 $pagenb++;
524 $pdf->setPage($pagenb);
525 $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it.
526 if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
527 $this->_pagehead($pdf, $object, 0, $outputlangs);
528 }
529 if (!empty($tplidx)) {
530 $pdf->useTemplate($tplidx);
531 }
532 }
533 if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { // @phan-suppress-current-line PhanUndeclaredProperty
534 if ($pagenb == 1) {
535 $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
536 } else {
537 $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
538 }
539 $this->_pagefoot($pdf, $object, $outputlangs, 1);
540 // New page
541 $pdf->AddPage();
542 if (!empty($tplidx)) {
543 $pdf->useTemplate($tplidx);
544 }
545 $pagenb++;
546 if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
547 $this->_pagehead($pdf, $object, 0, $outputlangs);
548 }
549 }
550 }
551
552 // Show square
553 if ($pagenb == 1) {
554 $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
555 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
556 } else {
557 $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
558 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
559 }
560
561 // Affiche zone infos
562 $this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);
563
564 // Pied de page
565 $this->_pagefoot($pdf, $object, $outputlangs);
566
567 if (method_exists($pdf, 'AliasNbPages')) {
568 $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
569 }
570
571 $pdf->Close();
572
573 $pdf->Output($file, 'F');
574
575 // Add pdfgeneration hook
576 if (!is_object($hookmanager)) {
577 include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
578 $hookmanager = new HookManager($this->db);
579 }
580 $hookmanager->initHooks(array('pdfgeneration'));
581 $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
582 global $action;
583 $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
584 $this->warnings = $hookmanager->warnings;
585 if ($reshook < 0) {
586 $this->error = $hookmanager->error;
587 $this->errors = $hookmanager->errors;
588 dolChmod($file);
589 return -1;
590 }
591
592 dolChmod($file);
593
594 $this->result = array('fullpath' => $file);
595
596 return 1; // No error
597 } else {
598 $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
599 return 0;
600 }
601 }
602
603 $this->error = $langs->transnoentities("ErrorConstantNotDefined", "LIVRAISON_OUTPUTDIR");
604 return 0;
605 }
606
607 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
608 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
618 protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
619 {
620 // phpcs:enable
621 global $conf, $mysoc;
622 $default_font_size = pdf_getPDFFontSize($outputlangs);
623
624 $pdf->SetFont('', '', $default_font_size);
625 $pdf->SetXY($this->marge_gauche, $posy);
626
627 $larg_sign = ($this->page_largeur - $this->marge_gauche - $this->marge_droite) / 3;
628 $pdf->RoundedRect($this->marge_gauche, $posy + 1, $larg_sign, 25, $this->corner_radius, '1234', 'D');
629 $pdf->SetXY($this->marge_gauche + 2, $posy + 2);
630 $pdf->MultiCell($larg_sign, 2, $outputlangs->trans("For").' '.$outputlangs->convToOutputCharset($mysoc->name).":", '', 'L');
631
632 $pdf->RoundedRect(2 * $larg_sign + $this->marge_gauche, $posy + 1, $larg_sign, 25, $this->corner_radius, '1234', 'D');
633 $pdf->SetXY(2 * $larg_sign + $this->marge_gauche + 2, $posy + 2);
634 $pdf->MultiCell($larg_sign, 2, $outputlangs->trans("ForCustomer").':', '', 'L');
635 }
636
637
638 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
651 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
652 {
653 global $conf;
654
655 // Force to disable hidetop and hidebottom
656 $hidebottom = 0;
657 if ($hidetop) {
658 $hidetop = -1;
659 }
660
661 $default_font_size = pdf_getPDFFontSize($outputlangs);
662
663 // Amount in (at tab_top - 1)
664 $pdf->SetTextColor(0, 0, 0);
665 $pdf->SetFont('', '', $default_font_size - 2);
666
667 if (empty($hidetop)) {
668 //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
669 if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) {
670 $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
671 }
672 }
673
674 $pdf->SetDrawColor(128, 128, 128);
675 $pdf->SetFont('', '', $default_font_size - 1);
676
677 // Output Rect
678 $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'); // Rect takes a length in 3rd parameter and 4th parameter
679
680
681 $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
682
683 if (empty($hidetop)) {
684 $pdf->line($this->marge_gauche, $tab_top + $this->tabTitleHeight, $this->page_largeur - $this->marge_droite, $tab_top + $this->tabTitleHeight); // line takes a position y in 2nd parameter and 4th parameter
685 }
686 }
687
688 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
698 protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
699 {
700 global $conf;
701
702 $default_font_size = pdf_getPDFFontSize($outputlangs);
703
704 pdf_pagehead($pdf, $outputlangs, $this->page_hauteur);
705
706 // Show Draft Watermark
707 if ($object->statut == 0 && getDolGlobalString('COMMANDE_DRAFT_WATERMARK')) {
708 pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', getDolGlobalString('COMMANDE_DRAFT_WATERMARK'));
709 }
710
711 $pdf->SetTextColor(0, 0, 60);
712 $pdf->SetFont('', 'B', $default_font_size + 3);
713
714 $posy = $this->marge_haute;
715 $posx = $this->page_largeur - $this->marge_droite - 100;
716
717 $pdf->SetXY($this->marge_gauche, $posy);
718
719 // Logo
720 $logo = $conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
721 if ($this->emetteur->logo) {
722 if (is_readable($logo)) {
723 $height = pdf_getHeightForLogo($logo);
724 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
725 } else {
726 $pdf->SetTextColor(200, 0, 0);
727 $pdf->SetFont('', 'B', $default_font_size - 2);
728 $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
729 $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
730 }
731 } else {
732 $pdf->MultiCell(100, 4, $this->emetteur->name, 0, 'L');
733 }
734
735 $pdf->SetFont('', 'B', $default_font_size + 2);
736 $pdf->SetXY($posx, $posy);
737 $pdf->SetTextColor(0, 0, 60);
738 $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DeliveryOrder")." ".$outputlangs->convToOutputCharset($object->ref), '', 'R');
739
740 $pdf->SetFont('', '', $default_font_size + 2);
741
742 $posy += 5;
743 $pdf->SetXY($posx, $posy);
744 $pdf->SetTextColor(0, 0, 60);
745 if ($object->date_valid) {
746 $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date_delivery, "%d %b %Y", false, $outputlangs, true), '', 'R');
747 } else {
748 $pdf->SetTextColor(255, 0, 0);
749 $pdf->MultiCell(100, 4, $outputlangs->transnoentities("DeliveryNotValidated"), '', 'R');
750 $pdf->SetTextColor(0, 0, 60);
751 }
752
753 if ($object->thirdparty->code_client) {
754 $posy += 5;
755 $pdf->SetXY($posx, $posy);
756 $pdf->SetTextColor(0, 0, 60);
757 $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : ".$outputlangs->transnoentities((string) $object->thirdparty->code_client), '', 'R');
758 }
759
760 $pdf->SetTextColor(0, 0, 60);
761
762 $posy += 2;
763
764 // Show list of linked objects
765 $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
766
767 if ($showaddress) {
768 // Sender properties
769 $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object);
770
771 // Show sender
772 $posy = 42;
773 $posx = $this->marge_gauche;
774 if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) {
775 $posx = $this->page_largeur - $this->marge_droite - 80;
776 }
777 $hautcadre = 40;
778
779 // Show sender frame
780 $pdf->SetTextColor(0, 0, 0);
781 $pdf->SetFont('', '', $default_font_size - 2);
782 $pdf->SetXY($posx, $posy - 5);
783 $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, 'L');
784 $pdf->SetXY($posx, $posy);
785 $pdf->SetFillColor(230, 230, 230);
786 $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F');
787 $pdf->SetTextColor(0, 0, 60);
788
789 // Show sender name
790 $pdf->SetXY($posx + 2, $posy + 3);
791 $pdf->SetFont('', 'B', $default_font_size);
792 $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
793 $posy = $pdf->getY();
794
795 // Show sender information
796 $pdf->SetXY($posx + 2, $posy);
797 $pdf->SetFont('', '', $default_font_size - 1);
798 $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
799
800 // Client destinataire
801 $posy = 42;
802 $posx = 102;
803 if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) {
804 $posx = $this->marge_gauche;
805 }
806 $pdf->SetTextColor(0, 0, 0);
807 $pdf->SetFont('', '', $default_font_size - 2);
808 $pdf->SetXY($posx, $posy - 5);
809 $pdf->MultiCell(80, 5, $outputlangs->transnoentities("DeliveryAddress"), 0, 'L');
810
811 // If SHIPPING contact defined on order, we use it
812 $usecontact = false;
813 $arrayidcontact = $object->commande->getIdContact('external', 'SHIPPING');
814 if (count($arrayidcontact) > 0) {
815 $usecontact = true;
816 $result = $object->fetch_contact($arrayidcontact[0]);
817 }
818
819 // Recipient name
820 if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || getDolGlobalString('MAIN_USE_COMPANY_NAME_OF_CONTACT')))) {
821 $thirdparty = $object->contact;
822 } else {
823 $thirdparty = $object->thirdparty;
824 }
825
826 $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
827
828 $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object);
829
830 // Show recipient
831 $widthrecbox = 100;
832 if ($this->page_largeur < 210) {
833 $widthrecbox = 84; // To work with US executive format
834 }
835 $posy = 42;
836 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
837 if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) {
838 $posx = $this->marge_gauche;
839 }
840
841 // Show recipient frame
842 $pdf->SetTextColor(0, 0, 0);
843 $pdf->SetFont('', '', $default_font_size - 2);
844 $pdf->SetXY($posx + 2, $posy - 5);
845 //$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L');
846 $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D');
847
848 // Show recipient name
849 $pdf->SetXY($posx + 2, $posy + 3);
850 $pdf->SetFont('', 'B', $default_font_size);
851 $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
852
853 $posy = $pdf->getY();
854
855 // Show recipient information
856 $pdf->SetFont('', '', $default_font_size - 1);
857 $pdf->SetXY($posx + 2, $posy);
858 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
859 }
860
861 $pdf->SetTextColor(0, 0, 60);
862
863 return 0;
864 }
865
866 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
876 protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
877 {
878 $showdetails = getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
879 return pdf_pagefoot($pdf, $outputlangs, 'DELIVERY_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
880 }
881
882
883
894 public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
895 {
896 global $hookmanager;
897
898 // Default field style for content
899 $this->defaultContentsFieldsStyle = array(
900 'align' => 'R', // R,C,L
901 'padding' => array(0.5, 0.5, 0.5, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
902 );
903
904 // Default field style for content
905 $this->defaultTitlesFieldsStyle = array(
906 'align' => 'C', // R,C,L
907 'padding' => array(0.5, 0, 0.5, 0), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
908 );
909
910 /*
911 * For example
912 $this->cols['theColKey'] = array(
913 'rank' => $rank, // int : use for ordering columns
914 'width' => 20, // the column width in mm
915 'title' => array(
916 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label
917 'label' => ' ', // the final label : used fore final generated text
918 'align' => 'L', // text alignment : R,C,L
919 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
920 ),
921 'content' => array(
922 'align' => 'L', // text alignment : R,C,L
923 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
924 ),
925 );
926 */
927
928 $rank = 0; // do not use negative rank
929 $this->cols['desc'] = array(
930 'rank' => $rank,
931 'width' => false, // only for desc
932 'status' => true,
933 'title' => array(
934 'textkey' => 'Designation', // use lang key is useful in some case with module
935 'align' => 'L',
936 // 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label
937 // 'label' => ' ', // the final label
938 'padding' => array(0.5, 0.5, 0.5, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
939 ),
940 'content' => array(
941 'align' => 'L',
942 ),
943 );
944
945 $rank += 10;
946 $this->cols['photo'] = array(
947 'rank' => $rank,
948 'width' => getDolGlobalInt('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH', 20), // in mm
949 'status' => false,
950 'title' => array(
951 'textkey' => 'Photo',
952 'label' => ' '
953 ),
954 'content' => array(
955 'padding' => array(0, 0, 0, 0), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
956 ),
957 'border-left' => false, // remove left line separator
958 );
959
960 if (getDolGlobalString('MAIN_GENERATE_DELIVERY_WITH_PICTURE') && !empty($this->atleastonephoto)) {
961 $this->cols['photo']['status'] = true;
962 }
963
964
965 $rank += 10;
966 $this->cols['Comments'] = array(
967 'rank' => $rank,
968 'width' => 50, // in mm
969 'status' => true,
970 'title' => array(
971 'textkey' => 'Comments'
972 ),
973 'border-left' => true, // add left line separator
974 );
975
976 // $rank += 10;
977 // $this->cols['weight'] = array(
978 // 'rank' => $rank,
979 // 'width' => 30, // in mm
980 // 'status' => false,
981 // 'title' => array(
982 // 'textkey' => 'WeightVolShort'
983 // ),
984 // 'border-left' => true, // add left line separator
985 // );
986
987 $rank += 10;
988 $this->cols['qty_shipped'] = array(
989 'rank' => $rank,
990 'width' => 20, // in mm
991 'status' => !getDolGlobalString('DELIVERY_PDF_HIDE_SHIPPED'),
992 'title' => array(
993 'textkey' => 'QtyShippedShort'
994 ),
995 'border-left' => true, // add left line separator
996 );
997
998 $rank += 10;
999 $this->cols['qty_remaining'] = array(
1000 'rank' => $rank,
1001 'width' => 20, // in mm
1002 'status' => !getDolGlobalString('DELIVERY_PDF_HIDE_QTYTOSHIP'),
1003 'title' => array(
1004 'textkey' => 'KeepToShipShort'
1005 ),
1006 'border-left' => true, // add left line separator
1007 );
1008
1009
1010 // Add extrafields cols
1011 if (!empty($object->lines)) {
1012 $line = reset($object->lines);
1013 $this->defineColumnExtrafield($line, $outputlangs, $hidedetails);
1014 }
1015
1016 $parameters = array(
1017 'object' => $object,
1018 'outputlangs' => $outputlangs,
1019 'hidedetails' => $hidedetails,
1020 'hidedesc' => $hidedesc,
1021 'hideref' => $hideref
1022 );
1023
1024 $reshook = $hookmanager->executeHooks('defineColumnField', $parameters, $this); // Note that $object may have been modified by hook
1025 if ($reshook < 0) {
1026 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1027 } elseif (empty($reshook)) {
1028 // @phan-suppress-next-line PhanPluginSuspiciousParamOrderInternal
1029 $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys
1030 } else {
1031 $this->cols = $hookmanager->resArray;
1032 }
1033 }
1034}
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
Class to manage customers orders.
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.
getColumnContentXStart($colKey)
get column content X (abscissa) left position from column key
getColumnContentWidth($colKey)
get column content width from column key
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.
Class to manage hooks.
Class mere des modeles de bon de livraison.
Class to manage products or services.
Class to build Delivery Order documents with storm model.
defineColumnField($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Define Array Column Field.
_tableau_info(&$pdf, $object, $posy, $outputlangs)
Show miscellaneous information (payment mode, payment term, ...)
_tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
Show table for lines.
__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.
global $mysoc
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(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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...
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_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.
isModEnabled($module)
Is Dolibarr module enabled.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
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...
Definition pdf.lib.php:3160
pdf_watermark($pdf, $outputlangs, $h, $w, $unit, $text)
Add a draft watermark on PDF files.
Definition pdf.lib.php:1155
pdf_getFormat($outputlangs=null, $mode='setup')
Return array with format properties of default PDF format.
Definition pdf.lib.php:87
pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, $w, $h, $align, $default_font_size)
Show linked objects for PDF generation.
Definition pdf.lib.php:1808
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
Definition pdf.lib.php:294
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $w, $h, $posx, $posy, $hideref=0, $hidedesc=0, $issupplierline=0, $align='J')
Output line description into PDF.
Definition pdf.lib.php:1846
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
Definition pdf.lib.php:317
pdf_pagehead($pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
Definition pdf.lib.php:747
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.
Definition pdf.lib.php:1421
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
Definition pdf.lib.php:273
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.
Definition pdf.lib.php:438
pdf_getInstance($format='', $metric='mm', $pagetype='P')
Return a PDF instance object.
Definition pdf.lib.php:129
pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0)
Returns the name of the thirdparty.
Definition pdf.lib.php:393
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]]]',...
Definition repair.php:130
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:133