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

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


	$report = new Report();
	$report->setGId(Util::generateUserUniqueId());
	$report->setReportClassName(Treatment::getClassName());
	$report->setWidget($widget);
	$report->getReportHandler(true)->updateFormElementValue('groupingBy', Treatment::GROUP_BY_CHANEL);
	$report->getReportHandler(true)->updateFormElementValue('calculate', Treatment::WHAT_WILL_CALCULATE_ALL);
	$report->addConfigurations($report->getReportHandler(true)->getConfigurations());
	$widget->addReports($report);


	return $widget;
}