From e20a6c05c3bdd45282cecb680af7eeb51d3872e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 15 Jan 2024 00:05:19 +0100 Subject: [PATCH] example of use --- htdocs/projet/class/project.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index f79bb10a1b9..5fc55e2da5f 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -849,9 +849,9 @@ class Project extends CommonObject $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$tablename." WHERE ".$projectkey." IN (".$this->db->sanitize($ids).") AND entity IN (".getEntity($type).")"; } - if ($date_start > 0 && $type == 'loan') { + if (isDolValidTms($date_start) && $type == 'loan') { $sql .= " AND (dateend > '".$this->db->idate($date_start)."' OR dateend IS NULL)"; - } elseif ($date_start > 0 && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table + } elseif (isDolValidTms($date_start) && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table if (empty($datefieldname) && !empty($this->table_element_date)) { $datefieldname = $this->table_element_date; } @@ -861,9 +861,9 @@ class Project extends CommonObject $sql .= " AND (".$datefieldname." >= '".$this->db->idate($date_start)."' OR ".$datefieldname." IS NULL)"; } - if ($date_end > 0 && $type == 'loan') { + if (isDolValidTms($date_end) && $type == 'loan') { $sql .= " AND (datestart < '".$this->db->idate($date_end)."' OR datestart IS NULL)"; - } elseif ($date_end > 0 && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table + } elseif (isDolValidTms($date_end) && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table if (empty($datefieldname) && !empty($this->table_element_date)) { $datefieldname = $this->table_element_date; }