From 827659b2a95b3a5b4e1ffa2c79b477abc747fd74 Mon Sep 17 00:00:00 2001 From: kurund Date: Wed, 21 Aug 2013 15:22:37 +0530 Subject: [PATCH] CRM-13161, added unique names for prefix_id, gender_id and suffix_id, also code cleanup and related fixes ---------------------------------------- * CRM-13161: Greetings are not evaluated correctly if it includes prefix / suffix http://issues.civicrm.org/jira/browse/CRM-13161 --- CRM/Contact/BAO/Contact.php | 24 +- CRM/Contact/BAO/Query.php | 68 +- CRM/Core/BAO/UFGroup.php | 13 +- CRM/Profile/Selector/Listings.php | 3 - xml/schema/Contact/Contact.xml | 1098 +++++++++++++++-------------- 5 files changed, 625 insertions(+), 581 deletions(-) diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index e1ae8f5d4e..603dd4e12a 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_id', - 'prefix_id', - 'suffix_id', + 'gender', + 'individual_prefix', + 'individual_suffix', 'birth_date', 'organization_name', 'legal_name', @@ -1205,9 +1205,9 @@ WHERE id={$id}; "; 'middle_name', 'last_name', 'job_title', - 'gender_id', - 'prefix_id', - 'suffix_id', + 'gender', + 'individual_prefix', + 'individual_suffix', 'birth_date', 'household_name', 'is_deceased', @@ -1443,9 +1443,9 @@ WHERE id={$id}; "; 'middle_name', 'last_name', 'job_title', - 'gender_id', - 'prefix_id', - 'suffix_id', + 'gender', + 'individual_prefix', + 'individual_suffix', 'birth_date', 'organization_name', 'legal_name', @@ -1466,9 +1466,9 @@ WHERE id={$id}; "; 'middle_name', 'last_name', 'job_title', - 'gender_id', - 'prefix_id', - 'suffix_id', + 'gender', + 'individual_prefix', + 'individual_suffix', 'birth_date', 'household_name', 'email_greeting_custom', diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 0485f70ff0..fb4e52c37a 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -711,13 +711,22 @@ 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"; @@ -747,14 +756,26 @@ 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 ($fieldName == 'prefix_id') { - $this->_pseudoConstantsSelect['individual_prefix'] = array('pseudoField' => 'prefix_id', 'idCol' => "prefix_id", 'bao' => 'CRM_Contact_BAO_Contact'); + if ($name == 'individual_prefix') { + $this->_pseudoConstantsSelect['individual_prefix'] = array( + 'pseudoField' => 'prefix_id', + 'idCol' => "individual_prefix", + '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 == 'individual_suffix') { + $this->_pseudoConstantsSelect['individual_suffix'] = array( + 'pseudoField' => 'suffix_id', + 'idCol' => "individual_suffix", + 'bao' => 'CRM_Contact_BAO_Contact' + ); } - if ($fieldName == 'gender_id') { - $this->_pseudoConstantsSelect['gender'] = array('pseudoField' => 'gender_id', 'idCol' => "gender_id", 'bao' => 'CRM_Contact_BAO_Contact'); + if ($name == 'gender') { + $this->_pseudoConstantsSelect['gender'] = array( + 'pseudoField' => 'gender_id', + 'idCol' => "gender", + 'bao' => 'CRM_Contact_BAO_Contact' + ); } $this->_select[$name] = "contact_a.{$fieldName} as `$name`"; } @@ -1820,6 +1841,12 @@ 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; } @@ -3827,7 +3854,6 @@ 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'); @@ -3981,10 +4007,10 @@ civicrm_relationship.start_date > {$today} 'first_name' => 1, 'middle_name' => 1, 'last_name' => 1, - 'prefix_id' => 1, - 'suffix_id' => 1, + 'individual_prefix' => 1, + 'individual_suffix' => 1, 'birth_date' => 1, - 'gender_id' => 1, + 'gender' => 1, 'street_address' => 1, 'supplemental_address_1' => 1, 'supplemental_address_2' => 1, @@ -5006,7 +5032,14 @@ AND displayRelType.is_active = 1 $qill = $value; } - $pseudoFields = array('email_greeting', 'postal_greeting', 'addressee', 'gender_id', 'prefix_id', 'suffix_id'); + $pseudoFields = array( + 'email_greeting', + 'postal_greeting', + 'addressee', + 'gender', + 'individual_prefix', + 'individual_suffix', + ); if (is_numeric($value)) { $qill = $selectValues[(int ) $value]; @@ -5040,7 +5073,7 @@ AND displayRelType.is_active = 1 } if (in_array($name, $pseudoFields)) { - if (!in_array($name, array('gender_id', 'prefix_id', 'suffix_id'))) { + if (!in_array($name, array('gender', 'individual_prefix', 'individual_suffix'))) { $wc = "contact_a.{$name}_id"; } $dataType = 'Positive'; @@ -5115,6 +5148,9 @@ AND displayRelType.is_active = 1 $dao->$key = NULL; } elseif ($baoName = CRM_Utils_Array::value('bao', $value, NULL)) { + //preserve id value + $idColumn = "{$key}_id"; + $dao->$idColumn = $val; $dao->$key = CRM_Core_PseudoConstant::getLabel($baoName, $value['pseudoField'], $val); } elseif ($value['pseudoField'] == 'state_province_abbreviation') { diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index 7b9e18cf99..149b02f630 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -949,9 +949,10 @@ 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, 0, -3), array('gender', 'prefix', 'suffix'))) { - $values[$index] = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', $name, $details->$name); - $params[$index] = $details->$name; + if (in_array(substr($name, -6), array('gender', 'prefix', 'suffix'))) { + $values[$index] = $details->$name; + $idColumn = "{$name}_id"; + $params[$index] = $details->$idColumn; } elseif (in_array($name, CRM_Contact_BAO_Contact::$_greetingTypes)) { $dname = $name . '_display'; @@ -1846,7 +1847,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) '' => ts('- select -')) + CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label'), $required ); } - elseif ($fieldName === 'gender_id') { + elseif ($fieldName === 'gender') { $genderOptions = array(); $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'); foreach ($gender as $key => $var) { @@ -1857,13 +1858,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 === 'prefix_id') { + elseif ($fieldName === 'individual_prefix') { $form->add('select', $name, $title, array( '' => ts('- select -')) + CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'prefix_id'), $required ); } - elseif ($fieldName === 'suffix_id') { + elseif ($fieldName === 'individual_suffix') { $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 39fd3d4de5..7046fb14dc 100644 --- a/CRM/Profile/Selector/Listings.php +++ b/CRM/Profile/Selector/Listings.php @@ -618,9 +618,6 @@ 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/xml/schema/Contact/Contact.xml b/xml/schema/Contact/Contact.xml index 6c90dc3b98..ed1afdfea8 100644 --- a/xml/schema/Contact/Contact.xml +++ b/xml/schema/Contact/Contact.xml @@ -7,107 +7,107 @@ Contact objects are defined by a civicrm_contact record plus a related civicrm_contact_type record. 1.1 true - - id - int unsigned - Internal Contact ID - true - /internal|contact?|id$/i - true - Unique Contact ID - 1.1 + + id + int unsigned + Internal Contact ID + true + /internal|contact?|id$/i + true + Unique Contact ID + 1.1 - id - true + id + true - contact_type - Contact Type - varchar - 64 - Type of Contact. - true - - civicrm_contact_type
- name - label - parent_id IS NULL -
- 1.1 - 3.1 + contact_type + Contact Type + varchar + 64 + Type of Contact. + true + + civicrm_contact_type
+ name + label + parent_id IS NULL +
+ 1.1 + 3.1
- index_contact_type - contact_type - 2.1 + index_contact_type + contact_type + 2.1 - contact_sub_type - Contact Subtype - varchar - 255 - true - true - /C(ontact )?(subtype|sub-type|sub type)/i - May be used to over-ride contact view and edit templates. - - civicrm_contact_type
- name - label - parent_id IS NOT NULL -
- 1.5 + contact_sub_type + Contact Subtype + varchar + 255 + true + true + /C(ontact )?(subtype|sub-type|sub type)/i + May be used to over-ride contact view and edit templates. + + civicrm_contact_type
+ name + label + parent_id IS NOT NULL +
+ 1.5
- index_contact_sub_type - contact_sub_type - 2.1 + index_contact_sub_type + contact_sub_type + 2.1 - do_not_email - boolean - true - /d(o )?(not )?(email)/i - /^\d{1,}$/ - 0 - 1.1 - - - do_not_phone - boolean - 0 - true - /d(o )?(not )?(call|phone)/i - /^\d{1,}$/ - 1.1 - - - do_not_mail - boolean - true - /^(d(o\s)?n(ot\s)?mail)|(\w*)?bulk\s?(\w*)$/i - /^\d{1,}$/ - 0 - 1.1 - - - do_not_sms - boolean - true - /d(o )?(not )?(sms)/i - /^\d{1,}$/ - 0 - 3.0 - - - do_not_trade - boolean - true - /d(o )?(not )?(trade)/i - /^\d{1,}$/ - 0 - 1.1 + do_not_email + boolean + true + /d(o )?(not )?(email)/i + /^\d{1,}$/ + 0 + 1.1 + + + do_not_phone + boolean + 0 + true + /d(o )?(not )?(call|phone)/i + /^\d{1,}$/ + 1.1 + + + do_not_mail + boolean + true + /^(d(o\s)?n(ot\s)?mail)|(\w*)?bulk\s?(\w*)$/i + /^\d{1,}$/ + 0 + 1.1 + + + do_not_sms + boolean + true + /d(o )?(not )?(sms)/i + /^\d{1,}$/ + 0 + 3.0 + + + do_not_trade + boolean + true + /d(o )?(not )?(trade)/i + /^\d{1,}$/ + 0 + 1.1 is_opt_out @@ -120,522 +120,532 @@ 1.1 - legal_identifier - varchar - 32 - true - /legal\s?id/i - /\w+?\d{5,}/ - May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID. - 1.1 + legal_identifier + varchar + 32 + true + /legal\s?id/i + /\w+?\d{5,}/ + May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID. + + 1.1 - external_identifier - varchar - 32 - EIGHT - true - /external\s?id/i - /^\d{11,}$/ - Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations. - 1.1 + external_identifier + varchar + 32 + EIGHT + true + /external\s?id/i + /^\d{11,}$/ + Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping + operations. + + 1.1 - UI_external_identifier - true - external_identifier - 1.7 + UI_external_identifier + true + external_identifier + 1.7 - sort_name - Sort Name - varchar - 128 - BIG - true - Name used for sorting different contact types - 1.1 + sort_name + Sort Name + varchar + 128 + BIG + true + Name used for sorting different contact types + 1.1 - index_sort_name - sort_name - 2.1 + index_sort_name + sort_name + 2.1 - display_name - Display Name - varchar - 128 - BIG - true - Formatted name representing preferred format for display/print/other output. - 1.1 - - - nick_name - Nickname - varchar - 128 - BIG - true - /n(ick\s)name|nick$/i - /^\w+$/ - Nickname. - - 1.1 - - - legal_name - varchar - 128 - BIG - true - /^legal|(l(egal\s)?name)$/i - Legal Name. - - 1.1 - - - home_URL - url - Website - varchar - 128 - BIG - true - /^(home\sURL)|URL|web|site/i - /^[\w\/\:\.]+$/ - optional "home page" URL for this contact. - 1.1 - 3.2 - - - image_URL - varchar - 255 - true - optional URL for preferred image (photo, logo, etc.) to display for this contact. - 1.1 - - - preferred_communication_method - Preferred Communication Method - varchar - 255 - true - /^p(ref\w*\s)?c(omm\w*)|( meth\w*)$/i - /^\w+$/ - What is the preferred mode of communication. - 1.1 - - preferred_communication_method - + display_name + Display Name + varchar + 128 + BIG + true + Formatted name representing preferred format for display/print/other output. + 1.1 + + + nick_name + Nickname + varchar + 128 + BIG + true + /n(ick\s)name|nick$/i + /^\w+$/ + Nickname. + + 1.1 + + + legal_name + varchar + 128 + BIG + true + /^legal|(l(egal\s)?name)$/i + Legal Name. + + 1.1 + + + home_URL + url + Website + varchar + 128 + BIG + true + /^(home\sURL)|URL|web|site/i + /^[\w\/\:\.]+$/ + optional "home page" URL for this contact. + 1.1 + 3.2 + + + image_URL + varchar + 255 + true + optional URL for preferred image (photo, logo, etc.) to display for this contact. + 1.1 + + + preferred_communication_method + Preferred Communication Method + varchar + 255 + true + /^p(ref\w*\s)?c(omm\w*)|( meth\w*)$/i + /^\w+$/ + What is the preferred mode of communication. + 1.1 + + preferred_communication_method + - index_preferred_communication_method - preferred_communication_method - 1.6 + index_preferred_communication_method + preferred_communication_method + 1.6 - preferred_language - Preferred Language - varchar - 5 - Which language is preferred for communication. FK to languages in civicrm_option_value. - /^lang/i - true - - languages - name - - 3.2 - - - preferred_mail_format - enum - Text, HTML, Both - "Both" - true - /^p(ref\w*\s)?m(ail\s)?f(orm\w*)$/i - What is the preferred mode of sending an email. - 1.1 - - - hash - Contact Hash - varchar - 32 - Key for validating requests related to this contact. - 1.1 - 1.5 - true + preferred_language + Preferred Language + varchar + 5 + Which language is preferred for communication. FK to languages in civicrm_option_value. + /^lang/i + true + + languages + name + + 3.2 + + + preferred_mail_format + enum + Text, HTML, Both + "Both" + true + /^p(ref\w*\s)?m(ail\s)?f(orm\w*)$/i + What is the preferred mode of sending an email. + 1.1 + + + hash + Contact Hash + varchar + 32 + Key for validating requests related to this contact. + 1.1 + 1.5 + true - index_hash - hash - 2.1 + index_hash + hash + 2.1 - api_key - varchar - 32 - API Key for validating requests related to this contact. - 2.2 + api_key + varchar + 32 + API Key for validating requests related to this contact. + 2.2 - index_api_key - api_key - 2.1 + index_api_key + api_key + 2.1 - source - Source of Contact Data - contact_source - varchar - 255 - BIG - true - /(S(ource\s)?o(f\s)?C(ontact\s)?Data)$/i - where contact come from, e.g. import, donate module insert... - 1.1 - - - first_name - varchar - 64 - BIG - true - /^first|(f(irst\s)?name)$/i - /^\w+$/ - - First Name. - 1.1 + source + Source of Contact Data + contact_source + varchar + 255 + BIG + true + /(S(ource\s)?o(f\s)?C(ontact\s)?Data)$/i + where contact come from, e.g. import, donate module insert... + 1.1 + + + first_name + varchar + 64 + BIG + true + /^first|(f(irst\s)?name)$/i + /^\w+$/ + + First Name. + 1.1 - index_first_name - first_name - 1.8 + index_first_name + first_name + 1.8 - middle_name - varchar - 64 - MEDIUM - true - /^middle|(m(iddle\s)?name)$/i - /^\w+$/ - - Middle Name. - 1.1 - - - last_name - varchar - 64 - BIG - true - /^last|(l(ast\s)?name)$/i - /^\w+(\s\w+)?+$/ - Last Name. - - 1.1 + middle_name + varchar + 64 + MEDIUM + true + /^middle|(m(iddle\s)?name)$/i + /^\w+$/ + + Middle Name. + 1.1 + + + last_name + varchar + 64 + BIG + true + /^last|(l(ast\s)?name)$/i + /^\w+(\s\w+)?+$/ + Last Name. + + 1.1 - index_last_name - last_name - 1.8 + index_last_name + last_name + 1.8 - prefix_id - Individual Prefix - int unsigned - Prefix or Title for name (Ms, Mr...). FK to prefix ID - - individual_prefix - - /^(prefix|title)/i - /^(mr|ms|mrs|sir|dr)\.?$/i - true - 1.2 + prefix_id + individual_prefix + Individual Prefix + int unsigned + Prefix or Title for name (Ms, Mr...). FK to prefix ID + + individual_prefix + + /^(prefix|title)/i + /^(mr|ms|mrs|sir|dr)\.?$/i + true + 1.2 - UI_prefix - prefix_id - 1.6 + UI_prefix + prefix_id + 1.6 - suffix_id - Individual Suffix - int unsigned - - individual_suffix - - true - Suffix for name (Jr, Sr...). FK to suffix ID - /^suffix$/i - /^(sr|jr)\.?|i{2,}$/ - 1.2 + suffix_id + individual_suffix + Individual Suffix + int unsigned + + individual_suffix + + true + Suffix for name (Jr, Sr...). FK to suffix ID + /^suffix$/i + /^(sr|jr)\.?|i{2,}$/ + 1.2 - UI_suffix - suffix_id - 1.6 + UI_suffix + suffix_id + 1.6 - greeting_type - varchar - 128 - true - Preferred greeting format. - 1.1 - 2.2 - + greeting_type + varchar + 128 + true + Preferred greeting format. + 1.1 + 2.2 +
+ + greeting_type_id + Greeting Type + int unsigned + FK to civicrm_option_value.id, that has to be valid, registered Greeting type. + 2.2 + 3.0 + + + custom_greeting + varchar + 128 + true + Custom greeting message. + 1.1 + 3.0 + + + email_greeting_id + int unsigned + Email Greeting ID + FK to civicrm_option_value.id, that has to be valid registered Email Greeting. + 3.0 + + + email_greeting_custom + varchar + 128 + true + false + Custom Email Greeting. + 3.0 + + + email_greeting_display + Email Greeting + varchar + 255 + Cache Email Greeting. + 3.0 + + + postal_greeting_id + int unsigned + Postal Greeting ID + FK to civicrm_option_value.id, that has to be valid registered Postal Greeting. + 3.0 + + + postal_greeting_custom + varchar + 128 + true + false + Custom Postal greeting. + 3.0 + + + postal_greeting_display + Postal Greeting + varchar + 255 + Cache Postal greeting. + 3.0 + + + addressee_id + int unsigned + Addressee ID + FK to civicrm_option_value.id, that has to be valid registered Addressee. + 3.0 + + + addressee_custom + varchar + 128 + true + false + Custom Addressee. + 3.0 + + + addressee_display + Addressee + varchar + 255 + Cache Addressee. + 3.0 + + + job_title + varchar + 255 + MEDIUM + true + /^job|(j(ob\s)?title)$/i + // + Job Title + 1.1 + - greeting_type_id - Greeting Type - int unsigned - FK to civicrm_option_value.id, that has to be valid, registered Greeting type. - 2.2 - 3.0 - - - custom_greeting - varchar - 128 - true - Custom greeting message. - 1.1 - 3.0 - - - email_greeting_id - int unsigned - Email Greeting ID - FK to civicrm_option_value.id, that has to be valid registered Email Greeting. - 3.0 - - - email_greeting_custom - varchar - 128 - true - false - Custom Email Greeting. - 3.0 - - - email_greeting_display - Email Greeting - varchar - 255 - Cache Email Greeting. - 3.0 - - - postal_greeting_id - int unsigned - Postal Greeting ID - FK to civicrm_option_value.id, that has to be valid registered Postal Greeting. - 3.0 - - - postal_greeting_custom - varchar - 128 - true - false - Custom Postal greeting. - 3.0 - - - postal_greeting_display - Postal Greeting - varchar - 255 - Cache Postal greeting. - 3.0 - - - addressee_id - int unsigned - Addressee ID - FK to civicrm_option_value.id, that has to be valid registered Addressee. - 3.0 - - - addressee_custom - varchar - 128 - true - false - Custom Addressee. - 3.0 - - - addressee_display - Addressee - varchar - 255 - Cache Addressee. - 3.0 - - - job_title - varchar - 255 - MEDIUM - true - /^job|(j(ob\s)?title)$/i - // - Job Title - 1.1 - - - gender_id - Gender - int unsigned - - gender - - /^gender$/i - FK to gender ID - true - 1.2 + gender_id + gender + Gender + int unsigned + + gender + + /^gender$/i + FK to gender ID + true + 1.2 - UI_gender - gender_id - 1.6 + UI_gender + gender_id + 1.6 - birth_date - date - true - /^birth|(b(irth\s)?date)|D(\W*)O(\W*)B(\W*)$/i - /\d{4}-?\d{2}-?\d{2}/ - Date of birth - 1.1 - - - is_deceased - Is Deceased - true - true - /i(s\s)?d(eceased)$/i - boolean - 0 - 1.1 - - - deceased_date - date - true - true - /^deceased|(d(eceased\s)?date)$/i - Date of deceased - 1.5 - - - mail_to_household_id - Mail to Household ID - int unsigned - OPTIONAL FK to civicrm_contact_household record. If NOT NULL, direct mail communications to household rather than individual location. - true - 1.1 - 3.3 + birth_date + date + true + /^birth|(b(irth\s)?date)|D(\W*)O(\W*)B(\W*)$/i + /\d{4}-?\d{2}-?\d{2}/ + Date of birth + 1.1 + + + is_deceased + Is Deceased + true + true + /i(s\s)?d(eceased)$/i + boolean + 0 + 1.1 + + + deceased_date + date + true + true + /^deceased|(d(eceased\s)?date)$/i + Date of deceased + 1.5 + + + mail_to_household_id + Mail to Household ID + int unsigned + OPTIONAL FK to civicrm_contact_household record. If NOT NULL, direct mail communications to household + rather than individual location. + + true + 1.1 + 3.3 - mail_to_household_id - civicrm_contact
- id - 2.1 - SET NULL - 3.3 + mail_to_household_id + civicrm_contact
+ id + 2.1 + SET NULL + 3.3
- household_name - varchar - 128 - BIG - true - /^household|(h(ousehold\s)?name)$/i - /^\w+$/ - Household Name. - - 1.1 + household_name + varchar + 128 + BIG + true + /^household|(h(ousehold\s)?name)$/i + /^\w+$/ + Household Name. + + 1.1 - index_household_name - household_name - 1.8 + index_household_name + household_name + 1.8 - primary_contact_id - int unsigned - Household Primary Contact ID - Optional FK to Primary Contact for this household. - 1.1 + primary_contact_id + int unsigned + Household Primary Contact ID + Optional FK to Primary Contact for this household. + 1.1 - primary_contact_id - civicrm_contact
- id - 1.1 - SET NULL + primary_contact_id + civicrm_contact
+ id + 1.1 + SET NULL
- organization_name - varchar - 128 - BIG - true - /^organization|(o(rganization\s)?name)$/i - /^\w+$/ - Organization Name. - - 1.1 + organization_name + varchar + 128 + BIG + true + /^organization|(o(rganization\s)?name)$/i + /^\w+$/ + Organization Name. + + 1.1 - index_organization_name - organization_name - 1.8 + index_organization_name + organization_name + 1.8 - sic_code - varchar - 8 - true - /^sic|(s(ic\s)?code)$/i - Standard Industry Classification Code. - 1.1 - - - user_unique_id - url - Unique ID (OpenID) - varchar - 255 - true - /^Open\s?ID|u(niq\w*)?\s?ID/i - /^[\w\/\:\.]+$/ - the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM - 2.0 - - - employer_id - Current Employer ID - current_employer_id - int unsigned - OPTIONAL FK to civicrm_contact record. - true - 2.1 + sic_code + varchar + 8 + true + /^sic|(s(ic\s)?code)$/i + Standard Industry Classification Code. + 1.1 + + + user_unique_id + url + Unique ID (OpenID) + varchar + 255 + true + /^Open\s?ID|u(niq\w*)?\s?ID/i + /^[\w\/\:\.]+$/ + the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for + logging in to CiviCRM + + 2.0 + + + employer_id + Current Employer ID + current_employer_id + int unsigned + OPTIONAL FK to civicrm_contact record. + true + 2.1 - employer_id - civicrm_contact
- id - 2.1 - SET NULL + employer_id + civicrm_contact
+ id + 2.1 + SET NULL
is_deleted -- 2.25.1