From 9826e545c6d4a38569f2fce1f34dec249aebff51 Mon Sep 17 00:00:00 2001 From: Steve Ireland Date: Mon, 27 Mar 2023 23:56:34 -0400 Subject: [PATCH] Removed problematic calls to site_url function. --- app/Helpers/report_helper.php | 2 +- app/Views/attributes/form.php | 6 +++--- app/Views/attributes/item.php | 4 ++-- app/Views/attributes/manage.php | 2 +- app/Views/cashups/form.php | 4 ++-- app/Views/cashups/manage.php | 4 ++-- app/Views/configs/general_config.php | 4 ++-- app/Views/configs/info_config.php | 2 +- app/Views/configs/integrations_config.php | 2 +- app/Views/configs/reward_config.php | 2 +- app/Views/configs/stock_config.php | 2 +- app/Views/configs/table_config.php | 2 +- app/Views/configs/tax_config.php | 4 ++-- app/Views/employees/form.php | 4 ++-- app/Views/expenses/form.php | 4 ++-- app/Views/expenses/manage.php | 2 +- app/Views/expenses_categories/form.php | 2 +- app/Views/expenses_categories/manage.php | 2 +- app/Views/giftcards/form.php | 8 ++++---- app/Views/giftcards/manage.php | 2 +- app/Views/item_kits/form.php | 8 ++++---- app/Views/item_kits/manage.php | 4 ++-- app/Views/items/form_bulk.php | 4 ++-- app/Views/items/form_csv_import.php | 4 ++-- app/Views/items/form_inventory.php | 2 +- app/Views/messages/form_sms.php | 2 +- app/Views/receivings/form.php | 6 +++--- app/Views/receivings/receiving.php | 16 ++++++++-------- app/Views/sales/form.php | 16 ++++++++-------- app/Views/sales/register.php | 2 +- app/Views/sales/tax_invoice.php | 2 +- app/Views/sales/work_order.php | 2 +- app/Views/suppliers/form.php | 2 +- app/Views/taxes/tax_categories.php | 2 +- app/Views/taxes/tax_codes.php | 2 +- app/Views/taxes/tax_jurisdictions.php | 2 +- app/Views/taxes/tax_rates.php | 2 +- app/Views/taxes/tax_rates_form.php | 2 +- 38 files changed, 72 insertions(+), 72 deletions(-) diff --git a/app/Helpers/report_helper.php b/app/Helpers/report_helper.php index fe573055e..10f12adab 100644 --- a/app/Helpers/report_helper.php +++ b/app/Helpers/report_helper.php @@ -33,7 +33,7 @@ function show_report(string $report_prefix, string $report_name, string $lang_ke if(!empty($report_label) && $report_label != $lang_key . ' (TBD)') //TODO: String Interpolation. Also !== {//TODO: Is there a better way to do this? breaking the php like this makes it more difficult to read. ?> - "> + "> ', {definition_id: definition_id, attribute_value: value}); + $.post('', {definition_id: definition_id, attribute_value: value}); } $(this).parents("li").remove(); }; @@ -210,7 +210,7 @@ $(document).ready(function() } else { - $.post('', {definition_id: definition_id, attribute_value: value}); + $.post('', {definition_id: definition_id, attribute_value: value}); } } @@ -256,7 +256,7 @@ $(document).ready(function() success: function(response) { dialog_support.hide(); - table_support.handle_submit('', response); + table_support.handle_submit('', response); }, dataType: 'json' }); diff --git a/app/Views/attributes/item.php b/app/Views/attributes/item.php index e4e3fb526..f0058ed3c 100644 --- a/app/Views/attributes/item.php +++ b/app/Views/attributes/item.php @@ -100,7 +100,7 @@ foreach($definition_values as $definition_id => $definition_value) $("input[name='attribute_ids[" + definition_id + "]']").val(''); }).autocomplete({ source: function(request, response) { - $.get('' + this.element.data('definition-id') + '?term=' + request.term, function(data) { + $.get('' + this.element.data('definition-id') + '?term=' + request.term, function(data) { return response(data); }, 'json'); }, @@ -125,7 +125,7 @@ foreach($definition_values as $definition_id => $definition_value) var definition_id = $("#definition_name option:selected").val(); var attribute_values = definition_values(); attribute_values[definition_id] = ''; - $('#attributes').load('', { + $('#attributes').load('', { 'definition_ids': JSON.stringify(attribute_values) }, enable_delete); }; diff --git a/app/Views/attributes/manage.php b/app/Views/attributes/manage.php index 8133db010..46f0e869d 100644 --- a/app/Views/attributes/manage.php +++ b/app/Views/attributes/manage.php @@ -23,7 +23,7 @@ diff --git a/app/Views/configs/general_config.php b/app/Views/configs/general_config.php index 7c7932374..7d9b8130c 100644 --- a/app/Views/configs/general_config.php +++ b/app/Views/configs/general_config.php @@ -473,12 +473,12 @@ $(document).ready(function() lines_per_page: { required: true, - remote: "" + remote: "" }, default_sales_discount: { required: true, - remote: "" + remote: "" }, gcaptcha_site_key: { diff --git a/app/Views/configs/info_config.php b/app/Views/configs/info_config.php index 7b42b0e03..5220a6f1f 100644 --- a/app/Views/configs/info_config.php +++ b/app/Views/configs/info_config.php @@ -149,7 +149,7 @@ $(document).ready(function() $("a.fileinput-exists").click(function() { $.ajax({ type: 'POST', - url: '', + url: '', dataType: 'json' }) }); diff --git a/app/Views/configs/integrations_config.php b/app/Views/configs/integrations_config.php index 5663d6273..e01f3953a 100644 --- a/app/Views/configs/integrations_config.php +++ b/app/Views/configs/integrations_config.php @@ -61,7 +61,7 @@ $(document).ready(function() { $('#mailchimp_api_key').change(function() { - $.post("", { + $.post("", { 'mailchimp_api_key': $('#mailchimp_api_key').val() }, function(response) { diff --git a/app/Views/configs/reward_config.php b/app/Views/configs/reward_config.php index a4478fb5e..ffd345121 100644 --- a/app/Views/configs/reward_config.php +++ b/app/Views/configs/reward_config.php @@ -122,7 +122,7 @@ $(document).ready(function() }, success: function(response) { $.notify({ message: response.message }, { type: response.success ? 'success' : 'danger'}); - $("#customer_rewards").load('', init_add_remove_tables); + $("#customer_rewards").load('', init_add_remove_tables); }, dataType: 'json' }); diff --git a/app/Views/configs/stock_config.php b/app/Views/configs/stock_config.php index 77b6f8136..dc918e9f4 100644 --- a/app/Views/configs/stock_config.php +++ b/app/Views/configs/stock_config.php @@ -80,7 +80,7 @@ $(document).ready(function() $(form).ajaxSubmit({ success: function(response) { $.notify({ message: response.message }, { type: response.success ? 'success' : 'danger'}); - $("#stock_locations").load('', init_add_remove_locations); + $("#stock_locations").load('', init_add_remove_locations); }, dataType: 'json' }); diff --git a/app/Views/configs/table_config.php b/app/Views/configs/table_config.php index 21e81df98..5dc6301bf 100644 --- a/app/Views/configs/table_config.php +++ b/app/Views/configs/table_config.php @@ -117,7 +117,7 @@ $(document).ready(function() }, success: function(response) { $.notify({ message: response.message }, { type: response.success ? 'success' : 'danger'}); - $("#dinner_tables").load('', init_add_remove_tables); + $("#dinner_tables").load('', init_add_remove_tables); }, dataType: 'json' }); diff --git a/app/Views/configs/tax_config.php b/app/Views/configs/tax_config.php index 42870e31d..a401d3883 100644 --- a/app/Views/configs/tax_config.php +++ b/app/Views/configs/tax_config.php @@ -159,11 +159,11 @@ $(document).ready(function() { default_tax_1_rate: { - remote: "" + remote: "" }, default_tax2_rate: { - remote: "" + remote: "" }, }, diff --git a/app/Views/employees/form.php b/app/Views/employees/form.php index 3bed72c9a..17ba45825 100644 --- a/app/Views/employees/form.php +++ b/app/Views/employees/form.php @@ -209,7 +209,7 @@ $(document).ready(function() success: function(response) { dialog_support.hide(); - table_support.handle_submit("", response); + table_support.handle_submit("", response); }, dataType: 'json' }); @@ -226,7 +226,7 @@ $(document).ready(function() required: true, minlength: 5, - remote: '' + remote: '' }, password: { diff --git a/app/Views/expenses/form.php b/app/Views/expenses/form.php index 6e03aabb0..e4487af79 100644 --- a/app/Views/expenses/form.php +++ b/app/Views/expenses/form.php @@ -170,7 +170,7 @@ $(document).ready(function() var amount_validator = function(field) { return { - url: "", + url: "", type: 'POST', dataFilter: function(data) { var response = JSON.parse(data); @@ -226,7 +226,7 @@ $(document).ready(function() success: function(response) { dialog_support.hide(); - table_support.handle_submit("", response); + table_support.handle_submit("", response); }, dataType: 'json' }); diff --git a/app/Views/expenses/manage.php b/app/Views/expenses/manage.php index d09852838..a9a9a2cb6 100644 --- a/app/Views/expenses/manage.php +++ b/app/Views/expenses/manage.php @@ -53,7 +53,7 @@ $(document).ready(function() - diff --git a/app/Views/expenses_categories/form.php b/app/Views/expenses_categories/form.php index bc468e0ee..361a2020e 100644 --- a/app/Views/expenses_categories/form.php +++ b/app/Views/expenses_categories/form.php @@ -47,7 +47,7 @@ $(document).ready(function() success: function(response) { dialog_support.hide(); - table_support.handle_submit("", response); + table_support.handle_submit("", response); }, dataType: 'json' }); diff --git a/app/Views/expenses_categories/manage.php b/app/Views/expenses_categories/manage.php index 317d467cc..18f0800a5 100644 --- a/app/Views/expenses_categories/manage.php +++ b/app/Views/expenses_categories/manage.php @@ -28,7 +28,7 @@ $(document).ready(function()
- diff --git a/app/Views/giftcards/form.php b/app/Views/giftcards/form.php index 6d9ea27f7..fa5629d52 100644 --- a/app/Views/giftcards/form.php +++ b/app/Views/giftcards/form.php @@ -83,7 +83,7 @@ $(document).ready(function() }; $('#person_name').autocomplete({ - source: "", + source: "", minChars: 0, delay: 15, cacheLength: 1, @@ -98,11 +98,11 @@ $(document).ready(function() success: function(response) { dialog_support.hide(); - table_support.handle_submit("", response); + table_support.handle_submit("", response); }, error: function(jqXHR, textStatus, errorThrown) { - table_support.handle_submit("", {message: errorThrown}); + table_support.handle_submit("", {message: errorThrown}); }, dataType: 'json' }); @@ -129,7 +129,7 @@ $(document).ready(function() required: true, remote: { - url: "", + url: "", type: 'POST', data: { 'amount': $('#giftcard_amount').val() diff --git a/app/Views/giftcards/manage.php b/app/Views/giftcards/manage.php index 1d0f67bf1..15b2bdaf2 100644 --- a/app/Views/giftcards/manage.php +++ b/app/Views/giftcards/manage.php @@ -19,7 +19,7 @@ $(document).ready(function()
- diff --git a/app/Views/item_kits/form.php b/app/Views/item_kits/form.php index 04e5b13af..bf117cc32 100644 --- a/app/Views/item_kits/form.php +++ b/app/Views/item_kits/form.php @@ -215,7 +215,7 @@ $(document).ready(function() { $('#item').autocomplete({ - source: "", + source: '', minChars: 0, autoFocus: false, delay: 10, @@ -253,7 +253,7 @@ $(document).ready(function() $('#item_name').autocomplete({ - source: "", + source: "", minChars: 0, delay: 15, cacheLength: 1, @@ -268,7 +268,7 @@ $(document).ready(function() success: function(response) { dialog_support.hide(); - table_support.handle_submit("", response); + table_support.handle_submit("", response); }, dataType: 'json' }); @@ -285,7 +285,7 @@ $(document).ready(function() required: false, remote: { - url: "", + url: '', type: 'POST', data: { diff --git a/app/Views/item_kits/manage.php b/app/Views/item_kits/manage.php index 12fa33a35..85240aece 100644 --- a/app/Views/item_kits/manage.php +++ b/app/Views/item_kits/manage.php @@ -30,7 +30,7 @@ $(document).ready(function()
- @@ -42,7 +42,7 @@ $(document).ready(function()   -
diff --git a/app/Views/items/form_bulk.php b/app/Views/items/form_bulk.php index 93af88290..7cd583159 100644 --- a/app/Views/items/form_bulk.php +++ b/app/Views/items/form_bulk.php @@ -171,7 +171,7 @@ $(document).ready(function() { $('#category').autocomplete({ - source: "", + source: "", appendTo: '.modal-content', delay: 10 }); @@ -195,7 +195,7 @@ $(document).ready(function() success: function(response) { dialog_support.hide(); - table_support.handle_submit("", response); + table_support.handle_submit("", response); }, dataType: 'json' }); diff --git a/app/Views/items/form_csv_import.php b/app/Views/items/form_csv_import.php index e6bb78044..b18ddedd7 100644 --- a/app/Views/items/form_csv_import.php +++ b/app/Views/items/form_csv_import.php @@ -4,7 +4,7 @@
- +
@@ -30,7 +30,7 @@ $(document).ready(function() success:function(response) { dialog_support.hide(); - table_support.handle_submit('', response); + table_support.handle_submit('', response); }, dataType: 'json' }); diff --git a/app/Views/items/form_inventory.php b/app/Views/items/form_inventory.php index a0be8fe20..9584a5c2f 100644 --- a/app/Views/items/form_inventory.php +++ b/app/Views/items/form_inventory.php @@ -111,7 +111,7 @@ $(document).ready(function() success: function(response) { dialog_support.hide(); - table_support.handle_submit("", response); + table_support.handle_submit("", response); }, dataType: 'json' }); diff --git a/app/Views/messages/form_sms.php b/app/Views/messages/form_sms.php index 9fdfefbea..09b5df623 100644 --- a/app/Views/messages/form_sms.php +++ b/app/Views/messages/form_sms.php @@ -50,7 +50,7 @@ $(document).ready(function() success: function(response) { dialog_support.hide(); - table_support.handle_submit("", response); + table_support.handle_submit("", response); }, dataType: 'json' }); diff --git a/app/Views/receivings/form.php b/app/Views/receivings/form.php index ebe038333..a14438200 100644 --- a/app/Views/receivings/form.php +++ b/app/Views/receivings/form.php @@ -76,7 +76,7 @@ $(document).ready(function() }; $('#supplier_name').autocomplete({ - source: "", + source: "", minChars: 0, delay: 15, cacheLength: 1, @@ -88,7 +88,7 @@ $(document).ready(function() $('button#delete').click(function() { dialog_support.hide(); - table_support.do_delete("", ); + table_support.do_delete("", ); }); $('#receivings_edit_form').validate($.extend({ @@ -97,7 +97,7 @@ $(document).ready(function() success: function(response) { dialog_support.hide(); - table_support.handle_submit("", response); + table_support.handle_submit("", response); }, dataType: 'json' }); diff --git a/app/Views/receivings/receiving.php b/app/Views/receivings/receiving.php index a7cbdd6ce..399e5df9a 100644 --- a/app/Views/receivings/receiving.php +++ b/app/Views/receivings/receiving.php @@ -106,7 +106,7 @@ if (isset($success)) @@ -342,7 +342,7 @@ if (isset($success)) 'value' => lang('Receivings.start_typing_supplier_name') ]) ?> - @@ -496,7 +496,7 @@ $(document).ready(function() { $("#item").autocomplete( { - source: '', + source: '', minChars:0, delay:10, autoFocus: false, @@ -523,17 +523,17 @@ $(document).ready(function() $('#comment').keyup(function() { - $.post('', {comment: $('#comment').val()}); + $.post('', {comment: $('#comment').val()}); }); $('#recv_reference').keyup(function() { - $.post('', {recv_reference: $('#recv_reference').val()}); + $.post('', {recv_reference: $('#recv_reference').val()}); }); $("#recv_print_after_sale").change(function() { - $.post('', {recv_print_after_sale: $(this).is(":checked")}); + $.post('', {recv_print_after_sale: $(this).is(":checked")}); }); $('#item,#supplier').click(function() @@ -543,7 +543,7 @@ $(document).ready(function() $("#supplier").autocomplete( { - source: '', + source: '', minChars:0, delay:10, select: function (a, ui) { @@ -568,7 +568,7 @@ $(document).ready(function() { if (confirm('')) { - $('#finish_receiving_form').attr('action', ''); + $('#finish_receiving_form').attr('action', ''); $('#finish_receiving_form').submit(); } }); diff --git a/app/Views/sales/form.php b/app/Views/sales/form.php index 692440932..de753fb0a 100644 --- a/app/Views/sales/form.php +++ b/app/Views/sales/form.php @@ -165,7 +165,7 @@ $(document).ready(function() $('#send_invoice').click(function(event) { if (confirm("")) { - $.get("", + $.get("", function(response) { BootstrapDialog.closeAll(); $.notify( { message: response.message }, { type: response.success ? 'success' : 'danger'} ) @@ -184,7 +184,7 @@ $(document).ready(function() }; $('#customer_name').autocomplete( { - source: "", + source: "", minChars: 0, delay: 15, cacheLength: 1, @@ -200,7 +200,7 @@ $(document).ready(function() }; $('#employee_name').autocomplete( { - source: "", + source: "", minChars: 0, delay: 15, cacheLength: 1, @@ -211,12 +211,12 @@ $(document).ready(function() $('button#delete').click(function() { dialog_support.hide(); - table_support.do_delete("", ); + table_support.do_delete("", ); }); $('button#restore').click(function() { dialog_support.hide(); - table_support.do_restore("", ); + table_support.do_restore("", ); }); $('#sales_edit_form').validate($.extend( { @@ -225,10 +225,10 @@ $(document).ready(function() success: function(response) { dialog_support.hide(); - table_support.handle_submit("", response); + table_support.handle_submit("", response); const params = $.param(table_support.query_params()); - $.get("/search?" + params, function(response) { + $.get("/search?" + params, function(response) { $("#payment_summary").html(response.payment_summary); }, 'json'); }, @@ -244,7 +244,7 @@ $(document).ready(function() { remote: { - url: "", + url: "", type: 'POST', data: { 'sale_id': , diff --git a/app/Views/sales/register.php b/app/Views/sales/register.php index 27c18b13f..333ebd1d1 100644 --- a/app/Views/sales/register.php +++ b/app/Views/sales/register.php @@ -98,7 +98,7 @@ if(isset($success)) ?>
  • - diff --git a/app/Views/sales/tax_invoice.php b/app/Views/sales/tax_invoice.php index dca467822..4bff54a3b 100644 --- a/app/Views/sales/tax_invoice.php +++ b/app/Views/sales/tax_invoice.php @@ -34,7 +34,7 @@ $(document).ready(function() { var send_email = function() { - $.get('', + $.get('', function(response) { $.notify( { message: response.message }, { type: response.success ? 'success' : 'danger'} ) diff --git a/app/Views/sales/work_order.php b/app/Views/sales/work_order.php index 3532e3cbe..b8b32ff23 100644 --- a/app/Views/sales/work_order.php +++ b/app/Views/sales/work_order.php @@ -32,7 +32,7 @@ if(isset($error_message)) { var send_email = function() { - $.get('', + $.get('', function(response) { $.notify( { message: response.message }, { type: response.success ? 'success' : 'danger'} ) diff --git a/app/Views/suppliers/form.php b/app/Views/suppliers/form.php index 85999b69a..a551e08a9 100644 --- a/app/Views/suppliers/form.php +++ b/app/Views/suppliers/form.php @@ -84,7 +84,7 @@ $(document).ready(function() success: function(response) { dialog_support.hide(); - table_support.handle_submit("", response); + table_support.handle_submit("", response); }, dataType: 'json' }); diff --git a/app/Views/taxes/tax_categories.php b/app/Views/taxes/tax_categories.php index 84838c89c..b515f7b86 100644 --- a/app/Views/taxes/tax_categories.php +++ b/app/Views/taxes/tax_categories.php @@ -105,7 +105,7 @@ $(form).ajaxSubmit({ success: function(response) { $.notify({ message: response.message }, { type: response.success ? 'success' : 'danger'}); - $("#tax_categories").load('', init_add_remove_tax_categories); + $("#tax_categories").load('', init_add_remove_tax_categories); }, dataType: 'json' }); diff --git a/app/Views/taxes/tax_codes.php b/app/Views/taxes/tax_codes.php index 45fa8af51..7afa88078 100644 --- a/app/Views/taxes/tax_codes.php +++ b/app/Views/taxes/tax_codes.php @@ -104,7 +104,7 @@ $(form).ajaxSubmit({ success: function(response) { $.notify({ message: response.message }, { type: response.success ? 'success' : 'danger'}); - $("#tax_codes").load('', init_add_remove_tax_codes); + $("#tax_codes").load('', init_add_remove_tax_codes); }, dataType: 'json' }); diff --git a/app/Views/taxes/tax_jurisdictions.php b/app/Views/taxes/tax_jurisdictions.php index 5bc1790bc..ff89afebf 100644 --- a/app/Views/taxes/tax_jurisdictions.php +++ b/app/Views/taxes/tax_jurisdictions.php @@ -108,7 +108,7 @@ $(form).ajaxSubmit({ success: function(response) { $.notify({ message: response.message }, { type: response.success ? 'success' : 'danger'}); - $("#tax_jurisdictions").load('', init_add_remove_tax_jurisdiction); + $("#tax_jurisdictions").load('', init_add_remove_tax_jurisdiction); }, dataType: 'json' }); diff --git a/app/Views/taxes/tax_rates.php b/app/Views/taxes/tax_rates.php index 010d1ed45..d8a4f880a 100644 --- a/app/Views/taxes/tax_rates.php +++ b/app/Views/taxes/tax_rates.php @@ -18,7 +18,7 @@ $(document).ready(function()
    - diff --git a/app/Views/taxes/tax_rates_form.php b/app/Views/taxes/tax_rates_form.php index 1be7f3c5a..681545820 100644 --- a/app/Views/taxes/tax_rates_form.php +++ b/app/Views/taxes/tax_rates_form.php @@ -71,7 +71,7 @@ $(form).ajaxSubmit({ success: function (response) { dialog_support.hide(); - table_support.handle_submit('', response); + table_support.handle_submit('', response); }, dataType: 'json' });