From fd0a9177cdd28d964332527b844f53fd92186863 Mon Sep 17 00:00:00 2001 From: alextselegidis Date: Wed, 20 May 2015 22:26:11 +0200 Subject: [PATCH] Added index.php in js ajax urls (without mod rewrite) --- src/assets/js/backend_calendar.js | 30 +++++++++++----------- src/assets/js/backend_customers.js | 6 ++--- src/assets/js/backend_services.js | 14 +++++----- src/assets/js/backend_settings.js | 6 ++--- src/assets/js/backend_users.js | 4 +-- src/assets/js/backend_users_admins.js | 6 ++--- src/assets/js/backend_users_providers.js | 6 ++--- src/assets/js/backend_users_secretaries.js | 6 ++--- src/assets/js/frontend_book.js | 4 +-- src/assets/js/general_functions.js | 2 +- 10 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/assets/js/backend_calendar.js b/src/assets/js/backend_calendar.js index 8ca95e7a..1b6a6c67 100644 --- a/src/assets/js/backend_calendar.js +++ b/src/assets/js/backend_calendar.js @@ -275,7 +275,7 @@ var BackendCalendar = { * Trigger the synchronization algorithm. */ $('#google-sync').click(function() { - var getUrl = GlobalVariables.baseUrl + '/google/sync/' + $('#select-filter-item').val(); + var getUrl = GlobalVariables.baseUrl + '/index.php/google/sync/' + $('#select-filter-item').val(); $.ajax({ 'type': 'GET', 'url': getUrl, @@ -405,7 +405,7 @@ var BackendCalendar = { if (BackendCalendar.lastFocusedEventData.data.is_unavailable == false) { var messageButtons = {}; messageButtons['OK'] = function() { - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_delete_appointment'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_appointment'; var postData = { 'appointment_id' : BackendCalendar.lastFocusedEventData.data['id'], @@ -447,7 +447,7 @@ var BackendCalendar = { $('#delete-reason').css('width', '353px'); } else { // Do not display confirmation promt. - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_delete_unavailable'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_unavailable'; var postData = { 'unavailable_id' : BackendCalendar.lastFocusedEventData.data.id @@ -683,10 +683,10 @@ var BackendCalendar = { $('#enable-sync').click(function() { if ($('#enable-sync').hasClass('enabled') === false) { // :: ENABLE SYNCHRONIZATION FOR SELECTED PROVIDER - var authUrl = GlobalVariables.baseUrl + '/google/oauth/' + var authUrl = GlobalVariables.baseUrl + '/index.php/google/oauth/' + $('#select-filter-item').val(); - var redirectUrl = GlobalVariables.baseUrl + '/google/oauth_callback'; + var redirectUrl = GlobalVariables.baseUrl + '/index.php/google/oauth_callback'; var windowHandle = window.open(authUrl, 'Authorize Easy!Appointments', 'width=800, height=600'); @@ -710,7 +710,7 @@ var BackendCalendar = { // Display the calendar selection dialog. First we will get a list // of the available user's calendars and then we will display a selection // modal so the user can select the sync calendar. - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_get_google_calendars'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_get_google_calendars'; var postData = { 'provider_id': $('#select-filter-item').val() }; @@ -947,7 +947,7 @@ var BackendCalendar = { * Event: Select Google Calendar "Click" */ $('#select-calendar').click(function() { - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_select_google_calendar'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_select_google_calendar'; var postData = { 'provider_id': $('#select-filter-item').val(), 'calendar_id': $('#google-calendar').val() @@ -994,7 +994,7 @@ var BackendCalendar = { * @param {type} endDate Visible end date of the calendar. */ refreshCalendarAppointments: function($calendar, recordId, filterType, startDate, endDate) { - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_get_calendar_appointments'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_get_calendar_appointments'; var postData = { 'record_id': recordId, 'start_date': startDate.toString('yyyy-MM-dd'), @@ -1261,7 +1261,7 @@ var BackendCalendar = { * going to be executed on post failure. */ saveAppointment: function(appointment, customer, successCallback, errorCallback) { - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_save_appointment'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_appointment'; var postData = {}; @@ -1306,7 +1306,7 @@ var BackendCalendar = { * @param {function} errorCallback The ajax failure callback function. */ saveUnavailable: function(unavailable, successCallback, errorCallback) { - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_save_unavailable'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_unavailable'; var postData = { 'unavailable': JSON.stringify(unavailable) @@ -1380,7 +1380,7 @@ var BackendCalendar = { .add({ minutes: -minuteDelta }) .toString('yyyy-MM-dd HH:mm:ss'); - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_save_appointment'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_appointment'; var postData = { 'appointment_data': JSON.stringify(appointment) }; $.post(postUrl, postData, function(response) { @@ -1433,7 +1433,7 @@ var BackendCalendar = { .add({ minutes: -minuteDelta }) .toString('yyyy-MM-dd HH:mm:ss'); - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_save_unavailable'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_unavailable'; var postData = { 'unavailable': JSON.stringify(unavailable) }; $.post(postUrl, postData, function(response) { @@ -1656,7 +1656,7 @@ var BackendCalendar = { event.data['start_datetime'] = appointment['start_datetime']; event.data['end_datetime'] = appointment['end_datetime']; - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_save_appointment'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_appointment'; var postData = { 'appointment_data': JSON.stringify(appointment) }; @@ -1718,7 +1718,7 @@ var BackendCalendar = { event.data['start_datetime'] = unavailable['start_datetime']; event.data['end_datetime'] = unavailable['end_datetime']; - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_save_unavailable'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_unavailable'; var postData = { 'unavailable': JSON.stringify(unavailable) }; @@ -1780,7 +1780,7 @@ var BackendCalendar = { disableProviderSync: function(providerId) { // Make an ajax call to the server in order to disable the setting // from the database. - var postUrl = GlobalVariables.baseUrl + 'backend_api/ajax_disable_provider_sync'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_disable_provider_sync'; var postData = { 'provider_id': providerId }; $.post(postUrl, postData, function(response) { diff --git a/src/assets/js/backend_customers.js b/src/assets/js/backend_customers.js index c077cf58..e3ce83f2 100644 --- a/src/assets/js/backend_customers.js +++ b/src/assets/js/backend_customers.js @@ -215,7 +215,7 @@ CustomersHelper.prototype.bindEventHandlers = function() { * @param {object} customer Contains the customer data. */ CustomersHelper.prototype.save = function(customer) { - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_save_customer'; + var postUrl = GlobalVariables.baseUrl + '/index.php/index.php/backend_api/ajax_save_customer'; var postData = { 'customer': JSON.stringify(customer) }; $.post(postUrl, postData, function(response) { @@ -238,7 +238,7 @@ CustomersHelper.prototype.save = function(customer) { * @param {numeric} id Record id to be deleted. */ CustomersHelper.prototype.delete = function(id) { - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_delete_customer'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_customer'; var postData = { 'customer_id': id }; $.post(postUrl, postData, function(response) { @@ -357,7 +357,7 @@ CustomersHelper.prototype.display = function(customer) { CustomersHelper.prototype.filter = function(key, selectId, display) { if (display == undefined) display = false; - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_filter_customers'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_customers'; var postData = { 'key': key }; $.post(postUrl, postData, function(response) { diff --git a/src/assets/js/backend_services.js b/src/assets/js/backend_services.js index 609f0903..67cbcd8c 100644 --- a/src/assets/js/backend_services.js +++ b/src/assets/js/backend_services.js @@ -82,7 +82,7 @@ var BackendServices = { * to the service categories db table. */ updateAvailableCategories: function() { - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_filter_service_categories'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_service_categories'; var postData = { 'key': '' }; $.post(postUrl, postData, function(response) { @@ -259,7 +259,7 @@ ServicesHelper.prototype.save = function(service) { //console.log('Service data to save:', service); //////////////////////////////////////////////// - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_save_service'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_service'; var postData = { 'service': JSON.stringify(service) }; $.post(postUrl, postData, function(response) { @@ -281,7 +281,7 @@ ServicesHelper.prototype.save = function(service) { * @param {numeric} id Record id to be deleted. */ ServicesHelper.prototype.delete = function(id) { - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_delete_service'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_service'; var postData = { 'service_id': id }; $.post(postUrl, postData, function(response) { @@ -374,7 +374,7 @@ ServicesHelper.prototype.display = function(service) { ServicesHelper.prototype.filter = function(key, selectId, display) { if (display == undefined) display = false; - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_filter_services'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_services'; var postData = { 'key': key }; $.post(postUrl, postData, function(response) { @@ -594,7 +594,7 @@ CategoriesHelper.prototype.bindEventHandlers = function() { * be displayed on the form. */ CategoriesHelper.prototype.filter = function(key, selectId, display) { - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_filter_service_categories'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_service_categories'; var postData = { 'key': key }; $.post(postUrl, postData, function(response) { @@ -631,7 +631,7 @@ CategoriesHelper.prototype.filter = function(key, selectId, display) { * @param {object} category Contains the category data. */ CategoriesHelper.prototype.save = function(category) { - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_save_service_category'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_service_category'; var postData = { 'category': JSON.stringify(category) }; $.post(postUrl, postData, function(response) { @@ -655,7 +655,7 @@ CategoriesHelper.prototype.save = function(category) { * @param {int} id Record id to be deleted. */ CategoriesHelper.prototype.delete = function(id) { - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_delete_service_category'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_service_category'; var postData = { 'category_id': id }; $.post(postUrl, postData, function(response) { diff --git a/src/assets/js/backend_settings.js b/src/assets/js/backend_settings.js index e4a3ba4a..5f5c9c20 100644 --- a/src/assets/js/backend_settings.js +++ b/src/assets/js/backend_settings.js @@ -168,7 +168,7 @@ var BackendSettings = { if ($input.prop('readonly') == true || $input.val() == '') return; - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_validate_username'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_validate_username'; var postData = { 'username': $input.val(), 'user_id': $input.parents().eq(2).find('#user-id').val() @@ -205,7 +205,7 @@ var SystemSettings = function() {}; * @param {array} settings Contains the system settings data. */ SystemSettings.prototype.save = function(settings) { - var postUrl = GlobalVariables.baseUrl + 'backend_api/ajax_save_settings'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_settings'; var postData = { 'settings': JSON.stringify(settings), 'type': BackendSettings.SETTINGS_SYSTEM @@ -346,7 +346,7 @@ UserSettings.prototype.save = function(settings) { return; // Validation failed, do not procceed. } - var postUrl = GlobalVariables.baseUrl + 'backend_api/ajax_save_settings'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_settings'; var postData = { 'type': BackendSettings.SETTINGS_USER, 'settings': JSON.stringify(settings) diff --git a/src/assets/js/backend_users.js b/src/assets/js/backend_users.js index 9ad60f25..21bc494d 100644 --- a/src/assets/js/backend_users.js +++ b/src/assets/js/backend_users.js @@ -100,7 +100,7 @@ var BackendUsers = { BackendUsers.helper = new SecretariesHelper(); // Update the list with the all the available providers. - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_filter_providers'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_providers'; var postData = { 'key': '' }; $.post(postUrl, postData, function(response) { ////////////////////////////////////////////////////////// @@ -141,7 +141,7 @@ var BackendUsers = { return; } - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_validate_username'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_validate_username'; var postData = { 'username': $input.val(), 'user_id': $input.parents().eq(2).find('.record-id').val() diff --git a/src/assets/js/backend_users_admins.js b/src/assets/js/backend_users_admins.js index 79249a98..2e777564 100644 --- a/src/assets/js/backend_users_admins.js +++ b/src/assets/js/backend_users_admins.js @@ -168,7 +168,7 @@ AdminsHelper.prototype.save = function(admin) { //console.log('Admin data to save:', admin); //////////////////////////////////////////// - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_save_admin'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_admin'; var postData = { 'admin': JSON.stringify(admin) }; $.post(postUrl, postData, function(response) { @@ -189,7 +189,7 @@ AdminsHelper.prototype.save = function(admin) { * @param {int} id Record id to be deleted. */ AdminsHelper.prototype.delete = function(id) { - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_delete_admin'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_admin'; var postData = { 'admin_id': id }; $.post(postUrl, postData, function(response) { @@ -317,7 +317,7 @@ AdminsHelper.prototype.display = function(admin) { AdminsHelper.prototype.filter = function(key, selectId, display) { if (display == undefined) display = false; - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_filter_admins'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_admins'; var postData = { 'key': key }; $.post(postUrl, postData, function(response) { diff --git a/src/assets/js/backend_users_providers.js b/src/assets/js/backend_users_providers.js index ac3dde1a..5739ba16 100644 --- a/src/assets/js/backend_users_providers.js +++ b/src/assets/js/backend_users_providers.js @@ -219,7 +219,7 @@ ProvidersHelper.prototype.save = function(provider) { //console.log('Provider data to save:', provider); ////////////////////////////////////////////////// - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_save_provider'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_provider'; var postData = { 'provider': JSON.stringify(provider) }; $.post(postUrl, postData, function(response) { @@ -240,7 +240,7 @@ ProvidersHelper.prototype.save = function(provider) { * @param {numeric} id Record id to be deleted. */ ProvidersHelper.prototype.delete = function(id) { - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_delete_provider'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_provider'; var postData = { 'provider_id': id }; $.post(postUrl, postData, function(response) { @@ -393,7 +393,7 @@ ProvidersHelper.prototype.display = function(provider) { ProvidersHelper.prototype.filter = function(key, selectId, display) { if (display == undefined) display = false; - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_filter_providers'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_providers'; var postData = { 'key': key }; $.post(postUrl, postData, function(response) { diff --git a/src/assets/js/backend_users_secretaries.js b/src/assets/js/backend_users_secretaries.js index 31fd552e..5e12f26f 100644 --- a/src/assets/js/backend_users_secretaries.js +++ b/src/assets/js/backend_users_secretaries.js @@ -179,7 +179,7 @@ SecretariesHelper.prototype.save = function(secretary) { //console.log('Secretary data to save:', secretary); //////////////////////////////////////////////////// - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_save_secretary'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_secretary'; var postData = { 'secretary': JSON.stringify(secretary) }; $.post(postUrl, postData, function(response) { @@ -200,7 +200,7 @@ SecretariesHelper.prototype.save = function(secretary) { * @param {int} id Record id to be deleted. */ SecretariesHelper.prototype.delete = function(id) { - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_delete_secretary'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_secretary'; var postData = { 'secretary_id': id }; $.post(postUrl, postData, function(response) { @@ -338,7 +338,7 @@ SecretariesHelper.prototype.display = function(secretary) { SecretariesHelper.prototype.filter = function(key, selectId, display) { if (display == undefined) display = false; - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_filter_secretaries'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_secretaries'; var postData = { 'key': key }; $.post(postUrl, postData, function(response) { diff --git a/src/assets/js/frontend_book.js b/src/assets/js/frontend_book.js index 67083851..edd17d63 100644 --- a/src/assets/js/frontend_book.js +++ b/src/assets/js/frontend_book.js @@ -256,7 +256,7 @@ var FrontendBook = { postData.exclude_appointment_id = GlobalVariables.appointmentData.id; } - var postUrl = GlobalVariables.baseUrl + '/appointments/ajax_check_datetime_availability'; + var postUrl = GlobalVariables.baseUrl + '/index.php/appointments/ajax_check_datetime_availability'; $.post(postUrl, postData, function(response) { //////////////////////////////////////////////////////////////////////// @@ -318,7 +318,7 @@ var FrontendBook = { }; // Make ajax post request and get the available hours. - var ajaxurl = GlobalVariables.baseUrl + '/appointments/ajax_get_available_hours'; + var ajaxurl = GlobalVariables.baseUrl + '/index.php/appointments/ajax_get_available_hours'; jQuery.post(ajaxurl, postData, function(response) { /////////////////////////////////////////////////////////////// console.log('Get Available Hours JSON Response:', response); diff --git a/src/assets/js/general_functions.js b/src/assets/js/general_functions.js index 646cb06c..6a3b41c3 100644 --- a/src/assets/js/general_functions.js +++ b/src/assets/js/general_functions.js @@ -305,7 +305,7 @@ var GeneralFunctions = { $(document).on('click', 'li.language', function() { // Change language with ajax call and refresh page. - var postUrl = GlobalVariables.baseUrl + '/backend_api/ajax_change_language'; + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_change_language'; var postData = { 'language': $(this).attr('data-language') }; $.post(postUrl, postData, function(response) { ////////////////////////////////////////////////////