1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00

Fix some Calendar Event userPHID/hostPHID/"Creator" confusion in searching

Summary: Ref T11326. Align this stuff with "Host" and "hostPHID".

Test Plan: Searched for events by host.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11326

Differential Revision: https://secure.phabricator.com/D16303
This commit is contained in:
epriestley 2016-07-14 12:54:36 -07:00
parent 08ac49e15a
commit cf57f6385b
2 changed files with 11 additions and 10 deletions

View file

@ -8,7 +8,7 @@ final class PhabricatorCalendarEventQuery
private $rangeBegin;
private $rangeEnd;
private $inviteePHIDs;
private $creatorPHIDs;
private $hostPHIDs;
private $isCancelled;
private $eventsWithNoParent;
private $instanceSequencePairs;
@ -46,8 +46,8 @@ final class PhabricatorCalendarEventQuery
return $this;
}
public function withCreatorPHIDs(array $phids) {
$this->creatorPHIDs = $phids;
public function withHostPHIDs(array $phids) {
$this->hostPHIDs = $phids;
return $this;
}
@ -370,11 +370,11 @@ final class PhabricatorCalendarEventQuery
$this->inviteePHIDs);
}
if ($this->creatorPHIDs) {
if ($this->hostPHIDs) {
$where[] = qsprintf(
$conn,
'event.userPHID IN (%Ls)',
$this->creatorPHIDs);
'event.hostPHID IN (%Ls)',
$this->hostPHIDs);
}
if ($this->isCancelled !== null) {

View file

@ -26,8 +26,9 @@ final class PhabricatorCalendarEventSearchEngine
protected function buildCustomSearchFields() {
return array(
id(new PhabricatorSearchDatasourceField())
->setLabel(pht('Created By'))
->setKey('creatorPHIDs')
->setLabel(pht('Hosts'))
->setKey('hostPHIDs')
->setAliases(array('host', 'hostPHID', 'hosts'))
->setDatasource(new PhabricatorPeopleUserFunctionDatasource()),
id(new PhabricatorSearchDatasourceField())
->setLabel(pht('Invited'))
@ -78,8 +79,8 @@ final class PhabricatorCalendarEventSearchEngine
$query = $this->newQuery();
$viewer = $this->requireViewer();
if ($map['creatorPHIDs']) {
$query->withCreatorPHIDs($map['creatorPHIDs']);
if ($map['hostPHIDs']) {
$query->withHostPHIDs($map['hostPHIDs']);
}
if ($map['invitedPHIDs']) {