UFGroup.php - Code cleanup
authorColeman Watts <coleman@civicrm.org>
Sun, 8 Dec 2013 06:32:03 +0000 (22:32 -0800)
committerColeman Watts <coleman@civicrm.org>
Sun, 8 Dec 2013 06:32:03 +0000 (22:32 -0800)
CRM/Core/BAO/UFGroup.php

index 8c13067f58118148a7fff1d124ba3358c0ded707..05fd61d48e280fcdbdaa39587dd3e771b310327e 100644 (file)
@@ -1871,16 +1871,10 @@ AND    ( entity_id IS NULL OR entity_id <= 0 )
         $form->addRule($name, ts('%1 is a required field.', array(1 => $title)), 'required');
       }
     }
-    elseif ($fieldName === 'prefix_id') {
+    elseif ($fieldName === 'prefix_id' || $fieldName === 'suffix_id') {
       $form->add('select', $name, $title,
         array(
-          '' => ts('- select -')) + CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'prefix_id'), $required
-      );
-    }
-    elseif ($fieldName === 'suffix_id') {
-      $form->add('select', $name, $title,
-        array(
-          '' => ts('- select -')) + CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'suffix_id'), $required
+          '' => ts('- select -')) + CRM_Core_PseudoConstant::get('CRM_Contact_BAO_Contact', $fieldName), $required
       );
     }
     elseif ($fieldName === 'contact_sub_type') {