Changeset View
Changeset View
Standalone View
Standalone View
src/applications/herald/query/HeraldRuleSearchEngine.php
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) { | ||||
return $query; | return $query; | ||||
} | } | ||||
public function buildSearchForm( | public function buildSearchForm( | ||||
AphrontFormView $form, | AphrontFormView $form, | ||||
PhabricatorSavedQuery $saved_query) { | PhabricatorSavedQuery $saved_query) { | ||||
$phids = $saved_query->getParameter('authorPHIDs', array()); | $author_phids = $saved_query->getParameter('authorPHIDs', array()); | ||||
$author_handles = id(new PhabricatorHandleQuery()) | |||||
->setViewer($this->requireViewer()) | |||||
->withPHIDs($phids) | |||||
->execute(); | |||||
$content_type = $saved_query->getParameter('contentType'); | $content_type = $saved_query->getParameter('contentType'); | ||||
$rule_type = $saved_query->getParameter('ruleType'); | $rule_type = $saved_query->getParameter('ruleType'); | ||||
$form | $form | ||||
->appendChild( | ->appendControl( | ||||
id(new AphrontFormTokenizerControl()) | id(new AphrontFormTokenizerControl()) | ||||
->setDatasource(new PhabricatorPeopleDatasource()) | ->setDatasource(new PhabricatorPeopleDatasource()) | ||||
->setName('authors') | ->setName('authors') | ||||
->setLabel(pht('Authors')) | ->setLabel(pht('Authors')) | ||||
->setValue($author_handles)) | ->setValue($author_phids)) | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormSelectControl()) | id(new AphrontFormSelectControl()) | ||||
->setName('contentType') | ->setName('contentType') | ||||
->setLabel(pht('Content Type')) | ->setLabel(pht('Content Type')) | ||||
->setValue($content_type) | ->setValue($content_type) | ||||
->setOptions($this->getContentTypeOptions())) | ->setOptions($this->getContentTypeOptions())) | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormSelectControl()) | id(new AphrontFormSelectControl()) | ||||
▲ Show 20 Lines • Show All 134 Lines • Show Last 20 Lines |