dolibarr  7.0.0-beta
actions_sendmails.inc.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
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 <http://www.gnu.org/licenses/>.
16 * or see http://www.gnu.org/
17 */
18 
24 // $mysoc must be defined
25 // $id must be defined
26 // $paramname must be defined
27 // $mode must be defined (used to know the automatic BCC to add)
28 // $trigger_name must be set (can be '')
29 // $actiontypecode can be set
30 // $object and $uobject may be defined
31 
32 /*
33  * Add file in email form
34  */
35 if (GETPOST('addfile','alpha'))
36 {
37  $trackid = GETPOST('trackid','aZ09');
38 
39  require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
40 
41  // Set tmp user directory
42  $vardir=$conf->user->dir_output."/".$user->id;
43  $upload_dir_tmp = $vardir.'/temp'; // TODO Add $keytoavoidconflict in upload_dir path
44 
45  dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, $trackid);
46  $action='presend';
47 }
48 
49 /*
50  * Remove file in email form
51  */
52 if (! empty($_POST['removedfile']) && empty($_POST['removAll']))
53 {
54  $trackid = GETPOST('trackid','aZ09');
55 
56  require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
57 
58  // Set tmp user directory
59  $vardir=$conf->user->dir_output."/".$user->id;
60  $upload_dir_tmp = $vardir.'/temp'; // TODO Add $keytoavoidconflict in upload_dir path
61 
62  // TODO Delete only files that was uploaded from email form. This can be addressed by adding the trackid into the temp path then changing donotdeletefile to 2 instead of 1 to say "delete only if into temp dir"
63  // GETPOST('removedfile','alpha') is position of file into $_SESSION["listofpaths"...] array.
64  dol_remove_file_process(GETPOST('removedfile','alpha'), 0, 1, $trackid); // We do not delete because if file is the official PDF of doc, we don't want to remove it physically
65  $action='presend';
66 }
67 
68 /*
69  * Remove all files in email form
70  */
71 if (GETPOST('removAll','alpha'))
72 {
73  $trackid = GETPOST('trackid','aZ09');
74 
75  $listofpaths=array();
76  $listofnames=array();
77  $listofmimes=array();
78  $keytoavoidconflict = empty($trackid)?'':'-'.$trackid;
79  if (! empty($_SESSION["listofpaths".$keytoavoidconflict])) $listofpaths=explode(';',$_SESSION["listofpaths".$keytoavoidconflict]);
80  if (! empty($_SESSION["listofnames".$keytoavoidconflict])) $listofnames=explode(';',$_SESSION["listofnames".$keytoavoidconflict]);
81  if (! empty($_SESSION["listofmimes".$keytoavoidconflict])) $listofmimes=explode(';',$_SESSION["listofmimes".$keytoavoidconflict]);
82 
83  include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
84  $formmail = new FormMail($db);
85  $formmail->trackid = $trackid;
86 
87  foreach($listofpaths as $key => $value)
88  {
89  $pathtodelete = $value;
90  $filetodelete = $listofnames[$key];
91  $result = dol_delete_file($pathtodelete,1); // Delete uploded Files
92 
93  $langs->load("other");
94  setEventMessages($langs->trans("FileWasRemoved",$filetodelete), null, 'mesgs');
95 
96  $formmail->remove_attached_files($key); // Update Session
97  }
98 }
99 
100 /*
101  * Send mail
102  */
103 if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_POST['removAll'] && ! $_POST['removedfile'] && ! $_POST['cancel'] && !$_POST['modelselected'])
104 {
105  $trackid = GETPOST('trackid','aZ09');
106  $subject='';$actionmsg='';$actionmsg2='';
107 
108  if (! empty($conf->dolimail->enabled)) $langs->load("dolimail@dolimail");
109  $langs->load('mails');
110 
111  if (is_object($object))
112  {
113  $result=$object->fetch($id);
114 
115  $sendtosocid=0; // Thirdparty on object
116  if (method_exists($object,"fetch_thirdparty") && ! in_array($object->element, array('societe','member','user','expensereport')))
117  {
118  $result=$object->fetch_thirdparty();
119  if ($object->element == 'user' && $result == 0) $result=1; // Even if not found, we consider ok
120  $thirdparty=$object->thirdparty;
121  $sendtosocid=$thirdparty->id;
122  }
123  else if ($object->element == 'member' || $object->element == 'user')
124  {
125  $thirdparty=$object;
126  if ($thirdparty->id > 0) $sendtosocid=$thirdparty->id;
127  }
128  else if ($object->element == 'societe')
129  {
130  $thirdparty=$object;
131  if ($thirdparty->id > 0) $sendtosocid=$thirdparty->id;
132  elseif (! empty($conf->dolimail->enabled))
133  {
134  $dolimail = new Dolimail($db);
135  $possibleaccounts=$dolimail->get_societe_by_email($_POST['sendto'],"1");
136  $possibleuser=$dolimail->get_from_user_by_mail($_POST['sendto'],"1"); // suche in llx_societe and socpeople
137  if (!$possibleaccounts && !$possibleuser)
138  {
139  setEventMessages($langs->trans('ErrorFailedToFindSocieteRecord',$_POST['sendto']), null, 'errors');
140  }
141  elseif (count($possibleaccounts)>1)
142  {
143  $sendtosocid=$possibleaccounts[1]['id'];
144  $result=$object->fetch($sendtosocid);
145 
146  setEventMessages($langs->trans('ErrorFoundMoreThanOneRecordWithEmail',$_POST['sendto'],$object->name), null, 'mesgs');
147  }
148  else
149  {
150  if($possibleaccounts){
151  $sendtosocid=$possibleaccounts[1]['id'];
152  $result=$object->fetch($sendtosocid);
153  }elseif($possibleuser){
154  $sendtosocid=$possibleuser[0]['id'];
155 
156  $result=$uobject->fetch($sendtosocid);
157  $object=$uobject;
158  }
159 
160  }
161  }
162  }
163  else dol_print_error('','Use actions_sendmails.in.php for an element/object that is not supported');
164  }
165  else $thirdparty = $mysoc;
166 
167  if ($result > 0)
168  {
169  $sendto='';
170  $sendtocc='';
171  $sendtobcc='';
172  $sendtoid = array();
173 
174  // Define $sendto
175  $receiver=$_POST['receiver'];
176  if (! is_array($receiver))
177  {
178  if ($receiver == '-1') $receiver=array();
179  else $receiver=array($receiver);
180  }
181  $tmparray=array();
182  if (trim($_POST['sendto']))
183  {
184  // Recipients are provided into free text
185  $tmparray[] = trim($_POST['sendto']);
186  }
187  if (count($receiver)>0)
188  {
189  foreach($receiver as $key=>$val)
190  {
191  // Recipient was provided from combo list
192  if ($val == 'thirdparty') // Id of third party
193  {
194  $tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>';
195  }
196  elseif ($val) // Id du contact
197  {
198  $tmparray[] = $thirdparty->contact_get_property((int) $val,'email');
199  $sendtoid[] = $val;
200  }
201  }
202  }
203  $sendto=implode(',',$tmparray);
204 
205  // Define $sendtocc
206  $receivercc=$_POST['receivercc'];
207  if (! is_array($receivercc))
208  {
209  if ($receivercc == '-1') $receivercc=array();
210  else $receivercc=array($receivercc);
211  }
212  $tmparray=array();
213  if (trim($_POST['sendtocc']))
214  {
215  $tmparray[] = trim($_POST['sendtocc']);
216  }
217  if (count($receivercc) > 0)
218  {
219  foreach($receivercc as $key=>$val)
220  {
221  // Recipient was provided from combo list
222  if ($val == 'thirdparty') // Id of third party
223  {
224  $tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>';
225  }
226  elseif ($val) // Id du contact
227  {
228  $tmparray[] = $thirdparty->contact_get_property((int) $val,'email');
229  //$sendtoid[] = $val; TODO Add also id of contact in CC ?
230  }
231  }
232  }
233  $sendtocc=implode(',',$tmparray);
234 
235  if (dol_strlen($sendto))
236  {
237  // Define $urlwithroot
238  $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
239  $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
240  //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
241 
242  require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
243 
244  $langs->load("commercial");
245 
246  $fromtype = GETPOST('fromtype','alpha');
247  if ($fromtype === 'robot') {
248  $from = $conf->global->MAIN_MAIL_EMAIL_FROM .' <'.$conf->global->MAIN_MAIL_EMAIL_FROM.'>';
249  }
250  elseif ($fromtype === 'user') {
251  $from = $user->getFullName($langs) .' <'.$user->email.'>';
252  }
253  elseif ($fromtype === 'company') {
254  $from = $conf->global->MAIN_INFO_SOCIETE_NOM .' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>';
255  }
256  elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) {
257  $tmp=explode(',', $user->email_aliases);
258  $from = trim($tmp[($reg[1] - 1)]);
259  }
260  elseif (preg_match('/global_aliases_(\d+)/', $fromtype, $reg)) {
261  $tmp=explode(',', $conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES);
262  $from = trim($tmp[($reg[1] - 1)]);
263  }
264  elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) {
265  $sql='SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE rowid = '.(int) $reg[1];
266  $resql = $db->query($sql);
267  $obj = $db->fetch_object($resql);
268  if ($obj)
269  {
270  $from = $obj->label.' <'.$obj->email.'>';
271  }
272  }
273  else {
274  $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>';
275  }
276 
277  $replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
278  $message = GETPOST('message','none');
279  $subject = GETPOST('subject','none');
280 
281  // Make a change into HTML code to allow to include images from medias directory with an external reabable URL.
282  // <img alt="" src="/dolibarr_dev/htdocs/viewimage.php?modulepart=medias&amp;entity=1&amp;file=image/ldestailleur_166x166.jpg" style="height:166px; width:166px" />
283  // become
284  // <img alt="" src="'.$urlwithroot.'viewimage.php?modulepart=medias&amp;entity=1&amp;file=image/ldestailleur_166x166.jpg" style="height:166px; width:166px" />
285  $message=preg_replace('/(<img.*src=")[^\"]*viewimage\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^\/]*\/>)/', '\1'.$urlwithroot.'/viewimage.php\2modulepart=medias\3file=\4\5', $message);
286 
287  $sendtobcc= GETPOST('sendtoccc');
288  // Autocomplete the $sendtobcc
289  // $autocopy can be MAIN_MAIL_AUTOCOPY_PROPOSAL_TO, MAIN_MAIL_AUTOCOPY_ORDER_TO, MAIN_MAIL_AUTOCOPY_INVOICE_TO, MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO...
290  if (! empty($autocopy))
291  {
292  $sendtobcc .= (empty($conf->global->$autocopy) ? '' : (($sendtobcc?", ":"").$conf->global->$autocopy));
293  }
294 
295  $deliveryreceipt = $_POST['deliveryreceipt'];
296 
297  if ($action == 'send' || $action == 'relance')
298  {
299  $actionmsg2=$langs->transnoentities('MailSentBy').' '.CMailFile::getValidAddress($from,4,0,1).' '.$langs->transnoentities('To').' '.CMailFile::getValidAddress($sendto,4,0,1);
300  if ($message)
301  {
302  $actionmsg=$langs->transnoentities('MailFrom').': '.dol_escape_htmltag($from);
303  $actionmsg=dol_concatdesc($actionmsg, $langs->transnoentities('MailTo').': '.dol_escape_htmltag($sendto));
304  if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . dol_escape_htmltag($sendtocc));
305  $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
306  $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
307  $actionmsg = dol_concatdesc($actionmsg, $message);
308  }
309  }
310 
311  // Create form object
312  include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
313  $formmail = new FormMail($db);
314  $formmail->trackid = $trackid; // $trackid must be defined
315 
316  $attachedfiles=$formmail->get_attached_files();
317  $filepath = $attachedfiles['paths'];
318  $filename = $attachedfiles['names'];
319  $mimetype = $attachedfiles['mimes'];
320 
321 
322  // Feature to push mail sent into Sent folder
323  if (! empty($conf->dolimail->enabled))
324  {
325  $mailfromid = explode("#", $_POST['frommail'],3); // $_POST['frommail'] = 'aaa#Sent# <aaa@aaa.com>' // TODO Use a better way to define Sent dir.
326  if (count($mailfromid)==0) $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>';
327  else
328  {
329  $mbid = $mailfromid[1];
330 
331  /*IMAP Postbox*/
332  $mailboxconfig = new IMAP($db);
333  $mailboxconfig->fetch($mbid);
334  if ($mailboxconfig->mailbox_imap_host) $ref=$mailboxconfig->get_ref();
335 
336  $mailboxconfig->folder_id=$mailboxconfig->mailbox_imap_outbox;
337  $mailboxconfig->userfolder_fetch();
338 
339  if ($mailboxconfig->mailbox_save_sent_mails == 1)
340  {
341 
342  $folder=str_replace($ref, '', $mailboxconfig->folder_cache_key);
343  if (!$folder) $folder = "Sent"; // Default Sent folder
344 
345  $mailboxconfig->mbox = imap_open($mailboxconfig->get_connector_url().$folder, $mailboxconfig->mailbox_imap_login, $mailboxconfig->mailbox_imap_password);
346  if (FALSE === $mailboxconfig->mbox)
347  {
348  $info = FALSE;
349  $err = $langs->trans('Error3_Imap_Connection_Error');
350  setEventMessages($err,$mailboxconfig->element, null, 'errors');
351  }
352  else
353  {
354  $mailboxconfig->mailboxid=$_POST['frommail'];
355  $mailboxconfig->foldername=$folder;
356  $from = $mailfromid[0] . $mailfromid[2];
357  $imap=1;
358  }
359 
360  }
361  }
362  }
363 
364  // Make substitution in email content
365  $substitutionarray=getCommonSubstitutionArray($langs, 0, null, $object);
366  $substitutionarray['__EMAIL__'] = $sendto;
367  $substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty))?'<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>':'';
368 
369  $parameters=array('mode'=>'formemail');
370  complete_substitutions_array($substitutionarray, $langs, $object, $parameters);
371 
372  $subject=make_substitutions($subject, $substitutionarray);
373  $message=make_substitutions($message, $substitutionarray);
374 
375  if (method_exists($object, 'makeSubstitution'))
376  {
377  $subject = $object->makeSubstitution($subject);
378  $message = $object->makeSubstitution($message);
379  }
380 
381  // Send mail (substitutionarray must be done just before this)
382  if (empty($sendcontext)) $sendcontext = 'standard';
383  $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid,'', $sendcontext);
384 
385  if ($mailfile->error)
386  {
387  setEventMessage($mailfile->error, 'errors');
388  $action='presend';
389  }
390  else
391  {
392  $result=$mailfile->sendfile();
393  if ($result)
394  {
395  // FIXME This must be moved into the trigger for action $trigger_name
396  if (! empty($conf->dolimail->enabled))
397  {
398  $mid = (GETPOST('mid','int') ? GETPOST('mid','int') : 0); // Original mail id is set ?
399  if ($mid)
400  {
401  // set imap flag answered if it is an answered mail
402  $dolimail=new DoliMail($db);
403  $dolimail->id = $mid;
404  $res=$dolimail->set_prop($user, 'answered',1);
405  }
406  if ($imap==1)
407  {
408  // write mail to IMAP Server
409  $movemail = $mailboxconfig->putMail($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$folder,$deliveryreceipt,$mailfile);
410  if ($movemail) setEventMessages($langs->trans("MailMovedToImapFolder",$folder), null, 'mesgs');
411  else setEventMessages($langs->trans("MailMovedToImapFolder_Warning",$folder), null, 'warnings');
412  }
413  }
414 
415  // Initialisation of datas
416  if (is_object($object))
417  {
418  if (empty($actiontypecode)) $actiontypecode='AC_OTH_AUTO'; // Event insert into agenda automatically
419 
420  $object->socid = $sendtosocid; // To link to a company
421  $object->sendtoid = $sendtoid; // To link to contacts/addresses. This is an array.
422  $object->actiontypecode = $actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
423  $object->actionmsg = $actionmsg; // Long text
424  $object->actionmsg2 = $actionmsg2; // Short text
425  $object->trackid = $trackid;
426  $object->fk_element = $object->id;
427  $object->elementtype = $object->element;
428  if (is_array($attachedfiles) && count($attachedfiles)>0) {
429  $object->attachedfiles = $attachedfiles;
430  }
431 
432  // Call of triggers
433  if (! empty($trigger_name))
434  {
435  include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
436  $interface=new Interfaces($db);
437  $result=$interface->run_triggers($trigger_name,$object,$user,$langs,$conf);
438  if ($result < 0) {
439  setEventMessages($interface->error, $interface->errors, 'errors');
440  }
441  }
442  }
443 
444  // Redirect here
445  // This avoid sending mail twice if going out and then back to page
446  $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2));
447  setEventMessages($mesg, null, 'mesgs');
448  if ($conf->dolimail->enabled)
449  {
450  header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.(is_object($object)?$object->id:'').'&'.($paramname2?$paramname2:'mid').'='.$parm2val);
451  exit;
452  }
453  header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.(is_object($object)?$object->id:''));
454  exit;
455  }
456  else
457  {
458  $langs->load("other");
459  $mesg='<div class="error">';
460  if ($mailfile->error)
461  {
462  $mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
463  $mesg.='<br>'.$mailfile->error;
464  }
465  else
466  {
467  $mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS';
468  }
469  $mesg.='</div>';
470 
471  setEventMessages($mesg, null, 'warnings');
472  $action = 'presend';
473  }
474  }
475  }
476  else
477  {
478  $langs->load("errors");
479  setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("MailTo")), null, 'warnings');
480  dol_syslog('Try to send email with no recipient defined', LOG_WARNING);
481  $action = 'presend';
482  }
483  }
484  else
485  {
486  $langs->load("other");
487  setEventMessages($langs->trans('ErrorFailedToReadObject',$object->element), null, 'errors');
488  dol_syslog('Failed to read data of object id='.$object->id.' element='.$object->element);
489  $action = 'presend';
490  }
491 
492 }
Classe permettant la generation du formulaire html d'envoi de mail unitaire Usage: $formail = new For...
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
dol_remove_file_process($filenb, $donotupdatesession=0, $donotdeletefile=1, $trackid='')
Remove an uploaded file (for example after submitting a new file a mail form).
Definition: files.lib.php:1640
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
dol_concatdesc($text1, $text2, $forxml=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null)
Return array of possible common substitutions.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
static getValidAddress($address, $format, $encode=0, $maxnumberofemail=0)
Return a formatted address string for SMTP protocol.
dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesession=0, $varfiles='addedfile', $savingdocmask='', $link=null, $trackid='', $generatethumbs=1)
Get and save an upload file (for example after submitting a new file a mail form).
Definition: files.lib.php:1478
Class to send emails (with attachments or not) Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to,$css,$trackid,$moreinheader,$sendcontext); $mailfile->sendfile();.
setEventMessage($mesgs, $style='mesgs')
Set event message in dol_events session object.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if(!empty($conf->fournisseur->enabled)&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->societe->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if(!empty($conf->fournisseur->enabled)&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1013
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null)
Remove a file or several files with a mask.
Definition: files.lib.php:1103
make_substitutions($text, $substitutionarray, $outputlangs=null)
Make substition into a text string, replacing keys with vals from $substitutionarray (oldval=>newval)...
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
Class to manage triggers.
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...