Page MenuHomePhabricator

D16291.id39181.diff
No OneTemporary

D16291.id39181.diff

diff --git a/resources/sql/autopatches/20150506.calendarunnamedevents.1.php b/resources/sql/autopatches/20150506.calendarunnamedevents.1.php
--- a/resources/sql/autopatches/20150506.calendarunnamedevents.1.php
+++ b/resources/sql/autopatches/20150506.calendarunnamedevents.1.php
@@ -17,7 +17,7 @@
// later patch. See T8209.
$user = id(new PhabricatorPeopleQuery())
->setViewer($viewer)
- ->withPHIDs(array($event->getUserPHID()))
+ ->withPHIDs(array($event->getHostPHID()))
->executeOne();
if ($user) {
diff --git a/resources/sql/autopatches/20160713.event.01.host.sql b/resources/sql/autopatches/20160713.event.01.host.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20160713.event.01.host.sql
@@ -0,0 +1,2 @@
+ALTER TABLE {$NAMESPACE}_calendar.calendar_event
+ CHANGE userPHID hostPHID VARBINARY(64) NOT NULL;
diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php b/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
--- a/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
+++ b/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
@@ -245,7 +245,7 @@
$properties->addProperty(
pht('Host'),
- $viewer->renderHandle($event->getUserPHID()));
+ $viewer->renderHandle($event->getHostPHID()));
$invitees = $event->getInvitees();
foreach ($invitees as $key => $invitee) {
diff --git a/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php b/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php
--- a/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php
+++ b/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php
@@ -197,8 +197,8 @@
protected function getMailTo(PhabricatorLiskDAO $object) {
$phids = array();
- if ($object->getUserPHID()) {
- $phids[] = $object->getUserPHID();
+ if ($object->getHostPHID()) {
+ $phids[] = $object->getHostPHID();
}
$phids[] = $this->getActingAsPHID();
diff --git a/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php b/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
--- a/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
+++ b/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
@@ -248,16 +248,6 @@
return parent::buildSavedQueryFromBuiltin($query_key);
}
- protected function getRequiredHandlePHIDsForResultList(
- array $objects,
- PhabricatorSavedQuery $query) {
- $phids = array();
- foreach ($objects as $event) {
- $phids[$event->getUserPHID()] = 1;
- }
- return array_keys($phids);
- }
-
protected function renderResultList(
array $events,
PhabricatorSavedQuery $query,
@@ -275,7 +265,6 @@
foreach ($events as $event) {
$event_date_info = $this->getEventDateLabel($event);
- $creator_handle = $handles[$event->getUserPHID()];
$attendees = array();
foreach ($event->getInvitees() as $invitee) {
@@ -364,7 +353,8 @@
$month_view->setUser($viewer);
- $phids = mpull($statuses, 'getUserPHID');
+ $phids = mpull($statuses, 'getHostPHID');
+ $handles = $viewer->loadHandles($phids);
foreach ($statuses as $status) {
$viewer_is_invited = $status->getIsUserInvited($viewer->getPHID());
@@ -376,9 +366,9 @@
$event->setIsAllDay($status->getIsAllDay());
$event->setIcon($status->getIcon());
- $name_text = $handles[$status->getUserPHID()]->getName();
+ $name_text = $handles[$status->getHostPHID()]->getName();
$status_text = $status->getName();
- $event->setUserPHID($status->getUserPHID());
+ $event->setHostPHID($status->getHostPHID());
$event->setDescription(pht('%s (%s)', $name_text, $status_text));
$event->setName($status_text);
$event->setURI($status->getURI());
@@ -419,7 +409,7 @@
$day_view->setUser($viewer);
- $phids = mpull($statuses, 'getUserPHID');
+ $phids = mpull($statuses, 'getHostPHID');
foreach ($statuses as $status) {
if ($status->getIsCancelled()) {
diff --git a/src/applications/calendar/search/PhabricatorCalendarEventFulltextEngine.php b/src/applications/calendar/search/PhabricatorCalendarEventFulltextEngine.php
--- a/src/applications/calendar/search/PhabricatorCalendarEventFulltextEngine.php
+++ b/src/applications/calendar/search/PhabricatorCalendarEventFulltextEngine.php
@@ -17,13 +17,13 @@
$document->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
- $event->getUserPHID(),
+ $event->getHostPHID(),
PhabricatorPeopleUserPHIDType::TYPECONST,
$event->getDateCreated());
$document->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_OWNER,
- $event->getUserPHID(),
+ $event->getHostPHID(),
PhabricatorPeopleUserPHIDType::TYPECONST,
$event->getDateCreated());
diff --git a/src/applications/calendar/storage/PhabricatorCalendarEvent.php b/src/applications/calendar/storage/PhabricatorCalendarEvent.php
--- a/src/applications/calendar/storage/PhabricatorCalendarEvent.php
+++ b/src/applications/calendar/storage/PhabricatorCalendarEvent.php
@@ -16,7 +16,7 @@
PhabricatorConduitResultInterface {
protected $name;
- protected $userPHID;
+ protected $hostPHID;
protected $dateFrom;
protected $dateTo;
protected $description;
@@ -83,7 +83,7 @@
$epoch_max = $end->format('U');
return id(new PhabricatorCalendarEvent())
- ->setUserPHID($actor->getPHID())
+ ->setHostPHID($actor->getPHID())
->setIsCancelled(0)
->setIsAllDay(0)
->setIsStub(0)
@@ -120,7 +120,7 @@
protected function readField($field) {
static $inherit = array(
- 'userPHID' => true,
+ 'hostPHID' => true,
'isAllDay' => true,
'icon' => true,
'spacePHID' => true,
@@ -156,7 +156,7 @@
$parent = $this->getParentEvent();
$this
- ->setUserPHID($parent->getUserPHID())
+ ->setHostPHID($parent->getHostPHID())
->setIsAllDay($parent->getIsAllDay())
->setIcon($parent->getIcon())
->setSpacePHID($parent->getSpacePHID())
@@ -311,8 +311,8 @@
'isStub' => 'bool',
),
self::CONFIG_KEY_SCHEMA => array(
- 'userPHID_dateFrom' => array(
- 'columns' => array('userPHID', 'dateTo'),
+ 'key_date' => array(
+ 'columns' => array('dateFrom', 'dateTo'),
),
'key_instance' => array(
'columns' => array('instanceOfEventPHID', 'sequenceIndex'),
@@ -545,8 +545,8 @@
}
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
- // The owner of a task can always view and edit it.
- $user_phid = $this->getUserPHID();
+ // The host of an event can always view and edit it.
+ $user_phid = $this->getHostPHID();
if ($user_phid) {
$viewer_phid = $viewer->getPHID();
if ($viewer_phid == $user_phid) {
@@ -567,11 +567,12 @@
}
public function describeAutomaticCapability($capability) {
- return pht('The owner of an event can always view and edit it,
- and invitees can always view it, except if the event is an
- instance of a recurring event.');
+ return pht(
+ 'The host of an event can always view and edit it. Users who are '.
+ 'invited to an event can always view it.');
}
+
/* -( PhabricatorApplicationTransactionInterface )------------------------- */
@@ -598,14 +599,14 @@
public function isAutomaticallySubscribed($phid) {
- return ($phid == $this->getUserPHID());
+ return ($phid == $this->getHostPHID());
}
/* -( PhabricatorTokenReceiverInterface )---------------------------------- */
public function getUsersToNotifyOfTokenGiven() {
- return array($this->getUserPHID());
+ return array($this->getHostPHID());
}
/* -( PhabricatorDestructibleInterface )----------------------------------- */
diff --git a/src/applications/calendar/view/AphrontCalendarEventView.php b/src/applications/calendar/view/AphrontCalendarEventView.php
--- a/src/applications/calendar/view/AphrontCalendarEventView.php
+++ b/src/applications/calendar/view/AphrontCalendarEventView.php
@@ -2,7 +2,7 @@
final class AphrontCalendarEventView extends AphrontView {
- private $userPHID;
+ private $hostPHID;
private $name;
private $epochStart;
private $epochEnd;
@@ -39,13 +39,13 @@
return $this->viewerIsInvited;
}
- public function setUserPHID($user_phid) {
- $this->userPHID = $user_phid;
+ public function setHostPHID($host_phid) {
+ $this->hostPHID = $host_phid;
return $this;
}
- public function getUserPHID() {
- return $this->userPHID;
+ public function getHostPHID() {
+ return $this->hostPHID;
}
public function setName($name) {
diff --git a/src/applications/calendar/xaction/PhabricatorCalendarEventRecurringTransaction.php b/src/applications/calendar/xaction/PhabricatorCalendarEventRecurringTransaction.php
--- a/src/applications/calendar/xaction/PhabricatorCalendarEventRecurringTransaction.php
+++ b/src/applications/calendar/xaction/PhabricatorCalendarEventRecurringTransaction.php
@@ -22,7 +22,7 @@
$old = $object->getIsRecurring();
foreach ($xactions as $xaction) {
- if ($this->getIsNewObject()) {
+ if ($this->isNewObject()) {
continue;
}
diff --git a/src/applications/differential/controller/DifferentialInlineCommentEditController.php b/src/applications/differential/controller/DifferentialInlineCommentEditController.php
--- a/src/applications/differential/controller/DifferentialInlineCommentEditController.php
+++ b/src/applications/differential/controller/DifferentialInlineCommentEditController.php
@@ -46,7 +46,7 @@
throw new Exception(
pht(
'Changeset ID "%s" is part of diff ID "%s", but that diff '.
- 'is attached to reivsion "%s", not revision "%s".',
+ 'is attached to revision "%s", not revision "%s".',
$changeset_id,
$diff->getID(),
$diff->getRevisionID(),

File Metadata

Mime Type
text/plain
Expires
Fri, Apr 18, 4:54 PM (1 w, 8 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7725728
Default Alt Text
D16291.id39181.diff (10 KB)

Event Timeline