Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
Show First 20 Lines • Show All 213 Lines • ▼ Show 20 Lines | public function buildSearchForm( | ||||
$assigned_phids = $this->readAssignedPHIDs($saved); | $assigned_phids = $this->readAssignedPHIDs($saved); | ||||
$author_phids = $saved->getParameter('authorPHIDs', array()); | $author_phids = $saved->getParameter('authorPHIDs', array()); | ||||
$projects = $this->readProjectTokens($saved); | $projects = $this->readProjectTokens($saved); | ||||
$subscriber_phids = $saved->getParameter('subscriberPHIDs', array()); | $subscriber_phids = $saved->getParameter('subscriberPHIDs', array()); | ||||
$statuses = $saved->getParameter('statuses', array()); | $statuses = $saved->getParameter('statuses', array()); | ||||
$statuses = array_fuse($statuses); | |||||
$status_control = id(new AphrontFormCheckboxControl()) | |||||
->setLabel(pht('Status')); | |||||
foreach (ManiphestTaskStatus::getTaskStatusMap() as $status => $name) { | |||||
$status_control->addCheckbox( | |||||
'statuses[]', | |||||
$status, | |||||
$name, | |||||
isset($statuses[$status])); | |||||
} | |||||
$priorities = $saved->getParameter('priorities', array()); | $priorities = $saved->getParameter('priorities', array()); | ||||
$priorities = array_fuse($priorities); | |||||
$priority_control = id(new AphrontFormCheckboxControl()) | |||||
->setLabel(pht('Priority')); | |||||
foreach (ManiphestTaskPriority::getTaskPriorityMap() as $pri => $name) { | |||||
$priority_control->addCheckbox( | |||||
'priorities[]', | |||||
$pri, | |||||
$name, | |||||
isset($priorities[$pri])); | |||||
} | |||||
$blocking_control = id(new AphrontFormSelectControl()) | $blocking_control = id(new AphrontFormSelectControl()) | ||||
->setLabel(pht('Blocking')) | ->setLabel(pht('Blocking')) | ||||
->setName('blocking') | ->setName('blocking') | ||||
->setValue($this->getBoolFromQuery($saved, 'blocking')) | ->setValue($this->getBoolFromQuery($saved, 'blocking')) | ||||
->setOptions(array( | ->setOptions(array( | ||||
'' => pht('Show All Tasks'), | '' => pht('Show All Tasks'), | ||||
'true' => pht('Show Tasks Blocking Other Tasks'), | 'true' => pht('Show Tasks Blocking Other Tasks'), | ||||
Show All 36 Lines | $form | ||||
->setLabel(pht('Authors')) | ->setLabel(pht('Authors')) | ||||
->setValue($author_phids)) | ->setValue($author_phids)) | ||||
->appendControl( | ->appendControl( | ||||
id(new AphrontFormTokenizerControl()) | id(new AphrontFormTokenizerControl()) | ||||
->setDatasource(new PhabricatorMetaMTAMailableFunctionDatasource()) | ->setDatasource(new PhabricatorMetaMTAMailableFunctionDatasource()) | ||||
->setName('subscribers') | ->setName('subscribers') | ||||
->setLabel(pht('Subscribers')) | ->setLabel(pht('Subscribers')) | ||||
->setValue($subscriber_phids)) | ->setValue($subscriber_phids)) | ||||
->appendControl( | |||||
id(new AphrontFormTokenizerControl()) | |||||
->setDatasource(new ManiphestTaskStatusDatasource()) | |||||
->setLabel(pht('Statuses')) | |||||
->setName('statuses') | |||||
->setValue($statuses)) | |||||
->appendControl( | |||||
id(new AphrontFormTokenizerControl()) | |||||
->setDatasource(new ManiphestTaskPriorityDatasource()) | |||||
->setLabel(pht('Priorities')) | |||||
->setName('priorities') | |||||
->setValue($priorities)) | |||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormTextControl()) | id(new AphrontFormTextControl()) | ||||
->setName('fulltext') | ->setName('fulltext') | ||||
->setLabel(pht('Contains Words')) | ->setLabel(pht('Contains Words')) | ||||
->setValue($saved->getParameter('fulltext'))) | ->setValue($saved->getParameter('fulltext'))) | ||||
->appendChild($status_control) | |||||
->appendChild($priority_control) | |||||
->appendChild($blocking_control) | ->appendChild($blocking_control) | ||||
->appendChild($blocked_control); | ->appendChild($blocked_control); | ||||
if (!$this->getIsBoardView()) { | if (!$this->getIsBoardView()) { | ||||
$form | $form | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormSelectControl()) | id(new AphrontFormSelectControl()) | ||||
->setName('group') | ->setName('group') | ||||
▲ Show 20 Lines • Show All 219 Lines • Show Last 20 Lines |