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
|
// '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)
|
// '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('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
|
// Boxes
|
||||||
$this->boxes = array(); // List of 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.'/holiday/common.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.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/usergroups.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php';
|
||||||
|
|
||||||
$langs->load('users');
|
$langs->load('users');
|
||||||
$langs->load('holidays');
|
$langs->load('holidays');
|
||||||
@ -39,6 +40,7 @@ $langs->load('holidays');
|
|||||||
// Protection if external user
|
// Protection if external user
|
||||||
if ($user->societe_id > 0) accessforbidden();
|
if ($user->societe_id > 0) accessforbidden();
|
||||||
|
|
||||||
|
$mode = GETPOST("mode",'alpha');
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
$page = GETPOST("page",'int');
|
$page = GETPOST("page",'int');
|
||||||
@ -225,13 +227,22 @@ $form = new Form($db);
|
|||||||
$formother = new FormOther($db);
|
$formother = new FormOther($db);
|
||||||
|
|
||||||
if ($id > 0)
|
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);
|
$head = user_prepare_head($fuser);
|
||||||
|
|
||||||
$title = $langs->trans("User");
|
$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>';
|
$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);
|
dol_banner_tab($fuser,'id',$linkback,$user->rights->user->user->lire || $user->admin);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user