dolibarr 22.0.5
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", "deliveries"));
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->getFullName($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 if ($reshook < 0) {
585 $this->error = $hookmanager->error;
586 $this->errors = $hookmanager->errors;
587 }
588
589 dolChmod($file);
590
591 $this->result = array('fullpath' => $file);
592
593 return 1; // No error
594 } else {
595 $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
596 return 0;
597 }
598 }
599
600 $this->error = $langs->transnoentities("ErrorConstantNotDefined", "LIVRAISON_OUTPUTDIR");
601 return 0;
602 }
603
604 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
605 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
615 protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
616 {
617 // phpcs:enable
618 global $conf, $mysoc;
619 $default_font_size = pdf_getPDFFontSize($outputlangs);
620
621 $pdf->SetFont('', '', $default_font_size);
622 $pdf->SetXY($this->marge_gauche, $posy);
623
624 $larg_sign = ($this->page_largeur - $this->marge_gauche - $this->marge_droite) / 3;
625 $pdf->RoundedRect($this->marge_gauche, $posy + 1, $larg_sign, 25, $this->corner_radius, '1234', 'D');
626 $pdf->SetXY($this->marge_gauche + 2, $posy + 2);
627 $pdf->MultiCell($larg_sign, 2, $outputlangs->trans("For").' '.$outputlangs->convToOutputCharset($mysoc->name).":", '', 'L');
628
629 $pdf->RoundedRect(2 * $larg_sign + $this->marge_gauche, $posy + 1, $larg_sign, 25, $this->corner_radius, '1234', 'D');
630 $pdf->SetXY(2 * $larg_sign + $this->marge_gauche + 2, $posy + 2);
631 $pdf->MultiCell($larg_sign, 2, $outputlangs->trans("ForCustomer").':', '', 'L');
632 }
633
634
635 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
648 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
649 {
650 global $conf;
651
652 // Force to disable hidetop and hidebottom
653 $hidebottom = 0;
654 if ($hidetop) {
655 $hidetop = -1;
656 }
657
658 $default_font_size = pdf_getPDFFontSize($outputlangs);
659
660 // Amount in (at tab_top - 1)
661 $pdf->SetTextColor(0, 0, 0);
662 $pdf->SetFont('', '', $default_font_size - 2);
663
664 if (empty($hidetop)) {
665 //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
666 if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) {
667 $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')));
668 }
669 }
670
671 $pdf->SetDrawColor(128, 128, 128);
672 $pdf->SetFont('', '', $default_font_size - 1);
673
674 // Output Rect
675 $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
676
677
678 $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
679
680 if (empty($hidetop)) {
681 $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
682 }
683 }
684
685 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
695 protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
696 {
697 global $conf;
698
699 $default_font_size = pdf_getPDFFontSize($outputlangs);
700
701 pdf_pagehead($pdf, $outputlangs, $this->page_hauteur);
702
703 // Show Draft Watermark
704 if ($object->statut == 0 && getDolGlobalString('COMMANDE_DRAFT_WATERMARK')) {
705 pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', getDolGlobalString('COMMANDE_DRAFT_WATERMARK'));
706 }
707
708 $pdf->SetTextColor(0, 0, 60);
709 $pdf->SetFont('', 'B', $default_font_size + 3);
710
711 $posy = $this->marge_haute;
712 $posx = $this->page_largeur - $this->marge_droite - 100;
713
714 $pdf->SetXY($this->marge_gauche, $posy);
715
716 // Logo
717 $logo = $conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
718 if ($this->emetteur->logo) {
719 if (is_readable($logo)) {
720 $height = pdf_getHeightForLogo($logo);
721 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
722 } else {
723 $pdf->SetTextColor(200, 0, 0);
724 $pdf->SetFont('', 'B', $default_font_size - 2);
725 $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
726 $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
727 }
728 } else {
729 $pdf->MultiCell(100, 4, $this->emetteur->name, 0, 'L');
730 }
731
732 $pdf->SetFont('', 'B', $default_font_size + 2);
733 $pdf->SetXY($posx, $posy);
734 $pdf->SetTextColor(0, 0, 60);
735 $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DeliveryOrder")." ".$outputlangs->convToOutputCharset($object->ref), '', 'R');
736
737 $pdf->SetFont('', '', $default_font_size + 2);
738
739 $posy += 5;
740 $pdf->SetXY($posx, $posy);
741 $pdf->SetTextColor(0, 0, 60);
742 if ($object->date_valid) {
743 $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date_delivery, "%d %b %Y", false, $outputlangs, true), '', 'R');
744 } else {
745 $pdf->SetTextColor(255, 0, 0);
746 $pdf->MultiCell(100, 4, $outputlangs->transnoentities("DeliveryNotValidated"), '', 'R');
747 $pdf->SetTextColor(0, 0, 60);
748 }
749
750 if ($object->thirdparty->code_client) {
751 $posy += 5;
752 $pdf->SetXY($posx, $posy);
753 $pdf->SetTextColor(0, 0, 60);
754 $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : ".$outputlangs->transnoentities($object->thirdparty->code_client), '', 'R');
755 }
756
757 $pdf->SetTextColor(0, 0, 60);
758
759 $posy += 2;
760
761 // Show list of linked objects
762 $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
763
764 if ($showaddress) {
765 // Sender properties
766 $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object);
767
768 // Show sender
769 $posy = 42;
770 $posx = $this->marge_gauche;
771 if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) {
772 $posx = $this->page_largeur - $this->marge_droite - 80;
773 }
774 $hautcadre = 40;
775
776 // Show sender frame
777 $pdf->SetTextColor(0, 0, 0);
778 $pdf->SetFont('', '', $default_font_size - 2);
779 $pdf->SetXY($posx, $posy - 5);
780 $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, 'L');
781 $pdf->SetXY($posx, $posy);
782 $pdf->SetFillColor(230, 230, 230);
783 $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F');
784 $pdf->SetTextColor(0, 0, 60);
785
786 // Show sender name
787 $pdf->SetXY($posx + 2, $posy + 3);
788 $pdf->SetFont('', 'B', $default_font_size);
789 $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
790 $posy = $pdf->getY();
791
792 // Show sender information
793 $pdf->SetXY($posx + 2, $posy);
794 $pdf->SetFont('', '', $default_font_size - 1);
795 $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
796
797 // Client destinataire
798 $posy = 42;
799 $posx = 102;
800 if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) {
801 $posx = $this->marge_gauche;
802 }
803 $pdf->SetTextColor(0, 0, 0);
804 $pdf->SetFont('', '', $default_font_size - 2);
805 $pdf->SetXY($posx, $posy - 5);
806 $pdf->MultiCell(80, 5, $outputlangs->transnoentities("DeliveryAddress"), 0, 'L');
807
808 // If SHIPPING contact defined on order, we use it
809 $usecontact = false;
810 $arrayidcontact = $object->commande->getIdContact('external', 'SHIPPING');
811 if (count($arrayidcontact) > 0) {
812 $usecontact = true;
813 $result = $object->fetch_contact($arrayidcontact[0]);
814 }
815
816 // Recipient name
817 if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || getDolGlobalString('MAIN_USE_COMPANY_NAME_OF_CONTACT')))) {
818 $thirdparty = $object->contact;
819 } else {
820 $thirdparty = $object->thirdparty;
821 }
822
823 $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
824
825 $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object);
826
827 // Show recipient
828 $widthrecbox = 100;
829 if ($this->page_largeur < 210) {
830 $widthrecbox = 84; // To work with US executive format
831 }
832 $posy = 42;
833 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
834 if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) {
835 $posx = $this->marge_gauche;
836 }
837
838 // Show recipient frame
839 $pdf->SetTextColor(0, 0, 0);
840 $pdf->SetFont('', '', $default_font_size - 2);
841 $pdf->SetXY($posx + 2, $posy - 5);
842 //$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L');
843 $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D');
844
845 // Show recipient name
846 $pdf->SetXY($posx + 2, $posy + 3);
847 $pdf->SetFont('', 'B', $default_font_size);
848 $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
849
850 $posy = $pdf->getY();
851
852 // Show recipient information
853 $pdf->SetFont('', '', $default_font_size - 1);
854 $pdf->SetXY($posx + 2, $posy);
855 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
856 }
857
858 $pdf->SetTextColor(0, 0, 60);
859
860 return 0;
861 }
862
863 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
873 protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
874 {
875 $showdetails = getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
876 return pdf_pagefoot($pdf, $outputlangs, 'DELIVERY_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
877 }
878
879
880
891 public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
892 {
893 global $hookmanager;
894
895 // Default field style for content
896 $this->defaultContentsFieldsStyle = array(
897 'align' => 'R', // R,C,L
898 'padding' => array(0.5, 0.5, 0.5, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
899 );
900
901 // Default field style for content
902 $this->defaultTitlesFieldsStyle = array(
903 'align' => 'C', // R,C,L
904 'padding' => array(0.5, 0, 0.5, 0), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
905 );
906
907 /*
908 * For example
909 $this->cols['theColKey'] = array(
910 'rank' => $rank, // int : use for ordering columns
911 'width' => 20, // the column width in mm
912 'title' => array(
913 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label
914 'label' => ' ', // the final label : used fore final generated text
915 'align' => 'L', // text alignment : R,C,L
916 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
917 ),
918 'content' => array(
919 'align' => 'L', // text alignment : R,C,L
920 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
921 ),
922 );
923 */
924
925 $rank = 0; // do not use negative rank
926 $this->cols['desc'] = array(
927 'rank' => $rank,
928 'width' => false, // only for desc
929 'status' => true,
930 'title' => array(
931 'textkey' => 'Designation', // use lang key is useful in somme case with module
932 'align' => 'L',
933 // 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label
934 // 'label' => ' ', // the final label
935 'padding' => array(0.5, 0.5, 0.5, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
936 ),
937 'content' => array(
938 'align' => 'L',
939 ),
940 );
941
942 $rank += 10;
943 $this->cols['photo'] = array(
944 'rank' => $rank,
945 'width' => getDolGlobalInt('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH', 20), // in mm
946 'status' => false,
947 'title' => array(
948 'textkey' => 'Photo',
949 'label' => ' '
950 ),
951 'content' => array(
952 'padding' => array(0, 0, 0, 0), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
953 ),
954 'border-left' => false, // remove left line separator
955 );
956
957 if (getDolGlobalString('MAIN_GENERATE_DELIVERY_WITH_PICTURE') && !empty($this->atleastonephoto)) {
958 $this->cols['photo']['status'] = true;
959 }
960
961
962 $rank += 10;
963 $this->cols['Comments'] = array(
964 'rank' => $rank,
965 'width' => 50, // in mm
966 'status' => true,
967 'title' => array(
968 'textkey' => 'Comments'
969 ),
970 'border-left' => true, // add left line separator
971 );
972
973 // $rank += 10;
974 // $this->cols['weight'] = array(
975 // 'rank' => $rank,
976 // 'width' => 30, // in mm
977 // 'status' => false,
978 // 'title' => array(
979 // 'textkey' => 'WeightVolShort'
980 // ),
981 // 'border-left' => true, // add left line separator
982 // );
983
984 $rank += 10;
985 $this->cols['qty_shipped'] = array(
986 'rank' => $rank,
987 'width' => 20, // in mm
988 'status' => !getDolGlobalString('DELIVERY_PDF_HIDE_SHIPPED'),
989 'title' => array(
990 'textkey' => 'QtyShippedShort'
991 ),
992 'border-left' => true, // add left line separator
993 );
994
995 $rank += 10;
996 $this->cols['qty_remaining'] = array(
997 'rank' => $rank,
998 'width' => 20, // in mm
999 'status' => !getDolGlobalString('DELIVERY_PDF_HIDE_QTYTOSHIP'),
1000 'title' => array(
1001 'textkey' => 'KeepToShipShort'
1002 ),
1003 'border-left' => true, // add left line separator
1004 );
1005
1006
1007 // Add extrafields cols
1008 if (!empty($object->lines)) {
1009 $line = reset($object->lines);
1010 $this->defineColumnExtrafield($line, $outputlangs, $hidedetails);
1011 }
1012
1013 $parameters = array(
1014 'object' => $object,
1015 'outputlangs' => $outputlangs,
1016 'hidedetails' => $hidedetails,
1017 'hidedesc' => $hidedesc,
1018 'hideref' => $hideref
1019 );
1020
1021 $reshook = $hookmanager->executeHooks('defineColumnField', $parameters, $this); // Note that $object may have been modified by hook
1022 if ($reshook < 0) {
1023 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1024 } elseif (empty($reshook)) {
1025 // @phan-suppress-next-line PhanPluginSuspiciousParamOrderInternal
1026 $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys
1027 } else {
1028 $this->cols = $hookmanager->resArray;
1029 }
1030 }
1031}
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:67
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.
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.
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.
dolChmod($filepath, $newmask='')
Change mod of a file.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
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_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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)
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
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:2731
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:1463
pdf_getFormat($outputlangs=null, $mode='setup')
Return array with format properties of default PDF format.
Definition pdf.lib.php:87
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
Definition pdf.lib.php:289
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
Definition pdf.lib.php:314
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:1047
pdf_pagehead(&$pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
Definition pdf.lib.php:742
pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w, $h, $align, $default_font_size)
Show linked objects for PDF generation.
Definition pdf.lib.php:1425
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
Definition pdf.lib.php:266
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:439
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:391
pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
Add a draft watermark on PDF files.
Definition pdf.lib.php:798
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition repair.php:158
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:161