From 3542118fa47ab7a6fdef277acc6e4ab16badd78d Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 11 Nov 2019 13:39:04 -0500 Subject: [PATCH] Field metadata cleanup: Contact & Activity --- CRM/Activity/BAO/Activity.php | 1 + CRM/Activity/DAO/Activity.php | 26 ++++++++++---------------- CRM/Contact/DAO/Contact.php | 22 ++++++++-------------- xml/schema/Activity/Activity.xml | 24 +++++++++--------------- xml/schema/Contact/Contact.xml | 31 +++++++------------------------ 5 files changed, 35 insertions(+), 69 deletions(-) diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index f6034293ba..be3011c80f 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -2140,6 +2140,7 @@ AND cl.modified_id = c.id ], ]; $fields = array_merge($Activityfields, $exportableFields); + $fields['activity_type_id']['title'] = ts('Activity Type ID'); } else { // Set title to activity fields. diff --git a/CRM/Activity/DAO/Activity.php b/CRM/Activity/DAO/Activity.php index 60fad910b6..0b4fde7b06 100644 --- a/CRM/Activity/DAO/Activity.php +++ b/CRM/Activity/DAO/Activity.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Activity/Activity.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:fa6ffb0aaff92c8a515aff74919c7ad3) + * (GenCodeChecksum:1d6842701f82cb5ee56916c7599b3b3d) */ /** @@ -270,7 +270,7 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { 'activity_type_id' => [ 'name' => 'activity_type_id', 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Activity Type ID'), + 'title' => ts('Activity Type'), 'description' => ts('FK to civicrm_option_value.id, that has to be valid, registered activity type.'), 'required' => TRUE, 'import' => TRUE, @@ -341,7 +341,7 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { 'bao' => 'CRM_Activity_BAO_Activity', 'localizable' => 0, 'html' => [ - 'type' => 'Text', + 'type' => 'Number', ], ], 'activity_location' => [ @@ -366,7 +366,7 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { 'phone_id' => [ 'name' => 'phone_id', 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Phone (called) ID'), + 'title' => ts('Phone (called)'), 'description' => ts('Phone ID of the number called (optional - used if an existing phone number is selected).'), 'where' => 'civicrm_activity.phone_id', 'table_name' => 'civicrm_activity', @@ -476,7 +476,7 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { 'bao' => 'CRM_Activity_BAO_Activity', 'localizable' => 0, 'html' => [ - 'type' => 'Select', + 'type' => 'CheckBox', ], ], 'activity_medium_id' => [ @@ -535,9 +535,6 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { 'entity' => 'Activity', 'bao' => 'CRM_Activity_BAO_Activity', 'localizable' => 0, - 'html' => [ - 'type' => 'CheckBox', - ], ], 'original_id' => [ 'name' => 'original_id', @@ -563,9 +560,6 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { 'entity' => 'Activity', 'bao' => 'CRM_Activity_BAO_Activity', 'localizable' => 0, - 'html' => [ - 'type' => 'Text', - ], ], 'activity_is_deleted' => [ 'name' => 'is_deleted', @@ -581,7 +575,7 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { 'bao' => 'CRM_Activity_BAO_Activity', 'localizable' => 0, 'html' => [ - 'type' => 'Text', + 'type' => 'CheckBox', ], ], 'activity_campaign_id' => [ @@ -598,7 +592,7 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { 'localizable' => 0, 'FKClassName' => 'CRM_Campaign_DAO_Campaign', 'html' => [ - 'type' => 'CheckBox', + 'type' => 'Select', ], 'pseudoconstant' => [ 'table' => 'civicrm_campaign', @@ -635,9 +629,6 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { 'entity' => 'Activity', 'bao' => 'CRM_Activity_BAO_Activity', 'localizable' => 0, - 'html' => [ - 'type' => 'Text', - ], ], 'is_star' => [ 'name' => 'is_star', @@ -653,6 +644,9 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { 'entity' => 'Activity', 'bao' => 'CRM_Activity_BAO_Activity', 'localizable' => 0, + 'html' => [ + 'type' => 'Checkbox', + ], ], 'activity_created_date' => [ 'name' => 'created_date', diff --git a/CRM/Contact/DAO/Contact.php b/CRM/Contact/DAO/Contact.php index c0637da82e..a799fa9d92 100644 --- a/CRM/Contact/DAO/Contact.php +++ b/CRM/Contact/DAO/Contact.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/Contact.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:ee3bf9f2d1faed5a4de439ecf0537ac6) + * (GenCodeChecksum:b72765d873639076299753a8c4e676d5) */ /** @@ -990,6 +990,9 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { 'entity' => 'Contact', 'bao' => 'CRM_Contact_BAO_Contact', 'localizable' => 0, + 'html' => [ + 'type' => 'Select', + ], 'pseudoconstant' => [ 'optionGroupName' => 'email_greeting', 'optionEditPath' => 'civicrm/admin/options/email_greeting', @@ -1025,9 +1028,6 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { 'entity' => 'Contact', 'bao' => 'CRM_Contact_BAO_Contact', 'localizable' => 0, - 'html' => [ - 'type' => 'Text', - ], ], 'postal_greeting_id' => [ 'name' => 'postal_greeting_id', @@ -1041,7 +1041,7 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { 'bao' => 'CRM_Contact_BAO_Contact', 'localizable' => 0, 'html' => [ - 'type' => 'Text', + 'type' => 'Select', ], 'pseudoconstant' => [ 'optionGroupName' => 'postal_greeting', @@ -1078,9 +1078,6 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { 'entity' => 'Contact', 'bao' => 'CRM_Contact_BAO_Contact', 'localizable' => 0, - 'html' => [ - 'type' => 'Text', - ], ], 'addressee_id' => [ 'name' => 'addressee_id', @@ -1093,6 +1090,9 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { 'entity' => 'Contact', 'bao' => 'CRM_Contact_BAO_Contact', 'localizable' => 0, + 'html' => [ + 'type' => 'Select', + ], 'pseudoconstant' => [ 'optionGroupName' => 'addressee', 'optionEditPath' => 'civicrm/admin/options/addressee', @@ -1128,9 +1128,6 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { 'entity' => 'Contact', 'bao' => 'CRM_Contact_BAO_Contact', 'localizable' => 0, - 'html' => [ - 'type' => 'Text', - ], ], 'job_title' => [ 'name' => 'job_title', @@ -1258,9 +1255,6 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { 'bao' => 'CRM_Contact_BAO_Contact', 'localizable' => 0, 'FKClassName' => 'CRM_Contact_DAO_Contact', - 'html' => [ - 'type' => 'Select', - ], ], 'organization_name' => [ 'name' => 'organization_name', diff --git a/xml/schema/Activity/Activity.xml b/xml/schema/Activity/Activity.xml index 6b6da12249..8bb01cba9a 100644 --- a/xml/schema/Activity/Activity.xml +++ b/xml/schema/Activity/Activity.xml @@ -58,7 +58,7 @@ activity_type_id - Activity Type ID + Activity Type true int unsigned true @@ -167,7 +167,7 @@ Planned or actual duration of activity expressed in minutes. Conglomerate of former duration_hours and duration_minutes. 2.0 - Text + Number @@ -187,7 +187,7 @@ phone_id int unsigned - Phone (called) ID + Phone (called) Phone ID of the number called (optional - used if an existing phone number is selected). 2.0 @@ -295,7 +295,7 @@ /(is.)?test(.activity)?/i 2.0 - Select + CheckBox @@ -347,9 +347,6 @@ true /(is.)?(current.)?(revision|version(ing)?)/i 2.2 - - CheckBox - index_is_current_revision @@ -383,9 +380,6 @@ Result 255 Currently being used to store result id for survey activity, FK to option value. - - Text - 3.3 @@ -398,7 +392,7 @@ /(activity.)?(trash|deleted)/i 2.2 - Text + CheckBox @@ -420,7 +414,7 @@ 3.4 - CheckBox + Select @@ -449,9 +443,6 @@ Order int 4.1 - - Text - is_star @@ -462,6 +453,9 @@ Activity marked as favorite. /(activity.)?(star|favorite)/i 4.7 + + Checkbox + created_date diff --git a/xml/schema/Contact/Contact.xml b/xml/schema/Contact/Contact.xml index 14965f9ffc..7facb329ca 100644 --- a/xml/schema/Contact/Contact.xml +++ b/xml/schema/Contact/Contact.xml @@ -250,11 +250,6 @@ Website varchar 128 - - Text - 30 - - true /^(home\sURL)|URL|web|site/i /^[\w\/\:\.]+$/ @@ -430,9 +425,6 @@ index_last_name last_name 1.8 - - Text - prefix_id @@ -542,6 +534,9 @@ true FK to civicrm_option_value.id, that has to be valid registered Email Greeting. 3.0 + + Select + email_greeting @@ -565,9 +560,6 @@ 255 Cache Email Greeting. 3.0 - - Text - postal_greeting_id @@ -577,7 +569,7 @@ FK to civicrm_option_value.id, that has to be valid registered Postal Greeting. 3.0 - Text + Select postal_greeting @@ -602,9 +594,6 @@ 255 Cache Postal greeting. 3.0 - - Text - addressee_id @@ -613,6 +602,9 @@ FK to civicrm_option_value.id, that has to be valid registered Addressee. 3.0 true + + Select + addressee @@ -636,9 +628,6 @@ 255 Cache Addressee. 3.0 - - Text - job_title @@ -673,9 +662,6 @@ UI_gender gender_id 1.6 - - Select - birth_date @@ -764,9 +750,6 @@ Household Primary Contact ID Optional FK to Primary Contact for this household. 1.1 - - Select - primary_contact_id -- 2.25.1