Page MenuHomePhabricator

D10684.id.diff
No OneTemporary

D10684.id.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -2627,7 +2627,6 @@
'PhortunePurchase' => 'applications/phortune/storage/PhortunePurchase.php',
'PhortunePurchasePHIDType' => 'applications/phortune/phid/PhortunePurchasePHIDType.php',
'PhortunePurchaseQuery' => 'applications/phortune/query/PhortunePurchaseQuery.php',
- 'PhortunePurchaseViewController' => 'applications/phortune/controller/PhortunePurchaseViewController.php',
'PhortuneSchemaSpec' => 'applications/phortune/storage/PhortuneSchemaSpec.php',
'PhortuneStripePaymentProvider' => 'applications/phortune/provider/PhortuneStripePaymentProvider.php',
'PhortuneTestPaymentProvider' => 'applications/phortune/provider/PhortuneTestPaymentProvider.php',
@@ -5705,7 +5704,6 @@
),
'PhortunePurchasePHIDType' => 'PhabricatorPHIDType',
'PhortunePurchaseQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
- 'PhortunePurchaseViewController' => 'PhortuneController',
'PhortuneSchemaSpec' => 'PhabricatorConfigSchemaSpec',
'PhortuneStripePaymentProvider' => 'PhortunePaymentProvider',
'PhortuneTestPaymentProvider' => 'PhortunePaymentProvider',
diff --git a/src/applications/phortune/application/PhabricatorPhortuneApplication.php b/src/applications/phortune/application/PhabricatorPhortuneApplication.php
--- a/src/applications/phortune/application/PhabricatorPhortuneApplication.php
+++ b/src/applications/phortune/application/PhabricatorPhortuneApplication.php
@@ -39,7 +39,6 @@
'card/' => array(
'new/' => 'PhortunePaymentMethodCreateController',
),
- 'buy/(?P<productID>\d+)/' => 'PhortuneProductPurchaseController',
),
'card/(?P<id>\d+)/' => array(
'edit/' => 'PhortunePaymentMethodEditController',
diff --git a/src/applications/phortune/controller/PhortuneController.php b/src/applications/phortune/controller/PhortuneController.php
--- a/src/applications/phortune/controller/PhortuneController.php
+++ b/src/applications/phortune/controller/PhortuneController.php
@@ -2,12 +2,6 @@
abstract class PhortuneController extends PhabricatorController {
- protected function loadActiveAccount(PhabricatorUser $user) {
- return PhortuneAccountQuery::loadActiveAccountForUser(
- $user,
- PhabricatorContentSource::newFromRequest($this->getRequest()));
- }
-
protected function buildChargesTable(array $charges, $show_cart = true) {
$request = $this->getRequest();
$viewer = $request->getUser();
diff --git a/src/applications/phortune/controller/PhortuneProductViewController.php b/src/applications/phortune/controller/PhortuneProductViewController.php
--- a/src/applications/phortune/controller/PhortuneProductViewController.php
+++ b/src/applications/phortune/controller/PhortuneProductViewController.php
@@ -16,7 +16,6 @@
->setViewer($user)
->withIDs(array($this->productID))
->executeOne();
-
if (!$product) {
return new Aphront404Response();
}
@@ -26,11 +25,7 @@
$header = id(new PHUIHeaderView())
->setHeader($product->getProductName());
- $account = $this->loadActiveAccount($user);
-
$edit_uri = $this->getApplicationURI('product/edit/'.$product->getID().'/');
- $cart_uri = $this->getApplicationURI(
- $account->getID().'/buy/'.$product->getID().'/');
$actions = id(new PhabricatorActionListView())
->setUser($user)
diff --git a/src/applications/phortune/controller/PhortunePurchaseViewController.php b/src/applications/phortune/controller/PhortunePurchaseViewController.php
deleted file mode 100644
--- a/src/applications/phortune/controller/PhortunePurchaseViewController.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-
-final class PhortunePurchaseViewController extends PhortuneController {
-
- private $purchaseID;
-
- public function willProcessRequest(array $data) {
- $this->purchaseID = $data['id'];
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
-
- $account = $this->loadActiveAccount($viewer);
-
- $purchase = id(new PhortunePurchaseQuery())
- ->setViewer($viewer)
- ->withIDs(array($this->purchaseID))
- ->executeOne();
- if (!$purchase) {
- return new Aphront404Response();
- }
- $cart = $purchase->getCart();
-
- $title = pht('Purchase: %s', $purchase->getFullDisplayName());
-
- $header = id(new PHUIHeaderView())
- ->setHeader($purchase->getFullDisplayName());
-
- $crumbs = $this->buildApplicationCrumbs();
- $this->addAccountCrumb($crumbs, $account);
- $crumbs->addTextCrumb(
- pht('Cart %d', $cart->getID()),
- $this->getApplicationURI('cart/'.$cart->getID().'/'));
- $crumbs->addTextCrumb(
- pht('Purchase %d', $purchase->getID()),
- $this->getApplicationURI('purchase/'.$purchase->getID().'/'));
-
- $properties = id(new PHUIPropertyListView())
- ->setUser($viewer)
- ->addProperty(pht('Status'), $purchase->getStatus());
-
- $object_box = id(new PHUIObjectBoxView())
- ->setHeader($header)
- ->addPropertyList($properties);
-
- return $this->buildApplicationPage(
- array(
- $crumbs,
- $object_box,
- ),
- array(
- 'title' => $title,
- ));
- }
-
-}
diff --git a/src/applications/phortune/query/PhortuneAccountQuery.php b/src/applications/phortune/query/PhortuneAccountQuery.php
--- a/src/applications/phortune/query/PhortuneAccountQuery.php
+++ b/src/applications/phortune/query/PhortuneAccountQuery.php
@@ -27,24 +27,6 @@
return $accounts;
}
- public static function loadActiveAccountForUser(
- PhabricatorUser $user,
- PhabricatorContentSource $content_source) {
-
- $accounts = id(new PhortuneAccountQuery())
- ->setViewer($user)
- ->withMemberPHIDs(array($user->getPHID()))
- ->execute();
-
- if (!$accounts) {
- return PhortuneAccount::createNewAccount($user, $content_source);
- } else if (count($accounts) == 1) {
- return head($accounts);
- } else {
- throw new Exception('TODO: No account selection yet.');
- }
- }
-
public function withIDs(array $ids) {
$this->ids = $ids;
return $this;

File Metadata

Mime Type
text/plain
Expires
Sun, May 12, 4:40 AM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6289160
Default Alt Text
D10684.id.diff (6 KB)

Event Timeline