Differential D12224 Diff 29377 src/applications/repository/query/PhabricatorRepositorySearchEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/query/PhabricatorRepositorySearchEngine.php
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | public function buildSearchForm( | ||||
PhabricatorSavedQuery $saved_query) { | PhabricatorSavedQuery $saved_query) { | ||||
$callsigns = $saved_query->getParameter('callsigns', array()); | $callsigns = $saved_query->getParameter('callsigns', array()); | ||||
$types = $saved_query->getParameter('types', array()); | $types = $saved_query->getParameter('types', array()); | ||||
$types = array_fuse($types); | $types = array_fuse($types); | ||||
$name = $saved_query->getParameter('name'); | $name = $saved_query->getParameter('name'); | ||||
$any_project_phids = $saved_query->getParameter('anyProjectPHIDs', array()); | $any_project_phids = $saved_query->getParameter('anyProjectPHIDs', array()); | ||||
if ($any_project_phids) { | |||||
$any_project_handles = id(new PhabricatorHandleQuery()) | |||||
->setViewer($this->requireViewer()) | |||||
->withPHIDs($any_project_phids) | |||||
->execute(); | |||||
} else { | |||||
$any_project_handles = array(); | |||||
} | |||||
$form | $form | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormTextControl()) | id(new AphrontFormTextControl()) | ||||
->setName('callsigns') | ->setName('callsigns') | ||||
->setLabel(pht('Callsigns')) | ->setLabel(pht('Callsigns')) | ||||
->setValue(implode(', ', $callsigns))) | ->setValue(implode(', ', $callsigns))) | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormTextControl()) | id(new AphrontFormTextControl()) | ||||
->setName('name') | ->setName('name') | ||||
->setLabel(pht('Name Contains')) | ->setLabel(pht('Name Contains')) | ||||
->setValue($name)) | ->setValue($name)) | ||||
->appendChild( | ->appendControl( | ||||
id(new AphrontFormTokenizerControl()) | id(new AphrontFormTokenizerControl()) | ||||
->setDatasource(new PhabricatorProjectDatasource()) | ->setDatasource(new PhabricatorProjectDatasource()) | ||||
->setName('anyProjects') | ->setName('anyProjects') | ||||
->setLabel(pht('In Any Project')) | ->setLabel(pht('In Any Project')) | ||||
->setValue($any_project_handles)) | ->setValue($any_project_phids)) | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormSelectControl()) | id(new AphrontFormSelectControl()) | ||||
->setName('status') | ->setName('status') | ||||
->setLabel(pht('Status')) | ->setLabel(pht('Status')) | ||||
->setValue($saved_query->getParameter('status')) | ->setValue($saved_query->getParameter('status')) | ||||
->setOptions($this->getStatusOptions())) | ->setOptions($this->getStatusOptions())) | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormSelectControl()) | id(new AphrontFormSelectControl()) | ||||
▲ Show 20 Lines • Show All 187 Lines • Show Last 20 Lines |