Fixing style errors.

This commit is contained in:
stickler-ci 2022-08-02 09:00:15 +00:00
parent da196b868c
commit e7242788b9

View File

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