From: Coleman Watts <coleman@civicrm.org> Date: Wed, 12 Jun 2019 03:16:45 +0000 (-0400) Subject: Add a couple customField pseudoconstants X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=72c65bfa8227952d89905fce057a7458e5feec00;p=civicrm-core.git Add a couple customField pseudoconstants --- diff --git a/CRM/Core/DAO/CustomField.php b/CRM/Core/DAO/CustomField.php index 573ac27fa0..8bca9d2e78 100644 --- a/CRM/Core/DAO/CustomField.php +++ b/CRM/Core/DAO/CustomField.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/CustomField.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:58323f46f5ac021f96591e075b37cca6) + * (GenCodeChecksum:bd9573e2a92ef325a5bbaa1a47f28da7) */ /** @@ -197,14 +197,14 @@ class CRM_Core_DAO_CustomField extends CRM_Core_DAO { public $time_format; /** - * Number of columns in Note Field + * Number of columns in Note Field * * @var int */ public $note_columns; /** - * Number of rows in Note Field + * Number of rows in Note Field * * @var int */ @@ -570,6 +570,9 @@ class CRM_Core_DAO_CustomField extends CRM_Core_DAO { 'entity' => 'CustomField', 'bao' => 'CRM_Core_BAO_CustomField', 'localizable' => 0, + 'pseudoconstant' => [ + 'callback' => 'CRM_Core_SelectValues::getDatePluginInputFormats', + ], ], 'time_format' => [ 'name' => 'time_format', @@ -581,6 +584,9 @@ class CRM_Core_DAO_CustomField extends CRM_Core_DAO { 'entity' => 'CustomField', 'bao' => 'CRM_Core_BAO_CustomField', 'localizable' => 0, + 'pseudoconstant' => [ + 'callback' => 'CRM_Core_SelectValues::getTimeFormats', + ], ], 'note_columns' => [ 'name' => 'note_columns', diff --git a/tests/phpunit/CRM/Contact/BAO/SavedSearchTest.php b/tests/phpunit/CRM/Contact/BAO/SavedSearchTest.php index babcbe1409..0b4a7a90d7 100644 --- a/tests/phpunit/CRM/Contact/BAO/SavedSearchTest.php +++ b/tests/phpunit/CRM/Contact/BAO/SavedSearchTest.php @@ -224,7 +224,7 @@ class CRM_Contact_BAO_SavedSearchTest extends CiviUnitTestCase { 'weight' => 4, 'is_required' => 1, 'is_searchable' => 1, - 'date_format' => 'mm/dd/yyyy', + 'date_format' => 'mm/dd/yy', 'is_active' => 1, ); $customField = $this->callAPIAndDocument('custom_field', 'create', $params, __FUNCTION__, __FILE__); diff --git a/xml/schema/Core/CustomField.xml b/xml/schema/Core/CustomField.xml index 919ec75882..0db6507227 100644 --- a/xml/schema/Core/CustomField.xml +++ b/xml/schema/Core/CustomField.xml @@ -226,6 +226,9 @@ <length>64</length> <comment>date format for custom date</comment> <add>3.1</add> + <pseudoconstant> + <callback>CRM_Core_SelectValues::getDatePluginInputFormats</callback> + </pseudoconstant> </field> <field> <name>time_format</name> @@ -233,19 +236,22 @@ <title>Field Time Format</title> <comment>time format for custom date</comment> <add>3.1</add> + <pseudoconstant> + <callback>CRM_Core_SelectValues::getTimeFormats</callback> + </pseudoconstant> </field> <field> <name>note_columns</name> <type>int unsigned</type> <title>Field Note Columns</title> - <comment> Number of columns in Note Field </comment> + <comment>Number of columns in Note Field</comment> <add>1.4</add> </field> <field> <name>note_rows</name> <type>int unsigned</type> <title>Field Note Rows</title> - <comment> Number of rows in Note Field </comment> + <comment>Number of rows in Note Field</comment> <add>1.4</add> </field> <field>