+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
+ | Copyright CiviCRM LLC (c) 2004-2020 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2019
+ * @copyright CiviCRM LLC (c) 2004-2020
*/
/**
return TRUE;
}
- /**
- * Is the from being accessed by a front end user to update their own recurring.
- *
- * @var bool
- */
- protected $selfService;
-
/**
* Set variables up before form is built.
*
$this->_mode = 'auto_renew';
// CRM-18468: crid is more accurate than mid for getting
// subscriptionDetails, so don't get them again.
- if (!$this->_crid) {
- $this->_paymentProcessorObj = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_mid, 'membership', 'obj');
- $this->_subscriptionDetails = CRM_Contribute_BAO_ContributionRecur::getSubscriptionDetails($this->_mid, 'membership');
- }
$membershipTypes = CRM_Member_PseudoConstant::membershipType();
$membershipTypeId = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $this->_mid, 'membership_type_id');
'cancel_reason' => ['name' => 'cancel_reason'],
];
$this->entityFields['send_cancel_request'] = [
- 'title' => ts('Send cancellation request to %1 ?', [1 => $this->_paymentProcessorObj->_processorName]),
+ 'title' => ts('Send cancellation request?'),
'name' => 'send_cancel_request',
'not-auto-addable' => TRUE,
];
}
}
- /**
- * Is this being used by a front end user to update their own recurring.
- *
- * @return bool
- */
- protected function isSelfService() {
- if (!is_null($this->selfService)) {
- return $this->selfService;
- }
- $this->selfService = FALSE;
- 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 this recurring contribution.'));
- }
- $this->selfService = TRUE;
- }
- return $this->selfService;
- }
-
}