Merge pull request #4054 from eileenmcnaughton/CRM-15237
[civicrm-core.git] / CRM / Upgrade / Incremental / sql / 2.2.3.mysql.tpl
1 -- CRM-4374
2
3 SELECT @og_id_at := max(id) from civicrm_option_group where name = 'activity_type';
4 SELECT @max_val_at := max(round(value)) from civicrm_option_value where option_group_id=@og_id_at;
5 SELECT @max_wt_at := max(weight) from civicrm_option_value where option_group_id=@og_id_at;
6
7 SELECT @og_id_mp := max(id) from civicrm_option_group where name = 'mail_protocol';
8 SELECT @max_val_mp := max(round(value)) from civicrm_option_value where option_group_id=@og_id_mp;
9 SELECT @max_wt_mp := max(weight) from civicrm_option_value where option_group_id=@og_id_mp;
10
11 SELECT @civicase_component_id := id from civicrm_component where name = 'CiviCase';
12
13 {if $multilingual}
14 INSERT INTO civicrm_option_value
15 (option_group_id, {foreach from=$locales item=locale}label_{$locale},{/foreach} value, name, filter, weight, is_reserved, is_active, component_id) VALUES
16 (@og_id_at, {foreach from=$locales item=locale}'Change Case Start Date',{/foreach} @max_val_at + 1, 'Change Case Start Date', 0, @max_wt_at + 1, 1, 1, @civicase_component_id),
17 (@og_id_mp, {foreach from=$locales item=locale}'Localdir',{/foreach} @max_val_mp + 1, 'Localdir', 0, @max_wt_mp + 1, 1, 1, NULL);
18 {else}
19 INSERT INTO `civicrm_option_value`
20 (`option_group_id`, `label`, `value`, `name`, `filter`, `weight`, `is_reserved`, `is_active`, component_id) VALUES
21 (@og_id_at, 'Change Case Start Date', @max_val_at + 1, 'Change Case Start Date', 0, @max_wt_at + 1, 1, 1, @civicase_component_id ),
22 (@og_id_mp, 'Localdir', @max_val_mp + 1, 'Localdir', 0, @max_wt_mp + 1, 1, 1, NULL);
23 {/if}
24
25 --CRM-4373
26 --Adding new custom search for FullText Search.
27
28 SELECT @og_id_cs := id FROM civicrm_option_group WHERE name = 'custom_search';
29 SELECT @maxValue := max(CAST( `value` AS UNSIGNED )) FROM civicrm_option_value WHERE option_group_id = @og_id_cs;
30
31 {if $multilingual}
32 INSERT INTO civicrm_option_value
33 (option_group_id, {foreach from=$locales item=locale}label_{$locale}, description_{$locale}, {/foreach} value, name, weight, is_active) VALUES
34 (@og_id_cs, {foreach from=$locales item=locale}'CRM_Contact_Form_Search_Custom_FullText', 'Full-text Search', {/foreach} @maxValue + 1, 'CRM_Contact_Form_Search_Custom_FullText', @maxValue + 1, 1);
35 {else}
36 INSERT INTO civicrm_option_value
37 (option_group_id, label, value, name, description, weight, is_active ) VALUES
38 (@og_id_cs, 'CRM_Contact_Form_Search_Custom_FullText', @maxValue + 1, 'CRM_Contact_Form_Search_Custom_FullText', 'Full-text Search', @maxValue + 1, 1);
39 {/if}