diff --git a/src/assets/js/backend_customers_helper.js b/src/assets/js/backend_customers_helper.js index 5b4d92e9..4086e077 100644 --- a/src/assets/js/backend_customers_helper.js +++ b/src/assets/js/backend_customers_helper.js @@ -9,15 +9,17 @@ * @since v1.0.0 * ---------------------------------------------------------------------------- */ -/** - * This class contains the methods that are used in the backend customers page. - * - * @class CustomersHelper - */ (function() { 'use strict'; + /** + * CustomersHelper Class + * + * This class contains the methods that are used in the backend customers page. + * + * @class CustomersHelper + */ function CustomersHelper() { this.filterResults = {}; }; @@ -185,7 +187,7 @@ /** * Save a customer record to the database (via ajax post). * - * @param {object} customer Contains the customer data. + * @param {Object} customer Contains the customer data. */ CustomersHelper.prototype.save = function(customer) { var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_customer', @@ -195,7 +197,9 @@ }; $.post(postUrl, postData, function(response) { - if (!GeneralFunctions.handleAjaxExceptions(response)) return; + if (!GeneralFunctions.handleAjaxExceptions(response)) { + return; + } Backend.displayNotification(EALang['customer_saved']); this.resetForm(); @@ -207,7 +211,7 @@ /** * Delete a customer record from database. * - * @param {numeric} id Record id to be deleted. + * @param {Number} id Record id to be deleted. */ CustomersHelper.prototype.delete = function(id) { var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_customer', @@ -217,7 +221,9 @@ }; $.post(postUrl, postData, function(response) { - if (!GeneralFunctions.handleAjaxExceptions(response)) return; + if (!GeneralFunctions.handleAjaxExceptions(response)) { + return; + } Backend.displayNotification(EALang['customer_deleted']); this.resetForm(); @@ -228,7 +234,7 @@ /** * Validate customer data before save (insert or update). * - * @param {object} customer Contains the customer data. + * @param {Object} customer Contains the customer data. */ CustomersHelper.prototype.validate = function(customer) { $('#form-message').hide(); @@ -287,7 +293,7 @@ /** * Display a customer record into the form. * - * @param {object} customer Contains the customer record data. + * @param {Object} customer Contains the customer record data. */ CustomersHelper.prototype.display = function(customer) { $('#customer-id').val(customer.id); @@ -304,8 +310,8 @@ $('#customer-appointments').empty(); $.each(customer.appointments, function(index, appointment) { var start = GeneralFunctions.formatDate(Date.parse(appointment.start_datetime), GlobalVariables.dateFormat, true), - end = GeneralFunctions.formatDate(Date.parse(appointment.end_datetime), GlobalVariables.dateFormat, true); - var html = + end = GeneralFunctions.formatDate(Date.parse(appointment.end_datetime), GlobalVariables.dateFormat, true), + html = '