Merge pull request #5210 from simnandez/3.9

FIX issues with entity in leave creation
This commit is contained in:
Laurent Destailleur 2016-05-18 20:28:35 +02:00
commit 85cc5cbf02

View File

@ -3,6 +3,7 @@
* Copyright (C) 2012-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2012-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012-2016 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2012-2016 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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) function create($user, $notrigger=0)
{ {
global $conf, $langs; global $conf;
$error=0; $error=0;
$now=dol_now(); $now=dol_now();
@ -137,7 +138,8 @@ class Holiday extends CommonObject
$sql.= "statut,"; $sql.= "statut,";
$sql.= "fk_validator,"; $sql.= "fk_validator,";
$sql.= "fk_type,"; $sql.= "fk_type,";
$sql.= "fk_user_create"; $sql.= "fk_user_create,";
$sql.= "entity";
$sql.= ") VALUES ("; $sql.= ") VALUES (";
$sql.= "'".$this->fk_user."',"; $sql.= "'".$this->fk_user."',";
$sql.= " '".$this->db->idate($now)."',"; $sql.= " '".$this->db->idate($now)."',";
@ -148,7 +150,8 @@ class Holiday extends CommonObject
$sql.= " '1',"; $sql.= " '1',";
$sql.= " '".$this->fk_validator."',"; $sql.= " '".$this->fk_validator."',";
$sql.= " '".$this->fk_type."',"; $sql.= " '".$this->fk_type."',";
$sql.= " ".$user->id; $sql.= " ".$user->id.",";
$sql.= " ".$conf->entity;
$sql.= ")"; $sql.= ")";
$this->db->begin(); $this->db->begin();