Merge pull request #5744 from davejenx/CRM-16427
[civicrm-core.git] / CRM / Member / Form.php
index c3b9dcda01437f8f6a6ac24a2714d51d312c0bee..72c1bdcadcfbb7edacd6fd6192156c84ad210c35 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$
  *
  */
@@ -85,7 +85,8 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment {
    * the default values are retrieved from the database
    *
    *
-   * @return array defaults
+   * @return array
+   *   defaults
    */
   public function setDefaultValues() {
     $defaults = array();
@@ -117,7 +118,7 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment {
   }
 
   /**
-   * Build the form object
+   * Build the form object.
    *
    * @return void
    */
@@ -128,19 +129,19 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment {
         $this->_processors, TRUE,
         array('onChange' => "buildAutoRenew( null, this.value );")
       );
-      CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor, TRUE);
+      CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor, FALSE);
     }
     if ($this->_action & CRM_Core_Action::RENEW) {
       $this->addButtons(array(
           array(
             'type' => 'upload',
             'name' => ts('Renew'),
-            'isDefault' => TRUE
+            'isDefault' => TRUE,
           ),
           array(
             'type' => 'cancel',
-            'name' => ts('Cancel')
-          )
+            'name' => ts('Cancel'),
+          ),
         )
       );
     }
@@ -149,12 +150,12 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment {
           array(
             'type' => 'next',
             'name' => ts('Delete'),
-            'isDefault' => TRUE
+            'isDefault' => TRUE,
           ),
           array(
             'type' => 'cancel',
-            'name' => ts('Cancel')
-          )
+            'name' => ts('Cancel'),
+          ),
         )
       );
     }
@@ -163,17 +164,17 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment {
           array(
             'type' => 'upload',
             'name' => ts('Save'),
-            'isDefault' => TRUE
+            'isDefault' => TRUE,
           ),
           array(
             'type' => 'upload',
             'name' => ts('Save and New'),
-            'subName' => 'new'
+            'subName' => 'new',
           ),
           array(
             'type' => 'cancel',
-            'name' => ts('Cancel')
-          )
+            'name' => ts('Cancel'),
+          ),
         )
       );
     }
@@ -193,27 +194,27 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment {
    * If the member & contributor are the same then the values will be the same. But if different people paid
    * then they weill differ
    *
-   * @param $formValues
-   *   Array values from form. The important values we are looking for are.
+   * @param array $formValues
+   *   values from form. The important values we are looking for are.
    *  - contact_id
    *  - soft_credit_contact_id
    */
-  public function storeContactFields($formValues){
+  public function storeContactFields($formValues) {
     // in a 'standalone form' (contact id not in the url) the contact will be in the form values
     if (!empty($formValues['contact_id'])) {
       $this->_contactID = $formValues['contact_id'];
     }
 
     list($this->_memberDisplayName,
-         $this->_memberEmail
-    ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactID);
+      $this->_memberEmail
+      ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactID);
 
     //CRM-10375 Where the payer differs to the member the payer should get the email.
     // here we store details in order to do that
     if (!empty($formValues['soft_credit_contact_id'])) {
       $this->_receiptContactId = $this->_contributorContactID = $formValues['soft_credit_contact_id'];
-      list( $this->_contributorDisplayName,
-         $this->_contributorEmail ) = CRM_Contact_BAO_Contact_Location::getEmailDetails( $this->_contributorContactID );
+      list($this->_contributorDisplayName,
+        $this->_contributorEmail) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contributorContactID);
     }
     else {
       $this->_receiptContactId = $this->_contributorContactID = $this->_contactID;
@@ -221,4 +222,5 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment {
       $this->_contributorEmail = $this->_memberEmail;
     }
   }
+
 }