1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Make owner search queries work.

Summary:

Test Plan:

Reviewers:

CC:
This commit is contained in:
epriestley 2011-02-18 17:36:25 -08:00
parent 505c82236d
commit 21650c47b6
2 changed files with 28 additions and 6 deletions

View file

@ -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))
@ -80,6 +85,11 @@ class PhabricatorSearchController extends PhabricatorSearchBaseController {
$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
->setUser($user)
@ -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'));

View file

@ -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,