mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-18 21:40:52 -04:00
Tack on the void return type onto the Employee:logout method.
This commit is contained in:
@@ -35,21 +35,21 @@ class Cashups extends Secure_Controller
|
||||
echo view('cashups/manage', $data);
|
||||
}
|
||||
|
||||
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);
|
||||
$filters = [
|
||||
'start_date' => $this->request->getGet('start_date', FILTER_SANITIZE_STRING), //TODO: Is this the best way to filter dates
|
||||
'end_date' => $this->request->getGet('end_date', FILTER_SANITIZE_STRING),
|
||||
'start_date' => $this->request->getVar('start_date', FILTER_SANITIZE_STRING), //TODO: Is this the best way to filter dates
|
||||
'end_date' => $this->request->getVar('end_date', FILTER_SANITIZE_STRING),
|
||||
'is_deleted' => FALSE
|
||||
];
|
||||
|
||||
// check if any filter is set in the multiselect dropdown
|
||||
$filledup = array_fill_keys($this->request->getGet('filters', FILTER_SANITIZE_STRING), TRUE); //TODO: $filledup doesn't follow variable naming patterns we are using.
|
||||
$filledup = array_fill_keys($this->request->getVar('filters', FILTER_SANITIZE_STRING), TRUE); //TODO: $filledup doesn't follow variable naming patterns we are using.
|
||||
$filters = array_merge($filters, $filledup);
|
||||
$cash_ups = $this->cashup->search($search, $filters, $limit, $offset, $sort, $order);
|
||||
$total_rows = $this->cashup->get_found_rows($search, $filters);
|
||||
@@ -62,7 +62,7 @@ class Cashups extends Secure_Controller
|
||||
echo json_encode(['total' => $total_rows, 'rows' => $data_rows]);
|
||||
}
|
||||
|
||||
public function view(int $cashup_id = -1): void //TODO: Need to replace -1 with a constant in constants.php
|
||||
public function getView(int $cashup_id = NEW_ENTRY): void
|
||||
{
|
||||
$data = [];
|
||||
|
||||
@@ -178,7 +178,7 @@ class Cashups extends Secure_Controller
|
||||
echo view("cashups/form", $data);
|
||||
}
|
||||
|
||||
public function get_row(int $row_id): void
|
||||
public function getRow(int $row_id): void
|
||||
{
|
||||
$cash_ups_info = $this->cashup->get_info($row_id);
|
||||
$data_row = get_cash_up_data_row($cash_ups_info);
|
||||
@@ -186,7 +186,7 @@ class Cashups extends Secure_Controller
|
||||
echo json_encode($data_row);
|
||||
}
|
||||
|
||||
public function save(int $cashup_id = -1): void //TODO: Need to replace -1 with a constant in constants.php
|
||||
public function postSave(int $cashup_id = NEW_ENTRY): void
|
||||
{
|
||||
$open_date = $this->request->getPost('open_date', FILTER_SANITIZE_STRING);
|
||||
$open_date_formatter = date_create_from_format($this->config['dateformat'] . ' ' . $this->config['timeformat'], $open_date);
|
||||
@@ -214,7 +214,7 @@ class Cashups extends Secure_Controller
|
||||
if($this->cashup->save_value($cash_up_data, $cashup_id))
|
||||
{
|
||||
//New cashup_id
|
||||
if($cashup_id == -1)//TODO: Need to replace -1 with a constant in constants.php
|
||||
if($cashup_id == NEW_ENTRY)
|
||||
{
|
||||
echo json_encode(['success' => TRUE, 'message' => lang('Cashups.successful_adding'), 'id' => $cash_up_data['cashup_id']]);
|
||||
}
|
||||
@@ -225,11 +225,11 @@ class Cashups extends Secure_Controller
|
||||
}
|
||||
else//failure
|
||||
{
|
||||
echo json_encode(['success' => FALSE, 'message' => lang('Cashups.error_adding_updating'), 'id' => -1]);//TODO: Need to replace -1 with a constant in constants.php
|
||||
echo json_encode(['success' => FALSE, 'message' => lang('Cashups.error_adding_updating'), 'id' => NEW_ENTRY]);
|
||||
}
|
||||
}
|
||||
|
||||
public function delete(): void
|
||||
public function postDelete(): void
|
||||
{
|
||||
$cash_ups_to_delete = $this->request->getPost('ids', FILTER_SANITIZE_STRING);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user