diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 8ac4963f5b5..77b4a59df7a 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -10,6 +10,7 @@ * Copyright (C) 2013-2014 Philippe Grand * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2015 Marcos GarcĂ­a + * Copyright (C) 2018 charlene Benke * * 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 @@ -131,6 +132,7 @@ class User extends CommonObject public $color; // Define background color for user in agenda public $dateemployment; // Define date of employment by company + public $dateemploymentend; // Define date of employment end by company public $default_c_exp_tax_cat; public $default_range; @@ -201,7 +203,7 @@ class User extends CommonObject $sql.= " u.salaryextra,"; $sql.= " u.weeklyhours,"; $sql.= " u.color,"; - $sql.= " u.dateemployment,"; + $sql.= " u.dateemployment, u.dateemploymentend,"; $sql.= " u.ref_int, u.ref_ext,"; $sql.= " u.default_range, u.default_c_exp_tax_cat,"; // Expense report default mode $sql.= " c.code as country_code, c.label as country,"; @@ -304,6 +306,7 @@ class User extends CommonObject $this->weeklyhours = $obj->weeklyhours; $this->color = $obj->color; $this->dateemployment = $this->db->jdate($obj->dateemployment); + $this->dateemploymentend = $this->db->jdate($obj->dateemploymentend); $this->datec = $this->db->jdate($obj->datec); $this->datem = $this->db->jdate($obj->datem); @@ -1376,6 +1379,7 @@ class User extends CommonObject $this->accountancy_code = trim($this->accountancy_code); $this->color = empty($this->color)?'':$this->color; $this->dateemployment = empty($this->dateemployment)?'':$this->dateemployment; + $this->dateemploymentend = empty($this->dateemploymentend)?'':$this->dateemploymentend; // Check parameters if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email)) @@ -1418,6 +1422,7 @@ class User extends CommonObject $sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; $sql.= ", color = '".$this->db->escape($this->color)."'"; $sql.= ", dateemployment=".(strval($this->dateemployment)!='' ? "'".$this->db->idate($this->dateemployment)."'" : 'null'); + $sql.= ", dateemploymentend=".(strval($this->dateemploymentend)!='' ? "'".$this->db->idate($this->dateemploymentend)."'" : 'null'); $sql.= ", note = '".$this->db->escape($this->note)."'"; $sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null"); $sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null");