Merge pull request #14024 from civicrm/5.13
[civicrm-core.git] / CRM / Contribute / Form / ContributionRecur.php
index 8363ab5b5a0575e1829694d9ae08fbef76867d18..d0b1ee2873ad50d109940914d4f94071455d3dcd 100644 (file)
@@ -46,6 +46,21 @@ class CRM_Contribute_Form_ContributionRecur extends CRM_Core_Form {
    */
   protected $_crid = NULL;
 
+  /**
+   * The recurring contribution id, used when editing the recurring contribution.
+   *
+   * For historical reasons this duplicates _crid & since the name is more meaningful
+   * we should probably deprecate $_crid.
+   *
+   * @var int
+   */
+  protected $contributionRecurID = NULL;
+
+  /**
+   * @var int Membership ID
+   */
+  protected $_mid = NULL;
+
   /**
    * Explicitly declare the entity api name.
    */
@@ -60,4 +75,14 @@ class CRM_Contribute_Form_ContributionRecur extends CRM_Core_Form {
     return 'create';
   }
 
+  /**
+   * Set variables up before form is built.
+   */
+  public function preProcess() {
+    $this->_mid = CRM_Utils_Request::retrieve('mid', 'Integer', $this, FALSE);
+    $this->_crid = CRM_Utils_Request::retrieve('crid', 'Integer', $this, FALSE);
+    $this->contributionRecurID = $this->_crid;
+    $this->_coid = CRM_Utils_Request::retrieve('coid', 'Integer', $this, FALSE);
+  }
+
 }