Skip to content

EspoCRM – Open Source CRM Application

Ref

Yuriiccdd5fcbfb1e
diff --git a/application/Espo/Modules/Crm/Tools/Calendar/Service.php b/application/Espo/Modules/Crm/Tools/Calendar/Service.php
index bcdc56c992..e7991651ca 100644
--- a/application/Espo/Modules/Crm/Tools/Calendar/Service.php
+++ b/application/Espo/Modules/Crm/Tools/Calendar/Service.php
@@ -602,7 +602,7 @@ class Service
{
$scopeList = $fetchParams->getScopeList();
- $brScopeList = $this->config->get('busyRangesEntityList') ?? [Meeting::ENTITY_TYPE, Call::ENTITY_TYPE];
+ $brScopeList = $this->getBusyRangesEntityList();
if ($scopeList) {
foreach ($scopeList as $s) {
@@ -832,10 +832,7 @@ class Service
->withTo($params->to);
if ($fetchParams->getScopeList() === null) {
- $fetchParams = $fetchParams->withScopeList(
- $this->config->get('busyRangesEntityList') ??
- [Meeting::ENTITY_TYPE, Call::ENTITY_TYPE]
- );
+ $fetchParams = $fetchParams->withScopeList($this->getBusyRangesEntityList());
}
$eventList = $this->fetchInternal($user, $fetchParams->withSkipAcl(), !$params->accessCheck);
@@ -1004,7 +1001,7 @@ class Service
?string $ignoreId = null
): array {
- $scopeList = $this->config->get('busyRangesEntityList') ?? [Meeting::ENTITY_TYPE, Call::ENTITY_TYPE];
+ $scopeList = $this->getBusyRangesEntityList();
if ($entityType) {
if (!$this->acl->check($entityType)) {
@@ -1112,4 +1109,12 @@ class Service
return $this->applicationConfig->getTimeZone();
}
+
+ /**
+ * @return string[]
+ */
+ private function getBusyRangesEntityList(): array
+ {
+ return $this->config->get('busyRangesEntityList') ?? [Meeting::ENTITY_TYPE, Call::ENTITY_TYPE];
+ }
}