X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FForm.php;h=d0c1767333dcd8e55500d5c91785f14749e31d25;hb=64c2aeba7eea943c799caafed1c82e4f383a1e2d;hp=60c7a7d9e2d9ee0eacfabbf3817b2bb7164abe2d;hpb=a74880802265c949ef3284b795d320396966629f;p=civicrm-core.git diff --git a/CRM/Contribute/Form.php b/CRM/Contribute/Form.php index 60c7a7d9e2..d0c1767333 100644 --- a/CRM/Contribute/Form.php +++ b/CRM/Contribute/Form.php @@ -1,9 +1,9 @@ _id = $this->get('id'); - $this->_BAOName = $this->get('BAOName'); - } - - /** - * This function sets the default values for the form. MobileProvider that in edit/view mode + * This function sets the default values for the form. Note that in edit/view mode * the default values are retrieved from the database * * @access public * - * @return void + * @return array */ function setDefaultValues() { $defaults = array(); - $params = array(); if (isset($this->_id)) { $params = array('id' => $this->_id); @@ -77,7 +57,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) { @@ -88,7 +68,7 @@ class CRM_Contribute_Form extends CRM_Core_Form { } elseif ($this->_action & CRM_Core_Action::UPDATE) { - if (!empty($defaults['contact_id']) || CRM_Utils_Array::value('created_id', $defaults)) { + 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); @@ -101,40 +81,5 @@ class CRM_Contribute_Form extends CRM_Core_Form { return $defaults; } - /** - * Function to actually build the form - * - * @return void - * @access public - */ - public function buildQuickForm() { - $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Save'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); - - if ($this->_action & CRM_Core_Action::DELETE) { - $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Delete'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); - } - } }