diff --git a/application/language/arabic/translations_lang.php b/application/language/arabic/translations_lang.php index 71cbe75f..21d0f4d4 100755 --- a/application/language/arabic/translations_lang.php +++ b/application/language/arabic/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/bulgarian/translations_lang.php b/application/language/bulgarian/translations_lang.php index 6bb6673e..be87b554 100755 --- a/application/language/bulgarian/translations_lang.php +++ b/application/language/bulgarian/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/catalan/translations_lang.php b/application/language/catalan/translations_lang.php index a96eea57..98c761c1 100644 --- a/application/language/catalan/translations_lang.php +++ b/application/language/catalan/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/chinese/translations_lang.php b/application/language/chinese/translations_lang.php index 7d619690..3affba17 100755 --- a/application/language/chinese/translations_lang.php +++ b/application/language/chinese/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/czech/translations_lang.php b/application/language/czech/translations_lang.php index 4ac70b76..2737604b 100644 --- a/application/language/czech/translations_lang.php +++ b/application/language/czech/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/danish/translations_lang.php b/application/language/danish/translations_lang.php index 20391b85..90bfcb08 100755 --- a/application/language/danish/translations_lang.php +++ b/application/language/danish/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/dutch/translations_lang.php b/application/language/dutch/translations_lang.php index e5b5d218..ba7388ae 100755 --- a/application/language/dutch/translations_lang.php +++ b/application/language/dutch/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/english/translations_lang.php b/application/language/english/translations_lang.php index 045ccef9..1f2446dd 100755 --- a/application/language/english/translations_lang.php +++ b/application/language/english/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/finnish/translations_lang.php b/application/language/finnish/translations_lang.php index 6f125902..2c0c943d 100755 --- a/application/language/finnish/translations_lang.php +++ b/application/language/finnish/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/french/translations_lang.php b/application/language/french/translations_lang.php index 1684b3a5..b51f0c36 100755 --- a/application/language/french/translations_lang.php +++ b/application/language/french/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/greek/translations_lang.php b/application/language/greek/translations_lang.php index 0a843348..7d3fdb28 100755 --- a/application/language/greek/translations_lang.php +++ b/application/language/greek/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/hebrew/translations_lang.php b/application/language/hebrew/translations_lang.php index 44517703..43aa9c70 100644 --- a/application/language/hebrew/translations_lang.php +++ b/application/language/hebrew/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/hindi/translations_lang.php b/application/language/hindi/translations_lang.php index 918cb6b2..21612ba0 100755 --- a/application/language/hindi/translations_lang.php +++ b/application/language/hindi/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/hungarian/translations_lang.php b/application/language/hungarian/translations_lang.php index 7b9c1e98..9a9e8e21 100755 --- a/application/language/hungarian/translations_lang.php +++ b/application/language/hungarian/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/italian/translations_lang.php b/application/language/italian/translations_lang.php index fbd7612a..17ff29c8 100755 --- a/application/language/italian/translations_lang.php +++ b/application/language/italian/translations_lang.php @@ -363,4 +363,6 @@ $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['copy'] = 'Copy'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/japanese/translations_lang.php b/application/language/japanese/translations_lang.php index 281d1bb4..5acbf099 100755 --- a/application/language/japanese/translations_lang.php +++ b/application/language/japanese/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/luxembourgish/translations_lang.php b/application/language/luxembourgish/translations_lang.php index e34692f9..4879ecf7 100755 --- a/application/language/luxembourgish/translations_lang.php +++ b/application/language/luxembourgish/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/marathi/translations_lang.php b/application/language/marathi/translations_lang.php index 415d14cb..430b5451 100644 --- a/application/language/marathi/translations_lang.php +++ b/application/language/marathi/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/polish/translations_lang.php b/application/language/polish/translations_lang.php index a8522fb2..84c6eac5 100755 --- a/application/language/polish/translations_lang.php +++ b/application/language/polish/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/portuguese-br/translations_lang.php b/application/language/portuguese-br/translations_lang.php index ef5e4a46..d7c6f658 100755 --- a/application/language/portuguese-br/translations_lang.php +++ b/application/language/portuguese-br/translations_lang.php @@ -361,4 +361,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/portuguese/translations_lang.php b/application/language/portuguese/translations_lang.php index 54b7171a..31415318 100755 --- a/application/language/portuguese/translations_lang.php +++ b/application/language/portuguese/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/romanian/translations_lang.php b/application/language/romanian/translations_lang.php index cb25a330..80a2198c 100755 --- a/application/language/romanian/translations_lang.php +++ b/application/language/romanian/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/russian/translations_lang.php b/application/language/russian/translations_lang.php index ec32975f..18a2aa65 100755 --- a/application/language/russian/translations_lang.php +++ b/application/language/russian/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/slovak/translations_lang.php b/application/language/slovak/translations_lang.php index 82e9388d..afa6b878 100755 --- a/application/language/slovak/translations_lang.php +++ b/application/language/slovak/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/spanish/translations_lang.php b/application/language/spanish/translations_lang.php index a90c90b0..05ebfed6 100755 --- a/application/language/spanish/translations_lang.php +++ b/application/language/spanish/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/swedish/translations_lang.php b/application/language/swedish/translations_lang.php index 4fa7a4a8..ff4857c7 100644 --- a/application/language/swedish/translations_lang.php +++ b/application/language/swedish/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/application/language/turkish/translations_lang.php b/application/language/turkish/translations_lang.php index fc789c0d..fdfebec4 100755 --- a/application/language/turkish/translations_lang.php +++ b/application/language/turkish/translations_lang.php @@ -362,4 +362,6 @@ $lang['private_hint'] = 'Private records will not be displayed or processed in p $lang['reset'] = 'Reset'; $lang['all'] = 'All'; $lang['booking_link'] = 'Booking Link'; +$lang['add_new_event'] = 'Add New Event'; +$lang['what_kind_of_event'] = 'What kind of event would you like to add?'; // End diff --git a/assets/js/utils/calendar_default_view.js b/assets/js/utils/calendar_default_view.js index aa40bea1..2fd24ed5 100755 --- a/assets/js/utils/calendar_default_view.js +++ b/assets/js/utils/calendar_default_view.js @@ -1474,51 +1474,91 @@ App.Utils.CalendarDefaultView = (function () { return; } - $('#insert-appointment').trigger('click'); + const isProviderDisplayed = + $selectFilterItem.find('option:selected').attr('type') === FILTER_TYPE_PROVIDER; - // Preselect service & provider. - let service; + const buttons = [ + { + text: lang('close'), + click: () => { + $('#message-box').dialog('close'); + } + }, + { + text: lang('unavailability'), + click: () => { + $('#insert-unavailability').trigger('click'); - if ($selectFilterItem.find('option:selected').attr('type') === FILTER_TYPE_SERVICE) { - service = vars('available_services').find( - (availableService) => Number(availableService.id) === Number($selectFilterItem.val()) - ); - $appointmentsModal.find('#select-service').val(service.id).trigger('change'); - } else { - const provider = vars('available_providers').find( - (availableProvider) => Number(availableProvider.id) === Number($selectFilterItem.val()) - ); + if (isProviderDisplayed) { + $('#unavailability-provider').val($selectFilterItem.val()); + } else { + $('#unavailability-provider option:first').prop('selected', true); + } - if (provider) { - service = vars('available_services').find( - (availableService) => provider.services.indexOf(availableService.id) !== -1 - ); + $('#unavailability-start').datepicker('setDate', info.start); - if (service) { - $appointmentsModal.find('#select-service').val(service.id); + $('#unavailability-end').datepicker('setDate', info.end); + + $('#message-box').dialog('close'); + } + }, + { + text: lang('appointment'), + click: () => { + $('#insert-appointment').trigger('click'); + + // Preselect service & provider. + let service; + + if (isProviderDisplayed) { + const provider = vars('available_providers').find( + (availableProvider) => + Number(availableProvider.id) === Number($selectFilterItem.val()) + ); + + if (provider) { + service = vars('available_services').find( + (availableService) => provider.services.indexOf(availableService.id) !== -1 + ); + + if (service) { + $appointmentsModal.find('#select-service').val(service.id); + } + } + + if (!$appointmentsModal.find('#select-service').val()) { + $('#select-service option:first').prop('selected', true); + } + + $appointmentsModal.find('#select-service').trigger('change'); + + if (provider) { + $appointmentsModal.find('#select-provider').val(provider.id); + } + + if (!$appointmentsModal.find('#select-provider').val()) { + $appointmentsModal.find('#select-provider option:first').prop('selected', true); + } + + $appointmentsModal.find('#select-provider').trigger('change'); + } else { + service = vars('available_services').find( + (availableService) => + Number(availableService.id) === Number($selectFilterItem.val()) + ); + $appointmentsModal.find('#select-service').val(service.id).trigger('change'); + } + + // Preselect time + $('#start-datetime').datepicker('setDate', info.start); + $('#end-datetime').datepicker('setDate', info.end); + + $('#message-box').dialog('close'); } } + ]; - if (!$appointmentsModal.find('#select-service').val()) { - $('#select-service option:first').prop('selected', true); - } - - $appointmentsModal.find('#select-service').trigger('change'); - - if (provider) { - $appointmentsModal.find('#select-provider').val(provider.id); - } - - if (!$appointmentsModal.find('#select-provider').val()) { - $appointmentsModal.find('#select-provider option:first').prop('selected', true); - } - - $appointmentsModal.find('#select-provider').trigger('change'); - } - - // Preselect time - $('#start-datetime').datepicker('setDate', info.start); - $('#end-datetime').datepicker('setDate', info.end); + App.Utils.Message.show(lang('add_new_event'), lang('what_kind_of_event'), buttons); return false; },