Skip to content

Commit

Permalink
Merge pull request #7876 from ptibogxiv/patch-6
Browse files Browse the repository at this point in the history
fix for multicompany
  • Loading branch information
eldy committed Nov 28, 2017
2 parents fa1bb9d + a9e4fcf commit 3071796
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions htdocs/core/modules/mailings/fraise.modules.php
Expand Up @@ -65,15 +65,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 +89,11 @@ 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 3071796

Please sign in to comment.