• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/component/entitydetails/factorybased.php
  • Класс: Bitrix\Crm\Component\EntityDetails\FactoryBased
  • Вызов: FactoryBased::getBizprocStarterConfig
protected function getBizprocStarterConfig(): array
{
	$documentType = \CCrmBizProcHelper::ResolveDocumentType($this->item->getEntityTypeId());
	$documentId = \CCrmBizProcHelper::ResolveDocumentId($this->item->getEntityTypeId(), $this->item->getId());

	$config = [];
	if (Loader::includeModule('bizproc'))
	{
		$templates = \CBPDocument::getTemplatesForStart(
			$this->userID,
			$documentType,
			$documentId,
			['DocumentStates' => []]
		);

		if ($templates)
		{
			$config = [
				'templates' => $templates,
				'moduleId' => 'crm',
				'entity' => $documentType[1],
				'documentType' => $documentType[2],
				'documentId' => $documentId[2],
			];
		}
	}

	return $config;
}