mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 20:40:56 +01:00
Fix an issue where 'Attending' would appear on calendar view unnecessarily
Summary: Ref T10295 * Viewing Upcoming Events in the calendar would display 'Attending: ' even if there were not attendees. This caused confusion, such as 'Is it telling me I am "Attending?"' * When a calendar event has no attendees, simply do not display the 'Attending: ' label Test Plan: * Add a new event with no one attending. * Add a new event with one or more attendees. * View the Upcoming Events query of the Calendar app. * Notice how the one with no attendees does not show 'Attending: ' while the other with attendees will show the already existing 'Attending: jdoe, ssmith' label. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T10295 Differential Revision: https://secure.phabricator.com/D15207
This commit is contained in:
parent
d9bd062bba
commit
604b780953
1 changed files with 19 additions and 16 deletions
|
@ -266,7 +266,6 @@ final class PhabricatorCalendarEventSearchEngine
|
|||
$list = new PHUIObjectItemListView();
|
||||
|
||||
foreach ($events as $event) {
|
||||
$duration = '';
|
||||
$event_date_info = $this->getEventDateLabel($event);
|
||||
$creator_handle = $handles[$event->getUserPHID()];
|
||||
$attendees = array();
|
||||
|
@ -275,18 +274,6 @@ final class PhabricatorCalendarEventSearchEngine
|
|||
$attendees[] = $invitee->getInviteePHID();
|
||||
}
|
||||
|
||||
$attendees = pht(
|
||||
'Attending: %s',
|
||||
$viewer->renderHandleList($attendees)
|
||||
->setAsInline(1)
|
||||
->render());
|
||||
|
||||
if (strlen($event->getDuration()) > 0) {
|
||||
$duration = pht(
|
||||
'Duration: %s',
|
||||
$event->getDuration());
|
||||
}
|
||||
|
||||
if ($event->getIsGhostEvent()) {
|
||||
$title_text = $event->getMonogram()
|
||||
.' ('
|
||||
|
@ -302,9 +289,25 @@ final class PhabricatorCalendarEventSearchEngine
|
|||
->setObject($event)
|
||||
->setHeader($title_text)
|
||||
->setHref($event->getURI())
|
||||
->addAttribute($event_date_info)
|
||||
->addAttribute($attendees)
|
||||
->addIcon('none', $duration);
|
||||
->addAttribute($event_date_info);
|
||||
|
||||
if ($attendees) {
|
||||
$attending = pht(
|
||||
'Attending: %s',
|
||||
$viewer->renderHandleList($attendees)
|
||||
->setAsInline(1)
|
||||
->render());
|
||||
|
||||
$item->addAttribute($attending);
|
||||
}
|
||||
|
||||
if (strlen($event->getDuration()) > 0) {
|
||||
$duration = pht(
|
||||
'Duration: %s',
|
||||
$event->getDuration());
|
||||
|
||||
$item->addIcon('none', $duration);
|
||||
}
|
||||
|
||||
$list->addItem($item);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue