Separate titles from labels in exportable fields
authorColeman Watts <coleman@civicrm.org>
Tue, 25 Aug 2020 18:20:51 +0000 (14:20 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 25 Aug 2020 18:21:03 +0000 (14:21 -0400)
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.

CRM/Activity/BAO/Activity.php
CRM/Activity/DAO/Activity.php
CRM/Contact/BAO/Contact.php
CRM/Contact/DAO/Contact.php
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/DAO/Contribution.php
xml/schema/Activity/Activity.xml
xml/schema/Contact/Contact.xml
xml/schema/Contribute/Contribution.xml

index 3c8a0eb1551f2ee1c10baf75e16ccdfbd2b2d205..40f6fdc906656c530692d0d9f7449555c8a43adf 100644 (file)
@@ -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') {
index 3221932f12eaaefaabbcecb70c42bcc32b376f86..03ad751cd6b738217b822db35492b5956a3b0996 100644 (file)
@@ -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',
         ],
index 29c82bd90095a51272ad27253560f6da37b7d506..5f42dce4faa5665af235fc1995c7eafffdc13f94 100644 (file)
@@ -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, [
index 18129eecc9749fd794ca12d47adae0e1162c3e09..f91dc3264b1e5e35928815f8b2b63d80434c65c3 100644 (file)
@@ -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',
         ],
index 849daf7a4e5de6385cbb9cab94ac956c2483d1c5..1bc7aa5b401ad8fb720fd14ea2c8402a263aa943 100644 (file)
@@ -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;
     }
 
index d40a175b96d7ab4c6f73b56fe5121a0c1cbc0a3d..45f51b756cad855b0a4ae6c45d1bda1a92c7925e 100644 (file)
@@ -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',
index 8a37ea3d76156f28972b2e351b017acfc9d004cd..47fa642301033b8d1d35cdcb2a12548643657b87 100644 (file)
@@ -59,7 +59,7 @@
   </index>
   <field>
     <name>activity_type_id</name>
-    <title>Activity Type</title>
+    <title>Activity Type ID</title>
     <import>true</import>
     <type>int unsigned</type>
     <required>true</required>
@@ -73,6 +73,7 @@
     </pseudoconstant>
     <html>
       <type>Select</type>
+      <label>Activity Type</label>
     </html>
   </field>
   <index>
   <field>
     <name>phone_id</name>
     <type>int unsigned</type>
-    <title>Phone (called)</title>
+    <title>Phone (called) ID</title>
     <comment>Phone ID of the number called (optional - used if an existing phone number is selected).</comment>
     <add>2.0</add>
     <html>
       <type>EntityRef</type>
+      <label>Phone (called)</label>
     </html>
   </field>
   <foreignKey>
index f904c09cff1e29681d1b8b17f3cd93386fe0a757..58456425fda7fdcc5c6d5c9e9347abc3eada6534 100644 (file)
   </field>
   <field>
     <name>employer_id</name>
-    <title>Current Employer</title>
+    <title>Current Employer ID</title>
     <uniqueName>current_employer_id</uniqueName>
     <type>int unsigned</type>
     <comment>OPTIONAL FK to civicrm_contact record.</comment>
     <add>2.1</add>
     <html>
       <type>EntityRef</type>
+      <label>Current Employer</label>
     </html>
     <contactType>Individual</contactType>
   </field>
index e98363baa93bef96f461dc69accb1d839003e198..c7ed79e140cc072600eaa7cb5f6d3d951c13b67d 100644 (file)
@@ -81,7 +81,7 @@
   </foreignKey>
   <field>
     <name>financial_type_id</name>
-    <title>Financial Type</title>
+    <title>Financial Type ID</title>
     <type>int unsigned</type>
     <comment>FK to Financial Type for (total_amount - non_deductible_amount).</comment>
     <pseudoconstant>
@@ -92,6 +92,7 @@
     <export>true</export>
     <html>
       <type>Select</type>
+      <label>Financial Type</label>
     </html>
     <add>4.3</add>
   </field>