• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/integrations/report/handlers/dialog.php
  • Класс: BitrixImOpenLinesIntegrationsReportHandlersDialog
  • Вызов: Dialog::prepareResultByWhatWillCalculate
protected function prepareResultByWhatWillCalculate($data, $whatWillCalculateValue)
{
	$result = array();
	foreach ($data as $groupingKey => $value)
	{
		switch ($whatWillCalculateValue)
		{
			case self::WHAT_WILL_CALCULATE_AVERAGE_TIME_TO_ANSWER:
				$result[$groupingKey]['value'] = floor(array_sum($value['value']) / count($value['value']));
				$result[$groupingKey]['label'] = $value['label'];
				break;
			default:
				$result[$groupingKey]['value'] = array_sum($value['value']);
				$result[$groupingKey]['label'] = $value['label'];


		}
	}

	return $result;
}