Skip to content

Commit

Permalink
Allow the users to define their own status and assign them to appoint…
Browse files Browse the repository at this point in the history
…ments (#244).
  • Loading branch information
alextselegidis committed Oct 16, 2022
1 parent 5431d25 commit 0f6df76
Show file tree
Hide file tree
Showing 48 changed files with 452 additions and 6 deletions.
7 changes: 7 additions & 0 deletions application/controllers/Booking.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,12 +536,19 @@ public function register()

$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',
Expand Down
4 changes: 4 additions & 0 deletions application/controllers/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ public function index(string $appointment_hash = '')

$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,
Expand Down Expand Up @@ -146,6 +148,7 @@ public function index(string $appointment_hash = '')
'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'),
Expand Down Expand Up @@ -248,6 +251,7 @@ public function save_appointment()
'location',
'notes',
'color',
'status',
'is_unavailability',
'id_users_provider',
'id_users_customer',
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 @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/bulgarian/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/catalan/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/chinese/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/czech/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/danish/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/dutch/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/english/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/estonian/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/finnish/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/french/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/german/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/greek/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/hebrew/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/hindi/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/hungarian/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/italian/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/japanese/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/luxembourgish/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/marathi/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/persian/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/polish/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
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 @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/portuguese/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/romanian/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/russian/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/serbian/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/slovak/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/spanish/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/swedish/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
3 changes: 3 additions & 0 deletions application/language/turkish/translations_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,7 @@
$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
Loading

0 comments on commit 0f6df76

Please sign in to comment.