diff --git a/CRM/Contact/DAO/Contact.php b/CRM/Contact/DAO/Contact.php index 02a08b2caf3..98a2c243e5b 100644 --- a/CRM/Contact/DAO/Contact.php +++ b/CRM/Contact/DAO/Contact.php @@ -30,7 +30,7 @@ * * Generated from xml/schema/CRM/Contact/Contact.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:6b04aae8fb2f9ebedb5aa9c792b81e30) + * (GenCodeChecksum:1e87927c8c8bdec9acfe3c306bb711d4) */ require_once 'CRM/Core/DAO.php'; require_once 'CRM/Utils/Type.php'; @@ -968,6 +968,10 @@ static function &fields() { 'entity' => 'Contact', 'bao' => 'CRM_Contact_BAO_Contact', 'localizable' => 0, + 'pseudoconstant' => array( + 'optionGroupName' => 'email_greeting', + 'optionEditPath' => 'civicrm/admin/options/email_greeting', + ) ) , 'email_greeting_custom' => array( 'name' => 'email_greeting_custom', @@ -1016,6 +1020,10 @@ static function &fields() { 'html' => array( 'type' => 'Text', ) , + 'pseudoconstant' => array( + 'optionGroupName' => 'postal_greeting', + 'optionEditPath' => 'civicrm/admin/options/postal_greeting', + ) ) , 'postal_greeting_custom' => array( 'name' => 'postal_greeting_custom', @@ -1081,6 +1089,10 @@ static function &fields() { 'html' => array( 'type' => 'Text', ) , + 'pseudoconstant' => array( + 'optionGroupName' => 'addressee', + 'optionEditPath' => 'civicrm/admin/options/addressee', + ) ) , 'addressee_display' => array( 'name' => 'addressee_display', diff --git a/CRM/Contact/Form/Edit/CommunicationPreferences.php b/CRM/Contact/Form/Edit/CommunicationPreferences.php index 2dae6696366..20f08e501bb 100644 --- a/CRM/Contact/Form/Edit/CommunicationPreferences.php +++ b/CRM/Contact/Form/Edit/CommunicationPreferences.php @@ -131,7 +131,7 @@ public static function formRule($fields, $files, $self) { $greetings = self::getGreetingFields($self->_contactType); foreach ($greetings as $greeting => $details) { - $customizedValue = CRM_Core_OptionGroup::getValue($greeting, 'Customized', 'name'); + $customizedValue = CRM_Core_PseudoConstant::getKey('CRM_Contact_BAO_Contact', $details['field'], 'Customized'); if (CRM_Utils_Array::value($details['field'], $fields) == $customizedValue && empty($fields[$details['customField']])) { $errors[$details['customField']] = ts('Custom %1 is a required field if %1 is of type Customized.', array(1 => $details['label']) diff --git a/xml/schema/Contact/Contact.xml b/xml/schema/Contact/Contact.xml index 4b2aab12f81..428dc40b55a 100644 --- a/xml/schema/Contact/Contact.xml +++ b/xml/schema/Contact/Contact.xml @@ -534,6 +534,9 @@ Email Greeting ID FK to civicrm_option_value.id, that has to be valid registered Email Greeting. 3.0 + + email_greeting + email_greeting_custom @@ -567,6 +570,9 @@ Text + + postal_greeting + postal_greeting_custom @@ -609,6 +615,9 @@ Text + + addressee + addressee_display