diff --git a/application/controllers/Booking.php b/application/controllers/Booking.php index 13800fd8..33775d14 100755 --- a/application/controllers/Booking.php +++ b/application/controllers/Booking.php @@ -536,12 +536,19 @@ class Booking extends EA_Controller { $appointment['id_users_customer'] = $customer_id; $appointment['is_unavailability'] = FALSE; + $appointment['color'] = $service['color']; + + $appointment_status_options_json = setting('appointment_status_options', '[]'); + $appointment_status_options = json_decode($appointment_status_options_json, TRUE) ?? []; + $appointment['status'] = $appointment_status_options[0] ?? NULL; $this->appointments_model->only($appointment, [ 'start_datetime', 'end_datetime', 'location', 'notes', + 'color', + 'status', 'is_unavailability', 'id_users_provider', 'id_users_customer', diff --git a/application/controllers/Calendar.php b/application/controllers/Calendar.php index a4cd0654..6ba4efb1 100644 --- a/application/controllers/Calendar.php +++ b/application/controllers/Calendar.php @@ -117,6 +117,8 @@ class Calendar extends EA_Controller { $calendar_view = request('view', $user['settings']['calendar_view']); + $appointment_status_options = setting('appointment_status_options'); + script_vars([ 'user_id' => $user_id, 'role_slug' => $role_slug, @@ -146,6 +148,7 @@ class Calendar extends EA_Controller { 'available_providers' => $available_providers, 'available_services' => $available_services, 'secretary_providers' => $secretary_providers, + 'appointment_status_options' => json_decode($appointment_status_options, TRUE) ?? [], 'require_first_name' => setting('require_first_name'), 'require_last_name' => setting('require_last_name'), 'require_email' => setting('require_email'), @@ -248,6 +251,7 @@ class Calendar extends EA_Controller { 'location', 'notes', 'color', + 'status', 'is_unavailability', 'id_users_provider', 'id_users_customer', diff --git a/application/language/arabic/translations_lang.php b/application/language/arabic/translations_lang.php index 012ccbb6..16d7be76 100755 --- a/application/language/arabic/translations_lang.php +++ b/application/language/arabic/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/bulgarian/translations_lang.php b/application/language/bulgarian/translations_lang.php index 852cf25f..32a1ea50 100755 --- a/application/language/bulgarian/translations_lang.php +++ b/application/language/bulgarian/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/catalan/translations_lang.php b/application/language/catalan/translations_lang.php index 70bb1cbd..7395db3a 100644 --- a/application/language/catalan/translations_lang.php +++ b/application/language/catalan/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/chinese/translations_lang.php b/application/language/chinese/translations_lang.php index 497d2a27..6372391e 100755 --- a/application/language/chinese/translations_lang.php +++ b/application/language/chinese/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/czech/translations_lang.php b/application/language/czech/translations_lang.php index ca7e77e9..3731882a 100644 --- a/application/language/czech/translations_lang.php +++ b/application/language/czech/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/danish/translations_lang.php b/application/language/danish/translations_lang.php index 9812f97d..555af33e 100755 --- a/application/language/danish/translations_lang.php +++ b/application/language/danish/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/dutch/translations_lang.php b/application/language/dutch/translations_lang.php index 156d2e15..c3ae57d3 100755 --- a/application/language/dutch/translations_lang.php +++ b/application/language/dutch/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/english/translations_lang.php b/application/language/english/translations_lang.php index f8caea6d..64d70431 100755 --- a/application/language/english/translations_lang.php +++ b/application/language/english/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/estonian/translations_lang.php b/application/language/estonian/translations_lang.php index 27f3ea64..e18bf7ea 100644 --- a/application/language/estonian/translations_lang.php +++ b/application/language/estonian/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/finnish/translations_lang.php b/application/language/finnish/translations_lang.php index 95ed81bf..5d65e570 100755 --- a/application/language/finnish/translations_lang.php +++ b/application/language/finnish/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/french/translations_lang.php b/application/language/french/translations_lang.php index 815059c4..d484364f 100755 --- a/application/language/french/translations_lang.php +++ b/application/language/french/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/german/translations_lang.php b/application/language/german/translations_lang.php index 2e0d5dde..029a97a1 100755 --- a/application/language/german/translations_lang.php +++ b/application/language/german/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/greek/translations_lang.php b/application/language/greek/translations_lang.php index 60fc0a97..388ec8a1 100755 --- a/application/language/greek/translations_lang.php +++ b/application/language/greek/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/hebrew/translations_lang.php b/application/language/hebrew/translations_lang.php index 5ee023bc..da91bd44 100644 --- a/application/language/hebrew/translations_lang.php +++ b/application/language/hebrew/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/hindi/translations_lang.php b/application/language/hindi/translations_lang.php index c4dbd00a..3c0c789c 100755 --- a/application/language/hindi/translations_lang.php +++ b/application/language/hindi/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/hungarian/translations_lang.php b/application/language/hungarian/translations_lang.php index e7fbceee..523442fb 100755 --- a/application/language/hungarian/translations_lang.php +++ b/application/language/hungarian/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/italian/translations_lang.php b/application/language/italian/translations_lang.php index 39d10fdd..ea6de8bf 100755 --- a/application/language/italian/translations_lang.php +++ b/application/language/italian/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/japanese/translations_lang.php b/application/language/japanese/translations_lang.php index cca792b5..771a900e 100755 --- a/application/language/japanese/translations_lang.php +++ b/application/language/japanese/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/luxembourgish/translations_lang.php b/application/language/luxembourgish/translations_lang.php index 73b70b90..1e20ef4b 100755 --- a/application/language/luxembourgish/translations_lang.php +++ b/application/language/luxembourgish/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/marathi/translations_lang.php b/application/language/marathi/translations_lang.php index 1815df5f..65b37e27 100644 --- a/application/language/marathi/translations_lang.php +++ b/application/language/marathi/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/persian/translations_lang.php b/application/language/persian/translations_lang.php index 1b6ae74b..55ff01f7 100644 --- a/application/language/persian/translations_lang.php +++ b/application/language/persian/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/polish/translations_lang.php b/application/language/polish/translations_lang.php index 3fcbe467..e9067da0 100755 --- a/application/language/polish/translations_lang.php +++ b/application/language/polish/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/portuguese-br/translations_lang.php b/application/language/portuguese-br/translations_lang.php index 92662835..e09e2f79 100755 --- a/application/language/portuguese-br/translations_lang.php +++ b/application/language/portuguese-br/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/portuguese/translations_lang.php b/application/language/portuguese/translations_lang.php index 9d3dd1a0..bc514e53 100755 --- a/application/language/portuguese/translations_lang.php +++ b/application/language/portuguese/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/romanian/translations_lang.php b/application/language/romanian/translations_lang.php index df14a035..4ae8d56c 100755 --- a/application/language/romanian/translations_lang.php +++ b/application/language/romanian/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/russian/translations_lang.php b/application/language/russian/translations_lang.php index 869a103a..f1c0e404 100755 --- a/application/language/russian/translations_lang.php +++ b/application/language/russian/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/serbian/translations_lang.php b/application/language/serbian/translations_lang.php index 3b960b82..4f11b7ea 100644 --- a/application/language/serbian/translations_lang.php +++ b/application/language/serbian/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/slovak/translations_lang.php b/application/language/slovak/translations_lang.php index a0b25585..68342cf6 100755 --- a/application/language/slovak/translations_lang.php +++ b/application/language/slovak/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/spanish/translations_lang.php b/application/language/spanish/translations_lang.php index 71a0dc43..a47e7568 100755 --- a/application/language/spanish/translations_lang.php +++ b/application/language/spanish/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/swedish/translations_lang.php b/application/language/swedish/translations_lang.php index cb97806e..903b72ae 100644 --- a/application/language/swedish/translations_lang.php +++ b/application/language/swedish/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/language/turkish/translations_lang.php b/application/language/turkish/translations_lang.php index c90e76c4..5a1b852c 100755 --- a/application/language/turkish/translations_lang.php +++ b/application/language/turkish/translations_lang.php @@ -405,4 +405,7 @@ $lang['future_booking_limit_hint'] = 'Set the future limit in days customers can $lang['api_token'] = 'API Token'; $lang['allow_rescheduling_cancellation_before'] = 'Allow Rescheduling/Cancellation Before'; $lang['at_least_one_field'] = 'At least one field must be displayed in the booking page.'; +$lang['status'] = 'Status'; +$lang['appointment_status_options'] = 'Appointment Status Options'; +$lang['appointment_status_options_info'] = 'Define a list of available appointment status options that can be used in the the calendar page (the first one will automatically become the default value).'; // End diff --git a/application/migrations/043_add_appointment_status_options_setting.php b/application/migrations/043_add_appointment_status_options_setting.php new file mode 100644 index 00000000..efb50c10 --- /dev/null +++ b/application/migrations/043_add_appointment_status_options_setting.php @@ -0,0 +1,47 @@ + + * @copyright Copyright (c) 2013 - 2020, Alex Tselegidis + * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link http://easyappointments.org + * @since v1.4.0 + * ---------------------------------------------------------------------------- */ + +/** + * @property CI_DB_query_builder $db + * @property CI_DB_forge $dbforge + */ +class Migration_Add_appointment_status_options_setting extends CI_Migration { + /** + * Upgrade method. + * + * @throws Exception + */ + public function up() + { + if ( ! $this->db->get_where('settings', ['name' => 'appointment_status_options'])->num_rows()) + { + $this->db->insert('settings', [ + 'name' => 'appointment_status_options', + 'value' => '["Booked", "Confirmed", "Rescheduled", "Cancelled", "Draft"]' + ]); + } + } + + /** + * Downgrade method. + * + * @throws Exception + */ + public function down() + { + if ($this->db->get_where('settings', ['name' => 'appointment_status_options'])->num_rows()) + { + $this->db->delete('settings', ['name' => 'status_options']); + } + } +} diff --git a/application/migrations/044_add_status_column_to_appointments_table.php b/application/migrations/044_add_status_column_to_appointments_table.php new file mode 100644 index 00000000..5d8c5986 --- /dev/null +++ b/application/migrations/044_add_status_column_to_appointments_table.php @@ -0,0 +1,45 @@ + + * @copyright Copyright (c) 2013 - 2020, Alex Tselegidis + * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link http://easyappointments.org + * @since v1.4.0 + * ---------------------------------------------------------------------------- */ + +class Migration_Add_status_column_to_appointments_table extends EA_Migration { + /** + * Upgrade method. + */ + public function up() + { + if ( ! $this->db->field_exists('status', 'appointments')) + { + $fields = [ + 'status' => [ + 'type' => 'VARCHAR', + 'constraint' => '512', + 'default' => '', + 'after' => 'color' + ] + ]; + + $this->dbforge->add_column('appointments', $fields); + } + } + + /** + * Downgrade method. + */ + public function down() + { + if ( ! $this->db->field_exists('status', 'appointments')) + { + $this->dbforge->drop_column('appointments', 'status'); + } + } +} diff --git a/application/models/Appointments_model.php b/application/models/Appointments_model.php index 97115bea..329a149b 100644 --- a/application/models/Appointments_model.php +++ b/application/models/Appointments_model.php @@ -38,6 +38,7 @@ class Appointments_model extends EA_Model { 'end' => 'end_datetime', 'location' => 'location', 'color' => 'color', + 'status' => 'status', 'notes' => 'notes', 'hash' => 'hash', 'providerId' => 'id_users_provider', diff --git a/application/views/components/appointment_status_options.php b/application/views/components/appointment_status_options.php new file mode 100644 index 00000000..9a3957f6 --- /dev/null +++ b/application/views/components/appointment_status_options.php @@ -0,0 +1,22 @@ + + +
+ + + + + + diff --git a/application/views/components/appointments_modal.php b/application/views/components/appointments_modal.php index a32e8424..eb86c166 100644 --- a/application/views/components/appointments_modal.php +++ b/application/views/components/appointments_modal.php @@ -1,8 +1,9 @@+ = lang('appointment_status_options_info') ?> +
+ + 'id="appointment-status-options"']) ?> diff --git a/application/views/pages/calendar.php b/application/views/pages/calendar.php index 881f3e5b..99deddcf 100755 --- a/application/views/pages/calendar.php +++ b/application/views/pages/calendar.php @@ -92,6 +92,7 @@ 'appointments_modal', [ 'available_services' => vars('available_services'), + 'appointment_status_options' => vars('appointment_status_options'), 'timezones' => vars('timezones'), 'require_first_name' => vars('require_first_name'), 'require_last_name' => vars('require_last_name'), diff --git a/application/views/pages/services.php b/application/views/pages/services.php index 2161d344..b56851cd 100755 --- a/application/views/pages/services.php +++ b/application/views/pages/services.php @@ -126,7 +126,6 @@