From 2b1fab21819aac5cc242f9c0254d319f42699451 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 30 Nov 2021 11:50:27 +0100 Subject: [PATCH 1/4] Clean code --- htdocs/projet/activity/perweek.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index d7c0f874383..1f1bbc96336 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -520,7 +520,6 @@ if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS)) for ($idw = 0; $idw < 7; $idw++) { $dayinloopfromfirstdaytoshow = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); // $firstdaytoshow is a date with hours = 0 - $dayinloop = dol_time_plus_duree($startday, $idw, 'd'); // Useless because $dayinloopwithouthours should be same than $dayinloopfromfirstdaytoshow //$tmparray = dol_getdate($dayinloop); From 386771cffc96106afb570f96867db49a60ab660b Mon Sep 17 00:00:00 2001 From: atm-gregr Date: Wed, 8 Dec 2021 14:21:42 +0100 Subject: [PATCH 2/4] 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 3/4] 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 4/4] 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');