29 $calculatedPerformedData[
'data'] = $calculatedPerformedData;
33 if ($allCalculatedReportData = $calculatedPerformedData[
'data'])
35 foreach ($allCalculatedReportData as $reportKey => $reportHandlerResult)
37 $items = $reportHandlerResult[
'items'];
39 foreach ($items as $item)
41 $result[
'items'][$item[
'groupBy']][$reportKey] = $item;
43 $result[
'config'][
'reportOptions'][$reportKey][
'title'] = htmlspecialcharsbx($reportHandlerResult[
'config'][
'reportTitle']);
44 $result[
'config'][
'reportOptions'][$reportKey][
'amount'] = !empty($reportHandlerResult[
'config'][
'amount']) ? $reportHandlerResult[
'config'][
'amount'] : [];
46 if (!empty($reportHandlerResult[
'config'][
'groupsLabelMap']))
48 foreach ($reportHandlerResult[
'config'][
'groupsLabelMap'] as $groupKey => $label)
50 $result[
'config'][
'groupOptions'][$groupKey][
'title'] = htmlspecialcharsbx($label);
54 if (!empty($reportHandlerResult[
'config'][
'groupsLogoMap']))
56 foreach ($reportHandlerResult[
'config'][
'groupsLogoMap'] as $groupKey => $logUrl)
58 $result[
'config'][
'groupOptions'][$groupKey][
'logo'] = $logUrl;
63 if (!empty($reportHandlerResult[
'config'][
'groupsTargetUrlMap']))
65 foreach ($reportHandlerResult[
'config'][
'groupsTargetUrlMap'] as $groupKey => $targetUrl)
67 $result[
'config'][
'groupOptions'][$groupKey][
'link'] = $targetUrl;