Added xml metadata for group_id column in various tables. CRM-12464
authorAllen Shaw <allen@emphanos.com>
Sat, 4 May 2013 22:28:23 +0000 (15:28 -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

CRM/Core/PseudoConstant.php
tests/phpunit/CRM/Core/PseudoConstantTest.php
xml/schema/Bridge/OG.xml
xml/schema/Bridge/Role.xml
xml/schema/Contact/GroupContact.xml
xml/schema/Contact/GroupContactCache.xml
xml/schema/Contact/GroupOrganization.xml
xml/schema/Contact/SubscriptionHistory.xml
xml/schema/Core/ActionSchedule.xml
xml/schema/Mailing/Event/Subscribe.xml

index ff35937d1af7f493f2ede7d805c2ff08097e1dfa..bb8e4bf77489ae8156221cc5d7f490ec5668e0ce 100644 (file)
@@ -57,6 +57,8 @@ class CRM_Core_PseudoConstant {
   private static $cache;
 
   /**
+   * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
+   *
    * activity type
    * @var array
    * @static
@@ -106,6 +108,8 @@ class CRM_Core_PseudoConstant {
   private static $countryIsoCode;
 
   /**
+   * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
+   *
    * group
    * @var array
    * @static
@@ -162,6 +166,8 @@ class CRM_Core_PseudoConstant {
   private static $worldRegions;
 
   /**
+   * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
+   *
    * activity status
    * @var array
    * @static
@@ -785,6 +791,8 @@ WHERE  id = %1";
   }
 
   /**
+   * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
+   *
    * Get all groups from database
    *
    * The static array group is returned, and if it's
@@ -1351,6 +1359,8 @@ WHERE  id = %1";
   }
 
   /**
+   * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
+   *
    * Get all Activity Statuses.
    *
    * The static array activityStatus is returned
index af1a2d69974018706588eb199a1111d1e4c4fb36..6df056dd58dd09ef159895e436e45f96e4cf49bd 100644 (file)
@@ -49,6 +49,7 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase {
    */
   function testOptionValues() {
 
+    // Create a custom field group for testing.
     $custom_group_name = md5(microtime());
     $api_params = array(
       'version' => 3,
@@ -58,6 +59,15 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase {
     );
     $result = civicrm_api('customGroup', 'create', $api_params);
 
+    // Create a Group for testing.
+    $group_name = md5(microtime());
+    $api_params = array(
+      'version' => 3,
+      'title' => $group_name,
+      'is_active' => TRUE,
+    );
+    $result = civicrm_api('group', 'create', $api_params);
+
     /**
      * daoName/field combinations to test
      * Format: array[DAO Name] = $properties, where properties is an array whose
@@ -68,6 +78,42 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase {
      * - max: integer (default = 10) maximum number of option values expected.
      */
     $fields = array(
+      'CRM_Contact_DAO_GroupContact' => array(
+        array(
+          'fieldName' => 'group_id',
+          'sample' => $group_name,
+        ),
+      ),
+      'CRM_Contact_DAO_GroupContactCache' => array(
+        array(
+          'fieldName' => 'group_id',
+          'sample' => $group_name,
+        ),
+      ),
+      'CRM_Contact_DAO_GroupOrganization' => array(
+        array(
+          'fieldName' => 'group_id',
+          'sample' => $group_name,
+        ),
+      ),
+      'CRM_Contact_DAO_SubscriptionHistory' => array(
+        array(
+          'fieldName' => 'group_id',
+          'sample' => $group_name,
+        ),
+      ),
+      'CRM_Core_DAO_ActionSchedule' => array(
+        array(
+          'fieldName' => 'group_id',
+          'sample' => $group_name,
+        ),
+      ),
+      'CRM_Mailing_Event_DAO_Subscribe' => array(
+        array(
+          'fieldName' => 'group_id',
+          'sample' => $group_name,
+        ),
+      ),
       'CRM_Activity_DAO_Activity' => array(
         array(
           'fieldName' => 'activity_type_id',
index c9e8a28e929f865e2d7659c7067ce8a93aa47d81..c1a171e2af30633fc81f5657f2b3658123dcd91a 100644 (file)
       <required>true</required>
       <comment>FK to civicrm group.</comment>
       <add>2.0</add>
+      <pseudoconstant>
+        <table>civicrm_group</table>
+        <keyColumn>id</keyColumn>
+        <labelColumn>title</labelColumn>
+      </pseudoconstant>
   </field>
   <foreignKey>
        <name>group_id</name>
       <required>true</required>
       <comment>FK to admin civicrm group.</comment>
       <add>2.0</add> 
+      <pseudoconstant>
+        <table>civicrm_group</table>
+        <keyColumn>id</keyColumn>
+        <labelColumn>title</labelColumn>
+      </pseudoconstant>
   </field>
   <foreignKey>
        <name>admin_group_id</name>
index 726b1583ee11fdd64067fda7a6b988bfe42f91be..948c53982c8cb67aa9f59104c4fa0006727d9bb0 100644 (file)
        <add>2.0</add> 
   </index>
   <field> 
-      <name>group_id</name> 
-      <type>int unsigned</type> 
-      <required>true</required> 
-      <comment>FK to civicrm group.</comment> 
-      <add>2.0</add> 
+    <name>group_id</name>
+    <type>int unsigned</type>
+    <required>true</required>
+    <comment>FK to civicrm group.</comment>
+    <add>2.0</add>
+    <pseudoconstant>
+      <table>civicrm_group</table>
+      <keyColumn>id</keyColumn>
+      <labelColumn>title</labelColumn>
+    </pseudoconstant>
   </field> 
   <foreignKey> 
        <name>group_id</name> 
index 1c1b8b3b60d72cf64d538acd4e507f15cb9f390f..5aed17d81b45bc791c533f427522ed03dd43503d 100644 (file)
        <autoincrement>true</autoincrement>
   </primaryKey>
   <field>
-      <name>group_id</name>
-      <type>int unsigned</type>
-      <title>Group ID</title>
-      <required>true</required>
-      <comment>FK to civicrm_group</comment>
-       <add>1.1</add>
+    <name>group_id</name>
+    <type>int unsigned</type>
+    <title>Group ID</title>
+    <required>true</required>
+    <comment>FK to civicrm_group</comment>
+    <add>1.1</add>
+    <pseudoconstant>
+      <table>civicrm_group</table>
+      <keyColumn>id</keyColumn>
+      <labelColumn>title</labelColumn>
+    </pseudoconstant>
   </field>
   <foreignKey>
        <name>group_id</name>
index 6dbc52d91ea9db243497f49c8f2a20a91512dc34..893b0e03d88fc6321bc7b6beedf96ca6aeb798e6 100644 (file)
        <autoincrement>true</autoincrement>
   </primaryKey>
   <field>
-      <name>group_id</name>
-      <type>int unsigned</type>
-      <required>true</required>
-      <comment>FK to civicrm_group</comment>
-       <add>2.1</add>
+    <name>group_id</name>
+    <type>int unsigned</type>
+    <required>true</required>
+    <comment>FK to civicrm_group</comment>
+    <add>2.1</add>
+    <pseudoconstant>
+      <table>civicrm_group</table>
+      <keyColumn>id</keyColumn>
+      <labelColumn>title</labelColumn>
+    </pseudoconstant>
   </field>
   <foreignKey>
        <name>group_id</name>
index 6d5e33253e2ebc875caea9766f0de4011d74fc2b..1f8afa6137e595cedb89a0bfbbc777db29ed2dca 100644 (file)
     <required>true</required>
     <comment>ID of the group</comment>
     <add>2.0</add>
+    <pseudoconstant>
+      <table>civicrm_group</table>
+      <keyColumn>id</keyColumn>
+      <labelColumn>title</labelColumn>
+    </pseudoconstant>
   </field>
   <foreignKey>
     <name>group_id</name>
index 846fc86dc427499553eaa2b97ee52fff735bbea5..f30869409269a25ae4a47239835d2ad77f93f1ea 100644 (file)
         <onDelete>CASCADE</onDelete>
     </foreignKey>
     <field>
-        <name>group_id</name>
-        <type>int unsigned</type>
-        <comment>Group Id</comment>
-       <add>1.1</add>
+      <name>group_id</name>
+      <type>int unsigned</type>
+      <comment>Group Id</comment>
+      <add>1.1</add>
+      <pseudoconstant>
+        <table>civicrm_group</table>
+        <keyColumn>id</keyColumn>
+        <labelColumn>title</labelColumn>
+      </pseudoconstant>
     </field>
     <foreignKey>
        <name>group_id</name>
index 12d6feb003a8de6831a89aff921e297569754521..1d4dff806c86cd3a60d30b40260b7d429db058b3 100644 (file)
        <onDelete>SET NULL</onDelete>
   </foreignKey> 
   <field>
-        <name>group_id</name>
-        <type>int unsigned</type>
-        <comment>FK to Group</comment>
-  <add>3.4</add>
-    </field>
+    <name>group_id</name>
+    <type>int unsigned</type>
+    <comment>FK to Group</comment>
+    <pseudoconstant>
+      <table>civicrm_group</table>
+      <keyColumn>id</keyColumn>
+      <labelColumn>title</labelColumn>
+    </pseudoconstant>
+    <add>3.4</add>
+  </field>
     <foreignKey>
         <name>group_id</name>
         <table>civicrm_group</table>
index 5ddf29080330931ddb73c5386597d52b4c2989c2..2a458bb6fb75b935024eff35f260a9276861e1cb 100644 (file)
         <autoincrement>true</autoincrement>
     </primaryKey>
     <field>
-        <name>group_id</name>
-        <type>int unsigned</type>
-        <required>true</required>
-        <comment>FK to Group</comment>
+      <name>group_id</name>
+      <type>int unsigned</type>
+      <required>true</required>
+      <comment>FK to Group</comment>
+      <pseudoconstant>
+        <table>civicrm_group</table>
+        <keyColumn>id</keyColumn>
+        <labelColumn>title</labelColumn>
+      </pseudoconstant>
     </field>
     <foreignKey>
         <name>group_id</name>