Added time format selection

This commit is contained in:
Andrea 2018-03-06 12:20:47 +01:00
parent dfbae5a2c2
commit d971f4f097
40 changed files with 153 additions and 37 deletions

View file

@ -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

5
src/application/controllers/Backend.php Normal file → Executable file
View file

@ -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);

6
src/application/controllers/Backend_api.php Normal file → Executable file
View file

@ -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

4
src/application/language/arabic/translations_lang.php Normal file → Executable file
View file

@ -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'] = 'عدد الحاضرين';

View file

@ -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'] = 'Гъвкав';

2
src/application/language/chinese/translations_lang.php Normal file → Executable file
View file

@ -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';

2
src/application/language/danish/translations_lang.php Normal file → Executable file
View file

@ -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';

2
src/application/language/dutch/translations_lang.php Normal file → Executable file
View file

@ -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';

2
src/application/language/english/translations_lang.php Normal file → Executable file
View file

@ -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';

2
src/application/language/finnish/translations_lang.php Normal file → Executable file
View file

@ -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';

2
src/application/language/french/translations_lang.php Normal file → Executable file
View file

@ -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';

2
src/application/language/german/translations_lang.php Normal file → Executable file
View file

@ -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';

2
src/application/language/greek/translations_lang.php Normal file → Executable file
View file

@ -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'] = 'Ευέλικτος';

2
src/application/language/hindi/translations_lang.php Normal file → Executable file
View file

@ -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';

View file

@ -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';

2
src/application/language/italian/translations_lang.php Normal file → Executable file
View file

@ -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';

View file

@ -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';

View file

@ -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';

2
src/application/language/polish/translations_lang.php Normal file → Executable file
View file

@ -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';

View file

@ -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';

View file

@ -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';

View file

@ -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';

2
src/application/language/russian/translations_lang.php Normal file → Executable file
View file

@ -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';

2
src/application/language/slovak/translations_lang.php Normal file → Executable file
View file

@ -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ý';

2
src/application/language/spanish/translations_lang.php Normal file → Executable file
View file

@ -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';

2
src/application/language/turkish/translations_lang.php Normal file → Executable file
View file

@ -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';

1
src/application/views/appointments/book.php Normal file → Executable file
View file

@ -327,6 +327,7 @@
baseUrl : <?= json_encode(config('base_url')) ?>,
manageMode : <?= $manage_mode ? 'true' : 'false' ?>,
dateFormat : <?= json_encode($date_format) ?>,
timeFormat : <?= json_encode($time_format) ?>,
appointmentData : <?= json_encode($appointment_data) ?>,
providerData : <?= json_encode($provider_data) ?>,
customerData : <?= json_encode($customer_data) ?>,

1
src/application/views/backend/calendar.php Normal file → Executable file
View file

@ -19,6 +19,7 @@
'baseUrl' : <?= json_encode($base_url) ?>,
'bookAdvanceTimeout' : <?= $book_advance_timeout ?>,
'dateFormat' : <?= json_encode($date_format) ?>,
'timeFormat' : <?= json_encode($time_format) ?>,
'editAppointment' : <?= json_encode($edit_appointment) ?>,
'customers' : <?= json_encode($customers) ?>,
'secretaryProviders' : <?= json_encode($secretary_providers) ?>,

1
src/application/views/backend/customers.php Normal file → Executable file
View file

@ -7,6 +7,7 @@
availableProviders : <?= json_encode($available_providers) ?>,
availableServices : <?= json_encode($available_services) ?>,
dateFormat : <?= json_encode($date_format) ?>,
timeFormat : <?= json_encode($time_format) ?>,
baseUrl : <?= json_encode($base_url) ?>,
customers : <?= json_encode($customers) ?>,
user : {

1
src/application/views/backend/services.php Normal file → Executable file
View file

@ -6,6 +6,7 @@
csrfToken : <?= json_encode($this->security->get_csrf_hash()) ?>,
baseUrl : <?= json_encode($base_url) ?>,
dateFormat : <?= json_encode($date_format) ?>,
timeFormat : <?= json_encode($time_format) ?>,
services : <?= json_encode($services) ?>,
categories : <?= json_encode($categories) ?>,
user : {

13
src/application/views/backend/settings.php Normal file → Executable file
View file

@ -9,6 +9,7 @@
'csrfToken' : <?= json_encode($this->security->get_csrf_hash()) ?>,
'baseUrl' : <?= json_encode($base_url) ?>,
'dateFormat' : <?= json_encode($date_format) ?>,
'timeFormat' : <?= json_encode($time_format) ?>,
'userSlug' : <?= json_encode($role_slug) ?>,
'settings' : {
'system' : <?= json_encode($system_settings) ?>,
@ -117,6 +118,18 @@
<?= lang('date_format_hint') ?>
</span>
</div>
<div class="form-group">
<label for="time-format">
<?= lang('time_format') ?>
</label>
<select class="form-control" id="time-format" data-field="time_format">
<option value="h:mm tt">4:30 PM</option>
<option value="HH:mm">16:30</option>
</select>
<span class="help-block">
<?= lang('time_format_hint') ?>
</span>
</div>
<div class="form-group">
<label><?= lang('customer_notifications') ?></label>
<br>

1
src/application/views/backend/users.php Normal file → Executable file
View file

@ -10,6 +10,7 @@
csrfToken : <?= json_encode($this->security->get_csrf_hash()) ?>,
baseUrl : <?= json_encode($base_url) ?>,
dateFormat : <?= json_encode($date_format) ?>,
timeFormat : <?= json_encode($time_format) ?>,
admins : <?= json_encode($admins) ?>,
providers : <?= json_encode($providers) ?>,
secretaries : <?= json_encode($secretaries) ?>,

4
src/assets/js/backend_calendar_appointments_modal.js Normal file → Executable file
View file

@ -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,

23
src/assets/js/backend_calendar_default_view.js Normal file → Executable file
View file

@ -333,7 +333,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
'<strong>' + EALang.email + '</strong> '
+ event.data.customer.email
+ '<br>' +
'<strong>' + EALang.provider + '</strong> '
'<strong>' + EALang.phone_number + '</strong> '
+ event.data.customer.phone_number
+ '<hr>' +
'<div class="text-center">' +
@ -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',

12
src/assets/js/backend_calendar_table_view.js Normal file → Executable file
View file

@ -686,7 +686,7 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
$event.html(
appointment.customer.first_name.charAt(0) + '. ' + appointment.customer.last_name +
' <span class="hour">' + startDate.toString('h:mm tt') + '</span> '
' <span class="hour">' + startDate.toString(GlobalVariables.timeFormat) + '</span> '
+ (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 = $('<div class="event unavailability" />');
$event.html((unavailability.notes || EALang.unavailable) +
' <span class="hour">' + eventDate.toString('h:mm tt') + '</span> (' + eventDuration + '\')');
' <span class="hour">' + eventDate.toString(GlobalVariables.timeFormat) + '</span> (' + 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 +
' <span class="hour">' + eventDate.toString('h:mm tt') + '</span> (' + eventDuration + '\')');
' <span class="hour">' + eventDate.toString(GlobalVariables.timeFormat) + '</span> (' + 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();
}

View file

@ -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,

4
src/assets/js/frontend_book_api.js Normal file → Executable file
View file

@ -78,7 +78,7 @@ window.FrontendBookApi = window.FrontendBookApi || {};
}
$('#available-hours div:eq(' + (currColumn - 1) + ')').append(
'<span class="available-hour">' + Date.parse(availableHour).toString('h:mm tt') + '</span><br/>');
'<span class="available-hour">' + Date.parse(availableHour).toString(GlobalVariables.timeFormat) + '</span><br/>');
});
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.

2
src/assets/js/general_functions.js Normal file → Executable file
View file

@ -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':

24
src/assets/js/working_plan.js Normal file → Executable file
View file

@ -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 =
'<tr>' +
'<td class="break-day editable">' + GeneralFunctions.ucaseFirstLetter(day) + '</td>' +
'<td class="break-start editable">' + Date.parse(brk.start).toString('h:mm tt').toUpperCase() + '</td>' +
'<td class="break-end editable">' + Date.parse(brk.end).toString('h:mm tt').toUpperCase() + '</td>' +
'<td class="break-start editable">' + Date.parse(brk.start).toString(GlobalVariables.timeFormat).toUpperCase() + '</td>' +
'<td class="break-end editable">' + Date.parse(brk.end).toString(GlobalVariables.timeFormat).toUpperCase() + '</td>' +
'<td>' +
'<button type="button" class="btn btn-default btn-sm edit-break" title="' + EALang.edit + '">' +
'<span class="glyphicon glyphicon-pencil"></span>' +
@ -172,8 +172,8 @@
var id = $(this).attr('id');
if ($(this).prop('checked') == true) {
$('#' + id + '-start').prop('disabled', false).val('9:00 AM');
$('#' + id + '-end').prop('disabled', false).val('6:00 PM');
$('#' + id + '-start').prop('disabled', false).val((GlobalVariables.timeFormat === 'h:mm tt') ? '9:00 AM' : '09:00');
$('#' + id + '-end').prop('disabled', false).val((GlobalVariables.timeFormat === 'h:mm tt') ? '6:00 PM' : '18:00');
} else {
$('#' + id + '-start').prop('disabled', true).val('');
$('#' + id + '-end').prop('disabled', true).val('');
@ -190,8 +190,8 @@
var tr =
'<tr>' +
'<td class="break-day editable">' + EALang.sunday + '</td>' +
'<td class="break-start editable">9:00 AM</td>' +
'<td class="break-end editable">10:00 AM</td>' +
'<td class="break-start editable">' + ((GlobalVariables.timeFormat === 'h:mm tt') ? '9:00 AM' : '09:00') + '</td>' +
'<td class="break-end editable">' + ((GlobalVariables.timeFormat === 'h:mm tt') ? '10:00 AM' : '10:00') + '</td>' +
'<td>' +
'<button type="button" class="btn btn-default btn-sm edit-break" title="' + EALang.edit + '">' +
'<span class="glyphicon glyphicon-pencil"></span>' +
@ -234,7 +234,7 @@
// Make all cells in current row editable.
$(this).parent().parent().children().trigger('edit');
$(this).parent().parent().find('.break-start input, .break-end input').timepicker({
timeFormat: 'h:mm TT',
timeFormat: (GlobalVariables.timeFormat === 'h:mm tt') ? 'h:mm TT' : GlobalVariables.timeFormat,
currentText: EALang.now,
closeText: EALang.close,
timeOnlyTitle: EALang.select_time,
@ -295,7 +295,7 @@
end = Date.parse($modifiedRow.find('.break-end input').val());
if (start > end) {
$modifiedRow.find('.break-end input').val(start.addHours(1).toString('h:mm tt'));
$modifiedRow.find('.break-end input').val(start.addHours(1).toString(GlobalVariables.timeFormat));
}
this.enableSubmit = true;
@ -361,7 +361,7 @@
if (disabled == false) {
// Set timepickers where needed.
$('.working-plan input:text').timepicker({
timeFormat: 'h:mm TT',
timeFormat: (GlobalVariables.timeFormat === 'h:mm tt') ? 'h:mm TT' : GlobalVariables.timeFormat,
currentText: EALang.now,
closeText: EALang.close,
timeOnlyTitle: EALang.select_time,
@ -375,7 +375,7 @@
end = Date.parse($(this).parent().parent().find('.work-end').val());
if (start > end) {
$(this).parent().parent().find('.work-end').val(start.addHours(1).toString('h:mm tt'));
$(this).parent().parent().find('.work-end').val(start.addHours(1).toString((GlobalVariables.timeFormat === 'h:mm tt') ? 'h:mm TT' : GlobalVariables.timeFormat));
}
}
});

32
src/engine/Notifications/Email.php Normal file → Executable file
View file

@ -119,14 +119,26 @@ class Email {
throw new \Exception('Invalid date_format value: ' . $company['date_format']);
}
switch ($company['time_format'])
{
case 'HH:mm':
$timeFormat = 'H:i';
break;
case 'h:mm tt':
$timeFormat = 'g:i A';
break;
default:
throw new \Exception('Invalid time_format value: ' . $company['time_format']);
}
// Prepare template replace array.
$replaceArray = [
'$email_title' => $title->get(),
'$email_message' => $message->get(),
'$appointment_service' => $service['name'],
'$appointment_provider' => $provider['first_name'] . ' ' . $provider['last_name'],
'$appointment_start_date' => date($date_format . ' g:i A', strtotime($appointment['start_datetime'])),
'$appointment_end_date' => date($date_format . ' g:i A', strtotime($appointment['end_datetime'])),
'$appointment_start_date' => date($date_format . ' ' . $timeFormat, strtotime($appointment['start_datetime'])),
'$appointment_end_date' => date($date_format . ' ' . $timeFormat, strtotime($appointment['end_datetime'])),
'$appointment_link' => $appointmentLink->get(),
'$company_link' => $company['company_link'],
'$company_name' => $company['company_name'],
@ -211,13 +223,25 @@ class Email {
throw new \Exception('Invalid date_format value: ' . $company['date_format']);
}
// Prepare email template data.
switch ($company['time_format'])
{
case 'HH:mm':
$timeFormat = 'H:i';
break;
case 'h:mm tt':
$timeFormat = 'g:i A';
break;
default:
throw new \Exception('Invalid time_format value: ' . $company['time_format']);
}
// Prepare email template data.
$replaceArray = [
'$email_title' => $this->framework->lang->line('appointment_cancelled_title'),
'$email_message' => $this->framework->lang->line('appointment_removed_from_schedule'),
'$appointment_service' => $service['name'],
'$appointment_provider' => $provider['first_name'] . ' ' . $provider['last_name'],
'$appointment_date' => date($date_format . ' g:i A', strtotime($appointment['start_datetime'])),
'$appointment_date' => date($date_format . ' ' . $timeFormat, strtotime($appointment['start_datetime'])),
'$appointment_duration' => $service['duration'] . ' minutes',
'$company_link' => $company['company_link'],
'$company_name' => $company['company_name'],