Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/query/PhabricatorPeopleSearchEngine.php
Show First 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | final class PhabricatorPeopleSearchEngine | ||||
protected function getURI($path) { | protected function getURI($path) { | ||||
return '/people/'.$path; | return '/people/'.$path; | ||||
} | } | ||||
protected function getBuiltinQueryNames() { | protected function getBuiltinQueryNames() { | ||||
$names = array( | $names = array( | ||||
'active' => pht('Active'), | 'active' => pht('Active'), | ||||
'admin' => pht('Administrators'), | |||||
'all' => pht('All'), | 'all' => pht('All'), | ||||
); | ); | ||||
$viewer = $this->requireViewer(); | $viewer = $this->requireViewer(); | ||||
if ($viewer->getIsAdmin()) { | if ($viewer->getIsAdmin()) { | ||||
$names['approval'] = pht('Approval Queue'); | $names['approval'] = pht('Approval Queue'); | ||||
} | } | ||||
return $names; | return $names; | ||||
} | } | ||||
public function buildSavedQueryFromBuiltin($query_key) { | public function buildSavedQueryFromBuiltin($query_key) { | ||||
$query = $this->newSavedQuery(); | $query = $this->newSavedQuery(); | ||||
$query->setQueryKey($query_key); | $query->setQueryKey($query_key); | ||||
switch ($query_key) { | switch ($query_key) { | ||||
case 'all': | case 'all': | ||||
return $query; | return $query; | ||||
case 'active': | case 'active': | ||||
return $query | return $query | ||||
->setParameter('isDisabled', false); | ->setParameter('isDisabled', false); | ||||
case 'admin': | |||||
return $query | |||||
->setParameter('isAdmin', true); | |||||
case 'approval': | case 'approval': | ||||
return $query | return $query | ||||
->setParameter('needsApproval', true) | ->setParameter('needsApproval', true) | ||||
->setParameter('isDisabled', false); | ->setParameter('isDisabled', false); | ||||
} | } | ||||
return parent::buildSavedQueryFromBuiltin($query_key); | return parent::buildSavedQueryFromBuiltin($query_key); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 117 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0