3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
21 * Base class for offline membership / membership type / membership renewal and membership status forms
24 class CRM_Member_Form_MembershipConfig
extends CRM_Core_Form
{
27 * The id of the object being edited / created
34 * The name of the BAO object for this form.
41 * Set default values for the form. MobileProvider that in edit/view mode
42 * the default values are retrieved from the database
47 public function setDefaultValues() {
50 if (isset($this->_id
)) {
51 $params = ['id' => $this->_id
];
52 $baoName = $this->_BAOName
;
53 $baoName::retrieve($params, $defaults);
56 if (isset($defaults['minimum_fee'])) {
57 $defaults['minimum_fee'] = CRM_Utils_Money
::format($defaults['minimum_fee'], NULL, '%a');
60 if (isset($defaults['status'])) {
61 $this->assign('membershipStatus', $defaults['status']);
64 if ($this->_action
& CRM_Core_Action
::ADD
) {
65 $defaults['is_active'] = 1;
68 if (isset($defaults['member_of_contact_id']) &&
69 $defaults['member_of_contact_id']
71 $defaults['member_org'] = CRM_Core_DAO
::getFieldValue('CRM_Contact_DAO_Contact',
72 $defaults['member_of_contact_id'], 'display_name'
79 * Build the form object.
83 public function buildQuickForm() {
84 if ($this->_action
& CRM_Core_Action
::RENEW
) {
88 'name' => ts('Renew'),
93 'name' => ts('Cancel'),
97 elseif ($this->_action
& CRM_Core_Action
::DELETE
) {
101 'name' => ts('Delete'),
106 'name' => ts('Cancel'),
114 'name' => ts('Save'),
119 'name' => ts('Save and New'),
124 'name' => ts('Cancel'),