Example #1
0
// <editor-fold defaultstate="collapsed" desc="filter compare variations">
$compareVariations = $arResult['compareVariations'] = call_user_func(array($arParams['REPORT_HELPER_CLASS'], 'getCompareVariations'));
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="period types">
$periodTypes = $arResult['periodTypes'] = array('month', 'month_ago', 'week', 'week_ago', 'days', 'after', 'before', 'interval', 'all');
// </editor-fold>
try {
    // <editor-fold defaultstate="collapsed" desc="common initiazlize">
    $ownerId = call_user_func(array($arParams['REPORT_HELPER_CLASS'], 'getOwnerId'));
    $entityName = call_user_func(array($arParams['REPORT_HELPER_CLASS'], 'getEntityName'));
    $entityFields = call_user_func(array($arParams['REPORT_HELPER_CLASS'], 'getColumnList'));
    $initEntity = Entity\Base::getInstance($entityName);
    $strChains = $entityFields;
    $chains = CReport::generateChains($strChains, $initEntity, '');
    $arResult['chains'] = $chains;
    $arResult['fieldsTree'] = CReport::generateColumnTree($chains, $initEntity, $arParams['REPORT_HELPER_CLASS']);
    $fieldList = CReport::getUniqueFieldsByTree($arResult['fieldsTree']);
    // </editor-fold>
    // <editor-fold defaultstate="collapsed" desc="validation">
    if ($arParams['ACTION'] == 'edit' || $arParams['ACTION'] == 'copy' || $arParams['ACTION'] == 'delete') {
        $result = Bitrix\Report\ReportTable::getById($arParams['REPORT_ID']);
        $report = $result->fetch();
        if (empty($report)) {
            throw new BXUserException(sprintf(GetMessage('REPORT_NOT_FOUND'), $arParams['REPORT_ID']));
        }
        if ($report['CREATED_BY'] != $USER->GetID()) {
            throw new BXUserException(GetMessage('REPORT_VIEW_PERMISSION_DENIED'));
        }
        $arResult['report'] = $report;
    }
    // </editor-fold>
Example #2
0
 $group = array();
 $order = array();
 $limit = array();
 $options = array('SQL_TIME_INTERVAL' => $sqlTimeInterval);
 $excelView = isset($_GET["EXCEL"]) && $_GET["EXCEL"] == "Y";
 // <editor-fold defaultstate="collapsed" desc="parse entity">
 $entityName = call_user_func(array($arParams['REPORT_HELPER_CLASS'], 'getEntityName'));
 $entityFields = call_user_func(array($arParams['REPORT_HELPER_CLASS'], 'getColumnList'));
 $grcFields = call_user_func(array($arParams['REPORT_HELPER_CLASS'], 'getGrcColumns'));
 //$arUFInfo = call_user_func(array($arParams['REPORT_HELPER_CLASS'], 'getUFInfo'));
 $arUFEnumerations = call_user_func(array($arParams['REPORT_HELPER_CLASS'], 'getUFEnumerations'));
 // customize entity
 $entity = clone Entity\Base::getInstance($entityName);
 call_user_func(array($arParams['REPORT_HELPER_CLASS'], 'setRuntimeFields'), $entity, $sqlTimeInterval);
 $chains = CReport::generateChains($entityFields, $entity, '');
 $fieldsTree = CReport::generateColumnTree($chains, $entity, $arParams['REPORT_HELPER_CLASS']);
 unset($chains);
 // custom columns types
 $customColumnTypes = call_user_func(array($arParams['REPORT_HELPER_CLASS'], 'getCustomColumnTypes'));
 if (!is_array($customColumnTypes)) {
     $customColumnTypes = array();
 }
 // </editor-fold>
 // <editor-fold defaultstate="collapsed" desc="parse select columns">
 // <editor-fold defaultstate="collapsed" desc="collect fields">
 $fList = array();
 $fChainList = array();
 $bGroupingMode = false;
 foreach ($settings['select'] as $elem) {
     if (!$bGroupingMode) {
         if ($elem['grouping'] === true) {