• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/ui/filter.php
  • Класс: BitrixTasksUiFilter
  • Вызов: Filter::getFilter
static function getFilter()
{
	static $filter = null;

	if ($filter === null)
	{
		$filter = array();
		$filter['ID'] = array(
			'id' => 'ID',
			'name' => Loc::getMessage('TASKS_HELPER_FLT_ID'),
			'default' => false,
			'type' => 'number'
		);
		$filter['TITLE'] = array(
			'id' => 'TITLE',
			'name' => Loc::getMessage('TASKS_HELPER_FLT_TITLE'),
			'default' => true,
			'type' => 'string'
		);
		$filter['PRIORITY'] = array(
			'id' => 'PRIORITY',
			'name' => Loc::getMessage('TASKS_HELPER_FLT_PRIORITY'),
			'default' => false,
			'type' => 'list',
			'items' => array(
				CTasks::PRIORITY_HIGH => Loc::getMessage('TASKS_HELPER_FLT_PRIORITY_HIGH')
			)
		);
		$filter['REAL_STATUS'] = array(
			'id' => 'REAL_STATUS',
			'name' => Loc::getMessage('TASKS_HELPER_FLT_REAL_STATUS'),
			'default' => true,
			'type' => 'list',
			'items' => array(
				static::getMetaStatus('IN_PROGRESS') => Loc::getMessage('TASKS_HELPER_FLT_REAL_STATUS_IN_PROGRESS'),
				static::getMetaStatus('DEFERRED') => Loc::getMessage('TASKS_HELPER_FLT_REAL_STATUS_DEFERRED'),
				static::getMetaStatus('COMPLETED') => Loc::getMessage('TASKS_HELPER_FLT_REAL_STATUS_COMPLETED')
			)
		);
		$filter['PROBLEM'] = array(
			'id' => 'PROBLEM',
			'name' => Loc::getMessage('TASKS_HELPER_FLT_PROBLEM'),
			'default' => false,
			'type' => 'list',
			'items' => static::getCounters()
		);
		$filter['DEADLINE'] = array(
			'id' => 'DEADLINE',
			'name' => Loc::getMessage('TASKS_HELPER_FLT_DEADLINE'),
			'default' => true,
			'type' => 'date'
		);
		$filter['CREATED_DATE'] = array(
			'id' => 'CREATED_DATE',
			'name' => Loc::getMessage('TASKS_HELPER_FLT_CREATED_DATE'),
			'default' => false,
			'type' => 'date'
		);
		$filter['CLOSED_DATE'] = array(
			'id' => 'CLOSED_DATE',
			'name' => Loc::getMessage('TASKS_HELPER_FLT_CLOSED_DATE'),
			'default' => false,
			'type' => 'date'
		);
		$filter['RESPONSIBLE_ID'] = array(
			'id' => 'RESPONSIBLE_ID',
			'name' => Loc::getMessage('TASKS_HELPER_FLT_RESPONSIBLE_ID'),
			'default' => false,
			'type' => 'custom_entity',
			'selector' => array(
				'TYPE' => 'user',
				'DATA' => array(
					'ID' => 'user',
					'FIELD_ID' => 'RESPONSIBLE_ID'
				)
			)
		);
		$filter['CREATED_BY'] = array(
			'id' => 'CREATED_BY',
			'name' => Loc::getMessage('TASKS_HELPER_FLT_CREATED_BY'),
			'default' => false,
			'type' => 'custom_entity',
			'selector' => array(
				'TYPE' => 'user',
				'DATA' => array(
					'ID' => 'user',
					'FIELD_ID' => 'CREATED_BY'
				)
			)
		);
		$filter['GROUP_ID'] = array(
			'id' => 'GROUP_ID',
			'name' => Loc::getMessage('TASKS_HELPER_FLT_GROUP'),
			'default' => true,
			'type' => 'custom_entity',
			'selector' => array(
				'TYPE' => 'group',
				'DATA' => array(
					'ID' => 'group',
					'FIELD_ID' => 'GROUP_ID'
				)
			)
		);
	}

	return $filter;
}