From 3542118fa47ab7a6fdef277acc6e4ab16badd78d Mon Sep 17 00:00:00 2001 From: Coleman Watts <coleman@civicrm.org> 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 @@ </index> <field> <name>activity_type_id</name> - <title>Activity Type ID</title> + <title>Activity Type</title> <import>true</import> <type>int unsigned</type> <required>true</required> @@ -167,7 +167,7 @@ <comment>Planned or actual duration of activity expressed in minutes. Conglomerate of former duration_hours and duration_minutes.</comment> <add>2.0</add> <html> - <type>Text</type> + <type>Number</type> </html> </field> <field> @@ -187,7 +187,7 @@ <field> <name>phone_id</name> <type>int unsigned</type> - <title>Phone (called) ID</title> + <title>Phone (called)</title> <comment>Phone ID of the number called (optional - used if an existing phone number is selected).</comment> <add>2.0</add> <html> @@ -295,7 +295,7 @@ <headerPattern>/(is.)?test(.activity)?/i</headerPattern> <add>2.0</add> <html> - <type>Select</type> + <type>CheckBox</type> </html> </field> <field> @@ -347,9 +347,6 @@ <import>true</import> <headerPattern>/(is.)?(current.)?(revision|version(ing)?)/i</headerPattern> <add>2.2</add> - <html> - <type>CheckBox</type> - </html> </field> <index> <name>index_is_current_revision</name> @@ -383,9 +380,6 @@ <title>Result</title> <length>255</length> <comment>Currently being used to store result id for survey activity, FK to option value.</comment> - <html> - <type>Text</type> - </html> <add>3.3</add> </field> <field> @@ -398,7 +392,7 @@ <headerPattern>/(activity.)?(trash|deleted)/i</headerPattern> <add>2.2</add> <html> - <type>Text</type> + <type>CheckBox</type> </html> </field> <index> @@ -420,7 +414,7 @@ </pseudoconstant> <add>3.4</add> <html> - <type>CheckBox</type> + <type>Select</type> </html> </field> <foreignKey> @@ -449,9 +443,6 @@ <title>Order</title> <type>int</type> <add>4.1</add> - <html> - <type>Text</type> - </html> </field> <field> <name>is_star</name> @@ -462,6 +453,9 @@ <comment>Activity marked as favorite.</comment> <headerPattern>/(activity.)?(star|favorite)/i</headerPattern> <add>4.7</add> + <html> + <type>Checkbox</type> + </html> </field> <field> <name>created_date</name> 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 @@ <title>Website</title> <type>varchar</type> <length>128</length> - <html> - <type>Text</type> - <size>30</size> - </html> - <import>true</import> <headerPattern>/^(home\sURL)|URL|web|site/i</headerPattern> <dataPattern>/^[\w\/\:\.]+$/</dataPattern> @@ -430,9 +425,6 @@ <name>index_last_name</name> <fieldName>last_name</fieldName> <add>1.8</add> - <html> - <type>Text</type> - </html> </index> <field> <name>prefix_id</name> @@ -542,6 +534,9 @@ <export>true</export> <comment>FK to civicrm_option_value.id, that has to be valid registered Email Greeting.</comment> <add>3.0</add> + <html> + <type>Select</type> + </html> <pseudoconstant> <optionGroupName>email_greeting</optionGroupName> </pseudoconstant> @@ -565,9 +560,6 @@ <length>255</length> <comment>Cache Email Greeting.</comment> <add>3.0</add> - <html> - <type>Text</type> - </html> </field> <field> <name>postal_greeting_id</name> @@ -577,7 +569,7 @@ <comment>FK to civicrm_option_value.id, that has to be valid registered Postal Greeting.</comment> <add>3.0</add> <html> - <type>Text</type> + <type>Select</type> </html> <pseudoconstant> <optionGroupName>postal_greeting</optionGroupName> @@ -602,9 +594,6 @@ <length>255</length> <comment>Cache Postal greeting.</comment> <add>3.0</add> - <html> - <type>Text</type> - </html> </field> <field> <name>addressee_id</name> @@ -613,6 +602,9 @@ <comment>FK to civicrm_option_value.id, that has to be valid registered Addressee.</comment> <add>3.0</add> <export>true</export> + <html> + <type>Select</type> + </html> <pseudoconstant> <optionGroupName>addressee</optionGroupName> </pseudoconstant> @@ -636,9 +628,6 @@ <length>255</length> <comment>Cache Addressee.</comment> <add>3.0</add> - <html> - <type>Text</type> - </html> </field> <field> <name>job_title</name> @@ -673,9 +662,6 @@ <name>UI_gender</name> <fieldName>gender_id</fieldName> <add>1.6</add> - <html> - <type>Select</type> - </html> </index> <field> <name>birth_date</name> @@ -764,9 +750,6 @@ <title>Household Primary Contact ID</title> <comment>Optional FK to Primary Contact for this household.</comment> <add>1.1</add> - <html> - <type>Select</type> - </html> </field> <foreignKey> <name>primary_contact_id</name> -- 2.25.1