• Модуль: crmmobile
  • Путь к файлу: ~/bitrix/modules/crmmobile/lib/Controller/EntityDetails.php
  • Класс: BitrixCrmMobileControllerEntityDetails
  • Вызов: EntityDetails::loadMainAction
public function loadMainAction(Factory $factory, Item $entity, CurrentUser $currentUser): array
{
	$this->registerEntityViewedEvent($factory, $entity);

	$entityEditorQuery = new EntityEditor($factory, $entity, $this->getEditorParams($entity));
	$result = [
		'editor' => $entityEditorQuery->execute(),
	];

	if ($entity->isNew())
	{
		return array_merge(
			$result,
			[
				'params' => [
					'permissions' => $this->getPermissions($entity),
				],
			]
		);
	}

	$permissions = $this->getPermissions($entity);

	return array_merge(
		$result,
		[
			'header' => $this->getEntityHeader($entity),
			'params' => [
				'permissions' => $permissions,
				'restrictions' => [
					'conversion' => RestrictionManager::isConversionPermitted(),
				],
				'qrUrl' => $this->getDesktopLink($entity),
				'timelinePushTag' => $this->subscribeToTimelinePushEvents($entity, $currentUser),
				'todoNotificationParams' => $this->getTodoNotificationParams($factory, $entity, $permissions),
				'isAutomationAvailable' => $this->getIsAutomationAvailable($entity->getEntityTypeId()),
				'isLinkWithProductsEnabled' => $this->isLinkWithProductsEnabled(),
				'isDocumentGenerationEnabled' => $this->isDocumentGenerationEnabled(),
				'isClientEnabled' => $this->isClientEnabled(),
				'isChatSupported' => ImChat::isEntitySupported($entity->getEntityTypeId()),
				'isCategoriesEnabled' => $this->isCategoriesEnabled(),
				'documentGeneratorProvider' => $this->getDocumentGeneratorProvider($entity->getEntityTypeId()),
				'ahaMoments' => $this->getAhaMoments($entity),
				'linkedUserFields' => $this->getLinkedUserFields(),
				'floatingMenuItemsSettings' => $this->getFloatingMenuItemsSettings($entity, $currentUser),
			],
		]
	);
}