• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/report/dashboard/managers/managersrating.php
  • Класс: Bitrix\Crm\Integration\Report\Dashboard\Managers\ManagersRating
  • Вызов: ManagersRating::buildManagersRatingGraph
static function buildManagersRatingGraph()
{
	$widget = new Widget();
	$widget->setGId(Util::generateUserUniqueId());
	$widget->setWidgetClass(BaseWidget::getClassName());
	$widget->setViewKey(View\Managers\ManagersRatingGraph::VIEW_KEY);
	$widget->setCategoryKey('crm');
	$widget->setBoardId(self::BOARD_KEY);

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

	$report = new Report();
	$report->setGId(Util::generateUserUniqueId());
	$report->setReportClassName(Handler\Managers\RatingGraph::class);
	$report->setWidget($widget);
	$report->getReportHandler(true)->updateFormElementValue(
		'label',
		Loc::getMessage("CRM_REPORT_MANAGER_WON_DEALS_AMOUNT")
	);
	$report->getReportHandler(true)->updateFormElementValue("color", "#64b1e2");
	$report->addConfigurations($report->getReportHandler(true)->getConfigurations());
	$widget->addReports($report);

	return $widget;
}