Fix: B1032-develop: Problem in the filter of Contact by company category
This commit is contained in:
parent
5ca7820884
commit
05040d1997
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2011 François Cerbelle <francois@cerbelle.net>
|
/* Copyright (C) 2011 François Cerbelle <francois@cerbelle.net>
|
||||||
|
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -26,8 +27,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class mailing_contacts3
|
* 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_contacts3 extends MailingTargets
|
class mailing_contacts3 extends MailingTargets
|
||||||
{
|
{
|
||||||
@ -80,9 +80,9 @@ class mailing_contacts3 extends MailingTargets
|
|||||||
$sql.= " sp.lastname, sp.firstname, sp.civilite,";
|
$sql.= " sp.lastname, sp.firstname, sp.civilite,";
|
||||||
$sql.= " s.nom as companyname";
|
$sql.= " s.nom as companyname";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
|
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc";
|
||||||
if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie as c";
|
if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie as c";
|
||||||
if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs";
|
if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc";
|
|
||||||
$sql.= " WHERE sp.email != ''"; // Note that null != '' is false
|
$sql.= " WHERE sp.email != ''"; // Note that null != '' is false
|
||||||
$sql.= " AND sp.no_email = 0";
|
$sql.= " AND sp.no_email = 0";
|
||||||
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
|
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
|
||||||
@ -91,6 +91,7 @@ class mailing_contacts3 extends MailingTargets
|
|||||||
if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$this->db->escape($filtersarray[0])."'";
|
if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$this->db->escape($filtersarray[0])."'";
|
||||||
$sql.= " ORDER BY sp.lastname, sp.firstname";
|
$sql.= " ORDER BY sp.lastname, sp.firstname";
|
||||||
|
|
||||||
|
dol_syslog("sql=".$sql);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user