mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 03:50:54 +01:00
Calendar items in Upcoming Events query should link to events, not calendar
Summary: Closes T7933, Calendar items in Upcoming Events query should link to events, not calendar. Test Plan: Open Upcoming Events query, click on an event, event detail view should open. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7933 Differential Revision: https://secure.phabricator.com/D12631
This commit is contained in:
parent
47f91c322d
commit
f14e0bf2ef
1 changed files with 5 additions and 17 deletions
|
@ -191,35 +191,23 @@ final class PhabricatorCalendarEventSearchEngine
|
|||
PhabricatorSavedQuery $query,
|
||||
array $handles) {
|
||||
assert_instances_of($events, 'PhabricatorCalendarEvent');
|
||||
|
||||
$viewer = $this->requireViewer();
|
||||
|
||||
$list = new PHUIObjectItemListView();
|
||||
foreach ($events as $event) {
|
||||
if ($event->getUserPHID() == $viewer->getPHID()) {
|
||||
$href = '/E'.$event->getID();
|
||||
} else {
|
||||
$from = $event->getDateFrom();
|
||||
$month = phabricator_format_local_time($from, $viewer, 'm');
|
||||
$year = phabricator_format_local_time($from, $viewer, 'Y');
|
||||
$uri = new PhutilURI($this->getApplicationURI());
|
||||
$uri->setQueryParams(
|
||||
array(
|
||||
'month' => $month,
|
||||
'year' => $year,
|
||||
));
|
||||
$href = (string) $uri;
|
||||
}
|
||||
$href = '/E'.$event->getID();
|
||||
$from = phabricator_datetime($event->getDateFrom(), $viewer);
|
||||
$to = phabricator_datetime($event->getDateTo(), $viewer);
|
||||
$creator_handle = $handles[$event->getUserPHID()];
|
||||
|
||||
$name = (strlen($event->getName())) ?
|
||||
$event->getName() : $event->getTerseSummary($viewer);
|
||||
|
||||
$color = ($event->getStatus() == PhabricatorCalendarEvent::STATUS_AWAY)
|
||||
? 'red'
|
||||
: 'yellow';
|
||||
|
||||
$item = id(new PHUIObjectItemView())
|
||||
->setHeader($event->getTerseSummary($viewer))
|
||||
->setHeader($name)
|
||||
->setHref($href)
|
||||
->setBarColor($color)
|
||||
->addByline(pht('Creator: %s', $creator_handle->renderLink()))
|
||||
|
|
Loading…
Reference in a new issue