- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/integration/ui/entityselector/dynamicmultipleprovider.php
- Класс: Bitrix\Crm\Integration\UI\EntitySelector\DynamicMultipleProvider
- Вызов: DynamicMultipleProvider::makeItem
protected function makeItem(int $entityTypeId, int $entityId): ?Item
{
$canReadItem = EntityAuthorization::checkReadPermission($entityTypeId, $entityId);
$entityInfo = \CCrmEntitySelectorHelper::PrepareEntityInfo(
$this->getEntityTypeNameForMakeItemMethod($entityTypeId),
$entityId,
[
'ENTITY_EDITOR_FORMAT' => true,
'IS_HIDDEN' => !$canReadItem,
'REQUIRE_REQUISITE_DATA' => true,
'REQUIRE_MULTIFIELDS' => true,
'NAME_TEMPLATE' => PersonNameFormatter::getFormat(),
'REQUIRE_EDIT_REQUISITE_DATA' => false,
'LARGE_IMAGES' => true,
]
);
$entityInfo['id'] = "{$entityTypeId}:{$entityId}";
$entityInfo['type'] = $this->getItemEntityId();
return new Item([
'id' => "{$entityTypeId}:{$entityId}",
'entityId' => $this->getItemEntityId(),
'title' => (string)$entityInfo['title'],
'subtitle' => $entityInfo['desc'],
'link' => $entityInfo['url'],
'linkTitle' => Loc::getMessage('CRM_COMMON_DETAIL'),
'avatar' => $entityInfo['image'],
'searchable' => true,
'hidden' => !$canReadItem,
'customData' => [
'entityInfo' => $entityInfo,
],
]);
}