• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/components/kanban/services/counters.php
  • Класс: BitrixTasksComponentsKanbanServicesCounters
  • Вызов: Counters::getCounters
public function getCounters(array $items): array
{
	if (
		$this->currentUserId !== $this->viewedUserId
		&& !BitrixTasksUtilUser::isAdmin($this->currentUserId)
		&& !CTasks::IsSubordinate($this->viewedUserId, $this->currentUserId)
	)
	{
		return $items;
	}

	foreach ($items as $taskId => $row)
	{
		$rowCounter = (new BitrixTasksInternalsCounterTemplateTaskCounter($this->viewedUserId))->getRowCounter($taskId);
		if (!$rowCounter['VALUE'])
		{
			$items[$taskId]['data']['counter'] = 0;
			continue;
		}
		$items[$taskId]['data']['counter'] = [
			'value' => $rowCounter['VALUE'],
			'color' => "ui-counter-{$rowCounter['COLOR']}",
		];
		$items[$taskId]['data']['count_comments'] = $rowCounter['VALUE'];
	}

	return $items;
}