diff --git a/.prettierrc.json b/.prettierrc.json index 742418e5..1356b56e 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -5,8 +5,8 @@ "bracketSpacing": false, "bracketSameLine": false, "quoteProps": "preserve", - "trailingComma": "none", - "trailingCommaPHP": false, + "trailingComma": "all", + "trailingCommaPHP": true, "phpVersion": "8.0", "plugins": ["@prettier/plugin-php"] } diff --git a/application/config/config.php b/application/config/config.php index 454c62e5..064e4288 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -17,7 +17,7 @@ $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') || - (isset($_SERVER['SERVER_PORT']) && (int) $_SERVER['SERVER_PORT'] === 443) || + (isset($_SERVER['SERVER_PORT']) && (int)$_SERVER['SERVER_PORT'] === 443) || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') ? 'https://' : 'http://'; @@ -26,7 +26,8 @@ $domain = $_SERVER['HTTP_HOST'] ?? 'localhost'; $request_uri = dirname($_SERVER['SCRIPT_NAME']); -if ($request_uri === '.') { +if ($request_uri === '.') +{ $request_uri = ''; } @@ -195,7 +196,7 @@ $config['charset'] = 'UTF-8'; | setting this variable to TRUE (boolean). See the user guide for details. | */ -$config['enable_hooks'] = true; +$config['enable_hooks'] = TRUE; /* |-------------------------------------------------------------------------- @@ -255,8 +256,8 @@ $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; | use segment based URLs. | */ -$config['allow_get_array'] = true; -$config['enable_query_strings'] = false; +$config['allow_get_array'] = TRUE; +$config['enable_query_strings'] = FALSE; $config['controller_trigger'] = 'c'; $config['function_trigger'] = 'm'; $config['directory_trigger'] = 'd'; // experimental not currently in use @@ -349,9 +350,9 @@ $config['sess_driver'] = 'files'; $config['sess_cookie_name'] = 'ea_session'; $config['sess_expiration'] = 7200; $config['sess_save_path'] = __DIR__ . '/../../storage/sessions'; -$config['sess_match_ip'] = false; +$config['sess_match_ip'] = FALSE; $config['sess_time_to_update'] = 300; -$config['sess_regenerate_destroy'] = false; +$config['sess_regenerate_destroy'] = FALSE; /* |-------------------------------------------------------------------------- @@ -367,7 +368,7 @@ $config['sess_regenerate_destroy'] = false; $config['cookie_prefix'] = ''; $config['cookie_domain'] = ''; $config['cookie_path'] = '/'; -$config['cookie_secure'] = strpos($config['base_url'], 'https') !== false; +$config['cookie_secure'] = strpos($config['base_url'], 'https') !== FALSE; /* |-------------------------------------------------------------------------- @@ -381,7 +382,7 @@ $config['cookie_secure'] = strpos($config['base_url'], 'https') !== false; | 'csrf_cookie_name' = The cookie name | 'csrf_expire' = The number in seconds the token should expire. */ -$config['csrf_protection'] = true; +$config['csrf_protection'] = TRUE; $config['csrf_token_name'] = 'csrf_token'; $config['csrf_cookie_name'] = 'csrf_cookie'; $config['csrf_expire'] = 7200; @@ -404,7 +405,7 @@ $config['csrf_exclude_uris'] = ['api/v1/.*', 'booking/.*', 'booking_cancellation | by the output class. Do not 'echo' any values with compression enabled. | */ -$config['compress_output'] = false; +$config['compress_output'] = FALSE; /* |-------------------------------------------------------------------------- @@ -429,7 +430,7 @@ $config['time_reference'] = 'local'; | in your view files. Options are TRUE or FALSE (boolean) | */ -$config['rewrite_short_tags'] = false; +$config['rewrite_short_tags'] = FALSE; /* |-------------------------------------------------------------------------- @@ -453,7 +454,7 @@ $config['proxy_ips'] = ''; | will control the number of requests a client can sent to the app. | */ -$config['rate_limiting'] = true; +$config['rate_limiting'] = TRUE; /* End of file config.php */ /* Location: ./application/config/config.php */ diff --git a/application/config/database.php b/application/config/database.php index f77fa1fc..6cf6b0a6 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -47,7 +47,7 @@ */ $active_group = 'default'; -$query_builder = true; +$query_builder = TRUE; $db['default']['hostname'] = Config::DB_HOST; $db['default']['username'] = Config::DB_USERNAME; @@ -55,15 +55,15 @@ $db['default']['password'] = Config::DB_PASSWORD; $db['default']['database'] = Config::DB_NAME; $db['default']['dbdriver'] = 'mysqli'; $db['default']['dbprefix'] = 'ea_'; -$db['default']['pconnect'] = true; -$db['default']['db_debug'] = true; -$db['default']['cache_on'] = false; +$db['default']['pconnect'] = TRUE; +$db['default']['db_debug'] = TRUE; +$db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ''; $db['default']['char_set'] = 'utf8mb4'; $db['default']['dbcollat'] = 'utf8mb4_unicode_ci'; $db['default']['swap_pre'] = ''; -$db['default']['autoinit'] = true; -$db['default']['stricton'] = false; +$db['default']['autoinit'] = TRUE; +$db['default']['stricton'] = FALSE; /* End of file database.php */ /* Location: ./application/config/database.php */ diff --git a/application/config/migration.php b/application/config/migration.php index b1107828..3df89b21 100755 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -9,7 +9,7 @@ | whenever you intend to do a schema migration. | */ -$config['migration_enabled'] = true; +$config['migration_enabled'] = TRUE; /* |-------------------------------------------------------------------------- diff --git a/application/config/mimes.php b/application/config/mimes.php index 7f6bccd3..411bb53c 100644 --- a/application/config/mimes.php +++ b/application/config/mimes.php @@ -14,7 +14,7 @@ return [ 'application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', - 'application/x-mac-binhex40' + 'application/x-mac-binhex40', ], 'cpt' => 'application/mac-compactpro', 'csv' => [ @@ -28,14 +28,14 @@ return [ 'application/csv', 'application/excel', 'application/vnd.msexcel', - 'text/plain' + 'text/plain', ], 'bin' => [ 'application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', - 'application/x-macbinary' + 'application/x-macbinary', ], 'dms' => 'application/octet-stream', 'lha' => 'application/octet-stream', @@ -66,18 +66,18 @@ return [ 'application/excel', 'application/download', 'application/vnd.ms-office', - 'application/msword' + 'application/msword', ], 'ppt' => [ 'application/powerpoint', 'application/vnd.ms-powerpoint', 'application/vnd.ms-office', - 'application/msword' + 'application/msword', ], 'pptx' => [ 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/x-zip', - 'application/zip' + 'application/zip', ], 'wbxml' => 'application/wbxml', 'wmlc' => 'application/wmlc', @@ -94,7 +94,7 @@ return [ 'application/x-php', 'text/php', 'text/x-php', - 'application/x-httpd-php-source' + 'application/x-httpd-php-source', ], 'php4' => 'application/x-httpd-php', 'php3' => 'application/x-httpd-php', @@ -113,7 +113,7 @@ return [ 'application/zip', 'application/x-zip-compressed', 'application/s-compressed', - 'multipart/x-zip' + 'multipart/x-zip', ], 'rar' => ['application/x-rar', 'application/rar', 'application/x-rar-compressed'], 'mid' => 'audio/midi', @@ -141,7 +141,7 @@ return [ 'image/x-ms-bmp', 'application/bmp', 'application/x-bmp', - 'application/x-win-bitmap' + 'application/x-win-bitmap', ], 'gif' => 'image/gif', 'jpeg' => ['image/jpeg', 'image/pjpeg'], @@ -181,20 +181,20 @@ return [ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword', - 'application/x-zip' + 'application/x-zip', ], 'dot' => ['application/msword', 'application/vnd.ms-office'], 'dotx' => [ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', - 'application/msword' + 'application/msword', ], 'xlsx' => [ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip', 'application/vnd.ms-excel', 'application/msword', - 'application/x-zip' + 'application/x-zip', ], 'word' => ['application/msword', 'application/octet-stream'], 'xl' => 'application/excel', @@ -245,14 +245,14 @@ return [ 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', - 'multipart/x-zip' + 'multipart/x-zip', ], '7zip' => [ 'application/x-7z-compressed', 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', - 'multipart/x-zip' + 'multipart/x-zip', ], 'cdr' => [ 'application/cdr', @@ -261,14 +261,14 @@ return [ 'application/x-coreldraw', 'image/cdr', 'image/x-cdr', - 'zz-application/zz-winassoc-cdr' + 'zz-application/zz-winassoc-cdr', ], 'wma' => ['audio/x-ms-wma', 'video/x-ms-asf'], 'jar' => [ 'application/java-archive', 'application/x-java-application', 'application/x-jar', - 'application/x-compressed' + 'application/x-compressed', ], 'svg' => ['image/svg+xml', 'application/xml', 'text/xml'], 'vcf' => 'text/x-vcard', @@ -290,5 +290,5 @@ return [ 'odt' => 'application/vnd.oasis.opendocument.text', 'odm' => 'application/vnd.oasis.opendocument.text-master', 'ott' => 'application/vnd.oasis.opendocument.text-template', - 'oth' => 'application/vnd.oasis.opendocument.text-web' + 'oth' => 'application/vnd.oasis.opendocument.text-web', ]; diff --git a/application/config/routes.php b/application/config/routes.php index 0ee2d88e..d52a18ee 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -55,7 +55,7 @@ $route['default_controller'] = 'booking'; $route['404_override'] = ''; -$route['translate_uri_dashes'] = false; +$route['translate_uri_dashes'] = FALSE; /* | ------------------------------------------------------------------------- @@ -86,16 +86,19 @@ header('Access-Control-Allow-Origin: ' . ($_SERVER['HTTP_ORIGIN'] ?? '*')); // N header('Access-Control-Allow-Credentials: "true"'); -if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])) { +if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])) +{ // May also be using PUT, PATCH, HEAD etc header('Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD'); } -if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) { +if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) +{ header('Access-Control-Allow-Headers: ' . $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']); } -if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'OPTIONS') { +if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'OPTIONS') +{ exit(0); } diff --git a/application/config/testing/routes.php b/application/config/testing/routes.php index a5d538fe..090173cb 100644 --- a/application/config/testing/routes.php +++ b/application/config/testing/routes.php @@ -13,7 +13,7 @@ $route['default_controller'] = 'test/index'; $route['404_override'] = 'test/index'; // when in doubt, use the hammer -$route['translate_uri_dashes'] = false; +$route['translate_uri_dashes'] = FALSE; /* End of file routes.php */ /* Location: ./application/config/testing/routes.php */ diff --git a/application/controllers/About.php b/application/controllers/About.php index 2cb21c7d..e6580b6c 100644 --- a/application/controllers/About.php +++ b/application/controllers/About.php @@ -64,14 +64,14 @@ class About extends EA_Controller script_vars([ 'user_id' => $user_id, - 'role_slug' => $role_slug + 'role_slug' => $role_slug, ]); html_vars([ 'page_title' => lang('settings'), 'active_menu' => PRIV_SYSTEM_SETTINGS, 'user_display_name' => $this->accounts->get_user_display_name($user_id), - 'privileges' => $this->roles_model->get_permissions_by_slug($role_slug) + 'privileges' => $this->roles_model->get_permissions_by_slug($role_slug), ]); $this->load->view('pages/about'); diff --git a/application/controllers/Account.php b/application/controllers/Account.php index 3547cced..a69a9656 100644 --- a/application/controllers/Account.php +++ b/application/controllers/Account.php @@ -63,14 +63,14 @@ class Account extends EA_Controller $account = $this->users_model->find($user_id); script_vars([ - 'account' => $account + 'account' => $account, ]); html_vars([ 'page_title' => lang('settings'), 'active_menu' => PRIV_SYSTEM_SETTINGS, 'user_display_name' => $this->accounts->get_user_display_name($user_id), - 'grouped_timezones' => $this->timezones->to_grouped_array() + 'grouped_timezones' => $this->timezones->to_grouped_array(), ]); $this->load->view('pages/account'); @@ -104,7 +104,7 @@ class Account extends EA_Controller 'notes', 'timezone', 'language', - 'settings' + 'settings', ]); $this->users_model->only($account['settings'], ['username', 'password', 'notifications', 'calendar_view']); @@ -119,7 +119,7 @@ class Account extends EA_Controller 'user_email' => $account['email'], 'username' => $account['settings']['username'], 'timezone' => $account['timezone'], - 'language' => $account['language'] + 'language' => $account['language'], ]); response(); @@ -141,7 +141,7 @@ class Account extends EA_Controller $is_valid = $this->users_model->validate_username($username, $user_id); json_response([ - 'is_valid' => $is_valid + 'is_valid' => $is_valid, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/Admins.php b/application/controllers/Admins.php index 1fee46a8..f5f20998 100644 --- a/application/controllers/Admins.php +++ b/application/controllers/Admins.php @@ -63,7 +63,7 @@ class Admins extends EA_Controller 'user_id' => $user_id, 'role_slug' => $role_slug, 'timezones' => $this->timezones->to_array(), - 'min_password_length' => MIN_PASSWORD_LENGTH + 'min_password_length' => MIN_PASSWORD_LENGTH, ]); html_vars([ @@ -71,7 +71,7 @@ class Admins extends EA_Controller 'active_menu' => PRIV_USERS, 'user_display_name' => $this->accounts->get_user_display_name($user_id), 'grouped_timezones' => $this->timezones->to_grouped_array(), - 'privileges' => $this->roles_model->get_permissions_by_slug($role_slug) + 'privileges' => $this->roles_model->get_permissions_by_slug($role_slug), ]); $this->load->view('pages/admins'); @@ -128,7 +128,7 @@ class Admins extends EA_Controller 'notes', 'timezone', 'language', - 'settings' + 'settings', ]); $this->admins_model->only($admin['settings'], ['username', 'password', 'notifications', 'calendar_view']); @@ -141,7 +141,7 @@ class Admins extends EA_Controller json_response([ 'success' => true, - 'id' => $admin_id + 'id' => $admin_id, ]); } catch (Throwable $e) { json_exception($e); @@ -194,7 +194,7 @@ class Admins extends EA_Controller 'notes', 'timezone', 'language', - 'settings' + 'settings', ]); $this->admins_model->only($admin['settings'], ['username', 'password', 'notifications', 'calendar_view']); @@ -207,7 +207,7 @@ class Admins extends EA_Controller json_response([ 'success' => true, - 'id' => $admin_id + 'id' => $admin_id, ]); } catch (Throwable $e) { json_exception($e); @@ -233,7 +233,7 @@ class Admins extends EA_Controller $this->webhooks_client->trigger(WEBHOOK_ADMIN_DELETE, $admin); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/Api_settings.php b/application/controllers/Api_settings.php index 910cd41e..77b05adf 100644 --- a/application/controllers/Api_settings.php +++ b/application/controllers/Api_settings.php @@ -56,13 +56,13 @@ class Api_settings extends EA_Controller script_vars([ 'user_id' => $user_id, 'role_slug' => $role_slug, - 'api_settings' => $this->settings_model->get('name like "api_%"') + 'api_settings' => $this->settings_model->get('name like "api_%"'), ]); html_vars([ 'page_title' => lang('api'), 'active_menu' => PRIV_SYSTEM_SETTINGS, - 'user_display_name' => $this->accounts->get_user_display_name($user_id) + 'user_display_name' => $this->accounts->get_user_display_name($user_id), ]); $this->load->view('pages/api_settings'); diff --git a/application/controllers/Appointments.php b/application/controllers/Appointments.php index e07fb824..fc566197 100644 --- a/application/controllers/Appointments.php +++ b/application/controllers/Appointments.php @@ -97,7 +97,7 @@ class Appointments extends EA_Controller 'is_unavailability', 'id_users_provider', 'id_users_customer', - 'id_services' + 'id_services', ]); $appointment_id = $this->appointments_model->save($appointment); @@ -108,7 +108,7 @@ class Appointments extends EA_Controller json_response([ 'success' => true, - 'id' => $appointment_id + 'id' => $appointment_id, ]); } catch (Throwable $e) { json_exception($e); @@ -157,14 +157,14 @@ class Appointments extends EA_Controller 'is_unavailability', 'id_users_provider', 'id_users_customer', - 'id_services' + 'id_services', ]); $appointment_id = $this->appointments_model->save($appointment); json_response([ 'success' => true, - 'id' => $appointment_id + 'id' => $appointment_id, ]); } catch (Throwable $e) { json_exception($e); @@ -190,7 +190,7 @@ class Appointments extends EA_Controller $this->webhooks_client->trigger(WEBHOOK_APPOINTMENT_DELETE, $appointment); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/Blocked_periods.php b/application/controllers/Blocked_periods.php index 41829553..3a8ca58c 100644 --- a/application/controllers/Blocked_periods.php +++ b/application/controllers/Blocked_periods.php @@ -64,7 +64,7 @@ class Blocked_periods extends EA_Controller 'role_slug' => $role_slug, 'date_format' => setting('date_format'), 'time_format' => setting('time_format'), - 'first_weekday' => setting('first_weekday') + 'first_weekday' => setting('first_weekday'), ]); html_vars([ @@ -72,7 +72,7 @@ class Blocked_periods extends EA_Controller 'active_menu' => PRIV_BLOCKED_PERIODS, 'user_display_name' => $this->accounts->get_user_display_name($user_id), 'timezones' => $this->timezones->to_array(), - 'privileges' => $this->roles_model->get_permissions_by_slug($role_slug) + 'privileges' => $this->roles_model->get_permissions_by_slug($role_slug), ]); $this->load->view('pages/blocked_periods'); @@ -126,7 +126,7 @@ class Blocked_periods extends EA_Controller json_response([ 'success' => true, - 'id' => $blocked_period_id + 'id' => $blocked_period_id, ]); } catch (Throwable $e) { json_exception($e); @@ -170,7 +170,7 @@ class Blocked_periods extends EA_Controller 'name', 'start_datetime', 'end_datetime', - 'notes' + 'notes', ]); $blocked_period_id = $this->blocked_periods_model->save($blocked_period); @@ -181,7 +181,7 @@ class Blocked_periods extends EA_Controller json_response([ 'success' => true, - 'id' => $blocked_period_id + 'id' => $blocked_period_id, ]); } catch (Throwable $e) { json_exception($e); @@ -207,7 +207,7 @@ class Blocked_periods extends EA_Controller $this->webhooks_client->trigger(WEBHOOK_BLOCKED_PERIOD_DELETE, $blocked_period); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/Booking.php b/application/controllers/Booking.php index 3ec007bc..426ee021 100755 --- a/application/controllers/Booking.php +++ b/application/controllers/Booking.php @@ -91,7 +91,7 @@ class Booking extends EA_Controller '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 + 'matomo_analytics_url' => $matomo_analytics_url, ]); $this->load->view('pages/booking_message'); @@ -110,7 +110,7 @@ class Booking extends EA_Controller 'first_name', 'last_name', 'services', - 'timezone' + 'timezone', ]); } @@ -169,7 +169,7 @@ class Booking extends EA_Controller 'message_text' => lang('appointment_does_not_exist_in_db'), 'message_icon' => base_url('assets/img/error.png'), 'google_analytics_code' => $google_analytics_code, - 'matomo_analytics_url' => $matomo_analytics_url + 'matomo_analytics_url' => $matomo_analytics_url, ]); $this->load->view('pages/booking_message'); @@ -193,11 +193,11 @@ class Booking extends EA_Controller 'page_title' => lang('page_title') . ' ' . $company_name, 'message_title' => lang('appointment_locked'), 'message_text' => strtr(lang('appointment_locked_message'), [ - '{$limit}' => sprintf('%02d:%02d', $hours, $minutes) + '{$limit}' => sprintf('%02d:%02d', $hours, $minutes), ]), 'message_icon' => base_url('assets/img/error.png'), 'google_analytics_code' => $google_analytics_code, - 'matomo_analytics_url' => $matomo_analytics_url + 'matomo_analytics_url' => $matomo_analytics_url, ]); $this->load->view('pages/booking_message'); @@ -232,7 +232,7 @@ class Booking extends EA_Controller 'future_booking_limit' => setting('future_booking_limit'), 'appointment_data' => $appointment, 'provider_data' => $provider, - 'customer_data' => $customer + 'customer_data' => $customer, ]); html_vars([ @@ -278,7 +278,7 @@ class Booking extends EA_Controller 'customer_token' => $customer_token, 'appointment_data' => $appointment, 'provider_data' => $provider, - 'customer_data' => $customer + 'customer_data' => $customer, ]); $this->load->view('pages/booking'); @@ -335,7 +335,7 @@ class Booking extends EA_Controller if ($require_captcha && strtoupper($captcha_phrase) !== strtoupper($captcha)) { json_response([ - 'captcha_verification' => false + 'captcha_verification' => false, ]); return; @@ -347,7 +347,7 @@ class Booking extends EA_Controller $existing_appointments = $this->appointments_model->get([ 'id_users_customer' => $customer['id'], 'start_datetime <=' => $appointment['start_datetime'], - 'end_datetime >=' => $appointment['end_datetime'] + 'end_datetime >=' => $appointment['end_datetime'], ]); if (count($existing_appointments)) { @@ -370,7 +370,7 @@ class Booking extends EA_Controller 'first_name' => $customer['first_name'] ?? '-', 'last_name' => $customer['last_name'] ?? '-', 'email' => $customer['email'] ?? '-', - 'ip' => $customer_ip + 'ip' => $customer_ip, ]; if (setting('display_terms_and_conditions')) { @@ -399,7 +399,7 @@ class Booking extends EA_Controller 'state', 'zip_code', 'timezone', - 'language' + 'language', ]); $customer_id = $this->customers_model->save($customer); @@ -424,7 +424,7 @@ class Booking extends EA_Controller 'is_unavailability', 'id_users_provider', 'id_users_customer', - 'id_services' + 'id_services', ]); $appointment_id = $this->appointments_model->save($appointment); @@ -435,7 +435,7 @@ class Booking extends EA_Controller 'company_link' => setting('company_link'), 'company_email' => setting('company_email'), 'date_format' => setting('date_format'), - 'time_format' => setting('time_format') + 'time_format' => setting('time_format'), ]; $this->synchronization->sync_appointment_saved($appointment, $service, $provider, $customer, $settings); @@ -446,14 +446,14 @@ class Booking extends EA_Controller $provider, $customer, $settings, - $manage_mode + $manage_mode, ); $this->webhooks_client->trigger(WEBHOOK_APPOINTMENT_SAVE, $appointment); $response = [ 'appointment_id' => $appointment['id'], - 'appointment_hash' => $appointment['hash'] + 'appointment_hash' => $appointment['hash'], ]; json_response($response); @@ -504,7 +504,7 @@ class Booking extends EA_Controller $date, $service, $provider, - $exclude_appointment_id + $exclude_appointment_id, ); $is_still_available = false; @@ -610,7 +610,7 @@ class Booking extends EA_Controller $selected_date, $service, $provider, - $exclude_appointment_id + $exclude_appointment_id, ); $available_hours = array_merge($available_hours, $provider_available_hours); @@ -628,7 +628,7 @@ class Booking extends EA_Controller $selected_date, $service, $provider, - $exclude_appointment_id + $exclude_appointment_id, ); } @@ -684,7 +684,7 @@ class Booking extends EA_Controller $current_date->format('Y-m-d'), $service, $provider, - $exclude_appointment_id + $exclude_appointment_id, ); if (!empty($available_hours)) { @@ -700,7 +700,7 @@ class Booking extends EA_Controller if (count($unavailable_dates) === $number_of_days_in_month) { json_response([ - 'is_month_unavailable' => true + 'is_month_unavailable' => true, ]); return; diff --git a/application/controllers/Booking_cancellation.php b/application/controllers/Booking_cancellation.php index 40c8aabb..e92d0c85 100755 --- a/application/controllers/Booking_cancellation.php +++ b/application/controllers/Booking_cancellation.php @@ -65,7 +65,7 @@ class Booking_cancellation extends EA_Controller 'message_text' => lang('appointment_does_not_exist_in_db'), 'message_icon' => base_url('assets/img/error.png'), 'google_analytics_code' => setting('google_analytics_code'), - 'matomo_analytics_url' => setting('matomo_analytics_url') + 'matomo_analytics_url' => setting('matomo_analytics_url'), ]); $this->load->view('pages/booking_message'); @@ -86,7 +86,7 @@ class Booking_cancellation extends EA_Controller 'company_email' => setting('company_email'), 'company_link' => setting('company_link'), 'date_format' => setting('date_format'), - 'time_format' => setting('time_format') + 'time_format' => setting('time_format'), ]; $this->appointments_model->delete($appointment['id']); @@ -99,7 +99,7 @@ class Booking_cancellation extends EA_Controller $provider, $customer, $settings, - $cancellation_reason + $cancellation_reason, ); $this->webhooks_client->trigger(WEBHOOK_APPOINTMENT_DELETE, $appointment); @@ -111,7 +111,7 @@ class Booking_cancellation extends EA_Controller 'page_title' => lang('appointment_cancelled_title'), 'company_color' => setting('company_color'), 'google_analytics_code' => setting('google_analytics_code'), - 'matomo_analytics_url' => setting('matomo_analytics_url') + 'matomo_analytics_url' => setting('matomo_analytics_url'), ]); $this->load->view('pages/booking_cancellation'); diff --git a/application/controllers/Booking_confirmation.php b/application/controllers/Booking_confirmation.php index 7f71b593..7e6fb689 100755 --- a/application/controllers/Booking_confirmation.php +++ b/application/controllers/Booking_confirmation.php @@ -61,7 +61,7 @@ class Booking_confirmation extends EA_Controller 'company_color' => setting('company_color'), 'google_analytics_code' => setting('google_analytics_code'), 'matomo_analytics_url' => setting('matomo_analytics_url'), - 'add_to_google_url' => $add_to_google_url + 'add_to_google_url' => $add_to_google_url, ]); $this->load->view('pages/booking_confirmation'); diff --git a/application/controllers/Booking_settings.php b/application/controllers/Booking_settings.php index 5743a436..c3901cdb 100644 --- a/application/controllers/Booking_settings.php +++ b/application/controllers/Booking_settings.php @@ -65,13 +65,13 @@ class Booking_settings extends EA_Controller script_vars([ 'user_id' => $user_id, 'role_slug' => $role_slug, - 'booking_settings' => $this->settings_model->get_batch() + 'booking_settings' => $this->settings_model->get_batch(), ]); html_vars([ 'page_title' => lang('settings'), 'active_menu' => PRIV_SYSTEM_SETTINGS, - 'user_display_name' => $this->accounts->get_user_display_name($user_id) + 'user_display_name' => $this->accounts->get_user_display_name($user_id), ]); $this->load->view('pages/booking_settings'); diff --git a/application/controllers/Business_settings.php b/application/controllers/Business_settings.php index 5a60909a..55b0e45a 100644 --- a/application/controllers/Business_settings.php +++ b/application/controllers/Business_settings.php @@ -67,13 +67,13 @@ class Business_settings extends EA_Controller 'role_slug' => $role_slug, 'business_settings' => $this->settings_model->get(), 'first_weekday' => setting('first_weekday'), - 'time_format' => setting('time_format') + 'time_format' => setting('time_format'), ]); html_vars([ 'page_title' => lang('settings'), 'active_menu' => PRIV_SYSTEM_SETTINGS, - 'user_display_name' => $this->accounts->get_user_display_name($user_id) + 'user_display_name' => $this->accounts->get_user_display_name($user_id), ]); $this->load->view('pages/business_settings'); diff --git a/application/controllers/Calendar.php b/application/controllers/Calendar.php index f1adc59d..9f054ddf 100644 --- a/application/controllers/Calendar.php +++ b/application/controllers/Calendar.php @@ -112,7 +112,7 @@ class Calendar extends EA_Controller $available_providers = array_values( array_filter($available_providers, function ($available_provider) use ($user_id) { return (int) $available_provider['id'] === (int) $user_id; - }) + }), ); } @@ -120,7 +120,7 @@ class Calendar extends EA_Controller $available_providers = array_values( array_filter($available_providers, function ($available_provider) use ($secretary_providers) { return in_array($available_provider['id'], $secretary_providers); - }) + }), ); } @@ -144,7 +144,7 @@ class Calendar extends EA_Controller 'available_services' => $available_services, 'secretary_providers' => $secretary_providers, 'edit_appointment' => $edit_appointment, - 'customers' => $this->customers_model->get(null, 50, null, 'update_datetime DESC') + 'customers' => $this->customers_model->get(null, 50, null, 'update_datetime DESC'), ]); html_vars([ @@ -167,7 +167,7 @@ class Calendar extends EA_Controller 'require_address' => setting('require_address'), 'require_city' => setting('require_city'), 'require_zip_code' => setting('require_zip_code'), - 'require_notes' => setting('require_notes') + 'require_notes' => setting('require_notes'), ]); $this->load->view('pages/calendar'); @@ -208,7 +208,7 @@ class Calendar extends EA_Controller 'zip_code', 'timezone', 'language', - 'notes' + 'notes', ]); $customer['id'] = $this->customers_model->save($customer); @@ -250,7 +250,7 @@ class Calendar extends EA_Controller 'is_unavailability', 'id_users_provider', 'id_users_customer', - 'id_services' + 'id_services', ]); $appointment['id'] = $this->appointments_model->save($appointment); @@ -270,7 +270,7 @@ class Calendar extends EA_Controller 'company_link' => setting('company_link'), 'company_email' => setting('company_email'), 'date_format' => setting('date_format'), - 'time_format' => setting('time_format') + 'time_format' => setting('time_format'), ]; $this->synchronization->sync_appointment_saved($appointment, $service, $provider, $customer, $settings); @@ -281,13 +281,13 @@ class Calendar extends EA_Controller $provider, $customer, $settings, - $manage_mode + $manage_mode, ); $this->webhooks_client->trigger(WEBHOOK_APPOINTMENT_SAVE, $appointment); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); @@ -346,7 +346,7 @@ class Calendar extends EA_Controller 'company_email' => setting('company_email'), 'company_link' => setting('company_link'), 'date_format' => setting('date_format'), - 'time_format' => setting('time_format') + 'time_format' => setting('time_format'), ]; // Delete appointment record from the database. @@ -358,7 +358,7 @@ class Calendar extends EA_Controller $provider, $customer, $settings, - $cancellation_reason + $cancellation_reason, ); $this->synchronization->sync_appointment_deleted($appointment, $provider); @@ -366,7 +366,7 @@ class Calendar extends EA_Controller $this->webhooks_client->trigger(WEBHOOK_APPOINTMENT_DELETE, $appointment); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); @@ -406,7 +406,7 @@ class Calendar extends EA_Controller json_response([ 'success' => true, - 'warnings' => $warnings ?? [] + 'warnings' => $warnings ?? [], ]); } catch (Throwable $e) { json_exception($e); @@ -438,7 +438,7 @@ class Calendar extends EA_Controller $this->webhooks_client->trigger(WEBHOOK_UNAVAILABILITY_DELETE, $unavailability); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); @@ -468,7 +468,7 @@ class Calendar extends EA_Controller $this->providers_model->save_working_plan_exception($provider_id, $date, $working_plan_exception); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); @@ -494,7 +494,7 @@ class Calendar extends EA_Controller $this->providers_model->delete_working_plan_exception($provider_id, $date); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); @@ -522,12 +522,12 @@ class Calendar extends EA_Controller $response = [ 'appointments' => $this->appointments_model->get([ 'start_datetime >=' => $start_date, - 'end_datetime <=' => $end_date + 'end_datetime <=' => $end_date, ]), 'unavailabilities' => $this->unavailabilities_model->get([ 'start_datetime >=' => $start_date, - 'end_datetime <=' => $end_date - ]) + 'end_datetime <=' => $end_date, + ]), ]; foreach ($response['appointments'] as &$appointment) { @@ -613,7 +613,7 @@ class Calendar extends EA_Controller if (!$filter_type && $record_id !== FILTER_TYPE_ALL) { json_response([ 'appointments' => [], - 'unavailabilities' => [] + 'unavailabilities' => [], ]); return; diff --git a/application/controllers/Consents.php b/application/controllers/Consents.php index 990838b2..3104deb0 100644 --- a/application/controllers/Consents.php +++ b/application/controllers/Consents.php @@ -53,7 +53,7 @@ class Consents extends EA_Controller // Do not create a new consent. json_response([ - 'success' => true + 'success' => true, ]); return; @@ -64,7 +64,7 @@ class Consents extends EA_Controller json_response([ 'success' => true, - 'id' => $consent['id'] + 'id' => $consent['id'], ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/Console.php b/application/controllers/Console.php index f4032379..a81ad3d0 100644 --- a/application/controllers/Console.php +++ b/application/controllers/Console.php @@ -58,7 +58,7 @@ class Console extends EA_Controller $password = $this->instance->seed(); response( - PHP_EOL . '⇾ Installation completed, login with "administrator" / "' . $password . '".' . PHP_EOL . PHP_EOL + PHP_EOL . '⇾ Installation completed, login with "administrator" / "' . $password . '".' . PHP_EOL . PHP_EOL, ); } @@ -173,7 +173,7 @@ class Console extends EA_Controller '⇾ php index.php console backup', '⇾ php index.php console sync', '', - '' + '', ]; response(implode(PHP_EOL, $help)); diff --git a/application/controllers/Customers.php b/application/controllers/Customers.php index a8aabef0..b69294bb 100644 --- a/application/controllers/Customers.php +++ b/application/controllers/Customers.php @@ -86,7 +86,7 @@ class Customers extends EA_Controller 'date_format' => $date_format, 'time_format' => $time_format, 'timezones' => $this->timezones->to_array(), - 'secretary_providers' => $secretary_providers + 'secretary_providers' => $secretary_providers, ]); html_vars([ @@ -103,7 +103,7 @@ class Customers extends EA_Controller 'require_address' => $require_address, 'require_city' => $require_city, 'require_zip_code' => $require_zip_code, - 'available_languages' => config('available_languages') + 'available_languages' => config('available_languages'), ]); $this->load->view('pages/customers'); @@ -211,7 +211,7 @@ class Customers extends EA_Controller 'custom_field_2', 'custom_field_3', 'custom_field_4', - 'custom_field_5' + 'custom_field_5', ]); $customer_id = $this->customers_model->save($customer); @@ -222,7 +222,7 @@ class Customers extends EA_Controller json_response([ 'success' => true, - 'id' => $customer_id + 'id' => $customer_id, ]); } catch (Throwable $e) { json_exception($e); @@ -264,7 +264,7 @@ class Customers extends EA_Controller 'custom_field_2', 'custom_field_3', 'custom_field_4', - 'custom_field_5' + 'custom_field_5', ]); $customer_id = $this->customers_model->save($customer); @@ -275,7 +275,7 @@ class Customers extends EA_Controller json_response([ 'success' => true, - 'id' => $customer_id + 'id' => $customer_id, ]); } catch (Throwable $e) { json_exception($e); @@ -307,7 +307,7 @@ class Customers extends EA_Controller $this->webhooks_client->trigger(WEBHOOK_CUSTOMER_DELETE, $customer); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/General_settings.php b/application/controllers/General_settings.php index bc97101e..4b63c8dd 100644 --- a/application/controllers/General_settings.php +++ b/application/controllers/General_settings.php @@ -62,14 +62,14 @@ class General_settings extends EA_Controller script_vars([ 'user_id' => $user_id, 'role_slug' => $role_slug, - 'general_settings' => $this->settings_model->get() + 'general_settings' => $this->settings_model->get(), ]); html_vars([ 'page_title' => lang('settings'), 'active_menu' => PRIV_SYSTEM_SETTINGS, 'user_display_name' => $this->accounts->get_user_display_name($user_id), - 'available_themes' => $available_themes + 'available_themes' => $available_themes, ]); $this->load->view('pages/general_settings'); diff --git a/application/controllers/Google.php b/application/controllers/Google.php index 21bf796c..1380edfd 100644 --- a/application/controllers/Google.php +++ b/application/controllers/Google.php @@ -93,7 +93,7 @@ class Google extends EA_Controller $where = [ 'start_datetime >=' => date('Y-m-d H:i:s', $start), 'end_datetime <=' => date('Y-m-d H:i:s', $end), - 'id_users_provider' => $provider['id'] + 'id_users_provider' => $provider['id'], ]; $appointments = $CI->appointments_model->get($where); @@ -105,7 +105,7 @@ class Google extends EA_Controller $settings = [ 'company_name' => setting('company_name'), 'company_link' => setting('company_link'), - 'company_email' => setting('company_email') + 'company_email' => setting('company_email'), ]; $provider_timezone = new DateTimeZone($provider['timezone']); @@ -129,7 +129,7 @@ class Google extends EA_Controller $provider, $service, $customer, - $settings + $settings, ); $local_event['id_google_calendar'] = $google_event->getId(); @@ -152,11 +152,11 @@ class Google extends EA_Controller $local_event_start = strtotime($local_event['start_datetime']); $local_event_end = strtotime($local_event['end_datetime']); $google_event_start = new DateTime( - $google_event->getStart()->getDateTime() ?? $google_event->getEnd()->getDate() + $google_event->getStart()->getDateTime() ?? $google_event->getEnd()->getDate(), ); $google_event_start->setTimezone($provider_timezone); $google_event_end = new DateTime( - $google_event->getEnd()->getDateTime() ?? $google_event->getEnd()->getDate() + $google_event->getEnd()->getDateTime() ?? $google_event->getEnd()->getDate(), ); $google_event_end->setTimezone($provider_timezone); @@ -223,7 +223,7 @@ class Google extends EA_Controller } $unavailability_results = $CI->unavailabilities_model->get([ - 'id_google_calendar' => $google_event->getId() + 'id_google_calendar' => $google_event->getId(), ]); if (!empty($unavailability_results)) { @@ -240,19 +240,19 @@ class Google extends EA_Controller 'id_users_provider' => $provider_id, 'id_google_calendar' => $google_event->getId(), 'id_users_customer' => null, - 'id_services' => null + 'id_services' => null, ]; $CI->unavailabilities_model->save($local_event); } json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { log_message( 'error', - 'Google - Sync completed with an error (provider ID "' . $provider_id . '"): ' . $e->getMessage() + 'Google - Sync completed with an error (provider ID "' . $provider_id . '"): ' . $e->getMessage(), ); json_exception($e); @@ -348,7 +348,7 @@ class Google extends EA_Controller if (!$google_sync) { json_response([ - 'success' => false + 'success' => false, ]); return; @@ -387,7 +387,7 @@ class Google extends EA_Controller $this->providers_model->set_setting($provider_id, 'google_calendar', $calendar_id); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); @@ -423,7 +423,7 @@ class Google extends EA_Controller $this->appointments_model->clear_google_sync_ids($provider_id); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/Google_analytics_settings.php b/application/controllers/Google_analytics_settings.php index 16230b31..18c49e6a 100644 --- a/application/controllers/Google_analytics_settings.php +++ b/application/controllers/Google_analytics_settings.php @@ -56,13 +56,13 @@ class Google_analytics_settings extends EA_Controller script_vars([ 'user_id' => $user_id, 'role_slug' => $role_slug, - 'google_analytics_settings' => $this->settings_model->get('name like "google_analytics_%"') + 'google_analytics_settings' => $this->settings_model->get('name like "google_analytics_%"'), ]); html_vars([ 'page_title' => lang('google_analytics'), 'active_menu' => PRIV_SYSTEM_SETTINGS, - 'user_display_name' => $this->accounts->get_user_display_name($user_id) + 'user_display_name' => $this->accounts->get_user_display_name($user_id), ]); $this->load->view('pages/google_analytics_settings'); diff --git a/application/controllers/Installation.php b/application/controllers/Installation.php index e1719b6c..64a1b513 100644 --- a/application/controllers/Installation.php +++ b/application/controllers/Installation.php @@ -47,7 +47,7 @@ class Installation extends EA_Controller } $this->load->view('pages/installation', [ - 'base_url' => config('base_url') + 'base_url' => config('base_url'), ]); } @@ -80,14 +80,14 @@ class Installation extends EA_Controller 'user_email' => $admin['email'], 'role_slug' => DB_SLUG_ADMIN, 'timezone' => $admin['timezone'], - 'username' => $admin['settings']['username'] + 'username' => $admin['settings']['username'], ]); // Save company settings setting([ 'company_name' => $company['company_name'], 'company_email' => $company['company_email'], - 'company_link' => $company['company_link'] + 'company_link' => $company['company_link'], ]); // Service @@ -97,7 +97,7 @@ class Installation extends EA_Controller 'price' => '0', 'currency' => '', 'availabilities_type' => 'flexible', - 'attendants_number' => '1' + 'attendants_number' => '1', ]); // Provider @@ -115,8 +115,8 @@ class Installation extends EA_Controller 'google_sync' => false, 'sync_past_days' => 30, 'sync_future_days' => 90, - 'calendar_view' => CALENDAR_VIEW_DEFAULT - ] + 'calendar_view' => CALENDAR_VIEW_DEFAULT, + ], ]); // Customer @@ -124,11 +124,11 @@ class Installation extends EA_Controller 'first_name' => 'James', 'last_name' => 'Doe', 'email' => 'james@example.org', - 'phone_number' => '+1 (000) 000-0000' + 'phone_number' => '+1 (000) 000-0000', ]); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/Integrations.php b/application/controllers/Integrations.php index 1b5d036c..ccc76a15 100644 --- a/application/controllers/Integrations.php +++ b/application/controllers/Integrations.php @@ -66,7 +66,7 @@ class Integrations extends EA_Controller 'page_title' => lang('integrations'), 'active_menu' => PRIV_SYSTEM_SETTINGS, 'user_display_name' => $this->accounts->get_user_display_name($user_id), - 'privileges' => $this->roles_model->get_permissions_by_slug($role_slug) + 'privileges' => $this->roles_model->get_permissions_by_slug($role_slug), ]); $this->load->view('pages/integrations'); diff --git a/application/controllers/Legal_settings.php b/application/controllers/Legal_settings.php index 052ebca1..f327b09c 100644 --- a/application/controllers/Legal_settings.php +++ b/application/controllers/Legal_settings.php @@ -56,13 +56,13 @@ class Legal_settings extends EA_Controller script_vars([ 'user_id' => $user_id, 'role_slug' => $role_slug, - 'legal_settings' => $this->settings_model->get() + 'legal_settings' => $this->settings_model->get(), ]); html_vars([ 'page_title' => lang('settings'), 'active_menu' => PRIV_SYSTEM_SETTINGS, - 'user_display_name' => $this->accounts->get_user_display_name($user_id) + 'user_display_name' => $this->accounts->get_user_display_name($user_id), ]); $this->load->view('pages/legal_settings'); diff --git a/application/controllers/Localization.php b/application/controllers/Localization.php index 6cba363b..1cb6aa99 100644 --- a/application/controllers/Localization.php +++ b/application/controllers/Localization.php @@ -35,7 +35,7 @@ class Localization extends EA_Controller if (!in_array($language, config('available_languages'))) { throw new RuntimeException( - 'Translations for the given language does not exist (' . request('language') . ').' + 'Translations for the given language does not exist (' . request('language') . ').', ); } @@ -46,7 +46,7 @@ class Localization extends EA_Controller config(['language' => $language]); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/Login.php b/application/controllers/Login.php index 6b5473ce..f7945144 100644 --- a/application/controllers/Login.php +++ b/application/controllers/Login.php @@ -31,7 +31,7 @@ class Login extends EA_Controller $this->load->library('email_messages'); script_vars([ - 'dest_url' => session('dest_url', site_url('calendar')) + 'dest_url' => session('dest_url', site_url('calendar')), ]); } @@ -44,7 +44,7 @@ class Login extends EA_Controller 'page_title' => lang('login'), 'base_url' => config('base_url'), 'dest_url' => session('dest_url', site_url('calendar')), - 'company_name' => setting('company_name') + 'company_name' => setting('company_name'), ]); $this->load->view('pages/login'); @@ -79,7 +79,7 @@ class Login extends EA_Controller session($user_data); // Save data in the session. json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/Logout.php b/application/controllers/Logout.php index 19b7378b..bab759b1 100644 --- a/application/controllers/Logout.php +++ b/application/controllers/Logout.php @@ -31,7 +31,7 @@ class Logout extends EA_Controller html_vars([ 'page_title' => lang('log_out'), - 'company_name' => $company_name + 'company_name' => $company_name, ]); $this->load->view('pages/logout'); diff --git a/application/controllers/Matomo_analytics_settings.php b/application/controllers/Matomo_analytics_settings.php index 2b0fa20b..f77cf558 100644 --- a/application/controllers/Matomo_analytics_settings.php +++ b/application/controllers/Matomo_analytics_settings.php @@ -56,13 +56,13 @@ class Matomo_analytics_settings extends EA_Controller script_vars([ 'user_id' => $user_id, 'role_slug' => $role_slug, - 'matomo_analytics_settings' => $this->settings_model->get('name like "matomo_analytics_%"') + 'matomo_analytics_settings' => $this->settings_model->get('name like "matomo_analytics_%"'), ]); html_vars([ 'page_title' => lang('matomo_analytics'), 'active_menu' => PRIV_SYSTEM_SETTINGS, - 'user_display_name' => $this->accounts->get_user_display_name($user_id) + 'user_display_name' => $this->accounts->get_user_display_name($user_id), ]); $this->load->view('pages/matomo_analytics_settings'); diff --git a/application/controllers/Privacy.php b/application/controllers/Privacy.php index 6c8775ca..2e1b1be1 100644 --- a/application/controllers/Privacy.php +++ b/application/controllers/Privacy.php @@ -54,14 +54,14 @@ class Privacy extends EA_Controller if (empty($customer_id)) { throw new InvalidArgumentException( - 'Customer ID does not exist, please reload the page ' . 'and try again.' + 'Customer ID does not exist, please reload the page ' . 'and try again.', ); } $this->customers_model->delete($customer_id); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/Providers.php b/application/controllers/Providers.php index b800d137..75fdc350 100644 --- a/application/controllers/Providers.php +++ b/application/controllers/Providers.php @@ -75,7 +75,7 @@ class Providers extends EA_Controller 'first_weekday' => setting('first_weekday'), 'min_password_length' => MIN_PASSWORD_LENGTH, 'timezones' => $this->timezones->to_array(), - 'services' => $services + 'services' => $services, ]); html_vars([ @@ -84,7 +84,7 @@ class Providers extends EA_Controller 'user_display_name' => $this->accounts->get_user_display_name($user_id), 'grouped_timezones' => $this->timezones->to_grouped_array(), 'privileges' => $this->roles_model->get_permissions_by_slug($role_slug), - 'services' => $this->services_model->get() + 'services' => $this->services_model->get(), ]); $this->load->view('pages/providers'); @@ -144,7 +144,7 @@ class Providers extends EA_Controller 'is_private', 'id_roles', 'settings', - 'services' + 'services', ]); $this->providers_model->only($provider['settings'], [ @@ -153,11 +153,11 @@ class Providers extends EA_Controller 'working_plan', 'working_plan_exceptions', 'notifications', - 'calendar_view' + 'calendar_view', ]); $this->providers_model->optional($provider, [ - 'services' => [] + 'services' => [], ]); $provider_id = $this->providers_model->save($provider); @@ -168,7 +168,7 @@ class Providers extends EA_Controller json_response([ 'success' => true, - 'id' => $provider_id + 'id' => $provider_id, ]); } catch (Throwable $e) { json_exception($e); @@ -224,7 +224,7 @@ class Providers extends EA_Controller 'is_private', 'id_roles', 'settings', - 'services' + 'services', ]); $this->providers_model->only($provider['settings'], [ @@ -233,11 +233,11 @@ class Providers extends EA_Controller 'working_plan', 'working_plan_exceptions', 'notifications', - 'calendar_view' + 'calendar_view', ]); $this->providers_model->optional($provider, [ - 'services' => [] + 'services' => [], ]); $provider_id = $this->providers_model->save($provider); @@ -248,7 +248,7 @@ class Providers extends EA_Controller json_response([ 'success' => true, - 'id' => $provider_id + 'id' => $provider_id, ]); } catch (Throwable $e) { json_exception($e); @@ -274,7 +274,7 @@ class Providers extends EA_Controller $this->webhooks_client->trigger(WEBHOOK_PROVIDER_DELETE, $provider); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/Recovery.php b/application/controllers/Recovery.php index 2e38a84d..ce6f156c 100644 --- a/application/controllers/Recovery.php +++ b/application/controllers/Recovery.php @@ -41,7 +41,7 @@ class Recovery extends EA_Controller html_vars([ 'page_title' => lang('forgot_your_password'), 'dest_url' => session('dest_url', site_url('backend')), - 'company_name' => $company_name + 'company_name' => $company_name, ]); $this->load->view('pages/recovery'); @@ -71,14 +71,14 @@ class Recovery extends EA_Controller $settings = [ 'company_name' => setting('company_name'), 'company_link' => setting('company_link'), - 'company_email' => setting('company_email') + 'company_email' => setting('company_email'), ]; $this->email_messages->send_password($new_password, $email, $settings); } json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/Secretaries.php b/application/controllers/Secretaries.php index 8902de8c..ef8cd3ed 100644 --- a/application/controllers/Secretaries.php +++ b/application/controllers/Secretaries.php @@ -71,7 +71,7 @@ class Secretaries extends EA_Controller 'role_slug' => $role_slug, 'timezones' => $this->timezones->to_array(), 'min_password_length' => MIN_PASSWORD_LENGTH, - 'providers' => $providers + 'providers' => $providers, ]); html_vars([ @@ -80,7 +80,7 @@ class Secretaries extends EA_Controller 'user_display_name' => $this->accounts->get_user_display_name($user_id), 'grouped_timezones' => $this->timezones->to_grouped_array(), 'privileges' => $this->roles_model->get_permissions_by_slug($role_slug), - 'providers' => $this->providers_model->get() + 'providers' => $this->providers_model->get(), ]); $this->load->view('pages/secretaries'); @@ -140,18 +140,18 @@ class Secretaries extends EA_Controller 'is_private', 'id_roles', 'settings', - 'providers' + 'providers', ]); $this->secretaries_model->only($secretary['settings'], [ 'username', 'password', 'notifications', - 'calendar_view' + 'calendar_view', ]); $this->secretaries_model->optional($secretary, [ - 'providers' => [] + 'providers' => [], ]); $secretary_id = $this->secretaries_model->save($secretary); @@ -162,7 +162,7 @@ class Secretaries extends EA_Controller json_response([ 'success' => true, - 'id' => $secretary_id + 'id' => $secretary_id, ]); } catch (Throwable $e) { json_exception($e); @@ -218,18 +218,18 @@ class Secretaries extends EA_Controller 'is_private', 'id_roles', 'settings', - 'providers' + 'providers', ]); $this->secretaries_model->only($secretary['settings'], [ 'username', 'password', 'notifications', - 'calendar_view' + 'calendar_view', ]); $this->secretaries_model->optional($secretary, [ - 'providers' => [] + 'providers' => [], ]); $secretary_id = $this->secretaries_model->save($secretary); @@ -240,7 +240,7 @@ class Secretaries extends EA_Controller json_response([ 'success' => true, - 'id' => $secretary_id + 'id' => $secretary_id, ]); } catch (Throwable $e) { json_exception($e); @@ -266,7 +266,7 @@ class Secretaries extends EA_Controller $this->webhooks_client->trigger(WEBHOOK_SECRETARY_DELETE, $secretary); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/Service_categories.php b/application/controllers/Service_categories.php index bfc2eeeb..32e96c6a 100644 --- a/application/controllers/Service_categories.php +++ b/application/controllers/Service_categories.php @@ -61,7 +61,7 @@ class Service_categories extends EA_Controller script_vars([ 'user_id' => $user_id, - 'role_slug' => $role_slug + 'role_slug' => $role_slug, ]); html_vars([ @@ -69,7 +69,7 @@ class Service_categories extends EA_Controller 'active_menu' => PRIV_SERVICES, 'user_display_name' => $this->accounts->get_user_display_name($user_id), 'timezones' => $this->timezones->to_array(), - 'privileges' => $this->roles_model->get_permissions_by_slug($role_slug) + 'privileges' => $this->roles_model->get_permissions_by_slug($role_slug), ]); $this->load->view('pages/service_categories'); @@ -123,7 +123,7 @@ class Service_categories extends EA_Controller json_response([ 'success' => true, - 'id' => $service_category_id + 'id' => $service_category_id, ]); } catch (Throwable $e) { json_exception($e); @@ -172,7 +172,7 @@ class Service_categories extends EA_Controller json_response([ 'success' => true, - 'id' => $service_category_id + 'id' => $service_category_id, ]); } catch (Throwable $e) { json_exception($e); @@ -198,7 +198,7 @@ class Service_categories extends EA_Controller $this->webhooks_client->trigger(WEBHOOK_SERVICE_CATEGORY_DELETE, $service_category); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/Services.php b/application/controllers/Services.php index b35bbce0..12c65c05 100644 --- a/application/controllers/Services.php +++ b/application/controllers/Services.php @@ -62,7 +62,7 @@ class Services extends EA_Controller script_vars([ 'user_id' => $user_id, 'role_slug' => $role_slug, - 'event_minimum_duration' => EVENT_MINIMUM_DURATION + 'event_minimum_duration' => EVENT_MINIMUM_DURATION, ]); html_vars([ @@ -70,7 +70,7 @@ class Services extends EA_Controller 'active_menu' => PRIV_SERVICES, 'user_display_name' => $this->accounts->get_user_display_name($user_id), 'timezones' => $this->timezones->to_array(), - 'privileges' => $this->roles_model->get_permissions_by_slug($role_slug) + 'privileges' => $this->roles_model->get_permissions_by_slug($role_slug), ]); $this->load->view('pages/services'); @@ -125,11 +125,11 @@ class Services extends EA_Controller 'availabilities_type', 'attendants_number', 'is_private', - 'id_service_categories' + 'id_service_categories', ]); $this->services_model->optional($service, [ - 'id_service_categories' => null + 'id_service_categories' => null, ]); $service_id = $this->services_model->save($service); @@ -140,7 +140,7 @@ class Services extends EA_Controller json_response([ 'success' => true, - 'id' => $service_id + 'id' => $service_id, ]); } catch (Throwable $e) { json_exception($e); @@ -191,11 +191,11 @@ class Services extends EA_Controller 'availabilities_type', 'attendants_number', 'is_private', - 'id_service_categories' + 'id_service_categories', ]); $this->services_model->optional($service, [ - 'id_service_categories' => null + 'id_service_categories' => null, ]); $service_id = $this->services_model->save($service); @@ -206,7 +206,7 @@ class Services extends EA_Controller json_response([ 'success' => true, - 'id' => $service_id + 'id' => $service_id, ]); } catch (Throwable $e) { json_exception($e); @@ -232,7 +232,7 @@ class Services extends EA_Controller $this->webhooks_client->trigger(WEBHOOK_SERVICE_DELETE, $service); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/Unavailabilities.php b/application/controllers/Unavailabilities.php index 7871c2a3..368ae794 100644 --- a/application/controllers/Unavailabilities.php +++ b/application/controllers/Unavailabilities.php @@ -84,7 +84,7 @@ class Unavailabilities extends EA_Controller 'zip_code', 'notes', 'timezone', - 'language' + 'language', ]); $unavailability_id = $this->unavailabilities_model->save($unavailability); @@ -99,7 +99,7 @@ class Unavailabilities extends EA_Controller json_response([ 'success' => true, - 'id' => $unavailability_id + 'id' => $unavailability_id, ]); } catch (Throwable $e) { json_exception($e); @@ -150,7 +150,7 @@ class Unavailabilities extends EA_Controller json_response([ 'success' => true, - 'id' => $unavailability_id + 'id' => $unavailability_id, ]); } catch (Throwable $e) { json_exception($e); @@ -176,7 +176,7 @@ class Unavailabilities extends EA_Controller $this->webhooks_client->trigger(WEBHOOK_UNAVAILABILITY_DELETE, $unavailability); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/Webhooks.php b/application/controllers/Webhooks.php index eb76791a..57b3045c 100644 --- a/application/controllers/Webhooks.php +++ b/application/controllers/Webhooks.php @@ -60,7 +60,7 @@ class Webhooks extends EA_Controller script_vars([ 'user_id' => $user_id, - 'role_slug' => $role_slug + 'role_slug' => $role_slug, ]); html_vars([ @@ -87,8 +87,8 @@ class Webhooks extends EA_Controller WEBHOOK_SECRETARY_SAVE, WEBHOOK_SECRETARY_DELETE, WEBHOOK_ADMIN_SAVE, - WEBHOOK_ADMIN_DELETE - ] + WEBHOOK_ADMIN_DELETE, + ], ]); $this->load->view('pages/webhooks'); @@ -138,14 +138,14 @@ class Webhooks extends EA_Controller 'actions', 'secret_token', 'is_ssl_verified', - 'notes' + 'notes', ]); $webhook_id = $this->webhooks_model->save($webhook); json_response([ 'success' => true, - 'id' => $webhook_id + 'id' => $webhook_id, ]); } catch (Throwable $e) { json_exception($e); @@ -171,14 +171,14 @@ class Webhooks extends EA_Controller 'actions', 'secret_token', 'is_ssl_verified', - 'notes' + 'notes', ]); $webhook_id = $this->webhooks_model->save($webhook); json_response([ 'success' => true, - 'id' => $webhook_id + 'id' => $webhook_id, ]); } catch (Throwable $e) { json_exception($e); @@ -200,7 +200,7 @@ class Webhooks extends EA_Controller $this->webhooks_model->delete($webhook_id); json_response([ - 'success' => true + 'success' => true, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/controllers/api/v1/Appointments_api_v1.php b/application/controllers/api/v1/Appointments_api_v1.php index 0e26e793..44cf4883 100644 --- a/application/controllers/api/v1/Appointments_api_v1.php +++ b/application/controllers/api/v1/Appointments_api_v1.php @@ -150,15 +150,15 @@ class Appointments_api_v1 extends EA_Controller if ($aggregates) { $appointment['service'] = $this->services_model->find( $appointment['id_services'] ?? ($appointment['serviceId'] ?? null), - true + true, ); $appointment['provider'] = $this->providers_model->find( $appointment['id_users_provider'] ?? ($appointment['providerId'] ?? null), - true + true, ); $appointment['customer'] = $this->customers_model->find( $appointment['id_users_customer'] ?? ($appointment['customerId'] ?? null), - true + true, ); $this->services_model->api_encode($appointment['service']); $this->providers_model->api_encode($appointment['provider']); @@ -275,7 +275,7 @@ class Appointments_api_v1 extends EA_Controller 'company_email' => setting('company_email'), 'company_link' => setting('company_link'), 'date_format' => setting('date_format'), - 'time_format' => setting('time_format') + 'time_format' => setting('time_format'), ]; $this->synchronization->sync_appointment_saved($appointment, $service, $provider, $customer, $settings); @@ -286,7 +286,7 @@ class Appointments_api_v1 extends EA_Controller $provider, $customer, $settings, - $manage_mode + $manage_mode, ); } @@ -355,7 +355,7 @@ class Appointments_api_v1 extends EA_Controller 'company_email' => setting('company_email'), 'company_link' => setting('company_link'), 'date_format' => setting('date_format'), - 'time_format' => setting('time_format') + 'time_format' => setting('time_format'), ]; $this->appointments_model->delete($id); @@ -367,7 +367,7 @@ class Appointments_api_v1 extends EA_Controller $service, $provider, $customer, - $settings + $settings, ); response('', 204); diff --git a/application/controllers/api/v1/Settings_api_v1.php b/application/controllers/api/v1/Settings_api_v1.php index 8dd55cc3..177757f6 100644 --- a/application/controllers/api/v1/Settings_api_v1.php +++ b/application/controllers/api/v1/Settings_api_v1.php @@ -78,7 +78,7 @@ class Settings_api_v1 extends EA_Controller json_response([ 'name' => $name, - 'value' => $value + 'value' => $value, ]); } catch (Throwable $e) { json_exception($e); @@ -99,7 +99,7 @@ class Settings_api_v1 extends EA_Controller json_response([ 'name' => $name, - 'value' => $value + 'value' => $value, ]); } catch (Throwable $e) { json_exception($e); diff --git a/application/core/EA_Controller.php b/application/core/EA_Controller.php index 831050a5..23b600d1 100644 --- a/application/core/EA_Controller.php +++ b/application/core/EA_Controller.php @@ -117,7 +117,7 @@ class EA_Controller extends CI_Controller config([ 'language' => $session_language, - 'language_code' => array_search($session_language, $language_codes) ?: 'en' + 'language_code' => array_search($session_language, $language_codes) ?: 'en', ]); } @@ -134,7 +134,7 @@ class EA_Controller extends CI_Controller 'index_page' => config('index_page'), 'available_languages' => config('available_languages'), 'language' => $this->lang->language, - 'csrf_token' => $this->security->get_csrf_hash() + 'csrf_token' => $this->security->get_csrf_hash(), ]); } @@ -149,7 +149,7 @@ class EA_Controller extends CI_Controller 'available_languages' => config('available_languages'), 'csrf_token' => $this->security->get_csrf_hash(), 'language' => config('language'), - 'language_code' => config('language_code') + 'language_code' => config('language_code'), ]); } } diff --git a/application/core/EA_Loader.php b/application/core/EA_Loader.php index f4f397ff..ebbfc315 100644 --- a/application/core/EA_Loader.php +++ b/application/core/EA_Loader.php @@ -59,7 +59,7 @@ class EA_Loader extends CI_Loader $result = $this->_ci_load([ '_ci_view' => $view, '_ci_vars' => $this->_ci_prepare_view_vars($vars), - '_ci_return' => $return + '_ci_return' => $return, ]); $layout = config('layout'); @@ -68,7 +68,7 @@ class EA_Loader extends CI_Loader $result = $this->_ci_load([ '_ci_view' => $layout['filename'], '_ci_vars' => $this->_ci_prepare_view_vars($vars), - '_ci_return' => $return + '_ci_return' => $return, ]); } diff --git a/application/helpers/array_helper.php b/application/helpers/array_helper.php index 433026f6..1f47c14e 100644 --- a/application/helpers/array_helper.php +++ b/application/helpers/array_helper.php @@ -68,7 +68,7 @@ if (!function_exists('array_fields')) { function ($field) use ($fields) { return in_array($field, $fields); }, - ARRAY_FILTER_USE_KEY + ARRAY_FILTER_USE_KEY, ); } } diff --git a/application/helpers/date_helper.php b/application/helpers/date_helper.php index 45a56ecf..bef0edea 100644 --- a/application/helpers/date_helper.php +++ b/application/helpers/date_helper.php @@ -25,7 +25,7 @@ if (!function_exists('get_date_format')) { 'DMY' => 'd/m/Y', 'MDY' => 'm/d/Y', 'YMD' => 'Y/m/d', - default => throw new RuntimeException('Invalid date format value: ' . $date_format) + default => throw new RuntimeException('Invalid date format value: ' . $date_format), }; } } @@ -43,7 +43,7 @@ if (!function_exists('get_time_format')) { return match ($time_format) { 'military' => 'H:i', 'regular' => 'g:i a', - default => throw new RuntimeException('Invalid time format value: ' . $time_format) + default => throw new RuntimeException('Invalid time format value: ' . $time_format), }; } } diff --git a/application/helpers/html_helper.php b/application/helpers/html_helper.php index fe62ddf9..81bb347e 100644 --- a/application/helpers/html_helper.php +++ b/application/helpers/html_helper.php @@ -69,8 +69,8 @@ if (!function_exists('extend')) { 'layout' => [ 'filename' => $layout, 'sections' => [], - 'tmp' => [] - ] + 'tmp' => [], + ], ]); } } diff --git a/application/helpers/http_helper.php b/application/helpers/http_helper.php index b04a37db..7d40edd2 100644 --- a/application/helpers/http_helper.php +++ b/application/helpers/http_helper.php @@ -137,9 +137,9 @@ if (!function_exists('json_exception')) { [ 'success' => false, 'message' => $e->getMessage(), - 'trace' => config('debug') ? $e->getTrace() : [] + 'trace' => config('debug') ? $e->getTrace() : [], ], - 500 + 500, ); } } diff --git a/application/helpers/setting_helper.php b/application/helpers/setting_helper.php index 0f4efb28..607c74d5 100644 --- a/application/helpers/setting_helper.php +++ b/application/helpers/setting_helper.php @@ -53,7 +53,7 @@ if (!function_exists('setting')) { if (empty($setting)) { $setting = [ - 'name' => $name + 'name' => $name, ]; } diff --git a/application/libraries/Accounts.php b/application/libraries/Accounts.php index c280e02a..f49c732d 100644 --- a/application/libraries/Accounts.php +++ b/application/libraries/Accounts.php @@ -56,7 +56,7 @@ class Accounts $user_settings = $this->CI->db ->get_where('user_settings', [ 'username' => $username, - 'password' => $password + 'password' => $password, ]) ->row_array(); @@ -76,7 +76,7 @@ class Accounts 'username' => $username, 'timezone' => !empty($user['timezone']) ? $user['timezone'] : $default_timezone, 'language' => !empty($user['language']) ? $user['language'] : Config::LANGUAGE, - 'role_slug' => $role['slug'] + 'role_slug' => $role['slug'], ]; } diff --git a/application/libraries/Api.php b/application/libraries/Api.php index 4067c727..e4ab6856 100644 --- a/application/libraries/Api.php +++ b/application/libraries/Api.php @@ -83,7 +83,7 @@ class Api throw new RuntimeException( 'The provided credentials do not match any admin user!', 401, - 'Unauthorized' + 'Unauthorized', ); } } catch (Throwable) { @@ -133,7 +133,7 @@ class Api // about capitalization for Authorization). $requestHeaders = array_combine( array_map('ucwords', array_keys($requestHeaders)), - array_values($requestHeaders) + array_values($requestHeaders), ); if (isset($requestHeaders['Authorization'])) { diff --git a/application/libraries/Availability.php b/application/libraries/Availability.php index d9b72da7..f890e7c5 100644 --- a/application/libraries/Availability.php +++ b/application/libraries/Availability.php @@ -60,7 +60,7 @@ class Availability string $date, array $service, array $provider, - int $exclude_appointment_id = null + int $exclude_appointment_id = null, ): array { if ($this->CI->blocked_periods_model->is_entire_date_blocked($date)) { return []; @@ -97,13 +97,13 @@ class Availability string $date, array $service, array $provider, - int $exclude_appointment_id = null + int $exclude_appointment_id = null, ): array { $unavailability_events = $this->CI->unavailabilities_model->get([ 'is_unavailability' => true, 'DATE(start_datetime) <=' => $date, 'DATE(end_datetime) >=' => $date, - 'id_users_provider' => $provider['id'] + 'id_users_provider' => $provider['id'], ]); $working_plan = json_decode($provider['settings']['working_plan'], true); @@ -126,8 +126,8 @@ class Availability $periods = [ [ 'start' => new DateTime($date . ' ' . $date_working_plan['start']), - 'end' => new DateTime($date . ' ' . $date_working_plan['end']) - ] + 'end' => new DateTime($date . ' ' . $date_working_plan['end']), + ], ]; $blocked_periods = $this->CI->blocked_periods_model->get_for_period($date, $date); @@ -154,7 +154,7 @@ class Availability $slot_end, $service['id'], $provider['id'], - $exclude_appointment_id + $exclude_appointment_id, ); if ($other_service_attendants_number > 0) { @@ -169,7 +169,7 @@ class Availability $slot_end, $service['id'], $provider['id'], - $exclude_appointment_id + $exclude_appointment_id, ); if ($appointment_attendants_number < $service['attendants_number']) { @@ -227,7 +227,7 @@ class Availability $period['end'] = $break_start; $periods[] = [ 'start' => $break_end, - 'end' => $period_end + 'end' => $period_end, ]; continue; } @@ -290,7 +290,7 @@ class Availability $period['end'] = $unavailability_start; $periods[] = [ 'start' => $unavailability_end, - 'end' => $period_end + 'end' => $period_end, ]; continue; } @@ -365,8 +365,8 @@ class Availability array_merge( $this->CI->appointments_model->get($where), $this->CI->unavailabilities_model->get($where), - $this->CI->blocked_periods_model->get_for_period($date, $date) - ) + $this->CI->blocked_periods_model->get_for_period($date, $date), + ), ); // Find the empty spaces on the plan. The first split between the plan is due to a break (if any). After that @@ -389,7 +389,7 @@ class Availability if (isset($date_working_plan['breaks'])) { $periods[] = [ 'start' => $date_working_plan['start'], - 'end' => $date_working_plan['end'] + 'end' => $date_working_plan['end'], ]; $day_start = new DateTime($date_working_plan['start']); @@ -421,7 +421,7 @@ class Availability if ($break_start > $period_start && $break_start < $period_end && $break_end > $period_start) { $periods[] = [ 'start' => $period_start->format('H:i'), - 'end' => $break_start->format('H:i') + 'end' => $break_start->format('H:i'), ]; $remove_current_period = true; @@ -430,7 +430,7 @@ class Availability if ($break_start < $period_end && $break_end > $period_start && $break_end < $period_end) { $periods[] = [ 'start' => $break_end->format('H:i'), - 'end' => $period_end->format('H:i') + 'end' => $period_end->format('H:i'), ]; $remove_current_period = true; @@ -484,12 +484,12 @@ class Availability $periods[] = [ 'start' => $period_start->format('H:i'), - 'end' => $appointment_start->format('H:i') + 'end' => $appointment_start->format('H:i'), ]; $periods[] = [ 'start' => $appointment_end->format('H:i'), - 'end' => $period_end->format('H:i') + 'end' => $period_end->format('H:i'), ]; } elseif ($appointment_start == $period_start && $appointment_end == $period_end) { unset($periods[$index]); // The whole period is blocked so remove it from the available periods array. @@ -623,7 +623,7 @@ class Availability protected function consider_future_booking_limit( string $selected_date, array $available_hours, - array $provider + array $provider, ): array { $provider_timezone = new DateTimeZone($provider['timezone']); diff --git a/application/libraries/Captcha_builder.php b/application/libraries/Captcha_builder.php index 4b3cfb16..d06f2aeb 100644 --- a/application/libraries/Captcha_builder.php +++ b/application/libraries/Captcha_builder.php @@ -251,7 +251,7 @@ class Captcha_builder if (!in_array($imageType, $this->allowedBackgroundImageTypes)) { throw new Exception( - 'Invalid background image type! Allowed types are: ' . join(', ', $this->allowedBackgroundImageTypes) + 'Invalid background image type! Allowed types are: ' . join(', ', $this->allowedBackgroundImageTypes), ); } @@ -395,7 +395,7 @@ class Captcha_builder $this->getCol($image, floor($nX), floor($nY), $bg), $this->getCol($image, ceil($nX), floor($nY), $bg), $this->getCol($image, floor($nX), ceil($nY), $bg), - $this->getCol($image, ceil($nX), ceil($nY), $bg) + $this->getCol($image, ceil($nX), ceil($nY), $bg), ); } else { $p = $this->getCol($image, round($nX), round($nY), $bg); diff --git a/application/libraries/Email_messages.php b/application/libraries/Email_messages.php index 9643529d..00f9309f 100644 --- a/application/libraries/Email_messages.php +++ b/application/libraries/Email_messages.php @@ -72,7 +72,7 @@ class Email_messages string $appointment_link, string $recipient_email, string $ics_stream, - string $timezone = null + string $timezone = null, ): void { $appointment_timezone = new DateTimeZone($provider['timezone']); @@ -101,9 +101,9 @@ class Email_messages 'customer' => $customer, 'settings' => $settings, 'timezone' => $timezone, - 'appointment_link' => $appointment_link + 'appointment_link' => $appointment_link, ], - true + true, ); $this->CI->email->from($settings['company_email'], $settings['company_email']); @@ -143,7 +143,7 @@ class Email_messages array $settings, string $recipient_email, string $reason = null, - string $timezone = null + string $timezone = null, ): void { $appointment_timezone = new DateTimeZone($provider['timezone']); @@ -170,9 +170,9 @@ class Email_messages 'customer' => $customer, 'settings' => $settings, 'timezone' => $timezone, - 'reason' => $reason + 'reason' => $reason, ], - true + true, ); $this->CI->email->from($settings['company_email'], $settings['company_email']); @@ -202,9 +202,9 @@ class Email_messages [ 'subject' => lang('new_account_password'), 'message' => str_replace('$password', '' . $password . '', lang('new_password_is')), - 'settings' => $settings + 'settings' => $settings, ], - true + true, ); $this->CI->email->from($settings['company_email'], $settings['company_email']); diff --git a/application/libraries/Google_sync.php b/application/libraries/Google_sync.php index 312c8a94..fb2e4e08 100644 --- a/application/libraries/Google_sync.php +++ b/application/libraries/Google_sync.php @@ -62,7 +62,7 @@ class Google_sync public function initialize_clients(): void { $http = new GuzzleHttp\Client([ - 'verify' => false + 'verify' => false, ]); $this->client = new Google_Client(); @@ -109,7 +109,7 @@ class Google_sync if (isset($response['error'])) { throw new RuntimeException( - 'Google Authentication Error (' . $response['error'] . '): ' . $response['error_description'] + 'Google Authentication Error (' . $response['error'] . '): ' . $response['error_description'], ); } @@ -155,7 +155,7 @@ class Google_sync array $provider, array $service, array $customer, - array $settings + array $settings, ): Event { $event = new Google_Service_Calendar_Event(); $event->setSummary(!empty($service) ? $service['name'] : 'Unavailable'); @@ -166,7 +166,7 @@ class Google_sync $start = new Google_Service_Calendar_EventDateTime(); $start->setDateTime( - (new DateTime($appointment['start_datetime'], $timezone))->format(DateTimeInterface::RFC3339) + (new DateTime($appointment['start_datetime'], $timezone))->format(DateTimeInterface::RFC3339), ); $event->setStart($start); @@ -213,11 +213,11 @@ class Google_sync array $provider, array $service, array $customer, - array $settings + array $settings, ): Event { $event = $this->service->events->get( $provider['settings']['google_calendar'], - $appointment['id_google_calendar'] + $appointment['id_google_calendar'], ); $event->setSummary($service['name']); @@ -228,7 +228,7 @@ class Google_sync $start = new Google_Service_Calendar_EventDateTime(); $start->setDateTime( - (new DateTime($appointment['start_datetime'], $timezone))->format(DateTimeInterface::RFC3339) + (new DateTime($appointment['start_datetime'], $timezone))->format(DateTimeInterface::RFC3339), ); $event->setStart($start); @@ -284,13 +284,13 @@ class Google_sync $start = new Google_Service_Calendar_EventDateTime(); $start->setDateTime( - (new DateTime($unavailability['start_datetime'], $timezone))->format(DateTimeInterface::RFC3339) + (new DateTime($unavailability['start_datetime'], $timezone))->format(DateTimeInterface::RFC3339), ); $event->setStart($start); $end = new Google_Service_Calendar_EventDateTime(); $end->setDateTime( - (new DateTime($unavailability['end_datetime'], $timezone))->format(DateTimeInterface::RFC3339) + (new DateTime($unavailability['end_datetime'], $timezone))->format(DateTimeInterface::RFC3339), ); $event->setEnd($end); @@ -312,7 +312,7 @@ class Google_sync { $event = $this->service->events->get( $provider['settings']['google_calendar'], - $unavailability['id_google_calendar'] + $unavailability['id_google_calendar'], ); $event->setSummary('Unavailable'); @@ -322,13 +322,13 @@ class Google_sync $start = new Google_Service_Calendar_EventDateTime(); $start->setDateTime( - (new DateTime($unavailability['start_datetime'], $timezone))->format(DateTimeInterface::RFC3339) + (new DateTime($unavailability['start_datetime'], $timezone))->format(DateTimeInterface::RFC3339), ); $event->setStart($start); $end = new Google_Service_Calendar_EventDateTime(); $end->setDateTime( - (new DateTime($unavailability['end_datetime'], $timezone))->format(DateTimeInterface::RFC3339) + (new DateTime($unavailability['end_datetime'], $timezone))->format(DateTimeInterface::RFC3339), ); $event->setEnd($end); @@ -373,7 +373,7 @@ class Google_sync $params = [ 'timeMin' => date(DateTimeInterface::RFC3339, $start), 'timeMax' => date(DateTimeInterface::RFC3339, $end), - 'singleEvents' => true + 'singleEvents' => true, ]; return $this->service->events->listEvents($google_calendar, $params); @@ -400,7 +400,7 @@ class Google_sync $calendars[] = [ 'id' => $google_calendar->getId(), - 'summary' => $google_calendar->getSummary() + 'summary' => $google_calendar->getSummary(), ]; } @@ -453,7 +453,7 @@ class Google_sync $appointment_end_instance->format('Ymd\THis\Z'), 'location' => setting('company_name'), 'details' => 'View/Change Appointment: ' . site_url('appointments/index/' . $appointment['hash']), - 'add' => implode(', ', $add) + 'add' => implode(', ', $add), ]; return 'https://calendar.google.com/calendar/render?' . http_build_query($add_to_google_url_params); diff --git a/application/libraries/Ics_calendar.php b/application/libraries/Ics_calendar.php index 6b3a2c2f..bc53cdd9 100644 --- a/application/libraries/Ics_calendar.php +++ b/application/libraries/Ics_calendar.php @@ -252,13 +252,13 @@ class Ics_calendar extends Calendar if ($image['VALUE'] == 'URI' && $image['URI']) { $new_image = [ 'VALUE' => 'URI', - 'URI' => $image['URI'] + 'URI' => $image['URI'], ]; } elseif ($image['VALUE'] == 'BINARY' && $image['ENCODING'] && $image['BINARY']) { $new_image = [ 'VALUE' => 'BINARY', 'ENCODING' => $image['ENCODING'], - 'BINARY' => $image['BINARY'] + 'BINARY' => $image['BINARY'], ]; } else { return; diff --git a/application/libraries/Ics_file.php b/application/libraries/Ics_file.php index ff7067a0..a17261f9 100644 --- a/application/libraries/Ics_file.php +++ b/application/libraries/Ics_file.php @@ -108,7 +108,7 @@ class Ics_file '', lang('notes'), '', - $appointment['notes'] + $appointment['notes'], ]; $event->setDescription(implode("\\n", $description)); diff --git a/application/libraries/Instance.php b/application/libraries/Instance.php index d6dd4221..937939b3 100644 --- a/application/libraries/Instance.php +++ b/application/libraries/Instance.php @@ -91,7 +91,7 @@ class Instance setting([ 'company_name' => 'Company Name', 'company_email' => 'info@example.org', - 'company_link' => 'https://example.org' + 'company_link' => 'https://example.org', ]); // Admin @@ -107,8 +107,8 @@ class Instance 'username' => 'administrator', 'password' => $password, 'notifications' => true, - 'calendar_view' => CALENDAR_VIEW_DEFAULT - ] + 'calendar_view' => CALENDAR_VIEW_DEFAULT, + ], ]); // Service @@ -119,7 +119,7 @@ class Instance 'price' => '0', 'currency' => '', 'availabilities_type' => 'flexible', - 'attendants_number' => '1' + 'attendants_number' => '1', ]); // Provider @@ -139,8 +139,8 @@ class Instance 'google_sync' => false, 'sync_past_days' => 30, 'sync_future_days' => 90, - 'calendar_view' => CALENDAR_VIEW_DEFAULT - ] + 'calendar_view' => CALENDAR_VIEW_DEFAULT, + ], ]); // Customer @@ -149,7 +149,7 @@ class Instance 'first_name' => 'James', 'last_name' => 'Doe', 'email' => 'james@example.org', - 'phone_number' => '+10000000000' + 'phone_number' => '+10000000000', ]); return $password; diff --git a/application/libraries/Notifications.php b/application/libraries/Notifications.php index 05473c8b..59df379a 100644 --- a/application/libraries/Notifications.php +++ b/application/libraries/Notifications.php @@ -60,7 +60,7 @@ class Notifications array $provider, array $customer, array $settings, - bool $manage_mode = false + bool $manage_mode = false, ): void { try { $current_language = config('english'); @@ -92,14 +92,14 @@ class Notifications $customer_link, $customer['email'], $ics_stream, - $customer['timezone'] + $customer['timezone'], ); } // Notify provider. $send_provider = filter_var( $this->CI->providers_model->get_setting($provider['id'], 'notifications'), - FILTER_VALIDATE_BOOLEAN + FILTER_VALIDATE_BOOLEAN, ); if ($send_provider === true) { @@ -119,7 +119,7 @@ class Notifications $provider_link, $provider['email'], $ics_stream, - $provider['timezone'] + $provider['timezone'], ); } @@ -147,7 +147,7 @@ class Notifications $provider_link, $admin['email'], $ics_stream, - $admin['timezone'] + $admin['timezone'], ); } @@ -179,7 +179,7 @@ class Notifications $provider_link, $secretary['email'], $ics_stream, - $secretary['timezone'] + $secretary['timezone'], ); } } catch (Throwable $e) { @@ -188,7 +188,7 @@ class Notifications 'Notifications - Could not email confirmation details of appointment (' . ($appointment['id'] ?? '-') . ') : ' . - $e->getMessage() + $e->getMessage(), ); log_message('error', $e->getTraceAsString()); } finally { @@ -212,7 +212,7 @@ class Notifications array $provider, array $customer, array $settings, - string $cancellation_reason = '' + string $cancellation_reason = '', ): void { try { $current_language = config('language'); @@ -220,7 +220,7 @@ class Notifications // Notify provider. $send_provider = filter_var( $this->CI->providers_model->get_setting($provider['id'], 'notifications'), - FILTER_VALIDATE_BOOLEAN + FILTER_VALIDATE_BOOLEAN, ); if ($send_provider === true) { @@ -235,7 +235,7 @@ class Notifications $settings, $provider['email'], $cancellation_reason, - $provider['timezone'] + $provider['timezone'], ); } @@ -255,7 +255,7 @@ class Notifications $settings, $customer['email'], $cancellation_reason, - $customer['timezone'] + $customer['timezone'], ); } @@ -278,7 +278,7 @@ class Notifications $settings, $admin['email'], $cancellation_reason, - $admin['timezone'] + $admin['timezone'], ); } @@ -305,7 +305,7 @@ class Notifications $settings, $secretary['email'], $cancellation_reason, - $secretary['timezone'] + $secretary['timezone'], ); } } catch (Throwable $e) { @@ -314,7 +314,7 @@ class Notifications 'Notifications - Could not email cancellation details of appointment (' . ($appointment['id'] ?? '-') . ') : ' . - $e->getMessage() + $e->getMessage(), ); log_message('error', $e->getTraceAsString()); } finally { diff --git a/application/libraries/Synchronization.php b/application/libraries/Synchronization.php index fa874cf0..d029730c 100644 --- a/application/libraries/Synchronization.php +++ b/application/libraries/Synchronization.php @@ -52,7 +52,7 @@ class Synchronization array $service, array $provider, array $customer, - array $settings + array $settings, ): void { try { if (!$provider['settings']['google_sync']) { @@ -73,7 +73,7 @@ class Synchronization $provider, $service, $customer, - $settings + $settings, ); $appointment['id_google_calendar'] = $google_event->getId(); @@ -88,7 +88,7 @@ class Synchronization 'Synchronization - Could not sync confirmation details of appointment (' . ($appointment['id'] ?? '-') . ') : ' . - $e->getMessage() + $e->getMessage(), ); log_message('error', $e->getTraceAsString()); } @@ -130,7 +130,7 @@ class Synchronization 'Synchronization - Could not sync cancellation details of unavailability (' . ($appointment['id'] ?? '-') . ') : ' . - $e->getMessage() + $e->getMessage(), ); log_message('error', $e->getTraceAsString()); } @@ -164,7 +164,7 @@ class Synchronization 'Synchronization - Could not sync cancellation details of unavailability (' . ($appointment['id'] ?? '-') . ') : ' . - $e->getMessage() + $e->getMessage(), ); log_message('error', $e->getTraceAsString()); } @@ -223,7 +223,7 @@ class Synchronization 'Synchronization - Could not sync cancellation details of appointment (' . ($appointment['id'] ?? '-') . ') : ' . - $e->getMessage() + $e->getMessage(), ); log_message('error', $e->getTraceAsString()); } diff --git a/application/libraries/Timezones.php b/application/libraries/Timezones.php index d993362c..c5e93e31 100644 --- a/application/libraries/Timezones.php +++ b/application/libraries/Timezones.php @@ -35,7 +35,7 @@ class Timezones */ protected array $timezones = [ 'UTC' => [ - 'UTC' => 'UTC' + 'UTC' => 'UTC', ], 'America' => [ 'America/Adak' => 'Adak (-10:00)', @@ -166,7 +166,7 @@ class Timezones 'America/Sao_Paulo' => 'Sao_Paulo (-3:00)', 'America/Noronha' => 'Noronha (-2:00)', 'America/Scoresbysund' => 'Scoresbysund (-1:00)', - 'America/Danmarkshavn' => 'Danmarkshavn (+0:00)' + 'America/Danmarkshavn' => 'Danmarkshavn (+0:00)', ], 'Canada' => [ 'Canada/Pacific' => 'Pacific (-8:00)', @@ -177,16 +177,16 @@ class Timezones 'Canada/Saskatchewan' => 'Saskatchewan (-6:00)', 'Canada/Eastern' => 'Eastern (-5:00)', 'Canada/Atlantic' => 'Atlantic (-4:00)', - 'Canada/Newfoundland' => 'Newfoundland (-3:-30)' + 'Canada/Newfoundland' => 'Newfoundland (-3:-30)', ], 'Mexico' => [ 'Mexico/BajaNorte' => 'BajaNorte (-8:00)', 'Mexico/BajaSur' => 'BajaSur (-7:00)', - 'Mexico/General' => 'General (-6:00)' + 'Mexico/General' => 'General (-6:00)', ], 'Chile' => [ 'Chile/EasterIsland' => 'EasterIsland (-6:00)', - 'Chile/Continental' => 'Continental (-4:00)' + 'Chile/Continental' => 'Continental (-4:00)', ], 'Antarctica' => [ 'Antarctica/Palmer' => 'Palmer (-4:00)', @@ -198,7 +198,7 @@ class Timezones 'Antarctica/Casey' => 'Casey (+8:00)', 'Antarctica/DumontDUrville' => 'DumontDUrville (+10:00)', 'Antarctica/McMurdo' => 'McMurdo (+12:00)', - 'Antarctica/South_Pole' => 'South_Pole (+12:00)' + 'Antarctica/South_Pole' => 'South_Pole (+12:00)', ], 'Atlantic' => [ 'Atlantic/Bermuda' => 'Bermuda (-4:00)', @@ -212,13 +212,13 @@ class Timezones 'Atlantic/Madeira' => 'Madeira (+0:00)', 'Atlantic/Reykjavik' => 'Reykjavik (+0:00)', 'Atlantic/St_Helena' => 'St_Helena (+0:00)', - 'Atlantic/Jan_Mayen' => 'Jan_Mayen (+1:00)' + 'Atlantic/Jan_Mayen' => 'Jan_Mayen (+1:00)', ], 'Brazil' => [ 'Brazil/Acre' => 'Acre (-4:00)', 'Brazil/West' => 'West (-4:00)', 'Brazil/East' => 'East (-3:00)', - 'Brazil/DeNoronha' => 'DeNoronha (-2:00)' + 'Brazil/DeNoronha' => 'DeNoronha (-2:00)', ], 'Africa' => [ 'Africa/Abidjan' => 'Abidjan (+0:00)', @@ -273,7 +273,7 @@ class Timezones 'Africa/Kampala' => 'Kampala (+3:00)', 'Africa/Khartoum' => 'Khartoum (+3:00)', 'Africa/Mogadishu' => 'Mogadishu (+3:00)', - 'Africa/Nairobi' => 'Nairobi (+3:00)' + 'Africa/Nairobi' => 'Nairobi (+3:00)', ], 'Europe' => [ 'Europe/Belfast' => 'Belfast (+0:00)', @@ -333,10 +333,10 @@ class Timezones 'Europe/Zaporozhye' => 'Zaporozhye (+2:00)', 'Europe/Moscow' => 'Moscow (+3:00)', 'Europe/Volgograd' => 'Volgograd (+3:00)', - 'Europe/Samara' => 'Samara (+4:00)' + 'Europe/Samara' => 'Samara (+4:00)', ], 'Arctic' => [ - 'Arctic/Longyearbyen' => 'Longyearbyen (+1:00)' + 'Arctic/Longyearbyen' => 'Longyearbyen (+1:00)', ], 'Asia' => [ 'Asia/Amman' => 'Amman (+2:00)', @@ -423,7 +423,7 @@ class Timezones 'Asia/Vladivostok' => 'Vladivostok (+10:00)', 'Asia/Magadan' => 'Magadan (+11:00)', 'Asia/Anadyr' => 'Anadyr (+12:00)', - 'Asia/Kamchatka' => 'Kamchatka (+12:00)' + 'Asia/Kamchatka' => 'Kamchatka (+12:00)', ], 'Indian' => [ 'Indian/Antananarivo' => 'Antananarivo (+3:00)', @@ -436,7 +436,7 @@ class Timezones 'Indian/Maldives' => 'Maldives (+5:00)', 'Indian/Chagos' => 'Chagos (+6:00)', 'Indian/Cocos' => 'Cocos (+6:30)', - 'Indian/Christmas' => 'Christmas (+7:00)' + 'Indian/Christmas' => 'Christmas (+7:00)', ], 'Australia' => [ 'Australia/Perth' => 'Perth (+8:00)', @@ -461,7 +461,7 @@ class Timezones 'Australia/Tasmania' => 'Tasmania (+10:00)', 'Australia/Victoria' => 'Victoria (+10:00)', 'Australia/LHI' => 'LHI (+10:30)', - 'Australia/Lord_Howe' => 'Lord_Howe (+10:30)' + 'Australia/Lord_Howe' => 'Lord_Howe (+10:30)', ], 'Pacific' => [ 'Pacific/Apia' => 'Apia (+13:00)', @@ -499,8 +499,8 @@ class Timezones 'Pacific/Tarawa' => 'Tarawa (+12:00)', 'Pacific/Tongatapu' => 'Tongatapu (+13:00)', 'Pacific/Wake' => 'Wake (+12:00)', - 'Pacific/Wallis' => 'Wallis (+12:00)' - ] + 'Pacific/Wallis' => 'Wallis (+12:00)', + ], ]; /** diff --git a/application/libraries/Webhooks_client.php b/application/libraries/Webhooks_client.php index 4bdec38e..921c71a3 100644 --- a/application/libraries/Webhooks_client.php +++ b/application/libraries/Webhooks_client.php @@ -78,8 +78,8 @@ class Webhooks_client 'verify' => $webhook['is_ssl_verified'], 'json' => [ 'action' => $action, - 'payload' => $payload - ] + 'payload' => $payload, + ], ]); } catch (Throwable $e) { log_message( @@ -87,7 +87,7 @@ class Webhooks_client 'Webhooks Client - The webhook (' . ($webhook['id'] ?? null) . ') request received an unexpected exception: ' . - $e->getMessage() + $e->getMessage(), ); log_message('error', $e->getTraceAsString()); } diff --git a/application/migrations/001_specific_calendar_sync.php b/application/migrations/001_specific_calendar_sync.php index f71ffe18..9b29f20e 100644 --- a/application/migrations/001_specific_calendar_sync.php +++ b/application/migrations/001_specific_calendar_sync.php @@ -28,55 +28,55 @@ class Migration_Specific_calendar_sync extends EA_Migration 'type' => 'BIGINT', 'constraint' => '20', 'unsigned' => true, - 'auto_increment' => true + 'auto_increment' => true, ], 'book_datetime' => [ 'type' => 'DATETIME', - 'null' => true + 'null' => true, ], 'start_datetime' => [ 'type' => 'DATETIME', - 'null' => true + 'null' => true, ], 'end_datetime' => [ 'type' => 'DATETIME', - 'null' => true + 'null' => true, ], 'notes' => [ 'type' => 'TEXT', - 'null' => true + 'null' => true, ], 'hash' => [ 'type' => 'TEXT', - 'null' => true + 'null' => true, ], 'is_unavailability' => [ 'type' => 'TINYINT', 'constraint' => '4', - 'default' => '0' + 'default' => '0', ], 'id_users_provider' => [ 'type' => 'BIGINT', 'constraint' => '20', 'unsigned' => true, - 'null' => true + 'null' => true, ], 'id_users_customer' => [ 'type' => 'BIGINT', 'constraint' => '20', 'unsigned' => true, - 'null' => true + 'null' => true, ], 'id_services' => [ 'type' => 'BIGINT', 'constraint' => '20', 'unsigned' => true, - 'null' => true + 'null' => true, ], 'id_google_calendar' => [ 'type' => 'TEXT', - 'null' => true - ] + 'null' => true, + ], ]); $this->dbforge->add_key('id', true); $this->dbforge->add_key('id_users_provider'); @@ -89,53 +89,53 @@ class Migration_Specific_calendar_sync extends EA_Migration 'type' => 'BIGINT', 'constraint' => '20', 'unsigned' => true, - 'auto_increment' => true + 'auto_increment' => true, ], 'name' => [ 'type' => 'VARCHAR', 'constraint' => '256', - 'null' => true + 'null' => true, ], 'slug' => [ 'type' => 'VARCHAR', 'constraint' => '256', - 'null' => true + 'null' => true, ], 'is_admin' => [ 'type' => 'TINYINT', 'constraint' => '4', - 'null' => true + 'null' => true, ], 'appointments' => [ 'type' => 'INT', 'constraint' => '4', - 'null' => true + 'null' => true, ], 'customers' => [ 'type' => 'INT', 'constraint' => '4', - 'null' => true + 'null' => true, ], 'services' => [ 'type' => 'INT', 'constraint' => '4', - 'null' => true + 'null' => true, ], 'users' => [ 'type' => 'INT', 'constraint' => '4', - 'null' => true + 'null' => true, ], 'system_settings' => [ 'type' => 'INT', 'constraint' => '4', - 'null' => true + 'null' => true, ], 'user_settings' => [ 'type' => 'INT', 'constraint' => '4', - 'null' => true - ] + 'null' => true, + ], ]); $this->dbforge->add_key('id', true); $this->dbforge->create_table('roles', true, ['engine' => 'InnoDB']); @@ -144,13 +144,13 @@ class Migration_Specific_calendar_sync extends EA_Migration 'id_users_secretary' => [ 'type' => 'BIGINT', 'constraint' => '20', - 'unsigned' => true + 'unsigned' => true, ], 'id_users_provider' => [ 'type' => 'BIGINT', 'constraint' => '20', - 'unsigned' => true - ] + 'unsigned' => true, + ], ]); $this->dbforge->add_key('id_users_secretary', true); $this->dbforge->add_key('id_users_provider', true); @@ -161,38 +161,38 @@ class Migration_Specific_calendar_sync extends EA_Migration 'type' => 'BIGINT', 'constraint' => '20', 'unsigned' => true, - 'auto_increment' => true + 'auto_increment' => true, ], 'name' => [ 'type' => 'VARCHAR', 'constraint' => '256', - 'null' => true + 'null' => true, ], 'duration' => [ 'type' => 'INT', 'constraint' => '11', - 'null' => true + 'null' => true, ], 'price' => [ 'type' => 'DECIMAL', 'constraint' => '10,2', - 'null' => true + 'null' => true, ], 'currency' => [ 'type' => 'VARCHAR', 'constraint' => '32', - 'null' => true + 'null' => true, ], 'description' => [ 'type' => 'TEXT', - 'null' => true + 'null' => true, ], 'id_service_categories' => [ 'type' => 'BIGINT', 'constraint' => '20', 'unsigned' => true, - 'null' => true - ] + 'null' => true, + ], ]); $this->dbforge->add_key('id', true); $this->dbforge->add_key('id_service_categories'); @@ -202,13 +202,13 @@ class Migration_Specific_calendar_sync extends EA_Migration 'id_users' => [ 'type' => 'BIGINT', 'constraint' => '20', - 'unsigned' => true + 'unsigned' => true, ], 'id_services' => [ 'type' => 'BIGINT', 'constraint' => '20', - 'unsigned' => true - ] + 'unsigned' => true, + ], ]); $this->dbforge->add_key('id_users', true); $this->dbforge->add_key('id_services', true); @@ -219,17 +219,17 @@ class Migration_Specific_calendar_sync extends EA_Migration 'type' => 'BIGINT', 'constraint' => '20', 'unsigned' => true, - 'auto_increment' => true + 'auto_increment' => true, ], 'name' => [ 'type' => 'VARCHAR', 'constraint' => '256', - 'null' => true + 'null' => true, ], 'description' => [ 'type' => 'TEXT', - 'null' => true - ] + 'null' => true, + ], ]); $this->dbforge->add_key('id', true); $this->dbforge->add_key('id_service_categories'); @@ -240,17 +240,17 @@ class Migration_Specific_calendar_sync extends EA_Migration 'type' => 'BIGINT', 'constraint' => '20', 'unsigned' => true, - 'auto_increment' => true + 'auto_increment' => true, ], 'name' => [ 'type' => 'VARCHAR', 'constraint' => '512', - 'null' => true + 'null' => true, ], 'value' => [ 'type' => 'LONGTEXT', - 'null' => true - ] + 'null' => true, + ], ]); $this->dbforge->add_key('id', true); $this->dbforge->create_table('settings', true, ['engine' => 'InnoDB']); @@ -260,62 +260,62 @@ class Migration_Specific_calendar_sync extends EA_Migration 'type' => 'BIGINT', 'constraint' => '20', 'unsigned' => true, - 'auto_increment' => true + 'auto_increment' => true, ], 'first_name' => [ 'type' => 'VARCHAR', 'constraint' => '256', - 'null' => true + 'null' => true, ], 'last_name' => [ 'type' => 'VARCHAR', 'constraint' => '512', - 'null' => true + 'null' => true, ], 'email' => [ 'type' => 'VARCHAR', 'constraint' => '512', - 'null' => true + 'null' => true, ], 'mobile_number' => [ 'type' => 'VARCHAR', 'constraint' => '128', - 'null' => true + 'null' => true, ], 'phone_number' => [ 'type' => 'VARCHAR', 'constraint' => '128', - 'null' => true + 'null' => true, ], 'address' => [ 'type' => 'VARCHAR', 'constraint' => '256', - 'null' => true + 'null' => true, ], 'city' => [ 'type' => 'VARCHAR', 'constraint' => '256', - 'null' => true + 'null' => true, ], 'state' => [ 'type' => 'VARCHAR', 'constraint' => '128', - 'null' => true + 'null' => true, ], 'zip_code' => [ 'type' => 'VARCHAR', 'constraint' => '64', - 'null' => true + 'null' => true, ], 'notes' => [ 'type' => 'TEXT', - 'null' => true + 'null' => true, ], 'id_roles' => [ 'type' => 'BIGINT', 'constraint' => '20', - 'unsigned' => true - ] + 'unsigned' => true, + ], ]); $this->dbforge->add_key('id', true); $this->dbforge->add_key('id_roles'); @@ -325,58 +325,58 @@ class Migration_Specific_calendar_sync extends EA_Migration 'id_users' => [ 'type' => 'BIGINT', 'constraint' => '20', - 'unsigned' => true + 'unsigned' => true, ], 'username' => [ 'type' => 'VARCHAR', 'constraint' => '256', - 'null' => true + 'null' => true, ], 'password' => [ 'type' => 'VARCHAR', 'constraint' => '512', - 'null' => true + 'null' => true, ], 'salt' => [ 'type' => 'VARCHAR', 'constraint' => '512', - 'null' => true + 'null' => true, ], 'working_plan' => [ 'type' => 'TEXT', - 'null' => true + 'null' => true, ], 'notifications' => [ 'type' => 'TINYINT', 'constraint' => '4', - 'null' => true + 'null' => true, ], 'google_sync' => [ 'type' => 'TINYINT', 'constraint' => '4', - 'null' => true + 'null' => true, ], 'google_token' => [ 'type' => 'TEXT', - 'null' => true + 'null' => true, ], 'google_calendar' => [ 'type' => 'VARCHAR', 'constraint' => '128', - 'null' => true + 'null' => true, ], 'sync_past_days' => [ 'type' => 'INT', 'constraint' => '11', 'null' => true, - 'default' => '5' + 'default' => '5', ], 'sync_future_days' => [ 'type' => 'INT', 'constraint' => '11', 'null' => true, - 'default' => '5' - ] + 'default' => '5', + ], ]); $this->dbforge->add_key('id_users', true); $this->dbforge->create_table('user_settings', true, ['engine' => 'InnoDB']); @@ -401,7 +401,7 @@ class Migration_Specific_calendar_sync extends EA_Migration '_ibfk_4` FOREIGN KEY (`id_users_provider`) REFERENCES `' . $this->db->dbprefix('users') . '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; - ' + ', ); $this->db->query( @@ -419,7 +419,7 @@ class Migration_Specific_calendar_sync extends EA_Migration '_2` FOREIGN KEY (`id_users_provider`) REFERENCES `' . $this->db->dbprefix('users') . '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; - ' + ', ); $this->db->query( @@ -432,7 +432,7 @@ class Migration_Specific_calendar_sync extends EA_Migration '_ibfk_1` FOREIGN KEY (`id_service_categories`) REFERENCES `' . $this->db->dbprefix('service_categories') . '` (`id`) ON DELETE SET NULL ON UPDATE CASCADE; - ' + ', ); $this->db->query( @@ -450,7 +450,7 @@ class Migration_Specific_calendar_sync extends EA_Migration '_ibfk_2` FOREIGN KEY (`id_services`) REFERENCES `' . $this->db->dbprefix('services') . '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; - ' + ', ); $this->db->query( @@ -463,7 +463,7 @@ class Migration_Specific_calendar_sync extends EA_Migration '_ibfk_1` FOREIGN KEY (`id_roles`) REFERENCES `' . $this->db->dbprefix('roles') . '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; - ' + ', ); $this->db->query( @@ -477,7 +477,7 @@ class Migration_Specific_calendar_sync extends EA_Migration $this->db->dbprefix('users') . '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; - ' + ', ); $this->db->insert('roles', [ @@ -489,7 +489,7 @@ class Migration_Specific_calendar_sync extends EA_Migration 'services' => 15, 'users' => 15, 'system_settings' => 15, - 'user_settings' => 15 + 'user_settings' => 15, ]); $this->db->insert('roles', [ @@ -501,7 +501,7 @@ class Migration_Specific_calendar_sync extends EA_Migration 'services' => 0, 'users' => 0, 'system_settings' => 0, - 'user_settings' => 15 + 'user_settings' => 15, ]); $this->db->insert('roles', [ @@ -513,7 +513,7 @@ class Migration_Specific_calendar_sync extends EA_Migration 'services' => 0, 'users' => 0, 'system_settings' => 0, - 'user_settings' => 0 + 'user_settings' => 0, ]); $this->db->insert('roles', [ @@ -525,18 +525,18 @@ class Migration_Specific_calendar_sync extends EA_Migration 'services' => 0, 'users' => 0, 'system_settings' => 0, - 'user_settings' => 15 + 'user_settings' => 15, ]); $this->db->insert('settings', [ 'name' => 'company_working_plan', 'value' => - '{"monday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"tuesday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"wednesday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"thursday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"friday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"saturday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"sunday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]}}' + '{"monday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"tuesday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"wednesday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"thursday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"friday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"saturday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"sunday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]}}', ]); $this->db->insert('settings', [ 'name' => 'book_advance_timeout', - 'value' => '30' + 'value' => '30', ]); } @@ -550,70 +550,70 @@ class Migration_Specific_calendar_sync extends EA_Migration $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('appointments') . - '_ibfk_2`' + '_ibfk_2`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('appointments') . - '_ibfk_3`' + '_ibfk_3`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('appointments') . - '_ibfk_4`' + '_ibfk_4`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('secretaries_providers') . '` DROP FOREIGN KEY `fk_' . $this->db->dbprefix('secretaries_providers') . - '_1`' + '_1`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('secretaries_providers') . '` DROP FOREIGN KEY `fk_' . $this->db->dbprefix('secretaries_providers') . - '_2`' + '_2`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('services_providers') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('services_providers') . - '_ibfk_1`' + '_ibfk_1`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('services_providers') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('services_providers') . - '_ibfk_2`' + '_ibfk_2`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('services') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('services') . - '_ibfk_1`' + '_ibfk_1`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('users') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('users') . - '_ibfk_1`' + '_ibfk_1`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('user_settings') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('user_settings') . - '_ibfk_1`' + '_ibfk_1`', ); $this->dbforge->drop_table('appointments'); diff --git a/application/migrations/002_add_google_analytics_setting.php b/application/migrations/002_add_google_analytics_setting.php index fb93bdca..f7e30263 100644 --- a/application/migrations/002_add_google_analytics_setting.php +++ b/application/migrations/002_add_google_analytics_setting.php @@ -23,7 +23,7 @@ class Migration_Add_google_analytics_setting extends EA_Migration if (!$this->db->get_where('settings', ['name' => 'google_analytics_code'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'google_analytics_code', - 'value' => '' + 'value' => '', ]); } } diff --git a/application/migrations/003_add_customer_notifications_setting.php b/application/migrations/003_add_customer_notifications_setting.php index ea86bbdb..149fd99f 100644 --- a/application/migrations/003_add_customer_notifications_setting.php +++ b/application/migrations/003_add_customer_notifications_setting.php @@ -23,7 +23,7 @@ class Migration_Add_customer_notifications_setting extends EA_Migration if (!$this->db->get_where('settings', ['name' => 'customer_notifications'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'customer_notifications', - 'value' => '1' + 'value' => '1', ]); } } diff --git a/application/migrations/004_add_date_format_setting.php b/application/migrations/004_add_date_format_setting.php index b5594678..44a8b17f 100644 --- a/application/migrations/004_add_date_format_setting.php +++ b/application/migrations/004_add_date_format_setting.php @@ -23,7 +23,7 @@ class Migration_Add_date_format_setting extends EA_Migration if (!$this->db->get_where('settings', ['name' => 'date_format'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'date_format', - 'value' => 'DMY' + 'value' => 'DMY', ]); } } diff --git a/application/migrations/005_add_require_captcha_setting.php b/application/migrations/005_add_require_captcha_setting.php index c27ccb1f..a8f4355f 100644 --- a/application/migrations/005_add_require_captcha_setting.php +++ b/application/migrations/005_add_require_captcha_setting.php @@ -23,7 +23,7 @@ class Migration_Add_require_captcha_setting extends EA_Migration if (!$this->db->get_where('settings', ['name' => 'require_captcha'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'require_captcha', - 'value' => '0' + 'value' => '0', ]); } } diff --git a/application/migrations/006_add_calendar_view_setting.php b/application/migrations/006_add_calendar_view_setting.php index 6d87a9e0..848ac74c 100644 --- a/application/migrations/006_add_calendar_view_setting.php +++ b/application/migrations/006_add_calendar_view_setting.php @@ -23,8 +23,8 @@ class Migration_Add_calendar_view_setting extends EA_Migration 'calendar_view' => [ 'type' => 'VARCHAR', 'constraint' => '32', - 'default' => 'default' - ] + 'default' => 'default', + ], ]; $this->dbforge->add_column('user_settings', $fields); diff --git a/application/migrations/007_add_service_availabilities_type.php b/application/migrations/007_add_service_availabilities_type.php index 1399d78d..33e21e8e 100644 --- a/application/migrations/007_add_service_availabilities_type.php +++ b/application/migrations/007_add_service_availabilities_type.php @@ -24,8 +24,8 @@ class Migration_Add_service_availabilities_type extends EA_Migration 'type' => 'VARCHAR', 'constraint' => '32', 'default' => 'flexible', - 'after' => 'description' - ] + 'after' => 'description', + ], ]; $this->dbforge->add_column('services', $fields); diff --git a/application/migrations/008_add_service_attendants_number.php b/application/migrations/008_add_service_attendants_number.php index 6b5d38b4..21aca2c4 100644 --- a/application/migrations/008_add_service_attendants_number.php +++ b/application/migrations/008_add_service_attendants_number.php @@ -24,8 +24,8 @@ class Migration_Add_service_attendants_number extends EA_Migration 'type' => 'INT', 'constraint' => '11', 'default' => '1', - 'after' => 'availabilities_type' - ] + 'after' => 'availabilities_type', + ], ]; $this->dbforge->add_column('services', $fields); diff --git a/application/migrations/009_change_column_types.php b/application/migrations/009_change_column_types.php index 24fc2c50..3c803c12 100644 --- a/application/migrations/009_change_column_types.php +++ b/application/migrations/009_change_column_types.php @@ -24,70 +24,70 @@ class Migration_Change_column_types extends EA_Migration $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('appointments') . - '_ibfk_2`' + '_ibfk_2`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('appointments') . - '_ibfk_3`' + '_ibfk_3`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('appointments') . - '_ibfk_4`' + '_ibfk_4`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('secretaries_providers') . '` DROP FOREIGN KEY `fk_' . $this->db->dbprefix('secretaries_providers') . - '_1`' + '_1`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('secretaries_providers') . '` DROP FOREIGN KEY `fk_' . $this->db->dbprefix('secretaries_providers') . - '_2`' + '_2`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('services_providers') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('services_providers') . - '_ibfk_1`' + '_ibfk_1`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('services_providers') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('services_providers') . - '_ibfk_2`' + '_ibfk_2`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('services') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('services') . - '_ibfk_1`' + '_ibfk_1`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('users') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('users') . - '_ibfk_1`' + '_ibfk_1`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('user_settings') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('user_settings') . - '_ibfk_1`' + '_ibfk_1`', ); // Appointments @@ -96,23 +96,23 @@ class Migration_Change_column_types extends EA_Migration 'name' => 'id', 'type' => 'int', 'constraint' => '11', - 'auto_increment' => true + 'auto_increment' => true, ], 'id_users_provider' => [ 'name' => 'id_users_provider', 'type' => 'int', - 'constraint' => '11' + 'constraint' => '11', ], 'id_users_customer' => [ 'name' => 'id_users_customer', 'type' => 'int', - 'constraint' => '11' + 'constraint' => '11', ], 'id_services' => [ 'name' => 'id_services', 'type' => 'int', - 'constraint' => '11' - ] + 'constraint' => '11', + ], ]; $this->dbforge->modify_column('appointments', $fields); @@ -123,38 +123,38 @@ class Migration_Change_column_types extends EA_Migration 'name' => 'id', 'type' => 'int', 'constraint' => '11', - 'auto_increment' => true + 'auto_increment' => true, ], 'appointments' => [ 'name' => 'appointments', 'type' => 'int', - 'constraint' => '11' + 'constraint' => '11', ], 'customers' => [ 'name' => 'customers', 'type' => 'int', - 'constraint' => '11' + 'constraint' => '11', ], 'services' => [ 'name' => 'services', 'type' => 'int', - 'constraint' => '11' + 'constraint' => '11', ], 'users' => [ 'name' => 'users', 'type' => 'int', - 'constraint' => '11' + 'constraint' => '11', ], 'system_settings' => [ 'name' => 'system_settings', 'type' => 'int', - 'constraint' => '11' + 'constraint' => '11', ], 'user_settings' => [ 'name' => 'user_settings', 'type' => 'int', - 'constraint' => '11' - ] + 'constraint' => '11', + ], ]; $this->dbforge->modify_column('roles', $fields); @@ -164,13 +164,13 @@ class Migration_Change_column_types extends EA_Migration 'id_users_secretary' => [ 'name' => 'id_users_secretary', 'type' => 'int', - 'constraint' => '11' + 'constraint' => '11', ], 'id_users_provider' => [ 'name' => 'id_users_provider', 'type' => 'int', - 'constraint' => '11' - ] + 'constraint' => '11', + ], ]; $this->dbforge->modify_column('secretaries_providers', $fields); @@ -181,13 +181,13 @@ class Migration_Change_column_types extends EA_Migration 'name' => 'id', 'type' => 'int', 'constraint' => '11', - 'auto_increment' => true + 'auto_increment' => true, ], 'id_service_categories' => [ 'name' => 'id_service_categories', 'type' => 'int', - 'constraint' => '11' - ] + 'constraint' => '11', + ], ]; $this->dbforge->modify_column('services', $fields); @@ -197,13 +197,13 @@ class Migration_Change_column_types extends EA_Migration 'id_users' => [ 'name' => 'id_users', 'type' => 'int', - 'constraint' => '11' + 'constraint' => '11', ], 'id_services' => [ 'name' => 'id_services', 'type' => 'int', - 'constraint' => '11' - ] + 'constraint' => '11', + ], ]; $this->dbforge->modify_column('services_providers', $fields); @@ -214,8 +214,8 @@ class Migration_Change_column_types extends EA_Migration 'name' => 'id', 'type' => 'int', 'constraint' => '11', - 'auto_increment' => true - ] + 'auto_increment' => true, + ], ]; $this->dbforge->modify_column('service_categories', $fields); @@ -226,8 +226,8 @@ class Migration_Change_column_types extends EA_Migration 'name' => 'id', 'type' => 'int', 'constraint' => '11', - 'auto_increment' => true - ] + 'auto_increment' => true, + ], ]; $this->dbforge->modify_column('settings', $fields); @@ -238,13 +238,13 @@ class Migration_Change_column_types extends EA_Migration 'name' => 'id', 'type' => 'int', 'constraint' => '11', - 'auto_increment' => true + 'auto_increment' => true, ], 'id_roles' => [ 'name' => 'id_roles', 'type' => 'int', - 'constraint' => '11' - ] + 'constraint' => '11', + ], ]; $this->dbforge->modify_column('users', $fields); @@ -254,8 +254,8 @@ class Migration_Change_column_types extends EA_Migration 'id_users' => [ 'name' => 'id_users', 'type' => 'int', - 'constraint' => '11' - ] + 'constraint' => '11', + ], ]; $this->dbforge->modify_column('user_settings', $fields); @@ -279,7 +279,7 @@ class Migration_Change_column_types extends EA_Migration $this->db->dbprefix('appointments') . '_ibfk_4` FOREIGN KEY (`id_users_provider`) REFERENCES `' . $this->db->dbprefix('users') . - '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE' + '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE', ); $this->db->query( @@ -295,7 +295,7 @@ class Migration_Change_column_types extends EA_Migration $this->db->dbprefix('secretaries_providers') . '_2` FOREIGN KEY (`id_users_provider`) REFERENCES `' . $this->db->dbprefix('users') . - '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE' + '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE', ); $this->db->query( @@ -306,7 +306,7 @@ class Migration_Change_column_types extends EA_Migration $this->db->dbprefix('services') . '_ibfk_1` FOREIGN KEY (`id_service_categories`) REFERENCES `' . $this->db->dbprefix('service_categories') . - '` (`id`) ON DELETE SET NULL ON UPDATE CASCADE' + '` (`id`) ON DELETE SET NULL ON UPDATE CASCADE', ); $this->db->query( @@ -322,7 +322,7 @@ class Migration_Change_column_types extends EA_Migration $this->db->dbprefix('services_providers') . '_ibfk_2` FOREIGN KEY (`id_services`) REFERENCES `' . $this->db->dbprefix('services') . - '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE' + '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE', ); $this->db->query( @@ -333,7 +333,7 @@ class Migration_Change_column_types extends EA_Migration $this->db->dbprefix('users') . '_ibfk_1` FOREIGN KEY (`id_roles`) REFERENCES `' . $this->db->dbprefix('roles') . - '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE' + '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE', ); $this->db->query( @@ -344,12 +344,12 @@ class Migration_Change_column_types extends EA_Migration $this->db->dbprefix('user_settings') . '_ibfk_1` FOREIGN KEY (`id_users`) REFERENCES `' . $this->db->dbprefix('users') . - '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE' + '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE', ); // Change charset of ' . $this->db->dbprefix('secretaries_providers') . ' table for databases created with EA! 1.2.1 version $this->db->query( - 'ALTER TABLE ' . $this->db->dbprefix('secretaries_providers') . ' CONVERT TO CHARACTER SET utf8' + 'ALTER TABLE ' . $this->db->dbprefix('secretaries_providers') . ' CONVERT TO CHARACTER SET utf8', ); } @@ -364,70 +364,70 @@ class Migration_Change_column_types extends EA_Migration $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('appointments') . - '_ibfk_2`' + '_ibfk_2`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('appointments') . - '_ibfk_3`' + '_ibfk_3`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('appointments') . - '_ibfk_4`' + '_ibfk_4`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('secretaries_providers') . '` DROP FOREIGN KEY `fk_' . $this->db->dbprefix('secretaries_providers') . - '_1`' + '_1`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('secretaries_providers') . '` DROP FOREIGN KEY `fk_' . $this->db->dbprefix('secretaries_providers') . - '_2`' + '_2`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('services_providers') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('services_providers') . - '_ibfk_1`' + '_ibfk_1`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('services_providers') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('services_providers') . - '_ibfk_2`' + '_ibfk_2`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('services') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('services') . - '_ibfk_1`' + '_ibfk_1`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('users') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('users') . - '_ibfk_1`' + '_ibfk_1`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('user_settings') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('user_settings') . - '_ibfk_1`' + '_ibfk_1`', ); // Appointments @@ -436,23 +436,23 @@ class Migration_Change_column_types extends EA_Migration 'name' => 'id', 'type' => 'bigint', 'constraint' => '20', - 'auto_increment' => true + 'auto_increment' => true, ], 'id_users_provider' => [ 'name' => 'id_users_provider', 'type' => 'bigint', - 'constraint' => '20' + 'constraint' => '20', ], 'id_users_customer' => [ 'name' => 'id_users_customer', 'type' => 'bigint', - 'constraint' => '20' + 'constraint' => '20', ], 'id_services' => [ 'name' => 'id_services', 'type' => 'bigint', - 'constraint' => '20' - ] + 'constraint' => '20', + ], ]; $this->dbforge->modify_column('appointments', $fields); @@ -463,38 +463,38 @@ class Migration_Change_column_types extends EA_Migration 'name' => 'id', 'type' => 'bigint', 'constraint' => '20', - 'auto_increment' => true + 'auto_increment' => true, ], 'appointments' => [ 'name' => 'appointments', 'type' => 'bigint', - 'constraint' => '20' + 'constraint' => '20', ], 'customers' => [ 'name' => 'customers', 'type' => 'bigint', - 'constraint' => '20' + 'constraint' => '20', ], 'services' => [ 'name' => 'services', 'type' => 'bigint', - 'constraint' => '20' + 'constraint' => '20', ], 'users' => [ 'name' => 'users', 'type' => 'bigint', - 'constraint' => '20' + 'constraint' => '20', ], 'system_settings' => [ 'name' => 'system_settings', 'type' => 'bigint', - 'constraint' => '20' + 'constraint' => '20', ], 'user_settings' => [ 'name' => 'user_settings', 'type' => 'bigint', - 'constraint' => '20' - ] + 'constraint' => '20', + ], ]; $this->dbforge->modify_column('roles', $fields); @@ -504,13 +504,13 @@ class Migration_Change_column_types extends EA_Migration 'id_users_secretary' => [ 'name' => 'id_users_secretary', 'type' => 'bigint', - 'constraint' => '20' + 'constraint' => '20', ], 'id_users_provider' => [ 'name' => 'id_users_provider', 'type' => 'bigint', - 'constraint' => '20' - ] + 'constraint' => '20', + ], ]; $this->dbforge->modify_column('secretaries_providers', $fields); @@ -521,13 +521,13 @@ class Migration_Change_column_types extends EA_Migration 'name' => 'id', 'type' => 'bigint', 'constraint' => '20', - 'auto_increment' => true + 'auto_increment' => true, ], 'id_service_categories' => [ 'name' => 'id_service_categories', 'type' => 'bigint', - 'constraint' => '20' - ] + 'constraint' => '20', + ], ]; $this->dbforge->modify_column('services', $fields); @@ -537,13 +537,13 @@ class Migration_Change_column_types extends EA_Migration 'id_users' => [ 'name' => 'id_users', 'type' => 'bigint', - 'constraint' => '20' + 'constraint' => '20', ], 'id_services' => [ 'name' => 'id_services', 'type' => 'bigint', - 'constraint' => '20' - ] + 'constraint' => '20', + ], ]; $this->dbforge->modify_column('services_providers', $fields); @@ -554,8 +554,8 @@ class Migration_Change_column_types extends EA_Migration 'name' => 'id', 'type' => 'bigint', 'constraint' => '20', - 'auto_increment' => true - ] + 'auto_increment' => true, + ], ]; $this->dbforge->modify_column('service_categories', $fields); @@ -566,8 +566,8 @@ class Migration_Change_column_types extends EA_Migration 'name' => 'id', 'type' => 'bigint', 'constraint' => '20', - 'auto_increment' => true - ] + 'auto_increment' => true, + ], ]; $this->dbforge->modify_column('settings', $fields); @@ -578,13 +578,13 @@ class Migration_Change_column_types extends EA_Migration 'name' => 'id', 'type' => 'bigint', 'constraint' => '20', - 'auto_increment' => true + 'auto_increment' => true, ], 'id_roles' => [ 'name' => 'id_roles', 'type' => 'bigint', - 'constraint' => '20' - ] + 'constraint' => '20', + ], ]; $this->dbforge->modify_column('users', $fields); @@ -594,8 +594,8 @@ class Migration_Change_column_types extends EA_Migration 'id_users' => [ 'name' => 'id_users', 'type' => 'bigint', - 'constraint' => '20' - ] + 'constraint' => '20', + ], ]; $this->dbforge->modify_column('user_settings', $fields); @@ -619,7 +619,7 @@ class Migration_Change_column_types extends EA_Migration $this->db->dbprefix('appointments') . '_ibfk_4` FOREIGN KEY (`id_users_provider`) REFERENCES `' . $this->db->dbprefix('users') . - '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE' + '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE', ); $this->db->query( @@ -635,7 +635,7 @@ class Migration_Change_column_types extends EA_Migration $this->db->dbprefix('secretaries_providers') . '_2` FOREIGN KEY (`id_users_provider`) REFERENCES `' . $this->db->dbprefix('users') . - '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE' + '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE', ); $this->db->query( @@ -646,7 +646,7 @@ class Migration_Change_column_types extends EA_Migration $this->db->dbprefix('services') . '_ibfk_1` FOREIGN KEY (`id_service_categories`) REFERENCES `' . $this->db->dbprefix('service_categories') . - '` (`id`) ON DELETE SET NULL ON UPDATE CASCADE' + '` (`id`) ON DELETE SET NULL ON UPDATE CASCADE', ); $this->db->query( @@ -662,7 +662,7 @@ class Migration_Change_column_types extends EA_Migration $this->db->dbprefix('services_providers') . '_ibfk_2` FOREIGN KEY (`id_services`) REFERENCES `' . $this->db->dbprefix('services') . - '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE' + '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE', ); $this->db->query( @@ -673,7 +673,7 @@ class Migration_Change_column_types extends EA_Migration $this->db->dbprefix('users') . '_ibfk_1` FOREIGN KEY (`id_roles`) REFERENCES `' . $this->db->dbprefix('roles') . - '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE' + '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE', ); $this->db->query( @@ -684,7 +684,7 @@ class Migration_Change_column_types extends EA_Migration $this->db->dbprefix('user_settings') . '_ibfk_1` FOREIGN KEY (`id_users`) REFERENCES `' . $this->db->dbprefix('users') . - '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE' + '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE', ); } } diff --git a/application/migrations/010_add_time_format_setting.php b/application/migrations/010_add_time_format_setting.php index 595ba67f..59413ed1 100644 --- a/application/migrations/010_add_time_format_setting.php +++ b/application/migrations/010_add_time_format_setting.php @@ -21,7 +21,7 @@ class Migration_Add_time_format_setting extends EA_Migration if (!$this->db->get_where('settings', ['name' => 'time_format'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'time_format', - 'value' => 'regular' + 'value' => 'regular', ]); } } diff --git a/application/migrations/011_remove_prefix_from_fkey_constraints.php b/application/migrations/011_remove_prefix_from_fkey_constraints.php index 5f9257a5..4c8d3a36 100644 --- a/application/migrations/011_remove_prefix_from_fkey_constraints.php +++ b/application/migrations/011_remove_prefix_from_fkey_constraints.php @@ -24,70 +24,70 @@ class Migration_Remove_prefix_from_fkey_constraints extends EA_Migration $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('appointments') . - '_ibfk_2`' + '_ibfk_2`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('appointments') . - '_ibfk_3`' + '_ibfk_3`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('appointments') . - '_ibfk_4`' + '_ibfk_4`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('secretaries_providers') . '` DROP FOREIGN KEY `fk_' . $this->db->dbprefix('secretaries_providers') . - '_1`' + '_1`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('secretaries_providers') . '` DROP FOREIGN KEY `fk_' . $this->db->dbprefix('secretaries_providers') . - '_2`' + '_2`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('services_providers') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('services_providers') . - '_ibfk_1`' + '_ibfk_1`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('services_providers') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('services_providers') . - '_ibfk_2`' + '_ibfk_2`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('services') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('services') . - '_ibfk_1`' + '_ibfk_1`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('users') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('users') . - '_ibfk_1`' + '_ibfk_1`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('user_settings') . '` DROP FOREIGN KEY `' . $this->db->dbprefix('user_settings') . - '_ibfk_1`' + '_ibfk_1`', ); // Add table constraints again without the "ea" prefix. @@ -109,7 +109,7 @@ class Migration_Remove_prefix_from_fkey_constraints extends EA_Migration $this->db->dbprefix('users') . '` (`id`) ON DELETE CASCADE - ON UPDATE CASCADE' + ON UPDATE CASCADE', ); $this->db->query( @@ -125,7 +125,7 @@ class Migration_Remove_prefix_from_fkey_constraints extends EA_Migration $this->db->dbprefix('users') . '` (`id`) ON DELETE CASCADE - ON UPDATE CASCADE' + ON UPDATE CASCADE', ); $this->db->query( @@ -136,7 +136,7 @@ class Migration_Remove_prefix_from_fkey_constraints extends EA_Migration $this->db->dbprefix('service_categories') . '` (`id`) ON DELETE SET NULL - ON UPDATE CASCADE' + ON UPDATE CASCADE', ); $this->db->query( @@ -152,7 +152,7 @@ class Migration_Remove_prefix_from_fkey_constraints extends EA_Migration $this->db->dbprefix('services') . '` (`id`) ON DELETE CASCADE - ON UPDATE CASCADE' + ON UPDATE CASCADE', ); $this->db->query( @@ -163,7 +163,7 @@ class Migration_Remove_prefix_from_fkey_constraints extends EA_Migration $this->db->dbprefix('roles') . '` (`id`) ON DELETE CASCADE - ON UPDATE CASCADE' + ON UPDATE CASCADE', ); $this->db->query( @@ -174,7 +174,7 @@ class Migration_Remove_prefix_from_fkey_constraints extends EA_Migration $this->db->dbprefix('users') . '` (`id`) ON DELETE CASCADE - ON UPDATE CASCADE' + ON UPDATE CASCADE', ); } @@ -185,40 +185,40 @@ class Migration_Remove_prefix_from_fkey_constraints extends EA_Migration { // Drop table constraints. $this->db->query( - 'ALTER TABLE `' . $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `appointments_services`' + 'ALTER TABLE `' . $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `appointments_services`', ); $this->db->query( - 'ALTER TABLE `' . $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `appointments_users_customer`' + 'ALTER TABLE `' . $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `appointments_users_customer`', ); $this->db->query( - 'ALTER TABLE `' . $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `appointments_users_provider`' + 'ALTER TABLE `' . $this->db->dbprefix('appointments') . '` DROP FOREIGN KEY `appointments_users_provider`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('secretaries_providers') . - '` DROP FOREIGN KEY `secretaries_users_secretary`' + '` DROP FOREIGN KEY `secretaries_users_secretary`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('secretaries_providers') . - '` DROP FOREIGN KEY `secretaries_users_provider`' + '` DROP FOREIGN KEY `secretaries_users_provider`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('services_providers') . - '` DROP FOREIGN KEY `services_providers_users_provider`' + '` DROP FOREIGN KEY `services_providers_users_provider`', ); $this->db->query( 'ALTER TABLE `' . $this->db->dbprefix('services_providers') . - '` DROP FOREIGN KEY `services_providers_services`' + '` DROP FOREIGN KEY `services_providers_services`', ); $this->db->query( - 'ALTER TABLE `' . $this->db->dbprefix('services') . '` DROP FOREIGN KEY `services_service_categories`' + 'ALTER TABLE `' . $this->db->dbprefix('services') . '` DROP FOREIGN KEY `services_service_categories`', ); $this->db->query('ALTER TABLE `' . $this->db->dbprefix('users') . '` DROP FOREIGN KEY `users_roles`'); $this->db->query( - 'ALTER TABLE `' . $this->db->dbprefix('user_settings') . '` DROP FOREIGN KEY `user_settings_users`' + 'ALTER TABLE `' . $this->db->dbprefix('user_settings') . '` DROP FOREIGN KEY `user_settings_users`', ); // Add table constraints again. @@ -240,7 +240,7 @@ class Migration_Remove_prefix_from_fkey_constraints extends EA_Migration $this->db->dbprefix('appointments') . '_ibfk_4` FOREIGN KEY (`id_users_provider`) REFERENCES `' . $this->db->dbprefix('users') . - '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE' + '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE', ); $this->db->query( @@ -256,7 +256,7 @@ class Migration_Remove_prefix_from_fkey_constraints extends EA_Migration $this->db->dbprefix('secretaries_providers') . '_2` FOREIGN KEY (`id_users_provider`) REFERENCES `' . $this->db->dbprefix('users') . - '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE' + '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE', ); $this->db->query( @@ -267,7 +267,7 @@ class Migration_Remove_prefix_from_fkey_constraints extends EA_Migration $this->db->dbprefix('services') . '_ibfk_1` FOREIGN KEY (`id_service_categories`) REFERENCES `' . $this->db->dbprefix('service_categories') . - '` (`id`) ON DELETE SET NULL ON UPDATE CASCADE' + '` (`id`) ON DELETE SET NULL ON UPDATE CASCADE', ); $this->db->query( @@ -283,7 +283,7 @@ class Migration_Remove_prefix_from_fkey_constraints extends EA_Migration $this->db->dbprefix('services_providers') . '_ibfk_2` FOREIGN KEY (`id_services`) REFERENCES `' . $this->db->dbprefix('services') . - '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE' + '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE', ); $this->db->query( @@ -294,7 +294,7 @@ class Migration_Remove_prefix_from_fkey_constraints extends EA_Migration $this->db->dbprefix('users') . '_ibfk_1` FOREIGN KEY (`id_roles`) REFERENCES `' . $this->db->dbprefix('roles') . - '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE' + '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE', ); $this->db->query( @@ -305,7 +305,7 @@ class Migration_Remove_prefix_from_fkey_constraints extends EA_Migration $this->db->dbprefix('user_settings') . '_ibfk_1` FOREIGN KEY (`id_users`) REFERENCES `' . $this->db->dbprefix('users') . - '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE' + '` (`id`) ON DELETE CASCADE ON UPDATE CASCADE', ); } } diff --git a/application/migrations/012_legal_contents.php b/application/migrations/012_legal_contents.php index 9dbdd579..7f8da9cf 100644 --- a/application/migrations/012_legal_contents.php +++ b/application/migrations/012_legal_contents.php @@ -21,42 +21,42 @@ class Migration_Legal_contents extends EA_Migration if (!$this->db->get_where('settings', ['name' => 'display_cookie_notice'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'display_cookie_notice', - 'value' => '0' + 'value' => '0', ]); } if (!$this->db->get_where('settings', ['name' => 'cookie_notice_content'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'cookie_notice_content', - 'value' => 'Cookie notice content.' + 'value' => 'Cookie notice content.', ]); } if (!$this->db->get_where('settings', ['name' => 'display_terms_and_conditions'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'display_terms_and_conditions', - 'value' => '0' + 'value' => '0', ]); } if (!$this->db->get_where('settings', ['name' => 'terms_and_conditions_content'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'terms_and_conditions_content', - 'value' => 'Terms and conditions content.' + 'value' => 'Terms and conditions content.', ]); } if (!$this->db->get_where('settings', ['name' => 'display_privacy_policy'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'display_privacy_policy', - 'value' => '0' + 'value' => '0', ]); } if (!$this->db->get_where('settings', ['name' => 'privacy_policy_content'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'privacy_policy_content', - 'value' => 'Privacy policy content.' + 'value' => 'Privacy policy content.', ]); } @@ -65,41 +65,41 @@ class Migration_Legal_contents extends EA_Migration 'id' => [ 'type' => 'INT', 'constraint' => 11, - 'auto_increment' => true + 'auto_increment' => true, ], 'created' => [ 'type' => 'TIMESTAMP', - 'null' => true + 'null' => true, ], 'modified' => [ 'type' => 'TIMESTAMP', - 'null' => true + 'null' => true, ], 'first_name' => [ 'type' => 'VARCHAR', 'constraint' => '256', - 'null' => true + 'null' => true, ], 'last_name' => [ 'type' => 'VARCHAR', 'constraint' => '256', - 'null' => true + 'null' => true, ], 'email' => [ 'type' => 'VARCHAR', 'constraint' => '512', - 'null' => true + 'null' => true, ], 'ip' => [ 'type' => 'VARCHAR', 'constraint' => '256', - 'null' => true + 'null' => true, ], 'type' => [ 'type' => 'VARCHAR', 'constraint' => '256', - 'null' => true - ] + 'null' => true, + ], ]); $this->dbforge->add_key('id', true); @@ -115,37 +115,37 @@ class Migration_Legal_contents extends EA_Migration { if ($this->db->get_where('settings', ['name' => 'display_cookie_notice'])->num_rows()) { $this->db->delete('settings', [ - 'name' => 'display_cookie_notice' + 'name' => 'display_cookie_notice', ]); } if ($this->db->get_where('settings', ['name' => 'cookie_notice_content'])->num_rows()) { $this->db->delete('settings', [ - 'name' => 'cookie_notice_content' + 'name' => 'cookie_notice_content', ]); } if ($this->db->get_where('settings', ['name' => 'display_terms_and_conditions'])->num_rows()) { $this->db->delete('settings', [ - 'name' => 'display_terms_and_conditions' + 'name' => 'display_terms_and_conditions', ]); } if ($this->db->get_where('settings', ['name' => 'terms_and_conditions_content'])->num_rows()) { $this->db->delete('settings', [ - 'name' => 'terms_and_conditions_content' + 'name' => 'terms_and_conditions_content', ]); } if ($this->db->get_where('settings', ['name' => 'display_privacy_policy'])->num_rows()) { $this->db->delete('settings', [ - 'name' => 'display_privacy_policy' + 'name' => 'display_privacy_policy', ]); } if ($this->db->get_where('settings', ['name' => 'privacy_policy_content'])->num_rows()) { $this->db->delete('settings', [ - 'name' => 'privacy_policy_content' + 'name' => 'privacy_policy_content', ]); } diff --git a/application/migrations/013_add_weekday_start_setting.php b/application/migrations/013_add_weekday_start_setting.php index 0ac8d06b..1f6f083f 100644 --- a/application/migrations/013_add_weekday_start_setting.php +++ b/application/migrations/013_add_weekday_start_setting.php @@ -21,7 +21,7 @@ class Migration_Add_weekday_start_setting extends EA_Migration if (!$this->db->get_where('settings', ['name' => 'first_weekday'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'first_weekday', - 'value' => 'sunday' + 'value' => 'sunday', ]); } } diff --git a/application/migrations/014_create_appointment_location_column.php b/application/migrations/014_create_appointment_location_column.php index 6c2fd6ee..4ac6a485 100644 --- a/application/migrations/014_create_appointment_location_column.php +++ b/application/migrations/014_create_appointment_location_column.php @@ -23,8 +23,8 @@ class Migration_Create_appointment_location_column extends EA_Migration 'location' => [ 'type' => 'TEXT', 'null' => true, - 'after' => 'end_datetime' - ] + 'after' => 'end_datetime', + ], ]; $this->dbforge->add_column('appointments', $fields); @@ -35,8 +35,8 @@ class Migration_Create_appointment_location_column extends EA_Migration 'location' => [ 'type' => 'TEXT', 'null' => true, - 'after' => 'description' - ] + 'after' => 'description', + ], ]; $this->dbforge->add_column('services', $fields); diff --git a/application/migrations/015_add_working_plan_exceptions_to_user_settings.php b/application/migrations/015_add_working_plan_exceptions_to_user_settings.php index 62c43c56..d98abee7 100644 --- a/application/migrations/015_add_working_plan_exceptions_to_user_settings.php +++ b/application/migrations/015_add_working_plan_exceptions_to_user_settings.php @@ -23,8 +23,8 @@ class Migration_Add_working_plan_exceptions_to_user_settings extends EA_Migratio 'working_plan_exceptions' => [ 'type' => 'TEXT', 'null' => true, - 'after' => 'working_plan' - ] + 'after' => 'working_plan', + ], ]; $this->dbforge->add_column('user_settings', $fields); diff --git a/application/migrations/016_add_require_phone_number_setting.php b/application/migrations/016_add_require_phone_number_setting.php index d5abe6bf..e65c2058 100644 --- a/application/migrations/016_add_require_phone_number_setting.php +++ b/application/migrations/016_add_require_phone_number_setting.php @@ -21,7 +21,7 @@ class Migration_Add_require_phone_number_setting extends EA_Migration if (!$this->db->get_where('settings', ['name' => 'require_phone_number'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'require_phone_number', - 'value' => '1' + 'value' => '1', ]); } } diff --git a/application/migrations/017_add_api_token_setting.php b/application/migrations/017_add_api_token_setting.php index 34428ff6..5127b857 100644 --- a/application/migrations/017_add_api_token_setting.php +++ b/application/migrations/017_add_api_token_setting.php @@ -23,7 +23,7 @@ class Migration_Add_api_token_setting extends EA_Migration if (!$this->db->get_where('settings', ['name' => 'api_token'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'api_token', - 'value' => '' + 'value' => '', ]); } } diff --git a/application/migrations/018_add_timezone_to_users.php b/application/migrations/018_add_timezone_to_users.php index 66cb11e5..ba978370 100644 --- a/application/migrations/018_add_timezone_to_users.php +++ b/application/migrations/018_add_timezone_to_users.php @@ -24,8 +24,8 @@ class Migration_Add_timezone_to_users extends EA_Migration 'type' => 'VARCHAR', 'constraint' => '256', 'default' => 'UTC', - 'after' => 'notes' - ] + 'after' => 'notes', + ], ]; $this->dbforge->add_column('users', $fields); diff --git a/application/migrations/019_add_display_any_provider_setting.php b/application/migrations/019_add_display_any_provider_setting.php index 651c57e1..a9622343 100644 --- a/application/migrations/019_add_display_any_provider_setting.php +++ b/application/migrations/019_add_display_any_provider_setting.php @@ -21,7 +21,7 @@ class Migration_Add_display_any_provider_setting extends EA_Migration if (!$this->db->get_where('settings', ['name' => 'display_any_provider'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'display_any_provider', - 'value' => '1' + 'value' => '1', ]); } } diff --git a/application/migrations/020_add_language_to_users.php b/application/migrations/020_add_language_to_users.php index f6a326ab..6a961dad 100644 --- a/application/migrations/020_add_language_to_users.php +++ b/application/migrations/020_add_language_to_users.php @@ -24,8 +24,8 @@ class Migration_Add_language_to_users extends EA_Migration 'type' => 'VARCHAR', 'constraint' => '256', 'default' => 'english', - 'after' => 'timezone' - ] + 'after' => 'timezone', + ], ]; $this->dbforge->add_column('users', $fields); diff --git a/application/migrations/021_modify_sync_period_columns.php b/application/migrations/021_modify_sync_period_columns.php index eef5a670..a4c608bf 100644 --- a/application/migrations/021_modify_sync_period_columns.php +++ b/application/migrations/021_modify_sync_period_columns.php @@ -23,14 +23,14 @@ class Migration_Modify_sync_period_columns extends EA_Migration 'type' => 'INT', 'constraint' => '11', 'null' => true, - 'default' => '30' + 'default' => '30', ], 'sync_future_days' => [ 'type' => 'INT', 'constraint' => '11', 'null' => true, - 'default' => '90' - ] + 'default' => '90', + ], ]; $this->dbforge->modify_column('user_settings', $fields); @@ -38,21 +38,21 @@ class Migration_Modify_sync_period_columns extends EA_Migration $this->db->update( 'user_settings', [ - 'sync_past_days' => '30' + 'sync_past_days' => '30', ], [ - 'sync_past_days' => '5' - ] + 'sync_past_days' => '5', + ], ); $this->db->update( 'user_settings', [ - 'sync_future_days' => '90' + 'sync_future_days' => '90', ], [ - 'sync_future_days' => '5' - ] + 'sync_future_days' => '5', + ], ); } @@ -66,14 +66,14 @@ class Migration_Modify_sync_period_columns extends EA_Migration 'type' => 'INT', 'constraint' => '11', 'null' => true, - 'default' => '5' + 'default' => '5', ], 'sync_future_days' => [ 'type' => 'INT', 'constraint' => '11', 'null' => true, - 'default' => '5' - ] + 'default' => '5', + ], ]; $this->dbforge->modify_column('user_settings', $fields); @@ -81,21 +81,21 @@ class Migration_Modify_sync_period_columns extends EA_Migration $this->db->update( 'user_settings', [ - 'sync_past_days' => '5' + 'sync_past_days' => '5', ], [ - 'sync_past_days' => '30' - ] + 'sync_past_days' => '30', + ], ); $this->db->update( 'user_settings', [ - 'sync_future_days' => '5' + 'sync_future_days' => '5', ], [ - 'sync_future_days' => '90' - ] + 'sync_future_days' => '90', + ], ); } } diff --git a/application/migrations/022_add_booking_field_settings.php b/application/migrations/022_add_booking_field_settings.php index 29579d9e..68b4f854 100644 --- a/application/migrations/022_add_booking_field_settings.php +++ b/application/migrations/022_add_booking_field_settings.php @@ -19,36 +19,36 @@ class Migration_Add_booking_field_settings extends EA_Migration private $fields = [ 'first_name' => [ 'display' => '1', - 'require' => '1' + 'require' => '1', ], 'last_name' => [ 'display' => '1', - 'require' => '1' + 'require' => '1', ], 'email' => [ 'display' => '1', - 'require' => '1' + 'require' => '1', ], 'phone_number' => [ 'display' => '1', - 'require' => '1' + 'require' => '1', ], 'address' => [ 'display' => '1', - 'require' => '0' + 'require' => '0', ], 'city' => [ 'display' => '1', - 'require' => '0' + 'require' => '0', ], 'zip_code' => [ 'display' => '1', - 'require' => '0' + 'require' => '0', ], 'notes' => [ 'display' => '1', - 'require' => '0' - ] + 'require' => '0', + ], ]; /** @@ -71,7 +71,7 @@ class Migration_Add_booking_field_settings extends EA_Migration if (!$this->db->get_where('settings', ['name' => $setting_name])->num_rows()) { $this->db->insert('settings', [ 'name' => $setting_name, - 'value' => $value + 'value' => $value, ]); } } diff --git a/application/migrations/024_rename_id_service_categories_column_of_services_table.php b/application/migrations/024_rename_id_service_categories_column_of_services_table.php index 431b69ea..b101fad6 100644 --- a/application/migrations/024_rename_id_service_categories_column_of_services_table.php +++ b/application/migrations/024_rename_id_service_categories_column_of_services_table.php @@ -20,15 +20,15 @@ class Migration_Rename_id_service_categories_column_of_services_table extends EA { if ($this->db->field_exists('id_service_categories', 'services')) { $this->db->query( - 'ALTER TABLE `' . $this->db->dbprefix('services') . '` DROP FOREIGN KEY `services_service_categories`' + 'ALTER TABLE `' . $this->db->dbprefix('services') . '` DROP FOREIGN KEY `services_service_categories`', ); $fields = [ 'id_service_categories' => [ 'name' => 'id_categories', 'type' => 'INT', - 'constraint' => '11' - ] + 'constraint' => '11', + ], ]; $this->dbforge->modify_column('services', $fields); @@ -43,7 +43,7 @@ class Migration_Rename_id_service_categories_column_of_services_table extends EA '` (`id`) ON DELETE SET NULL ON UPDATE CASCADE - ' + ', ); } } @@ -55,15 +55,15 @@ class Migration_Rename_id_service_categories_column_of_services_table extends EA { if ($this->db->field_exists('id_categories', 'services')) { $this->db->query( - 'ALTER TABLE `' . $this->db->dbprefix('services') . '` DROP FOREIGN KEY `services_categories`' + 'ALTER TABLE `' . $this->db->dbprefix('services') . '` DROP FOREIGN KEY `services_categories`', ); $fields = [ 'id_categories' => [ 'name' => 'id_service_categories', 'type' => 'INT', - 'constraint' => '11' - ] + 'constraint' => '11', + ], ]; $this->dbforge->modify_column('services', $fields); @@ -78,7 +78,7 @@ class Migration_Rename_id_service_categories_column_of_services_table extends EA '` (`id`) ON DELETE SET NULL ON UPDATE CASCADE - ' + ', ); } } diff --git a/application/migrations/025_rename_is_unavailable_column_of_appointments_table.php b/application/migrations/025_rename_is_unavailable_column_of_appointments_table.php index dd4b9f80..959df197 100644 --- a/application/migrations/025_rename_is_unavailable_column_of_appointments_table.php +++ b/application/migrations/025_rename_is_unavailable_column_of_appointments_table.php @@ -24,8 +24,8 @@ class Migration_Rename_is_unavailable_column_of_appointments_table extends EA_Mi 'name' => 'is_unavailability', 'type' => 'TINYINT', 'constraint' => '4', - 'default' => '0' - ] + 'default' => '0', + ], ]; $this->dbforge->modify_column('appointments', $fields); @@ -43,8 +43,8 @@ class Migration_Rename_is_unavailable_column_of_appointments_table extends EA_Mi 'name' => 'is_unavailable', 'type' => 'TINYINT', 'constraint' => '4', - 'default' => '0' - ] + 'default' => '0', + ], ]; $this->dbforge->modify_column('appointments', $fields); diff --git a/application/migrations/026_add_color_column_to_services_table.php b/application/migrations/026_add_color_column_to_services_table.php index 1c15b326..4f9f3271 100644 --- a/application/migrations/026_add_color_column_to_services_table.php +++ b/application/migrations/026_add_color_column_to_services_table.php @@ -24,8 +24,8 @@ class Migration_Add_color_column_to_services_table extends EA_Migration 'type' => 'VARCHAR', 'constraint' => '256', 'default' => '#7cbae8', - 'after' => 'description' - ] + 'after' => 'description', + ], ]; $this->dbforge->add_column('services', $fields); diff --git a/application/migrations/027_add_color_column_to_appointments_table.php b/application/migrations/027_add_color_column_to_appointments_table.php index e7e632d7..b0ca7be6 100644 --- a/application/migrations/027_add_color_column_to_appointments_table.php +++ b/application/migrations/027_add_color_column_to_appointments_table.php @@ -24,8 +24,8 @@ class Migration_Add_color_column_to_appointments_table extends EA_Migration 'type' => 'VARCHAR', 'constraint' => '256', 'default' => '#7cbae8', - 'after' => 'hash' - ] + 'after' => 'hash', + ], ]; $this->dbforge->add_column('appointments', $fields); diff --git a/application/migrations/028_add_matomo_analytics_url_setting.php b/application/migrations/028_add_matomo_analytics_url_setting.php index a590142f..0d9aac2b 100644 --- a/application/migrations/028_add_matomo_analytics_url_setting.php +++ b/application/migrations/028_add_matomo_analytics_url_setting.php @@ -21,7 +21,7 @@ class Migration_Add_matomo_analytics_url_setting extends EA_Migration if (!$this->db->get_where('settings', ['name' => 'matomo_analytics_url'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'matomo_analytics_url', - 'value' => '' + 'value' => '', ]); } } diff --git a/application/migrations/029_add_display_delete_personal_information_setting.php b/application/migrations/029_add_display_delete_personal_information_setting.php index 44d673a3..65804d93 100644 --- a/application/migrations/029_add_display_delete_personal_information_setting.php +++ b/application/migrations/029_add_display_delete_personal_information_setting.php @@ -21,7 +21,7 @@ class Migration_Add_display_delete_personal_information_setting extends EA_Migra if (!$this->db->get_where('settings', ['name' => 'display_delete_personal_information'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'display_delete_personal_information', - 'value' => '0' + 'value' => '0', ]); } } diff --git a/application/migrations/030_add_disable_booking_setting.php b/application/migrations/030_add_disable_booking_setting.php index a6fee6f0..86d65ee5 100644 --- a/application/migrations/030_add_disable_booking_setting.php +++ b/application/migrations/030_add_disable_booking_setting.php @@ -21,7 +21,7 @@ class Migration_Add_disable_booking_setting extends EA_Migration if (!$this->db->get_where('settings', ['name' => 'disable_booking'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'disable_booking', - 'value' => '0' + 'value' => '0', ]); } } diff --git a/application/migrations/031_add_disable_booking_message_setting.php b/application/migrations/031_add_disable_booking_message_setting.php index b6e83fdd..b530b11c 100644 --- a/application/migrations/031_add_disable_booking_message_setting.php +++ b/application/migrations/031_add_disable_booking_message_setting.php @@ -22,7 +22,7 @@ class Migration_Add_disable_booking_message_setting extends EA_Migration $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.

' + '

Thanks for stopping by!

We are not accepting new appointments at the moment, please check back again later.

', ]); } } diff --git a/application/migrations/032_add_company_logo_setting.php b/application/migrations/032_add_company_logo_setting.php index fca7d8e3..c09dc9a7 100644 --- a/application/migrations/032_add_company_logo_setting.php +++ b/application/migrations/032_add_company_logo_setting.php @@ -21,7 +21,7 @@ class Migration_Add_company_logo_setting extends EA_Migration if (!$this->db->get_where('settings', ['name' => 'company_logo'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'company_logo', - 'value' => '' + 'value' => '', ]); } } diff --git a/application/migrations/033_add_company_color_setting.php b/application/migrations/033_add_company_color_setting.php index dadb6b11..21be5fe2 100644 --- a/application/migrations/033_add_company_color_setting.php +++ b/application/migrations/033_add_company_color_setting.php @@ -21,7 +21,7 @@ class Migration_Add_company_color_setting extends EA_Migration if (!$this->db->get_where('settings', ['name' => 'company_color'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'company_color', - 'value' => '#ffffff' + 'value' => '#ffffff', ]); } } diff --git a/application/migrations/034_add_display_login_button_setting.php b/application/migrations/034_add_display_login_button_setting.php index 5a4cdc86..b1df340e 100644 --- a/application/migrations/034_add_display_login_button_setting.php +++ b/application/migrations/034_add_display_login_button_setting.php @@ -21,7 +21,7 @@ class Migration_Add_display_login_button_setting extends EA_Migration if (!$this->db->get_where('settings', ['name' => 'display_login_button'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'display_login_button', - 'value' => '1' + 'value' => '1', ]); } } diff --git a/application/migrations/035_add_is_private_column_to_services_table.php b/application/migrations/035_add_is_private_column_to_services_table.php index 52230a1f..b5d35f47 100644 --- a/application/migrations/035_add_is_private_column_to_services_table.php +++ b/application/migrations/035_add_is_private_column_to_services_table.php @@ -24,8 +24,8 @@ class Migration_Add_is_private_column_to_services_table extends EA_Migration 'type' => 'TINYINT', 'constraint' => '4', 'default' => '0', - 'after' => 'attendants_number' - ] + 'after' => 'attendants_number', + ], ]; $this->dbforge->add_column('services', $fields); diff --git a/application/migrations/036_add_is_private_column_to_users_table.php b/application/migrations/036_add_is_private_column_to_users_table.php index 7bfae212..cbf7e315 100644 --- a/application/migrations/036_add_is_private_column_to_users_table.php +++ b/application/migrations/036_add_is_private_column_to_users_table.php @@ -24,8 +24,8 @@ class Migration_Add_is_private_column_to_users_table extends EA_Migration 'type' => 'TINYINT', 'constraint' => '4', 'default' => '0', - 'after' => 'language' - ] + 'after' => 'language', + ], ]; $this->dbforge->add_column('users', $fields); diff --git a/application/migrations/037_add_timestamp_columns.php b/application/migrations/037_add_timestamp_columns.php index 01c91ad3..d15f040b 100644 --- a/application/migrations/037_add_timestamp_columns.php +++ b/application/migrations/037_add_timestamp_columns.php @@ -35,8 +35,8 @@ class Migration_Add_timestamp_columns extends EA_Migration $column => [ 'type' => 'DATETIME', 'null' => true, - 'after' => 'id' - ] + 'after' => 'id', + ], ]; $this->dbforge->add_column($table, $fields); diff --git a/application/migrations/038_add_theme_setting.php b/application/migrations/038_add_theme_setting.php index 3280c985..a0470bb7 100644 --- a/application/migrations/038_add_theme_setting.php +++ b/application/migrations/038_add_theme_setting.php @@ -21,7 +21,7 @@ class Migration_Add_theme_setting extends EA_Migration if (!$this->db->get_where('settings', ['name' => 'theme'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'theme', - 'value' => 'default' + 'value' => 'default', ]); } } diff --git a/application/migrations/039_add_limit_customer_access_setting.php b/application/migrations/039_add_limit_customer_access_setting.php index 97bfd496..3272a789 100644 --- a/application/migrations/039_add_limit_customer_access_setting.php +++ b/application/migrations/039_add_limit_customer_access_setting.php @@ -23,7 +23,7 @@ class Migration_Add_limit_customer_access_setting extends EA_Migration 'create_datetime' => date('Y-m-d H:i:s'), 'update_datetime' => date('Y-m-d H:i:s'), 'name' => 'limit_customer_access', - 'value' => '0' + 'value' => '0', ]); } } diff --git a/application/migrations/040_create_webhooks_table.php b/application/migrations/040_create_webhooks_table.php index 8a55e060..22364203 100644 --- a/application/migrations/040_create_webhooks_table.php +++ b/application/migrations/040_create_webhooks_table.php @@ -23,47 +23,47 @@ class Migration_Create_webhooks_table extends EA_Migration 'id' => [ 'type' => 'INT', 'constraint' => 11, - 'auto_increment' => true + 'auto_increment' => true, ], 'create_datetime' => [ 'type' => 'DATETIME', - 'null' => true + 'null' => true, ], 'update_datetime' => [ 'type' => 'DATETIME', - 'null' => true + 'null' => true, ], 'delete_datetime' => [ 'type' => 'DATETIME', - 'null' => true + 'null' => true, ], 'name' => [ 'type' => 'VARCHAR', 'constraint' => '256', - 'null' => true + 'null' => true, ], 'url' => [ 'type' => 'TEXT', - 'null' => true + 'null' => true, ], 'actions' => [ 'type' => 'TEXT', - 'null' => true + 'null' => true, ], 'secret_token' => [ 'type' => 'VARCHAR', 'constraint' => '512', - 'null' => true + 'null' => true, ], 'is_ssl_verified' => [ 'type' => 'TINYINT', 'constraint' => '4', - 'default' => true + 'default' => true, ], 'notes' => [ 'type' => 'TEXT', - 'null' => true - ] + 'null' => true, + ], ]); $this->dbforge->add_key('id', true); diff --git a/application/migrations/041_add_webhooks_column_to_roles_table.php b/application/migrations/041_add_webhooks_column_to_roles_table.php index 70c866b4..a9e8bd12 100644 --- a/application/migrations/041_add_webhooks_column_to_roles_table.php +++ b/application/migrations/041_add_webhooks_column_to_roles_table.php @@ -23,8 +23,8 @@ class Migration_Add_webhooks_column_to_roles_table extends EA_Migration 'webhooks' => [ 'type' => 'INT', 'constraint' => '11', - 'null' => true - ] + 'null' => true, + ], ]; $this->dbforge->add_column('roles', $fields); diff --git a/application/migrations/042_add_future_booking_limit_setting.php b/application/migrations/042_add_future_booking_limit_setting.php index 5fe81374..3f3f679d 100644 --- a/application/migrations/042_add_future_booking_limit_setting.php +++ b/application/migrations/042_add_future_booking_limit_setting.php @@ -27,7 +27,7 @@ class Migration_Add_future_booking_limit_setting extends CI_Migration if (!$this->db->get_where('settings', ['name' => 'future_booking_limit'])->num_rows()) { $this->db->insert('settings', [ 'name' => 'future_booking_limit', - 'value' => '90' // days + 'value' => '90', // days ]); } } diff --git a/application/migrations/043_add_appointment_status_options_setting.php b/application/migrations/043_add_appointment_status_options_setting.php index c31b3daf..f88e36f0 100644 --- a/application/migrations/043_add_appointment_status_options_setting.php +++ b/application/migrations/043_add_appointment_status_options_setting.php @@ -27,7 +27,7 @@ class Migration_Add_appointment_status_options_setting extends CI_Migration 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"]' + 'value' => '["Booked", "Confirmed", "Rescheduled", "Cancelled", "Draft"]', ]); } } diff --git a/application/migrations/044_add_status_column_to_appointments_table.php b/application/migrations/044_add_status_column_to_appointments_table.php index 33411be2..e481ced7 100644 --- a/application/migrations/044_add_status_column_to_appointments_table.php +++ b/application/migrations/044_add_status_column_to_appointments_table.php @@ -24,8 +24,8 @@ class Migration_Add_status_column_to_appointments_table extends EA_Migration 'type' => 'VARCHAR', 'constraint' => '512', 'default' => '', - 'after' => 'color' - ] + 'after' => 'color', + ], ]; $this->dbforge->add_column('appointments', $fields); diff --git a/application/migrations/045_drop_delete_datetime_column_from_all_tables.php b/application/migrations/045_drop_delete_datetime_column_from_all_tables.php index 777b5c02..ae1d613d 100644 --- a/application/migrations/045_drop_delete_datetime_column_from_all_tables.php +++ b/application/migrations/045_drop_delete_datetime_column_from_all_tables.php @@ -24,7 +24,7 @@ class Migration_Drop_delete_datetime_column_from_all_tables extends EA_Migration 'services', 'settings', 'users', - 'webhooks' + 'webhooks', ]; /** @@ -50,8 +50,8 @@ class Migration_Drop_delete_datetime_column_from_all_tables extends EA_Migration 'delete_datetime' => [ 'type' => 'DATETIME', 'null' => true, - 'after' => 'update_datetime' - ] + 'after' => 'update_datetime', + ], ]; $this->dbforge->add_column($table, $fields); diff --git a/application/migrations/047_revert_rename_id_service_categories_column_of_services_table.php b/application/migrations/047_revert_rename_id_service_categories_column_of_services_table.php index 953edcdf..57b12b08 100644 --- a/application/migrations/047_revert_rename_id_service_categories_column_of_services_table.php +++ b/application/migrations/047_revert_rename_id_service_categories_column_of_services_table.php @@ -20,15 +20,15 @@ class Migration_Revert_rename_id_service_categories_column_of_services_table ext { if ($this->db->field_exists('id_categories', 'services')) { $this->db->query( - 'ALTER TABLE `' . $this->db->dbprefix('services') . '` DROP FOREIGN KEY `services_categories`' + 'ALTER TABLE `' . $this->db->dbprefix('services') . '` DROP FOREIGN KEY `services_categories`', ); $fields = [ 'id_categories' => [ 'name' => 'id_service_categories', 'type' => 'INT', - 'constraint' => '11' - ] + 'constraint' => '11', + ], ]; $this->dbforge->modify_column('services', $fields); @@ -43,7 +43,7 @@ class Migration_Revert_rename_id_service_categories_column_of_services_table ext '` (`id`) ON DELETE SET NULL ON UPDATE CASCADE - ' + ', ); } } @@ -55,15 +55,15 @@ class Migration_Revert_rename_id_service_categories_column_of_services_table ext { if ($this->db->field_exists('id_service_categories', 'services')) { $this->db->query( - 'ALTER TABLE `' . $this->db->dbprefix('services') . '` DROP FOREIGN KEY `services_service_categories`' + 'ALTER TABLE `' . $this->db->dbprefix('services') . '` DROP FOREIGN KEY `services_service_categories`', ); $fields = [ 'id_service_categories' => [ 'name' => 'id_categories', 'type' => 'INT', - 'constraint' => '11' - ] + 'constraint' => '11', + ], ]; $this->dbforge->modify_column('services', $fields); @@ -78,7 +78,7 @@ class Migration_Revert_rename_id_service_categories_column_of_services_table ext '` (`id`) ON DELETE SET NULL ON UPDATE CASCADE - ' + ', ); } } diff --git a/application/migrations/048_create_blocked_periods_table.php b/application/migrations/048_create_blocked_periods_table.php index 33cac59b..f2148df2 100644 --- a/application/migrations/048_create_blocked_periods_table.php +++ b/application/migrations/048_create_blocked_periods_table.php @@ -23,33 +23,33 @@ class Migration_Create_blocked_periods_table extends EA_Migration 'id' => [ 'type' => 'INT', 'constraint' => 11, - 'auto_increment' => true + 'auto_increment' => true, ], 'create_datetime' => [ 'type' => 'DATETIME', - 'null' => true + 'null' => true, ], 'update_datetime' => [ 'type' => 'DATETIME', - 'null' => true + 'null' => true, ], 'name' => [ 'type' => 'VARCHAR', 'constraint' => '256', - 'null' => true + 'null' => true, ], 'start_datetime' => [ 'type' => 'DATETIME', - 'null' => true + 'null' => true, ], 'end_datetime' => [ 'type' => 'DATETIME', - 'null' => true + 'null' => true, ], 'notes' => [ 'type' => 'TEXT', - 'null' => true - ] + 'null' => true, + ], ]); $this->dbforge->add_key('id', true); diff --git a/application/migrations/049_add_blocked_periods_column_to_roles_table.php b/application/migrations/049_add_blocked_periods_column_to_roles_table.php index 46c002ad..29dab812 100644 --- a/application/migrations/049_add_blocked_periods_column_to_roles_table.php +++ b/application/migrations/049_add_blocked_periods_column_to_roles_table.php @@ -23,8 +23,8 @@ class Migration_Add_blocked_periods_column_to_roles_table extends EA_Migration 'blocked_periods' => [ 'type' => 'INT', 'constraint' => '11', - 'null' => true - ] + 'null' => true, + ], ]; $this->dbforge->add_column('roles', $fields); diff --git a/application/migrations/050_add_custom_fields_columns_to_users_table.php b/application/migrations/050_add_custom_fields_columns_to_users_table.php index ee162015..f14894a2 100644 --- a/application/migrations/050_add_custom_fields_columns_to_users_table.php +++ b/application/migrations/050_add_custom_fields_columns_to_users_table.php @@ -31,8 +31,8 @@ class Migration_Add_custom_fields_columns_to_users_table extends EA_Migration $field_name => [ 'type' => 'TEXT', 'null' => true, - 'after' => 'language' - ] + 'after' => 'language', + ], ]; $this->dbforge->add_column('users', $fields); diff --git a/application/migrations/051_insert_custom_field_rows_to_settings_table.php b/application/migrations/051_insert_custom_field_rows_to_settings_table.php index 0e4fe4d7..87704a25 100644 --- a/application/migrations/051_insert_custom_field_rows_to_settings_table.php +++ b/application/migrations/051_insert_custom_field_rows_to_settings_table.php @@ -21,7 +21,7 @@ class Migration_Insert_custom_field_rows_to_settings_table extends EA_Migration private const SETTINGS = [ 'display' => '0', 'require' => '0', - 'label' => '' + 'label' => '', ]; /** @@ -38,7 +38,7 @@ class Migration_Insert_custom_field_rows_to_settings_table extends EA_Migration if (!$this->db->get_where('settings', ['name' => $setting_name])->num_rows()) { $this->db->insert('settings', [ 'name' => $setting_name, - 'value' => $default_value + 'value' => $default_value, ]); } } diff --git a/application/models/Admins_model.php b/application/models/Admins_model.php index 2203aad8..90dbdccf 100644 --- a/application/models/Admins_model.php +++ b/application/models/Admins_model.php @@ -25,7 +25,7 @@ class Admins_model extends EA_Model */ protected array $casts = [ 'id' => 'integer', - 'id_roles' => 'integer' + 'id_roles' => 'integer', ]; /** @@ -45,7 +45,7 @@ class Admins_model extends EA_Model 'timezone' => 'timezone', 'language' => 'language', 'notes' => 'notes', - 'roleId' => 'id_roles' + 'roleId' => 'id_roles', ]; /** @@ -84,7 +84,7 @@ class Admins_model extends EA_Model if (!$count) { throw new InvalidArgumentException( - 'The provided admin ID does not exist in the database: ' . $admin['id'] + 'The provided admin ID does not exist in the database: ' . $admin['id'], ); } } @@ -110,7 +110,7 @@ class Admins_model extends EA_Model if (!$this->validate_username($admin['settings']['username'], $admin_id)) { throw new InvalidArgumentException( - 'The provided username is already in use, please use a different one.' + 'The provided username is already in use, please use a different one.', ); } } @@ -119,7 +119,7 @@ class Admins_model extends EA_Model if (!empty($admin['settings']['password'])) { if (strlen($admin['settings']['password']) < MIN_PASSWORD_LENGTH) { throw new InvalidArgumentException( - 'The admin password must be at least ' . MIN_PASSWORD_LENGTH . ' characters long.' + 'The admin password must be at least ' . MIN_PASSWORD_LENGTH . ' characters long.', ); } } @@ -135,7 +135,7 @@ class Admins_model extends EA_Model !in_array($admin['settings']['calendar_view'], [CALENDAR_VIEW_DEFAULT, CALENDAR_VIEW_TABLE]) ) { throw new InvalidArgumentException( - 'The provided calendar view is invalid: ' . $admin['settings']['calendar_view'] + 'The provided calendar view is invalid: ' . $admin['settings']['calendar_view'], ); } @@ -154,7 +154,7 @@ class Admins_model extends EA_Model if ($count > 0) { throw new InvalidArgumentException( - 'The provided email address is already in use, please use a different one.' + 'The provided email address is already in use, please use a different one.', ); } } @@ -195,7 +195,7 @@ class Admins_model extends EA_Model array|string $where = null, int $limit = null, int $offset = null, - string $order_by = null + string $order_by = null, ): array { $role_id = $this->get_admin_role_id(); @@ -548,8 +548,8 @@ class Admins_model extends EA_Model 'settings' => [ 'username' => $admin['settings']['username'], 'notifications' => filter_var($admin['settings']['notifications'], FILTER_VALIDATE_BOOLEAN), - 'calendarView' => $admin['settings']['calendar_view'] - ] + 'calendarView' => $admin['settings']['calendar_view'], + ], ]; $admin = $encoded_resource; @@ -629,7 +629,7 @@ class Admins_model extends EA_Model if (array_key_exists('notifications', $admin['settings'])) { $decoded_resource['settings']['notifications'] = filter_var( $admin['settings']['notifications'], - FILTER_VALIDATE_BOOLEAN + FILTER_VALIDATE_BOOLEAN, ); } diff --git a/application/models/Appointments_model.php b/application/models/Appointments_model.php index dc0f283f..1aacf7a6 100644 --- a/application/models/Appointments_model.php +++ b/application/models/Appointments_model.php @@ -26,7 +26,7 @@ class Appointments_model extends EA_Model 'is_unavailability' => 'boolean', 'id_users_provider' => 'integer', 'id_users_customer' => 'integer', - 'id_services' => 'integer' + 'id_services' => 'integer', ]; /** @@ -45,7 +45,7 @@ class Appointments_model extends EA_Model 'serviceId' => 'id_services', 'providerId' => 'id_users_provider', 'customerId' => 'id_users_customer', - 'googleCalendarId' => 'id_google_calendar' + 'googleCalendarId' => 'id_google_calendar', ]; /** @@ -83,7 +83,7 @@ class Appointments_model extends EA_Model if (!$count) { throw new InvalidArgumentException( - 'The provided appointment ID does not exist in the database: ' . $appointment['id'] + 'The provided appointment ID does not exist in the database: ' . $appointment['id'], ); } } @@ -117,7 +117,7 @@ class Appointments_model extends EA_Model if ($diff < EVENT_MINIMUM_DURATION) { throw new InvalidArgumentException( - 'The appointment duration cannot be less than ' . EVENT_MINIMUM_DURATION . ' minutes.' + 'The appointment duration cannot be less than ' . EVENT_MINIMUM_DURATION . ' minutes.', ); } @@ -133,7 +133,7 @@ class Appointments_model extends EA_Model if (!$count) { throw new InvalidArgumentException( - 'The appointment provider ID was not found in the database: ' . $appointment['id_users_provider'] + 'The appointment provider ID was not found in the database: ' . $appointment['id_users_provider'], ); } @@ -150,7 +150,7 @@ class Appointments_model extends EA_Model if (!$count) { throw new InvalidArgumentException( - 'The appointment customer ID was not found in the database: ' . $appointment['id_users_customer'] + 'The appointment customer ID was not found in the database: ' . $appointment['id_users_customer'], ); } @@ -177,7 +177,7 @@ class Appointments_model extends EA_Model array|string $where = null, int $limit = null, int $offset = null, - string $order_by = null + string $order_by = null, ): array { if ($where !== null) { $this->db->where($where); @@ -268,7 +268,7 @@ class Appointments_model extends EA_Model if (!$appointment) { throw new InvalidArgumentException( - 'The provided appointment ID was not found in the database: ' . $appointment_id + 'The provided appointment ID was not found in the database: ' . $appointment_id, ); } @@ -302,7 +302,7 @@ class Appointments_model extends EA_Model if (!$query->num_rows()) { throw new InvalidArgumentException( - 'The provided appointment ID was not found in the database: ' . $appointment_id + 'The provided appointment ID was not found in the database: ' . $appointment_id, ); } @@ -344,7 +344,7 @@ class Appointments_model extends EA_Model DateTime $end, int $service_id, int $provider_id, - int $exclude_appointment_id = null + int $exclude_appointment_id = null, ): int { if ($exclude_appointment_id) { $this->db->where('id !=', $exclude_appointment_id); @@ -388,7 +388,7 @@ class Appointments_model extends EA_Model DateTime $end, int $service_id, int $provider_id, - int $exclude_appointment_id = null + int $exclude_appointment_id = null, ): int { if ($exclude_appointment_id) { $this->db->where('id !=', $exclude_appointment_id); @@ -493,7 +493,7 @@ class Appointments_model extends EA_Model case 'service': $appointment['service'] = $this->db ->get_where('services', [ - 'id' => $appointment['id_services'] ?? ($appointment['serviceId'] ?? null) + 'id' => $appointment['id_services'] ?? ($appointment['serviceId'] ?? null), ]) ->row_array(); break; @@ -501,7 +501,7 @@ class Appointments_model extends EA_Model case 'provider': $appointment['provider'] = $this->db ->get_where('users', [ - 'id' => $appointment['id_users_provider'] ?? ($appointment['providerId'] ?? null) + 'id' => $appointment['id_users_provider'] ?? ($appointment['providerId'] ?? null), ]) ->row_array(); break; @@ -509,14 +509,14 @@ class Appointments_model extends EA_Model case 'customer': $appointment['customer'] = $this->db ->get_where('users', [ - 'id' => $appointment['id_users_customer'] ?? ($appointment['customerId'] ?? null) + 'id' => $appointment['id_users_customer'] ?? ($appointment['customerId'] ?? null), ]) ->row_array(); break; default: throw new InvalidArgumentException( - 'The requested appointment relation is not supported: ' . $resource + 'The requested appointment relation is not supported: ' . $resource, ); } } @@ -543,7 +543,7 @@ class Appointments_model extends EA_Model 'providerId' => $appointment['id_users_provider'] !== null ? (int) $appointment['id_users_provider'] : null, 'serviceId' => $appointment['id_services'] !== null ? (int) $appointment['id_services'] : null, 'googleCalendarId' => - $appointment['id_google_calendar'] !== null ? (int) $appointment['id_google_calendar'] : null + $appointment['id_google_calendar'] !== null ? (int) $appointment['id_google_calendar'] : null, ]; $appointment = $encoded_resource; diff --git a/application/models/Blocked_periods_model.php b/application/models/Blocked_periods_model.php index 9c2982d9..e42c5846 100644 --- a/application/models/Blocked_periods_model.php +++ b/application/models/Blocked_periods_model.php @@ -24,7 +24,7 @@ class Blocked_periods_model extends EA_Model * @var array */ protected array $casts = [ - 'id' => 'integer' + 'id' => 'integer', ]; /** @@ -35,7 +35,7 @@ class Blocked_periods_model extends EA_Model 'name' => 'name', 'start' => 'start_datetime', 'end' => 'end_datetime', - 'notes' => 'notes' + 'notes' => 'notes', ]; /** @@ -73,7 +73,7 @@ class Blocked_periods_model extends EA_Model if (!$count) { throw new InvalidArgumentException( - 'The provided blocked-period ID does not exist in the database: ' . $blocked_period['id'] + 'The provided blocked-period ID does not exist in the database: ' . $blocked_period['id'], ); } } @@ -85,7 +85,7 @@ class Blocked_periods_model extends EA_Model empty($blocked_period['end_datetime']) ) { throw new InvalidArgumentException( - 'Not all required fields are provided: ' . print_r($blocked_period, true) + 'Not all required fields are provided: ' . print_r($blocked_period, true), ); } @@ -166,7 +166,7 @@ class Blocked_periods_model extends EA_Model if (!$blocked_period) { throw new InvalidArgumentException( - 'The provided blocked-period ID was not found in the database: ' . $blocked_period_id + 'The provided blocked-period ID was not found in the database: ' . $blocked_period_id, ); } @@ -200,7 +200,7 @@ class Blocked_periods_model extends EA_Model if (!$query->num_rows()) { throw new InvalidArgumentException( - 'The provided blocked-period ID was not found in the database: ' . $blocked_period_id + 'The provided blocked-period ID was not found in the database: ' . $blocked_period_id, ); } @@ -211,7 +211,7 @@ class Blocked_periods_model extends EA_Model if (!array_key_exists($field, $blocked_period)) { throw new InvalidArgumentException( - 'The requested field was not found in the blocked-period data: ' . $field + 'The requested field was not found in the blocked-period data: ' . $field, ); } @@ -264,7 +264,7 @@ class Blocked_periods_model extends EA_Model array|string $where = null, int $limit = null, int $offset = null, - string $order_by = null + string $order_by = null, ): array { if ($where !== null) { $this->db->where($where); @@ -308,7 +308,7 @@ class Blocked_periods_model extends EA_Model 'name' => $blocked_period['name'], 'start' => array_key_exists('start_datetime', $blocked_period) ? $blocked_period['start_datetime'] : null, 'end' => array_key_exists('end_datetime', $blocked_period) ? $blocked_period['end_datetime'] : null, - 'notes' => array_key_exists('notes', $blocked_period) ? $blocked_period['notes'] : null + 'notes' => array_key_exists('notes', $blocked_period) ? $blocked_period['notes'] : null, ]; $blocked_period = $encoded_resource; diff --git a/application/models/Consents_model.php b/application/models/Consents_model.php index 619032b5..a58b247b 100644 --- a/application/models/Consents_model.php +++ b/application/models/Consents_model.php @@ -24,7 +24,7 @@ class Consents_model extends EA_Model * @var array */ protected array $casts = [ - 'id' => 'integer' + 'id' => 'integer', ]; /** @@ -231,7 +231,7 @@ class Consents_model extends EA_Model array|string $where = null, int $limit = null, int $offset = null, - string $order_by = null + string $order_by = null, ): array { if ($where !== null) { $this->db->where($where); diff --git a/application/models/Customers_model.php b/application/models/Customers_model.php index 869a234c..d97ac0f7 100644 --- a/application/models/Customers_model.php +++ b/application/models/Customers_model.php @@ -25,7 +25,7 @@ class Customers_model extends EA_Model */ protected array $casts = [ 'id' => 'integer', - 'id_roles' => 'integer' + 'id_roles' => 'integer', ]; /** @@ -48,7 +48,7 @@ class Customers_model extends EA_Model 'customField3' => 'custom_field_3', 'customField4' => 'custom_field_4', 'customField5' => 'custom_field_5', - 'notes' => 'notes' + 'notes' => 'notes', ]; /** @@ -90,7 +90,7 @@ class Customers_model extends EA_Model if (!$count) { throw new InvalidArgumentException( - 'The provided customer ID does not exist in the database: ' . $customer['id'] + 'The provided customer ID does not exist in the database: ' . $customer['id'], ); } } @@ -137,7 +137,7 @@ class Customers_model extends EA_Model if ($count > 0) { throw new InvalidArgumentException( - 'The provided email address is already in use, please use a different one.' + 'The provided email address is already in use, please use a different one.', ); } } @@ -157,7 +157,7 @@ class Customers_model extends EA_Model array|string $where = null, int $limit = null, int $offset = null, - string $order_by = null + string $order_by = null, ): array { $role_id = $this->get_customer_role_id(); @@ -319,7 +319,7 @@ class Customers_model extends EA_Model if (!$customer) { throw new InvalidArgumentException( - 'The provided customer ID was not found in the database: ' . $customer_id + 'The provided customer ID was not found in the database: ' . $customer_id, ); } @@ -353,7 +353,7 @@ class Customers_model extends EA_Model if (!$query->num_rows()) { throw new InvalidArgumentException( - 'The provided customer ID was not found in the database: ' . $customer_id + 'The provided customer ID was not found in the database: ' . $customer_id, ); } @@ -460,7 +460,7 @@ class Customers_model extends EA_Model 'customField2' => $customer['custom_field_2'], 'customField3' => $customer['custom_field_3'], 'customField4' => $customer['custom_field_4'], - 'customField5' => $customer['custom_field_5'] + 'customField5' => $customer['custom_field_5'], ]; $customer = $encoded_resource; diff --git a/application/models/Providers_model.php b/application/models/Providers_model.php index 2506bf69..3a3de408 100755 --- a/application/models/Providers_model.php +++ b/application/models/Providers_model.php @@ -26,7 +26,7 @@ class Providers_model extends EA_Model protected array $casts = [ 'id' => 'integer', 'is_private' => 'boolean', - 'id_roles' => 'integer' + 'id_roles' => 'integer', ]; /** @@ -47,7 +47,7 @@ class Providers_model extends EA_Model 'language' => 'language', 'notes' => 'notes', 'isPrivate' => 'is_private', - 'roleId' => 'id_roles' + 'roleId' => 'id_roles', ]; /** @@ -86,7 +86,7 @@ class Providers_model extends EA_Model if (!$count) { throw new InvalidArgumentException( - 'The provided provider ID does not exist in the database: ' . $provider['id'] + 'The provided provider ID does not exist in the database: ' . $provider['id'], ); } } @@ -112,7 +112,7 @@ class Providers_model extends EA_Model foreach ($provider['services'] as $service_id) { if (!is_numeric($service_id)) { throw new InvalidArgumentException( - 'The provided provider services are invalid: ' . print_r($provider, true) + 'The provided provider services are invalid: ' . print_r($provider, true), ); } } @@ -124,7 +124,7 @@ class Providers_model extends EA_Model if (!$this->validate_username($provider['settings']['username'], $provider_id)) { throw new InvalidArgumentException( - 'The provided username is already in use, please use a different one.' + 'The provided username is already in use, please use a different one.', ); } } @@ -133,7 +133,7 @@ class Providers_model extends EA_Model if (!empty($provider['settings']['password'])) { if (strlen($provider['settings']['password']) < MIN_PASSWORD_LENGTH) { throw new InvalidArgumentException( - 'The provider password must be at least ' . MIN_PASSWORD_LENGTH . ' characters long.' + 'The provider password must be at least ' . MIN_PASSWORD_LENGTH . ' characters long.', ); } } @@ -149,7 +149,7 @@ class Providers_model extends EA_Model !in_array($provider['settings']['calendar_view'], [CALENDAR_VIEW_DEFAULT, CALENDAR_VIEW_TABLE]) ) { throw new InvalidArgumentException( - 'The provided calendar view is invalid: ' . $provider['settings']['calendar_view'] + 'The provided calendar view is invalid: ' . $provider['settings']['calendar_view'], ); } @@ -168,7 +168,7 @@ class Providers_model extends EA_Model if ($count > 0) { throw new InvalidArgumentException( - 'The provided email address is already in use, please use a different one.' + 'The provided email address is already in use, please use a different one.', ); } } @@ -209,7 +209,7 @@ class Providers_model extends EA_Model array|string $where = null, int $limit = null, int $offset = null, - string $order_by = null + string $order_by = null, ): array { $role_id = $this->get_provider_role_id(); @@ -401,7 +401,7 @@ class Providers_model extends EA_Model foreach ($service_ids as $service_id) { $service_provider_connection = [ 'id_users' => $provider_id, - 'id_services' => $service_id + 'id_services' => $service_id, ]; $this->db->insert('services_providers', $service_provider_connection); @@ -445,7 +445,7 @@ class Providers_model extends EA_Model if (!$query->num_rows()) { throw new InvalidArgumentException( - 'The provided provider ID was not found in the database: ' . $provider_id + 'The provided provider ID was not found in the database: ' . $provider_id, ); } @@ -504,7 +504,7 @@ class Providers_model extends EA_Model // Make sure the provider record exists. $where = [ 'id' => $provider_id, - 'id_roles' => $this->db->get_where('roles', ['slug' => DB_SLUG_PROVIDER])->row()->id + 'id_roles' => $this->db->get_where('roles', ['slug' => DB_SLUG_PROVIDER])->row()->id, ]; if ($this->db->get_where('users', $where)->num_rows() === 0) { @@ -542,7 +542,7 @@ class Providers_model extends EA_Model if (!$provider) { throw new InvalidArgumentException( - 'The provided provider ID was not found in the database: ' . $provider_id + 'The provided provider ID was not found in the database: ' . $provider_id, ); } @@ -623,7 +623,7 @@ class Providers_model extends EA_Model $provider['settings']['id_users'], $provider['settings']['username'], $provider['settings']['password'], - $provider['settings']['salt'] + $provider['settings']['salt'], ); $provider['services'] = []; @@ -734,8 +734,8 @@ class Providers_model extends EA_Model ->get() ->result_array(), default => throw new InvalidArgumentException( - 'The requested provider relation is not supported: ' . $resource - ) + 'The requested provider relation is not supported: ' . $resource, + ), }; } } @@ -759,7 +759,7 @@ class Providers_model extends EA_Model 'state' => $provider['state'], 'zip' => $provider['zip_code'], 'notes' => $provider['notes'], - 'timezone' => $provider['timezone'] + 'timezone' => $provider['timezone'], ]; if (array_key_exists('services', $provider)) { @@ -791,7 +791,7 @@ class Providers_model extends EA_Model : null, 'workingPlanExceptions' => array_key_exists('working_plan_exceptions', $provider['settings']) ? json_decode($provider['settings']['working_plan_exceptions'], true) - : null + : null, ]; } @@ -880,14 +880,14 @@ class Providers_model extends EA_Model if (array_key_exists('notifications', $provider['settings'])) { $decoded_resource['settings']['notifications'] = filter_var( $provider['settings']['notifications'], - FILTER_VALIDATE_BOOLEAN + FILTER_VALIDATE_BOOLEAN, ); } if (array_key_exists('googleSync', $provider['settings'])) { $decoded_resource['settings']['google_sync'] = filter_var( $provider['settings']['googleSync'], - FILTER_VALIDATE_BOOLEAN + FILTER_VALIDATE_BOOLEAN, ); } @@ -913,7 +913,7 @@ class Providers_model extends EA_Model if (array_key_exists('workingPlanExceptions', $provider['settings'])) { $decoded_resource['settings']['working_plan_exceptions'] = json_encode( - $provider['settings']['workingPlanExceptions'] + $provider['settings']['workingPlanExceptions'], ); } } diff --git a/application/models/Roles_model.php b/application/models/Roles_model.php index c079639f..7f71d6f8 100644 --- a/application/models/Roles_model.php +++ b/application/models/Roles_model.php @@ -31,7 +31,7 @@ class Roles_model extends EA_Model 'services' => 'integer', 'users' => 'integer', 'system_settings' => 'integer', - 'user_settings' => 'integer' + 'user_settings' => 'integer', ]; /** @@ -69,7 +69,7 @@ class Roles_model extends EA_Model if (!$count) { throw new InvalidArgumentException( - 'The provided role ID does not exist in the database: ' . $role['id'] + 'The provided role ID does not exist in the database: ' . $role['id'], ); } } @@ -227,7 +227,7 @@ class Roles_model extends EA_Model 'view' => false, 'add' => false, 'edit' => false, - 'delete' => false + 'delete' => false, ]; if ($value > 0) { @@ -308,7 +308,7 @@ class Roles_model extends EA_Model array|string $where = null, int $limit = null, int $offset = null, - string $order_by = null + string $order_by = null, ): array { if ($where !== null) { $this->db->where($where); diff --git a/application/models/Secretaries_model.php b/application/models/Secretaries_model.php index b7bb5cba..39e7db0c 100644 --- a/application/models/Secretaries_model.php +++ b/application/models/Secretaries_model.php @@ -25,7 +25,7 @@ class Secretaries_model extends EA_Model */ protected array $casts = [ 'id' => 'integer', - 'id_roles' => 'integer' + 'id_roles' => 'integer', ]; /** @@ -45,7 +45,7 @@ class Secretaries_model extends EA_Model 'timezone' => 'timezone', 'language' => 'language', 'notes' => 'notes', - 'roleId' => 'id_roles' + 'roleId' => 'id_roles', ]; /** @@ -84,7 +84,7 @@ class Secretaries_model extends EA_Model if (!$count) { throw new InvalidArgumentException( - 'The provided secretary ID does not exist in the database: ' . $secretary['id'] + 'The provided secretary ID does not exist in the database: ' . $secretary['id'], ); } } @@ -110,7 +110,7 @@ class Secretaries_model extends EA_Model foreach ($secretary['providers'] as $secretary_id) { if (!is_numeric($secretary_id)) { throw new InvalidArgumentException( - 'The provided secretary providers are invalid: ' . print_r($secretary, true) + 'The provided secretary providers are invalid: ' . print_r($secretary, true), ); } } @@ -122,7 +122,7 @@ class Secretaries_model extends EA_Model if (!$this->validate_username($secretary['settings']['username'], $secretary_id)) { throw new InvalidArgumentException( - 'The provided username is already in use, please use a different one.' + 'The provided username is already in use, please use a different one.', ); } } @@ -131,7 +131,7 @@ class Secretaries_model extends EA_Model if (!empty($secretary['settings']['password'])) { if (strlen($secretary['settings']['password']) < MIN_PASSWORD_LENGTH) { throw new InvalidArgumentException( - 'The secretary password must be at least ' . MIN_PASSWORD_LENGTH . ' characters long.' + 'The secretary password must be at least ' . MIN_PASSWORD_LENGTH . ' characters long.', ); } } @@ -147,7 +147,7 @@ class Secretaries_model extends EA_Model !in_array($secretary['settings']['calendar_view'], [CALENDAR_VIEW_DEFAULT, CALENDAR_VIEW_TABLE]) ) { throw new InvalidArgumentException( - 'The provided calendar view is invalid: ' . $secretary['settings']['calendar_view'] + 'The provided calendar view is invalid: ' . $secretary['settings']['calendar_view'], ); } @@ -166,7 +166,7 @@ class Secretaries_model extends EA_Model if ($count > 0) { throw new InvalidArgumentException( - 'The provided email address is already in use, please use a different one.' + 'The provided email address is already in use, please use a different one.', ); } } @@ -207,7 +207,7 @@ class Secretaries_model extends EA_Model array|string $where = null, int $limit = null, int $offset = null, - string $order_by = null + string $order_by = null, ): array { $role_id = $this->get_secretary_role_id(); @@ -229,7 +229,7 @@ class Secretaries_model extends EA_Model unset( $secretary['settings']['id_users'], $secretary['settings']['password'], - $secretary['settings']['salt'] + $secretary['settings']['salt'], ); $secretary_provider_connections = $this->db @@ -391,7 +391,7 @@ class Secretaries_model extends EA_Model foreach ($provider_ids as $provider_id) { $secretary_provider_connection = [ 'id_users_secretary' => $secretary_id, - 'id_users_provider' => $provider_id + 'id_users_provider' => $provider_id, ]; $this->db->insert('secretaries_providers', $secretary_provider_connection); @@ -435,7 +435,7 @@ class Secretaries_model extends EA_Model if (!$query->num_rows()) { throw new InvalidArgumentException( - 'The provided secretary ID was not found in the database: ' . $secretary_id + 'The provided secretary ID was not found in the database: ' . $secretary_id, ); } @@ -525,7 +525,7 @@ class Secretaries_model extends EA_Model unset( $secretary['settings']['id_users'], $secretary['settings']['password'], - $secretary['settings']['salt'] + $secretary['settings']['salt'], ); $secretary_provider_connections = $this->db @@ -566,8 +566,8 @@ class Secretaries_model extends EA_Model ->get() ->result_array(), default => throw new InvalidArgumentException( - 'The requested secretary relation is not supported: ' . $resource - ) + 'The requested secretary relation is not supported: ' . $resource, + ), }; } } @@ -596,8 +596,8 @@ class Secretaries_model extends EA_Model 'settings' => [ 'username' => $secretary['settings']['username'], 'notifications' => filter_var($secretary['settings']['notifications'], FILTER_VALIDATE_BOOLEAN), - 'calendarView' => $secretary['settings']['calendar_view'] - ] + 'calendarView' => $secretary['settings']['calendar_view'], + ], ]; $secretary = $encoded_resource; @@ -681,7 +681,7 @@ class Secretaries_model extends EA_Model if (array_key_exists('notifications', $secretary['settings'])) { $decoded_resource['settings']['notifications'] = filter_var( $secretary['settings']['notifications'], - FILTER_VALIDATE_BOOLEAN + FILTER_VALIDATE_BOOLEAN, ); } @@ -723,7 +723,7 @@ class Secretaries_model extends EA_Model if (!$secretary) { throw new InvalidArgumentException( - 'The provided secretary ID was not found in the database: ' . $secretary_id + 'The provided secretary ID was not found in the database: ' . $secretary_id, ); } diff --git a/application/models/Service_categories_model.php b/application/models/Service_categories_model.php index 210fbd29..88d624d2 100644 --- a/application/models/Service_categories_model.php +++ b/application/models/Service_categories_model.php @@ -24,7 +24,7 @@ class Service_categories_model extends EA_Model * @var array */ protected array $casts = [ - 'id' => 'integer' + 'id' => 'integer', ]; /** @@ -33,7 +33,7 @@ class Service_categories_model extends EA_Model protected array $api_resource = [ 'id' => 'id', 'name' => 'name', - 'description' => 'description' + 'description' => 'description', ]; /** @@ -71,7 +71,7 @@ class Service_categories_model extends EA_Model if (!$count) { throw new InvalidArgumentException( - 'The provided service-category ID does not exist in the database: ' . $service_category['id'] + 'The provided service-category ID does not exist in the database: ' . $service_category['id'], ); } } @@ -79,7 +79,7 @@ class Service_categories_model extends EA_Model // Make sure all required fields are provided. if (empty($service_category['name'])) { throw new InvalidArgumentException( - 'Not all required fields are provided: ' . print_r($service_category, true) + 'Not all required fields are provided: ' . print_r($service_category, true), ); } } @@ -152,7 +152,7 @@ class Service_categories_model extends EA_Model if (!$service_category) { throw new InvalidArgumentException( - 'The provided service-category ID was not found in the database: ' . $service_category_id + 'The provided service-category ID was not found in the database: ' . $service_category_id, ); } @@ -186,7 +186,7 @@ class Service_categories_model extends EA_Model if (!$query->num_rows()) { throw new InvalidArgumentException( - 'The provided service-category ID was not found in the database: ' . $service_category_id + 'The provided service-category ID was not found in the database: ' . $service_category_id, ); } @@ -197,7 +197,7 @@ class Service_categories_model extends EA_Model if (!array_key_exists($field, $service_category)) { throw new InvalidArgumentException( - 'The requested field was not found in the service-category data: ' . $field + 'The requested field was not found in the service-category data: ' . $field, ); } @@ -260,7 +260,7 @@ class Service_categories_model extends EA_Model array|string $where = null, int $limit = null, int $offset = null, - string $order_by = null + string $order_by = null, ): array { if ($where !== null) { $this->db->where($where); @@ -304,7 +304,7 @@ class Service_categories_model extends EA_Model 'name' => $service_category['name'], 'description' => array_key_exists('description', $service_category) ? $service_category['description'] - : null + : null, ]; $service_category = $encoded_resource; diff --git a/application/models/Services_model.php b/application/models/Services_model.php index 5ad51894..527eb1ca 100644 --- a/application/models/Services_model.php +++ b/application/models/Services_model.php @@ -28,7 +28,7 @@ class Services_model extends EA_Model 'price' => 'float', 'attendants_number' => 'integer', 'is_private' => 'boolean', - 'id_service_categories' => 'integer' + 'id_service_categories' => 'integer', ]; /** @@ -46,7 +46,7 @@ class Services_model extends EA_Model 'availabilitiesType' => 'availabilities_type', 'attendantsNumber' => 'attendants_number', 'isPrivate' => 'is_private', - 'serviceCategoryId' => 'id_service_categories' + 'serviceCategoryId' => 'id_service_categories', ]; /** @@ -84,7 +84,7 @@ class Services_model extends EA_Model if (!$count) { throw new InvalidArgumentException( - 'The provided service ID does not exist in the database: ' . $service['id'] + 'The provided service ID does not exist in the database: ' . $service['id'], ); } } @@ -100,7 +100,7 @@ class Services_model extends EA_Model if (!$count) { throw new InvalidArgumentException( - 'The provided category ID was not found in the database: ' . $service['id_service_categories'] + 'The provided category ID was not found in the database: ' . $service['id_service_categories'], ); } } @@ -109,7 +109,7 @@ class Services_model extends EA_Model if (!empty($service['duration'])) { if ((int) $service['duration'] < EVENT_MINIMUM_DURATION) { throw new InvalidArgumentException( - 'The service duration cannot be less than ' . EVENT_MINIMUM_DURATION . ' minutes long.' + 'The service duration cannot be less than ' . EVENT_MINIMUM_DURATION . ' minutes long.', ); } } @@ -127,7 +127,7 @@ class Services_model extends EA_Model AVAILABILITIES_TYPE_FIXED . ' (given ' . $service['availabilities_type'] . - ')' + ')', ); } @@ -137,14 +137,14 @@ class Services_model extends EA_Model !in_array($service['availabilities_type'], [AVAILABILITIES_TYPE_FLEXIBLE, AVAILABILITIES_TYPE_FIXED]) ) { throw new InvalidArgumentException( - 'The provided availabilities type is invalid: ' . $service['availabilities_type'] + 'The provided availabilities type is invalid: ' . $service['availabilities_type'], ); } // Validate the attendants number value. if (empty($service['attendants_number']) || (int) $service['attendants_number'] < 1) { throw new InvalidArgumentException( - 'The provided attendants number is invalid: ' . $service['attendants_number'] + 'The provided attendants number is invalid: ' . $service['attendants_number'], ); } } @@ -279,7 +279,7 @@ class Services_model extends EA_Model $services = $this->db ->distinct() ->select( - 'services.*, service_categories.name AS service_category_name, service_categories.id AS service_category_id' + 'services.*, service_categories.name AS service_category_name, service_categories.id AS service_category_id', ) ->from('services') ->join('services_providers', 'services_providers.id_services = services.id', 'inner') @@ -309,7 +309,7 @@ class Services_model extends EA_Model array|string $where = null, int $limit = null, int $offset = null, - string $order_by = null + string $order_by = null, ): array { if ($where !== null) { $this->db->where($where); @@ -388,12 +388,12 @@ class Services_model extends EA_Model $service['category'] = match ($resource) { 'category' => $this->db ->get_where('categories', [ - 'id' => $service['id_service_categories'] ?? ($service['serviceCategoryId'] ?? null) + 'id' => $service['id_service_categories'] ?? ($service['serviceCategoryId'] ?? null), ]) ->row_array(), default => throw new InvalidArgumentException( - 'The requested appointment relation is not supported: ' . $resource - ) + 'The requested appointment relation is not supported: ' . $resource, + ), }; } } @@ -416,7 +416,7 @@ class Services_model extends EA_Model 'availabilitiesType' => $service['availabilities_type'], 'attendantsNumber' => (int) $service['attendants_number'], 'serviceCategoryId' => - $service['id_service_categories'] !== null ? (int) $service['id_service_categories'] : null + $service['id_service_categories'] !== null ? (int) $service['id_service_categories'] : null, ]; $service = $encoded_resource; diff --git a/application/models/Settings_model.php b/application/models/Settings_model.php index f7a3943c..a3fb7416 100644 --- a/application/models/Settings_model.php +++ b/application/models/Settings_model.php @@ -24,7 +24,7 @@ class Settings_model extends EA_Model * @var array */ protected array $casts = [ - 'id' => 'integer' + 'id' => 'integer', ]; /** @@ -32,7 +32,7 @@ class Settings_model extends EA_Model */ protected array $api_resource = [ 'name' => 'name', - 'value' => 'value' + 'value' => 'value', ]; /** @@ -70,7 +70,7 @@ class Settings_model extends EA_Model if (!$count) { throw new InvalidArgumentException( - 'The provided setting ID does not exist in the database: ' . $setting['id'] + 'The provided setting ID does not exist in the database: ' . $setting['id'], ); } } @@ -251,7 +251,7 @@ class Settings_model extends EA_Model array|string $where = null, int $limit = null, int $offset = null, - string $order_by = null + string $order_by = null, ): array { if ($where !== null) { $this->db->where($where); @@ -292,7 +292,7 @@ class Settings_model extends EA_Model { $encoded_resource = [ 'name' => $setting['name'], - 'value' => $setting['value'] + 'value' => $setting['value'], ]; $setting = $encoded_resource; diff --git a/application/models/Unavailabilities_model.php b/application/models/Unavailabilities_model.php index ef9d0a30..d2711e52 100644 --- a/application/models/Unavailabilities_model.php +++ b/application/models/Unavailabilities_model.php @@ -26,7 +26,7 @@ class Unavailabilities_model extends EA_Model 'is_unavailability' => 'boolean', 'id_users_provider' => 'integer', 'id_users_customer' => 'integer', - 'id_services' => 'integer' + 'id_services' => 'integer', ]; /** @@ -43,7 +43,7 @@ class Unavailabilities_model extends EA_Model 'notes' => 'notes', 'hash' => 'hash', 'providerId' => 'id_users_provider', - 'googleCalendarId' => 'id_google_calendar' + 'googleCalendarId' => 'id_google_calendar', ]; /** @@ -81,7 +81,7 @@ class Unavailabilities_model extends EA_Model if (!$count) { throw new InvalidArgumentException( - 'The provided unavailability ID does not exist in the database: ' . $unavailability['id'] + 'The provided unavailability ID does not exist in the database: ' . $unavailability['id'], ); } } @@ -93,7 +93,7 @@ class Unavailabilities_model extends EA_Model empty($unavailability['id_users_provider']) ) { throw new InvalidArgumentException( - 'Not all required fields are provided: ' . print_r($unavailability, true) + 'Not all required fields are provided: ' . print_r($unavailability, true), ); } @@ -111,7 +111,7 @@ class Unavailabilities_model extends EA_Model if ($diff < EVENT_MINIMUM_DURATION) { throw new InvalidArgumentException( - 'The unavailability duration cannot be less than ' . EVENT_MINIMUM_DURATION . ' minutes.' + 'The unavailability duration cannot be less than ' . EVENT_MINIMUM_DURATION . ' minutes.', ); } @@ -127,7 +127,7 @@ class Unavailabilities_model extends EA_Model if (!$count) { throw new InvalidArgumentException( - 'The unavailability provider ID was not found in the database: ' . $unavailability['id_users_provider'] + 'The unavailability provider ID was not found in the database: ' . $unavailability['id_users_provider'], ); } } @@ -146,7 +146,7 @@ class Unavailabilities_model extends EA_Model array|string $where = null, int $limit = null, int $offset = null, - string $order_by = null + string $order_by = null, ): array { if ($where !== null) { $this->db->where($where); @@ -238,7 +238,7 @@ class Unavailabilities_model extends EA_Model if (!$unavailability) { throw new InvalidArgumentException( - 'The provided unavailability ID was not found in the database: ' . $unavailability_id + 'The provided unavailability ID was not found in the database: ' . $unavailability_id, ); } @@ -272,7 +272,7 @@ class Unavailabilities_model extends EA_Model if (!$query->num_rows()) { throw new InvalidArgumentException( - 'The provided unavailability ID was not found in the database: ' . $unavailability_id + 'The provided unavailability ID was not found in the database: ' . $unavailability_id, ); } @@ -283,7 +283,7 @@ class Unavailabilities_model extends EA_Model if (!array_key_exists($field, $unavailability)) { throw new InvalidArgumentException( - 'The requested field was not found in the unavailability data: ' . $field + 'The requested field was not found in the unavailability data: ' . $field, ); } @@ -359,12 +359,12 @@ class Unavailabilities_model extends EA_Model $unavailability['provider'] = match ($resource) { 'provider' => $this->db ->get_where('users', [ - 'id' => $unavailability['id_users_provider'] ?? ($unavailability['providerId'] ?? null) + 'id' => $unavailability['id_users_provider'] ?? ($unavailability['providerId'] ?? null), ]) ->row_array(), default => throw new InvalidArgumentException( - 'The requested unavailability relation is not supported: ' . $resource - ) + 'The requested unavailability relation is not supported: ' . $resource, + ), }; } } @@ -387,7 +387,7 @@ class Unavailabilities_model extends EA_Model 'providerId' => $unavailability['id_users_provider'] !== null ? (int) $unavailability['id_users_provider'] : null, 'googleCalendarId' => - $unavailability['id_google_calendar'] !== null ? (int) $unavailability['id_google_calendar'] : null + $unavailability['id_google_calendar'] !== null ? (int) $unavailability['id_google_calendar'] : null, ]; $unavailability = $encoded_resource; diff --git a/application/models/Users_model.php b/application/models/Users_model.php index 48c5df29..3bc01245 100644 --- a/application/models/Users_model.php +++ b/application/models/Users_model.php @@ -25,7 +25,7 @@ class Users_model extends EA_Model */ protected array $casts = [ 'id' => 'integer', - 'id_roles' => 'integer' + 'id_roles' => 'integer', ]; /** @@ -45,7 +45,7 @@ class Users_model extends EA_Model 'timezone' => 'timezone', 'language' => 'language', 'notes' => 'notes', - 'roleId' => 'id_roles' + 'roleId' => 'id_roles', ]; /** @@ -84,7 +84,7 @@ class Users_model extends EA_Model if (!$count) { throw new InvalidArgumentException( - 'The provided user ID does not exist in the database: ' . $user['id'] + 'The provided user ID does not exist in the database: ' . $user['id'], ); } } @@ -369,7 +369,7 @@ class Users_model extends EA_Model array|string $where = null, int $limit = null, int $offset = null, - string $order_by = null + string $order_by = null, ): array { if ($where !== null) { $this->db->where($where); diff --git a/application/models/Webhooks_model.php b/application/models/Webhooks_model.php index db21c8ab..18cec3cb 100644 --- a/application/models/Webhooks_model.php +++ b/application/models/Webhooks_model.php @@ -26,7 +26,7 @@ class Webhooks_model extends EA_Model protected array $casts = [ 'id' => 'integer', 'is_active' => 'boolean', - 'is_ssl_verified' => 'boolean' + 'is_ssl_verified' => 'boolean', ]; /** @@ -40,7 +40,7 @@ class Webhooks_model extends EA_Model 'secretToken' => 'secret_token', 'isActive' => 'is_active', 'isSslVerified' => 'is_ssl_verified', - 'notes' => 'notes' + 'notes' => 'notes', ]; /** @@ -246,7 +246,7 @@ class Webhooks_model extends EA_Model array|string $where = null, int $limit = null, int $offset = null, - string $order_by = null + string $order_by = null, ): array { if ($where !== null) { $this->db->where($where); diff --git a/application/views/components/appointments_modal.php b/application/views/components/appointments_modal.php index 3c333e2e..93e55282 100644 --- a/application/views/components/appointments_modal.php +++ b/application/views/components/appointments_modal.php @@ -321,7 +321,7 @@ 'id="timezone" class="form-control required"', - 'grouped_timezones' => vars('grouped_timezones') + 'grouped_timezones' => vars('grouped_timezones'), ]); ?> diff --git a/application/views/components/backend_header.php b/application/views/components/backend_header.php index a58ada02..e1ba0d9e 100755 --- a/application/views/components/backend_header.php +++ b/application/views/components/backend_header.php @@ -25,7 +25,7 @@