diff --git a/application/controllers/Booking.php b/application/controllers/Booking.php index 2fab9463..a819826f 100755 --- a/application/controllers/Booking.php +++ b/application/controllers/Booking.php @@ -60,6 +60,30 @@ class Booking extends EA_Controller { return; } + $company_name = setting('company_name'); + $disable_booking = setting('disable_booking'); + $google_analytics_code = setting('google_analytics_code'); + $matomo_analytics_url = setting('matomo_analytics_url'); + + if ($disable_booking) + { + $disable_booking_message = setting('disable_booking_message'); + + html_vars([ + 'show_message' => TRUE, + 'page_title' => lang('page_title') . ' ' . $company_name, + 'message_title' => lang('booking_is_disabled'), + 'message_text' => $disable_booking_message, + 'message_icon' => base_url('assets/img/error.png'), + 'google_analytics_code' => $google_analytics_code, + 'matomo_analytics_url' => $matomo_analytics_url + ]); + + $this->load->view('pages/booking_message'); + + return; + } + $available_services = $this->services_model->get_available_services(); $available_providers = $this->providers_model->get_available_providers(); @@ -76,7 +100,6 @@ class Booking extends EA_Controller { ]); } - $company_name = setting('company_name'); $date_format = setting('date_format'); $time_format = setting('time_format'); $first_weekday = setting('first_weekday'); @@ -105,8 +128,6 @@ class Booking extends EA_Controller { $display_any_provider = setting('display_any_provider'); $display_delete_personal_information = setting('display_delete_personal_information'); $book_advance_timeout = setting('book_advance_timeout'); - $google_analytics_code = setting('google_analytics_code'); - $matomo_analytics_url = setting('matomo_analytics_url'); $timezones = $this->timezones->to_array(); $grouped_timezones = $this->timezones->to_grouped_array(); diff --git a/application/language/arabic/translations_lang.php b/application/language/arabic/translations_lang.php index d8813552..dd0e0dbc 100755 --- a/application/language/arabic/translations_lang.php +++ b/application/language/arabic/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/bulgarian/translations_lang.php b/application/language/bulgarian/translations_lang.php index 2c8b72af..4fde4476 100755 --- a/application/language/bulgarian/translations_lang.php +++ b/application/language/bulgarian/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/catalan/translations_lang.php b/application/language/catalan/translations_lang.php index 952eaa59..aa153bc1 100644 --- a/application/language/catalan/translations_lang.php +++ b/application/language/catalan/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/chinese/translations_lang.php b/application/language/chinese/translations_lang.php index 632c81bc..d81436b2 100755 --- a/application/language/chinese/translations_lang.php +++ b/application/language/chinese/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/czech/translations_lang.php b/application/language/czech/translations_lang.php index 612bf998..682a102e 100644 --- a/application/language/czech/translations_lang.php +++ b/application/language/czech/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/danish/translations_lang.php b/application/language/danish/translations_lang.php index fdd157e3..5f6e1940 100755 --- a/application/language/danish/translations_lang.php +++ b/application/language/danish/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/dutch/translations_lang.php b/application/language/dutch/translations_lang.php index bb619404..9feb9e46 100755 --- a/application/language/dutch/translations_lang.php +++ b/application/language/dutch/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/english/translations_lang.php b/application/language/english/translations_lang.php index f4584a78..96a88927 100755 --- a/application/language/english/translations_lang.php +++ b/application/language/english/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/finnish/translations_lang.php b/application/language/finnish/translations_lang.php index 3254ad0d..f4729adc 100755 --- a/application/language/finnish/translations_lang.php +++ b/application/language/finnish/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/french/translations_lang.php b/application/language/french/translations_lang.php index 009db169..8c6014d3 100755 --- a/application/language/french/translations_lang.php +++ b/application/language/french/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/greek/translations_lang.php b/application/language/greek/translations_lang.php index 8e3f9352..73029b79 100755 --- a/application/language/greek/translations_lang.php +++ b/application/language/greek/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/hebrew/translations_lang.php b/application/language/hebrew/translations_lang.php index 9bb6f4d7..9b3c7fd5 100644 --- a/application/language/hebrew/translations_lang.php +++ b/application/language/hebrew/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/hindi/translations_lang.php b/application/language/hindi/translations_lang.php index 97b32943..e6a342e9 100755 --- a/application/language/hindi/translations_lang.php +++ b/application/language/hindi/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/hungarian/translations_lang.php b/application/language/hungarian/translations_lang.php index f270f5c7..c1d8aeef 100755 --- a/application/language/hungarian/translations_lang.php +++ b/application/language/hungarian/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/italian/translations_lang.php b/application/language/italian/translations_lang.php index dcc1997d..9d6e1048 100755 --- a/application/language/italian/translations_lang.php +++ b/application/language/italian/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/japanese/translations_lang.php b/application/language/japanese/translations_lang.php index 4d782830..61ce0164 100755 --- a/application/language/japanese/translations_lang.php +++ b/application/language/japanese/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/luxembourgish/translations_lang.php b/application/language/luxembourgish/translations_lang.php index 44229b8d..bc5a5181 100755 --- a/application/language/luxembourgish/translations_lang.php +++ b/application/language/luxembourgish/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/marathi/translations_lang.php b/application/language/marathi/translations_lang.php index 29af40ad..3eb528fd 100644 --- a/application/language/marathi/translations_lang.php +++ b/application/language/marathi/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/polish/translations_lang.php b/application/language/polish/translations_lang.php index 8c5859ea..f4a1e415 100755 --- a/application/language/polish/translations_lang.php +++ b/application/language/polish/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/portuguese-br/translations_lang.php b/application/language/portuguese-br/translations_lang.php index 215115dd..4c4ddbca 100755 --- a/application/language/portuguese-br/translations_lang.php +++ b/application/language/portuguese-br/translations_lang.php @@ -341,4 +341,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/portuguese/translations_lang.php b/application/language/portuguese/translations_lang.php index 317a8471..cf709f04 100755 --- a/application/language/portuguese/translations_lang.php +++ b/application/language/portuguese/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/romanian/translations_lang.php b/application/language/romanian/translations_lang.php index 686f3339..11338f83 100755 --- a/application/language/romanian/translations_lang.php +++ b/application/language/romanian/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/russian/translations_lang.php b/application/language/russian/translations_lang.php index d018511b..0ae9cc76 100755 --- a/application/language/russian/translations_lang.php +++ b/application/language/russian/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/slovak/translations_lang.php b/application/language/slovak/translations_lang.php index 6fc0f302..b152a7c7 100755 --- a/application/language/slovak/translations_lang.php +++ b/application/language/slovak/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/spanish/translations_lang.php b/application/language/spanish/translations_lang.php index 8a729b4b..6cca9bf1 100755 --- a/application/language/spanish/translations_lang.php +++ b/application/language/spanish/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/swedish/translations_lang.php b/application/language/swedish/translations_lang.php index 4de11f8c..2919dd88 100644 --- a/application/language/swedish/translations_lang.php +++ b/application/language/swedish/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/language/turkish/translations_lang.php b/application/language/turkish/translations_lang.php index b49efdc6..283bc9c3 100755 --- a/application/language/turkish/translations_lang.php +++ b/application/language/turkish/translations_lang.php @@ -342,4 +342,8 @@ $lang['invalid_phone'] = 'Invalid phone number.'; $lang['legal'] = 'Legal'; $lang['business'] = 'Business'; $lang['account'] = 'Account'; +$lang['disable_booking'] = 'Disable Booking'; +$lang['disable_booking_hint'] = 'The booking page will be disabled for as long as this setting is active and customers will not be able to register new appointments.'; +$lang['display_message'] = 'Display Message'; +$lang['booking_is_disabled'] = 'Booking Is Disabled!'; // End diff --git a/application/migrations/030_add_disable_booking_setting.php b/application/migrations/030_add_disable_booking_setting.php new file mode 100644 index 00000000..47c46606 --- /dev/null +++ b/application/migrations/030_add_disable_booking_setting.php @@ -0,0 +1,41 @@ + + * @copyright Copyright (c) Alex Tselegidis + * @license https://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link https://easyappointments.org + * @since v1.4.0 + * ---------------------------------------------------------------------------- */ + +class Migration_Add_disable_booking_setting extends EA_Migration { + /** + * Upgrade method. + */ + public function up() + { + if ( ! $this->db->get_where('settings', ['name' => 'disable_booking'])->num_rows()) + { + $this->db->insert('settings', [ + 'name' => 'disable_booking', + 'value' => '0' + ]); + } + } + + /** + * Downgrade method. + */ + public function down() + { + if ( ! $this->db->get_where('settings', ['name' => 'disable_booking'])->num_rows()) + { + $this->db->delete('settings', [ + 'name' => 'disable_booking', + ]); + } + } +} diff --git a/application/migrations/031_add_disable_booking_message_setting.php b/application/migrations/031_add_disable_booking_message_setting.php new file mode 100644 index 00000000..61df3eb0 --- /dev/null +++ b/application/migrations/031_add_disable_booking_message_setting.php @@ -0,0 +1,41 @@ + + * @copyright Copyright (c) Alex Tselegidis + * @license https://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link https://easyappointments.org + * @since v1.4.0 + * ---------------------------------------------------------------------------- */ + +class Migration_Add_disable_booking_message_setting extends EA_Migration { + /** + * Upgrade method. + */ + public function up() + { + if ( ! $this->db->get_where('settings', ['name' => 'disable_booking_message'])->num_rows()) + { + $this->db->insert('settings', [ + 'name' => 'disable_booking_message', + 'value' => '
Thanks for stopping by!
We are not accepting new appointments at the moment, please check back again later.
' + ]); + } + } + + /** + * Downgrade method. + */ + public function down() + { + if ( ! $this->db->get_where('settings', ['name' => 'disable_booking_message'])->num_rows()) + { + $this->db->delete('settings', [ + 'name' => 'disable_booking_message', + ]); + } + } +} diff --git a/application/views/pages/booking_settings.php b/application/views/pages/booking_settings.php index 08d05a73..9137fc8f 100755 --- a/application/views/pages/booking_settings.php +++ b/application/views/pages/booking_settings.php @@ -286,6 +286,29 @@ + +