/** * Function to build the form * * @return None * @access public */ public function buildQuickForm() { $profileID = CRM_Core_DAO::getFieldValue('CRM_Auction_DAO_Auction', $this->_aid, 'donor_profile_id'); if (!$profileID) { CRM_Core_Error::fatal('Profile not configured for this auction.'); } require_once 'CRM/Auction/BAO/Item.php'; if (CRM_Auction_BAO_Item::isEmailInProfile($profileID)) { $this->assign('profileDisplay', TRUE); } $fields = NULL; require_once "CRM/Core/BAO/UFGroup.php"; if ($this->_donorID) { if (CRM_Core_BAO_UFGroup::filterUFGroups($profileID, $this->_donorID)) { $fields = CRM_Core_BAO_UFGroup::getFields($profileID, FALSE, CRM_Core_Action::ADD); } $this->addFormRule(array('CRM_Auction_Form_ItemAccount', 'formRule'), $this); } else { require_once 'CRM/Core/BAO/CMSUser.php'; CRM_Core_BAO_CMSUser::buildForm($this, $profileID, TRUE); $fields = CRM_Core_BAO_UFGroup::getFields($profileID, FALSE, CRM_Core_Action::ADD); } if ($fields) { $this->assign('fields', $fields); $addCaptcha = FALSE; foreach ($fields as $key => $field) { if (isset($field['data_type']) && $field['data_type'] == 'File') { // ignore file upload fields continue; } require_once "CRM/Core/BAO/UFGroup.php"; require_once "CRM/Profile/Form.php"; CRM_Core_BAO_UFGroup::buildProfile($this, $field, CRM_Profile_Form::MODE_CREATE); $this->_fields[$key] = $field; if ($field['add_captcha']) { $addCaptcha = TRUE; } } if ($addCaptcha) { require_once 'CRM/Utils/ReCAPTCHA.php'; $captcha =& CRM_Utils_ReCAPTCHA::singleton(); $captcha->add($this); $this->assign("isCaptcha", TRUE); } } $button[] = array('type' => 'next', 'name' => ts('Continue >>'), 'spacing' => ' ', 'isDefault' => TRUE); $this->addButtons($button); }