diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index e2faef3da8e..e25f06ed6a4 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -2021,7 +2021,7 @@ class Project extends CommonObject $sql = "SELECT ptt.rowid as taskid, ptt.element_duration, ptt.element_date, ptt.element_datehour, ptt.fk_element"; $sql .= " FROM ".MAIN_DB_PREFIX."element_time AS ptt, ".MAIN_DB_PREFIX."projet_task as pt"; $sql .= " WHERE ptt.fk_element = pt.rowid"; - $sql .= " AND ptt.elementtype = 'task'"; + $sql .= " AND ptt.elementtype = 'task'"; $sql .= " AND pt.fk_projet = ".((int) $this->id); $sql .= " AND (ptt.element_date >= '".$this->db->idate($datestart)."' "; $sql .= " AND ptt.element_date <= '".$this->db->idate(dol_time_plus_duree($datestart, 1, 'w') - 1)."')"; @@ -2085,7 +2085,7 @@ class Project extends CommonObject $sql = "SELECT ptt.rowid as taskid, ptt.element_duration, ptt.element_date, ptt.element_datehour, ptt.fk_element"; $sql .= " FROM ".MAIN_DB_PREFIX."element_time AS ptt, ".MAIN_DB_PREFIX."projet_task as pt"; $sql .= " WHERE ptt.fk_element = pt.rowid"; - $sql .= " AND ptt.elementtype = 'task'"; + $sql .= " AND ptt.elementtype = 'task'"; $sql .= " AND pt.fk_projet = ".((int) $this->id); $sql .= " AND (ptt.element_date >= '".$this->db->idate($datestart)."' "; $sql .= " AND ptt.element_date <= '".$this->db->idate(dol_time_plus_duree($datestart, 1, 'm') - 1)."')"; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index cd822b9864c..1898f64210e 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1310,7 +1310,7 @@ class Task extends CommonObjectLine } // Update hourly rate of this time spent entry - $resql_thm_user = $this->db->query("SELECT thm FROM " . MAIN_DB_PREFIX . "user WHERE rowid = " . ((int)$timespent->fk_user)); + $resql_thm_user = $this->db->query("SELECT thm FROM " . MAIN_DB_PREFIX . "user WHERE rowid = " . ((int) $timespent->fk_user)); if (!empty($resql_thm_user)) { $obj_thm_user = $this->db->fetch_object($resql_thm_user); $timespent->thm = $obj_thm_user->thm; @@ -1573,7 +1573,6 @@ class Task extends CommonObjectLine } return 0; - } /** @@ -1760,8 +1759,8 @@ class Task extends CommonObjectLine // Update hourly rate of this time spent entry, but only if it was not set initialy $res_update = 1; - if(empty($timespent->thm) || !empty($conf->global->TIMESPENT_ALWAYS_UPDATE_THM)) { - $resql_thm_user = $this->db->query("SELECT thm FROM " . MAIN_DB_PREFIX . "user WHERE rowid = " . ((int)$timespent->fk_user)); + if (empty($timespent->thm) || !empty($conf->global->TIMESPENT_ALWAYS_UPDATE_THM)) { + $resql_thm_user = $this->db->query("SELECT thm FROM " . MAIN_DB_PREFIX . "user WHERE rowid = " . ((int) $timespent->fk_user)); if (!empty($resql_thm_user)) { $obj_thm_user = $this->db->fetch_object($resql_thm_user); $timespent->thm = $obj_thm_user->thm;