mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 05:20:56 +01:00
Remove some dead Phortune code
Summary: Ref T2787. This stuff is now irrelevant and/or has no callsites. Test Plan: `grep`, poked around Reviewers: chad, btrahan Reviewed By: chad, btrahan Subscribers: epriestley Maniphest Tasks: T2787 Differential Revision: https://secure.phabricator.com/D10684
This commit is contained in:
parent
2172f59ed5
commit
7fc7b89bb4
6 changed files with 0 additions and 90 deletions
|
@ -2627,7 +2627,6 @@ phutil_register_library_map(array(
|
||||||
'PhortunePurchase' => 'applications/phortune/storage/PhortunePurchase.php',
|
'PhortunePurchase' => 'applications/phortune/storage/PhortunePurchase.php',
|
||||||
'PhortunePurchasePHIDType' => 'applications/phortune/phid/PhortunePurchasePHIDType.php',
|
'PhortunePurchasePHIDType' => 'applications/phortune/phid/PhortunePurchasePHIDType.php',
|
||||||
'PhortunePurchaseQuery' => 'applications/phortune/query/PhortunePurchaseQuery.php',
|
'PhortunePurchaseQuery' => 'applications/phortune/query/PhortunePurchaseQuery.php',
|
||||||
'PhortunePurchaseViewController' => 'applications/phortune/controller/PhortunePurchaseViewController.php',
|
|
||||||
'PhortuneSchemaSpec' => 'applications/phortune/storage/PhortuneSchemaSpec.php',
|
'PhortuneSchemaSpec' => 'applications/phortune/storage/PhortuneSchemaSpec.php',
|
||||||
'PhortuneStripePaymentProvider' => 'applications/phortune/provider/PhortuneStripePaymentProvider.php',
|
'PhortuneStripePaymentProvider' => 'applications/phortune/provider/PhortuneStripePaymentProvider.php',
|
||||||
'PhortuneTestPaymentProvider' => 'applications/phortune/provider/PhortuneTestPaymentProvider.php',
|
'PhortuneTestPaymentProvider' => 'applications/phortune/provider/PhortuneTestPaymentProvider.php',
|
||||||
|
@ -5705,7 +5704,6 @@ phutil_register_library_map(array(
|
||||||
),
|
),
|
||||||
'PhortunePurchasePHIDType' => 'PhabricatorPHIDType',
|
'PhortunePurchasePHIDType' => 'PhabricatorPHIDType',
|
||||||
'PhortunePurchaseQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
'PhortunePurchaseQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||||
'PhortunePurchaseViewController' => 'PhortuneController',
|
|
||||||
'PhortuneSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
'PhortuneSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
||||||
'PhortuneStripePaymentProvider' => 'PhortunePaymentProvider',
|
'PhortuneStripePaymentProvider' => 'PhortunePaymentProvider',
|
||||||
'PhortuneTestPaymentProvider' => 'PhortunePaymentProvider',
|
'PhortuneTestPaymentProvider' => 'PhortunePaymentProvider',
|
||||||
|
|
|
@ -39,7 +39,6 @@ final class PhabricatorPhortuneApplication extends PhabricatorApplication {
|
||||||
'card/' => array(
|
'card/' => array(
|
||||||
'new/' => 'PhortunePaymentMethodCreateController',
|
'new/' => 'PhortunePaymentMethodCreateController',
|
||||||
),
|
),
|
||||||
'buy/(?P<productID>\d+)/' => 'PhortuneProductPurchaseController',
|
|
||||||
),
|
),
|
||||||
'card/(?P<id>\d+)/' => array(
|
'card/(?P<id>\d+)/' => array(
|
||||||
'edit/' => 'PhortunePaymentMethodEditController',
|
'edit/' => 'PhortunePaymentMethodEditController',
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
|
|
||||||
abstract class PhortuneController extends PhabricatorController {
|
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) {
|
protected function buildChargesTable(array $charges, $show_cart = true) {
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$viewer = $request->getUser();
|
$viewer = $request->getUser();
|
||||||
|
|
|
@ -16,7 +16,6 @@ final class PhortuneProductViewController extends PhortuneController {
|
||||||
->setViewer($user)
|
->setViewer($user)
|
||||||
->withIDs(array($this->productID))
|
->withIDs(array($this->productID))
|
||||||
->executeOne();
|
->executeOne();
|
||||||
|
|
||||||
if (!$product) {
|
if (!$product) {
|
||||||
return new Aphront404Response();
|
return new Aphront404Response();
|
||||||
}
|
}
|
||||||
|
@ -26,11 +25,7 @@ final class PhortuneProductViewController extends PhortuneController {
|
||||||
$header = id(new PHUIHeaderView())
|
$header = id(new PHUIHeaderView())
|
||||||
->setHeader($product->getProductName());
|
->setHeader($product->getProductName());
|
||||||
|
|
||||||
$account = $this->loadActiveAccount($user);
|
|
||||||
|
|
||||||
$edit_uri = $this->getApplicationURI('product/edit/'.$product->getID().'/');
|
$edit_uri = $this->getApplicationURI('product/edit/'.$product->getID().'/');
|
||||||
$cart_uri = $this->getApplicationURI(
|
|
||||||
$account->getID().'/buy/'.$product->getID().'/');
|
|
||||||
|
|
||||||
$actions = id(new PhabricatorActionListView())
|
$actions = id(new PhabricatorActionListView())
|
||||||
->setUser($user)
|
->setUser($user)
|
||||||
|
|
|
@ -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,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -27,24 +27,6 @@ final class PhortuneAccountQuery
|
||||||
return $accounts;
|
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) {
|
public function withIDs(array $ids) {
|
||||||
$this->ids = $ids;
|
$this->ids = $ids;
|
||||||
return $this;
|
return $this;
|
||||||
|
|
Loading…
Reference in a new issue