From f43b3ebda463a59a184779081f81e350470ebacb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Jan 2017 09:30:00 +0100 Subject: [PATCH] Fix holiday class --- htdocs/holiday/class/holiday.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 78bc1582a65..c51c99ff1ff 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -127,7 +127,8 @@ class Holiday extends CommonObject // Check parameters if (empty($this->fk_user) || ! is_numeric($this->fk_user) || $this->fk_user < 0) { $this->error="ErrorBadParameter"; return -1; } if (empty($this->fk_validator) || ! is_numeric($this->fk_validator) || $this->fk_validator < 0) { $this->error="ErrorBadParameter"; return -1; } - + if (empty($this->fk_type) || ! is_numeric($this->fk_type) || $this->fk_type < 0) { $this->error="ErrorBadParameter"; return -1; } + // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday("; $sql.= "fk_user,"; @@ -150,7 +151,7 @@ class Holiday extends CommonObject $sql.= " ".$this->halfday.","; $sql.= " '1',"; $sql.= " '".$this->fk_validator."',"; - $sql.= " '".$this->fk_type."',"; + $sql.= " ".$this->fk_type.","; $sql.= " ".$user->id.","; $sql.= " ".$conf->entity; $sql.= ")";