From 21b639ef168389b2d2a6b92482179b577621f76a Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Sat, 14 May 2016 00:47:46 +0200 Subject: [PATCH] Fix issues with entity control --- htdocs/holiday/class/holiday.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 4e5706f94c6..94704451df7 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2012-2014 Laurent Destailleur * Copyright (C) 2012-2016 Regis Houssin * Copyright (C) 2013 Florian Henry + * Copyright (C) 2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -117,7 +118,7 @@ class Holiday extends CommonObject */ function create($user, $notrigger=0) { - global $conf, $langs; + global $conf; $error=0; $now=dol_now(); @@ -137,7 +138,8 @@ class Holiday extends CommonObject $sql.= "statut,"; $sql.= "fk_validator,"; $sql.= "fk_type,"; - $sql.= "fk_user_create"; + $sql.= "fk_user_create,"; + $sql.= "entity"; $sql.= ") VALUES ("; $sql.= "'".$this->fk_user."',"; $sql.= " '".$this->db->idate($now)."',"; @@ -148,7 +150,8 @@ class Holiday extends CommonObject $sql.= " '1',"; $sql.= " '".$this->fk_validator."',"; $sql.= " '".$this->fk_type."',"; - $sql.= " ".$user->id; + $sql.= " ".$user->id.","; + $sql.= " ".$conf->entity; $sql.= ")"; $this->db->begin();