From d971f4f0973aa994a9a33200e8caa7a141436996 Mon Sep 17 00:00:00 2001 From: Andrea Date: Tue, 6 Mar 2018 12:20:47 +0100 Subject: [PATCH 1/7] Added time format selection --- src/application/controllers/Appointments.php | 8 +++-- src/application/controllers/Backend.php | 5 +++ src/application/controllers/Backend_api.php | 6 ++-- .../language/arabic/translations_lang.php | 4 ++- .../language/bulgarian/translations_lang.php | 2 ++ .../language/chinese/translations_lang.php | 2 ++ .../language/danish/translations_lang.php | 2 ++ .../language/dutch/translations_lang.php | 2 ++ .../language/english/translations_lang.php | 2 ++ .../language/finnish/translations_lang.php | 2 ++ .../language/french/translations_lang.php | 2 ++ .../language/german/translations_lang.php | 2 ++ .../language/greek/translations_lang.php | 2 ++ .../language/hindi/translations_lang.php | 2 ++ .../language/hungarian/translations_lang.php | 2 ++ .../language/italian/translations_lang.php | 2 ++ .../language/japanese/translations_lang.php | 2 ++ .../luxembourgish/translations_lang.php | 2 ++ .../language/polish/translations_lang.php | 2 ++ .../portuguese-br/translations_lang.php | 2 ++ .../language/portuguese/translations_lang.php | 2 ++ .../language/romanian/translations_lang.php | 2 ++ .../language/russian/translations_lang.php | 2 ++ .../language/slovak/translations_lang.php | 2 ++ .../language/spanish/translations_lang.php | 2 ++ .../language/turkish/translations_lang.php | 2 ++ src/application/views/appointments/book.php | 1 + src/application/views/backend/calendar.php | 1 + src/application/views/backend/customers.php | 1 + src/application/views/backend/services.php | 1 + src/application/views/backend/settings.php | 13 ++++++++ src/application/views/backend/users.php | 1 + .../js/backend_calendar_appointments_modal.js | 4 +-- .../js/backend_calendar_default_view.js | 23 +++++++++++-- src/assets/js/backend_calendar_table_view.js | 12 +++---- ...backend_calendar_unavailabilities_modal.js | 4 +-- src/assets/js/frontend_book_api.js | 4 +-- src/assets/js/general_functions.js | 2 +- src/assets/js/working_plan.js | 24 +++++++------- src/engine/Notifications/Email.php | 32 ++++++++++++++++--- 40 files changed, 153 insertions(+), 37 deletions(-) mode change 100644 => 100755 src/application/controllers/Backend.php mode change 100644 => 100755 src/application/controllers/Backend_api.php mode change 100644 => 100755 src/application/language/arabic/translations_lang.php mode change 100644 => 100755 src/application/language/bulgarian/translations_lang.php mode change 100644 => 100755 src/application/language/chinese/translations_lang.php mode change 100644 => 100755 src/application/language/danish/translations_lang.php mode change 100644 => 100755 src/application/language/dutch/translations_lang.php mode change 100644 => 100755 src/application/language/english/translations_lang.php mode change 100644 => 100755 src/application/language/finnish/translations_lang.php mode change 100644 => 100755 src/application/language/french/translations_lang.php mode change 100644 => 100755 src/application/language/german/translations_lang.php mode change 100644 => 100755 src/application/language/greek/translations_lang.php mode change 100644 => 100755 src/application/language/hindi/translations_lang.php mode change 100644 => 100755 src/application/language/hungarian/translations_lang.php mode change 100644 => 100755 src/application/language/italian/translations_lang.php mode change 100644 => 100755 src/application/language/japanese/translations_lang.php mode change 100644 => 100755 src/application/language/luxembourgish/translations_lang.php mode change 100644 => 100755 src/application/language/polish/translations_lang.php mode change 100644 => 100755 src/application/language/portuguese-br/translations_lang.php mode change 100644 => 100755 src/application/language/portuguese/translations_lang.php mode change 100644 => 100755 src/application/language/romanian/translations_lang.php mode change 100644 => 100755 src/application/language/russian/translations_lang.php mode change 100644 => 100755 src/application/language/slovak/translations_lang.php mode change 100644 => 100755 src/application/language/spanish/translations_lang.php mode change 100644 => 100755 src/application/language/turkish/translations_lang.php mode change 100644 => 100755 src/application/views/appointments/book.php mode change 100644 => 100755 src/application/views/backend/calendar.php mode change 100644 => 100755 src/application/views/backend/customers.php mode change 100644 => 100755 src/application/views/backend/services.php mode change 100644 => 100755 src/application/views/backend/settings.php mode change 100644 => 100755 src/application/views/backend/users.php mode change 100644 => 100755 src/assets/js/backend_calendar_appointments_modal.js mode change 100644 => 100755 src/assets/js/backend_calendar_default_view.js mode change 100644 => 100755 src/assets/js/backend_calendar_table_view.js mode change 100644 => 100755 src/assets/js/backend_calendar_unavailabilities_modal.js mode change 100644 => 100755 src/assets/js/frontend_book_api.js mode change 100644 => 100755 src/assets/js/general_functions.js mode change 100644 => 100755 src/assets/js/working_plan.js mode change 100644 => 100755 src/engine/Notifications/Email.php diff --git a/src/application/controllers/Appointments.php b/src/application/controllers/Appointments.php index 8b3916d1..c6d5976e 100755 --- a/src/application/controllers/Appointments.php +++ b/src/application/controllers/Appointments.php @@ -75,6 +75,7 @@ class Appointments extends CI_Controller { $available_providers = $this->providers_model->get_available_providers(); $company_name = $this->settings_model->get_setting('company_name'); $date_format = $this->settings_model->get_setting('date_format'); + $time_format = $this->settings_model->get_setting('time_format'); // Remove the data that are not needed inside the $available_providers array. foreach ($available_providers as $index => $provider) @@ -132,6 +133,7 @@ class Appointments extends CI_Controller { 'company_name' => $company_name, 'manage_mode' => $manage_mode, 'date_format' => $date_format, + 'time_format' => $time_format, 'appointment_data' => $appointment, 'provider_data' => $provider, 'customer_data' => $customer @@ -180,7 +182,8 @@ class Appointments extends CI_Controller { 'company_name' => $this->settings_model->get_setting('company_name'), 'company_email' => $this->settings_model->get_setting('company_email'), 'company_link' => $this->settings_model->get_setting('company_link'), - 'date_format' => $this->settings_model->get_setting('date_format') + 'date_format' => $this->settings_model->get_setting('date_format'), + 'time_format' => $this->settings_model->get_setting('time_format') ]; // :: DELETE APPOINTMENT RECORD FROM THE DATABASE. @@ -470,7 +473,8 @@ class Appointments extends CI_Controller { 'company_name' => $this->settings_model->get_setting('company_name'), 'company_link' => $this->settings_model->get_setting('company_link'), 'company_email' => $this->settings_model->get_setting('company_email'), - 'date_format' => $this->settings_model->get_setting('date_format') + 'date_format' => $this->settings_model->get_setting('date_format'), + 'time_format' => $this->settings_model->get_setting('time_format') ]; // :: SYNCHRONIZE APPOINTMENT WITH PROVIDER'S GOOGLE CALENDAR diff --git a/src/application/controllers/Backend.php b/src/application/controllers/Backend.php old mode 100644 new mode 100755 index bcd177c9..2db56b7d --- a/src/application/controllers/Backend.php +++ b/src/application/controllers/Backend.php @@ -69,6 +69,7 @@ class Backend extends CI_Controller { $view['active_menu'] = PRIV_APPOINTMENTS; $view['book_advance_timeout'] = $this->settings_model->get_setting('book_advance_timeout'); $view['date_format'] = $this->settings_model->get_setting('date_format'); + $view['time_format'] = $this->settings_model->get_setting('time_format'); $view['company_name'] = $this->settings_model->get_setting('company_name'); $view['available_providers'] = $this->providers_model->get_available_providers(); $view['available_services'] = $this->services_model->get_available_services(); @@ -130,6 +131,7 @@ class Backend extends CI_Controller { $view['active_menu'] = PRIV_CUSTOMERS; $view['company_name'] = $this->settings_model->get_setting('company_name'); $view['date_format'] = $this->settings_model->get_setting('date_format'); + $view['time_format'] = $this->settings_model->get_setting('time_format'); $view['customers'] = $this->customers_model->get_batch(); $view['available_providers'] = $this->providers_model->get_available_providers(); $view['available_services'] = $this->services_model->get_available_services(); @@ -167,6 +169,7 @@ class Backend extends CI_Controller { $view['active_menu'] = PRIV_SERVICES; $view['company_name'] = $this->settings_model->get_setting('company_name'); $view['date_format'] = $this->settings_model->get_setting('date_format'); + $view['time_format'] = $this->settings_model->get_setting('time_format'); $view['services'] = $this->services_model->get_batch(); $view['categories'] = $this->services_model->get_all_categories(); $this->set_user_data($view); @@ -203,6 +206,7 @@ class Backend extends CI_Controller { $view['active_menu'] = PRIV_USERS; $view['company_name'] = $this->settings_model->get_setting('company_name'); $view['date_format'] = $this->settings_model->get_setting('date_format'); + $view['time_format'] = $this->settings_model->get_setting('time_format'); $view['admins'] = $this->admins_model->get_batch(); $view['providers'] = $this->providers_model->get_batch(); $view['secretaries'] = $this->secretaries_model->get_batch(); @@ -242,6 +246,7 @@ class Backend extends CI_Controller { $view['active_menu'] = PRIV_SYSTEM_SETTINGS; $view['company_name'] = $this->settings_model->get_setting('company_name'); $view['date_format'] = $this->settings_model->get_setting('date_format'); + $view['time_format'] = $this->settings_model->get_setting('time_format'); $view['role_slug'] = $this->session->userdata('role_slug'); $view['system_settings'] = $this->settings_model->get_settings(); $view['user_settings'] = $this->user_model->get_settings($user_id); diff --git a/src/application/controllers/Backend_api.php b/src/application/controllers/Backend_api.php old mode 100644 new mode 100755 index 2f5ae866..d7588eae --- a/src/application/controllers/Backend_api.php +++ b/src/application/controllers/Backend_api.php @@ -311,7 +311,8 @@ class Backend_api extends CI_Controller { 'company_name' => $this->settings_model->get_setting('company_name'), 'company_link' => $this->settings_model->get_setting('company_link'), 'company_email' => $this->settings_model->get_setting('company_email'), - 'date_format' => $this->settings_model->get_setting('date_format') + 'date_format' => $this->settings_model->get_setting('date_format'), + 'time_format' => $this->settings_model->get_setting('time_format') ]; // :: SYNC APPOINTMENT CHANGES WITH GOOGLE CALENDAR @@ -461,7 +462,8 @@ class Backend_api extends CI_Controller { 'company_name' => $this->settings_model->get_setting('company_name'), 'company_email' => $this->settings_model->get_setting('company_email'), 'company_link' => $this->settings_model->get_setting('company_link'), - 'date_format' => $this->settings_model->get_setting('date_format') + 'date_format' => $this->settings_model->get_setting('date_format'), + 'time_format' => $this->settings_model->get_setting('time_format') ]; // :: DELETE APPOINTMENT RECORD FROM DATABASE diff --git a/src/application/language/arabic/translations_lang.php b/src/application/language/arabic/translations_lang.php old mode 100644 new mode 100755 index cd28ace3..233ac5ef --- a/src/application/language/arabic/translations_lang.php +++ b/src/application/language/arabic/translations_lang.php @@ -274,8 +274,10 @@ $lang['customer_notifications'] = 'اشعارات الزبون'; $lang['customer_notifications_hint'] = 'سيتم تلقي اشعارات للزبون عند تغيّر موعد الحجز أو عند تحديثه'; $lang['date_format'] = 'صيغة التاريخ'; $lang['date_format_hint'] = 'تغيير صيغة وعرض التاريخ (D - Date, M - Month, Y - Year).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'ليتم تضمينه في صفحة الحجز Google Analytics ID أضف معرّف'; $lang['availabilities_type'] = 'نوع التوفر أو الإتاحة'; $lang['flexible'] = 'مرن'; $lang['fixed'] = 'ثابت'; -$lang['attendants_number'] = 'عدد الحاضرين'; +$lang['attendants_number'] = 'عدد الحاضرين'; \ No newline at end of file diff --git a/src/application/language/bulgarian/translations_lang.php b/src/application/language/bulgarian/translations_lang.php old mode 100644 new mode 100755 index 39b42f67..4e541cdf --- a/src/application/language/bulgarian/translations_lang.php +++ b/src/application/language/bulgarian/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications_hint'] = 'Дефинира дали клиентъ $lang['customer_notifications'] = 'Клиентски Известия'; $lang['date_format'] = 'Формат на Дата'; $lang['date_format_hint'] = 'Промяна на дормат за показ на дата (D - дата, M - месец, Y - година).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Добавете Google Analytics ID за да бъде включена статистика в страницата за запазване на час.'; $lang['availabilities_type'] = 'Типове на работен период.'; $lang['flexible'] = 'Гъвкав'; diff --git a/src/application/language/chinese/translations_lang.php b/src/application/language/chinese/translations_lang.php old mode 100644 new mode 100755 index e33ec564..52ecf124 --- a/src/application/language/chinese/translations_lang.php +++ b/src/application/language/chinese/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Customer Notifications'; $lang['customer_notifications_hint'] = 'Defines whether the customer will receive email notifications whenever there is a schedule change on one of his appointments.'; $lang['date_format'] = 'Date Format'; $lang['date_format_hint'] = 'Change the date display format (D - Date, M - Month, Y - Year).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Add your Google Analytics ID to be included in the booking page.'; $lang['availabilities_type'] = 'Availabilities Type'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/language/danish/translations_lang.php b/src/application/language/danish/translations_lang.php old mode 100644 new mode 100755 index a206a988..5a710c74 --- a/src/application/language/danish/translations_lang.php +++ b/src/application/language/danish/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Customer Notifications'; $lang['customer_notifications_hint'] = 'Defines whether the customer will receive email notifications whenever there is a schedule change on one of his appointments.'; $lang['date_format'] = 'Date Format'; $lang['date_format_hint'] = 'Change the date display format (D - Date, M - Month, Y - Year).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Add your Google Analytics ID to be included in the booking page.'; $lang['availabilities_type'] = 'Availabilities Type'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/language/dutch/translations_lang.php b/src/application/language/dutch/translations_lang.php old mode 100644 new mode 100755 index 1c9787cb..2df2e536 --- a/src/application/language/dutch/translations_lang.php +++ b/src/application/language/dutch/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Klant mededelingen'; $lang['customer_notifications_hint'] = 'Kies of de klant een bevestiging krijgt per email als er de afspraak wordt aangepast.'; $lang['date_format'] = 'Datum formaat'; $lang['date_format_hint'] = 'Verander het datum formaat (D - dag, M - maand, Y - jaar).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Voeg je Google Analytics ID toe om deze te gebruiken op je boekings pagina.'; $lang['availabilities_type'] = 'Beschikbaarheidstype'; $lang['flexible'] = 'Flexibel'; diff --git a/src/application/language/english/translations_lang.php b/src/application/language/english/translations_lang.php old mode 100644 new mode 100755 index 18ead603..617b7a36 --- a/src/application/language/english/translations_lang.php +++ b/src/application/language/english/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Customer Notifications'; $lang['customer_notifications_hint'] = 'Defines whether the customer will receive email notifications whenever there is a schedule change on one of his appointments.'; $lang['date_format'] = 'Date Format'; $lang['date_format_hint'] = 'Change the date display format (D - Date, M - Month, Y - Year).'; +$lang['time_format'] = 'Time Format'; +$lang['time_format_hint'] = 'Change the time display format.'; $lang['google_analytics_code_hint'] = 'Add your Google Analytics ID to be included in the booking page.'; $lang['availabilities_type'] = 'Availabilities Type'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/language/finnish/translations_lang.php b/src/application/language/finnish/translations_lang.php old mode 100644 new mode 100755 index 471455c7..5de71c45 --- a/src/application/language/finnish/translations_lang.php +++ b/src/application/language/finnish/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Asiakas ilmoitukset'; $lang['customer_notifications_hint'] = 'Jos aktivoitu, asiakkaalle lähetetään ilmoitus jos varattuun aikaan tulee muutoksia.'; $lang['date_format'] = 'Päiväyksen muoto'; $lang['date_format_hint'] = 'Vaihda päiväyksen esitysmuoto (D - Päivä, M - Kuukausi, Y - Vuosi).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Lisää Google Analytics ID varaussivulle.'; $lang['availabilities_type'] = 'Availabilities Type'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/language/french/translations_lang.php b/src/application/language/french/translations_lang.php old mode 100644 new mode 100755 index 8159c450..a7b7a8ad --- a/src/application/language/french/translations_lang.php +++ b/src/application/language/french/translations_lang.php @@ -272,6 +272,8 @@ $lang['customer_notifications'] = 'Notifications aux clients'; $lang['customer_notifications_hint'] = 'Définit si les clients reçoivent des notifications par email chaque fois qu\'il y a un changement d\'horaire de l\'un de leurs rendez-vous.'; $lang['date_format'] = 'Format des Dates'; $lang['date_format_hint'] = 'Change le format d\'affichage des dates (D - Jour, M - Mois, Y - Année).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Renseignez l\'ID Google Analytics à utiliser dans la page des réservations.'; $lang['availabilities_type'] = 'Availabilities Type'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/language/german/translations_lang.php b/src/application/language/german/translations_lang.php old mode 100644 new mode 100755 index 532cd87f..1fe3a683 --- a/src/application/language/german/translations_lang.php +++ b/src/application/language/german/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Kunden Benachrichtigungen'; $lang['customer_notifications_hint'] = 'Stellen Sie ein, ob die Kunden eine E-Mail-Benachrichtigungen erhalten, jedes mal es gibt ein neue änderung auf ein Termin.'; $lang['date_format'] = 'Datumsformat'; $lang['date_format_hint'] = 'Ändern Sie das Datumsanzeigeformat (D - Datum, M - Monat, Y - Jahr).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Fügen Sie Ihre Google Analytics-ID hinzu, das auf der Buchungsseite enthalten wird.'; $lang['availabilities_type'] = 'Verfügungstyp'; $lang['flexible'] = 'Flexibel'; diff --git a/src/application/language/greek/translations_lang.php b/src/application/language/greek/translations_lang.php old mode 100644 new mode 100755 index 45257069..215a0783 --- a/src/application/language/greek/translations_lang.php +++ b/src/application/language/greek/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Ειδοποιήσεις Πελατών'; $lang['customer_notifications_hint'] = 'Ορίζει αν οι πελάτες θα λαμβάνουν ειδοποιήσεις μέσω email κάθε φορά που θα υπαχει μια αλλαγή σε κάποιο από τα ραντεβού τους.'; $lang['date_format'] = 'Μορφή Ημερομηνίας'; $lang['date_format_hint'] = 'Αλλάξτε την μορφή ημερομηνίας (D - Ημέρα, M - Μήνας, Y - Χρόνος).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Προσθέστε τον Google Analytics ID σας το οποίο θα συμπεριληφθεί στην σελίδα κράτησης.'; $lang['availabilities_type'] = 'Τύπος Διαθεσιμοτήτων'; $lang['flexible'] = 'Ευέλικτος'; diff --git a/src/application/language/hindi/translations_lang.php b/src/application/language/hindi/translations_lang.php old mode 100644 new mode 100755 index 6e83b42c..4ad393b6 --- a/src/application/language/hindi/translations_lang.php +++ b/src/application/language/hindi/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Customer Notifications'; $lang['customer_notifications_hint'] = 'Defines whether the customer will receive email notifications whenever there is a schedule change on one of his appointments.'; $lang['date_format'] = 'Date Format'; $lang['date_format_hint'] = 'Change the date display format (D - Date, M - Month, Y - Year).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Add your Google Analytics ID to be included in the booking page.'; $lang['availabilities_type'] = 'Availabilities Type'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/language/hungarian/translations_lang.php b/src/application/language/hungarian/translations_lang.php old mode 100644 new mode 100755 index 3001c55a..8fef7373 --- a/src/application/language/hungarian/translations_lang.php +++ b/src/application/language/hungarian/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Customer Notifications'; $lang['customer_notifications_hint'] = 'Defines whether the customer will receive email notifications whenever there is a schedule change on one of his appointments.'; $lang['date_format'] = 'Date Format'; $lang['date_format_hint'] = 'Change the date display format (D - Date, M - Month, Y - Year).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Add your Google Analytics ID to be included in the booking page.'; $lang['availabilities_type'] = 'Availabilities Type'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/language/italian/translations_lang.php b/src/application/language/italian/translations_lang.php old mode 100644 new mode 100755 index b79449da..3279c203 --- a/src/application/language/italian/translations_lang.php +++ b/src/application/language/italian/translations_lang.php @@ -280,6 +280,8 @@ $lang['customer_notifications'] = 'Notifiche cliente'; $lang['customer_notifications_hint'] = 'Definisce se il cliente riceverà notifiche email ogni volta che c\'è un cambiamento di programma su uno dei suoi appuntamenti.'; $lang['date_format'] = 'Formato data'; $lang['date_format_hint'] = 'Cambia il formato di visualizzazione della data (D - Giorno, M - Mese, Y - Anno).'; +$lang['time_format'] = 'Formato orario'; +$lang['time_format_hint'] = 'Cambia il formato di visualizzazione dell\'orario.'; $lang['google_analytics_code_hint'] = 'Aggiunti il tuo ID di Google Analytics per includerlo nella pagina di prenotazione.'; $lang['availabilities_type'] = 'Availabilities Type'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/language/japanese/translations_lang.php b/src/application/language/japanese/translations_lang.php old mode 100644 new mode 100755 index 151c3db4..3fa89b29 --- a/src/application/language/japanese/translations_lang.php +++ b/src/application/language/japanese/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Customer Notifications'; $lang['customer_notifications_hint'] = 'Defines whether the customer will receive email notifications whenever there is a schedule change on one of his appointments.'; $lang['date_format'] = 'Date Format'; $lang['date_format_hint'] = 'Change the date display format (D - Date, M - Month, Y - Year).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Add your Google Analytics ID to be included in the booking page.'; $lang['availabilities_type'] = 'Availabilities Type'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/language/luxembourgish/translations_lang.php b/src/application/language/luxembourgish/translations_lang.php old mode 100644 new mode 100755 index 45ba24e0..2b4ba04d --- a/src/application/language/luxembourgish/translations_lang.php +++ b/src/application/language/luxembourgish/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Customer Notifications'; $lang['customer_notifications_hint'] = 'Defines whether the customer will receive email notifications whenever there is a schedule change on one of his appointments.'; $lang['date_format'] = 'Date Format'; $lang['date_format_hint'] = 'Change the date display format (D - Date, M - Month, Y - Year).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Add your Google Analytics ID to be included in the booking page.'; $lang['availabilities_type'] = 'Availabilities Type'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/language/polish/translations_lang.php b/src/application/language/polish/translations_lang.php old mode 100644 new mode 100755 index 31b2d40a..fc2493ea --- a/src/application/language/polish/translations_lang.php +++ b/src/application/language/polish/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Customer Notifications'; $lang['customer_notifications_hint'] = 'Defines whether the customer will receive email notifications whenever there is a schedule change on one of his appointments.'; $lang['date_format'] = 'Date Format'; $lang['date_format_hint'] = 'Change the date display format (D - Date, M - Month, Y - Year).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Add your Google Analytics ID to be included in the booking page.'; $lang['availabilities_type'] = 'Availabilities Type'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/language/portuguese-br/translations_lang.php b/src/application/language/portuguese-br/translations_lang.php old mode 100644 new mode 100755 index 7594aa6b..d00e6e94 --- a/src/application/language/portuguese-br/translations_lang.php +++ b/src/application/language/portuguese-br/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Notificações de Clientes'; $lang['customer_notifications_hint'] = 'Define se o cliente receberá ou não, notificações por email sempre que um de seus agendamentos sejam alterados de horário.'; $lang['date_format'] = 'Formato da Data'; $lang['date_format_hint'] = 'Altera o formato de visualização da Data (D - Data, M - Mes, Y - Ano).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Adicione o seu ID do Google Analytics para ser incluido na pagina de agendamentos.'; $lang['availabilities_type'] = 'Availabilities Type'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/language/portuguese/translations_lang.php b/src/application/language/portuguese/translations_lang.php old mode 100644 new mode 100755 index b6ed6f2b..c2a9a8c9 --- a/src/application/language/portuguese/translations_lang.php +++ b/src/application/language/portuguese/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Customer Notifications'; $lang['customer_notifications_hint'] = 'Defines whether the customer will receive email notifications whenever there is a schedule change on one of his appointments.'; $lang['date_format'] = 'Date Format'; $lang['date_format_hint'] = 'Change the date display format (D - Date, M - Month, Y - Year).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Add your Google Analytics ID to be included in the booking page.'; $lang['availabilities_type'] = 'Availabilities Type'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/language/romanian/translations_lang.php b/src/application/language/romanian/translations_lang.php old mode 100644 new mode 100755 index bc00172e..aba0ad53 --- a/src/application/language/romanian/translations_lang.php +++ b/src/application/language/romanian/translations_lang.php @@ -280,6 +280,8 @@ $lang['customer_notifications'] = 'Customer Notifications'; $lang['customer_notifications_hint'] = 'Defines whether the customer will receive email notifications whenever there is a schedule change on one of his appointments.'; $lang['date_format'] = 'Date Format'; $lang['date_format_hint'] = 'Change the date display format (D - Date, M - Month, Y - Year).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Add your Google Analytics ID to be included in the booking page.'; $lang['availabilities_type'] = 'Availabilities Type'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/language/russian/translations_lang.php b/src/application/language/russian/translations_lang.php old mode 100644 new mode 100755 index 628d77cd..d51c2c9e --- a/src/application/language/russian/translations_lang.php +++ b/src/application/language/russian/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Customer Notifications'; $lang['customer_notifications_hint'] = 'Defines whether the customer will receive email notifications whenever there is a schedule change on one of his appointments.'; $lang['date_format'] = 'Date Format'; $lang['date_format_hint'] = 'Change the date display format (D - Date, M - Month, Y - Year).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Add your Google Analytics ID to be included in the booking page.'; $lang['availabilities_type'] = 'Availabilities Type'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/language/slovak/translations_lang.php b/src/application/language/slovak/translations_lang.php old mode 100644 new mode 100755 index 1fb0e95a..18a9499f --- a/src/application/language/slovak/translations_lang.php +++ b/src/application/language/slovak/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Upozornenia zákazníka'; $lang['customer_notifications_hint'] = 'Určuje, či zákazník dostane e-mailové upozornenia vždy, keď nastane zmena plánu na jednej z jeho rezervácií.'; $lang['date_format'] = 'Formát dátumu'; $lang['date_format_hint'] = 'Zmeňte formát zobrazenia dátumu (D - Dátum, M - Mesiac, Y - Rok).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Pridajte svoje ID služby Google Analytics, aby ste bola zahrnutá do stránky rezervácie.'; $lang['availabilities_type'] = 'Typ dostupnosti'; $lang['flexible'] = 'Flexibilný'; diff --git a/src/application/language/spanish/translations_lang.php b/src/application/language/spanish/translations_lang.php old mode 100644 new mode 100755 index a5c3f145..237401e9 --- a/src/application/language/spanish/translations_lang.php +++ b/src/application/language/spanish/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Notificaciones de Clientes'; $lang['customer_notifications_hint'] = 'Define si su cliente recibirá notificaciones de correo cada vez que una agenda cambia o alguna de sus citas.'; $lang['date_format'] = 'Formato de Fecha'; $lang['date_format_hint'] = 'Cambia el formato de fecha para mostrar (D - Día, M - Mes, Y - Año).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Agrega tu ID de Google Analytics para ser incluido en la página de reservas.'; $lang['availabilities_type'] = 'Tipos disponibles'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/language/turkish/translations_lang.php b/src/application/language/turkish/translations_lang.php old mode 100644 new mode 100755 index 8d02230a..2d78e152 --- a/src/application/language/turkish/translations_lang.php +++ b/src/application/language/turkish/translations_lang.php @@ -274,6 +274,8 @@ $lang['customer_notifications'] = 'Customer Notifications'; $lang['customer_notifications_hint'] = 'Defines whether the customer will receive email notifications whenever there is a schedule change on one of his appointments.'; $lang['date_format'] = 'Date Format'; $lang['date_format_hint'] = 'Change the date display format (D - Date, M - Month, Y - Year).'; +$lang['time_format'] = ''; +$lang['time_format_hint'] = ''; $lang['google_analytics_code_hint'] = 'Add your Google Analytics ID to be included in the booking page.'; $lang['availabilities_type'] = 'Availabilities Type'; $lang['flexible'] = 'Flexible'; diff --git a/src/application/views/appointments/book.php b/src/application/views/appointments/book.php old mode 100644 new mode 100755 index 4eb5ab00..2aca05ab --- a/src/application/views/appointments/book.php +++ b/src/application/views/appointments/book.php @@ -327,6 +327,7 @@ baseUrl : , manageMode : , dateFormat : , + timeFormat : , appointmentData : , providerData : , customerData : , diff --git a/src/application/views/backend/calendar.php b/src/application/views/backend/calendar.php old mode 100644 new mode 100755 index dd8682a9..b0e0afe6 --- a/src/application/views/backend/calendar.php +++ b/src/application/views/backend/calendar.php @@ -19,6 +19,7 @@ 'baseUrl' : , 'bookAdvanceTimeout' : , 'dateFormat' : , + 'timeFormat' : , 'editAppointment' : , 'customers' : , 'secretaryProviders' : , diff --git a/src/application/views/backend/customers.php b/src/application/views/backend/customers.php old mode 100644 new mode 100755 index e588d4d3..67a92728 --- a/src/application/views/backend/customers.php +++ b/src/application/views/backend/customers.php @@ -7,6 +7,7 @@ availableProviders : , availableServices : , dateFormat : , + timeFormat : , baseUrl : , customers : , user : { diff --git a/src/application/views/backend/services.php b/src/application/views/backend/services.php old mode 100644 new mode 100755 index d1c74fd5..3c28e38e --- a/src/application/views/backend/services.php +++ b/src/application/views/backend/services.php @@ -6,6 +6,7 @@ csrfToken : security->get_csrf_hash()) ?>, baseUrl : , dateFormat : , + timeFormat : , services : , categories : , user : { diff --git a/src/application/views/backend/settings.php b/src/application/views/backend/settings.php old mode 100644 new mode 100755 index 2f526b3d..00b5bf7a --- a/src/application/views/backend/settings.php +++ b/src/application/views/backend/settings.php @@ -9,6 +9,7 @@ 'csrfToken' : security->get_csrf_hash()) ?>, 'baseUrl' : , 'dateFormat' : , + 'timeFormat' : , 'userSlug' : , 'settings' : { 'system' : , @@ -117,6 +118,18 @@ +
+ + + + + +

diff --git a/src/application/views/backend/users.php b/src/application/views/backend/users.php old mode 100644 new mode 100755 index fba5ad81..7e420ba1 --- a/src/application/views/backend/users.php +++ b/src/application/views/backend/users.php @@ -10,6 +10,7 @@ csrfToken : security->get_csrf_hash()) ?>, baseUrl : , dateFormat : , + timeFormat : , admins : , providers : , secretaries : , diff --git a/src/assets/js/backend_calendar_appointments_modal.js b/src/assets/js/backend_calendar_appointments_modal.js old mode 100644 new mode 100755 index 01a67606..20393e48 --- a/src/assets/js/backend_calendar_appointments_modal.js +++ b/src/assets/js/backend_calendar_appointments_modal.js @@ -391,7 +391,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa $dialog.find('#start-datetime').datetimepicker({ dateFormat: dateFormat, - timeFormat: 'h:mm TT', + timeFormat: (GlobalVariables.timeFormat === 'h:mm tt') ? 'h:mm TT' : GlobalVariables.timeFormat, // Translation dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday, @@ -421,7 +421,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa $dialog.find('#end-datetime').datetimepicker({ dateFormat: dateFormat, - timeFormat: 'h:mm TT', + timeFormat: (GlobalVariables.timeFormat === 'h:mm tt') ? 'h:mm TT' : GlobalVariables.timeFormat, // Translation dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday, diff --git a/src/assets/js/backend_calendar_default_view.js b/src/assets/js/backend_calendar_default_view.js old mode 100644 new mode 100755 index 07a811b3..dcd74838 --- a/src/assets/js/backend_calendar_default_view.js +++ b/src/assets/js/backend_calendar_default_view.js @@ -333,7 +333,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {}; '' + EALang.email + ' ' + event.data.customer.email + '
' + - '' + EALang.provider + ' ' + '' + EALang.phone_number + ' ' + event.data.customer.phone_number + '
' + '
' + @@ -1062,6 +1062,23 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {}; throw new Error('Invalid date format setting provided!', GlobalVariables.dateFormat); } + // Time formats + var timeFormat = ''; + var slotTimeFormat= ''; + + switch (GlobalVariables.timeFormat) { + case 'HH:mm': + timeFormat = 'H:mm'; + slotTimeFormat = 'H(:mm)'; + break; + case 'h:mm tt': + timeFormat = 'h:mm A'; + slotTimeFormat = 'h(:mm) A'; + break; + default: + throw new Error('Invalid time format setting provided!', GlobalVariables.timeFormat); + } + var defaultView = window.innerWidth < 468 ? 'agendaDay' : 'agendaWeek'; // Initialize page calendar @@ -1071,8 +1088,8 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {}; editable: true, firstDay: 0, snapDuration: '00:30:00', - timeFormat: 'h:mm A', - slotLabelFormat: 'h(:mm) A', + timeFormat: timeFormat, + slotLabelFormat: slotTimeFormat, allDayText: EALang.all_day, columnFormat: columnFormat, titleFormat: 'MMMM YYYY', diff --git a/src/assets/js/backend_calendar_table_view.js b/src/assets/js/backend_calendar_table_view.js old mode 100644 new mode 100755 index 5b0fd9bb..051b694f --- a/src/assets/js/backend_calendar_table_view.js +++ b/src/assets/js/backend_calendar_table_view.js @@ -686,7 +686,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; $event.html( appointment.customer.first_name.charAt(0) + '. ' + appointment.customer.last_name + - ' ' + startDate.toString('h:mm tt') + ' ' + ' ' + startDate.toString(GlobalVariables.timeFormat) + ' ' + (eventDuration !== parseInt(appointment.service.duration) ? '(' + eventDuration + '\')' : '') ); @@ -708,7 +708,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; $event.appendTo($(tr).prev().find('td').eq(cellIndex)); // Remove the hour from the event if it is the same as the row. - if (eventDate.toString('h:mm tt') === $(tr).prev().find('td').eq(0).text()) { + if (eventDate.toString(GlobalVariables.timeFormat) === $(tr).prev().find('td').eq(0).text()) { $event.find('.hour').remove(); } @@ -747,7 +747,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; var $event = $('
'); $event.html((unavailability.notes || EALang.unavailable) + - ' ' + eventDate.toString('h:mm tt') + ' (' + eventDuration + '\')'); + ' ' + eventDate.toString(GlobalVariables.timeFormat) + ' (' + eventDuration + '\')'); $event.data(unavailability); @@ -763,7 +763,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; $event.appendTo($(tr).prev().find('td').eq(1)); // Remove the hour from the event if it is the same as the row. - if (eventDate.toString('h:mm tt') === $(tr).prev().find('td').eq(0).text()) { + if (eventDate.toString(GlobalVariables.timeFormat) === $(tr).prev().find('td').eq(0).text()) { $event.find('.hour').remove(); } @@ -798,7 +798,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; $event.html( EALang.break + - ' ' + eventDate.toString('h:mm tt') + ' (' + eventDuration + '\')'); + ' ' + eventDate.toString(GlobalVariables.timeFormat) + ' (' + eventDuration + '\')'); $event.data(entry); @@ -812,7 +812,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {}; if (eventDate < cellDate) { // Remove the hour from the event if it is the same as the row. - if (eventDate.toString('h:mm tt') === $(tr).prev().find('td').eq(0).text()) { + if (eventDate.toString(GlobalVariables.timeFormat) === $(tr).prev().find('td').eq(0).text()) { $event.find('.hour').remove(); } diff --git a/src/assets/js/backend_calendar_unavailabilities_modal.js b/src/assets/js/backend_calendar_unavailabilities_modal.js old mode 100644 new mode 100755 index 7678f833..73976f85 --- a/src/assets/js/backend_calendar_unavailabilities_modal.js +++ b/src/assets/js/backend_calendar_unavailabilities_modal.js @@ -183,7 +183,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili $dialog.find('#unavailable-start').datetimepicker({ dateFormat: dateFormat, - timeFormat: 'h:mm TT', + timeFormat: (GlobalVariables.timeFormat === 'h:mm tt') ? 'h:mm TT' : GlobalVariables.timeFormat, // Translation dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday, @@ -213,7 +213,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili $dialog.find('#unavailable-end').datetimepicker({ dateFormat: dateFormat, - timeFormat: 'h:mm TT', + timeFormat: (GlobalVariables.timeFormat === 'h:mm tt') ? 'h:mm TT' : GlobalVariables.timeFormat, // Translation dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday, diff --git a/src/assets/js/frontend_book_api.js b/src/assets/js/frontend_book_api.js old mode 100644 new mode 100755 index 79104aa2..341c25d7 --- a/src/assets/js/frontend_book_api.js +++ b/src/assets/js/frontend_book_api.js @@ -78,7 +78,7 @@ window.FrontendBookApi = window.FrontendBookApi || {}; } $('#available-hours div:eq(' + (currColumn - 1) + ')').append( - '' + Date.parse(availableHour).toString('h:mm tt') + '
'); + '' + Date.parse(availableHour).toString(GlobalVariables.timeFormat) + '
'); }); if (FrontendBook.manageMode) { @@ -87,7 +87,7 @@ window.FrontendBookApi = window.FrontendBookApi || {}; $('.available-hour').filter(function () { return $(this).text() === Date.parseExact( GlobalVariables.appointmentData.start_datetime, - 'yyyy-MM-dd HH:mm:ss').toString('h:mm tt'); + 'yyyy-MM-dd HH:mm:ss').toString(GlobalVariables.timeFormat); }).addClass('selected-hour'); } else { // Set the first available hour as the default selection. diff --git a/src/assets/js/general_functions.js b/src/assets/js/general_functions.js old mode 100644 new mode 100755 index 0a0587fb..a20558f7 --- a/src/assets/js/general_functions.js +++ b/src/assets/js/general_functions.js @@ -411,7 +411,7 @@ window.GeneralFunctions = window.GeneralFunctions || {}; */ exports.formatDate = function (date, dateFormatSetting, addHours) { var format, result; - var hours = addHours ? ' h:mm tt' : ''; + var hours = addHours ? ' ' + GlobalVariables.timeFormat : ''; switch (dateFormatSetting) { case 'DMY': diff --git a/src/assets/js/working_plan.js b/src/assets/js/working_plan.js old mode 100644 new mode 100755 index d0826bc5..df39fae6 --- a/src/assets/js/working_plan.js +++ b/src/assets/js/working_plan.js @@ -48,8 +48,8 @@ $.each(workingPlan, function (index, workingDay) { if (workingDay != null) { $('#' + index).prop('checked', true); - $('#' + index + '-start').val(Date.parse(workingDay.start).toString('h:mm tt').toUpperCase()); - $('#' + index + '-end').val(Date.parse(workingDay.end).toString('h:mm tt').toUpperCase()); + $('#' + index + '-start').val(Date.parse(workingDay.start).toString(GlobalVariables.timeFormat).toUpperCase()); + $('#' + index + '-end').val(Date.parse(workingDay.end).toString(GlobalVariables.timeFormat).toUpperCase()); // Add the day's breaks on the breaks table. $.each(workingDay.breaks, function (i, brk) { @@ -58,8 +58,8 @@ var tr = '' + '' + GeneralFunctions.ucaseFirstLetter(day) + '' + - '' + Date.parse(brk.start).toString('h:mm tt').toUpperCase() + '' + - '' + Date.parse(brk.end).toString('h:mm tt').toUpperCase() + '' + + '' + Date.parse(brk.start).toString(GlobalVariables.timeFormat).toUpperCase() + '' + + '' + Date.parse(brk.end).toString(GlobalVariables.timeFormat).toUpperCase() + '' + '' + '