From 559a9024050bcd8b86b969c4ccbd6527ac5117ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Jul 2019 03:39:35 +0200 Subject: [PATCH] FIX summary of time spent in preview tab of projects --- htdocs/projet/class/project.class.php | 4 ++-- htdocs/projet/element.php | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index cbee8d181ca..2261e06219b 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -599,13 +599,13 @@ class Project extends CommonObject $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $tablename." WHERE ".$projectkey." IN (". $ids .") AND entity IN (".getEntity($type).")"; } - if ($dates > 0) + if ($dates > 0 && ($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; if (empty($datefieldname)) return 'Error this object has no date field defined'; $sql.=" AND (".$datefieldname." >= '".$this->db->idate($dates)."' OR ".$datefieldname." IS NULL)"; } - if ($datee > 0) + if ($datee > 0 && ($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; if (empty($datefieldname)) return 'Error this object has no date field defined'; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index b4d2a8b290f..4f5af0ca94f 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -532,7 +532,8 @@ if (! $showdatefilter) { print '
'; print '
'; - print ''; + print ''; + print ''; print ''; print ''; print '
'.$langs->trans("From").' '; @@ -762,7 +763,8 @@ foreach ($listofreferent as $key => $value) // Define form with the combo list of elements to link $addform.='
'; $addform.=''; - $addform.=''; + $addform.=''; + $addform.=''; $addform.=''; $addform.=''; $addform.='';