GridFilter::getFilterFields

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. GridFilter
  4. getFilterFields
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/internals/project/filter/gridfilter.php
  • Класс: BitrixTasksInternalsProjectFilterGridFilter
  • Вызов: GridFilter::getFilterFields
public function getFilterFields(): array
{
	if ($this->isScrum)
	{
		$counterItems = [
			'NEW_COMMENTS' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_COUNTERS_NEW_COMMENTS'),
			'PROJECT_NEW_COMMENTS' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_COUNTERS_PROJECT_NEW_COMMENTS'),
		];
	}
	else
	{
		$counterItems = [
			'EXPIRED' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_COUNTERS_EXPIRED'),
			'NEW_COMMENTS' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_COUNTERS_NEW_COMMENTS'),
			'PROJECT_EXPIRED' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_COUNTERS_PROJECT_EXPIRED'),
			'PROJECT_NEW_COMMENTS' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_COUNTERS_PROJECT_NEW_COMMENTS'),
		];
	}

	$fields = [
		'NAME' => [
			'id' => 'NAME',
			'name' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_NAME'),
			'type' => 'string',
			'default' => true,
		],
		'OWNER_ID' => [
			'id' => 'OWNER_ID',
			'name' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_DIRECTOR'),
			'type' => 'dest_selector',
			'params' => [
				'apiVersion' => '3',
				'context' => 'TASKS_PROJECTS_FILTER_OWNER_ID',
				'multiple' => 'N',
				'contextCode' => 'U',
				'enableAll' => 'N',
				'enableSonetgroups' => 'N',
				'allowEmailInvitation' => 'N',
				'allowSearchEmailUsers' => 'Y',
				'departmentSelectDisable' => 'Y',
				'isNumeric' => 'Y',
				'prefix' => 'U',
			],
			'default' => true,
		],
		'MEMBER' => [
			'id' => 'MEMBER_ID',
			'name' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_MEMBER'),
			'type' => 'dest_selector',
			'params' => [
				'apiVersion' => '3',
				'context' => 'TASKS_PROJECTS_FILTER_MEMBER_ID',
				'multiple' => 'N',
				'contextCode' => 'U',
				'enableAll' => 'N',
				'enableSonetgroups' => 'N',
				'allowEmailInvitation' => 'N',
				'allowSearchEmailUsers' => 'Y',
				'departmentSelectDisable' => 'Y',
				'isNumeric' => 'Y',
				'prefix' => 'U',
			],
			'default' => true,
		],
		'CLOSED' => [
			'id' => 'CLOSED',
			'name' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_CLOSED'),
			'type' => 'list',
			'items' => [
				'Y' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_CLOSED_Y'),
				'N' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_CLOSED_N'),
			],
		],
		'ID' => [
			'id' => 'ID',
			'name' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_ID'),
			'type' => 'number',
			'default' => false,
		],
		'TAGS' => [
			'id' => 'TAGS',
			'name' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_TAG'),
			'type' => 'string',
			'default' => false,
		],
		'COUNTERS' => [
			'id' => 'COUNTERS',
			'name' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_COUNTERS'),
			'type' => 'list',
			'items' => $counterItems,
		],
	];

	if (!$this->isScrum)
	{
		$fields['IS_PROJECT'] = [
			'id' => 'IS_PROJECT',
			'name' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_IS_PROJECT'),
			'type' => 'list',
			'items' => [
				'Y' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_IS_PROJECT_Y'),
				'N' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_IS_PROJECT_N'),
			],
		];
		$fields['TYPE'] = [
			'id' => 'TYPE',
			'name' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_TYPE'),
			'type' => 'list',
			'items' => $this->getProjectTypes(),
		];
		$fields['PROJECT_DATE'] = [
			'id' => 'PROJECT_DATE',
			'name' => Loc::getMessage('TASKS_PROJECT_GRID_FILTER_FIELD_PROJECT_DATE'),
			'type' => 'date',
		];
	}

	return $fields;
}

Добавить комментарий