X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FForm.php;h=ddc30aa4a99dd523cb83614dba675c072960d58c;hb=c503dcf3dc4ec114585dcaa8ffdfdbaab9609da7;hp=d2596921d2dfc54818ab936a7e89fe4b89ddce7d;hpb=03298d98322f2da05e2ab30cb0e2d5b90df47ab3;p=civicrm-core.git diff --git a/CRM/Contribute/Form.php b/CRM/Contribute/Form.php index d2596921d2..ddc30aa4a9 100644 --- a/CRM/Contribute/Form.php +++ b/CRM/Contribute/Form.php @@ -1,7 +1,7 @@ _id = $this->get('id'); - $this->_BAOName = $this->get('BAOName'); - } +class CRM_Contribute_Form extends CRM_Admin_Form { /** - * This function sets the default values for the form. MobileProvider that in edit/view mode + * Set 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() { + public function setDefaultValues() { $defaults = array(); - $params = array(); if (isset($this->_id)) { $params = array('id' => $this->_id); - if (!empty( $this->_BAOName)) { + if (!empty($this->_BAOName)) { $baoName = $this->_BAOName; $baoName::retrieve($params, $defaults); } @@ -82,7 +61,7 @@ class CRM_Contribute_Form extends CRM_Core_Form { } elseif ($this->_action == CRM_Core_Action::ADD) { $condition = " AND is_default = 1"; - $values = CRM_Core_OptionGroup::values('financial_account_type', false, false, false, $condition); + $values = CRM_Core_OptionGroup::values('financial_account_type', FALSE, FALSE, FALSE, $condition); $defaults['financial_account_type_id'] = array_keys($values); $defaults['is_active'] = 1; @@ -101,40 +80,4 @@ 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'), - ), - ) - ); - } - } } -