107 $parent = $this->getParent();
108 if (is_object($parent) && $parent->__name <>
'')
114 $parent2 = $parent->getParent();
115 if (is_object($parent2) && $parent2->__name <>
'')
186 if($this->processorInstance ===
null)
188 $this->processorInstance =
new Processor([
189 'component' => $this,
193 if ($this->processorInstance->isSpace())
195 $this->processorInstance
196 ->setUserId($this->arParams[
'SPACE_USER_ID'])
197 ->setGroupId($this->arParams[
'GROUP_ID']);
201 return $this->processorInstance;
242 $this->
setExtranetSiteValue((Loader::includeModule(
'extranet') && \CExtranet::isExtranetSite()));
244 $request->get(
'log_filter_submit') <>
''
245 &&
$request->get(
'flt_comments') ===
'Y'
254 $params[
'HIDE_EDIT_FORM'] = ($params[
'LOG_ID'] > 0 ?
'Y' : ($params[
'HIDE_EDIT_FORM'] ??
'N'));
255 $params[
'SHOW_EVENT_ID_FILTER'] = ($params[
'LOG_ID'] > 0 ?
'N' : $params[
'SHOW_EVENT_ID_FILTER']);
256 $params[
'AUTH'] = (isset($params[
'AUTH']) && mb_strtoupper($params[
'AUTH']) ===
'Y' ?
'Y' :
'N');
257 $params[
'PAGE_NUMBER'] = (
258 isset($params[
'PAGE_NUMBER'])
259 && (int)$params[
'PAGE_NUMBER'] > 0
260 ? (
int)$params[
'PAGE_NUMBER']
269 $params[
'IS_CRM'] = (
270 !ModuleManager::isModuleInstalled(
'crm')
272 : ($params[
'IS_CRM'] ??
'N')
275 $params[
'SHOW_LOGIN'] = ($params[
'SHOW_LOGIN'] ??
'Y');
276 $this->useLogin = ($params[
'SHOW_LOGIN'] !==
'N');
278 $params[
'CONTEXT'] = (is_string($params[
'CONTEXT'] ??
null) ? $params[
'CONTEXT'] :
'');
280 $params[
'SHOW_UNREAD'] = ($USER->isAuthorized() && $params[
'LOG_ID'] <= 0 && $params[
'MODE'] !==
'LANDING' ?
'Y' :
'N');
320 if (!$assetsProcessorInstance->checkRefreshNeeded($result))
328 $result[
'SHOW_FOLLOW_CONTROL'] =
'Y';
329 $result[
'CAN_DELETE'] = \CSocNetUser::isCurrentUserModuleAdmin(SITE_ID,
false);
330 $result[
'ENTITIES_CORRESPONDENCE'] = [];
332 $result[
'PATH_TO_LOG_TAG'] = $pathsProcessorInstance->getFolderUsersValue().
'log/?TAG=#tag#';
334 defined(
'SITE_TEMPLATE_ID')
335 && SITE_TEMPLATE_ID ===
'bitrix24'
338 $result[
'PATH_TO_LOG_TAG'] .=
'&apply_filter=Y';
341 $result[
'AJAX_CALL'] = (
342 !empty($this->arParams[
'TARGET'])
345 $result[
'bReload'] = (
350 isset($this->arParams[
'RELOAD'])
351 && $this->arParams[
'RELOAD'] ===
'Y'
355 $result[
'SHOW_UNREAD'] = $this->arParams[
'SHOW_UNREAD'];
356 $result[
'currentUserId'] = (int)$USER->getId();
358 $assetsProcessorInstance->getAssetsCheckSum($result);
364 $result[
'TZ_OFFSET'] = \CTimeZone::getOffset();
365 $result[
'FILTER_ID'] = (
366 !empty($this->arParams[
'FILTER_ID'])
367 ? $this->arParams[
'FILTER_ID']
368 :
'LIVEFEED'.(!empty($this->arParams[
'GROUP_ID']) ?
'_SG'.$this->arParams[
'GROUP_ID'] :
'')
371 \CSocNetTools::initGlobalExtranetArrays();
374 $this->arParams[
'AUTH'] ===
'Y'
378 $result[
'IS_FILTERED'] =
false;
382 'GROUP' => ($result[
'Group'] ?? []),
385 $result[
'Events'] =
false;
412 $this->arParams[
'LOG_ID'] > 0
414 !is_array($result[
'Events'])
415 || count($result[
'Events']) <= 0
425 $result[
'WORKGROUPS_PAGE'] = $pathsProcessorInstance->getFolderWorkgroupsValue();
444 $result[
'NEED_AUTH'] =
'Y';
448 $this->arParams[
'SHOW_UNREAD'] = $result[
'SHOW_UNREAD'];
490 protected function processEvent(&$result, &$cnt, array $eventFields = [], array $options = []): void
492 if ($eventFields[
'MODULE_ID'] ===
'crm_shared')
494 $eventFields[
'MODULE_ID'] =
'crm';
497 static $timemanInstalled =
null;
498 static $tasksInstalled =
null;
499 static $listsInstalled =
null;
501 if ($timemanInstalled ===
null)
503 $timemanInstalled = ModuleManager::isModuleInstalled(
'timeman');
505 if ($tasksInstalled ===
null)
507 $tasksInstalled = ModuleManager::isModuleInstalled(
'tasks');
509 if ($listsInstalled ===
null)
511 $listsInstalled = ModuleManager::isModuleInstalled(
'lists');
515 !ModuleManager::isModuleInstalled(
'bitrix24')
518 !empty($eventFields[
'MODULE_ID'])
519 && !ModuleManager::isModuleInstalled($eventFields[
'MODULE_ID'])
523 in_array($eventFields[
'EVENT_ID'], [
'timeman_entry',
'report' ])
524 && !$timemanInstalled
527 $eventFields[
'EVENT_ID'] ===
'tasks'
531 $eventFields[
'EVENT_ID'] ===
'lists_new_element'
546 if ($eventFields[
'EVENT_ID'] ===
'crm_activity_add')
553 elseif ($eventFields[
'EVENT_ID'] ===
'tasks')
556 $task2LogList[(int)$eventFields[
'SOURCE_ID']] = (
int)$eventFields[
'ID'];
562 if (isset($options[
'type']))
564 if ($options[
'type'] ===
'main')
566 $result[
'arLogTmpID'][] = $eventFields[
'ID'];
569 elseif ($options[
'type'] ===
'pinned')
571 $contentId = \Bitrix\Socialnetwork\Livefeed\Provider::getContentId($eventFields);
573 if (!empty($contentId[
'ENTITY_TYPE']))
575 $postProvider = \Bitrix\Socialnetwork\Livefeed\Provider::init([
576 'ENTITY_TYPE' => $contentId[
'ENTITY_TYPE'],
577 'ENTITY_ID' => $contentId[
'ENTITY_ID'],
578 'LOG_ID' => $eventFields[
'ID']
583 $result[
'pinnedIdList'][] = $eventFields[
'ID'];
584 $eventFields[
'PINNED_PANEL_DATA'] = [
585 'TITLE' => $postProvider->getPinnedTitle(),
586 'DESCRIPTION' => $postProvider->getPinnedDescription()
594 $livefeedProvider = new \Bitrix\Socialnetwork\Livefeed\BlogPost();
597 (
int)$eventFields[
'SOURCE_ID'] > 0
598 && in_array($eventFields[
'EVENT_ID'], array_merge($livefeedProvider->getEventId(), [
'idea']),
true)
606 elseif (!in_array($eventFields[
'EVENT_ID'], [
'data',
'photo',
'photo_photo',
'bitrix24_new_user',
'intranet_new_user',
'news' ]))
626 return $returnResult;
631 $result[
'arLogTmpID'] = [];
632 return $returnResult;
637 $res = \CSocNetLog::getList(
648 $result[
'NAV_STRING'] =
'';
649 $result[
'PAGE_NAVNUM'] = $NavNum+1;
650 $result[
'PAGE_NAVCOUNT'] = 1000000;
654 $navComponentObject =
false;
655 $result[
'NAV_STRING'] = $res->getPageNavStringEx($navComponentObject,
Loc::getMessage(
'SONET_LOG_LIST_NAV'),
'',
false);
656 $result[
'PAGE_NUMBER'] = $res->NavPageNomer;
657 $result[
'PAGE_NAVNUM'] = $res->NavNum;
658 $result[
'PAGE_NAVCOUNT'] = $res->NavPageCount;
662 while ($eventFields = $res->getNext())
666 'pageNumber' => $res->NavPageNomer
670 $returnResult[
'countAll'] = $res->selectedRowsCount();
672 return $returnResult;
730 global $USER_FIELD_MANAGER;
732 $params = $this->arParams;
735 !$result[
'AJAX_CALL']
740 $cache = new \CPHPCache;
741 $cacheId =
'log_form_comments'.serialize($params[
'COMMENT_PROPERTY']);
742 $cachePath =
'/sonet/log_form/comments';
743 $ttl = (defined(
'BX_COMP_MANAGED_CACHE') ? 2592000 : 600);
745 if ($cache->initCache($ttl, $cacheId, $cachePath))
747 $cacheVars = $cache->getVars();
748 $result[
'COMMENT_PROPERTIES'] = $cacheVars[
'comment_props'];
753 $cache->startDataCache($ttl, $cacheId, $cachePath);
755 $result[
'COMMENT_PROPERTIES'] = [
'SHOW' =>
'N' ];
757 !empty($params[
'COMMENT_PROPERTY'])
758 && is_array($params[
'COMMENT_PROPERTY'])
761 $arPostFields = $USER_FIELD_MANAGER->getUserFields(
'SONET_COMMENT', 0, LANGUAGE_ID);
762 foreach ($arPostFields as $fieldName => $fieldData)
764 if (!in_array($fieldName, $params[
'COMMENT_PROPERTY'],
true))
769 $fieldData[
'EDIT_FORM_LABEL'] = $fieldData[
'EDIT_FORM_LABEL'] <>
'' ? $fieldData[
'EDIT_FORM_LABEL'] : $fieldData[
'FIELD_NAME'];
770 $fieldData[
'~EDIT_FORM_LABEL'] = $fieldData[
'EDIT_FORM_LABEL'];
771 $fieldData[
'EDIT_FORM_LABEL'] = htmlspecialcharsEx($fieldData[
'EDIT_FORM_LABEL']);
772 $result[
'COMMENT_PROPERTIES'][
'DATA'][$fieldName] = $fieldData;
775 if (!empty($result[
'COMMENT_PROPERTIES'][
'DATA']))
777 $result[
'COMMENT_PROPERTIES'][
'SHOW'] =
'Y';
781 $cache->endDataCache([
'comment_props' => $result[
'COMMENT_PROPERTIES'] ]);