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