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