From 3864a38f48bab4fd138988d01cc35736fd27442f Mon Sep 17 00:00:00 2001 From: Aidan Saunders Date: Fri, 16 Dec 2022 09:46:01 +0000 Subject: [PATCH] Enhance metadata for OptionGroups Extracted from https://github.com/civicrm/civicrm-core/pull/25180 --- CRM/Core/DAO/OptionGroup.php | 25 +++++++++++++++++++++---- xml/schema/Core/OptionGroup.xml | 23 ++++++++++++++++++++--- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/CRM/Core/DAO/OptionGroup.php b/CRM/Core/DAO/OptionGroup.php index 0b6a0d2de7..9f909157ef 100644 --- a/CRM/Core/DAO/OptionGroup.php +++ b/CRM/Core/DAO/OptionGroup.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/OptionGroup.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:6d1ca6dc8aa693e7b26bb19b731b0b55) + * (GenCodeChecksum:1d5fad72032ebfdfdce93a4b29f97542) */ /** @@ -174,12 +174,15 @@ class CRM_Core_DAO_OptionGroup extends CRM_Core_DAO { 'entity' => 'OptionGroup', 'bao' => 'CRM_Core_BAO_OptionGroup', 'localizable' => 0, + 'html' => [ + 'type' => 'Text', + ], 'add' => '1.5', ], 'title' => [ 'name' => 'title', 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Option Group title'), + 'title' => ts('Option Group Title'), 'description' => ts('Option Group title.'), 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, @@ -188,6 +191,9 @@ class CRM_Core_DAO_OptionGroup extends CRM_Core_DAO { 'entity' => 'OptionGroup', 'bao' => 'CRM_Core_BAO_OptionGroup', 'localizable' => 1, + 'html' => [ + 'type' => 'Text', + ], 'add' => '1.5', ], 'description' => [ @@ -200,6 +206,9 @@ class CRM_Core_DAO_OptionGroup extends CRM_Core_DAO { 'entity' => 'OptionGroup', 'bao' => 'CRM_Core_BAO_OptionGroup', 'localizable' => 1, + 'html' => [ + 'type' => 'Text', + ], 'add' => '1.5', ], 'data_type' => [ @@ -222,7 +231,7 @@ class CRM_Core_DAO_OptionGroup extends CRM_Core_DAO { 'is_reserved' => [ 'name' => 'is_reserved', 'type' => CRM_Utils_Type::T_BOOLEAN, - 'title' => ts('Option Group Is Reserved?'), + 'title' => ts('Option Group Is Reserved'), 'description' => ts('Is this a predefined system option group (i.e. it can not be deleted)?'), 'required' => TRUE, 'where' => 'civicrm_option_group.is_reserved', @@ -231,12 +240,16 @@ class CRM_Core_DAO_OptionGroup extends CRM_Core_DAO { 'entity' => 'OptionGroup', 'bao' => 'CRM_Core_BAO_OptionGroup', 'localizable' => 0, + 'html' => [ + 'type' => 'CheckBox', + 'label' => ts("Reserved"), + ], 'add' => '1.5', ], 'is_active' => [ 'name' => 'is_active', 'type' => CRM_Utils_Type::T_BOOLEAN, - 'title' => ts('Option Group Is Active?'), + 'title' => ts('Enabled'), 'description' => ts('Is this option group active?'), 'required' => TRUE, 'where' => 'civicrm_option_group.is_active', @@ -263,6 +276,10 @@ class CRM_Core_DAO_OptionGroup extends CRM_Core_DAO { 'entity' => 'OptionGroup', 'bao' => 'CRM_Core_BAO_OptionGroup', 'localizable' => 0, + 'html' => [ + 'type' => 'CheckBox', + 'label' => ts("Locked"), + ], 'add' => '4.5', ], 'option_value_fields' => [ diff --git a/xml/schema/Core/OptionGroup.xml b/xml/schema/Core/OptionGroup.xml index f4e3f62031..25469867cb 100644 --- a/xml/schema/Core/OptionGroup.xml +++ b/xml/schema/Core/OptionGroup.xml @@ -29,15 +29,21 @@ true Option group name. Used as selection key by class properties which lookup options in civicrm_option_value. 1.5 + + Text + title - Option Group title + Option Group Title varchar 255 true Option Group title. 1.5 + + Text + description @@ -46,6 +52,9 @@ true Option group description. 1.5 + + Text + data_type @@ -60,16 +69,20 @@ is_reserved - Option Group Is Reserved? + Option Group Is Reserved boolean 1 true Is this a predefined system option group (i.e. it can not be deleted)? 1.5 + + CheckBox + + is_active - Option Group Is Active? + Enabled boolean 1 true @@ -88,6 +101,10 @@ true A lock to remove the ability to add new options via the UI. 4.5 + + CheckBox + + option_value_fields -- 2.25.1