• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/lib/integration/report/view/activitygraphbase.php
  • Класс: BitrixVoximplantIntegrationReportViewActivityGraphBase
  • Вызов: ActivityGraphBase::handlerFinallyBeforePassToView
public function handlerFinallyBeforePassToView($dataFromReport)
{
	$result = [];
	if ($dataFromReport['items'])
	{
		$items = [];
		foreach ($dataFromReport['items'] as $item)
		{

			if (!empty($items[$item['firstGroupId']][$item['secondGroupId']]))
			{
				$items[$item['firstGroupId']][$item['secondGroupId']]['active'] += (int)$item['value'][0];

				if (is_array($item['value']))
				{
					foreach ($item['value'] as $index => $value)
					{
						$items[$item['firstGroupId']][$item['secondGroupId']]['tooltip'][$index] += $value;
					}
				}
			}
			else
			{
				$items[$item['firstGroupId']][$item['secondGroupId']] = array(
					'labelXid' => (int)$item['firstGroupId'] + 1,
					'labelYid' => (int)$item['secondGroupId'],
					'active' => (int)$item['value'][0],
					'tooltip' => $item['value'],
					'targetUrl' => $item['url']
				);
			}
		}

		foreach ($items as $firstGroupId => $secondGroup)
		{
			foreach ($secondGroup as $secondGroupId => $newItem)
			{
				$result['items'][] = $newItem;
			}
		}
	}

	$result['config']['labelY'] = $this->getWeekDaysMap();
	$result['config']['labelX'] = $this->getHourList();

	$result['config']['workingHours'] = $dataFromReport['workingHours'];

	return $result;
}