diff --git a/src/assets/js/backend_calendar.js b/src/assets/js/backend_calendar.js index 77637477..c3f6f0d1 100644 --- a/src/assets/js/backend_calendar.js +++ b/src/assets/js/backend_calendar.js @@ -310,10 +310,6 @@ var BackendCalendar = { 'url': getUrl, 'dataType': 'json', 'success': function(response) { - ///////////////////////////////////////////////// - console.log('Google Sync Response:', response); - ///////////////////////////////////////////////// - if (response.exceptions) { response.exceptions = GeneralFunctions.parseExceptions(response.exceptions); GeneralFunctions.displayMessageBox(GeneralFunctions.EXCEPTIONS_TITLE, @@ -445,10 +441,6 @@ var BackendCalendar = { }; $.post(postUrl, postData, function(response) { - ///////////////////////////////////////////////////////// - console.log('Delete Appointment Response :', response); - ///////////////////////////////////////////////////////// - $('#message_box').dialog('close'); if (response.exceptions) { @@ -487,10 +479,6 @@ var BackendCalendar = { }; $.post(postUrl, postData, function(response) { - ///////////////////////////////////////////////////////// - console.log('Delete Unavailable Response :', response); - ///////////////////////////////////////////////////////// - $('#message_box').dialog('close'); if (response.exceptions) { @@ -642,10 +630,6 @@ var BackendCalendar = { } var successCallback = function(response) { - /////////////////////////////////////////////////////////////////// - //console.log('Save Unavailable Time Period Response:', response); - /////////////////////////////////////////////////////////////////// - if (response.exceptions) { response.exceptions = GeneralFunctions.parseExceptions(response.exceptions); GeneralFunctions.displayMessageBox(GeneralFunctions.EXCEPTIONS_TITLE, GeneralFunctions.EXCEPTIONS_MESSAGE); @@ -682,10 +666,6 @@ var BackendCalendar = { }; var errorCallback = function(jqXHR, textStatus, errorThrown) { - //////////////////////////////////////////////////////////////////////// - console.log('Save Unavailable Error:', jqXHR, textStatus, errorThrown); - //////////////////////////////////////////////////////////////////////// - GeneralFunctions.displayMessageBox('Communication Error', 'Unfortunately ' + 'the operation could not complete due to server communication errors.'); @@ -746,10 +726,6 @@ var BackendCalendar = { 'provider_id': $('#select-filter-item').val() }; $.post(postUrl, postData, function(response) { - /////////////////////////////////////////////////////////////////// - console.log('Get Available Google Calendars Response', response); - /////////////////////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; $('#google-calendar').empty(); @@ -941,10 +917,6 @@ var BackendCalendar = { timeout: 1000, global: false, success: function(response) { - ///////////////////////////////////////////////////////////// - // console.log('Filter Customers Appointment Response:', response); - ///////////////////////////////////////////////////////////// - $list.empty(); $.each(response, function(index, c) { $list.append('
' @@ -961,10 +933,6 @@ var BackendCalendar = { }); }, error: function(jqXHR, textStatus, errorThrown) { - ////////////////////////////////////////////////////////////////// - // console.log('Filter Customers Appointment Error:', jqXHR, textStatus, errorThrown); - ////////////////////////////////////////////////////////////////// - // If there is any error on the request, search by the local client database. $list.empty(); $.each(GlobalVariables.customers, function(index, c) { @@ -1037,10 +1005,7 @@ var BackendCalendar = { 'provider_id': $('#select-filter-item').val(), 'calendar_id': $('#google-calendar').val() }; - $.post(postUrl, postData, function(response){ - /////////////////////////////////////////////////////////// - console.log('Select Google Calendar Response', response); - /////////////////////////////////////////////////////////// + $.post(postUrl, postData, function(response) { if (!GeneralFunctions.handleAjaxExceptions(response)) return; Backend.displayNotification(EALang['google_calendar_selected']); $('#select-google-calendar').modal('hide'); @@ -1089,10 +1054,6 @@ var BackendCalendar = { }; $.post(postUrl, postData, function(response) { - //////////////////////////////////////////////////////////////////// - console.log('Refresh Calendar Appointments Response :', response); - //////////////////////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; // :: ADD APPOINTMENTS TO CALENDAR @@ -1364,20 +1325,11 @@ var BackendCalendar = { 'data': postData, 'dataType': 'json', 'success': function(response) { - ///////////////////////////////////////////////////////////// - console.log('Save Appointment Data Response:', response); - ///////////////////////////////////////////////////////////// - if (successCallback !== undefined) { successCallback(response); } }, 'error': function(jqXHR, textStatus, errorThrown) { - ////////////////////////////////////////////////////////////////// - console.log('Save Appointment Data Error:', jqXHR, textStatus, - errorThrown); - ////////////////////////////////////////////////////////////////// - if (errorCallback !== undefined) { errorCallback(); } @@ -1786,8 +1738,6 @@ var BackendCalendar = { } var successCallback = function(response) { - console.log('Drop Unavailable Event Response:', response); - if (response.exceptions) { response.exceptions = GeneralFunctions.parseExceptions(response.exceptions); GeneralFunctions.displayMessageBox(GeneralFunctions.EXCEPTIONS_TITLE, GeneralFunctions.EXCEPTIONS_MESSAGE); @@ -1887,10 +1837,6 @@ var BackendCalendar = { }; $.post(postUrl, postData, function(response) { - //////////////////////////////////////////////////////////// - //console.log('Disable Provider Sync Response :', response); - //////////////////////////////////////////////////////////// - if (response.exceptions) { response.exceptions = GeneralFunctions.parseExceptions(response.exceptions); GeneralFunctions.displayMessageBox(GeneralFunctions.EXCEPTIONS_TITLE, GeneralFunctions.EXCEPTIONS_MESSAGE); diff --git a/src/assets/js/backend_customers.js b/src/assets/js/backend_customers.js index edc8e608..12db42d7 100644 --- a/src/assets/js/backend_customers.js +++ b/src/assets/js/backend_customers.js @@ -234,10 +234,6 @@ CustomersHelper.prototype.save = function(customer) { }; $.post(postUrl, postData, function(response) { - /////////////////////////////////////////////////////////// - console.log('Save Customer Response:', response); - /////////////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; Backend.displayNotification(EALang['customer_saved']); @@ -260,10 +256,6 @@ CustomersHelper.prototype.delete = function(id) { }; $.post(postUrl, postData, function(response) { - //////////////////////////////////////////////////// - //console.log('Delete customer response:', response); - //////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; Backend.displayNotification(EALang['customer_deleted']); @@ -382,10 +374,6 @@ CustomersHelper.prototype.filter = function(key, selectId, display) { }; $.post(postUrl, postData, function(response) { - /////////////////////////////////////////////////////// - console.log('Filter Customers Response:', response); - /////////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; BackendCustomers.helper.filterResults = response; diff --git a/src/assets/js/backend_services.js b/src/assets/js/backend_services.js index 8b344f93..819dc1ed 100644 --- a/src/assets/js/backend_services.js +++ b/src/assets/js/backend_services.js @@ -100,10 +100,6 @@ var BackendServices = { }; $.post(postUrl, postData, function(response) { - /////////////////////////////////////////////////////////////// - console.log('Update Available Categories Response:', response); - /////////////////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; GlobalVariables.categories = response; @@ -270,10 +266,6 @@ ServicesHelper.prototype.bindEventHandlers = function() { * then the update operation is going to be executed. */ ServicesHelper.prototype.save = function(service) { - //////////////////////////////////////////////// - //console.log('Service data to save:', service); - //////////////////////////////////////////////// - var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_service'; var postData = { 'csrfToken': GlobalVariables.csrfToken, @@ -281,9 +273,6 @@ ServicesHelper.prototype.save = function(service) { }; $.post(postUrl, postData, function(response) { - ////////////////////////////////////////////////// - //console.log('Save Service Response:', response); - ////////////////////////////////////////////////// if (!GeneralFunctions.handleAjaxExceptions(response)) return; Backend.displayNotification(EALang['service_saved']); @@ -306,10 +295,6 @@ ServicesHelper.prototype.delete = function(id) { }; $.post(postUrl, postData, function(response) { - //////////////////////////////////////////////////// - //console.log('Delete service response:', response); - //////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; Backend.displayNotification(EALang['service_deleted']); @@ -402,10 +387,6 @@ ServicesHelper.prototype.filter = function(key, selectId, display) { }; $.post(postUrl, postData, function(response) { - ///////////////////////////////////////////////////// - //console.log('Filter services response:', response); - ///////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; BackendServices.helper.filterResults = response; @@ -626,10 +607,6 @@ CategoriesHelper.prototype.filter = function(key, selectId, display) { }; $.post(postUrl, postData, function(response) { - /////////////////////////////////////////////////////// - console.log('Filter Categories Response:', response); - /////////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; BackendServices.helper.filterResults = response; @@ -666,10 +643,6 @@ CategoriesHelper.prototype.save = function(category) { }; $.post(postUrl, postData, function(response) { - /////////////////////////////////////////////////////////// - console.log('Save Service Category Response:', response); - /////////////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; Backend.displayNotification(EALang['service_category_saved']); @@ -693,10 +666,6 @@ CategoriesHelper.prototype.delete = function(id) { }; $.post(postUrl, postData, function(response) { - //////////////////////////////////////////////////// - console.log('Delete category response:', response); - //////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; Backend.displayNotification(EALang['service_category_deleted']); @@ -739,7 +708,6 @@ CategoriesHelper.prototype.validate = function(category) { return true; } catch(exc) { - console.log('Category Record Validation Exc:', exc); return false; } }; diff --git a/src/assets/js/backend_settings.js b/src/assets/js/backend_settings.js index d1eb9964..359d6573 100644 --- a/src/assets/js/backend_settings.js +++ b/src/assets/js/backend_settings.js @@ -172,9 +172,6 @@ var BackendSettings = { $('.save-settings').click(function() { var settings = BackendSettings.settings.get(); BackendSettings.settings.save(settings); - ////////////////////////////////////////////// - //console.log('Settings To Save: ', settings); - ////////////////////////////////////////////// }); /** @@ -196,9 +193,6 @@ var BackendSettings = { }; $.post(postUrl, postData, function(response) { - /////////////////////////////////////////////////////// - //console.log('Validate Username Response:', response); - /////////////////////////////////////////////////////// if (!GeneralFunctions.handleAjaxExceptions(response)) return; if (response == false) { $input.css('border', '2px solid red'); @@ -234,10 +228,6 @@ SystemSettings.prototype.save = function(settings) { }; $.post(postUrl, postData, function(response) { - /////////////////////////////////////////////////////////// - console.log('Save General Settings Response:', response); - /////////////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; Backend.displayNotification(EALang['settings_saved']); @@ -386,10 +376,6 @@ UserSettings.prototype.save = function(settings) { }; $.post(postUrl, postData, function(response) { - ////////////////////////////////////////////////////////// - console.log('Save User Settings Response: ', response); - ////////////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; Backend.displayNotification(EALang['settings_saved']); diff --git a/src/assets/js/backend_users.js b/src/assets/js/backend_users.js index 2e534346..6314b875 100644 --- a/src/assets/js/backend_users.js +++ b/src/assets/js/backend_users.js @@ -133,10 +133,6 @@ var BackendUsers = { 'key': '' }; $.post(postUrl, postData, function(response) { - ////////////////////////////////////////////////////////// - //console.log('Get all db providers response:', response); - ////////////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; GlobalVariables.providers = response; @@ -194,9 +190,6 @@ var BackendUsers = { }; $.post(postUrl, postData, function(response) { - /////////////////////////////////////////////////////// - console.log('Validate Username Response:', response); - /////////////////////////////////////////////////////// if (!GeneralFunctions.handleAjaxExceptions(response)) return; if (response == false) { $input.css('border', '2px solid red'); diff --git a/src/assets/js/backend_users_admins.js b/src/assets/js/backend_users_admins.js index bce4aad2..71d2e6b8 100644 --- a/src/assets/js/backend_users_admins.js +++ b/src/assets/js/backend_users_admins.js @@ -176,10 +176,6 @@ AdminsHelper.prototype.bindEventHandlers = function() { * then the update operation is going to be executed. */ AdminsHelper.prototype.save = function(admin) { - //////////////////////////////////////////// - //console.log('Admin data to save:', admin); - //////////////////////////////////////////// - var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_admin'; var postData = { 'csrfToken': GlobalVariables.csrfToken, @@ -187,9 +183,6 @@ AdminsHelper.prototype.save = function(admin) { }; $.post(postUrl, postData, function(response) { - //////////////////////////////////////////////// - //console.log('Save Admin Response:', response); - //////////////////////////////////////////////// if (!GeneralFunctions.handleAjaxExceptions(response)) return; Backend.displayNotification(EALang['admin_saved']); BackendUsers.helper.resetForm(); @@ -211,9 +204,6 @@ AdminsHelper.prototype.delete = function(id) { }; $.post(postUrl, postData, function(response) { - ////////////////////////////////////////////////// - //console.log('Delete admin response:', response); - ////////////////////////////////////////////////// if (!GeneralFunctions.handleAjaxExceptions(response)) return; Backend.displayNotification(EALang['admin_deleted']); BackendUsers.helper.resetForm(); @@ -342,10 +332,6 @@ AdminsHelper.prototype.filter = function(key, selectId, display) { }; $.post(postUrl, postData, function(response) { - /////////////////////////////////////////////////// - //console.log('Filter admins response:', response); - /////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; BackendUsers.helper.filterResults = response; diff --git a/src/assets/js/backend_users_providers.js b/src/assets/js/backend_users_providers.js index c8604481..92318cfc 100644 --- a/src/assets/js/backend_users_providers.js +++ b/src/assets/js/backend_users_providers.js @@ -227,10 +227,6 @@ ProvidersHelper.prototype.bindEventHandlers = function() { * then the update operation is going to be executed. */ ProvidersHelper.prototype.save = function(provider) { - ////////////////////////////////////////////////// - //console.log('Provider data to save:', provider); - ////////////////////////////////////////////////// - var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_provider'; var postData = { 'csrfToken': GlobalVariables.csrfToken, @@ -238,9 +234,6 @@ ProvidersHelper.prototype.save = function(provider) { }; $.post(postUrl, postData, function(response) { - /////////////////////////////////////////////////// - //console.log('Save Provider Response:', response); - /////////////////////////////////////////////////// if (!GeneralFunctions.handleAjaxExceptions(response)) return; Backend.displayNotification(EALang['provider_saved']); BackendUsers.helper.resetForm(); @@ -262,9 +255,6 @@ ProvidersHelper.prototype.delete = function(id) { }; $.post(postUrl, postData, function(response) { - ///////////////////////////////////////////////////// - //console.log('Delete provider response:', response); - ///////////////////////////////////////////////////// if (!GeneralFunctions.handleAjaxExceptions(response)) return; Backend.displayNotification(EALang['provider_deleted']); BackendUsers.helper.resetForm(); @@ -418,10 +408,6 @@ ProvidersHelper.prototype.filter = function(key, selectId, display) { }; $.post(postUrl, postData, function(response) { - ////////////////////////////////////////////////////// - //console.log('Filter providers response:', response); - ////////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; BackendUsers.helper.filterResults = response; diff --git a/src/assets/js/backend_users_secretaries.js b/src/assets/js/backend_users_secretaries.js index 6fab2966..076af921 100644 --- a/src/assets/js/backend_users_secretaries.js +++ b/src/assets/js/backend_users_secretaries.js @@ -187,20 +187,13 @@ SecretariesHelper.prototype.bindEventHandlers = function() { * then the update operation is going to be executed. */ SecretariesHelper.prototype.save = function(secretary) { - //////////////////////////////////////////////////// - //console.log('Secretary data to save:', secretary); - //////////////////////////////////////////////////// - - var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_secretary'; - var postData = { - 'csrfToken': GlobalVariables.csrfToken, - 'secretary': JSON.stringify(secretary) - }; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_secretary', + postData = { + 'csrfToken': GlobalVariables.csrfToken, + 'secretary': JSON.stringify(secretary) + }; $.post(postUrl, postData, function(response) { - //////////////////////////////////////////////////// - //console.log('Save Secretary Response:', response); - //////////////////////////////////////////////////// if (!GeneralFunctions.handleAjaxExceptions(response)) return; Backend.displayNotification(EALang['secretary_saved']); BackendUsers.helper.resetForm(); @@ -215,16 +208,13 @@ SecretariesHelper.prototype.save = function(secretary) { * @param {int} id Record id to be deleted. */ SecretariesHelper.prototype.delete = function(id) { - var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_secretary'; - var postData = { - 'csrfToken': GlobalVariables.csrfToken, - 'secretary_id': id - }; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_secretary', + postData = { + 'csrfToken': GlobalVariables.csrfToken, + 'secretary_id': id + }; $.post(postUrl, postData, function(response) { - ////////////////////////////////////////////////////// - //console.log('Delete secretary response:', response); - ////////////////////////////////////////////////////// if (!GeneralFunctions.handleAjaxExceptions(response)) return; Backend.displayNotification(EALang['secretary_deleted']); BackendUsers.helper.resetForm(); @@ -363,10 +353,6 @@ SecretariesHelper.prototype.filter = function(key, selectId, display) { }; $.post(postUrl, postData, function(response) { - //////////////////////////////////////////////////////// - //console.log('Filter secretaries response:', response); - //////////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; BackendUsers.helper.filterResults = response; diff --git a/src/assets/js/frontend_book.js b/src/assets/js/frontend_book.js index d442b72b..5d7be79b 100644 --- a/src/assets/js/frontend_book.js +++ b/src/assets/js/frontend_book.js @@ -327,10 +327,6 @@ var FrontendBook = { }; $.post(postUrl, postData, function(response) { - /////////////////////////////////////////////////////////////// - console.log('Get Available Hours JSON Response:', response); - /////////////////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; // The response contains the available hours for the selected provider and @@ -570,7 +566,6 @@ var FrontendBook = { return true; } catch(exc) { - console.log(exc); // log exception return false; } }, diff --git a/src/assets/js/frontend_book_success.js b/src/assets/js/frontend_book_success.js index c6570d94..1024a019 100644 --- a/src/assets/js/frontend_book_success.js +++ b/src/assets/js/frontend_book_success.js @@ -1,10 +1,10 @@ /* ---------------------------------------------------------------------------- * Easy!Appointments - Open Source Web Scheduler - * + * * @package EasyAppointments * @author A.Tselegidis * @copyright Copyright (c) 2013 - 2016, Alex Tselegidis - * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 + * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 * @link http://easyappointments.org * @since v1.0.0 * ---------------------------------------------------------------------------- */ @@ -12,10 +12,10 @@ $(document).ready(function() { /** * Event: Add Appointment to Google Calendar "Click" - * + * * This event handler adds the appointment to the users Google * Calendar Account. The event is going to be added to the "primary" - * calendar. In order to use the API the javascript client library + * calendar. In order to use the API the javascript client library * provided by Google is necessary. */ $('#add-to-google-calendar').click(function() { @@ -26,33 +26,29 @@ $(document).ready(function() { 'immediate' : false }, handleAuthResult); }); - + /** * This method handles the authorization result. If the user granted access * to his data, then the appointment is going to be added to his calendar. - * + * * @param {bool} authResult The user's auth result. */ function handleAuthResult(authResult) { try { - /////////////////////////////////////////////////////////// - console.log('Google Authorization Result: ', authResult); - /////////////////////////////////////////////////////////// - if (authResult.error) { throw 'Could not authorize user.'; } - + // The user has granted access, add the appointment to his calendar. // Before making the event.insert request the the event resource data // must be prepared. var appointmentData = GlobalVariables.appointmentData; - + appointmentData['start_datetime'] = GeneralFunctions.ISODateString( - Date.parseExact(appointmentData['start_datetime'], + Date.parseExact(appointmentData['start_datetime'], 'yyyy-MM-dd HH:mm:ss')); appointmentData['end_datetime'] = GeneralFunctions.ISODateString( - Date.parseExact(appointmentData['end_datetime'], + Date.parseExact(appointmentData['end_datetime'], 'yyyy-MM-dd HH:mm:ss')); // Create a valid Google Calendar API resource for the new event. @@ -81,21 +77,17 @@ $(document).ready(function() { }); request.execute(function(response) { - ///////////////////////////////////////////////// - console.log('Google API Response:', response); - ///////////////////////////////////////////////// - if (!response.error) { $('#success-frame').append( '

' + '
' + '

' + EALang['success'] + '

' + '

' + - EALang['appointment_added_to_google_calendar'] + - '
' + - '' + + EALang['appointment_added_to_google_calendar'] + + '
' + + '
' + EALang['view_appointment_in_google_calendar'] + - '' + + '' + '

' + '
' ); @@ -106,17 +98,16 @@ $(document).ready(function() { }); }); } catch(exc) { - // The user denied access or something else happened, display + // The user denied access or something else happened, display // corresponding message on the screen. $('#success-frame').append( - '
' + - '

' + EALang['oops_something_went_wrong'] + '

' + - '

' + + '

' + + '

' + EALang['oops_something_went_wrong'] + '

' + + '

' + EALang['could_not_add_to_google_calendar'] + '

' + exc + '
' + '

' + '
'); - console.log('Add To Google Calendar Exception', exc); } - } -}); \ No newline at end of file + } +}); diff --git a/src/assets/js/general_functions.js b/src/assets/js/general_functions.js index 9fa6de48..ccaad1c7 100644 --- a/src/assets/js/general_functions.js +++ b/src/assets/js/general_functions.js @@ -325,10 +325,6 @@ var GeneralFunctions = { 'language': $(this).attr('data-language'), }; $.post(postUrl, postData, function(response) { - //////////////////////////////////////////////////// - console.log('Change Language Response', response); - //////////////////////////////////////////////////// - if (!GeneralFunctions.handleAjaxExceptions(response)) return; document.location.reload(true); @@ -349,8 +345,6 @@ var GeneralFunctions = { message: 'AJAX Error: ' + errorThrown } ]; - - console.log('AJAX Failure Handler:', jqxhr, textStatus, errorThrown); GeneralFunctions.displayMessageBox(GeneralFunctions.EXCEPTIONS_TITLE, GeneralFunctions.EXCEPTIONS_MESSAGE); $('#message_box').append(GeneralFunctions.exceptionsToHtml(exceptions));