From d177a2fbb4b0eebb2586cc8fd562391a68ff5872 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Tue, 4 Nov 2014 16:13:51 +0100 Subject: [PATCH] fix bug on thm --- htdocs/projet/class/task.class.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index c97b51e53a4..642441a27b6 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -769,7 +769,7 @@ class Task extends CommonObject if ($this->db->query($sql) ) { $tasktime_id = $this->db->last_insert_id(MAIN_DB_PREFIX."projet_task_time"); - $ret = $tasktme_id; + $ret = $tasktime_id; if (! $notrigger) { @@ -801,10 +801,7 @@ class Task extends CommonObject dol_syslog(get_class($this)."::addTimeSpent error -2 ".$this->error, LOG_ERR); $ret = -2; } - } - - if ($ret >= 0) - { + $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time"; $sql.= " SET thm = (SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".$this->timespent_fk_user.")"; $sql.= " WHERE rowid = ".$tasktime_id;