Beispiel #1
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule('crm')) {
    ShowError(GetMessage('CRM_MODULE_NOT_INSTALLED'));
    return;
}
$gridID = $arParams['GRID_ID'];
$gridContext = CCrmGridContext::Get($gridID);
if (empty($gridContext) && isset($arParams['FILTER_FIELDS'])) {
    $gridContext = CCrmGridContext::Parse($arParams['FILTER_FIELDS']);
    if (isset($arParams['IS_EXTERNAL_FILTER']) && $arParams['IS_EXTERNAL_FILTER']) {
        $gridContext['FILTER_INFO']['IS_APPLIED'] = false;
    }
}
$arResult['FILTER_INFO'] = isset($gridContext['FILTER_INFO']) ? $gridContext['FILTER_INFO'] : array();
$this->IncludeComponentTemplate();
Beispiel #2
0
             $urlParams[] = $filterFieldID . '_from';
             $urlParams[] = $filterFieldID . '_to';
         }
         $urlParams[] = $filterFieldID;
     }
     $urlParams[] = 'clear_filter';
     $CGridOptions->GetFilter(array());
     if ($arResult['TAB_ID'] !== '') {
         $urlParams[] = $tabParamName;
         LocalRedirect($APPLICATION->GetCurPageParam(urlencode($tabParamName) . '=' . urlencode($arResult['TAB_ID']), $urlParams));
     } else {
         LocalRedirect($APPLICATION->GetCurPageParam('', $urlParams));
     }
 }
 $arGridFilter = $CGridOptions->GetFilter($arResult['FILTER']);
 $arResult['GRID_CONTEXT'] = CCrmGridContext::Parse($arGridFilter);
 if (!$arResult['GRID_CONTEXT']['FILTER_INFO']['IS_APPLIED']) {
     $clearFilterKey = 'activity_list_clear_filter' . strtolower($arResult['UID']);
     if (isset($_REQUEST['clear_filter']) && $_REQUEST['clear_filter'] !== '') {
         $_SESSION[$clearFilterKey] = $arResult['CLEAR_FILTER'] = true;
     } elseif (isset($_SESSION[$clearFilterKey]) && $_SESSION[$clearFilterKey]) {
         $arResult['CLEAR_FILTER'] = true;
     }
 }
 if (empty($arGridFilter) && isset($arParams['DEFAULT_FILTER']) && is_array($arParams['DEFAULT_FILTER'])) {
     $arGridFilter = $arParams['DEFAULT_FILTER'];
 }
 $arResult['GRID_FILTER'] = $arGridFilter;
 if (!empty($arGridFilter)) {
     // Clear SHOW_MODE filter if grid filter is enabled
     $showMode = $arResult['SHOW_MODE'] = 'ALL';