Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
| Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | final class ManiphestTaskSearchEngine | ||||
| } | } | ||||
| protected function buildCustomSearchFields() { | protected function buildCustomSearchFields() { | ||||
| // Hide the "Subtypes" constraint from the web UI if the install only | // 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. | // defines one task subtype, since it isn't of any use in this case. | ||||
| $subtype_map = id(new ManiphestTask())->newEditEngineSubtypeMap(); | $subtype_map = id(new ManiphestTask())->newEditEngineSubtypeMap(); | ||||
| $hide_subtypes = (count($subtype_map) == 1); | $hide_subtypes = (count($subtype_map) == 1); | ||||
| $hide_ferret = !PhabricatorEnv::getEnvConfig('phabricator.show-prototypes'); | |||||
| 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 24 Lines | return array( | ||||
| ->setAliases(array('subtype')) | ->setAliases(array('subtype')) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht('Search for tasks with given subtypes.')) | pht('Search for tasks with given subtypes.')) | ||||
| ->setDatasource(new ManiphestTaskSubtypeDatasource()) | ->setDatasource(new ManiphestTaskSubtypeDatasource()) | ||||
| ->setIsHidden($hide_subtypes), | ->setIsHidden($hide_subtypes), | ||||
| id(new PhabricatorSearchTextField()) | id(new PhabricatorSearchTextField()) | ||||
| ->setLabel(pht('Contains Words')) | ->setLabel(pht('Contains Words')) | ||||
| ->setKey('fulltext'), | ->setKey('fulltext'), | ||||
| id(new PhabricatorSearchTextField()) | |||||
| ->setLabel(pht('Matches (Prototype)')) | |||||
| ->setKey('ferret') | |||||
| ->setIsHidden($hide_ferret), | |||||
| 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( | ||||
| pht('(Show All)'), | pht('(Show All)'), | ||||
| pht('Show Only Tasks With Open Parents'), | pht('Show Only Tasks With Open Parents'), | ||||
| pht('Show Only Tasks Without Open Parents')), | pht('Show Only Tasks Without Open Parents')), | ||||
| Show All 40 Lines | return array( | ||||
| 'assignedPHIDs', | 'assignedPHIDs', | ||||
| 'projectPHIDs', | 'projectPHIDs', | ||||
| 'authorPHIDs', | 'authorPHIDs', | ||||
| 'subscriberPHIDs', | 'subscriberPHIDs', | ||||
| 'statuses', | 'statuses', | ||||
| 'priorities', | 'priorities', | ||||
| 'subtypes', | 'subtypes', | ||||
| 'fulltext', | 'fulltext', | ||||
| 'ferret', | |||||
| 'hasParents', | 'hasParents', | ||||
| 'hasSubtasks', | 'hasSubtasks', | ||||
| 'parentIDs', | 'parentIDs', | ||||
| 'subtaskIDs', | 'subtaskIDs', | ||||
| 'group', | 'group', | ||||
| 'order', | 'order', | ||||
| 'ids', | 'ids', | ||||
| '...', | '...', | ||||
| ▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | protected function buildQueryFromParameters(array $map) { | ||||
| if ($map['hasSubtasks'] !== null) { | if ($map['hasSubtasks'] !== null) { | ||||
| $query->withOpenSubtasks($map['hasSubtasks']); | $query->withOpenSubtasks($map['hasSubtasks']); | ||||
| } | } | ||||
| if (strlen($map['fulltext'])) { | if (strlen($map['fulltext'])) { | ||||
| $query->withFullTextSearch($map['fulltext']); | $query->withFullTextSearch($map['fulltext']); | ||||
| } | } | ||||
| if (strlen($map['ferret'])) { | |||||
| $query->withFerretConstraint( | |||||
| id(new ManiphestTask())->newFerretEngine(), | |||||
| $map['ferret']); | |||||
| } | |||||
| if ($map['parentIDs']) { | if ($map['parentIDs']) { | ||||
| $query->withParentTaskIDs($map['parentIDs']); | $query->withParentTaskIDs($map['parentIDs']); | ||||
| } | } | ||||
| if ($map['subtaskIDs']) { | if ($map['subtaskIDs']) { | ||||
| $query->withSubtaskIDs($map['subtaskIDs']); | $query->withSubtaskIDs($map['subtaskIDs']); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 209 Lines • Show Last 20 Lines | |||||