It started to seem a little silly and a waste of time to try to keep including "ajax" in function names to identify them as function calls. So I'm backing that out with this commit, and going forward I will be removing ajax from the function names where they were added.

This commit is contained in:
Steve Ireland
2023-03-25 14:08:29 -04:00
parent 8cbc915741
commit ddc976919d
16 changed files with 20 additions and 19 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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));

View File

@@ -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);

View File

@@ -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));

View File

@@ -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));

View File

@@ -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));

View File

@@ -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));

View File

@@ -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);

View File

@@ -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']);

View File

@@ -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));

View File

@@ -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));

View File

@@ -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));

View File

@@ -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));

View File

@@ -508,7 +508,7 @@ $(document).ready(function()
{
remote:
{
url: "<?php echo esc("$controller_name/ajaxCheckEmail") ?>",
url: "<?php echo esc("$controller_name/checkEmail") ?>",
type: 'POST',
data: {
'person_id': "<?php echo $person_info->person_id ?>"
@@ -520,7 +520,7 @@ $(document).ready(function()
{
remote:
{
url: "<?php echo esc("$controller_name/ajaxCheckAccountNumber") ?>",
url: "<?php echo esc("$controller_name/checkAccountNumber") ?>",
type: 'POST',
data: {
'person_id': "<?php echo $person_info->person_id ?>"

View File

@@ -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});