* @return void
*/
public static function buildQuickForm(&$form) {
- // radio button for gender
- $genderOptions = array();
- $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id', array('localize' => TRUE));
- foreach ($gender as $key => $var) {
- $genderOptions[$key] = $form->createElement('radio', NULL,
- ts('Gender'), $var, $key,
- array('id' => "civicrm_gender_{$var}_{$key}")
- );
- }
- $form->addGroup($genderOptions, 'gender_id', ts('Gender'))->setAttribute('allowClear', TRUE);
+ $form->addField('gender_id', array('entity' => 'contact', 'type' => 'Radio', 'allowClear' => TRUE));
- $form->addDate('birth_date', ts('Date of Birth'), FALSE, array('formatType' => 'birth'));
+ $form->addField('birth_date', array('entity' => 'contact', 'formatType' => 'birth'));
- $form->addElement('checkbox', 'is_deceased', NULL, ts('Contact is Deceased'), array('onclick' => "showDeceasedDate()"));
- $form->addDate('deceased_date', ts('Deceased Date'), FALSE, array('formatType' => 'birth'));
+ $form->addField('is_deceased', array('entity' => 'contact', 'label' => ts('Contact is Deceased'), 'onclick' => "showDeceasedDate()"));
+ $form->addField('deceased_date', array('entity' => 'contact', 'formatType' => 'birth'));
}
/**