Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
attachmenteditmanager.php
1<?php
2
3
5
6
15
21{
26 public function __construct(array $event)
27 {
28 parent::__construct($event);
29 $this->uid = $event['DAV_XML_ID'];
30 }
31
32 public function getUid(): ?string
33 {
34 if ($this->uid)
35 {
36 return $this->uid;
37 }
38
39 if ($this->event['ID'])
40 {
41 $eventFromDb = EventTable::getById($this->event['ID'])->fetch();
42
43 if ($eventFromDb && $eventFromDb['DAV_XML_ID'] && $eventFromDb['DELETED'] === 'N')
44 {
45 $this->uid = $eventFromDb['DAV_XML_ID'];
46
47 return $this->uid;
48 }
49 }
50
51 return null;
52 }
53
58 public function getContent(): string
59 {
62 ->setMethod(mb_strtoupper(SenderRequestInvitation::METHOD))
63 ->setTimezones(Timezone::createInstance()
64 ->setTimezoneId(Helper::getTimezoneObject($event['TZ_FROM']))
65 ->setObservance(StandardObservances::createInstance()
66 ->setOffsetFrom(Helper::getTimezoneObject($event['TZ_FROM']))
67 ->setOffsetTo(Helper::getTimezoneObject($event['TZ_TO']))
68 ->setDTStart()
69 )
70 )
71 ->addEvent(Event::createInstance($this->uid)
72 ->setName($event['NAME'])
73 ->setAttendees($event['ICAL_ATTENDEES'])
74 ->setStartsAt(Util::getDateObject($event['DATE_FROM'], $event['SKIP_TIME'] ?? null, $event['TZ_FROM']))
75 ->setEndsAt(Util::getDateObject($event['DATE_TO'], $event['SKIP_TIME'] ?? null, $event['TZ_TO']))
76 ->setCreatedAt(Util::getDateObject($event['CREATED'] ?? null, false, $event['TZ_FROM']))
77 ->setDtStamp(Util::getDateObject($event['CREATED'] ?? null, false, $event['TZ_FROM']))
78 ->setModified(Util::getDateObject($event['MODIFIED'] ?? null, false, $event['TZ_FROM']))
79 ->setWithTimezone(!($event['SKIP_TIME'] ?? null))
80 ->setWithTime(!($event['SKIP_TIME'] ?? null))
81 ->setOrganizer($event['ICAL_ORGANIZER'], $this->getOrganizerMailTo())
82 ->setDescription($this->prepareDescription($event['DESCRIPTION']))
83 ->setTransparent(Dictionary::TRANSPARENT[$event['ACCESSIBILITY']] ?? Dictionary::TRANSPARENT['busy'])
84 ->setRRule($this->prepareRecurrenceRule($event['RRULE'] ?? null))
85 ->setLocation($event['TEXT_LOCATION'])
86 ->setSequence((int)$event['VERSION'])
87 ->setStatus(Dictionary::EVENT_STATUS['confirmed'])
88 )
89 ->get();
90 }
91}
static createInstance(string $name=null)
Definition calendar.php:27
static getTimezoneObject(string $tz=null)
Definition helper.php:178
static getDateObject(string $date=null, ?bool $fullDay=true, ?string $tz='UTC')
Definition util.php:102