mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-18 21:40:52 -04:00
Add route for no_access controller with just one parameter
Remove permission dependency between sales, receivings and items module Add explicit stock permission to sales and receiving modules
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
*/
|
||||
|
||||
$route['default_controller'] = "login";
|
||||
$route['no_access/(:any)'] = "no_access/index/$1";
|
||||
$route['no_access/(:any)/(:any)'] = "no_access/index/$1/$2";
|
||||
$route['reports/(summary_:any)/(:any)/(:any)'] = "reports/$1/$2/$3";
|
||||
$route['reports/summary_:any'] = "reports/date_input_excel_export";
|
||||
|
||||
@@ -69,7 +69,7 @@ class Employees extends Person_controller
|
||||
'country'=>$this->input->post('country'),
|
||||
'comments'=>$this->input->post('comments')
|
||||
);
|
||||
$grants_data = $this->input->post("grants")!=false ? $this->input->post("grants"):array();
|
||||
$grants_data = $this->input->post("grants")!=FALSE ? $this->input->post("grants"):array();
|
||||
|
||||
//Password has been changed OR first time password set
|
||||
if($this->input->post('password')!='')
|
||||
|
||||
@@ -9,7 +9,7 @@ class No_Access extends CI_Controller
|
||||
function index($module_id='',$permission_id='')
|
||||
{
|
||||
$data['module_name']=$this->Module->get_module_name($module_id);
|
||||
$data['permission_id']=empty($permission_id)?$module_id:$permission_id;
|
||||
$data['permission_id']=$permission_id;
|
||||
$this->load->view('no_access',$data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ class Receivings extends Secure_area
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct('receivings','items');
|
||||
parent::__construct('receivings');
|
||||
$this->load->library('receiving_lib');
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ class Sales extends Secure_area
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct('sales','items');
|
||||
parent::__construct('sales');
|
||||
$this->load->library('sale_lib');
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<?php
|
||||
echo $this->lang->line('error_no_permission_module').' '.$module_name . ' (' . $permission_id . ')';
|
||||
echo $this->lang->line('error_no_permission_module').' '.$module_name . (!empty($permission_id) ? ' (' . $permission_id . ')' : '');
|
||||
?>
|
||||
@@ -37,7 +37,14 @@ INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES
|
||||
('suppliers', 'suppliers');
|
||||
|
||||
-- add permissions for existing stock locations
|
||||
INSERT INTO `ospos_permissions` (permission_id, module_id, location_id) (SELECT CONCAT('items_', location_name), 'items', location_id FROM ospos_stock_locations);
|
||||
INSERT INTO `ospos_permissions` (permission_id, module_id, location_id)
|
||||
(SELECT CONCAT('items_', location_name), 'items', location_id FROM ospos_stock_locations);
|
||||
|
||||
INSERT INTO `ospos_permissions` (permission_id, module_id, location_id)
|
||||
(SELECT CONCAT('sales_', location_name), 'sales', location_id FROM ospos_stock_locations);
|
||||
|
||||
INSERT INTO `ospos_permissions` (permission_id, module_id, location_id)
|
||||
(SELECT CONCAT('receivings_', location_name), 'receivings', location_id FROM ospos_stock_locations);
|
||||
|
||||
CREATE TABLE `ospos_grants` (
|
||||
`permission_id` varchar(255) NOT NULL,
|
||||
@@ -72,6 +79,8 @@ INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES
|
||||
('sales', 1),
|
||||
('config', 1),
|
||||
('items_stock', 1),
|
||||
('sales_stock', 1),
|
||||
('receivings_stock', 1),
|
||||
('suppliers', 1);
|
||||
|
||||
-- add config options for tax inclusive sales
|
||||
|
||||
@@ -345,8 +345,9 @@ INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES
|
||||
('suppliers', 'suppliers');
|
||||
|
||||
INSERT INTO `ospos_permissions` (`permission_id`, `module_id`, `location_id`) VALUES
|
||||
('items_stock', 'items', 1);
|
||||
|
||||
('items_stock', 'items', 1),
|
||||
('sales_stock', 'sales', 1),
|
||||
('receivings_stock', 'receivings', 1);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -387,6 +388,8 @@ INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES
|
||||
('sales', 1),
|
||||
('config', 1),
|
||||
('items_stock', 1),
|
||||
('sales_stock', 1),
|
||||
('receivings_stock', 1),
|
||||
('suppliers', 1);
|
||||
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user