dolibarr 25.0.0-alpha
card_presend.tpl.php
1<?php
2/* Copyright (C) 2017-2018 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
4 * Copyright (C) 2023 Maxime Nicolas <maxime@oarces.com>
5 * Copyright (C) 2023 Benjamin GREMBI <benjamin@oarces.com>
6 * Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
7 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
8 * Copyright (C) 2026 Lenin Rivas <lenin.rivas777@gmail.com>
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
48'
49@phan-var-force int<0,1> $diroutput
50@phan-var-force string $defaulttopic
51@phan-var-force string $defaulttopiclang
52@phan-var-force string[] $arrayoffamiliestoexclude
53@phan-var-force string $file
54@phan-var-force string $modelmail
55@phan-var-force CommonObject $object
56';
57
58// Protection to avoid direct call of template
59if (empty($conf) || !is_object($conf)) {
60 print "Error, template page can't be called as URL";
61 exit(1);
62}
63
64$fileparams = array();
65$file = null;
66if (!isset($modelmail)) {
67 $modelmail = '';
68}
69
70if ($action == 'presend') {
71 $langs->load("mails");
72
73 $titreform = 'SendMail';
74
75 $object->fetchProject();
76
77 $ref = dol_sanitizeFileName($object->ref);
78 if (!in_array($object->element, array('user', 'member'))) {
79 //$fileparams['fullname'] can be filled from the card
80 //Get also the main_lastdoc field of $object. If not found, try to guess with following code
81 if (!empty($object->last_main_doc) && is_readable(DOL_DATA_ROOT.'/'.$object->last_main_doc) && is_file(DOL_DATA_ROOT.'/'.$object->last_main_doc)) {
82 $fileparams['fullname'] = DOL_DATA_ROOT.'/'.$object->last_main_doc;
83 } else {
84 include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
85 // Special case
86 if ($object->element == 'invoice_supplier') {
87 $fileparams = dol_most_recent_file($diroutput.'/'.get_exdir($object->id, 2, 0, 0, $object, $object->element).$ref, preg_quote($ref, '/').'([^\-])+');
88 } else {
89 $fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+');
90 }
91 }
92
93 $file = isset($fileparams['fullname']) ? $fileparams['fullname'] : null;
94 }
95
96 // Define output language
97 $outputlangs = $langs;
98 $newlang = '';
99 if (getDolGlobalInt('MAIN_MULTILANGS')) {
100 if (!is_object($object->thirdparty) && method_exists($object, 'fetch_thirdparty')) {
101 $object->fetch_thirdparty();
102 }
103 if (is_object($object->thirdparty)) {
104 $newlang = $object->thirdparty->default_lang;
105 }
106 if (GETPOST('lang_id', 'aZ09')) {
107 $newlang = GETPOST('lang_id', 'aZ09');
108 }
109 // When the email form is resubmitted (e.g. Apply button to select a template),
110 // lang_id is not in POST but langsmodels is. Use it to preserve the language selection.
111 if (empty($newlang) && GETPOST('langsmodels', 'aZ09')) {
112 $newlang = GETPOST('langsmodels', 'aZ09');
113 }
114 }
115
116 if (!empty($newlang)) {
117 $outputlangs = new Translate('', $conf);
118 $outputlangs->setDefaultLang($newlang);
119 // Load traductions files required by page
120 $outputlangs->loadLangs(array('commercial', 'bills', 'orders', 'contracts', 'main', 'members', 'propal', 'products', 'supplier_proposal', 'interventions', 'receptions', 'sendings'));
121 if (!empty($defaulttopiclang)) {
122 $outputlangs->loadLangs(array($defaulttopiclang));
123 }
124 }
125
126 $topicmail = '';
127 if (empty($object->ref_client)) {
128 $topicmail = $outputlangs->trans($defaulttopic, '__REF__');
129 } elseif (!empty($object->ref_client)) {
130 $topicmail = $outputlangs->trans($defaulttopic, '__REF__ (__REF_CLIENT__)');
131 }
132
133 // Build document if it does not exists
134 $forcebuilddoc = true;
135 // except for some cases where it can not exists
136 if (in_array($object->element, array('user', 'member'))) {
137 $forcebuilddoc = false;
138 }
139 if ($object->element == 'invoice_supplier' && !getDolGlobalString('INVOICE_SUPPLIER_ADDON_PDF')) {
140 $forcebuilddoc = false;
141 }
142 if ($object->element == 'project' && !getDolGlobalString('PROJECT_ADDON_PDF')) {
143 $forcebuilddoc = false;
144 }
145 if ($object->element == 'project_task' && !getDolGlobalString('PROJECT_TASK_ADDON_PDF')) {
146 $forcebuilddoc = false;
147 }
148 if ($object->element == 'societe' && !getDolGlobalString('COMPANY_ADDON_PDF')) {
149 $forcebuilddoc = false;
150 }
151
152 if ($forcebuilddoc) { // If there is no default value for supplier invoice, we do not generate file, even if modelpdf was set by a manual generation
153 if ((!$file || !is_readable($file)) && method_exists($object, 'generateDocument')) {
154 $hidedetails = empty($hidedetails) ? '' : $hidedetails;
155 $hidedesc = empty($hidedesc) ? '' : $hidedesc;
156 $hideref = empty($hideref) ? '' : $hideref;
157
158 $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
159 if ($result < 0) {
160 dol_syslog(__FILE__.' generateDocument failed for '.$object->element.' id='.(empty($object->id) ? 0 : $object->id).' error='.$object->error, LOG_ERR);
161 setEventMessages($object->error, $object->errors, 'errors');
162 }
163 if ($result >= 0) {
164 if ($object->element == 'invoice_supplier') {
165 $fileparams = dol_most_recent_file($diroutput.'/'.get_exdir($object->id, 2, 0, 0, $object, $object->element).$ref, preg_quote($ref, '/').'([^\-])+');
166 } else {
167 $fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+');
168 }
169
170 $file = isset($fileparams['fullname']) ? $fileparams['fullname'] : null;
171 }
172 }
173 }
174
175 print '<div id="formmailbeforetitle" name="formmailbeforetitle"></div>';
176 print '<div class="clearboth"></div>';
177 print '<br>';
178 print load_fiche_titre($langs->trans($titreform));
179
180 print dol_get_fiche_head([], '', '', -1);
181
182 // Create form for email
183 include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
184 $formmail = new FormMail($db);
185
186 $formmail->param['langsmodels'] = (empty($newlang) ? $langs->defaultlang : $newlang);
187 $formmail->fromtype = (GETPOST('fromtype') ? GETPOST('fromtype') : getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE', 'user'));
188
189 if ($formmail->fromtype === 'user') {
190 $formmail->fromid = $user->id;
191 }
192 if ($object->element == 'salary' && getDolGlobalString('INVOICE_EMAIL_SENDER')) {
193 $formmail->frommail = getDolGlobalString('SINVOICE_EMAIL_SENDER');
194 $formmail->fromname = getDolGlobalString('INVOICE_EMAIL_SENDER_NAME', '');
195 $formmail->fromtype = 'special';
196 }
197 if ($object->element === 'facture' && getDolGlobalString('INVOICE_EMAIL_SENDER')) {
198 $formmail->frommail = getDolGlobalString('INVOICE_EMAIL_SENDER');
199 $formmail->fromname = getDolGlobalString('INVOICE_EMAIL_SENDER_NAME', '');
200 $formmail->fromtype = 'special';
201 }
202 if ($object->element === 'shipping' && getDolGlobalString('SHIPPING_EMAIL_SENDER')) {
203 $formmail->frommail = getDolGlobalString('SHIPPING_EMAIL_SENDER');
204 $formmail->fromname = getDolGlobalString('SHIPPING_EMAIL_SENDER_NAME', '');
205 $formmail->fromtype = 'special';
206 }
207 if ($object->element === 'commande' && getDolGlobalString('COMMANDE_EMAIL_SENDER')) {
208 $formmail->frommail = getDolGlobalString('COMMANDE_EMAIL_SENDER');
209 $formmail->fromname = getDolGlobalString('COMMANDE_EMAIL_SENDER_NAME', '');
210 $formmail->fromtype = 'special';
211 }
212 if ($object->element === 'order_supplier' && getDolGlobalString('ORDER_SUPPLIER_EMAIL_SENDER')) {
213 $formmail->frommail = getDolGlobalString('ORDER_SUPPLIER_EMAIL_SENDER');
214 $formmail->fromname = getDolGlobalString('ORDER_SUPPLIER_EMAIL_SENDER_NAME', '');
215 $formmail->fromtype = 'special';
216 }
217 if ($object->element === 'recruitmentcandidature') {
218 $formmail->frommail = getDolGlobalString('RECRUITMENT_EMAIL_SENDER', (!empty($recruitermail) ? $recruitermail : ''));
219 $formmail->fromname = getDolGlobalString('RECRUITMENT_EMAIL_SENDER_NAME', (!empty($recruitername) ? $recruitername : ''));
220 $formmail->fromtype = 'special';
221 }
222
223 // Set the default "From"
224 $defaultfrom = '';
225 if (GETPOSTISSET('fromtype')) {
226 $defaultfrom = GETPOST('fromtype');
227 } else {
228 $parameters = array();
229 $reshook = $hookmanager->executeHooks('getDefaultFromEmail', $parameters, $formmail);
230 if (empty($reshook)) {
231 $defaultfrom = $formmail->fromtype;
232 }
233 if (!empty($hookmanager->resArray['defaultfrom'])) {
234 $defaultfrom = $hookmanager->resArray['defaultfrom'];
235 }
236 }
237 $formmail->fromtype = $defaultfrom;
238
239 $formmail->trackid = empty($trackid) ? '' : $trackid;
240 $formmail->inreplyto = empty($inreplyto) ? '' : $inreplyto;
241 $formmail->withfrom = 1;
242 $formmail->withlayout = 'email';
243 $formmail->withaiprompt = 'html';
244
245
246 // Define $liste, a list of recipients with email inside <>.
247 $liste = array();
248 if ($object->element == 'expensereport') {
249 '@phan-var-force ExpenseReport $object';
250 $fuser = new User($db);
251 $fuser->fetch($object->fk_user_author);
252 $liste['thirdparty'] = $fuser->getFullName($outputlangs)." <".$fuser->email.">";
253 } elseif ($object->element == 'partnership' && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') {
254 '@phan-var-force Partnership $object';
255 $fadherent = new Adherent($db);
256 $fadherent->fetch($object->fk_member);
257 $liste['member'] = $fadherent->getFullName($outputlangs)." <".$fadherent->email.">";
258 } elseif ($object->element == 'societe') {
259 '@phan-var-force Societe $object';
260 foreach ($object->thirdparty_and_contact_email_array(1) as $key => $value) {
261 $liste[$key] = $value;
262 }
263 } elseif ($object->element == 'contact') {
264 '@phan-var-force Contact $object';
265 $liste['contact'] = $object->getFullName($outputlangs)." <".$object->email.">";
266 } elseif ($object->element == 'user' || $object->element == 'member') {
267 '@phan-var-force User|Adherent $object';
268 $liste['thirdparty'] = $object->getFullName($outputlangs)." <".$object->email.">";
269 } elseif ($object->element == 'salary') {
270 '@phan-var-force Salary $object';
271 $fuser = new User($db);
272 $fuser->fetch($object->fk_user);
273 $liste['thirdparty'] = $fuser->getFullName($outputlangs)." <".$fuser->email.">";
274 } else {
275 // For example if element is project
276 // @phan-suppress-next-line PhanUndeclaredProperty
277 if (property_exists($object, 'socid') && !empty($object->socid) && $object->socid > 0 && !is_object($object->thirdparty) && method_exists($object, 'fetch_thirdparty')) {
278 $object->fetch_thirdparty();
279 }
280 if (is_object($object->thirdparty)) {
281 foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) {
282 $liste[$key] = $value;
283 }
284 }
285 }
286
287 if (getDolGlobalString('MAIN_MAIL_ENABLED_USER_DEST_SELECT')) {
288 $listeuser = array();
289 $fuserdest = new User($db);
290 $result = $fuserdest->fetchAll('ASC', 't.lastname', 0, 0, "(t.statut:=:1) AND (t.employee:=:1) AND (t.email:isnot:NULL) AND (t.email:!=:'')", 'AND', true);
291 if ($result > 0 && is_array($fuserdest->users) && count($fuserdest->users) > 0) {
292 foreach ($fuserdest->users as $uuserdest) {
293 $listeuser[$uuserdest->id] = $uuserdest->user_get_property($uuserdest->id, 'email');
294 }
295 } elseif ($result < 0) {
296 setEventMessages(null, $fuserdest->errors, 'errors');
297 }
298 if (count($listeuser) > 0) {
299 $formmail->withtouser = $listeuser;
300 $formmail->withtoccuser = $listeuser;
301 }
302 }
303
304 //$arrayoffamiliestoexclude=array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...);
305 if (!isset($arrayoffamiliestoexclude)) {
306 $arrayoffamiliestoexclude = null;
307 }
308
309 // Make substitution in email content
310 if (!empty($object)) {
311 // First we set ->substit (useless, it will be erased later) and ->substit_lines
312 $formmail->setSubstitFromObject($object, $outputlangs);
313 }
314 $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object);
315
316 $emailsendersignature = null;
317 // Overwrite __SENDEREMAIL_SIGNATURE__ with value select into form
318 if ($formmail->fromtype) {
319 $reg = array();
320 if (preg_match('/user/', $formmail->fromtype, $reg)) {
321 $emailsendersignature = $user->signature;
322 } elseif (preg_match('/company/', $formmail->fromtype, $reg)) {
323 $emailsendersignature = '';
324 } elseif (preg_match('/senderprofile_(\d+)/', $formmail->fromtype, $reg)) {
325 $sql = "SELECT rowid, label, email, signature FROM ".$db->prefix()."c_email_senderprofile";
326 $sql .= " WHERE rowid = ".((int) $reg[1]);
327 $resql = $db->query($sql);
328 if ($resql) {
329 $obj = $db->fetch_object($resql);
330 if ($obj) {
331 $emailsendersignature = $obj->signature;
332 }
333 }
334 }
335 }
336 $substitutionarray['__SENDEREMAIL_SIGNATURE__'] = $emailsendersignature;
337
338 $substitutionarray['__CHECK_READ__'] = "";
339 if (is_object($object) && is_object($object->thirdparty)) {
340 $checkRead = '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php';
341 // @phan-suppress-next-line PhanUndeclaredProperty;
342 $checkRead .= '?tag='.(!empty($object->thirdparty->tag) ? urlencode($object->thirdparty->tag) : "");
343 $checkRead .= '&securitykey='.(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY') ? urlencode(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY')) : "");
344 $checkRead .= '" width="1" height="1" style="width:1px;height:1px" border="0"/>';
345 $substitutionarray['__CHECK_READ__'] = $checkRead;
346 }
347 $substitutionarray['__CONTACTCIVNAME__'] = '';
348 $parameters = array(
349 'mode' => 'formemail'
350 );
351 complete_substitutions_array($substitutionarray, $outputlangs, $object, $parameters);
352
353 // Find all external contact addresses
354 $tmpobject = $object;
355 if (($object->element == 'shipping' || $object->element == 'reception')) {
356 $origin = $object->origin;
357 $origin_id = $object->origin_id;
358
359 if (!empty($origin) && !empty($origin_id)) {
360 $element = $subelement = $origin;
361
362 if ($element == 'order_supplier') {
363 $element = 'fourn';
364 $subelement = 'fournisseur.commande';
365 $origin = 'CommandeFournisseur';
366 }
367
368 $regs = array();
369 if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
370 $element = $regs[1];
371 $subelement = $regs[2];
372 }
373 // For compatibility
374 if ($element == 'order') {
375 $element = $subelement = 'commande';
376 }
377 if ($element == 'propal') {
378 $element = 'comm/propal';
379 $subelement = 'propal';
380 }
381 if ($element == 'contract') {
382 $element = $subelement = 'contrat';
383 }
384 if ($element == 'inter') {
385 $element = $subelement = 'fichinter';
386 }
387 if ($element == 'shipping') {
388 $element = $subelement = 'expedition';
389 }
390 if ($element == 'project') {
391 $element = 'projet';
392 }
393
394 dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
395 $classname = ucfirst($origin);
396 $objectsrc = new $classname($db);
397 '@phan-var-force Commande|Facture $objectsrc';
398 $objectsrc->fetch($origin_id);
399
400 $tmpobject = $objectsrc;
401 }
402 }
403
404 $contactarr = array();
405 $contactarr = $tmpobject->liste_contact(-1, 'external', 0, '', 1);
406
407 if (is_array($contactarr) && count($contactarr) > 0) {
408 require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
409 require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
410 $contactstatic = new Contact($db);
411 $tmpcompany = new Societe($db);
412
413 foreach ($contactarr as $contact) {
414 $contactstatic->fetch($contact['id']);
415 // Complete substitution array
416 $substitutionarray['__CONTACT_NAME_'.$contact['code'].'__'] = $contactstatic->getFullName($outputlangs, 1);
417 $substitutionarray['__CONTACT_LASTNAME_'.$contact['code'].'__'] = $contactstatic->lastname;
418 $substitutionarray['__CONTACT_FIRSTNAME_'.$contact['code'].'__'] = $contactstatic->firstname;
419 $substitutionarray['__CONTACT_TITLE_'.$contact['code'].'__'] = $contactstatic->getCivilityLabel();
420
421 // Complete $liste with the $contact
422 if (empty($liste[$contact['id']])) { // If this contact id not already into the $liste
423 $contacttoshow = '';
424 if (isset($object->thirdparty) && is_object($object->thirdparty)) {
425 if ($contactstatic->fk_soc != $object->thirdparty->id) {
426 $tmpcompany->fetch($contactstatic->fk_soc);
427 if ($tmpcompany->id > 0) {
428 $contacttoshow .= $tmpcompany->name.': ';
429 }
430 }
431 }
432 $contacttoshow .= $contactstatic->getFullName($outputlangs, 1);
433 $contacttoshow .= " <".($contactstatic->email ? $contactstatic->email : $langs->transnoentitiesnoconv("NoEMail")) .">";
434 $liste[$contact['id']] = $contacttoshow;
435 }
436 }
437 }
438
439 $formmail->withto = $liste;
440 $formmail->withtofree = (GETPOST('sendto', 'alphawithlgt') ? GETPOST('sendto', 'alphawithlgt') : '1');
441 $formmail->withtocc = $liste;
442 $formmail->withtoccc = getDolGlobalString('MAIN_EMAIL_USECCC');
443 $formmail->withtopic = $topicmail;
444 $formmail->withfile = 2;
445 $formmail->withbody = 1;
446 $formmail->withdeliveryreceipt = 1;
447 $formmail->withcancel = 1;
448
449 // Array of substitutions
450 $formmail->substit = $substitutionarray;
451
452 $fileinit = array();
453 $nbmostrecentfiles = 0;
454 if ($object->element == 'facture' && getDolGlobalInt('MAIN_FACTURE_EMAIL_ATTACH_MOST_RECENT_FILES') > 0) {
455 $nbmostrecentfiles = getDolGlobalInt('MAIN_FACTURE_EMAIL_ATTACH_MOST_RECENT_FILES');
456 } elseif (getDolGlobalInt('MAIN_EMAIL_ATTACH_MOST_RECENT_FILES') > 0) {
457 $nbmostrecentfiles = getDolGlobalInt('MAIN_EMAIL_ATTACH_MOST_RECENT_FILES');
458 }
459
460 if ($nbmostrecentfiles > 0) {
461 include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
462 if ($object->element == 'invoice_supplier') {
463 $dir = $diroutput.'/'.get_exdir($object->id, 2, 0, 0, $object, $object->element).$ref;
464 } else {
465 $dir = $diroutput.'/'.$ref;
466 }
467 $recentfiles = dol_most_recent_file($dir, '', array('(\.meta|_preview.*\.png)$', '^\.'), 0, 0, $nbmostrecentfiles);
468 if (is_array($recentfiles) && count($recentfiles) > 0) {
469 if (isset($recentfiles['fullname'])) {
470 $recentfiles = array($recentfiles);
471 }
472 foreach ($recentfiles as $fileentry) {
473 if (!empty($fileentry['fullname']) && is_readable($fileentry['fullname'])) {
474 $fileinit[] = $fileentry['fullname'];
475 }
476 }
477 }
478 }
479
480 if (empty($fileinit) && !empty($file)) {
481 $fileinit = array($file);
482 }
483
484 // Array of other parameters
485 $formmail->param['action'] = 'send';
486 $formmail->param['models'] = $modelmail;
487 $formmail->param['models_id'] = GETPOSTINT('modelmailselected');
488 $formmail->param['id'] = $object->id;
489 $formmail->param['returnurl'] = $_SERVER["PHP_SELF"].'?id='.$object->id;
490 $formmail->param['fileinit'] = $fileinit;
491 $formmail->param['object_entity'] = $object->entity;
492
493 // Show form
494 print $formmail->get_form();
495
496 print dol_get_fiche_end();
497}
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
Class to manage members of a foundation.
Class to manage contact/addresses.
Class to manage a HTML form to send a unitary email Usage: $formail = new FormMail($db) $formmail->pr...
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage translations.
Class to manage Dolibarr users.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
dol_most_recent_file($dir, $regexfilter='', $excludefilter=array('(\.meta|_preview.*\.png) $', '^\.'), $nohook=0, $mode=0, $limit=0)
Return file(s) into a directory (by default most recent)
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
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...
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
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_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
Definition html.lib.php:540
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition html.lib.php:738
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.