Added meta-data to XML schema for fields referencing 'activity_type' and 'visibility...
authorAllen Shaw <allen@emphanos.com>
Sat, 4 May 2013 00:30:49 +0000 (17:30 -0700)
committerColeman Watts <coleman@civicrm.org>
Thu, 30 May 2013 05:14:04 +0000 (22:14 -0700)
----------------------------------------
* CRM-12464: Search improvements in 4.4
  http://issues.civicrm.org/jira/browse/CRM-12464

tests/phpunit/CRM/Core/PseudoConstantTest.php
xml/schema/Activity/Activity.xml
xml/schema/Campaign/Survey.xml
xml/schema/Event/ParticipantStatusType.xml
xml/schema/Member/MembershipType.xml
xml/schema/Price/Field.xml

index e47eacfc06340d358c0696963e162e2b28fa302a..26360f86e4c9898eaba4604d29c48cab2e8784f7 100644 (file)
@@ -68,6 +68,42 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase {
      * - max: integer (default = 10) maximum number of option values expected.
      */
     $fields = array(
+      'CRM_Activity_DAO_Activity' => array(
+        array(
+          'fieldName' => 'activity_type_id',
+          'sample' => 'Text Message (SMS)',
+          'max' => 50,
+        ),
+        array(
+          'fieldName' => 'status_id',
+          'sample' => 'Scheduled',
+        ),
+      ),
+      'CRM_Campaign_DAO_Survey' => array(
+        array(
+          'fieldName' => 'activity_type_id',
+          'sample' => 'Text Message (SMS)',
+          'max' => 50,
+        ),
+      ),
+      'CRM_Event_DAO_ParticipantStatusType' => array(
+        array(
+          'fieldName' => 'visibility_id',
+          'sample' => 'Public',
+        ),
+      ),
+      'CRM_Member_DAO_MembershipType' => array(
+        array(
+          'fieldName' => 'visibility',
+          'sample' => 'Public',
+        ),
+      ),
+      'CRM_Price_DAO_Field' => array(
+        array(
+          'fieldName' => 'visibility_id',
+          'sample' => 'Public',
+        ),
+      ),
       'CRM_Financial_DAO_EntityFinancialAccount' => array(
         array(
           'fieldName' => 'financial_account_id',
index 7f80e1f923b10e31dd9a6900e6c18e6d4da3b5f2..cb229b34b4f1781644d9d5f098b37bdeb8d9269c 100644 (file)
        <add>3.2</add>
   </index>
   <field>
-       <name>activity_type_id</name>
-       <title>Activity Type ID</title>
-       <import>true</import>
-       <type>int unsigned</type>
-       <required>true</required>
-       <export>false</export>
-       <default>1</default>
-       <headerPattern>/(activity.)?type(.id$)/i</headerPattern>
-       <comment>FK to civicrm_option_value.id, that has to be valid, registered activity type.</comment>
-       <add>1.1</add>
+      <name>activity_type_id</name>
+      <title>Activity Type ID</title>
+      <import>true</import>
+      <type>int unsigned</type>
+      <required>true</required>
+      <export>false</export>
+      <default>1</default>
+      <headerPattern>/(activity.)?type(.id$)/i</headerPattern>
+      <comment>FK to civicrm_option_value.id, that has to be valid, registered activity type.</comment>
+      <add>1.1</add>
+      <pseudoconstant>
+        <optionGroupName>activity_type</optionGroupName>
+      </pseudoconstant>
   </field>
   <index>
        <name>UI_activity_type_id</name>
       <type>int unsigned</type>
       <comment>ID of the status this activity is currently in. Foreign key to civicrm_option_value.</comment>
       <add>2.0</add>
+      <pseudoconstant>
+        <optionGroupName>activity_status</optionGroupName>
+      </pseudoconstant>
   </field>
   <field>
       <name>priority_id</name>
index 3faa1a2dc66bd198ae4ab070ca816c48db6ea283..683fee058d7d52c9bac1c8096b06389721674518 100644 (file)
@@ -52,6 +52,9 @@
     <comment>Implicit FK to civicrm_option_value where option_group = activity_type</comment> 
     <import>true</import>
     <add>3.3</add>
+    <pseudoconstant>
+      <optionGroupName>activity_type</optionGroupName>
+    </pseudoconstant>
   </field>
   <index>
     <name>UI_activity_type_id</name>
index afe6f870a6648fdfef86b66179e321a6e28e1efe..55b67ceafdd08b4cddff3d086b0b663c8746ac41 100644 (file)
@@ -75,5 +75,8 @@
     <type>int unsigned</type>
     <comment>whether the status type is visible to the public, an implicit foreign key to option_value.value related to the `visibility` option_group</comment>
     <add>3.0</add>
+    <pseudoconstant>
+      <optionGroupName>visibility</optionGroupName>
+    </pseudoconstant>
   </field>
 </table>
index bdbd0610162a9f3d1f76292bb70394a3665bb52a..b713a1ce89fb6d2487f32a781c7c29fce54ee0d8 100644 (file)
     <title>Visible</title>
     <type>varchar</type>
     <length>64</length>
-    <add>1.5</add>  
+    <add>1.5</add>
+    <pseudoconstant>
+      <optionGroupName>visibility</optionGroupName>
+      <labelColumn>label</labelColumn>
+    </pseudoconstant>
   </field>
   <field>  
     <name>weight</name>     
index f817910fbe3d2fb0d8dd11fcc3abbe0e985d6e81..5d7472a74ac44b5318ce9ce33914618aa6b36a39 100644 (file)
       <default>1</default>
       <comment>Implicit FK to civicrm_option_group with name = \'visibility\'</comment>
       <add>3.2</add>
+      <pseudoconstant>
+        <optionGroupName>visibility</optionGroupName>
+      </pseudoconstant>
    </field>   
    <field>
       <name>count</name>