FIX Update of timespent when date is empty

This commit is contained in:
ldestailleur 2019-01-04 15:44:09 +01:00
parent 5638ac8f4d
commit 2c474de61e

View File

@ -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);