diff --git a/app/Controllers/Attributes.php b/app/Controllers/Attributes.php index e3a8c710f..090d57970 100644 --- a/app/Controllers/Attributes.php +++ b/app/Controllers/Attributes.php @@ -160,7 +160,7 @@ class Attributes extends Secure_Controller echo json_encode($suggestions); } - public function getAjaxRow(int $row_id): void + public function getRow(int $row_id): void { $attribute_definition_info = $this->attribute->get_info($row_id); $attribute_definition_info->definition_flags = $this->get_attributes($attribute_definition_info->definition_flags); diff --git a/app/Controllers/Cashups.php b/app/Controllers/Cashups.php index 0e5863e56..665f42bc2 100644 --- a/app/Controllers/Cashups.php +++ b/app/Controllers/Cashups.php @@ -178,7 +178,7 @@ class Cashups extends Secure_Controller echo view("cashups/form", $data); } - public function getAjaxRow(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); diff --git a/app/Controllers/Customers.php b/app/Controllers/Customers.php index 6305fb042..8c0021978 100644 --- a/app/Controllers/Customers.php +++ b/app/Controllers/Customers.php @@ -64,8 +64,9 @@ class Customers extends Persons /** * Gets one row for a customer manage table. This is called using AJAX to update one row. */ - public function getAjaxRow(int $row_id): void + public function getRow(int $row_id): void { + log_message('info', '>>>getRow row_id-' . $row_id); $person = $this->customer->get_info($row_id); // retrieve the total amount the customer spent so far together with min, max and average values @@ -353,7 +354,7 @@ class Customers extends Persons /** * AJAX call to verify if an email address already exists */ - public function postAjaxCheckEmail(): void + public function postCheckEmail(): void { $exists = $this->customer->check_email_exists(strtolower($this->request->getPost('email')), $this->request->getPost('person_id', FILTER_SANITIZE_NUMBER_INT)); @@ -363,7 +364,7 @@ class Customers extends Persons /** * AJAX call to verify if an account number already exists */ - public function postAjaxCheckAccountNumber(): void + public function postCheckAccountNumber(): void { $exists = $this->customer->check_account_number_exists($this->request->getPost('account_number'), $this->request->getPost('person_id', FILTER_SANITIZE_NUMBER_INT)); diff --git a/app/Controllers/Expenses.php b/app/Controllers/Expenses.php index ed2a462d3..eba38e35a 100644 --- a/app/Controllers/Expenses.php +++ b/app/Controllers/Expenses.php @@ -125,7 +125,7 @@ class Expenses extends Secure_Controller echo view("expenses/form", $data); } - public function getAjaxRow(int $row_id): vpid + public function getRow(int $row_id): vpid { $expense_info = $this->expense->get_info($row_id); $data_row = get_expenses_data_row($expense_info); diff --git a/app/Controllers/Expenses_categories.php b/app/Controllers/Expenses_categories.php index ce99904cc..32a6083c4 100644 --- a/app/Controllers/Expenses_categories.php +++ b/app/Controllers/Expenses_categories.php @@ -46,7 +46,7 @@ class Expenses_categories extends Secure_Controller //TODO: Is this class ever u echo json_encode (['total' => $total_rows, 'rows' => $data_rows]); } - public function getAjaxRow(int $row_id): void + public function getRow(int $row_id): void { $data_row = get_expense_category_data_row($this->expense_category->get_info($row_id)); diff --git a/app/Controllers/Giftcards.php b/app/Controllers/Giftcards.php index cf992b182..d0d40fdb9 100644 --- a/app/Controllers/Giftcards.php +++ b/app/Controllers/Giftcards.php @@ -64,7 +64,7 @@ class Giftcards extends Secure_Controller echo json_encode($suggestions); } - public function getAjaxRow(int $row_id): void + public function getRow(int $row_id): void { $data_row = get_giftcard_data_row($this->giftcard->get_info($row_id)); diff --git a/app/Controllers/Item_kits.php b/app/Controllers/Item_kits.php index cb644b2cc..4f8e43680 100644 --- a/app/Controllers/Item_kits.php +++ b/app/Controllers/Item_kits.php @@ -103,7 +103,7 @@ class Item_kits extends Secure_Controller echo json_encode($suggestions); } - public function getAjaxRow(int $row_id): void + public function getRow(int $row_id): void { // calculate the total cost and retail price of the Kit, so it can be added to the table refresh $item_kit = $this->_add_totals_to_item_kit($this->item_kit->get_info($row_id)); diff --git a/app/Controllers/Persons.php b/app/Controllers/Persons.php index ffc449165..4b245554e 100644 --- a/app/Controllers/Persons.php +++ b/app/Controllers/Persons.php @@ -36,7 +36,7 @@ abstract class Persons extends Secure_Controller /** * Gets one row for a person manage table. This is called using AJAX to update one row. */ - public function getAjaxRow(int $row_id): void + public function getRow(int $row_id): void { $data_row = get_person_data_row($this->person->get_info($row_id)); diff --git a/app/Controllers/Sales.php b/app/Controllers/Sales.php index caf978735..a30a35914 100644 --- a/app/Controllers/Sales.php +++ b/app/Controllers/Sales.php @@ -91,7 +91,7 @@ class Sales extends Secure_Controller } } - public function getAjaxRow(int $row_id): void + public function getRow(int $row_id): void { $sale_info = $this->sale->get_info($row_id)->getRow(); $data_row = get_sale_data_row($sale_info); diff --git a/app/Controllers/Suppliers.php b/app/Controllers/Suppliers.php index e761cd9a8..763c8e795 100644 --- a/app/Controllers/Suppliers.php +++ b/app/Controllers/Suppliers.php @@ -32,7 +32,7 @@ class Suppliers extends Persons * @param $row_id * @return void */ - public function getAjaxRow($row_id): void + public function getRow($row_id): void { $data_row = get_supplier_data_row($this->supplier->get_info($row_id)); $data_row['category'] = $this->supplier->get_category_name($data_row['category']); diff --git a/app/Controllers/Tax_categories.php b/app/Controllers/Tax_categories.php index 2a0daad1f..848869301 100644 --- a/app/Controllers/Tax_categories.php +++ b/app/Controllers/Tax_categories.php @@ -46,7 +46,7 @@ class Tax_categories extends Secure_Controller echo json_encode (['total' => $total_rows, 'rows' => $data_rows]); } - public function getAjaxRow($row_id): void + public function getRow($row_id): void { $data_row = get_tax_categories_data_row($this->tax_category->get_info($row_id)); diff --git a/app/Controllers/Tax_codes.php b/app/Controllers/Tax_codes.php index e6997483c..606b551b7 100644 --- a/app/Controllers/Tax_codes.php +++ b/app/Controllers/Tax_codes.php @@ -54,7 +54,7 @@ class Tax_codes extends Secure_Controller echo json_encode (['total' => $total_rows, 'rows' => $data_rows]); } - public function getAjaxRow(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)); diff --git a/app/Controllers/Tax_jurisdictions.php b/app/Controllers/Tax_jurisdictions.php index fdb57141f..d621e0483 100644 --- a/app/Controllers/Tax_jurisdictions.php +++ b/app/Controllers/Tax_jurisdictions.php @@ -49,7 +49,7 @@ class Tax_jurisdictions extends Secure_Controller echo json_encode (['total' => $total_rows, 'rows' => $data_rows]); } - public function getAjaxRow(int $row_id): void + public function getRow(int $row_id): void { $data_row = get_tax_jurisdictions_data_row($this->tax_jurisdiction->get_info($row_id)); diff --git a/app/Controllers/Taxes.php b/app/Controllers/Taxes.php index b080c13d4..6fb8ea835 100644 --- a/app/Controllers/Taxes.php +++ b/app/Controllers/Taxes.php @@ -119,7 +119,7 @@ class Taxes extends Secure_Controller } - public function getAjaxRow(int $row_id): void + public function getRow(int $row_id): void { $data_row = get_tax_rates_data_row($this->tax->get_info($row_id)); diff --git a/app/Views/customers/form.php b/app/Views/customers/form.php index 168588fcd..52c94933f 100644 --- a/app/Views/customers/form.php +++ b/app/Views/customers/form.php @@ -508,7 +508,7 @@ $(document).ready(function() { remote: { - url: "", + url: "", type: 'POST', data: { 'person_id': "person_id ?>" @@ -520,7 +520,7 @@ $(document).ready(function() { remote: { - url: "", + url: "", type: 'POST', data: { 'person_id': "person_id ?>" diff --git a/public/js/manage_tables.js b/public/js/manage_tables.js index c87e11512..bfddc7ac8 100644 --- a/public/js/manage_tables.js +++ b/public/js/manage_tables.js @@ -293,7 +293,7 @@ var rows = $(selector.join(",")).length; if (rows > 0 && rows < 15) { var ids = id.split(":"); - $.get([url || resource + '/ajaxRow', id].join("/"), {}, function (response) { + $.get([url || resource + '/row', id].join("/"), {}, function (response) { $.each(selector, function (index, element) { var id = $(element).data('uniqueid'); table().updateByUniqueId({id: id, row: response[id] || response});