From e7242788b9690f2718b046f4e6f8ecdd80c34dad Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 2 Aug 2022 09:00:15 +0000 Subject: [PATCH] Fixing style errors. --- htdocs/projet/class/task.class.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 70f8d998f4b..52dd2aae311 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1725,15 +1725,14 @@ class Task extends CommonObjectLine } if ($ret == 1 && (($this->timespent_old_duration != $this->timespent_duration) || !empty($conf->global->TIMESPENT_ALWAYS_UPDATE_THM))) { - - if($this->timespent_old_duration != $this->timespent_duration) { + if ($this->timespent_old_duration != $this->timespent_duration) { // Recalculate amount of time spent for task and update denormalized field $sql = "UPDATE " . MAIN_DB_PREFIX . "projet_task"; - $sql .= " SET duration_effective = (SELECT SUM(task_duration) FROM " . MAIN_DB_PREFIX . "projet_task_time as ptt where ptt.fk_task = " . ((int)$this->id) . ")"; + $sql .= " SET duration_effective = (SELECT SUM(task_duration) FROM " . MAIN_DB_PREFIX . "projet_task_time as ptt where ptt.fk_task = " . ((int) $this->id) . ")"; if (isset($this->progress)) { - $sql .= ", progress = " . ((float)$this->progress); // Do not overwrite value if not provided + $sql .= ", progress = " . ((float) $this->progress); // Do not overwrite value if not provided } - $sql .= " WHERE rowid = " . ((int)$this->id); + $sql .= " WHERE rowid = " . ((int) $this->id); dol_syslog(get_class($this) . "::updateTimeSpent", LOG_DEBUG); if (!$this->db->query($sql)) { @@ -1747,7 +1746,7 @@ class Task extends CommonObjectLine $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time"; $sql .= " SET thm = (SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".((int) $this->timespent_fk_user).")"; // set average hour rate of user $sql .= " WHERE rowid = ".((int) $this->timespent_id); - if(empty($conf->global->TIMESPENT_ALWAYS_UPDATE_THM)) { // then if not empty we always update, in case of new thm for user, or change user of task time line + if (empty($conf->global->TIMESPENT_ALWAYS_UPDATE_THM)) { // then if not empty we always update, in case of new thm for user, or change user of task time line $sql .= " AND (thm IS NULL OR thm = 0)"; }