Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
alextselegidis committed Jul 19, 2021
2 parents 96b694f + 215c4f5 commit df2f169
Show file tree
Hide file tree
Showing 360 changed files with 29,894 additions and 11,770 deletions.
30 changes: 30 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,36 @@
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.

## [1.4.2] - TBA

### Added

- #1004: Add support for line breaks when displaying the service description in the frontend.
- #1040: Support all-day events while syncing with Google Calendar.

### Fixed

- #1000: Small fix for the display of the delete button in table view.
- #1011: Working plan exception - details pane shows incorrect details.
- #1023: Backend calendar table events missing or duplicated.
- #1026: The timepicker sliders do not work when using an iOS device.
- #1029: Enhance SMTP functions of PHPMailer.
- #1043: Unavailable events do not block time from services with multiple attendants.
- #1046: Make sure that saving the modifications of a single break does not cancel any pending break edits.
- #1068: Set minimum service duration field value to honor the value of EVENT_MINIMUM_DURATION.
- #1073: Update PHPMailer dependencies.
- #1074: In case of deletion of one appointment, system sends email to admins anyway even if they have email notifications disabled.
- #1092: Javascript RangeError on appointment change causing disabled calendar dates.
- #961: Timezone/UX issue: Wrong day is selected when timezone differs by -1 day.
- #966: Secretaries are getting notification emails for providers that are not assigned to them.
- #980: Missing Pacific (and potentially other) timezones.
- #982: The Any-Provider option might lead to double bookings, if all the providers have the same number of appointments for the selected date.
- #986: Managed to replicate appointment hash collisions.
- #989: Fix Critical mistake resulting in wrong date
- #990: The API availabilities controller throws an error when generating availability for services with multiple attendants.
- #991: Available hours generated with the "Any Provider" option in the booking page, may use the information of a provider that is not assigned to the selected service.
- #993: Add support for PHP8 (vendor packages need to be updated).

## [1.4.1] - 2020-12-14

### Added
Expand Down
70 changes: 40 additions & 30 deletions application/config/config.php
Expand Up @@ -8,8 +8,8 @@
| Declare some of the global config values of Easy!Appointments.
|
*/
$config['version'] = '1.4.1'; // This must be changed manually.
$config['release_label'] = ''; // Leave empty for no title or add Alpha, Beta etc ...
$config['version'] = '1.4.2'; // This must be changed manually.
$config['release_label'] = 'beta.1'; // Leave empty for no title or add Alpha, Beta etc ...
$config['debug'] = Config::DEBUG_MODE;

/*
Expand Down Expand Up @@ -82,32 +82,41 @@
|
*/

$config['language'] = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ?
[
'ar' => 'arabic',
'bu' => 'bulgarian',
'zh' => 'chinese',
'da' => 'danish',
'nl' => 'dutch',
'en' => 'english',
'fi' => 'finnish',
'fr' => 'french',
'de' => 'german',
'el' => 'greek',
'he' => 'hebrew',
'hi' => 'hindi',
'hu' => 'hungarian',
'it' => 'italian',
'ja' => 'japanese',
'pl' => 'polish',
'pt' => 'portuguese',
'ro' => 'romanian',
'ru' => 'russian',
'sk' => 'slovak',
'es' => 'spanish',
'tr' => 'turkish',
'sv' => 'swedish'
][substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)]
$languages = [
'ar' => 'arabic',
'bu' => 'bulgarian',
'ca' => 'catalan',
'zh' => 'chinese',
'cs' => 'czech',
'da' => 'danish',
'nl' => 'dutch',
'en' => 'english',
'fi' => 'finnish',
'fr' => 'french',
'de' => 'german',
'el' => 'greek',
'he' => 'hebrew',
'hi' => 'hindi',
'hu' => 'hungarian',
'it' => 'italian',
'ja' => 'japanese',
'fa' => 'persian',
'lb' => 'luxembourgish',
'mr' => 'marathi',
'pl' => 'polish',
'pt' => 'portuguese',
'ro' => 'romanian',
'ru' => 'russian',
'sk' => 'slovak',
'es' => 'spanish',
'sv' => 'swedish',
'tr' => 'turkish',
];

$language_code = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) : 'en';

$config['language'] = isset($_SERVER['HTTP_ACCEPT_LANGUAGE'], $languages[$language_code])
? $languages[$language_code]
: Config::LANGUAGE;

/*
Expand Down Expand Up @@ -138,8 +147,9 @@
'hungarian',
'italian',
'japanese',
'marathi',
'luxembourgish',
'marathi',
'persian',
'polish',
'portuguese',
'portuguese-br',
Expand Down Expand Up @@ -304,7 +314,7 @@
| new release.
|
*/
$config['cache_busting_token'] = '924WX';
$config['cache_busting_token'] = '624TB';

/*
|--------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions application/config/email.php
Expand Up @@ -7,6 +7,8 @@
$config['useragent'] = 'Easy!Appointments';
$config['protocol'] = 'mail'; // or 'smtp'
$config['mailtype'] = 'html'; // or 'text'
// $config['smtp_debug'] = '0'; // or '1'
// $config['smtp_auth'] = TRUE; //or FALSE for anonymous relay.
// $config['smtp_host'] = '';
// $config['smtp_user'] = '';
// $config['smtp_pass'] = '';
Expand Down
16 changes: 9 additions & 7 deletions application/controllers/Appointments.php
Expand Up @@ -340,7 +340,7 @@ public function ajax_get_available_hours()
// that will provide the requested service.
if ($provider_id === ANY_PROVIDER)
{
$provider_id = $this->search_any_provider($selected_date, $service_id);
$provider_id = $this->search_any_provider($service_id, $selected_date);

if ($provider_id === NULL)
{
Expand Down Expand Up @@ -378,14 +378,15 @@ public function ajax_get_available_hours()
*
* This method will return the database ID of the provider with the most available periods.
*
* @param string $date The date to be searched (Y-m-d).
* @param int $service_id The requested service ID.
* @param string $date The date to be searched (Y-m-d).
* @param string $hour The hour to be searched (H:i).
*
* @return int Returns the ID of the provider that can provide the service at the selected date.
*
* @throws Exception
*/
protected function search_any_provider($date, $service_id)
protected function search_any_provider($service_id, $date, $hour = null)
{
$available_providers = $this->providers_model->get_available_providers();

Expand All @@ -404,7 +405,7 @@ protected function search_any_provider($date, $service_id)
// Check if the provider is available for the requested date.
$available_hours = $this->availability->get_available_hours($date, $service, $provider);

if (count($available_hours) > $max_hours_count)
if (count($available_hours) > $max_hours_count && (empty($hour) || in_array($hour, $available_hours, false)))
{
$provider_id = $provider['id'];
$max_hours_count = count($available_hours);
Expand Down Expand Up @@ -527,12 +528,13 @@ protected function check_datetime_availability()

$appointment = $post_data['appointment'];

$date = date('Y-m-d', strtotime($appointment['start_datetime']));
$appointment_start = new DateTime($appointment['start_datetime']);
$date = $appointment_start->format('Y-m-d');
$hour = $appointment_start->format('H:i');

if ($appointment['id_users_provider'] === ANY_PROVIDER)
{

$appointment['id_users_provider'] = $this->search_any_provider($date, $appointment['id_services']);
$appointment['id_users_provider'] = $this->search_any_provider($appointment['id_services'], $date, $hour);

return $appointment['id_users_provider'];
}
Expand Down
1 change: 1 addition & 0 deletions application/controllers/Backend_api.php
Expand Up @@ -88,6 +88,7 @@ public function ajax_get_calendar_events()
$appointment['service'] = $this->services_model->get_row($appointment['id_services']);
$appointment['customer'] = $this->customers_model->get_row($appointment['id_users_customer']);
}
unset ($appointment);

$user_id = $this->session->userdata('user_id');
$role_slug = $this->session->userdata('role_slug');
Expand Down
16 changes: 11 additions & 5 deletions application/controllers/Google.php
Expand Up @@ -184,7 +184,17 @@ public static function sync($provider_id = NULL)

if ($google_event->getStart()->getDateTime() === $google_event->getEnd()->getDateTime())
{
continue; // Skip all day events
$event_start = new DateTime($google_event->getStart()->getDate());
$event_start->setTimezone($provider_timezone);
$event_end = new DateTime($google_event->getEnd()->getDate());
$event_end->setTimezone($provider_timezone);
}
else
{
$event_start = new DateTime($google_event->getStart()->getDateTime());
$event_start->setTimezone($provider_timezone);
$event_end = new DateTime($google_event->getEnd()->getDateTime());
$event_end->setTimezone($provider_timezone);
}

$results = $CI->appointments_model->get_batch(['id_google_calendar' => $google_event->getId()]);
Expand All @@ -194,10 +204,6 @@ public static function sync($provider_id = NULL)
continue;
}

$event_start = new DateTime($google_event->getStart()->getDateTime());
$event_start->setTimezone($provider_timezone);
$event_end = new DateTime($google_event->getEnd()->getDateTime());
$event_end->setTimezone($provider_timezone);

// Record doesn't exist in the Easy!Appointments, so add the event now.
$appointment = [
Expand Down

0 comments on commit df2f169

Please sign in to comment.