mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-20 21:52:22 +03:00
Add support for PHP 8.4 (#1640)
This commit is contained in:
parent
3251923faa
commit
54529a2f14
121 changed files with 679 additions and 599 deletions
|
@ -5,6 +5,10 @@ developers to maintain and readjust their custom modifications on the main proje
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- Add support for PHP 8.4 (#1640)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix the date parsing issue on Safari web browsers during the booking process (#1584)
|
||||
|
@ -12,6 +16,7 @@ developers to maintain and readjust their custom modifications on the main proje
|
|||
- Improve the CalDAV syncing mechanism so that it connects to more systems without problems (#1622)
|
||||
|
||||
|
||||
|
||||
## [1.5.0] - 2024-07-07
|
||||
|
||||
### Added
|
||||
|
|
|
@ -53,7 +53,7 @@ $config['index_page'] = 'index.php';
|
|||
| URI string. The default setting of 'AUTO' works for most servers.
|
||||
| If your links do not seem to work, try one of the other delicious flavors:
|
||||
|
|
||||
| 'AUTO' Default - auto detects
|
||||
| 'AUTO' Default - auto-detects
|
||||
| 'PATH_INFO' Uses the PATH_INFO
|
||||
| 'QUERY_STRING' Uses the QUERY_STRING
|
||||
| 'REQUEST_URI' Uses the REQUEST_URI
|
||||
|
@ -236,7 +236,7 @@ $config['subclass_prefix'] = 'EA_';
|
|||
| characters they will get a warning message.
|
||||
|
|
||||
| As a security measure you are STRONGLY encouraged to restrict URLs to
|
||||
| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
|
||||
| as few characters as possible. By default, only these are allowed: a-z 0-9~%.:_-
|
||||
|
|
||||
| Leave blank to allow all characters -- but only if you are insane.
|
||||
|
|
||||
|
@ -465,7 +465,7 @@ $config['proxy_ips'] = '';
|
|||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Toggle the rate limiting feature in your application. Using rate limiting
|
||||
| will control the number of requests a client can sent to the app.
|
||||
| will control the number of requests a client can send to the app.
|
||||
|
|
||||
*/
|
||||
$config['rate_limiting'] = true;
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
| multi-byte character set and are running versions lower than these.
|
||||
| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
|
||||
| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
|
||||
| ['autoinit'] Whether or not to automatically initialize the database.
|
||||
| ['autoinit'] Whether to automatically initialize the database.
|
||||
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
|
||||
| - good for ensuring strict SQL while developing
|
||||
|
|
||||
|
@ -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 */
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
| whenever you intend to do a schema migration.
|
||||
|
|
||||
*/
|
||||
$config['migration_enabled'] = TRUE;
|
||||
$config['migration_enabled'] = true;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -28,9 +28,9 @@ $config['migration_version'] = 0;
|
|||
| Migrations Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Path to your migrations folder.
|
||||
| Path to your "migrations" folder.
|
||||
| Typically, it will be within your application path.
|
||||
| Also, writing permission is required within the migrations path.
|
||||
| Also, writing permission is required within the "migrations" path.
|
||||
|
|
||||
*/
|
||||
$config['migration_path'] = APPPATH . 'migrations/';
|
||||
|
|
|
@ -63,7 +63,7 @@ class Appointments extends EA_Controller
|
|||
*
|
||||
* @deprecated Since 1.5
|
||||
*/
|
||||
public function index(string $appointment_hash = '')
|
||||
public function index(string $appointment_hash = ''): void
|
||||
{
|
||||
redirect('booking/' . $appointment_hash);
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ class Backend extends EA_Controller
|
|||
/**
|
||||
* Display settings page.
|
||||
*
|
||||
* Notice: Since the "settings" page is split into multiple pages (general, business, booking etc), this method will
|
||||
* Notice: Since the "settings" page is split into multiple pages (general, business, booking etc.), this method will
|
||||
* redirect to "general" page by default.
|
||||
*/
|
||||
public function settings(): void
|
||||
|
|
|
@ -551,7 +551,7 @@ class Booking extends EA_Controller
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function search_any_provider(int $service_id, string $date, string $hour = null): ?int
|
||||
protected function search_any_provider(int $service_id, string $date, ?string $hour = null): ?int
|
||||
{
|
||||
$available_providers = $this->providers_model->get_available_providers(true);
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ class Business_settings extends EA_Controller
|
|||
/**
|
||||
* Apply global working plan to all providers.
|
||||
*/
|
||||
public function apply_global_working_plan()
|
||||
public function apply_global_working_plan(): void
|
||||
{
|
||||
try {
|
||||
if (cannot('edit', PRIV_SYSTEM_SETTINGS)) {
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Jsvrcek\ICS\Exception\CalendarEventException;
|
||||
|
||||
/**
|
||||
* Caldav controller.
|
||||
|
@ -87,7 +88,7 @@ class Caldav extends EA_Controller
|
|||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Jsvrcek\ICS\Exception\CalendarEventException
|
||||
* @throws CalendarEventException
|
||||
* @throws Exception
|
||||
* @throws Throwable
|
||||
*/
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
* @since v1.3.2
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
use Jsvrcek\ICS\Exception\CalendarEventException;
|
||||
|
||||
require_once __DIR__ . '/Google.php';
|
||||
require_once __DIR__ . '/Caldav.php';
|
||||
|
||||
|
@ -133,6 +135,10 @@ class Console extends EA_Controller
|
|||
* Usage:
|
||||
*
|
||||
* php index.php console sync
|
||||
*
|
||||
* @throws CalendarEventException
|
||||
* @throws Exception
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function sync(): void
|
||||
{
|
||||
|
|
|
@ -41,7 +41,7 @@ class Google extends EA_Controller
|
|||
* needs to be relatively small, because a lot of API calls might be necessary and this will lead to consuming the
|
||||
* Google limit for the Calendar API usage.
|
||||
*/
|
||||
public static function sync(string $provider_id = null): void
|
||||
public static function sync(?string $provider_id = null): void
|
||||
{
|
||||
try {
|
||||
/** @var EA_Controller $CI */
|
||||
|
|
|
@ -54,7 +54,7 @@ class Installation extends EA_Controller
|
|||
/**
|
||||
* Installs Easy!Appointments on the server.
|
||||
*/
|
||||
public function perform()
|
||||
public function perform(): void
|
||||
{
|
||||
try {
|
||||
if (is_app_installed()) {
|
||||
|
|
|
@ -50,7 +50,7 @@ class Recovery extends EA_Controller
|
|||
/**
|
||||
* Recover the user password and notify the user via email.
|
||||
*/
|
||||
public function perform()
|
||||
public function perform(): void
|
||||
{
|
||||
try {
|
||||
$username = request('username');
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* This file can only be used in a testing environment and only from the termninal.
|
||||
* This file can only be used in a testing environment and only from the terminal.
|
||||
*/
|
||||
|
||||
if (ENVIRONMENT !== 'testing' || !is_cli()) {
|
||||
|
|
|
@ -44,7 +44,7 @@ class User extends EA_Controller
|
|||
*
|
||||
* @deprecated Since 1.5 Use the Login controller instead.
|
||||
*/
|
||||
public function login()
|
||||
public function login(): void
|
||||
{
|
||||
redirect('login');
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ class User extends EA_Controller
|
|||
*
|
||||
* @deprecated Since 1.5 Use the Logout controller instead.
|
||||
*/
|
||||
public function logout()
|
||||
public function logout(): void
|
||||
{
|
||||
redirect('logout');
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ class User extends EA_Controller
|
|||
*
|
||||
* @deprecated Since 1.5 Use the Logout controller instead.
|
||||
*/
|
||||
public function forgot_password()
|
||||
public function forgot_password(): void
|
||||
{
|
||||
redirect('recovery');
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
|
|
|
@ -79,7 +79,7 @@ class Admins_api_v1 extends EA_Controller
|
|||
*
|
||||
* @param int|null $id Admin ID.
|
||||
*/
|
||||
public function show(int $id = null): void
|
||||
public function show(?int $id = null): void
|
||||
{
|
||||
try {
|
||||
$occurrences = $this->admins_model->get(['id' => $id]);
|
||||
|
|
|
@ -65,7 +65,7 @@ class Appointments_api_v1 extends EA_Controller
|
|||
$date = request('date');
|
||||
|
||||
if (!empty($date)) {
|
||||
$where['DATE(start_datetime)'] = (new DateTime($date))->format('Y-m-d');
|
||||
$where['DATE(start_datetime)'] = new DateTime($date)->format('Y-m-d');
|
||||
}
|
||||
|
||||
// From query param.
|
||||
|
@ -73,7 +73,7 @@ class Appointments_api_v1 extends EA_Controller
|
|||
$from = request('from');
|
||||
|
||||
if (!empty($from)) {
|
||||
$where['DATE(start_datetime) >='] = (new DateTime($from))->format('Y-m-d');
|
||||
$where['DATE(start_datetime) >='] = new DateTime($from)->format('Y-m-d');
|
||||
}
|
||||
|
||||
// Till query param.
|
||||
|
@ -81,7 +81,7 @@ class Appointments_api_v1 extends EA_Controller
|
|||
$till = request('till');
|
||||
|
||||
if (!empty($till)) {
|
||||
$where['DATE(end_datetime) <='] = (new DateTime($till))->format('Y-m-d');
|
||||
$where['DATE(end_datetime) <='] = new DateTime($till)->format('Y-m-d');
|
||||
}
|
||||
|
||||
// Service ID query param.
|
||||
|
@ -150,15 +150,12 @@ class Appointments_api_v1 extends EA_Controller
|
|||
if ($aggregates) {
|
||||
$appointment['service'] = $this->services_model->find(
|
||||
$appointment['id_services'] ?? ($appointment['serviceId'] ?? null),
|
||||
true,
|
||||
);
|
||||
$appointment['provider'] = $this->providers_model->find(
|
||||
$appointment['id_users_provider'] ?? ($appointment['providerId'] ?? null),
|
||||
true,
|
||||
);
|
||||
$appointment['customer'] = $this->customers_model->find(
|
||||
$appointment['id_users_customer'] ?? ($appointment['customerId'] ?? null),
|
||||
true,
|
||||
);
|
||||
$this->services_model->api_encode($appointment['service']);
|
||||
$this->providers_model->api_encode($appointment['provider']);
|
||||
|
@ -171,7 +168,7 @@ class Appointments_api_v1 extends EA_Controller
|
|||
*
|
||||
* @param int|null $id Appointment ID.
|
||||
*/
|
||||
public function show(int $id = null): void
|
||||
public function show(?int $id = null): void
|
||||
{
|
||||
try {
|
||||
$occurrences = $this->appointments_model->get(['id' => $id]);
|
||||
|
@ -262,15 +259,15 @@ class Appointments_api_v1 extends EA_Controller
|
|||
* @param array $appointment Appointment data.
|
||||
* @param string $action Performed action ("store" or "update").
|
||||
*/
|
||||
private function notify_and_sync_appointment(array $appointment, string $action = 'store')
|
||||
private function notify_and_sync_appointment(array $appointment, string $action = 'store'): void
|
||||
{
|
||||
$manage_mode = $action === 'update';
|
||||
|
||||
$service = $this->services_model->find($appointment['id_services'], true);
|
||||
$service = $this->services_model->find($appointment['id_services']);
|
||||
|
||||
$provider = $this->providers_model->find($appointment['id_users_provider'], true);
|
||||
$provider = $this->providers_model->find($appointment['id_users_provider']);
|
||||
|
||||
$customer = $this->customers_model->find($appointment['id_users_customer'], true);
|
||||
$customer = $this->customers_model->find($appointment['id_users_customer']);
|
||||
|
||||
$settings = [
|
||||
'company_name' => setting('company_name'),
|
||||
|
@ -346,11 +343,11 @@ class Appointments_api_v1 extends EA_Controller
|
|||
|
||||
$deleted_appointment = $occurrences[0];
|
||||
|
||||
$service = $this->services_model->find($deleted_appointment['id_services'], true);
|
||||
$service = $this->services_model->find($deleted_appointment['id_services']);
|
||||
|
||||
$provider = $this->providers_model->find($deleted_appointment['id_users_provider'], true);
|
||||
$provider = $this->providers_model->find($deleted_appointment['id_users_provider']);
|
||||
|
||||
$customer = $this->customers_model->find($deleted_appointment['id_users_customer'], true);
|
||||
$customer = $this->customers_model->find($deleted_appointment['id_users_customer']);
|
||||
|
||||
$settings = [
|
||||
'company_name' => setting('company_name'),
|
||||
|
|
|
@ -77,7 +77,7 @@ class Customers_api_v1 extends EA_Controller
|
|||
*
|
||||
* @param int|null $id Customer ID.
|
||||
*/
|
||||
public function show(int $id = null): void
|
||||
public function show(?int $id = null): void
|
||||
{
|
||||
try {
|
||||
$occurrences = $this->customers_model->get(['id' => $id]);
|
||||
|
|
|
@ -77,7 +77,7 @@ class Providers_api_v1 extends EA_Controller
|
|||
*
|
||||
* @param int|null $id Provider ID.
|
||||
*/
|
||||
public function show(int $id = null): void
|
||||
public function show(?int $id = null): void
|
||||
{
|
||||
try {
|
||||
$occurrences = $this->providers_model->get(['id' => $id]);
|
||||
|
|
|
@ -77,7 +77,7 @@ class Secretaries_api_v1 extends EA_Controller
|
|||
*
|
||||
* @param int|null $id Secretary ID.
|
||||
*/
|
||||
public function show(int $id = null): void
|
||||
public function show(?int $id = null): void
|
||||
{
|
||||
try {
|
||||
$occurrences = $this->secretaries_model->get(['id' => $id]);
|
||||
|
|
|
@ -77,7 +77,7 @@ class Service_categories_api_v1 extends EA_Controller
|
|||
*
|
||||
* @param int|null $id Service-category ID.
|
||||
*/
|
||||
public function show(int $id = null): void
|
||||
public function show(?int $id = null): void
|
||||
{
|
||||
try {
|
||||
$occurrences = $this->service_categories_model->get(['id' => $id]);
|
||||
|
|
|
@ -33,7 +33,7 @@ class Services_api_v1 extends EA_Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Get an service collection.
|
||||
* Get a service collection.
|
||||
*/
|
||||
public function index(): void
|
||||
{
|
||||
|
@ -77,7 +77,7 @@ class Services_api_v1 extends EA_Controller
|
|||
*
|
||||
* @param int|null $id Service ID.
|
||||
*/
|
||||
public function show(int $id = null): void
|
||||
public function show(?int $id = null): void
|
||||
{
|
||||
try {
|
||||
$occurrences = $this->services_model->get(['id' => $id]);
|
||||
|
@ -137,7 +137,7 @@ class Services_api_v1 extends EA_Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Update an service.
|
||||
* Update a service.
|
||||
*
|
||||
* @param int $id Service ID.
|
||||
*/
|
||||
|
@ -171,7 +171,7 @@ class Services_api_v1 extends EA_Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Delete an service.
|
||||
* Delete a service.
|
||||
*
|
||||
* @param int $id Service ID.
|
||||
*/
|
||||
|
|
|
@ -77,7 +77,7 @@ class Unavailabilities_api_v1 extends EA_Controller
|
|||
*
|
||||
* @param int|null $id Unavailability ID.
|
||||
*/
|
||||
public function show(int $id = null): void
|
||||
public function show(?int $id = null): void
|
||||
{
|
||||
try {
|
||||
$occurrences = $this->unavailabilities_model->get(['id' => $id]);
|
||||
|
|
|
@ -77,7 +77,7 @@ class Webhooks_api_v1 extends EA_Controller
|
|||
*
|
||||
* @param int|null $id Webhook ID.
|
||||
*/
|
||||
public function show(int $id = null): void
|
||||
public function show(?int $id = null): void
|
||||
{
|
||||
try {
|
||||
$occurrences = $this->webhooks_model->get(['id' => $id]);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
|
|
|
@ -51,7 +51,7 @@ class EA_Input extends CI_Input
|
|||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function json(string $index = null, bool $xss_clean = false): mixed
|
||||
public function json(?string $index = null, bool $xss_clean = false): mixed
|
||||
{
|
||||
/** @var EA_Controller $CI */
|
||||
$CI = &get_instance();
|
||||
|
|
|
@ -105,7 +105,7 @@ class EA_Model extends CI_Model
|
|||
*
|
||||
* @return array Returns an array of records.
|
||||
*/
|
||||
public function get_batch($where = null, int $limit = null, int $offset = null, string $order_by = null): array
|
||||
public function get_batch($where = null, ?int $limit = null, ?int $offset = null, ?string $order_by = null): array
|
||||
{
|
||||
return $this->get($where, $limit, $offset, $order_by);
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ class EA_Security extends CI_Security
|
|||
is_string($_COOKIE[$this->_csrf_cookie_name]) &&
|
||||
hash_equals($csrf_token, $_COOKIE[$this->_csrf_cookie_name]);
|
||||
|
||||
// We kill this since we're done and we don't want to pollute the _POST array
|
||||
// We kill this since we're done, and we don't want to pollute the _POST array
|
||||
unset($_POST[$this->_csrf_token_name]);
|
||||
|
||||
// Regenerate on every submission?
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
*
|
||||
* @return string Returns the final asset URL.
|
||||
*/
|
||||
function asset_url(string $uri = '', string $protocol = null): string
|
||||
function asset_url(string $uri = '', ?string $protocol = null): string
|
||||
{
|
||||
$debug = config('debug');
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ if (!function_exists('script_vars')) {
|
|||
*
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
function script_vars(array|string $key = null, mixed $default = null): mixed
|
||||
function script_vars(array|string|null $key = null, mixed $default = null): mixed
|
||||
{
|
||||
$script_vars = config('script_vars', []);
|
||||
|
||||
|
@ -119,7 +119,7 @@ if (!function_exists('html_vars')) {
|
|||
*
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
function html_vars(array|string $key = null, mixed $default = null): mixed
|
||||
function html_vars(array|string|null $key = null, mixed $default = null): mixed
|
||||
{
|
||||
$html_vars = config('html_vars', []);
|
||||
|
||||
|
@ -164,7 +164,7 @@ if (!function_exists('vars')) {
|
|||
*
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
function vars(array|string $key = null, mixed $default = null): mixed
|
||||
function vars(array|string|null $key = null, mixed $default = null): mixed
|
||||
{
|
||||
return html_vars($key) ?? (script_vars($key) ?? $default);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ if (!function_exists('request')) {
|
|||
*
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
function request(string $key = null, $default = null): mixed
|
||||
function request(?string $key = null, $default = null): mixed
|
||||
{
|
||||
/** @var EA_Controller $CI */
|
||||
$CI = &get_instance();
|
||||
|
|
|
@ -25,7 +25,7 @@ if (!function_exists('can')) {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
function can(string $action, string $resource, int $user_id = null): bool
|
||||
function can(string $action, string $resource, ?int $user_id = null): bool
|
||||
{
|
||||
/** @var EA_Controller $CI */
|
||||
$CI = &get_instance();
|
||||
|
@ -65,7 +65,7 @@ if (!function_exists('cannot')) {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
function cannot(string $action, string $resource, int $user_id = null): bool
|
||||
function cannot(string $action, string $resource, ?int $user_id = null): bool
|
||||
{
|
||||
return !can($action, $resource, $user_id);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ if (!function_exists('session')) {
|
|||
*
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
function session(array|string $key = null, mixed $default = null): mixed
|
||||
function session(array|string|null $key = null, mixed $default = null): mixed
|
||||
{
|
||||
/** @var EA_Controller $CI */
|
||||
$CI = &get_instance();
|
||||
|
|
|
@ -32,7 +32,7 @@ if (!function_exists('setting')) {
|
|||
*
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
function setting(array|string $key = null, mixed $default = null): mixed
|
||||
function setting(array|string|null $key = null, mixed $default = null): mixed
|
||||
{
|
||||
/** @var EA_Controller $CI */
|
||||
$CI = &get_instance();
|
||||
|
|
|
@ -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,7 +97,7 @@ 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,
|
||||
|
@ -330,7 +330,7 @@ class Availability
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function get_available_periods(string $date, array $provider, int $exclude_appointment_id = null): array
|
||||
public function get_available_periods(string $date, array $provider, ?int $exclude_appointment_id = null): array
|
||||
{
|
||||
// Get the service, provider's working plan and provider appointments.
|
||||
$working_plan = json_decode($provider['settings']['working_plan'], true);
|
||||
|
|
|
@ -86,7 +86,7 @@ class Caldav_sync
|
|||
|
||||
return $caldav_event_id;
|
||||
} catch (GuzzleException $e) {
|
||||
$this->handle_guzzle_exception($e, 'Failed to save CalDAV event');
|
||||
$this->handle_guzzle_exception($e, 'Failed to save CalDAV appointment event');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ class Caldav_sync
|
|||
|
||||
return $caldav_event_id;
|
||||
} catch (GuzzleException $e) {
|
||||
$this->handle_guzzle_exception($e, 'Failed to save CalDAV event');
|
||||
$this->handle_guzzle_exception($e, 'Failed to save CalDAV unavailability event');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ class Caldav_sync
|
|||
|
||||
$client->request('DELETE', $uri);
|
||||
} catch (GuzzleException $e) {
|
||||
$this->handle_guzzle_exception($e, 'Failed to save CalDAV event');
|
||||
$this->handle_guzzle_exception($e, 'Failed to delete CalDAV event');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ class Caldav_sync
|
|||
|
||||
return $this->convert_caldav_event_to_array_event($vcalendar->VEVENT, $provider_timezone_object);
|
||||
} catch (GuzzleException $e) {
|
||||
$this->handle_guzzle_exception($e, 'Failed to save CalDAV event');
|
||||
$this->handle_guzzle_exception($e, 'Failed to get CalDAV event');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ class Caldav_sync
|
|||
$provider_timezone_object,
|
||||
);
|
||||
} catch (GuzzleException $e) {
|
||||
$this->handle_guzzle_exception($e, 'Failed to save CalDAV event');
|
||||
$this->handle_guzzle_exception($e, 'Failed to get CalDAV sync events');
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
@ -397,11 +397,14 @@ class Caldav_sync
|
|||
|
||||
$this->fetch_events($client, $start_date_time, $end_date_time);
|
||||
} catch (GuzzleException $e) {
|
||||
$this->handle_guzzle_exception($e, 'Failed to save CalDAV event');
|
||||
$this->handle_guzzle_exception($e, 'Failed to test CalDAV connection');
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
private function get_http_client_by_provider_id(int $provider_id): Client
|
||||
{
|
||||
$provider = $this->CI->providers_model->find($provider_id);
|
||||
|
|
|
@ -106,7 +106,7 @@ class Captcha_builder
|
|||
*/
|
||||
protected $allowedBackgroundImageTypes = ['image/png', 'image/jpeg', 'image/gif'];
|
||||
|
||||
public function __construct($phrase = null, PhraseBuilderInterface $builder = null)
|
||||
public function __construct($phrase = null, ?PhraseBuilderInterface $builder = null)
|
||||
{
|
||||
if ($builder === null) {
|
||||
$this->builder = new PhraseBuilder();
|
||||
|
@ -119,6 +119,7 @@ class Captcha_builder
|
|||
|
||||
/**
|
||||
* Generate the image
|
||||
* @throws Exception
|
||||
*/
|
||||
public function build($width = 150, $height = 40, $font = null, $fingerprint = null)
|
||||
{
|
||||
|
@ -135,6 +136,8 @@ class Captcha_builder
|
|||
__DIR__ . '/../../vendor/gregwar/captcha/src/Gregwar/Captcha/Font/captcha' . $this->rand(0, 5) . '.ttf';
|
||||
}
|
||||
|
||||
$bg = null;
|
||||
|
||||
if (empty($this->backgroundImages)) {
|
||||
// if background images list is not set, use a color fill as a background
|
||||
$image = imagecreatetruecolor($width, $height);
|
||||
|
|
|
@ -78,7 +78,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']);
|
||||
|
||||
|
@ -142,8 +142,8 @@ class Email_messages
|
|||
array $customer,
|
||||
array $settings,
|
||||
string $recipient_email,
|
||||
string $reason = null,
|
||||
string $timezone = null,
|
||||
?string $reason = null,
|
||||
?string $timezone = null,
|
||||
): void {
|
||||
$appointment_timezone = new DateTimeZone($provider['timezone']);
|
||||
|
||||
|
@ -222,9 +222,9 @@ class Email_messages
|
|||
* @throws Exception
|
||||
*/
|
||||
private function get_php_mailer(
|
||||
string $recipient_email = null,
|
||||
string $subject = null,
|
||||
string $html = null,
|
||||
?string $recipient_email = null,
|
||||
?string $subject = null,
|
||||
?string $html = null,
|
||||
): PHPMailer {
|
||||
$php_mailer = new PHPMailer(true);
|
||||
|
||||
|
|
|
@ -258,6 +258,8 @@ class Google_sync
|
|||
*
|
||||
* @param array $provider Provider data.
|
||||
* @param string $google_event_id The Google Calendar event ID to be removed.
|
||||
*
|
||||
* @throws \Google\Service\Exception
|
||||
*/
|
||||
public function delete_appointment(array $provider, string $google_event_id): void
|
||||
{
|
||||
|
@ -340,6 +342,8 @@ class Google_sync
|
|||
*
|
||||
* @param array $provider Provider data.
|
||||
* @param string $google_event_id Google Calendar event ID to be removed.
|
||||
*
|
||||
* @throws \Google\Service\Exception
|
||||
*/
|
||||
public function delete_unavailability(array $provider, string $google_event_id): void
|
||||
{
|
||||
|
@ -353,6 +357,8 @@ class Google_sync
|
|||
* @param string $google_event_id Google Calendar event ID.
|
||||
*
|
||||
* @return Event Returns the Google Calendar event.
|
||||
*
|
||||
* @throws \Google\Service\Exception
|
||||
*/
|
||||
public function get_event(array $provider, string $google_event_id): Event
|
||||
{
|
||||
|
@ -367,6 +373,8 @@ class Google_sync
|
|||
* @param string $end The end date of sync period.
|
||||
*
|
||||
* @return Events Returns a collection of events.
|
||||
*
|
||||
* @throws \Google\Service\Exception
|
||||
*/
|
||||
public function get_sync_events(string $google_calendar, string $start, string $end): Events
|
||||
{
|
||||
|
@ -386,6 +394,8 @@ class Google_sync
|
|||
* Google Calendar account.
|
||||
*
|
||||
* @return array Returns an array with the available calendars.
|
||||
*
|
||||
* @throws \Google\Service\Exception
|
||||
*/
|
||||
public function get_google_calendars(): array
|
||||
{
|
||||
|
|
|
@ -49,7 +49,7 @@ class Ics_provider implements Iterator
|
|||
* array key value will be passed as an argument. The closure should return an array containing the next
|
||||
* batch of items.
|
||||
*/
|
||||
public function __construct(Closure $provider = null)
|
||||
public function __construct(?Closure $provider = null)
|
||||
{
|
||||
$this->provider = $provider;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ class Migration_Specific_calendar_sync extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
$this->dbforge->add_field([
|
||||
'id' => [
|
||||
|
@ -543,7 +543,7 @@ class Migration_Specific_calendar_sync extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
$this->db->query(
|
||||
'ALTER TABLE `' .
|
||||
|
|
|
@ -18,7 +18,7 @@ class Migration_Add_google_analytics_setting extends EA_Migration
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'google_analytics_code'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -33,7 +33,7 @@ class Migration_Add_google_analytics_setting extends EA_Migration
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'google_analytics_code'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'google_analytics_code']);
|
||||
|
|
|
@ -18,7 +18,7 @@ class Migration_Add_customer_notifications_setting extends EA_Migration
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'customer_notifications'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -33,7 +33,7 @@ class Migration_Add_customer_notifications_setting extends EA_Migration
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'customer_notifications'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'customer_notifications']);
|
||||
|
|
|
@ -18,7 +18,7 @@ class Migration_Add_date_format_setting extends EA_Migration
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'date_format'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -33,7 +33,7 @@ class Migration_Add_date_format_setting extends EA_Migration
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'date_format'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'date_format']);
|
||||
|
|
|
@ -18,7 +18,7 @@ class Migration_Add_require_captcha_setting extends EA_Migration
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'require_captcha'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -33,7 +33,7 @@ class Migration_Add_require_captcha_setting extends EA_Migration
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'require_captcha'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'require_captcha']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_calendar_view_setting extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('calendar_view', 'user_settings')) {
|
||||
$fields = [
|
||||
|
@ -36,7 +36,7 @@ class Migration_Add_calendar_view_setting extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('calendar_view', 'user_settings')) {
|
||||
$this->dbforge->drop_column('user_settings', 'calendar_view');
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_service_availabilities_type extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('availabilities_type', 'services')) {
|
||||
$fields = [
|
||||
|
@ -37,7 +37,7 @@ class Migration_Add_service_availabilities_type extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('availabilities_type', 'services')) {
|
||||
$this->dbforge->drop_column('services', 'availabilities_type');
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_service_attendants_number extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('attendants_number', 'services')) {
|
||||
$fields = [
|
||||
|
@ -35,7 +35,7 @@ class Migration_Add_service_attendants_number extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('attendants_number', 'services')) {
|
||||
$this->dbforge->drop_column('services', 'attendants_number');
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Change_column_types extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
// Drop table constraints.
|
||||
$this->db->query(
|
||||
|
@ -356,7 +356,7 @@ class Migration_Change_column_types extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
// Drop table constraints.
|
||||
$this->db->query(
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_time_format_setting extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'time_format'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -29,7 +29,7 @@ class Migration_Add_time_format_setting extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'time_format'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'time_format']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Remove_prefix_from_fkey_constraints extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
// Drop table constraints.
|
||||
$this->db->query(
|
||||
|
@ -181,7 +181,7 @@ class Migration_Remove_prefix_from_fkey_constraints extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
// Drop table constraints.
|
||||
$this->db->query(
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Legal_contents extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'display_cookie_notice'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -111,7 +111,7 @@ class Migration_Legal_contents extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'display_cookie_notice'])->num_rows()) {
|
||||
$this->db->delete('settings', [
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_weekday_start_setting extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'first_weekday'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -29,7 +29,7 @@ class Migration_Add_weekday_start_setting extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'first_weekday'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'first_weekday']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Create_appointment_location_column extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('location', 'appointments')) {
|
||||
$fields = [
|
||||
|
@ -46,7 +46,7 @@ class Migration_Create_appointment_location_column extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('location', 'appointments')) {
|
||||
$this->dbforge->drop_column('appointments', 'location');
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_working_plan_exceptions_to_user_settings extends EA_Migratio
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('working_plan_exceptions', 'user_settings')) {
|
||||
$fields = [
|
||||
|
@ -34,7 +34,7 @@ class Migration_Add_working_plan_exceptions_to_user_settings extends EA_Migratio
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('working_plan_exceptions', 'user_settings')) {
|
||||
$this->dbforge->drop_column('user_settings', 'working_plan_exceptions');
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_require_phone_number_setting extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'require_phone_number'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -29,7 +29,7 @@ class Migration_Add_require_phone_number_setting extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'require_phone_number'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'require_phone_number']);
|
||||
|
|
|
@ -18,7 +18,7 @@ class Migration_Add_api_token_setting extends EA_Migration
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'api_token'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -33,7 +33,7 @@ class Migration_Add_api_token_setting extends EA_Migration
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'api_token'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'api_token']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_timezone_to_users extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('timezone', 'users')) {
|
||||
$fields = [
|
||||
|
@ -35,7 +35,7 @@ class Migration_Add_timezone_to_users extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
$this->dbforge->drop_column('users', 'timezone');
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_display_any_provider_setting extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'display_any_provider'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -29,7 +29,7 @@ class Migration_Add_display_any_provider_setting extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'display_any_provider'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'display_any_provider']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_language_to_users extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('language', 'users')) {
|
||||
$fields = [
|
||||
|
@ -35,7 +35,7 @@ class Migration_Add_language_to_users extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
$this->dbforge->drop_column('users', 'language');
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Modify_sync_period_columns extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
$fields = [
|
||||
'sync_past_days' => [
|
||||
|
@ -59,7 +59,7 @@ class Migration_Modify_sync_period_columns extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
$fields = [
|
||||
'sync_past_days' => [
|
||||
|
|
|
@ -54,7 +54,7 @@ class Migration_Add_booking_field_settings extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
foreach ($this->fields as $field => $props) {
|
||||
foreach ($props as $prop => $value) {
|
||||
|
@ -81,7 +81,7 @@ class Migration_Add_booking_field_settings extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
foreach ($this->fields as $field => $props) {
|
||||
foreach ($props as $prop => $value) {
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Rename_service_categories_table_to_categories extends EA_Migrati
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if ($this->db->table_exists('service_categories')) {
|
||||
$this->dbforge->rename_table('service_categories', 'categories');
|
||||
|
@ -26,7 +26,7 @@ class Migration_Rename_service_categories_table_to_categories extends EA_Migrati
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->table_exists('categories')) {
|
||||
$this->dbforge->rename_table('categories', 'service_categories');
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Rename_id_service_categories_column_of_services_table extends EA
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if ($this->db->field_exists('id_service_categories', 'services')) {
|
||||
$this->db->query(
|
||||
|
@ -51,7 +51,7 @@ class Migration_Rename_id_service_categories_column_of_services_table extends EA
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('id_categories', 'services')) {
|
||||
$this->db->query(
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Rename_is_unavailable_column_of_appointments_table extends EA_Mi
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if ($this->db->field_exists('is_unavailable', 'appointments')) {
|
||||
$fields = [
|
||||
|
@ -35,7 +35,7 @@ class Migration_Rename_is_unavailable_column_of_appointments_table extends EA_Mi
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('is_unavailability', 'appointments')) {
|
||||
$fields = [
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_color_column_to_services_table extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('color', 'services')) {
|
||||
$fields = [
|
||||
|
@ -35,7 +35,7 @@ class Migration_Add_color_column_to_services_table extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('color', 'services')) {
|
||||
$this->dbforge->drop_column('services', 'color');
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_color_column_to_appointments_table extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('color', 'appointments')) {
|
||||
$fields = [
|
||||
|
@ -35,7 +35,7 @@ class Migration_Add_color_column_to_appointments_table extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('color', 'appointments')) {
|
||||
$this->dbforge->drop_column('appointments', 'color');
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_matomo_analytics_url_setting extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'matomo_analytics_url'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -29,7 +29,7 @@ class Migration_Add_matomo_analytics_url_setting extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'matomo_analytics_url'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'matomo_analytics_url']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_display_delete_personal_information_setting extends EA_Migra
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'display_delete_personal_information'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -29,7 +29,7 @@ class Migration_Add_display_delete_personal_information_setting extends EA_Migra
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'display_delete_personal_information'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'display_delete_personal_information']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_disable_booking_setting extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'disable_booking'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -29,7 +29,7 @@ class Migration_Add_disable_booking_setting extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'disable_booking'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'disable_booking']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_disable_booking_message_setting extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'disable_booking_message'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -30,7 +30,7 @@ class Migration_Add_disable_booking_message_setting extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'disable_booking_message'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'disable_booking_message']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_company_logo_setting extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'company_logo'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -29,7 +29,7 @@ class Migration_Add_company_logo_setting extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'company_logo'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'company_logo']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_company_color_setting extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'company_color'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -29,7 +29,7 @@ class Migration_Add_company_color_setting extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'company_color'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'company_color']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_display_login_button_setting extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'display_login_button'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -29,7 +29,7 @@ class Migration_Add_display_login_button_setting extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'display_login_button'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'display_login_button']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_is_private_column_to_services_table extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('is_private', 'services')) {
|
||||
$fields = [
|
||||
|
@ -35,7 +35,7 @@ class Migration_Add_is_private_column_to_services_table extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('is_private', 'services')) {
|
||||
$this->dbforge->drop_column('services', 'is_private');
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_is_private_column_to_users_table extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('is_private', 'users')) {
|
||||
$fields = [
|
||||
|
@ -35,7 +35,7 @@ class Migration_Add_is_private_column_to_users_table extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('is_private', 'users')) {
|
||||
$this->dbforge->drop_column('users', 'is_private');
|
||||
|
|
|
@ -26,7 +26,7 @@ class Migration_Add_timestamp_columns extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
foreach ($this->tables as $table) {
|
||||
foreach ($this->columns as $column) {
|
||||
|
@ -48,7 +48,7 @@ class Migration_Add_timestamp_columns extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
foreach ($this->tables as $table) {
|
||||
foreach ($this->columns as $column) {
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_theme_setting extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'theme'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -29,7 +29,7 @@ class Migration_Add_theme_setting extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'theme'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'theme']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_limit_customer_access_setting extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'limit_customer_access'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -31,7 +31,7 @@ class Migration_Add_limit_customer_access_setting extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'limit_customer_access'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'limit_customer_access']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Create_webhooks_table extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->table_exists('webhooks')) {
|
||||
$this->dbforge->add_field([
|
||||
|
@ -75,7 +75,7 @@ class Migration_Create_webhooks_table extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->table_exists('webhooks')) {
|
||||
$this->dbforge->drop_table('webhooks');
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_webhooks_column_to_roles_table extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('webhooks', 'roles')) {
|
||||
$fields = [
|
||||
|
@ -38,7 +38,7 @@ class Migration_Add_webhooks_column_to_roles_table extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('webhooks', 'roles')) {
|
||||
$this->dbforge->drop_column('roles', 'webhooks');
|
||||
|
|
|
@ -22,7 +22,7 @@ class Migration_Add_future_booking_limit_setting extends CI_Migration
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'future_booking_limit'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -37,7 +37,7 @@ class Migration_Add_future_booking_limit_setting extends CI_Migration
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'future_booking_limit'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'future_booking_limit']);
|
||||
|
|
|
@ -22,7 +22,7 @@ class Migration_Add_appointment_status_options_setting extends CI_Migration
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'appointment_status_options'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -37,7 +37,7 @@ class Migration_Add_appointment_status_options_setting extends CI_Migration
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'appointment_status_options'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'status_options']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_status_column_to_appointments_table extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('status', 'appointments')) {
|
||||
$fields = [
|
||||
|
@ -35,7 +35,7 @@ class Migration_Add_status_column_to_appointments_table extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('status', 'appointments')) {
|
||||
$this->dbforge->drop_column('appointments', 'status');
|
||||
|
|
|
@ -30,7 +30,7 @@ class Migration_Drop_delete_datetime_column_from_all_tables extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
foreach ($this->tables as $table) {
|
||||
if ($this->db->field_exists('delete_datetime', $table)) {
|
||||
|
@ -42,7 +42,7 @@ class Migration_Drop_delete_datetime_column_from_all_tables extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
foreach ($this->tables as $table) {
|
||||
if (!$this->db->field_exists('delete_datetime', $table)) {
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Revert_rename_service_categories_table_to_categories extends EA_
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if ($this->db->table_exists('categories')) {
|
||||
$this->dbforge->rename_table('categories', 'service_categories');
|
||||
|
@ -26,7 +26,7 @@ class Migration_Revert_rename_service_categories_table_to_categories extends EA_
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->table_exists('service_categories')) {
|
||||
$this->dbforge->rename_table('service_categories', 'categories');
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Revert_rename_id_service_categories_column_of_services_table ext
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if ($this->db->field_exists('id_categories', 'services')) {
|
||||
$this->db->query(
|
||||
|
@ -51,7 +51,7 @@ class Migration_Revert_rename_id_service_categories_column_of_services_table ext
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('id_service_categories', 'services')) {
|
||||
$this->db->query(
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Create_blocked_periods_table extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->table_exists('blocked_periods')) {
|
||||
$this->dbforge->add_field([
|
||||
|
@ -61,7 +61,7 @@ class Migration_Create_blocked_periods_table extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->table_exists('blocked_periods')) {
|
||||
$this->dbforge->drop_table('blocked_periods');
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_blocked_periods_column_to_roles_table extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('blocked_periods', 'roles')) {
|
||||
$fields = [
|
||||
|
@ -38,7 +38,7 @@ class Migration_Add_blocked_periods_column_to_roles_table extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('blocked_periods', 'roles')) {
|
||||
$this->dbforge->drop_column('roles', 'blocked_periods');
|
||||
|
|
|
@ -21,7 +21,7 @@ class Migration_Add_custom_fields_columns_to_users_table extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
for ($i = self::FIELD_NUMBER; $i > 0; $i--) {
|
||||
$field_name = 'custom_field_' . $i;
|
||||
|
@ -43,7 +43,7 @@ class Migration_Add_custom_fields_columns_to_users_table extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
for ($i = self::FIELD_NUMBER; $i > 0; $i--) {
|
||||
$field_name = 'custom_fields_' . $i;
|
||||
|
|
|
@ -27,7 +27,7 @@ class Migration_Insert_custom_field_rows_to_settings_table extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
for ($i = 1; $i <= self::FIELD_NUMBER; $i++) {
|
||||
$field_name = 'custom_field_' . $i;
|
||||
|
@ -48,7 +48,7 @@ class Migration_Insert_custom_field_rows_to_settings_table extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
for ($i = 1; $i >= self::FIELD_NUMBER; $i++) {
|
||||
$field_name = 'custom_field_' . $i;
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_matomo_analytics_site_id_setting extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'matomo_analytics_site_id'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -29,7 +29,7 @@ class Migration_Add_matomo_analytics_site_id_setting extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'matomo_analytics_site_id'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'matomo_analytics_site_id']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_default_language_setting extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'default_language'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -29,7 +29,7 @@ class Migration_Add_default_language_setting extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'default_language'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'default_language']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_default_timezone_setting extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->get_where('settings', ['name' => 'default_timezone'])->num_rows()) {
|
||||
$this->db->insert('settings', [
|
||||
|
@ -29,7 +29,7 @@ class Migration_Add_default_timezone_setting extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'default_timezone'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'default_timezone']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_caldav_columns_to_user_settings_table extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('caldav_sync', 'user_settings')) {
|
||||
$fields = [
|
||||
|
@ -87,7 +87,7 @@ class Migration_Add_caldav_columns_to_user_settings_table extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('caldav_sync', 'user_settings')) {
|
||||
$this->dbforge->drop_column('user_settings', 'caldav_sync');
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_id_caldav_calendar_column_to_appointments_table extends EA_M
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('id_caldav_calendar', 'appointments')) {
|
||||
$fields = [
|
||||
|
@ -34,7 +34,7 @@ class Migration_Add_id_caldav_calendar_column_to_appointments_table extends EA_M
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('id_caldav_calendar', 'appointments')) {
|
||||
$this->dbforge->drop_column('appointments', 'id_caldav_calendar');
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_ldap_rows_to_settings_table extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
$now = date('Y-m-d H:i:s');
|
||||
|
||||
|
@ -101,7 +101,7 @@ class Migration_Add_ldap_rows_to_settings_table extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->get_where('settings', ['name' => 'ldap_is_active'])->num_rows()) {
|
||||
$this->db->delete('settings', ['name' => 'ldap_is_active']);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Migration_Add_ldap_dn_column_to_users_table extends EA_Migration
|
|||
/**
|
||||
* Upgrade method.
|
||||
*/
|
||||
public function up()
|
||||
public function up(): void
|
||||
{
|
||||
if (!$this->db->field_exists('ldap_dn', 'users')) {
|
||||
$fields = [
|
||||
|
@ -34,7 +34,7 @@ class Migration_Add_ldap_dn_column_to_users_table extends EA_Migration
|
|||
/**
|
||||
* Downgrade method.
|
||||
*/
|
||||
public function down()
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->db->field_exists('ldap_dn', 'users')) {
|
||||
$this->dbforge->drop_column('users', 'ldap_dn');
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue