forked from Wavyzz/dolibarr
Merge pull request #3809 from aspangaro/develop-hrm
HRM module : continue to work
This commit is contained in:
@@ -53,7 +53,7 @@ dol_htmloutput_mesg($mesg);
|
||||
|
||||
// Subheader
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback);
|
||||
print load_fiche_titre($langs->trans("HRMSetup"), $linkback);
|
||||
|
||||
// Configuration header
|
||||
$head = hrm_admin_prepare_head();
|
||||
|
||||
@@ -48,7 +48,7 @@ dol_htmloutput_mesg($mesg);
|
||||
|
||||
// Subheader
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback);
|
||||
print load_fiche_titre($langs->trans("HRMSetup"), $linkback);
|
||||
|
||||
// Configuration header
|
||||
$head = hrm_admin_prepare_head();
|
||||
|
||||
226
htdocs/hrm/class/employee.class.php
Normal file
226
htdocs/hrm/class/employee.class.php
Normal file
@@ -0,0 +1,226 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/hrm/class/employee.class.php
|
||||
* \ingroup HRM
|
||||
* \brief File of class to manage employees
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
|
||||
|
||||
/**
|
||||
* Class to manage establishments
|
||||
*/
|
||||
class Employee extends CommonObject
|
||||
{
|
||||
public $element='employee';
|
||||
public $table_element='user';
|
||||
public $table_element_line = '';
|
||||
public $fk_element = 'fk_user';
|
||||
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
var $rowid;
|
||||
|
||||
var $name;
|
||||
var $address;
|
||||
var $zip;
|
||||
var $town;
|
||||
var $status; // 0=open, 1=closed
|
||||
var $entity;
|
||||
|
||||
var $statuts=array();
|
||||
var $statuts_short=array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
|
||||
$this->statuts_short = array(0 => 'Opened', 1 => 'Closed');
|
||||
$this->statuts = array(0 => 'Opened', 1 => 'Closed');
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load an object from database
|
||||
*
|
||||
* @param int $id Id of record to load
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($id)
|
||||
{
|
||||
$sql = "SELECT rowid, firstname, lastname, status, fk_user";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user";
|
||||
$sql.= " WHERE rowid = ".$id;
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if ( $result )
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->name = $obj->name;
|
||||
$this->address = $obj->address;
|
||||
$this->zip = $obj->zip;
|
||||
$this->town = $obj->town;
|
||||
$this->status = $obj->status;
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a link to the employee card (with optionaly the picto)
|
||||
* Use this->id,this->lastname, this->firstname
|
||||
*
|
||||
* @param int $withpictoimg Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo)
|
||||
* @param string $option On what the link point to
|
||||
* @param integer $notooltip 1=Disable tooltip on picto and name
|
||||
* @param int $maxlen Max length of visible employee name
|
||||
* @param int $hidethirdpartylogo Hide logo of thirdparty
|
||||
* @param string $mode ''=Show firstname and lastname, 'firstname'=Show only firstname, 'login'=Show login
|
||||
* @param string $morecss Add more css on link
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpictoimg=0, $option='', $notooltip=0, $maxlen=24, $hidethirdpartylogo=0, $mode='',$morecss='')
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) $withpictoimg=0;
|
||||
|
||||
$result = '';
|
||||
$companylink = '';
|
||||
$link = '';
|
||||
|
||||
$label = '<u>' . $langs->trans("Employee") . '</u>';
|
||||
$label.= '<div width="100%">';
|
||||
$label.= '<b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs,'','');
|
||||
$label.= '<br><b>' . $langs->trans("EMail").':</b> '.$this->email;
|
||||
$label.='</div>';
|
||||
if (! empty($this->photo))
|
||||
{
|
||||
$label.= '<div class="photointooltip">';
|
||||
$label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small', 0, 1);
|
||||
$label.= '</div><div style="clear: both;"></div>';
|
||||
}
|
||||
|
||||
$link.= '<a href="'.DOL_URL_ROOT.'/hrm/employee/card.php?id='.$this->id.'"';
|
||||
if (empty($notooltip))
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$langs->load("users");
|
||||
$label=$langs->trans("ShowUser");
|
||||
$link.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$link.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$link.= ' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
|
||||
}
|
||||
$link.= '>';
|
||||
$linkend='</a>';
|
||||
|
||||
//if ($withpictoimg == -1) $result.='<div class="nowrap">';
|
||||
$result.=$link;
|
||||
if ($withpictoimg)
|
||||
{
|
||||
$paddafterimage='';
|
||||
if (abs($withpictoimg) == 1) $paddafterimage='style="padding-right: 3px;"';
|
||||
if ($withpictoimg > 0) $picto='<div class="inline-block valignmiddle'.($morecss?' userimg'.$morecss:'').'">'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"')).'</div>';
|
||||
else $picto='<div class="inline-block valignmiddle'.($morecss?' userimg'.$morecss:'').'"'.($paddafterimage?' '.$paddafterimage:'').'>'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto', 'mini', 0, 1).'</div>';
|
||||
$result.=$picto;
|
||||
}
|
||||
if (abs($withpictoimg) != 2)
|
||||
{
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='<div class="inline-block valignmiddle'.($morecss?' usertext'.$morecss:'').'">';
|
||||
if ($mode == 'login') $result.=dol_trunc($this->login, $maxlen);
|
||||
else $result.=$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen);
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='</div>';
|
||||
}
|
||||
$result.=$linkend;
|
||||
//if ($withpictoimg == -1) $result.='</div>';
|
||||
$result.=$companylink;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return status label of an employee
|
||||
*
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
{
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return label of given status
|
||||
*
|
||||
* @param int $statut Id statut
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
global $langs;
|
||||
$langs->load('users');
|
||||
|
||||
if ($mode == 0)
|
||||
{
|
||||
$prefix='';
|
||||
if ($statut == 1) return $langs->trans('Enabled');
|
||||
if ($statut == 0) return $langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 1)
|
||||
{
|
||||
if ($statut == 1) return $langs->trans('Enabled');
|
||||
if ($statut == 0) return $langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 2)
|
||||
{
|
||||
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 3)
|
||||
{
|
||||
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4');
|
||||
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5');
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||
}
|
||||
if ($mode == 5)
|
||||
{
|
||||
if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||
if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
||||
}
|
||||
}
|
||||
}
|
||||
0
htdocs/hrm/employee/index.html
Normal file
0
htdocs/hrm/employee/index.html
Normal file
223
htdocs/hrm/employee/list.php
Normal file
223
htdocs/hrm/employee/list.php
Normal file
@@ -0,0 +1,223 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/hrm/employee/list.php
|
||||
* \ingroup core
|
||||
* \brief Page of users
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/hrm/class/employee.class.php';
|
||||
|
||||
if (! $user->rights->hrm->employee->read)
|
||||
accessforbidden();
|
||||
|
||||
$langs->load("users");
|
||||
$langs->load("companies");
|
||||
$langs->load("hrm");
|
||||
|
||||
// Security check (for external users)
|
||||
$socid=0;
|
||||
if ($user->societe_id > 0)
|
||||
$socid = $user->societe_id;
|
||||
|
||||
$sall=GETPOST('sall','alpha');
|
||||
$search_user=GETPOST('search_user','alpha');
|
||||
$search_login=GETPOST('search_login','alpha');
|
||||
$search_lastname=GETPOST('search_lastname','alpha');
|
||||
$search_firstname=GETPOST('search_firstname','alpha');
|
||||
$search_statut=GETPOST('search_statut','alpha');
|
||||
$search_thirdparty=GETPOST('search_thirdparty','alpha');
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
|
||||
if ($search_statut == '') $search_statut='1';
|
||||
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
$page = GETPOST('page','int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
$limit = $conf->liste_limit;
|
||||
if (! $sortfield) $sortfield="u.login";
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
$employeestatic = new Employee($db);
|
||||
$companystatic = new Societe($db);
|
||||
$form = new Form($db);
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter"))
|
||||
{
|
||||
$search_user="";
|
||||
$search_login="";
|
||||
$search_lastname="";
|
||||
$search_firstname="";
|
||||
$search_statut="";
|
||||
$search_thirdparty="";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('',$langs->trans("ListOfEmployees"));
|
||||
|
||||
$buttonviewhierarchy='<form action="'.DOL_URL_ROOT.'/hrm/employee/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : '').'" method="POST"><input type="submit" class="button" style="width:120px" name="viewcal" value="'.dol_escape_htmltag($langs->trans("HierarchicView")).'"></form>';
|
||||
|
||||
print load_fiche_titre($langs->trans("ListOfEmployees"), $buttonviewhierarchy);
|
||||
|
||||
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.email, u.gender,";
|
||||
$sql.= " u.datec,";
|
||||
$sql.= " u.tms as datem,";
|
||||
$sql.= " u.ldap_sid, u.statut, u.entity,";
|
||||
$sql.= " u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2,";
|
||||
$sql.= " s.nom as name, s.canvas";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid";
|
||||
$sql.= " WHERE u.employee >= '1'";
|
||||
$sql.= " AND u.entity IN (".getEntity('user',1).")";
|
||||
|
||||
if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid;
|
||||
if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user);
|
||||
if ($search_thirdparty != '') $sql.=natural_search(array('s.nom'), $search_thirdparty);
|
||||
if ($search_login != '') $sql.= natural_search("u.login", $search_login);
|
||||
if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname);
|
||||
if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname);
|
||||
if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")";
|
||||
if ($sall) $sql.= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email', 'u.note'), $sall);
|
||||
$sql.=$db->order($sortfield,$sortorder);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
|
||||
$param="search_user=".$search_user."&sall=".$sall;
|
||||
$param.="&search_statut=".$search_statut;
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("LastName"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder);
|
||||
if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))
|
||||
{
|
||||
print_liste_field_titre($langs->trans("Entity"),$_SERVER['PHP_SELF'],"u.entity",$param,"","",$sortfield,$sortorder);
|
||||
}
|
||||
print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u2.login",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER['PHP_SELF'],"u.statut",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
// Search bar
|
||||
if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) $colspan++;
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td><input type="text" name="search_login" size="6" value="'.$search_login.'"></td>';
|
||||
print '<td><input type="text" name="search_lastname" size="6" value="'.$search_lastname.'"></td>';
|
||||
print '<td><input type="text" name="search_firstname" size="6" value="'.$search_firstname.'"></td>';
|
||||
print '<td> </td>';
|
||||
|
||||
// Status
|
||||
print '<td align="right">';
|
||||
print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$employee2=new Employee($db);
|
||||
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
|
||||
$employeestatic->id=$obj->rowid;
|
||||
$employeestatic->ref=$obj->label;
|
||||
$employeestatic->login=$obj->login;
|
||||
$employeestatic->statut=$obj->statut;
|
||||
$employeestatic->email=$obj->email;
|
||||
$employeestatic->gender=$obj->gender;
|
||||
$employeestatic->societe_id=$obj->fk_soc;
|
||||
$employeestatic->firstname='';
|
||||
$employeestatic->lastname=$obj->login;
|
||||
|
||||
$li=$employeestatic->getNomUrl(1,'',0,0,24,1);
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td>';
|
||||
print $li;
|
||||
if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity)
|
||||
{
|
||||
print img_picto($langs->trans("SuperAdministrator"),'redstar');
|
||||
}
|
||||
else if ($obj->admin)
|
||||
{
|
||||
print img_picto($langs->trans("Administrator"),'star');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.ucfirst($obj->lastname).'</td>';
|
||||
print '<td>'.ucfirst($obj->firstname).'</td>';
|
||||
|
||||
// Resp
|
||||
print '<td class="nowrap" align="center">';
|
||||
if ($obj->login2)
|
||||
{
|
||||
$employee2->login=$obj->login2;
|
||||
//$employee2->lastname=$obj->lastname2;
|
||||
//$employee2->firstname=$obj->firstname2;
|
||||
$employee2->lastname=$employee2->login;
|
||||
$employee2->firstname='';
|
||||
print $employee2->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Statut
|
||||
$employeestatic->statut=$obj->statut;
|
||||
print '<td align="right">'.$employeestatic->getLibStatut(5).'</td>';
|
||||
print '<td> </td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
print "</form>\n";
|
||||
$db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
@@ -105,6 +105,74 @@ ALTER TABLE llx_product ADD COLUMN onportal tinyint DEFAULT 0 after tobuy;
|
||||
|
||||
ALTER TABLE llx_user ADD COLUMN employee tinyint DEFAULT 1;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS llx_c_hrm_function
|
||||
(
|
||||
rowid integer PRIMARY KEY,
|
||||
pos tinyint DEFAULT 0 NOT NULL,
|
||||
code varchar(16) NOT NULL,
|
||||
label varchar(50),
|
||||
c_level tinyint DEFAULT 0 NOT NULL,
|
||||
active tinyint DEFAULT 1 NOT NULL
|
||||
)ENGINE=innodb;
|
||||
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(1, 5,'EXECBOARD', 'Executive board', 0, 1);
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(2, 10, 'MANAGDIR', 'Managing director', 1, 1);
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 15, 'ACCOUNTMANAG', 'Account manager', 0, 1);
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 20, 'ENGAGDIR', 'Engagement director', 1, 1);
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(4, 25, 'DIRECTOR', 'Director', 1, 1);
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(5, 30, 'PROJMANAG', 'Project manager', 0, 1);
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(6, 35, 'DEPHEAD', 'Department head', 0, 1);
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(7, 40, 'SECRETAR', 'Secretary', 0, 1);
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(8, 45, 'EMPLOYEE', 'Department employee', 0, 1);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS llx_c_hrm_department
|
||||
(
|
||||
rowid integer PRIMARY KEY,
|
||||
pos tinyint DEFAULT 0 NOT NULL,
|
||||
code varchar(16) NOT NULL,
|
||||
label varchar(50),
|
||||
active tinyint DEFAULT 1 NOT NULL
|
||||
)ENGINE=innodb;
|
||||
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(1, 5,'MANAGEMENT', 'Management', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(2, 10,'GESTION', 'Gestion', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(3, 15,'TRAINING', 'Training', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(4, 20,'IT', 'Inform. Technology (IT)', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(5, 25,'MARKETING', 'Marketing', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(6, 30,'SALES', 'Sales', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(7, 35,'LEGAL', 'Legal', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(8, 40,'FINANCIAL', 'Financial accounting', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(9, 45,'HUMANRES', 'Human resources', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(10, 50,'PURCHASING', 'Purchasing', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(11, 55,'SERVICES', 'Services', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(12, 60,'CUSTOMSERV', 'Customer service', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(13, 65,'CONSULTING', 'Consulting', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(14, 70,'LOGISTIC', 'Logistics', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(15, 75,'CONSTRUCT', 'Engineering/design', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(16, 80,'PRODUCTION', 'Manufacturing', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(17, 85,'QUALITY', 'Quality assurance', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(18, 85,'MAINT', 'Plant assurance', 1);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS llx_establishment (
|
||||
rowid integer NOT NULL auto_increment PRIMARY KEY,
|
||||
entity integer NOT NULL DEFAULT 1,
|
||||
name varchar(50),
|
||||
address varchar(255),
|
||||
zip varchar(25),
|
||||
town varchar(50),
|
||||
fk_state integer DEFAULT 0,
|
||||
fk_country integer DEFAULT 0,
|
||||
profid1 varchar(20),
|
||||
profid2 varchar(20),
|
||||
profid3 varchar(20),
|
||||
phone varchar(20),
|
||||
fk_user_author integer NOT NULL,
|
||||
fk_user_mod integer NOT NULL,
|
||||
datec datetime NOT NULL,
|
||||
tms timestamp NOT NULL,
|
||||
status tinyint DEFAULT 1
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
|
||||
ALTER TABLE llx_projet_task_time ADD COLUMN invoice_id integer DEFAULT NULL;
|
||||
ALTER TABLE llx_projet_task_time ADD COLUMN invoice_line_id integer DEFAULT NULL;
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
--
|
||||
-- Be carefull to requests order.
|
||||
-- This file must be loaded by calling /install/index.php page
|
||||
-- when current version is 3.9.0 or higher.
|
||||
--
|
||||
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
|
||||
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
|
||||
-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
|
||||
-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
|
||||
-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60);
|
||||
-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name;
|
||||
-- To restrict request to Mysql version x.y use -- VMYSQLx.y
|
||||
-- To restrict request to Pgsql version x.y use -- VPGSQLx.y
|
||||
-- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
|
||||
-- To make pk to be auto increment (postgres): VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE
|
||||
-- To set a field as NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL;
|
||||
-- To set a field as default NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
|
||||
-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
|
||||
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS llx_c_hrm_function
|
||||
(
|
||||
rowid integer PRIMARY KEY,
|
||||
pos tinyint DEFAULT 0 NOT NULL,
|
||||
code varchar(16) NOT NULL,
|
||||
label varchar(50),
|
||||
c_level tinyint DEFAULT 0 NOT NULL,
|
||||
active tinyint DEFAULT 1 NOT NULL
|
||||
)ENGINE=innodb;
|
||||
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(1, 5,'EXECBOARD', 'Executive board', 0, 1);
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(2, 10, 'MANAGDIR', 'Managing director', 1, 1);
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 15, 'ACCOUNTMANAG', 'Account manager', 0, 1);
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 20, 'ENGAGDIR', 'Engagement director', 1, 1);
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(4, 25, 'DIRECTOR', 'Director', 1, 1);
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(5, 30, 'PROJMANAG', 'Project manager', 0, 1);
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(6, 35, 'DEPHEAD', 'Department head', 0, 1);
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(7, 40, 'SECRETAR', 'Secretary', 0, 1);
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(8, 45, 'EMPLOYEE', 'Department employee', 0, 1);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS llx_c_hrm_department
|
||||
(
|
||||
rowid integer PRIMARY KEY,
|
||||
pos tinyint DEFAULT 0 NOT NULL,
|
||||
code varchar(16) NOT NULL,
|
||||
label varchar(50),
|
||||
active tinyint DEFAULT 1 NOT NULL
|
||||
)ENGINE=innodb;
|
||||
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(1, 5,'MANAGEMENT', 'Management', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(2, 10,'GESTION', 'Gestion', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(3, 15,'TRAINING', 'Training', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(4, 20,'IT', 'Inform. Technology (IT)', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(5, 25,'MARKETING', 'Marketing', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(6, 30,'SALES', 'Sales', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(7, 35,'LEGAL', 'Legal', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(8, 40,'FINANCIAL', 'Financial accounting', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(9, 45,'HUMANRES', 'Human resources', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(10, 50,'PURCHASING', 'Purchasing', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(11, 55,'SERVICES', 'Services', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(12, 60,'CUSTOMSERV', 'Customer service', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(13, 65,'CONSULTING', 'Consulting', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(14, 70,'LOGISTIC', 'Logistics', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(15, 75,'CONSTRUCT', 'Engineering/design', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(16, 80,'PRODUCTION', 'Manufacturing', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(17, 85,'QUALITY', 'Quality assurance', 1);
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(18, 85,'MAINT', 'Plant assurance', 1);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS llx_establishment (
|
||||
rowid integer NOT NULL auto_increment PRIMARY KEY,
|
||||
entity integer NOT NULL DEFAULT 1,
|
||||
name varchar(50),
|
||||
address varchar(255),
|
||||
zip varchar(25),
|
||||
town varchar(50),
|
||||
fk_state integer DEFAULT 0,
|
||||
fk_country integer DEFAULT 0,
|
||||
profid1 varchar(20),
|
||||
profid2 varchar(20),
|
||||
profid3 varchar(20),
|
||||
phone varchar(20),
|
||||
fk_user_author integer NOT NULL,
|
||||
fk_user_mod integer NOT NULL,
|
||||
datec datetime NOT NULL,
|
||||
tms timestamp NOT NULL,
|
||||
status tinyint DEFAULT 1
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
@@ -1126,6 +1126,8 @@ EncryptedPasswordInDatabase=To allow the encryption of the passwords in the data
|
||||
DisableForgetPasswordLinkOnLogonPage=Do not show the link "Forget password" on login page
|
||||
UsersSetup=Users module setup
|
||||
UserMailRequired=EMail required to create a new user
|
||||
##### HRM setup #####
|
||||
HRMSetup=HRM module setup
|
||||
##### Company setup #####
|
||||
CompanySetup=Companies module setup
|
||||
CompanyCodeChecker=Module for third parties code generation and checking (customer or supplier)
|
||||
|
||||
@@ -8,6 +8,7 @@ DeleteEstablishment=Delete establishment
|
||||
ConfirmDeleteEstablishment=Are-you sure to delete this establishment ?
|
||||
OpenEtablishment=Open establishment
|
||||
CloseEtablishment=Close establishment
|
||||
ListOfEmployees=List of employees
|
||||
Employees=Employees
|
||||
Employee=Employee
|
||||
NewEmployee=New employee
|
||||
|
||||
Reference in New Issue
Block a user