I created a staff group named as ' Delivery Staff ' - staff for delivering foods.
Few changes i want and something i tried but i didn't get the feature exactly i want .
1. when delivery staff get logged in, then the first page directly go to Orders Page, Delivery staff no need to view other options like dashboard,kitchen items etc.,
2. I do not want to display ' Dashboard' in left navigation menu.
3. In Orders page, the list of orders should be listed only the orders assigned to that particular staff.
For these changes, i have tried the following things:
1. Created new permission in Admin->Settings->Permission as Admin.Dashboard with Access , Manage options selected.
2. Created new Staff group named as 'Delivery Staff' and in Privileges, i did not select Admin.Dashboard ( It means the menu should not display the dashboard link as per my understanding). For 'admin' Staff group, i selected both Access and Manage because admin should have dashboard.
3. Changes in codes:
In admin\Controllers\Login.php in index() i added below codings
if ($this->user->hasPermission('Admin.Dashboard.Access')) {
redirect('dashboard');
}
else{
redirect('orders');
}
Finally what i got is?
When the delivery staff get logged in. it directly goes to 'Orders' page. When i logged out and enter as 'Admin' still it goes to 'Orders' page .Actually i want to go to 'Dashboard'.
For getting only the orders assigned to that staff:
In admin\controllers\Orders.php in index()
if($this->user->getStaffGroupId() == '12') //Delivery staff
$filter['assignee_id'] = (int) $this->user->getStaffId();
In Orders_model.php in getList()
if ( ! empty($filter['assignee_id']) AND is_numeric($filter['assignee_id'])) {
$this->db->where('assignee_id', $filter['assignee_id']);
}
Finally what i got is?
Yes it works as i wanted.No problem.
But still i am facing these two problem - 1.redirect to Dashboard problem, 2. Dashboard menu option still visible in delivery staff login.
What i do for this?