28 parent::__construct();
30 $this->
setLogoUri(
'/bitrix/images/report/visualconstructor/view-lines-list.png');
31 $this->
setComponentName(
'bitrix:report.visualconstructor.widget.content.groupeddatagrid');
33 $this->
setJsClassName(
'BX.Report.VisualConstructor.Widget.Content.GroupedDataGrid');
47 $calculatedPerformedData = parent::handlerFinallyBeforePassToView($calculatedPerformedData);
51 if ($allCalculatedReportData = $calculatedPerformedData[
'data'])
53 foreach ($allCalculatedReportData as $reportKey => $reportHandlerResult)
55 $items = $reportHandlerResult[
'items'];
61 foreach ($items as $item)
63 $result[
'items'][$item[
'groupBy']][$reportKey] = $item;
65 $result[
'config'][
'reportOptions'][$reportKey][
'title'] = htmlspecialcharsbx($reportHandlerResult[
'config'][
'reportTitle']);
67 foreach ($reportHandlerResult[
'config'][
'groupsLabelMap'] as $groupKey => $label)
69 $result[
'config'][
'groupOptions'][$groupKey][
'title'] = htmlspecialcharsbx($label);
72 foreach ($reportHandlerResult[
'config'][
'groupsLogoMap'] as $groupKey => $logUrl)
74 $result[
'config'][
'groupOptions'][$groupKey][
'logo'] = $logUrl;
77 if (!empty($reportHandlerResult[
'config'][
'groupsTargetUrlMap']))
79 foreach ($reportHandlerResult[
'config'][
'groupsTargetUrlMap'] as $groupKey => $targetUrl)
81 $result[
'config'][
'groupOptions'][$groupKey][
'link'] = $targetUrl;
98 parent::collectWidgetHandlerFormElements($widgetHandler);
109 parent::collectReportHandlerFormElements($reportHandler);
111 $colorField = $reportHandler->getFormElement(
'color');
114 $colorField->setPickerFieldHidden(
true);
118 $whatWillCalculateField = $reportHandler->getFormElement(
'calculate');
119 $labelField = $reportHandler->getFormElement(
'label');
120 if ($whatWillCalculateField)
122 $labelField->addJsEventListener($whatWillCalculateField, $whatWillCalculateField::JS_EVENT_ON_CHANGE, array(
123 'class' =>
'BX.Report.VisualConstructor.FieldEventHandlers.Title',
124 'action' =>
'whatWillCalculateChange',
126 $labelField->addAssets(array(
127 'js' => array(
'/bitrix/js/report/js/visualconstructor/fields/reporttitle.js')
131 $calculateField = $reportHandler->getFormElement(
'calculate');
134 $groupByField = $reportHandler->getFormElement(
'groupingBy');
135 $groupByField->setDefaultValue(
'RESPONSIBLE');
136 $reportHandler->addFormElementBefore($groupByField, $reportHandler->getFormElement(
'main_container_end'));
static getMessage($code, $replace=null, $language=null)