Skip to content

EspoCRM – Open Source CRM Application

fix free busy service

Yuri Kuznetsov985c6fb64b1d
diff --git a/application/Espo/Modules/Crm/Tools/Calendar/Service.php b/application/Espo/Modules/Crm/Tools/Calendar/Service.php
index b2ef0bb660..fe7ac47d6f 100644
--- a/application/Espo/Modules/Crm/Tools/Calendar/Service.php
+++ b/application/Espo/Modules/Crm/Tools/Calendar/Service.php
@@ -708,7 +708,7 @@ class Service
private function fetchWorkingRangeListForTeams(array $teamIdList, FetchParams $fetchParams): array
{
$teamList = iterator_to_array(
- $this->entityManager
+ $this->entityManager
->getRDBRepositoryByClass(Team::class)
->where([Attribute::ID => $teamIdList])
->find()
@@ -794,6 +794,13 @@ class Service
->withFrom($params->from)
->withTo($params->to);
+ if ($fetchParams->getScopeList() === null) {
+ $fetchParams = $fetchParams->withScopeList(
+ $this->config->get('busyRangesEntityList') ??
+ [Meeting::ENTITY_TYPE, Call::ENTITY_TYPE]
+ );
+ }
+
$eventList = $this->fetchInternal($user, $fetchParams->withSkipAcl(), !$params->accessCheck);
$ignoreHash = (object) [];