From: eileen Date: Wed, 2 Mar 2016 04:24:32 +0000 (+1300) Subject: CRM-18106 add contact deleted by merge activity type X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6eb752fad35c61354c8599613a96796cdf6d0ee2;p=civicrm-core.git CRM-18106 add contact deleted by merge activity type --- diff --git a/CRM/Upgrade/Incremental/php/FourSeven.php b/CRM/Upgrade/Incremental/php/FourSeven.php index ec6282f129..66221d929c 100644 --- a/CRM/Upgrade/Incremental/php/FourSeven.php +++ b/CRM/Upgrade/Incremental/php/FourSeven.php @@ -174,6 +174,15 @@ class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base $this->addTask('Add Index to civicrm_contribution.total_amount', 'addIndexContributionAmount'); } + /** + * Upgrade function. + * + * @param string $rev + */ + public function upgrade_4_7_4($rev) { + $this->addTask('Add Contact Deleted by Merge Activity Type', 'addDeletedByMergeActivityType'); + } + /** * CRM-16354 * @@ -526,4 +535,25 @@ FROM `civicrm_dashboard_contact` WHERE 1 GROUP BY contact_id"; return TRUE; } + /** + * CRM-18124 Add index to civicrm_contribution.total_amount. + * + * Note that I made this a combined index with receive_date because the issue included + * both criteria and they seemed likely to be used in conjunction to me in other cases. + * + * @param \CRM_Queue_TaskContext $ctx + * + * @return bool + */ + public function addDeletedByMergeActivityType(CRM_Queue_TaskContext $ctx) { + CRM_Core_BAO_OptionValue::ensureOptionValueExists(array( + 'option_group_id' => 'activity_type', + 'name' => 'Contact Deleted by Merge', + 'label' => ts('Contact Deleted by Merge'), + 'description' => ts('Contact was merged into another contact'), + 'is_active' => TRUE, + )); + return TRUE; + } + } diff --git a/xml/templates/civicrm_data.tpl b/xml/templates/civicrm_data.tpl index 11e386898c..98f71d6d8e 100644 --- a/xml/templates/civicrm_data.tpl +++ b/xml/templates/civicrm_data.tpl @@ -381,9 +381,10 @@ VALUES -- for manual contact merge (@option_group_id_act, '{ts escape="sql"}Contact Merged{/ts}', 51, 'Contact Merged', NULL, 1, NULL, 51, '{ts escape="sql"}Contact Merged{/ts}',0, 1, 1, NULL, NULL), + (@option_group_id_act, '{ts escape="sql"}Contact Deleted by Merge{/ts}', 52, 'Contact Deleted by Merge', NULL, 1, NULL, 52, '{ts escape="sql"}Contact was merged into another contact{/ts}',0, 1, 1, NULL, NULL), -- Activity Type for failed payment - (@option_group_id_act, 'Failed Payment', 52, 'Failed Payment', NULL, 1, 0, 43, 'Failed Payment', 0, 1, 1, @contributeCompId, NULL), + (@option_group_id_act, 'Failed Payment', 53, 'Failed Payment', NULL, 1, 0, 53, 'Failed Payment', 0, 1, 1, @contributeCompId, NULL), (@option_group_id_gender, '{ts escape="sql"}Female{/ts}', 1, 'Female', NULL, 0, NULL, 1, NULL, 0, 0, 1, NULL, NULL), (@option_group_id_gender, '{ts escape="sql"}Male{/ts}', 2, 'Male', NULL, 0, NULL, 2, NULL, 0, 0, 1, NULL, NULL),