Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: #1081 Add a way to hide unneeded form fields from clients #1082

Merged
2 changes: 1 addition & 1 deletion application/config/migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 21;
$config['migration_version'] = 22;


/*
Expand Down
12 changes: 12 additions & 0 deletions application/controllers/Appointments.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ public function index($appointment_hash = '')
$time_format = $this->settings_model->get_setting('time_format');
$first_weekday = $this->settings_model->get_setting('first_weekday');
$require_phone_number = $this->settings_model->get_setting('require_phone_number');
$show_field['phone-number'] = $this->settings_model->get_setting('show_phone_number');
$show_field['address'] = $this->settings_model->get_setting('show_address');
$show_field['city'] = $this->settings_model->get_setting('show_city');
$show_field['zip-code'] = $this->settings_model->get_setting('show_zip_code');
$show_field['notes'] = $this->settings_model->get_setting('show_notes');
$display_cookie_notice = $this->settings_model->get_setting('display_cookie_notice');
$cookie_notice_content = $this->settings_model->get_setting('cookie_notice_content');
$display_terms_and_conditions = $this->settings_model->get_setting('display_terms_and_conditions');
Expand Down Expand Up @@ -163,6 +168,7 @@ public function index($appointment_hash = '')
'time_format' => $time_format,
'first_weekday' => $first_weekday,
'require_phone_number' => $require_phone_number,
'show_field' => $show_field,
'appointment_data' => $appointment,
'provider_data' => $provider,
'customer_data' => $customer,
Expand Down Expand Up @@ -442,6 +448,12 @@ public function ajax_register_appointment()
$appointment = $post_data['appointment'];
$customer = $post_data['customer'];

if (!array_key_exists('address', $customer)){ $customer['address'] = ""; }
if (!array_key_exists('city', $customer)){ $customer['city'] = ""; }
if (!array_key_exists('zip_code', $customer)){ $customer['zip_code'] = ""; }
if (!array_key_exists('notes', $customer)){ $customer['notes'] = ""; }
if (!array_key_exists('phone_number', $customer)){ $customer['address'] = ""; }

// Check appointment availability before registering it to the database.
$appointment['id_users_provider'] = $this->check_datetime_availability();

Expand Down
18 changes: 18 additions & 0 deletions application/controllers/Backend_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,24 @@ public function ajax_save_settings()

$settings = json_decode($this->input->post('settings', FALSE), TRUE);

//check if phone number settings are valid
$phone_number_required = false;
$phone_number_shown = false;
foreach ($settings as $setting)
{
if ($setting['name'] == "require_phone_number"){
$phone_number_required = $setting['value'];
}

if ($setting['name'] == "show_phone_number"){
$phone_number_shown = $setting['value'];
}
}

if ($phone_number_required && !$phone_number_shown){//we have settings that break the appointments field.
throw new Exception("You cannot hide the phone number in the booking form while it's also required!");
}

$this->settings_model->save_settings($settings);
}
else
Expand Down
3 changes: 3 additions & 0 deletions application/language/arabic/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'الذهاب الى صفحة الحجوزات';
$lang['settings_saved'] = 'تم حفظ الاعدادات بنجاح';
$lang['general'] = 'عام';
$lang['client_form'] = 'نموذج العميل';
$lang['visible'] = 'مرئي';
$lang['hidden'] = 'مختفي';
$lang['business_logic'] = 'منطق الأعمال';
$lang['current_user'] = 'المستخدم الحالي';
$lang['about_app'] = 'About E!A';
Expand Down
3 changes: 3 additions & 0 deletions application/language/bulgarian/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Към страница за запазване.';
$lang['settings_saved'] = 'Настройките записани успешно.';
$lang['general'] = 'Общи';
$lang['client_form'] = 'Клиентска форма';
$lang['visible'] = 'видим';
$lang['hidden'] = 'Скрит';
$lang['business_logic'] = 'Бизнес логика';
$lang['current_user'] = 'Текущ потребител';
$lang['about_app'] = 'Относно';
Expand Down
3 changes: 3 additions & 0 deletions application/language/catalan/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Ves a la pàgina de reserves';
$lang['settings_saved'] = 'Les configuracions s\'han desat correctament.';
$lang['general'] = 'General';
$lang['client_form'] = 'Formulari del client';
$lang['visible'] = 'Visible';
$lang['hidden'] = 'Amagat';
$lang['business_logic'] = 'Lògica de negoci';
$lang['current_user'] = 'Usuari actual';
$lang['about_app'] = 'Quant a Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/chinese/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = '进入预约页面';
$lang['settings_saved'] = '设置成功保存.';
$lang['general'] = '一般设置';
$lang['client_form'] = '客户形态';
$lang['visible'] = '可见的';
$lang['hidden'] = '隐';
$lang['business_logic'] = '工作时间';
$lang['current_user'] = '目前登录用户';
$lang['about_app'] = '关于网上预约系统';
Expand Down
3 changes: 3 additions & 0 deletions application/language/czech/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Přejít na stránku rezervací';
$lang['settings_saved'] = 'Nastavení úspěšně uložena.';
$lang['general'] = 'Obecné';
$lang['client_form'] = 'Formulář klienta';
$lang['visible'] = 'Viditelný';
$lang['hidden'] = 'Skrytý';
$lang['business_logic'] = 'Business logika';
$lang['current_user'] = 'Přihlášený uživatel';
$lang['about_app'] = 'O aplikaci Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/danish/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Gå til booking siden';
$lang['settings_saved'] = 'Indstillingerne er gemt';
$lang['general'] = 'Generelt';
$lang['client_form'] = 'Klientform';
$lang['visible'] = 'Synlig';
$lang['hidden'] = 'Skjult';
$lang['business_logic'] = 'Forretningslogik';
$lang['current_user'] = 'Nuværende bruger';
$lang['about_app'] = 'Om Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/dutch/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Ga naar de boekingspagina';
$lang['settings_saved'] = 'Instellingen succesvol opgeslagen.';
$lang['general'] = 'Algemeen';
$lang['client_form'] = 'Klantformulier';
$lang['visible'] = 'Zichtbaar';
$lang['hidden'] = 'Verborgen';
$lang['business_logic'] = 'Bedrijfsinstellingen';
$lang['current_user'] = 'Huidige gebruiker';
$lang['about_app'] = 'Over Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/english/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Go To Booking Page';
$lang['settings_saved'] = 'Settings saved successfully.';
$lang['general'] = 'General';
$lang['client_form'] = 'Client Form';
$lang['visible'] = 'Visible';
$lang['hidden'] = 'Hidden';
$lang['business_logic'] = 'Business Logic';
$lang['current_user'] = 'Current User';
$lang['about_app'] = 'About Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/finnish/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Palaa ajanvaraussivulle';
$lang['settings_saved'] = 'Asetukset tallennettiin onnistuneesti.';
$lang['general'] = 'Yleinen';
$lang['client_form'] = 'Asiakaslomake';
$lang['visible'] = 'Näkyvä';
$lang['hidden'] = 'Piilotettu';
$lang['business_logic'] = 'Työajat';
$lang['current_user'] = 'Nykyinen käyttäjä';
$lang['about_app'] = 'Tietoja Easy!Appointments:sta';
Expand Down
3 changes: 3 additions & 0 deletions application/language/french/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Aller à la page de rendez-vous';
$lang['settings_saved'] = 'Paramètres sauvegardés avec succès.';
$lang['general'] = 'Général';
$lang['client_form'] = 'Formulaire de clientèle';
$lang['visible'] = 'Visible';
$lang['hidden'] = 'Caché';
$lang['business_logic'] = 'Logique commerciale';
$lang['current_user'] = 'Utilisateur actuel';
$lang['about_app'] = 'Au sujet d\'Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/german/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@
$lang['go_to_booking_page'] = 'Weiter zur Buchungsseite';
$lang['settings_saved'] = 'Einstellungen erfolgreich gesichert.';
$lang['general'] = 'Allgemeines';
$lang['client_form'] = 'Kundenformular';
$lang['visible'] = 'Sichtbar';
$lang['hidden'] = 'Versteckt';
$lang['business_logic'] = 'Unternehmerische Logik';
$lang['current_user'] = 'Aktueller Nutzer';
$lang['about_app'] = 'Über Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/greek/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Πλοήγηση Στην Σελίδα Κράτησης';
$lang['settings_saved'] = 'Οι ρυθμίσεις αποθηκεύτηκαν επιτυχώς.';
$lang['general'] = 'Γενικά';
$lang['client_form'] = 'Μορφή πελάτη';
$lang['visible'] = 'Ορατός';
$lang['hidden'] = 'Κρυμμένος';
$lang['business_logic'] = 'Επιχειρηματική Λογική';
$lang['current_user'] = 'Τρέχων Χρήστης';
$lang['about_app'] = 'Σχετικά με το Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/hebrew/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'עבור לדף ההזמנות';
$lang['settings_saved'] = 'ההגדרות נשמרו בהצלחה!';
$lang['general'] = 'כללי';
$lang['client_form'] = 'טופס הלקוח';
$lang['visible'] = 'גלוי';
$lang['hidden'] = 'מוּסתָר';
$lang['business_logic'] = 'לוגיקה עסקית';
$lang['current_user'] = 'משתמש נוכחי';
$lang['about_app'] = 'אודות Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/hindi/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'आरक्षण का पेज पर जाएं';
$lang['settings_saved'] = 'सेटिंग सफलतापूर्वक सेव.';
$lang['general'] = 'सामान्य';
$lang['client_form'] = 'क्लाइंट फॉर्म';
$lang['visible'] = 'दर्शनीय';
$lang['hidden'] = 'छिपा हुआ';
$lang['business_logic'] = 'व्यापार का तर्क';
$lang['current_user'] = 'तात्कालिक प्रयोगकर्ता';
$lang['about_app'] = 'ई ए के बारे में';
Expand Down
3 changes: 3 additions & 0 deletions application/language/hungarian/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Ugrás a foglalási oldalra';
$lang['settings_saved'] = 'Beállítások sikeresen mentve.';
$lang['general'] = 'Általános';
$lang['client_form'] = 'Ügyfélforma';
$lang['visible'] = 'Látható';
$lang['hidden'] = 'Rejtett';
$lang['business_logic'] = 'Business Logic';
$lang['current_user'] = 'Jelenlegi felhasználó';
$lang['about_app'] = 'Easy!Appointments-ról';
Expand Down
3 changes: 3 additions & 0 deletions application/language/italian/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Vai alla pagina delle prenotazioni';
$lang['settings_saved'] = 'Impostazioni salvate con successo.';
$lang['general'] = 'Generale';
$lang['client_form'] = 'Forma del cliente';
$lang['visible'] = 'Visible';
$lang['hidden'] = 'Nascosto';
$lang['business_logic'] = 'Business Logic';
$lang['current_user'] = 'Utente corrente';
$lang['about_app'] = 'Info su Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/japanese/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = '予約ページへ';
$lang['settings_saved'] = '設定は保存されました。';
$lang['general'] = '一般';
$lang['client_form'] = 'お客様のフォーム';
$lang['visible'] = '目に見える';
$lang['hidden'] = '目に見えません';
$lang['business_logic'] = '勤務時間設定';
$lang['current_user'] = '現在のユーザー';
$lang['about_app'] = 'Easy!Appointmentsとは。';
Expand Down
3 changes: 3 additions & 0 deletions application/language/luxembourgish/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Gitt op d\'Buchungssäit';
$lang['settings_saved'] = 'Astellungen erfollegräich gespäichert.';
$lang['general'] = 'Allgemenges';
$lang['client_form'] = 'Client Form';
$lang['visible'] = 'Fir siichtbar';
$lang['hidden'] = 'Verstoppen';
$lang['business_logic'] = 'Business Logik';
$lang['current_user'] = 'Ugemellte Benotzer';
$lang['about_app'] = 'Iwwert Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/marathi/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'आरक्षण पृष्ठावर जा';
$lang['settings_saved'] = 'सेव्ह यशस्वीरित्या सेट करीत आहे.';
$lang['general'] = 'सामान्य';
$lang['client_form'] = 'क्लायंट फॉर्म';
$lang['visible'] = 'दृश्यमान';
$lang['hidden'] = 'लपलेले';
$lang['business_logic'] = 'व्यवसाय तर्कशास्त्र';
$lang['current_user'] = 'तात्कालिक प्रयोगकर्ता';
$lang['about_app'] = 'अ‍ॅप बद्दल...';
Expand Down
3 changes: 3 additions & 0 deletions application/language/persian/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@
$lang['go_to_booking_page'] = 'برو به صفحه ثبت ملاقات';
$lang['settings_saved'] = 'تنظیمات با موفقیت ذخیره شد';
$lang['general'] = 'عمومی';
$lang['client_form'] = 'فرم مشتری';
$lang['visible'] = 'قابل رویت';
$lang['hidden'] = 'پنهان';
$lang['business_logic'] = 'منطق تجارت';
$lang['current_user'] = 'کاربر جاری';
$lang['about_app'] = 'درباره Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/polish/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Idź do strony bookowania';
$lang['settings_saved'] = 'Ustawienia zapisano.';
$lang['general'] = 'Ogólne';
$lang['client_form'] = 'Formularz klienta';
$lang['visible'] = 'Widoczny';
$lang['hidden'] = 'Ukryty';
$lang['business_logic'] = 'Podział Firmy';
$lang['current_user'] = 'Bieżący Użytkownik';
$lang['about_app'] = 'O Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/portuguese-br/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@
$lang['go_to_booking_page'] = 'Ir para a página de reserva';
$lang['settings_saved'] = 'Definições salvas com sucesso.';
$lang['general'] = 'Geral';
$lang['client_form'] = 'Forma de cliente';
$lang['visible'] = 'Visível';
$lang['hidden'] = 'Escondido';
$lang['business_logic'] = 'Lógica de negócio';
$lang['current_user'] = 'Usuário Atual';
$lang['about_app'] = 'Sobre o Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/portuguese/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Ir para a página de reserva';
$lang['settings_saved'] = 'Definições guardadas com sucesso.';
$lang['general'] = 'Geral';
$lang['client_form'] = 'Forma de cliente';
$lang['visible'] = 'Visível';
$lang['hidden'] = 'Escondido';
$lang['business_logic'] = 'Lógica de negócio';
$lang['current_user'] = 'Utilizador Actual';
$lang['about_app'] = 'Sobre o Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/romanian/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'La pagina de înregistrari';
$lang['settings_saved'] = 'Setari salvate.';
$lang['general'] = 'General';
$lang['client_form'] = 'Client Formular';
$lang['visible'] = 'Vizibil';
$lang['hidden'] = 'Ascuns';
$lang['business_logic'] = 'Logica afacerii';
$lang['current_user'] = 'Utilizator curent';
$lang['about_app'] = 'Despre Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/russian/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Перейти на страницу заказов';
$lang['settings_saved'] = 'Настройки сохранены.';
$lang['general'] = 'Основные';
$lang['client_form'] = 'Форма клиента';
$lang['visible'] = 'Видимый';
$lang['hidden'] = 'Скрытый';
$lang['business_logic'] = 'Бизнес-логика';
$lang['current_user'] = 'Текущий пользователь';
$lang['about_app'] = 'О приложении Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/slovak/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Prejsť na stránku rezervácií';
$lang['settings_saved'] = 'Nastavenie úspešne uložené.';
$lang['general'] = 'Všeobecný';
$lang['client_form'] = 'Tvar klienta';
$lang['visible'] = 'Viditeľný';
$lang['hidden'] = 'Skrytý';
$lang['business_logic'] = 'Firemné údaje';
$lang['current_user'] = 'Prihlásený užívateľ';
$lang['about_app'] = 'O Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/spanish/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Ir a la página para agendar';
$lang['settings_saved'] = 'Configuración guardada exitosamente';
$lang['general'] = 'General';
$lang['client_form'] = 'Formulario del cliente';
$lang['visible'] = 'Visible';
$lang['hidden'] = 'Oculto';
$lang['business_logic'] = 'Lógica del negocio';
$lang['current_user'] = 'Usuario actual';
$lang['about_app'] = 'Acerca de Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/swedish/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Gå till bokningssidan.';
$lang['settings_saved'] = 'Inställningarna är sparade.';
$lang['general'] = 'Generellt';
$lang['client_form'] = 'Klientform';
$lang['visible'] = 'Synlig';
$lang['hidden'] = 'Dold';
$lang['business_logic'] = 'Affärsregler';
$lang['current_user'] = 'Nuvarande användare';
$lang['about_app'] = 'Om Easy!Appointments';
Expand Down
3 changes: 3 additions & 0 deletions application/language/turkish/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
$lang['go_to_booking_page'] = 'Rezervasyon Sayfasına Git';
$lang['settings_saved'] = 'Ayarlar başarıyla kaydedildi.';
$lang['general'] = 'Genel';
$lang['client_form'] = 'Müşteri formu';
$lang['visible'] = 'Gözle görülür';
$lang['hidden'] = 'Gizli';
$lang['business_logic'] = 'İş Mantığı';
$lang['current_user'] = 'Mevcut Kullanıcı';
$lang['about_app'] = 'Easy!Appointments Hakkında';
Expand Down
Loading