diff --git a/app/Controllers/Items.php b/app/Controllers/Items.php index 3fa20aea6..ef79a7269 100644 --- a/app/Controllers/Items.php +++ b/app/Controllers/Items.php @@ -440,7 +440,7 @@ class Items extends Secure_Controller echo view('items/form_inventory', $data); } - public function count_details(int $item_id = NEW_ENTRY): void + public function getCountDetails(int $item_id = NEW_ENTRY): void { $item_info = $this->item->get_info($item_id); //TODO: Duplicate code @@ -923,7 +923,7 @@ class Items extends Secure_Controller public function getCsvImport(): void { - echo view('items/form_csv_import', NULL); + echo view('items/form_csv_import'); } /** diff --git a/app/Helpers/tabular_helper.php b/app/Helpers/tabular_helper.php index 2e07978aa..f84c427da 100644 --- a/app/Helpers/tabular_helper.php +++ b/app/Helpers/tabular_helper.php @@ -520,7 +520,7 @@ function get_item_data_row(object $item): array ] ), 'stock' => anchor( - "$controller/count_details/$item->item_id", + "$controller/countDetails/$item->item_id", '', [ 'class' => 'modal-dlg', diff --git a/app/Models/Employee.php b/app/Models/Employee.php index 3de3afaf7..8b2336d82 100644 --- a/app/Models/Employee.php +++ b/app/Models/Employee.php @@ -472,13 +472,17 @@ class Employee extends Person /** * Determines whether the employee specified employee has access the specific module. */ - public function has_grant(?string $permission_id, int $person_id): bool + public function has_grant(?string $permission_id, ?int $person_id): bool { //if no module_id is null, allow access if($permission_id == NULL) { return TRUE; } + if($person_id == NULL) + { + return FALSE; + } $builder = $this->db->table('grants'); $query = $builder->getWhere(['person_id' => $person_id, 'permission_id' => $permission_id], 1);