From f5d9403c7de04d434191383370626b50811f1075 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Jul 2018 15:38:00 +0200 Subject: [PATCH] Fix permission to see HR tab on user. All HR on same tabs. --- htdocs/core/lib/usergroups.lib.php | 5 ++++- htdocs/core/modules/modHoliday.class.php | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 7a62470e2da..2cbba69d256 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -143,7 +143,10 @@ function user_prepare_head($object) complete_head_from_modules($conf,$langs,$object,$head,$h,'user'); if ((! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) - || (! empty($conf->hrm->enabled) && ! empty($user->rights->hrm->employee->read))) + || (! empty($conf->hrm->enabled) && ! empty($user->rights->hrm->employee->read)) + || (! empty($conf->expensereport->enabled) && ! empty($user->rights->expensereport->lire) && $user->id == $object->id) + || (! empty($conf->holiday->enabled) && ! empty($user->rights->holiday->read) && $user->id == $object->id ) + ) { // Bank $head[$h][0] = DOL_URL_ROOT.'/user/bank.php?id='.$object->id; diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index be078b92a8e..78a1c71fbcb 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -89,7 +89,8 @@ class modHoliday extends DolibarrModules $this->const = array(); // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 0 or 'allentities') // Array to add new pages in new tabs - $this->tabs[] = array('data'=>'user:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->read:/holiday/list.php?mainmenu=hrm&id=__ID__'); // To add a new tab identified by code tabname1 + //$this->tabs[] = array('data'=>'user:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->read:/holiday/list.php?mainmenu=hrm&id=__ID__'); // We avoid to get one tab for each module. RH data are already in RH tab. + $this->tabs[] = array(); // To add a new tab identified by code tabname1 // Boxes $this->boxes = array(); // List of boxes