Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13998359
D10684.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D10684.id.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Fri, Oct 25, 9:05 AM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6739521
Default Alt Text
D10684.id.diff (6 KB)
Attached To
Mode
D10684: Remove some dead Phortune code
Attached
Detach File
Event Timeline
Log In to Comment