CCrmViewHelper::PrepareItemStatusesByCategoryId

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmViewHelper
  4. PrepareItemStatusesByCategoryId
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_view_helper.php
  • Класс: \CCrmViewHelper
  • Вызов: CCrmViewHelper::PrepareItemStatusesByCategoryId
static function PrepareItemStatusesByCategoryId($entityTypeId, $categoryId): array
{
	$result = [];

	$isFinalFailurePassed = false;
	foreach (self::PrepareItemsStatuses($entityTypeId, $categoryId) as $status)
	{
		$info = [
			'id' => $status['STATUS_ID'],
			'name' => $status['NAME'],
			'sort' => intval($status['SORT']),
			'color' => $status['COLOR'] ?? '',
			'semantics' => $status['SEMANTICS'],
		];
		if ($status['SEMANTICS'] === 'F')
		{
			$info['semantics'] = $isFinalFailurePassed ? 'apology' : 'failure';
			$isFinalFailurePassed = true;
		}
		if ($status['SEMANTICS'] === 'S')
		{
			$info['semantics'] = 'success';
			$info['hint'] = GetMessage('CRM_ITEM_STATUS_MANAGER_SELECTOR_TTL');
		}
		$result[] = $info;
	}
	return $result;
}

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