From 468635867db6fc93ad983bb2c9a6ccae98952bd8 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sat, 12 May 2018 17:52:56 +0200 Subject: [PATCH 1/6] Add dateemployementend --- htdocs/install/mysql/tables/llx_user.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 2ecb52511d4..7ae732d51e6 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -84,6 +84,7 @@ create table llx_user salary double(24,8), -- denormalized value coming from llx_user_employment salaryextra double(24,8), -- denormalized value coming from llx_user_employment dateemployment date, -- denormalized value coming from llx_user_employment + dateemploymentend date, -- denormalized value coming from llx_user_employment weeklyhours double(16,8), -- denormalized value coming from llx_user_employment import_key varchar(14), -- import key From fcf6ab6ee5d8872ba02aa51dd65fa8afd78c74ce Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sat, 12 May 2018 17:55:14 +0200 Subject: [PATCH 2/6] Update 7.0.0-8.0.0.sql --- htdocs/install/mysql/migration/7.0.0-8.0.0.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index a57e02455cc..d259da1fe55 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -44,6 +44,7 @@ ALTER TABLE llx_website_page ADD COLUMN type_container varchar(16) NOT NULL DEFA DROP TABLE llx_c_accountancy_category; DROP TABLE llx_c_accountingaccount; + update llx_propal set fk_statut = 1 where fk_statut = -1; ALTER TABLE llx_inventory ADD COLUMN fk_user_creat integer; @@ -79,6 +80,10 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- For 8.0 + +ALTER TABLE llx_user ADD COLUMN dateemploymentend date after dateemployment; + + -- delete old permission no more used DELETE FROM llx_rights_def WHERE perms = 'main' and module = 'commercial'; From caa35e03590fb51dc2dcf5ed3b0b20efd599503b Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sat, 12 May 2018 17:59:43 +0200 Subject: [PATCH 3/6] Update user.class.php --- htdocs/user/class/user.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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"); From 0dad083cb529999cd15e29605ace10768406be3b Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sat, 12 May 2018 18:05:06 +0200 Subject: [PATCH 4/6] Update card.php --- htdocs/user/card.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 48dc1049706..1823adc8044 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -11,7 +11,7 @@ * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2015-2017 Jean-François Ferry * Copyright (C) 2015 Ari Elbaz (elarifr) - * Copyright (C) 2015 Charlie Benke + * Copyright (C) 2015-2018 Charlene Benke * Copyright (C) 2016 Raphaël Doursenaud * * This program is free software; you can redistribute it and/or modify @@ -222,6 +222,9 @@ if (empty($reshook)) { $dateemployment = dol_mktime(0, 0, 0, GETPOST('dateemploymentmonth'), GETPOST('dateemploymentday'), GETPOST('dateemploymentyear')); $object->dateemployment = $dateemployment; + $dateemploymentend = dol_mktime(0, 0, 0, GETPOST('dateemploymentendmonth'), GETPOST('dateemploymentendday'), GETPOST('dateemploymentendyear')); + $object->dateemploymentend = $dateemploymentend; + // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels, $object); if ($ret < 0) { @@ -364,6 +367,8 @@ if (empty($reshook)) { $object->color = GETPOST("color",'alpha') != '' ? GETPOST("color",'alpha') : ''; $dateemployment = dol_mktime(0, 0, 0, GETPOST('dateemploymentmonth','int'), GETPOST('dateemploymentday','int'), GETPOST('dateemploymentyear','int')); $object->dateemployment = $dateemployment; + $dateemploymentend = dol_mktime(0, 0, 0, GETPOST('dateemploymentendmonth','int'), GETPOST('dateemploymentendday','int'), GETPOST('dateemploymentendyear','int')); + $object->dateemploymentend = $dateemploymentend; if (! empty($conf->multicompany->enabled)) { @@ -1159,6 +1164,13 @@ if ($action == 'create' || $action == 'adduserldap') print ''; print "\n"; + // Date employment END + print ''.$langs->trans("DateEmploymentEnd").''; + print ''; + echo $form->select_date(GETPOST('dateemploymentend'),'dateemploymentend',0,0,1,'form'.'dateemploymentend',1,0,1); + print ''; + print "\n"; + // Date birth print ''.$langs->trans("DateToBirth").''; print ''; @@ -1505,6 +1517,13 @@ else print ''; print "\n"; + // Date employment + print ''.$langs->trans("DateEmploymentEnd").''; + print ''; + print dol_print_date($object->dateemploymentend); + print ''; + print "\n"; + // Date of birth print ''.$langs->trans("DateToBirth").''; print ''; @@ -2430,6 +2449,14 @@ else print ''; print "\n"; + // Date employmentEnd + print ''.$langs->trans("DateEmploymentEnd").''; + print ''; + echo $form->select_date(GETPOST('dateemploymentend')?GETPOST('dateemploymentend'):$object->dateemploymentend,'dateemploymentend',0,0,1,'form'.'dateemploymentend',1,0,1); + print ''; + print "\n"; + + // Date birth print ''.$langs->trans("DateToBirth").''; print ''; From 7984316142b6b122ceaecd00dadd7c81572dcb6d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Jun 2018 01:20:44 +0200 Subject: [PATCH 5/6] Update 7.0.0-8.0.0.sql --- htdocs/install/mysql/migration/7.0.0-8.0.0.sql | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index d259da1fe55..471b73b894b 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -44,7 +44,6 @@ ALTER TABLE llx_website_page ADD COLUMN type_container varchar(16) NOT NULL DEFA DROP TABLE llx_c_accountancy_category; DROP TABLE llx_c_accountingaccount; - update llx_propal set fk_statut = 1 where fk_statut = -1; ALTER TABLE llx_inventory ADD COLUMN fk_user_creat integer; @@ -81,7 +80,6 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- For 8.0 -ALTER TABLE llx_user ADD COLUMN dateemploymentend date after dateemployment; -- delete old permission no more used From 202ab93c5f4c60176df63c992d275c39b83c4c19 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Jun 2018 01:20:57 +0200 Subject: [PATCH 6/6] Update 7.0.0-8.0.0.sql --- htdocs/install/mysql/migration/7.0.0-8.0.0.sql | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index 471b73b894b..a57e02455cc 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -79,9 +79,6 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- For 8.0 - - - -- delete old permission no more used DELETE FROM llx_rights_def WHERE perms = 'main' and module = 'commercial';