mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 21:40:55 +01:00
Make owner search queries work.
Summary: Test Plan: Reviewers: CC:
This commit is contained in:
parent
505c82236d
commit
21650c47b6
2 changed files with 28 additions and 6 deletions
|
@ -47,6 +47,10 @@ class PhabricatorSearchController extends PhabricatorSearchBaseController {
|
|||
$query->setParameter('author', $request->getArr('author'));
|
||||
}
|
||||
|
||||
if ($request->getArr('owner')) {
|
||||
$query->setParameter('owner', $request->getArr('owner'));
|
||||
}
|
||||
|
||||
if ($request->getInt('open')) {
|
||||
$query->setParameter('open', $request->getInt('open'));
|
||||
}
|
||||
|
@ -69,7 +73,8 @@ class PhabricatorSearchController extends PhabricatorSearchBaseController {
|
|||
);
|
||||
|
||||
$phids = array_merge(
|
||||
$query->getParameter('author', array())
|
||||
$query->getParameter('author', array()),
|
||||
$query->getParameter('owner', array())
|
||||
);
|
||||
|
||||
$handles = id(new PhabricatorObjectHandleData($phids))
|
||||
|
@ -79,6 +84,11 @@ class PhabricatorSearchController extends PhabricatorSearchBaseController {
|
|||
$handles,
|
||||
$query->getParameter('author', array()));
|
||||
$author_value = mpull($author_value, 'getFullName', 'getPHID');
|
||||
|
||||
$owner_value = array_select_keys(
|
||||
$handles,
|
||||
$query->getParameter('owner', array()));
|
||||
$owner_value = mpull($owner_value, 'getFullName', 'getPHID');
|
||||
|
||||
$search_form = new AphrontFormView();
|
||||
$search_form
|
||||
|
@ -95,6 +105,12 @@ class PhabricatorSearchController extends PhabricatorSearchBaseController {
|
|||
->setName('type')
|
||||
->setOptions($options)
|
||||
->setValue($query->getParameter('type')))
|
||||
->appendChild(
|
||||
id(new AphrontFormSelectControl())
|
||||
->setLabel('Document Status')
|
||||
->setName('open')
|
||||
->setOptions($status_options)
|
||||
->setValue($query->getParameter('open')))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setName('author')
|
||||
|
@ -102,11 +118,11 @@ class PhabricatorSearchController extends PhabricatorSearchBaseController {
|
|||
->setDatasource('/typeahead/common/users/')
|
||||
->setValue($author_value))
|
||||
->appendChild(
|
||||
id(new AphrontFormSelectControl())
|
||||
->setLabel('Document Status')
|
||||
->setName('open')
|
||||
->setOptions($status_options)
|
||||
->setValue($query->getParameter('open')))
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setName('owner')
|
||||
->setLabel('Owner')
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setValue($owner_value))
|
||||
->appendChild(
|
||||
id(new AphrontFormSubmitControl())
|
||||
->setValue('Search'));
|
||||
|
|
|
@ -86,6 +86,12 @@ class PhabricatorSearchMySQLExecutor extends PhabricatorSearchExecutor {
|
|||
'open',
|
||||
PhabricatorSearchRelationship::RELATIONSHIP_OPEN);
|
||||
|
||||
$join[] = $this->joinRelationship(
|
||||
$conn_r,
|
||||
$query,
|
||||
'owner',
|
||||
PhabricatorSearchRelationship::RELATIONSHIP_OWNER);
|
||||
|
||||
/*
|
||||
$join[] = $this->joinRelationship(
|
||||
$conn_r,
|
||||
|
|
Loading…
Reference in a new issue