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