Merge pull request #8785 from defrance/patch-115
Add dateemploymentEnd on user
This commit is contained in:
commit
15cc90a66b
@ -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
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2015-2017 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2015-2018 Charlene Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -219,6 +219,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) {
|
||||
@ -361,6 +364,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))
|
||||
{
|
||||
@ -1156,6 +1161,13 @@ if ($action == 'create' || $action == 'adduserldap')
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Date employment END
|
||||
print '<tr><td>'.$langs->trans("DateEmploymentEnd").'</td>';
|
||||
print '<td>';
|
||||
echo $form->select_date(GETPOST('dateemploymentend'),'dateemploymentend',0,0,1,'form'.'dateemploymentend',1,0,1);
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Date birth
|
||||
print '<tr><td>'.$langs->trans("DateToBirth").'</td>';
|
||||
print '<td>';
|
||||
@ -1502,6 +1514,13 @@ else
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Date employment
|
||||
print '<tr><td>'.$langs->trans("DateEmploymentEnd").'</td>';
|
||||
print '<td>';
|
||||
print dol_print_date($object->dateemploymentend);
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Date of birth
|
||||
print '<tr><td>'.$langs->trans("DateToBirth").'</td>';
|
||||
print '<td>';
|
||||
@ -2432,6 +2451,14 @@ else
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Date employmentEnd
|
||||
print '<tr><td>'.$langs->trans("DateEmploymentEnd").'</td>';
|
||||
print '<td>';
|
||||
echo $form->select_date(GETPOST('dateemploymentend')?GETPOST('dateemploymentend'):$object->dateemploymentend,'dateemploymentend',0,0,1,'form'.'dateemploymentend',1,0,1);
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
// Date birth
|
||||
print '<tr><td>'.$langs->trans("DateToBirth").'</td>';
|
||||
print '<td>';
|
||||
|
||||
@ -10,7 +10,8 @@
|
||||
* Copyright (C) 2013-2014 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2018 charlene Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
*
|
||||
* 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
|
||||
@ -132,6 +133,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;
|
||||
@ -208,7 +210,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,";
|
||||
@ -311,6 +313,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);
|
||||
@ -1383,6 +1386,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))
|
||||
@ -1425,6 +1429,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");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user