- Модуль: calendar
- Путь к файлу: ~/bitrix/modules/calendar/lib/controller/calendarajax.php
- Класс: BitrixCalendarControllerCalendarAjax
- Вызов: CalendarAjax::getViewEventSliderAction
public function getViewEventSliderAction()
{
$request = $this->getRequest();
$responseParams = [];
$uniqueId = 'calendar_view_slider_' . mt_rand();
$entryId = (int)$request->get('entryId');
$userId = CCalendar::GetCurUserId();
$entry = null;
if ($entryId)
{
$entry = CCalendarEvent::getEventForViewInterface($entryId,
[
'eventDate' => $request->get('dateFrom'),
'timezoneOffset' => (int)$request->get('timezoneOffset'),
'userId' => $userId
]
);
}
else
{
$this->addError(new Error(Loc::getMessage('EC_EVENT_NOT_FOUND'), 'EVENT_NOT_FOUND_01'));
}
if ($entry)
{
$responseParams['uniqueId'] = $uniqueId;
$responseParams['userId'] = $userId;
$responseParams['userTimezone'] = CCalendar::GetUserTimezoneName($userId);
$responseParams['entry'] = $entry;
$responseParams['userIndex'] = CCalendarEvent::getUserIndex();
$responseParams['userSettings'] = UserSettings::get($userId);
$responseParams['plannerFeatureEnabled'] = Bitrix24Manager::isPlannerFeatureEnabled();
$responseParams['entryUrl'] = CHTTP::urlAddParams(
CCalendar::GetPath($entry['CAL_TYPE'], $entry['OWNER_ID'], true),
[
'EVENT_ID' => (int)$entry['ID'],
'EVENT_DATE' => urlencode($entry['DATE_FROM'])
]);
$responseParams['dayOfWeekMonthFormat'] = stripslashes(
BitrixMainContext::getCurrent()
->getCulture()
->getDayOfWeekMonthFormat()
);
$sections = CCalendarSect::GetList([
'arFilter' => [
'ID' => $entry['SECTION_ID'],
'ACTIVE' => 'Y',
],
'checkPermissions' => false,
'getPermissions' => true
]);
$responseParams['section'] = isset($sections[0]) ? $sections[0] : null;
return new BitrixMainEngineResponseComponent(
'bitrix:calendar.view.slider',
'',
[
'id' => $uniqueId,
'event' => $entry,
'type' => CCalendar::GetType(),
'sectionName' => $_REQUEST['section_name'],
'bIntranet' => CCalendar::IsIntranetEnabled(),
'bSocNet' => CCalendar::IsSocNet(),
'AVATAR_SIZE' => 21
],
$responseParams
);
}
$this->addError(new Error(Loc::getMessage('EC_EVENT_NOT_FOUND'), 'EVENT_NOT_FOUND_02'));
return [];
}