Fix conflict on visibility of ->_paymentProcessors
[civicrm-core.git] / CRM / Contribute / Form / Contribution / ThankYou.php
index 0823aac7c4c29bc071c198b7a82266da8c8f4537..f9dc5d3fb479f2936c2e8f350281fe0ac78e168d 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
 class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_ContributionBase {
 
   /**
-   * Membership price set status
+   * Membership price set status.
    */
   public $_useForMember;
 
   /**
-   * Set variables up before form is built
-   *
-   * @return void
+   * Set variables up before form is built.
    */
   public function preProcess() {
     parent::preProcess();
@@ -88,7 +86,7 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
   }
 
   /**
-   * Build the form object
+   * Build the form object.
    *
    * @return void
    */
@@ -174,14 +172,17 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
       $this->assign('membership_amount', $membershipAmount);
       $this->assign('renewal_mode', $renewalMode);
 
-      CRM_Member_BAO_Membership::buildMembershipBlock($this,
-        $this->_id,
+      $this->buildMembershipBlock(
         $this->_membershipContactID,
         FALSE,
         $membershipTypeID,
         TRUE,
         NULL
       );
+
+      if (!empty($params['auto_renew'])) {
+        $this->assign('auto_renew', TRUE);
+      }
     }
 
     $this->_separateMembershipPayment = $this->get('separateMembershipPayment');
@@ -292,4 +293,5 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
     // CRM-9491
     $this->controller->reset();
   }
+
 }