From 2c474de61ebdd380569480d045f9fa65b9eb22a2 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Fri, 4 Jan 2019 15:44:09 +0100 Subject: [PATCH] FIX Update of timespent when date is empty --- htdocs/projet/class/task.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 50c7f0d007f..49e0c34a0dc 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1362,6 +1362,18 @@ class Task extends CommonObject $ret = 0; + // Check parameters + if ($this->timespent_date == '') + { + $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")); + return -1; + } + if (! ($this->timespent_fk_user > 0)) + { + $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("User")); + return -1; + } + // Clean parameters if (empty($this->timespent_datehour)) $this->timespent_datehour = $this->timespent_date; if (isset($this->timespent_note)) $this->timespent_note = trim($this->timespent_note);