From 4080e4734ce6e9b739992a9a231d7f39e5e38bc8 Mon Sep 17 00:00:00 2001 From: Allen Shaw Date: Fri, 3 May 2013 17:30:49 -0700 Subject: [PATCH] Added meta-data to XML schema for fields referencing 'activity_type' and 'visibility' option_group values. CRM-12464 ---------------------------------------- * CRM-12464: Search improvements in 4.4 http://issues.civicrm.org/jira/browse/CRM-12464 --- tests/phpunit/CRM/Core/PseudoConstantTest.php | 36 +++++++++++++++++++ xml/schema/Activity/Activity.xml | 26 ++++++++------ xml/schema/Campaign/Survey.xml | 3 ++ xml/schema/Event/ParticipantStatusType.xml | 3 ++ xml/schema/Member/MembershipType.xml | 6 +++- xml/schema/Price/Field.xml | 3 ++ 6 files changed, 66 insertions(+), 11 deletions(-) diff --git a/tests/phpunit/CRM/Core/PseudoConstantTest.php b/tests/phpunit/CRM/Core/PseudoConstantTest.php index e47eacfc06..26360f86e4 100644 --- a/tests/phpunit/CRM/Core/PseudoConstantTest.php +++ b/tests/phpunit/CRM/Core/PseudoConstantTest.php @@ -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', diff --git a/xml/schema/Activity/Activity.xml b/xml/schema/Activity/Activity.xml index 7f80e1f923..cb229b34b4 100644 --- a/xml/schema/Activity/Activity.xml +++ b/xml/schema/Activity/Activity.xml @@ -58,16 +58,19 @@ 3.2 - activity_type_id - Activity Type ID - true - int unsigned - true - false - 1 - /(activity.)?type(.id$)/i - FK to civicrm_option_value.id, that has to be valid, registered activity type. - 1.1 + activity_type_id + Activity Type ID + true + int unsigned + true + false + 1 + /(activity.)?type(.id$)/i + FK to civicrm_option_value.id, that has to be valid, registered activity type. + 1.1 + + activity_type + UI_activity_type_id @@ -227,6 +230,9 @@ int unsigned ID of the status this activity is currently in. Foreign key to civicrm_option_value. 2.0 + + activity_status + priority_id diff --git a/xml/schema/Campaign/Survey.xml b/xml/schema/Campaign/Survey.xml index 3faa1a2dc6..683fee058d 100644 --- a/xml/schema/Campaign/Survey.xml +++ b/xml/schema/Campaign/Survey.xml @@ -52,6 +52,9 @@ Implicit FK to civicrm_option_value where option_group = activity_type true 3.3 + + activity_type + UI_activity_type_id diff --git a/xml/schema/Event/ParticipantStatusType.xml b/xml/schema/Event/ParticipantStatusType.xml index afe6f870a6..55b67ceafd 100644 --- a/xml/schema/Event/ParticipantStatusType.xml +++ b/xml/schema/Event/ParticipantStatusType.xml @@ -75,5 +75,8 @@ int unsigned whether the status type is visible to the public, an implicit foreign key to option_value.value related to the `visibility` option_group 3.0 + + visibility + diff --git a/xml/schema/Member/MembershipType.xml b/xml/schema/Member/MembershipType.xml index bdbd061016..b713a1ce89 100644 --- a/xml/schema/Member/MembershipType.xml +++ b/xml/schema/Member/MembershipType.xml @@ -170,7 +170,11 @@ Visible varchar 64 - 1.5 + 1.5 + + visibility + label + weight diff --git a/xml/schema/Price/Field.xml b/xml/schema/Price/Field.xml index f817910fbe..5d7472a74a 100644 --- a/xml/schema/Price/Field.xml +++ b/xml/schema/Price/Field.xml @@ -149,6 +149,9 @@ 1 Implicit FK to civicrm_option_group with name = \'visibility\' 3.2 + + visibility + count -- 2.25.1