dolibarr 25.0.0-alpha
pdf_standard_donation.modules.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2026 Philippe Grand <philippe.grand@atoo-net.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
23require_once DOL_DOCUMENT_ROOT.'/core/modules/dons/modules_don.php';
24require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
25require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
26require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
27require_once DOL_DOCUMENT_ROOT.'/core/lib/functionsnumtoword.lib.php';
28
29
35{
40 public $version = 'dolibarr';
41
45 public $heightforfooter;
46
50 public $position = 50;
51
52
58 public function __construct($db)
59 {
60 global $langs, $mysoc;
61
62 $langs->loadLangs(array("main", "donations"));
63
64 $this->db = $db;
65 $this->name = "Standard";
66 $this->description = $langs->trans('DonationsReceiptModel').' - '.$langs->trans('DocumentModelStandardPDF');
67
68 $this->type = 'pdf';
69 $formatarray = pdf_getFormat();
70 $this->page_largeur = $formatarray['width'];
71 $this->page_hauteur = $formatarray['height'];
72 $this->format = array($this->page_largeur, $this->page_hauteur);
73 $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
74 $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
75 $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
76 $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
77 $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0);
78 $this->option_logo = 1; // Display logo
79 $this->option_multilang = 1; // Available in several languages
80
81 if ($mysoc === null) {
82 dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR);
83 return;
84 }
85
86 $this->emetteur = $mysoc;
87 if (!$this->emetteur->country_code) {
88 $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
89 }
90 }
91
92
98 public function isEnabled()
99 {
100 return true;
101 }
102
103
104 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
113 public function write_file($don, $outputlangs, $currency = '')
114 {
115 // phpcs:enable
116 global $user, $conf, $langs, $hookmanager;
117
118 if (!is_object($outputlangs)) {
119 $outputlangs = $langs;
120 }
121 // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
122 if (getDolGlobalString('MAIN_USE_FPDF')) {
123 $outputlangs->charset_output = 'ISO-8859-1';
124 }
125
126 $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "donations"));
127
128 $currency = !empty($currency) ? $currency : $conf->currency;
129
130 if (empty($conf->don->dir_output)) {
131 $this->error = $langs->transnoentities("ErrorConstantNotDefined", "DON_OUTPUTDIR");
132 return 0;
133 }
134
135 if (!is_object($don)) {
136 $id = $don;
137 $don = new Don($this->db);
138 $don->fetch($id);
139 }
140
141 // Definition of $dir and $file
142 if (!empty($don->specimen)) {
143 $dir = $conf->don->dir_output;
144 $file = $dir."/SPECIMEN.pdf";
145 } else {
146 $donref = dol_sanitizeFileName((string) $don->ref);
147 $dir = $conf->don->dir_output."/".$donref;
148 $file = $dir."/".$donref.".pdf";
149 }
150
151 if (!file_exists($dir)) {
152 if (dol_mkdir($dir) < 0) {
153 $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
154 return 0;
155 }
156 }
157
158 // Add pdfgeneration hook
159 if (!is_object($hookmanager)) {
160 include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
161 $hookmanager = new HookManager($this->db);
162 }
163 $hookmanager->initHooks(array('pdfgeneration'));
164 $parameters = array('file' => $file, 'object' => $don, 'outputlangs' => $outputlangs);
165 global $action;
166 $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $don, $action); // Note that $action and $object may have been modified by some hooks
167
168 $pdf = pdf_getInstance($this->format);
169 $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
170 $this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin)
171 $pdf->setAutoPageBreak(true, $this->heightforfooter);
172
173 if (class_exists('TCPDF')) {
174 $pdf->setPrintHeader(false);
175 $pdf->setPrintFooter(false);
176 }
177 $pdf->SetFont(pdf_getPDFFont($outputlangs));
178 // Set path to the background PDF File
179 $tplidx = null;
180 if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) {
181 $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
182 $tplidx = $pdf->importPage(1);
183 }
184
185 $pdf->Open();
186 $pdf->SetDrawColor(128, 128, 128);
187
188 $pdf->SetTitle($outputlangs->convToOutputCharset($outputlangs->transnoentities("DonationReceipt")." ".$don->ref));
189 $pdf->SetSubject($outputlangs->transnoentities("DonationReceipt"));
190 $pdf->SetCreator("Dolibarr ".DOL_VERSION);
191 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
192 $pdf->SetKeyWords($outputlangs->convToOutputCharset($don->ref)." ".$outputlangs->transnoentities("DonationReceipt"));
193 if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) {
194 $pdf->SetCompression(false);
195 }
196
197 // @phan-suppress-next-line PhanPluginSuspiciousParamOrder
198 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
199
200 $pdf->AddPage();
201 if (!empty($tplidx)) {
202 $pdf->useTemplate($tplidx);
203 }
204
205 $donor = $this->getDonorInfos($don, $outputlangs);
206
207 $posy = $this->_pagehead($pdf, $don, $donor, $outputlangs);
208
209 $posy = $this->tableauDon($pdf, $don, $posy + 8, $outputlangs, $currency);
210
211 // Public note
212 $notetoshow = empty($don->note_public) ? '' : (string) $don->note_public;
213 if ($notetoshow) {
214 $substitutionarray = pdf_getSubstitutionArray($outputlangs, null, $don);
215 complete_substitutions_array($substitutionarray, $outputlangs, $don);
216 $notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
217 $notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow);
218
219 $pdf->SetFont('', '', $default_font_size - 1);
220 $pdf->writeHTMLCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $this->marge_gauche, $posy + 6, dol_htmlentitiesbr($notetoshow), 0, 1);
221 $posy = $pdf->GetY();
222 }
223
224 $this->signatureArea($pdf, $don, $posy + 10, $outputlangs);
225
226 // Pagefoot on each page (a long public note may need several pages)
227 $nbpages = $pdf->getNumPages();
228 for ($i = 1; $i <= $nbpages; $i++) {
229 $pdf->setPage($i);
230 $pdf->setAutoPageBreak(false, 0); // After setPage() that restores it: the footer is written inside the bottom margin, it must not add a page
231 $this->_pagefoot($pdf, $don, $outputlangs);
232 }
233 if (method_exists($pdf, 'AliasNbPages')) {
234 $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
235 }
236
237 $pdf->Close();
238
239 $pdf->Output($file, 'F');
240
241 // Add pdfgeneration hook
242 $hookmanager->initHooks(array('pdfgeneration'));
243 $parameters = array('file' => $file, 'object' => $don, 'outputlangs' => $outputlangs);
244 global $action;
245 $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
246 $this->warnings = $hookmanager->warnings;
247 if ($reshook < 0) {
248 $this->error = $hookmanager->error;
249 $this->errors = $hookmanager->errors;
250 dolChmod($file);
251 return -1;
252 }
253
254 dolChmod($file);
255
256 $this->result = array('fullpath' => $file);
257
258 return 1;
259 }
260
261
272 protected function tableauDon(&$pdf, $don, $posy, $outputlangs, $currency)
273 {
274 $default_font_size = pdf_getPDFFontSize($outputlangs);
275 $width = $this->page_largeur - $this->marge_gauche - $this->marge_droite;
276 $widthlabel = 60;
277
278 $pdf->SetTextColor(0, 0, 0);
279 $pdf->SetFont('', '', $default_font_size);
280 $pdf->SetXY($this->marge_gauche, $posy);
281 $pdf->MultiCell($width, 4, $outputlangs->transnoentities("DonationReceivedAmount"), 0, 'L');
282 $posy = $pdf->GetY() + 4;
283
284 // Amount, framed
285 $amount = (float) price2num($don->amount, 'MT');
286 $pdf->SetFillColor(230, 230, 230);
287 $pdf->RoundedRect($this->marge_gauche, $posy, $width, 16, $this->corner_radius, '1234', 'F');
288 $pdf->SetFont('', 'B', $default_font_size + 4);
289 $pdf->SetXY($this->marge_gauche + 2, $posy + 2);
290 $pdf->MultiCell($width - 4, 6, price($amount, 0, $outputlangs, 1, -1, 'MT', $currency), 0, 'C');
291 $amountinletters = dol_convertToWord($amount, $outputlangs, $currency, true);
292 if ($amountinletters) {
293 $pdf->SetFont('', 'I', $default_font_size - 1);
294 $pdf->SetXY($this->marge_gauche + 2, $posy + 9);
295 $pdf->MultiCell($width - 4, 4, $outputlangs->convToOutputCharset($amountinletters), 0, 'C');
296 }
297 $posy += 22;
298
299 // Details
300 $details = array();
301 $details[] = array($outputlangs->transnoentities("DonationDate"), dol_print_date($don->date, 'day', false, $outputlangs, true));
302 if (!empty($don->mode_reglement_code)) {
303 $details[] = array($outputlangs->transnoentities("PaymentMode"), $outputlangs->transnoentitiesnoconv("PaymentType".$don->mode_reglement_code) != "PaymentType".$don->mode_reglement_code ? $outputlangs->transnoentitiesnoconv("PaymentType".$don->mode_reglement_code) : (string) $don->mode_reglement);
304 }
305 if (isModEnabled('project') && !empty($don->fk_project) && $don->fetchProject() > 0 && is_object($don->project)) {
306 $outputlangs->load("projects");
307 $details[] = array($outputlangs->transnoentities("Project"), $don->project->ref.(empty($don->project->title) ? '' : ' - '.$don->project->title));
308 }
309
310 $pdf->SetFont('', '', $default_font_size - 1);
311 foreach ($details as $detail) {
312 $pdf->SetXY($this->marge_gauche, $posy);
313 $pdf->MultiCell($widthlabel, 5, $detail[0], 0, 'L');
314 $pdf->SetXY($this->marge_gauche + $widthlabel, $posy);
315 $pdf->MultiCell($width - $widthlabel, 5, $outputlangs->convToOutputCharset($detail[1]), 0, 'L');
316 $posy = max($posy + 5, $pdf->GetY());
317 }
318
319 return $posy;
320 }
321
322
332 protected function signatureArea(&$pdf, $don, $posy, $outputlangs)
333 {
334 $default_font_size = pdf_getPDFFontSize($outputlangs);
335 $widthbox = 80;
336 $heightbox = 30;
337
338 // Do not cut the signature area between two pages
339 if ($posy + 10 + $heightbox > $this->page_hauteur - $this->heightforfooter) {
340 $pdf->AddPage();
341 $posy = $this->marge_haute;
342 }
343
344 $posx = $this->page_largeur - $this->marge_droite - $widthbox;
345 $place = (string) $this->emetteur->town;
346 $text = ($place ? $place.', ' : '').dol_print_date(dol_now(), 'day', false, $outputlangs, true);
347
348 $pdf->SetTextColor(0, 0, 0);
349 $pdf->SetFont('', '', $default_font_size - 1);
350 $pdf->SetXY($posx, $posy);
351 $pdf->MultiCell($widthbox, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
352 $pdf->SetXY($posx, $posy + 5);
353 $pdf->MultiCell($widthbox, 4, $outputlangs->transnoentities("Signature"), 0, 'L');
354 $pdf->RoundedRect($posx, $posy + 10, $widthbox, $heightbox, $this->corner_radius, '1234', 'D');
355
356 return $posy + 10 + $heightbox;
357 }
358
359
360 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
370 protected function _pagehead(&$pdf, $don, $donor, $outputlangs)
371 {
372 // phpcs:enable
373 global $conf;
374
375 $default_font_size = pdf_getPDFFontSize($outputlangs);
376
377 pdf_pagehead($pdf, $outputlangs, $this->page_hauteur);
378
379 $pdf->SetTextColor(0, 0, 60);
380 $pdf->SetFont('', 'B', $default_font_size + 3);
381
382 $w = 100;
383 $posy = $this->marge_haute;
384 $posx = $this->page_largeur - $this->marge_droite - $w;
385
386 $pdf->SetXY($this->marge_gauche, $posy);
387
388 // Logo
389 if ($this->emetteur->logo) {
390 $logodir = $conf->mycompany->dir_output;
391 if (!empty($conf->mycompany->multidir_output[$don->entity ?? $conf->entity])) {
392 $logodir = $conf->mycompany->multidir_output[$don->entity ?? $conf->entity];
393 }
394 if (!getDolGlobalInt('MAIN_PDF_USE_LARGE_LOGO')) {
395 $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
396 } else {
397 $logo = $logodir.'/logos/'.$this->emetteur->logo;
398 }
399 if (is_readable($logo)) {
400 $height = pdf_getHeightForLogo($logo);
401 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
402 } else {
403 $pdf->SetTextColor(200, 0, 0);
404 $pdf->SetFont('', 'B', $default_font_size - 2);
405 $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
406 $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
407 }
408 } else {
409 $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
410 }
411
412 // Title, ref and date
413 $pdf->SetFont('', 'B', $default_font_size + 3);
414 $pdf->SetXY($posx, $posy);
415 $pdf->SetTextColor(0, 0, 60);
416 $pdf->MultiCell($w, 4, $outputlangs->transnoentities("DonationReceipt"), 0, 'R');
417
418 $posy += 6;
419 $pdf->SetFont('', 'B', $default_font_size);
420 $pdf->SetXY($posx, $posy);
421 $pdf->MultiCell($w, 4, $outputlangs->transnoentities("Ref")." : ".$outputlangs->convToOutputCharset((string) $don->ref), 0, 'R');
422
423 $posy += 5;
424 $pdf->SetFont('', '', $default_font_size - 1);
425 $pdf->SetXY($posx, $posy);
426 $pdf->MultiCell($w, 4, $outputlangs->transnoentities("Date")." : ".dol_print_date(dol_now(), 'day', false, $outputlangs, true), 0, 'R');
427
428 // Beneficiary (the company in Dolibarr)
429 $posy = 42;
430 $hautcadre = 40;
431 $widthrecbox = 90;
432 if ($this->page_largeur < 210) {
433 $widthrecbox = 84; // To work with US executive format
434 }
435 $posx = $this->marge_gauche;
436 if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) {
437 $posx = $this->page_largeur - $this->marge_droite - 82;
438 }
439
440 $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, null, null, 0, 'source', $don);
441
442 $pdf->SetTextColor(0, 0, 0);
443 $pdf->SetFont('', '', $default_font_size - 2);
444 $pdf->SetXY($posx, $posy - 5);
445 $pdf->MultiCell(82, 5, $outputlangs->transnoentities("DonationRecipient"), 0, 'L');
446 $pdf->SetFillColor(230, 230, 230);
447 $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F');
448 $pdf->SetTextColor(0, 0, 60);
449
450 $pdf->SetXY($posx + 2, $posy + 3);
451 $pdf->SetFont('', 'B', $default_font_size);
452 $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
453 $pdf->SetXY($posx + 2, $pdf->GetY());
454 $pdf->SetFont('', '', $default_font_size - 1);
455 $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
456
457 // Donor
458 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
459 if (getDolGlobalString('MAIN_INVERT_SENDER_RECIPIENT')) {
460 $posx = $this->marge_gauche;
461 }
462
463 $carac_donor = '';
464 if ($donor['address'] !== '') {
465 $carac_donor .= $donor['address']."\n";
466 }
467 $carac_donor .= trim($donor['zip'].' '.$donor['town']);
468 if ($donor['country_code'] !== '' && $donor['country_code'] != $this->emetteur->country_code) {
469 $carac_donor .= "\n".$donor['country'];
470 }
471
472 $pdf->SetTextColor(0, 0, 0);
473 $pdf->SetFont('', '', $default_font_size - 2);
474 $pdf->SetXY($posx + 2, $posy - 5);
475 $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Donor"), 0, 'L');
476 $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D');
477
478 $pdf->SetXY($posx + 2, $posy + 3);
479 $pdf->SetFont('', 'B', $default_font_size);
480 $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($donor['name']), 0, 'L');
481 $pdf->SetXY($posx + 2, $pdf->GetY());
482 $pdf->SetFont('', '', $default_font_size - 1);
483 $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($carac_donor), 0, 'L');
484
485 $pdf->SetTextColor(0, 0, 0);
486
487 return $posy + $hautcadre;
488 }
489
490
491 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
501 protected function _pagefoot(&$pdf, $don, $outputlangs, $hidefreetext = 0)
502 {
503 // phpcs:enable
504 $showdetails = getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
505 return pdf_pagefoot($pdf, $outputlangs, 'DONATION_MESSAGE', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $don, $showdetails, $hidefreetext, $this->page_largeur);
506 }
507}
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
$propal type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
Definition propal.php:281
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
Class to manage donations.
Definition don.class.php:42
Class to manage hooks.
Parent class of subscription templates.
getDonorInfos($don, $outputlangs)
Return the identity of the donor of a donation.
Class to generate a PDF donation receipt with the standard model.
tableauDon(&$pdf, $don, $posy, $outputlangs, $currency)
Show the amount and the details of the donation.
write_file($don, $outputlangs, $currency='')
Write the donation receipt to a PDF file on disk.
isEnabled()
Return if a module can be used or not.
_pagehead(&$pdf, $don, $donor, $outputlangs)
Show top header of page.
signatureArea(&$pdf, $don, $posy, $outputlangs)
Show the place, date and signature area of the receipt.
_pagefoot(&$pdf, $don, $outputlangs, $hidefreetext=0)
Show footer of page.
global $mysoc
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
if(!function_exists( 'dolEscapeXML')) convertBackOfficeMediasLinksToPublicLinks($notetoshow)
Convert links to local wrapper to medias files into a string into a public external URL readable on i...
dol_now($mode='gmt')
Return date for now.
price2num($amount, $rounding='', $option=0, $currencycode='')
Function that return a number with universal decimal format (decimal separator is '.
getCallerInfoString()
Get caller info as a string that can be appended to a log message.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
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.
dolChmod($filepath, $newmask='')
Change mod of a file.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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...
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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)
dol_convertToWord($num, $langs, $currency='', $centimes=false)
Function to return a number into a text.
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:296
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
Definition pdf.lib.php:319
pdf_pagehead($pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
Definition pdf.lib.php:792
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:1479
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
Definition pdf.lib.php:275
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:481
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0, $include=null)
Return array of possible substitutions for PDF content (without external module substitutions).
Definition pdf.lib.php:1180
pdf_getInstance($format='', $metric='mm', $pagetype='P')
Return a PDF instance object.
Definition pdf.lib.php:129
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:165