From 47ba769e6222ef06abe0386fbd315726f7ee723e Mon Sep 17 00:00:00 2001 From: alextselegidis Date: Thu, 20 Oct 2016 22:42:16 +0200 Subject: [PATCH 1/4] Corrected translation which was causing problem with delete/cancel buttons (fixes #215). --- src/application/language/italian/translations_lang.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/application/language/italian/translations_lang.php b/src/application/language/italian/translations_lang.php index 414d614d..2b243e8d 100644 --- a/src/application/language/italian/translations_lang.php +++ b/src/application/language/italian/translations_lang.php @@ -26,7 +26,7 @@ $lang['step_four_title'] = 'Conferma appuntamento'; $lang['confirm'] = 'Conferma'; $lang['update'] = 'Aggiorna'; $lang['cancel_appointment_hint'] = 'Clicca sul bottone "Cancella" per rimuovere l\'appuntamento dalla pianificazione aziendale.'; -$lang['cancel'] = 'Cancella'; +$lang['cancel'] = 'Annulla'; $lang['appointment_registered'] = 'Il tuo appuntamento è stato registrato con successo!'; $lang['cancel_appointment_title'] = 'Cancella appuntamento'; $lang['appointment_cancelled'] = 'Il tuo appuntamento è stato cancellato con successo!'; @@ -94,7 +94,7 @@ $lang['reload_appointments_hint'] = 'Ricarica gli appuntamenti a calendario.'; $lang['trigger_google_sync_hint'] = 'Avvia il processo di sincronizzazione con Google Calendar.'; $lang['appointment_updated'] = 'Appuntamento aggiornato con successo!'; $lang['undo'] = 'Annulla'; -$lang['cancel'] = 'Cancella'; +$lang['cancel'] = 'Annulla'; $lang['appointment_details_changed'] = 'I dettagli dell\'appuntamento sono cambiati.'; $lang['appointment_changes_saved'] = 'Le modifiche all\'appuntamento sono state salvate con successo!'; $lang['save'] = 'Salva'; From 2c38a2165e104af73ba78ebcbe59bedf3a1957ed Mon Sep 17 00:00:00 2001 From: alextselegidis Date: Thu, 20 Oct 2016 23:00:34 +0200 Subject: [PATCH 2/4] Corrected appointment form layout. --- src/application/views/backend/calendar.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/application/views/backend/calendar.php b/src/application/views/backend/calendar.php index 56c5259f..1e6d75a2 100644 --- a/src/application/views/backend/calendar.php +++ b/src/application/views/backend/calendar.php @@ -204,7 +204,7 @@
-
+
@@ -288,7 +288,7 @@
-
+
@@ -296,7 +296,7 @@
-
+
@@ -304,7 +304,7 @@
-
+
@@ -312,7 +312,7 @@
-
+
From e6082ab2e0df74bfd4ca213f5528fd01f4a12052 Mon Sep 17 00:00:00 2001 From: alextselegidis Date: Thu, 20 Oct 2016 23:05:43 +0200 Subject: [PATCH 3/4] Removed unnecessary "stripcslashes" method call (fixes #194) --- src/application/controllers/Backend_api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/application/controllers/Backend_api.php b/src/application/controllers/Backend_api.php index 1bb77d2d..df45d372 100644 --- a/src/application/controllers/Backend_api.php +++ b/src/application/controllers/Backend_api.php @@ -217,7 +217,7 @@ class Backend_api extends CI_Controller { // :: SAVE CUSTOMER CHANGES TO DATABASE if (isset($_POST['customer_data'])) { - $customer = json_decode(stripcslashes($_POST['customer_data']), true); + $customer = json_decode($_POST['customer_data'], true); $REQUIRED_PRIV = (!isset($customer['id'])) ? $this->privileges[PRIV_CUSTOMERS]['add'] @@ -231,7 +231,7 @@ class Backend_api extends CI_Controller { // :: SAVE APPOINTMENT CHANGES TO DATABASE if (isset($_POST['appointment_data'])) { - $appointment = json_decode(stripcslashes($_POST['appointment_data']), true); + $appointment = json_decode($_POST['appointment_data'], true); $REQUIRED_PRIV = (!isset($appointment['id'])) ? $this->privileges[PRIV_APPOINTMENTS]['add'] From 81b3eb9bd3e2c8a13e75deeca42d46c5e0b55b59 Mon Sep 17 00:00:00 2001 From: alextselegidis Date: Thu, 20 Oct 2016 23:39:25 +0200 Subject: [PATCH 4/4] Do not use the "getDate" method of the datepicker as it changes the timezone for dates between the 30nth of October and the 25th of March. --- src/assets/js/backend_calendar_appointments_modal.js | 10 ++++------ .../js/backend_calendar_unavailabilities_modal.js | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/assets/js/backend_calendar_appointments_modal.js b/src/assets/js/backend_calendar_appointments_modal.js index da81e650..d479415c 100644 --- a/src/assets/js/backend_calendar_appointments_modal.js +++ b/src/assets/js/backend_calendar_appointments_modal.js @@ -49,10 +49,8 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa // ID must exist on the object in order for the model to update the record and not to perform // an insert operation. - var startDatetime = $dialog.find('#start-datetime') - .datepicker('getDate').toString('yyyy-MM-dd HH:mm:ss'); - var endDatetime = $dialog.find('#end-datetime') - .datepicker('getDate').toString('yyyy-MM-dd HH:mm:ss'); + var startDatetime = Date.parse($dialog.find('#start-datetime').val()).toString('yyyy-MM-dd HH:mm:ss'); + var endDatetime = Date.parse($dialog.find('#end-datetime').val()).toString('yyyy-MM-dd HH:mm:ss'); var appointment = { id_services: $dialog.find('#select-service').val(), @@ -483,8 +481,8 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa } // Check appointment start and end time. - var start = $('#start-datetime').datepicker('getDate'); - var end = $('#end-datetime').datepicker('getDate'); + var start = Date.parse($('#start-datetime').val()); + var end = Date.parse($('#end-datetime').val()); if (start > end) { $dialog.find('#start-datetime').parents('.form-group').addClass('has-error'); $dialog.find('#end-datetime').parents('.form-group').addClass('has-error'); diff --git a/src/assets/js/backend_calendar_unavailabilities_modal.js b/src/assets/js/backend_calendar_unavailabilities_modal.js index 6c992980..127caf3c 100644 --- a/src/assets/js/backend_calendar_unavailabilities_modal.js +++ b/src/assets/js/backend_calendar_unavailabilities_modal.js @@ -30,8 +30,8 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili */ $('#manage-unavailable #save-unavailable').click(function() { var $dialog = $('#manage-unavailable'); - var start = $dialog.find('#unavailable-start').datetimepicker('getDate'); - var end = $dialog.find('#unavailable-end').datetimepicker('getDate'); + var start = Date.parse($dialog.find('#unavailable-start').val()); + var end = Date.parse($dialog.find('#unavailable-end').val()); if (start > end) { // Start time is after end time - display message to user.