From d108d04addd9e3c9531f1bd652f54d75e2cf5ca1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 Aug 2017 19:26:48 +0200 Subject: [PATCH] NEW Can filter on the "other" column on emailing target list --- htdocs/comm/mailing/cibles.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index a2743246560..6e917010b51 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -56,6 +56,7 @@ $action=GETPOST('action','aZ09'); $search_lastname=GETPOST("search_lastname"); $search_firstname=GETPOST("search_firstname"); $search_email=GETPOST("search_email"); +$search_other=GETPOST("search_other"); $search_dest_status=GETPOST('search_dest_status'); // Search modules dirs @@ -397,9 +398,10 @@ if ($object->fetch($id) >= 0) $sql = "SELECT mc.rowid, mc.lastname, mc.firstname, mc.email, mc.other, mc.statut, mc.date_envoi, mc.source_url, mc.source_id, mc.source_type, mc.error_text"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc"; $sql .= " WHERE mc.fk_mailing=".$object->id; - if ($search_lastname) $sql.= " AND mc.lastname LIKE '%".$db->escape($search_lastname)."%'"; - if ($search_firstname) $sql.= " AND mc.firstname LIKE '%".$db->escape($search_firstname)."%'"; - if ($search_email) $sql.= " AND mc.email LIKE '%".$db->escape($search_email)."%'"; + if ($search_lastname) $sql.= natural_search("mc.lastname", $search_lastname); + if ($search_firstname) $sql.= natural_search("mc.firstname", $search_firstname); + if ($search_email) $sql.= natural_search("mc.email", $search_email); + if ($search_other) $sql.= natural_search("mc.other", $search_other); if ($search_dest_status != '' && $search_dest_status >= -1) $sql.= " AND mc.statut=".$db->escape($search_dest_status)." "; $sql .= $db->order($sortfield,$sortorder); @@ -423,6 +425,7 @@ if ($object->fetch($id) >= 0) if ($search_lastname) $param.= "&search_lastname=".urlencode($search_lastname); if ($search_firstname) $param.= "&search_firstname=".urlencode($search_firstname); if ($search_email) $param.= "&search_email=".urlencode($search_email); + if ($search_other) $param.= "&search_other=".urlencode($search_other); print '
'; print ''; @@ -469,7 +472,7 @@ if ($object->fetch($id) >= 0) print ''; // Other print ''; - print ' '; + print ''; print ''; // Source print '';