dolibarr  9.0.0
mailing.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
26 require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
27 
28 
32 class Mailing extends CommonObject
33 {
37  public $element='mailing';
38 
42  public $table_element='mailing';
43 
47  public $picto='email';
48 
49  public $titre;
50  public $sujet;
51  public $body;
52  public $nbemail;
53  public $bgcolor;
54  public $bgimage;
55 
56  public $statut; // Status 0=Draft, 1=Validated, 2=Sent partially, 3=Sent completely
57 
58  public $email_from;
59  public $email_replyto;
60  public $email_errorsto;
61 
62  public $joined_file1;
63  public $joined_file2;
64  public $joined_file3;
65  public $joined_file4;
66 
67  public $user_creat;
68  public $user_valid;
69 
70  public $date_creat;
71  public $date_valid;
72 
73  public $extraparams=array();
74 
75  public $statut_dest=array();
76  public $statuts=array();
77 
78 
84  function __construct($db)
85  {
86  $this->db = $db;
87 
88  // List of language codes for status
89  $this->statuts[0] = 'MailingStatusDraft';
90  $this->statuts[1] = 'MailingStatusValidated';
91  $this->statuts[2] = 'MailingStatusSentPartialy';
92  $this->statuts[3] = 'MailingStatusSentCompletely';
93 
94  $this->statut_dest[-1] = 'MailingStatusError';
95  $this->statut_dest[0] = 'MailingStatusNotSent';
96  $this->statut_dest[1] = 'MailingStatusSent';
97  $this->statut_dest[2] = 'MailingStatusRead';
98  $this->statut_dest[3] = 'MailingStatusReadAndUnsubscribe'; // Read but ask to not be contacted anymore
99  }
100 
107  function create($user)
108  {
109  global $conf, $langs;
110 
111  $this->db->begin();
112 
113  $this->titre=trim($this->titre);
114  $this->email_from=trim($this->email_from);
115 
116  if (! $this->email_from)
117  {
118  $this->error = $langs->trans("ErrorMailFromRequired");
119  return -1;
120  }
121 
122  $now=dol_now();
123 
124  $sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing";
125  $sql .= " (date_creat, fk_user_creat, entity)";
126  $sql .= " VALUES ('".$this->db->idate($now)."', ".$user->id.", ".$conf->entity.")";
127 
128  if (! $this->titre)
129  {
130  $this->titre = $langs->trans("NoTitle");
131  }
132 
133  dol_syslog("Mailing::Create", LOG_DEBUG);
134  $result=$this->db->query($sql);
135  if ($result)
136  {
137  $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."mailing");
138 
139  if ($this->update($user) > 0)
140  {
141  $this->db->commit();
142  }
143  else
144  {
145  $this->error=$this->db->lasterror();
146  $this->db->rollback();
147  return -1;
148  }
149 
150  return $this->id;
151  }
152  else
153  {
154  $this->error=$this->db->lasterror();
155  $this->db->rollback();
156  return -1;
157  }
158  }
159 
166  function update($user)
167  {
168  $sql = "UPDATE ".MAIN_DB_PREFIX."mailing ";
169  $sql .= " SET titre = '".$this->db->escape($this->titre)."'";
170  $sql .= ", sujet = '".$this->db->escape($this->sujet)."'";
171  $sql .= ", body = '".$this->db->escape($this->body)."'";
172  $sql .= ", email_from = '".$this->db->escape($this->email_from)."'";
173  $sql .= ", email_replyto = '".$this->db->escape($this->email_replyto)."'";
174  $sql .= ", email_errorsto = '".$this->db->escape($this->email_errorsto)."'";
175  $sql .= ", bgcolor = '".($this->bgcolor?$this->db->escape($this->bgcolor):null)."'";
176  $sql .= ", bgimage = '".($this->bgimage?$this->db->escape($this->bgimage):null)."'";
177  $sql .= " WHERE rowid = ".$this->id;
178 
179  dol_syslog("Mailing::Update", LOG_DEBUG);
180  $result=$this->db->query($sql);
181  if ($result)
182  {
183  return 1;
184  }
185  else
186  {
187  $this->error=$this->db->lasterror();
188  return -1;
189  }
190  }
191 
198  function fetch($rowid)
199  {
200  global $conf;
201 
202  $sql = "SELECT m.rowid, m.titre, m.sujet, m.body, m.bgcolor, m.bgimage";
203  $sql.= ", m.email_from, m.email_replyto, m.email_errorsto";
204  $sql.= ", m.statut, m.nbemail";
205  $sql.= ", m.fk_user_creat, m.fk_user_valid";
206  $sql.= ", m.date_creat";
207  $sql.= ", m.date_valid";
208  $sql.= ", m.date_envoi";
209  $sql.= ", m.extraparams";
210  $sql.= " FROM ".MAIN_DB_PREFIX."mailing as m";
211  $sql.= " WHERE m.rowid = ".(int) $rowid;
212 
213  dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
214  $result=$this->db->query($sql);
215  if ($result)
216  {
217  if ($this->db->num_rows($result))
218  {
219  $obj = $this->db->fetch_object($result);
220 
221  $this->id = $obj->rowid;
222  $this->ref = $obj->rowid;
223  $this->statut = $obj->statut;
224  $this->nbemail = $obj->nbemail;
225  $this->titre = $obj->titre;
226 
227  $this->sujet = $obj->sujet;
228  if (!empty($conf->global->FCKEDITOR_ENABLE_MAILING) && dol_textishtml(dol_html_entity_decode($obj->body, ENT_COMPAT | ENT_HTML401))) {
229  $this->body = dol_html_entity_decode($obj->body, ENT_COMPAT | ENT_HTML401);
230  }else {
231  $this->body = $obj->body;
232  }
233 
234  $this->bgcolor = $obj->bgcolor;
235  $this->bgimage = $obj->bgimage;
236 
237  $this->email_from = $obj->email_from;
238  $this->email_replyto = $obj->email_replyto;
239  $this->email_errorsto = $obj->email_errorsto;
240 
241  $this->user_creat = $obj->fk_user_creat;
242  $this->user_valid = $obj->fk_user_valid;
243 
244  $this->date_creat = $this->db->jdate($obj->date_creat);
245  $this->date_valid = $this->db->jdate($obj->date_valid);
246  $this->date_envoi = $this->db->jdate($obj->date_envoi);
247 
248  $this->extraparams = (array) json_decode($obj->extraparams, true);
249 
250  return 1;
251  }
252  else
253  {
254  dol_syslog(get_class($this)."::fetch Erreur -1");
255  return -1;
256  }
257  }
258  else
259  {
260  dol_syslog(get_class($this)."::fetch Erreur -2");
261  return -2;
262  }
263  }
264 
265 
274  function createFromClone($fromid,$option1,$option2)
275  {
276  global $user,$langs;
277 
278  $error=0;
279 
280  $object=new Mailing($this->db);
281 
282  $this->db->begin();
283 
284  // Load source object
285  $object->fetch($fromid);
286  $object->id=0;
287  $object->statut=0;
288 
289  // Clear fields
290  $object->titre=$langs->trans("CopyOf").' '.$object->titre.' '.dol_print_date(dol_now());
291 
292  // If no option copy content
293  if (empty($option1))
294  {
295  // Clear values
296  $object->nbemail = 0;
297  $object->sujet = '';
298  $object->body = '';
299  $object->bgcolor = '';
300  $object->bgimage = '';
301 
302  $object->email_from = '';
303  $object->email_replyto = '';
304  $object->email_errorsto = '';
305 
306  $object->user_creat = $user->id;
307  $object->user_valid = '';
308 
309  $object->date_creat = '';
310  $object->date_valid = '';
311  $object->date_envoi = '';
312  }
313 
314  // Create clone
315  $object->context['createfromclone']='createfromclone';
316  $result=$object->create($user);
317 
318  // Other options
319  if ($result < 0)
320  {
321  $this->error=$object->error;
322  $this->errors=array_merge($this->errors, $object->errors);
323  $error++;
324  }
325 
326  if (! $error)
327  {
328  //Clone target
329  if (!empty($option2)) {
330 
331  require_once DOL_DOCUMENT_ROOT .'/core/modules/mailings/modules_mailings.php';
332 
333  $mailing_target = new MailingTargets($this->db);
334 
335  $target_array=array();
336 
337  $sql = "SELECT fk_contact, ";
338  $sql.=" lastname, ";
339  $sql.=" firstname,";
340  $sql.=" email,";
341  $sql.=" other,";
342  $sql.=" source_url,";
343  $sql.=" source_id ,";
344  $sql.=" source_type ";
345  $sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles ";
346  $sql.= " WHERE fk_mailing = ".$fromid;
347 
348  $result=$this->db->query($sql);
349  if ($result)
350  {
351  if ($this->db->num_rows($result))
352  {
353  while ($obj = $this->db->fetch_object($result)) {
354 
355  $target_array[]=array('fk_contact'=>$obj->fk_contact,
356  'lastname'=>$obj->lastname,
357  'firstname'=>$obj->firstname,
358  'email'=>$obj->email,
359  'other'=>$obj->other,
360  'source_url'=>$obj->source_url,
361  'source_id'=>$obj->source_id,
362  'source_type'=>$obj->source_type);
363  }
364  }
365  }
366  else
367  {
368  $this->error=$this->db->lasterror();
369  return -1;
370  }
371 
372  $mailing_target->add_to_target($object->id, $target_array);
373  }
374  }
375 
376  unset($object->context['createfromclone']);
377 
378  // End
379  if (! $error)
380  {
381  $this->db->commit();
382  return $object->id;
383  }
384  else
385  {
386  $this->db->rollback();
387  return -1;
388  }
389  }
390 
397  function valid($user)
398  {
399  $now=dol_now();
400 
401  $sql = "UPDATE ".MAIN_DB_PREFIX."mailing ";
402  $sql .= " SET statut = 1, date_valid = '".$this->db->idate($now)."', fk_user_valid=".$user->id;
403  $sql .= " WHERE rowid = ".$this->id;
404 
405  dol_syslog("Mailing::valid", LOG_DEBUG);
406  if ($this->db->query($sql))
407  {
408  return 1;
409  }
410  else
411  {
412  $this->error=$this->db->lasterror();
413  return -1;
414  }
415  }
416 
417 
424  function delete($rowid)
425  {
426  $sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing";
427  $sql.= " WHERE rowid = ".$rowid;
428 
429  dol_syslog("Mailing::delete", LOG_DEBUG);
430  $resql=$this->db->query($sql);
431  if ($resql)
432  {
433  return $this->delete_targets();
434  }
435  else
436  {
437  $this->error=$this->db->lasterror();
438  return -1;
439  }
440  }
441 
442  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
448  function delete_targets()
449  {
450  // phpcs:enable
451  $sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles";
452  $sql.= " WHERE fk_mailing = ".$this->id;
453 
454  dol_syslog("Mailing::delete_targets", LOG_DEBUG);
455  $resql=$this->db->query($sql);
456  if ($resql)
457  {
458  return 1;
459  }
460  else
461  {
462  $this->error=$this->db->lasterror();
463  return 0;
464  }
465  }
466 
467 
468  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
475  function reset_targets_status($user)
476  {
477  // phpcs:enable
478  $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
479  $sql.= " SET statut = 0";
480  $sql.= " WHERE fk_mailing = ".$this->id;
481 
482  dol_syslog("Mailing::reset_targets_status", LOG_DEBUG);
483  $resql=$this->db->query($sql);
484  if ($resql)
485  {
486  return 1;
487  }
488  else
489  {
490  $this->error=$this->db->lasterror();
491  return -1;
492  }
493  }
494 
495 
502  function countNbOfTargets($mode)
503  {
504  $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."mailing_cibles";
505  $sql.= " WHERE fk_mailing = ".$this->id;
506  if ($mode == 'alreadysent') $sql.= " AND statut <> 0";
507  elseif ($mode == 'alreadysentok') $sql.= " AND statut > 0";
508  elseif ($mode == 'alreadysentko') $sql.= " AND statut = -1";
509  else
510  {
511  $this->error='BadValueForParameterMode';
512  return -2;
513  }
514 
515  $resql=$this->db->query($sql);
516  if ($resql)
517  {
518  $obj = $this->db->fetch_object($resql);
519  if ($obj) return $obj->nb;
520  }
521  else
522  {
523  $this->error=$this->db->lasterror();
524  return -1;
525  }
526  return 0;
527  }
528 
529 
540  function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
541  {
542  global $db, $conf, $langs, $hookmanager;
543  global $dolibarr_main_authentication, $dolibarr_main_demo;
544  global $menumanager;
545 
546  if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
547 
548  $result = '';
549  $companylink = '';
550 
551  $label = '<u>' . $langs->trans("ShowEmailing") . '</u>';
552  $label.= '<br>';
553  $label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
554 
555  $url = DOL_URL_ROOT.'/comm/mailing/card.php?id='.$this->id;
556 
557  if ($option != 'nolink')
558  {
559  // Add param to save lastsearch_values or not
560  $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
561  if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
562  if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
563  }
564 
565  $linkclose='';
566  if (empty($notooltip))
567  {
568  if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
569  {
570  $label=$langs->trans("ShowEmailing");
571  $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
572  }
573  $linkclose.=' title="'.dol_escape_htmltag($label, 1).'"';
574  $linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
575 
576  /*
577  $hookmanager->initHooks(array('myobjectdao'));
578  $parameters=array('id'=>$this->id);
579  $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
580  if ($reshook > 0) $linkclose = $hookmanager->resPrint;
581  */
582  }
583  else $linkclose = ($morecss?' class="'.$morecss.'"':'');
584 
585  $linkstart = '<a href="'.$url.'"';
586  $linkstart.=$linkclose.'>';
587  $linkend='</a>';
588 
589  $result .= $linkstart;
590  if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
591  if ($withpicto != 2) $result.= $this->ref;
592  $result .= $linkend;
593  //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
594 
595  global $action;
596  $hookmanager->initHooks(array('emailingdao'));
597  $parameters=array('id'=>$this->id, 'getnomurl'=>$result);
598  $reshook=$hookmanager->executeHooks('getNomUrl',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
599  if ($reshook > 0) $result = $hookmanager->resPrint;
600  else $result .= $hookmanager->resPrint;
601 
602  return $result;
603  }
604 
611  function getLibStatut($mode=0)
612  {
613  return $this->LibStatut($this->statut,$mode);
614  }
615 
616  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
624  function LibStatut($statut,$mode=0)
625  {
626  // phpcs:enable
627  global $langs;
628  $langs->load('mails');
629 
630  if ($mode == 0 || $mode == 1)
631  {
632  return $langs->trans($this->statuts[$statut]);
633  }
634  elseif ($mode == 2)
635  {
636  if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
637  if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]);
638  if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]);
639  if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
640  }
641  elseif ($mode == 3)
642  {
643  if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0');
644  if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1');
645  if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3');
646  if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6');
647  }
648  elseif ($mode == 4)
649  {
650  if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
651  if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]);
652  if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]);
653  if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
654  }
655  elseif ($mode == 5)
656  {
657  if ($statut == 0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut0');
658  if ($statut == 1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut1');
659  if ($statut == 2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut3');
660  if ($statut == 3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut6');
661  }
662  }
663 
664 
674  public static function libStatutDest($statut,$mode=0,$desc='')
675  {
676  global $langs;
677  $langs->load('mails');
678 
679  if ($mode == 0)
680  {
681  return $langs->trans('MailingStatusError');
682  }
683  elseif ($mode == 1)
684  {
685  return $langs->trans('MailingStatusSent');
686  }
687  elseif ($mode == 2)
688  {
689  if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
690  if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
691  if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4');
692  if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3');
693  }
694  elseif ($mode == 3)
695  {
696  if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
697  if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
698  if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4');
699  if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3');
700  }
701  elseif ($mode == 4)
702  {
703  if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
704  if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
705  if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4');
706  if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3');
707  }
708  elseif ($mode == 5)
709  {
710  if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
711  if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
712  if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4');
713  if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3');
714  }
715  elseif ($mode == 6)
716  {
717  if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
718  if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
719  if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4');
720  if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3');
721  }
722  }
723 }
img_error($titlealt='default')
Show error logo.
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:1053
getLibStatut($mode=0)
Return label of status of emailing (draft, validated, ...)
update($user)
Update emailing record.
delete_targets()
Delete targets emailing.
createFromClone($fromid, $option1, $option2)
Load an object from its id and create a new one in database.
create($user)
Create an EMailing.
static libStatutDest($statut, $mode=0, $desc='')
Renvoi le libelle d&#39;un statut donne TODO Add class mailin_target.class.php.
countNbOfTargets($mode)
Count number of target with status.
valid($user)
Validate emailing.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Return a link to the object card (with optionaly the picto)
Class to manage emailings module.
dol_now($mode='gmt')
Return date for now.
reset_targets_status($user)
Change status of each recipient.
fetch($rowid)
Get object from database.
__construct($db)
Constructor.
dol_print_date($time, $format='', $tzoutput='tzserver', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_html_entity_decode($a, $b, $c='UTF-8')
Replace html_entity_decode functions to manage errors.
LibStatut($statut, $mode=0)
Renvoi le libelle d&#39;un statut donne.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
Show picto whatever it&#39;s its name (generic function)
Parent class of all other business classes (invoices, contracts, proposals, orders, ...)
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
Parent class of emailing target selectors modules.
dol_textishtml($msg, $option=0)
Return if a text is a html content.