• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/integrations/report/eventhandler.php
  • Класс: BitrixImOpenLinesIntegrationsReportEventHandler
  • Вызов: EventHandler::onDefaultBoardsCollect
static function onDefaultBoardsCollect()
{
	$board = new Dashboard();
	$board->setVersion('v3');
	$board->setBoardKey(self::getOpenLinesBoardId());
	$board->setGId(Util::generateUserUniqueId());
	$board->setUserId(0);

	$firstRow = new DashboardRow();
	$firstRow->setGId(Util::generateUserUniqueId());
	$firstRow->setWeight(1);
	$firstCellId = 'cell_' . randString(4);
	$secondCellId = 'cell_' . randString(4);

	$map = array(
		'type' => 'cell-container',
		'orientation' => 'horizontal',
		'elements' => array(
			array(
				'type' => 'cell',
				'id' => $firstCellId
			),
			array(
				'type' => 'cell',
				'id' => $secondCellId
			)
		)
	);
	$firstRow->setLayoutMap($map);
	$board->addRows($firstRow);

	$loadByChannelWidget= self::buildWidgetLoadByChannels();
	$loadByChannelWidget->setWeight($firstCellId);
	$loadByChannelWidget->setIsPattern(true);
	$firstRow->addWidgets($loadByChannelWidget);

	$numberBlockWithTreatmentCount = self::buildNumberBlockWithTreatmentCount();
	$numberBlockWithTreatmentCount->setWeight($secondCellId);
	$numberBlockWithTreatmentCount->setIsPattern(true);
	$firstRow->addWidgets($numberBlockWithTreatmentCount);


	$secondRow = new DashboardRow();
	$secondRow->setGId(Util::generateUserUniqueId());
	$secondRow->setWeight(2);
	$firstCellId = 'cell_' . randString(4);
	$secondCellId = 'cell_' . randString(4);

	$map = array(
		'type' => 'cell-container',
		'orientation' => 'horizontal',
		'elements' => array(
			array(
				'type' => 'cell',
				'id' => $firstCellId
			),
			array(
				'type' => 'cell',
				'id' => $secondCellId
			)
		)
	);
	$secondRow->setLayoutMap($map);
	$board->addRows($secondRow);

	$numberWithAverageTime= self::buildNumberWithAverageAnswerTime();
	$numberWithAverageTime->setWeight($firstCellId);
	$numberWithAverageTime->setIsPattern(true);
	$secondRow->addWidgets($numberWithAverageTime);

	$numberWithContentment = self::buildNumberContentment();
	$numberWithContentment->setWeight($secondCellId);
	$numberWithContentment->setIsPattern(true);
	$secondRow->addWidgets($numberWithContentment);


	$thirdRow = new DashboardRow();
	$thirdRow->setGId(Util::generateUserUniqueId());
	$thirdRow->setWeight(3);
	$firstCellId = 'cell_' . randString(4);
	$secondCellId = 'cell_' . randString(4);

	$map = array(
		'type' => 'cell-container',
		'orientation' => 'horizontal',
		'elements' => array(
			array(
				'type' => 'cell',
				'id' => $firstCellId
			),
			array(
				'type' => 'cell',
				'id' => $secondCellId
			)
		)
	);
	$thirdRow->setLayoutMap($map);
	$board->addRows($thirdRow);

	$dynamicsOfReaction= self::buildDynamicsOfReaction();
	$dynamicsOfReaction->setWeight($firstCellId);
	$dynamicsOfReaction->setIsPattern(true);
	$thirdRow->addWidgets($dynamicsOfReaction);

	$activity = self::buildActivity();
	$activity->setWeight($secondCellId);
	$activity->setIsPattern(true);
	$thirdRow->addWidgets($activity);


	$fourthRow = new DashboardRow();
	$fourthRow->setGId(Util::generateUserUniqueId());
	$fourthRow->setWeight(4);
	$firstCellId = 'cell_' . randString(4);

	$map = array(
		'type' => 'cell-container',
		'orientation' => 'horizontal',
		'elements' => array(
			array(
				'type' => 'cell',
				'id' => $firstCellId
			),
		)
	);
	$fourthRow->setLayoutMap($map);
	$board->addRows($fourthRow);

	$dynamicsOfVote = self::buildDynamicsOfVote();
	$dynamicsOfVote->setWeight($firstCellId);
	$dynamicsOfVote->setIsPattern(true);
	$fourthRow->addWidgets($dynamicsOfVote);


	$fifthRow = new DashboardRow();
	$fifthRow->setGId(Util::generateUserUniqueId());
	$fifthRow->setWeight(5);
	$firstCellId = 'cell_' . randString(4);

	$map = array(
		'type' => 'cell-container',
		'orientation' => 'horizontal',
		'elements' => array(
			array(
				'type' => 'cell',
				'id' => $firstCellId
			),
		)
	);
	$fifthRow->setLayoutMap($map);
	$board->addRows($fifthRow);

	$staffCutStatistics= self::buildStaffCutStatistics();
	$staffCutStatistics->setWeight($firstCellId);
	$staffCutStatistics->setIsPattern(true);
	$fifthRow->addWidgets($staffCutStatistics);





	$result = array();
	$result[] = $board;
	return $result;
}