Page MenuHomePhabricator

D15967.diff
No OneTemporary

D15967.diff

diff --git a/src/applications/people/controller/PhabricatorPeopleProfileViewController.php b/src/applications/people/controller/PhabricatorPeopleProfileViewController.php
--- a/src/applications/people/controller/PhabricatorPeopleProfileViewController.php
+++ b/src/applications/people/controller/PhabricatorPeopleProfileViewController.php
@@ -192,7 +192,7 @@
$query = id(new PhabricatorCalendarEventQuery())
->setViewer($viewer)
->withDateRange($range_start, $range_end)
- ->withInvitedPHIDs(array($viewer->getPHID()))
+ ->withInvitedPHIDs(array($user->getPHID()))
->withIsCancelled(false);
$statuses = $query->execute();
@@ -200,23 +200,22 @@
$events = array();
foreach ($statuses as $status) {
- $viewer_is_invited = $status->getIsUserInvited($viewer->getPHID());
+ $viewer_is_invited = $status->getIsUserInvited($user->getPHID());
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
$status,
PhabricatorPolicyCapability::CAN_EDIT);
- $event = new AphrontCalendarEventView();
- $event->setCanEdit($can_edit);
- $event->setEventID($status->getID());
- $event->setEpochRange($status->getDateFrom(), $status->getDateTo());
- $event->setIsAllDay($status->getIsAllDay());
- $event->setIcon($status->getIcon());
- $event->setViewerIsInvited($viewer_is_invited);
-
- $event->setName($status->getName());
- $event->setURI($status->getURI());
+ $event = id(new AphrontCalendarEventView())
+ ->setCanEdit($can_edit)
+ ->setEventID($status->getID())
+ ->setEpochRange($status->getDateFrom(), $status->getDateTo())
+ ->setIsAllDay($status->getIsAllDay())
+ ->setIcon($status->getIcon())
+ ->setViewerIsInvited($viewer_is_invited)
+ ->setName($status->getName())
+ ->setURI($status->getURI());
$events[] = $event;
}
@@ -229,7 +228,11 @@
->render();
$header = id(new PHUIHeaderView())
- ->setHeader(pht('Calendar'));
+ ->setHeader(pht('Calendar'))
+ ->setHref(
+ urisprintf(
+ '/calendar/?invitedPHIDs=%s#R',
+ $user->getPHID()));
$box = id(new PHUIObjectBoxView())
->setHeader($header)
->appendChild($day_view)
diff --git a/src/applications/people/engine/PhabricatorPeopleProfilePanelEngine.php b/src/applications/people/engine/PhabricatorPeopleProfilePanelEngine.php
--- a/src/applications/people/engine/PhabricatorPeopleProfilePanelEngine.php
+++ b/src/applications/people/engine/PhabricatorPeopleProfilePanelEngine.php
@@ -26,23 +26,6 @@
->setBuiltinKey(self::PANEL_PROFILE)
->setPanelKey(PhabricatorPeopleDetailsProfilePanel::PANELKEY);
- // TODO: Convert this into a proper panel type.
- $have_calendar = PhabricatorApplication::isClassInstalledForViewer(
- 'PhabricatorCalendarApplication',
- $viewer);
- if ($have_calendar) {
- $uri = urisprintf(
- '/p/%s/calendar/',
- $object->getUsername());
-
- $panels[] = $this->newPanel()
- ->setBuiltinKey('calendar')
- ->setPanelKey(PhabricatorLinkProfilePanel::PANELKEY)
- ->setPanelProperty('icon', 'calendar')
- ->setPanelProperty('name', pht('Calendar'))
- ->setPanelProperty('uri', $uri);
- }
-
$have_maniphest = PhabricatorApplication::isClassInstalledForViewer(
'PhabricatorManiphestApplication',
$viewer);

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 13, 1:15 PM (5 d, 17 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6720988
Default Alt Text
D15967.diff (3 KB)

Event Timeline