forked from mirrors/easyappointments
Merge branch 'develop'
This commit is contained in:
commit
9e71255cae
103 changed files with 901 additions and 1128 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -22,7 +22,7 @@
|
|||
!/storage/sessions/.htaccess
|
||||
!/storage/sessions/index.html
|
||||
/storage/uploads/*
|
||||
/!storage/uploads/index.html
|
||||
!/storage/uploads/index.html
|
||||
/vendor/
|
||||
/metafile
|
||||
.DS_Store
|
||||
|
|
69
CHANGELOG.md
69
CHANGELOG.md
|
@ -3,8 +3,73 @@
|
|||
This file contains the code changes that were introduced into each release (starting from v1.1.0) so that is easy for
|
||||
developers to maintain and readjust their custom modifications on the main project codebase.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
## [1.4.0] - TBA
|
||||
|
||||
### Added
|
||||
|
||||
- #203: Appointment location / 12-hour format / sync notes and location in Google Calendar.
|
||||
- #221: Fixed/Improved sort breaks increasingly by hour within day.
|
||||
- #247: Add new system-wide setting for removing the "Any Provider" option of the booking page.
|
||||
- #251: Automatically populate the appointment end datetime in API.
|
||||
- #301: Automatically reload the backend calendar events.
|
||||
- #313: How to set the timezone from the user booking the appointment.
|
||||
- #365: Only allow appointments for a few weeks in advance.
|
||||
- #431: Add support for working plan exceptions.
|
||||
- #471: Add new system-wide setting that enable users to choose the first day of the week.
|
||||
- #496: Add pagination on every backend page in order to make filter requests faster.
|
||||
- #501: Integrate script for assets minification.
|
||||
- #502: Config::DEBUG value toggles the use of normal or minified asset files.
|
||||
- #546: Add appointment edit link in the backend customers page.
|
||||
- #550: Multi-Lang Front-End selection popup not working on mobile.
|
||||
- #551: Front-End booking calendar not syncing with business logic working plan.
|
||||
- #572: Ensure the database structure is compatible to at least MySQL 5.5.
|
||||
- #576: Appointment cancelled exception not showing properly.
|
||||
- #610: Token based authentication for the Rest API.
|
||||
- #648: Add a warning when customers delete their personal information.
|
||||
- #655: Creating an appointment requires user to enter their phone number enhancement.
|
||||
- #659: Automatically detect browser language enhancement.
|
||||
- #663: Language selector not working under legacy iOS (v.10.3.1).
|
||||
- #680: Generate new password in the generate_random_string function may create duplicate passwords, plus it is not secure enough.
|
||||
- #739: Enhance the table view mode by replacing the tables with fullcalendar instances.
|
||||
- #770: Store customer's language and use it with notifications or when the customer manages and existing appointment.
|
||||
- #889: Notify admins and secretaries on appointment changes.
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- #386: Service price should be optional.
|
||||
- #428: Enable book advance timeout values in days.
|
||||
- #568: Sort providers alphabetically in the booking page.
|
||||
- #745: Add appointment notes preview in the event popover.
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
- #171: Google calendar sync - wrong timezone for appointments.
|
||||
- #195: Fix Google calendar sync activation error (JavaScript).
|
||||
- #298: Provider availability issue when selecting the "Any Provider" option.
|
||||
- #396: Start and end time do not update correctly during calendar time selection on iPad (and other Safari based devices).
|
||||
- #447: Captcha error using docker (500 error).
|
||||
- #506: Working plan created in version v1.2.1 wrongly displayed in backend with version v1.3.1.
|
||||
- #507: Need to manually clean the cache when migrating from v1.2.1 to v1.3.1.
|
||||
- #541: Can't remove (empty) customer notes field.
|
||||
- #549: Querying appointments API endpoint with the q parmeter produces PHP warnings.
|
||||
- #557: App not connecting to MySQL with fresh docker run.
|
||||
- #562: Unavailability periods with length of more than 1 day are not handled correctly.
|
||||
- #563: Description field overflows with long text.
|
||||
- #600: Unable to select Language on mobile phones.
|
||||
- #611: Double replacement when using translation to other languages.
|
||||
- #664: Easy!Appointments v1.3.2 allows sensitive information disclosure (username and password hash).
|
||||
- #687: Errors when the provider modifies an appointment.
|
||||
- #705: The alert notification of the installation is not being displayed on error.
|
||||
- #757: Corrected display of datetimepickers when editing events.
|
||||
- #801: Invalid time duration during appointment registration could lead to DOS of the service.
|
||||
- #813: Hyperlinks are not being displayed correctly inside legal contents (they are escaped).
|
||||
- #839: Provider is missing on appointment modal opened after a click on the link sent with the provider email confirmation.
|
||||
- #840: Start/end datetime are not correctly initialized on Safari when the appointment modal is opened after a click in the backend calendar.
|
||||
- #883: Appointment date is wrongly changed to today in some case.
|
||||
- #903: Notification not working when creating/updating/deleting an appointment from the REST API.
|
||||
|
||||
|
||||
## [1.3.2] - 2018-07-29
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<br>
|
||||
|
||||
<h4 align="center">
|
||||
A powerful Open Source Web Scheduler that can be installed on your server.
|
||||
A powerful Open Source Appointment Scheduler that can be installed on your server.
|
||||
</h4>
|
||||
|
||||
<p align="center">
|
||||
|
|
|
@ -185,7 +185,7 @@ $config['enable_hooks'] = TRUE;
|
|||
| http://codeigniter.com/user_guide/general/creating_libraries.html
|
||||
|
|
||||
*/
|
||||
$config['subclass_prefix'] = 'MY_';
|
||||
$config['subclass_prefix'] = 'EA_';
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -6,42 +6,17 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.0.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Appointments Controller
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
* @property Timezones $timezones
|
||||
* @property Synchronization $synchronization
|
||||
* @property Notifications $notifications
|
||||
* @property Availability $availability
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Appointments extends CI_Controller {
|
||||
class Appointments extends EA_Controller {
|
||||
/**
|
||||
* Class Constructor
|
||||
*/
|
||||
|
@ -51,6 +26,7 @@ class Appointments extends CI_Controller {
|
|||
|
||||
$this->load->helper('installation');
|
||||
$this->load->helper('google_analytics');
|
||||
|
||||
$this->load->model('appointments_model');
|
||||
$this->load->model('providers_model');
|
||||
$this->load->model('admins_model');
|
||||
|
@ -58,12 +34,15 @@ class Appointments extends CI_Controller {
|
|||
$this->load->model('services_model');
|
||||
$this->load->model('customers_model');
|
||||
$this->load->model('settings_model');
|
||||
|
||||
$this->load->library('session');
|
||||
$this->load->library('timezones');
|
||||
$this->load->library('synchronization');
|
||||
$this->load->library('notifications');
|
||||
$this->load->library('availability');
|
||||
|
||||
$this->load->driver('cache', ['adapter' => 'file']);
|
||||
|
||||
if ($this->session->userdata('language'))
|
||||
{
|
||||
// Set the user's selected language.
|
||||
|
@ -175,8 +154,6 @@ class Appointments extends CI_Controller {
|
|||
|
||||
$customer_token = md5(uniqid(mt_rand(), TRUE));
|
||||
|
||||
$this->load->driver('cache', ['adapter' => 'file']);
|
||||
|
||||
// Save the token for 10 minutes.
|
||||
$this->cache->save('customer-token-' . $customer_token, $customer['id'], 600);
|
||||
}
|
||||
|
@ -307,7 +284,6 @@ class Appointments extends CI_Controller {
|
|||
unset($appointment['notes']);
|
||||
|
||||
$provider = $this->providers_model->get_row($appointment['id_users_provider']);
|
||||
unset($provider['settings'], $provider['notes']);
|
||||
|
||||
$service = $this->services_model->get_row($appointment['id_services']);
|
||||
|
||||
|
@ -318,7 +294,13 @@ class Appointments extends CI_Controller {
|
|||
|
||||
$view = [
|
||||
'appointment_data' => $appointment,
|
||||
'provider_data' => $provider,
|
||||
'provider_data' => [
|
||||
'id' => $provider['id'],
|
||||
'first_name' => $provider['first_name'],
|
||||
'last_name' => $provider['last_name'],
|
||||
'email' => $provider['email'],
|
||||
'timezone' => $provider['timezone'],
|
||||
],
|
||||
'service_data' => $service,
|
||||
'company_name' => $company_name,
|
||||
];
|
||||
|
@ -365,7 +347,7 @@ class Appointments extends CI_Controller {
|
|||
// that will provide the requested service.
|
||||
if ($provider_id === ANY_PROVIDER)
|
||||
{
|
||||
$provider_id = $this->search_any_provider($service_id, $selected_date);
|
||||
$provider_id = $this->search_any_provider($selected_date, $service_id);
|
||||
|
||||
if ($provider_id === NULL)
|
||||
{
|
||||
|
@ -451,16 +433,6 @@ class Appointments extends CI_Controller {
|
|||
{
|
||||
try
|
||||
{
|
||||
$this->load->model('appointments_model');
|
||||
$this->load->model('providers_model');
|
||||
$this->load->model('admins_model');
|
||||
$this->load->model('secretaries_model');
|
||||
$this->load->model('services_model');
|
||||
$this->load->model('customers_model');
|
||||
$this->load->model('settings_model');
|
||||
$this->load->library('notifications');
|
||||
$this->load->library('synchronization');
|
||||
|
||||
$post_data = $this->input->post('post_data');
|
||||
$captcha = $this->input->post('captcha');
|
||||
$manage_mode = filter_var($post_data['manage_mode'], FILTER_VALIDATE_BOOLEAN);
|
||||
|
@ -578,23 +550,15 @@ class Appointments extends CI_Controller {
|
|||
|
||||
$provider = $this->providers_model->get_row($appointment['id_users_provider']);
|
||||
|
||||
$available_periods = $this->availability->get_available_periods($date, $provider, $exclude_appointment_id);
|
||||
$available_hours = $this->availability->get_available_hours($date, $service, $provider, $exclude_appointment_id);
|
||||
|
||||
$is_still_available = FALSE;
|
||||
|
||||
foreach ($available_periods as $available_period)
|
||||
$appointment_hour = date('H:i', strtotime($appointment['start_datetime']));
|
||||
|
||||
foreach ($available_hours as $available_hour)
|
||||
{
|
||||
$appointment_start = new DateTime($appointment['start_datetime']);
|
||||
$appointment_start = $appointment_start->format('H:i');
|
||||
|
||||
$appointment_end = new DateTime($appointment['start_datetime']);
|
||||
$appointment_end->add(new DateInterval('PT' . $service['duration'] . 'M'));
|
||||
$appointment_end = $appointment_end->format('H:i');
|
||||
|
||||
$available_period_start = date('H:i', strtotime($available_period['start']));
|
||||
$available_period_end = date('H:i', strtotime($available_period['end']));
|
||||
|
||||
if ($available_period_start <= $appointment_start && $available_period_end >= $appointment_end)
|
||||
if ($appointment_hour === $available_hour)
|
||||
{
|
||||
$is_still_available = TRUE;
|
||||
break;
|
||||
|
@ -617,9 +581,6 @@ class Appointments extends CI_Controller {
|
|||
{
|
||||
try
|
||||
{
|
||||
$this->load->model('providers_model');
|
||||
$this->load->model('services_model');
|
||||
|
||||
$provider_id = $this->input->get('provider_id');
|
||||
$service_id = $this->input->get('service_id');
|
||||
$appointment_id = $this->input->get_post('appointment_id');
|
||||
|
@ -702,7 +663,6 @@ class Appointments extends CI_Controller {
|
|||
*/
|
||||
protected function search_providers_by_service($service_id)
|
||||
{
|
||||
$this->load->model('providers_model');
|
||||
$available_providers = $this->providers_model->get_available_providers();
|
||||
$provider_list = [];
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.0.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -15,37 +15,30 @@
|
|||
* Backend Controller
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Backend extends CI_Controller {
|
||||
class Backend extends EA_Controller {
|
||||
/**
|
||||
* Class Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('appointments_model');
|
||||
$this->load->model('providers_model');
|
||||
$this->load->model('services_model');
|
||||
$this->load->model('customers_model');
|
||||
$this->load->model('settings_model');
|
||||
$this->load->model('roles_model');
|
||||
$this->load->model('user_model');
|
||||
$this->load->model('secretaries_model');
|
||||
$this->load->model('admins_model');
|
||||
|
||||
$this->load->library('timezones');
|
||||
$this->load->library('session');
|
||||
$this->load->library('migration');
|
||||
|
||||
if ($this->session->userdata('language'))
|
||||
{
|
||||
|
@ -80,16 +73,6 @@ class Backend extends CI_Controller {
|
|||
return;
|
||||
}
|
||||
|
||||
$this->load->model('appointments_model');
|
||||
$this->load->model('providers_model');
|
||||
$this->load->model('services_model');
|
||||
$this->load->model('customers_model');
|
||||
$this->load->model('settings_model');
|
||||
$this->load->model('roles_model');
|
||||
$this->load->model('user_model');
|
||||
$this->load->model('secretaries_model');
|
||||
$this->load->library('timezones');
|
||||
|
||||
$calendar_view_query_param = $this->input->get('view');
|
||||
|
||||
$user_id = $this->session->userdata('user_id');
|
||||
|
@ -196,9 +179,6 @@ class Backend extends CI_Controller {
|
|||
*/
|
||||
protected function set_user_data(&$view)
|
||||
{
|
||||
$this->load->model('roles_model');
|
||||
|
||||
// Get privileges
|
||||
$view['user_id'] = $this->session->userdata('user_id');
|
||||
$view['user_email'] = $this->session->userdata('user_email');
|
||||
$view['timezone'] = $this->session->userdata('timezone');
|
||||
|
@ -220,14 +200,6 @@ class Backend extends CI_Controller {
|
|||
return;
|
||||
}
|
||||
|
||||
$this->load->model('providers_model');
|
||||
$this->load->model('customers_model');
|
||||
$this->load->model('secretaries_model');
|
||||
$this->load->model('services_model');
|
||||
$this->load->model('settings_model');
|
||||
$this->load->model('user_model');
|
||||
$this->load->library('timezones');
|
||||
|
||||
$view['base_url'] = $this->config->item('base_url');
|
||||
$view['page_title'] = lang('customers');
|
||||
$view['user_display_name'] = $this->user_model->get_user_display_name($this->session->userdata('user_id'));
|
||||
|
@ -276,12 +248,6 @@ class Backend extends CI_Controller {
|
|||
return;
|
||||
}
|
||||
|
||||
$this->load->model('customers_model');
|
||||
$this->load->model('services_model');
|
||||
$this->load->model('settings_model');
|
||||
$this->load->model('user_model');
|
||||
$this->load->library('timezones');
|
||||
|
||||
$view['base_url'] = $this->config->item('base_url');
|
||||
$view['page_title'] = lang('services');
|
||||
$view['user_display_name'] = $this->user_model->get_user_display_name($this->session->userdata('user_id'));
|
||||
|
@ -315,14 +281,6 @@ class Backend extends CI_Controller {
|
|||
return;
|
||||
}
|
||||
|
||||
$this->load->model('providers_model');
|
||||
$this->load->model('secretaries_model');
|
||||
$this->load->model('admins_model');
|
||||
$this->load->model('services_model');
|
||||
$this->load->model('settings_model');
|
||||
$this->load->model('user_model');
|
||||
$this->load->library('timezones');
|
||||
|
||||
$view['base_url'] = $this->config->item('base_url');
|
||||
$view['page_title'] = lang('users');
|
||||
$view['user_display_name'] = $this->user_model->get_user_display_name($this->session->userdata('user_id'));
|
||||
|
@ -361,11 +319,6 @@ class Backend extends CI_Controller {
|
|||
return;
|
||||
}
|
||||
|
||||
$this->load->model('settings_model');
|
||||
$this->load->model('user_model');
|
||||
$this->load->library('timezones');
|
||||
|
||||
$this->load->library('session');
|
||||
$user_id = $this->session->userdata('user_id');
|
||||
|
||||
$view['base_url'] = $this->config->item('base_url');
|
||||
|
@ -412,8 +365,6 @@ class Backend extends CI_Controller {
|
|||
throw new Exception('You do not have the required privileges for this task!');
|
||||
}
|
||||
|
||||
$this->load->library('migration');
|
||||
|
||||
if ( ! $this->migration->current())
|
||||
{
|
||||
throw new Exception($this->migration->error_string());
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.0.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -21,33 +21,9 @@ use EA\Engine\Types\Url;
|
|||
*
|
||||
* Contains all the backend AJAX callbacks.
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Synchronization $synchronization
|
||||
* @property Notifications $notifications
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Backend_api extends CI_Controller {
|
||||
class Backend_api extends EA_Controller {
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
|
@ -455,7 +431,7 @@ class Backend_api extends CI_Controller {
|
|||
|
||||
if ((bool)$send_provider === TRUE)
|
||||
{
|
||||
$email->sendDeleteAppointment($appointment, $provider,
|
||||
$email->send_delete_appointment($appointment, $provider,
|
||||
$service, $customer, $settings, new Email($provider['email']),
|
||||
new Text($this->input->post('delete_reason')));
|
||||
}
|
||||
|
@ -464,7 +440,7 @@ class Backend_api extends CI_Controller {
|
|||
|
||||
if ((bool)$send_customer === TRUE)
|
||||
{
|
||||
$email->sendDeleteAppointment($appointment, $provider,
|
||||
$email->send_delete_appointment($appointment, $provider,
|
||||
$service, $customer, $settings, new Email($customer['email']),
|
||||
new Text($this->input->post('delete_reason')));
|
||||
}
|
||||
|
@ -479,7 +455,7 @@ class Backend_api extends CI_Controller {
|
|||
continue;
|
||||
}
|
||||
|
||||
$email->sendDeleteAppointment($appointment, $provider,
|
||||
$email->send_delete_appointment($appointment, $provider,
|
||||
$service, $customer, $settings, new Email($admin['email']),
|
||||
new Text($this->input->post('cancel_reason')));
|
||||
}
|
||||
|
@ -499,7 +475,7 @@ class Backend_api extends CI_Controller {
|
|||
continue;
|
||||
}
|
||||
|
||||
$email->sendDeleteAppointment($appointment, $provider,
|
||||
$email->send_delete_appointment($appointment, $provider,
|
||||
$service, $customer, $settings, new Email($secretary['email']),
|
||||
new Text($this->input->post('cancel_reason')));
|
||||
}
|
||||
|
@ -1565,7 +1541,15 @@ class Backend_api extends CI_Controller {
|
|||
|
||||
$this->load->model('user_model');
|
||||
|
||||
$this->user_model->save_user(json_decode($this->input->post('settings'), TRUE));
|
||||
$settings = json_decode($this->input->post('settings'), TRUE);
|
||||
|
||||
$this->user_model->save_user($settings);
|
||||
|
||||
$this->session->set_userdata([
|
||||
'user_email' => $settings['email'],
|
||||
'username' => $settings['settings']['username'],
|
||||
'timezone' => $settings['timezone'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,39 +6,17 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.0.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Captcha Controller
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Captcha extends CI_Controller {
|
||||
class Captcha extends EA_Controller {
|
||||
/**
|
||||
* Class Constructor
|
||||
*/
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.3.2
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -16,32 +16,9 @@
|
|||
*
|
||||
* Handles user consent related operations.
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Consents_Model consents_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Consents extends CI_Controller {
|
||||
class Consents extends EA_Controller {
|
||||
/**
|
||||
* Save the user's consent.
|
||||
*/
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.3.2
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -17,11 +17,8 @@ require_once __DIR__ .'/Google.php';
|
|||
* Class Console
|
||||
*
|
||||
* CLI commands of Easy!Appointments, can only be executed from a terminal and not with a direct request.
|
||||
*
|
||||
* @property CI_Migration $migration
|
||||
* @property Providers_model $providers_model
|
||||
*/
|
||||
class Console extends CI_Controller {
|
||||
class Console extends EA_Controller {
|
||||
/**
|
||||
* Console constructor.
|
||||
*/
|
||||
|
|
|
@ -6,39 +6,17 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.0.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Errors Controller
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Errors extends CI_Controller {
|
||||
class Errors extends EA_Controller {
|
||||
/**
|
||||
* Class Constructor
|
||||
*/
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.0.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -16,31 +16,9 @@
|
|||
*
|
||||
* This controller handles the Google Calendar synchronization operations.
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Google extends CI_Controller {
|
||||
class Google extends EA_Controller {
|
||||
/**
|
||||
* Class Constructor
|
||||
*/
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.1.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -16,32 +16,9 @@
|
|||
*
|
||||
* This controller will handle the installation procedure of Easy!Appointments.
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property CI_Migration migration
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Installation extends CI_Controller {
|
||||
class Installation extends EA_Controller {
|
||||
/**
|
||||
* Class Constructor
|
||||
*/
|
||||
|
@ -72,7 +49,7 @@ class Installation extends CI_Controller {
|
|||
{
|
||||
if (is_app_installed())
|
||||
{
|
||||
redirect('appointments/index');
|
||||
redirect('appointments');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,39 +6,17 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.3.2
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Class Privacy
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Privacy extends CI_Controller {
|
||||
class Privacy extends EA_Controller {
|
||||
/**
|
||||
* Remove all customer data (including appointments from the system).
|
||||
*/
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.0.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -18,31 +18,9 @@ use EA\Engine\Types\NonEmptyText;
|
|||
/**
|
||||
* User Controller
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class User extends CI_Controller {
|
||||
class User extends EA_Controller {
|
||||
/**
|
||||
* Class Constructor
|
||||
*/
|
||||
|
@ -226,7 +204,7 @@ class User extends CI_Controller {
|
|||
'company_email' => $this->settings_model->get_setting('company_email')
|
||||
];
|
||||
|
||||
$email->sendPassword(new NonEmptyText($new_password), new Email($this->input->post('email')),
|
||||
$email->send_password(new NonEmptyText($new_password), new Email($this->input->post('email')),
|
||||
$company_settings);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.2.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -22,7 +22,7 @@ use EA\Engine\Types\NonEmptyText;
|
|||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class API_V1_Controller extends CI_Controller {
|
||||
class API_V1_Controller extends EA_Controller {
|
||||
/**
|
||||
* Class Constructor
|
||||
*
|
||||
|
@ -150,7 +150,7 @@ class API_V1_Controller extends CI_Controller {
|
|||
];
|
||||
|
||||
$header = $exception instanceof \EA\Engine\Api\V1\Exception
|
||||
? $exception->getCode() . ' ' . $exception->getHeader()
|
||||
? $exception->getCode() . ' ' . $exception->get_header()
|
||||
: '500 Internal Server Error';
|
||||
|
||||
header('HTTP/1.0 ' . $header);
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.2.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -20,28 +20,6 @@ use EA\Engine\Types\NonEmptyText;
|
|||
/**
|
||||
* Admins Controller
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Admins extends API_V1_Controller {
|
||||
|
@ -105,7 +83,7 @@ class Admins extends API_V1_Controller {
|
|||
{
|
||||
// Insert the admin to the database.
|
||||
$request = new Request();
|
||||
$admin = $request->getBody();
|
||||
$admin = $request->get_body();
|
||||
$this->parser->decode($admin);
|
||||
|
||||
if (isset($admin['id']))
|
||||
|
@ -145,7 +123,7 @@ class Admins extends API_V1_Controller {
|
|||
}
|
||||
|
||||
$request = new Request();
|
||||
$updatedAdmin = $request->getBody();
|
||||
$updatedAdmin = $request->get_body();
|
||||
$baseAdmin = $batch[0];
|
||||
$this->parser->decode($updatedAdmin, $baseAdmin);
|
||||
$updatedAdmin['id'] = $id;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.2.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -20,30 +20,6 @@ use EA\Engine\Types\NonEmptyText;
|
|||
/**
|
||||
* Appointments Controller
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Notifications $notifications
|
||||
* @property Synchronization $synchronization
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Appointments extends API_V1_Controller {
|
||||
|
@ -121,7 +97,7 @@ class Appointments extends API_V1_Controller {
|
|||
{
|
||||
// Insert the appointment to the database.
|
||||
$request = new Request();
|
||||
$appointment = $request->getBody();
|
||||
$appointment = $request->get_body();
|
||||
$this->parser->decode($appointment);
|
||||
|
||||
if (isset($appointment['id']))
|
||||
|
@ -188,7 +164,7 @@ class Appointments extends API_V1_Controller {
|
|||
}
|
||||
|
||||
$request = new Request();
|
||||
$updated_appointment = $request->getBody();
|
||||
$updated_appointment = $request->get_body();
|
||||
$base_appointment = $batch[0];
|
||||
$this->parser->decode($updated_appointment, $base_appointment);
|
||||
$updated_appointment['id'] = $id;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.2.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -19,28 +19,6 @@ use EA\Engine\Types\UnsignedInteger;
|
|||
/**
|
||||
* Availabilities Controller
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Availabilities extends API_V1_Controller {
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.2.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -20,28 +20,6 @@ use EA\Engine\Types\NonEmptyText;
|
|||
/**
|
||||
* Categories Controller
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Categories extends API_V1_Controller {
|
||||
|
@ -71,7 +49,7 @@ class Categories extends API_V1_Controller {
|
|||
{
|
||||
try
|
||||
{
|
||||
$condition = $id !== NULL ? 'id = ' . $id : '';
|
||||
$condition = $id !== NULL ? 'id = ' . $id : NULL;
|
||||
$categories = $this->services_model->get_all_categories($condition);
|
||||
|
||||
if ($id !== NULL && count($categories) === 0)
|
||||
|
@ -105,7 +83,7 @@ class Categories extends API_V1_Controller {
|
|||
{
|
||||
// Insert the category to the database.
|
||||
$request = new Request();
|
||||
$category = $request->getBody();
|
||||
$category = $request->get_body();
|
||||
$this->parser->decode($category);
|
||||
|
||||
if (isset($category['id']))
|
||||
|
@ -145,7 +123,7 @@ class Categories extends API_V1_Controller {
|
|||
}
|
||||
|
||||
$request = new Request();
|
||||
$updated_category = $request->getBody();
|
||||
$updated_category = $request->get_body();
|
||||
$base_category = $batch[0];
|
||||
$this->parser->decode($updated_category, $base_category);
|
||||
$updated_category['id'] = $id;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.2.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -20,28 +20,6 @@ use EA\Engine\Types\NonEmptyText;
|
|||
/**
|
||||
* Customers Controller
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Customers extends API_V1_Controller {
|
||||
|
@ -105,7 +83,7 @@ class Customers extends API_V1_Controller {
|
|||
{
|
||||
// Insert the customer to the database.
|
||||
$request = new Request();
|
||||
$customer = $request->getBody();
|
||||
$customer = $request->get_body();
|
||||
$this->parser->decode($customer);
|
||||
|
||||
if (isset($customer['id']))
|
||||
|
@ -145,7 +123,7 @@ class Customers extends API_V1_Controller {
|
|||
}
|
||||
|
||||
$request = new Request();
|
||||
$updated_customer = $request->getBody();
|
||||
$updated_customer = $request->get_body();
|
||||
$base_customer = $batch[0];
|
||||
$this->parser->decode($updated_customer, $base_customer);
|
||||
$updated_customer['id'] = $id;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.2.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -20,28 +20,6 @@ use EA\Engine\Types\NonEmptyText;
|
|||
/**
|
||||
* Providers Controller
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Providers extends API_V1_Controller {
|
||||
|
@ -105,7 +83,7 @@ class Providers extends API_V1_Controller {
|
|||
{
|
||||
// Insert the provider to the database.
|
||||
$request = new Request();
|
||||
$provider = $request->getBody();
|
||||
$provider = $request->get_body();
|
||||
$this->parser->decode($provider);
|
||||
|
||||
if (isset($provider['id']))
|
||||
|
@ -145,7 +123,7 @@ class Providers extends API_V1_Controller {
|
|||
}
|
||||
|
||||
$request = new Request();
|
||||
$updated_provider = $request->getBody();
|
||||
$updated_provider = $request->get_body();
|
||||
$base_provider = $batch[0];
|
||||
$this->parser->decode($updated_provider, $base_provider);
|
||||
$updated_provider['id'] = $id;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.2.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -20,28 +20,6 @@ use EA\Engine\Types\NonEmptyText;
|
|||
/**
|
||||
* Secretaries Controller
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Secretaries extends API_V1_Controller {
|
||||
|
@ -105,7 +83,7 @@ class Secretaries extends API_V1_Controller {
|
|||
{
|
||||
// Insert the secretary to the database.
|
||||
$request = new Request();
|
||||
$secretary = $request->getBody();
|
||||
$secretary = $request->get_body();
|
||||
$this->parser->decode($secretary);
|
||||
|
||||
if (isset($secretary['id']))
|
||||
|
@ -145,7 +123,7 @@ class Secretaries extends API_V1_Controller {
|
|||
}
|
||||
|
||||
$request = new Request();
|
||||
$updated_secretary = $request->getBody();
|
||||
$updated_secretary = $request->get_body();
|
||||
$base_secretary = $batch[0];
|
||||
$this->parser->decode($updated_secretary, $base_secretary);
|
||||
$updated_secretary['id'] = $id;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.2.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -20,28 +20,6 @@ use EA\Engine\Types\NonEmptyText;
|
|||
/**
|
||||
* Services Controller
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Services extends API_V1_Controller {
|
||||
|
@ -105,7 +83,7 @@ class Services extends API_V1_Controller {
|
|||
{
|
||||
// Insert the service to the database.
|
||||
$request = new Request();
|
||||
$service = $request->getBody();
|
||||
$service = $request->get_body();
|
||||
$this->parser->decode($service);
|
||||
|
||||
if (isset($service['id']))
|
||||
|
@ -145,7 +123,7 @@ class Services extends API_V1_Controller {
|
|||
}
|
||||
|
||||
$request = new Request();
|
||||
$updated_service = $request->getBody();
|
||||
$updated_service = $request->get_body();
|
||||
$base_service = $batch[0];
|
||||
$this->parser->decode($updated_service, $base_service);
|
||||
$updated_service['id'] = $id;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.2.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -19,28 +19,6 @@ use EA\Engine\Api\V1\Response;
|
|||
/**
|
||||
* Settings Controller
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Settings extends API_V1_Controller {
|
||||
|
@ -124,7 +102,7 @@ class Settings extends API_V1_Controller {
|
|||
try
|
||||
{
|
||||
$request = new Request();
|
||||
$value = $request->getBody()['value'];
|
||||
$value = $request->get_body()['value'];
|
||||
$this->settings_model->set_setting($name, $value);
|
||||
|
||||
// Fetch the updated object from the database and return it to the client.
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link http://easyappointments.org
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.2.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -20,28 +20,6 @@ use EA\Engine\Types\NonEmptyText;
|
|||
/**
|
||||
* Unavailabilities Controller
|
||||
*
|
||||
* @property CI_Session $session
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Security $security
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Appointments_Model $appointments_model
|
||||
* @property Providers_Model $providers_model
|
||||
* @property Services_Model $services_model
|
||||
* @property Customers_Model $customers_model
|
||||
* @property Settings_Model $settings_model
|
||||
* @property Timezones $timezones
|
||||
* @property Roles_Model $roles_model
|
||||
* @property Secretaries_Model $secretaries_model
|
||||
* @property Admins_Model $admins_model
|
||||
* @property User_Model $user_model
|
||||
*
|
||||
* @package Controllers
|
||||
*/
|
||||
class Unavailabilities extends API_V1_Controller {
|
||||
|
@ -105,7 +83,7 @@ class Unavailabilities extends API_V1_Controller {
|
|||
{
|
||||
// Insert the appointment to the database.
|
||||
$request = new Request();
|
||||
$unavailability = $request->getBody();
|
||||
$unavailability = $request->get_body();
|
||||
$this->parser->decode($unavailability);
|
||||
|
||||
if (isset($unavailability['id']))
|
||||
|
@ -145,7 +123,7 @@ class Unavailabilities extends API_V1_Controller {
|
|||
}
|
||||
|
||||
$request = new Request();
|
||||
$updatedUnavailability = $request->getBody();
|
||||
$updatedUnavailability = $request->get_body();
|
||||
$baseUnavailability = $batch[0];
|
||||
$this->parser->decode($updatedUnavailability, $baseUnavailability);
|
||||
$updatedUnavailability['id'] = $id;
|
||||
|
|
48
application/core/EA_Controller.php
Normal file
48
application/core/EA_Controller.php
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Easy!Appointments - Open Source Web Scheduler
|
||||
*
|
||||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.4.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Class MY_Controller
|
||||
*
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Session $session
|
||||
* @property CI_Security $security
|
||||
* @property CI_Migration $migration
|
||||
|
||||
* @property Admins_model $admins_model
|
||||
* @property Appointments_model $appointments_model
|
||||
* @property Consents_model $consents_model
|
||||
* @property Customers_model $customers_model
|
||||
* @property Providers_model $providers_model
|
||||
* @property Roles_model $roles_model
|
||||
* @property Secretaries_model $secretaries_model
|
||||
* @property Services_model $services_model
|
||||
* @property Settings_model $settings_model
|
||||
* @property User_model $user_model
|
||||
*
|
||||
* @property Availability $availability
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Notifications $notifications
|
||||
* @property Synchronization $synchronization
|
||||
* @property Timezones $timezones
|
||||
*/
|
||||
class EA_Controller extends CI_Controller {
|
||||
//
|
||||
}
|
48
application/core/EA_Model.php
Normal file
48
application/core/EA_Model.php
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Easy!Appointments - Open Source Web Scheduler
|
||||
*
|
||||
* @package EasyAppointments
|
||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||
* @link https://easyappointments.org
|
||||
* @since v1.4.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Class MY_Model
|
||||
*
|
||||
* @property CI_Loader $load
|
||||
* @property CI_Input $input
|
||||
* @property CI_Output $output
|
||||
* @property CI_Config $config
|
||||
* @property CI_Lang $lang
|
||||
* @property CI_Cache $cache
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Session $session
|
||||
* @property CI_Security $security
|
||||
* @property CI_Migration $migration
|
||||
*
|
||||
* @property Admins_model $admins_model
|
||||
* @property Appointments_model $appointments_model
|
||||
* @property Consents_model $consents_model
|
||||
* @property Customers_model $customers_model
|
||||
* @property Providers_model $providers_model
|
||||
* @property Roles_model $roles_model
|
||||
* @property Secretaries_model $secretaries_model
|
||||
* @property Services_model $services_model
|
||||
* @property Settings_model $settings_model
|
||||
* @property User_model $user_model
|
||||
*
|
||||
* @property Availability $availability
|
||||
* @property Google_Sync $google_sync
|
||||
* @property Ics_file $ics_file
|
||||
* @property Notifications $notifications
|
||||
* @property Synchronization $synchronization
|
||||
* @property Timezones $timezones
|
||||
*/
|
||||
class EA_Model extends CI_Model {
|
||||
//
|
||||
}
|
|
@ -166,7 +166,7 @@ $lang['go_to_booking_page'] = 'Gehe zu Buchungsseite';
|
|||
$lang['settings_saved'] = 'Einstellungen erfolgreich gesichert.';
|
||||
$lang['general'] = 'Allgemeines';
|
||||
$lang['business_logic'] = 'Unternehmerische Logik';
|
||||
$lang['current_user'] = 'Laufender Nutzer';
|
||||
$lang['current_user'] = 'Aktueller Nutzer';
|
||||
$lang['about_app'] = 'Über Easy!Appointments';
|
||||
$lang['edit_working_plan_hint'] = 'Bitte notieren Sie im folgenden die Tage und Zeiten für die das Unternehmen Termine anbietet. Sie können Termine auch für Feiertage festlegen, aber die Kunden können an diesen Tagen keine Buchung durchführen. Dieser Arbeitsplan ist voreingestellt für alle neuen Einschreibungen von Dienstleistern, aber Sie haben die Möglichkeit den Arbeitsplan zu ändern und zwar für jeden Anbieter gesondert, indem Sie seine Einschreibung bearbeiten. Danach fügen Sie die Zeiträume der Pausen hinzu.';
|
||||
$lang['edit_breaks_hint'] = 'Fügen Sie die betrieblichen Pausen je Tag hinzu. Diese Pausen werden für alle neuen Dienstleister angewendet.';
|
||||
|
@ -301,26 +301,26 @@ $lang['delete_personal_information_hint'] = 'Entfernen Sie alle Ihre Termine und
|
|||
$lang['delete_personal_information'] = 'Persönlichen Informationen löschen';
|
||||
$lang['delete_personal_information_prompt'] = 'Sind Sie sicher, dass Sie Ihre persönlichen Daten löschen möchten? Diese Aktion kann nicht rückgängig gemacht werden.';
|
||||
$lang['location'] = 'Ort';
|
||||
$lang['working_plan_exception'] = 'Working Plan Exception';
|
||||
$lang['working_plan_exceptions'] = 'Working Plan Exceptions';
|
||||
$lang['working_plan_exceptions_hint'] = 'Add a working plan exception day, outside the working plan.';
|
||||
$lang['new_working_plan_exception_title'] = 'New Working Plan Exception';
|
||||
$lang['working_plan_exception_saved'] = 'Working plan exception saved successfully.';
|
||||
$lang['working_plan_exception_deleted'] = 'Working plan exception deleted successfully.';
|
||||
$lang['add_working_plan_exceptions_during_each_day'] = 'Add working plan exceptions, outside the working plan.';
|
||||
$lang['add_working_plan_exception'] = 'Add Working Plan Exception';
|
||||
$lang['require_phone_number'] = 'Require phone number';
|
||||
$lang['require_phone_number_hint'] = 'When enabled, customers and users will need to enter the customer\'s phone number when booking an appointment';
|
||||
$lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.';
|
||||
$lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.';
|
||||
$lang['timezone'] = 'Timezone';
|
||||
$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?';
|
||||
$lang['working_plans_got_updated'] = 'All the working plans got updated.';
|
||||
$lang['apply_to_all_providers'] = 'Apply To All Providers';
|
||||
$lang['display_any_provider'] = 'Display Any Provider Option';
|
||||
$lang['display_any_provider_hint'] = 'The booking page will get an additional option that allows customers to book without specifying a provider.';
|
||||
$lang['load_more'] = 'Load More';
|
||||
$lang['list'] = 'List';
|
||||
$lang['default'] = 'Default';
|
||||
$lang['table'] = 'Table';
|
||||
$lang['date'] = 'Date';
|
||||
$lang['working_plan_exception'] = 'Arbeitsplan Ausnahme';
|
||||
$lang['working_plan_exceptions'] = 'Arbeitsplan Ausnahmen';
|
||||
$lang['working_plan_exceptions_hint'] = 'Fügt einen Ausnahmetag außerhalb des Arbeitsplans hinzu.';
|
||||
$lang['new_working_plan_exception_title'] = 'Neue Ausnahme vom Arbeitsplan';
|
||||
$lang['working_plan_exception_saved'] = 'Ausnahme vom Arbeitsplan erfolgreich gespeichert.';
|
||||
$lang['working_plan_exception_deleted'] = 'Ausnahme vom Arbeitsplan erfolgreich gelöscht.';
|
||||
$lang['add_working_plan_exceptions_during_each_day'] = 'Ausnahmen vom Arbeitsplan für jeden Tag hinzufügen.';
|
||||
$lang['add_working_plan_exception'] = 'Ausnahme vom Arbeitsplan hinzufügen';
|
||||
$lang['require_phone_number'] = 'Telefonnummer benötigt';
|
||||
$lang['require_phone_number_hint'] = 'Wenn aktiviert, müssen Kunden und Benutzer die Telefonnummer des Kunden beim Buchen eines Termins eingeben';
|
||||
$lang['check_spam_folder'] = 'Bitte kontrollieren Sie Ihren Spam-Ordner, falss die Email nicht innerhalb weniger Minuten eintrifft.';
|
||||
$lang['api_token_hint'] = 'Setze einen geheimen Token um die tokenbasierte Authentifizierung für die Easy!Appointments API zu aktivieren.';
|
||||
$lang['timezone'] = 'Zeitzone';
|
||||
$lang['overwrite_existing_working_plans'] = 'Dies wird bestehende Arbeitspläne von Anbietern überschreiben. Sind sie sicher?';
|
||||
$lang['working_plans_got_updated'] = 'Alle Arbeitspläne wurden aktualisiert.';
|
||||
$lang['apply_to_all_providers'] = 'Auf alle Anbieter anwenden';
|
||||
$lang['display_any_provider'] = 'Option zum Anzeigen aller Anbieter';
|
||||
$lang['display_any_provider_hint'] = 'Es wird eine zusätzliche Option zur Buchungsseite hinzugefügt, die es Kunden ermöglicht zu buchen ohne eine spezifischen Anbieter auszuwählen.';
|
||||
$lang['load_more'] = 'Mehr laden';
|
||||
$lang['list'] = 'Liste';
|
||||
$lang['default'] = 'Standard';
|
||||
$lang['table'] = 'Tabelle';
|
||||
$lang['date'] = 'Datum';
|
||||
|
|
|
@ -117,7 +117,7 @@ $lang['description'] = 'Descripción';
|
|||
$lang['categories'] = 'Categorías';
|
||||
$lang['admins'] = 'Administradores';
|
||||
$lang['providers'] = 'Proveedores';
|
||||
$lang['secretaries'] = 'Secretarias';
|
||||
$lang['secretaries'] = 'Secretarios/as';
|
||||
$lang['mobile_number'] = 'Número de teléfono móvil';
|
||||
$lang['state'] = 'Estado';
|
||||
$lang['username'] = 'Nombre de usuario';
|
||||
|
@ -142,15 +142,15 @@ $lang['working_plan'] = 'Esquema del horario laboral';
|
|||
$lang['reset_plan'] = 'Restaurar el esquema del horario laboral';
|
||||
$lang['monday'] = 'Lunes';
|
||||
$lang['tuesday'] = 'Martes';
|
||||
$lang['wednesday'] = 'Miercoles';
|
||||
$lang['wednesday'] = 'Miércoles';
|
||||
$lang['thursday'] = 'Jueves';
|
||||
$lang['friday'] = 'Viernes';
|
||||
$lang['saturday'] = 'Sabado';
|
||||
$lang['saturday'] = 'Sábado';
|
||||
$lang['sunday'] = 'Domingo';
|
||||
$lang['breaks'] = 'Periodos de descanso';
|
||||
$lang['add_breaks_during_each_day'] = 'Agregar periodos de descanso para cada día. Durante los periodos de descanso los proveedores no podrán aceptar ninguna cita.';
|
||||
$lang['day'] = 'Día';
|
||||
$lang['days'] = 'Days';
|
||||
$lang['days'] = 'Días';
|
||||
$lang['actions'] = 'Acciones';
|
||||
$lang['reset_working_plan_hint'] = 'Restaurar el esquema del horario laboral a los valores por defecto.';
|
||||
$lang['company_name'] = 'Nombre de la empresa';
|
||||
|
@ -273,12 +273,12 @@ $lang['date_format'] = 'Formato de Fecha';
|
|||
$lang['date_format_hint'] = 'Cambia el formato de fecha para mostrar (D - Día, M - Mes, Y - Año).';
|
||||
$lang['time_format'] = '';
|
||||
$lang['time_format_hint'] = '';
|
||||
$lang['first_weekday'] = 'First day of week';
|
||||
$lang['first_weekday_hint'] = 'Set the first day of the calendar week.';
|
||||
$lang['first_weekday'] = 'Primer día de la semana';
|
||||
$lang['first_weekday_hint'] = 'Defina el primer día de la semana en el calendario.';
|
||||
$lang['google_analytics_code_hint'] = 'Agrega tu ID de Google Analytics para ser incluido en la página de reservas.';
|
||||
$lang['availabilities_type'] = 'Tipos disponibles';
|
||||
$lang['flexible'] = 'Flexible';
|
||||
$lang['fixed'] = 'Fixed';
|
||||
$lang['fixed'] = 'Fijo';
|
||||
$lang['attendants_number'] = 'Número de Atenciones';
|
||||
$lang['reset_working_plan'] = 'Reinicia el plan de trabajo a los valores por defecto.';
|
||||
$lang['legal_contents'] = 'Contenidos legales';
|
||||
|
@ -297,27 +297,27 @@ $lang['read_and_agree_to_privacy_policy'] = 'He leido y estoy de acuerdo con {$l
|
|||
$lang['delete_personal_information_hint'] = 'Borrar toda la información personal del sistema.';
|
||||
$lang['delete_personal_information'] = 'Borrar información personal';
|
||||
$lang['delete_personal_information_prompt'] = '¿Estás seguro que quieres borrar tu información personal? Esta acción no se puede deshacer.';
|
||||
$lang['location'] = 'Location';
|
||||
$lang['working_plan_exception'] = 'Working Plan Exception';
|
||||
$lang['working_plan_exceptions'] = 'Working Plan Exceptions';
|
||||
$lang['working_plan_exceptions_hint'] = 'Add a working plan exception day, outside the working plan.';
|
||||
$lang['new_working_plan_exception_title'] = 'New Working Plan Exception';
|
||||
$lang['working_plan_exception_saved'] = 'Working plan exception saved successfully.';
|
||||
$lang['working_plan_exception_deleted'] = 'Working plan exception deleted successfully.';
|
||||
$lang['add_working_plan_exceptions_during_each_day'] = 'Add working plan exceptions, outside the working plan.';
|
||||
$lang['add_working_plan_exception'] = 'Add Working Plan Exception';
|
||||
$lang['require_phone_number'] = 'Require phone number';
|
||||
$lang['require_phone_number_hint'] = 'When enabled, customers and users will need to enter the customer\'s phone number when booking an appointment';
|
||||
$lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.';
|
||||
$lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.';
|
||||
$lang['timezone'] = 'Timezone';
|
||||
$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?';
|
||||
$lang['working_plans_got_updated'] = 'All the working plans got updated.';
|
||||
$lang['apply_to_all_providers'] = 'Apply To All Providers';
|
||||
$lang['display_any_provider'] = 'Display Any Provider Option';
|
||||
$lang['display_any_provider_hint'] = 'The booking page will get an additional option that allows customers to book without specifying a provider.';
|
||||
$lang['load_more'] = 'Load More';
|
||||
$lang['list'] = 'List';
|
||||
$lang['default'] = 'Default';
|
||||
$lang['table'] = 'Table';
|
||||
$lang['date'] = 'Date';
|
||||
$lang['location'] = 'Ubicación';
|
||||
$lang['working_plan_exception'] = 'Excepción al plan de trabajo';
|
||||
$lang['working_plan_exceptions'] = 'Excepciones al plan de trabajo';
|
||||
$lang['working_plan_exceptions_hint'] = 'Agregar un día de excepción al plan de trabajo, fuera del plan de trabajo.';
|
||||
$lang['new_working_plan_exception_title'] = 'Nueva excepción al plan de trabajo.';
|
||||
$lang['working_plan_exception_saved'] = 'Plan de trabajo eliminado exitosamente.';
|
||||
$lang['working_plan_exception_deleted'] = 'Plan de trabajo eliminado exitosamente.';
|
||||
$lang['add_working_plan_exceptions_during_each_day'] = 'Agregar excepciones al plan de trabajo, fuera del plan de trabajo.';
|
||||
$lang['add_working_plan_exception'] = 'Agregar excepción al plan de trabajo';
|
||||
$lang['require_phone_number'] = 'Requerir número de teléfono';
|
||||
$lang['require_phone_number_hint'] = 'Cuando está habilitado, clientes y usuarios deberán ingresar el número de teléfono del cliente al registrar una cita.';
|
||||
$lang['check_spam_folder'] = 'Por favor, verifique su carpeta de correo no deseado si el correo no llega dentro de unos minutos.';
|
||||
$lang['api_token_hint'] = 'Defina un token secreto para habilitar la autentificación por token mediante la API de Easy!Appointments.';
|
||||
$lang['timezone'] = 'Zona horaria';
|
||||
$lang['overwrite_existing_working_plans'] = 'Esto sobreescribirá los planes de trabajo existentes del proveedor. ¿Seguro que desea continuar?';
|
||||
$lang['working_plans_got_updated'] = 'Todos los planes de trabajo fueron actualizados.';
|
||||
$lang['apply_to_all_providers'] = 'Aplicar a todos los proveedores';
|
||||
$lang['display_any_provider'] = 'Opción de mostrar cualquier proveedor';
|
||||
$lang['display_any_provider_hint'] = 'La página de reserva tendrá una opción adicional que permitirá que los clientes se anoten sin específicar un proveedor.';
|
||||
$lang['load_more'] = 'Cargar más';
|
||||
$lang['list'] = 'Lista';
|
||||
$lang['default'] = 'Predeterminado';
|
||||
$lang['table'] = 'Tabla';
|
||||
$lang['date'] = 'Fecha';
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
class Availability {
|
||||
/**
|
||||
* @var CI_Controller
|
||||
* @var EA_Controller
|
||||
*/
|
||||
protected $CI;
|
||||
|
||||
|
@ -79,7 +79,7 @@ class Availability {
|
|||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function get_available_periods(
|
||||
protected function get_available_periods(
|
||||
$date,
|
||||
$provider,
|
||||
$exclude_appointment_id = NULL
|
||||
|
@ -345,6 +345,11 @@ class Availability {
|
|||
$working_day = strtolower(date('l', strtotime($date)));
|
||||
$working_hours = $working_plan[$working_day];
|
||||
|
||||
if ( ! $working_hours)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
$periods = [
|
||||
[
|
||||
'start' => new DateTime($date . ' ' . $working_hours['start']),
|
||||
|
|
|
@ -24,9 +24,9 @@ class Google_Sync {
|
|||
/**
|
||||
* CodeIgniter Instance
|
||||
*
|
||||
* @var CI_Controller
|
||||
* @var EA_Controller
|
||||
*/
|
||||
protected $framework;
|
||||
protected $CI;
|
||||
|
||||
/**
|
||||
* Google API Client
|
||||
|
@ -50,17 +50,17 @@ class Google_Sync {
|
|||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->framework =& get_instance();
|
||||
$this->CI =& get_instance();
|
||||
|
||||
$this->framework->load->library('session');
|
||||
$this->CI->load->library('session');
|
||||
|
||||
// Initialize google client and calendar service.
|
||||
$this->client = new Google_Client();
|
||||
|
||||
$this->client->setApplicationName($this->framework->config->item('google_application_name'));
|
||||
$this->client->setClientId($this->framework->config->item('google_client_id'));
|
||||
$this->client->setClientSecret($this->framework->config->item('google_client_secret'));
|
||||
$this->client->setDeveloperKey($this->framework->config->item('google_api_key'));
|
||||
$this->client->setApplicationName($this->CI->config->item('google_application_name'));
|
||||
$this->client->setClientId($this->CI->config->item('google_client_id'));
|
||||
$this->client->setClientSecret($this->CI->config->item('google_client_secret'));
|
||||
$this->client->setDeveloperKey($this->CI->config->item('google_api_key'));
|
||||
$this->client->setRedirectUri(site_url('google/oauth_callback'));
|
||||
$this->client->setAccessType('offline');
|
||||
$this->client->addScope([
|
||||
|
@ -145,7 +145,7 @@ class Google_Sync {
|
|||
*/
|
||||
public function add_appointment($appointment, $provider, $service, $customer, $settings)
|
||||
{
|
||||
$this->framework->load->helper('general');
|
||||
$this->CI->load->helper('general');
|
||||
|
||||
$event = new Google_Service_Calendar_Event();
|
||||
$event->setSummary(($service != NULL) ? $service['name'] : 'Unavailable');
|
||||
|
@ -199,7 +199,7 @@ class Google_Sync {
|
|||
*/
|
||||
public function update_appointment($appointment, $provider, $service, $customer, $settings)
|
||||
{
|
||||
$this->framework->load->helper('general');
|
||||
$this->CI->load->helper('general');
|
||||
|
||||
$event = $this->service->events->get($provider['settings']['google_calendar'],
|
||||
$appointment['id_google_calendar']);
|
||||
|
@ -268,7 +268,7 @@ class Google_Sync {
|
|||
*/
|
||||
public function add_unavailable($provider, $unavailable)
|
||||
{
|
||||
$this->framework->load->helper('general');
|
||||
$this->CI->load->helper('general');
|
||||
|
||||
$event = new Google_Service_Calendar_Event();
|
||||
$event->setSummary('Unavailable');
|
||||
|
@ -299,7 +299,7 @@ class Google_Sync {
|
|||
*/
|
||||
public function update_unavailable($provider, $unavailable)
|
||||
{
|
||||
$this->framework->load->helper('general');
|
||||
$this->CI->load->helper('general');
|
||||
|
||||
$event = $this->service->events->get($provider['settings']['google_calendar'],
|
||||
$unavailable['id_google_calendar']);
|
||||
|
@ -362,7 +362,7 @@ class Google_Sync {
|
|||
*/
|
||||
public function get_sync_events($google_calendar, $start, $end)
|
||||
{
|
||||
$this->framework->load->helper('general');
|
||||
$this->CI->load->helper('general');
|
||||
|
||||
$params = [
|
||||
'timeMin' => date3339($start),
|
||||
|
|
|
@ -156,7 +156,7 @@ class Ics_file {
|
|||
|
||||
$calendar
|
||||
->setProdId('-//EasyAppointments//Open Source Web Scheduler//EN')
|
||||
->setTimezone(new DateTimeZone(date_default_timezone_get()))
|
||||
->setTimezone(new DateTimeZone($provider['timezone']))
|
||||
->addEvent($event);
|
||||
|
||||
// Setup exporter.
|
||||
|
|
|
@ -23,7 +23,7 @@ use EA\Engine\Types\Url;
|
|||
*/
|
||||
class Notifications {
|
||||
/**
|
||||
* @var CI_Controller
|
||||
* @var EA_Controller
|
||||
*/
|
||||
protected $CI;
|
||||
|
||||
|
@ -33,13 +33,18 @@ class Notifications {
|
|||
public function __construct()
|
||||
{
|
||||
$this->CI =& get_instance();
|
||||
|
||||
$this->CI->load->model('providers_model');
|
||||
$this->CI->load->model('secretaries_model');
|
||||
$this->CI->load->model('secretaries_model');
|
||||
$this->CI->load->model('admins_model');
|
||||
$this->CI->load->model('appointments_model');
|
||||
$this->CI->load->model('settings_model');
|
||||
|
||||
$this->CI->load->library('ics_file');
|
||||
$this->CI->load->library('timezones');
|
||||
|
||||
$this->CI->config->load('email');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,44 +59,39 @@ class Notifications {
|
|||
*/
|
||||
public function notify_appointment_saved($appointment, $service, $provider, $customer, $settings, $manage_mode = FALSE)
|
||||
{
|
||||
// Send email notifications to customer and provider.
|
||||
try
|
||||
{
|
||||
$this->CI->config->load('email');
|
||||
|
||||
$email = new EmailClient($this->CI, $this->CI->config->config);
|
||||
|
||||
if ($manage_mode === FALSE)
|
||||
{
|
||||
$customer_title = new Text(lang('appointment_booked'));
|
||||
$customer_message = new Text(lang('thank_you_for_appointment'));
|
||||
$provider_title = new Text(lang('appointment_added_to_your_plan'));
|
||||
$provider_message = new Text(lang('appointment_link_description'));
|
||||
|
||||
}
|
||||
else
|
||||
if ($manage_mode)
|
||||
{
|
||||
$customer_title = new Text(lang('appointment_changes_saved'));
|
||||
$customer_message = new Text('');
|
||||
$provider_title = new Text(lang('appointment_details_changed'));
|
||||
$provider_message = new Text('');
|
||||
}
|
||||
else
|
||||
{
|
||||
$customer_title = new Text(lang('appointment_booked'));
|
||||
$customer_message = new Text(lang('thank_you_for_appointment'));
|
||||
$provider_title = new Text(lang('appointment_added_to_your_plan'));
|
||||
$provider_message = new Text(lang('appointment_link_description'));
|
||||
}
|
||||
|
||||
$customer_link = new Url(site_url('appointments/index/' . $appointment['hash']));
|
||||
$provider_link = new Url(site_url('backend/index/' . $appointment['hash']));
|
||||
|
||||
$ics_stream = $this->CI->ics_file->get_stream($appointment, $service, $provider, $customer);
|
||||
|
||||
$send_customer = filter_var(
|
||||
$this->CI->settings_model->get_setting('customer_notifications'),
|
||||
FILTER_VALIDATE_BOOLEAN);
|
||||
|
||||
|
||||
$ics_stream = $this->CI->ics_file->get_stream($appointment, $service, $provider, $customer);
|
||||
|
||||
if ($send_customer === TRUE)
|
||||
{
|
||||
$email->sendAppointmentDetails($appointment, $provider,
|
||||
$email->send_appointment_details($appointment, $provider,
|
||||
$service, $customer, $settings, $customer_title,
|
||||
$customer_message, $customer_link, new Email($customer['email']), new Text($ics_stream));
|
||||
$customer_message, $customer_link, new Email($customer['email']), new Text($ics_stream), $customer['timezone']);
|
||||
}
|
||||
|
||||
$send_provider = filter_var(
|
||||
|
@ -100,9 +100,9 @@ class Notifications {
|
|||
|
||||
if ($send_provider === TRUE)
|
||||
{
|
||||
$email->sendAppointmentDetails($appointment, $provider,
|
||||
$email->send_appointment_details($appointment, $provider,
|
||||
$service, $customer, $settings, $provider_title,
|
||||
$provider_message, $provider_link, new Email($provider['email']), new Text($ics_stream));
|
||||
$provider_message, $provider_link, new Email($provider['email']), new Text($ics_stream), $provider['timezone']);
|
||||
}
|
||||
|
||||
// Notify admins
|
||||
|
@ -110,14 +110,14 @@ class Notifications {
|
|||
|
||||
foreach ($admins as $admin)
|
||||
{
|
||||
if ( ! $admin['settings']['notifications'] === '0')
|
||||
if ($admin['settings']['notifications'] === '0')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$email->sendAppointmentDetails($appointment, $provider,
|
||||
$email->send_appointment_details($appointment, $provider,
|
||||
$service, $customer, $settings, $provider_title,
|
||||
$provider_message, $provider_link, new Email($admin['email']), new Text($ics_stream));
|
||||
$provider_message, $provider_link, new Email($admin['email']), new Text($ics_stream), $admin['timezone']);
|
||||
}
|
||||
|
||||
// Notify secretaries
|
||||
|
@ -125,7 +125,7 @@ class Notifications {
|
|||
|
||||
foreach ($secretaries as $secretary)
|
||||
{
|
||||
if ( ! $secretary['settings']['notifications'] === '0')
|
||||
if ($secretary['settings']['notifications'] === '0')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -135,9 +135,9 @@ class Notifications {
|
|||
continue;
|
||||
}
|
||||
|
||||
$email->sendAppointmentDetails($appointment, $provider,
|
||||
$email->send_appointment_details($appointment, $provider,
|
||||
$service, $customer, $settings, $provider_title,
|
||||
$provider_message, $provider_link, new Email($secretary['email']), new Text($ics_stream));
|
||||
$provider_message, $provider_link, new Email($secretary['email']), new Text($ics_stream), $secretary['timezone']);
|
||||
}
|
||||
}
|
||||
catch (Exception $exception)
|
||||
|
@ -168,7 +168,7 @@ class Notifications {
|
|||
|
||||
if ($send_provider === TRUE)
|
||||
{
|
||||
$email->sendDeleteAppointment($appointment, $provider,
|
||||
$email->send_delete_appointment($appointment, $provider,
|
||||
$service, $customer, $settings, new Email($provider['email']),
|
||||
new Text($this->CI->input->post('cancel_reason')));
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ class Notifications {
|
|||
|
||||
if ($send_customer === TRUE)
|
||||
{
|
||||
$email->sendDeleteAppointment($appointment, $provider,
|
||||
$email->send_delete_appointment($appointment, $provider,
|
||||
$service, $customer, $settings, new Email($customer['email']),
|
||||
new Text($this->CI->input->post('cancel_reason')));
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ class Notifications {
|
|||
continue;
|
||||
}
|
||||
|
||||
$email->sendDeleteAppointment($appointment, $provider,
|
||||
$email->send_delete_appointment($appointment, $provider,
|
||||
$service, $customer, $settings, new Email($admin['email']),
|
||||
new Text($this->CI->input->post('cancel_reason')));
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ class Notifications {
|
|||
continue;
|
||||
}
|
||||
|
||||
$email->sendDeleteAppointment($appointment, $provider,
|
||||
$email->send_delete_appointment($appointment, $provider,
|
||||
$service, $customer, $settings, new Email($secretary['email']),
|
||||
new Text($this->CI->input->post('cancel_reason')));
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
class Synchronization {
|
||||
/**
|
||||
* @var CI_Controller
|
||||
* @var EA_Controller
|
||||
*/
|
||||
protected $CI;
|
||||
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
class Timezones {
|
||||
/**
|
||||
* @var CI_Controller
|
||||
* @var EA_Controller
|
||||
*/
|
||||
protected $framework;
|
||||
protected $CI;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
|
@ -464,13 +464,16 @@ class Timezones {
|
|||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Timezones constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->framework = & get_instance();
|
||||
$this->CI = & get_instance();
|
||||
|
||||
$this->framework->load->model('user_model');
|
||||
$this->CI->load->model('user_model');
|
||||
|
||||
$this->framework->load->library('session');
|
||||
$this->CI->load->library('session');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -499,7 +502,7 @@ class Timezones {
|
|||
throw new Exception('The provided event does not have the required properties: ' . print_r($event));
|
||||
}
|
||||
|
||||
$user_timezone = $this->framework->user_model->get_user_timezone($event['id_users_provider']);
|
||||
$user_timezone = $this->CI->user_model->get_user_timezone($event['id_users_provider']);
|
||||
|
||||
$session_timezone = $this->get_session_timezone();
|
||||
|
||||
|
@ -522,8 +525,8 @@ class Timezones {
|
|||
{
|
||||
$default_timezone = $this->get_default_timezone();
|
||||
|
||||
return $this->framework->session->has_userdata('timezone')
|
||||
? $this->framework->session->userdata('timezone')
|
||||
return $this->CI->session->has_userdata('timezone')
|
||||
? $this->CI->session->userdata('timezone')
|
||||
: $default_timezone;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* SQL are not required.
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Specific_calendar_sync extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Add_google_analytics_setting
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Add_google_analytics_setting extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Add_customer_notifications_setting
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Add_customer_notifications_setting extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Add_date_format_setting
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Add_date_format_setting extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Add_require_captcha_setting
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Add_require_captcha_setting extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Add_calendar_view_setting
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Add_calendar_view_setting extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Add_service_availabilities_type
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Add_service_availabilities_type extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Add_service_attendants_number
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Add_service_attendants_number extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Change_column_types
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Change_column_types extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Add_time_format_setting
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Add_time_format_setting extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Remove_prefix_from_foreign_keys
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Remove_prefix_from_fkey_constraints extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Create_consents_table
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Legal_contents extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Add_weekday_start_setting
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Add_weekday_start_setting extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Create_appointment_location_column
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Create_appointment_location_column extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Add_working_plan_exceptions_to_user_settings
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Add_working_plan_exceptions_to_user_settings extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Add_require_phone_number_setting
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Add_require_phone_number_setting extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Add_api_token_setting
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Add_api_token_setting extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Add_timezone_to_users
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Add_timezone_to_users extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* Class Migration_Add_display_any_provider_setting
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Add_display_any_provider_setting extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
/**
|
||||
* Class Migration_Add_language_to_users
|
||||
*
|
||||
* @property CI_DB_query_builder db
|
||||
* @property CI_DB_forge dbforge
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_DB_forge $dbforge
|
||||
*/
|
||||
class Migration_Add_language_to_users extends CI_Migration {
|
||||
/**
|
||||
|
|
|
@ -16,12 +16,17 @@
|
|||
*
|
||||
* Handles the database actions for admin users management.
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Loader $load
|
||||
*
|
||||
* @package Models
|
||||
*/
|
||||
class Admins_Model extends CI_Model {
|
||||
class Admins_model extends EA_Model {
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->helper('general');
|
||||
$this->load->helper('data_validation');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add (insert or update) an admin user record into database.
|
||||
*
|
||||
|
@ -63,8 +68,6 @@ class Admins_Model extends CI_Model {
|
|||
*/
|
||||
public function validate($admin)
|
||||
{
|
||||
$this->load->helper('data_validation');
|
||||
|
||||
// If a record id is provided then check whether the record exists in the database.
|
||||
if (isset($admin['id']))
|
||||
{
|
||||
|
@ -153,7 +156,7 @@ class Admins_Model extends CI_Model {
|
|||
{
|
||||
$num_rows = $this->db->get_where('user_settings',
|
||||
['username' => $username, 'id_users <> ' => $user_id])->num_rows();
|
||||
return ($num_rows > 0) ? FALSE : TRUE;
|
||||
return $num_rows > 0 ? FALSE : TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -227,8 +230,6 @@ class Admins_Model extends CI_Model {
|
|||
*/
|
||||
protected function insert($admin)
|
||||
{
|
||||
$this->load->helper('general');
|
||||
|
||||
$admin['id_roles'] = $this->get_admin_role_id();
|
||||
$settings = $admin['settings'];
|
||||
unset($admin['settings']);
|
||||
|
@ -278,8 +279,6 @@ class Admins_Model extends CI_Model {
|
|||
*/
|
||||
protected function update($admin)
|
||||
{
|
||||
$this->load->helper('general');
|
||||
|
||||
$settings = $admin['settings'];
|
||||
unset($admin['settings']);
|
||||
$settings['id_users'] = $admin['id'];
|
||||
|
|
|
@ -14,12 +14,21 @@
|
|||
/**
|
||||
* Appointments Model
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Loader $load
|
||||
*
|
||||
* @package Models
|
||||
*/
|
||||
class Appointments_Model extends CI_Model {
|
||||
class Appointments_model extends EA_Model {
|
||||
/**
|
||||
* Appointments_Model constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->helper('data_validation');
|
||||
|
||||
$this->load->library('timezones');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an appointment record to the database.
|
||||
*
|
||||
|
@ -61,8 +70,6 @@ class Appointments_Model extends CI_Model {
|
|||
*/
|
||||
public function validate($appointment)
|
||||
{
|
||||
$this->load->helper('data_validation');
|
||||
|
||||
// If a appointment id is given, check whether the record exists in the database.
|
||||
if (isset($appointment['id']))
|
||||
{
|
||||
|
@ -225,7 +232,7 @@ class Appointments_Model extends CI_Model {
|
|||
])
|
||||
->num_rows();
|
||||
|
||||
return ($num_rows > 0) ? TRUE : FALSE;
|
||||
return $num_rows > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -310,8 +317,6 @@ class Appointments_Model extends CI_Model {
|
|||
|
||||
$appointment = $this->db->get_where('appointments', ['id' => $appointment_id])->row_array();
|
||||
|
||||
$this->load->library('timezones');
|
||||
|
||||
$appointment = $this->timezones->convert_event_timezone($appointment);
|
||||
|
||||
return $appointment;
|
||||
|
@ -356,8 +361,6 @@ class Appointments_Model extends CI_Model {
|
|||
throw new Exception('The given field name does not exist in the database: ' . $field_name);
|
||||
}
|
||||
|
||||
$this->load->library('timezones');
|
||||
|
||||
$row_data = $this->timezones->convert_event_timezone($row_data);
|
||||
|
||||
return $row_data[$field_name];
|
||||
|
@ -378,6 +381,7 @@ class Appointments_Model extends CI_Model {
|
|||
* @param bool $aggregates (OPTIONAL) Defines whether to add aggregations or not.
|
||||
*
|
||||
* @return array Returns the rows from the database.
|
||||
* @throws Exception
|
||||
*/
|
||||
public function get_batch($where = NULL, $order_by = NULL, $limit = NULL, $offset = NULL, $aggregates = FALSE)
|
||||
{
|
||||
|
@ -393,8 +397,6 @@ class Appointments_Model extends CI_Model {
|
|||
|
||||
$appointments = $this->db->get('appointments', $limit, $offset)->result_array();
|
||||
|
||||
$this->load->library('timezones');
|
||||
|
||||
foreach ($appointments as &$appointment)
|
||||
{
|
||||
$appointment = $this->timezones->convert_event_timezone($appointment);
|
||||
|
|
|
@ -14,12 +14,9 @@
|
|||
/**
|
||||
* Class Consents_model
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Loader $load
|
||||
*
|
||||
* @package Models
|
||||
*/
|
||||
class Consents_model extends CI_Model {
|
||||
class Consents_model extends EA_Model {
|
||||
/**
|
||||
* Add a consent record to the database.
|
||||
*
|
||||
|
|
|
@ -14,12 +14,19 @@
|
|||
/**
|
||||
* Customers Model
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Loader $load
|
||||
*
|
||||
* @package Models
|
||||
*/
|
||||
class Customers_Model extends CI_Model {
|
||||
class Customers_model extends EA_Model {
|
||||
/**
|
||||
* Customers_Model constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->helper('data_validation');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a customer record to the database.
|
||||
*
|
||||
|
@ -37,14 +44,14 @@ class Customers_Model extends CI_Model {
|
|||
// Validate the customer data before doing anything.
|
||||
$this->validate($customer);
|
||||
|
||||
// :: CHECK IF CUSTOMER ALREADY EXIST (FROM EMAIL).
|
||||
// Check if a customer already exists (by email).
|
||||
if ($this->exists($customer) && ! isset($customer['id']))
|
||||
{
|
||||
// Find the customer id from the database.
|
||||
$customer['id'] = $this->find_record_id($customer);
|
||||
}
|
||||
|
||||
// :: INSERT OR UPDATE CUSTOMER RECORD
|
||||
// Insert or update the customer record.
|
||||
if ( ! isset($customer['id']))
|
||||
{
|
||||
$customer['id'] = $this->insert($customer);
|
||||
|
@ -68,10 +75,7 @@ class Customers_Model extends CI_Model {
|
|||
*/
|
||||
public function validate($customer)
|
||||
{
|
||||
$this->load->helper('data_validation');
|
||||
|
||||
// If a customer id is provided, check whether the record
|
||||
// exist in the database.
|
||||
// If a customer id is provided, check whether the record exist in the database.
|
||||
if (isset($customer['id']))
|
||||
{
|
||||
$num_rows = $this->db->get_where('users',
|
||||
|
@ -154,7 +158,7 @@ class Customers_Model extends CI_Model {
|
|||
->where('roles.slug', DB_SLUG_CUSTOMER)
|
||||
->get()->num_rows();
|
||||
|
||||
return ($num_rows > 0) ? TRUE : FALSE;
|
||||
return $num_rows > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -348,7 +352,7 @@ class Customers_Model extends CI_Model {
|
|||
* $this->Model->getBatch('id = ' . $recordId);
|
||||
*
|
||||
* @param mixed|null $where
|
||||
* @param midex|null $order_by
|
||||
* @param mixed|null $order_by
|
||||
* @param int|null $limit
|
||||
* @param int|null $offset
|
||||
* @return array Returns the rows from the database.
|
||||
|
|
|
@ -16,12 +16,20 @@
|
|||
*
|
||||
* Contains the database operations for the service provider users of Easy!Appointments.
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Loader $load
|
||||
*
|
||||
* @package Models
|
||||
*/
|
||||
class Providers_Model extends CI_Model {
|
||||
class Providers_model extends EA_Model {
|
||||
/**
|
||||
* Providers_Model constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->helper('data_validation');
|
||||
$this->load->helper('general');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add (insert - update) a service provider record.
|
||||
*
|
||||
|
@ -66,7 +74,6 @@ class Providers_Model extends CI_Model {
|
|||
*/
|
||||
public function validate($provider)
|
||||
{
|
||||
$this->load->helper('data_validation');
|
||||
|
||||
// If a provider id is present, check whether the record exist in the database.
|
||||
if (isset($provider['id']))
|
||||
|
@ -180,7 +187,7 @@ class Providers_Model extends CI_Model {
|
|||
{
|
||||
$num_rows = $this->db->get_where('user_settings',
|
||||
['username' => $username, 'id_users <> ' => $user_id])->num_rows();
|
||||
return ($num_rows > 0) ? FALSE : TRUE;
|
||||
return $num_rows > 0 ? FALSE : TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -208,7 +215,7 @@ class Providers_Model extends CI_Model {
|
|||
->where('roles.slug', DB_SLUG_PROVIDER)
|
||||
->get()->num_rows();
|
||||
|
||||
return ($num_rows > 0) ? TRUE : FALSE;
|
||||
return $num_rows > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -254,7 +261,6 @@ class Providers_Model extends CI_Model {
|
|||
*/
|
||||
protected function insert($provider)
|
||||
{
|
||||
$this->load->helper('general');
|
||||
|
||||
// Get provider role id.
|
||||
$provider['id_roles'] = $this->get_providers_role_id();
|
||||
|
@ -326,7 +332,14 @@ class Providers_Model extends CI_Model {
|
|||
if ($name === 'working_plan_exceptions')
|
||||
{
|
||||
$value = json_decode($value, TRUE);
|
||||
|
||||
if (!$value)
|
||||
{
|
||||
$value = [];
|
||||
}
|
||||
|
||||
krsort($value);
|
||||
|
||||
$value = json_encode($value);
|
||||
}
|
||||
|
||||
|
@ -342,6 +355,8 @@ class Providers_Model extends CI_Model {
|
|||
* @param string $setting_name The setting's name.
|
||||
* @param string $value The setting's value.
|
||||
* @param int $provider_id The selected provider id.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function set_setting($setting_name, $value, $provider_id)
|
||||
{
|
||||
|
@ -394,8 +409,6 @@ class Providers_Model extends CI_Model {
|
|||
*/
|
||||
protected function update($provider)
|
||||
{
|
||||
$this->load->helper('general');
|
||||
|
||||
// Store service and settings (must not be present on the $provider array).
|
||||
$services = $provider['services'];
|
||||
unset($provider['services']);
|
||||
|
@ -425,7 +438,7 @@ class Providers_Model extends CI_Model {
|
|||
/**
|
||||
* Delete an existing provider record from the database.
|
||||
*
|
||||
* @param int $customer_id The record id to be deleted.
|
||||
* @param $provider_id
|
||||
*
|
||||
* @return bool Returns the delete operation result.
|
||||
*
|
||||
|
|
|
@ -14,12 +14,9 @@
|
|||
/**
|
||||
* Roles Model
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Loader $load
|
||||
*
|
||||
* @package Models
|
||||
*/
|
||||
class Roles_Model extends CI_Model {
|
||||
class Roles_model extends EA_Model {
|
||||
/**
|
||||
* Get the record id of a particular role.
|
||||
*
|
||||
|
|
|
@ -16,12 +16,20 @@
|
|||
*
|
||||
* Handles the db actions that have to do with secretaries.
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Loader $load
|
||||
*
|
||||
* @package Models
|
||||
*/
|
||||
class Secretaries_Model extends CI_Model {
|
||||
class Secretaries_model extends EA_Model {
|
||||
/**
|
||||
* Secretaries_Model constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->helper('general');
|
||||
$this->load->helper('data_validation');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add (insert or update) a secretary user record into database.
|
||||
*
|
||||
|
@ -63,8 +71,6 @@ class Secretaries_Model extends CI_Model {
|
|||
*/
|
||||
public function validate($secretary)
|
||||
{
|
||||
$this->load->helper('data_validation');
|
||||
|
||||
// If a record id is provided then check whether the record exists in the database.
|
||||
if (isset($secretary['id']))
|
||||
{
|
||||
|
@ -159,7 +165,7 @@ class Secretaries_Model extends CI_Model {
|
|||
{
|
||||
$num_rows = $this->db->get_where('user_settings',
|
||||
['username' => $username, 'id_users <> ' => $user_id])->num_rows();
|
||||
return ($num_rows > 0) ? FALSE : TRUE;
|
||||
return $num_rows > 0 ? FALSE : TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -187,7 +193,7 @@ class Secretaries_Model extends CI_Model {
|
|||
->where('roles.slug', DB_SLUG_SECRETARY)
|
||||
->get()->num_rows();
|
||||
|
||||
return ($num_rows > 0) ? TRUE : FALSE;
|
||||
return $num_rows > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -233,8 +239,6 @@ class Secretaries_Model extends CI_Model {
|
|||
*/
|
||||
protected function insert($secretary)
|
||||
{
|
||||
$this->load->helper('general');
|
||||
|
||||
$providers = $secretary['providers'];
|
||||
unset($secretary['providers']);
|
||||
$settings = $secretary['settings'];
|
||||
|
@ -340,6 +344,8 @@ class Secretaries_Model extends CI_Model {
|
|||
* @param string $setting_name The setting's name.
|
||||
* @param string $value The setting's value.
|
||||
* @param int $secretary_id The selected provider id.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function set_setting($setting_name, $value, $secretary_id)
|
||||
{
|
||||
|
@ -358,8 +364,6 @@ class Secretaries_Model extends CI_Model {
|
|||
*/
|
||||
protected function update($secretary)
|
||||
{
|
||||
$this->load->helper('general');
|
||||
|
||||
$providers = $secretary['providers'];
|
||||
unset($secretary['providers']);
|
||||
$settings = $secretary['settings'];
|
||||
|
|
|
@ -14,12 +14,19 @@
|
|||
/**
|
||||
* Services Model
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Loader $load
|
||||
*
|
||||
* @package Models
|
||||
*/
|
||||
class Services_Model extends CI_Model {
|
||||
class Services_model extends EA_Model {
|
||||
/**
|
||||
* Services_Model constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->helper('data_validation');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add (insert or update) a service record on the database
|
||||
*
|
||||
|
@ -55,14 +62,11 @@ class Services_Model extends CI_Model {
|
|||
*/
|
||||
public function validate($service)
|
||||
{
|
||||
$this->load->helper('data_validation');
|
||||
|
||||
// If record id is provided we need to check whether the record exists
|
||||
// in the database.
|
||||
// If record id is provided we need to check whether the record exists in the database.
|
||||
if (isset($service['id']))
|
||||
{
|
||||
$num_rows = $this->db->get_where('services', ['id' => $service['id']])
|
||||
->num_rows();
|
||||
$num_rows = $this->db->get_where('services', ['id' => $service['id']])->num_rows();
|
||||
|
||||
if ($num_rows == 0)
|
||||
{
|
||||
throw new Exception('Provided service id does not exist in the database.');
|
||||
|
@ -182,17 +186,19 @@ class Services_Model extends CI_Model {
|
|||
'price' => $service['price']
|
||||
])->num_rows();
|
||||
|
||||
return ($num_rows > 0) ? TRUE : FALSE;
|
||||
return $num_rows > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the record id of an existing record.
|
||||
*
|
||||
* NOTICE: The record must exist, otherwise an exception will be raised.
|
||||
* Notice: The record must exist, otherwise an exception will be raised.
|
||||
*
|
||||
* @param array $service Contains the service record data. Name, duration and price values are mandatory for this
|
||||
* method to complete.
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @throws Exception If required fields are missing.
|
||||
* @throws Exception If requested service was not found.
|
||||
*/
|
||||
|
@ -308,12 +314,16 @@ class Services_Model extends CI_Model {
|
|||
/**
|
||||
* Get all, or specific records from service's table.
|
||||
*
|
||||
* @param string $whereClause (OPTIONAL) The WHERE clause of
|
||||
* the query to be executed. DO NOT INCLUDE 'WHERE' KEYWORD.
|
||||
* Example:
|
||||
*
|
||||
* $this->model->get_batch(['id' => $record_id]);
|
||||
*
|
||||
* @param mixed $where
|
||||
* @param mixed $order_by
|
||||
* @param int|null $limit
|
||||
* @param int|null $offset
|
||||
*
|
||||
* @return array Returns the rows from the database.
|
||||
* @example $this->Model->getBatch('id = ' . $recordId);
|
||||
*
|
||||
*/
|
||||
public function get_batch($where = NULL, $order_by = NULL, $limit = NULL, $offset = NULL)
|
||||
{
|
||||
|
@ -471,6 +481,11 @@ class Services_Model extends CI_Model {
|
|||
/**
|
||||
* Get all service category records from database.
|
||||
*
|
||||
* @param mixed $where
|
||||
* @param mixed $order_by
|
||||
* @param int|null $limit
|
||||
* @param int|null $offset
|
||||
*
|
||||
* @return array Returns an array that contains all the service category records.
|
||||
*/
|
||||
public function get_all_categories($where = NULL, $order_by = NULL, $limit = NULL, $offset = NULL)
|
||||
|
|
|
@ -14,12 +14,9 @@
|
|||
/**
|
||||
* Settings Model
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Loader $load
|
||||
*
|
||||
* @package Models
|
||||
*/
|
||||
class Settings_Model extends CI_Model {
|
||||
class Settings_model extends EA_Model {
|
||||
/**
|
||||
* Get setting value from database.
|
||||
*
|
||||
|
|
|
@ -16,12 +16,22 @@
|
|||
*
|
||||
* Contains current user's methods.
|
||||
*
|
||||
* @property CI_DB_query_builder $db
|
||||
* @property CI_Loader $load
|
||||
*
|
||||
* @package Models
|
||||
*/
|
||||
class User_Model extends CI_Model {
|
||||
class User_model extends EA_Model {
|
||||
/**
|
||||
* User_Model constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->library('timezones');
|
||||
|
||||
$this->load->helper('general');
|
||||
$this->load->helper('string');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the user from the database for the "settings" page.
|
||||
*
|
||||
|
@ -53,7 +63,6 @@ class User_Model extends CI_Model {
|
|||
// Prepare user password (hash).
|
||||
if (isset($user_settings['password']))
|
||||
{
|
||||
$this->load->helper('general');
|
||||
$salt = $this->db->get_where('user_settings', ['id_users' => $user['id']])->row()->salt;
|
||||
$user_settings['password'] = hash_password($salt, $user_settings['password']);
|
||||
}
|
||||
|
@ -81,7 +90,6 @@ class User_Model extends CI_Model {
|
|||
*/
|
||||
public function check_login($username, $password)
|
||||
{
|
||||
$this->load->helper('general');
|
||||
$salt = $this->get_salt($username);
|
||||
$password = hash_password($salt, $password);
|
||||
|
||||
|
@ -109,8 +117,6 @@ class User_Model extends CI_Model {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
$this->load->library('timezones');
|
||||
|
||||
$default_timezone = $this->timezones->get_default_timezone();
|
||||
|
||||
return [
|
||||
|
@ -167,9 +173,6 @@ class User_Model extends CI_Model {
|
|||
*/
|
||||
public function regenerate_password($username, $email)
|
||||
{
|
||||
$this->load->helper('general');
|
||||
$this->load->helper('string');
|
||||
|
||||
$result = $this->db
|
||||
->select('users.id')
|
||||
->from('users')
|
||||
|
|
|
@ -206,7 +206,7 @@
|
|||
<div id="select-date"></div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="col-12 col-md-6">
|
||||
<div id="select-time">
|
||||
<div class="form-group">
|
||||
<label for="select-timezone"><?= lang('timezone') ?></label>
|
||||
|
|
|
@ -82,7 +82,8 @@
|
|||
<i class="far fa-plus-square mr-2"></i>
|
||||
<?= lang('unavailable') ?>
|
||||
</a>
|
||||
<a class="dropdown-item" href="#" id="insert-working-plan-exception">
|
||||
<a class="dropdown-item" href="#" id="insert-working-plan-exception"
|
||||
<?= $this->session->userdata('role_slug') !== 'admin' ? 'hidden' : '' ?>>
|
||||
<i class="far fa-plus-square mr-2"></i>
|
||||
<?= lang('working_plan_exception') ?>
|
||||
</a>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
</div>
|
||||
</header>
|
||||
|
||||
<div class="content container-fluid">
|
||||
<div class="content container">
|
||||
<div class="welcome">
|
||||
<h3>Welcome to the Easy!Appointments installation page.</h3>
|
||||
<p>
|
||||
|
|
|
@ -15,6 +15,11 @@
|
|||
<link rel="icon" type="image/x-icon" href="<?= asset_url('assets/img/favicon.ico') ?>">
|
||||
<link rel="icon" sizes="192x192" href="<?= asset_url('assets/img/logo.png') ?>">
|
||||
|
||||
<script src="<?= asset_url('assets/ext/jquery/jquery.min.js') ?>"></script>
|
||||
<script src="<?= asset_url('assets/ext/jquery-ui/jquery-ui.min.js') ?>"></script>
|
||||
<script src="<?= asset_url('assets/ext/bootstrap/js/bootstrap.bundle.min.js') ?>"></script>
|
||||
<script src="<?= asset_url('assets/ext/datejs/date.min.js') ?>"></script>
|
||||
|
||||
<script>
|
||||
var GlobalVariables = {
|
||||
csrfToken: <?= json_encode($this->security->get_csrf_hash()) ?>,
|
||||
|
@ -29,14 +34,9 @@
|
|||
var availableLanguages = <?= json_encode(config('available_languages')) ?>;
|
||||
|
||||
$(function() {
|
||||
GeneralFunctions.enableLanguageSelection($('#select-language'));
|
||||
GeneralFunctions.enableLanguageSelection($('#select-language'));
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="<?= asset_url('assets/ext/jquery/jquery.min.js') ?>"></script>
|
||||
<script src="<?= asset_url('assets/ext/jquery-ui/jquery-ui.min.js') ?>"></script>
|
||||
<script src="<?= asset_url('assets/ext/bootstrap/js/bootstrap.bundle.min.js') ?>"></script>
|
||||
<script src="<?= asset_url('assets/ext/datejs/date.min.js') ?>"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="login-frame" class="frame-container">
|
||||
|
|
|
@ -1245,7 +1245,8 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
var calendarDate = calendarView.start.clone();
|
||||
|
||||
while (calendarDate < calendarView.end) {
|
||||
weekdayName = calendarDate.format('dddd').toLowerCase();
|
||||
weekdayNumber = parseInt(calendarDate.format('d'))
|
||||
weekdayName = GeneralFunctions.getWeekdayName(weekdayNumber);
|
||||
weekdayDate = calendarDate.format('YYYY-MM-DD');
|
||||
|
||||
// Add working plan exception event.
|
||||
|
|
|
@ -413,32 +413,38 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
});
|
||||
|
||||
// Create providers and service filters.
|
||||
if (GlobalVariables.user.role_slug !== Backend.DB_SLUG_PROVIDER) {
|
||||
$('<label/>', {
|
||||
'text': EALang.provider
|
||||
})
|
||||
.appendTo($calendarHeader);
|
||||
$('<label/>', {
|
||||
'text': EALang.provider
|
||||
})
|
||||
.appendTo($calendarHeader);
|
||||
|
||||
$filterProvider = $('<select/>', {
|
||||
'id': 'filter-provider',
|
||||
'multiple': 'multiple',
|
||||
'on': {
|
||||
'change': function () {
|
||||
var startDate = new Date($('.calendar-view .date-column:first').data('date'));
|
||||
var endDate = new Date(startDate.getTime()).add({days: parseInt($('#select-date').val()) - 1});
|
||||
createView(startDate, endDate);
|
||||
}
|
||||
$filterProvider = $('<select/>', {
|
||||
'id': 'filter-provider',
|
||||
'multiple': 'multiple',
|
||||
'on': {
|
||||
'change': function () {
|
||||
var startDate = new Date($('.calendar-view .date-column:first').data('date'));
|
||||
var endDate = new Date(startDate.getTime()).add({days: parseInt($('#select-date').val()) - 1});
|
||||
createView(startDate, endDate);
|
||||
}
|
||||
})
|
||||
.appendTo($calendarHeader);
|
||||
}
|
||||
})
|
||||
.appendTo($calendarHeader);
|
||||
|
||||
if (GlobalVariables.user.role_slug !== Backend.DB_SLUG_PROVIDER) {
|
||||
providers.forEach(function (provider) {
|
||||
$filterProvider.append(new Option(provider.first_name + ' ' + provider.last_name, provider.id));
|
||||
});
|
||||
|
||||
$filterProvider.select2();
|
||||
} else {
|
||||
providers.forEach(function (provider) {
|
||||
if (Number(provider.id) === Number(GlobalVariables.user.id)) {
|
||||
$filterProvider.append(new Option(provider.first_name + ' ' + provider.last_name, provider.id));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$filterProvider.select2();
|
||||
|
||||
var services = GlobalVariables.availableServices.filter(function (service) {
|
||||
var provider = providers.find(function (provider) {
|
||||
return provider.services.indexOf(service.id) !== -1;
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
$('#edit-category').on('click', function () {
|
||||
$('#categories .add-edit-delete-group').hide();
|
||||
$('#categories .save-cancel-group').show();
|
||||
$('#categories .record-details').find('input, select, textarea').prop('disbaled', false);
|
||||
$('#categories .record-details').find('input, select, textarea').prop('disabled', false);
|
||||
$('#filter-categories button').prop('disabled', true);
|
||||
$('#filter-categories .results').css('color', '#AAA');
|
||||
});
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
$('#services .add-edit-delete-group').hide();
|
||||
$('#services .save-cancel-group').show();
|
||||
$('#services .record-details')
|
||||
.find('input, select textarea')
|
||||
.find('input, select, textarea')
|
||||
.prop('disabled', false);
|
||||
$('#filter-services button').prop('disabled', true);
|
||||
$('#filter-services .results').css('color', '#AAA');
|
||||
|
@ -156,7 +156,7 @@
|
|||
$('#services .add-edit-delete-group').hide();
|
||||
$('#services .save-cancel-group').show();
|
||||
$('#services .record-details')
|
||||
.find('input, select textarea')
|
||||
.find('input, select, textarea')
|
||||
.prop('disabled', false);
|
||||
$('#filter-services button').prop('disabled', true);
|
||||
$('#filter-services .results').css('color', '#AAA');
|
||||
|
|
|
@ -229,6 +229,10 @@ window.FrontendBookApi = window.FrontendBookApi || {};
|
|||
return;
|
||||
}
|
||||
|
||||
if (!providerId || !serviceId) {
|
||||
return;
|
||||
}
|
||||
|
||||
var appointmentId = FrontendBook.manageMode ? GlobalVariables.appointmentData.id : null;
|
||||
|
||||
var url = GlobalVariables.baseUrl + '/index.php/appointments/ajax_get_unavailable_dates';
|
||||
|
|
|
@ -13,7 +13,9 @@
|
|||
|
||||
namespace EA\Engine\Api\V1;
|
||||
|
||||
use \EA\Engine\Types\NonEmptyText;
|
||||
use CI_Controller;
|
||||
use EA\Engine\Types\NonEmptyText;
|
||||
use EA_Controller;
|
||||
|
||||
/**
|
||||
* API v1 Authorization Class
|
||||
|
@ -26,18 +28,18 @@ class Authorization {
|
|||
/**
|
||||
* Framework Instance
|
||||
*
|
||||
* @var CI_Controller
|
||||
* @var EA_Controller
|
||||
*/
|
||||
protected $framework;
|
||||
protected $CI;
|
||||
|
||||
/**
|
||||
* Class Constructor
|
||||
*
|
||||
* @param \CI_Controller $framework
|
||||
* @param CI_Controller $CI
|
||||
*/
|
||||
public function __construct(\CI_Controller $framework)
|
||||
public function __construct(EA_Controller $CI)
|
||||
{
|
||||
$this->framework = $framework;
|
||||
$this->CI = $CI;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -50,9 +52,9 @@ class Authorization {
|
|||
*/
|
||||
public function basic(NonEmptyText $username, NonEmptyText $password)
|
||||
{
|
||||
$this->framework->load->model('user_model');
|
||||
$this->CI->load->model('user_model');
|
||||
|
||||
if ( ! $this->framework->user_model->check_login($username->get(), $password->get()))
|
||||
if ( ! $this->CI->user_model->check_login($username->get(), $password->get()))
|
||||
{
|
||||
throw new Exception('The provided credentials do not match any admin user!', 401, 'Unauthorized');
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ class Exception extends \Exception {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHeader()
|
||||
public function get_header()
|
||||
{
|
||||
return $this->header;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ class Admins implements ParsersInterface {
|
|||
*/
|
||||
public function encode(array &$response)
|
||||
{
|
||||
$encodedResponse = [
|
||||
$encoded_response = [
|
||||
'id' => $response['id'] !== NULL ? (int)$response['id'] : NULL,
|
||||
'firstName' => $response['first_name'],
|
||||
'lastName' => $response['last_name'],
|
||||
|
@ -47,7 +47,7 @@ class Admins implements ParsersInterface {
|
|||
]
|
||||
];
|
||||
|
||||
$response = $encodedResponse;
|
||||
$response = $encoded_response;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -58,92 +58,92 @@ class Admins implements ParsersInterface {
|
|||
*/
|
||||
public function decode(array &$request, array $base = NULL)
|
||||
{
|
||||
$decodedRequest = $base ?: [];
|
||||
$decoded_request = $base ?: [];
|
||||
|
||||
if ( ! empty($request['id']))
|
||||
{
|
||||
$decodedRequest['id'] = $request['id'];
|
||||
$decoded_request['id'] = $request['id'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['firstName']))
|
||||
{
|
||||
$decodedRequest['first_name'] = $request['firstName'];
|
||||
$decoded_request['first_name'] = $request['firstName'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['lastName']))
|
||||
{
|
||||
$decodedRequest['last_name'] = $request['lastName'];
|
||||
$decoded_request['last_name'] = $request['lastName'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['email']))
|
||||
{
|
||||
$decodedRequest['email'] = $request['email'];
|
||||
$decoded_request['email'] = $request['email'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['mobile']))
|
||||
{
|
||||
$decodedRequest['mobile_number'] = $request['mobile'];
|
||||
$decoded_request['mobile_number'] = $request['mobile'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['phone']))
|
||||
{
|
||||
$decodedRequest['phone_number'] = $request['phone'];
|
||||
$decoded_request['phone_number'] = $request['phone'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['address']))
|
||||
{
|
||||
$decodedRequest['address'] = $request['address'];
|
||||
$decoded_request['address'] = $request['address'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['city']))
|
||||
{
|
||||
$decodedRequest['city'] = $request['city'];
|
||||
$decoded_request['city'] = $request['city'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['state']))
|
||||
{
|
||||
$decodedRequest['state'] = $request['state'];
|
||||
$decoded_request['state'] = $request['state'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['zip']))
|
||||
{
|
||||
$decodedRequest['zip_code'] = $request['zip'];
|
||||
$decoded_request['zip_code'] = $request['zip'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['notes']))
|
||||
{
|
||||
$decodedRequest['notes'] = $request['notes'];
|
||||
$decoded_request['notes'] = $request['notes'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']))
|
||||
{
|
||||
if (empty($decodedRequest['settings']))
|
||||
if (empty($decoded_request['settings']))
|
||||
{
|
||||
$decodedRequest['settings'] = [];
|
||||
$decoded_request['settings'] = [];
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']['username']))
|
||||
{
|
||||
$decodedRequest['settings']['username'] = $request['settings']['username'];
|
||||
$decoded_request['settings']['username'] = $request['settings']['username'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']['password']))
|
||||
{
|
||||
$decodedRequest['settings']['password'] = $request['settings']['password'];
|
||||
$decoded_request['settings']['password'] = $request['settings']['password'];
|
||||
}
|
||||
|
||||
if ($request['settings']['notifications'] !== NULL)
|
||||
{
|
||||
$decodedRequest['settings']['notifications'] = filter_var($request['settings']['notifications'],
|
||||
$decoded_request['settings']['notifications'] = filter_var($request['settings']['notifications'],
|
||||
FILTER_VALIDATE_BOOLEAN);
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']['calendarView']))
|
||||
{
|
||||
$decodedRequest['settings']['calendar_view'] = $request['settings']['calendarView'];
|
||||
$decoded_request['settings']['calendar_view'] = $request['settings']['calendarView'];
|
||||
}
|
||||
}
|
||||
|
||||
$request = $decodedRequest;
|
||||
$request = $decoded_request;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ class Appointments implements ParsersInterface {
|
|||
*/
|
||||
public function encode(array &$response)
|
||||
{
|
||||
$encodedResponse = [
|
||||
$encoded_response = [
|
||||
'id' => $response['id'] !== NULL ? (int)$response['id'] : NULL,
|
||||
'book' => $response['book_datetime'],
|
||||
'start' => $response['start_datetime'],
|
||||
|
@ -44,26 +44,26 @@ class Appointments implements ParsersInterface {
|
|||
|
||||
if (isset($response['provider']))
|
||||
{
|
||||
$providerParser = new Providers();
|
||||
$providerParser->encode($response['provider']);
|
||||
$encodedResponse['provider'] = $response['provider'];
|
||||
$provider_parser = new Providers();
|
||||
$provider_parser->encode($response['provider']);
|
||||
$encoded_response['provider'] = $response['provider'];
|
||||
}
|
||||
|
||||
if (isset($response['customer']))
|
||||
{
|
||||
$customerParser = new Customers();
|
||||
$customerParser->encode($response['customer']);
|
||||
$encodedResponse['customer'] = $response['customer'];
|
||||
$customer_parser = new Customers();
|
||||
$customer_parser->encode($response['customer']);
|
||||
$encoded_response['customer'] = $response['customer'];
|
||||
}
|
||||
|
||||
if (isset($response['service']))
|
||||
{
|
||||
$serviceParser = new Services();
|
||||
$serviceParser->encode($response['service']);
|
||||
$encodedResponse['service'] = $response['service'];
|
||||
$service_parser = new Services();
|
||||
$service_parser->encode($response['service']);
|
||||
$encoded_response['service'] = $response['service'];
|
||||
}
|
||||
|
||||
$response = $encodedResponse;
|
||||
$response = $encoded_response;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -74,65 +74,65 @@ class Appointments implements ParsersInterface {
|
|||
*/
|
||||
public function decode(array &$request, array $base = NULL)
|
||||
{
|
||||
$decodedRequest = $base ?: [];
|
||||
$decoded_request = $base ?: [];
|
||||
|
||||
if ( ! empty($request['id']))
|
||||
{
|
||||
$decodedRequest['id'] = $request['id'];
|
||||
$decoded_request['id'] = $request['id'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['book']))
|
||||
{
|
||||
$decodedRequest['book_datetime'] = $request['book'];
|
||||
$decoded_request['book_datetime'] = $request['book'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['start']))
|
||||
{
|
||||
$decodedRequest['start_datetime'] = $request['start'];
|
||||
$decoded_request['start_datetime'] = $request['start'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['end']))
|
||||
{
|
||||
$decodedRequest['end_datetime'] = $request['end'];
|
||||
$decoded_request['end_datetime'] = $request['end'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['hash']))
|
||||
{
|
||||
$decodedRequest['hash'] = $request['hash'];
|
||||
$decoded_request['hash'] = $request['hash'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['location']))
|
||||
{
|
||||
$decodedRequest['location'] = $request['location'];
|
||||
$decoded_request['location'] = $request['location'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['notes']))
|
||||
{
|
||||
$decodedRequest['notes'] = $request['notes'];
|
||||
$decoded_request['notes'] = $request['notes'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['customerId']))
|
||||
{
|
||||
$decodedRequest['id_users_customer'] = $request['customerId'];
|
||||
$decoded_request['id_users_customer'] = $request['customerId'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['providerId']))
|
||||
{
|
||||
$decodedRequest['id_users_provider'] = $request['providerId'];
|
||||
$decoded_request['id_users_provider'] = $request['providerId'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['serviceId']))
|
||||
{
|
||||
$decodedRequest['id_services'] = $request['serviceId'];
|
||||
$decoded_request['id_services'] = $request['serviceId'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['googleCalendarId']))
|
||||
{
|
||||
$decodedRequest['id_google_calendar'] = $request['googleCalendarId'];
|
||||
$decoded_request['id_google_calendar'] = $request['googleCalendarId'];
|
||||
}
|
||||
|
||||
$decodedRequest['is_unavailable'] = FALSE;
|
||||
$decoded_request['is_unavailable'] = FALSE;
|
||||
|
||||
$request = $decodedRequest;
|
||||
$request = $decoded_request;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,13 +28,13 @@ class Categories implements ParsersInterface {
|
|||
*/
|
||||
public function encode(array &$response)
|
||||
{
|
||||
$encodedResponse = [
|
||||
$encoded_response = [
|
||||
'id' => $response['id'] !== NULL ? (int)$response['id'] : NULL,
|
||||
'name' => $response['name'],
|
||||
'description' => $response['description']
|
||||
];
|
||||
|
||||
$response = $encodedResponse;
|
||||
$response = $encoded_response;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -45,23 +45,23 @@ class Categories implements ParsersInterface {
|
|||
*/
|
||||
public function decode(array &$request, array $base = NULL)
|
||||
{
|
||||
$decodedRequest = $base ?: [];
|
||||
$decoded_request = $base ?: [];
|
||||
|
||||
if ( ! empty($request['id']))
|
||||
{
|
||||
$decodedRequest['id'] = $request['id'];
|
||||
$decoded_request['id'] = $request['id'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['name']))
|
||||
{
|
||||
$decodedRequest['name'] = $request['name'];
|
||||
$decoded_request['name'] = $request['name'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['description']))
|
||||
{
|
||||
$decodedRequest['description'] = $request['description'];
|
||||
$decoded_request['description'] = $request['description'];
|
||||
}
|
||||
|
||||
$request = $decodedRequest;
|
||||
$request = $decoded_request;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ class Customers implements ParsersInterface {
|
|||
*/
|
||||
public function encode(array &$response)
|
||||
{
|
||||
$encodedResponse = [
|
||||
$encoded_response = [
|
||||
'id' => $response['id'] !== NULL ? (int)$response['id'] : NULL,
|
||||
'firstName' => $response['first_name'],
|
||||
'lastName' => $response['last_name'],
|
||||
|
@ -40,7 +40,7 @@ class Customers implements ParsersInterface {
|
|||
'notes' => $response['notes']
|
||||
];
|
||||
|
||||
$response = $encodedResponse;
|
||||
$response = $encoded_response;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,53 +51,53 @@ class Customers implements ParsersInterface {
|
|||
*/
|
||||
public function decode(array &$request, array $base = NULL)
|
||||
{
|
||||
$decodedRequest = $base ?: [];
|
||||
$decoded_request = $base ?: [];
|
||||
|
||||
if ( ! empty($request['id']))
|
||||
{
|
||||
$decodedRequest['id'] = $request['id'];
|
||||
$decoded_request['id'] = $request['id'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['firstName']))
|
||||
{
|
||||
$decodedRequest['first_name'] = $request['firstName'];
|
||||
$decoded_request['first_name'] = $request['firstName'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['lastName']))
|
||||
{
|
||||
$decodedRequest['last_name'] = $request['lastName'];
|
||||
$decoded_request['last_name'] = $request['lastName'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['email']))
|
||||
{
|
||||
$decodedRequest['email'] = $request['email'];
|
||||
$decoded_request['email'] = $request['email'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['phone']))
|
||||
{
|
||||
$decodedRequest['phone_number'] = $request['phone'];
|
||||
$decoded_request['phone_number'] = $request['phone'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['address']))
|
||||
{
|
||||
$decodedRequest['address'] = $request['address'];
|
||||
$decoded_request['address'] = $request['address'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['city']))
|
||||
{
|
||||
$decodedRequest['city'] = $request['city'];
|
||||
$decoded_request['city'] = $request['city'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['zip']))
|
||||
{
|
||||
$decodedRequest['zip_code'] = $request['zip'];
|
||||
$decoded_request['zip_code'] = $request['zip'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['notes']))
|
||||
{
|
||||
$decodedRequest['notes'] = $request['notes'];
|
||||
$decoded_request['notes'] = $request['notes'];
|
||||
}
|
||||
|
||||
$request = $decodedRequest;
|
||||
$request = $decoded_request;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ class Providers implements ParsersInterface {
|
|||
*/
|
||||
public function encode(array &$response)
|
||||
{
|
||||
$encodedResponse = [
|
||||
$encoded_response = [
|
||||
'id' => $response['id'] !== NULL ? (int)$response['id'] : NULL,
|
||||
'firstName' => $response['first_name'],
|
||||
'lastName' => $response['last_name'],
|
||||
|
@ -44,12 +44,12 @@ class Providers implements ParsersInterface {
|
|||
|
||||
if (array_key_exists('services', $response))
|
||||
{
|
||||
$encodedResponse['services'] = $response['services'];
|
||||
$encoded_response['services'] = $response['services'];
|
||||
}
|
||||
|
||||
if (array_key_exists('settings', $response))
|
||||
{
|
||||
$encodedResponse['settings'] = [
|
||||
$encoded_response['settings'] = [
|
||||
'username' => $response['settings']['username'],
|
||||
'notifications' => filter_var($response['settings']['notifications'], FILTER_VALIDATE_BOOLEAN),
|
||||
'calendarView' => $response['settings']['calendar_view'],
|
||||
|
@ -63,7 +63,7 @@ class Providers implements ParsersInterface {
|
|||
];
|
||||
}
|
||||
|
||||
$response = $encodedResponse;
|
||||
$response = $encoded_response;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -74,133 +74,133 @@ class Providers implements ParsersInterface {
|
|||
*/
|
||||
public function decode(array &$request, array $base = NULL)
|
||||
{
|
||||
$decodedRequest = $base ?: [];
|
||||
$decoded_request = $base ?: [];
|
||||
|
||||
if ( ! empty($request['id']))
|
||||
{
|
||||
$decodedRequest['id'] = $request['id'];
|
||||
$decoded_request['id'] = $request['id'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['firstName']))
|
||||
{
|
||||
$decodedRequest['first_name'] = $request['firstName'];
|
||||
$decoded_request['first_name'] = $request['firstName'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['lastName']))
|
||||
{
|
||||
$decodedRequest['last_name'] = $request['lastName'];
|
||||
$decoded_request['last_name'] = $request['lastName'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['email']))
|
||||
{
|
||||
$decodedRequest['email'] = $request['email'];
|
||||
$decoded_request['email'] = $request['email'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['mobile']))
|
||||
{
|
||||
$decodedRequest['mobile_number'] = $request['mobile'];
|
||||
$decoded_request['mobile_number'] = $request['mobile'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['phone']))
|
||||
{
|
||||
$decodedRequest['phone_number'] = $request['phone'];
|
||||
$decoded_request['phone_number'] = $request['phone'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['address']))
|
||||
{
|
||||
$decodedRequest['address'] = $request['address'];
|
||||
$decoded_request['address'] = $request['address'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['city']))
|
||||
{
|
||||
$decodedRequest['city'] = $request['city'];
|
||||
$decoded_request['city'] = $request['city'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['state']))
|
||||
{
|
||||
$decodedRequest['state'] = $request['state'];
|
||||
$decoded_request['state'] = $request['state'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['zip']))
|
||||
{
|
||||
$decodedRequest['zip_code'] = $request['zip'];
|
||||
$decoded_request['zip_code'] = $request['zip'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['notes']))
|
||||
{
|
||||
$decodedRequest['notes'] = $request['notes'];
|
||||
$decoded_request['notes'] = $request['notes'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['services']))
|
||||
{
|
||||
$decodedRequest['services'] = $request['services'];
|
||||
$decoded_request['services'] = $request['services'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']))
|
||||
{
|
||||
if (empty($decodedRequest['settings']))
|
||||
if (empty($decoded_request['settings']))
|
||||
{
|
||||
$decodedRequest['settings'] = [];
|
||||
$decoded_request['settings'] = [];
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']['username']))
|
||||
{
|
||||
$decodedRequest['settings']['username'] = $request['settings']['username'];
|
||||
$decoded_request['settings']['username'] = $request['settings']['username'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']['password']))
|
||||
{
|
||||
$decodedRequest['settings']['password'] = $request['settings']['password'];
|
||||
$decoded_request['settings']['password'] = $request['settings']['password'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']['calendarView']))
|
||||
{
|
||||
$decodedRequest['settings']['calendar_view'] = $request['settings']['calendarView'];
|
||||
$decoded_request['settings']['calendar_view'] = $request['settings']['calendarView'];
|
||||
}
|
||||
|
||||
if ($request['settings']['notifications'] !== NULL)
|
||||
{
|
||||
$decodedRequest['settings']['notifications'] = filter_var($request['settings']['notifications'],
|
||||
$decoded_request['settings']['notifications'] = filter_var($request['settings']['notifications'],
|
||||
FILTER_VALIDATE_BOOLEAN);
|
||||
}
|
||||
|
||||
if ($request['settings']['googleSync'] !== NULL)
|
||||
{
|
||||
$decodedRequest['settings']['google_sync'] = filter_var($request['settings']['googleSync'],
|
||||
$decoded_request['settings']['google_sync'] = filter_var($request['settings']['googleSync'],
|
||||
FILTER_VALIDATE_BOOLEAN);
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']['googleCalendar']))
|
||||
{
|
||||
$decodedRequest['settings']['google_calendar'] = $request['settings']['googleCalendar'];
|
||||
$decoded_request['settings']['google_calendar'] = $request['settings']['googleCalendar'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']['googleToken']))
|
||||
{
|
||||
$decodedRequest['settings']['google_token'] = $request['settings']['googleToken'];
|
||||
$decoded_request['settings']['google_token'] = $request['settings']['googleToken'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']['syncFutureDays']))
|
||||
{
|
||||
$decodedRequest['settings']['sync_future_days'] = $request['settings']['syncFutureDays'];
|
||||
$decoded_request['settings']['sync_future_days'] = $request['settings']['syncFutureDays'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']['syncPastDays']))
|
||||
{
|
||||
$decodedRequest['settings']['sync_past_days'] = $request['settings']['syncPastDays'];
|
||||
$decoded_request['settings']['sync_past_days'] = $request['settings']['syncPastDays'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']['workingPlan']))
|
||||
{
|
||||
$decodedRequest['settings']['working_plan'] = json_encode($request['settings']['workingPlan']);
|
||||
$decoded_request['settings']['working_plan'] = json_encode($request['settings']['workingPlan']);
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']['workingPlanExceptions']))
|
||||
{
|
||||
$decodedRequest['settings']['working_plan_exceptions'] = json_encode($request['settings']['workingPlanExceptions']);
|
||||
$decoded_request['settings']['working_plan_exceptions'] = json_encode($request['settings']['workingPlanExceptions']);
|
||||
}
|
||||
}
|
||||
|
||||
$request = $decodedRequest;
|
||||
$request = $decoded_request;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ class Secretaries implements ParsersInterface {
|
|||
*/
|
||||
public function encode(array &$response)
|
||||
{
|
||||
$encodedResponse = [
|
||||
$encoded_response = [
|
||||
'id' => $response['id'] !== NULL ? (int)$response['id'] : NULL,
|
||||
'firstName' => $response['first_name'],
|
||||
'lastName' => $response['last_name'],
|
||||
|
@ -48,7 +48,7 @@ class Secretaries implements ParsersInterface {
|
|||
]
|
||||
];
|
||||
|
||||
$response = $encodedResponse;
|
||||
$response = $encoded_response;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -59,97 +59,97 @@ class Secretaries implements ParsersInterface {
|
|||
*/
|
||||
public function decode(array &$request, array $base = NULL)
|
||||
{
|
||||
$decodedRequest = $base ?: [];
|
||||
$decoded_request = $base ?: [];
|
||||
|
||||
if ( ! empty($request['id']))
|
||||
{
|
||||
$decodedRequest['id'] = $request['id'];
|
||||
$decoded_request['id'] = $request['id'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['firstName']))
|
||||
{
|
||||
$decodedRequest['first_name'] = $request['firstName'];
|
||||
$decoded_request['first_name'] = $request['firstName'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['lastName']))
|
||||
{
|
||||
$decodedRequest['last_name'] = $request['lastName'];
|
||||
$decoded_request['last_name'] = $request['lastName'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['email']))
|
||||
{
|
||||
$decodedRequest['email'] = $request['email'];
|
||||
$decoded_request['email'] = $request['email'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['mobile']))
|
||||
{
|
||||
$decodedRequest['mobile_number'] = $request['mobile'];
|
||||
$decoded_request['mobile_number'] = $request['mobile'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['phone']))
|
||||
{
|
||||
$decodedRequest['phone_number'] = $request['phone'];
|
||||
$decoded_request['phone_number'] = $request['phone'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['address']))
|
||||
{
|
||||
$decodedRequest['address'] = $request['address'];
|
||||
$decoded_request['address'] = $request['address'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['city']))
|
||||
{
|
||||
$decodedRequest['city'] = $request['city'];
|
||||
$decoded_request['city'] = $request['city'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['state']))
|
||||
{
|
||||
$decodedRequest['state'] = $request['state'];
|
||||
$decoded_request['state'] = $request['state'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['zip']))
|
||||
{
|
||||
$decodedRequest['zip_code'] = $request['zip'];
|
||||
$decoded_request['zip_code'] = $request['zip'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['notes']))
|
||||
{
|
||||
$decodedRequest['notes'] = $request['notes'];
|
||||
$decoded_request['notes'] = $request['notes'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['providers']))
|
||||
{
|
||||
$decodedRequest['providers'] = $request['providers'];
|
||||
$decoded_request['providers'] = $request['providers'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']))
|
||||
{
|
||||
if (empty($decodedRequest['settings']))
|
||||
if (empty($decoded_request['settings']))
|
||||
{
|
||||
$decodedRequest['settings'] = [];
|
||||
$decoded_request['settings'] = [];
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']['username']))
|
||||
{
|
||||
$decodedRequest['settings']['username'] = $request['settings']['username'];
|
||||
$decoded_request['settings']['username'] = $request['settings']['username'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']['password']))
|
||||
{
|
||||
$decodedRequest['settings']['password'] = $request['settings']['password'];
|
||||
$decoded_request['settings']['password'] = $request['settings']['password'];
|
||||
}
|
||||
|
||||
if ($request['settings']['notifications'] !== NULL)
|
||||
{
|
||||
$decodedRequest['settings']['notifications'] = filter_var($request['settings']['notifications'],
|
||||
$decoded_request['settings']['notifications'] = filter_var($request['settings']['notifications'],
|
||||
FILTER_VALIDATE_BOOLEAN);
|
||||
}
|
||||
|
||||
if ( ! empty($request['settings']['calendarView']))
|
||||
{
|
||||
$decodedRequest['settings']['calendar_view'] = $request['settings']['calendarView'];
|
||||
$decoded_request['settings']['calendar_view'] = $request['settings']['calendarView'];
|
||||
}
|
||||
}
|
||||
|
||||
$request = $decodedRequest;
|
||||
$request = $decoded_request;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ class Services implements ParsersInterface {
|
|||
*/
|
||||
public function encode(array &$response)
|
||||
{
|
||||
$encodedResponse = [
|
||||
$encoded_response = [
|
||||
'id' => $response['id'] !== NULL ? (int)$response['id'] : NULL,
|
||||
'name' => $response['name'],
|
||||
'duration' => (int)$response['duration'],
|
||||
|
@ -41,7 +41,7 @@ class Services implements ParsersInterface {
|
|||
'categoryId' => $response['id_service_categories'] !== NULL ? (int)$response['id_service_categories'] : NULL
|
||||
];
|
||||
|
||||
$response = $encodedResponse;
|
||||
$response = $encoded_response;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -52,58 +52,58 @@ class Services implements ParsersInterface {
|
|||
*/
|
||||
public function decode(array &$request, array $base = NULL)
|
||||
{
|
||||
$decodedRequest = $base ?: [];
|
||||
$decoded_request = $base ?: [];
|
||||
|
||||
if ( ! empty($request['id']))
|
||||
{
|
||||
$decodedRequest['id'] = $request['id'];
|
||||
$decoded_request['id'] = $request['id'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['name']))
|
||||
{
|
||||
$decodedRequest['name'] = $request['name'];
|
||||
$decoded_request['name'] = $request['name'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['duration']))
|
||||
{
|
||||
$decodedRequest['duration'] = $request['duration'];
|
||||
$decoded_request['duration'] = $request['duration'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['price']))
|
||||
{
|
||||
$decodedRequest['price'] = $request['price'];
|
||||
$decoded_request['price'] = $request['price'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['currency']))
|
||||
{
|
||||
$decodedRequest['currency'] = $request['currency'];
|
||||
$decoded_request['currency'] = $request['currency'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['description']))
|
||||
{
|
||||
$decodedRequest['description'] = $request['description'];
|
||||
$decoded_request['description'] = $request['description'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['location']))
|
||||
{
|
||||
$decodedRequest['location'] = $request['location'];
|
||||
$decoded_request['location'] = $request['location'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['availabilitiesType']))
|
||||
{
|
||||
$decodedRequest['availabilities_type'] = $request['availabilitiesType'];
|
||||
$decoded_request['availabilities_type'] = $request['availabilitiesType'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['attendantsNumber']))
|
||||
{
|
||||
$decodedRequest['attendants_number'] = $request['attendantsNumber'];
|
||||
$decoded_request['attendants_number'] = $request['attendantsNumber'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['categoryId']))
|
||||
{
|
||||
$decodedRequest['id_service_categories'] = $request['categoryId'];
|
||||
$decoded_request['id_service_categories'] = $request['categoryId'];
|
||||
}
|
||||
|
||||
$request = $decodedRequest;
|
||||
$request = $decoded_request;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,12 +28,12 @@ class Settings implements ParsersInterface {
|
|||
*/
|
||||
public function encode(array &$response)
|
||||
{
|
||||
$encodedResponse = [
|
||||
$encoded_response = [
|
||||
'name' => $response['name'],
|
||||
'value' => $response['value']
|
||||
];
|
||||
|
||||
$response = $encodedResponse;
|
||||
$response = $encoded_response;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,18 +44,18 @@ class Settings implements ParsersInterface {
|
|||
*/
|
||||
public function decode(array &$request, array $base = NULL)
|
||||
{
|
||||
$decodedRequest = $base ?: [];
|
||||
$decoded_request = $base ?: [];
|
||||
|
||||
if ( ! empty($request['name']))
|
||||
{
|
||||
$decodedRequest['name'] = $request['name'];
|
||||
$decoded_request['name'] = $request['name'];
|
||||
}
|
||||
|
||||
if ( ! empty($request['value']))
|
||||
{
|
||||
$decodedRequest['value'] = $request['value'];
|
||||
$decoded_request['value'] = $request['value'];
|
||||
}
|
||||
|
||||
$request = $decodedRequest;
|
||||
$request = $decoded_request;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ class Unavailabilities implements ParsersInterface {
|
|||
*/
|
||||
public function encode(array &$response)
|
||||
{
|
||||
$encodedResponse = [
|
||||
$encoded_response = [
|
||||
'id' => $response['id'] !== NULL ? (int)$response['id'] : NULL,
|
||||
'book' => $response['book_datetime'],
|
||||
'start' => $response['start_datetime'],
|
||||
|
@ -38,7 +38,7 @@ class Unavailabilities implements ParsersInterface {
|
|||
'googleCalendarId' => $response['id_google_calendar'] !== NULL ? (int)$response['id_google_calendar'] : NULL
|
||||
];
|
||||
|
||||
$response = $encodedResponse;
|
||||
$response = $encoded_response;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,24 +44,24 @@ class Minimize implements ProcessorsInterface {
|
|||
|
||||
$fields = explode(',', $_GET['fields']);
|
||||
|
||||
$temporaryResponse = [];
|
||||
$temporary_response = [];
|
||||
|
||||
foreach ($response as &$entry)
|
||||
{
|
||||
$temporaryEntry = [];
|
||||
$temporary_entry = [];
|
||||
|
||||
foreach ($fields as $field)
|
||||
{
|
||||
$field = trim($field);
|
||||
if (isset($entry[$field]))
|
||||
{
|
||||
$temporaryEntry[$field] = $entry[$field];
|
||||
$temporary_entry[$field] = $entry[$field];
|
||||
}
|
||||
}
|
||||
|
||||
$temporaryResponse[] = $temporaryEntry;
|
||||
$temporary_response[] = $temporary_entry;
|
||||
}
|
||||
|
||||
$response = $temporaryResponse;
|
||||
$response = $temporary_response;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ class Paginate implements ProcessorsInterface {
|
|||
* Process Response Array
|
||||
*
|
||||
* Example:
|
||||
* http://ea-installation.com/api/v1/appointments?page=3&length=30
|
||||
* http://example.org/api/v1/appointments?page=3&length=30
|
||||
*
|
||||
* @param array &$response The response array to be processed.
|
||||
*/
|
||||
|
|
|
@ -35,18 +35,18 @@ class Search implements ProcessorsInterface {
|
|||
return;
|
||||
}
|
||||
|
||||
$searchedResponse = [];
|
||||
$searched_response = [];
|
||||
$keyword = (string)$_GET['q'];
|
||||
|
||||
foreach ($response as $entry)
|
||||
{
|
||||
if (self::_recursiveArraySearch($entry, $keyword) !== FALSE)
|
||||
if (self::recursive_array_search($entry, $keyword) !== FALSE)
|
||||
{
|
||||
$searchedResponse[] = $entry;
|
||||
$searched_response[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
$response = $searchedResponse;
|
||||
$response = $searched_response;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -57,13 +57,13 @@ class Search implements ProcessorsInterface {
|
|||
*
|
||||
* @return int|bool Returns the index of the search occurrence or false it nothing was found.
|
||||
*/
|
||||
protected static function _recursiveArraySearch(array $haystack, $needle)
|
||||
protected static function recursive_array_search(array $haystack, $needle)
|
||||
{
|
||||
foreach ($haystack as $key => $value)
|
||||
{
|
||||
$currentKey = $key;
|
||||
|
||||
if (is_array($value) && self::_recursiveArraySearch($value, $needle) !== FALSE)
|
||||
if (is_array($value) && self::recursive_array_search($value, $needle) !== FALSE)
|
||||
{
|
||||
return $currentKey;
|
||||
}
|
||||
|
|
|
@ -40,56 +40,56 @@ class Sort implements ProcessorsInterface {
|
|||
|
||||
$sort = explode(',', (string)$_GET['sort']);
|
||||
|
||||
$sortDirection1 = substr($sort[0], 0, 1) === '-' ? SORT_DESC : SORT_ASC;
|
||||
$sort_direction1 = substr($sort[0], 0, 1) === '-' ? SORT_DESC : SORT_ASC;
|
||||
|
||||
if (isset($sort[1]))
|
||||
{
|
||||
$sortDirection2 = substr($sort[1], 0, 1) === '-' ? SORT_DESC : SORT_ASC;
|
||||
$sort_direction2 = substr($sort[1], 0, 1) === '-' ? SORT_DESC : SORT_ASC;
|
||||
}
|
||||
else
|
||||
{
|
||||
$sortDirection2 = NULL;
|
||||
$sort_direction2 = NULL;
|
||||
}
|
||||
|
||||
if (isset($sort[2]))
|
||||
{
|
||||
$sortDirection3 = substr($sort[2], 0, 1) === '-' ? SORT_DESC : SORT_ASC;
|
||||
$sort_direction3 = substr($sort[2], 0, 1) === '-' ? SORT_DESC : SORT_ASC;
|
||||
}
|
||||
else
|
||||
{
|
||||
$sortDirection3 = NULL;
|
||||
$sort_direction3 = NULL;
|
||||
}
|
||||
|
||||
foreach ($response as $index => $entry)
|
||||
{
|
||||
$sortOrder1[$index] = $entry[substr($sort[0], 1)];
|
||||
$sort_order1[$index] = $entry[substr($sort[0], 1)];
|
||||
|
||||
if ($sortDirection2)
|
||||
if ($sort_direction2)
|
||||
{
|
||||
$sortOrder2[$index] = $entry[substr($sort[1], 1)];
|
||||
$sort_order2[$index] = $entry[substr($sort[1], 1)];
|
||||
}
|
||||
|
||||
if ($sortDirection3)
|
||||
if ($sort_direction3)
|
||||
{
|
||||
$sortOrder3[$index] = $entry[substr($sort[2], 1)];
|
||||
$sort_order3[$index] = $entry[substr($sort[2], 1)];
|
||||
}
|
||||
}
|
||||
|
||||
$arguments = [
|
||||
&$sortOrder1,
|
||||
&$sortDirection1
|
||||
&$sort_order1,
|
||||
&$sort_direction1
|
||||
];
|
||||
|
||||
if ($sortDirection2)
|
||||
if ($sort_direction2)
|
||||
{
|
||||
$arguments[] = $sortOrder2;
|
||||
$arguments[] = $sortDirection2;
|
||||
$arguments[] = $sort_order2;
|
||||
$arguments[] = $sort_direction2;
|
||||
}
|
||||
|
||||
if ($sortDirection3)
|
||||
if ($sort_direction3)
|
||||
{
|
||||
$arguments[] = $sortOrder3;
|
||||
$arguments[] = $sortDirection3;
|
||||
$arguments[] = $sort_order3;
|
||||
$arguments[] = $sort_direction3;
|
||||
}
|
||||
|
||||
$arguments[] = &$response;
|
||||
|
|
|
@ -27,7 +27,7 @@ class Request {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getBody()
|
||||
public function get_body()
|
||||
{
|
||||
return json_decode(file_get_contents('php://input'), TRUE);
|
||||
}
|
||||
|
|
|
@ -13,11 +13,16 @@
|
|||
|
||||
namespace EA\Engine\Notifications;
|
||||
|
||||
use \EA\Engine\Types\Text;
|
||||
use \EA\Engine\Types\NonEmptyText;
|
||||
use \EA\Engine\Types\Url;
|
||||
use \EA\Engine\Types\Email as EmailAddress;
|
||||
use \PHPMailer\PHPMailer\PHPMailer;
|
||||
use DateTime;
|
||||
use DateTimeZone;
|
||||
use EA\Engine\Types\Email as EmailAddress;
|
||||
use EA\Engine\Types\NonEmptyText;
|
||||
use EA\Engine\Types\Text;
|
||||
use EA\Engine\Types\Url;
|
||||
use EA_Controller;
|
||||
use Exception;
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Email Notifications Class
|
||||
|
@ -32,7 +37,7 @@ class Email {
|
|||
/**
|
||||
* Framework Instance
|
||||
*
|
||||
* @var CI_Controller
|
||||
* @var EA_Controller
|
||||
*/
|
||||
protected $framework;
|
||||
|
||||
|
@ -65,32 +70,37 @@ class Email {
|
|||
* @param array $provider Contains the provider data.
|
||||
* @param array $service Contains the service data.
|
||||
* @param array $customer Contains the customer data.
|
||||
* @param array $company Contains settings of the company. By the time the
|
||||
* "company_name", "company_link" and "company_email" values are required in the array.
|
||||
* @param array $settings Contains settings of the company. At the time the "company_name", "company_link" and
|
||||
* "company_email" values are required in the array.
|
||||
* @param \EA\Engine\Types\Text $title The email title may vary depending the receiver.
|
||||
* @param \EA\Engine\Types\Text $message The email message may vary depending the receiver.
|
||||
* @param \EA\Engine\Types\Url $appointmentLink This link is going to enable the receiver to make changes
|
||||
* @param \EA\Engine\Types\Url $appointment_link_address This link is going to enable the receiver to make changes
|
||||
* to the appointment record.
|
||||
* @param \EA\Engine\Types\Email $recipientEmail The recipient email address.
|
||||
* @param \EA\Engine\Types\Text $icsStream Stream contents of the ICS file.
|
||||
* @param \EA\Engine\Types\Email $recipient_email The recipient email address.
|
||||
* @param \EA\Engine\Types\Text $ics_stream Stream contents of the ICS file.
|
||||
* @param string|null $timezone Custom timezone for the notification.
|
||||
*
|
||||
* @throws \PHPMailer\PHPMailer\Exception
|
||||
*/
|
||||
public function sendAppointmentDetails(
|
||||
public function send_appointment_details(
|
||||
array $appointment,
|
||||
array $provider,
|
||||
array $service,
|
||||
array $customer,
|
||||
array $company,
|
||||
array $settings,
|
||||
Text $title,
|
||||
Text $message,
|
||||
Url $appointmentLink,
|
||||
EmailAddress $recipientEmail,
|
||||
Text $icsStream
|
||||
) {
|
||||
Url $appointment_link_address,
|
||||
EmailAddress $recipient_email,
|
||||
Text $ics_stream,
|
||||
$timezone = NULL
|
||||
)
|
||||
{
|
||||
$framework = get_instance();
|
||||
|
||||
$timezones = $framework->timezones->to_array();
|
||||
|
||||
switch ($company['date_format'])
|
||||
switch ($settings['date_format'])
|
||||
{
|
||||
case 'DMY':
|
||||
$date_format = 'd/m/Y';
|
||||
|
@ -102,19 +112,30 @@ class Email {
|
|||
$date_format = 'Y/m/d';
|
||||
break;
|
||||
default:
|
||||
throw new \Exception('Invalid date_format value: ' . $company['date_format']);
|
||||
throw new Exception('Invalid date_format value: ' . $settings['date_format']);
|
||||
}
|
||||
|
||||
switch ($company['time_format'])
|
||||
switch ($settings['time_format'])
|
||||
{
|
||||
case 'military':
|
||||
$timeFormat = 'H:i';
|
||||
$time_format = 'H:i';
|
||||
break;
|
||||
case 'regular':
|
||||
$timeFormat = 'g:i A';
|
||||
$time_format = 'g:i A';
|
||||
break;
|
||||
default:
|
||||
throw new \Exception('Invalid time_format value: ' . $company['time_format']);
|
||||
throw new Exception('Invalid time_format value: ' . $settings['time_format']);
|
||||
}
|
||||
|
||||
$appointment_timezone = new DateTimeZone($provider['timezone']);
|
||||
$appointment_start = new DateTime($appointment['start_datetime'], $appointment_timezone);
|
||||
$appointment_end = new DateTime($appointment['end_datetime'], $appointment_timezone);
|
||||
|
||||
if ($timezone && $timezone !== $provider['timezone'])
|
||||
{
|
||||
$appointment_timezone = new DateTimeZone($timezone);
|
||||
$appointment_start->setTimezone($appointment_timezone);
|
||||
$appointment_end->setTimezone($appointment_timezone);
|
||||
}
|
||||
|
||||
// Prepare template replace array.
|
||||
|
@ -122,12 +143,12 @@ class Email {
|
|||
$email_message = $message->get();
|
||||
$appointment_service = $service['name'];
|
||||
$appointment_provider = $provider['first_name'] . ' ' . $provider['last_name'];
|
||||
$appointment_start_date = date($date_format . ' ' . $timeFormat, strtotime($appointment['start_datetime']));
|
||||
$appointment_end_date = date($date_format . ' ' . $timeFormat, strtotime($appointment['end_datetime']));
|
||||
$appointment_timezone = $timezones[$provider['timezone']];
|
||||
$appointment_link = $appointmentLink->get();
|
||||
$company_link = $company['company_link'];
|
||||
$company_name = $company['company_name'];
|
||||
$appointment_start_date = $appointment_start->format($date_format . ' ' . $time_format);
|
||||
$appointment_end_date = $appointment_end->format($date_format . ' ' . $time_format);
|
||||
$appointment_timezone = $timezones[empty($timezone) ? $provider['timezone'] : $timezone];
|
||||
$appointment_link = $appointment_link_address->get();
|
||||
$company_link = $settings['company_link'];
|
||||
$company_name = $settings['company_name'];
|
||||
$customer_name = $customer['first_name'] . ' ' . $customer['last_name'];
|
||||
$customer_email = $customer['email'];
|
||||
$customer_phone = $customer['phone_number'];
|
||||
|
@ -137,17 +158,17 @@ class Email {
|
|||
require __DIR__ . '/../../application/views/emails/appointment_details.php';
|
||||
$html = ob_get_clean();
|
||||
|
||||
$mailer = $this->_createMailer();
|
||||
$mailer->From = $company['company_email'];
|
||||
$mailer->FromName = $company['company_name'];
|
||||
$mailer->AddAddress($recipientEmail->get());
|
||||
$mailer = $this->create_mailer();
|
||||
$mailer->From = $settings['company_email'];
|
||||
$mailer->FromName = $settings['company_name'];
|
||||
$mailer->AddAddress($recipient_email->get());
|
||||
$mailer->Subject = $title->get();
|
||||
$mailer->Body = $html;
|
||||
$mailer->addStringAttachment($icsStream->get(), 'invitation.ics');
|
||||
$mailer->addStringAttachment($ics_stream->get(), 'invitation.ics');
|
||||
|
||||
if ( ! $mailer->Send())
|
||||
{
|
||||
throw new \RuntimeException('Email could not been sent. Mailer Error (Line ' . __LINE__ . '): '
|
||||
throw new RuntimeException('Email could not been sent. Mailer Error (Line ' . __LINE__ . '): '
|
||||
. $mailer->ErrorInfo);
|
||||
}
|
||||
}
|
||||
|
@ -165,26 +186,31 @@ class Email {
|
|||
* @param array $provider The record data of the appointment provider.
|
||||
* @param array $service The record data of the appointment service.
|
||||
* @param array $customer The record data of the appointment customer.
|
||||
* @param array $company Some settings that are required for this function. By now this array must contain
|
||||
* @param array $settings Some settings that are required for this function. As of now this array must contain
|
||||
* the following values: "company_link", "company_name", "company_email".
|
||||
* @param \EA\Engine\Types\Email $recipientEmail The email address of the email recipient.
|
||||
* @param \EA\Engine\Types\Email $recipient_email The email address of the email recipient.
|
||||
* @param \EA\Engine\Types\Text $reason The reason why the appointment is deleted.
|
||||
* @param string|null $timezone Custom timezone.
|
||||
*
|
||||
* @throws \PHPMailer\PHPMailer\Exception
|
||||
*/
|
||||
public function sendDeleteAppointment(
|
||||
public function send_delete_appointment(
|
||||
array $appointment,
|
||||
array $provider,
|
||||
array $service,
|
||||
array $customer,
|
||||
array $company,
|
||||
EmailAddress $recipientEmail,
|
||||
Text $reason
|
||||
) {
|
||||
array $settings,
|
||||
EmailAddress $recipient_email,
|
||||
Text $reason,
|
||||
$timezone = NULL
|
||||
)
|
||||
{
|
||||
$framework = get_instance();
|
||||
|
||||
|
||||
$timezones = $framework->timezones->to_array();
|
||||
|
||||
switch ($company['date_format'])
|
||||
switch ($settings['date_format'])
|
||||
{
|
||||
case 'DMY':
|
||||
$date_format = 'd/m/Y';
|
||||
|
@ -196,29 +222,38 @@ class Email {
|
|||
$date_format = 'Y/m/d';
|
||||
break;
|
||||
default:
|
||||
throw new \Exception('Invalid date_format value: ' . $company['date_format']);
|
||||
throw new Exception('Invalid date_format value: ' . $settings['date_format']);
|
||||
}
|
||||
|
||||
switch ($company['time_format'])
|
||||
switch ($settings['time_format'])
|
||||
{
|
||||
case 'military':
|
||||
$timeFormat = 'H:i';
|
||||
$time_format = 'H:i';
|
||||
break;
|
||||
case 'regular':
|
||||
$timeFormat = 'g:i A';
|
||||
$time_format = 'g:i A';
|
||||
break;
|
||||
default:
|
||||
throw new \Exception('Invalid time_format value: ' . $company['time_format']);
|
||||
throw new Exception('Invalid time_format value: ' . $settings['time_format']);
|
||||
}
|
||||
|
||||
$appointment_timezone = new DateTimeZone($provider['timezone']);
|
||||
$appointment_start = new DateTime($appointment['start_datetime'], $appointment_timezone);
|
||||
|
||||
if ($timezone && $timezone !== $provider['timezone'])
|
||||
{
|
||||
$appointment_timezone = new DateTimeZone($timezone);
|
||||
$appointment_start->setTimezone($appointment_timezone);
|
||||
}
|
||||
|
||||
// Prepare email template data.
|
||||
$appointment_service = $service['name'];
|
||||
$appointment_provider = $provider['first_name'] . ' ' . $provider['last_name'];
|
||||
$appointment_date = date($date_format . ' ' . $timeFormat, strtotime($appointment['start_datetime']));
|
||||
$appointment_date = $appointment_start->format($date_format . ' ' . $time_format);
|
||||
$appointment_duration = $service['duration'] . ' ' . $this->framework->lang->line('minutes');
|
||||
$appointment_timezone = $timezones[$provider['timezone']];
|
||||
$company_link = $company['company_link'];
|
||||
$company_name = $company['company_name'];
|
||||
$appointment_timezone = $timezones[empty($timezone) ? $provider['timezone'] : $timezone];
|
||||
$company_link = $settings['company_link'];
|
||||
$company_name = $settings['company_name'];
|
||||
$customer_name = $customer['first_name'] . ' ' . $customer['last_name'];
|
||||
$customer_email = $customer['email'];
|
||||
$customer_phone = $customer['phone_number'];
|
||||
|
@ -229,18 +264,18 @@ class Email {
|
|||
require __DIR__ . '/../../application/views/emails/delete_appointment.php';
|
||||
$html = ob_get_clean();
|
||||
|
||||
$mailer = $this->_createMailer();
|
||||
$mailer = $this->create_mailer();
|
||||
|
||||
// Send email to recipient.
|
||||
$mailer->From = $company['company_email'];
|
||||
$mailer->FromName = $company['company_name'];
|
||||
$mailer->AddAddress($recipientEmail->get()); // "Name" argument crushes the phpmailer class.
|
||||
$mailer->From = $settings['company_email'];
|
||||
$mailer->FromName = $settings['company_name'];
|
||||
$mailer->AddAddress($recipient_email->get()); // "Name" argument crushes the phpmailer class.
|
||||
$mailer->Subject = $this->framework->lang->line('appointment_cancelled_title');
|
||||
$mailer->Body = $html;
|
||||
|
||||
if ( ! $mailer->Send())
|
||||
{
|
||||
throw new \RuntimeException('Email could not been sent. Mailer Error (Line ' . __LINE__ . '): '
|
||||
throw new RuntimeException('Email could not been sent. Mailer Error (Line ' . __LINE__ . '): '
|
||||
. $mailer->ErrorInfo);
|
||||
}
|
||||
}
|
||||
|
@ -251,8 +286,10 @@ class Email {
|
|||
* @param \EA\Engine\Types\NonEmptyText $password Contains the new password.
|
||||
* @param \EA\Engine\Types\Email $recipientEmail The receiver's email address.
|
||||
* @param array $company The company settings to be included in the email.
|
||||
*
|
||||
* @throws \PHPMailer\PHPMailer\Exception
|
||||
*/
|
||||
public function sendPassword(NonEmptyText $password, EmailAddress $recipientEmail, array $company)
|
||||
public function send_password(NonEmptyText $password, EmailAddress $recipientEmail, array $company)
|
||||
{
|
||||
$email_title = $this->framework->lang->line('new_account_password');
|
||||
$password = '<strong>' . $password->get() . '</strong>';
|
||||
|
@ -265,7 +302,7 @@ class Email {
|
|||
require __DIR__ . '/../../application/views/emails/new_password.php';
|
||||
$html = ob_get_clean();
|
||||
|
||||
$mailer = $this->_createMailer();
|
||||
$mailer = $this->create_mailer();
|
||||
|
||||
$mailer->From = $company['company_email'];
|
||||
$mailer->FromName = $company['company_name'];
|
||||
|
@ -275,7 +312,7 @@ class Email {
|
|||
|
||||
if ( ! $mailer->Send())
|
||||
{
|
||||
throw new \RuntimeException('Email could not been sent. Mailer Error (Line ' . __LINE__ . '): '
|
||||
throw new RuntimeException('Email could not been sent. Mailer Error (Line ' . __LINE__ . '): '
|
||||
. $mailer->ErrorInfo);
|
||||
}
|
||||
}
|
||||
|
@ -285,7 +322,7 @@ class Email {
|
|||
*
|
||||
* @return PHPMailer
|
||||
*/
|
||||
protected function _createMailer()
|
||||
protected function create_mailer()
|
||||
{
|
||||
$mailer = new PHPMailer();
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ class Boolean extends Type {
|
|||
* @param mixed $value
|
||||
* @return bool
|
||||
*/
|
||||
protected function _validate($value)
|
||||
protected function validate($value)
|
||||
{
|
||||
return is_bool($value);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ class Decimal extends Type {
|
|||
* @param mixed $value
|
||||
* @return bool
|
||||
*/
|
||||
protected function _validate($value)
|
||||
protected function validate($value)
|
||||
{
|
||||
return is_float($value);
|
||||
}
|
||||
|
|
|
@ -21,8 +21,12 @@ namespace EA\Engine\Types;
|
|||
* @package EA\Engine\Types
|
||||
*/
|
||||
class Email extends NonEmptyText {
|
||||
protected function _validate($value)
|
||||
/**
|
||||
* @param mixed $value
|
||||
* @return bool
|
||||
*/
|
||||
protected function validate($value)
|
||||
{
|
||||
return parent::_validate($value) && filter_var($value, FILTER_VALIDATE_EMAIL);
|
||||
return parent::validate($value) && filter_var($value, FILTER_VALIDATE_EMAIL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class Integer extends Type {
|
|||
* @param mixed $value
|
||||
* @return bool
|
||||
*/
|
||||
protected function _validate($value)
|
||||
protected function validate($value)
|
||||
{
|
||||
return is_numeric($value) && ! is_float($value);
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@ class NonEmptyText extends Text {
|
|||
* @param mixed $value
|
||||
* @return bool
|
||||
*/
|
||||
protected function _validate($value)
|
||||
protected function validate($value)
|
||||
{
|
||||
return parent::_validate($value) && $value !== '';
|
||||
return parent::validate($value) && $value !== '';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,11 @@ namespace EA\Engine\Types;
|
|||
* @package EA\Engine\Types
|
||||
*/
|
||||
class Text extends Type {
|
||||
protected function _validate($value)
|
||||
/**
|
||||
* @param mixed $value
|
||||
* @return bool
|
||||
*/
|
||||
protected function validate($value)
|
||||
{
|
||||
return is_string($value);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ abstract class Type {
|
|||
*/
|
||||
public function __construct($value)
|
||||
{
|
||||
if ( ! $this->_validate($value))
|
||||
if ( ! $this->validate($value))
|
||||
{
|
||||
throw new \InvalidArgumentException(__CLASS__ . ': Invalid argument value provided (' . $value . ')');
|
||||
}
|
||||
|
@ -53,5 +53,5 @@ abstract class Type {
|
|||
*
|
||||
* @return bool Returns whether the value is valid or not.
|
||||
*/
|
||||
abstract protected function _validate($value);
|
||||
abstract protected function validate($value);
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@ class UnsignedInteger extends Integer {
|
|||
* @param mixed $value
|
||||
* @return bool
|
||||
*/
|
||||
protected function _validate($value)
|
||||
protected function validate($value)
|
||||
{
|
||||
return parent::_validate($value) && $value > -1;
|
||||
return parent::validate($value) && $value > -1;
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue