mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-30 20:03:52 -04:00
Add Office Menu
This commit is contained in:
committed by
FrancescoUK
parent
5a9aa96b7e
commit
de91510beb
@@ -6,7 +6,7 @@ class Secure_Controller extends CI_Controller
|
||||
* Controllers that are considered secure extend Secure_Controller, optionally a $module_id can
|
||||
* be set to also check if a user can access a particular module in the system.
|
||||
*/
|
||||
public function __construct($module_id = NULL, $submodule_id = NULL)
|
||||
public function __construct($module_id = NULL, $submodule_id = NULL, $menu_group = NULL)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
@@ -28,7 +28,24 @@ class Secure_Controller extends CI_Controller
|
||||
}
|
||||
|
||||
// load up global data visible to all the loaded views
|
||||
$data['allowed_modules'] = $this->Module->get_allowed_modules($logged_in_employee_info->person_id);
|
||||
|
||||
$this->load->library('session');
|
||||
if($menu_group == NULL)
|
||||
{
|
||||
$menu_group = $this->session->userdata('menu_group');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set_userdata('menu_group', $menu_group);
|
||||
}
|
||||
if($menu_group == 'home')
|
||||
{
|
||||
$data['allowed_modules'] = $this->Module->get_allowed_home_modules($logged_in_employee_info->person_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['allowed_modules'] = $this->Module->get_allowed_office_modules($logged_in_employee_info->person_id);
|
||||
}
|
||||
$data['user_info'] = $logged_in_employee_info;
|
||||
$data['controller_name'] = $module_id;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user