mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-24 07:32:22 +03:00
Reformat entire codebase for trailing comma that will make line duplication easier
This commit is contained in:
parent
1ee373a544
commit
2878d1299a
218 changed files with 2763 additions and 2638 deletions
|
@ -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"]
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
@ -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',
|
||||
];
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,8 +69,8 @@ if (!function_exists('extend')) {
|
|||
'layout' => [
|
||||
'filename' => $layout,
|
||||
'sections' => [],
|
||||
'tmp' => []
|
||||
]
|
||||
'tmp' => [],
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ if (!function_exists('setting')) {
|
|||
|
||||
if (empty($setting)) {
|
||||
$setting = [
|
||||
'name' => $name
|
||||
'name' => $name,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -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'],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -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'])) {
|
||||
|
|
|
@ -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']);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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', '<strong>' . $password . '</strong>', lang('new_password_is')),
|
||||
'settings' => $settings
|
||||
'settings' => $settings,
|
||||
],
|
||||
true
|
||||
true,
|
||||
);
|
||||
|
||||
$this->CI->email->from($settings['company_email'], $settings['company_email']);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -108,7 +108,7 @@ class Ics_file
|
|||
'',
|
||||
lang('notes'),
|
||||
'',
|
||||
$appointment['notes']
|
||||
$appointment['notes'],
|
||||
];
|
||||
|
||||
$event->setDescription(implode("\\n", $description));
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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)',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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' => '',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -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',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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' => '',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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',
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
'
|
||||
',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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' => '',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class Migration_Add_disable_booking_message_setting extends EA_Migration
|
|||
$this->db->insert('settings', [
|
||||
'name' => 'disable_booking_message',
|
||||
'value' =>
|
||||
'<p style="text-align: center;">Thanks for stopping by!</p><p style="text-align: center;">We are not accepting new appointments at the moment, please check back again later.</p>'
|
||||
'<p style="text-align: center;">Thanks for stopping by!</p><p style="text-align: center;">We are not accepting new appointments at the moment, please check back again later.</p>',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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' => '',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue