mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-25 09:23:08 +03:00
Merge branch 'develop' of github.com:alextselegidis/easyappointments into develop
This commit is contained in:
commit
10bc62de9f
4 changed files with 23 additions and 36 deletions
|
@ -72,7 +72,7 @@
|
|||
<span class="glyphicon glyphicon-plus"></span>
|
||||
<?= lang('appointment') ?>
|
||||
</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="sr-only">Toggle Dropdown</span>
|
||||
</button>
|
||||
|
|
|
@ -224,11 +224,11 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
$('#select-filter-item').change(function () {
|
||||
// If current value is service, then the sync buttons must be disabled.
|
||||
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', 'editable', false);
|
||||
} 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', 'editable', true);
|
||||
|
||||
|
@ -363,14 +363,6 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
&& GlobalVariables.user.privileges.appointments.delete === true)
|
||||
? '' : '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': [
|
||||
$('<strong/>', {
|
||||
|
|
|
@ -59,40 +59,35 @@ window.BackendCalendarExtraPeriodsModal = window.BackendCalendarExtraPeriodsModa
|
|||
|
||||
var successCallback = function (response) {
|
||||
// Display success message to the user.
|
||||
$dialog.find('.modal-message')
|
||||
.text(EALang.extra_period_saved)
|
||||
.addClass('alert-success')
|
||||
.removeClass('alert-danger hidden');
|
||||
Backend.displayNotification(EALang.extra_period_saved);
|
||||
|
||||
// Close the modal dialog and refresh the calendar appointments after one second.
|
||||
setTimeout(function () {
|
||||
$dialog.find('.alert').addClass('hidden');
|
||||
$dialog.modal('hide');
|
||||
// Close the modal dialog and refresh the calendar appointments.
|
||||
$dialog.find('.alert').addClass('hidden');
|
||||
$dialog.modal('hide');
|
||||
|
||||
var providerId = $('#extra-provider').val();
|
||||
var provider = GlobalVariables.availableProviders.filter(function (p) {
|
||||
return p.id === providerId;
|
||||
})[0];
|
||||
var providerIdx = GlobalVariables.availableProviders.indexOf(provider);
|
||||
var providerId = $('#extra-provider').val();
|
||||
var provider = GlobalVariables.availableProviders.filter(function (p) {
|
||||
return p.id === providerId;
|
||||
})[0];
|
||||
var providerIdx = GlobalVariables.availableProviders.indexOf(provider);
|
||||
|
||||
var extraWorkingPlan = jQuery.parseJSON(provider.settings.extra_working_plan);
|
||||
extraWorkingPlan[start.toString('yyyy-MM-dd')] = {
|
||||
start: start.toString('HH:mm'),
|
||||
end: end.toString('HH:mm'),
|
||||
breaks: []
|
||||
};
|
||||
provider.settings.extra_working_plan = JSON.stringify(extraWorkingPlan);
|
||||
GlobalVariables.availableProviders[providerIdx] = provider;
|
||||
var extraWorkingPlan = jQuery.parseJSON(provider.settings.extra_working_plan);
|
||||
extraWorkingPlan[start.toString('yyyy-MM-dd')] = {
|
||||
start: start.toString('HH:mm'),
|
||||
end: end.toString('HH:mm'),
|
||||
breaks: []
|
||||
};
|
||||
provider.settings.extra_working_plan = JSON.stringify(extraWorkingPlan);
|
||||
GlobalVariables.availableProviders[providerIdx] = provider;
|
||||
|
||||
$('#select-filter-item').trigger('change');
|
||||
}, 2000);
|
||||
$('#select-filter-item').trigger('change');
|
||||
};
|
||||
|
||||
var errorCallback = function (jqXHR, textStatus, errorThrown) {
|
||||
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').text(EALang.service_communication_error);
|
||||
$dialog.find('.modal-message').addClass('alert-danger').removeClass('hidden');
|
||||
};
|
||||
|
||||
|
|
|
@ -313,7 +313,7 @@ window.GeneralFunctions = window.GeneralFunctions || {};
|
|||
return;
|
||||
}
|
||||
|
||||
GeneralFunctions.displayMessageBox(EALang.unexpected_issues, EALang.unexpected_issues_message, []);
|
||||
GeneralFunctions.displayMessageBox(EALang.unexpected_issues, EALang.unexpected_issues_message);
|
||||
|
||||
$('<div/>', {
|
||||
'class': 'well',
|
||||
|
|
Loading…
Reference in a new issue