From 3d65c75c6bb1b086e1cb1dbec604d358c6866ea6 Mon Sep 17 00:00:00 2001 From: Andrew Hunt Date: Mon, 16 Jun 2014 11:45:53 -0400 Subject: [PATCH] CRM-14879: action mapping and option group for contact date field reminders ---------------------------------------- * CRM-14879: Scheduled reminders for contact date fields https://issues.civicrm.org/jira/browse/CRM-14879 --- .../Incremental/sql/4.5.alpha2.mysql.tpl | 18 ++++++++++++++++++ xml/templates/civicrm_data.tpl | 13 ++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/CRM/Upgrade/Incremental/sql/4.5.alpha2.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.5.alpha2.mysql.tpl index 42e888c1cb..7cc32cc782 100644 --- a/CRM/Upgrade/Incremental/sql/4.5.alpha2.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.5.alpha2.mysql.tpl @@ -22,3 +22,21 @@ INSERT INTO civicrm_state_province (id, country_id, abbreviation, name) VALUES UPDATE civicrm_state_province SET name = "Santiago Metropolitan", abbreviation = "SM" WHERE id = "2100"; + +-- CRM-14879 contact fields for scheduled reminders +INSERT INTO civicrm_action_mapping + (entity, entity_value, entity_value_label, entity_status, entity_status_label, entity_date_start, entity_date_end, entity_recipient) + VALUES + ( 'civicrm_contact', 'civicrm_contact', 'Date Field', 'contact_date_reminder_options', 'Annual Options', 'date_field', NULL, NULL); + +INSERT INTO `civicrm_option_group` (`name`, `title`, `is_reserved`, `is_active`, `is_locked`) + VALUES + ('contact_date_reminder_options', '{ts escape="sql"}Contact Date Reminder Options{/ts}', 1, 1, 1); + +SELECT @option_group_id_contactDateMode := max(id) from civicrm_option_group where name = 'contact_date_reminder_options'; + +INSERT INTO `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`) + VALUES + (@option_group_id_contactDateMode, '{ts escape="sql"}Actual date only{/ts}', '1', 'Actual date only', NULL, NULL, 0, 1, NULL, 0, 1, 1, NULL, NULL), + (@option_group_id_contactDateMode, '{ts escape="sql"}Each anniversary{/ts}', '2', 'Each anniversary', NULL, NULL, 0, 2, NULL, 0, 1, 1, NULL, NULL); diff --git a/xml/templates/civicrm_data.tpl b/xml/templates/civicrm_data.tpl index 1e35fd9bde..bff104d942 100644 --- a/xml/templates/civicrm_data.tpl +++ b/xml/templates/civicrm_data.tpl @@ -206,7 +206,8 @@ VALUES ('label_type' , '{ts escape="sql"}Label Type{/ts}' , 1, 1, 0), ('name_badge' , '{ts escape="sql"}Name Badge Format{/ts}' , 1, 1, 0), ('communication_style' , '{ts escape="sql"}Communication Style{/ts}' , 1, 1, 0), - ('msg_mode' , '{ts escape="sql"}Message Mode{/ts}' , 1, 1, 0); + ('msg_mode' , '{ts escape="sql"}Message Mode{/ts}' , 1, 1, 0), + ('contact_date_reminder_options' , '{ts escape="sql"}Contact Date Reminder Options{/ts}' , 1, 1, 1); SELECT @option_group_id_pcm := max(id) from civicrm_option_group where name = 'preferred_communication_method'; SELECT @option_group_id_act := max(id) from civicrm_option_group where name = 'activity_type'; @@ -282,6 +283,7 @@ SELECT @option_group_id_label_type := max(id) from civicrm_option_group where na SELECT @option_group_id_name_badge := max(id) from civicrm_option_group where name = 'name_badge'; SELECT @option_group_id_communication_style := max(id) from civicrm_option_group where name = 'communication_style'; SELECT @option_group_id_msg_mode := max(id) from civicrm_option_group where name = 'msg_mode'; +SELECT @option_group_id_contactDateMode := max(id) from civicrm_option_group where name = 'contact_date_reminder_options'; SELECT @contributeCompId := max(id) FROM civicrm_component where name = 'CiviContribute'; SELECT @eventCompId := max(id) FROM civicrm_component where name = 'CiviEvent'; @@ -924,7 +926,11 @@ VALUES -- Message Mode (@option_group_id_msg_mode, '{ts escape="sql"}Email{/ts}', 'Email', 'Email', NULL, 0, 1, 1, NULL, 0, 1, 1, NULL, NULL), (@option_group_id_msg_mode, '{ts escape="sql"}SMS{/ts}', 'SMS', 'SMS', NULL, 0, 0, 2, NULL, 0, 1, 1, NULL, NULL), -(@option_group_id_msg_mode, '{ts escape="sql"}User Preference{/ts}', 'User_Preference', 'User Preference', NULL, 0, 0, 3, NULL, 0, 1, 1, NULL, NULL); +(@option_group_id_msg_mode, '{ts escape="sql"}User Preference{/ts}', 'User_Preference', 'User Preference', NULL, 0, 0, 3, NULL, 0, 1, 1, NULL, NULL), + +-- Reminder Options for Contact Date Fields +(@option_group_id_contactDateMode, '{ts escape="sql"}Actual date only{/ts}', '1', 'Actual date only', NULL, NULL, 0, 1, NULL, 0, 1, 1, NULL, NULL), +(@option_group_id_contactDateMode, '{ts escape="sql"}Each anniversary{/ts}', '2', 'Each anniversary', NULL, NULL, 0, 2, NULL, 0, 1, 1, NULL, NULL); -- financial accounts SELECT @opval := value FROM civicrm_option_value WHERE name = 'Revenue' and option_group_id = @option_group_id_fat; @@ -1478,7 +1484,8 @@ VALUES ( 'civicrm_participant', 'event_type', 'Event Type', 'civicrm_participant_status_type', 'Participant Status', 'event_start_date', 'event_end_date', 'event_contacts'), ( 'civicrm_participant', 'civicrm_event', 'Event Name', 'civicrm_participant_status_type', 'Participant Status', 'event_start_date', 'event_end_date', 'event_contacts'), ( 'civicrm_membership', 'civicrm_membership_type', 'Membership Type', 'auto_renew_options', 'Auto Renew Options', 'membership_join_date', 'membership_end_date', NULL), -( 'civicrm_participant', 'event_template', 'Event Template', 'civicrm_participant_status_type', 'Participant Status', 'event_start_date', 'event_end_date', 'event_contacts'); +( 'civicrm_participant', 'event_template', 'Event Template', 'civicrm_participant_status_type', 'Participant Status', 'event_start_date', 'event_end_date', 'event_contacts'), +( 'civicrm_contact', 'civicrm_contact', 'Date Field', 'contact_date_reminder_options', 'Annual Options', 'date_field', NULL, NULL); INSERT INTO `civicrm_contact_type` (`id`, `name`, `label`,`image_URL`, `parent_id`, `is_active`,`is_reserved`) -- 2.25.1