Skip to content

Commit

Permalink
Merge pull request #7879 from ptibogxiv/patch-7
Browse files Browse the repository at this point in the history
fix for multicompany in mailing
  • Loading branch information
eldy committed Nov 28, 2017
2 parents c1e6d35 + 10b0eaf commit 430c72b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions htdocs/core/modules/mailings/fraise.modules.php
Expand Up @@ -43,7 +43,6 @@ class mailing_fraise extends MailingTargets

var $db;


/**
* Constructor
*
Expand All @@ -65,15 +64,15 @@ function __construct($db)
*/
function getSqlArrayForStats()
{
global $langs;
global $conf,$langs;

$langs->load("members");

// Array for requests for statistics board
$statssql=array();

$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;
}
Expand All @@ -89,9 +88,10 @@ function getSqlArrayForStats()
*/
function getNbOfRecipients($sql='')
{
global $conf;
$sql = "SELECT count(distinct(a.email)) as nb";
$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
// par parent::getNbOfRecipients
Expand Down

0 comments on commit 430c72b

Please sign in to comment.