3namespace Bitrix\Socialnetwork\Component;
5use Bitrix\Main\ErrorCollection;
8use Bitrix\Main\Localization\Loc;
9use Bitrix\Main\ModuleManager;
10use Bitrix\Socialnetwork\Component\LogList\Gratitude;
11use Bitrix\Socialnetwork\Component\LogList\Util;
12use Bitrix\Socialnetwork\Component\LogList\Param;
13use Bitrix\Socialnetwork\Component\LogList\Assets;
14use Bitrix\Socialnetwork\Component\LogList\Path;
15use Bitrix\Socialnetwork\Component\LogList\ParamPhotogallery;
16use Bitrix\Socialnetwork\Component\LogList\Processor;
17use Bitrix\Socialnetwork\Component\LogList\Page;
18use Bitrix\Socialnetwork\Component\LogList\Counter;
47 $this->extranetSite = ($value ===
true);
52 return $this->extranetSite;
57 $this->presetFilterTopId = $value;
62 return $this->presetFilterTopId;
67 $this->presetFilterId = $value;
72 return $this->presetFilterId;
77 $this->commentsNeeded = ($value ===
true);
82 return $this->commentsNeeded;
87 $this->activity2LogList = $value;
92 return $this->activity2LogList;
97 $this->diskUFEntityList = $value;
102 return $this->diskUFEntityList;
108 if (is_object($parent) && $parent->__name <>
'')
114 $parent2 = $parent->getParent();
115 if (is_object($parent2) && $parent2->__name <>
'')
124 if($this->gratitudesInstance ===
null)
126 $this->gratitudesInstance =
new Gratitude([
131 return $this->gratitudesInstance;
136 if($this->paramsInstance ===
null)
138 $this->paramsInstance =
new Param([
139 'component' => $this,
144 return $this->paramsInstance;
149 if($this->assetsInstance ===
null)
151 $this->assetsInstance =
new Assets([
156 return $this->assetsInstance;
161 if($this->pathInstance ===
null)
163 $this->pathInstance =
new Path([
164 'component' => $this,
169 return $this->pathInstance;
174 if($this->paramsPhotogalleryInstance ===
null)
181 return $this->paramsPhotogalleryInstance;
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;
206 if($this->logPageProcessorInstance ===
null)
208 $this->logPageProcessorInstance =
new Page([
209 'component' => $this,
215 return $this->logPageProcessorInstance;
220 if ($this->counterProcessorInstance ===
null)
222 $this->counterProcessorInstance =
new Counter([
223 'component' => $this,
229 return $this->counterProcessorInstance;
242 $this->
setExtranetSiteValue((Loader::includeModule(
'extranet') && \CExtranet::isExtranetSite()));
244 $request->get(
'log_filter_submit') <>
''
245 &&
$request->get(
'flt_comments') ===
'Y'
259 && (int)
$params[
'PAGE_NUMBER'] > 0
270 !ModuleManager::isModuleInstalled(
'crm')
276 $this->useLogin = (
$params[
'SHOW_LOGIN'] !==
'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' || SITE_TEMPLATE_ID ===
'air')
338 $result[
'PATH_TO_LOG_TAG'] .=
'&apply_filter=Y';
342 !empty($this->arParams[
'TARGET'])
350 isset($this->arParams[
'RELOAD'])
351 && $this->arParams[
'RELOAD'] ===
'Y'
355 $result[
'SHOW_UNREAD'] = $this->arParams[
'SHOW_UNREAD'];
358 $assetsProcessorInstance->getAssetsCheckSum(
$result);
364 $result[
'TZ_OFFSET'] = \CTimeZone::getOffset();
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'] ?? []),
412 $this->arParams[
'LOG_ID'] > 0
419 $this->errorCollection[] =
new Error(Loc::getMessage(
'SONET_LOG_LIST_ENTRY_NOT_FOUND'));
425 $result[
'WORKGROUPS_PAGE'] = $pathsProcessorInstance->getFolderWorkgroupsValue();
448 $this->arParams[
'SHOW_UNREAD'] =
$result[
'SHOW_UNREAD'];
469 if (empty(
$result[
'RETURN_EMPTY_LIST']))
474 $queryResultData[
'countAll'] < (
int)
$params[
'PAGE_SIZE']
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'];
566 $result[
'arLogTmpID'][] = $eventFields[
'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;
632 return $returnResult;
636 $this->prepareExpertMode();
638 $res = \CSocNetLog::getList(
650 $result[
'PAGE_NAVNUM'] = $NavNum+1;
651 $result[
'PAGE_NAVCOUNT'] = 1000000;
655 $navComponentObject =
false;
656 $result[
'NAV_STRING'] =
$res->getPageNavStringEx($navComponentObject, Loc::getMessage(
'SONET_LOG_LIST_NAV'),
'',
false);
663 while ($eventFields =
$res->getNext())
667 'pageNumber' =>
$res->NavPageNomer
671 $returnResult[
'countAll'] =
$res->selectedRowsCount();
673 return $returnResult;
681 if (
$result[
'USE_PINNED'] !==
'Y')
704 $res = \CSocNetLog::getList(
706 'PINNED_DATE' =>
'DESC'
715 'CHECK_RIGHTS' =>
'Y',
721 while ($eventFields =
$res->getNext())
741 $cache = new \CPHPCache;
742 $cacheId =
'log_form_comments'.serialize(
$params[
'COMMENT_PROPERTY']);
743 $cachePath =
'/sonet/log_form/comments';
744 $ttl = (defined(
'BX_COMP_MANAGED_CACHE') ? 2592000 : 600);
746 if ($cache->initCache($ttl, $cacheId, $cachePath))
748 $cacheVars = $cache->getVars();
749 $result[
'COMMENT_PROPERTIES'] = $cacheVars[
'comment_props'];
754 $cache->startDataCache($ttl, $cacheId, $cachePath);
756 $result[
'COMMENT_PROPERTIES'] = [
'SHOW' =>
'N' ];
758 !empty(
$params[
'COMMENT_PROPERTY'])
759 && is_array(
$params[
'COMMENT_PROPERTY'])
763 foreach ($arPostFields as $fieldName => $fieldData)
765 if (!in_array($fieldName,
$params[
'COMMENT_PROPERTY'],
true))
770 $fieldData[
'EDIT_FORM_LABEL'] = $fieldData[
'EDIT_FORM_LABEL'] <>
'' ? $fieldData[
'EDIT_FORM_LABEL'] : $fieldData[
'FIELD_NAME'];
771 $fieldData[
'~EDIT_FORM_LABEL'] = $fieldData[
'EDIT_FORM_LABEL'];
773 $result[
'COMMENT_PROPERTIES'][
'DATA'][$fieldName] = $fieldData;
776 if (!empty(
$result[
'COMMENT_PROPERTIES'][
'DATA']))
778 $result[
'COMMENT_PROPERTIES'][
'SHOW'] =
'Y';
782 $cache->endDataCache([
'comment_props' =>
$result[
'COMMENT_PROPERTIES'] ]);
802 private function prepareExpertMode(): void
804 $processor = $this->getProcessorInstance();
805 if ($processor->isSpace())
807 $processor->setListParamsKey(
'SKIP_EXPERT_MODE',
true);
static getGratitudesBlogData(array $params=[])
static getGratitudesIblockData(array $params=[])
static getGratitudesIblockId()
static checkEmptyParamString(&$params, $paramName, $defaultValue)
static checkEmptyParamInteger(&$params, $paramName, $defaultValue)
static checkUserAuthorized()
setTask2LogListValue($value=[])
setCurrentUserAdmin($value=false)
getLogPageProcessorInstance()
getDiskUFEntityListValue()
processLogFormComments(&$result)
setActivity2LogListValue($value=[])
onPrepareComponentParams($params)
setDiskUFEntityListValue($value=[])
processEvent(&$result, &$cnt, array $eventFields=[], array $options=[])
getPinnedIdList(&$result)
$paramsPhotogalleryInstance
static getGratitudesBlogData(array $params=[])
getCounterProcessorInstance()
static $canCurrentUserAddComments
getPresetFilterTopIdValue()
setPresetFilterIdValue($value)
static getGratitudesIblockData(array $params=[])
getParamsPhotogalleryInstance()
getActivity2LogListValue()
setExtranetSiteValue($value=false)
processParentParams(&$params)
$logPageProcessorInstance
setCommentsNeededValue($value=false)
$counterProcessorInstance
static getGratitudesIblockId()
setPresetFilterTopIdValue($value)
static init(array $params)
static getContentId($event=[])
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
global $USER_FIELD_MANAGER
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']