CCrmBizProcHelper::GetUserWorkflowTaskCount

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmBizProcHelper
  4. GetUserWorkflowTaskCount
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_bizproc_helper.php
  • Класс: \CCrmBizProcHelper
  • Вызов: CCrmBizProcHelper::GetUserWorkflowTaskCount
static function GetUserWorkflowTaskCount($workflowIDs, $userID = 0)
{
	if(!is_array($workflowIDs))
	{
		return 0;
	}

	if (!(IsModuleInstalled('bizproc') && CModule::IncludeModule('bizproc') && CBPRuntime::isFeatureEnabled()))
	{
		return 0;
	}

	$userID = intval($userID);
	if($userID <= 0)
	{
		$userID = CCrmSecurityHelper::GetCurrentUserID();
	}

	$filter = array('USER_ID' => $userID);
	$workflowQty = count($workflowIDs);
	if($workflowQty > 1)
	{
		$filter['@WORKFLOW_ID'] = $workflowIDs;
	}
	elseif($workflowQty === 1)
	{
		$filter['WORKFLOW_ID'] = $workflowIDs[0];
	}

	$result = CBPTaskService::GetList(array(), $filter, array(), false, array());
	return is_int($result) ? $result : 0;
}

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