diff --git a/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php b/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php index 0143b79a16..ba2017cba9 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarBrowseController.php @@ -7,16 +7,15 @@ final class PhabricatorCalendarBrowseController return true; } - public function processRequest() { - $now = time(); - $request = $this->getRequest(); - $user = $request->getUser(); - $year_d = phabricator_format_local_time($now, $user, 'Y'); - $year = $request->getInt('year', $year_d); - $month_d = phabricator_format_local_time($now, $user, 'm'); - $month = $request->getInt('month', $month_d); - $day = phabricator_format_local_time($now, $user, 'j'); + public function handleRequest(AphrontRequest $request) { + $viewer = $this->getViewer(); + $now = time(); + $year_d = phabricator_format_local_time($now, $viewer, 'Y'); + $year = $request->getInt('year', $year_d); + $month_d = phabricator_format_local_time($now, $viewer, 'm'); + $month = $request->getInt('month', $month_d); + $day = phabricator_format_local_time($now, $viewer, 'j'); $holidays = id(new PhabricatorCalendarHoliday())->loadAllWhere( 'day BETWEEN %s AND %s', @@ -24,7 +23,7 @@ final class PhabricatorCalendarBrowseController "{$year}-{$month}-31"); $statuses = id(new PhabricatorCalendarEventQuery()) - ->setViewer($user) + ->setViewer($viewer) ->withDateRange( strtotime("{$year}-{$month}-01"), strtotime("{$year}-{$month}-01 next month")) @@ -37,11 +36,11 @@ final class PhabricatorCalendarBrowseController } $month_view->setBrowseURI($request->getRequestURI()); - $month_view->setUser($user); + $month_view->setUser($viewer); $month_view->setHolidays($holidays); $phids = mpull($statuses, 'getUserPHID'); - $handles = $this->loadViewerHandles($phids); + $handles = $viewer->loadHandles($phids); /* Assign Colors */ $unique = array_unique($phids); diff --git a/src/applications/calendar/controller/PhabricatorCalendarViewController.php b/src/applications/calendar/controller/PhabricatorCalendarViewController.php index 58ac47af5a..59d477f2ca 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarViewController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarViewController.php @@ -7,16 +7,16 @@ final class PhabricatorCalendarViewController return true; } - public function processRequest() { - $user = $this->getRequest()->getUser(); + public function handleRequest(AphrontRequest $request) { + $viewer = $this->getViewer(); $now = time(); $request = $this->getRequest(); - $year_d = phabricator_format_local_time($now, $user, 'Y'); + $year_d = phabricator_format_local_time($now, $viewer, 'Y'); $year = $request->getInt('year', $year_d); - $month_d = phabricator_format_local_time($now, $user, 'm'); + $month_d = phabricator_format_local_time($now, $viewer, 'm'); $month = $request->getInt('month', $month_d); - $day = phabricator_format_local_time($now, $user, 'j'); + $day = phabricator_format_local_time($now, $viewer, 'j'); $holidays = id(new PhabricatorCalendarHoliday())->loadAllWhere( @@ -25,8 +25,8 @@ final class PhabricatorCalendarViewController "{$year}-{$month}-31"); $statuses = id(new PhabricatorCalendarEventQuery()) - ->setViewer($user) - ->withInvitedPHIDs(array($user->getPHID())) + ->setViewer($viewer) + ->withInvitedPHIDs(array($viewer->getPHID())) ->withDateRange( strtotime("{$year}-{$month}-01"), strtotime("{$year}-{$month}-01 next month")) @@ -39,7 +39,7 @@ final class PhabricatorCalendarViewController } $month_view->setBrowseURI($request->getRequestURI()); - $month_view->setUser($user); + $month_view->setUser($viewer); $month_view->setHolidays($holidays); if ($this->getNoticeView()) { $month_view->setInfoView($this->getNoticeView()); diff --git a/src/applications/differential/controller/DifferentialChangesetViewController.php b/src/applications/differential/controller/DifferentialChangesetViewController.php index 981688b22a..f617c52f2b 100644 --- a/src/applications/differential/controller/DifferentialChangesetViewController.php +++ b/src/applications/differential/controller/DifferentialChangesetViewController.php @@ -6,8 +6,7 @@ final class DifferentialChangesetViewController extends DifferentialController { return true; } - public function processRequest() { - $request = $this->getRequest(); + public function handleRequest(AphrontRequest $request) { $viewer = $this->getViewer(); $author_phid = $viewer->getPHID(); diff --git a/src/applications/differential/controller/DifferentialDiffCreateController.php b/src/applications/differential/controller/DifferentialDiffCreateController.php index c2d598cad9..7781f22023 100644 --- a/src/applications/differential/controller/DifferentialDiffCreateController.php +++ b/src/applications/differential/controller/DifferentialDiffCreateController.php @@ -135,13 +135,10 @@ final class DifferentialDiffCreateController extends DifferentialController { ->setUser($viewer); if ($revision) { - $revision_handles = $this->loadViewerHandles(array($revision->getPHID())); - $revision_handle = head($revision_handles); - $form->appendChild( id(new AphrontFormMarkupControl()) ->setLabel(pht('Updating Revision')) - ->setValue($revision_handle->renderLink())); + ->setValue($viewer->renderHandle($revision->getPHID()))); } if ($repository_phid) {