Tack on the void return type onto the Employee:logout method.

This commit is contained in:
Steve Ireland
2023-03-03 13:37:28 -05:00
committed by jekkos
parent 1d87de6f7d
commit 4798041408
123 changed files with 1270 additions and 937 deletions

View File

@@ -33,13 +33,13 @@ class Tax_codes extends Secure_Controller
/*
* Returns tax_category table data rows. This will be called with AJAX.
*/
public function search(): void
public function getSearch(): void
{
$search = $this->request->getGet('search', FILTER_SANITIZE_STRING);
$limit = $this->request->getGet('limit', FILTER_SANITIZE_NUMBER_INT);
$offset = $this->request->getGet('offset', FILTER_SANITIZE_NUMBER_INT);
$sort = $this->request->getGet('sort', FILTER_SANITIZE_STRING);
$order = $this->request->getGet('order', FILTER_SANITIZE_STRING);
$search = $this->request->getVar('search', FILTER_SANITIZE_STRING);
$limit = $this->request->getVar('limit', FILTER_SANITIZE_NUMBER_INT);
$offset = $this->request->getVar('offset', FILTER_SANITIZE_NUMBER_INT);
$sort = $this->request->getVar('sort', FILTER_SANITIZE_STRING);
$order = $this->request->getVar('order', FILTER_SANITIZE_STRING);
$tax_codes = $this->tax_code->search($search, $limit, $offset, $sort, $order);
$total_rows = $this->tax_code->get_found_rows($search);
@@ -54,14 +54,14 @@ class Tax_codes extends Secure_Controller
echo json_encode (['total' => $total_rows, 'rows' => $data_rows]);
}
public function get_row(int $row_id): void
public function getRow(int $row_id): void
{
$data_row = get_tax_code_data_row($this->tax_code->get_info($row_id));
echo json_encode($data_row);
}
public function view(int $tax_code_id = -1): void //TODO: Need to replace -1 with constant
public function getView(int $tax_code_id = NEW_ENTRY): void
{
$data['tax_code_info'] = $this->tax_code->get_info($tax_code_id);
@@ -69,7 +69,7 @@ class Tax_codes extends Secure_Controller
}
public function save(int $tax_code_id = -1): void //TODO: Need to replace -1 with constant
public function postSave(int $tax_code_id = NEW_ENTRY): void
{
$tax_code_data = [
'tax_code' => $this->request->getPost('tax_code', FILTER_SANITIZE_STRING),
@@ -80,7 +80,7 @@ class Tax_codes extends Secure_Controller
if($this->tax_code->save($tax_code_data))
{
if($tax_code_id == -1) //TODO: Need to replace -1 with constant
if($tax_code_id == NEW_ENTRY)
{
echo json_encode ([
'success' => TRUE,
@@ -102,12 +102,12 @@ class Tax_codes extends Secure_Controller
echo json_encode ([
'success' => FALSE,
'message' => lang('Tax_codes.error_adding_updating') . ' ' . $tax_code_data['tax_code_id'],
'id' => -1
'id' => NEW_ENTRY
]);
}
}
public function delete(): void
public function postDelete(): void
{
$tax_codes_to_delete = $this->request->getPost('ids', FILTER_SANITIZE_NUMBER_INT);
@@ -123,4 +123,4 @@ class Tax_codes extends Secure_Controller
echo json_encode (['success' => FALSE, 'message' => lang('Tax_codes.cannot_be_deleted')]);
}
}
}
}