From 386771cffc96106afb570f96867db49a60ab660b Mon Sep 17 00:00:00 2001 From: atm-gregr Date: Wed, 8 Dec 2021 14:21:42 +0100 Subject: [PATCH 1/3] fix display contat line on list --- htdocs/contact/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 7397cf8b61f..113fc5e74f7 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -418,7 +418,7 @@ if (count($search_roles) > 0) { $sql .= " AND p.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".implode(',', $search_roles)."))"; } if ($search_no_email != -1 && $search_no_email > 0) $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) > 0"; -if ($search_no_email != -1 && $search_no_email == 0) $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) = 0 AND p.email IS NOT NULL AND p.email <> ''"; +if ($search_no_email != -1 && $search_no_email == 0) $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) = 0"; if ($search_status != '' && $search_status >= 0) $sql .= " AND p.statut = ".$db->escape($search_status); if ($search_import_key) $sql .= natural_search("p.import_key", $search_import_key); if ($type == "o") // filtre sur type From 01893caa610240b48076a315697319a2fd5778aa Mon Sep 17 00:00:00 2001 From: atm-gregr Date: Wed, 8 Dec 2021 14:40:46 +0100 Subject: [PATCH 2/3] bad default value --- htdocs/contact/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 113fc5e74f7..1672bdd3f7f 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -96,6 +96,7 @@ $search_level = GETPOST("search_level", "array"); $search_stcomm = GETPOST('search_stcomm', 'int'); if ($search_status == '') $search_status = 1; // always display active customer first +if ($search_no_email == '') $search_no_email = -1; $optioncss = GETPOST('optioncss', 'alpha'); @@ -418,7 +419,7 @@ if (count($search_roles) > 0) { $sql .= " AND p.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".implode(',', $search_roles)."))"; } if ($search_no_email != -1 && $search_no_email > 0) $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) > 0"; -if ($search_no_email != -1 && $search_no_email == 0) $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) = 0"; +if ($search_no_email != -1 && $search_no_email == 0) $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) = 0 AND p.email IS NOT NULL AND p.email <> ''"; if ($search_status != '' && $search_status >= 0) $sql .= " AND p.statut = ".$db->escape($search_status); if ($search_import_key) $sql .= natural_search("p.import_key", $search_import_key); if ($type == "o") // filtre sur type From 9b65bb2085b8ef70f89d42bc600e298b428615a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Dec 2021 15:29:16 +0100 Subject: [PATCH 3/3] Update list.php --- htdocs/contact/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 1672bdd3f7f..45454485b70 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -95,8 +95,8 @@ $search_roles = GETPOST("search_roles", 'array'); $search_level = GETPOST("search_level", "array"); $search_stcomm = GETPOST('search_stcomm', 'int'); -if ($search_status == '') $search_status = 1; // always display active customer first -if ($search_no_email == '') $search_no_email = -1; +if ($search_status === '') $search_status = 1; // always display active customer first +if ($search_no_email === '') $search_no_email = -1; $optioncss = GETPOST('optioncss', 'alpha');