From 95ef72e4f99e90fff7dc500df528e4e590a4dab1 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Wed, 6 Aug 2014 15:04:12 -0700 Subject: [PATCH] Events - add a byline to event list Summary: so you can see who the event is about...! Fixes T5621. Test Plan: saw the creator of each event on /calendar/event/query/all/ Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T5621 Differential Revision: https://secure.phabricator.com/D10169 --- .../query/PhabricatorCalendarEventSearchEngine.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php b/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php index 258d95c77c..11bee4d5fa 100644 --- a/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php +++ b/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php @@ -166,6 +166,16 @@ final class PhabricatorCalendarEventSearchEngine 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, @@ -192,6 +202,7 @@ final class PhabricatorCalendarEventSearchEngine } $from = phabricator_datetime($event->getDateFrom(), $viewer); $to = phabricator_datetime($event->getDateTo(), $viewer); + $creator_handle = $handles[$event->getUserPHID()]; $color = ($event->getStatus() == PhabricatorCalendarEvent::STATUS_AWAY) ? 'red' @@ -201,6 +212,7 @@ final class PhabricatorCalendarEventSearchEngine ->setHeader($event->getTerseSummary($viewer)) ->setHref($href) ->setBarColor($color) + ->addByline(pht('Creator: %s', $creator_handle->renderLink())) ->addAttribute(pht('From %s to %s', $from, $to)) ->addAttribute( phutil_utf8_shorten($event->getDescription(), 64));