21 $model = $this->getAccessEventModel($this->
getId());
24 $this->canEdit = $controller->check(ActionDictionary::ACTION_EVENT_EDIT, $model);
25 $this->canEditAttendees = $controller->check(ActionDictionary::ACTION_EVENT_EDIT_ATTENDEES, $model);
26 $this->canEditLocation = $controller->check(ActionDictionary::ACTION_EVENT_EDIT_LOCATION, $model);
28 if (!($this->canEdit || $this->canEditAttendees || $this->canEditLocation))
40 'ID' => $this->getParentEventId(),
45 $meetingHost =
$params[
'meeting_host'] ?? \CCalendar::GetUserId();
47 $entryFields = array_merge($entryFields, [
48 'DATE_FROM' =>
$params[
'dates'][
'date_from'],
49 'DATE_TO' =>
$params[
'dates'][
'date_to'],
50 'SKIP_TIME' =>
$params[
'dates'][
'skip_time'],
51 'TZ_FROM' =>
$params[
'timezones'][
'timezone_from'],
52 'TZ_TO' =>
$params[
'timezones'][
'timezone_to'],
54 'DESCRIPTION' =>
$params[
'description'],
57 'ACCESSIBILITY' =>
$params[
'accessibility'],
58 'IMPORTANCE' =>
$params[
'importance'],
59 'PRIVATE_EVENT' =>
$params[
'private_event'],
62 'SECTION_CAL_TYPE' => $section[
'CAL_TYPE'],
63 'SECTION_OWNER_ID' => $section[
'OWNER_ID'],
64 'MEETING_HOST' => $meetingHost,
66 'HOST_NAME' => \CCalendar::GetUserName($meetingHost),
67 'NOTIFY' =>
$params[
'meeting_notify'] ===
'Y',
68 'REINVITE' =>
$params[
'meeting_reinvite'] ===
'Y',
69 'ALLOW_INVITE' =>
$params[
'allow_invite'] ===
'Y',
70 'MEETING_CREATOR' => $meetingHost,
71 'HIDE_GUESTS' =>
$params[
'hide_guests'] ===
'Y',
72 'CHAT_ID' =>
$params[
'chat_id'] ??
null,
79 if ($this->canEdit || $this->canEditAttendees)
82 $entryFields[
'ATTENDEES'] = \CCalendar::GetDestinationUsers($entryFields[
'ATTENDEES_CODES']);
83 $entryFields[
'IS_MEETING'] = $this->
isMeeting($entryFields[
'ATTENDEES_CODES']);
89 if ($this->canEdit || $this->canEditLocation)
91 $entryFields[
'LOCATION'] =
$params[
'location'];
93 if (!AccessibilityManager::checkAccessibility($entryFields[
'LOCATION'], [
'fields' => $entryFields]))
99 $newId = \CCalendar::SaveEvent([
100 'arFields' => $entryFields,
102 'silentErrorMode' =>
false,
103 'recursionEditMode' =>
$params[
'rec_edit_mode'],
104 'currentEventDateFrom' =>
$params[
'current_date_from'],
105 'sendInvitesToDeclined' =>
$params[
'send_invites_again'],
106 'requestUid' =>
$params[
'request_uid'],
107 'checkLocationOccupancy' =>
$params[
'check_location_occupancy'],
108 'checkPermission' =>
false,
111 $errors = \CCalendar::GetErrors();