From 5e5dc79908a7c8186edb22b269df4d8c2055459f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81bastien?= Date: Sat, 9 May 2020 20:19:47 +0200 Subject: [PATCH 1/7] Fix display of date-pickers used on appointments create/update modals --- assets/css/general.css | 1 - 1 file changed, 1 deletion(-) diff --git a/assets/css/general.css b/assets/css/general.css index b4c65a6a..6a467ab8 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -80,7 +80,6 @@ body .ui-widget.ui-widget-content { body #ui-datepicker-div { margin-top: 4px; - z-index: 4 !important; } body .ui-datepicker .ui-widget-header { From e857d3a37e62a33f9e048a8b47bea17852147479 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Sun, 14 Jun 2020 10:56:35 +0200 Subject: [PATCH 2/7] Corrected issue with attendants number query --- application/models/Appointments_model.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/models/Appointments_model.php b/application/models/Appointments_model.php index 539a6e18..bf8d60fe 100644 --- a/application/models/Appointments_model.php +++ b/application/models/Appointments_model.php @@ -545,6 +545,7 @@ class Appointments_Model extends CI_Model { ->select('count(*) AS attendants_number') ->from('appointments') ->group_start() + ->group_start() ->where('start_datetime <=', $slot_start->format('Y-m-d H:i:s')) ->where('end_datetime >', $slot_start->format('Y-m-d H:i:s')) ->group_end() @@ -552,6 +553,7 @@ class Appointments_Model extends CI_Model { ->where('start_datetime <', $slot_end->format('Y-m-d H:i:s')) ->where('end_datetime >=', $slot_end->format('Y-m-d H:i:s')) ->group_end() + ->group_end() ->where('id_services', $service_id) ->get() ->row() From 6585c38eb9a61bff3d81ebb67d192cf024ad014a Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Thu, 18 Jun 2020 14:02:02 +0200 Subject: [PATCH 3/7] Toggle the visibility of the alert element by toggling the "hidden" class (#705) --- assets/js/installation.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/installation.js b/assets/js/installation.js index 187b3e89..7a259116 100644 --- a/assets/js/installation.js +++ b/assets/js/installation.js @@ -51,7 +51,7 @@ $(function () { $alert .text('Easy!Appointments has been successfully installed!') .addClass('alert-success') - .show(); + .removeClass('hidden'); setTimeout(function () { window.location.href = GlobalVariables.baseUrl + '/index.php/backend'; @@ -71,7 +71,7 @@ $(function () { try { $alert .removeClass('alert-danger') - .hide(); + .addClass('hidden'); $('input').closest('.form-group').removeClass('has-error'); // Check for empty fields. @@ -116,7 +116,7 @@ $(function () { $alert .addClass('alert-danger') .text(error.message) - .show(); + .removeClass('hidden'); return false; } From 6382bc422a820726b36101814b5d90ae8a5af778 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Thu, 18 Jun 2020 19:30:47 +0200 Subject: [PATCH 4/7] Fixed 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 bba87c8b..2f2eab0a 100755 --- a/assets/js/general_functions.js +++ b/assets/js/general_functions.js @@ -284,7 +284,7 @@ window.GeneralFunctions = window.GeneralFunctions || {}; }; $.post(url, data) - done(function () { + .done(function () { document.location.reload(true); }) .fail(GeneralFunctions.ajaxFailureHandler); From 6290b85b82029553029a0d9db0a0f2f349d565f3 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Wed, 1 Jul 2020 08:48:57 +0200 Subject: [PATCH 5/7] Replaced the AJAX failure callback function --- assets/js/backend_calendar_unavailabilities_modal.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/assets/js/backend_calendar_unavailabilities_modal.js b/assets/js/backend_calendar_unavailabilities_modal.js index f565d120..c95b68cc 100755 --- a/assets/js/backend_calendar_unavailabilities_modal.js +++ b/assets/js/backend_calendar_unavailabilities_modal.js @@ -58,7 +58,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili unavailable.id = $dialog.find('#unavailable-id').val(); } - var successCallback = function (response) { + var successCallback = function () { // Display success message to the user. Backend.displayNotification(EALang.unavailable_saved); @@ -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').txt(EALang.service_communication_error); - $dialog.find('.modal-message').addClass('alert-danger').removeClass('hidden'); - }; - - BackendCalendarApi.saveUnavailable(unavailable, successCallback, errorCallback); + BackendCalendarApi.saveUnavailable(unavailable, successCallback, GeneralFunctions.ajaxFailureHandler); }); /** From d8a7318c95e15fa02c052ad504a0f5dc25e346c0 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Wed, 1 Jul 2020 08:49:17 +0200 Subject: [PATCH 6/7] Added missing response variable --- application/controllers/Backend_api.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/controllers/Backend_api.php b/application/controllers/Backend_api.php index da14e19c..89f6e43d 100755 --- a/application/controllers/Backend_api.php +++ b/application/controllers/Backend_api.php @@ -777,6 +777,7 @@ class Backend_api extends CI_Controller { ->set_output(json_encode(AJAX_SUCCESS)); } + $response = AJAX_SUCCESS; } catch (Exception $exception) { From 16c18f9b99764520b47a59c228214706e9802290 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Wed, 1 Jul 2020 09:13:22 +0200 Subject: [PATCH 7/7] Display event notes in the popup widget (#745). --- assets/js/backend_calendar_default_view.js | 33 ++++++++++++++++++---- assets/js/backend_calendar_table_view.js | 33 ++++++++++++++++++---- 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/assets/js/backend_calendar_default_view.js b/assets/js/backend_calendar_default_view.js index adeb05ec..3401b12e 100755 --- a/assets/js/backend_calendar_default_view.js +++ b/assets/js/backend_calendar_default_view.js @@ -270,6 +270,21 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {}; return (result > 500) ? result : 500; // Minimum height is 500px } + /** + * Get the event notes for the popup widget. + * + * @param {Event} event + */ + function getEventNotes(event) { + if (!event.data || !event.data.notes) { + return '-'; + } + + var notes = event.data.notes; + + return notes.length > 100 ? notes.substring(0, 100) + '...' : notes; + } + /** * Calendar Event "Click" Callback * @@ -296,11 +311,6 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {}; && GlobalVariables.user.privileges.appointments.delete === true) ? '' : 'hide'; // Same value at the time. - var notes = ''; - if (event.data) { // Only custom unavailable periods have notes. - notes = 'Notes ' + event.data.notes; - } - $html = $('
', { 'html': [ $('', { @@ -319,8 +329,11 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {}; }), $('
'), + $('', { + 'text': EALang.notes + }), $('', { - 'text': notes + 'text': getEventNotes(event) }), $('
'), @@ -485,6 +498,14 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {}; }), $('
'), + $('', { + 'text': EALang.notes + }), + $('', { + 'text': getEventNotes(event) + }), + $('
'), + $('
'), $('
', { diff --git a/assets/js/backend_calendar_table_view.js b/assets/js/backend_calendar_table_view.js index b4cebac7..ac916746 100755 --- a/assets/js/backend_calendar_table_view.js +++ b/assets/js/backend_calendar_table_view.js @@ -997,6 +997,21 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; } } + /** + * Get the event notes for the popup widget. + * + * @param {Event} event + */ + function getEventNotes(event) { + if (!event.data || !event.data.notes) { + return '-'; + } + + var notes = event.data.notes; + + return notes.length > 100 ? notes.substring(0, 100) + '...' : notes; + } + /** * Calendar Event "Click" Callback * @@ -1023,11 +1038,6 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; && GlobalVariables.user.privileges.appointments.delete === true) ? '' : 'hide'; // Same value at the time. - var notes = ''; - if (event.data) { // Only custom unavailable periods have notes. - notes = 'Notes ' + event.data.notes; - } - $html = $('
', { 'html': [ $('', { @@ -1046,8 +1056,11 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; }), $('
'), + $('', { + 'text': EALang.notes + }), $('', { - 'text': notes + 'text': getEventNotes(event) }), $('
'), @@ -1212,6 +1225,14 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; }), $('
'), + $('', { + 'text': EALang.notes + }), + $('', { + 'text': getEventNotes(event) + }), + $('
'), + $('
'), $('
', {