Merge pull request #7879 from ptibogxiv/patch-7
fix for multicompany in mailing
This commit is contained in:
commit
430c72bf0f
@ -43,7 +43,6 @@ class mailing_fraise extends MailingTargets
|
|||||||
|
|
||||||
var $db;
|
var $db;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@ -65,7 +64,7 @@ class mailing_fraise extends MailingTargets
|
|||||||
*/
|
*/
|
||||||
function getSqlArrayForStats()
|
function getSqlArrayForStats()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
|
|
||||||
@ -73,7 +72,7 @@ class mailing_fraise extends MailingTargets
|
|||||||
$statssql=array();
|
$statssql=array();
|
||||||
|
|
||||||
$statssql[0] ="SELECT '".$this->db->escape($langs->trans("FundationMembers"))."' as label, count(*) as nb";
|
$statssql[0] ="SELECT '".$this->db->escape($langs->trans("FundationMembers"))."' as label, count(*) as nb";
|
||||||
$statssql[0].=" FROM ".MAIN_DB_PREFIX."adherent where statut = 1";
|
$statssql[0].=" FROM ".MAIN_DB_PREFIX."adherent where statut = 1 and entity IN (".getEntity('member').")";
|
||||||
|
|
||||||
return $statssql;
|
return $statssql;
|
||||||
}
|
}
|
||||||
@ -89,9 +88,10 @@ class mailing_fraise extends MailingTargets
|
|||||||
*/
|
*/
|
||||||
function getNbOfRecipients($sql='')
|
function getNbOfRecipients($sql='')
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
$sql = "SELECT count(distinct(a.email)) as nb";
|
$sql = "SELECT count(distinct(a.email)) as nb";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||||
$sql .= " WHERE (a.email IS NOT NULL AND a.email != '')";
|
$sql .= " WHERE (a.email IS NOT NULL AND a.email != '') AND a.entity IN (".getEntity('member').")";
|
||||||
|
|
||||||
// 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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user