5use Bitrix\Crm\Activity\Provider\Tasks\Task;
29 ($this->logPageProcessorInstance ===
null)
33 $this->logPageProcessorInstance = $this->
getComponent()->getLogPageProcessorInstance();
40 $this->filterData = $value;
54 return ($this->filterData[$key] ??
false);
59 $this->filterContent = $value;
69 $this->select = $value;
79 $this->eventsList[$type] = $value;
89 if (!isset($this->eventsList[$type]))
91 $this->eventsList[$type] = [];
94 $this->eventsList[$type][$key] = $value;
99 if (!isset($this->eventsList[$type]))
101 $this->eventsList[$type] = [];
104 $this->eventsList[$type][] = $value;
114 if (!isset($this->eventsList[$type]))
119 unset($this->eventsList[$type][$key]);
124 return $this->eventsList[$type] ?? [];
139 static $siteDateFormatShort =
null;
140 static $siteDateFormatFull =
null;
142 if ($siteDateFormatShort ===
null)
144 $siteDateFormatShort = \CSite::getDateFormat(
'SHORT');
146 if ($siteDateFormatFull ===
null)
148 $siteDateFormatFull = \CSite::getDateFormat();
151 return makeTimeStamp($value, ($type ===
'SHORT' ? $siteDateFormatShort : $siteDateFormatFull));
159 $params[
'SET_TITLE'] ===
'Y'
160 || $params[
'SET_NAV_CHAIN'] !==
'N'
161 || $params[
'GROUP_ID'] > 0
164 if ($params[
'ENTITY_TYPE'] === SONET_ENTITY_USER)
166 $res = \CUser::getById($params[
'USER_ID']);
167 $result[
'User'] = $res->fetch();
169 elseif ($params[
'ENTITY_TYPE'] === SONET_ENTITY_GROUP)
171 $result[
'Group'] = \CSocNetGroup::getById($params[
'GROUP_ID']);
174 $result[
'Group'][
'OPENED'] ===
'Y'
178 \CSocNetUserToGroup::getUserRole($result[
'currentUserId'], $result[
'Group'][
'ID']),
184 $result[
'Group'][
'READ_ONLY'] =
'Y';
196 if ($params[
'LOG_ID'] > 0)
199 $this->showPinnedPanel =
false;
202 $turnFollowModeOff =
false;
204 if (isset($params[
'DISPLAY']))
206 $result[
'SHOW_UNREAD'] =
'N';
208 if (in_array($params[
'DISPLAY'], [
'forme',
'my']))
210 $accessCodesList = $USER->getAccessCodes();
211 foreach ($accessCodesList as $i => $code)
213 if (!preg_match(
'/^(U|D|DR)/', $code))
215 unset($accessCodesList[$i]);
221 if ($params[
'DISPLAY'] ===
'forme')
223 $this->
setFilterKey(
'!USER_ID', $result[
'currentUserId']);
225 elseif ($params[
'DISPLAY'] ===
'mine')
227 $this->
setFilterKey(
'USER_ID', $result[
'currentUserId']);
229 elseif (is_numeric($params[
'DISPLAY']))
231 $this->
setFilterKey(
'USER_ID', (
int)$params[
'DISPLAY']);
235 is_numeric($params[
'DISPLAY'])
236 || in_array($params[
'DISPLAY'], [
'forme',
'mine'])
239 $result[
'IS_FILTERED'] =
true;
241 $this->showPinnedPanel =
false;
245 !empty($params[
'DESTINATION'])
246 && is_array($params[
'DESTINATION'])
249 $this->
setFilterKey(
'LOG_RIGHTS', $params[
'DESTINATION']);
250 if (count($params[
'DESTINATION']) == 1)
252 $code = array_shift($params[
'DESTINATION']);
253 if (preg_match(
'/^U(\d+)$/', $code, $matches))
260 $params[
'MODE'] ===
'LANDING'
261 && !empty($params[
'DESTINATION_AUTHOR_ID'])
262 && (
int)$params[
'DESTINATION_AUTHOR_ID'] > 0
265 $this->
setFilterKey(
'USER_ID', (
int)$params[
'DESTINATION_AUTHOR_ID']);
268 elseif ($params[
'GROUP_ID'] > 0)
270 $this->
setFilterKey(
'LOG_RIGHTS',
'SG'.$params[
'GROUP_ID']);
273 isset($result[
'Group'])
274 && $result[
'Group'][
'OPENED'] ===
'Y'
280 $result[
'SHOW_FOLLOW_CONTROL'] =
'N';
281 $this->showPinnedPanel =
false;
283 elseif ($params[
'TO_USER_ID'] > 0)
285 $this->
setFilterKey(
'LOG_RIGHTS',
'U'.$params[
'TO_USER_ID']);
288 $result[
'SHOW_FOLLOW_CONTROL'] =
'N';
290 $res = UserTable::getList([
292 '=ID' => $params[
'TO_USER_ID']
294 'select' => [
'ID',
'NAME',
'LAST_NAME',
'SECOND_NAME',
'LOGIN' ]
296 if ($userFields = $res->fetch())
298 $result[
'ToUser'] = [
299 'ID' => $userFields[
'ID'],
300 'NAME' => \CUser::formatName($params[
'NAME_TEMPLATE'], $userFields, $this->
getComponent()->useLogin)
304 elseif ($params[
'USER_ID'] > 0)
309 elseif ($params[
'ENTITY_TYPE'] <>
'')
311 $this->
setFilterKey(
'ENTITY_TYPE', $params[
'ENTITY_TYPE']);
314 if ($params[
'~TAG'] <>
'')
317 $turnFollowModeOff =
true;
319 elseif ($params[
'FIND'] <>
'')
322 $this->showPinnedPanel =
false;
326 isset($params[
'!EXACT_EVENT_ID'])
327 && $params[
'!EXACT_EVENT_ID'] <>
''
330 $this->
setFilterKey(
'!EVENT_ID', $params[
'!EXACT_EVENT_ID']);
331 $turnFollowModeOff =
true;
335 isset($params[
'EXACT_EVENT_ID'])
336 && $params[
'EXACT_EVENT_ID'] <>
''
339 $this->
setFilterKey(
'EVENT_ID', [ $params[
'EXACT_EVENT_ID'] ]);
340 $turnFollowModeOff =
true;
343 isset($params[
'EVENT_ID'])
344 && is_array($params[
'EVENT_ID'])
347 if (!in_array(
'all', $params[
'EVENT_ID'],
true))
350 foreach ($params[
'EVENT_ID'] as $eventId)
352 $eventIdList = array_merge($eventIdList, \CSocNetLogTools::findFullSetByEventID($eventId));
355 if (!empty($eventIdList))
357 $this->
setFilterKey(
'EVENT_ID', array_unique($eventIdList));
359 $turnFollowModeOff =
true;
363 isset($params[
'EVENT_ID'])
364 && $params[
'EVENT_ID'] <>
''
367 $this->
setFilterKey(
'EVENT_ID', \CSocNetLogTools::findFullSetByEventID($params[
'EVENT_ID']));
368 $turnFollowModeOff =
true;
370 elseif ($this->
getComponent()->getPresetFilterIdValue() ===
'extranet')
372 $turnFollowModeOff =
true;
375 if ($params[
'CREATED_BY_ID'] > 0)
379 $this->
setFilterKey(
'USER_ID|COMMENT_USER_ID', $params[
'CREATED_BY_ID']);
383 $this->
setFilterKey(
'USER_ID', $params[
'CREATED_BY_ID']);
386 $turnFollowModeOff =
true;
389 if ($params[
'GROUP_ID'] > 0)
391 $result[
'IS_FILTERED'] =
true;
395 isset($params[
'FLT_ALL'])
396 && $params[
'FLT_ALL'] ===
'Y'
402 if (isset($params[
'FILTER_SITE_ID']))
404 $this->
setFilterKey(
'SITE_ID', $params[
'FILTER_SITE_ID']);
406 elseif ($params[
'MODE'] !==
'LANDING')
409 $result[
'isExtranetSite']
416 isset($params[
'LOG_DATE_FROM'])
417 && $params[
'LOG_DATE_FROM'] <>
''
421 $this->
setFilterKey(
'>=LOG_DATE', $params[
'LOG_DATE_FROM']);
422 $turnFollowModeOff =
true;
426 unset($_REQUEST[
'flt_date_from']);
430 isset($params[
'LOG_DATE_TO'])
431 && $params[
'LOG_DATE_TO'] <>
''
436 $turnFollowModeOff =
true;
441 unset($_REQUEST[
'flt_date_to']);
446 if ($params[
'IS_CRM'] ===
'Y')
448 if (Loader::includeModule(
'crm'))
450 $result[
'CRM_ENTITY_TYPE_NAME'] = \CCrmOwnerType::resolveName(\CCrmLiveFeedEntity::resolveEntityTypeID($params[
'CRM_ENTITY_TYPE']));
451 $result[
'CRM_ENTITY_ID'] = $params[
'CRM_ENTITY_ID'];
455 $params[
'CRM_ENTITY_TYPE'] <>
''
459 $result[
'SHOW_UNREAD'] =
'N';
461 $this->showPinnedPanel =
false;
464 $result[
'presetFilterTopIdValue'] = $this->
getComponent()->getPresetFilterTopIdValue();
465 $result[
'presetFilterIdValue'] = $this->
getComponent()->getPresetFilterIdValue();
469 !isset($params[
'USE_FAVORITES'])
470 || $params[
'USE_FAVORITES'] !==
'N'
472 && isset($params[
'FAVORITES'])
473 && $params[
'FAVORITES'] ===
'Y'
477 $result[
'SHOW_UNREAD'] =
'N';
480 if ($turnFollowModeOff)
482 $result[
'SHOW_UNREAD'] =
'N';
483 $result[
'SHOW_FOLLOW_CONTROL'] =
'N';
484 $result[
'IS_FILTERED'] =
true;
488 $params[
"IS_CRM"] !==
"Y"
495 if (empty($notEventIdFilter))
497 $notEventIdFilter = [];
499 elseif (!is_array($notEventIdFilter))
501 $notEventIdFilter = [ $notEventIdFilter ];
504 if (empty($eventIdFilter))
508 elseif (!is_array($eventIdFilter))
510 $eventIdFilter = [ $eventIdFilter ];
513 if (ModuleManager::isModuleInstalled(
'tasks'))
515 $notEventIdFilter = array_merge($notEventIdFilter, [
'tasks' ]);
516 $eventIdFilter = array_filter($eventIdFilter,
static function($eventId) {
return ($eventId !==
'tasks'); });
519 ModuleManager::isModuleInstalled(
'crm')
520 && Option::get(
'crm',
'enable_livefeed_merge',
'N') ===
'Y'
523 $notEventIdFilter = array_merge($notEventIdFilter, [
'crm_activity_add' ]);
524 $eventIdFilter = array_filter($eventIdFilter,
static function($eventId) {
return ($eventId !==
'crm_activity_add'); });
527 if (!empty($notEventIdFilter))
534 $result[
'USE_PINNED'] =
'N';
535 $result[
'SHOW_PINNED_PANEL'] =
'N';
538 $result[
'currentUserId'] > 0
539 && $params[
'MODE'] !==
'LANDING'
540 && $params[
'IS_CRM'] !==
'Y'
543 $result[
'USE_PINNED'] =
'Y';
545 if ($this->showPinnedPanel)
548 $result[
'SHOW_PINNED_PANEL'] =
'Y';
561 defined(
'SITE_TEMPLATE_ID')
562 && SITE_TEMPLATE_ID ===
'bitrix24'
565 isset($params[
'siteTemplateId'])
566 && in_array($params[
'siteTemplateId'], [
'bitrix24',
'landing24' ])
569 && (
int)$params[
'LOG_ID'] <= 0
571 $request->get(
'useBXMainFilter') ===
'Y'
572 || (($params[
'useBXMainFilter'] ??
'') ===
'Y')
577 $filterOption = new \Bitrix\Main\UI\Filter\Options($result[
'FILTER_ID']);
580 $result[
'FILTER_USED'] = (!empty(
$filterData) ?
'Y' :
'N');
586 && preg_match(
'/^SG(\d+)$/',
$filterData[
'GROUP_ID'], $matches)
589 $this->
setFilterKey(
'LOG_RIGHTS',
'SG' . (
int)$matches[1]);
594 && preg_match(
'/^U(\d+)$/',
$filterData[
'AUTHOR_ID'], $matches)
602 && preg_match(
'/^U(\d+)$/',
$filterData[
'CREATED_BY_ID'], $matches)
611 if (preg_match(
'/^U(\d+)$/',
$filterData[
'TO'], $matches))
613 $this->
setFilterKey(
'LOG_RIGHTS',
'U' . (
int)$matches[1]);
619 elseif (preg_match(
'/^SG(\d+)$/',
$filterData[
'TO'], $matches))
621 $this->
setFilterKey(
'LOG_RIGHTS',
'SG' . (
int)$matches[1]);
623 elseif (preg_match(
'/^DR(\d+)$/',
$filterData[
'TO'], $matches))
625 $this->
setFilterKey(
'LOG_RIGHTS',
'DR' . (
int)$matches[1]);
653 foreach (
$filterData[
'EVENT_ID'] as $filterEventId)
656 if (in_array($filterEventId, [
'blog_post_important',
'blog_post_grat',
'blog_post_vote' ]))
658 $eventIdFilterValue[] = $filterEventId;
662 $eventIdFilterValue = array_merge($eventIdFilterValue, \CSocNetLogTools::findFullSetByEventID($filterEventId));
665 $this->
setFilterKey(
'EVENT_ID', array_unique($eventIdFilterValue));
688 if ($findValue !==
'')
697 && Loader::includeModule(
'extranet')
701 $this->
setFilterKey(
'SITE_ID', \CExtranet::getExtranetSiteID());
702 $this->
setFilterKey(
'!EVENT_ID', [
'lists_new_element',
'tasks',
'timeman_entry',
'report',
'crm_activity_add' ]);
725 $this->
setFilterKey(
'<=CONTENT_DATE_CREATE', $dateCreateToValue);
736 $params[
'SET_LOG_COUNTER'] =
'N';
737 $params[
'SET_LOG_PAGE_CACHE'] =
'N';
738 $params[
'USE_FOLLOW'] =
'N';
739 $params[
'SHOW_UNREAD'] =
'N';
743 $result[
'SHOW_UNREAD'] =
'N';
744 $result[
'IS_FILTERED'] =
true;
745 $this->showPinnedPanel =
false;
750 defined(
'SITE_TEMPLATE_ID')
751 && SITE_TEMPLATE_ID ===
'bitrix24'
753 || $params[
'MODE'] ===
'LANDING'
756 $filterOption = new \Bitrix\Main\UI\Filter\Options($result[
'FILTER_ID']);
757 $filterOption->reset();
760 $this->setComposition();
764 $params[
'TAG'] !==
''
765 || $params[
'FIND'] !==
''
767 && $this->
getRequest()->
get(
'apply_filter') ===
'Y'
770 $this->
getComponent()->arParams[
'useBXMainFilter'] =
'Y';
782 'nPageSize' => $params[
'PAGE_SIZE'],
784 'iNavAddRecords' => 1,
785 'bSkipPageReset' =>
true,
786 'nRecordCount' => 1000000
788 if ($params[
'LOG_CNT'] > 0)
791 'nTopCount' => $params[
'LOG_CNT']
793 $result[
'PAGE_NUMBER'] = 1;
797 !$result[
'AJAX_CALL']
798 || $result[
'bReload']
802 'nTopCount' => $params[
'PAGE_SIZE']
804 $result[
'PAGE_NUMBER'] = 1;
807 elseif ((
int)
$request->get(
'PAGEN_' . ($NavNum + 1)) > 0)
809 $result[
'PAGE_NUMBER'] = (int)
$request->get(
'PAGEN_' . ($NavNum + 1));
811 elseif ((
int)$params[
'PAGE_NUMBER'] > 0)
813 $result[
'PAGE_NUMBER'] = (int)$params[
'PAGE_NUMBER'];
815 $navParams[
'iNumPage'] = $result[
'PAGE_NUMBER'];
825 !empty($params[
'ORDER'])
826 && is_array($params[
'ORDER'])
831 elseif ($this->
getComponent()->getCommentsNeededValue())
836 : [
'LOG_UPDATE' =>
'DESC' ]
839 elseif ($params[
'USE_FOLLOW'] ===
'Y')
841 $this->
setOrder([
'DATE_FOLLOW' =>
'DESC' ]);
843 elseif ($params[
'USE_COMMENTS'] ===
'Y')
847 ? [
'CONTENT_LOG_UPDATE' =>
'DESC' ]
848 : [
'LOG_UPDATE' =>
'DESC' ]
855 $res = getModuleEvents(
'socialnetwork',
'OnBuildSocNetLogOrder');
856 while ($eventFields = $res->fetch())
858 executeModuleEventEx($eventFields, [ &
$order, $params ]);
868 $result[
'LAST_LOG_TS'] = (isset($params[
'LAST_LOG_TIMESTAMP']) ? (int)$params[
'LAST_LOG_TIMESTAMP'] : (int)
$request->get(
'ts'));
871 $params[
'LOG_ID'] <= 0
873 !$result[
'AJAX_CALL']
874 || $result[
'bReload']
878 $result[
'LAST_LOG_TS'] = \CUserCounter::getLastDate($result[
'currentUserId'], $result[
'COUNTER_TYPE']);
880 if ($result[
'LAST_LOG_TS'] == 0)
882 $result[
'LAST_LOG_TS'] = 1;
888 $result[
'LAST_LOG_TS'] -= $result[
'TZ_OFFSET'];
897 if ($params[
'IS_CRM'] ===
'Y')
901 'CHECK_CRM_RIGHTS' =>
'Y'
905 'ENTITY_TYPE' => $params[
'CRM_ENTITY_TYPE'],
906 'ENTITY_ID' => $params[
'CRM_ENTITY_ID'],
907 'AFFECTED_TYPES' => [],
910 isset($params[
'CUSTOM_DATA'])
911 && is_array($params[
'CUSTOM_DATA'])
912 ? $params[
'CUSTOM_DATA']
918 $res = getModuleEvents(
'socialnetwork',
'OnBuildSocNetLogFilter');
919 while ($eventFields = $res->fetch())
922 executeModuleEventEx($eventFields, [ &
$filter, &$filterParams, &$params ]);
932 $params[
'PUBLIC_MODE'] !==
'Y'
933 && ModuleManager::isModuleInstalled(
'crm')
937 Option::get(
'crm',
'enable_livefeed_merge',
'N') ===
'Y'
941 && preg_match(
'/^SG(\d+)$/', $this->
getFilterKey(
'LOG_RIGHTS'), $matches)
944 : [
'crm',
'crm_shared' ]
948 $this->
setListParamsKey(
'CHECK_RIGHTS', ($params[
'MODE'] !==
'LANDING' ?
'Y' :
'N'));
951 $params[
'MODE'] !==
'LANDING'
952 && $params[
'LOG_ID'] <= 0
961 $params[
'USE_FOLLOW'] !==
'N'
962 && !ModuleManager::isModuleInstalled(
'intranet')
966 $result[
'USE_SMART_FILTER'] =
'Y';
968 \CSocNetLogSmartFilter::getDefaultValue($result[
'currentUserId']) ===
'Y'
975 $result[
'isExtranetSite']
977 || $this->
getComponent()->getPresetFilterIdValue() ===
'extranet'
990 if ($params[
'USE_FOLLOW'] ===
'Y')
1001 isset($params[
'USE_FAVORITES'])
1002 && $params[
'USE_FAVORITES'] ===
'N'
1009 empty($result[
'RETURN_EMPTY_LIST'])
1010 && !empty($params[
'EMPTY_EXPLICIT'])
1011 && $params[
'EMPTY_EXPLICIT'] ===
'Y'
1017 if ($result[
'USE_PINNED'] ===
'Y')
1025 if (!empty($componentResult[
'GRAT_POST_FILTER']))
1028 $this->
setFilterKey(
'SOURCE_ID', $componentResult[
'GRAT_POST_FILTER']);
1037 'ID',
'TMP_ID',
'MODULE_ID',
1038 'LOG_DATE',
'LOG_UPDATE',
'DATE_FOLLOW',
1039 'ENTITY_TYPE',
'ENTITY_ID',
'EVENT_ID',
'SOURCE_ID',
'USER_ID',
'FOLLOW',
1040 'RATING_TYPE_ID',
'RATING_ENTITY_ID',
1045 !isset($params[
'USE_FAVORITES'])
1046 || $params[
'USE_FAVORITES'] !==
'N'
1049 $select[] =
'FAVORITES_USER_ID';
1052 if ($result[
'currentUserId'] > 0)
1062 $diskUFEntityList = $this->
getComponent()->getDiskUFEntityListValue();
1064 !empty($diskUFEntityList[
'SONET_LOG'])
1065 || !empty($diskUFEntityList[
'BLOG_POST'])
1068 $res = getModuleEvents(
'socialnetwork',
'OnAfterFetchDiskUfEntity');
1069 while ($eventFields = $res->fetch())
1071 executeModuleEventEx($eventFields, [ $diskUFEntityList ]);
1078 $activity2LogList = $this->
getComponent()->getActivity2LogListValue();
1081 !empty($activity2LogList)
1082 && Loader::includeModule(
'crm')
1083 && Loader::includeModule(
'tasks')
1086 $res = \CCrmActivity::getList(
1089 '@ID' => array_keys($activity2LogList),
1090 'CHECK_PERMISSIONS' =>
'N'
1094 [
'ID',
'ASSOCIATED_ENTITY_ID',
'TYPE_ID',
'PROVIDER_ID']
1097 ($activityFields = $res->fetch())
1098 && ((
int)$activityFields[
'ASSOCIATED_ENTITY_ID'] > 0)
1102 (
int)$activityFields[
'TYPE_ID'] === \CCrmActivityType::Task
1104 (
int)$activityFields[
'TYPE_ID'] === \CCrmActivityType::Provider
1105 && $activityFields[
'PROVIDER_ID'] === Task::getId()
1111 $taskItem = new \CTaskItem((
int)$activityFields[
'ASSOCIATED_ENTITY_ID'], $result[
'currentUserId']);
1112 if (!$taskItem->checkCanRead())
1114 $activity2LogList = $this->
getComponent()->getActivity2LogListValue();
1115 unset($activity2LogList[$activityFields[
'ID']]);
1116 $this->
getComponent()->setActivity2LogListValue($activity2LogList);
1117 unset($activity2LogList);
1121 $task2LogList = $this->
getComponent()->getTask2LogListValue();
1122 $task2LogList[(int)$activityFields[
'ASSOCIATED_ENTITY_ID']] = (
int)$activity2LogList[$activityFields[
'ID']];
1123 $this->
getComponent()->setTask2LogListValue($task2LogList);
1124 unset($task2LogList);
1127 catch (\CTaskAssertException $e)
1141 $result[
'NEXT_PAGE_SIZE'] = 0;
1144 isset(
$filter[
'>=LOG_UPDATE'])
1145 && count($result[
'arLogTmpID']) < $params[
'PAGE_SIZE']
1148 $result[
'NEXT_PAGE_SIZE'] = count($result[
'arLogTmpID']);
1150 elseif ((
int)
$request->get(
'pagesize') > 0)
1152 $result[
'NEXT_PAGE_SIZE'] = (int)
$request->get(
'pagesize');
1158 $contentIdList = [];
1159 if (is_array($result[
'Events']))
1161 foreach ($result[
'Events'] as $key => $eventFields)
1165 $contentIdList[] = $result[
'Events'][$key][
'CONTENT_ID'] = $contentId[
'ENTITY_TYPE'].
'-'.$contentId[
'ENTITY_ID'];
1170 $result[
'ContentViewData'] = (
1171 !empty($contentIdList)
1172 ? \Bitrix\Socialnetwork\Item\UserContentView::getViewData([
1173 'contentId' => $contentIdList
1182 $activity2LogList = $this->
getComponent()->getActivity2LogListValue();
1186 $prevPageLogIdList = [];
1187 if ($type ===
'main')
1201 $eventFields[
'EVENT_ID'] ===
'crm_activity_add'
1202 && !empty($activity2LogList)
1203 && !in_array($eventFields[
'ID'], $activity2LogList)
1209 empty($prevPageLogIdList)
1210 || !in_array((
int)$eventFields[
'ID'], $prevPageLogIdList,
true)
1213 $eventFields[
'EVENT_ID_FULLSET'] = \CSocNetLogTools::findFullSetEventIDByEventID($eventFields[
'EVENT_ID']);
1218 && $eventFields[
'EVENT_ID'] ===
'tasks'
1229 if ($eventFields[
'DATE_FOLLOW'])
1234 $params[
'USE_FOLLOW'] ===
'N'
1235 && $eventFields[
'LOG_UPDATE']
1248 if ($type ===
'main')
1252 elseif ($type ===
'pinned')
1262 $idList = array_merge($result[
'arLogTmpID'], $result[
'pinnedIdList']);
1266 && $result[
'currentUserId'] > 0
1268 !isset($params[
'USE_FAVORITES'])
1269 || $params[
'USE_FAVORITES'] !==
'N'
1274 $res = \Bitrix\Socialnetwork\LogFavoritesTable::getList([
1276 '@LOG_ID' => $idList,
1277 'USER_ID' => $result[
'currentUserId']
1279 'select' => [
'LOG_ID' ]
1281 while ($favEntry = $res->fetch())
1283 $favLogIdList[] = (int)$favEntry[
'LOG_ID'];
1289 $entry[
'FAVORITES_USER_ID'] = $entry[
'!FAVORITES_USER_ID'] = (
1290 in_array((
int)$entry[
'ID'], $favLogIdList,
true)
1291 ? $result[
'currentUserId']
1301 global $CACHE_MANAGER;
1308 if (Loader::includeModule(
'forum'))
1310 $result[
'Smiles'] = Option::get(
'forum',
'smile_gallery_id', 0);
1314 $cacheId =
'b_sonet_smile_'.LANGUAGE_ID;
1316 if ($CACHE_MANAGER->read(604800, $cacheId))
1318 $result[
'Smiles'] = $CACHE_MANAGER->get($cacheId);
1322 $result[
'Smiles'] = [];
1324 $res = \CSocNetSmile::getList(
1325 [
'SORT' =>
'ASC' ],
1327 'SMILE_TYPE' =>
'S',
1328 'LANG_LID' => LANGUAGE_ID
1332 [
'ID',
'IMAGE',
'DESCRIPTION',
'TYPING',
'SMILE_TYPE',
'SORT',
'LANG_NAME' ]
1334 while ($smileFields = $res->fetch())
1336 [$type] = explode(
' ', $smileFields[
'TYPING']);
1337 $smileFields[
'TYPE'] = str_replace(
"'",
"\'", $type);
1338 $smileFields[
'TYPE'] = str_replace(
"\\",
"\\\\", $smileFields[
'TYPE']);
1339 $smileFields[
'NAME'] = $smileFields[
'LANG_NAME'];
1340 $smileFields[
'IMAGE'] =
'/bitrix/images/socialnetwork/smile/'.$smileFields[
'IMAGE'];
1342 $result[
'Smiles'][] = $smileFields;
1345 $CACHE_MANAGER->set($cacheId, $result[
'Smiles']);
1355 $params[
'USE_TASKS'] ===
'Y'
1359 $result[
'EXPERT_MODE'] =
'N';
1361 $res = LogViewTable::getList([
1364 'USER_ID' => $result[
'currentUserId'],
1365 '=EVENT_ID' =>
'tasks'
1367 'select' => [
'TYPE' ]
1369 if ($logViewFields = $res->fetch())
1371 $result[
'EXPERT_MODE'] = ($logViewFields[
'TYPE'] ===
'N' ?
'Y' :
'N');
1378 $logEventsData = [];
1380 if (is_array($result[
'Events']))
1382 foreach ($result[
'Events'] as $eventFields)
1384 $logEventsData[(int)$eventFields[
'ID']] = $eventFields[
'EVENT_ID'];
1387 if (is_array($result[
'pinnedEvents']))
1389 foreach ($result[
'pinnedEvents'] as $eventFields)
1391 $logEventsData[(int)$eventFields[
'ID']] = $eventFields[
'EVENT_ID'];
1395 $forumPostLivefeedProvider = new \Bitrix\Socialnetwork\Livefeed\ForumPost();
1396 $forumPostLivefeedProvider->warmUpAuxCommentsStaticCache([
1397 'logEventsData' => $logEventsData,
1401 private function setComposition(): void
1407 $composition =
new Composition($this->userId, $this->groupId);
1408 $deselectedItems = $composition->getDeselectedSettings();
unsetEventsListKey($key='', $type='main')
getLogPageProcessorInstance()
warmUpStaticCache($result)
processMainUIFilterData(&$result)
processEventsList(&$result, $type='main')
processCrmActivities($result)
processSelectData(&$result)
getExpertModeValue(&$result)
setFilterData(array $value=[])
setFilterContent($value=false)
processNextPageSize(&$result)
setEventsList(array $value=[], $type='main')
processFavoritesData($result)
processLastTimestamp(&$result)
$logPageProcessorInstance
appendEventsList(array $value=[], $type='main')
getFilterDataKey($key='')
processListParams(&$result)
processFilterData(&$result)
setEventsListKey($key='', array $value=[], $type='main')
setListFilter(array $componentResult=[])
makeTimeStampFromDateTime($value, $type='FULL')
getEventsList($type='main')
prepareContextData(&$result)
processContentList(&$result)
static checkUserAuthorized()
setListParams(array $value=[])
setOrder(array $value=[])
setOrderKey($key='', $value=false)
getListParamsKey($key='')
setNavParams($value=false)
setFilter(array $value=[])
addFilter($key='', $value=false)
setListParamsKey($key='', $value=false)
setFirstPage($value=false)
setFilterKey($key='', $value=false)
static checkLivefeedTasksAllowed()
static prepareToken($str)
static getContentId($event=[])