diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php
index ce4a8b89e09..3db13ac824c 100644
--- a/htdocs/core/modules/mailings/pomme.modules.php
+++ b/htdocs/core/modules/mailings/pomme.modules.php
@@ -26,8 +26,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php';
/**
- * \class mailing_pomme
- * \brief Class to offer a selector of emailing targets with Rule 'Peche'.
+ * Class to offer a selector of emailing targets with Rule 'Peche'.
*/
class mailing_pomme extends MailingTargets
{
@@ -112,11 +111,21 @@ class mailing_pomme extends MailingTargets
$langs->load("users");
$s='';
+ $s.=$langs->trans("Status").': ';
$s.='';
+
+ $s.=' ';
+ $s.=$langs->trans("Employee").': ';
+ $s.='';
+
return $s;
}
@@ -142,7 +151,12 @@ class mailing_pomme extends MailingTargets
*/
function add_to_target($mailing_id,$filtersarray=array())
{
- global $conf, $langs;
+ // Deprecation warning
+ if ($filtersarray) {
+ dol_syslog(__METHOD__ . ": filtersarray parameter is deprecated", LOG_WARNING);
+ }
+
+ global $conf, $langs;
$langs->load("companies");
$cibles = array();
@@ -154,11 +168,10 @@ class mailing_pomme extends MailingTargets
$sql.= " WHERE u.email <> ''"; // u.email IS NOT NULL est implicite dans ce test
$sql.= " AND u.entity IN (0,".$conf->entity.")";
$sql.= " AND u.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
- foreach($filtersarray as $key)
- {
- if ($key == '1') $sql.= " AND u.statut=1";
- if ($key == '0') $sql.= " AND u.statut=0";
- }
+ if (isset($_POST["filter"]) && $_POST["filter"] == '1') $sql.= " AND u.statut=1";
+ if (isset($_POST["filter"]) && $_POST["filter"] == '0') $sql.= " AND u.statut=0";
+ if (isset($_POST["filteremployee"]) && $_POST["filteremployee"] == '1') $sql.= " AND u.employee=1";
+ if (isset($_POST["filteremployee"]) && $_POST["filteremployee"] == '0') $sql.= " AND u.employee=0";
$sql.= " ORDER BY u.email";
// Stocke destinataires dans cibles