CCrmBizProcHelper::GetDocumentNames

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmBizProcHelper
  4. GetDocumentNames
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_bizproc_helper.php
  • Класс: \CCrmBizProcHelper
  • Вызов: CCrmBizProcHelper::GetDocumentNames
static function GetDocumentNames($ownerTypeID, $ownerID)
{
	if (!(IsModuleInstalled('bizproc') && CModule::IncludeModule('bizproc') && CBPRuntime::isFeatureEnabled()))
	{
		return false;
	}

	$ownerTypeID = intval($ownerTypeID);
	$ownerID = intval($ownerID);

	$docName = self::ResolveDocumentName($ownerTypeID);
	if($docName === '')
	{
		return array();
	}

	$ownerTypeName = CCrmOwnerType::ResolveName($ownerTypeID);
	if($ownerTypeName === '')
	{
		return array();
	}

	/*$arDocumentStates = CBPDocument::GetDocumentStates(
		array('crm', $docName, $ownerTypeName),
		array('crm', $docName, $ownerTypeName.'_'.$ownerID)
	);*/

	$arDocumentStates = CBPStateService::GetDocumentStates(
		array('crm', $docName, $ownerTypeName.'_'.$ownerID)
	);

	$result = array();
	foreach ($arDocumentStates as $arDocumentState)
	{
		if($arDocumentState['ID'] !== '' && $arDocumentState['TEMPLATE_NAME'] !== '')
		{
			$result[] = $arDocumentState['TEMPLATE_NAME'];
		}
	}

	return $result;
}

Добавить комментарий