CRM-13107, fixed for event confirm/thank you screen to show prefix/suffix/gender...
authorkurund <kurund@civicrm.org>
Mon, 5 Aug 2013 22:35:00 +0000 (04:05 +0530)
committerkurund <kurund@civicrm.org>
Mon, 5 Aug 2013 22:35:00 +0000 (04:05 +0530)
----------------------------------------
* CRM-13107: Individual Prefix, Suffix and Gender fields are broken in Profile Create, Edit and View
  http://issues.civicrm.org/jira/browse/CRM-13107

CRM/Event/BAO/Event.php

index c2d58884f8a7d1582c5dc0771a0c83ee0db9f018..97d35cbdc4bb4d6561b56fd80ed4db6555e67ed3 100644 (file)
@@ -1392,17 +1392,8 @@ WHERE civicrm_event.is_active = 1
             $values[$index] = '';
           }
         }
-        elseif ('gender' == substr($name, 0, 6)) {
-          $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
-          $values[$index] = $gender[$params[$name]];
-        }
-        elseif ('individual_prefix' == substr($name, 0, 17)) {
-          $prefix = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'prefix_id');
-          $values[$index] = $prefix[$params[$name]];
-        }
-        elseif ('individual_suffix' == substr($name, 0, 17)) {
-          $suffix = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'suffix_id');
-          $values[$index] = $suffix[$params[$name]];
+        elseif (in_array(substr($name, 0, -3), array('gender', 'prefix', 'suffix'))) {
+          $values[$index] = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', $name, $params[$name]);
         }
         elseif (in_array($name, array(
           'addressee', 'email_greeting', 'postal_greeting'))) {