diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index bfdf4cefbf2b13447523d0aec96b6898b9931dc3..0adb9c26d10945b0d6453a0ff541f7953d30e15a 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -1188,9 +1188,9 @@ WHERE id={$id}; "; 'middle_name', 'last_name', 'job_title', - 'gender', - 'individual_prefix', - 'individual_suffix', + 'gender_id', + 'prefix_id', + 'suffix_id', 'birth_date', 'organization_name', 'legal_name', @@ -1205,9 +1205,9 @@ WHERE id={$id}; "; 'middle_name', 'last_name', 'job_title', - 'gender', - 'individual_prefix', - 'individual_suffix', + 'gender_id', + 'prefix_id', + 'suffix_id', 'birth_date', 'household_name', 'is_deceased', @@ -1445,9 +1445,9 @@ WHERE id={$id}; "; 'middle_name', 'last_name', 'job_title', - 'gender', - 'individual_prefix', - 'individual_suffix', + 'gender_id', + 'prefix_id', + 'suffix_id', 'birth_date', 'organization_name', 'legal_name', @@ -1468,9 +1468,9 @@ WHERE id={$id}; "; 'middle_name', 'last_name', 'job_title', - 'gender', - 'individual_prefix', - 'individual_suffix', + 'gender_id', + 'prefix_id', + 'suffix_id', 'birth_date', 'household_name', 'email_greeting_custom', diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index cb79403ac53b8fd051b7eebe0b76d2d73c98e70b..de3ac1fdd807e2319b7ff5ffd43b95d39628be0e 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -711,22 +711,13 @@ class CRM_Contact_BAO_Query { if (in_array($tName, array('country', 'state_province', 'county'))) { $pf = ($tName == 'state_province') ? 'state_province_name' : $name; $this->_pseudoConstantsSelect[$pf] = - array( - 'pseudoField' => "{$tName}_id", - 'idCol' => "{$tName}_id", - 'bao' => 'CRM_Core_BAO_Address', - 'table' => "civicrm_{$tName}", - 'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id " - ); + array('pseudoField' => "{$tName}_id", 'idCol' => "{$tName}_id", 'bao' => 'CRM_Core_BAO_Address', + 'table' => "civicrm_{$tName}", 'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id "); if ($tName == 'state_province') { $this->_pseudoConstantsSelect[$tName] = - array( - 'pseudoField' => 'state_province_abbreviation', - 'idCol' => "{$tName}_id", - 'table' => "civicrm_{$tName}", - 'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id " - ); + array('pseudoField' => 'state_province_abbreviation', 'idCol' => "{$tName}_id", + 'table' => "civicrm_{$tName}", 'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id "); } $this->_select["{$tName}_id"] = "civicrm_address.{$tName}_id as {$tName}_id"; @@ -756,26 +747,14 @@ class CRM_Contact_BAO_Query { $this->_select[$name] = "IF ( contact_a.contact_type = 'Individual', NULL, contact_a.organization_name ) as organization_name"; } elseif ($fieldName != 'id') { - if ($name == 'individual_prefix') { - $this->_pseudoConstantsSelect['individual_prefix'] = array( - 'pseudoField' => 'prefix_id', - 'idCol' => "individual_prefix", - 'bao' => 'CRM_Contact_BAO_Contact' - ); + if ($fieldName == 'prefix_id') { + $this->_pseudoConstantsSelect['individual_prefix'] = array('pseudoField' => 'prefix_id', 'idCol' => "prefix_id", 'bao' => 'CRM_Contact_BAO_Contact'); } - if ($name == 'individual_suffix') { - $this->_pseudoConstantsSelect['individual_suffix'] = array( - 'pseudoField' => 'suffix_id', - 'idCol' => "individual_suffix", - 'bao' => 'CRM_Contact_BAO_Contact' - ); + if ($fieldName == 'suffix_id') { + $this->_pseudoConstantsSelect['individual_suffix'] = array('pseudoField' => 'suffix_id', 'idCol' => "suffix_id", 'bao' => 'CRM_Contact_BAO_Contact'); } - if ($name == 'gender') { - $this->_pseudoConstantsSelect['gender'] = array( - 'pseudoField' => 'gender_id', - 'idCol' => "gender", - 'bao' => 'CRM_Contact_BAO_Contact' - ); + if ($fieldName == 'gender_id') { + $this->_pseudoConstantsSelect['gender'] = array('pseudoField' => 'gender_id', 'idCol' => "gender_id", 'bao' => 'CRM_Contact_BAO_Contact'); } $this->_select[$name] = "contact_a.{$fieldName} as `$name`"; } @@ -1843,12 +1822,6 @@ class CRM_Contact_BAO_Query { if (!$field) { $field = CRM_Utils_Array::value($locType[0], $this->_fields); - // handling for special fields like gender - $specialFields = array('gender_id' => 'gender'); - if (!$field && array_key_exists($name, $specialFields)) { - $field = $this->_fields[$specialFields[$name]]; - } - if (!$field) { return; } @@ -3858,6 +3831,7 @@ WHERE id IN ( $groupIDs ) } } + $relTypeInd = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Individual'); $relTypeOrg = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Organization'); $relTypeHou = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Household'); @@ -4011,10 +3985,10 @@ civicrm_relationship.start_date > {$today} 'first_name' => 1, 'middle_name' => 1, 'last_name' => 1, - 'individual_prefix' => 1, - 'individual_suffix' => 1, + 'prefix_id' => 1, + 'suffix_id' => 1, 'birth_date' => 1, - 'gender' => 1, + 'gender_id' => 1, 'street_address' => 1, 'supplemental_address_1' => 1, 'supplemental_address_2' => 1, @@ -5041,14 +5015,7 @@ AND displayRelType.is_active = 1 $qill = $value; } - $pseudoFields = array( - 'email_greeting', - 'postal_greeting', - 'addressee', - 'gender', - 'individual_prefix', - 'individual_suffix', - ); + $pseudoFields = array('email_greeting', 'postal_greeting', 'addressee', 'gender_id', 'prefix_id', 'suffix_id'); if (is_numeric($value)) { $qill = $selectValues[(int ) $value]; @@ -5082,7 +5049,7 @@ AND displayRelType.is_active = 1 } if (in_array($name, $pseudoFields)) { - if (!in_array($name, array('gender', 'individual_prefix', 'individual_suffix'))) { + if (!in_array($name, array('gender_id', 'prefix_id', 'suffix_id'))) { $wc = "contact_a.{$name}_id"; } $dataType = 'Positive'; @@ -5156,7 +5123,6 @@ AND displayRelType.is_active = 1 if (property_exists($dao, $value['idCol'])) { $val = $dao->$value['idCol']; - $idColumn = $key; if (CRM_Utils_System::isNull($val)) { $dao->$key = NULL; @@ -5164,9 +5130,6 @@ AND displayRelType.is_active = 1 elseif ($baoName = CRM_Utils_Array::value('bao', $value, NULL)) { //preserve id value $idColumn = "{$key}_id"; - if (!empty($this->_fields[$key]['name'])) { - $idColumn = $this->_fields[$key]['name']; - } $dao->$idColumn = $val; $dao->$key = CRM_Core_PseudoConstant::getLabel($baoName, $value['pseudoField'], $val); } @@ -5193,7 +5156,6 @@ AND displayRelType.is_active = 1 $current[$lastElement] = $dao->$key; } else { - $values[$idColumn] = $dao->$idColumn; $values[$key] = $dao->$key; } } diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index ba9703f6ec56d1f200a781bedbeea9501ec6a9a1..1a3d23417f46d69a1bcad9751bd14dd57660efbd 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -949,10 +949,9 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { // hack for CRM-665 if (isset($details->$name) || $name == 'group' || $name == 'tag') { // to handle gender / suffix / prefix - if (in_array(substr($name, -6), array('gender', 'prefix', 'suffix'))) { - $values[$index] = $details->$name; - $idColumn = "{$name}_id"; - $params[$index] = $details->$idColumn; + if (in_array(substr($name, 0, -3), array('gender', 'prefix', 'suffix'))) { + $values[$index] = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', $name, $details->$name); + $params[$index] = $details->$name; } elseif (in_array($name, CRM_Contact_BAO_Contact::$_greetingTypes)) { $dname = $name . '_display'; @@ -1857,7 +1856,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) '' => ts('- select -')) + CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label'), $required ); } - elseif ($fieldName === 'gender') { + elseif ($fieldName === 'gender_id') { $genderOptions = array(); $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'); foreach ($gender as $key => $var) { @@ -1868,13 +1867,13 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) $form->addRule($name, ts('%1 is a required field.', array(1 => $title)), 'required'); } } - elseif ($fieldName === 'individual_prefix') { + elseif ($fieldName === 'prefix_id') { $form->add('select', $name, $title, array( '' => ts('- select -')) + CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'prefix_id'), $required ); } - elseif ($fieldName === 'individual_suffix') { + elseif ($fieldName === 'suffix_id') { $form->add('select', $name, $title, array( '' => ts('- select -')) + CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'suffix_id'), $required diff --git a/CRM/Profile/Selector/Listings.php b/CRM/Profile/Selector/Listings.php index 7046fb14dcdb3b2bb638d61bf2a9e5c9384d79ab..39fd3d4de55d915b826a7fb7cb25eb9d15f164ca 100644 --- a/CRM/Profile/Selector/Listings.php +++ b/CRM/Profile/Selector/Listings.php @@ -618,6 +618,9 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR elseif ($name == 'preferred_language') { $row[] = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', 'preferred_language', $result->$name); } + elseif (in_array(substr($name, 0, -3), array('gender', 'prefix', 'suffix'))) { + $row[] = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', $name, $result->$name); + } elseif ($multipleSelectFields && array_key_exists($name, $multipleSelectFields) ) { diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index 7f922bdf064522210d3bdeef6b407821294602f3..4d459f93b73815605ddb97e02b061044525aaf7e 100644 --- a/CRM/Utils/Token.php +++ b/CRM/Utils/Token.php @@ -644,6 +644,9 @@ class CRM_Utils_Token { $value = NULL; + // Support legacy tokens + $token = CRM_Utils_Array::value($token, self::legacyContactTokens(), $token); + // check if the token we were passed is valid // we have to do this because this function is // called only when we find a token in the string @@ -664,10 +667,17 @@ class CRM_Utils_Token { else { $value = CRM_Utils_Array::retrieveValueRecursive($contact, $token); - // note that incase of pseudoconstants we get array ( 0 => id, 1 => label ) + // FIXME: for some pseudoconstants we get array ( 0 => id, 1 => label ) if (is_array($value)) { $value = $value[1]; } + // Convert pseudoconstants using metadata + elseif ($value && is_numeric($value)) { + $allFields = CRM_Contact_BAO_Contact::exportableFields('All'); + if (!empty($allFields[$token]['pseudoconstant'])) { + $value = CRM_Core_PseudoConstant::getLabel('CRM_Contact_BAO_Contact', $token, $value); + } + } } if (!$html) { @@ -1214,10 +1224,6 @@ class CRM_Utils_Token { if (!empty($greetingTokens)) { // first use the existing contact object for token replacement if (!empty($contactDetails)) { - // unset id's to get labels for the pseudoconstants - foreach ( array('individual_prefix', 'individual_suffix', 'gender') as $field ) { - unset($contactDetails[0][$contactId][$field]); - } $tokenString = CRM_Utils_Token::replaceContactTokens($tokenString, $contactDetails, TRUE, $greetingTokens, TRUE); } @@ -1473,4 +1479,16 @@ class CRM_Utils_Token { function getPermissionEmails($permissionName) {} function getRoleEmails($roleName) {} + + /** + * @return array: legacy_token => new_token + */ + static function legacyContactTokens() { + return array( + 'individual_prefix' => 'prefix_id', + 'individual_suffix' => 'suffix_id', + 'gender' => 'gender_id', + ); + } + } diff --git a/xml/schema/Contact/Contact.xml b/xml/schema/Contact/Contact.xml index ed1afdfea8b83c7975c0c53f595d7c6dc52af6fa..6c90dc3b9866f35b77f17413d8890a7ca17525e0 100644 --- a/xml/schema/Contact/Contact.xml +++ b/xml/schema/Contact/Contact.xml @@ -7,107 +7,107 @@ <comment>Contact objects are defined by a civicrm_contact record plus a related civicrm_contact_type record.</comment> <add>1.1</add> <log>true</log> - <field> - <name>id</name> - <type>int unsigned</type> - <title>Internal Contact ID</title> - <import>true</import> - <headerPattern>/internal|contact?|id$/i</headerPattern> - <required>true</required> - <comment>Unique Contact ID</comment> - <add>1.1</add> + <field> + <name>id</name> + <type>int unsigned</type> + <title>Internal Contact ID</title> + <import>true</import> + <headerPattern>/internal|contact?|id$/i</headerPattern> + <required>true</required> + <comment>Unique Contact ID</comment> + <add>1.1</add> </field> <primaryKey> - <name>id</name> - <autoincrement>true</autoincrement> + <name>id</name> + <autoincrement>true</autoincrement> </primaryKey> <field> - <name>contact_type</name> - <title>Contact Type</title> - <type>varchar</type> - <length>64</length> - <comment>Type of Contact.</comment> - <export>true</export> - <pseudoconstant> - <table>civicrm_contact_type</table> - <keyColumn>name</keyColumn> - <labelColumn>label</labelColumn> - <condition>parent_id IS NULL</condition> - </pseudoconstant> - <add>1.1</add> - <change>3.1</change> + <name>contact_type</name> + <title>Contact Type</title> + <type>varchar</type> + <length>64</length> + <comment>Type of Contact.</comment> + <export>true</export> + <pseudoconstant> + <table>civicrm_contact_type</table> + <keyColumn>name</keyColumn> + <labelColumn>label</labelColumn> + <condition>parent_id IS NULL</condition> + </pseudoconstant> + <add>1.1</add> + <change>3.1</change> </field> <index> - <name>index_contact_type</name> - <fieldName>contact_type</fieldName> - <add>2.1</add> + <name>index_contact_type</name> + <fieldName>contact_type</fieldName> + <add>2.1</add> </index> <field> - <name>contact_sub_type</name> - <title>Contact Subtype</title> - <type>varchar</type> - <length>255</length> - <export>true</export> - <import>true</import> - <headerPattern>/C(ontact )?(subtype|sub-type|sub type)/i</headerPattern> - <comment>May be used to over-ride contact view and edit templates.</comment> - <pseudoconstant> - <table>civicrm_contact_type</table> - <keyColumn>name</keyColumn> - <labelColumn>label</labelColumn> - <condition>parent_id IS NOT NULL</condition> - </pseudoconstant> - <add>1.5</add> + <name>contact_sub_type</name> + <title>Contact Subtype</title> + <type>varchar</type> + <length>255</length> + <export>true</export> + <import>true</import> + <headerPattern>/C(ontact )?(subtype|sub-type|sub type)/i</headerPattern> + <comment>May be used to over-ride contact view and edit templates.</comment> + <pseudoconstant> + <table>civicrm_contact_type</table> + <keyColumn>name</keyColumn> + <labelColumn>label</labelColumn> + <condition>parent_id IS NOT NULL</condition> + </pseudoconstant> + <add>1.5</add> </field> <index> - <name>index_contact_sub_type</name> - <fieldName>contact_sub_type</fieldName> - <add>2.1</add> + <name>index_contact_sub_type</name> + <fieldName>contact_sub_type</fieldName> + <add>2.1</add> </index> <field> - <name>do_not_email</name> - <type>boolean</type> - <import>true</import> - <headerPattern>/d(o )?(not )?(email)/i</headerPattern> - <dataPattern>/^\d{1,}$/</dataPattern> - <default>0</default> - <add>1.1</add> - </field> - <field> - <name>do_not_phone</name> - <type>boolean</type> - <default>0</default> - <import>true</import> - <headerPattern>/d(o )?(not )?(call|phone)/i</headerPattern> - <dataPattern>/^\d{1,}$/</dataPattern> - <add>1.1</add> - </field> - <field> - <name>do_not_mail</name> - <type>boolean</type> - <import>true</import> - <headerPattern>/^(d(o\s)?n(ot\s)?mail)|(\w*)?bulk\s?(\w*)$/i</headerPattern> - <dataPattern>/^\d{1,}$/</dataPattern> - <default>0</default> - <add>1.1</add> - </field> - <field> - <name>do_not_sms</name> - <type>boolean</type> - <import>true</import> - <headerPattern>/d(o )?(not )?(sms)/i</headerPattern> - <dataPattern>/^\d{1,}$/</dataPattern> - <default>0</default> - <add>3.0</add> - </field> - <field> - <name>do_not_trade</name> - <type>boolean</type> - <import>true</import> - <headerPattern>/d(o )?(not )?(trade)/i</headerPattern> - <dataPattern>/^\d{1,}$/</dataPattern> - <default>0</default> - <add>1.1</add> + <name>do_not_email</name> + <type>boolean</type> + <import>true</import> + <headerPattern>/d(o )?(not )?(email)/i</headerPattern> + <dataPattern>/^\d{1,}$/</dataPattern> + <default>0</default> + <add>1.1</add> +</field> +<field> + <name>do_not_phone</name> + <type>boolean</type> + <default>0</default> + <import>true</import> + <headerPattern>/d(o )?(not )?(call|phone)/i</headerPattern> + <dataPattern>/^\d{1,}$/</dataPattern> + <add>1.1</add> + </field> + <field> + <name>do_not_mail</name> + <type>boolean</type> + <import>true</import> + <headerPattern>/^(d(o\s)?n(ot\s)?mail)|(\w*)?bulk\s?(\w*)$/i</headerPattern> + <dataPattern>/^\d{1,}$/</dataPattern> + <default>0</default> + <add>1.1</add> + </field> + <field> + <name>do_not_sms</name> + <type>boolean</type> + <import>true</import> + <headerPattern>/d(o )?(not )?(sms)/i</headerPattern> + <dataPattern>/^\d{1,}$/</dataPattern> + <default>0</default> + <add>3.0</add> + </field> + <field> + <name>do_not_trade</name> + <type>boolean</type> + <import>true</import> + <headerPattern>/d(o )?(not )?(trade)/i</headerPattern> + <dataPattern>/^\d{1,}$/</dataPattern> + <default>0</default> + <add>1.1</add> </field> <field> <name>is_opt_out</name> @@ -120,532 +120,522 @@ <add>1.1</add> </field> <field> - <name>legal_identifier</name> - <type>varchar</type> - <length>32</length> - <import>true</import> - <headerPattern>/legal\s?id/i</headerPattern> - <dataPattern>/\w+?\d{5,}/</dataPattern> - <comment>May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID. - </comment> - <add>1.1</add> + <name>legal_identifier</name> + <type>varchar</type> + <length>32</length> + <import>true</import> + <headerPattern>/legal\s?id/i</headerPattern> + <dataPattern>/\w+?\d{5,}/</dataPattern> + <comment>May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID.</comment> + <add>1.1</add> </field> <field> - <name>external_identifier</name> - <type>varchar</type> - <length>32</length> - <size>EIGHT</size> - <import>true</import> - <headerPattern>/external\s?id/i</headerPattern> - <dataPattern>/^\d{11,}$/</dataPattern> - <comment>Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping - operations. - </comment> - <add>1.1</add> + <name>external_identifier</name> + <type>varchar</type> + <length>32</length> + <size>EIGHT</size> + <import>true</import> + <headerPattern>/external\s?id/i</headerPattern> + <dataPattern>/^\d{11,}$/</dataPattern> + <comment>Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.</comment> + <add>1.1</add> </field> <index> - <name>UI_external_identifier</name> - <unique>true</unique> - <fieldName>external_identifier</fieldName> - <add>1.7</add> + <name>UI_external_identifier</name> + <unique>true</unique> + <fieldName>external_identifier</fieldName> + <add>1.7</add> </index> <field> - <name>sort_name</name> - <title>Sort Name</title> - <type>varchar</type> - <length>128</length> - <size>BIG</size> - <export>true</export> - <comment>Name used for sorting different contact types</comment> - <add>1.1</add> + <name>sort_name</name> + <title>Sort Name</title> + <type>varchar</type> + <length>128</length> + <size>BIG</size> + <export>true</export> + <comment>Name used for sorting different contact types</comment> + <add>1.1</add> </field> <index> - <name>index_sort_name</name> - <fieldName>sort_name</fieldName> - <add>2.1</add> + <name>index_sort_name</name> + <fieldName>sort_name</fieldName> + <add>2.1</add> </index> <field> - <name>display_name</name> - <title>Display Name</title> - <type>varchar</type> - <length>128</length> - <size>BIG</size> - <export>true</export> - <comment>Formatted name representing preferred format for display/print/other output.</comment> - <add>1.1</add> - </field> - <field> - <name>nick_name</name> - <title>Nickname</title> - <type>varchar</type> - <length>128</length> - <size>BIG</size> - <import>true</import> - <headerPattern>/n(ick\s)name|nick$/i</headerPattern> - <dataPattern>/^\w+$/</dataPattern> - <comment>Nickname.</comment> - <fulltext/> - <add>1.1</add> - </field> - <field> - <name>legal_name</name> - <type>varchar</type> - <length>128</length> - <size>BIG</size> - <import>true</import> - <headerPattern>/^legal|(l(egal\s)?name)$/i</headerPattern> - <comment>Legal Name.</comment> - <fulltext/> - <add>1.1</add> - </field> - <field> - <name>home_URL</name> - <rule>url</rule> - <title>Website</title> - <type>varchar</type> - <length>128</length> - <size>BIG</size> - <import>true</import> - <headerPattern>/^(home\sURL)|URL|web|site/i</headerPattern> - <dataPattern>/^[\w\/\:\.]+$/</dataPattern> - <comment>optional "home page" URL for this contact.</comment> - <add>1.1</add> - <drop>3.2</drop> - </field> - <field> - <name>image_URL</name> - <type>varchar</type> - <length>255</length> - <import>true</import> - <comment>optional URL for preferred image (photo, logo, etc.) to display for this contact.</comment> - <add>1.1</add> - </field> - <field> - <name>preferred_communication_method</name> - <title>Preferred Communication Method</title> - <type>varchar</type> - <length>255</length> - <import>true</import> - <headerPattern>/^p(ref\w*\s)?c(omm\w*)|( meth\w*)$/i</headerPattern> - <dataPattern>/^\w+$/</dataPattern> - <comment>What is the preferred mode of communication.</comment> - <add>1.1</add> - <pseudoconstant> - <optionGroupName>preferred_communication_method</optionGroupName> - </pseudoconstant> + <name>display_name</name> + <title>Display Name</title> + <type>varchar</type> + <length>128</length> + <size>BIG</size> + <export>true</export> + <comment>Formatted name representing preferred format for display/print/other output.</comment> + <add>1.1</add> + </field> + <field> + <name>nick_name</name> + <title>Nickname</title> + <type>varchar</type> + <length>128</length> + <size>BIG</size> + <import>true</import> + <headerPattern>/n(ick\s)name|nick$/i</headerPattern> + <dataPattern>/^\w+$/</dataPattern> + <comment>Nickname.</comment> + <fulltext/> + <add>1.1</add> + </field> + <field> + <name>legal_name</name> + <type>varchar</type> + <length>128</length> + <size>BIG</size> + <import>true</import> + <headerPattern>/^legal|(l(egal\s)?name)$/i</headerPattern> + <comment>Legal Name.</comment> + <fulltext/> + <add>1.1</add> + </field> + <field> + <name>home_URL</name> + <rule>url</rule> + <title>Website</title> + <type>varchar</type> + <length>128</length> + <size>BIG</size> + <import>true</import> + <headerPattern>/^(home\sURL)|URL|web|site/i</headerPattern> + <dataPattern>/^[\w\/\:\.]+$/</dataPattern> + <comment>optional "home page" URL for this contact.</comment> + <add>1.1</add> + <drop>3.2</drop> + </field> + <field> + <name>image_URL</name> + <type>varchar</type> + <length>255</length> + <import>true</import> + <comment>optional URL for preferred image (photo, logo, etc.) to display for this contact.</comment> + <add>1.1</add> + </field> + <field> + <name>preferred_communication_method</name> + <title>Preferred Communication Method</title> + <type>varchar</type> + <length>255</length> + <import>true</import> + <headerPattern>/^p(ref\w*\s)?c(omm\w*)|( meth\w*)$/i</headerPattern> + <dataPattern>/^\w+$/</dataPattern> + <comment>What is the preferred mode of communication.</comment> + <add>1.1</add> + <pseudoconstant> + <optionGroupName>preferred_communication_method</optionGroupName> + </pseudoconstant> </field> <index> - <name>index_preferred_communication_method</name> - <fieldName>preferred_communication_method</fieldName> - <add>1.6</add> + <name>index_preferred_communication_method</name> + <fieldName>preferred_communication_method</fieldName> + <add>1.6</add> </index> <field> - <name>preferred_language</name> - <title>Preferred Language</title> - <type>varchar</type> - <length>5</length> - <comment>Which language is preferred for communication. FK to languages in civicrm_option_value.</comment> - <headerPattern>/^lang/i</headerPattern> - <import>true</import> - <pseudoconstant> - <optionGroupName>languages</optionGroupName> - <keyColumn>name</keyColumn> - </pseudoconstant> - <add>3.2</add> - </field> - <field> - <name>preferred_mail_format</name> - <type>enum</type> - <values>Text, HTML, Both</values> - <default>"Both"</default> - <import>true</import> - <headerPattern>/^p(ref\w*\s)?m(ail\s)?f(orm\w*)$/i</headerPattern> - <comment>What is the preferred mode of sending an email.</comment> - <add>1.1</add> - </field> - <field> - <name>hash</name> - <title>Contact Hash</title> - <type>varchar</type> - <length>32</length> - <comment>Key for validating requests related to this contact.</comment> - <add>1.1</add> - <change>1.5</change> - <export>true</export> + <name>preferred_language</name> + <title>Preferred Language</title> + <type>varchar</type> + <length>5</length> + <comment>Which language is preferred for communication. FK to languages in civicrm_option_value.</comment> + <headerPattern>/^lang/i</headerPattern> + <import>true</import> + <pseudoconstant> + <optionGroupName>languages</optionGroupName> + <keyColumn>name</keyColumn> + </pseudoconstant> + <add>3.2</add> + </field> + <field> + <name>preferred_mail_format</name> + <type>enum</type> + <values>Text, HTML, Both</values> + <default>"Both"</default> + <import>true</import> + <headerPattern>/^p(ref\w*\s)?m(ail\s)?f(orm\w*)$/i</headerPattern> + <comment>What is the preferred mode of sending an email.</comment> + <add>1.1</add> + </field> + <field> + <name>hash</name> + <title>Contact Hash</title> + <type>varchar</type> + <length>32</length> + <comment>Key for validating requests related to this contact.</comment> + <add>1.1</add> + <change>1.5</change> + <export>true</export> </field> <index> - <name>index_hash</name> - <fieldName>hash</fieldName> - <add>2.1</add> + <name>index_hash</name> + <fieldName>hash</fieldName> + <add>2.1</add> </index> <field> - <name>api_key</name> - <type>varchar</type> - <length>32</length> - <comment>API Key for validating requests related to this contact.</comment> - <add>2.2</add> + <name>api_key</name> + <type>varchar</type> + <length>32</length> + <comment>API Key for validating requests related to this contact.</comment> + <add>2.2</add> </field> <index> - <name>index_api_key</name> - <fieldName>api_key</fieldName> - <add>2.1</add> + <name>index_api_key</name> + <fieldName>api_key</fieldName> + <add>2.1</add> </index> <field> - <name>source</name> - <title>Source of Contact Data</title> - <uniqueName>contact_source</uniqueName> - <type>varchar</type> - <length>255</length> - <size>BIG</size> - <import>true</import> - <headerPattern>/(S(ource\s)?o(f\s)?C(ontact\s)?Data)$/i</headerPattern> - <comment>where contact come from, e.g. import, donate module insert...</comment> - <add>1.1</add> - </field> - <field> - <name>first_name</name> - <type>varchar</type> - <length>64</length> - <size>BIG</size> - <import>true</import> - <headerPattern>/^first|(f(irst\s)?name)$/i</headerPattern> - <dataPattern>/^\w+$/</dataPattern> - <fulltext/> - <comment>First Name.</comment> - <add>1.1</add> + <name>source</name> + <title>Source of Contact Data</title> + <uniqueName>contact_source</uniqueName> + <type>varchar</type> + <length>255</length> + <size>BIG</size> + <import>true</import> + <headerPattern>/(S(ource\s)?o(f\s)?C(ontact\s)?Data)$/i</headerPattern> + <comment>where contact come from, e.g. import, donate module insert...</comment> + <add>1.1</add> + </field> + <field> + <name>first_name</name> + <type>varchar</type> + <length>64</length> + <size>BIG</size> + <import>true</import> + <headerPattern>/^first|(f(irst\s)?name)$/i</headerPattern> + <dataPattern>/^\w+$/</dataPattern> + <fulltext/> + <comment>First Name.</comment> + <add>1.1</add> </field> <index> - <name>index_first_name</name> - <fieldName>first_name</fieldName> - <add>1.8</add> + <name>index_first_name</name> + <fieldName>first_name</fieldName> + <add>1.8</add> </index> <field> - <name>middle_name</name> - <type>varchar</type> - <length>64</length> - <size>MEDIUM</size> - <import>true</import> - <headerPattern>/^middle|(m(iddle\s)?name)$/i</headerPattern> - <dataPattern>/^\w+$/</dataPattern> - <fulltext/> - <comment>Middle Name.</comment> - <add>1.1</add> - </field> - <field> - <name>last_name</name> - <type>varchar</type> - <length>64</length> - <size>BIG</size> - <import>true</import> - <headerPattern>/^last|(l(ast\s)?name)$/i</headerPattern> - <dataPattern>/^\w+(\s\w+)?+$/</dataPattern> - <comment>Last Name.</comment> - <fulltext/> - <add>1.1</add> + <name>middle_name</name> + <type>varchar</type> + <length>64</length> + <size>MEDIUM</size> + <import>true</import> + <headerPattern>/^middle|(m(iddle\s)?name)$/i</headerPattern> + <dataPattern>/^\w+$/</dataPattern> + <fulltext/> + <comment>Middle Name.</comment> + <add>1.1</add> + </field> + <field> + <name>last_name</name> + <type>varchar</type> + <length>64</length> + <size>BIG</size> + <import>true</import> + <headerPattern>/^last|(l(ast\s)?name)$/i</headerPattern> + <dataPattern>/^\w+(\s\w+)?+$/</dataPattern> + <comment>Last Name.</comment> + <fulltext/> + <add>1.1</add> </field> <index> - <name>index_last_name</name> - <fieldName>last_name</fieldName> - <add>1.8</add> + <name>index_last_name</name> + <fieldName>last_name</fieldName> + <add>1.8</add> </index> <field> - <name>prefix_id</name> - <uniqueName>individual_prefix</uniqueName> - <title>Individual Prefix</title> - <type>int unsigned</type> - <comment>Prefix or Title for name (Ms, Mr...). FK to prefix ID</comment> - <pseudoconstant> - <optionGroupName>individual_prefix</optionGroupName> - </pseudoconstant> - <headerPattern>/^(prefix|title)/i</headerPattern> - <dataPattern>/^(mr|ms|mrs|sir|dr)\.?$/i</dataPattern> - <import>true</import> - <add>1.2</add> + <name>prefix_id</name> + <title>Individual Prefix</title> + <type>int unsigned</type> + <comment>Prefix or Title for name (Ms, Mr...). FK to prefix ID</comment> + <pseudoconstant> + <optionGroupName>individual_prefix</optionGroupName> + </pseudoconstant> + <headerPattern>/^(prefix|title)/i</headerPattern> + <dataPattern>/^(mr|ms|mrs|sir|dr)\.?$/i</dataPattern> + <import>true</import> + <add>1.2</add> </field> <index> - <name>UI_prefix</name> - <fieldName>prefix_id</fieldName> - <add>1.6</add> + <name>UI_prefix</name> + <fieldName>prefix_id</fieldName> + <add>1.6</add> </index> <field> - <name>suffix_id</name> - <uniqueName>individual_suffix</uniqueName> - <title>Individual Suffix</title> - <type>int unsigned</type> - <pseudoconstant> - <optionGroupName>individual_suffix</optionGroupName> - </pseudoconstant> - <import>true</import> - <comment>Suffix for name (Jr, Sr...). FK to suffix ID</comment> - <headerPattern>/^suffix$/i</headerPattern> - <dataPattern>/^(sr|jr)\.?|i{2,}$/</dataPattern> - <add>1.2</add> + <name>suffix_id</name> + <title>Individual Suffix</title> + <type>int unsigned</type> + <pseudoconstant> + <optionGroupName>individual_suffix</optionGroupName> + </pseudoconstant> + <import>true</import> + <comment>Suffix for name (Jr, Sr...). FK to suffix ID</comment> + <headerPattern>/^suffix$/i</headerPattern> + <dataPattern>/^(sr|jr)\.?|i{2,}$/</dataPattern> + <add>1.2</add> </field> <index> - <name>UI_suffix</name> - <fieldName>suffix_id</fieldName> - <add>1.6</add> + <name>UI_suffix</name> + <fieldName>suffix_id</fieldName> + <add>1.6</add> </index> <field> - <name>greeting_type</name> - <type>varchar</type> - <length>128</length> - <import>true</import> - <comment>Preferred greeting format.</comment> - <add>1.1</add> - <drop>2.2</drop> - </field> - <field> - <name>greeting_type_id</name> - <title>Greeting Type</title> - <type>int unsigned</type> - <comment>FK to civicrm_option_value.id, that has to be valid, registered Greeting type.</comment> - <add>2.2</add> - <drop>3.0</drop> - </field> - <field> - <name>custom_greeting</name> - <type>varchar</type> - <length>128</length> - <import>true</import> - <comment>Custom greeting message.</comment> - <add>1.1</add> - <drop>3.0</drop> - </field> - <field> - <name>email_greeting_id</name> - <type>int unsigned</type> - <title>Email Greeting ID</title> - <comment>FK to civicrm_option_value.id, that has to be valid registered Email Greeting.</comment> - <add>3.0</add> - </field> - <field> - <name>email_greeting_custom</name> - <type>varchar</type> - <length>128</length> - <import>true</import> - <export>false</export> - <comment>Custom Email Greeting.</comment> - <add>3.0</add> - </field> - <field> - <name>email_greeting_display</name> - <title>Email Greeting</title> - <type>varchar</type> - <length>255</length> - <comment>Cache Email Greeting.</comment> - <add>3.0</add> - </field> - <field> - <name>postal_greeting_id</name> - <type>int unsigned</type> - <title>Postal Greeting ID</title> - <comment>FK to civicrm_option_value.id, that has to be valid registered Postal Greeting.</comment> - <add>3.0</add> - </field> - <field> - <name>postal_greeting_custom</name> - <type>varchar</type> - <length>128</length> - <import>true</import> - <export>false</export> - <comment>Custom Postal greeting.</comment> - <add>3.0</add> - </field> - <field> - <name>postal_greeting_display</name> - <title>Postal Greeting</title> - <type>varchar</type> - <length>255</length> - <comment>Cache Postal greeting.</comment> - <add>3.0</add> - </field> - <field> - <name>addressee_id</name> - <type>int unsigned</type> - <title>Addressee ID</title> - <comment>FK to civicrm_option_value.id, that has to be valid registered Addressee.</comment> - <add>3.0</add> - </field> - <field> - <name>addressee_custom</name> - <type>varchar</type> - <length>128</length> - <import>true</import> - <export>false</export> - <comment>Custom Addressee.</comment> - <add>3.0</add> - </field> - <field> - <name>addressee_display</name> - <title>Addressee</title> - <type>varchar</type> - <length>255</length> - <comment>Cache Addressee.</comment> - <add>3.0</add> - </field> - <field> - <name>job_title</name> - <type>varchar</type> - <length>255</length> - <size>MEDIUM</size> - <import>true</import> - <headerPattern>/^job|(j(ob\s)?title)$/i</headerPattern> - <dataPattern>//</dataPattern> - <comment>Job Title</comment> - <add>1.1</add> - </field> + <name>greeting_type</name> + <type>varchar</type> + <length>128</length> + <import>true</import> + <comment>Preferred greeting format.</comment> + <add>1.1</add> + <drop>2.2</drop> + </field> <field> - <name>gender_id</name> - <uniqueName>gender</uniqueName> - <title>Gender</title> - <type>int unsigned</type> - <pseudoconstant> - <optionGroupName>gender</optionGroupName> - </pseudoconstant> - <headerPattern>/^gender$/i</headerPattern> - <comment>FK to gender ID</comment> - <import>true</import> - <add>1.2</add> + <name>greeting_type_id</name> + <title>Greeting Type</title> + <type>int unsigned</type> + <comment>FK to civicrm_option_value.id, that has to be valid, registered Greeting type.</comment> + <add>2.2</add> + <drop>3.0</drop> + </field> + <field> + <name>custom_greeting</name> + <type>varchar</type> + <length>128</length> + <import>true</import> + <comment>Custom greeting message.</comment> + <add>1.1</add> + <drop>3.0</drop> + </field> + <field> + <name>email_greeting_id</name> + <type>int unsigned</type> + <title>Email Greeting ID</title> + <comment>FK to civicrm_option_value.id, that has to be valid registered Email Greeting.</comment> + <add>3.0</add> + </field> + <field> + <name>email_greeting_custom</name> + <type>varchar</type> + <length>128</length> + <import>true</import> + <export>false</export> + <comment>Custom Email Greeting.</comment> + <add>3.0</add> + </field> + <field> + <name>email_greeting_display</name> + <title>Email Greeting</title> + <type>varchar</type> + <length>255</length> + <comment>Cache Email Greeting.</comment> + <add>3.0</add> + </field> + <field> + <name>postal_greeting_id</name> + <type>int unsigned</type> + <title>Postal Greeting ID</title> + <comment>FK to civicrm_option_value.id, that has to be valid registered Postal Greeting.</comment> + <add>3.0</add> + </field> + <field> + <name>postal_greeting_custom</name> + <type>varchar</type> + <length>128</length> + <import>true</import> + <export>false</export> + <comment>Custom Postal greeting.</comment> + <add>3.0</add> + </field> + <field> + <name>postal_greeting_display</name> + <title>Postal Greeting</title> + <type>varchar</type> + <length>255</length> + <comment>Cache Postal greeting.</comment> + <add>3.0</add> + </field> + <field> + <name>addressee_id</name> + <type>int unsigned</type> + <title>Addressee ID</title> + <comment>FK to civicrm_option_value.id, that has to be valid registered Addressee.</comment> + <add>3.0</add> + </field> + <field> + <name>addressee_custom</name> + <type>varchar</type> + <length>128</length> + <import>true</import> + <export>false</export> + <comment>Custom Addressee.</comment> + <add>3.0</add> + </field> + <field> + <name>addressee_display</name> + <title>Addressee</title> + <type>varchar</type> + <length>255</length> + <comment>Cache Addressee.</comment> + <add>3.0</add> + </field> + <field> + <name>job_title</name> + <type>varchar</type> + <length>255</length> + <size>MEDIUM</size> + <import>true</import> + <headerPattern>/^job|(j(ob\s)?title)$/i</headerPattern> + <dataPattern>//</dataPattern> + <comment>Job Title</comment> + <add>1.1</add> + </field> + <field> + <name>gender_id</name> + <title>Gender</title> + <type>int unsigned</type> + <pseudoconstant> + <optionGroupName>gender</optionGroupName> + </pseudoconstant> + <headerPattern>/^gender$/i</headerPattern> + <comment>FK to gender ID</comment> + <import>true</import> + <add>1.2</add> </field> <index> - <name>UI_gender</name> - <fieldName>gender_id</fieldName> - <add>1.6</add> + <name>UI_gender</name> + <fieldName>gender_id</fieldName> + <add>1.6</add> </index> <field> - <name>birth_date</name> - <type>date</type> - <import>true</import> - <headerPattern>/^birth|(b(irth\s)?date)|D(\W*)O(\W*)B(\W*)$/i</headerPattern> - <dataPattern>/\d{4}-?\d{2}-?\d{2}/</dataPattern> - <comment>Date of birth</comment> - <add>1.1</add> - </field> - <field> - <name>is_deceased</name> - <title>Is Deceased</title> - <import>true</import> - <export>true</export> - <headerPattern>/i(s\s)?d(eceased)$/i</headerPattern> - <type>boolean</type> - <default>0</default> - <add>1.1</add> - </field> - <field> - <name>deceased_date</name> - <type>date</type> - <import>true</import> - <export>true</export> - <headerPattern>/^deceased|(d(eceased\s)?date)$/i</headerPattern> - <comment>Date of deceased</comment> - <add>1.5</add> - </field> - <field> - <name>mail_to_household_id</name> - <title>Mail to Household ID</title> - <type>int unsigned</type> - <comment>OPTIONAL FK to civicrm_contact_household record. If NOT NULL, direct mail communications to household - rather than individual location. - </comment> - <export>true</export> - <add>1.1</add> - <drop>3.3</drop> + <name>birth_date</name> + <type>date</type> + <import>true</import> + <headerPattern>/^birth|(b(irth\s)?date)|D(\W*)O(\W*)B(\W*)$/i</headerPattern> + <dataPattern>/\d{4}-?\d{2}-?\d{2}/</dataPattern> + <comment>Date of birth</comment> + <add>1.1</add> + </field> + <field> + <name>is_deceased</name> + <title>Is Deceased</title> + <import>true</import> + <export>true</export> + <headerPattern>/i(s\s)?d(eceased)$/i</headerPattern> + <type>boolean</type> + <default>0</default> + <add>1.1</add> + </field> + <field> + <name>deceased_date</name> + <type>date</type> + <import>true</import> + <export>true</export> + <headerPattern>/^deceased|(d(eceased\s)?date)$/i</headerPattern> + <comment>Date of deceased</comment> + <add>1.5</add> + </field> + <field> + <name>mail_to_household_id</name> + <title>Mail to Household ID</title> + <type>int unsigned</type> + <comment>OPTIONAL FK to civicrm_contact_household record. If NOT NULL, direct mail communications to household rather than individual location.</comment> + <export>true</export> + <add>1.1</add> + <drop>3.3</drop> </field> <foreignKey> - <name>mail_to_household_id</name> - <table>civicrm_contact</table> - <key>id</key> - <add>2.1</add> - <onDelete>SET NULL</onDelete> - <drop>3.3</drop> + <name>mail_to_household_id</name> + <table>civicrm_contact</table> + <key>id</key> + <add>2.1</add> + <onDelete>SET NULL</onDelete> + <drop>3.3</drop> </foreignKey> <field> - <name>household_name</name> - <type>varchar</type> - <length>128</length> - <size>BIG</size> - <import>true</import> - <headerPattern>/^household|(h(ousehold\s)?name)$/i</headerPattern> - <dataPattern>/^\w+$/</dataPattern> - <comment>Household Name.</comment> - <fulltext/> - <add>1.1</add> + <name>household_name</name> + <type>varchar</type> + <length>128</length> + <size>BIG</size> + <import>true</import> + <headerPattern>/^household|(h(ousehold\s)?name)$/i</headerPattern> + <dataPattern>/^\w+$/</dataPattern> + <comment>Household Name.</comment> + <fulltext/> + <add>1.1</add> </field> <index> - <name>index_household_name</name> - <fieldName>household_name</fieldName> - <add>1.8</add> + <name>index_household_name</name> + <fieldName>household_name</fieldName> + <add>1.8</add> </index> <field> - <name>primary_contact_id</name> - <type>int unsigned</type> - <title>Household Primary Contact ID</title> - <comment>Optional FK to Primary Contact for this household.</comment> - <add>1.1</add> + <name>primary_contact_id</name> + <type>int unsigned</type> + <title>Household Primary Contact ID</title> + <comment>Optional FK to Primary Contact for this household.</comment> + <add>1.1</add> </field> <foreignKey> - <name>primary_contact_id</name> - <table>civicrm_contact</table> - <key>id</key> - <add>1.1</add> - <onDelete>SET NULL</onDelete> + <name>primary_contact_id</name> + <table>civicrm_contact</table> + <key>id</key> + <add>1.1</add> + <onDelete>SET NULL</onDelete> </foreignKey> <field> - <name>organization_name</name> - <type>varchar</type> - <length>128</length> - <size>BIG</size> - <import>true</import> - <headerPattern>/^organization|(o(rganization\s)?name)$/i</headerPattern> - <dataPattern>/^\w+$/</dataPattern> - <comment>Organization Name.</comment> - <fulltext/> - <add>1.1</add> + <name>organization_name</name> + <type>varchar</type> + <length>128</length> + <size>BIG</size> + <import>true</import> + <headerPattern>/^organization|(o(rganization\s)?name)$/i</headerPattern> + <dataPattern>/^\w+$/</dataPattern> + <comment>Organization Name.</comment> + <fulltext/> + <add>1.1</add> </field> <index> - <name>index_organization_name</name> - <fieldName>organization_name</fieldName> - <add>1.8</add> + <name>index_organization_name</name> + <fieldName>organization_name</fieldName> + <add>1.8</add> </index> <field> - <name>sic_code</name> - <type>varchar</type> - <length>8</length> - <import>true</import> - <headerPattern>/^sic|(s(ic\s)?code)$/i</headerPattern> - <comment>Standard Industry Classification Code.</comment> - <add>1.1</add> - </field> - <field> - <name>user_unique_id</name> - <rule>url</rule> - <title>Unique ID (OpenID)</title> - <type>varchar</type> - <length>255</length> - <import>true</import> - <headerPattern>/^Open\s?ID|u(niq\w*)?\s?ID/i</headerPattern> - <dataPattern>/^[\w\/\:\.]+$/</dataPattern> - <comment>the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for - logging in to CiviCRM - </comment> - <add>2.0</add> - </field> - <field> - <name>employer_id</name> - <title>Current Employer ID</title> - <uniqueName>current_employer_id</uniqueName> - <type>int unsigned</type> - <comment>OPTIONAL FK to civicrm_contact record.</comment> - <export>true</export> - <add>2.1</add> + <name>sic_code</name> + <type>varchar</type> + <length>8</length> + <import>true</import> + <headerPattern>/^sic|(s(ic\s)?code)$/i</headerPattern> + <comment>Standard Industry Classification Code.</comment> + <add>1.1</add> + </field> + <field> + <name>user_unique_id</name> + <rule>url</rule> + <title>Unique ID (OpenID)</title> + <type>varchar</type> + <length>255</length> + <import>true</import> + <headerPattern>/^Open\s?ID|u(niq\w*)?\s?ID/i</headerPattern> + <dataPattern>/^[\w\/\:\.]+$/</dataPattern> + <comment>the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM</comment> + <add>2.0</add> + </field> + <field> + <name>employer_id</name> + <title>Current Employer ID</title> + <uniqueName>current_employer_id</uniqueName> + <type>int unsigned</type> + <comment>OPTIONAL FK to civicrm_contact record.</comment> + <export>true</export> + <add>2.1</add> </field> <foreignKey> - <name>employer_id</name> - <table>civicrm_contact</table> - <key>id</key> - <add>2.1</add> - <onDelete>SET NULL</onDelete> + <name>employer_id</name> + <table>civicrm_contact</table> + <key>id</key> + <add>2.1</add> + <onDelete>SET NULL</onDelete> </foreignKey> <field> <name>is_deleted</name>