/** * Function to actually build the form * * @return None * @access public */ function buildQuickForm() { // assign a few constants used by all display elements // we can obsolete this when smarty can access class constans directly $this->assign('locationCount', CRM_CONTACT_FORM_EDIT_LOCATION_BLOCKS + 1); $this->assign('blockCount', CRM_CONTACT_FORM_LOCATION_BLOCKS + 1); $this->assign('contact_type', $this->_contactType); require_once str_replace('_', DIRECTORY_SEPARATOR, "CRM_Contact_Form_" . $this->_contactType) . ".php"; eval('CRM_Contact_Form_' . $this->_contactType . '::buildQuickForm( $this );'); // add the communications block CRM_Contact_Form_Edit::buildCommunicationBlock($this); /* Entering the compact location engine */ $location =& CRM_Contact_Form_Location::buildLocationBlock($this, CRM_CONTACT_FORM_EDIT_LOCATION_BLOCKS); /* End of locations */ // add note block if ($this->_action & CRM_CORE_ACTION_ADD) { $note =& CRM_Contact_Form_Note::buildNoteBlock($this); } //add tags and groups block $groupTag =& CRM_Contact_Form_GroupTag::buildGroupTagBlock($this, $this->_contactId, CRM_CONTACT_FORM_GROUPTAG_ALL); //Custom Group Inline Edit form $this->_groupTree =& CRM_Core_BAO_CustomGroup::getTree($this->_contactType, $this->_contactId); CRM_Core_BAO_CustomGroup::buildQuickForm($this, $this->_groupTree, 'showBlocks1', 'hideBlocks1'); $config =& CRM_Core_Config::singleton(); CRM_Core_ShowHideBlocks::links($this, 'notes', '', ''); // add the dedupe button $this->addElement('submit', $this->_dedupeButtonName, ts('Check for Matching Contact(s)')); $this->addElement('submit', $this->_duplicateButtonName, ts('Save Duplicate Contact')); $this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'subName' => 'view', 'isDefault' => true), array('type' => 'next', 'name' => ts('Save and New'), 'subName' => 'new'), array('type' => 'cancel', 'name' => ts('Cancel')))); }
/** * Function to actually build the form * * @return None * @access public */ function buildQuickForm() { $this->add('text', 'name', ts('Name:'), array('size' => 25)); $this->add('text', 'description', ts('Description:'), array('size' => 25)); $this->add('text', 'contact_name', ts('Contact Name:'), array('size' => 25)); $this->add('text', 'email_domain', ts('Email Domain:'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Email', 'email')); $this->addRule("email_domain", ts('Email is not valid.'), 'domain'); $this->add('text', 'email_return_path', ts('Send Emails RETURN-PATH:'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Email', 'email')); $this->addRule("email_return_path", ts('Email is not valid.'), 'email'); $this->assign('locationCount', CRM_CONTACT_FORM_DOMAIN_LOCATION_BLOCKS + 1); $location =& CRM_Contact_Form_Location::buildLocationBlock($this, CRM_CONTACT_FORM_DOMAIN_LOCATION_BLOCKS); $this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'subName' => 'view', 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel')))); if ($this->_action & CRM_CORE_ACTION_VIEW) { $this->freeze(); } $this->assign('emailDomain', true); }