Merge branch 'develop' of github.com:alextselegidis/easyappointments into develop

This commit is contained in:
Alex Tselegidis 2020-08-15 16:58:05 +03:00
commit 10bc62de9f
4 changed files with 23 additions and 36 deletions

View file

@ -72,7 +72,7 @@
<span class="glyphicon glyphicon-plus"></span> <span class="glyphicon glyphicon-plus"></span>
<?= lang('appointment') ?> <?= lang('appointment') ?>
</button> </button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <button type="button" id="insert-dropdown" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span> <span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span> <span class="sr-only">Toggle Dropdown</span>
</button> </button>

View file

@ -224,11 +224,11 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
$('#select-filter-item').change(function () { $('#select-filter-item').change(function () {
// If current value is service, then the sync buttons must be disabled. // If current value is service, then the sync buttons must be disabled.
if ($('#select-filter-item option:selected').attr('type') === FILTER_TYPE_SERVICE) { if ($('#select-filter-item option:selected').attr('type') === FILTER_TYPE_SERVICE) {
$('#google-sync, #enable-sync, #insert-appointment, #insert-unavailable').prop('disabled', true); $('#google-sync, #enable-sync, #insert-appointment, #insert-dropdown').prop('disabled', true);
$('#calendar').fullCalendar('option', 'selectable', false); $('#calendar').fullCalendar('option', 'selectable', false);
$('#calendar').fullCalendar('option', 'editable', false); $('#calendar').fullCalendar('option', 'editable', false);
} else { } else {
$('#google-sync, #enable-sync, #insert-appointment, #insert-unavailable').prop('disabled', false); $('#google-sync, #enable-sync, #insert-appointment, #insert-dropdown').prop('disabled', false);
$('#calendar').fullCalendar('option', 'selectable', true); $('#calendar').fullCalendar('option', 'selectable', true);
$('#calendar').fullCalendar('option', 'editable', true); $('#calendar').fullCalendar('option', 'editable', true);
@ -363,14 +363,6 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
&& GlobalVariables.user.privileges.appointments.delete === true) && GlobalVariables.user.privileges.appointments.delete === true)
? '' : 'hide'; // Same value at the time. ? '' : 'hide'; // Same value at the time.
var provider = '';
if (event.data) { // Only custom unavailable periods have notes.
provider = '<strong>' + EALang.provider + '</strong> ' + event.data.first_name + ' ' + event.data.last_name;
}
var extraPeriod = jQuery.parseJSON(event.data.settings.extra_working_plan)[event.start.format()];
$html = $('<div/>', { $html = $('<div/>', {
'html': [ 'html': [
$('<strong/>', { $('<strong/>', {

View file

@ -59,40 +59,35 @@ window.BackendCalendarExtraPeriodsModal = window.BackendCalendarExtraPeriodsModa
var successCallback = function (response) { var successCallback = function (response) {
// Display success message to the user. // Display success message to the user.
$dialog.find('.modal-message') Backend.displayNotification(EALang.extra_period_saved);
.text(EALang.extra_period_saved)
.addClass('alert-success')
.removeClass('alert-danger hidden');
// Close the modal dialog and refresh the calendar appointments after one second. // Close the modal dialog and refresh the calendar appointments.
setTimeout(function () { $dialog.find('.alert').addClass('hidden');
$dialog.find('.alert').addClass('hidden'); $dialog.modal('hide');
$dialog.modal('hide');
var providerId = $('#extra-provider').val(); var providerId = $('#extra-provider').val();
var provider = GlobalVariables.availableProviders.filter(function (p) { var provider = GlobalVariables.availableProviders.filter(function (p) {
return p.id === providerId; return p.id === providerId;
})[0]; })[0];
var providerIdx = GlobalVariables.availableProviders.indexOf(provider); var providerIdx = GlobalVariables.availableProviders.indexOf(provider);
var extraWorkingPlan = jQuery.parseJSON(provider.settings.extra_working_plan); var extraWorkingPlan = jQuery.parseJSON(provider.settings.extra_working_plan);
extraWorkingPlan[start.toString('yyyy-MM-dd')] = { extraWorkingPlan[start.toString('yyyy-MM-dd')] = {
start: start.toString('HH:mm'), start: start.toString('HH:mm'),
end: end.toString('HH:mm'), end: end.toString('HH:mm'),
breaks: [] breaks: []
}; };
provider.settings.extra_working_plan = JSON.stringify(extraWorkingPlan); provider.settings.extra_working_plan = JSON.stringify(extraWorkingPlan);
GlobalVariables.availableProviders[providerIdx] = provider; GlobalVariables.availableProviders[providerIdx] = provider;
$('#select-filter-item').trigger('change'); $('#select-filter-item').trigger('change');
}, 2000);
}; };
var errorCallback = function (jqXHR, textStatus, errorThrown) { var errorCallback = function (jqXHR, textStatus, errorThrown) {
GeneralFunctions.displayMessageBox('Communication Error', 'Unfortunately ' + GeneralFunctions.displayMessageBox('Communication Error', 'Unfortunately ' +
'the operation could not complete due to server communication errors.'); 'the operation could not complete due to server communication errors.');
$dialog.find('.modal-message').txt(EALang.service_communication_error); $dialog.find('.modal-message').text(EALang.service_communication_error);
$dialog.find('.modal-message').addClass('alert-danger').removeClass('hidden'); $dialog.find('.modal-message').addClass('alert-danger').removeClass('hidden');
}; };

View file

@ -313,7 +313,7 @@ window.GeneralFunctions = window.GeneralFunctions || {};
return; return;
} }
GeneralFunctions.displayMessageBox(EALang.unexpected_issues, EALang.unexpected_issues_message, []); GeneralFunctions.displayMessageBox(EALang.unexpected_issues, EALang.unexpected_issues_message);
$('<div/>', { $('<div/>', {
'class': 'well', 'class': 'well',