From 6f1604d452c7a4b56687a37e43738352beb43a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81bastien?= Date: Mon, 4 May 2020 21:13:13 +0200 Subject: [PATCH 1/8] Fix typo. --- assets/js/backend_calendar_extra_periods_modal.js | 2 +- assets/js/backend_calendar_unavailabilities_modal.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/backend_calendar_extra_periods_modal.js b/assets/js/backend_calendar_extra_periods_modal.js index 6335589f..c4a801fe 100644 --- a/assets/js/backend_calendar_extra_periods_modal.js +++ b/assets/js/backend_calendar_extra_periods_modal.js @@ -92,7 +92,7 @@ window.BackendCalendarExtraPeriodsModal = window.BackendCalendarExtraPeriodsModa 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'); }; diff --git a/assets/js/backend_calendar_unavailabilities_modal.js b/assets/js/backend_calendar_unavailabilities_modal.js index 3d320039..2de3edc2 100755 --- a/assets/js/backend_calendar_unavailabilities_modal.js +++ b/assets/js/backend_calendar_unavailabilities_modal.js @@ -72,7 +72,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').text(EALang.service_communication_error); $dialog.find('.modal-message').addClass('alert-danger').removeClass('hidden'); }; From 9905c942acdf9918a9b08a12dd65bd6c2ee9010c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81bastien?= Date: Mon, 4 May 2020 21:19:02 +0200 Subject: [PATCH 2/8] Remove timeout before closing the extra periods modal on success. --- .../backend_calendar_extra_periods_modal.js | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/assets/js/backend_calendar_extra_periods_modal.js b/assets/js/backend_calendar_extra_periods_modal.js index 6335589f..50a6e21f 100644 --- a/assets/js/backend_calendar_extra_periods_modal.js +++ b/assets/js/backend_calendar_extra_periods_modal.js @@ -59,33 +59,28 @@ 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) { From c997a48c626da3a063f390d9f8feb81458bcc219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81bastien?= Date: Sat, 9 May 2020 17:58:54 +0200 Subject: [PATCH 3/8] Remove an unexpected character from the settings backend page. --- application/views/backend/settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/backend/settings.php b/application/views/backend/settings.php index 6f233b14..576b60c7 100755 --- a/application/views/backend/settings.php +++ b/application/views/backend/settings.php @@ -459,7 +459,7 @@ -
∏ +
From 356b4242a7ae7ce97fa07ba21c496a5994c5723f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81bastien?= Date: Sat, 9 May 2020 18:17:25 +0200 Subject: [PATCH 4/8] Fix close button not displayed on login error modal when username and password are empty. --- assets/js/general_functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/general_functions.js b/assets/js/general_functions.js index 8a737c11..fa0a4ae2 100755 --- a/assets/js/general_functions.js +++ b/assets/js/general_functions.js @@ -337,7 +337,7 @@ window.GeneralFunctions = window.GeneralFunctions || {}; return; } - GeneralFunctions.displayMessageBox(EALang.unexpected_issues, EALang.unexpected_issues_message, []); + GeneralFunctions.displayMessageBox(EALang.unexpected_issues, EALang.unexpected_issues_message); $('
', { 'class': 'well', From 779b291281a74126a22afcb189824b43e404babe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81bastien?= Date: Sat, 9 May 2020 23:29:16 +0200 Subject: [PATCH 5/8] Fix disabled bug with insert dropdown in backend. --- application/views/backend/calendar.php | 2 +- assets/js/backend_calendar_default_view.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/views/backend/calendar.php b/application/views/backend/calendar.php index a4919af9..e443c125 100755 --- a/application/views/backend/calendar.php +++ b/application/views/backend/calendar.php @@ -73,7 +73,7 @@ - diff --git a/assets/js/backend_calendar_default_view.js b/assets/js/backend_calendar_default_view.js index e8b43883..c30a6178 100755 --- a/assets/js/backend_calendar_default_view.js +++ b/assets/js/backend_calendar_default_view.js @@ -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); From 24a1eeee2f40289a2a4c808012d6b5bc229a197c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81bastien?= Date: Tue, 16 Jun 2020 15:10:56 +0200 Subject: [PATCH 6/8] Fix a js typo. --- assets/js/general_functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/general_functions.js b/assets/js/general_functions.js index fa0a4ae2..a3188587 100755 --- a/assets/js/general_functions.js +++ b/assets/js/general_functions.js @@ -314,7 +314,7 @@ window.GeneralFunctions = window.GeneralFunctions || {}; language: $(this).attr('data-language') }; $.post(url, data) - done(function () { + .done(function () { document.location.reload(true); }) .fail(GeneralFunctions.ajaxFailureHandler); From 516830b5feb00d10556dab23eb6b5916acbddff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81bastien?= Date: Wed, 1 Jul 2020 11:15:40 +0200 Subject: [PATCH 7/8] Remove unneeded code. --- assets/js/backend_calendar_default_view.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/assets/js/backend_calendar_default_view.js b/assets/js/backend_calendar_default_view.js index 3401b12e..e119ae86 100755 --- a/assets/js/backend_calendar_default_view.js +++ b/assets/js/backend_calendar_default_view.js @@ -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 = '' + EALang.provider + ' ' + event.data.first_name + ' ' + event.data.last_name; - } - - var extraPeriod = jQuery.parseJSON(event.data.settings.extra_working_plan)[event.start.format()]; - $html = $('
', { 'html': [ $('', { From dc704aa1d40b9b0a0a9756ebd2ba3a4784bb219e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81bastien?= Date: Wed, 1 Jul 2020 11:18:50 +0200 Subject: [PATCH 8/8] Restore some code after merge. --- assets/js/backend_calendar_unavailabilities_modal.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/assets/js/backend_calendar_unavailabilities_modal.js b/assets/js/backend_calendar_unavailabilities_modal.js index df80ed84..c95b68cc 100755 --- a/assets/js/backend_calendar_unavailabilities_modal.js +++ b/assets/js/backend_calendar_unavailabilities_modal.js @@ -68,15 +68,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili $('#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').text(EALang.service_communication_error); - $dialog.find('.modal-message').addClass('alert-danger').removeClass('hidden'); - }; - - BackendCalendarApi.saveUnavailable(unavailable, successCallback, errorCallback); + BackendCalendarApi.saveUnavailable(unavailable, successCallback, GeneralFunctions.ajaxFailureHandler); }); /**