Skip to content
Snippets Groups Projects
Commit af4d8326 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Debug of new emailing modules: Add link to third party, and removed some too long statistics.

Also I rename modules to have them sorted by theme elements.
parent 37b0dcfe
Branches
Tags
No related merge requests found
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
*/ */
/** /**
* \file htdocs/includes/modules/mailings/poire.modules.php * \file htdocs/includes/modules/mailings/contact1.modules.php
* \ingroup mailing * \ingroup mailing
* \brief File of class to offer a selector of emailing targets with Rule 'Poire'. * \brief File of class to offer a selector of emailing targets with Rule 'Poire'.
* \version $Id$ * \version $Id$
...@@ -30,10 +30,10 @@ include_once DOL_DOCUMENT_ROOT.'/includes/modules/mailings/modules_mailings.php' ...@@ -30,10 +30,10 @@ include_once DOL_DOCUMENT_ROOT.'/includes/modules/mailings/modules_mailings.php'
/** /**
* \class mailing_poire * \class mailing_contact1
* \brief Class to offer a selector of emailing targets with Rule 'Poire'. * \brief Class to offer a selector of emailing targets with Rule 'Poire'.
*/ */
class mailing_poire extends MailingTargets class mailing_contact1 extends MailingTargets
{ {
var $name='ContactCompanies'; // Identifiant du module mailing var $name='ContactCompanies'; // Identifiant du module mailing
var $desc='Contacts des tiers (prospects, clients, fournisseurs...)'; // Libell� utilis� si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv�e var $desc='Contacts des tiers (prospects, clients, fournisseurs...)'; // Libell� utilis� si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv�e
...@@ -44,7 +44,7 @@ class mailing_poire extends MailingTargets ...@@ -44,7 +44,7 @@ class mailing_poire extends MailingTargets
var $db; var $db;
function mailing_poire($DB) function mailing_contact1($DB)
{ {
$this->db=$DB; $this->db=$DB;
} }
...@@ -57,15 +57,15 @@ class mailing_poire extends MailingTargets ...@@ -57,15 +57,15 @@ class mailing_poire extends MailingTargets
$langs->load("commercial"); $langs->load("commercial");
$statssql=array(); $statssql=array();
$statssql[0] = "SELECT '".$langs->trans("NbOfCompaniesContacts")."' as label"; $statssql[0] = "SELECT '".$langs->trans("NbOfCompaniesContacts")."' as label,";
$statssql[0].= ", count(distinct(c.email)) as nb"; $statssql[0].= " count(distinct(c.email)) as nb";
$statssql[0].= " FROM ".MAIN_DB_PREFIX."socpeople as c"; $statssql[0].= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$statssql[0].= ", ".MAIN_DB_PREFIX."societe as s"; $statssql[0].= " ".MAIN_DB_PREFIX."societe as s";
$statssql[0].= " WHERE s.rowid = c.fk_soc"; $statssql[0].= " WHERE s.rowid = c.fk_soc";
$statssql[0].= " AND s.entity = ".$conf->entity; $statssql[0].= " AND s.entity = ".$conf->entity;
$statssql[0].= " AND c.entity = ".$conf->entity; $statssql[0].= " AND c.entity = ".$conf->entity;
$statssql[0].= " AND s.client IN (1, 3)"; $statssql[0].= " AND s.client IN (1, 3)";
$statssql[0].= " AND c.email != ''"; $statssql[0].= " AND c.email != ''"; // Note that null != '' is false
return $statssql; return $statssql;
} }
...@@ -82,12 +82,12 @@ class mailing_poire extends MailingTargets ...@@ -82,12 +82,12 @@ class mailing_poire extends MailingTargets
global $conf; global $conf;
$sql = "SELECT count(distinct(c.email)) as nb"; $sql = "SELECT count(distinct(c.email)) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$sql .= ", ".MAIN_DB_PREFIX."societe as s"; $sql .= " ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE s.rowid = c.fk_soc"; $sql .= " WHERE s.rowid = c.fk_soc";
$sql .= " AND c.entity = ".$conf->entity; $sql .= " AND c.entity = ".$conf->entity;
$sql .= " AND s.entity = ".$conf->entity; $sql .= " AND s.entity = ".$conf->entity;
$sql .= " AND c.email != ''"; $sql .= " AND c.email != ''"; // Note that null != '' is false
// La requete doit retourner un champ "nb" pour etre comprise // La requete doit retourner un champ "nb" pour etre comprise
// par parent::getNbOfRecipients // par parent::getNbOfRecipients
...@@ -226,7 +226,7 @@ class mailing_poire extends MailingTargets ...@@ -226,7 +226,7 @@ class mailing_poire extends MailingTargets
'firstname' => $obj->firstname, 'firstname' => $obj->firstname,
'other' => 'other' =>
($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'.
($langs->transnoentities("Civility").'='.$langs->transnoentities("Civility".$obj->civilite)), ($langs->transnoentities("Civility").'='.($obj->civilite?$langs->transnoentities("Civility".$obj->civilite):'')),
'source_url' => $this->url($obj->id), 'source_url' => $this->url($obj->id),
'source_id' => $obj->id, 'source_id' => $obj->id,
'source_type' => 'contact' 'source_type' => 'contact'
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
/** /**
* \file htdocs/includes/modules/mailings/myrtille.modules.php * \file htdocs/includes/modules/mailings/contacts2.modules.php
* \ingroup mailing * \ingroup mailing
* \brief Provides a list of recipients for mailing module * \brief Provides a list of recipients for mailing module
* \version $Revision$ * \version $Revision$
...@@ -28,10 +28,10 @@ include_once DOL_DOCUMENT_ROOT.'/includes/modules/mailings/modules_mailings.php' ...@@ -28,10 +28,10 @@ include_once DOL_DOCUMENT_ROOT.'/includes/modules/mailings/modules_mailings.php'
/** /**
* \class mailing_myrtille * \class mailing_contacts2
* \brief Class to manage a list of personalised recipients for mailing feature * \brief Class to manage a list of personalised recipients for mailing feature
*/ */
class mailing_myrtille extends MailingTargets class mailing_contacts2 extends MailingTargets
{ {
var $name='ContactsByFunction'; var $name='ContactsByFunction';
// This label is used if no translation is found for key MailingModuleDescXXX where XXX=name is found // This label is used if no translation is found for key MailingModuleDescXXX where XXX=name is found
...@@ -43,12 +43,21 @@ class mailing_myrtille extends MailingTargets ...@@ -43,12 +43,21 @@ class mailing_myrtille extends MailingTargets
var $db; var $db;
function mailing_myrtille($DB) function mailing_contacts2($DB)
{ {
$this->db=$DB; $this->db=$DB;
} }
/**
* \brief Renvoie url lien vers fiche de la source du destinataire du mailing
* \return string Url lien
*/
function url($id)
{
return '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$id.'">'.img_object('',"contact").'</a>';
}
/** /**
* This is the main function that returns the array of emails * This is the main function that returns the array of emails
* @param mailing_id Id of mailing. No need to use it. * @param mailing_id Id of mailing. No need to use it.
...@@ -57,18 +66,21 @@ class mailing_myrtille extends MailingTargets ...@@ -57,18 +66,21 @@ class mailing_myrtille extends MailingTargets
*/ */
function add_to_target($mailing_id,$filtersarray=array()) function add_to_target($mailing_id,$filtersarray=array())
{ {
global $conf; global $conf,$langs;
$target = array(); $target = array();
$sql = "SELECT sp.rowid, sp.email, sp.name, sp.firstname"; // La requete doit retourner: id, email, fk_contact, name, firstname, other
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,";
$sql.= " WHERE (sp.email IS NOT NULL AND sp.email != '')"; $sql.= " sp.name as name, sp.firstname as firstname, sp.civilite,";
$sql.= " AND (sp.poste IS NOT NULL AND sp.poste != '')"; $sql.= " s.nom as companyname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE s.rowid = sp.fk_soc";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.entity = ".$conf->entity; $sql.= " AND sp.entity = ".$conf->entity;
if ($filtersarray[0]<>'all') $sql.= " AND sp.poste ='".$filtersarray[0]."'"; if ($filtersarray[0]<>'all') $sql.= " AND sp.poste ='".$filtersarray[0]."'";
$sql.= " ORDER BY sp.name, sp.firstname"; $sql.= " ORDER BY sp.name, sp.firstname";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
...@@ -79,10 +91,15 @@ class mailing_myrtille extends MailingTargets ...@@ -79,10 +91,15 @@ class mailing_myrtille extends MailingTargets
$obj= $this->db->fetch_object($resql); $obj= $this->db->fetch_object($resql);
$target[] = array( $target[] = array(
'email' => $obj->email, 'email' => $obj->email,
'fk_contact' => $obj->fk_contact,
'name' => $obj->name, 'name' => $obj->name,
'firstname' => $obj->firstname, 'firstname' => $obj->firstname,
'other' => $other, 'other' =>
'url' => '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->rowid.'">'.img_object('',"contact").'</a>' ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'.
($langs->transnoentities("Civility").'='.($obj->civilite?$langs->transnoentities("Civility".$obj->civilite):'')),
'source_url' => $this->url($obj->id),
'source_id' => $obj->id,
'source_type' => 'contact'
); );
$i++; $i++;
} }
...@@ -104,17 +121,19 @@ class mailing_myrtille extends MailingTargets ...@@ -104,17 +121,19 @@ class mailing_myrtille extends MailingTargets
global $conf; global $conf;
$statssql=array(); $statssql=array();
for ($i=0; $i<5; $i++) { /*for ($i=0; $i<5; $i++) {
$statssql[$i] = "SELECT sp.poste as label"; $statssql[$i] = "SELECT sp.poste as label";
$statssql[$i].= ", count(distinct(sp.email)) as nb"; $statssql[$i].= ", count(distinct(sp.email)) as nb";
$statssql[$i].= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $statssql[$i].= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$statssql[$i].= " WHERE (sp.email IS NOT NULL AND sp.email != '')"; $statssql[$i].= " ".MAIN_DB_PREFIX."societe as s";
$statssql[$i].= " WHERE s.rowid = sp.fk_soc";
$statssql[$i].= " AND sp.email != ''"; // Note that null != '' is false
$statssql[$i].= " AND (sp.poste IS NOT NULL AND sp.poste != '')"; $statssql[$i].= " AND (sp.poste IS NOT NULL AND sp.poste != '')";
$statssql[$i].= " AND sp.entity = ".$conf->entity; $statssql[$i].= " AND sp.entity = ".$conf->entity;
$statssql[$i].= " GROUP BY label"; $statssql[$i].= " GROUP BY label";
$statssql[$i].= " ORDER BY nb DESC"; $statssql[$i].= " ORDER BY nb DESC";
$statssql[$i].= " LIMIT $i,1"; $statssql[$i].= " LIMIT $i,1";
} }*/
return $statssql; return $statssql;
} }
...@@ -129,11 +148,12 @@ class mailing_myrtille extends MailingTargets ...@@ -129,11 +148,12 @@ class mailing_myrtille extends MailingTargets
global $conf; global $conf;
$sql = "SELECT count(distinct(sp.email)) as nb"; $sql = "SELECT count(distinct(sp.email)) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$sql.= " WHERE sp.entity = ".$conf->entity; $sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " AND (sp.email IS NOT NULL AND sp.email != '')"; $sql.= " WHERE s.rowid = sp.fk_soc";
$sql.= " AND (sp.poste IS NOT NULL AND sp.poste != '')"; $sql.= " AND s.entity = ".$conf->entity;
$sql.= " AND sp.entity = ".$conf->entity;
$sql.= " AND sp.email != ''"; // Note that null != '' is false
// La requete doit retourner un champ "nb" pour etre comprise // La requete doit retourner un champ "nb" pour etre comprise
// par parent::getNbOfRecipients // par parent::getNbOfRecipients
return parent::getNbOfRecipients($sql); return parent::getNbOfRecipients($sql);
...@@ -151,9 +171,11 @@ class mailing_myrtille extends MailingTargets ...@@ -151,9 +171,11 @@ class mailing_myrtille extends MailingTargets
$langs->load("companies"); $langs->load("companies");
$sql = "SELECT sp.poste, count(distinct(sp.email)) AS nb"; $sql = "SELECT sp.poste, count(distinct(sp.email)) AS nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$sql.= " WHERE sp.entity = ".$conf->entity; $sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " AND (sp.email IS NOT NULL AND sp.email != '')"; $sql.= " WHERE s.rowid = sp.fk_soc";
$sql.= " AND sp.entity = ".$conf->entity;
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " AND (sp.poste IS NOT NULL AND sp.poste != '')"; $sql.= " AND (sp.poste IS NOT NULL AND sp.poste != '')";
$sql.= " GROUP BY sp.poste"; $sql.= " GROUP BY sp.poste";
$sql.= " ORDER BY sp.poste"; $sql.= " ORDER BY sp.poste";
...@@ -162,7 +184,7 @@ class mailing_myrtille extends MailingTargets ...@@ -162,7 +184,7 @@ class mailing_myrtille extends MailingTargets
$s=''; $s='';
$s.='<select name="filter" class="flat">'; $s.='<select name="filter" class="flat">';
$s.='<option value="all">'.$langs->trans("ContactsAllShort").'</option>'; $s.='<option value="all"></option>';
if ($resql) if ($resql)
{ {
$num = $this->db->num_rows($resql); $num = $this->db->num_rows($resql);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
/** /**
* \file htdocs/includes/modules/mailings/banane.modules.php * \file htdocs/includes/modules/mailings/contacts3.modules.php
* \ingroup mailing * \ingroup mailing
* \brief Provides a list of recipients for mailing module * \brief Provides a list of recipients for mailing module
* \version $Revision$ * \version $Revision$
...@@ -28,10 +28,10 @@ include_once DOL_DOCUMENT_ROOT.'/includes/modules/mailings/modules_mailings.php' ...@@ -28,10 +28,10 @@ include_once DOL_DOCUMENT_ROOT.'/includes/modules/mailings/modules_mailings.php'
/** /**
* \class mailing_banane * \class mailing_contacts3
* \brief Class to manage a list of personalised recipients for mailing feature * \brief Class to manage a list of personalised recipients for mailing feature
*/ */
class mailing_banane extends MailingTargets class mailing_contacts3 extends MailingTargets
{ {
var $name='ContactsByCompanyCategory'; var $name='ContactsByCompanyCategory';
// This label is used if no translation is found for key MailingModuleDescXXX where XXX=name is found // This label is used if no translation is found for key MailingModuleDescXXX where XXX=name is found
...@@ -43,12 +43,21 @@ class mailing_banane extends MailingTargets ...@@ -43,12 +43,21 @@ class mailing_banane extends MailingTargets
var $db; var $db;
function mailing_banane($DB) function mailing_contacts3($DB)
{ {
$this->db=$DB; $this->db=$DB;
} }
/**
* \brief Renvoie url lien vers fiche de la source du destinataire du mailing
* \return string Url lien
*/
function url($id)
{
return '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$id.'">'.img_object('',"contact").'</a>';
}
/** /**
* This is the main function that returns the array of emails * This is the main function that returns the array of emails
* @param mailing_id Id of mailing. No need to use it. * @param mailing_id Id of mailing. No need to use it.
...@@ -57,19 +66,24 @@ class mailing_banane extends MailingTargets ...@@ -57,19 +66,24 @@ class mailing_banane extends MailingTargets
*/ */
function add_to_target($mailing_id,$filtersarray=array()) function add_to_target($mailing_id,$filtersarray=array())
{ {
global $conf; global $conf,$langs;
$target = array(); $target = array();
$sql = "SELECT sp.rowid, sp.email, sp.name, sp.firstname"; // La requete doit retourner: id, email, fk_contact, name, firstname, other
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,";
$sql.= ", ".MAIN_DB_PREFIX."categorie as c"; $sql.= " sp.name as name, sp.firstname as firstname, sp.civilite,";
$sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs"; $sql.= " s.nom as companyname";
$sql.= " WHERE (sp.email IS NOT NULL AND sp.email != '')"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$sql.= " ".MAIN_DB_PREFIX."societe as s,";
$sql.= " ".MAIN_DB_PREFIX."categorie as c,";
$sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs";
$sql.= " WHERE s.rowid = sp.fk_soc";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.entity = ".$conf->entity; $sql.= " AND sp.entity = ".$conf->entity;
$sql.= " AND cs.fk_categorie = c.rowid"; $sql.= " AND cs.fk_categorie = c.rowid";
$sql.= " AND cs.fk_societe = sp.fk_soc"; $sql.= " AND cs.fk_societe = sp.fk_soc";
print $sql;
if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$filtersarray[0]."'"; if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$filtersarray[0]."'";
$sql.= " ORDER BY sp.name, sp.firstname"; $sql.= " ORDER BY sp.name, sp.firstname";
...@@ -84,10 +98,15 @@ class mailing_banane extends MailingTargets ...@@ -84,10 +98,15 @@ class mailing_banane extends MailingTargets
$obj= $this->db->fetch_object($resql); $obj= $this->db->fetch_object($resql);
$target[] = array( $target[] = array(
'email' => $obj->email, 'email' => $obj->email,
'fk_contact' => $obj->fk_contact,
'name' => $obj->name, 'name' => $obj->name,
'firstname' => $obj->firstname, 'firstname' => $obj->firstname,
'other' => $other, 'other' =>
'url' => '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->rowid.'">'.img_object('',"contact").'</a>' ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'.
($langs->transnoentities("Civility").'='.($obj->civilite?$langs->transnoentities("Civility".$obj->civilite):'')),
'source_url' => $this->url($obj->id),
'source_id' => $obj->id,
'source_type' => 'contact'
); );
$i++; $i++;
} }
...@@ -109,19 +128,21 @@ class mailing_banane extends MailingTargets ...@@ -109,19 +128,21 @@ class mailing_banane extends MailingTargets
global $conf, $langs; global $conf, $langs;
$statssql=array(); $statssql=array();
for ($i=0; $i<5; $i++) { /*for ($i=0; $i<5; $i++) {
$statssql[$i] = "SELECT c.label, count(sp.rowid) AS nb"; $statssql[$i] = "SELECT c.label, count(sp.rowid) AS nb";
$statssql[$i].= " FROM ".MAIN_DB_PREFIX."categorie as c"; $statssql[$i].= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$statssql[$i].= ", ".MAIN_DB_PREFIX."categorie_societe as cs"; $statssql[$i].= " ".MAIN_DB_PREFIX."societe as s,";
$statssql[$i].= ", ".MAIN_DB_PREFIX."socpeople as sp"; $statssql[$i].= " ".MAIN_DB_PREFIX."categorie as c,";
$statssql[$i].= " WHERE (sp.email IS NOT NULL AND sp.email != '')"; $statssql[$i].= " ".MAIN_DB_PREFIX."categorie_societe as cs";
$statssql[$i].= " WHERE s.rowid = sp.fk_soc";
$statssql[$i].= " AND sp.email != ''"; // Note that null != '' is false
$statssql[$i].= " AND sp.entity = ".$conf->entity; $statssql[$i].= " AND sp.entity = ".$conf->entity;
$statssql[$i].= " AND cs.fk_categorie = c.rowid"; $statssql[$i].= " AND cs.fk_categorie = c.rowid";
$statssql[$i].= " AND cs.fk_societe = sp.fk_soc"; $statssql[$i].= " AND cs.fk_societe = sp.fk_soc";
$statssql[$i].= " GROUP BY c.label"; $statssql[$i].= " GROUP BY c.label";
$statssql[$i].= " ORDER BY nb DESC"; $statssql[$i].= " ORDER BY nb DESC";
$statssql[$i].= " LIMIT $i,1"; $statssql[$i].= " LIMIT $i,1";
} }*/
return $statssql; return $statssql;
} }
...@@ -135,14 +156,13 @@ class mailing_banane extends MailingTargets ...@@ -135,14 +156,13 @@ class mailing_banane extends MailingTargets
{ {
global $conf; global $conf;
$sql = "SELECT count(distinct(sp.email)) AS nb"; $sql = "SELECT count(distinct(c.email)) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs"; $sql .= " ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."socpeople as sp"; $sql .= " WHERE s.rowid = c.fk_soc";
$sql.= " WHERE (sp.email IS NOT NULL AND sp.email != '')"; $sql .= " AND c.entity = ".$conf->entity;
$sql.= " AND sp.entity = ".$conf->entity; $sql .= " AND s.entity = ".$conf->entity;
$sql.= " AND cs.fk_categorie = c.rowid"; $sql .= " AND c.email != ''"; // Note that null != '' is false
$sql.= " AND cs.fk_societe = sp.fk_soc";
// La requete doit retourner un champ "nb" pour etre comprise // La requete doit retourner un champ "nb" pour etre comprise
// par parent::getNbOfRecipients // par parent::getNbOfRecipients
return parent::getNbOfRecipients($sql); return parent::getNbOfRecipients($sql);
...@@ -160,10 +180,12 @@ class mailing_banane extends MailingTargets ...@@ -160,10 +180,12 @@ class mailing_banane extends MailingTargets
$langs->load("companies"); $langs->load("companies");
$sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; $sql = "SELECT c.label, count(distinct(sp.email)) AS nb";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs"; $sql.= " ".MAIN_DB_PREFIX."societe as s,";
$sql.= ", ".MAIN_DB_PREFIX."socpeople as sp"; $sql.= " ".MAIN_DB_PREFIX."categorie as c,";
$sql.= " WHERE (sp.email IS NOT NULL AND sp.email != '')"; $sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs";
$sql.= " WHERE s.rowid = sp.fk_soc";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.entity = ".$conf->entity; $sql.= " AND sp.entity = ".$conf->entity;
$sql.= " AND cs.fk_categorie = c.rowid"; $sql.= " AND cs.fk_categorie = c.rowid";
$sql.= " AND cs.fk_societe = sp.fk_soc"; $sql.= " AND cs.fk_societe = sp.fk_soc";
...@@ -174,7 +196,7 @@ class mailing_banane extends MailingTargets ...@@ -174,7 +196,7 @@ class mailing_banane extends MailingTargets
$s=''; $s='';
$s.='<select name="filter" class="flat">'; $s.='<select name="filter" class="flat">';
$s.='<option value="all">'.$langs->trans("ContactsAllShort").'</option>'; $s.='<option value="all"></option>';
if ($resql) if ($resql)
{ {
$num = $this->db->num_rows($resql); $num = $this->db->num_rows($resql);
......
...@@ -111,7 +111,7 @@ class mailing_fraise extends MailingTargets ...@@ -111,7 +111,7 @@ class mailing_fraise extends MailingTargets
$s.='<option value="0">'.$langs->trans("MemberStatusResiliatedShort").'</option>'; $s.='<option value="0">'.$langs->trans("MemberStatusResiliatedShort").'</option>';
$s.='</select>'; $s.='</select>';
$s.='<br>'; $s.='<br>';
$s.=$langs->trans("DateEndSubscription").': '; $s.=$langs->trans("DateEndSubscription").': &nbsp;';
$s.=$langs->trans("After").' > '.$form->select_date(-1,'subscriptionafter',0,0,1,'fraise',1,0,1,0); $s.=$langs->trans("After").' > '.$form->select_date(-1,'subscriptionafter',0,0,1,'fraise',1,0,1,0);
$s.=' &nbsp; '; $s.=' &nbsp; ';
$s.=$langs->trans("Before").' < '.$form->select_date(-1,'subscriptionbefore',0,0,1,'fraise',1,0,1,0); $s.=$langs->trans("Before").' < '.$form->select_date(-1,'subscriptionbefore',0,0,1,'fraise',1,0,1,0);
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
*/ */
/** /**
* \file htdocs/includes/modules/mailings/kiwi.modules.php * \file htdocs/includes/modules/mailings/thirdparties.modules.php
* \ingroup mailing * \ingroup mailing
* \brief Example file to provide a list of recipients for mailing module * \brief Example file to provide a list of recipients for mailing module
* \version $Revision$ * \version $Revision$
...@@ -20,10 +20,10 @@ include_once DOL_DOCUMENT_ROOT.'/includes/modules/mailings/modules_mailings.php' ...@@ -20,10 +20,10 @@ include_once DOL_DOCUMENT_ROOT.'/includes/modules/mailings/modules_mailings.php'
/** /**
* \class mailing_kiwi * \class mailing_thirdparties
* \brief Class to manage a list of personalised recipients for mailing feature * \brief Class to manage a list of personalised recipients for mailing feature
*/ */
class mailing_kiwi extends MailingTargets class mailing_thirdparties extends MailingTargets
{ {
// CHANGE THIS: Put here a name not already used // CHANGE THIS: Put here a name not already used
var $name='ContactsCategories'; var $name='ContactsCategories';
...@@ -38,7 +38,7 @@ class mailing_kiwi extends MailingTargets ...@@ -38,7 +38,7 @@ class mailing_kiwi extends MailingTargets
var $db; var $db;
function mailing_kiwi($DB) function mailing_thirdparties($DB)
{ {
$this->db=$DB; $this->db=$DB;
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
*/ */
/** /**
* \file htdocs/includes/modules/mailings/dolibarr_services_expired.modules.php * \file htdocs/includes/modules/mailings/thirdparties_services_expired.modules.php
* \ingroup mailing * \ingroup mailing
* \brief File of class to offer a selector of emailing targets with Rule 'services expired'. * \brief File of class to offer a selector of emailing targets with Rule 'services expired'.
* \version $Id$ * \version $Id$
...@@ -19,10 +19,10 @@ require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); ...@@ -19,10 +19,10 @@ require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
/** /**
* \class mailing_dolibarr_services_expired * \class mailing_thirdparties_services_expired
* \brief Class to offer a selector of emailing targets with Rule 'services expired'. * \brief Class to offer a selector of emailing targets with Rule 'services expired'.
*/ */
class mailing_dolibarr_services_expired extends MailingTargets class mailing_thirdparties_services_expired extends MailingTargets
{ {
var $name='DolibarrContractsLinesExpired'; var $name='DolibarrContractsLinesExpired';
var $desc='Third parties with expired contract\'s lines'; var $desc='Third parties with expired contract\'s lines';
...@@ -38,9 +38,9 @@ class mailing_dolibarr_services_expired extends MailingTargets ...@@ -38,9 +38,9 @@ class mailing_dolibarr_services_expired extends MailingTargets
* Constructor * Constructor
* *
* @param $DB * @param $DB
* @return mailing_dolibarr_services_expired * @return mailing_thirdparties_services_expired
*/ */
function mailing_dolibarr_services_expired($DB) function mailing_thirdparties_services_expired($DB)
{ {
$this->db=$DB; $this->db=$DB;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment