From 20d1bd78e6ec534d229f21e1f28500943f20ce1d Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 20 Jun 2015 20:54:00 +1200 Subject: [PATCH] CRM-16417 add failed payment activity type --- CRM/Upgrade/Incremental/sql/4.6.5.mysql.tpl | 11 +++++++++++ xml/templates/civicrm_data.tpl | 8 ++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CRM/Upgrade/Incremental/sql/4.6.5.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.6.5.mysql.tpl index fba14d2382..32f4a6952d 100644 --- a/CRM/Upgrade/Incremental/sql/4.6.5.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.6.5.mysql.tpl @@ -1 +1,12 @@ {* file to handle db changes in 4.6.5 during upgrade *} +-- CRM-16417 add failed payment activity type +SELECT @option_group_id_act := max(id) from civicrm_option_group where name = 'activity_type'; +SELECT @option_group_id_act_wt := MAX(weight) FROM civicrm_option_value WHERE option_group_id = @option_group_id_act; +SELECT @option_group_id_act_val := MAX(ROUND(value)) FROM civicrm_option_value WHERE option_group_id = @option_group_id_act; +SELECT @contributeCompId := max(id) FROM civicrm_component where name = 'CiviContribute'; + +INSERT INTO +`civicrm_option_value` (`option_group_id`, {localize field='label'}`label`{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, {localize field='description'}`description`{/localize}, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`) +VALUES +(@option_group_id_act, {localize}'{ts escape="sql"}Failed Payment{/ts}'{/localize}, @option_group_id_act_val+1, +'Failed Payment', NULL, 1, NULL, @option_group_id_act_wt+1, {localize}'{ts escape="sql"}Failed payment.{/ts}'{/localize}, 0, 1, 1, @contributeCompId, NULL); diff --git a/xml/templates/civicrm_data.tpl b/xml/templates/civicrm_data.tpl index 720a6028ca..49ad65f738 100644 --- a/xml/templates/civicrm_data.tpl +++ b/xml/templates/civicrm_data.tpl @@ -376,8 +376,12 @@ VALUES -- for Print or Email Contribution Invoices (@option_group_id_act, '{ts escape="sql"}Downloaded Invoice{/ts}', 49, 'Downloaded Invoice', NULL, 1, NULL, 49, '{ts escape="sql"}Downloaded Invoice.{/ts}',0, 1, 1, NULL, NULL), (@option_group_id_act, '{ts escape="sql"}Emailed Invoice{/ts}', 50, 'Emailed Invoice', NULL, 1, NULL, 50, '{ts escape="sql"}Emailed Invoice.{/ts}',0, 1, 1, NULL, NULL), - -- 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), + + -- 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), + + -- 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_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), -- 2.25.1