From: Tim Mallezie Date: Fri, 15 May 2015 19:07:09 +0000 (+0200) Subject: CRM-16178 use addfield in demographics X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c39881b82bf69e67faf85a3a1da752e3ec0970f2;p=civicrm-core.git CRM-16178 use addfield in demographics --- diff --git a/CRM/Contact/Form/Edit/Demographics.php b/CRM/Contact/Form/Edit/Demographics.php index 17f7ff3b05..892a263577 100644 --- a/CRM/Contact/Form/Edit/Demographics.php +++ b/CRM/Contact/Form/Edit/Demographics.php @@ -47,21 +47,12 @@ class CRM_Contact_Form_Edit_Demographics { * @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')); } /**