Page MenuHomePhabricator

D11601.id27918.diff
No OneTemporary

D11601.id27918.diff

diff --git a/src/applications/phortune/controller/PhortuneSubscriptionViewController.php b/src/applications/phortune/controller/PhortuneSubscriptionViewController.php
--- a/src/applications/phortune/controller/PhortuneSubscriptionViewController.php
+++ b/src/applications/phortune/controller/PhortuneSubscriptionViewController.php
@@ -26,10 +26,10 @@
$account_id = $account->getID();
$subscription_id = $subscription->getID();
- $title = pht('Subscription: %s', $subscription->getSubscriptionName());
+ $title = $subscription->getSubscriptionFullName();
$header = id(new PHUIHeaderView())
- ->setHeader($subscription->getSubscriptionName());
+ ->setHeader($title);
$actions = id(new PhabricatorActionListView())
->setUser($viewer)
@@ -53,7 +53,7 @@
} else {
$this->addAccountCrumb($crumbs, $account);
}
- $crumbs->addTextCrumb(pht('Subscription %d', $subscription->getID()));
+ $crumbs->addTextCrumb($subscription->getSubscriptionCrumbName());
$properties = id(new PHUIPropertyListView())
->setUser($viewer)
diff --git a/src/applications/phortune/phid/PhortunePurchasePHIDType.php b/src/applications/phortune/phid/PhortunePurchasePHIDType.php
--- a/src/applications/phortune/phid/PhortunePurchasePHIDType.php
+++ b/src/applications/phortune/phid/PhortunePurchasePHIDType.php
@@ -31,7 +31,7 @@
$id = $purchase->getID();
$handle->setName($purchase->getFullDisplayName());
- $handle->setURI("/phortune/purchase/{$id}/");
+ $handle->setURI($purchase->getURI());
}
}
diff --git a/src/applications/phortune/product/PhortuneProductImplementation.php b/src/applications/phortune/product/PhortuneProductImplementation.php
--- a/src/applications/phortune/product/PhortuneProductImplementation.php
+++ b/src/applications/phortune/product/PhortuneProductImplementation.php
@@ -35,4 +35,10 @@
return;
}
+ public function getPurchaseURI(
+ PhortuneProduct $product,
+ PhortunePurchase $purchase) {
+ return null;
+ }
+
}
diff --git a/src/applications/phortune/product/PhortuneSubscriptionProduct.php b/src/applications/phortune/product/PhortuneSubscriptionProduct.php
--- a/src/applications/phortune/product/PhortuneSubscriptionProduct.php
+++ b/src/applications/phortune/product/PhortuneSubscriptionProduct.php
@@ -62,6 +62,22 @@
return;
}
+ public function getPurchaseName(
+ PhortuneProduct $product,
+ PhortunePurchase $purchase) {
+ return $this->getSubscription()->getPurchaseName(
+ $product,
+ $purchase);
+ }
+
+ public function getPurchaseURI(
+ PhortuneProduct $product,
+ PhortunePurchase $purchase) {
+ return $this->getSubscription()->getPurchaseURI(
+ $product,
+ $purchase);
+ }
+
public function loadImplementationsForRefs(
PhabricatorUser $viewer,
array $refs) {
diff --git a/src/applications/phortune/storage/PhortuneProduct.php b/src/applications/phortune/storage/PhortuneProduct.php
--- a/src/applications/phortune/storage/PhortuneProduct.php
+++ b/src/applications/phortune/storage/PhortuneProduct.php
@@ -87,6 +87,11 @@
$amount);
}
+ public function getPurchaseURI(PhortunePurchase $purchase) {
+ return $this->getImplementation()->getPurchaseURI(
+ $this,
+ $purchase);
+ }
/* -( PhabricatorPolicyInterface )----------------------------------------- */
diff --git a/src/applications/phortune/storage/PhortunePurchase.php b/src/applications/phortune/storage/PhortunePurchase.php
--- a/src/applications/phortune/storage/PhortunePurchase.php
+++ b/src/applications/phortune/storage/PhortunePurchase.php
@@ -87,6 +87,10 @@
return $this->getProduct()->getPurchaseName($this);
}
+ public function getURI() {
+ return $this->getProduct()->getPurchaseURI($this);
+ }
+
public function getTotalPriceAsCurrency() {
return $this->getBasePriceAsCurrency();
}
diff --git a/src/applications/phortune/storage/PhortuneSubscription.php b/src/applications/phortune/storage/PhortuneSubscription.php
--- a/src/applications/phortune/storage/PhortuneSubscription.php
+++ b/src/applications/phortune/storage/PhortuneSubscription.php
@@ -168,6 +168,14 @@
return $this->getImplementation()->getName($this);
}
+ public function getSubscriptionFullName() {
+ return $this->getImplementation()->getFullName($this);
+ }
+
+ public function getSubscriptionCrumbName() {
+ return $this->getImplementation()->getCrumbName($this);
+ }
+
public function getCartName(PhortuneCart $cart) {
return $this->getImplementation()->getCartName($this, $cart);
}
@@ -192,6 +200,24 @@
$end_epoch);
}
+ public function getPurchaseName(
+ PhortuneProduct $product,
+ PhortunePurchase $purchase) {
+ return $this->getImplementation()->getPurchaseName(
+ $this,
+ $product,
+ $purchase);
+ }
+
+ public function getPurchaseURI(
+ PhortuneProduct $product,
+ PhortunePurchase $purchase) {
+ return $this->getImplementation()->getPurchaseURI(
+ $this,
+ $product,
+ $purchase);
+ }
+
/* -( PhabricatorPolicyInterface )----------------------------------------- */
diff --git a/src/applications/phortune/subscription/PhortuneSubscriptionImplementation.php b/src/applications/phortune/subscription/PhortuneSubscriptionImplementation.php
--- a/src/applications/phortune/subscription/PhortuneSubscriptionImplementation.php
+++ b/src/applications/phortune/subscription/PhortuneSubscriptionImplementation.php
@@ -8,6 +8,15 @@
abstract public function getRef();
abstract public function getName(PhortuneSubscription $subscription);
+
+ public function getFullName(PhortuneSubscription $subscription) {
+ return $this->getName($subscription);
+ }
+
+ public function getCrumbName(PhortuneSubscription $subscription) {
+ return $this->getName($subscription);
+ }
+
abstract public function getCostForBillingPeriodAsCurrency(
PhortuneSubscription $subscription,
$start_epoch,
@@ -25,4 +34,17 @@
return pht('Subscription');
}
+ public function getPurchaseName(
+ PhortuneSubscription $subscription,
+ PhortuneProduct $product,
+ PhortunePurchase $purchase) {
+ return $product->getProductName();
+ }
+
+ public function getPurchaseURI(
+ PhortuneSubscription $subscription,
+ PhortuneProduct $product,
+ PhortunePurchase $purchase) {
+ return null;
+ }
}
diff --git a/src/applications/phortune/view/PhortuneSubscriptionTableView.php b/src/applications/phortune/view/PhortuneSubscriptionTableView.php
--- a/src/applications/phortune/view/PhortuneSubscriptionTableView.php
+++ b/src/applications/phortune/view/PhortuneSubscriptionTableView.php
@@ -55,7 +55,7 @@
array(
'href' => $uri,
),
- $subscription->getSubscriptionName()),
+ $subscription->getSubscriptionFullName()),
phabricator_datetime($subscription->getDateCreated(), $viewer),
);
}
diff --git a/src/applications/phortune/worker/PhortuneSubscriptionWorker.php b/src/applications/phortune/worker/PhortuneSubscriptionWorker.php
--- a/src/applications/phortune/worker/PhortuneSubscriptionWorker.php
+++ b/src/applications/phortune/worker/PhortuneSubscriptionWorker.php
@@ -49,6 +49,8 @@
$purchase
->setBasePriceAsCurrency($currency)
->setMetadataValue('subscriptionPHID', $subscription->getPHID())
+ ->setMetadataValue('epoch.start', $last_epoch)
+ ->setMetadataValue('epoch.end', $next_epoch)
->save();
$cart->setSubscriptionPHID($subscription->getPHID());
diff --git a/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php b/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php
--- a/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php
+++ b/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php
@@ -901,6 +901,11 @@
'Related link:',
'Related links:',
),
+
+ 'You have %d unpaid invoice(s).' => array(
+ 'You have an unpaid invoice.',
+ 'You have unpaid invoices.',
+ ),
);
}

File Metadata

Mime Type
text/plain
Expires
Sun, Oct 27, 11:51 PM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6721559
Default Alt Text
D11601.id27918.diff (8 KB)

Event Timeline