27 require_once DOL_DOCUMENT_ROOT.
'/core/modules/project/modules_project.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
37 require_once DOL_DOCUMENT_ROOT.
'/comm/propal/class/propal.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture-rec.class.php';
40 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
41 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
42 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
43 require_once DOL_DOCUMENT_ROOT.
'/contrat/class/contrat.class.php';
44 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
45 require_once DOL_DOCUMENT_ROOT.
'/compta/deplacement/class/deplacement.class.php';
46 require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
47 require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
61 private $orientation =
'';
76 global $conf, $langs, $mysoc;
79 $langs->loadLangs(array(
"main",
"projects",
"companies"));
82 $this->
name =
"beluga";
83 $this->
description = $langs->trans(
"DocumentModelBeluga");
88 $this->orientation =
'L';
89 if ($this->orientation ==
'L' || $this->orientation ==
'Landscape') {
90 $this->page_largeur = $formatarray[
'height'];
91 $this->page_hauteur = $formatarray[
'width'];
93 $this->page_largeur = $formatarray[
'width'];
94 $this->page_hauteur = $formatarray[
'height'];
96 $this->format = array($this->page_largeur, $this->page_hauteur);
97 $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
98 $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
99 $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
100 $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
102 $this->option_logo = 1;
103 $this->option_tva = 1;
104 $this->option_codeproduitservice = 1;
107 $this->emetteur = $mysoc;
108 if (!$this->emetteur->country_code) $this->emetteur->country_code = substr($langs->defaultlang, -2);
111 if ($this->orientation ==
'L' || $this->orientation ==
'Landscape') {
112 $this->posxref = $this->marge_gauche + 1;
113 $this->posxdate = $this->marge_gauche + 105;
114 $this->posxsociety = $this->marge_gauche + 126;
115 $this->posxamountht = $this->marge_gauche + 190;
116 $this->posxamountttc = $this->marge_gauche + 215;
117 $this->posxstatut = $this->marge_gauche + 245;
119 $this->posxref = $this->marge_gauche + 1;
120 $this->posxdate = $this->marge_gauche + 25;
121 $this->posxsociety = $this->marge_gauche + 46;
122 $this->posxamountht = $this->marge_gauche + 110;
123 $this->posxamountttc = $this->marge_gauche + 135;
124 $this->posxstatut = $this->marge_gauche + 165;
126 if ($this->page_largeur < 210)
128 $this->posxref -= 20;
129 $this->posxdate -= 20;
130 $this->posxsociete -= 20;
131 $this->posxamountht -= 20;
132 $this->posxamountttc -= 20;
133 $this->posstatut -= 20;
149 global $conf, $hookmanager, $langs, $user;
153 if (!is_object($outputlangs)) $outputlangs = $langs;
155 if (!empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output =
'ISO-8859-1';
158 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"projects"));
160 if ($conf->projet->dir_output)
165 $dir = $conf->projet->dir_output;
166 if (!preg_match(
'/specimen/i', $objectref)) $dir .=
"/".$objectref;
167 $file = $dir.
"/".$objectref.
".pdf";
169 if (!file_exists($dir))
173 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
178 if (file_exists($dir))
181 if (!is_object($hookmanager))
183 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
186 $hookmanager->initHooks(array(
'pdfgeneration'));
187 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
189 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters, $object, $action);
194 $pdf->SetAutoPageBreak(1, 0);
196 $heightforinfotot = 40;
197 $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5);
198 $heightforfooter = $this->marge_basse + 8;
199 if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS)) $heightforfooter += 6;
201 if (class_exists(
'TCPDF'))
203 $pdf->setPrintHeader(
false);
204 $pdf->setPrintFooter(
false);
208 if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
210 $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.
'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
211 $tplidx = $pdf->importPage(1);
215 $task =
new Task($this->
db);
216 $tasksarray = array();
217 $tasksarray = $task->getTasksArray(0, 0, $object->id);
220 if (!$object->id > 0) {
221 $tasksarray = array_slice($tasksarray, 0, min(5, count($tasksarray)));
224 $object->lines = $tasksarray;
225 $nblines = count($object->lines);
229 $pdf->SetDrawColor(128, 128, 128);
231 $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
232 $pdf->SetSubject($outputlangs->transnoentities(
"Project"));
233 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
234 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
235 $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref).
" ".$outputlangs->transnoentities(
"Project"));
236 if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(
false);
238 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
241 $pdf->AddPage($this->orientation);
242 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
244 $this->
_pagehead($pdf, $object, 1, $outputlangs);
245 $pdf->SetFont(
'',
'', $default_font_size - 1);
246 $pdf->MultiCell(0, 3,
'');
247 $pdf->SetTextColor(0, 0, 0);
250 $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 : 10);
252 $tab_height_newpage = 190;
255 $notetoshow = empty($object->note_public) ?
'' : $object->note_public;
265 $pdf->SetFont(
'',
'', $default_font_size - 1);
266 $pdf->writeHTMLCell(190, 3, $this->posxref - 1, $tab_top - 2,
dol_htmlentitiesbr($notetoshow), 0, 1);
267 $nexY = $pdf->GetY();
268 $height_note = $nexY - $tab_top;
271 $pdf->SetDrawColor(192, 192, 192);
272 $pdf->Rect($this->marge_gauche, $tab_top - 2, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2);
274 $tab_height = $tab_height - $height_note;
275 $tab_top = $nexY + 6;
280 $heightoftitleline = 10;
281 $iniY = $tab_top + $heightoftitleline + 1;
282 $curY = $tab_top + $heightoftitleline + 1;
283 $nexY = $tab_top + $heightoftitleline + 1;
285 $listofreferent = array(
288 'title'=>
"ListProposalsAssociatedProject",
291 'datefieldname'=>
'datep',
292 'test'=>$conf->propal->enabled && $user->rights->propale->lire,
295 'name'=>
"CustomersOrders",
296 'title'=>
"ListOrdersAssociatedProject",
299 'datefieldname'=>
'date_commande',
300 'test'=>$conf->commande->enabled && $user->rights->commande->lire,
303 'name'=>
"CustomersInvoices",
304 'title'=>
"ListInvoicesAssociatedProject",
308 'datefieldname'=>
'datef',
309 'test'=>$conf->facture->enabled && $user->rights->facture->lire,
311 'invoice_predefined'=>array(
312 'name'=>
"PredefinedInvoices",
313 'title'=>
"ListPredefinedInvoicesAssociatedProject",
314 'class'=>
'FactureRec',
315 'table'=>
'facture_rec',
316 'datefieldname'=>
'datec',
317 'test'=>$conf->facture->enabled && $user->rights->facture->lire,
319 'order_supplier'=>array(
320 'name'=>
"SuppliersOrders",
321 'title'=>
"ListSupplierOrdersAssociatedProject",
322 'class'=>
'CommandeFournisseur',
323 'table'=>
'commande_fournisseur',
324 'datefieldname'=>
'date_commande',
325 'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire,
327 'invoice_supplier'=>array(
328 'name'=>
"BillsSuppliers",
329 'title'=>
"ListSupplierInvoicesAssociatedProject",
330 'class'=>
'FactureFournisseur',
332 'table'=>
'facture_fourn',
333 'datefieldname'=>
'datef',
334 'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire,
338 'title'=>
"ListContractAssociatedProject",
341 'datefieldname'=>
'date_contrat',
342 'test'=>$conf->contrat->enabled && $user->rights->contrat->lire,
344 'intervention'=>array(
345 'name'=>
"Interventions",
346 'title'=>
"ListFichinterAssociatedProject",
347 'class'=>
'Fichinter',
348 'table'=>
'fichinter',
349 'datefieldname'=>
'date_valid',
351 'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire,
352 'lang'=>
'interventions'),
354 'name'=>
"TripsAndExpenses",
355 'title'=>
"ListExpenseReportsAssociatedProject",
356 'class'=>
'Deplacement',
357 'table'=>
'deplacement',
358 'datefieldname'=>
'dated',
361 'test'=>$conf->deplacement->enabled && $user->rights->deplacement->lire,
363 'expensereport'=>array(
364 'name'=>
"ExpensesReports",
365 'title'=>
"ListExpenseReportsAssociatedProject",
366 'class'=>
'ExpenseReport',
367 'table'=>
'expensereport',
368 'datefieldname'=>
'dated',
371 'test'=>$conf->expensereport->enabled && $user->rights->expensereport->lire,
375 'title'=>
"ListActionsAssociatedProject",
376 'class'=>
'ActionComm',
377 'table'=>
'actioncomm',
378 'datefieldname'=>
'datep',
380 'test'=>$conf->agenda->enabled && $user->rights->agenda->allactions->read,
384 $hookmanager->initHooks(array(
'completeListOfReferent'));
385 $hookmanager->executeHooks(
'completeListOfReferent', [
'listofreferent'=>$listofreferent], $object, $action);
386 if (!empty($hookmanager->resArray)) {
387 $listofreferent = array_merge($listofreferent, $hookmanager->resArray);
390 foreach ($listofreferent as $key => $value)
392 $title = $value[
'title'];
393 $classname = $value[
'class'];
394 $tablename = $value[
'table'];
395 $datefieldname = $value[
'datefieldname'];
396 $qualified = $value[
'test'];
397 $langstoload = $value[
'lang'];
398 $projectField = isset($value[
'project_field']) ? $value[
'project_field'] :
'fk_projet';
399 $langs->load($langstoload);
401 if (!$qualified)
continue;
404 $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, $projectField);
406 $num = count($elementarray);
409 $nexY = $pdf->GetY() + 5;
412 $pdf->SetFont(
'',
'', $default_font_size - 1);
413 $pdf->SetTextColor(0, 0, 0);
415 $pdf->SetXY($this->posxref, $curY);
416 $pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0,
'L');
418 $selectList = $formproject->select_element($tablename, $project->thirdparty->id,
'', -2, $projectField);
419 $nexY = $pdf->GetY() + 1;
421 $pdf->SetXY($this->posxref, $curY);
422 $pdf->MultiCell($this->posxdate - $this->posxref, 3, $outputlangs->transnoentities(
"Ref"), 1,
'L');
423 $pdf->SetXY($this->posxdate, $curY);
424 $pdf->MultiCell($this->posxsociety - $this->posxdate, 3, $outputlangs->transnoentities(
"Date"), 1,
'C');
425 $pdf->SetXY($this->posxsociety, $curY);
426 $titlethirdparty = $outputlangs->transnoentities(
"ThirdParty");
427 if ($classname ==
'ExpenseReport') $titlethirdparty = $langs->trans(
"User");
428 $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $titlethirdparty, 1,
'L');
429 if (empty($value[
'disableamount'])) {
430 $pdf->SetXY($this->posxamountht, $curY);
431 $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, $outputlangs->transnoentities(
"AmountHTShort"), 1,
'R');
432 $pdf->SetXY($this->posxamountttc, $curY);
433 $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, $outputlangs->transnoentities(
"AmountTTCShort"), 1,
'R');
435 $pdf->SetXY($this->posxamountht, $curY);
436 $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3,
"", 1,
'R');
438 $pdf->SetXY($this->posxstatut, $curY);
439 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities(
"Status"), 1,
'R');
441 if (is_array($elementarray) && count($elementarray) > 0)
443 $nexY = $pdf->GetY();
447 $num = count($elementarray);
450 for ($i = 0; $i < $num; $i++)
453 $pdf->SetFont(
'',
'', $default_font_size - 1);
454 $pdf->SetTextColor(0, 0, 0);
456 $pdf->setTopMargin($tab_top_newpage);
457 $pdf->setPageOrientation($this->orientation, 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
458 $pageposbefore = $pdf->getPage();
461 $idofelement = $elementarray[$i];
462 if ($classname ==
'ExpenseReport')
466 $expensereportline->fetch($idofelement);
467 $idofelement = $expensereportline->fk_expensereport;
470 $element =
new $classname($this->
db);
471 $element->fetch($idofelement);
472 $element->fetch_thirdparty();
475 $qualifiedfortotal =
true;
476 if ($key ==
'invoice') {
477 if ($element->close_code ==
'replaced')
478 $qualifiedfortotal =
false;
481 $showpricebeforepagebreak = 1;
483 $pdf->startTransaction();
485 $pdf->SetXY($this->posxref, $curY);
486 $pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1,
'L');
487 $pageposafter = $pdf->getPage();
488 if ($pageposafter > $pageposbefore)
490 $pdf->rollbackTransaction(
true);
491 $pageposafter = $pageposbefore;
493 $pdf->setPageOrientation($this->orientation, 1, $heightforfooter);
495 $pdf->SetXY($this->posxref, $curY);
496 $posybefore = $pdf->GetY();
497 $pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1,
'L');
498 $pageposafter = $pdf->getPage();
499 $posyafter = $pdf->GetY();
500 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)))
502 if ($i == ($num - 1))
504 $pdf->AddPage($this->orientation,
'',
true);
505 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
506 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->
_pagehead($pdf, $object, 0, $outputlangs);
507 $pdf->setPage($pageposafter + 1);
513 if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
514 $showpricebeforepagebreak = 1;
515 else $showpricebeforepagebreak = 0;
517 $forcedesconsamepage = 1;
518 if ($forcedesconsamepage)
520 $pdf->rollbackTransaction(
true);
521 $pageposafter = $pageposbefore;
522 $pdf->setPageOrientation($this->orientation, 1, $heightforfooter);
524 $pdf->AddPage($this->orientation,
'',
true);
525 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
526 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->
_pagehead($pdf, $object, 0, $outputlangs);
527 $pdf->setPage($pageposafter + 1);
528 $pdf->SetFont(
'',
'', $default_font_size - 1);
529 $pdf->MultiCell(0, 3,
'');
530 $pdf->SetTextColor(0, 0, 0);
532 $pdf->setPageOrientation($this->orientation, 1, $heightforfooter);
533 $curY = $tab_top_newpage + $heightoftitleline + 1;
536 $pdf->SetXY($this->posxref, $curY);
537 $posybefore = $pdf->GetY();
538 $pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1,
'L');
539 $pageposafter = $pdf->getPage();
540 $posyafter = $pdf->GetY();
546 $pdf->commitTransaction();
548 $posYAfterDescription = $pdf->GetY();
550 $nexY = $pdf->GetY();
551 $pageposafter = $pdf->getPage();
552 $pdf->setPage($pageposbefore);
553 $pdf->setTopMargin($this->marge_haute);
554 $pdf->setPageOrientation($this->orientation, 1, 0);
557 if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
559 $pdf->setPage($pageposafter); $curY = $tab_top_newpage + $heightoftitleline + 1;
562 $pdf->SetFont(
'',
'', $default_font_size - 1);
565 if ($tablename ==
'commande_fournisseur' || $tablename ==
'supplier_order')
566 $date = $element->date_commande;
568 $date = $element->date;
570 $date = $element->datep;
572 $date = $element->date_contrat;
574 $date = $element->datev;
577 $pdf->SetXY($this->posxdate, $curY);
578 $pdf->MultiCell($this->posxsociety - $this->posxdate, 3,
dol_print_date($date,
'day'), 1,
'C');
580 $pdf->SetXY($this->posxsociety, $curY);
581 if ($classname ==
'ExpenseReport')
583 $fuser =
new User($this->
db);
584 $fuser->fetch($element->fk_user_author);
585 $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $fuser->getFullName($outputlangs), 1,
'L');
587 $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, (is_object($element->thirdparty) ? $element->thirdparty->name :
''), 1,
'L');
591 if (empty($value[
'disableamount'])) {
592 $pdf->SetXY($this->posxamountht, $curY);
593 $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ?
price($element->total_ht) :
''), 1,
'R');
594 $pdf->SetXY($this->posxamountttc, $curY);
595 $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ?
price($element->total_ttc) :
''), 1,
'R');
597 $pdf->SetXY($this->posxamountht, $curY);
598 if ($key ==
'agenda')
600 $textforamount =
dol_trunc($element->label, 26);
601 $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, $textforamount, 1,
'L');
603 $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3,
"", 1,
'R');
610 $outputstatut = $element->getLibStatut(1, $element->getSommePaiement());
612 $outputstatut = $element->getLibStatut(1);
614 $pdf->SetXY($this->posxstatut, $curY);
615 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputstatut, 1,
'R',
false, 1,
'',
'',
true, 0,
true);
617 if ($qualifiedfortotal) {
618 $total_ht = $total_ht + $element->total_ht;
619 $total_ttc = $total_ttc + $element->total_ttc;
621 $nexY = $pdf->GetY();
625 if (empty($value[
'disableamount'])) {
627 $pdf->SetXY($this->posxref, $curY);
628 $pdf->MultiCell($this->posxamountttc - $this->posxref, 3,
"TOTAL", 1,
'L');
629 $pdf->SetXY($this->posxamountht, $curY);
630 $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ?
price($total_ht) :
''), 1,
'R');
631 $pdf->SetXY($this->posxamountttc, $curY);
632 $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ?
price($total_ttc) :
''), 1,
'R');
633 $pdf->SetXY($this->posxstatut, $curY);
634 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities(
"Nb").
" ".$num, 1,
'L');
636 $nexY = $pdf->GetY() + 5;
644 while ($pagenb < $pageposafter)
646 $pdf->setPage($pagenb);
647 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
649 $pdf->setPage($pagenb);
650 $pdf->setPageOrientation($this->orientation, 1, 0);
651 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->
_pagehead($pdf, $object, 0, $outputlangs);
656 $this->
_pagefoot($pdf, $object, $outputlangs);
657 if (method_exists($pdf,
'AliasNbPages')) $pdf->AliasNbPages();
661 $pdf->Output($file,
'F');
664 $hookmanager->initHooks(array(
'pdfgeneration'));
665 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
667 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
670 $this->error = $hookmanager->error;
671 $this->errors = $hookmanager->errors;
674 if (!empty($conf->global->MAIN_UMASK))
675 @chmod($file, octdec($conf->global->MAIN_UMASK));
677 $this->result = array(
'fullpath'=>$file);
681 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
685 $this->error = $langs->transnoentities(
"ErrorConstantNotDefined",
"PROJECT_OUTPUTDIR");
703 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
705 global $conf, $mysoc;
707 $heightoftitleline = 10;
711 $pdf->SetDrawColor(128, 128, 128);
714 $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height);
717 $pdf->line($this->marge_gauche, $tab_top + $heightoftitleline, $this->page_largeur - $this->marge_droite, $tab_top + $heightoftitleline);
719 $pdf->SetTextColor(0, 0, 0);
720 $pdf->SetFont(
'',
'', $default_font_size);
722 $pdf->SetXY($this->posxref, $tab_top + 1);
723 $pdf->MultiCell($this->posxlabel - $this->posxref, 3, $outputlangs->transnoentities(
"Tasks"),
'',
'L');
725 $pdf->SetXY($this->posxlabel, $tab_top + 1);
726 $pdf->MultiCell($this->posxworkload - $this->posxlabel, 3, $outputlangs->transnoentities(
"Description"), 0,
'L');
728 $pdf->SetXY($this->posxworkload, $tab_top + 1);
729 $pdf->MultiCell($this->posxprogress - $this->posxworkload, 3, $outputlangs->transnoentities(
"PlannedWorkloadShort"), 0,
'R');
731 $pdf->SetXY($this->posxprogress, $tab_top + 1);
732 $pdf->MultiCell($this->posxdatestart - $this->posxprogress, 3,
'%', 0,
'R');
734 $pdf->SetXY($this->posxdatestart, $tab_top + 1);
735 $pdf->MultiCell($this->posxdateend - $this->posxdatestart, 3,
'', 0,
'C');
737 $pdf->SetXY($this->posxdateend, $tab_top + 1);
738 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxdatestart, 3,
'', 0,
'C');
751 protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
753 global $langs, $conf, $mysoc;
759 $pdf->SetTextColor(0, 0, 60);
760 $pdf->SetFont(
'',
'B', $default_font_size + 3);
762 $posx = $this->page_largeur - $this->marge_droite - 100;
763 $posy = $this->marge_haute;
765 $pdf->SetXY($this->marge_gauche, $posy);
768 $logo = $conf->mycompany->dir_output.
'/logos/'.$mysoc->logo;
771 if (is_readable($logo))
774 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
776 $pdf->SetTextColor(200, 0, 0);
777 $pdf->SetFont(
'',
'B', $default_font_size - 2);
778 $pdf->MultiCell(100, 3, $langs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
779 $pdf->MultiCell(100, 3, $langs->transnoentities(
"ErrorGoToModuleSetup"), 0,
'L');
781 }
else $pdf->MultiCell(100, 4, $outputlangs->transnoentities($this->emetteur->name), 0,
'L');
783 $pdf->SetFont(
'',
'B', $default_font_size + 3);
784 $pdf->SetXY($posx, $posy);
785 $pdf->SetTextColor(0, 0, 60);
786 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"Project").
" ".$outputlangs->convToOutputCharset($object->ref),
'',
'R');
787 $pdf->SetFont(
'',
'', $default_font_size + 2);
790 $pdf->SetXY($posx, $posy);
791 $pdf->SetTextColor(0, 0, 60);
792 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"DateStart").
" : ".
dol_print_date($object->date_start,
'day',
false, $outputlangs,
true),
'',
'R');
795 $pdf->SetXY($posx, $posy);
796 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"DateEnd").
" : ".
dol_print_date($object->date_end,
'day',
false, $outputlangs,
true),
'',
'R');
798 if (is_object($object->thirdparty))
801 $pdf->SetXY($posx, $posy);
802 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"ThirdParty").
" : ".$object->thirdparty->getFullName($outputlangs),
'',
'R');
805 $pdf->SetTextColor(0, 0, 60);
818 protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
821 $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
822 return pdf_pagefoot($pdf, $outputlangs,
'PROJECT_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
pdf_getFormat(Translate $outputlangs=null, $mode= 'setup')
Return array with format properties of default PDF format.
pdf_pagehead(&$pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
Class of expense report details lines.
</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.
Class to manage generation of project document Beluga.
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
Class to manage Dolibarr users.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom= 'UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.
price($amount, $form=0, $outlangs= '', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code= '')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
_pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
Show footer of page.
Parent class for projects models.
pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails=0, $hidefreetext=0)
Show footer of page for PDF generation.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
convertBackOfficeMediasLinksToPublicLinks($notetoshow)
Convert links to local wrapper to medias files into a string into a public external URL readable on i...
Superclass for invoices classes.
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0)
Return array of possible substitutions for PDF content (without external module substitutions).
__construct($db)
Constructor.
pdf_getInstance($format= '', $metric= 'mm', $pagetype= 'P')
Return a PDF instance object.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
_pagehead(&$pdf, $object, $showaddress, $outputlangs)
Show top header of page.
dol_trunc($string, $size=40, $trunc= 'right', $stringencoding= 'UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '...' if string larger than length.
make_substitutions($text, $substitutionarray, $outputlangs=null)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
write_file($object, $outputlangs)
Fonction generant le projet sur le disque.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
_tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
Show table for lines.
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the "subst...