HRM: add a mode 'employee' for development to show tab
This commit is contained in:
parent
154f88a58c
commit
bedba7ffb7
@ -113,7 +113,7 @@ class modHoliday extends DolibarrModules
|
||||
// 'contact' to add a tab in contact view
|
||||
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
|
||||
$this->tabs = array('user:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->read:/holiday/list.php?mainmenu=holiday&id=__ID__');
|
||||
$this->tabs = array('employee:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->read:/holiday/list.php?mainmenu=holiday&id=__ID__');
|
||||
$this->tabs = array('employee:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->read:/holiday/list.php?mainmenu=holiday&mode=employee&id=__ID__');
|
||||
|
||||
// Boxes
|
||||
$this->boxes = array(); // List of boxes
|
||||
|
||||
@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php';
|
||||
|
||||
$langs->load('users');
|
||||
$langs->load('holidays');
|
||||
@ -39,6 +40,7 @@ $langs->load('holidays');
|
||||
// Protection if external user
|
||||
if ($user->societe_id > 0) accessforbidden();
|
||||
|
||||
$mode = GETPOST("mode",'alpha');
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
@ -226,13 +228,22 @@ $formother = new FormOther($db);
|
||||
|
||||
if ($id > 0)
|
||||
{
|
||||
$head = user_prepare_head($fuser);
|
||||
if ($mode == 'employee') // For HRM module development
|
||||
{
|
||||
$head = employee_prepare_head($fuser);
|
||||
$title = $langs->trans("Employee");
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/hrm/employee/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$head = user_prepare_head($fuser);
|
||||
$title = $langs->trans("User");
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/user/index.php">'.$langs->trans("BackToList").'</a>';
|
||||
}
|
||||
|
||||
$title = $langs->trans("User");
|
||||
|
||||
dol_fiche_head($head, 'paidholidays', $title, 0, 'user');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/user/index.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($fuser,'id',$linkback,$user->rights->user->user->lire || $user->admin);
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user