Skip to content
Snippets Groups Projects
Commit bedba7ff authored by aspangaro's avatar aspangaro
Browse files

HRM: add a mode 'employee' for development to show tab

parent 154f88a5
Branches
Tags
No related merge requests found
......@@ -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');
......@@ -225,13 +227,22 @@ $form = new Form($db);
$formother = new FormOther($db);
if ($id > 0)
{
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");
dol_fiche_head($head, 'paidholidays', $title, 0, 'user');
$linkback = '<a href="'.DOL_URL_ROOT.'/user/index.php">'.$langs->trans("BackToList").'</a>';
}
dol_fiche_head($head, 'paidholidays', $title, 0, 'user');
dol_banner_tab($fuser,'id',$linkback,$user->rights->user->user->lire || $user->admin);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment