Add a couple customField pseudoconstants
authorColeman Watts <coleman@civicrm.org>
Wed, 12 Jun 2019 03:16:45 +0000 (23:16 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 12 Jun 2019 14:43:08 +0000 (10:43 -0400)
CRM/Core/DAO/CustomField.php
tests/phpunit/CRM/Contact/BAO/SavedSearchTest.php
xml/schema/Core/CustomField.xml

index 573ac27fa01bcceb9792c5fa5d4a13329e4fc2eb..8bca9d2e78881af935e0444c5f2d8221039d9c4f 100644 (file)
@@ -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',
index babcbe14092deab30d5814aeca3bde91288a14c5..0b4a7a90d79a1bfdcea7a073fe9a8128db120717 100644 (file)
@@ -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__);
index 919ec7588276e05e5e2bd0e1c8291fd64cfef893..0db65072278a4ceee2e3ebe86aba76c2326fa530 100644 (file)
     <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>
     <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>