- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/Service/Timeline/Item/Comment.php
- Класс: Bitrix\Crm\Service\Timeline\Item\Comment
- Вызов: Comment::buildFilesBlock
private function buildFilesBlock(): ?ContentBlock
{
$storageFiles = $this->getUserFieldFiles();
if (empty($storageFiles))
{
return null;
}
$files = $this->prepareFiles($storageFiles);
$fileListBlock = (new FileList())
->setTitle(Loc::getMessage('CRM_TIMELINE_COMMENT_FILES'))
->setFiles($files)
->setScopeMobile()
;
if ($this->hasUpdatePermission())
{
$fileListBlock->setUpdateParams([
'type' => $this->getType(),
'entityTypeId' => $this->getModel()->getTypeId(),
'entityId' => $this->getModel()->getId(),
'files' => array_column($storageFiles, 'FILE_ID'),
'ownerTypeId' => $this->getContext()->getIdentifier()->getEntityTypeId(),
'ownerId' => $this->getContext()->getIdentifier()->getEntityId(),
]);
}
return $fileListBlock;
}