3namespace Bitrix\Calendar\Sync\Icloud;
5use Bitrix\Calendar\Core\Section\Section;
6use Bitrix\Calendar\Sync\Connection\Connection;
7use Bitrix\Calendar\Sync\Connection\SectionConnection;
8use Bitrix\Calendar\Sync\Connection\Server;
9use Bitrix\Calendar\Core;
10use Bitrix\Calendar\Sync\Managers\SectionManagerInterface;
11use Bitrix\Calendar\Sync\Push\Push;
12use Bitrix\Calendar\Sync\Util\Result;
13use Bitrix\Calendar\Sync\Util\SectionContext;
15use Bitrix\Main\LoaderException;
31 $data = $this->getApiService()->createSection(
$path, $section);
33 if ($this->getApiService()->
getError())
35 $this->processConnectionError($this->connection, $this->getApiService()->
getError());
41 'id' =>
$data[
'XML_ID'],
42 'version' =>
$data[
'MODIFICATION_LABEL']
47 $result->addError(
new Error(
'Error while trying to save section'));
64 $data = $this->getApiService()->updateSection(
$context->getSectionConnection()->getVendorSectionId(), $section);
66 if ($this->getApiService()->
getError())
68 $this->processConnectionError($this->connection, $this->getApiService()->
getError());
74 'id' =>
$data[
'XML_ID'],
75 'version' =>
$data[
'MODIFICATION_LABEL']
83 'error' =>
$data[
'ERROR']
87 $result->addError(
new Error(
'Error while trying to update section'));
104 $data = $this->getApiService()->deleteSection(
$context->getSectionConnection()->getVendorSectionId());
106 if ($this->getApiService()->
getError())
108 $this->processConnectionError($this->connection, $this->getApiService()->
getError());
113 $result->addError(
new Error(
'Error while trying to delete section'));
124 if (!$this->apiService)
129 return $this->apiService;
162 $data = $this->getApiService($server)->getSectionsList(
$connection->getServer()->getBasePath());
165 foreach (
$data as $section)
167 if ($section[
'supported-calendar-component-set'] ===
'VEVENT')
170 'XML_ID' => $section[
'href'],
171 'NAME' => $section[
'displayname'],
172 'DESCRIPTION' => $section[
'calendar-description'],
173 'TYPE' => $section[
'supported-calendar-component-set'],
174 'COLOR' => $section[
'calendar-color'],
175 'MODIFICATION_LABEL' => $section[
'getctag'],
186 return [Helper::ACCOUNT_TYPE];
198 \CDavConnection::SetLastResult(
$connection->getId(), $parsedError);
prepareServerData(Server $server)
getAvailableExternalType()
getSections(Connection $connection)
create(Section $section, SectionContext $context)
subscribe(SectionConnection $link)
update(Section $section, SectionContext $context)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)