Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | $saved->setParameter( | ||||
$this->readUsersFromRequest($request, 'assigned')); | $this->readUsersFromRequest($request, 'assigned')); | ||||
$saved->setParameter( | $saved->setParameter( | ||||
'authorPHIDs', | 'authorPHIDs', | ||||
$this->readUsersFromRequest($request, 'authors')); | $this->readUsersFromRequest($request, 'authors')); | ||||
$saved->setParameter( | $saved->setParameter( | ||||
'subscriberPHIDs', | 'subscriberPHIDs', | ||||
$this->readPHIDsFromRequest($request, 'subscribers')); | $this->readSubscribersFromRequest($request, 'subscribers')); | ||||
$saved->setParameter( | $saved->setParameter( | ||||
'statuses', | 'statuses', | ||||
$this->readListFromRequest($request, 'statuses')); | $this->readListFromRequest($request, 'statuses')); | ||||
$saved->setParameter( | $saved->setParameter( | ||||
'priorities', | 'priorities', | ||||
$this->readListFromRequest($request, 'priorities')); | $this->readListFromRequest($request, 'priorities')); | ||||
Show All 39 Lines | public function buildSavedQueryFromRequest(AphrontRequest $request) { | ||||
return $saved; | return $saved; | ||||
} | } | ||||
public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) { | public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) { | ||||
$query = id(new ManiphestTaskQuery()) | $query = id(new ManiphestTaskQuery()) | ||||
->needProjectPHIDs(true); | ->needProjectPHIDs(true); | ||||
$author_phids = $saved->getParameter('authorPHIDs'); | $viewer = $this->requireViewer(); | ||||
$datasource = id(new PhabricatorTypeaheadUserParameterizedDatasource()) | |||||
->setViewer($viewer); | |||||
$author_phids = $saved->getParameter('authorPHIDs', array()); | |||||
$author_phids = $datasource->evaluateTokens($author_phids); | |||||
if ($author_phids) { | if ($author_phids) { | ||||
$query->withAuthors($author_phids); | $query->withAuthors($author_phids); | ||||
} | } | ||||
$subscriber_phids = $saved->getParameter('subscriberPHIDs'); | $datasource = id(new PhabricatorMetaMTAMailableFunctionDatasource()) | ||||
->setViewer($viewer); | |||||
$subscriber_phids = $saved->getParameter('subscriberPHIDs', array()); | |||||
$subscriber_phids = $datasource->evaluateTokens($subscriber_phids); | |||||
if ($subscriber_phids) { | if ($subscriber_phids) { | ||||
$query->withSubscribers($subscriber_phids); | $query->withSubscribers($subscriber_phids); | ||||
} | } | ||||
$datasource = id(new PhabricatorPeopleOwnerDatasource()) | $datasource = id(new PhabricatorPeopleOwnerDatasource()) | ||||
->setViewer($this->requireViewer()); | ->setViewer($this->requireViewer()); | ||||
$assigned_phids = $this->readAssignedPHIDs($saved); | $assigned_phids = $this->readAssignedPHIDs($saved); | ||||
▲ Show 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | $form | ||||
->appendControl( | ->appendControl( | ||||
id(new AphrontFormTokenizerControl()) | id(new AphrontFormTokenizerControl()) | ||||
->setDatasource(new PhabricatorProjectLogicalDatasource()) | ->setDatasource(new PhabricatorProjectLogicalDatasource()) | ||||
->setName('projects') | ->setName('projects') | ||||
->setLabel(pht('Projects')) | ->setLabel(pht('Projects')) | ||||
->setValue($projects)) | ->setValue($projects)) | ||||
->appendControl( | ->appendControl( | ||||
id(new AphrontFormTokenizerControl()) | id(new AphrontFormTokenizerControl()) | ||||
->setDatasource(new PhabricatorPeopleDatasource()) | ->setDatasource(new PhabricatorTypeaheadUserParameterizedDatasource()) | ||||
->setName('authors') | ->setName('authors') | ||||
->setLabel(pht('Authors')) | ->setLabel(pht('Authors')) | ||||
->setValue($author_phids)) | ->setValue($author_phids)) | ||||
->appendControl( | ->appendControl( | ||||
id(new AphrontFormTokenizerControl()) | id(new AphrontFormTokenizerControl()) | ||||
->setDatasource(new PhabricatorMetaMTAMailableDatasource()) | ->setDatasource(new PhabricatorMetaMTAMailableFunctionDatasource()) | ||||
->setName('subscribers') | ->setName('subscribers') | ||||
->setLabel(pht('Subscribers')) | ->setLabel(pht('Subscribers')) | ||||
->setValue($subscriber_phids)) | ->setValue($subscriber_phids)) | ||||
->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'))) | ||||
▲ Show 20 Lines • Show All 229 Lines • Show Last 20 Lines |