- Модуль: mobile
- Путь к файлу: ~/bitrix/modules/mobile/lib/component/loglist.php
- Класс: BitrixMobileComponentLogList
- Вызов: LogList::processEvent
protected function processEvent(&$result, &$cnt, array $eventFields = [], array $options = []): void
{
static $timemanInstalled = null;
static $tasksInstalled = null;
static $listsInstalled = null;
if ($timemanInstalled === null)
{
$timemanInstalled = ModuleManager::isModuleInstalled('timeman');
}
if ($tasksInstalled === null)
{
$tasksInstalled = ModuleManager::isModuleInstalled('tasks');
}
if ($listsInstalled === null)
{
$listsInstalled = ModuleManager::isModuleInstalled('lists');
}
if (
(
!$tasksInstalled
&& $eventFields['EVENT_ID'] === 'tasks'
)
|| (
$eventFields['EVENT_ID'] === 'lists_new_element'
&& !$listsInstalled
)
|| (
in_array($eventFields['EVENT_ID'], [ 'timeman_entry', 'report' ], true)
&& !$timemanInstalled
)
)
{
return;
}
$processorInstance = $this->getProcessorInstance();
if (!$processorInstance)
{
return;
}
if (
$eventFields['EVENT_ID'] === 'crm_activity_add'
&& (int)$eventFields['ENTITY_ID'] > 0
)
{
$this->crmActivityIdList[] = (int)$eventFields['ENTITY_ID'];
}
elseif ($eventFields['EVENT_ID'] === 'tasks')
{
$task2LogList = $this->getTask2LogListValue();
$task2LogList[(int)$eventFields['SOURCE_ID']] = (int)$eventFields['ID'];
$this->setTask2LogListValue($task2LogList);
unset($task2LogList);
}
$cnt++;
if (isset($options['type']))
{
if ($options['type'] === 'main')
{
$result['arLogTmpID'][] = $eventFields['ID'];
$processorInstance->appendEventsList($eventFields);
}
elseif ($options['type'] === 'pinned')
{
$contentId = BitrixSocialnetworkLivefeedProvider::getContentId($eventFields);
if (!empty($contentId['ENTITY_TYPE']))
{
$postProvider = BitrixSocialnetworkLivefeedProvider::init([
'ENTITY_TYPE' => $contentId['ENTITY_TYPE'],
'ENTITY_ID' => $contentId['ENTITY_ID'],
'LOG_ID' => $eventFields['ID']
]);
if ($postProvider)
{
$result['pinnedIdList'][] = $eventFields['ID'];
$eventFields['PINNED_PANEL_DATA'] = [
'TITLE' => $postProvider->getPinnedTitle(),
'DESCRIPTION' => $postProvider->getPinnedDescription()
];
$processorInstance->appendEventsList($eventFields, 'pinned');
}
}
}
}
}