mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-28 04:00:17 +01:00
Convert "Created By" and "Invited" inputs in Calendar search to use PhabricatorPeopleUserFunctionDatasource
Summary: Closes T8046, Convert "Created By" and "Invited" inputs in Calendar search to use `PhabricatorPeopleUserFunctionDatasource` Test Plan: {nav Calendar > Advanced Search}, search for "members:Calendar", created by and invited. Should autofill and search correctly. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T8046 Differential Revision: https://secure.phabricator.com/D13311
This commit is contained in:
parent
2a5cf5e1b7
commit
05066f649b
1 changed files with 7 additions and 2 deletions
|
@ -58,6 +58,9 @@ final class PhabricatorCalendarEventSearchEngine
|
|||
$min_range = $this->getDateFrom($saved)->getEpoch();
|
||||
$max_range = $this->getDateTo($saved)->getEpoch();
|
||||
|
||||
$user_datasource = id(new PhabricatorPeopleUserFunctionDatasource())
|
||||
->setViewer($viewer);
|
||||
|
||||
if ($this->isMonthView($saved) ||
|
||||
$this->isDayView($saved)) {
|
||||
list($start_year, $start_month, $start_day) =
|
||||
|
@ -124,11 +127,13 @@ final class PhabricatorCalendarEventSearchEngine
|
|||
}
|
||||
|
||||
$invited_phids = $saved->getParameter('invitedPHIDs');
|
||||
$invited_phids = $user_datasource->evaluateTokens($invited_phids);
|
||||
if ($invited_phids) {
|
||||
$query->withInvitedPHIDs($invited_phids);
|
||||
}
|
||||
|
||||
$creator_phids = $saved->getParameter('creatorPHIDs');
|
||||
$creator_phids = $user_datasource->evaluateTokens($creator_phids);
|
||||
if ($creator_phids) {
|
||||
$query->withCreatorPHIDs($creator_phids);
|
||||
}
|
||||
|
@ -196,13 +201,13 @@ final class PhabricatorCalendarEventSearchEngine
|
|||
$form
|
||||
->appendControl(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setDatasource(new PhabricatorPeopleUserFunctionDatasource())
|
||||
->setName('creators')
|
||||
->setLabel(pht('Created By'))
|
||||
->setValue($creator_phids))
|
||||
->appendControl(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setDatasource(new PhabricatorPeopleUserFunctionDatasource())
|
||||
->setName('invited')
|
||||
->setLabel(pht('Invited'))
|
||||
->setValue($invited_phids))
|
||||
|
|
Loading…
Add table
Reference in a new issue