Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
Show All 38 Lines | final class ManiphestTaskSearchEngine | ||||
} | } | ||||
public function newQuery() { | public function newQuery() { | ||||
return id(new ManiphestTaskQuery()) | return id(new ManiphestTaskQuery()) | ||||
->needProjectPHIDs(true); | ->needProjectPHIDs(true); | ||||
} | } | ||||
protected function buildCustomSearchFields() { | protected function buildCustomSearchFields() { | ||||
// Hide the "Subtypes" constraint from the web UI if the install only | |||||
// defines one task subtype, since it isn't of any use in this case. | |||||
$subtype_map = id(new ManiphestTask())->newEditEngineSubtypeMap(); | |||||
$hide_subtypes = (count($subtype_map) == 1); | |||||
return array( | return array( | ||||
id(new PhabricatorOwnersSearchField()) | id(new PhabricatorOwnersSearchField()) | ||||
->setLabel(pht('Assigned To')) | ->setLabel(pht('Assigned To')) | ||||
->setKey('assignedPHIDs') | ->setKey('assignedPHIDs') | ||||
->setConduitKey('assigned') | ->setConduitKey('assigned') | ||||
->setAliases(array('assigned')) | ->setAliases(array('assigned')) | ||||
->setDescription( | ->setDescription( | ||||
pht('Search for tasks owned by a user from a list.')), | pht('Search for tasks owned by a user from a list.')), | ||||
Show All 13 Lines | return array( | ||||
id(new PhabricatorSearchDatasourceField()) | id(new PhabricatorSearchDatasourceField()) | ||||
->setLabel(pht('Priorities')) | ->setLabel(pht('Priorities')) | ||||
->setKey('priorities') | ->setKey('priorities') | ||||
->setAliases(array('priority')) | ->setAliases(array('priority')) | ||||
->setDescription( | ->setDescription( | ||||
pht('Search for tasks with given priorities.')) | pht('Search for tasks with given priorities.')) | ||||
->setConduitParameterType(new ConduitIntListParameterType()) | ->setConduitParameterType(new ConduitIntListParameterType()) | ||||
->setDatasource(new ManiphestTaskPriorityDatasource()), | ->setDatasource(new ManiphestTaskPriorityDatasource()), | ||||
id(new PhabricatorSearchDatasourceField()) | |||||
->setLabel(pht('Subtypes')) | |||||
->setKey('subtypes') | |||||
->setAliases(array('subtype')) | |||||
->setDescription( | |||||
pht('Search for tasks with given subtypes.')) | |||||
->setDatasource(new ManiphestTaskSubtypeDatasource()) | |||||
->setIsHidden($hide_subtypes), | |||||
id(new PhabricatorSearchTextField()) | id(new PhabricatorSearchTextField()) | ||||
->setLabel(pht('Contains Words')) | ->setLabel(pht('Contains Words')) | ||||
->setKey('fulltext'), | ->setKey('fulltext'), | ||||
id(new PhabricatorSearchThreeStateField()) | id(new PhabricatorSearchThreeStateField()) | ||||
->setLabel(pht('Open Parents')) | ->setLabel(pht('Open Parents')) | ||||
->setKey('hasParents') | ->setKey('hasParents') | ||||
->setAliases(array('blocking')) | ->setAliases(array('blocking')) | ||||
->setOptions( | ->setOptions( | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | final class ManiphestTaskSearchEngine | ||||
protected function getDefaultFieldOrder() { | protected function getDefaultFieldOrder() { | ||||
return array( | return array( | ||||
'assignedPHIDs', | 'assignedPHIDs', | ||||
'projectPHIDs', | 'projectPHIDs', | ||||
'authorPHIDs', | 'authorPHIDs', | ||||
'subscriberPHIDs', | 'subscriberPHIDs', | ||||
'statuses', | 'statuses', | ||||
'priorities', | 'priorities', | ||||
'subtypes', | |||||
'fulltext', | 'fulltext', | ||||
'hasParents', | 'hasParents', | ||||
'hasSubtasks', | 'hasSubtasks', | ||||
'parentIDs', | 'parentIDs', | ||||
'subtaskIDs', | 'subtaskIDs', | ||||
'group', | 'group', | ||||
'order', | 'order', | ||||
'ids', | 'ids', | ||||
Show All 32 Lines | protected function buildQueryFromParameters(array $map) { | ||||
if ($map['statuses']) { | if ($map['statuses']) { | ||||
$query->withStatuses($map['statuses']); | $query->withStatuses($map['statuses']); | ||||
} | } | ||||
if ($map['priorities']) { | if ($map['priorities']) { | ||||
$query->withPriorities($map['priorities']); | $query->withPriorities($map['priorities']); | ||||
} | } | ||||
if ($map['subtypes']) { | |||||
$query->withSubtypes($map['subtypes']); | |||||
} | |||||
if ($map['createdStart']) { | if ($map['createdStart']) { | ||||
$query->withDateCreatedAfter($map['createdStart']); | $query->withDateCreatedAfter($map['createdStart']); | ||||
} | } | ||||
if ($map['createdEnd']) { | if ($map['createdEnd']) { | ||||
$query->withDateCreatedBefore($map['createdEnd']); | $query->withDateCreatedBefore($map['createdEnd']); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 239 Lines • Show Last 20 Lines |