Commit | Line | Data |
---|---|---|
296342b1 | 1 | {* file to handle db changes in 4.5.alpha1 during upgrade *} |
e171748b OB |
2 | |
3 | ALTER TABLE `civicrm_contact` | |
4 | ADD COLUMN `formal_title` varchar(64) COMMENT 'Formal (academic or similar) title in front of name. (Prof., Dr. etc.)' AFTER `suffix_id`; | |
aa62b355 OB |
5 | |
6 | ALTER TABLE `civicrm_contact` | |
7 | ADD COLUMN `communication_style_id` int(10) unsigned COMMENT 'Communication style (e.g. formal vs. familiar) to use with this contact. FK to communication styles in civicrm_option_value.' AFTER `formal_title`, | |
8 | ADD INDEX `index_communication_style_id` (`communication_style_id`); | |
9 | ||
10 | INSERT INTO | |
11 | `civicrm_option_group` (`name`, {localize field='title'}`title`{/localize}, `is_reserved`, `is_active`) | |
12 | VALUES | |
13 | ('communication_style', {localize}'{ts escape="sql"}Communication Style{/ts}'{/localize}, 1, 1); | |
14 | ||
15 | SELECT @option_group_id_communication_style := max(id) from civicrm_option_group where name = 'communication_style'; | |
16 | ||
17 | INSERT INTO | |
18 | `civicrm_option_value` (`option_group_id`, `label`, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `description`, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`) | |
19 | VALUES | |
20 | (@option_group_id_communication_style, {localize}'{ts escape="sql"}Formal{/ts}'{/localize} , 1, 'formal' , NULL, 0, 1, 1, NULL, 0, 0, 1, NULL, NULL), | |
21 | (@option_group_id_communication_style, {localize}'{ts escape="sql"}Familiar{/ts}'{/localize}, 2, 'familiar', NULL, 0, 0, 2, NULL, 0, 0, 1, NULL, NULL); | |
d4311a7a OB |
22 | |
23 | -- Insert menu item at Administer > Communications, above the various Greeting Formats | |
24 | ||
25 | SELECT @parent_id := `id` FROM `civicrm_navigation` WHERE `name` = 'Communications' AND `domain_id` = {$domainID}; | |
26 | SELECT @add_weight := MIN(`weight`) FROM `civicrm_navigation` WHERE `name` IN('Email Greeting Formats', 'Postal Greeting Formats', 'Addressee Formats') AND `parent_id` = @parent_id; | |
27 | ||
28 | UPDATE `civicrm_navigation` | |
29 | SET `weight` = `weight`+1 | |
30 | WHERE `parent_id` = @parent_id | |
31 | AND `weight` >= @add_weight; | |
32 | ||
33 | INSERT INTO `civicrm_navigation` | |
34 | ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) | |
35 | VALUES | |
36 | ( {$domainID}, 'civicrm/admin/options/communication_style&group=communication_style&reset=1', '{ts escape="sql" skip="true"}Communication Style Options{/ts}', 'Communication Style Options', 'administer CiviCRM', '', @parent_id, '1', NULL, @add_weight ); | |
b97b088e | 37 | |
38 | -- CRM-9988 Change world region of Panama country to America South, Central, North and Caribbean | |
39 | UPDATE `civicrm_country` SET `region_id` = 2 WHERE `id` = 1166; |