1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 12:30:56 +01: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 $rangeBegin;
private $rangeEnd; private $rangeEnd;
private $inviteePHIDs; private $inviteePHIDs;
private $creatorPHIDs; private $hostPHIDs;
private $isCancelled; private $isCancelled;
private $eventsWithNoParent; private $eventsWithNoParent;
private $instanceSequencePairs; private $instanceSequencePairs;
@ -46,8 +46,8 @@ final class PhabricatorCalendarEventQuery
return $this; return $this;
} }
public function withCreatorPHIDs(array $phids) { public function withHostPHIDs(array $phids) {
$this->creatorPHIDs = $phids; $this->hostPHIDs = $phids;
return $this; return $this;
} }
@ -370,11 +370,11 @@ final class PhabricatorCalendarEventQuery
$this->inviteePHIDs); $this->inviteePHIDs);
} }
if ($this->creatorPHIDs) { if ($this->hostPHIDs) {
$where[] = qsprintf( $where[] = qsprintf(
$conn, $conn,
'event.userPHID IN (%Ls)', 'event.hostPHID IN (%Ls)',
$this->creatorPHIDs); $this->hostPHIDs);
} }
if ($this->isCancelled !== null) { if ($this->isCancelled !== null) {

View file

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