dolibarr 21.0.0-beta
MailingTargets Class Reference

Parent class of emailing target selectors modules. More...

Inheritance diagram for MailingTargets:

Public Member Functions

 __construct ($db)
 Constructor.
 
 getDesc ()
 Return description of email selector.
 
 getNbOfRecords ()
 Return number of records for email selector.
 
 getNbOfRecipients ($sql)
 Retourne nombre de destinataires.
 
 formFilter ()
 Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings.
 
 update_nb ($mailing_id)
 Met a jour nombre de destinataires.
 
 addTargetsToDatabase ($mailing_id, $cibles)
 Add a list of targets into the database.
 
 clear_target ($mailing_id)
 Supprime tous les destinataires de la table des cibles.
 
 getSqlArrayForStats ()
 On the main mailing area, there is a box with statistics.
 
 add_to_target ($mailing_id)
 Add destinations in the targets table.
 

Static Public Member Functions

static getEmailingSelectorsList ($forcedir=null)
 Return list of widget.
 

Detailed Description

Parent class of emailing target selectors modules.

Definition at line 33 of file modules_mailings.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ add_to_target()

MailingTargets::add_to_target ( $mailing_id)

Add destinations in the targets table.

Parameters
int$mailing_idId of emailing
Returns
int Return integer < 0 on error, count of added when ok

Reimplemented in mailing_contacts1, mailing_eventorganization, mailing_fraise, mailing_mailing_mymodule_selector1, mailing_partnership, mailing_pomme, mailing_thirdparties, mailing_thirdparties_services_expired, mailing_xinputfile, and mailing_xinputuser.

Definition at line 460 of file modules_mailings.php.

References dol_syslog().

◆ addTargetsToDatabase()

MailingTargets::addTargetsToDatabase ( $mailing_id,
$cibles )

Add a list of targets into the database.

Parameters
int$mailing_idId of emailing
array<array{fk_contact?:int,lastname:string,firstname:string,email:string,other:string,source_url:string,source_id?:int,source_type:string,id?:int}>$cibles Array with targets
Returns
int Return integer < 0 if error, nb added if OK

Definition at line 199 of file modules_mailings.php.

References $conf, dol_hash(), dol_print_error(), dol_syslog(), getDolGlobalString(), and update_nb().

◆ clear_target()

MailingTargets::clear_target ( $mailing_id)

Supprime tous les destinataires de la table des cibles.

Parameters
int$mailing_idId of emailing
Returns
void

Definition at line 291 of file modules_mailings.php.

References dol_syslog(), and update_nb().

◆ formFilter()

MailingTargets::formFilter ( )

Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings.

Returns
string Retourne zone select

Reimplemented in mailing_advthirdparties, mailing_contacts1, mailing_eventorganization, mailing_fraise, mailing_mailing_mymodule_selector1, mailing_partnership, mailing_pomme, mailing_thirdparties, mailing_thirdparties_services_expired, mailing_xinputfile, and mailing_xinputuser.

Definition at line 156 of file modules_mailings.php.

◆ getDesc()

MailingTargets::getDesc ( )

Return description of email selector.

Returns
string Return translation of module label. Try translation of $this->name then translation of 'MailingModuleDesc'.$this->name, or $this->desc if not found

Definition at line 97 of file modules_mailings.php.

References name.

◆ getEmailingSelectorsList()

static MailingTargets::getEmailingSelectorsList ( $forcedir = null)
static

Return list of widget.

Function used by admin page htdoc/admin/widget. List is sorted by widget filename so by priority to run.

Parameters
?array<string>$forcedir null=All default directories. This parameter is used by modulebuilder module only.
Returns
array<array{picto:string,file:string,fullpath:string,relpath:string,iscoreorexternal:'external'|'internal',version:string,status:string,info:string}> Array list of widgets

Definition at line 312 of file modules_mailings.php.

References dol_buildpath(), dol_osencode(), img_object(), and img_picto().

◆ getNbOfRecipients()

MailingTargets::getNbOfRecipients ( $sql)

Retourne nombre de destinataires.

Parameters
string$sqlSql request to count
Returns
int|string Nb of recipient, or <0 if error, or '' if NA

Reimplemented in mailing_advthirdparties, mailing_contacts1, mailing_eventorganization, mailing_fraise, mailing_mailing_mymodule_selector1, mailing_partnership, mailing_pomme, mailing_thirdparties, mailing_thirdparties_services_expired, mailing_xinputfile, and mailing_xinputuser.

Definition at line 135 of file modules_mailings.php.

◆ getNbOfRecords()

MailingTargets::getNbOfRecords ( )

Return number of records for email selector.

Returns
integer Example

Definition at line 124 of file modules_mailings.php.

◆ getSqlArrayForStats()

MailingTargets::getSqlArrayForStats ( )

On the main mailing area, there is a box with statistics.

If you want to add a line in this report you must provide an array of SQL request that returns two field: One called "label", One called "nb".

Returns
string[] Array with SQL requests

Reimplemented in mailing_advthirdparties, mailing_contacts1, mailing_eventorganization, mailing_fraise, mailing_mailing_mymodule_selector1, mailing_partnership, mailing_pomme, mailing_thirdparties, mailing_thirdparties_services_expired, mailing_xinputfile, and mailing_xinputuser.

Definition at line 445 of file modules_mailings.php.

References dol_syslog().

◆ update_nb()

MailingTargets::update_nb ( $mailing_id)

Met a jour nombre de destinataires.

Parameters
int$mailing_idId of emailing
Returns
int Return integer < 0 si erreur, nb destinataires si ok

Definition at line 168 of file modules_mailings.php.

References dol_syslog().

Referenced by addTargetsToDatabase(), and clear_target().


The documentation for this class was generated from the following file: