@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+37 -10
+10
src/applications/calendar/editor/PhabricatorCalendarEventEditor.php
··· 144 144 145 145 return $errors; 146 146 } 147 + 148 + protected function getMailTo(PhabricatorLiskDAO $object) { 149 + return array($object->getUserPHID()); 150 + } 151 + 152 + protected function shouldPublishFeedStory( 153 + PhabricatorLiskDAO $object, 154 + array $xactions) { 155 + return true; 156 + } 147 157 }
+2 -2
src/applications/calendar/phid/PhabricatorCalendarEventPHIDType.php
··· 29 29 $event = $objects[$phid]; 30 30 31 31 $id = $event->getID(); 32 - $name = pht('Event %d', $id); 32 + $name = $event->getName(); 33 33 34 34 $handle 35 - ->setName(pht('Event %d', $id)) 35 + ->setName($name) 36 36 ->setFullName(pht('E%d: %s', $id, $name)) 37 37 ->setURI('/E'.$id); 38 38 }
+25 -8
src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php
··· 127 127 $old = $this->getOldValue(); 128 128 $new = $this->getNewValue(); 129 129 130 + $viewer = $this->getViewer(); 131 + 130 132 $type = $this->getTransactionType(); 131 133 switch ($type) { 132 134 case self::TYPE_NAME: 133 - if ($old) { 135 + if ($old === null) { 136 + return pht( 137 + '%s created %s', 138 + $this->renderHandleLink($author_phid), 139 + $this->renderHandleLink($object_phid)); 140 + } else { 134 141 return pht( 135 142 '%s changed the name of %s from %s to %s.', 136 143 $this->renderHandleLink($author_phid), ··· 141 148 break; 142 149 case self::TYPE_START_DATE: 143 150 if ($old) { 151 + $old = phabricator_datetime($old, $viewer); 152 + $new = phabricator_datetime($new, $viewer); 144 153 return pht( 145 - '%s edited the start date of this event from %s to %s.', 154 + '%s changed the start date of %s from %s to %s.', 146 155 $this->renderHandleLink($author_phid), 156 + $this->renderHandleLink($object_phid), 147 157 $old, 148 158 $new); 149 159 } 150 160 break; 151 161 case self::TYPE_END_DATE: 152 162 if ($old) { 163 + $old = phabricator_datetime($old, $viewer); 164 + $new = phabricator_datetime($new, $viewer); 153 165 return pht( 154 - '%s edited the end date of this event from %s to %s.', 166 + '%s edited the end date of %s from %s to %s.', 155 167 $this->renderHandleLink($author_phid), 168 + $this->renderHandleLink($object_phid), 156 169 $old, 157 170 $new); 158 171 } 159 172 break; 160 173 case self::TYPE_STATUS: 174 + $old_name = PhabricatorCalendarEvent::getNameForStatus($old); 175 + $new_name = PhabricatorCalendarEvent::getNameForStatus($new); 161 176 return pht( 162 - '%s updated the event status from %s to %s.', 177 + '%s updated the status of %s from %s to %s.', 163 178 $this->renderHandleLink($author_phid), 164 - $old, 165 - $new); 179 + $this->renderHandleLink($object_phid), 180 + $old_name, 181 + $new_name); 166 182 break; 167 183 case self::TYPE_DESCRIPTION: 168 184 return pht( 169 - "%s updated the event's description.", 170 - $this->renderHandleLink($author_phid)); 185 + '%s updated the description of %s.', 186 + $this->renderHandleLink($author_phid), 187 + $this->renderHandleLink($object_phid)); 171 188 break; 172 189 } 173 190