dolibarr 21.0.0-beta
mailing-send.php
Go to the documentation of this file.
1#!/usr/bin/env php
2<?php
3/*
4 * Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
5 * Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
6 * Copyright (C) 2005-2016 Regis Houssin <regis.houssin@inodbox.com>
7 * Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
8 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
9 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <https://www.gnu.org/licenses/>.
23 */
24
31if (!defined('NOSESSION')) {
32 define('NOSESSION', '1');
33}
34
35$sapi_type = php_sapi_name();
36$script_file = basename(__FILE__);
37$path = __DIR__.'/';
38
39// Test if batch mode
40if (substr($sapi_type, 0, 3) == 'cgi') {
41 echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
42 exit(1);
43}
44
45if (!isset($argv[1]) || !$argv[1]) {
46 print "Usage: ".$script_file." (ID_MAILING|all) [userloginforsignature] [maxnbofemails]\n";
47 exit(1);
48}
49
50$id = $argv[1];
51
52if (isset($argv[2]) || !empty($argv[2])) {
53 $login = $argv[2];
54} else {
55 $login = '';
56}
57
58$max = -1;
59
60if (isset($argv[3]) || !empty($argv[3])) {
61 $max = $argv[3];
62}
63
64
65require_once $path."../../htdocs/master.inc.php";
66require_once DOL_DOCUMENT_ROOT.'/core/lib/functionscli.lib.php';
67require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php";
68require_once DOL_DOCUMENT_ROOT."/comm/mailing/class/mailing.class.php";
76// Global variables
77$version = DOL_VERSION;
78$error = 0;
79
80if (!getDolGlobalString('MAILING_LIMIT_SENDBYCLI')) {
81 $conf->global->MAILING_LIMIT_SENDBYCLI = 0;
82}
83
84$langs->loadLangs(array("main", "mails"));
85
86if (!isModEnabled('mailing')) {
87 print 'Module Emailing not enabled';
88 exit(1);
89}
90
91$hookmanager->initHooks(array('cli'));
92
93
94/*
95 * Main
96 */
97
98@set_time_limit(0);
99print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
100
101if (getDolGlobalInt('MAILING_DELAY')) {
102 print 'A delay of '.((float) getDolGlobalInt('MAILING_DELAY')).' seconds has been set between each email'."\n";
103}
104
105if (getDolGlobalString('MAILING_LIMIT_SENDBYCLI') == '-1') {
106}
107
108if (!empty($dolibarr_main_db_readonly)) {
109 print "Error: instance in read-only mode\n";
110 exit(1);
111}
112
113$user = new User($db);
114// for signature, we use user send as parameter
115if (!empty($login)) {
116 $user->fetch('', $login);
117}
119// We get list of emailing id to process
120$sql = "SELECT m.rowid, m.statut as status";
121$sql .= " FROM ".MAIN_DB_PREFIX."mailing as m";
122$sql .= " WHERE m.statut IN (1,2)";
123if ($id != 'all') {
124 $sql .= " AND m.rowid= ".((int) $id);
125 $sql .= " LIMIT 1";
126}
127
128$resql = $db->query($sql);
129if ($resql) {
130 $num = $db->num_rows($resql);
131 $j = 0;
132
133 if ($num) {
134 for ($j = 0; $j < $num && $max != 0; $j++) {
135 $obj = $db->fetch_object($resql);
136
137 dol_syslog("Process mailing with id ".$obj->rowid);
138 print "Process mailing with id ".$obj->rowid."\n";
139
140 if ($obj->status == 1) {
141 $sql = "UPDATE ".MAIN_DB_PREFIX."mailing SET statut = 2 WHERE rowid = ".((int) $obj->rowid);
142 $result_sql = $db->query($sql);
143 dol_syslog("Started mailing campaign ".$obj->rowid, LOG_DEBUG);
144 }
145
146 $emailing = new Mailing($db);
147 $emailing->fetch($obj->rowid);
148
149 $upload_dir = $conf->mailing->dir_output."/".get_exdir($emailing->id, 2, 0, 1, $emailing, 'mailing');
150
151 $id = $emailing->id;
152 $subject = $emailing->sujet;
153 $message = $emailing->body;
154 $from = $emailing->email_from;
155 $replyto = $emailing->email_replyto;
156 $errorsto = $emailing->email_errorsto;
157 // Le message est-il en html
158 $msgishtml = -1; // Unknown by default
159 if (preg_match('/[\s\t]*<html>/i', $message)) {
160 $msgishtml = 1;
161 }
162
163 $nbok = 0;
164 $nbko = 0;
165
166 // On choisit les mails non deja envoyes pour ce mailing (statut=0)
167 // ou envoyes en erreur (statut=-1)
168 $sql2 = "SELECT mc.rowid, mc.fk_mailing, mc.lastname, mc.firstname, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type, mc.tag";
169 $sql2 .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
170 $sql2 .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".((int) $id);
171 if (getDolGlobalInt('MAILING_LIMIT_SENDBYCLI') > 0 && empty($max)) {
172 $sql2 .= " LIMIT " . getDolGlobalInt('MAILING_LIMIT_SENDBYCLI');
173 } elseif (getDolGlobalInt('MAILING_LIMIT_SENDBYCLI') > 0 && $max > 0) {
174 $sql2 .= " LIMIT ".min(getDolGlobalInt('MAILING_LIMIT_SENDBYCLI'), $max);
175 } elseif ($max > 0) {
176 $sql2 .= " LIMIT ".((int) $max);
177 }
178
179 $resql2 = $db->query($sql2);
180 if ($resql2) {
181 $num2 = $db->num_rows($resql2);
182 dol_syslog("Nb of targets = ".$num2, LOG_DEBUG);
183 print "Nb of targets = ".$num2."\n";
184
185 if ($num2) {
186 $now = dol_now();
187
188 // Positionne date debut envoi
189 $sqlstartdate = "UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi='".$db->idate($now)."' WHERE rowid=".((int) $id);
190 $resqlstartdate = $db->query($sqlstartdate);
191 if (!$resqlstartdate) {
192 dol_print_error($db);
193 $error++;
194 }
195
196 $thirdpartystatic = new Societe($db);
197
198 // Look on each email and sent message
199 $i = 0;
200 while ($i < $num2) {
201 // Here code is common with same loop ino card.php
202 $res = 1;
203 $now = dol_now();
204
205 $obj = $db->fetch_object($resql2);
206 $max--;
207
208 // sendto en RFC2822
209 $sendto = str_replace(',', ' ', dolGetFirstLastname($obj->firstname, $obj->lastname)." <".$obj->email.">");
210
211 // Make subtsitutions on topic and body
212 $other = explode(';', $obj->other);
213 $tmpfield = explode('=', $other[0], 2);
214 $other1 = (isset($tmpfield[1]) ? $tmpfield[1] : $tmpfield[0]);
215 $tmpfield = explode('=', $other[1], 2);
216 $other2 = (isset($tmpfield[1]) ? $tmpfield[1] : $tmpfield[0]);
217 $tmpfield = explode('=', $other[2], 2);
218 $other3 = (isset($tmpfield[1]) ? $tmpfield[1] : $tmpfield[0]);
219 $tmpfield = explode('=', $other[3], 2);
220 $other4 = (isset($tmpfield[1]) ? $tmpfield[1] : $tmpfield[0]);
221 $tmpfield = explode('=', $other[4], 2);
222 $other5 = (isset($tmpfield[1]) ? $tmpfield[1] : $tmpfield[0]);
223 $signature = ((!empty($user->signature) && !getDolGlobalString('MAIN_MAIL_DO_NOT_USE_SIGN')) ? $user->signature : '');
224
225 $object = null; // Not defined with mass emailing
226 $parameters = array('mode' => 'emailing');
227 $substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount'), $object); // Note: On mass emailing, this is null because we don't know object
228
229 // Array of possible substitutions (See also file mailing-send.php that should manage same substitutions)
230 $substitutionarray['__ID__'] = $obj->source_id;
231 if ($obj->source_type == "thirdparty") {
232 $result = $thirdpartystatic->fetch($obj->source_id);
233
234 if ($result > 0) {
235 $substitutionarray['__THIRDPARTY_CUSTOMER_CODE__'] = $thirdpartystatic->code_client;
236 } else {
237 $substitutionarray['__THIRDPARTY_CUSTOMER_CODE__'] = '';
238 }
239 }
240 $substitutionarray['__EMAIL__'] = $obj->email;
241 $substitutionarray['__LASTNAME__'] = $obj->lastname;
242 $substitutionarray['__FIRSTNAME__'] = $obj->firstname;
243 $substitutionarray['__MAILTOEMAIL__'] = '<a href="mailto:'.$obj->email.'">'.$obj->email.'</a>';
244 $substitutionarray['__OTHER1__'] = $other1;
245 $substitutionarray['__OTHER2__'] = $other2;
246 $substitutionarray['__OTHER3__'] = $other3;
247 $substitutionarray['__OTHER4__'] = $other4;
248 $substitutionarray['__OTHER5__'] = $other5;
249 $substitutionarray['__USER_SIGNATURE__'] = $signature; // Signature is empty when ran from command line or taken from user in parameter)
250 $substitutionarray['__SIGNATURE__'] = $signature; // For backward compatibility
251 $substitutionarray['__CHECK_READ__'] = '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.urlencode($obj->tag).'&securitykey='.dol_hash(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY') . "-".$obj->tag."-".$obj->email."-".$obj->rowid, "md5").'&email='.urlencode($obj->email).'&mtid='.((int) $obj->rowid).'" width="1" height="1" style="width:1px;height:1px" border="0"/>';
252 $substitutionarray['__UNSUBSCRIBE__'] = '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.urlencode($obj->tag).'&unsuscrib=1&securitykey='.dol_hash(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY') . "-".$obj->tag."-".$obj->email."-".$obj->rowid, "md5").'&email='.urlencode($obj->email).'&mtid='.((int) $obj->rowid).'" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>';
253 $substitutionarray['__UNSUBSCRIBE_URL__'] = DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.urlencode($obj->tag).'&unsuscrib=1&securitykey='.dol_hash(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY') . "-".$obj->tag."-".$obj->email."-".$obj->rowid, "md5").'&email='.urlencode($obj->email).'&mtid='.((int) $obj->rowid);
254
255 $onlinepaymentenabled = 0;
256 if (isModEnabled('paypal')) {
257 $onlinepaymentenabled++;
258 }
259 if (isModEnabled('paybox')) {
260 $onlinepaymentenabled++;
261 }
262 if (isModEnabled('stripe')) {
263 $onlinepaymentenabled++;
264 }
265 if ($onlinepaymentenabled && getDolGlobalString('PAYMENT_SECURITY_TOKEN')) {
266 $substitutionarray['__SECUREKEYPAYMENT__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), '2');
267 if (!getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) {
268 $substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), '2');
269 $substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), '2');
270 $substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), '2');
271 $substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), '2');
272 } else {
273 $substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'membersubscription'.$obj->source_id, '2');
274 $substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'order'.$obj->source_id, '2');
275 $substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'invoice'.$obj->source_id, '2');
276 $substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'contractline'.$obj->source_id, '2');
277 }
278 }
279 /* For backward compatibility */
280 if (isModEnabled('paypal') && getDolGlobalString('PAYPAL_SECURITY_TOKEN')) {
281 $substitutionarray['__SECUREKEYPAYPAL__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), '2');
282
283 if (!getDolGlobalString('PAYPAL_SECURITY_TOKEN_UNIQUE')) {
284 $substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), '2');
285 } else {
286 $substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'membersubscription'.$obj->source_id, '2');
287 }
288
289 if (!getDolGlobalString('PAYPAL_SECURITY_TOKEN_UNIQUE')) {
290 $substitutionarray['__SECUREKEYPAYPAL_ORDER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), '2');
291 } else {
292 $substitutionarray['__SECUREKEYPAYPAL_ORDER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'order'.$obj->source_id, '2');
293 }
294
295 if (!getDolGlobalString('PAYPAL_SECURITY_TOKEN_UNIQUE')) {
296 $substitutionarray['__SECUREKEYPAYPAL_INVOICE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), '2');
297 } else {
298 $substitutionarray['__SECUREKEYPAYPAL_INVOICE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'invoice'.$obj->source_id, '2');
299 }
300
301 if (!getDolGlobalString('PAYPAL_SECURITY_TOKEN_UNIQUE')) {
302 $substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), '2');
303 } else {
304 $substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'contractline'.$obj->source_id, '2');
305 }
306 }
307
308 complete_substitutions_array($substitutionarray, $langs);
309 $newsubject = make_substitutions($subject, $substitutionarray);
310 $newmessage = make_substitutions($message, $substitutionarray);
311
312 $substitutionisok = true;
313
314 $moreinheader = '';
315 if (preg_match('/__UNSUBSCRIBE__/', $message)) {
316 $moreinheader = "List-Unsubscribe: <__UNSUBSCRIBE_URL__>\n";
317 $moreinheader = make_substitutions($moreinheader, $substitutionarray);
318 }
319
320 $arr_file = array();
321 $arr_mime = array();
322 $arr_name = array();
323 $arr_css = array();
324
325 $listofpaths = dol_dir_list($upload_dir, 'all', 0, '', '', 'name', SORT_ASC, 0);
326
327 if (count($listofpaths)) {
328 foreach ($listofpaths as $key => $val) {
329 $arr_file[] = $listofpaths[$key]['fullname'];
330 $arr_mime[] = dol_mimetype($listofpaths[$key]['name']);
331 $arr_name[] = $listofpaths[$key]['name'];
332 }
333 }
334 // Fabrication du mail
335 $trackid = 'emailing-'.$obj->fk_mailing.'-'.$obj->rowid;
336 $upload_dir_tmp = $upload_dir;
337 $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, $moreinheader, 'emailing', '', $upload_dir_tmp);
338
339 if ($mail->error) {
340 $res = 0;
341 }
342 if (!$substitutionisok) {
343 $mail->error = 'Some substitution failed';
344 $res = 0;
345 }
346
347 // Send Email
348 if ($res) {
349 $res = $mail->sendfile();
350 }
351
352 if ($res) {
353 // Mail successful
354 $nbok++;
355
356 dol_syslog("ok for emailing id ".$id." #".$i.($mail->error ? ' - '.$mail->error : ''), LOG_DEBUG);
357
358 // Note: If emailing is 100 000 targets, 100 000 entries are added, so we don't enter events for each target here
359 // We must union table llx_mailing_taget for event tab OR enter 1 event with a special table link (id of email in event)
360 // Run trigger
361 /*
362 * if ($obj->source_type == 'contact')
363 * {
364 * $emailing->sendtoid = $obj->source_id;
365 * }
366 * if ($obj->source_type == 'thirdparty')
367 * {
368 * $emailing->socid = $obj->source_id;
369 * }
370 * // Call trigger
371 * $result=$emailing->call_trigger('EMAILING_SENTBYMAIL',$user);
372 * if ($result < 0) $error++;
373 * // End call triggers
374 */
375
376 $sqlok = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
377 $sqlok .= " SET statut = 1, date_envoi = '".$db->idate($now)."' WHERE rowid = ".((int) $obj->rowid);
378 $resqlok = $db->query($sqlok);
379 if (!$resqlok) {
380 dol_print_error($db);
381 $error++;
382 } else {
383 // if cheack read is use then update prospect contact status
384 if (strpos($message, '__CHECK_READ__') !== false) {
385 // Update status communication of thirdparty prospect
386 $sqlx = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE rowid=".((int) $obj->rowid).")";
387 dol_syslog("card.php: set prospect thirdparty status", LOG_DEBUG);
388 $resqlx = $db->query($sqlx);
389 if (!$resqlx) {
390 dol_print_error($db);
391 $error++;
392 }
393
394 // Update status communication of contact prospect
395 $sqlx = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.rowid=".((int) $obj->rowid)." AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)";
396 dol_syslog("card.php: set prospect contact status", LOG_DEBUG);
397
398 $resqlx = $db->query($sqlx);
399 if (!$resqlx) {
400 dol_print_error($db);
401 $error++;
402 }
403 }
404
405 if (getDolGlobalInt('MAILING_DELAY')) {
406 usleep((int) ((float) getDolGlobalInt('MAILING_DELAY') * 1000000));
407 }
408 }
409 } else {
410 // Mail failed
411 $nbko++;
412
413 dol_syslog("error for emailing id ".$id." #".$i.($mail->error ? ' - '.$mail->error : ''), LOG_DEBUG);
414
415 $sqlerror = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
416 $sqlerror .= " SET statut=-1, date_envoi='".$db->idate($now)."' WHERE rowid=".$obj->rowid;
417 $resqlerror = $db->query($sqlerror);
418 if (!$resqlerror) {
419 dol_print_error($db);
420 $error++;
421 }
422 }
423
424 $i++;
425 }
426 } else {
427 //$mesg = "Emailing id ".$id." has no recipient to target";
428 print $mesg."\n";
429 dol_syslog($mesg, LOG_ERR);
430
431 // Loop finished, set global statut of mail
432 $sql = "UPDATE ".MAIN_DB_PREFIX."mailing SET statut=3 WHERE rowid=".$obj->rowid;
433 $result_sql = $db->query($sql);
434
435 dol_syslog("update global status", LOG_DEBUG);
436 print "Update status of emailing id ".$id." to ".$statut."\n";
437 }
438 } else {
439 dol_print_error($db);
440 $error++;
441 }
442 }
443 } else {
444 $mesg = "No validated emailing id to send found.";
445 print $mesg."\n";
446 dol_syslog($mesg, LOG_ERR);
447 $error++;
448 }
449} else {
450 dol_print_error($db);
451 $error++;
452}
453
454exit($error);
$id
Definition account.php:48
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
Class to send emails (with attachments or not) Usage: $mailfile = new CMailFile($subject,...
Class to manage emailings module.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
Definition files.lib.php:63
dol_getmypid()
Return getmypid() or random PID when function is disabled Some web hosts disable this php function fo...
dol_mimetype($file, $default='application/octet-stream', $mode=0)
Return MIME type of a file from its name with extension.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dolGetFirstLastname($firstname, $lastname, $nameorder=-1)
Return firstname and lastname in correct order.
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_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null, $include=null)
Return array of possible common substitutions.
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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
dol_hash($chain, $type='0', $nosalt=0)
Returns a hash (non reversible encryption) of a string.