mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-30 02:32:42 +01:00
Calendar events should now surface to Feed.
Summary: Closes T7955, Calendar events should now surface to Feed. Test Plan: Create and/or edit an calendar event, open Feed, inspect the Feed stories for the event. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7955 Differential Revision: https://secure.phabricator.com/D12597
This commit is contained in:
parent
cd7fec1729
commit
b1081a1553
3 changed files with 37 additions and 10 deletions
|
@ -144,4 +144,14 @@ final class PhabricatorCalendarEventEditor
|
|||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
protected function getMailTo(PhabricatorLiskDAO $object) {
|
||||
return array($object->getUserPHID());
|
||||
}
|
||||
|
||||
protected function shouldPublishFeedStory(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,10 +29,10 @@ final class PhabricatorCalendarEventPHIDType extends PhabricatorPHIDType {
|
|||
$event = $objects[$phid];
|
||||
|
||||
$id = $event->getID();
|
||||
$name = pht('Event %d', $id);
|
||||
$name = $event->getName();
|
||||
|
||||
$handle
|
||||
->setName(pht('Event %d', $id))
|
||||
->setName($name)
|
||||
->setFullName(pht('E%d: %s', $id, $name))
|
||||
->setURI('/E'.$id);
|
||||
}
|
||||
|
|
|
@ -127,10 +127,17 @@ final class PhabricatorCalendarEventTransaction
|
|||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$type = $this->getTransactionType();
|
||||
switch ($type) {
|
||||
case self::TYPE_NAME:
|
||||
if ($old) {
|
||||
if ($old === null) {
|
||||
return pht(
|
||||
'%s created %s',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid));
|
||||
} else {
|
||||
return pht(
|
||||
'%s changed the name of %s from %s to %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
|
@ -141,33 +148,43 @@ final class PhabricatorCalendarEventTransaction
|
|||
break;
|
||||
case self::TYPE_START_DATE:
|
||||
if ($old) {
|
||||
$old = phabricator_datetime($old, $viewer);
|
||||
$new = phabricator_datetime($new, $viewer);
|
||||
return pht(
|
||||
'%s edited the start date of this event from %s to %s.',
|
||||
'%s changed the start date of %s from %s to %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid),
|
||||
$old,
|
||||
$new);
|
||||
}
|
||||
break;
|
||||
case self::TYPE_END_DATE:
|
||||
if ($old) {
|
||||
$old = phabricator_datetime($old, $viewer);
|
||||
$new = phabricator_datetime($new, $viewer);
|
||||
return pht(
|
||||
'%s edited the end date of this event from %s to %s.',
|
||||
'%s edited the end date of %s from %s to %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid),
|
||||
$old,
|
||||
$new);
|
||||
}
|
||||
break;
|
||||
case self::TYPE_STATUS:
|
||||
$old_name = PhabricatorCalendarEvent::getNameForStatus($old);
|
||||
$new_name = PhabricatorCalendarEvent::getNameForStatus($new);
|
||||
return pht(
|
||||
'%s updated the event status from %s to %s.',
|
||||
'%s updated the status of %s from %s to %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$old,
|
||||
$new);
|
||||
$this->renderHandleLink($object_phid),
|
||||
$old_name,
|
||||
$new_name);
|
||||
break;
|
||||
case self::TYPE_DESCRIPTION:
|
||||
return pht(
|
||||
"%s updated the event's description.",
|
||||
$this->renderHandleLink($author_phid));
|
||||
'%s updated the description of %s.',
|
||||
$this->renderHandleLink($author_phid),
|
||||
$this->renderHandleLink($object_phid));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue