Documentation

GetSelectedFilterPresetId

int
public function getSelectedFilterPresetId();

This method returns the ID of the current selected filter.

Returned value

Returns the ID of the current deleted user.

Examples of use

<?php
CModule::IncludeModule('tasks');
$userId = (int) $GLOBALS['USER']->getId();
$bGroupMode = false;
$oFilter = CTaskFilterCtrl::getInstance($userId, $bGroupMode);

$selectedFilter = $oFilter->getSelectedFilterPresetId();
$arFilter = $oFilter->getFilterPresetConditionById($selectedFilter);

// Show filter conditions
var_dump($arFilter);

// This condition can be used in CTasks::GetList();
$rsTasks = CTasks::GetList(array(), $arFilter);
?>

Result:
array(1) {
  ["::SUBFILTER-ROOT"]=>
  array(3) {
    ["::LOGIC"]=>
    string(3) "AND"
    ["MEMBER"]=>
    int(1)
    ["STATUS"]=>
    array(6) {
      [0]=>
      int(-2)
      [1]=>
      int(-1)
      [2]=>
      int(1)
      [3]=>
      int(2)
      [4]=>
      int(3)
      [5]=>
      int(7)
    }
  }
}


© «Bitrix24», 2001-2024
Up