Merge pull request #4054 from eileenmcnaughton/CRM-15237
[civicrm-core.git] / CRM / Upgrade / Incremental / sql / 2.2.beta2.mysql.tpl
1 -- CRM-4104
2 SELECT @og_id_cs := id FROM civicrm_option_group WHERE name = 'custom_search';
3 SELECT @maxValue := max(CAST( `value` AS UNSIGNED )) FROM civicrm_option_value WHERE option_group_id = @og_id_cs;
4 {if $customSearchAbsentAll}
5 {if $multilingual}
6 INSERT INTO civicrm_option_value
7 (option_group_id, {foreach from=$locales item=locale}label_{$locale}, description_{$locale}, {/foreach} value, name, weight, is_active) VALUES
8 (@og_id_cs, {foreach from=$locales item=locale}'CRM_Contact_Form_Search_Custom_ZipCodeRange', 'Zip Code Range', {/foreach} @maxValue + 1, 'CRM_Contact_Form_Search_Custom_ZipCodeRange', @maxValue + 1, 1),
9 (@og_id_cs, {foreach from=$locales item=locale}'CRM_Contact_Form_Search_Custom_DateAdded', 'Date Added to CiviCRM', {/foreach} @maxValue + 2, 'CRM_Contact_Form_Search_Custom_DateAdded', @maxValue + 2, 1),
10 (@og_id_cs, {foreach from=$locales item=locale}'CRM_Contact_Form_Search_Custom_MultipleValues', 'Custom Group Multiple Values Listing', {/foreach} @maxValue + 3, 'CRM_Contact_Form_Search_Custom_MultipleValues', @maxValue + 3, 1),
11 (@og_id_cs, {foreach from=$locales item=locale}'CRM_Contact_Form_Search_Custom_ContribSYBNT', 'Contributions made in Year X and not Year Y', {/foreach} @maxValue + 4, 'CRM_Contact_Form_Search_Custom_ContribSYBNT', @maxValue + 4, 1);
12 {else}
13 INSERT INTO civicrm_option_value
14 (option_group_id, label, value, name, description, weight, is_active ) VALUES
15 (@og_id_cs, 'CRM_Contact_Form_Search_Custom_ZipCodeRange', @maxValue + 1, 'CRM_Contact_Form_Search_Custom_ZipCodeRange', 'Zip Code Range', @maxValue + 1, 1),
16 (@og_id_cs, 'CRM_Contact_Form_Search_Custom_DateAdded', @maxValue + 2, 'CRM_Contact_Form_Search_Custom_DateAdded', 'Date Added to CiviCRM', @maxValue + 2, 1),
17 (@og_id_cs, 'CRM_Contact_Form_Search_Custom_MultipleValues', @maxValue + 3, 'CRM_Contact_Form_Search_Custom_MultipleValues', 'Custom Group Multiple Values Listing', @maxValue + 3, 1),
18 (@og_id_cs, 'CRM_Contact_Form_Search_Custom_ContribSYBNT', @maxValue + 4, 'CRM_Contact_Form_Search_Custom_ContribSYBNT', 'Contributions made in Year X and not Year Y', @maxValue + 4, 1);
19 {/if}
20 {else if $customSearchAbsent}
21 {if $multilingual}
22 INSERT INTO civicrm_option_value
23 (option_group_id, {foreach from=$locales item=locale}label_{$locale}, description_{$locale}, {/foreach} value, name, weight, is_active) VALUES
24 (@og_id_cs, {foreach from=$locales item=locale}'CRM_Contact_Form_Search_Custom_MultipleValues', 'Custom Group Multiple Values Listing', {/foreach} @maxValue + 1, 'CRM_Contact_Form_Search_Custom_MultipleValues', @maxValue + 1, 1),
25 (@og_id_cs, {foreach from=$locales item=locale}'CRM_Contact_Form_Search_Custom_ContribSYBNT', 'Contributions made in Year X and not Year Y', {/foreach} @maxValue + 2, 'CRM_Contact_Form_Search_Custom_ContribSYBNT', @maxValue + 2, 1);
26 {else}
27 INSERT INTO civicrm_option_value
28 (option_group_id, label, value, name, description, weight, is_active ) VALUES
29 (@og_id_cs, 'CRM_Contact_Form_Search_Custom_MultipleValues', @maxValue + 1, 'CRM_Contact_Form_Search_Custom_MultipleValues', 'Custom Group Multiple Values Listing', @maxValue + 1, 1),
30 (@og_id_cs, 'CRM_Contact_Form_Search_Custom_ContribSYBNT', @maxValue + 2, 'CRM_Contact_Form_Search_Custom_ContribSYBNT', 'Contributions made in Year X and not Year Y', @maxValue + 2, 1);
31 {/if}
32 {/if}
33
34 -- Added dummy processor
35 INSERT IGNORE INTO `civicrm_payment_processor_type`
36 (`name`, `title`, `is_active`, `is_default`, `user_name_label`, `class_name`, `billing_mode`) VALUES
37 ('Dummy', 'Dummy Payment Processor', 1, 1, 'User Name', 'Payment_Dummy', 1 );