Differential D20717 Diff 49434 src/applications/phortune/controller/account/PhortuneAccountProfileController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phortune/controller/account/PhortuneAccountProfileController.php
Show All 11 Lines | protected function buildHeaderView() { | ||||
$account = $this->getAccount(); | $account = $this->getAccount(); | ||||
$title = $account->getName(); | $title = $account->getName(); | ||||
$header = id(new PHUIHeaderView()) | $header = id(new PHUIHeaderView()) | ||||
->setUser($viewer) | ->setUser($viewer) | ||||
->setHeader($title) | ->setHeader($title) | ||||
->setHeaderIcon('fa-user-circle'); | ->setHeaderIcon('fa-user-circle'); | ||||
return $header; | if ($this->getMerchants()) { | ||||
$customer_tag = id(new PHUITagView()) | |||||
->setType(PHUITagView::TYPE_SHADE) | |||||
->setName(pht('Customer Account')) | |||||
->setColor('indigo') | |||||
->setIcon('fa-credit-card'); | |||||
$header->addTag($customer_tag); | |||||
} | } | ||||
protected function buildApplicationCrumbs() { | return $header; | ||||
$crumbs = parent::buildApplicationCrumbs(); | |||||
$crumbs->setBorder(true); | |||||
return $crumbs; | |||||
} | } | ||||
protected function buildSideNavView($filter = null) { | protected function buildSideNavView($filter = null) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$account = $this->getAccount(); | $account = $this->getAccount(); | ||||
$id = $account->getID(); | $id = $account->getID(); | ||||
$can_edit = !$this->getMerchants(); | |||||
$nav = id(new AphrontSideNavFilterView()) | $nav = id(new AphrontSideNavFilterView()) | ||||
->setBaseURI(new PhutilURI($this->getApplicationURI())); | ->setBaseURI(new PhutilURI($this->getApplicationURI())); | ||||
$nav->addLabel(pht('Account')); | $nav->addLabel(pht('Account')); | ||||
$nav->addFilter( | $nav->addFilter( | ||||
'overview', | 'overview', | ||||
pht('Overview'), | pht('Overview'), | ||||
$this->getApplicationURI("/{$id}/"), | $this->getApplicationURI("/{$id}/"), | ||||
'fa-user-circle'); | 'fa-user-circle'); | ||||
$nav->addFilter( | $nav->newLink('details') | ||||
'details', | ->setName(pht('Account Details')) | ||||
pht('Account Details'), | ->setHref($this->getApplicationURI("/account/{$id}/details/")) | ||||
$this->getApplicationURI("/account/{$id}/details/"), | ->setIcon('fa-address-card-o') | ||||
'fa-address-card-o'); | ->setWorkflow(!$can_edit) | ||||
->setDisabled(!$can_edit); | |||||
$nav->addLabel(pht('Payments')); | $nav->addLabel(pht('Payments')); | ||||
$nav->addFilter( | $nav->addFilter( | ||||
'methods', | 'methods', | ||||
pht('Payment Methods'), | pht('Payment Methods'), | ||||
$this->getApplicationURI("/account/{$id}/methods/"), | $this->getApplicationURI("/account/{$id}/methods/"), | ||||
'fa-credit-card'); | 'fa-credit-card'); | ||||
Show All 19 Lines | protected function buildSideNavView($filter = null) { | ||||
$nav->addLabel(pht('Personnel')); | $nav->addLabel(pht('Personnel')); | ||||
$nav->addFilter( | $nav->addFilter( | ||||
'managers', | 'managers', | ||||
pht('Account Managers'), | pht('Account Managers'), | ||||
$this->getApplicationURI("/account/{$id}/managers/"), | $this->getApplicationURI("/account/{$id}/managers/"), | ||||
'fa-group'); | 'fa-group'); | ||||
$nav->addFilter( | $nav->newLink('addresses') | ||||
'addresses', | ->setname(pht('Email Addresses')) | ||||
pht('Email Addresses'), | ->setHref($this->getApplicationURI("/account/{$id}/addresses/")) | ||||
$this->getApplicationURI("/account/{$id}/addresses/"), | ->setIcon('fa-envelope-o') | ||||
'fa-envelope-o'); | ->setWorkflow(!$can_edit) | ||||
->setDisabled(!$can_edit); | |||||
$nav->selectFilter($filter); | $nav->selectFilter($filter); | ||||
return $nav; | return $nav; | ||||
} | } | ||||
final protected function newRecentOrdersView( | final protected function newRecentOrdersView( | ||||
PhortuneAccount $account, | PhortuneAccount $account, | ||||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |