/**
  * Function to actually build the form
  *
  * @return void
  * @access public
  */
 public function buildQuickForm()
 {
     $params = array();
     $params['id'] = $params['contact_id'] = $this->_contactId;
     $contact = CRM_Contact_BAO_Contact::retrieve($params, $this->_defaults);
     $countryID = '';
     $stateID = '';
     if (!empty($this->_defaults['address'][1])) {
         $countryID = CRM_Utils_Array::value('country_id', $this->_defaults['address'][1]);
         $stateID = CRM_Utils_Array::value('state_province_id', $this->_defaults['address'][1]);
     }
     CRM_Contact_BAO_Contact_Utils::buildOnBehalfForm($this, $this->_contactType, $countryID, $stateID, 'Contact Information', TRUE);
     $this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel'))));
 }
Ejemplo n.º 2
0
 /**
  * build elements to enable pay on behalf of an organization.
  *
  * @access public
  */
 function buildOnBehalfOrganization()
 {
     if ($this->_membershipContactID) {
         require_once 'CRM/Core/BAO/Location.php';
         $entityBlock = array('contact_id' => $this->_membershipContactID);
         CRM_Core_BAO_Location::getValues($entityBlock, $this->_defaults);
     }
     require_once 'CRM/Contact/BAO/Contact/Utils.php';
     if ($this->_values['is_for_organization'] != 2) {
         $attributes = array('onclick' => "return showHideByValue('is_for_organization','true','for_organization','block','radio',false);");
         $this->addElement('checkbox', 'is_for_organization', $this->_values['for_organization'], null, $attributes);
     } else {
         $this->addElement('hidden', 'is_for_organization', true);
     }
     $this->assign('is_for_organization', true);
     CRM_Contact_BAO_Contact_Utils::buildOnBehalfForm($this, 'Organization', null, null, 'Organization Details');
 }