@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Clean up some more handle callsites

Summary: Ref T7689.

Test Plan:
- Viewed Calendar browse and detail views.
- Went through Differential update workflow.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7689

Differential Revision: https://secure.phabricator.com/D12341

+19 -24
+9 -10
src/applications/calendar/controller/PhabricatorCalendarBrowseController.php
··· 7 7 return true; 8 8 } 9 9 10 - public function processRequest() { 10 + public function handleRequest(AphrontRequest $request) { 11 + $viewer = $this->getViewer(); 12 + 11 13 $now = time(); 12 - $request = $this->getRequest(); 13 - $user = $request->getUser(); 14 - $year_d = phabricator_format_local_time($now, $user, 'Y'); 14 + $year_d = phabricator_format_local_time($now, $viewer, 'Y'); 15 15 $year = $request->getInt('year', $year_d); 16 - $month_d = phabricator_format_local_time($now, $user, 'm'); 16 + $month_d = phabricator_format_local_time($now, $viewer, 'm'); 17 17 $month = $request->getInt('month', $month_d); 18 - $day = phabricator_format_local_time($now, $user, 'j'); 19 - 18 + $day = phabricator_format_local_time($now, $viewer, 'j'); 20 19 21 20 $holidays = id(new PhabricatorCalendarHoliday())->loadAllWhere( 22 21 'day BETWEEN %s AND %s', ··· 24 23 "{$year}-{$month}-31"); 25 24 26 25 $statuses = id(new PhabricatorCalendarEventQuery()) 27 - ->setViewer($user) 26 + ->setViewer($viewer) 28 27 ->withDateRange( 29 28 strtotime("{$year}-{$month}-01"), 30 29 strtotime("{$year}-{$month}-01 next month")) ··· 37 36 } 38 37 39 38 $month_view->setBrowseURI($request->getRequestURI()); 40 - $month_view->setUser($user); 39 + $month_view->setUser($viewer); 41 40 $month_view->setHolidays($holidays); 42 41 43 42 $phids = mpull($statuses, 'getUserPHID'); 44 - $handles = $this->loadViewerHandles($phids); 43 + $handles = $viewer->loadHandles($phids); 45 44 46 45 /* Assign Colors */ 47 46 $unique = array_unique($phids);
+8 -8
src/applications/calendar/controller/PhabricatorCalendarViewController.php
··· 7 7 return true; 8 8 } 9 9 10 - public function processRequest() { 11 - $user = $this->getRequest()->getUser(); 10 + public function handleRequest(AphrontRequest $request) { 11 + $viewer = $this->getViewer(); 12 12 13 13 $now = time(); 14 14 $request = $this->getRequest(); 15 - $year_d = phabricator_format_local_time($now, $user, 'Y'); 15 + $year_d = phabricator_format_local_time($now, $viewer, 'Y'); 16 16 $year = $request->getInt('year', $year_d); 17 - $month_d = phabricator_format_local_time($now, $user, 'm'); 17 + $month_d = phabricator_format_local_time($now, $viewer, 'm'); 18 18 $month = $request->getInt('month', $month_d); 19 - $day = phabricator_format_local_time($now, $user, 'j'); 19 + $day = phabricator_format_local_time($now, $viewer, 'j'); 20 20 21 21 22 22 $holidays = id(new PhabricatorCalendarHoliday())->loadAllWhere( ··· 25 25 "{$year}-{$month}-31"); 26 26 27 27 $statuses = id(new PhabricatorCalendarEventQuery()) 28 - ->setViewer($user) 29 - ->withInvitedPHIDs(array($user->getPHID())) 28 + ->setViewer($viewer) 29 + ->withInvitedPHIDs(array($viewer->getPHID())) 30 30 ->withDateRange( 31 31 strtotime("{$year}-{$month}-01"), 32 32 strtotime("{$year}-{$month}-01 next month")) ··· 39 39 } 40 40 41 41 $month_view->setBrowseURI($request->getRequestURI()); 42 - $month_view->setUser($user); 42 + $month_view->setUser($viewer); 43 43 $month_view->setHolidays($holidays); 44 44 if ($this->getNoticeView()) { 45 45 $month_view->setInfoView($this->getNoticeView());
+1 -2
src/applications/differential/controller/DifferentialChangesetViewController.php
··· 6 6 return true; 7 7 } 8 8 9 - public function processRequest() { 10 - $request = $this->getRequest(); 9 + public function handleRequest(AphrontRequest $request) { 11 10 $viewer = $this->getViewer(); 12 11 13 12 $author_phid = $viewer->getPHID();
+1 -4
src/applications/differential/controller/DifferentialDiffCreateController.php
··· 135 135 ->setUser($viewer); 136 136 137 137 if ($revision) { 138 - $revision_handles = $this->loadViewerHandles(array($revision->getPHID())); 139 - $revision_handle = head($revision_handles); 140 - 141 138 $form->appendChild( 142 139 id(new AphrontFormMarkupControl()) 143 140 ->setLabel(pht('Updating Revision')) 144 - ->setValue($revision_handle->renderLink())); 141 + ->setValue($viewer->renderHandle($revision->getPHID()))); 145 142 } 146 143 147 144 if ($repository_phid) {