• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/lib/integration/ui/entityselector/templateprovider.php
  • Класс: BitrixBizprocIntegrationUIEntitySelectorTemplateProvider
  • Вызов: TemplateProvider::fillDocumentItem
protected function fillDocumentItem(Dialog $dialog, Item $documentItem, int $currentUserId): void
{
	[$moduleId, $documentType] = $this->parseDocumentItemId($documentItem->getId());

	if ($moduleId && $documentType && IsModuleInstalled($moduleId))
	{
		$templates = $this->getTemplatesByDocumentType($moduleId, $documentType);
		foreach ($templates as $template)
		{
			if ($this->canUserStartWorkflow($currentUserId, $template->getDocumentComplexType()))
			{
				$item = $this->makeItem(['id' => $template->getId(), 'title' => $template->getName()]);
				$documentItem->addChild($item);
			}
		}
	}
}