mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 13:30:55 +01:00
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
This commit is contained in:
parent
b717298c9e
commit
d44f05eead
4 changed files with 21 additions and 26 deletions
|
@ -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);
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue