From: Coleman Watts Date: Tue, 25 Aug 2020 18:20:51 +0000 (-0400) Subject: Separate titles from labels in exportable fields X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a1d226d6655afebbb63b14032180f217ee68b762;p=civicrm-core.git Separate titles from labels in exportable fields Follow-up to #18255 and #18114 - this separates field titles (used in export) from labels (used in forms and other displays). The previous approach was to try to use the title for both, and if that didn't work, override it somewhere. --- diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 3c8a0eb155..40f6fdc906 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -2164,7 +2164,6 @@ AND cl.modified_id = c.id ], ]; $fields = array_merge($activityFields, $exportableFields); - $fields['activity_type_id']['title'] = ts('Activity Type ID'); $fields['activity_priority_id'] = $fields['priority_id']; if ($name === 'Case') { diff --git a/CRM/Activity/DAO/Activity.php b/CRM/Activity/DAO/Activity.php index 3221932f12..03ad751cd6 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:acbed5c46fa2f00de06493210358c684) + * (GenCodeChecksum:cbcbcbb6720f015deae4097b01196c9a) */ /** @@ -288,7 +288,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'), + 'title' => ts('Activity Type ID'), 'description' => ts('FK to civicrm_option_value.id, that has to be valid, registered activity type.'), 'required' => TRUE, 'import' => TRUE, @@ -302,6 +302,7 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { 'localizable' => 0, 'html' => [ 'type' => 'Select', + 'label' => ts("Activity Type"), ], 'pseudoconstant' => [ 'optionGroupName' => 'activity_type', @@ -391,7 +392,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)'), + 'title' => ts('Phone (called) ID'), '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', @@ -401,6 +402,7 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { 'FKClassName' => 'CRM_Core_DAO_Phone', 'html' => [ 'type' => 'EntityRef', + 'label' => ts("Phone (called)"), ], 'add' => '2.0', ], diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 29c82bd900..5f42dce4fa 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -1609,7 +1609,6 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); ); } } - $fields['current_employer_id']['title'] = ts('Current Employer ID'); //fix for CRM-791 if ($export) { $fields = array_merge($fields, [ diff --git a/CRM/Contact/DAO/Contact.php b/CRM/Contact/DAO/Contact.php index 18129eecc9..f91dc3264b 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:7f796d14a0de2afa9ec1d5b658ab9329) + * (GenCodeChecksum:f58884560d4f49764182cd97f1bbbcdf) */ /** @@ -1402,7 +1402,7 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { 'current_employer_id' => [ 'name' => 'employer_id', 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Current Employer'), + 'title' => ts('Current Employer ID'), 'description' => ts('OPTIONAL FK to civicrm_contact record.'), 'where' => 'civicrm_contact.employer_id', 'export' => TRUE, @@ -1414,6 +1414,7 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { 'FKClassName' => 'CRM_Contact_DAO_Contact', 'html' => [ 'type' => 'EntityRef', + 'label' => ts("Current Employer"), ], 'add' => '2.1', ], diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 849daf7a4e..1bc7aa5b40 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -847,8 +847,6 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { CRM_Core_BAO_CustomField::getFieldsForImport('Contribution', FALSE, FALSE, FALSE, $checkPermission) ); - $fields['financial_type_id']['title'] = ts('Financial Type ID'); - self::$_exportableFields = $fields; } diff --git a/CRM/Contribute/DAO/Contribution.php b/CRM/Contribute/DAO/Contribution.php index d40a175b96..45f51b756c 100644 --- a/CRM/Contribute/DAO/Contribution.php +++ b/CRM/Contribute/DAO/Contribution.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contribute/Contribution.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:534963bc67ddc36a182ff4767f223531) + * (GenCodeChecksum:cc3bcdbce84066823084f71e30f6990b) */ /** @@ -327,7 +327,7 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO { 'financial_type_id' => [ 'name' => 'financial_type_id', 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Financial Type'), + 'title' => ts('Financial Type ID'), 'description' => ts('FK to Financial Type for (total_amount - non_deductible_amount).'), 'where' => 'civicrm_contribution.financial_type_id', 'export' => TRUE, @@ -338,6 +338,7 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO { 'FKClassName' => 'CRM_Financial_DAO_FinancialType', 'html' => [ 'type' => 'Select', + 'label' => ts("Financial Type"), ], 'pseudoconstant' => [ 'table' => 'civicrm_financial_type', diff --git a/xml/schema/Activity/Activity.xml b/xml/schema/Activity/Activity.xml index 8a37ea3d76..47fa642301 100644 --- a/xml/schema/Activity/Activity.xml +++ b/xml/schema/Activity/Activity.xml @@ -59,7 +59,7 @@ activity_type_id - Activity Type + Activity Type ID true int unsigned true @@ -73,6 +73,7 @@ Select + @@ -191,11 +192,12 @@ phone_id int unsigned - Phone (called) + Phone (called) ID Phone ID of the number called (optional - used if an existing phone number is selected). 2.0 EntityRef + diff --git a/xml/schema/Contact/Contact.xml b/xml/schema/Contact/Contact.xml index f904c09cff..58456425fd 100644 --- a/xml/schema/Contact/Contact.xml +++ b/xml/schema/Contact/Contact.xml @@ -826,7 +826,7 @@ employer_id - Current Employer + Current Employer ID current_employer_id int unsigned OPTIONAL FK to civicrm_contact record. @@ -834,6 +834,7 @@ 2.1 EntityRef + Individual diff --git a/xml/schema/Contribute/Contribution.xml b/xml/schema/Contribute/Contribution.xml index e98363baa9..c7ed79e140 100644 --- a/xml/schema/Contribute/Contribution.xml +++ b/xml/schema/Contribute/Contribution.xml @@ -81,7 +81,7 @@ financial_type_id - Financial Type + Financial Type ID int unsigned FK to Financial Type for (total_amount - non_deductible_amount). @@ -92,6 +92,7 @@ true Select + 4.3