Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/query/PhabricatorProjectSearchEngine.php
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | return array( | ||||
id(new PhabricatorSearchCheckboxesField()) | id(new PhabricatorSearchCheckboxesField()) | ||||
->setLabel(pht('Icons')) | ->setLabel(pht('Icons')) | ||||
->setKey('icons') | ->setKey('icons') | ||||
->setOptions($this->getIconOptions()), | ->setOptions($this->getIconOptions()), | ||||
id(new PhabricatorSearchCheckboxesField()) | id(new PhabricatorSearchCheckboxesField()) | ||||
->setLabel(pht('Colors')) | ->setLabel(pht('Colors')) | ||||
->setKey('colors') | ->setKey('colors') | ||||
->setOptions($this->getColorOptions()), | ->setOptions($this->getColorOptions()), | ||||
id(new PhabricatorPHIDsSearchField()) | |||||
->setLabel(pht('Parent Projects')) | |||||
->setKey('parentPHIDs') | |||||
->setAliases(array('parent', 'parents', 'parentPHID')) | |||||
->setDescription(pht('Find direct subprojects of specified parents.')), | |||||
id(new PhabricatorPHIDsSearchField()) | |||||
->setLabel(pht('Ancestor Projects')) | |||||
->setKey('ancestorPHIDs') | |||||
->setAliases(array('ancestor', 'ancestors', 'ancestorPHID')) | |||||
->setDescription( | |||||
pht('Find all subprojects beneath specified ancestors.')), | |||||
); | ); | ||||
} | } | ||||
protected function buildQueryFromParameters(array $map) { | protected function buildQueryFromParameters(array $map) { | ||||
$query = $this->newQuery(); | $query = $this->newQuery(); | ||||
if (strlen($map['name'])) { | if (strlen($map['name'])) { | ||||
Show All 23 Lines | protected function buildQueryFromParameters(array $map) { | ||||
if ($map['colors']) { | if ($map['colors']) { | ||||
$query->withColors($map['colors']); | $query->withColors($map['colors']); | ||||
} | } | ||||
if ($map['isMilestone'] !== null) { | if ($map['isMilestone'] !== null) { | ||||
$query->withIsMilestone($map['isMilestone']); | $query->withIsMilestone($map['isMilestone']); | ||||
} | } | ||||
if ($map['parentPHIDs']) { | |||||
$query->withParentProjectPHIDs($map['parentPHIDs']); | |||||
} | |||||
if ($map['ancestorPHIDs']) { | |||||
$query->withAncestorProjectPHIDs($map['ancestorPHIDs']); | |||||
} | |||||
return $query; | return $query; | ||||
} | } | ||||
protected function getURI($path) { | protected function getURI($path) { | ||||
return '/project/'.$path; | return '/project/'.$path; | ||||
} | } | ||||
protected function getBuiltinQueryNames() { | protected function getBuiltinQueryNames() { | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |