Example #1
0
        return 0;
    }
}
// Suppress the timezone, while report works in server time
CTimeZone::Disable();
use Bitrix\Main\Entity;
// <editor-fold defaultstate="collapsed" desc="period types">
$periodTypes = $arResult['periodTypes'] = array('month', 'month_ago', 'week', 'week_ago', 'days', 'after', 'before', 'interval', 'all');
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="chart types">
if ($arParams['USE_CHART']) {
    $arResult['chartTypes'] = array(array('id' => 'line', 'name' => GetMessage('REPORT_CHART_TYPE_LINE'), 'value_types' => array('float', 'integer')), array('id' => 'bar', 'name' => GetMessage('REPORT_CHART_TYPE_BAR'), 'value_types' => array('float', 'integer')), array('id' => 'pie', 'name' => GetMessage('REPORT_CHART_TYPE_PIE'), 'value_types' => array('float', 'integer')));
}
// </editor-fold>
// get view params
$strReportViewParams = CReport::getViewParams($arParams['REPORT_ID'], $this->GetTemplateName());
if (isset($_GET['set_filter'])) {
    if (substr($_SERVER['QUERY_STRING'], 0, 6) !== 'EXCEL=') {
        if ($_SERVER['QUERY_STRING'] !== $strReportViewParams) {
            CReport::setViewParams($arParams['REPORT_ID'], $this->GetTemplateName(), $_SERVER['QUERY_STRING']);
        }
    }
} else {
    if (!empty($strReportViewParams)) {
        if (!is_set($_GET['sort_id'])) {
            $len = strpos($arParams['PATH_TO_REPORT_VIEW'], '?');
            if ($len === false) {
                $redirectUrl = $arParams['PATH_TO_REPORT_VIEW'];
            } else {
                $redirectUrl = substr($arParams['PATH_TO_REPORT_VIEW'], 0, $len);
            }