diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index b272d7b45fb..aab00e8f0b7 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -703,7 +703,7 @@ class Holiday extends CommonObject // Update status $sql = "UPDATE ".MAIN_DB_PREFIX."holiday SET"; if (!empty($this->statut) && is_numeric($this->statut)) { - $sql .= " statut = ".$this->statut.","; + $sql .= " statut = ".((int) $this->statut).","; } else { $error++; } @@ -771,9 +771,9 @@ class Holiday extends CommonObject } else { $error++; } - $sql .= " halfday = ".$this->halfday.","; + $sql .= " halfday = ".((int) $this->halfday).","; if (!empty($this->statut) && is_numeric($this->statut)) { - $sql .= " statut = ".$this->statut.","; + $sql .= " statut = ".((int) $this->statut).","; } else { $error++; } @@ -817,7 +817,6 @@ class Holiday extends CommonObject } else { $sql .= " detail_refuse = NULL"; } - $sql .= " WHERE rowid= ".$this->id; $this->db->begin(); @@ -2181,12 +2180,12 @@ class Holiday extends CommonObject $this->id = 0; $this->specimen = 1; - $this->fk_user = 1; + $this->fk_user = $user->id; $this->description = 'SPECIMEN description'; $this->date_debut = dol_now(); $this->date_fin = dol_now() + (24 * 3600); $this->date_valid = dol_now(); - $this->fk_validator = 1; + $this->fk_validator = $user->id; $this->halfday = 0; $this->fk_type = 1; $this->statut = Holiday::STATUS_VALIDATED;