- Модуль: socialnetwork
- Путь к файлу: ~/bitrix/modules/socialnetwork/lib/component/loglist/processor.php
- Класс: BitrixSocialnetworkComponentLogListProcessor
- Вызов: Processor::processListParams
public function processListParams(&$result): void
{
$params = $this->getComponent()->arParams;
if ($params['IS_CRM'] === 'Y')
{
$this->setListParams([
'IS_CRM' => 'Y',
'CHECK_CRM_RIGHTS' => 'Y'
]);
$filterParams = [
'ENTITY_TYPE' => $params['CRM_ENTITY_TYPE'],
'ENTITY_ID' => $params['CRM_ENTITY_ID'],
'AFFECTED_TYPES' => [],
'OPTIONS' => [
'CUSTOM_DATA' => (
isset($params['CUSTOM_DATA'])
&& is_array($params['CUSTOM_DATA'])
? $params['CUSTOM_DATA']
: []
)
]
];
$res = getModuleEvents('socialnetwork', 'OnBuildSocNetLogFilter'); // crm handler used
while ($eventFields = $res->fetch())
{
$filter = $this->getFilter();
executeModuleEventEx($eventFields, [ &$filter, &$filterParams, &$params ]);
$this->setFilter($filter);
$this->getComponent()->arParams = $params;
}
$this->setListParamsKey('CUSTOM_FILTER_PARAMS' , $filterParams);
}
else
{
if (
$params['PUBLIC_MODE'] !== 'Y'
&& ModuleManager::isModuleInstalled('crm')
)
{
$this->setFilterKey('!MODULE_ID', ( // can't use !@MODULE_ID because of null
Option::get('crm', 'enable_livefeed_merge', 'N') === 'Y'
|| (
!empty($this->getFilterKey('LOG_RIGHTS'))
&& !is_array($this->getFilterKey('LOG_RIGHTS'))
&& preg_match('/^SG(d+)$/', $this->getFilterKey('LOG_RIGHTS'), $matches)
)
? [ 'crm']
: [ 'crm', 'crm_shared' ]
));
}
$this->setListParamsKey('CHECK_RIGHTS', ($params['MODE'] !== 'LANDING' ? 'Y' : 'N'));
if (
$params['MODE'] !== 'LANDING'
&& $params['LOG_ID'] <= 0
&& empty($this->getFilterDataKey('EVENT_ID'))
)
{
$this->setListParamsKey('CHECK_VIEW', 'Y');
}
}
if (
$params['USE_FOLLOW'] !== 'N'
&& !ModuleManager::isModuleInstalled('intranet')
&& Util::checkUserAuthorized()
) // BSM
{
$result['USE_SMART_FILTER'] = 'Y';
$this->setListParamsKey('MY_GROUPS_ONLY', (
CSocNetLogSmartFilter::getDefaultValue($result['currentUserId']) === 'Y'
? 'Y'
: 'N'
));
}
if (
$result['isExtranetSite']
|| $this->getFilterDataKey('EXTRANET') === 'Y'
|| $this->getComponent()->getPresetFilterIdValue() === 'extranet'
)
{
$this->setListParamsKey('MY_GROUPS_ONLY', 'Y');
}
$result['MY_GROUPS_ONLY'] = $this->getListParamsKey('MY_GROUPS_ONLY');
if ($this->getComponent()->getCurrentUserAdmin())
{
$this->setListParamsKey('USER_ID', 'A');
}
if ($params['USE_FOLLOW'] === 'Y')
{
$this->setListParamsKey('USE_FOLLOW', 'Y');
}
else
{
$this->setListParamsKey('USE_FOLLOW', 'N');
$this->setListParamsKey('USE_SUBSCRIBE', 'N');
}
if (
isset($params['USE_FAVORITES'])
&& $params['USE_FAVORITES'] === 'N'
)
{
$this->setListParamsKey('USE_FAVORITES', 'N');
}
if (
empty($result['RETURN_EMPTY_LIST'])
&& !empty($params['EMPTY_EXPLICIT'])
&& $params['EMPTY_EXPLICIT'] === 'Y'
)
{
$this->setListParamsKey('EMPTY_LIST', 'Y');
}
if ($result['USE_PINNED'] === 'Y')
{
$this->setListParamsKey('USE_PINNED', 'Y');
}
}