From 1975848649adb0c8bf55c495ed1d3c841d520f20 Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Thu, 2 May 2013 19:11:59 +0530 Subject: [PATCH] CRM-12357 upgrade part --- .../Incremental/sql/4.4.alpha1.mysql.tpl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/CRM/Upgrade/Incremental/sql/4.4.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.4.alpha1.mysql.tpl index 2f803db557..ec701f93e9 100644 --- a/CRM/Upgrade/Incremental/sql/4.4.alpha1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.4.alpha1.mysql.tpl @@ -1 +1,16 @@ -{include file='../CRM/Upgrade/4.4.alpha1.msg_template/civicrm_msg_template.tpl'} \ No newline at end of file +{include file='../CRM/Upgrade/4.4.alpha1.msg_template/civicrm_msg_template.tpl'} + +-- CRM-12357 +SELECT @option_group_id_cvOpt := max(id) FROM civicrm_option_group WHERE name = 'contact_view_options'; +SELECT @max_val := MAX(ROUND(op.value)) FROM civicrm_option_value op WHERE op.option_group_id = @option_group_id_cvOpt; +SELECT @max_wt := MAX(ROUND(val.weight)) FROM civicrm_option_value val WHERE val.option_group_id = @option_group_id_cvOpt; + +INSERT INTO + `civicrm_option_value` (`option_group_id`, {localize field='label'}`label`{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`) +VALUES + (@option_group_id_cvOpt, {localize}'{ts escape="sql"}Mailings{/ts}'{/localize}, @max_val+1, 'CiviMail', NULL, 0, NULL, @max_wt+1, 0, 0, 1, NULL, NULL); + +INSERT INTO civicrm_setting + (domain_id, contact_id, is_domain, group_name, name, value) +VALUES + ({$domainID}, NULL, 1, 'Mailing Preferences', 'write_activity_record', '{serialize}1{/serialize}'); \ No newline at end of file -- 2.25.1