Differential D20717 Diff 49398 src/applications/phortune/controller/account/PhortuneAccountOverviewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phortune/controller/account/PhortuneAccountOverviewController.php
<?php | <?php | ||||
final class PhortuneAccountOverviewController | final class PhortuneAccountOverviewController | ||||
extends PhortuneAccountProfileController { | extends PhortuneAccountProfileController { | ||||
public function handleRequest(AphrontRequest $request) { | protected function shouldRequireAccountEditCapability() { | ||||
$response = $this->loadAccount(); | return false; | ||||
if ($response) { | |||||
return $response; | |||||
} | } | ||||
protected function handleAccountRequest(AphrontRequest $request) { | |||||
$account = $this->getAccount(); | $account = $this->getAccount(); | ||||
$title = $account->getName(); | $title = $account->getName(); | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$invoices = id(new PhortuneCartQuery()) | $invoices = id(new PhortuneCartQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withAccountPHIDs(array($account->getPHID())) | ->withAccountPHIDs(array($account->getPHID())) | ||||
->needPurchases(true) | ->needPurchases(true) | ||||
->withInvoices(true) | ->withInvoices(true) | ||||
->execute(); | ->execute(); | ||||
$crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
$crumbs->setBorder(true); | $crumbs->setBorder(true); | ||||
$header = $this->buildHeaderView(); | $header = $this->buildHeaderView(); | ||||
$authority = $this->newAccountAuthorityView(); | |||||
$status = $this->buildStatusView($account, $invoices); | $status = $this->buildStatusView($account, $invoices); | ||||
$invoices = $this->buildInvoicesSection($account, $invoices); | $invoices = $this->buildInvoicesSection($account, $invoices); | ||||
$purchase_history = $this->newRecentOrdersView($account, 10); | $purchase_history = $this->newRecentOrdersView($account, 10); | ||||
$view = id(new PHUITwoColumnView()) | $view = id(new PHUITwoColumnView()) | ||||
->setHeader($header) | ->setHeader($header) | ||||
->setFooter( | ->setFooter( | ||||
array( | array( | ||||
$authority, | |||||
$status, | $status, | ||||
$invoices, | $invoices, | ||||
$purchase_history, | $purchase_history, | ||||
)); | )); | ||||
$navigation = $this->buildSideNavView('overview'); | $navigation = $this->buildSideNavView('overview'); | ||||
return $this->newPage() | return $this->newPage() | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |