• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/integrations/report/eventhandler.php
  • Класс: BitrixImOpenLinesIntegrationsReportEventHandler
  • Вызов: EventHandler::buildDynamicsOfReaction
static function buildDynamicsOfReaction()
{
	$widget = new Widget();
	$widget->setGId(Util::generateUserUniqueId());
	$widget->setWidgetClass(BaseWidget::getClassName());
	$widget->setViewKey(MultiDirectional::VIEW_KEY);
	$widget->setCategoryKey('open_lines');
	$widget->setBoardId('open_lines_report_base_board');

	$widget->getWidgetHandler(true)->updateFormElementValue('label', Loc::getMessage('REPORT_DYNAMICS_OF_REACTION_WIDGET_TITLE'));
	$widget->addConfigurations($widget->getWidgetHandler(true)->getConfigurations());

	$allTreatmentCount = new Report();
	$allTreatmentCount->setGId(Util::generateUserUniqueId());
	$allTreatmentCount->setReportClassName(Treatment::getClassName());
	$allTreatmentCount->setWidget($widget);
	$allTreatmentCount->getReportHandler(true)->updateFormElementValue('label', Loc::getMessage('REPORT_ALL_TREATMENT_COUNT_TITLE'));
	$allTreatmentCount->getReportHandler(true)->updateFormElementValue('color', '#ff8792');
	$allTreatmentCount->getReportHandler(true)->updateFormElementValue('groupingBy', Treatment::GROUP_BY_DATE);
	$allTreatmentCount->getReportHandler(true)->updateFormElementValue('calculate', Treatment::WHAT_WILL_CALCULATE_ALL);
	$allTreatmentCount->addConfigurations($allTreatmentCount->getReportHandler(true)->getConfigurations());
	$widget->addReports($allTreatmentCount);

	$averageAnswerTime = new Report();
	$averageAnswerTime->setGId(Util::generateUserUniqueId());
	$averageAnswerTime->setReportClassName(Dialog::getClassName());
	$averageAnswerTime->setWidget($widget);
	$averageAnswerTime->getReportHandler(true)->updateFormElementValue('label', Loc::getMessage('REPORT_AVERAGE_TIME_TO_ANSWER_TITLE'));
	$averageAnswerTime->getReportHandler(true)->updateFormElementValue('color', '#ff9752');
	$averageAnswerTime->getReportHandler(true)->updateFormElementValue('groupingBy', Dialog::GROUP_BY_DATE);
	$averageAnswerTime->getReportHandler(true)->updateFormElementValue('calculate', Dialog::WHAT_WILL_CALCULATE_AVERAGE_TIME_TO_ANSWER);
	$averageAnswerTime->addConfigurations($averageAnswerTime->getReportHandler(true)->getConfigurations());
	$widget->addReports($averageAnswerTime);

	return $widget;
}