• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/integrations/report/handlers/base.php
  • Класс: BitrixImOpenLinesIntegrationsReportHandlersBase
  • Вызов: Base::collectFormElements
protected function collectFormElements()
{
	$listOpenLinesOptions = $this->getOpenLinesOptions();
	$listChanelOptions = $this->getChanelOptions();
	$listResponsibleOptions = $this->getResponsibleOptions();
	$listLinesResponsibleOptions = $this->getLinesResponsibleOptions();

	parent::collectFormElements();
	$rowContainer = new Div();
	$rowContainer->addClass('report-configuration-row');
	$whatWillCalculateField = $this->getFormElement('calculate');

	$openLineSelect = new DropDown('filterOpenLine');
	$openLineSelect->setLabel(Loc::getMessage('FILTER_BY_OPEN_LINE'));
	$openLineSelect->addOptions($listOpenLinesOptions);
	$this->addFormElementBefore($openLineSelect, $whatWillCalculateField);

	$channelSelect = new DropDown('filterByChanel');
	$channelSelect->setLabel(Loc::getMessage('FILTER_BY_CHANNEL'));
	$channelSelect->addOptions($listChanelOptions);
	$this->addFormElementBefore($channelSelect, $whatWillCalculateField);

	$responsibleSelect = new DropDownResponsible('filterByResponsible');
	$responsibleSelect->setLabel(Loc::getMessage('FILTER_BY_RESPONSIBLE'));
	$responsibleSelect->addOptions($listResponsibleOptions);
	$responsibleSelect->setLinesOperators($listLinesResponsibleOptions);
	$responsibleSelect->setOpenLines($openLineSelect);
	$this->addFormElementBefore($responsibleSelect, $whatWillCalculateField);

	if ($previewBlock = $this->getWidgetHandler()->getFormElement('view_type'))
	{
		$previewBlock->addJsEventListener($openLineSelect, $openLineSelect::JS_EVENT_ON_CHANGE, [
			'class' => 'BX.Report.VisualConstructor.FieldEventHandlers.PreviewBlock',
			'action' => 'reloadWidgetPreview'
		]);
		$previewBlock->addJsEventListener($channelSelect, $channelSelect::JS_EVENT_ON_CHANGE, [
			'class' => 'BX.Report.VisualConstructor.FieldEventHandlers.PreviewBlock',
			'action' => 'reloadWidgetPreview'
		]);
		$previewBlock->addJsEventListener($responsibleSelect, $responsibleSelect::JS_EVENT_ON_CHANGE, [
			'class' => 'BX.Report.VisualConstructor.FieldEventHandlers.PreviewBlock',
			'action' => 'reloadWidgetPreview'
		]);
	}

}