• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/lib/integration/report/handler/employeesworkload/employeesworkloadgraph.php
  • Класс: BitrixVoximplantIntegrationReportHandlerEmployeesWorkloadEmployeesWorkloadGraph
  • Вызов: EmployeesWorkloadGraph::getMultipleGroupedData
public function getMultipleGroupedData(): array
{
	$calculatedData = $this->getCalculatedData();
	if (!$calculatedData['report'])
	{
		return [];
	}

	$this->preloadUserInfo(array_column($calculatedData['report'], 'PORTAL_USER_ID'));

	$result = [];
	foreach ($calculatedData['report'] as $row)
	{
		$user = $this->getUserInfo($row['PORTAL_USER_ID']);

		$result[] = [
			'value' => [
				'USER_NAME' => $user['name'],
				'INCOMING' => $row['CALL_INCOMING'],
				'OUTGOING' => $row['CALL_OUTGOING'],
				'MISSED' => $row['CALL_MISSED'],
				'INCOMING_COMPARE' => $this->formatPeriodCompare($row['CALL_INCOMING_COMPARE']),
				'OUTGOING_COMPARE' => $this->formatPeriodCompare($row['CALL_OUTGOING_COMPARE']),
				'MISSED_COMPARE' => $this->formatPeriodCompare($row['CALL_MISSED_COMPARE']),
			],
			'url' => [
				'INCOMING' => $this->createUrl(self::TELEPHONY_DETAIL_URI, [
					'PORTAL_USER_ID' => $row['PORTAL_USER_ID'],
					'INCOMING' => [
						CVoxImplantMain::CALL_INCOMING,
						CVoxImplantMain::CALL_INCOMING_REDIRECT,
					],
					'STATUS' => self::CALL_STATUS_SUCCESS,
				]),
				'OUTGOING' => $this->createUrl(self::TELEPHONY_DETAIL_URI, [
					'PORTAL_USER_ID' => $row['PORTAL_USER_ID'],
					'INCOMING' => CVoxImplantMain::CALL_OUTGOING,
				]),
				'MISSED' => $this->createUrl(self::TELEPHONY_DETAIL_URI, [
					'PORTAL_USER_ID' => $row['PORTAL_USER_ID'],
					'INCOMING' => CVoxImplantMain::CALL_INCOMING,
					'STATUS' => self::CALL_STATUS_FAILURE,
				]),
			]
		];
	}

	return $result;
}