Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-03-20-15-52-17
[civicrm-core.git] / CRM / Contribute / Form.php
index c9bc305cee21dad1c9429ada139fc31dd7e2fa8a..4cf363715a38d2ba1ebcdfe982325bc7f77028bc 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -51,7 +51,9 @@ class CRM_Contribute_Form extends CRM_Core_Form {
    *
    * @var string
    */
-  protected $_BAOName; function preProcess() {
+  protected $_BAOName;
+
+  function preProcess() {
     $this->_id = $this->get('id');
     $this->_BAOName = $this->get('BAOName');
   }
@@ -62,7 +64,7 @@ class CRM_Contribute_Form extends CRM_Core_Form {
    *
    * @access public
    *
-   * @return None
+   * @return void
    */
   function setDefaultValues() {
     $defaults = array();
@@ -75,7 +77,7 @@ class CRM_Contribute_Form extends CRM_Core_Form {
         $baoName::retrieve($params, $defaults);
       }
     }
-    if ($this->_action == CRM_Core_Action::DELETE && CRM_Utils_Array::value('name', $defaults)) {
+    if ($this->_action == CRM_Core_Action::DELETE && !empty($defaults['name'])) {
       $this->assign('delName', $defaults['name']);
     }
     elseif ($this->_action == CRM_Core_Action::ADD) {
@@ -86,8 +88,8 @@ class CRM_Contribute_Form extends CRM_Core_Form {
 
     }
     elseif ($this->_action & CRM_Core_Action::UPDATE) {
-      if (CRM_Utils_Array::value('contact_id', $defaults) || CRM_Utils_Array::value('created_id', $defaults)) {
-        $contactID = CRM_Utils_Array::value('created_id', $defaults) ? $defaults['created_id'] : $defaults['contact_id'];
+      if (!empty($defaults['contact_id']) || !empty($defaults['created_id'])) {
+        $contactID = !empty($defaults['created_id']) ? $defaults['created_id'] : $defaults['contact_id'];
         $this->assign('created_id', $contactID);
         $this->assign('organisationId', $contactID);
       }
@@ -102,7 +104,7 @@ class CRM_Contribute_Form extends CRM_Core_Form {
   /**
    * Function to actually build the form
    *
-   * @return None
+   * @return void
    * @access public
    */
   public function buildQuickForm() {