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

	$filterParameters = $this->getFilterParameters();

	$startDate = $calculatedData['startDate'];
	$finishDate = $calculatedData['finishDate'];
	$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'],
				'USER_ICON' => $user['icon'],
				'INCOMING' => $row['CALL_INCOMING'],
				'OUTGOING' => $row['CALL_OUTGOING'],
				'MISSED' => $row['CALL_MISSED'],
				'CALLBACK' => $row['CALL_CALLBACK'],
				'COUNT' => $row['CALL_COUNT'],
				'DYNAMICS' => $this->formatPeriodCompare($row['CALL_COUNT_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,
					'START_DATE_from' => $startDate,
					'START_DATE_to' => $finishDate,
				]),
				'OUTGOING' => $this->createUrl(self::TELEPHONY_DETAIL_URI, [
					'PORTAL_USER_ID' => $row['PORTAL_USER_ID'],
					'INCOMING' => CVoxImplantMain::CALL_OUTGOING,
					'START_DATE_from' => $startDate,
					'START_DATE_to' => $finishDate,
				]),
				'MISSED' => $this->createUrl(self::TELEPHONY_DETAIL_URI, [
					'PORTAL_USER_ID' => $row['PORTAL_USER_ID'],
					'INCOMING' => CVoxImplantMain::CALL_INCOMING,
					'STATUS' => self::CALL_STATUS_FAILURE,
					'START_DATE_from' => $startDate,
					'START_DATE_to' => $finishDate,
				]),
				'CALLBACK' => $this->createUrl(self::TELEPHONY_DETAIL_URI, [
					'PORTAL_USER_ID' => $row['PORTAL_USER_ID'],
					'INCOMING' => CVoxImplantMain::CALL_CALLBACK,
					'START_DATE_from' => $startDate,
					'START_DATE_to' => $finishDate,
				]),
				'COUNT' => $this->createUrl(self::TELEPHONY_DETAIL_URI, [
					'PORTAL_USER_ID' => $row['PORTAL_USER_ID'],
					'PHONE_NUMBER' => $filterParameters['PHONE_NUMBER'],
					'START_DATE_from' => $startDate,
					'START_DATE_to' => $finishDate,
				]),
			]
		];
	}

	return $result;
}