1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Event detail view of Calendar events with no invitees should show "None" in the Properties column.

Summary: Ref T8020, Event detail view of Calendar events with no invitees should show "None" in the Properties column.

Test Plan: Open event, edit event to have no invitees, save, event detail view should show "None" in the Invitee section of the Properties column

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T8020

Differential Revision: https://secure.phabricator.com/D12718
This commit is contained in:
lkassianik 2015-05-05 10:26:15 -07:00
parent 8d128646b3
commit a802371974

View file

@ -187,24 +187,34 @@ final class PhabricatorCalendarEventViewController
pht('Ends'),
phabricator_datetime($event->getDateTo(), $viewer));
$invitees = $event->getInvitees();
$invitee_list = new PHUIStatusListView();
foreach ($invitees as $invitee) {
if ($invitee->isUninvited()) {
continue;
}
$item = new PHUIStatusItemView();
$invitee_phid = $invitee->getInviteePHID();
$target = $viewer->renderHandle($invitee_phid);
$item->setNote($invitee->getStatus())
->setTarget($target);
$invitee_list->addItem($item);
}
$properties->addProperty(
pht('Host'),
$viewer->renderHandle($event->getUserPHID()));
$invitees = $event->getInvitees();
foreach ($invitees as $key => $invitee) {
if ($invitee->isUninvited()) {
unset($invitees[$key]);
}
}
if ($invitees) {
$invitee_list = new PHUIStatusListView();
foreach ($invitees as $invitee) {
$item = new PHUIStatusItemView();
$invitee_phid = $invitee->getInviteePHID();
$target = $viewer->renderHandle($invitee_phid);
$item->setNote($invitee->getStatus())
->setTarget($target);
$invitee_list->addItem($item);
}
} else {
$invitee_list = phutil_tag(
'em',
array(),
pht('None'));
}
$properties->addProperty(
pht('Invitees'),
$invitee_list);