From 094b780fd854dc89abf92ddd260465f3b5e7622a Mon Sep 17 00:00:00 2001 From: Thomas S Date: Fri, 28 May 2021 13:37:58 +0200 Subject: [PATCH 1/7] [1081] Add new settings in db --- application/config/migration.php | 2 +- application/controllers/Appointments.php | 5 ++ .../022_add_show_fields_setting.php | 65 +++++++++++++++++++ 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 application/migrations/022_add_show_fields_setting.php diff --git a/application/config/migration.php b/application/config/migration.php index b2d763b4..f98b1f39 100755 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE; | be upgraded / downgraded to. | */ -$config['migration_version'] = 21; +$config['migration_version'] = 22; /* diff --git a/application/controllers/Appointments.php b/application/controllers/Appointments.php index 8406fea7..67a0dc66 100755 --- a/application/controllers/Appointments.php +++ b/application/controllers/Appointments.php @@ -66,6 +66,11 @@ class Appointments extends EA_Controller { $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'); diff --git a/application/migrations/022_add_show_fields_setting.php b/application/migrations/022_add_show_fields_setting.php new file mode 100644 index 00000000..03e393d7 --- /dev/null +++ b/application/migrations/022_add_show_fields_setting.php @@ -0,0 +1,65 @@ + + * @copyright Copyright (c) 2013 - 2020, Alex Tselegidis + * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link http://easyappointments.org + * @since v1.4.2 + * ---------------------------------------------------------------------------- */ + +/** + * Class Migration_Add_show_fields_setting + * + * @property CI_DB_query_builder $db + * @property CI_DB_forge $dbforge + */ +class Migration_Add_show_fields_setting extends CI_Migration { + /** + * Upgrade method. + */ + public function up() + { + $this->db->insert('settings', [ + 'name' => 'show_phone_number', + 'value' => '1' + ]); + + $this->db->insert('settings', [ + 'name' => 'show_address', + 'value' => '1' + ]); + + $this->db->insert('settings', [ + 'name' => 'show_city', + 'value' => '1' + ]); + + $this->db->insert('settings', [ + 'name' => 'show_zip_code', + 'value' => '1' + ]); + + $this->db->insert('settings', [ + 'name' => 'show_notes', + 'value' => '1' + ]); + + + } + + /** + * Downgrade method. + */ + public function down() + { + $this->db->delete('settings', ['name' => 'show_phone_number']); + $this->db->delete('settings', ['name' => 'show_address']); + $this->db->delete('settings', ['name' => 'show_city']); + $this->db->delete('settings', ['name' => 'show_zip_code']); + $this->db->delete('settings', ['name' => 'show_notes']); + } +} From 872640c46d773750995e619d47ad381126a35818 Mon Sep 17 00:00:00 2001 From: Thomas S Date: Fri, 28 May 2021 15:39:14 +0200 Subject: [PATCH 2/7] [1081] Frontend hiding of fields --- application/controllers/Appointments.php | 7 +++++++ application/views/appointments/book.php | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/application/controllers/Appointments.php b/application/controllers/Appointments.php index 67a0dc66..7f173cc7 100755 --- a/application/controllers/Appointments.php +++ b/application/controllers/Appointments.php @@ -168,6 +168,7 @@ class Appointments extends EA_Controller { '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, @@ -438,6 +439,12 @@ class Appointments extends EA_Controller { $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(); diff --git a/application/views/appointments/book.php b/application/views/appointments/book.php index 772eaa82..7ab88663 100755 --- a/application/views/appointments/book.php +++ b/application/views/appointments/book.php @@ -268,6 +268,7 @@ +
+
+
+ +
+ +
+ +
+
From ea2cdeff7078b21e2de0aec8919d06c2146c3d08 Mon Sep 17 00:00:00 2001 From: Thomas S Date: Sat, 29 May 2021 20:58:08 +0200 Subject: [PATCH 3/7] [1081] Added visual buttons to hide or show form fields --- .../language/english/translations_lang.php | 3 + application/views/backend/settings.php | 62 +++++++++++++++++++ assets/css/backend.css | 12 ++++ assets/img/eye-hidden.svg | 1 + assets/img/eye.svg | 1 + 5 files changed, 79 insertions(+) create mode 100644 assets/img/eye-hidden.svg create mode 100644 assets/img/eye.svg diff --git a/application/language/english/translations_lang.php b/application/language/english/translations_lang.php index a9aadce4..22b00550 100755 --- a/application/language/english/translations_lang.php +++ b/application/language/english/translations_lang.php @@ -98,6 +98,8 @@ $lang['save'] = 'Save'; $lang['new'] = 'New'; $lang['select'] = 'Select'; $lang['hide'] = 'Hide'; +$lang['visible'] = 'Visible'; +$lang['hidden'] = 'Hidden'; $lang['type_to_filter_customers'] = 'Type to filter customers.'; $lang['clear_fields_add_existing_customer_hint'] = 'Clear the fields and enter a new customer.'; $lang['pick_existing_customer_hint'] = 'Pick an existing customer.'; @@ -170,6 +172,7 @@ $lang['company_link_hint'] = 'Company link should point to the official website $lang['go_to_booking_page'] = 'Go To Booking Page'; $lang['settings_saved'] = 'Settings saved successfully.'; $lang['general'] = 'General'; +$lang['client_form'] = 'Client Form'; $lang['business_logic'] = 'Business Logic'; $lang['current_user'] = 'Current User'; $lang['about_app'] = 'About Easy!Appointments'; diff --git a/application/views/backend/settings.php b/application/views/backend/settings.php index f3b758ad..13040851 100755 --- a/application/views/backend/settings.php +++ b/application/views/backend/settings.php @@ -38,6 +38,11 @@ + + +