• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/integrations/report/handlers/dialog.php
  • Класс: BitrixImOpenLinesIntegrationsReportHandlersDialog
  • Вызов: Dialog::prepare
public function prepare()
{
	$query = $this->getQueryForPrepareData();

	/** @var DropDown $whatWillCalculate */
	$whatWillCalculate = $this->getFormElement('calculate');
	$whatWillCalculateValue = $whatWillCalculate->getValue();
	switch ($whatWillCalculateValue)
	{
		case self::WHAT_WILL_CALCULATE_AVERAGE_TIME_TO_ANSWER:
			$query->addSelect(new ExpressionField('VALUE', '(SUM(AVERAGE_SECS_TO_ANSWER) / COUNT(*)) / 60'));
			break;
	}
	$result = $query->exec();

	return $this->getCalculatedDataFromDbResult($result);
}