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

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

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

	return $widget;
}