Merge pull request #5799 from atm-arnaud/NEW_user_date_of_employment
New user date of employment
This commit is contained in:
commit
6653c03e07
@ -33,6 +33,7 @@ DELETE FROM llx_menu where module='expensereport';
|
|||||||
|
|
||||||
ALTER TABLE llx_user DROP COLUMN phenix_login;
|
ALTER TABLE llx_user DROP COLUMN phenix_login;
|
||||||
ALTER TABLE llx_user DROP COLUMN phenix_pass;
|
ALTER TABLE llx_user DROP COLUMN phenix_pass;
|
||||||
|
ALTER TABLE llx_user ADD COLUMN dateemployment datetime;
|
||||||
|
|
||||||
ALTER TABLE llx_societe ADD COLUMN fk_account integer;
|
ALTER TABLE llx_societe ADD COLUMN fk_account integer;
|
||||||
|
|
||||||
|
|||||||
@ -80,5 +80,6 @@ create table llx_user
|
|||||||
tjm double(24,8),
|
tjm double(24,8),
|
||||||
salary double(24,8),
|
salary double(24,8),
|
||||||
salaryextra double(24,8),
|
salaryextra double(24,8),
|
||||||
|
dateemployment datetime,
|
||||||
weeklyhours double(16,8)
|
weeklyhours double(16,8)
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|||||||
@ -102,3 +102,4 @@ DisabledInMonoUserMode=Disabled in maintenance mode
|
|||||||
UserAccountancyCode=User accountancy code
|
UserAccountancyCode=User accountancy code
|
||||||
UserLogoff=User logout
|
UserLogoff=User logout
|
||||||
UserLogged=User logged
|
UserLogged=User logged
|
||||||
|
DateEmployment=Date of Employment
|
||||||
@ -100,3 +100,4 @@ WeeklyHours=Heures de travail hebdomadaires
|
|||||||
ColorUser=Couleur de l'utilisateur
|
ColorUser=Couleur de l'utilisateur
|
||||||
DisabledInMonoUserMode=Désactivé en mode maintenance
|
DisabledInMonoUserMode=Désactivé en mode maintenance
|
||||||
UserAccountancyCode=Code comptable utilisateur
|
UserAccountancyCode=Code comptable utilisateur
|
||||||
|
DateEmployment=Date d'embauche
|
||||||
|
|||||||
@ -216,6 +216,8 @@ if (empty($reshook)) {
|
|||||||
$object->weeklyhours = GETPOST("weeklyhours") != '' ? GETPOST("weeklyhours") : '';
|
$object->weeklyhours = GETPOST("weeklyhours") != '' ? GETPOST("weeklyhours") : '';
|
||||||
|
|
||||||
$object->color = GETPOST("color") != '' ? GETPOST("color") : '';
|
$object->color = GETPOST("color") != '' ? GETPOST("color") : '';
|
||||||
|
$dateemployment = dol_mktime(0, 0, 0, GETPOST('dateemploymentmonth'), GETPOST('dateemploymentday'), GETPOST('dateemploymentyear'));
|
||||||
|
$object->dateemployment = $dateemployment;
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||||
@ -357,6 +359,8 @@ if (empty($reshook)) {
|
|||||||
$object->weeklyhours = GETPOST("weeklyhours") != '' ? GETPOST("weeklyhours") : '';
|
$object->weeklyhours = GETPOST("weeklyhours") != '' ? GETPOST("weeklyhours") : '';
|
||||||
|
|
||||||
$object->color = GETPOST("color") != '' ? GETPOST("color") : '';
|
$object->color = GETPOST("color") != '' ? GETPOST("color") : '';
|
||||||
|
$dateemployment = dol_mktime(0, 0, 0, GETPOST('dateemploymentmonth'), GETPOST('dateemploymentday'), GETPOST('dateemploymentyear'));
|
||||||
|
$object->dateemployment = $dateemployment;
|
||||||
|
|
||||||
if (! empty($conf->multicompany->enabled))
|
if (! empty($conf->multicompany->enabled))
|
||||||
{
|
{
|
||||||
@ -1058,6 +1062,13 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
// Date employment
|
||||||
|
print '<tr><td>'.$langs->trans("DateEmployment").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
echo $form->select_date(GETPOST('dateemployment'),'dateemployment',0,0,1,'form'.'dateemployment',1,0,1);
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
// Accountancy code
|
// Accountancy code
|
||||||
if ($conf->accounting->enabled)
|
if ($conf->accounting->enabled)
|
||||||
{
|
{
|
||||||
@ -1412,6 +1423,13 @@ else
|
|||||||
print '<td>'.$object->accountancy_code.'</td>';
|
print '<td>'.$object->accountancy_code.'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Date employment
|
||||||
|
print '<tr><td>'.$langs->trans("DateEmployment").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print dol_print_date($object->dateemployment);
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -2186,6 +2204,13 @@ else
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
// Date employment
|
||||||
|
print '<tr><td>'.$langs->trans("DateEmployment").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
echo $form->select_date(GETPOST('dateemployment')?GETPOST('dateemployment'):$object->dateemployment,'dateemployment',0,0,1,'form'.'dateemployment',1,0,1);
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
// Accountancy code
|
// Accountancy code
|
||||||
if ($conf->accounting->enabled)
|
if ($conf->accounting->enabled)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -123,6 +123,8 @@ class User extends CommonObject
|
|||||||
|
|
||||||
var $color; // Define background color for user in agenda
|
var $color; // Define background color for user in agenda
|
||||||
|
|
||||||
|
var $dateemployment; // Define date of employment by company
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor de la classe
|
* Constructor de la classe
|
||||||
*
|
*
|
||||||
@ -187,6 +189,7 @@ class User extends CommonObject
|
|||||||
$sql.= " u.salaryextra,";
|
$sql.= " u.salaryextra,";
|
||||||
$sql.= " u.weeklyhours,";
|
$sql.= " u.weeklyhours,";
|
||||||
$sql.= " u.color,";
|
$sql.= " u.color,";
|
||||||
|
$sql.= " u.dateemployment,";
|
||||||
$sql.= " u.ref_int, u.ref_ext,";
|
$sql.= " u.ref_int, u.ref_ext,";
|
||||||
$sql.= " c.code as country_code, c.label as country,";
|
$sql.= " c.code as country_code, c.label as country,";
|
||||||
$sql.= " d.code_departement as state_code, d.nom as state";
|
$sql.= " d.code_departement as state_code, d.nom as state";
|
||||||
@ -286,6 +289,7 @@ class User extends CommonObject
|
|||||||
$this->salaryextra = $obj->salaryextra;
|
$this->salaryextra = $obj->salaryextra;
|
||||||
$this->weeklyhours = $obj->weeklyhours;
|
$this->weeklyhours = $obj->weeklyhours;
|
||||||
$this->color = $obj->color;
|
$this->color = $obj->color;
|
||||||
|
$this->dateemployment = $this->db->jdate($obj->dateemployment);
|
||||||
|
|
||||||
$this->datec = $this->db->jdate($obj->datec);
|
$this->datec = $this->db->jdate($obj->datec);
|
||||||
$this->datem = $this->db->jdate($obj->datem);
|
$this->datem = $this->db->jdate($obj->datem);
|
||||||
@ -1260,6 +1264,7 @@ class User extends CommonObject
|
|||||||
$this->town = empty($this->town)?'':$this->town;
|
$this->town = empty($this->town)?'':$this->town;
|
||||||
$this->accountancy_code = trim($this->accountancy_code);
|
$this->accountancy_code = trim($this->accountancy_code);
|
||||||
$this->color = empty($this->color)?'':$this->color;
|
$this->color = empty($this->color)?'':$this->color;
|
||||||
|
$this->dateemployment = empty($this->dateemployment)?'':$this->dateemployment;
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email))
|
if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email))
|
||||||
@ -1300,6 +1305,7 @@ class User extends CommonObject
|
|||||||
$sql.= ", signature = '".$this->db->escape($this->signature)."'";
|
$sql.= ", signature = '".$this->db->escape($this->signature)."'";
|
||||||
$sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'";
|
$sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'";
|
||||||
$sql.= ", color = '".$this->db->escape($this->color)."'";
|
$sql.= ", color = '".$this->db->escape($this->color)."'";
|
||||||
|
$sql.= ", dateemployment=".(strval($this->dateemployment)!='' ? "'".$this->db->idate($this->dateemployment)."'" : 'null');
|
||||||
$sql.= ", note = '".$this->db->escape($this->note)."'";
|
$sql.= ", note = '".$this->db->escape($this->note)."'";
|
||||||
$sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null");
|
$sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null");
|
||||||
$sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null");
|
$sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user