From a0e733f37b943129ae2ac3b61f87ef33f1ea9e1d Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 7 Mar 2021 16:09:10 -0500 Subject: [PATCH] Add more 'readonly' tags to the schema for fields not intended to be editable by users --- CRM/Activity/DAO/Activity.php | 3 ++- CRM/Batch/DAO/Batch.php | 7 ++++--- CRM/Case/DAO/Case.php | 3 ++- CRM/Contact/DAO/Contact.php | 6 +++++- CRM/Contact/DAO/Group.php | 3 ++- CRM/Contact/DAO/SavedSearch.php | 4 +++- CRM/Contribute/DAO/ContributionRecur.php | 3 ++- CRM/Core/DAO/ActionSchedule.php | 3 ++- CRM/Core/DAO/Note.php | 3 ++- CRM/Cxn/DAO/Cxn.php | 3 ++- CRM/Mailing/DAO/Mailing.php | 3 ++- CRM/Member/DAO/MembershipLog.php | 3 ++- CRM/Pledge/DAO/Pledge.php | 3 ++- ext/afform/core/Civi/Api4/Afform.php | 4 ++++ xml/schema/Activity/Activity.xml | 1 + xml/schema/Batch/Batch.xml | 3 ++- xml/schema/Case/Case.xml | 1 + xml/schema/Contact/Contact.xml | 4 ++++ xml/schema/Contact/Group.xml | 1 + xml/schema/Contact/SavedSearch.xml | 2 ++ xml/schema/Contribute/ContributionRecur.xml | 1 + xml/schema/Core/ActionSchedule.xml | 1 + xml/schema/Core/Note.xml | 1 + xml/schema/Cxn/Cxn.xml | 3 ++- xml/schema/Mailing/Mailing.xml | 1 + xml/schema/Member/MembershipLog.xml | 1 + xml/schema/Pledge/Pledge.xml | 1 + 27 files changed, 55 insertions(+), 17 deletions(-) diff --git a/CRM/Activity/DAO/Activity.php b/CRM/Activity/DAO/Activity.php index b2ba8e150f..aaed8694f3 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:c03cd9a4a9a2e78a7179c6979a9e21ef) + * (GenCodeChecksum:b2e238b9868552d5e065153d229e9a24) */ /** @@ -760,6 +760,7 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { 'html' => [ 'label' => ts("Modified Date"), ], + 'readonly' => TRUE, 'add' => '4.7', ], ]; diff --git a/CRM/Batch/DAO/Batch.php b/CRM/Batch/DAO/Batch.php index 190f3d25d6..8b85c8ce3d 100644 --- a/CRM/Batch/DAO/Batch.php +++ b/CRM/Batch/DAO/Batch.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Batch/Batch.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:21bc670b9083e60a58ccd4713958c192) + * (GenCodeChecksum:5da4d1a83e75b4ab957e1dfb8974d923) */ /** @@ -80,7 +80,7 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO { public $modified_id; /** - * When was this item created + * When was this item modified * * @var datetime */ @@ -310,12 +310,13 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO { 'name' => 'modified_date', 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, 'title' => ts('Batch Modified Date'), - 'description' => ts('When was this item created'), + 'description' => ts('When was this item modified'), 'where' => 'civicrm_batch.modified_date', 'table_name' => 'civicrm_batch', 'entity' => 'Batch', 'bao' => 'CRM_Batch_BAO_Batch', 'localizable' => 0, + 'readonly' => TRUE, 'add' => '3.3', ], 'saved_search_id' => [ diff --git a/CRM/Case/DAO/Case.php b/CRM/Case/DAO/Case.php index 815423a014..7f03f5ef49 100644 --- a/CRM/Case/DAO/Case.php +++ b/CRM/Case/DAO/Case.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Case/Case.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:0ce5a08de908f8eb8d65337dcc9cf5c5) + * (GenCodeChecksum:a306dc83df6e2e019a35a560841a702e) */ /** @@ -344,6 +344,7 @@ class CRM_Case_DAO_Case extends CRM_Core_DAO { 'html' => [ 'label' => ts("Modified Date"), ], + 'readonly' => TRUE, 'add' => '4.7', ], ]; diff --git a/CRM/Contact/DAO/Contact.php b/CRM/Contact/DAO/Contact.php index 1ffa441fb1..4a2821f061 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:cfed69c9e09acada46340971415ec767) + * (GenCodeChecksum:f9e902a96df5788a6f081f8d33632d9c) */ /** @@ -1132,6 +1132,7 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { 'entity' => 'Contact', 'bao' => 'CRM_Contact_BAO_Contact', 'localizable' => 0, + 'readonly' => TRUE, 'add' => '3.0', ], 'postal_greeting_id' => [ @@ -1186,6 +1187,7 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { 'entity' => 'Contact', 'bao' => 'CRM_Contact_BAO_Contact', 'localizable' => 0, + 'readonly' => TRUE, 'add' => '3.0', ], 'addressee_id' => [ @@ -1240,6 +1242,7 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { 'entity' => 'Contact', 'bao' => 'CRM_Contact_BAO_Contact', 'localizable' => 0, + 'readonly' => TRUE, 'add' => '3.0', ], 'job_title' => [ @@ -1391,6 +1394,7 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { 'html' => [ 'label' => ts("Household Primary Contact"), ], + 'readonly' => TRUE, 'add' => '1.1', ], 'organization_name' => [ diff --git a/CRM/Contact/DAO/Group.php b/CRM/Contact/DAO/Group.php index 7a0919b4be..0df766f314 100644 --- a/CRM/Contact/DAO/Group.php +++ b/CRM/Contact/DAO/Group.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/Group.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:70cda1352ed41a06561ffa99b92e459c) + * (GenCodeChecksum:cb5e8b19ff1f2ff99b556b2e24a67f80) */ /** @@ -542,6 +542,7 @@ class CRM_Contact_DAO_Group extends CRM_Core_DAO { 'html' => [ 'label' => ts("Modified By"), ], + 'readonly' => TRUE, 'add' => '4.5', ], 'frontend_title' => [ diff --git a/CRM/Contact/DAO/SavedSearch.php b/CRM/Contact/DAO/SavedSearch.php index 349075a5d9..a7a29f700c 100644 --- a/CRM/Contact/DAO/SavedSearch.php +++ b/CRM/Contact/DAO/SavedSearch.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/SavedSearch.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:1ca4440b5a09843b5d87d595a6d826ef) + * (GenCodeChecksum:86f450b7cee8be51a270e60cadd83f22) */ /** @@ -322,6 +322,7 @@ class CRM_Contact_DAO_SavedSearch extends CRM_Core_DAO { 'html' => [ 'label' => ts("Modified By"), ], + 'readonly' => TRUE, 'add' => '5.36', ], 'expires_date' => [ @@ -363,6 +364,7 @@ class CRM_Contact_DAO_SavedSearch extends CRM_Core_DAO { 'entity' => 'SavedSearch', 'bao' => 'CRM_Contact_BAO_SavedSearch', 'localizable' => 0, + 'readonly' => TRUE, 'add' => '5.36', ], 'description' => [ diff --git a/CRM/Contribute/DAO/ContributionRecur.php b/CRM/Contribute/DAO/ContributionRecur.php index 9c60146c77..2b9f2f24a6 100644 --- a/CRM/Contribute/DAO/ContributionRecur.php +++ b/CRM/Contribute/DAO/ContributionRecur.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contribute/ContributionRecur.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:de42c68c1da057066076b28ebe4f5460) + * (GenCodeChecksum:f84af6c77cc1e2d93f27952a2a9766fd) */ /** @@ -460,6 +460,7 @@ class CRM_Contribute_DAO_ContributionRecur extends CRM_Core_DAO { 'type' => 'Select Date', 'formatType' => 'activityDateTime', ], + 'readonly' => TRUE, 'add' => '1.6', ], 'contribution_recur_cancel_date' => [ diff --git a/CRM/Core/DAO/ActionSchedule.php b/CRM/Core/DAO/ActionSchedule.php index e009708710..0838c890f2 100644 --- a/CRM/Core/DAO/ActionSchedule.php +++ b/CRM/Core/DAO/ActionSchedule.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/ActionSchedule.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:7952a55bbf18fc91af640a130cb79137) + * (GenCodeChecksum:c7e9b07157ed16c2f0cec07607b2c50f) */ /** @@ -997,6 +997,7 @@ class CRM_Core_DAO_ActionSchedule extends CRM_Core_DAO { 'html' => [ 'label' => ts("Modified Date"), ], + 'readonly' => TRUE, 'add' => '5.34', ], 'action_schedule_effective_start_date' => [ diff --git a/CRM/Core/DAO/Note.php b/CRM/Core/DAO/Note.php index 4ce0f51f21..b1cbbac5fc 100644 --- a/CRM/Core/DAO/Note.php +++ b/CRM/Core/DAO/Note.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Note.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:444f6d1cb984753995b61839733abfc8) + * (GenCodeChecksum:769d2ecb72a576a60f8a83940ab4c995) */ /** @@ -231,6 +231,7 @@ class CRM_Core_DAO_Note extends CRM_Core_DAO { 'entity' => 'Note', 'bao' => 'CRM_Core_BAO_Note', 'localizable' => 0, + 'readonly' => TRUE, 'add' => '1.1', ], 'subject' => [ diff --git a/CRM/Cxn/DAO/Cxn.php b/CRM/Cxn/DAO/Cxn.php index 1faef0c488..ff419f5a4c 100644 --- a/CRM/Cxn/DAO/Cxn.php +++ b/CRM/Cxn/DAO/Cxn.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Cxn/Cxn.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:157ccfb9fab7c31b02b22cf6d79fe686) + * (GenCodeChecksum:f0b3443764bfbda8d074ee79657d33b7) */ /** @@ -281,6 +281,7 @@ class CRM_Cxn_DAO_Cxn extends CRM_Core_DAO { 'html' => [ 'label' => ts("Modified Date"), ], + 'readonly' => TRUE, 'add' => '4.6', ], 'fetched_date' => [ diff --git a/CRM/Mailing/DAO/Mailing.php b/CRM/Mailing/DAO/Mailing.php index 7da10873dd..944bdda3c9 100644 --- a/CRM/Mailing/DAO/Mailing.php +++ b/CRM/Mailing/DAO/Mailing.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Mailing/Mailing.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:b5a7699458ba089e3b1ee104a71e92bc) + * (GenCodeChecksum:61779b76f40d01168260977ed4c89c49) */ /** @@ -862,6 +862,7 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO { 'html' => [ 'label' => ts("Modified Date"), ], + 'readonly' => TRUE, 'add' => '4.7', ], 'scheduled_id' => [ diff --git a/CRM/Member/DAO/MembershipLog.php b/CRM/Member/DAO/MembershipLog.php index c783216565..b0ac1881a8 100644 --- a/CRM/Member/DAO/MembershipLog.php +++ b/CRM/Member/DAO/MembershipLog.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Member/MembershipLog.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:8f73099e9a9ed869fed01be412586118) + * (GenCodeChecksum:fc7552b2d017b9feb21acbef94f70342) */ /** @@ -226,6 +226,7 @@ class CRM_Member_DAO_MembershipLog extends CRM_Core_DAO { 'html' => [ 'label' => ts("Modified By"), ], + 'readonly' => TRUE, 'add' => '1.5', ], 'modified_date' => [ diff --git a/CRM/Pledge/DAO/Pledge.php b/CRM/Pledge/DAO/Pledge.php index f01b98ccee..9c86b0d1c9 100644 --- a/CRM/Pledge/DAO/Pledge.php +++ b/CRM/Pledge/DAO/Pledge.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Pledge/Pledge.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:3663f8bd4b5105b49277f60671375774) + * (GenCodeChecksum:dbae8b55f038778bd6862b001237a828) */ /** @@ -526,6 +526,7 @@ class CRM_Pledge_DAO_Pledge extends CRM_Core_DAO { 'entity' => 'Pledge', 'bao' => 'CRM_Pledge_BAO_Pledge', 'localizable' => 0, + 'readonly' => TRUE, 'add' => '2.1', ], 'cancel_date' => [ diff --git a/ext/afform/core/Civi/Api4/Afform.php b/ext/afform/core/Civi/Api4/Afform.php index 0106f09b7f..23c7c02189 100644 --- a/ext/afform/core/Civi/Api4/Afform.php +++ b/ext/afform/core/Civi/Api4/Afform.php @@ -172,17 +172,21 @@ class Afform extends Generic\AbstractEntity { if ($self->getAction() === 'get') { $fields[] = [ 'name' => 'module_name', + 'readonly' => TRUE, ]; $fields[] = [ 'name' => 'directive_name', + 'readonly' => TRUE, ]; $fields[] = [ 'name' => 'has_local', 'data_type' => 'Boolean', + 'readonly' => TRUE, ]; $fields[] = [ 'name' => 'has_base', 'data_type' => 'Boolean', + 'readonly' => TRUE, ]; } diff --git a/xml/schema/Activity/Activity.xml b/xml/schema/Activity/Activity.xml index 1fb0d32e51..e0957b13f8 100644 --- a/xml/schema/Activity/Activity.xml +++ b/xml/schema/Activity/Activity.xml @@ -421,6 +421,7 @@ + true 4.7 diff --git a/xml/schema/Batch/Batch.xml b/xml/schema/Batch/Batch.xml index a1960cc3bb..d7b4541bbd 100644 --- a/xml/schema/Batch/Batch.xml +++ b/xml/schema/Batch/Batch.xml @@ -105,7 +105,8 @@ modified_date Batch Modified Date datetime - When was this item created + When was this item modified + true 3.3 diff --git a/xml/schema/Case/Case.xml b/xml/schema/Case/Case.xml index 2f4b086a64..545765b3e0 100644 --- a/xml/schema/Case/Case.xml +++ b/xml/schema/Case/Case.xml @@ -165,6 +165,7 @@ + true 4.7 diff --git a/xml/schema/Contact/Contact.xml b/xml/schema/Contact/Contact.xml index e539c2805c..ba53ca3936 100644 --- a/xml/schema/Contact/Contact.xml +++ b/xml/schema/Contact/Contact.xml @@ -559,6 +559,7 @@ varchar 255 Cache Email Greeting. + true 3.0 @@ -594,6 +595,7 @@ varchar 255 Cache Postal greeting. + true 3.0 @@ -629,6 +631,7 @@ varchar 255 Cache Addressee. + true 3.0 @@ -752,6 +755,7 @@ 1.1 Household + true primary_contact_id diff --git a/xml/schema/Contact/Group.xml b/xml/schema/Contact/Group.xml index 5be873cd8f..6cf1f25631 100644 --- a/xml/schema/Contact/Group.xml +++ b/xml/schema/Contact/Group.xml @@ -237,6 +237,7 @@ + true 4.5 diff --git a/xml/schema/Contact/SavedSearch.xml b/xml/schema/Contact/SavedSearch.xml index 586dd30195..a06a794ab1 100644 --- a/xml/schema/Contact/SavedSearch.xml +++ b/xml/schema/Contact/SavedSearch.xml @@ -161,6 +161,7 @@ + true 5.36 @@ -193,6 +194,7 @@ true CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 5.36 + true description diff --git a/xml/schema/Contribute/ContributionRecur.xml b/xml/schema/Contribute/ContributionRecur.xml index 431bc7eea2..0d6621d02b 100644 --- a/xml/schema/Contribute/ContributionRecur.xml +++ b/xml/schema/Contribute/ContributionRecur.xml @@ -149,6 +149,7 @@ contribution_recur_modified_date Recurring Contribution Modified Date + true cancel_date diff --git a/xml/schema/Core/ActionSchedule.xml b/xml/schema/Core/ActionSchedule.xml index 8fe7ad01c8..532d6dbc61 100644 --- a/xml/schema/Core/ActionSchedule.xml +++ b/xml/schema/Core/ActionSchedule.xml @@ -424,6 +424,7 @@ 5.34 + true effective_start_date diff --git a/xml/schema/Core/Note.xml b/xml/schema/Core/Note.xml index 4f594b78d4..e15da273c2 100644 --- a/xml/schema/Core/Note.xml +++ b/xml/schema/Core/Note.xml @@ -93,6 +93,7 @@ When was this note last modified/edited CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 1.1 + true subject diff --git a/xml/schema/Cxn/Cxn.xml b/xml/schema/Cxn/Cxn.xml index 89e616d0bd..979dbcdb04 100644 --- a/xml/schema/Cxn/Cxn.xml +++ b/xml/schema/Cxn/Cxn.xml @@ -44,7 +44,7 @@ - + cxn_guid Connection GUID @@ -119,6 +119,7 @@ 4.6 + true fetched_date diff --git a/xml/schema/Mailing/Mailing.xml b/xml/schema/Mailing/Mailing.xml index 2a257dcc00..c42e8446f4 100644 --- a/xml/schema/Mailing/Mailing.xml +++ b/xml/schema/Mailing/Mailing.xml @@ -345,6 +345,7 @@ + true 4.7 diff --git a/xml/schema/Member/MembershipLog.xml b/xml/schema/Member/MembershipLog.xml index 4bd61a786d..a3c59ce07b 100644 --- a/xml/schema/Member/MembershipLog.xml +++ b/xml/schema/Member/MembershipLog.xml @@ -82,6 +82,7 @@ + true 1.5 diff --git a/xml/schema/Pledge/Pledge.xml b/xml/schema/Pledge/Pledge.xml index 58d6ef5749..0fc7c6491d 100644 --- a/xml/schema/Pledge/Pledge.xml +++ b/xml/schema/Pledge/Pledge.xml @@ -232,6 +232,7 @@ datetime Pledge Modified Date Last updated date for this pledge record. + true 2.1 -- 2.25.1