mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-22 22:52:35 +03:00
Refactored js code.
This commit is contained in:
parent
ad4e23302e
commit
279b931d80
15 changed files with 311 additions and 309 deletions
|
@ -23,8 +23,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
'use strict';
|
||||
|
||||
// Constants
|
||||
var FILTER_TYPE_PROVIDER = 'provider',
|
||||
FILTER_TYPE_SERVICE = 'service';
|
||||
var FILTER_TYPE_PROVIDER = 'provider';
|
||||
var FILTER_TYPE_SERVICE = 'service';
|
||||
|
||||
// Variables
|
||||
var lastFocusedEventData; // Contains event data for later use.
|
||||
|
@ -241,8 +241,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
$('#delete-reason').css('width', '100%');
|
||||
} else {
|
||||
// Do not display confirmation promt.
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_unavailable',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_unavailable';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
unavailable_id : lastFocusedEventData.data.id
|
||||
};
|
||||
|
@ -296,8 +296,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
// an insert operation.
|
||||
|
||||
var startDatetime = $dialog.find('#start-datetime')
|
||||
.datepicker('getDate').toString('yyyy-MM-dd HH:mm:ss'),
|
||||
endDatetime = $dialog.find('#end-datetime')
|
||||
.datepicker('getDate').toString('yyyy-MM-dd HH:mm:ss');
|
||||
var endDatetime = $dialog.find('#end-datetime')
|
||||
.datepicker('getDate').toString('yyyy-MM-dd HH:mm:ss');
|
||||
|
||||
var appointment = {
|
||||
|
@ -369,9 +369,9 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
* Stores the unavailable period changes or inserts a new record.
|
||||
*/
|
||||
$('#manage-unavailable #save-unavailable').click(function() {
|
||||
var $dialog = $('#manage-unavailable'),
|
||||
start = $dialog.find('#unavailable-start').datetimepicker('getDate'),
|
||||
end = $dialog.find('#unavailable-end').datetimepicker('getDate');
|
||||
var $dialog = $('#manage-unavailable');
|
||||
var start = $dialog.find('#unavailable-start').datetimepicker('getDate');
|
||||
var end = $dialog.find('#unavailable-end').datetimepicker('getDate');
|
||||
|
||||
if (start > end) {
|
||||
// Start time is after end time - display message to user.
|
||||
|
@ -485,8 +485,8 @@ window.BackendCalendar = window.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 + '/index.php/backend_api/ajax_get_google_calendars',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_get_google_calendars';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
provider_id: $('#select-filter-item').val()
|
||||
};
|
||||
|
@ -565,8 +565,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
}
|
||||
});
|
||||
|
||||
var start = new Date(),
|
||||
currentMin = parseInt(start.toString('mm'));
|
||||
var start = new Date();
|
||||
var currentMin = parseInt(start.toString('mm'));
|
||||
|
||||
if (currentMin > 0 && currentMin < 15) {
|
||||
start.set({ 'minute': 15 });
|
||||
|
@ -598,8 +598,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
var $dialog = $('#manage-unavailable');
|
||||
|
||||
// Set the default datetime values.
|
||||
var start = new Date(),
|
||||
currentMin = parseInt(start.toString('mm'));
|
||||
var start = new Date();
|
||||
var currentMin = parseInt(start.toString('mm'));
|
||||
|
||||
if (currentMin > 0 && currentMin < 15) {
|
||||
start.set({ 'minute': 15 });
|
||||
|
@ -668,12 +668,12 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
* Event: Filter Existing Customers "Change"
|
||||
*/
|
||||
$('#filter-existing-customers').keyup(function() {
|
||||
var key = $(this).val().toLowerCase(),
|
||||
$list = $('#existing-customers-list'),
|
||||
postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_customers',
|
||||
postData = {
|
||||
'csrfToken': GlobalVariables.csrfToken,
|
||||
'key': key
|
||||
var key = $(this).val().toLowerCase();
|
||||
var $list = $('#existing-customers-list');
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_customers';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
key: key
|
||||
};
|
||||
|
||||
// Try to get the updated customer list.
|
||||
|
@ -765,8 +765,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
* Event: Select Google Calendar "Click"
|
||||
*/
|
||||
$('#select-calendar').click(function() {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_select_google_calendar',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_select_google_calendar';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
provider_id: $('#select-filter-item').val(),
|
||||
calendar_id: $('#google-calendar').val()
|
||||
|
@ -814,8 +814,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
* @param {Date} endDate Visible end date of the calendar.
|
||||
*/
|
||||
function _refreshCalendarAppointments($calendar, recordId, filterType, startDate, endDate) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_get_calendar_appointments',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_get_calendar_appointments';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
record_id: recordId,
|
||||
start_date: startDate.toString('yyyy-MM-dd'),
|
||||
|
@ -829,8 +829,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
}
|
||||
|
||||
// Add appointments to calendar.
|
||||
var calendarEvents = [],
|
||||
$calendar = $('#calendar');
|
||||
var calendarEvents = [];
|
||||
var $calendar = $('#calendar');
|
||||
|
||||
$.each(response.appointments, function(index, appointment) {
|
||||
var event = {
|
||||
|
@ -917,8 +917,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
}
|
||||
|
||||
// Add unavailable period after work ends.
|
||||
var calendarDateEnd = $calendar.fullCalendar('getView').end,
|
||||
workDateEnd = Date.parseExact(
|
||||
var calendarDateEnd = $calendar.fullCalendar('getView').end;
|
||||
var workDateEnd = Date.parseExact(
|
||||
calendarDateStart.toString('dd/MM/yyyy') + ' '
|
||||
+ workingPlan[selDayName].end,
|
||||
'dd/MM/yyyy HH:mm'); // Use calendarDateStart ***
|
||||
|
@ -936,7 +936,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
}
|
||||
|
||||
// Add unavailable periods for breaks.
|
||||
var breakStart, breakEnd;
|
||||
var breakStart;
|
||||
var breakEnd;
|
||||
$.each(workingPlan[selDayName].breaks, function(index, currBreak) {
|
||||
breakStart = Date.parseExact(calendarDateStart.toString('dd/MM/yyyy')
|
||||
+ ' ' + currBreak.start, 'dd/MM/yyyy HH:mm');
|
||||
|
@ -957,8 +958,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
break;
|
||||
|
||||
case 'agendaWeek':
|
||||
var currDateStart = GeneralFunctions.clone($calendar.fullCalendar('getView').start),
|
||||
currDateEnd = GeneralFunctions.clone(currDateStart).addDays(1);
|
||||
var currDateStart = GeneralFunctions.clone($calendar.fullCalendar('getView').start);
|
||||
var currDateEnd = GeneralFunctions.clone(currDateStart).addDays(1);
|
||||
|
||||
// Add custom unavailable periods (they are always displayed on the calendar, even if
|
||||
// the provider won't work on that day).
|
||||
|
@ -997,8 +998,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
return; // Go to the next loop.
|
||||
}
|
||||
|
||||
var start,
|
||||
end;
|
||||
var start;
|
||||
var end;
|
||||
|
||||
// Add unavailable period before work starts.
|
||||
start = Date.parseExact(currDateStart.toString('dd/MM/yyyy')
|
||||
|
@ -1033,7 +1034,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
}
|
||||
|
||||
// Add unavailable periods during day breaks.
|
||||
var breakStart, breakEnd;
|
||||
var breakStart;
|
||||
var breakEnd;
|
||||
$.each(workingDay.breaks, function(index, currBreak) {
|
||||
breakStart = Date.parseExact(currDateStart.toString('dd/MM/yyyy')
|
||||
+ ' ' + currBreak.start, 'dd/MM/yyyy HH:mm');
|
||||
|
@ -1074,8 +1076,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
* @param {Function} errorCallback Optional, if defined, this function is going to be executed on post failure.
|
||||
*/
|
||||
function _saveAppointment(appointment, customer, successCallback, errorCallback) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_appointment',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_appointment';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
appointment_data: JSON.stringify(appointment)
|
||||
};
|
||||
|
@ -1110,8 +1112,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
* @param {Function} errorCallback The ajax failure callback function.
|
||||
*/
|
||||
function _saveUnavailable(unavailable, successCallback, errorCallback) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_unavailable',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_unavailable';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
unavailable: JSON.stringify(unavailable)
|
||||
};
|
||||
|
@ -1183,8 +1185,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_appointment';
|
||||
var postData = {
|
||||
'csrfToken': GlobalVariables.csrfToken,
|
||||
'appointment_data': JSON.stringify(appointment)
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
appointment_data: JSON.stringify(appointment)
|
||||
};
|
||||
|
||||
$.post(postUrl, postData, function(response) {
|
||||
|
@ -1238,8 +1240,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_unavailable';
|
||||
var postData = {
|
||||
'csrfToken': GlobalVariables.csrfToken,
|
||||
'unavailable': JSON.stringify(unavailable)
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
unavailable: JSON.stringify(unavailable)
|
||||
};
|
||||
|
||||
$.post(postUrl, postData, function(response) {
|
||||
|
@ -1295,9 +1297,9 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
function _calendarEventClick(event, jsEvent, view) {
|
||||
$('.popover').remove(); // Close all open popovers.
|
||||
|
||||
var html,
|
||||
displayEdit,
|
||||
displayDelete;
|
||||
var html;
|
||||
var displayEdit;
|
||||
var displayDelete;
|
||||
|
||||
// Depending where the user clicked the event (title or empty space) we
|
||||
// need to use different selectors to reach the parent element.
|
||||
|
@ -1458,8 +1460,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
event.data['start_datetime'] = appointment['start_datetime'];
|
||||
event.data['end_datetime'] = appointment['end_datetime'];
|
||||
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_appointment',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_appointment';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
appointment_data: JSON.stringify(appointment)
|
||||
};
|
||||
|
@ -1489,7 +1491,7 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
start_datetime: event.start.toString('yyyy-MM-dd HH:mm:ss'),
|
||||
end_datetime: event.end.toString('yyyy-MM-dd HH:mm:ss'),
|
||||
id_users_provider: event.data.id_users_provider
|
||||
}
|
||||
};
|
||||
|
||||
var successCallback = function(response) {
|
||||
if (response.exceptions) {
|
||||
|
@ -1519,8 +1521,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
event.data['start_datetime'] = unavailable['start_datetime'];
|
||||
event.data['end_datetime'] = unavailable['end_datetime'];
|
||||
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_unavailable',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_unavailable';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
unavailable: JSON.stringify(unavailable)
|
||||
};
|
||||
|
@ -1586,8 +1588,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
function _disableProviderSync(providerId) {
|
||||
// Make an ajax call to the server in order to disable the setting
|
||||
// from the database.
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_disable_provider_sync',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_disable_provider_sync';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
provider_id: providerId
|
||||
};
|
||||
|
@ -1654,9 +1656,9 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
}
|
||||
});
|
||||
|
||||
var startDatetime = new Date().addMinutes(GlobalVariables.bookAdvanceTimeout),
|
||||
endDatetime = new Date().addMinutes(GlobalVariables.bookAdvanceTimeout).addMinutes(serviceDuration),
|
||||
dateFormat;
|
||||
var startDatetime = new Date().addMinutes(GlobalVariables.bookAdvanceTimeout);
|
||||
var endDatetime = new Date().addMinutes(GlobalVariables.bookAdvanceTimeout).addMinutes(serviceDuration);
|
||||
var dateFormat;
|
||||
|
||||
switch(GlobalVariables.dateFormat) {
|
||||
case 'DMY':
|
||||
|
@ -1766,8 +1768,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
}
|
||||
|
||||
// Check appointment start and end time.
|
||||
var start = $('#start-datetime').datepicker('getDate'),
|
||||
end = $('#end-datetime').datepicker('getDate');
|
||||
var start = $('#start-datetime').datepicker('getDate');
|
||||
var end = $('#end-datetime').datepicker('getDate');
|
||||
if (start > end) {
|
||||
$dialog.find('#start-datetime').parents('.form-group').addClass('has-error');
|
||||
$dialog.find('#end-datetime').parents('.form-group').addClass('has-error');
|
||||
|
@ -1793,9 +1795,9 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
$dialog.find('#unavailable-id').val('');
|
||||
|
||||
// Set default time values
|
||||
var start = GeneralFunctions.formatDate(new Date(), GlobalVariables.dateFormat, true),
|
||||
end = GeneralFunctions.formatDate(new Date().addHours(1), GlobalVariables.dateFormat, true),
|
||||
dateFormat;
|
||||
var start = GeneralFunctions.formatDate(new Date(), GlobalVariables.dateFormat, true);
|
||||
var end = GeneralFunctions.formatDate(new Date().addHours(1), GlobalVariables.dateFormat, true);
|
||||
var dateFormat;
|
||||
|
||||
switch(GlobalVariables.dateFormat) {
|
||||
case 'DMY':
|
||||
|
@ -1908,18 +1910,18 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
switch(GlobalVariables.dateFormat) {
|
||||
case 'DMY':
|
||||
columnFormat = {
|
||||
'month': 'ddd',
|
||||
'week': 'ddd dd/MM',
|
||||
'day': 'dddd dd/MM'
|
||||
month: 'ddd',
|
||||
week: 'ddd dd/MM',
|
||||
day: 'dddd dd/MM'
|
||||
};
|
||||
|
||||
break;
|
||||
case 'MDY':
|
||||
case 'YMD':
|
||||
columnFormat = {
|
||||
'month': 'ddd',
|
||||
'week': 'ddd MM/dd',
|
||||
'day': 'dddd MM/dd'
|
||||
month: 'ddd',
|
||||
week: 'ddd MM/dd',
|
||||
day: 'dddd MM/dd'
|
||||
};
|
||||
break;
|
||||
default:
|
||||
|
@ -2064,8 +2066,8 @@ window.BackendCalendar = window.BackendCalendar || {};
|
|||
|
||||
// Display the edit dialog if an appointment hash is provided.
|
||||
if (GlobalVariables.editAppointment != null) {
|
||||
var $dialog = $('#manage-appointment'),
|
||||
appointment = GlobalVariables.editAppointment;
|
||||
var $dialog = $('#manage-appointment');
|
||||
var appointment = GlobalVariables.editAppointment;
|
||||
_resetAppointmentDialog();
|
||||
|
||||
$dialog.find('.modal-header h3').text(EALang['edit_appointment_title']);
|
||||
|
|
|
@ -161,8 +161,8 @@
|
|||
* @param {Boolean} display Optional (false), if true then the selected record will be displayed on the form.
|
||||
*/
|
||||
CategoriesHelper.prototype.filter = function(key, selectId, display) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_service_categories',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_service_categories';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
key: key
|
||||
};
|
||||
|
@ -198,8 +198,8 @@
|
|||
* @param {Object} category Contains the category data.
|
||||
*/
|
||||
CategoriesHelper.prototype.save = function(category) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_service_category',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_service_category';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
category: JSON.stringify(category)
|
||||
};
|
||||
|
@ -223,10 +223,10 @@
|
|||
* @param Number} id Record ID to be deleted.
|
||||
*/
|
||||
CategoriesHelper.prototype.delete = function(id) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_service_category',
|
||||
postData = {
|
||||
'csrfToken': GlobalVariables.csrfToken,
|
||||
'category_id': id
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_service_category';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
category_id: id
|
||||
};
|
||||
|
||||
$.post(postUrl, postData, function(response) {
|
||||
|
|
|
@ -60,8 +60,8 @@
|
|||
return; // Do nothing when user edits a customer record.
|
||||
}
|
||||
|
||||
var customerId = $(this).attr('data-id'),
|
||||
customer = {};
|
||||
var customerId = $(this).attr('data-id');
|
||||
var customer = {};
|
||||
$.each(instance.filterResults, function(index, item) {
|
||||
if (item.id == customerId) {
|
||||
customer = item;
|
||||
|
@ -84,9 +84,9 @@
|
|||
$('#customer-appointments .selected').removeClass('selected');
|
||||
$(this).addClass('selected');
|
||||
|
||||
var customerId = $('#filter-customers .selected').attr('data-id'),
|
||||
appointmentId = $(this).attr('data-id'),
|
||||
appointment = {};
|
||||
var customerId = $('#filter-customers .selected').attr('data-id');
|
||||
var appointmentId = $(this).attr('data-id');
|
||||
var appointment = {};
|
||||
|
||||
$.each(instance.filterResults, function(index, c) {
|
||||
if (c.id === customerId) {
|
||||
|
@ -144,14 +144,14 @@
|
|||
*/
|
||||
$('#save-customer').click(function() {
|
||||
var customer = {
|
||||
'first_name': $('#first-name').val(),
|
||||
'last_name': $('#last-name').val(),
|
||||
'email': $('#email').val(),
|
||||
'phone_number': $('#phone-number').val(),
|
||||
'address': $('#address').val(),
|
||||
'city': $('#city').val(),
|
||||
'zip_code': $('#zip-code').val(),
|
||||
'notes': $('#notes').val()
|
||||
first_name: $('#first-name').val(),
|
||||
last_name: $('#last-name').val(),
|
||||
email: $('#email').val(),
|
||||
phone_number: $('#phone-number').val(),
|
||||
address: $('#address').val(),
|
||||
city: $('#city').val(),
|
||||
zip_code: $('#zip-code').val(),
|
||||
notes: $('#notes').val()
|
||||
};
|
||||
|
||||
if ($('#customer-id').val() != '') {
|
||||
|
@ -167,8 +167,8 @@
|
|||
* Event: Delete Customer Button "Click"
|
||||
*/
|
||||
$('#delete-customer').click(function() {
|
||||
var customerId = $('#customer-id').val(),
|
||||
messageBtns = {};
|
||||
var customerId = $('#customer-id').val();
|
||||
var messageBtns = {};
|
||||
|
||||
messageBtns[EALang['delete']] = function() {
|
||||
instance.delete(customerId);
|
||||
|
@ -190,10 +190,10 @@
|
|||
* @param {Object} customer Contains the customer data.
|
||||
*/
|
||||
CustomersHelper.prototype.save = function(customer) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_customer',
|
||||
postData = {
|
||||
'csrfToken': GlobalVariables.csrfToken,
|
||||
'customer': JSON.stringify(customer)
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_customer';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
customer: JSON.stringify(customer)
|
||||
};
|
||||
|
||||
$.post(postUrl, postData, function(response) {
|
||||
|
@ -214,10 +214,10 @@
|
|||
* @param {Number} id Record id to be deleted.
|
||||
*/
|
||||
CustomersHelper.prototype.delete = function(id) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_customer',
|
||||
postData = {
|
||||
'csrfToken': GlobalVariables.csrfToken,
|
||||
'customer_id': id
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_customer';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
customer_id: id
|
||||
};
|
||||
|
||||
$.post(postUrl, postData, function(response) {
|
||||
|
@ -309,9 +309,9 @@
|
|||
$('#customer-appointments').data('jsp').destroy();
|
||||
$('#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),
|
||||
html =
|
||||
var start = GeneralFunctions.formatDate(Date.parse(appointment.start_datetime), GlobalVariables.dateFormat, true);
|
||||
var end = GeneralFunctions.formatDate(Date.parse(appointment.end_datetime), GlobalVariables.dateFormat, true);
|
||||
var html =
|
||||
'<div class="appointment-row" data-id="' + appointment.id + '">' +
|
||||
start + ' - ' + end + '<br>' +
|
||||
appointment.service.name + ', ' +
|
||||
|
@ -335,8 +335,8 @@
|
|||
CustomersHelper.prototype.filter = function(key, selectId, display) {
|
||||
display = display || false;
|
||||
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_customers',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_customers';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
key: key
|
||||
};
|
||||
|
@ -429,8 +429,8 @@
|
|||
* @param {Object} appointment Appointment data
|
||||
*/
|
||||
CustomersHelper.prototype.displayAppointment = function(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 start = GeneralFunctions.formatDate(Date.parse(appointment.start_datetime), GlobalVariables.dateFormat, true);
|
||||
var end = GeneralFunctions.formatDate(Date.parse(appointment.end_datetime), GlobalVariables.dateFormat, true);
|
||||
|
||||
var html =
|
||||
'<div>' +
|
||||
|
|
|
@ -105,8 +105,8 @@ window.BackendServices = window.BackendServices || {};
|
|||
* Use this method every time a change is made to the service categories db table.
|
||||
*/
|
||||
exports.updateAvailableCategories = function() {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_service_categories',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_service_categories';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
key: ''
|
||||
};
|
||||
|
|
|
@ -60,8 +60,8 @@
|
|||
return; // exit because we are on edit mode
|
||||
}
|
||||
|
||||
var serviceId = $(this).attr('data-id'),
|
||||
service = {};
|
||||
var serviceId = $(this).attr('data-id');
|
||||
var service = {};
|
||||
$.each(instance.filterResults, function(index, item) {
|
||||
if (item.id === serviceId) {
|
||||
service = item;
|
||||
|
@ -150,8 +150,8 @@
|
|||
* Event: Delete Service Button "Click"
|
||||
*/
|
||||
$('#delete-service').click(function() {
|
||||
var serviceId = $('#service-id').val(),
|
||||
messageBtns = {};
|
||||
var serviceId = $('#service-id').val();
|
||||
var messageBtns = {};
|
||||
|
||||
messageBtns[EALang['delete']] = function() {
|
||||
instance.delete(serviceId);
|
||||
|
@ -174,10 +174,10 @@
|
|||
* then the update operation is going to be executed.
|
||||
*/
|
||||
ServicesHelper.prototype.save = function(service) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_service',
|
||||
postData = {
|
||||
'csrfToken': GlobalVariables.csrfToken,
|
||||
'service': JSON.stringify(service)
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_service';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
service: JSON.stringify(service)
|
||||
};
|
||||
|
||||
$.post(postUrl, postData, function(response) {
|
||||
|
@ -198,8 +198,8 @@
|
|||
* @param {Number} id Record ID to be deleted.
|
||||
*/
|
||||
ServicesHelper.prototype.delete = function(id) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_service',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_service';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
service_id: id
|
||||
};
|
||||
|
@ -293,10 +293,10 @@
|
|||
ServicesHelper.prototype.filter = function(key, selectId, display) {
|
||||
display = display || false;
|
||||
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_services',
|
||||
postData = {
|
||||
'csrfToken': GlobalVariables.csrfToken,
|
||||
'key': key
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_services';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
key: key
|
||||
};
|
||||
|
||||
$.post(postUrl, postData, function(response) {
|
||||
|
|
|
@ -194,8 +194,8 @@ window.BackendSettings = window.BackendSettings || {};
|
|||
return;
|
||||
}
|
||||
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_validate_username',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_validate_username';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
username: $input.val(),
|
||||
user_id: $input.parents().eq(2).find('#user-id').val()
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
* @param {Array} settings Contains the system settings data.
|
||||
*/
|
||||
SystemSettings.prototype.save = function(settings) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_settings',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_settings';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
settings: JSON.stringify(settings),
|
||||
type: BackendSettings.SETTINGS_SYSTEM
|
||||
|
|
|
@ -62,8 +62,8 @@
|
|||
return; // Validation failed, do not procceed.
|
||||
}
|
||||
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_settings',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_settings';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
type: BackendSettings.SETTINGS_USER,
|
||||
settings: JSON.stringify(settings)
|
||||
|
|
|
@ -142,8 +142,8 @@ window.BackendUsers = window.BackendUsers || {};
|
|||
helper = new SecretariesHelper();
|
||||
|
||||
// Update the list with the all the available providers.
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_providers',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_providers';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
key: ''
|
||||
};
|
||||
|
@ -200,8 +200,8 @@ window.BackendUsers = window.BackendUsers || {};
|
|||
return;
|
||||
}
|
||||
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_validate_username',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_validate_username';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
username: $input.val(),
|
||||
user_id: userId
|
||||
|
|
|
@ -61,8 +61,8 @@
|
|||
return; // exit because we are currently on edit mode
|
||||
}
|
||||
|
||||
var adminId = $(e.currentTarget).attr('data-id'),
|
||||
admin = {};
|
||||
var adminId = $(e.currentTarget).attr('data-id');
|
||||
var admin = {};
|
||||
|
||||
$.each(this.filterResults, function(index, item) {
|
||||
if (item.id === adminId) {
|
||||
|
@ -109,8 +109,8 @@
|
|||
* Event: Delete Admin Button "Click"
|
||||
*/
|
||||
$('#admins').on('click', '#delete-admin', function() {
|
||||
var adminId = $('#admin-id').val(),
|
||||
messageBtns = {};
|
||||
var adminId = $('#admin-id').val();
|
||||
var messageBtns = {};
|
||||
|
||||
messageBtns[EALang['delete']] = function() {
|
||||
this.delete(adminId);
|
||||
|
@ -184,8 +184,8 @@
|
|||
* then the update operation is going to be executed.
|
||||
*/
|
||||
AdminsHelper.prototype.save = function(admin) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_admin',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_admin';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
admin: JSON.stringify(admin)
|
||||
};
|
||||
|
@ -207,8 +207,8 @@
|
|||
* @param {Number} id Record id to be deleted.
|
||||
*/
|
||||
AdminsHelper.prototype.delete = function(id) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_admin',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_admin';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
admin_id: id
|
||||
};
|
||||
|
@ -339,8 +339,8 @@
|
|||
AdminsHelper.prototype.filter = function(key, selectId, display) {
|
||||
display = display || false;
|
||||
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_admins',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_admins';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
key: key
|
||||
};
|
||||
|
@ -378,8 +378,8 @@
|
|||
* @return {String} The html code that represents the record on the filter results list.
|
||||
*/
|
||||
AdminsHelper.prototype.getFilterHtml = function(admin) {
|
||||
var name = admin.first_name + ' ' + admin.last_name,
|
||||
info = admin.email;
|
||||
var name = admin.first_name + ' ' + admin.last_name;
|
||||
var info = admin.email;
|
||||
|
||||
info = (admin.mobile_number != '' && admin.mobile_number != null)
|
||||
? info + ', ' + admin.mobile_number : info;
|
||||
|
|
|
@ -63,8 +63,8 @@
|
|||
return; // Exit because we are currently on edit mode.
|
||||
}
|
||||
|
||||
var providerId = $(e.currentTarget).attr('data-id'),
|
||||
provider = {};
|
||||
var providerId = $(e.currentTarget).attr('data-id');
|
||||
var provider = {};
|
||||
|
||||
$.each(this.filterResults, function(index, item) {
|
||||
if (item.id === providerId) {
|
||||
|
@ -236,8 +236,8 @@
|
|||
* then the update operation is going to be executed.
|
||||
*/
|
||||
ProvidersHelper.prototype.save = function(provider) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_provider',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_provider';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
provider: JSON.stringify(provider)
|
||||
};
|
||||
|
@ -259,8 +259,8 @@
|
|||
* @param {Number} id Record id to be deleted.
|
||||
*/
|
||||
ProvidersHelper.prototype.delete = function(id) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_provider',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_provider';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
provider_id: id
|
||||
};
|
||||
|
@ -412,8 +412,8 @@
|
|||
ProvidersHelper.prototype.filter = function(key, selectId, display) {
|
||||
display = display || false;
|
||||
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_providers',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_providers';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
key: key
|
||||
};
|
||||
|
|
|
@ -63,8 +63,8 @@
|
|||
return; // exit because we are currently on edit mode
|
||||
}
|
||||
|
||||
var secretaryId = $(e.currentTarget).attr('data-id'),
|
||||
secretary = {};
|
||||
var secretaryId = $(e.currentTarget).attr('data-id');
|
||||
var secretary = {};
|
||||
|
||||
$.each(this.filterResults, function(index, item) {
|
||||
if (item.id === secretaryId) {
|
||||
|
@ -114,8 +114,8 @@
|
|||
* Event: Delete Secretary Button "Click"
|
||||
*/
|
||||
$('#secretaries').on('click', '#delete-secretary', function() {
|
||||
var secretaryId = $('#secretary-id').val(),
|
||||
messageBtns = {};
|
||||
var secretaryId = $('#secretary-id').val();
|
||||
var messageBtns = {};
|
||||
|
||||
messageBtns[EALang['delete']] = function() {
|
||||
this.delete(secretaryId);
|
||||
|
@ -197,8 +197,8 @@
|
|||
* then the update operation is going to be executed.
|
||||
*/
|
||||
SecretariesHelper.prototype.save = function(secretary) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_secretary',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_save_secretary';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
secretary: JSON.stringify(secretary)
|
||||
};
|
||||
|
@ -220,8 +220,8 @@
|
|||
* @param {Number} id Record id to be deleted.
|
||||
*/
|
||||
SecretariesHelper.prototype.delete = function(id) {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_secretary',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_delete_secretary';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
secretary_id: id
|
||||
};
|
||||
|
@ -361,8 +361,8 @@
|
|||
SecretariesHelper.prototype.filter = function(key, selectId, display) {
|
||||
display = display || false;
|
||||
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_secretaries',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_secretaries';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
key: key
|
||||
};
|
||||
|
@ -400,8 +400,8 @@
|
|||
* @return {String} The html code that represents the record on the filter results list.
|
||||
*/
|
||||
SecretariesHelper.prototype.getFilterHtml = function(secretary) {
|
||||
var name = secretary.first_name + ' ' + secretary.last_name,
|
||||
info = secretary.email;
|
||||
var name = secretary.first_name + ' ' + secretary.last_name;
|
||||
var info = secretary.email;
|
||||
|
||||
info = (secretary.mobile_number != '' && secretary.mobile_number != null)
|
||||
? info + ', ' + secretary.mobile_number : info;
|
||||
|
|
|
@ -344,9 +344,9 @@ window.FrontendBook = window.FrontendBook || {};
|
|||
selectedDate = GeneralFunctions.formatDate(selectedDate, GlobalVariables.dateFormat);
|
||||
}
|
||||
|
||||
var selServiceId = $('#select-service').val(),
|
||||
servicePrice,
|
||||
serviceCurrency;
|
||||
var selServiceId = $('#select-service').val();
|
||||
var servicePrice;
|
||||
var serviceCurrency;
|
||||
|
||||
$.each(GlobalVariables.availableServices, function(index, service) {
|
||||
if (service.id == selServiceId) {
|
||||
|
@ -369,13 +369,13 @@ window.FrontendBook = window.FrontendBook || {};
|
|||
$('#appointment-details').html(html);
|
||||
|
||||
// Customer Details
|
||||
var firstname = GeneralFunctions.escapeHtml($('#first-name').val()),
|
||||
lastname = GeneralFunctions.escapeHtml($('#last-name').val()),
|
||||
phoneNumber = GeneralFunctions.escapeHtml($('#phone-number').val()),
|
||||
email = GeneralFunctions.escapeHtml($('#email').val()),
|
||||
address = GeneralFunctions.escapeHtml($('#address').val()),
|
||||
city = GeneralFunctions.escapeHtml($('#city').val()),
|
||||
zipCode = GeneralFunctions.escapeHtml($('#zip-code').val()),
|
||||
var firstname = GeneralFunctions.escapeHtml($('#first-name').val());
|
||||
var lastname = GeneralFunctions.escapeHtml($('#last-name').val());
|
||||
var phoneNumber = GeneralFunctions.escapeHtml($('#phone-number').val());
|
||||
var email = GeneralFunctions.escapeHtml($('#email').val());
|
||||
var address = GeneralFunctions.escapeHtml($('#address').val());
|
||||
var city = GeneralFunctions.escapeHtml($('#city').val());
|
||||
var zipCode = GeneralFunctions.escapeHtml($('#zip-code').val());
|
||||
|
||||
html =
|
||||
'<h4>' + firstname + ' ' + lastname + '</h4>' +
|
||||
|
|
|
@ -45,8 +45,8 @@ window.FrontendBookApi = window.FrontendBookApi || {};
|
|||
var appointmentId = FrontendBook.manageMode ? GlobalVariables.appointmentData['id'] : undefined;
|
||||
|
||||
// Make ajax post request and get the available hours.
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/appointments/ajax_get_available_hours',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/appointments/ajax_get_available_hours';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
service_id: $('#select-service').val(),
|
||||
provider_id: $('#select-provider').val(),
|
||||
|
@ -115,8 +115,8 @@ window.FrontendBookApi = window.FrontendBookApi || {};
|
|||
}
|
||||
}
|
||||
|
||||
var formData = jQuery.parseJSON($('input[name="post_data"]').val()),
|
||||
postData = {
|
||||
var formData = jQuery.parseJSON($('input[name="post_data"]').val());
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
post_data: formData
|
||||
};
|
||||
|
@ -129,8 +129,8 @@ window.FrontendBookApi = window.FrontendBookApi || {};
|
|||
postData.exclude_appointment_id = GlobalVariables.appointmentData.id;
|
||||
}
|
||||
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/appointments/ajax_register_appointment',
|
||||
$layer = $('<div/>');
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/appointments/ajax_register_appointment';
|
||||
var $layer = $('<div/>');
|
||||
|
||||
$.ajax({
|
||||
url: postUrl,
|
||||
|
@ -197,8 +197,8 @@ window.FrontendBookApi = window.FrontendBookApi || {};
|
|||
* @param {String} selectedDateString Y-m-d value of the selected date.
|
||||
*/
|
||||
exports.getUnavailableDates = function(providerId, serviceId, selectedDateString) {
|
||||
var url = GlobalVariables.baseUrl + '/index.php/appointments/ajax_get_unavailable_dates',
|
||||
data = {
|
||||
var url = GlobalVariables.baseUrl + '/index.php/appointments/ajax_get_unavailable_dates';
|
||||
var data = {
|
||||
provider_id: providerId,
|
||||
service_id: serviceId,
|
||||
selected_date: encodeURIComponent(selectedDateString),
|
||||
|
@ -213,8 +213,8 @@ window.FrontendBookApi = window.FrontendBookApi || {};
|
|||
})
|
||||
.done(function(response) {
|
||||
// Select first enabled date.
|
||||
var selectedDate = Date.parse(selectedDateString),
|
||||
numberOfDays = new Date(selectedDate.getFullYear(), selectedDate.getMonth() + 1, 0).getDate();
|
||||
var selectedDate = Date.parse(selectedDateString);
|
||||
var numberOfDays = new Date(selectedDate.getFullYear(), selectedDate.getMonth() + 1, 0).getDate();
|
||||
|
||||
for (var i=1; i<=numberOfDays; i++) {
|
||||
var currentDate = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), i);
|
||||
|
|
|
@ -115,9 +115,9 @@ window.GeneralFunctions = window.GeneralFunctions || {};
|
|||
*/
|
||||
exports.getUrlParameter = function(url, parameterName) {
|
||||
parameterName = parameterName.replace(/[\[]/,'\\\[').replace(/[\]]/,'\\\]');
|
||||
var regexS = '[\\#&]' + parameterName + '=([^&#]*)',
|
||||
regex = new RegExp(regexS),
|
||||
results = regex.exec(url);
|
||||
var regexS = '[\\#&]' + parameterName + '=([^&#]*)';
|
||||
var regex = new RegExp(regexS);
|
||||
var results = regex.exec(url);
|
||||
return (results == null) ? '' : results[1];
|
||||
};
|
||||
|
||||
|
@ -340,8 +340,8 @@ window.GeneralFunctions = window.GeneralFunctions || {};
|
|||
|
||||
$(document).on('click', 'li.language', function() {
|
||||
// Change language with ajax call and refresh page.
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_change_language',
|
||||
postData = {
|
||||
var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_change_language';
|
||||
var postData = {
|
||||
csrfToken: GlobalVariables.csrfToken,
|
||||
language: $(this).attr('data-language'),
|
||||
};
|
||||
|
@ -394,8 +394,8 @@ window.GeneralFunctions = window.GeneralFunctions || {};
|
|||
* @return {String} Returns the formatted date string.
|
||||
*/
|
||||
exports.formatDate = function(date, dateFormatSetting, addHours) {
|
||||
var format, result,
|
||||
hours = addHours ? ' HH:mm' : '';
|
||||
var format, result;
|
||||
var hours = addHours ? ' HH:mm' : '';
|
||||
|
||||
switch(dateFormatSetting) {
|
||||
case 'DMY':
|
||||
|
|
Loading…
Reference in a new issue