From: Coleman Watts Date: Wed, 8 May 2013 23:41:35 +0000 (-0700) Subject: Case, Campaign, Language PseudoConstants CRM-12464 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3f3a3ba09a3ea7bbc34511c5d8039d48aa2dd0e7;p=civicrm-core.git Case, Campaign, Language PseudoConstants CRM-12464 ---------------------------------------- * CRM-12464: Search improvements in 4.4 http://issues.civicrm.org/jira/browse/CRM-12464 --- diff --git a/CRM/Campaign/PseudoConstant.php b/CRM/Campaign/PseudoConstant.php index 5f3920ea8b..73592c94b4 100755 --- a/CRM/Campaign/PseudoConstant.php +++ b/CRM/Campaign/PseudoConstant.php @@ -67,6 +67,7 @@ class CRM_Campaign_PseudoConstant extends CRM_Core_PseudoConstant { private static $engagementLevel; /** + * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object. * Get all the survey activity types * * @access public @@ -91,6 +92,7 @@ class CRM_Campaign_PseudoConstant extends CRM_Core_PseudoConstant { } /** + * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object. * Get all campaign types. * * The static array campaignType is returned @@ -110,6 +112,7 @@ class CRM_Campaign_PseudoConstant extends CRM_Core_PseudoConstant { } /** + * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object. * Get all campaign status. * * The static array campaignStatus is returned @@ -129,6 +132,7 @@ class CRM_Campaign_PseudoConstant extends CRM_Core_PseudoConstant { } /** + * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object. * Get all Engagement Level. * * The static array Engagement Level is returned @@ -148,7 +152,7 @@ class CRM_Campaign_PseudoConstant extends CRM_Core_PseudoConstant { /** * Flush given pseudoconstant so it can be reread from db - * nex time it's requested. + * next time it's requested. * * @access public * @static @@ -156,7 +160,7 @@ class CRM_Campaign_PseudoConstant extends CRM_Core_PseudoConstant { * @param boolean $name pseudoconstant to be flushed * */ - public static function flush($name) { + public static function flush($name = 'cache') { if (isset(self::$$name)) { self::$$name = NULL; } diff --git a/CRM/Case/PseudoConstant.php b/CRM/Case/PseudoConstant.php index 1c2c2e93fc..c597da5b15 100644 --- a/CRM/Case/PseudoConstant.php +++ b/CRM/Case/PseudoConstant.php @@ -265,7 +265,7 @@ class CRM_Case_PseudoConstant extends CRM_Core_PseudoConstant { /** * Flush given pseudoconstant so it can be reread from db - * nex time it's requested. + * next time it's requested. * * @access public * @static @@ -273,7 +273,7 @@ class CRM_Case_PseudoConstant extends CRM_Core_PseudoConstant { * @param boolean $name pseudoconstant to be flushed * */ - public static function flush($name) { + public static function flush($name = 'cache') { if (isset(self::$$name)) { self::$$name = NULL; } diff --git a/CRM/Contribute/PseudoConstant.php b/CRM/Contribute/PseudoConstant.php index 9b8302e613..e83383a3eb 100644 --- a/CRM/Contribute/PseudoConstant.php +++ b/CRM/Contribute/PseudoConstant.php @@ -83,14 +83,6 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant { */ private static $paymentInstrument; - /** - * credit card - * - * @var array - * @static - */ - private static $creditCard; - /** * contribution status * @@ -114,6 +106,8 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant { private static $pcpStatus; /** + * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object. + * * Get all the financial types * * @access public @@ -142,6 +136,8 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant { } /** + * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object. + * * Get all the financial Accounts * * @access public @@ -191,6 +187,8 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant { } /** + * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object. + * * Get all the contribution pages * * @param integer $id id of the contribution page @@ -223,6 +221,8 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant { } /** + * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object. + * * Get all the payment instruments * * @access public @@ -249,16 +249,7 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant { * @static */ public static function &creditCard() { - $acceptCreditCard = array(); - $creditCard = CRM_Core_OptionGroup::values('accept_creditcard'); - - if (!$creditCard) { - $creditCard = array(); - } - foreach ($creditCard as $key => $value) { - $acceptCreditCard[$value] = $value; - } - return $acceptCreditCard; + return CRM_Core_OptionGroup::values('accept_creditcard', FALSE, FALSE, FALSE, NULL, 'label', TRUE, FALSE, 'name'); } /** diff --git a/CRM/Core/OptionGroup.php b/CRM/Core/OptionGroup.php index 6f4fd7faf9..64131a314b 100644 --- a/CRM/Core/OptionGroup.php +++ b/CRM/Core/OptionGroup.php @@ -92,6 +92,7 @@ class CRM_Core_OptionGroup { * @param $labelColumnName string the column to use for 'label' * @param $onlyActive boolean return only the action option values * @param $fresh boolean ignore cache entries and go back to DB + * @param $keyColumnName string the column to use for 'key' * * @return array the values as specified by the above params * @static diff --git a/CRM/Core/Payment/Form.php b/CRM/Core/Payment/Form.php index 91d913a1a2..9f61ac2276 100644 --- a/CRM/Core/Payment/Form.php +++ b/CRM/Core/Payment/Form.php @@ -186,7 +186,8 @@ class CRM_Core_Payment_Form { ); } - /** create all fields needed for direct debit transaction + /** + * create all fields needed for direct debit transaction * * @return void * @access public diff --git a/CRM/Core/PseudoConstant.php b/CRM/Core/PseudoConstant.php index d70e769ac6..bad70b4eee 100644 --- a/CRM/Core/PseudoConstant.php +++ b/CRM/Core/PseudoConstant.php @@ -1261,6 +1261,7 @@ WHERE id = %1"; } /** + * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object. * Get all active payment processors * * The static array paymentProcessor is returned @@ -1295,7 +1296,7 @@ WHERE id = %1"; } /** - * Get all active payment processors + * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object. * * The static array paymentProcessorType is returned * diff --git a/tests/phpunit/CRM/Core/PseudoConstantTest.php b/tests/phpunit/CRM/Core/PseudoConstantTest.php index 0658a5185a..67b8a80848 100644 --- a/tests/phpunit/CRM/Core/PseudoConstantTest.php +++ b/tests/phpunit/CRM/Core/PseudoConstantTest.php @@ -146,6 +146,21 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 'fieldName' => 'priority_id', 'sample' => 'Urgent', ), + array( + 'fieldName' => 'engagement_level', + 'sample' => '1', + ), + array( + 'fieldName' => 'medium_id', + 'sample' => 'Phone', + ), + ), + 'CRM_Campaign_DAO_Campaign' => array( + array( + 'fieldName' => 'status_id', + 'sample' => 'Completed', + 'max' => 50, + ), ), 'CRM_Campaign_DAO_Survey' => array( array( @@ -522,6 +537,12 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 'max' => 200, ), ), + 'CRM_Case_DAO_Case' => array( + array( + 'fieldName' => 'status_id', + 'sample' => 'Ongoing', + ), + ), ); foreach ($fields as $daoName => $daoFields) { diff --git a/xml/schema/Activity/Activity.xml b/xml/schema/Activity/Activity.xml index cb229b34b4..98175f3783 100644 --- a/xml/schema/Activity/Activity.xml +++ b/xml/schema/Activity/Activity.xml @@ -9,7 +9,7 @@ id activity_id - Activity ID + Activity ID true int unsigned true @@ -23,7 +23,7 @@ source_contact_id int unsigned - Source Contact + Source Contact true /(activity.)?source(.contact(.id)?)?/i Contact ID of the person scheduling or logging this Activity. Usually the authenticated user. @@ -37,10 +37,10 @@ 1.1 4.4 SET NULL - + UI_source_contact_id - source_contact_id + source_contact_id 2.0 3.2 @@ -54,7 +54,7 @@ UI_source_record_id - source_record_id + source_record_id 3.2 @@ -74,7 +74,7 @@ UI_activity_type_id - activity_type_id + activity_type_id 1.6 @@ -85,7 +85,7 @@ true Name of table where item being referenced is stored. 1.1 - 2.0 + 2.0 @@ -94,7 +94,7 @@ true Foreign key to the referenced item. 1.1 - 2.0 + 2.0 @@ -117,7 +117,7 @@ 1.1 2.0 - + activity_date_time true @@ -126,20 +126,20 @@ /(activity.)?date(.time$)?/i Date and time this activity is scheduled to occur. Formerly named scheduled_date_time. 2.0 - + due_date_time datetime Date and time this activity is due. 2.0 - 3.0 - + 3.0 + duration_hours int unsigned Planned or actual duration of meeting - hours. 1.1 - 2.0 + 2.0 @@ -147,13 +147,13 @@ int unsigned Planned or actual duration of meeting - minutes. 1.1 - 2.0 + 2.0 duration activity_duration - Duration + Duration true int unsigned /(activity.)?duration(s)?$/i @@ -201,7 +201,7 @@ details activity_details Details - true + true text 8 60 @@ -262,7 +262,7 @@ is_test Test - activity_is_test + activity_is_test boolean 0 true @@ -270,13 +270,16 @@ 2.0 - medium_id - activity_medium_id - Activity Medium - int unsigned - NULL - Activity Medium, Implicit FK to civicrm_option_value where option_group = encounter_medium. - 2.2 + medium_id + activity_medium_id + Activity Medium + int unsigned + NULL + Activity Medium, Implicit FK to civicrm_option_value where option_group = encounter_medium. + + encounter_medium + + 2.2 index_medium_id @@ -289,21 +292,21 @@ boolean 0 2.2 - - + + relationship_id Relationship Id - int unsigned + int unsigned NULL - FK to Relationship ID - 2.2 + FK to Relationship ID + 2.2 - - relationship_id - civicrm_relationship
- id + + relationship_id + civicrm_relationship
+ id SET NULL -
+
is_current_revision Is this activity a current revision in versioning chain? @@ -317,7 +320,7 @@ index_is_current_revision is_current_revision 2.2 - + original_id int unsigned @@ -337,7 +340,7 @@ original_id 2.2 3.2 - + result activity_result @@ -362,32 +365,33 @@ is_deleted 2.2 - + campaign_id activity_campaign_id int unsigned Campaign ID - true - The campaign for which this activity has been triggered. - 3.4 - - - engagement_level - activity_engagement_level - int unsigned - - - Engagement Index true - Assign a specific level of engagement to this activity. Used for tracking constituents in ladder of engagement. - 3.4 + The campaign for which this activity has been triggered. + 3.4 - - campaign_id - civicrm_campaign
- id + + campaign_id + civicrm_campaign
+ id SET NULL
+ + engagement_level + activity_engagement_level + int unsigned + Engagement Index + true + Assign a specific level of engagement to this activity. Used for tracking constituents in ladder of engagement. + + engagement_index + + 3.4 + weight int diff --git a/xml/schema/Campaign/Campaign.xml b/xml/schema/Campaign/Campaign.xml index 0b93e63370..adbdc24ef4 100644 --- a/xml/schema/Campaign/Campaign.xml +++ b/xml/schema/Campaign/Campaign.xml @@ -79,8 +79,11 @@ NULL Campaign Type ID.Implicit FK to civicrm_option_value where option_group = campaign_type true - 3.3 - + + campaign_type + + 3.3 +
UI_campaign_type_id campaign_type_id @@ -94,6 +97,9 @@ NULL Campaign status ID.Implicit FK to civicrm_option_value where option_group = campaign_status true + + campaign_status + 3.3
diff --git a/xml/schema/Case/Case.xml b/xml/schema/Case/Case.xml index 3de0b94e63..1e8907dc08 100644 --- a/xml/schema/Case/Case.xml +++ b/xml/schema/Case/Case.xml @@ -45,7 +45,10 @@ true false Case Type Id - Id of first case category. + Multivalued pseudo-fk to option_value table where option_group_name = case_type. + + case_type + 2.0
@@ -144,6 +147,9 @@ false Case Status Id Id of case status. + + case_status + 1.8
diff --git a/xml/schema/Event/Event.xml b/xml/schema/Event/Event.xml index 921b5b0eda..06c9be9f6c 100644 --- a/xml/schema/Event/Event.xml +++ b/xml/schema/Event/Event.xml @@ -1,51 +1,51 @@ - + - - CRM/Event - Event - civicrm_event - 1.7 +
+ CRM/Event + Event + civicrm_event + 1.7true - - id - int unsigned + + id + int unsigned Event ID - true - Event - 1.7 - - - id - true - - - title + true + Event + 1.7 + + + id + true + + + title event_title - varchar + varchar true Event Title /(event.)?title$/i - 255 + 255 true Event Title (e.g. Fall Fundraiser Dinner) - 1.7 - - + 1.7 + + summary - text - Event Summary + text + Event Summary textarea 4 60 true Brief summary of event. Text and html allowed. Displayed on Event Registration form and can be used on other CMS pages which need an event summary. - 1.7 - - - description - text + 1.7 + + + description + text event_description - Event Description + Event Description textarea 8 60 @@ -62,36 +62,36 @@ event_type - Event Type ID.Implicit FK to civicrm_option_value where option_group = event_type. - 1.7 - + Event Type ID.Implicit FK to civicrm_option_value where option_group = event_type. + 1.7 + index_event_type_id event_type_id 1.8 - - participant_listing_id - int unsigned + + participant_listing_id + int unsigned participant_listing_id - Participant Listing ID - 0 - Should we expose the participant list? Implicit FK to civicrm_option_value where option_group = participant_listing. - 2.0 - + Participant Listing ID + 0 + Should we expose the participant list? Implicit FK to civicrm_option_value where option_group = participant_listing. + 2.0 + index_participant_listing_id participant_listing_id 2.0 - - is_public - boolean - Is Event Public - 1 - Public events will be included in the iCal feeds. Access to private event information may be limited using ACLs. - 1.7 - + + is_public + boolean + Is Event Public + 1 + Public events will be included in the iCal feeds. Access to private event information may be limited using ACLs. + 1.7 + start_date datetime @@ -112,23 +112,23 @@ Date and time that event ends. May be NULL if no defined end date/time 1.7 - - is_online_registration - boolean + + is_online_registration + boolean Is Online Registration - 0 - If true, include registration link on Event Info page. - 1.7 + 0 + If true, include registration link on Event Info page. + 1.7 - - registration_link_text - varchar + + registration_link_text + varchar Event Registration Link Text - 255 + 255 true Text for link to Event Registration form which is displayed on Event Information screen when is_online_registration is true. - 1.7 - + 1.7 + registration_start_date datetime @@ -141,44 +141,44 @@ Date and time that online registration ends. 1.8 - - max_participants - int unsigned + + max_participants + int unsigned Max Participants NULL - Maximum number of registered participants to allow. After max is reached, a custom Event Full message is displayed. If NULL, allow unlimited number of participants. - 1.7 + Maximum number of registered participants to allow. After max is reached, a custom Event Full message is displayed. If NULL, allow unlimited number of participants. + 1.7 - - event_full_text - text + + event_full_text + text Event Information textarea 4 60 true - Message to display on Event Information page and INSTEAD OF Event Registration form if maximum participants are signed up. Can include email address/info about getting on a waiting list, etc. Text and html allowed. - 1.7 + Message to display on Event Information page and INSTEAD OF Event Registration form if maximum participants are signed up. Can include email address/info about getting on a waiting list, etc. Text and html allowed. + 1.7 - - is_monetary + + is_monetary Is this a PAID event? - boolean - 0 - If true, one or more fee amounts must be set and a Payment Processor must be configured for Online Event Registration. - 1.7 - - - contribution_type_id - int unsigned + boolean 0 - Contribution type assigned to paid event registrations for this event. Required if is_monetary is true. + If true, one or more fee amounts must be set and a Payment Processor must be configured for Online Event Registration. + 1.7 + + + contribution_type_id + int unsigned + 0 + Contribution type assigned to paid event registrations for this event. Required if is_monetary is true. 1.7 4.3 - - financial_type_id - int unsigned + + financial_type_id + int unsigned Financial Type ID NULL Financial type assigned to paid event registrations for this event. Required if is_monetary is true. @@ -187,7 +187,7 @@ id name - 4.3 + 4.3 payment_processor @@ -201,21 +201,21 @@ 1.8 - + is_map Map Enabled - boolean + boolean 0 - Include a map block on the Event Information page when geocode info is available and a mapping provider has been specified? - 1.7 - + Include a map block on the Event Information page when geocode info is available and a mapping provider has been specified? + 1.7 + is_active Is Active boolean 0 - Is this Event enabled or disabled/cancelled? - 1.7 + Is this Event enabled or disabled/cancelled? + 1.7 fee_label @@ -226,15 +226,15 @@ 255 true 1.8 - - - is_show_location - boolean + + + is_show_location + boolean show location - 1 - If true, show event location. - 1.7 - + 1 + If true, show event location. + 1.7 + loc_block_id int unsigned @@ -260,119 +260,119 @@ 2.0 2.1 - - default_role_id + + default_role_id default_role_id Participant Role true - int unsigned + int unsigned 1 - Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role. - 2.0 + Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role. + 2.0 - - intro_text - text + + intro_text + text textarea 6 50 Introductory Message true Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form. - 1.7 - - - footer_text + 1.7 + + + footer_text Footer Message - text + text textarea 6 50 true Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form. - 1.7 - - - confirm_title - varchar + 1.7 + + + confirm_title + varchar Confirmation Title - 255 + 255 NULL true Title for Confirmation page. - 1.7 - - - confirm_text - text + 1.7 + + + confirm_text + text textarea 6 50 Confirm Text true Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form. - 1.7 - - - confirm_footer_text - text + 1.7 + + + confirm_footer_text + text Footer Text textarea 6 50 true Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form. - 1.7 - - - is_email_confirm - boolean + 1.7 + + + is_email_confirm + boolean Is confirm email - 0 - If true, confirmation is automatically emailed to contact on successful registration. - 1.7 - - - confirm_email_text - text + 0 + If true, confirmation is automatically emailed to contact on successful registration. + 1.7 + + + confirm_email_text + text Confirmation Email Text textarea 4 50 true text to include above standard event info on confirmation email. emails are text-only, so do not allow html for now - 1.7 - - - confirm_from_name - varchar + 1.7 + + + confirm_from_name + varchar Confirm From Name - 255 + 255 true FROM email name used for confirmation emails. - 1.7 + 1.7 - - confirm_from_email - varchar + + confirm_from_email + varchar Confirm From Email - 255 + 255 FROM email address used for confirmation emails. - 1.7 - - - cc_confirm - varchar - 255 + 1.7 + + + cc_confirm + varchar + 255 comma-separated list of email addresses to cc each time a confirmation is sent - 1.7 + 1.7 - - bcc_confirm - varchar - 255 + + bcc_confirm + varchar + 255 comma-separated list of email addresses to bcc each time a confirmation is sent - 1.7 + 1.7 default_fee_id @@ -388,52 +388,52 @@ FK to civicrm_option_value. 1.7 - - thankyou_title - varchar + + thankyou_title + varchar ThankYou Title - 255 + 255 NULL true Title for ThankYou page. - 1.7 - - - thankyou_text - text + 1.7 + + + thankyou_text + text textarea 6 50 ThankYou Text true ThankYou Text. - 1.7 - - - thankyou_footer_text - text + 1.7 + + + thankyou_footer_text + text Footer Text textarea 6 50 true Footer message. - 1.7 - - + 1.7 + + is_pay_later Pay Later Allowed boolean 0 - if true - allows the user to send payment directly to the org later - 2.0 + if true - allows the user to send payment directly to the org later + 2.0 - + pay_later_text Pay Later Text text true - The text displayed to the user in the main form + The text displayed to the user in the main form 2.0 @@ -441,57 +441,57 @@ Pay Later Receipt Text text true - The receipt sent to the user instead of the normal receipt text + The receipt sent to the user instead of the normal receipt text 2.0 - + is_partial_payment Partial Payments Enabled - boolean - 0 - is partial payment enabled for this event - 4.3 + boolean + 0 + is partial payment enabled for this event + 4.3 - + initial_amount_label Initial Amount Label varchar - 255 + 255 true - Initial amount label for partial payment - 4.3 + Initial amount label for partial payment + 4.3 - + initial_amount_help_text Initial Amount Help Text text true - Initial amount help text for partial payment - 4.3 + Initial amount help text for partial payment + 4.3 - + min_initial_amount Minimum Initial Amount decimal - Minimum initial amount for partial payment - 4.3 + Minimum initial amount for partial payment + 4.3 - + is_multiple_registrations Allow Multiple Registrations boolean 0 - if true - allows the user to register multiple participants for event - 2.1 + if true - allows the user to register multiple participants for event + 2.1 - - allow_same_participant_emails - boolean + + allow_same_participant_emails + boolean Does Event allow multiple registrations from same email address? - 0 - if true - allows the user to register multiple registrations from same email address. - 2.2 - + 0 + if true - allows the user to register multiple registrations from same email address. + 2.2 + has_waitlist Waitlist Enabled @@ -539,17 +539,17 @@ whether the event has template 3.0 - - template_title + + template_title template_title - varchar + varchar true Event Template Title /(template.)?title$/i - 255 + 255 true Event Template Title - 3.0 + 3.0 created_id @@ -572,9 +572,9 @@ Date and time that event was created. 3.0 - - currency - varchar + + currency + varchar 3 true /cur(rency)?/i @@ -592,7 +592,7 @@ int unsigned Campaign ID The campaign for which this event has been created. - 3.4 + 3.4 campaign_id @@ -606,7 +606,7 @@ boolean 1 Can people share the event through social media? - 4.1 + 4.1 parent_event_id @@ -623,10 +623,10 @@ slot_label_id - int unsigned - Subevent Slot Label ID + int unsigned + Subevent Slot Label ID NULL - Subevent slot label. Implicit FK to civicrm_option_value where option_group = conference_slot. + Subevent slot label. Implicit FK to civicrm_option_value where option_group = conference_slot. 4.1