Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance metadata for OptionGroups #25188

Merged
merged 2 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions CRM/Core/DAO/OptionGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Core/OptionGroup.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:6d1ca6dc8aa693e7b26bb19b731b0b55)
* (GenCodeChecksum:cccb007e18d25b34d3af8fd583ade04b)
*/

/**
Expand Down Expand Up @@ -37,6 +37,16 @@ class CRM_Core_DAO_OptionGroup extends CRM_Core_DAO {
*/
public static $_log = TRUE;

/**
* Paths for accessing this entity in the UI.
*
* @var string[]
*/
protected static $_paths = [
'add' => 'civicrm/admin/options?action=add&reset=1',
'update' => 'civicrm/admin/options?action=update&reset=1&id=[id]',
];

/**
* Option Group ID
*
Expand Down Expand Up @@ -174,12 +184,15 @@ public static function &fields() {
'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,
Expand All @@ -188,6 +201,9 @@ public static function &fields() {
'entity' => 'OptionGroup',
'bao' => 'CRM_Core_BAO_OptionGroup',
'localizable' => 1,
'html' => [
'type' => 'Text',
],
'add' => '1.5',
],
'description' => [
Expand All @@ -200,6 +216,9 @@ public static function &fields() {
'entity' => 'OptionGroup',
'bao' => 'CRM_Core_BAO_OptionGroup',
'localizable' => 1,
'html' => [
'type' => 'Text',
],
'add' => '1.5',
],
'data_type' => [
Expand All @@ -222,7 +241,7 @@ public static function &fields() {
'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',
Expand All @@ -231,12 +250,16 @@ public static function &fields() {
'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',
Expand All @@ -263,6 +286,10 @@ public static function &fields() {
'entity' => 'OptionGroup',
'bao' => 'CRM_Core_BAO_OptionGroup',
'localizable' => 0,
'html' => [
'type' => 'CheckBox',
'label' => ts("Locked"),
],
'add' => '4.5',
],
'option_value_fields' => [
Expand Down
27 changes: 24 additions & 3 deletions xml/schema/Core/OptionGroup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<name>civicrm_option_group</name>
<add>1.5</add>
<log>true</log>
<paths>
<add>civicrm/admin/options?action=add&amp;reset=1</add>
<update>civicrm/admin/options?action=update&amp;reset=1&amp;id=[id]</update>
</paths>
<field>
<name>id</name>
<title>Option Group ID</title>
Expand All @@ -29,15 +33,21 @@
<required>true</required>
<comment>Option group name. Used as selection key by class properties which lookup options in civicrm_option_value.</comment>
<add>1.5</add>
<html>
<type>Text</type>
</html>
</field>
<field>
<name>title</name>
<title>Option Group title</title>
<title>Option Group Title</title>
<type>varchar</type>
<length>255</length>
<localizable>true</localizable>
<comment>Option Group title.</comment>
<add>1.5</add>
<html>
<type>Text</type>
</html>
</field>
<field>
<name>description</name>
Expand All @@ -46,6 +56,9 @@
<localizable>true</localizable>
<comment>Option group description.</comment>
<add>1.5</add>
<html>
<type>Text</type>
</html>
</field>
<field>
<name>data_type</name>
Expand All @@ -60,16 +73,20 @@
</field>
<field>
<name>is_reserved</name>
<title>Option Group Is Reserved?</title>
<title>Option Group Is Reserved</title>
<type>boolean</type>
<default>1</default>
<required>true</required>
<comment>Is this a predefined system option group (i.e. it can not be deleted)?</comment>
<add>1.5</add>
<html>
<type>CheckBox</type>
<label>Reserved</label>
</html>
</field>
<field>
<name>is_active</name>
<title>Option Group Is Active?</title>
<title>Enabled</title>
<type>boolean</type>
<default>1</default>
<required>true</required>
Expand All @@ -88,6 +105,10 @@
<required>true</required>
<comment>A lock to remove the ability to add new options via the UI.</comment>
<add>4.5</add>
<html>
<type>CheckBox</type>
<label>Locked</label>
</html>
</field>
<field>
<name>option_value_fields</name>
Expand Down