[REF] Update selfService in updateBilling to use shared function
authorSeamus Lee <seamuslee001@gmail.com>
Mon, 5 Aug 2019 05:19:34 +0000 (15:19 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Tue, 6 Aug 2019 23:37:20 +0000 (09:37 +1000)
Minor spelling fix

Update as per Eileen's comment

CRM/Contribute/Form/ContributionRecur.php
CRM/Contribute/Form/UpdateBilling.php

index 2ec9a2fbc67c3ba8b54541e5da62a6d61e477a54..b333159eca837a2ed463ec282a6563b4407ef87b 100644 (file)
@@ -108,7 +108,7 @@ class CRM_Contribute_Form_ContributionRecur extends CRM_Core_Form {
   protected $subscriptionDetails = [];
 
   /**
-   * Is the from being accessed by a front end user to update their own recurring.
+   * Is the form being accessed by a front end user to update their own recurring.
    *
    * @var bool
    */
index 2854e77424cd800c226079a3d590dc12319ce075..9ab033a5bdd84869d155193cbb814778d4376e99 100644 (file)
@@ -39,8 +39,6 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Contribute_Form_Contribution
 
   protected $_subscriptionDetails = NULL;
 
-  protected $_selfService = FALSE;
-
   public $_bltID = NULL;
 
   /**
@@ -75,12 +73,6 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Contribute_Form_Contribution
     if ((!$this->_crid && !$this->_coid && !$this->_mid) || (!$this->_subscriptionDetails)) {
       CRM_Core_Error::fatal('Required information missing.');
     }
-    if (!CRM_Core_Permission::check('edit contributions')) {
-      if ($this->_subscriptionDetails->contact_id != $this->getContactID()) {
-        CRM_Core_Error::statusBounce(ts('You do not have permission to cancel subscription.'));
-      }
-      $this->_selfService = TRUE;
-    }
 
     if (!$this->_paymentProcessor['object']->supports('updateSubscriptionBillingInfo')) {
       CRM_Core_Error::fatal(ts("%1 processor doesn't support updating subscription billing details.",
@@ -160,7 +152,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Contribute_Form_Contribution
    */
   public function buildQuickForm() {
     $type = 'next';
-    if ($this->_selfService) {
+    if ($this->isSelfService()) {
       $type = 'submit';
     }