3 abstract class PhortuneAccountProfileController
4 extends PhortuneAccountController
{
6 protected function buildHeaderView() {
7 $viewer = $this->getViewer();
8 $account = $this->getAccount();
9 $title = $account->getName();
11 $header = id(new PHUIHeaderView())
14 ->setHeaderIcon('fa-user-circle');
16 if ($this->getMerchants()) {
17 $customer_tag = id(new PHUITagView())
18 ->setType(PHUITagView
::TYPE_SHADE
)
19 ->setName(pht('Customer Account'))
21 ->setIcon('fa-credit-card');
22 $header->addTag($customer_tag);
28 protected function buildSideNavView($filter = null) {
29 $viewer = $this->getViewer();
30 $account = $this->getAccount();
31 $id = $account->getID();
33 $can_edit = !$this->getMerchants();
35 $nav = id(new AphrontSideNavFilterView())
36 ->setBaseURI(new PhutilURI($this->getApplicationURI()));
38 $nav->addLabel(pht('Account'));
46 $nav->newLink('details')
47 ->setName(pht('Account Details'))
48 ->setHref($this->getApplicationURI("/account/{$id}/details/"))
49 ->setIcon('fa-address-card-o')
50 ->setWorkflow(!$can_edit)
51 ->setDisabled(!$can_edit);
53 $nav->addLabel(pht('Payments'));
57 pht('Payment Methods'),
58 $account->getPaymentMethodsURI(),
64 $account->getSubscriptionsURI(),
70 $account->getOrdersURI(),
76 $account->getChargesURI(),
79 $nav->addLabel(pht('Personnel'));
83 pht('Account Managers'),
84 $this->getApplicationURI("/account/{$id}/managers/"),
87 $nav->newLink('addresses')
88 ->setname(pht('Email Addresses'))
89 ->setHref($account->getEmailAddressesURI())
90 ->setIcon('fa-envelope-o')
91 ->setWorkflow(!$can_edit)
92 ->setDisabled(!$can_edit);
94 $nav->selectFilter($filter);
99 final protected function newRecentOrdersView(
100 PhortuneAccount
$account,
103 $viewer = $this->getViewer();
105 $carts = id(new PhortuneCartQuery())
107 ->withAccountPHIDs(array($account->getPHID()))
108 ->needPurchases(true)
111 PhortuneCart
::STATUS_PURCHASING
,
112 PhortuneCart
::STATUS_CHARGED
,
113 PhortuneCart
::STATUS_HOLD
,
114 PhortuneCart
::STATUS_REVIEW
,
115 PhortuneCart
::STATUS_PURCHASED
,
120 $orders_uri = $account->getOrderListURI();
122 $table = id(new PhortuneOrderTableView())
126 $header = id(new PHUIHeaderView())
127 ->setHeader(pht('Recent Orders'))
129 id(new PHUIButtonView())
132 ->setHref($orders_uri)
133 ->setText(pht('View All Orders')));
135 return id(new PHUIObjectBoxView())
137 ->setBackground(PHUIObjectBoxView
::BLUE_PROPERTY
)