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

Fix: Some contacts were lost. Number in colume "Total number" must be "total...

Fix: Some contacts were lost. Number in colume "Total number" must be "total number" with no filter. Value after filtering is show inside the filter list.
parent e8b2ebd2
Branches
No related tags found
No related merge requests found
...@@ -148,6 +148,9 @@ class mailing_contacts2 extends MailingTargets ...@@ -148,6 +148,9 @@ class mailing_contacts2 extends MailingTargets
{ {
global $conf; global $conf;
// We must report here number of contacts when absolutely no filter selected (so all contacts).
// Number with a filter are show in the combo list for each filter.
// If we want a filter "function is defined", we must add it into formFilter
$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.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " ".MAIN_DB_PREFIX."societe as s";
......
...@@ -155,6 +155,17 @@ class mailing_contacts3 extends MailingTargets ...@@ -155,6 +155,17 @@ class mailing_contacts3 extends MailingTargets
{ {
global $conf; global $conf;
// We must report here number of contacts when absolutely no filter selected (so all contacts).
// Number with a filter are show in the combo list for each filter.
// If we want a filter "is inside at least one category", we must add it into formFilter
$sql = "SELECT count(distinct(c.email)) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE s.rowid = c.fk_soc";
$sql.= " AND c.entity = ".$conf->entity;
$sql.= " AND s.entity = ".$conf->entity;
$sql.= " AND c.email != ''"; // Note that null != '' is false
/*
$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.= " ".MAIN_DB_PREFIX."societe as s,"; $sql.= " ".MAIN_DB_PREFIX."societe as s,";
...@@ -166,6 +177,7 @@ class mailing_contacts3 extends MailingTargets ...@@ -166,6 +177,7 @@ class mailing_contacts3 extends MailingTargets
$sql.= " AND sp.email != ''"; // Note that null != '' is false $sql.= " AND sp.email != ''"; // Note that null != '' is false
$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";
*/
// 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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment