mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-10 01:52:22 +03:00
Refactored use of global EALang object.
This commit is contained in:
parent
c56650d1b8
commit
980ab7786a
21 changed files with 355 additions and 369 deletions
|
@ -86,13 +86,13 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
|
|||
// Define success callback.
|
||||
var successCallback = function(response) {
|
||||
if (!GeneralFunctions.handleAjaxExceptions(response)) {
|
||||
$dialog.find('.modal-message').text(EALang['unexpected_issues_occurred']);
|
||||
$dialog.find('.modal-message').text(EALang.unexpected_issues_occurred);
|
||||
$dialog.find('.modal-message').addClass('alert-danger').removeClass('hidden');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Display success message to the user.
|
||||
$dialog.find('.modal-message').text(EALang['appointment_saved']);
|
||||
$dialog.find('.modal-message').text(EALang.appointment_saved);
|
||||
$dialog.find('.modal-message').addClass('alert-success').removeClass('alert-danger hidden');
|
||||
$dialog.find('.modal-body').scrollTop(0);
|
||||
|
||||
|
@ -106,7 +106,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
|
|||
|
||||
// Define error callback.
|
||||
var errorCallback = function() {
|
||||
$dialog.find('.modal-message').text(EALang['server_communication_error']);
|
||||
$dialog.find('.modal-message').text(EALang.server_communication_error);
|
||||
$dialog.find('.modal-message').addClass('alert-danger').removeClass('hidden');
|
||||
$dialog.find('.modal-body').scrollTop(0);
|
||||
};
|
||||
|
@ -168,7 +168,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
|
|||
GlobalVariables.dateFormat, true));
|
||||
|
||||
// Display modal form.
|
||||
$dialog.find('.modal-header h3').text(EALang['new_appointment_title']);
|
||||
$dialog.find('.modal-header h3').text(EALang.new_appointment_title);
|
||||
$dialog.modal('show');
|
||||
});
|
||||
|
||||
|
@ -179,7 +179,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
|
|||
var $list = $('#existing-customers-list');
|
||||
|
||||
if (!$list.is(':visible')) {
|
||||
$(this).text(EALang['hide']);
|
||||
$(this).text(EALang.hide);
|
||||
$list.empty();
|
||||
$list.slideDown('slow');
|
||||
$('#filter-existing-customers').fadeIn('slow');
|
||||
|
@ -191,7 +191,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
|
|||
} else {
|
||||
$list.slideUp('slow');
|
||||
$('#filter-existing-customers').fadeOut('slow');
|
||||
$(this).text(EALang['select']);
|
||||
$(this).text(EALang.select);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -357,7 +357,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
|
|||
// Close existing customers-filter frame.
|
||||
$('#existing-customers-list').slideUp('slow');
|
||||
$('#filter-existing-customers').fadeOut('slow');
|
||||
$('#select-customer').text(EALang['select']);
|
||||
$('#select-customer').text(EALang.select);
|
||||
|
||||
// Setup start and datetimepickers.
|
||||
// Get the selected service duration. It will be needed in order to calculate the appointment end datetime.
|
||||
|
@ -391,27 +391,27 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
|
|||
dateFormat: dateFormat,
|
||||
|
||||
// Translation
|
||||
dayNames: [EALang['sunday'], EALang['monday'], EALang['tuesday'], EALang['wednesday'],
|
||||
EALang['thursday'], EALang['friday'], EALang['saturday']],
|
||||
dayNamesShort: [EALang['sunday'].substr(0,3), EALang['monday'].substr(0,3),
|
||||
EALang['tuesday'].substr(0,3), EALang['wednesday'].substr(0,3),
|
||||
EALang['thursday'].substr(0,3), EALang['friday'].substr(0,3),
|
||||
EALang['saturday'].substr(0,3)],
|
||||
dayNamesMin: [EALang['sunday'].substr(0,2), EALang['monday'].substr(0,2),
|
||||
EALang['tuesday'].substr(0,2), EALang['wednesday'].substr(0,2),
|
||||
EALang['thursday'].substr(0,2), EALang['friday'].substr(0,2),
|
||||
EALang['saturday'].substr(0,2)],
|
||||
monthNames: [EALang['january'], EALang['february'], EALang['march'], EALang['april'],
|
||||
EALang['may'], EALang['june'], EALang['july'], EALang['august'], EALang['september'],
|
||||
EALang['october'], EALang['november'], EALang['december']],
|
||||
prevText: EALang['previous'],
|
||||
nextText: EALang['next'],
|
||||
currentText: EALang['now'],
|
||||
closeText: EALang['close'],
|
||||
timeOnlyTitle: EALang['select_time'],
|
||||
timeText: EALang['time'],
|
||||
hourText: EALang['hour'],
|
||||
minuteText: EALang['minutes'],
|
||||
dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday,
|
||||
EALang.thursday, EALang.friday, EALang.saturday],
|
||||
dayNamesShort: [EALang.sunday.substr(0,3), EALang.monday.substr(0,3),
|
||||
EALang.tuesday.substr(0,3), EALang.wednesday.substr(0,3),
|
||||
EALang.thursday.substr(0,3), EALang.friday.substr(0,3),
|
||||
EALang.saturday.substr(0,3)],
|
||||
dayNamesMin: [EALang.sunday.substr(0,2), EALang.monday.substr(0,2),
|
||||
EALang.tuesday.substr(0,2), EALang.wednesday.substr(0,2),
|
||||
EALang.thursday.substr(0,2), EALang.friday.substr(0,2),
|
||||
EALang.saturday.substr(0,2)],
|
||||
monthNames: [EALang.january, EALang.february, EALang.march, EALang.april,
|
||||
EALang.may, EALang.june, EALang.july, EALang.august, EALang.september,
|
||||
EALang.october, EALang.november, EALang.december],
|
||||
prevText: EALang.previous,
|
||||
nextText: EALang.next,
|
||||
currentText: EALang.now,
|
||||
closeText: EALang.close,
|
||||
timeOnlyTitle: EALang.select_time,
|
||||
timeText: EALang.time,
|
||||
hourText: EALang.hour,
|
||||
minuteText: EALang.minutes,
|
||||
firstDay: 1
|
||||
});
|
||||
$dialog.find('#start-datetime').datetimepicker('setDate', startDatetime);
|
||||
|
@ -420,27 +420,27 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
|
|||
dateFormat: dateFormat,
|
||||
|
||||
// Translation
|
||||
dayNames: [EALang['sunday'], EALang['monday'], EALang['tuesday'], EALang['wednesday'],
|
||||
EALang['thursday'], EALang['friday'], EALang['saturday']],
|
||||
dayNamesShort: [EALang['sunday'].substr(0,3), EALang['monday'].substr(0,3),
|
||||
EALang['tuesday'].substr(0,3), EALang['wednesday'].substr(0,3),
|
||||
EALang['thursday'].substr(0,3), EALang['friday'].substr(0,3),
|
||||
EALang['saturday'].substr(0,3)],
|
||||
dayNamesMin: [EALang['sunday'].substr(0,2), EALang['monday'].substr(0,2),
|
||||
EALang['tuesday'].substr(0,2), EALang['wednesday'].substr(0,2),
|
||||
EALang['thursday'].substr(0,2), EALang['friday'].substr(0,2),
|
||||
EALang['saturday'].substr(0,2)],
|
||||
monthNames: [EALang['january'], EALang['february'], EALang['march'], EALang['april'],
|
||||
EALang['may'], EALang['june'], EALang['july'], EALang['august'], EALang['september'],
|
||||
EALang['october'], EALang['november'], EALang['december']],
|
||||
prevText: EALang['previous'],
|
||||
nextText: EALang['next'],
|
||||
currentText: EALang['now'],
|
||||
closeText: EALang['close'],
|
||||
timeOnlyTitle: EALang['select_time'],
|
||||
timeText: EALang['time'],
|
||||
hourText: EALang['hour'],
|
||||
minuteText: EALang['minutes'],
|
||||
dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday,
|
||||
EALang.thursday, EALang.friday, EALang.saturday],
|
||||
dayNamesShort: [EALang.sunday.substr(0,3), EALang.monday.substr(0,3),
|
||||
EALang.tuesday.substr(0,3), EALang.wednesday.substr(0,3),
|
||||
EALang.thursday.substr(0,3), EALang.friday.substr(0,3),
|
||||
EALang.saturday.substr(0,3)],
|
||||
dayNamesMin: [EALang.sunday.substr(0,2), EALang.monday.substr(0,2),
|
||||
EALang.tuesday.substr(0,2), EALang.wednesday.substr(0,2),
|
||||
EALang.thursday.substr(0,2), EALang.friday.substr(0,2),
|
||||
EALang.saturday.substr(0,2)],
|
||||
monthNames: [EALang.january, EALang.february, EALang.march, EALang.april,
|
||||
EALang.may, EALang.june, EALang.july, EALang.august, EALang.september,
|
||||
EALang.october, EALang.november, EALang.december],
|
||||
prevText: EALang.previous,
|
||||
nextText: EALang.next,
|
||||
currentText: EALang.now,
|
||||
closeText: EALang.close,
|
||||
timeOnlyTitle: EALang.select_time,
|
||||
timeText: EALang.time,
|
||||
hourText: EALang.hour,
|
||||
minuteText: EALang.minutes,
|
||||
firstDay: 1
|
||||
});
|
||||
$dialog.find('#end-datetime').datetimepicker('setDate', endDatetime);
|
||||
|
@ -471,13 +471,13 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
|
|||
});
|
||||
|
||||
if (missingRequiredField) {
|
||||
throw EALang['fields_are_required'];
|
||||
throw EALang.fields_are_required;
|
||||
}
|
||||
|
||||
// Check email address.
|
||||
if (!GeneralFunctions.validateEmail($dialog.find('#email').val())) {
|
||||
$dialog.find('#email').parents('.form-group').eq(1).addClass('has-error');
|
||||
throw EALang['invalid_email'];
|
||||
throw EALang.invalid_email;
|
||||
}
|
||||
|
||||
// Check appointment start and end time.
|
||||
|
@ -486,7 +486,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa
|
|||
if (start > end) {
|
||||
$dialog.find('#start-datetime').parents('.form-group').addClass('has-error');
|
||||
$dialog.find('#end-datetime').parents('.form-group').addClass('has-error');
|
||||
throw EALang['start_date_before_end_error'];
|
||||
throw EALang.start_date_before_end_error;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -70,7 +70,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
BackendCalendarAppointmentsModal.resetAppointmentDialog();
|
||||
|
||||
// Apply appointment data and show modal dialog.
|
||||
$dialog.find('.modal-header h3').text(EALang['edit_appointment_title']);
|
||||
$dialog.find('.modal-header h3').text(EALang.edit_appointment_title);
|
||||
$dialog.find('#appointment-id').val(appointment['id']);
|
||||
$dialog.find('#select-service').val(appointment['id_services']).trigger('change');
|
||||
$dialog.find('#select-provider').val(appointment['id_users_provider']);
|
||||
|
@ -160,12 +160,12 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
}, 'json').fail(GeneralFunctions.ajaxFailureHandler);
|
||||
};
|
||||
|
||||
messageButtons[EALang['cancel']] = function() {
|
||||
messageButtons[EALang.cancel] = function() {
|
||||
$('#message_box').dialog('close');
|
||||
};
|
||||
|
||||
GeneralFunctions.displayMessageBox(EALang['delete_appointment_title'],
|
||||
EALang['write_appointment_removal_reason'], messageButtons);
|
||||
GeneralFunctions.displayMessageBox(EALang.delete_appointment_title,
|
||||
EALang.write_appointment_removal_reason, messageButtons);
|
||||
|
||||
$('#message_box').append('<textarea id="delete-reason" rows="3"></textarea>');
|
||||
$('#delete-reason').css('width', '100%');
|
||||
|
@ -221,11 +221,11 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
// If the user has already the sync enabled then apply the proper style changes.
|
||||
if ($('#select-filter-item option:selected').attr('google-sync') === 'true') {
|
||||
$('#enable-sync').addClass('btn-danger enabled');
|
||||
$('#enable-sync span:eq(1)').text(EALang['disable_sync']);
|
||||
$('#enable-sync span:eq(1)').text(EALang.disable_sync);
|
||||
$('#google-sync').prop('disabled', false);
|
||||
} else {
|
||||
$('#enable-sync').removeClass('btn-danger enabled');
|
||||
$('#enable-sync span:eq(1)').text(EALang['enable_sync']);
|
||||
$('#enable-sync span:eq(1)').text(EALang.enable_sync);
|
||||
$('#google-sync').prop('disabled', true);
|
||||
}
|
||||
}
|
||||
|
@ -282,18 +282,18 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
+ '.popover-content strong {min-width: 80px; display:inline-block;}'
|
||||
+ '.popover-content button {margin-right: 10px;}'
|
||||
+ '</style>' +
|
||||
'<strong>' + EALang['start'] + '</strong> '
|
||||
'<strong>' + EALang.start + '</strong> '
|
||||
+ GeneralFunctions.formatDate(event.start, GlobalVariables.dateFormat, true)
|
||||
+ '<br>' +
|
||||
'<strong>' + EALang['end'] + '</strong> '
|
||||
'<strong>' + EALang.end + '</strong> '
|
||||
+ GeneralFunctions.formatDate(event.end, GlobalVariables.dateFormat, true)
|
||||
+ '<br>'
|
||||
+ notes
|
||||
+ '<hr>' +
|
||||
'<center>' +
|
||||
'<button class="edit-popover btn btn-primary ' + displayEdit + '">' + EALang['edit'] + '</button>' +
|
||||
'<button class="delete-popover btn btn-danger ' + displayDelete + '">' + EALang['delete'] + '</button>' +
|
||||
'<button class="close-popover btn btn-default" data-po=' + jsEvent.target + '>' + EALang['close'] + '</button>' +
|
||||
'<button class="edit-popover btn btn-primary ' + displayEdit + '">' + EALang.edit + '</button>' +
|
||||
'<button class="delete-popover btn btn-danger ' + displayDelete + '">' + EALang.delete + '</button>' +
|
||||
'<button class="close-popover btn btn-default" data-po=' + jsEvent.target + '>' + EALang.close + '</button>' +
|
||||
'</center>';
|
||||
} else {
|
||||
displayEdit = (GlobalVariables.user.privileges.appointments.edit == true)
|
||||
|
@ -306,27 +306,27 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
+ '.popover-content strong {min-width: 80px; display:inline-block;}'
|
||||
+ '.popover-content button {margin-right: 10px;}'
|
||||
+ '</style>' +
|
||||
'<strong>' + EALang['start'] + '</strong> '
|
||||
'<strong>' + EALang.start + '</strong> '
|
||||
+ GeneralFunctions.formatDate(event.start, GlobalVariables.dateFormat, true)
|
||||
+ '<br>' +
|
||||
'<strong>' + EALang['end'] + '</strong> '
|
||||
'<strong>' + EALang.end + '</strong> '
|
||||
+ GeneralFunctions.formatDate(event.end, GlobalVariables.dateFormat, true)
|
||||
+ '<br>' +
|
||||
'<strong>' + EALang['service'] + '</strong> '
|
||||
'<strong>' + EALang.service + '</strong> '
|
||||
+ event.data['service']['name']
|
||||
+ '<br>' +
|
||||
'<strong>' + EALang['provider'] + '</strong> '
|
||||
'<strong>' + EALang.provider + '</strong> '
|
||||
+ event.data['provider']['first_name'] + ' '
|
||||
+ event.data['provider']['last_name']
|
||||
+ '<br>' +
|
||||
'<strong>' + EALang['customer'] + '</strong> '
|
||||
'<strong>' + EALang.customer + '</strong> '
|
||||
+ event.data['customer']['first_name'] + ' '
|
||||
+ event.data['customer']['last_name']
|
||||
+ '<hr>' +
|
||||
'<center>' +
|
||||
'<button class="edit-popover btn btn-primary ' + displayEdit + '">' + EALang['edit'] + '</button>' +
|
||||
'<button class="delete-popover btn btn-danger ' + displayDelete + '">' + EALang['delete'] + '</button>' +
|
||||
'<button class="close-popover btn btn-default" data-po=' + jsEvent.target + '>' + EALang['close'] + '</button>' +
|
||||
'<button class="edit-popover btn btn-primary ' + displayEdit + '">' + EALang.edit + '</button>' +
|
||||
'<button class="delete-popover btn btn-danger ' + displayDelete + '">' + EALang.delete + '</button>' +
|
||||
'<button class="close-popover btn btn-default" data-po=' + jsEvent.target + '>' + EALang.close + '</button>' +
|
||||
'</center>';
|
||||
}
|
||||
|
||||
|
@ -359,7 +359,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
function _calendarEventResize(event, dayDelta, minuteDelta, revertFunc, jsEvent, ui, view) {
|
||||
if (GlobalVariables.user.privileges.appointments.edit == false) {
|
||||
revertFunc();
|
||||
Backend.displayNotification(EALang['no_privileges_edit_appointments']);
|
||||
Backend.displayNotification(EALang.no_privileges_edit_appointments);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -416,7 +416,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
}, 'json').fail(GeneralFunctions.ajaxFailureHandler);
|
||||
};
|
||||
|
||||
Backend.displayNotification(EALang['appointment_updated'], [
|
||||
Backend.displayNotification(EALang.appointment_updated, [
|
||||
{
|
||||
'label': 'Undo',
|
||||
'function': undoFunction
|
||||
|
@ -471,7 +471,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
}, 'json').fail(GeneralFunctions.ajaxFailureHandler);
|
||||
};
|
||||
|
||||
Backend.displayNotification(EALang['unavailable_updated'], [
|
||||
Backend.displayNotification(EALang.unavailable_updated, [
|
||||
{
|
||||
'label': 'Undo',
|
||||
'function': undoFunction
|
||||
|
@ -518,7 +518,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
function _calendarEventDrop(event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui, view) {
|
||||
if (GlobalVariables.user.privileges.appointments.edit == false) {
|
||||
revertFunc();
|
||||
Backend.displayNotification(EALang['no_privileges_edit_appointments']);
|
||||
Backend.displayNotification(EALang.no_privileges_edit_appointments);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -591,7 +591,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
}, 'json').fail(GeneralFunctions.ajaxFailureHandler);
|
||||
};
|
||||
|
||||
Backend.displayNotification(EALang['appointment_updated'], [
|
||||
Backend.displayNotification(EALang.appointment_updated, [
|
||||
{
|
||||
'label': 'Undo',
|
||||
'function': undoFunction
|
||||
|
@ -652,7 +652,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
}, 'json').fail(GeneralFunctions.ajaxFailureHandler);
|
||||
};
|
||||
|
||||
Backend.displayNotification(EALang['unavailable_updated'], [
|
||||
Backend.displayNotification(EALang.unavailable_updated, [
|
||||
{
|
||||
label: 'Undo',
|
||||
function: undoFunction
|
||||
|
@ -780,7 +780,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
// Add custom unavailable periods.
|
||||
$.each(response.unavailables, function(index, unavailable) {
|
||||
var unavailablePeriod = {
|
||||
title: EALang['unavailable'] + ' <br><small>' + ((unavailable.notes.length > 30)
|
||||
title: EALang.unavailable + ' <br><small>' + ((unavailable.notes.length > 30)
|
||||
? unavailable.notes.substring(0, 30) + '...'
|
||||
: unavailable.notes) + '</small>',
|
||||
start: Date.parse(unavailable.start_datetime),
|
||||
|
@ -797,7 +797,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
// Non-working day
|
||||
if (workingPlan[selDayName] == null) {
|
||||
unavailablePeriod = {
|
||||
title: EALang['not_working'],
|
||||
title: EALang.not_working,
|
||||
start: GeneralFunctions.clone($calendar.fullCalendar('getView').start),
|
||||
end: GeneralFunctions.clone($calendar.fullCalendar('getView').end),
|
||||
allDay: false,
|
||||
|
@ -818,7 +818,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
|
||||
if (calendarDateStart < workDateStart) {
|
||||
unavailablePeriod = {
|
||||
title: EALang['not_working'],
|
||||
title: EALang.not_working,
|
||||
start: calendarDateStart,
|
||||
end: workDateStart,
|
||||
allDay: false,
|
||||
|
@ -837,7 +837,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
'dd/MM/yyyy HH:mm'); // Use calendarDateStart ***
|
||||
if (calendarDateEnd > workDateEnd) {
|
||||
var unavailablePeriod = {
|
||||
title: EALang['not_working'],
|
||||
title: EALang.not_working,
|
||||
start: workDateEnd,
|
||||
end: calendarDateEnd,
|
||||
allDay: false,
|
||||
|
@ -857,7 +857,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
breakEnd = Date.parseExact(calendarDateStart.toString('dd/MM/yyyy')
|
||||
+ ' ' + currBreak.end, 'dd/MM/yyyy HH:mm');
|
||||
var unavailablePeriod = {
|
||||
title: EALang['break'],
|
||||
title: EALang.break,
|
||||
start: breakStart,
|
||||
end: breakEnd,
|
||||
allDay: false,
|
||||
|
@ -878,7 +878,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
// the provider won't work on that day).
|
||||
$.each(response.unavailables, function(index, unavailable) {
|
||||
unavailablePeriod = {
|
||||
title: EALang['unavailable'] + ' <br><small>' + ((unavailable.notes.length > 30)
|
||||
title: EALang.unavailable + ' <br><small>' + ((unavailable.notes.length > 30)
|
||||
? unavailable.notes.substring(0, 30) + '...'
|
||||
: unavailable.notes) + '</small>',
|
||||
start: Date.parse(unavailable.start_datetime),
|
||||
|
@ -897,7 +897,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
if (workingDay == null) {
|
||||
// Add a full day unavailable event.
|
||||
unavailablePeriod = {
|
||||
title: EALang['not_working'],
|
||||
title: EALang.not_working,
|
||||
start: GeneralFunctions.clone(currDateStart),
|
||||
end: GeneralFunctions.clone(currDateEnd),
|
||||
allDay: false,
|
||||
|
@ -919,7 +919,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
+ ' ' + workingDay.start, 'dd/MM/yyyy HH:mm');
|
||||
if (currDateStart < start) {
|
||||
unavailablePeriod = {
|
||||
title: EALang['not_working'],
|
||||
title: EALang.not_working,
|
||||
start: GeneralFunctions.clone(currDateStart),
|
||||
end: GeneralFunctions.clone(start),
|
||||
allDay: false,
|
||||
|
@ -935,7 +935,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
+ ' ' + workingDay.end, 'dd/MM/yyyy HH:mm');
|
||||
if (currDateEnd > end) {
|
||||
unavailablePeriod = {
|
||||
title: EALang['not_working'],
|
||||
title: EALang.not_working,
|
||||
start: GeneralFunctions.clone(end),
|
||||
end: GeneralFunctions.clone(currDateEnd),
|
||||
allDay: false,
|
||||
|
@ -955,7 +955,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
breakEnd = Date.parseExact(currDateStart.toString('dd/MM/yyyy')
|
||||
+ ' ' + currBreak.end, 'dd/MM/yyyy HH:mm');
|
||||
var unavailablePeriod = {
|
||||
title: EALang['break'],
|
||||
title: EALang.break,
|
||||
start: breakStart,
|
||||
end: breakEnd,
|
||||
allDay: false,
|
||||
|
@ -1017,7 +1017,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
snapMinutes: 15,
|
||||
axisFormat: 'HH:mm',
|
||||
timeFormat: 'HH:mm{ - HH:mm}',
|
||||
allDayText: EALang['all_day'],
|
||||
allDayText: EALang.all_day,
|
||||
columnFormat: columnFormat,
|
||||
titleFormat: {
|
||||
month: 'MMMM yyyy',
|
||||
|
@ -1031,31 +1031,31 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
},
|
||||
|
||||
// Translations
|
||||
monthNames: [EALang['january'], EALang['february'], EALang['march'], EALang['april'],
|
||||
EALang['may'], EALang['june'], EALang['july'], EALang['august'],
|
||||
EALang['september'],EALang['october'], EALang['november'],
|
||||
EALang['december']],
|
||||
monthNamesShort: [EALang['january'].substr(0,3), EALang['february'].substr(0,3),
|
||||
EALang['march'].substr(0,3), EALang['april'].substr(0,3),
|
||||
EALang['may'].substr(0,3), EALang['june'].substr(0,3),
|
||||
EALang['july'].substr(0,3), EALang['august'].substr(0,3),
|
||||
EALang['september'].substr(0,3),EALang['october'].substr(0,3),
|
||||
EALang['november'].substr(0,3), EALang['december'].substr(0,3)],
|
||||
dayNames: [EALang['sunday'], EALang['monday'], EALang['tuesday'], EALang['wednesday'],
|
||||
EALang['thursday'], EALang['friday'], EALang['saturday']],
|
||||
dayNamesShort: [EALang['sunday'].substr(0,3), EALang['monday'].substr(0,3),
|
||||
EALang['tuesday'].substr(0,3), EALang['wednesday'].substr(0,3),
|
||||
EALang['thursday'].substr(0,3), EALang['friday'].substr(0,3),
|
||||
EALang['saturday'].substr(0,3)],
|
||||
dayNamesMin: [EALang['sunday'].substr(0,2), EALang['monday'].substr(0,2),
|
||||
EALang['tuesday'].substr(0,2), EALang['wednesday'].substr(0,2),
|
||||
EALang['thursday'].substr(0,2), EALang['friday'].substr(0,2),
|
||||
EALang['saturday'].substr(0,2)],
|
||||
monthNames: [EALang.january, EALang.february, EALang.march, EALang.april,
|
||||
EALang.may, EALang.june, EALang.july, EALang.august,
|
||||
EALang.september,EALang.october, EALang.november,
|
||||
EALang.december],
|
||||
monthNamesShort: [EALang.january.substr(0,3), EALang.february.substr(0,3),
|
||||
EALang.march.substr(0,3), EALang.april.substr(0,3),
|
||||
EALang.may.substr(0,3), EALang.june.substr(0,3),
|
||||
EALang.july.substr(0,3), EALang.august.substr(0,3),
|
||||
EALang.september.substr(0,3),EALang.october.substr(0,3),
|
||||
EALang.november.substr(0,3), EALang.december.substr(0,3)],
|
||||
dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday,
|
||||
EALang.thursday, EALang.friday, EALang.saturday],
|
||||
dayNamesShort: [EALang.sunday.substr(0,3), EALang.monday.substr(0,3),
|
||||
EALang.tuesday.substr(0,3), EALang.wednesday.substr(0,3),
|
||||
EALang.thursday.substr(0,3), EALang.friday.substr(0,3),
|
||||
EALang.saturday.substr(0,3)],
|
||||
dayNamesMin: [EALang.sunday.substr(0,2), EALang.monday.substr(0,2),
|
||||
EALang.tuesday.substr(0,2), EALang.wednesday.substr(0,2),
|
||||
EALang.thursday.substr(0,2), EALang.friday.substr(0,2),
|
||||
EALang.saturday.substr(0,2)],
|
||||
buttonText: {
|
||||
today: EALang['today'],
|
||||
day: EALang['day'],
|
||||
week: EALang['week'],
|
||||
month: EALang['month']
|
||||
today: EALang.today,
|
||||
day: EALang.day,
|
||||
week: EALang.week,
|
||||
month: EALang.month
|
||||
},
|
||||
|
||||
// Calendar events need to be declared on initialization.
|
||||
|
@ -1073,7 +1073,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
|
||||
// Fill the select listboxes of the page.
|
||||
if (GlobalVariables.availableProviders.length > 0) {
|
||||
var optgroupHtml = '<optgroup label="' + EALang['providers'] + '" type="providers-group">';
|
||||
var optgroupHtml = '<optgroup label="' + EALang.providers + '" type="providers-group">';
|
||||
$.each(GlobalVariables.availableProviders, function(index, provider) {
|
||||
var hasGoogleSync = (provider['settings']['google_sync'] === '1')
|
||||
? 'true' : 'false';
|
||||
|
@ -1089,7 +1089,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
}
|
||||
|
||||
if (GlobalVariables.availableServices.length > 0) {
|
||||
optgroupHtml = '<optgroup label="' + EALang['services'] + '" type="services-group">';
|
||||
optgroupHtml = '<optgroup label="' + EALang.services + '" type="services-group">';
|
||||
$.each(GlobalVariables.availableServices, function(index, service) {
|
||||
optgroupHtml += '<option value="' + service['id'] + '" ' +
|
||||
'type="' + FILTER_TYPE_SERVICE + '">' +
|
||||
|
@ -1141,7 +1141,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
var appointment = GlobalVariables.editAppointment;
|
||||
BackendCalendarAppointmentsModal.resetAppointmentDialog();
|
||||
|
||||
$dialog.find('.modal-header h3').text(EALang['edit_appointment_title']);
|
||||
$dialog.find('.modal-header h3').text(EALang.edit_appointment_title);
|
||||
$dialog.find('#appointment-id').val(appointment['id']);
|
||||
$dialog.find('#select-service').val(appointment['id_services']).change();
|
||||
$dialog.find('#select-provider').val(appointment['id_users_provider']);
|
||||
|
|
|
@ -54,7 +54,7 @@ window.BackendCalendarGoogleSync = window.BackendCalendarGoogleSync || {};
|
|||
windowHandle.close();
|
||||
window.clearInterval(authInterval);
|
||||
$('#enable-sync').addClass('btn-danger enabled');
|
||||
$('#enable-sync span:eq(1)').text(EALang['disable_sync']);
|
||||
$('#enable-sync span:eq(1)').text(EALang.disable_sync);
|
||||
$('#google-sync').prop('disabled', false);
|
||||
$('#select-filter-item option:selected').attr('google-sync', 'true');
|
||||
|
||||
|
@ -101,7 +101,7 @@ window.BackendCalendarGoogleSync = window.BackendCalendarGoogleSync || {};
|
|||
_disableProviderSync(provider['id']);
|
||||
|
||||
$('#enable-sync').removeClass('btn-danger enabled');
|
||||
$('#enable-sync span:eq(1)').text(EALang['enable_sync']);
|
||||
$('#enable-sync span:eq(1)').text(EALang.enable_sync);
|
||||
$('#google-sync').prop('disabled', true);
|
||||
$('#select-filter-item option:selected').attr('google-sync', 'false');
|
||||
|
||||
|
@ -125,7 +125,7 @@ window.BackendCalendarGoogleSync = window.BackendCalendarGoogleSync || {};
|
|||
if (!GeneralFunctions.handleAjaxExceptions(response)) {
|
||||
return;
|
||||
}
|
||||
Backend.displayNotification(EALang['google_calendar_selected']);
|
||||
Backend.displayNotification(EALang.google_calendar_selected);
|
||||
$('#select-google-calendar').modal('hide');
|
||||
}, 'json').fail(GeneralFunctions.ajaxFailureHandler);
|
||||
});
|
||||
|
@ -166,11 +166,11 @@ window.BackendCalendarGoogleSync = window.BackendCalendarGoogleSync || {};
|
|||
$('#message_box').append(GeneralFunctions.exceptionsToHtml(response.warnings));
|
||||
}
|
||||
|
||||
Backend.displayNotification(EALang['google_sync_completed']);
|
||||
Backend.displayNotification(EALang.google_sync_completed);
|
||||
$('#reload-appointments').trigger('click');
|
||||
})
|
||||
.fail(function(jqXHR, textStatus, errorThrown) {
|
||||
Backend.displayNotification(EALang['google_sync_failed']);
|
||||
Backend.displayNotification(EALang.google_sync_failed);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -165,18 +165,18 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
+ '.popover-content strong {min-width: 80px; display:inline-block;}'
|
||||
+ '.popover-content button {margin-right: 10px;}'
|
||||
+ '</style>' +
|
||||
'<strong>' + EALang['start'] + '</strong> '
|
||||
'<strong>' + EALang.start + '</strong> '
|
||||
+ GeneralFunctions.formatDate(entry.start_datetime, GlobalVariables.dateFormat, true)
|
||||
+ '<br>' +
|
||||
'<strong>' + EALang['end'] + '</strong> '
|
||||
'<strong>' + EALang.end + '</strong> '
|
||||
+ GeneralFunctions.formatDate(entry.end_datetime, GlobalVariables.dateFormat, true)
|
||||
+ '<br>'
|
||||
+ notes
|
||||
+ '<hr>' +
|
||||
'<center>' +
|
||||
'<button class="edit-popover btn btn-primary">' + EALang['edit'] + '</button>' +
|
||||
'<button class="delete-popover btn btn-danger">' + EALang['delete'] + '</button>' +
|
||||
'<button class="close-popover btn btn-default" data-po=' + event.target + '>' + EALang['close'] + '</button>' +
|
||||
'<button class="edit-popover btn btn-primary">' + EALang.edit + '</button>' +
|
||||
'<button class="delete-popover btn btn-danger">' + EALang.delete + '</button>' +
|
||||
'<button class="close-popover btn btn-default" data-po=' + event.target + '>' + EALang.close + '</button>' +
|
||||
'</center>';
|
||||
} else {
|
||||
html =
|
||||
|
@ -184,31 +184,31 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
+ '.popover-content strong {min-width: 80px; display:inline-block;}'
|
||||
+ '.popover-content button {margin-right: 10px;}'
|
||||
+ '</style>' +
|
||||
'<strong>' + EALang['start'] + '</strong> '
|
||||
'<strong>' + EALang.start + '</strong> '
|
||||
+ GeneralFunctions.formatDate(entry.start_datetime, GlobalVariables.dateFormat, true)
|
||||
+ '<br>' +
|
||||
'<strong>' + EALang['end'] + '</strong> '
|
||||
'<strong>' + EALang.end + '</strong> '
|
||||
+ GeneralFunctions.formatDate(entry.end_datetime, GlobalVariables.dateFormat, true)
|
||||
+ '<br>' +
|
||||
'<strong>' + EALang['service'] + '</strong> '
|
||||
'<strong>' + EALang.service + '</strong> '
|
||||
+ entry.service.name
|
||||
+ '<br>' +
|
||||
'<strong>' + EALang['provider'] + '</strong> '
|
||||
'<strong>' + EALang.provider + '</strong> '
|
||||
+ entry.provider.first_name + ' '
|
||||
+ entry.provider.last_name
|
||||
+ '<br>' +
|
||||
'<strong>' + EALang['customer'] + '</strong> '
|
||||
'<strong>' + EALang.customer + '</strong> '
|
||||
+ entry.customer.first_name + ' '
|
||||
+ entry.customer.last_name
|
||||
+ '<hr>' +
|
||||
'<center>' +
|
||||
'<button class="edit-popover btn btn-primary">' + EALang['edit'] + '</button>' +
|
||||
'<button class="delete-popover btn btn-danger">' + EALang['delete'] + '</button>' +
|
||||
'<button class="close-popover btn btn-default" data-po=' + event.target + '>' + EALang['close'] + '</button>' +
|
||||
'<button class="edit-popover btn btn-primary">' + EALang.edit + '</button>' +
|
||||
'<button class="delete-popover btn btn-danger">' + EALang.delete + '</button>' +
|
||||
'<button class="close-popover btn btn-default" data-po=' + event.target + '>' + EALang.close + '</button>' +
|
||||
'</center>';
|
||||
}
|
||||
|
||||
var title = entry.is_unavailable !== '0' ? EALang['unavailable'] : entry.service.name + ' - '
|
||||
var title = entry.is_unavailable !== '0' ? EALang.unavailable : entry.service.name + ' - '
|
||||
+ entry.customer.first_name + ' ' + entry.customer.last_name;
|
||||
|
||||
$(event.target).popover({
|
||||
|
@ -260,7 +260,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
BackendCalendarAppointmentsModal.resetAppointmentDialog();
|
||||
|
||||
// Apply appointment data and show modal dialog.
|
||||
$dialog.find('.modal-header h3').text(EALang['edit_appointment_title']);
|
||||
$dialog.find('.modal-header h3').text(EALang.edit_appointment_title);
|
||||
$dialog.find('#appointment-id').val(appointment['id']);
|
||||
$dialog.find('#select-service').val(appointment['id_services']).trigger('change');
|
||||
$dialog.find('#select-provider').val(appointment['id_users_provider']);
|
||||
|
@ -350,12 +350,12 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
}, 'json').fail(GeneralFunctions.ajaxFailureHandler);
|
||||
};
|
||||
|
||||
messageButtons[EALang['cancel']] = function() {
|
||||
messageButtons[EALang.cancel] = function() {
|
||||
$('#message_box').dialog('close');
|
||||
};
|
||||
|
||||
GeneralFunctions.displayMessageBox(EALang['delete_appointment_title'],
|
||||
EALang['write_appointment_removal_reason'], messageButtons);
|
||||
GeneralFunctions.displayMessageBox(EALang.delete_appointment_title,
|
||||
EALang.write_appointment_removal_reason, messageButtons);
|
||||
|
||||
$('#message_box').append('<textarea id="delete-reason" rows="3"></textarea>');
|
||||
$('#delete-reason').css('width', '100%');
|
||||
|
@ -401,8 +401,8 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
$calendarFilter
|
||||
.find('select')
|
||||
.empty()
|
||||
.append(new Option('1 ' + EALang['day'] , 1))
|
||||
.append(new Option('3 ' + EALang['days'], 3));
|
||||
.append(new Option('1 ' + EALang.day , 1))
|
||||
.append(new Option('3 ' + EALang.days, 3));
|
||||
|
||||
var $calendarHeader = $('<div class="calendar-header" />').appendTo('#calendar');
|
||||
|
||||
|
@ -590,7 +590,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
|
||||
if (!plan) {
|
||||
$providerColumn.append('<div class="not-working">'
|
||||
+ (provider.first_name + ' ' + provider.last_name).trim() +' <br> ' + EALang['not_working']
|
||||
+ (provider.first_name + ' ' + provider.last_name).trim() +' <br> ' + EALang.not_working
|
||||
+ '</div>');
|
||||
return;
|
||||
}
|
||||
|
@ -606,7 +606,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
'</th>' +
|
||||
'</tr>' +
|
||||
'<tr>' +
|
||||
'<th>' + EALang['time'] + '</th>' +
|
||||
'<th>' + EALang.time + '</th>' +
|
||||
'</tr>' +
|
||||
'</thead>' +
|
||||
'<tbody></tbody>'
|
||||
|
@ -731,7 +731,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
var eventDuration = Math.round((endDate - eventDate) / 60000);
|
||||
var $event = $('<div class="event unavailability" />');
|
||||
|
||||
$event.html((unavailability.notes || EALang['unavailable']) +
|
||||
$event.html((unavailability.notes || EALang.unavailable) +
|
||||
' <span class="hour">' + eventDate.toString('HH:mm') + '</span> (' + eventDuration + '\')');
|
||||
|
||||
$event.data(unavailability);
|
||||
|
@ -782,7 +782,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
var $event = $('<div class="event unavailability break" />');
|
||||
|
||||
$event.html(
|
||||
EALang['break'] +
|
||||
EALang.break +
|
||||
' <span class="hour">' + eventDate.toString('HH:mm') + '</span> (' + eventDuration + '\')');
|
||||
|
||||
$event.data(entry);
|
||||
|
|
|
@ -36,7 +36,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
|
|||
if (start > end) {
|
||||
// Start time is after end time - display message to user.
|
||||
$dialog.find('.modal-message')
|
||||
.text(EALang['start_date_before_end_error'])
|
||||
.text(EALang.start_date_before_end_error)
|
||||
.addClass('alert-danger')
|
||||
.removeClass('hidden');
|
||||
return;
|
||||
|
@ -63,7 +63,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
|
|||
$('#message_box').append(GeneralFunctions.exceptionsToHtml(response.exceptions));
|
||||
|
||||
$dialog.find('.modal-message')
|
||||
.text(EALang['unexpected_issues_occurred'])
|
||||
.text(EALang.unexpected_issues_occurred)
|
||||
.addClass('alert-danger')
|
||||
.removeClass('hidden');
|
||||
|
||||
|
@ -79,7 +79,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
|
|||
|
||||
// Display success message to the user.
|
||||
$dialog.find('.modal-message')
|
||||
.text(EALang['unavailable_saved'])
|
||||
.text(EALang.unavailable_saved)
|
||||
.addClass('alert-success')
|
||||
.removeClass('alert-danger hidden');
|
||||
|
||||
|
@ -95,7 +95,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
|
|||
GeneralFunctions.displayMessageBox('Communication Error', 'Unfortunately ' +
|
||||
'the operation could not complete due to server communication errors.');
|
||||
|
||||
$dialog.find('.modal-message').txt(EALang['service_communication_error']);
|
||||
$dialog.find('.modal-message').txt(EALang.service_communication_error);
|
||||
$dialog.find('.modal-message').addClass('alert-danger').removeClass('hidden');
|
||||
};
|
||||
|
||||
|
@ -143,7 +143,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
|
|||
|
||||
$dialog.find('#unavailable-start').val(GeneralFunctions.formatDate(start, GlobalVariables.dateFormat, true));
|
||||
$dialog.find('#unavailable-end').val(GeneralFunctions.formatDate(start.addHours(1), GlobalVariables.dateFormat, true));
|
||||
$dialog.find('.modal-header h3').text(EALang['new_unavailable_title']);
|
||||
$dialog.find('.modal-header h3').text(EALang.new_unavailable_title);
|
||||
$dialog.modal('show');
|
||||
});
|
||||
}
|
||||
|
@ -181,27 +181,27 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
|
|||
dateFormat: dateFormat,
|
||||
|
||||
// Translation
|
||||
dayNames: [EALang['sunday'], EALang['monday'], EALang['tuesday'], EALang['wednesday'],
|
||||
EALang['thursday'], EALang['friday'], EALang['saturday']],
|
||||
dayNamesShort: [EALang['sunday'].substr(0,3), EALang['monday'].substr(0,3),
|
||||
EALang['tuesday'].substr(0,3), EALang['wednesday'].substr(0,3),
|
||||
EALang['thursday'].substr(0,3), EALang['friday'].substr(0,3),
|
||||
EALang['saturday'].substr(0,3)],
|
||||
dayNamesMin: [EALang['sunday'].substr(0,2), EALang['monday'].substr(0,2),
|
||||
EALang['tuesday'].substr(0,2), EALang['wednesday'].substr(0,2),
|
||||
EALang['thursday'].substr(0,2), EALang['friday'].substr(0,2),
|
||||
EALang['saturday'].substr(0,2)],
|
||||
monthNames: [EALang['january'], EALang['february'], EALang['march'], EALang['april'],
|
||||
EALang['may'], EALang['june'], EALang['july'], EALang['august'], EALang['september'],
|
||||
EALang['october'], EALang['november'], EALang['december']],
|
||||
prevText: EALang['previous'],
|
||||
nextText: EALang['next'],
|
||||
currentText: EALang['now'],
|
||||
closeText: EALang['close'],
|
||||
timeOnlyTitle: EALang['select_time'],
|
||||
timeText: EALang['time'],
|
||||
hourText: EALang['hour'],
|
||||
minuteText: EALang['minutes'],
|
||||
dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday,
|
||||
EALang.thursday, EALang.friday, EALang.saturday],
|
||||
dayNamesShort: [EALang.sunday.substr(0,3), EALang.monday.substr(0,3),
|
||||
EALang.tuesday.substr(0,3), EALang.wednesday.substr(0,3),
|
||||
EALang.thursday.substr(0,3), EALang.friday.substr(0,3),
|
||||
EALang.saturday.substr(0,3)],
|
||||
dayNamesMin: [EALang.sunday.substr(0,2), EALang.monday.substr(0,2),
|
||||
EALang.tuesday.substr(0,2), EALang.wednesday.substr(0,2),
|
||||
EALang.thursday.substr(0,2), EALang.friday.substr(0,2),
|
||||
EALang.saturday.substr(0,2)],
|
||||
monthNames: [EALang.january, EALang.february, EALang.march, EALang.april,
|
||||
EALang.may, EALang.june, EALang.july, EALang.august, EALang.september,
|
||||
EALang.october, EALang.november, EALang.december],
|
||||
prevText: EALang.previous,
|
||||
nextText: EALang.next,
|
||||
currentText: EALang.now,
|
||||
closeText: EALang.close,
|
||||
timeOnlyTitle: EALang.select_time,
|
||||
timeText: EALang.time,
|
||||
hourText: EALang.hour,
|
||||
minuteText: EALang.minutes,
|
||||
firstDay: 1
|
||||
});
|
||||
$dialog.find('#unavailable-start').val(start);
|
||||
|
@ -210,27 +210,27 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
|
|||
dateFormat: dateFormat,
|
||||
|
||||
// Translation
|
||||
dayNames: [EALang['sunday'], EALang['monday'], EALang['tuesday'], EALang['wednesday'],
|
||||
EALang['thursday'], EALang['friday'], EALang['saturday']],
|
||||
dayNamesShort: [EALang['sunday'].substr(0,3), EALang['monday'].substr(0,3),
|
||||
EALang['tuesday'].substr(0,3), EALang['wednesday'].substr(0,3),
|
||||
EALang['thursday'].substr(0,3), EALang['friday'].substr(0,3),
|
||||
EALang['saturday'].substr(0,3)],
|
||||
dayNamesMin: [EALang['sunday'].substr(0,2), EALang['monday'].substr(0,2),
|
||||
EALang['tuesday'].substr(0,2), EALang['wednesday'].substr(0,2),
|
||||
EALang['thursday'].substr(0,2), EALang['friday'].substr(0,2),
|
||||
EALang['saturday'].substr(0,2)],
|
||||
monthNames: [EALang['january'], EALang['february'], EALang['march'], EALang['april'],
|
||||
EALang['may'], EALang['june'], EALang['july'], EALang['august'], EALang['september'],
|
||||
EALang['october'], EALang['november'], EALang['december']],
|
||||
prevText: EALang['previous'],
|
||||
nextText: EALang['next'],
|
||||
currentText: EALang['now'],
|
||||
closeText: EALang['close'],
|
||||
timeOnlyTitle: EALang['select_time'],
|
||||
timeText: EALang['time'],
|
||||
hourText: EALang['hour'],
|
||||
minuteText: EALang['minutes'],
|
||||
dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday,
|
||||
EALang.thursday, EALang.friday, EALang.saturday],
|
||||
dayNamesShort: [EALang.sunday.substr(0,3), EALang.monday.substr(0,3),
|
||||
EALang.tuesday.substr(0,3), EALang.wednesday.substr(0,3),
|
||||
EALang.thursday.substr(0,3), EALang.friday.substr(0,3),
|
||||
EALang.saturday.substr(0,3)],
|
||||
dayNamesMin: [EALang.sunday.substr(0,2), EALang.monday.substr(0,2),
|
||||
EALang.tuesday.substr(0,2), EALang.wednesday.substr(0,2),
|
||||
EALang.thursday.substr(0,2), EALang.friday.substr(0,2),
|
||||
EALang.saturday.substr(0,2)],
|
||||
monthNames: [EALang.january, EALang.february, EALang.march, EALang.april,
|
||||
EALang.may, EALang.june, EALang.july, EALang.august, EALang.september,
|
||||
EALang.october, EALang.november, EALang.december],
|
||||
prevText: EALang.previous,
|
||||
nextText: EALang.next,
|
||||
currentText: EALang.now,
|
||||
closeText: EALang.close,
|
||||
timeOnlyTitle: EALang.select_time,
|
||||
timeText: EALang.time,
|
||||
hourText: EALang.hour,
|
||||
minuteText: EALang.minutes,
|
||||
firstDay: 1
|
||||
});
|
||||
$dialog.find('#unavailable-end').val(end);
|
||||
|
|
|
@ -109,22 +109,22 @@
|
|||
|
||||
var buttons = [
|
||||
{
|
||||
text: EALang['delete'],
|
||||
text: EALang.delete,
|
||||
click: function() {
|
||||
instance.delete(categoryId);
|
||||
$('#message_box').dialog('close');
|
||||
}
|
||||
},
|
||||
{
|
||||
text: EALang['cancel'],
|
||||
text: EALang.cancel,
|
||||
click: function() {
|
||||
$('#message_box').dialog('close');
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
GeneralFunctions.displayMessageBox(EALang['delete_category'],
|
||||
EALang['delete_record_prompt'], buttons);
|
||||
GeneralFunctions.displayMessageBox(EALang.delete_category,
|
||||
EALang.delete_record_prompt, buttons);
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -190,7 +190,7 @@
|
|||
$('#filter-categories .results').jScrollPane({ mouseWheelSpeed: 70 });
|
||||
|
||||
if (response.length === 0) {
|
||||
$('#filter-categories .results').html('<em>' + EALang['no_records_found'] + '</em>');
|
||||
$('#filter-categories .results').html('<em>' + EALang.no_records_found + '</em>');
|
||||
}
|
||||
|
||||
if (selectId !== undefined) {
|
||||
|
@ -216,7 +216,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
Backend.displayNotification(EALang['service_category_saved']);
|
||||
Backend.displayNotification(EALang.service_category_saved);
|
||||
this.resetForm();
|
||||
$('#filter-categories .key').val('');
|
||||
this.filter('', response.id, true);
|
||||
|
@ -241,7 +241,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
Backend.displayNotification(EALang['service_category_deleted']);
|
||||
Backend.displayNotification(EALang.service_category_deleted);
|
||||
|
||||
this.resetForm();
|
||||
this.filter($('#filter-categories .key').val());
|
||||
|
@ -279,7 +279,7 @@
|
|||
});
|
||||
|
||||
if (missingRequired) {
|
||||
throw EALang['fields_are_required'];
|
||||
throw EALang.fields_are_required;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -170,22 +170,22 @@
|
|||
var customerId = $('#customer-id').val();
|
||||
var buttons = [
|
||||
{
|
||||
text: EALang['delete'],
|
||||
text: EALang.delete,
|
||||
click: function() {
|
||||
instance.delete(customerId);
|
||||
$('#message_box').dialog('close');
|
||||
}
|
||||
},
|
||||
{
|
||||
text: EALang['cancel'],
|
||||
text: EALang.cancel,
|
||||
click: function() {
|
||||
$('#message_box').dialog('close');
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
GeneralFunctions.displayMessageBox(EALang['delete_customer'],
|
||||
EALang['delete_record_prompt'], buttons);
|
||||
GeneralFunctions.displayMessageBox(EALang.delete_customer,
|
||||
EALang.delete_record_prompt, buttons);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -206,7 +206,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
Backend.displayNotification(EALang['customer_saved']);
|
||||
Backend.displayNotification(EALang.customer_saved);
|
||||
this.resetForm();
|
||||
$('#filter-customers .key').val('');
|
||||
this.filter('', response.id, true);
|
||||
|
@ -230,7 +230,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
Backend.displayNotification(EALang['customer_deleted']);
|
||||
Backend.displayNotification(EALang.customer_deleted);
|
||||
this.resetForm();
|
||||
this.filter($('#filter-customers .key').val());
|
||||
}.bind(this), 'json').fail(GeneralFunctions.ajaxFailureHandler);
|
||||
|
@ -257,13 +257,13 @@
|
|||
});
|
||||
|
||||
if (missingRequired) {
|
||||
throw EALang['fields_are_required'];
|
||||
throw EALang.fields_are_required;
|
||||
}
|
||||
|
||||
// Validate email address.
|
||||
if (!GeneralFunctions.validateEmail($('#email').val())) {
|
||||
$('#email').css('border', '2px solid red');
|
||||
throw EALang['invalid_email'];
|
||||
throw EALang.invalid_email;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -362,7 +362,7 @@
|
|||
$('#filter-customers .results').jScrollPane({ mouseWheelSpeed: 70 });
|
||||
|
||||
if (response.length == 0) {
|
||||
$('#filter-customers .results').html('<em>' + EALang['no_records_found'] + '</em>');
|
||||
$('#filter-customers .results').html('<em>' + EALang.no_records_found + '</em>');
|
||||
}
|
||||
|
||||
if (selectId != undefined) {
|
||||
|
|
|
@ -45,7 +45,7 @@ window.BackendServices = window.BackendServices || {};
|
|||
var option = new Option(category.name, category.id);
|
||||
$('#service-category').append(option);
|
||||
});
|
||||
$('#service-category').append(new Option('- ' + EALang['no_category'] + ' -', null)).val('null');
|
||||
$('#service-category').append(new Option('- ' + EALang.no_category + ' -', null)).val('null');
|
||||
|
||||
$('#service-duration, #service-attendants-number').spinner({
|
||||
min: 1,
|
||||
|
@ -123,7 +123,7 @@ window.BackendServices = window.BackendServices || {};
|
|||
var option = new Option(category.name, category.id);
|
||||
$select.append(option);
|
||||
});
|
||||
$select.append(new Option('- ' + EALang['no_category'] + ' -', null)).val('null');
|
||||
$select.append(new Option('- ' + EALang.no_category + ' -', null)).val('null');
|
||||
}, 'json').fail(GeneralFunctions.ajaxFailureHandler);
|
||||
}
|
||||
|
||||
|
|
|
@ -164,22 +164,22 @@
|
|||
var serviceId = $('#service-id').val();
|
||||
var buttons = [
|
||||
{
|
||||
text: EALang['delete'],
|
||||
text: EALang.delete,
|
||||
click: function() {
|
||||
instance.delete(serviceId);
|
||||
$('#message_box').dialog('close');
|
||||
}
|
||||
},
|
||||
{
|
||||
text: EALang['cancel'],
|
||||
text: EALang.cancel,
|
||||
click: function() {
|
||||
$('#message_box').dialog('close');
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
GeneralFunctions.displayMessageBox(EALang['delete_service'],
|
||||
EALang['delete_record_prompt'], buttons);
|
||||
GeneralFunctions.displayMessageBox(EALang.delete_service,
|
||||
EALang.delete_record_prompt, buttons);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -201,7 +201,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
Backend.displayNotification(EALang['service_saved']);
|
||||
Backend.displayNotification(EALang.service_saved);
|
||||
this.resetForm();
|
||||
$('#filter-services .key').val('');
|
||||
this.filter('', response.id, true);
|
||||
|
@ -225,7 +225,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
Backend.displayNotification(EALang['service_deleted']);
|
||||
Backend.displayNotification(EALang.service_deleted);
|
||||
|
||||
this.resetForm();
|
||||
this.filter($('#filter-services .key').val());
|
||||
|
@ -254,7 +254,7 @@
|
|||
});
|
||||
|
||||
if (missingRequired) {
|
||||
throw EALang['fields_are_required'];
|
||||
throw EALang.fields_are_required;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -333,7 +333,7 @@
|
|||
$('#filter-services .results').jScrollPane({ mouseWheelSpeed: 70 });
|
||||
|
||||
if (response.length === 0) {
|
||||
$('#filter-services .results').html('<em>' + EALang['no_records_found'] + '</em>');
|
||||
$('#filter-services .results').html('<em>' + EALang.no_records_found + '</em>');
|
||||
}
|
||||
|
||||
if (selectId !== undefined) {
|
||||
|
|
|
@ -209,7 +209,7 @@ window.BackendSettings = window.BackendSettings || {};
|
|||
|
||||
if (response == false) {
|
||||
$input.css('border', '2px solid red');
|
||||
Backend.displayNotification(EALang['username_already_exists']);
|
||||
Backend.displayNotification(EALang.username_already_exists);
|
||||
$input.attr('already-exists', 'true');
|
||||
} else {
|
||||
$input.css('border', '');
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
Backend.displayNotification(EALang['settings_saved']);
|
||||
Backend.displayNotification(EALang.settings_saved);
|
||||
|
||||
// Update the logo title on the header.
|
||||
$('#header-logo span').text($('#company-name').val());
|
||||
|
@ -116,13 +116,13 @@
|
|||
});
|
||||
|
||||
if (missingRequired) {
|
||||
throw EALang['fields_are_required'];
|
||||
throw EALang.fields_are_required;
|
||||
}
|
||||
|
||||
// Validate company email address.
|
||||
if (!GeneralFunctions.validateEmail($('#company-email').val())) {
|
||||
$('#company-email').css('border', '2px solid red');
|
||||
throw EALang['invalid_email'];
|
||||
throw EALang.invalid_email;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
*/
|
||||
UserSettings.prototype.save = function(settings) {
|
||||
if (!this.validate(settings)) {
|
||||
Backend.displayNotification(EALang['user_settings_are_invalid']);
|
||||
Backend.displayNotification(EALang.user_settings_are_invalid);
|
||||
return; // Validation failed, do not proceed.
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
Backend.displayNotification(EALang['settings_saved']);
|
||||
Backend.displayNotification(EALang.settings_saved);
|
||||
|
||||
// Update footer greetings.
|
||||
$('#footer-user-display-name').text('Hello, ' + $('#first-name').val() + ' ' + $('#last-name').val() + '!');
|
||||
|
@ -105,24 +105,24 @@
|
|||
});
|
||||
|
||||
if (missingRequired) {
|
||||
throw EALang['fields_are_required'];
|
||||
throw EALang.fields_are_required;
|
||||
}
|
||||
|
||||
// Validate passwords (if provided).
|
||||
if ($('#password').val() != $('#retype-password').val()) {
|
||||
$('#password, #retype-password').css('border', '2px solid red');
|
||||
throw EALang['passwords_mismatch'];
|
||||
throw EALang.passwords_mismatch;
|
||||
}
|
||||
|
||||
// Validate user email.
|
||||
if (!GeneralFunctions.validateEmail($('#email').val())) {
|
||||
$('#email').css('border', '2px solid red');
|
||||
throw EALang['invalid_email'];
|
||||
throw EALang.invalid_email;
|
||||
}
|
||||
|
||||
if ($('#username').attr('already-exists') === 'true') {
|
||||
$('#username').css('border', '2px solid red');
|
||||
throw EALang['username_already_exists'];
|
||||
throw EALang.username_already_exists;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -215,12 +215,12 @@ window.BackendUsers = window.BackendUsers || {};
|
|||
if (response == false) {
|
||||
$input.css('border', '2px solid red');
|
||||
$input.attr('already-exists', 'true');
|
||||
$input.parents().eq(3).find('.form-message').text(EALang['username_already_exists']);
|
||||
$input.parents().eq(3).find('.form-message').text(EALang.username_already_exists);
|
||||
$input.parents().eq(3).find('.form-message').show();
|
||||
} else {
|
||||
$input.css('border', '');
|
||||
$input.attr('already-exists', 'false');
|
||||
if ($input.parents().eq(3).find('.form-message').text() == EALang['username_already_exists']) {
|
||||
if ($input.parents().eq(3).find('.form-message').text() == EALang.username_already_exists) {
|
||||
$input.parents().eq(3).find('.form-message').hide();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,22 +115,22 @@
|
|||
|
||||
var buttons = [
|
||||
{
|
||||
text: EALang['delete'],
|
||||
text: EALang.delete,
|
||||
click: function() {
|
||||
this.delete(adminId);
|
||||
$('#message_box').dialog('close');
|
||||
}.bind(this)
|
||||
},
|
||||
{
|
||||
text: EALang['cancel'],
|
||||
text: EALang.cancel,
|
||||
click: function() {
|
||||
$('#message_box').dialog('close');
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
GeneralFunctions.displayMessageBox(EALang['delete_admin'],
|
||||
EALang['delete_record_prompt'], buttons);
|
||||
GeneralFunctions.displayMessageBox(EALang.delete_admin,
|
||||
EALang.delete_record_prompt, buttons);
|
||||
}.bind(this));
|
||||
|
||||
/**
|
||||
|
@ -203,7 +203,7 @@
|
|||
if (!GeneralFunctions.handleAjaxExceptions(response)) {
|
||||
return;
|
||||
}
|
||||
Backend.displayNotification(EALang['admin_saved']);
|
||||
Backend.displayNotification(EALang.admin_saved);
|
||||
this.resetForm();
|
||||
$('#filter-admins .key').val('');
|
||||
this.filter('', response.id, true);
|
||||
|
@ -226,7 +226,7 @@
|
|||
if (!GeneralFunctions.handleAjaxExceptions(response)) {
|
||||
return;
|
||||
}
|
||||
Backend.displayNotification(EALang['admin_deleted']);
|
||||
Backend.displayNotification(EALang.admin_deleted);
|
||||
this.resetForm();
|
||||
this.filter($('#filter-admins .key').val());
|
||||
}.bind(this), 'json').fail(GeneralFunctions.ajaxFailureHandler);
|
||||
|
@ -261,25 +261,25 @@
|
|||
// Validate passwords.
|
||||
if ($('#admin-password').val() != $('#admin-password-confirm').val()) {
|
||||
$('#admin-password, #admin-password-confirm').css('border', '2px solid red');
|
||||
throw EALang['passwords_mismatch'];
|
||||
throw EALang.passwords_mismatch;
|
||||
}
|
||||
|
||||
if ($('#admin-password').val().length < BackendUsers.MIN_PASSWORD_LENGTH
|
||||
&& $('#admin-password').val() != '') {
|
||||
$('#admin-password, #admin-password-confirm').css('border', '2px solid red');
|
||||
throw EALang['password_length_notice'].replace('$number', BackendUsers.MIN_PASSWORD_LENGTH);
|
||||
throw EALang.password_length_notice.replace('$number', BackendUsers.MIN_PASSWORD_LENGTH);
|
||||
}
|
||||
|
||||
// Validate user email.
|
||||
if (!GeneralFunctions.validateEmail($('#admin-email').val())) {
|
||||
$('#admin-email').css('border', '2px solid red');
|
||||
throw EALang['invalid_email'];
|
||||
throw EALang.invalid_email;
|
||||
}
|
||||
|
||||
// Check if username exists
|
||||
if ($('#admin-username').attr('already-exists') == 'true') {
|
||||
$('#admin-username').css('border', '2px solid red');
|
||||
throw EALang['username_already_exists'];
|
||||
throw EALang.username_already_exists;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -372,7 +372,7 @@
|
|||
$('#filter-admins .results').jScrollPane({ mouseWheelSpeed: 70 });
|
||||
|
||||
if (response.length == 0) {
|
||||
$('#filter-admins .results').html('<em>' + EALang['no_records_found'] + '</em>')
|
||||
$('#filter-admins .results').html('<em>' + EALang.no_records_found + '</em>')
|
||||
}
|
||||
|
||||
if (selectId != undefined) {
|
||||
|
|
|
@ -127,22 +127,22 @@
|
|||
|
||||
var buttons = [
|
||||
{
|
||||
text: EALang['delete'],
|
||||
text: EALang.delete,
|
||||
click: function() {
|
||||
this.delete(providerId);
|
||||
$('#message_box').dialog('close');
|
||||
}.bind(this)
|
||||
},
|
||||
{
|
||||
text: EALang['cancel'],
|
||||
text: EALang.cancel,
|
||||
click: function() {
|
||||
$('#message_box').dialog('close');
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
GeneralFunctions.displayMessageBox(EALang['delete_provider'],
|
||||
EALang['delete_record_prompt'], buttons);
|
||||
GeneralFunctions.displayMessageBox(EALang.delete_provider,
|
||||
EALang.delete_record_prompt, buttons);
|
||||
}.bind(this));
|
||||
|
||||
/**
|
||||
|
@ -256,7 +256,7 @@
|
|||
if (!GeneralFunctions.handleAjaxExceptions(response)) {
|
||||
return;
|
||||
}
|
||||
Backend.displayNotification(EALang['provider_saved']);
|
||||
Backend.displayNotification(EALang.provider_saved);
|
||||
this.resetForm();
|
||||
$('#filter-providers .key').val('');
|
||||
this.filter('', response.id, true);
|
||||
|
@ -279,7 +279,7 @@
|
|||
if (!GeneralFunctions.handleAjaxExceptions(response)) {
|
||||
return;
|
||||
}
|
||||
Backend.displayNotification(EALang['provider_deleted']);
|
||||
Backend.displayNotification(EALang.provider_deleted);
|
||||
this.resetForm();
|
||||
this.filter($('#filter-providers .key').val());
|
||||
}.bind(this), 'json').fail(GeneralFunctions.ajaxFailureHandler);
|
||||
|
@ -306,31 +306,31 @@
|
|||
}
|
||||
});
|
||||
if (missingRequired) {
|
||||
throw EALang['fields_are_required'];
|
||||
throw EALang.fields_are_required;
|
||||
}
|
||||
|
||||
// Validate passwords.
|
||||
if ($('#provider-password').val() != $('#provider-password-confirm').val()) {
|
||||
$('#provider-password, #provider-password-confirm').css('border', '2px solid red');
|
||||
throw EALang['passwords_mismatch'];
|
||||
throw EALang.passwords_mismatch;
|
||||
}
|
||||
|
||||
if ($('#provider-password').val().length < BackendUsers.MIN_PASSWORD_LENGTH
|
||||
&& $('#provider-password').val() != '') {
|
||||
$('#provider-password, #provider-password-confirm').css('border', '2px solid red');
|
||||
throw EALang['password_length_notice'].replace('$number', BackendUsers.MIN_PASSWORD_LENGTH);
|
||||
throw EALang.password_length_notice.replace('$number', BackendUsers.MIN_PASSWORD_LENGTH);
|
||||
}
|
||||
|
||||
// Validate user email.
|
||||
if (!GeneralFunctions.validateEmail($('#provider-email').val())) {
|
||||
$('#provider-email').css('border', '2px solid red');
|
||||
throw EALang['invalid_email'];
|
||||
throw EALang.invalid_email;
|
||||
}
|
||||
|
||||
// Check if username exists
|
||||
if ($('#provider-username').attr('already-exists') == 'true') {
|
||||
$('#provider-username').css('border', '2px solid red');
|
||||
throw EALang['username_already_exists'];
|
||||
throw EALang.username_already_exists;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -463,7 +463,7 @@
|
|||
$('#filter-providers .results').jScrollPane({ mouseWheelSpeed: 70 });
|
||||
|
||||
if (response.length == 0) {
|
||||
$('#filter-providers .results').html('<em>' + EALang['no_records_found'] + '</em>')
|
||||
$('#filter-providers .results').html('<em>' + EALang.no_records_found + '</em>')
|
||||
}
|
||||
|
||||
if (selectId != undefined) {
|
||||
|
@ -505,13 +505,13 @@
|
|||
*/
|
||||
ProvidersHelper.prototype.editableBreakDay = function($selector) {
|
||||
var weekDays = {};
|
||||
weekDays[EALang['monday']] = 'Monday';
|
||||
weekDays[EALang['tuesday']] = 'Tuesday';
|
||||
weekDays[EALang['wednesday']] = 'Wednesday';
|
||||
weekDays[EALang['thursday']] = 'Thursday';
|
||||
weekDays[EALang['friday']] = 'Friday';
|
||||
weekDays[EALang['saturday']] = 'Saturday';
|
||||
weekDays[EALang['sunday']] = 'Sunday';
|
||||
weekDays[EALang.monday] = 'Monday';
|
||||
weekDays[EALang.tuesday] = 'Tuesday';
|
||||
weekDays[EALang.wednesday] = 'Wednesday';
|
||||
weekDays[EALang.thursday] = 'Thursday';
|
||||
weekDays[EALang.friday] = 'Friday';
|
||||
weekDays[EALang.saturday] = 'Saturday';
|
||||
weekDays[EALang.sunday] = 'Sunday';
|
||||
|
||||
|
||||
$selector.editable(function(value, settings) {
|
||||
|
|
|
@ -119,22 +119,22 @@
|
|||
var secretaryId = $('#secretary-id').val();
|
||||
var buttons = [
|
||||
{
|
||||
text: EALang['delete'],
|
||||
text: EALang.delete,
|
||||
click: function() {
|
||||
this.delete(secretaryId);
|
||||
$('#message_box').dialog('close');
|
||||
}.bind(this)
|
||||
},
|
||||
{
|
||||
text: EALang['cancel'],
|
||||
text: EALang.cancel,
|
||||
click: function() {
|
||||
$('#message_box').dialog('close');
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
GeneralFunctions.displayMessageBox(EALang['delete_secretary'],
|
||||
EALang['delete_record_prompt'], buttons);
|
||||
GeneralFunctions.displayMessageBox(EALang.delete_secretary,
|
||||
EALang.delete_record_prompt, buttons);
|
||||
}.bind(this));
|
||||
|
||||
/**
|
||||
|
@ -215,7 +215,7 @@
|
|||
if (!GeneralFunctions.handleAjaxExceptions(response)) {
|
||||
return;
|
||||
}
|
||||
Backend.displayNotification(EALang['secretary_saved']);
|
||||
Backend.displayNotification(EALang.secretary_saved);
|
||||
this.resetForm();
|
||||
$('#filter-secretaries .key').val('');
|
||||
this.filter('', response.id, true);
|
||||
|
@ -238,7 +238,7 @@
|
|||
if (!GeneralFunctions.handleAjaxExceptions(response)) {
|
||||
return;
|
||||
}
|
||||
Backend.displayNotification(EALang['secretary_deleted']);
|
||||
Backend.displayNotification(EALang.secretary_deleted);
|
||||
this.resetForm();
|
||||
this.filter($('#filter-secretaries .key').val());
|
||||
}.bind(this), 'json').fail(GeneralFunctions.ajaxFailureHandler);
|
||||
|
@ -393,7 +393,7 @@
|
|||
$('#filter-secretaries .results').jScrollPane({ mouseWheelSpeed: 70 });
|
||||
|
||||
if (response.length == 0) {
|
||||
$('#filter-secretaries .results').html('<em>' + EALang['no_records_found'] + '</em>')
|
||||
$('#filter-secretaries .results').html('<em>' + EALang.no_records_found + '</em>')
|
||||
}
|
||||
|
||||
if (selectId != undefined) {
|
||||
|
|
|
@ -67,23 +67,23 @@ window.FrontendBook = window.FrontendBook || {};
|
|||
defaultDate: Date.today(),
|
||||
|
||||
dayNames: [
|
||||
EALang['sunday'], EALang['monday'], EALang['tuesday'], EALang['wednesday'],
|
||||
EALang['thursday'], EALang['friday'], EALang['saturday']],
|
||||
dayNamesShort: [EALang['sunday'].substr(0,3), EALang['monday'].substr(0,3),
|
||||
EALang['tuesday'].substr(0,3), EALang['wednesday'].substr(0,3),
|
||||
EALang['thursday'].substr(0,3), EALang['friday'].substr(0,3),
|
||||
EALang['saturday'].substr(0,3)],
|
||||
dayNamesMin: [EALang['sunday'].substr(0,2), EALang['monday'].substr(0,2),
|
||||
EALang['tuesday'].substr(0,2), EALang['wednesday'].substr(0,2),
|
||||
EALang['thursday'].substr(0,2), EALang['friday'].substr(0,2),
|
||||
EALang['saturday'].substr(0,2)],
|
||||
monthNames: [EALang['january'], EALang['february'], EALang['march'], EALang['april'],
|
||||
EALang['may'], EALang['june'], EALang['july'], EALang['august'], EALang['september'],
|
||||
EALang['october'], EALang['november'], EALang['december']],
|
||||
prevText: EALang['previous'],
|
||||
nextText: EALang['next'],
|
||||
currentText: EALang['now'],
|
||||
closeText: EALang['close'],
|
||||
EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday,
|
||||
EALang.thursday, EALang.friday, EALang.saturday],
|
||||
dayNamesShort: [EALang.sunday.substr(0,3), EALang.monday.substr(0,3),
|
||||
EALang.tuesday.substr(0,3), EALang.wednesday.substr(0,3),
|
||||
EALang.thursday.substr(0,3), EALang.friday.substr(0,3),
|
||||
EALang.saturday.substr(0,3)],
|
||||
dayNamesMin: [EALang.sunday.substr(0,2), EALang.monday.substr(0,2),
|
||||
EALang.tuesday.substr(0,2), EALang.wednesday.substr(0,2),
|
||||
EALang.thursday.substr(0,2), EALang.friday.substr(0,2),
|
||||
EALang.saturday.substr(0,2)],
|
||||
monthNames: [EALang.january, EALang.february, EALang.march, EALang.april,
|
||||
EALang.may, EALang.june, EALang.july, EALang.august, EALang.september,
|
||||
EALang.october, EALang.november, EALang.december],
|
||||
prevText: EALang.previous,
|
||||
nextText: EALang.next,
|
||||
currentText: EALang.now,
|
||||
closeText: EALang.close,
|
||||
|
||||
onSelect: function(dateText, instance) {
|
||||
FrontendBookApi.getAvailableHours(dateText);
|
||||
|
@ -184,7 +184,7 @@ window.FrontendBook = window.FrontendBook || {};
|
|||
|
||||
// Add the "Any Provider" entry.
|
||||
if ($('#select-provider option').length >= 1) {
|
||||
$('#select-provider').append(new Option('- ' +EALang['any_provider'] + ' -', 'any-provider'));
|
||||
$('#select-provider').append(new Option('- ' + EALang.any_provider + ' -', 'any-provider'));
|
||||
}
|
||||
|
||||
FrontendBookApi.getUnavailableDates($('#select-provider').val(), $(this).val(),
|
||||
|
@ -213,7 +213,7 @@ window.FrontendBook = window.FrontendBook || {};
|
|||
if ($('#select-hour-prompt').length == 0) {
|
||||
$('#available-hours').append('<br><br>'
|
||||
+ '<span id="select-hour-prompt" class="text-danger">'
|
||||
+ EALang['appointment_hour_missing']
|
||||
+ EALang.appointment_hour_missing
|
||||
+ '</span>');
|
||||
}
|
||||
return;
|
||||
|
@ -289,12 +289,12 @@ window.FrontendBook = window.FrontendBook || {};
|
|||
$('#cancel-appointment-form').submit();
|
||||
};
|
||||
|
||||
dialogButtons[EALang['cancel']] = function() {
|
||||
dialogButtons[EALang.cancel] = function() {
|
||||
$('#message_box').dialog('close');
|
||||
};
|
||||
|
||||
GeneralFunctions.displayMessageBox(EALang['cancel_appointment_title'],
|
||||
EALang['write_appointment_removal_reason'], dialogButtons);
|
||||
GeneralFunctions.displayMessageBox(EALang.cancel_appointment_title,
|
||||
EALang.write_appointment_removal_reason, dialogButtons);
|
||||
|
||||
$('#message_box').append('<textarea id="cancel-reason" rows="3"></textarea>');
|
||||
$('#cancel-reason').css('width', '100%');
|
||||
|
@ -352,14 +352,14 @@ window.FrontendBook = window.FrontendBook || {};
|
|||
}
|
||||
});
|
||||
if (missingRequiredField) {
|
||||
throw EALang['fields_are_required'];
|
||||
throw EALang.fields_are_required;
|
||||
}
|
||||
|
||||
// Validate email address.
|
||||
if (!GeneralFunctions.validateEmail($('#email').val())) {
|
||||
$('#email').parents('.form-group').addClass('has-error');
|
||||
// $('#email').css('border', '2px solid red');
|
||||
throw EALang['invalid_email'];
|
||||
throw EALang.invalid_email;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -417,15 +417,15 @@ window.FrontendBook = window.FrontendBook || {};
|
|||
html =
|
||||
'<h4>' + firstName + ' ' + lastName + '</h4>' +
|
||||
'<p>' +
|
||||
EALang['phone'] + ': ' + phoneNumber +
|
||||
EALang.phone + ': ' + phoneNumber +
|
||||
'<br/>' +
|
||||
EALang['email'] + ': ' + email +
|
||||
EALang.email + ': ' + email +
|
||||
'<br/>' +
|
||||
EALang['address'] + ': ' + address +
|
||||
EALang.address + ': ' + address +
|
||||
'<br/>' +
|
||||
EALang['city'] + ': ' + city +
|
||||
EALang.city + ': ' + city +
|
||||
'<br/>' +
|
||||
EALang['zip_code'] + ': ' + zipCode +
|
||||
EALang.zip_code + ': ' + zipCode +
|
||||
'</p>';
|
||||
|
||||
$('#customer-details').html(html);
|
||||
|
@ -558,12 +558,12 @@ window.FrontendBook = window.FrontendBook || {};
|
|||
}
|
||||
|
||||
if (service.duration != '' && service.duration != null) {
|
||||
html += '[' + EALang['duration'] + ' ' + service.duration
|
||||
+ ' ' + EALang['minutes'] + '] ';
|
||||
html += '[' + EALang.duration + ' ' + service.duration
|
||||
+ ' ' + EALang.minutes'] + ';
|
||||
}
|
||||
|
||||
if (service.price != '' && service.price != null) {
|
||||
html += '[' + EALang['price'] + ' ' + service.price + ' ' + service.currency + ']';
|
||||
html += '[' + EALang.price + ' ' + service.price + ' ' + service.currency + ']';
|
||||
}
|
||||
|
||||
html += '<br>';
|
||||
|
|
|
@ -97,7 +97,7 @@ window.FrontendBookApi = window.FrontendBookApi || {};
|
|||
FrontendBook.updateConfirmFrame();
|
||||
|
||||
} else {
|
||||
$('#available-hours').text(EALang['no_available_hours']);
|
||||
$('#available-hours').text(EALang.no_available_hours);
|
||||
}
|
||||
}, 'json').fail(GeneralFunctions.ajaxFailureHandler);
|
||||
};
|
||||
|
@ -163,7 +163,7 @@ window.FrontendBookApi = window.FrontendBookApi || {};
|
|||
|
||||
if (response.captcha_verification === false) {
|
||||
$('#captcha-hint')
|
||||
.text(EALang['captcha_is_wrong'] + '(' + response.expected_phrase + ')')
|
||||
.text(EALang.captcha_is_wrong + '(' + response.expected_phrase + ')')
|
||||
.fadeTo(400, 1);
|
||||
|
||||
setTimeout(function() {
|
||||
|
@ -253,7 +253,7 @@ window.FrontendBookApi = window.FrontendBookApi || {};
|
|||
|
||||
// If all the days are unavailable then hide the appointments hours.
|
||||
if (unavailableDates.length === numberOfDays) {
|
||||
$('#available-hours').text(EALang['no_available_hours']);
|
||||
$('#available-hours').text(EALang.no_available_hours);
|
||||
}
|
||||
|
||||
// Grey out unavailable dates.
|
||||
|
|
|
@ -85,12 +85,12 @@ $(document).ready(function() {
|
|||
$('#success-frame').append(
|
||||
'<br><br>' +
|
||||
'<div class="alert alert-success col-xs-12">' +
|
||||
'<h4>' + EALang['success'] + '</h4>' +
|
||||
'<h4>' + EALang.success + '</h4>' +
|
||||
'<p>' +
|
||||
EALang['appointment_added_to_google_calendar'] +
|
||||
EALang.appointment_added_to_google_calendar +
|
||||
'<br>' +
|
||||
'<a href="' + response.htmlLink + '" target="_blank">' +
|
||||
EALang['view_appointment_in_google_calendar'] +
|
||||
EALang.view_appointment_in_google_calendar +
|
||||
'</a>' +
|
||||
'</p>' +
|
||||
'</div>'
|
||||
|
@ -102,9 +102,9 @@ $(document).ready(function() {
|
|||
// The user denied access or something else happened, display corresponding message on the screen.
|
||||
$('#success-frame').append(
|
||||
'<div class="alert alert-danger col-xs-12">' +
|
||||
'<h4>' + EALang['oops_something_went_wrong'] + '</h4>' +
|
||||
'<h4>' + EALang.oops_something_went_wrong + '</h4>' +
|
||||
'<p>' +
|
||||
EALang['could_not_add_to_google_calendar'] +
|
||||
EALang.could_not_add_to_google_calendar +
|
||||
'<pre>' + exc + '</pre>' +
|
||||
'</p>' +
|
||||
'</div>');
|
||||
|
|
|
@ -25,10 +25,10 @@ window.GeneralFunctions = window.GeneralFunctions || {};
|
|||
/**
|
||||
* General Functions Constants
|
||||
*/
|
||||
exports.EXCEPTIONS_TITLE = EALang['unexpected_issues'];
|
||||
exports.EXCEPTIONS_MESSAGE = EALang['unexpected_issues_message'];
|
||||
exports.WARNINGS_TITLE = EALang['unexpected_warnings'];
|
||||
exports.WARNINGS_MESSAGE = EALang['unexpected_warnings_message'];
|
||||
exports.EXCEPTIONS_TITLE = EALang.unexpected_issues;
|
||||
exports.EXCEPTIONS_MESSAGE = EALang.unexpected_issues_message;
|
||||
exports.WARNINGS_TITLE = EALang.unexpected_warnings;
|
||||
exports.WARNINGS_MESSAGE = EALang.unexpected_warnings_message;
|
||||
|
||||
/**
|
||||
* This functions displays a message box in the admin array. It is useful when user
|
||||
|
@ -50,7 +50,7 @@ window.GeneralFunctions = window.GeneralFunctions || {};
|
|||
|
||||
if (messageButtons == undefined) {
|
||||
messageButtons = {};
|
||||
messageButtons[EALang['close']] = function() {
|
||||
messageButtons[EALang.close] = function() {
|
||||
$('#message_box').dialog('close');
|
||||
};
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ window.GeneralFunctions = window.GeneralFunctions || {};
|
|||
'<div class="accordion-heading">' +
|
||||
'<a class="accordion-toggle" data-toggle="collapse" ' +
|
||||
'data-parent="#error-accordion" href="#error-technical">' +
|
||||
EALang['details'] +
|
||||
EALang.details +
|
||||
'</a>' +
|
||||
'</div>';
|
||||
|
||||
|
|
|
@ -61,16 +61,16 @@
|
|||
'<td class="break-start editable">' + brk.start + '</td>' +
|
||||
'<td class="break-end editable">' + brk.end + '</td>' +
|
||||
'<td>' +
|
||||
'<button type="button" class="btn btn-default btn-sm edit-break" title="' + EALang['edit'] + '">' +
|
||||
'<button type="button" class="btn btn-default btn-sm edit-break" title="' + EALang.edit + '">' +
|
||||
'<span class="glyphicon glyphicon-pencil"></span>' +
|
||||
'</button>' +
|
||||
'<button type="button" class="btn btn-default btn-sm delete-break" title="' + EALang['delete'] + '">' +
|
||||
'<button type="button" class="btn btn-default btn-sm delete-break" title="' + EALang.delete + '">' +
|
||||
'<span class="glyphicon glyphicon-remove"></span>' +
|
||||
'</button>' +
|
||||
'<button type="button" class="btn btn-default btn-sm save-break hidden" title="' + EALang['save'] + '">' +
|
||||
'<button type="button" class="btn btn-default btn-sm save-break hidden" title="' + EALang.save + '">' +
|
||||
'<span class="glyphicon glyphicon-ok"></span>' +
|
||||
'</button>' +
|
||||
'<button type="button" class="btn btn-default btn-sm cancel-break hidden" title="' + EALang['cancel'] + '">' +
|
||||
'<button type="button" class="btn btn-default btn-sm cancel-break hidden" title="' + EALang.cancel + '">' +
|
||||
'<span class="glyphicon glyphicon-ban-circle"></span>' +
|
||||
'</button>' +
|
||||
'</td>' +
|
||||
|
@ -98,13 +98,13 @@
|
|||
*/
|
||||
WorkingPlan.prototype.editableBreakDay = function($selector) {
|
||||
var weekDays = {};
|
||||
weekDays[EALang['monday']] = EALang['monday']; //'Monday';
|
||||
weekDays[EALang['tuesday']] = EALang['tuesday']; //'Tuesday';
|
||||
weekDays[EALang['wednesday']] = EALang['wednesday']; //'Wednesday';
|
||||
weekDays[EALang['thursday']] = EALang['thursday']; //'Thursday';
|
||||
weekDays[EALang['friday']] = EALang['friday']; //'Friday';
|
||||
weekDays[EALang['saturday']] = EALang['saturday']; //'Saturday';
|
||||
weekDays[EALang['sunday']] = EALang['sunday']; //'Sunday';
|
||||
weekDays[EALang.monday] = EALang.monday; //'Monday';
|
||||
weekDays[EALang.tuesday] = EALang.tuesday; //'Tuesday';
|
||||
weekDays[EALang.wednesday] = EALang.wednesday; //'Wednesday';
|
||||
weekDays[EALang.thursday] = EALang.thursday; //'Thursday';
|
||||
weekDays[EALang.friday] = EALang.friday; //'Friday';
|
||||
weekDays[EALang.saturday] = EALang.saturday; //'Saturday';
|
||||
weekDays[EALang.sunday] = EALang.sunday; //'Sunday';
|
||||
|
||||
$selector.editable(function(value, settings) {
|
||||
return value;
|
||||
|
@ -189,20 +189,20 @@
|
|||
$('.add-break').click(function() {
|
||||
var tr =
|
||||
'<tr>' +
|
||||
'<td class="break-day editable">' + EALang['monday'] + '</td>' +
|
||||
'<td class="break-day editable">' + EALang.monday + '</td>' +
|
||||
'<td class="break-start editable">09:00</td>' +
|
||||
'<td class="break-end editable">10:00</td>' +
|
||||
'<td>' +
|
||||
'<button type="button" class="btn btn-default btn-sm edit-break" title="' + EALang['edit'] + '">' +
|
||||
'<button type="button" class="btn btn-default btn-sm edit-break" title="' + EALang.edit + '">' +
|
||||
'<span class="glyphicon glyphicon-pencil"></span>' +
|
||||
'</button>' +
|
||||
'<button type="button" class="btn btn-default btn-sm delete-break" title="' + EALang['delete'] + '">' +
|
||||
'<button type="button" class="btn btn-default btn-sm delete-break" title="' + EALang.delete + '">' +
|
||||
'<span class="glyphicon glyphicon-remove"></span>' +
|
||||
'</button>' +
|
||||
'<button type="button" class="btn btn-default btn-sm save-break hidden" title="' + EALang['save'] + '">' +
|
||||
'<button type="button" class="btn btn-default btn-sm save-break hidden" title="' + EALang.save + '">' +
|
||||
'<span class="glyphicon glyphicon-ok"></span>' +
|
||||
'</button>' +
|
||||
'<button type="button" class="btn btn-default btn-sm cancel-break hidden" title="' + EALang['cancel'] + '">' +
|
||||
'<button type="button" class="btn btn-default btn-sm cancel-break hidden" title="' + EALang.cancel + '">' +
|
||||
'<span class="glyphicon glyphicon-ban-circle"></span>' +
|
||||
'</button>' +
|
||||
'</td>' +
|
||||
|
@ -234,12 +234,12 @@
|
|||
// Make all cells in current row editable.
|
||||
$(this).parent().parent().children().trigger('edit');
|
||||
$(this).parent().parent().find('.break-start input, .break-end input').timepicker({
|
||||
currentText: EALang['now'],
|
||||
closeText: EALang['close'],
|
||||
timeOnlyTitle: EALang['select_time'],
|
||||
timeText: EALang['time'],
|
||||
hourText: EALang['hour'],
|
||||
minuteText: EALang['minutes']
|
||||
currentText: EALang.now,
|
||||
closeText: EALang.close,
|
||||
timeOnlyTitle: EALang.select_time,
|
||||
timeText: EALang.time,
|
||||
hourText: EALang.hour,
|
||||
minuteText: EALang.minutes
|
||||
});
|
||||
$(this).parent().parent().find('.break-day select').focus();
|
||||
|
||||
|
@ -359,12 +359,12 @@
|
|||
$('.working-plan input[type="text"]').timepicker({
|
||||
timeFormat: 'HH:mm',
|
||||
|
||||
currentText: EALang['now'],
|
||||
closeText: EALang['close'],
|
||||
timeOnlyTitle: EALang['select_time'],
|
||||
timeText: EALang['time'],
|
||||
hourText: EALang['hour'],
|
||||
minuteText: EALang['minutes'],
|
||||
currentText: EALang.now,
|
||||
closeText: EALang.close,
|
||||
timeOnlyTitle: EALang.select_time,
|
||||
timeText: EALang.time,
|
||||
hourText: EALang.hour,
|
||||
minuteText: EALang.minutes,
|
||||
|
||||
onSelect: function(datetime, inst) {
|
||||
// Start time must be earlier than end time.
|
||||
|
@ -396,26 +396,19 @@
|
|||
WorkingPlan.prototype.convertValueToDay = function(value) {
|
||||
switch (value) {
|
||||
case 'monday':
|
||||
return EALang['monday'];
|
||||
break;
|
||||
return EALang.monday;
|
||||
case 'tuesday':
|
||||
return EALang['tuesday'];
|
||||
break;
|
||||
return EALang.tuesday;
|
||||
case 'wednesday':
|
||||
return EALang['wednesday'];
|
||||
break;
|
||||
return EALang.wednesday;
|
||||
case 'thursday':
|
||||
return EALang['thursday'];
|
||||
break;
|
||||
return EALang.thursday;
|
||||
case 'friday':
|
||||
return EALang['friday'];
|
||||
break;
|
||||
return EALang.friday;
|
||||
case 'saturday':
|
||||
return EALang['saturday'];
|
||||
break;
|
||||
return EALang.saturday;
|
||||
case 'sunday':
|
||||
return EALang['sunday'];
|
||||
break;
|
||||
return EALang.sunday;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -426,27 +419,20 @@
|
|||
*/
|
||||
WorkingPlan.prototype.convertDayToValue = function(day) {
|
||||
switch (day) {
|
||||
case EALang['monday']:
|
||||
case EALang.monday:
|
||||
return 'monday';
|
||||
break;
|
||||
case EALang['tuesday']:
|
||||
case EALang.tuesday:
|
||||
return 'tuesday';
|
||||
break;
|
||||
case EALang['wednesday']:
|
||||
case EALang.wednesday:
|
||||
return 'wednesday';
|
||||
break;
|
||||
case EALang['thursday']:
|
||||
case EALang.thursday:
|
||||
return 'thursday';
|
||||
break;
|
||||
case EALang['friday']:
|
||||
case EALang.friday:
|
||||
return 'friday';
|
||||
break;
|
||||
case EALang['saturday']:
|
||||
case EALang.saturday:
|
||||
return 'saturday';
|
||||
break;
|
||||
case EALang['sunday']:
|
||||
case EALang.sunday:
|
||||
return 'sunday';
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue