public function upgrade_4_7_8($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
$this->addTask('Upgrade mailing foreign key constraints', 'upgradeMailingFKs');
- $this->addTask('Add Smartgroup refresh options', 'addSmartGroupRefreshOptions');
}
/*
return TRUE;
}
- /**
- * CRM-16642 Add option for smart group refreshing.
- *
- * @param \CRM_Queue_TaskContext $ctx
- *
- * @return bool
- */
- public function addSmartGroupRefreshOptions(CRM_Queue_TaskContext $ctx) {
- $optionGroupID = CRM_Core_BAO_OptionGroup::ensureOptionGroupExists(array(
- 'name' => 'smart_group_cache_refresh_mode',
- 'title' => ts('Mode for refreshing smart group cache'),
- 'description' => ts('This provides the option for the smart group cache setting'),
- 'is_reserved' => 1,
- ));
- CRM_Core_BAO_OptionValue::ensureOptionValueExists(array(
- 'option_group_id' => $optionGroupID,
- 'name' => 'opportunistic',
- 'label' => ts('Opportunistic'),
- 'description' => ts('Purge the cache in response to user actions'),
- 'is_active' => TRUE,
- 'filter' => 1,
- 'is_reserved' => 1,
- ));
- CRM_Core_BAO_OptionValue::ensureOptionValueExists(array(
- 'option_group_id' => $optionGroupID,
- 'name' => 'deterministic',
- 'label' => ts('Deterministic'),
- 'description' => ts('Only purge the cache on system jobs'),
- 'is_active' => TRUE,
- 'filter' => 1,
- 'is_reserved' => 1,
- ));
- return TRUE;
- }
-
}
('communication_style' , '{ts escape="sql"}Communication Style{/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),
- ('relative_date_filters' , '{ts escape="sql"}Relative Date Filters{/ts}' , 1, 1, 0),
- ('smart_group_cache_refresh_mode', '{ts escape="sql"}Smart Group Cache Management Mode{/ts}' , 1, 1, 1);
+ ('relative_date_filters' , '{ts escape="sql"}Relative Date Filters{/ts}' , 1, 1, 0);
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';
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 @option_group_id_date_filter := max(id) from civicrm_option_group where name = 'relative_date_filters';
-SELECT @option_group_smart_group_cache_refresh_mode := max(id) from civicrm_option_group where name = 'smart_group_cache_refresh_mode';
SELECT @contributeCompId := max(id) FROM civicrm_component where name = 'CiviContribute';
SELECT @eventCompId := max(id) FROM civicrm_component where name = 'CiviEvent';
(@option_group_id_date_filter, '{ts escape="sql"}From end of previous week{/ts}', 'greater_previous.week', 'greater_previous.week', NULL, NULL, NULL,59, NULL, 0, 0, 1, NULL, NULL),
(@option_group_id_date_filter, '{ts escape="sql"}From end of previous calendar month{/ts}', 'greater_previous.month', 'greater_previous.month', NULL, NULL, NULL,60, NULL, 0, 0, 1, NULL, NULL),
(@option_group_id_date_filter, '{ts escape="sql"}From end of previous quarter{/ts}', 'greater_previous.quarter', 'greater_previous.quarter', NULL, NULL, NULL,61, NULL, 0, 0, 1, NULL, NULL),
- (@option_group_id_date_filter, '{ts escape="sql"}From end of previous calendar year{/ts}', 'greater_previous.year', 'greater_previous.year', NULL, NULL, NULL,62, NULL, 0, 0, 1, NULL, NULL),
- (@option_group_smart_group_cache_refresh_mode, '{ts escape="sql"}Opportunistic{/ts}', 'opportunistic','opportunistic', NULL, NULL, 1, 1, NULL, 0, 0, 1, NULL, NULL),
- (@option_group_smart_group_cache_refresh_mode, '{ts escape="sql"}Deterministic{/ts}', 'deterministic','deterministic', NULL, NULL, 0, 2, NULL, 0, 0, 1, NULL, NULL);
+ (@option_group_id_date_filter, '{ts escape="sql"}From end of previous calendar year{/ts}', 'greater_previous.year', 'greater_previous.year', NULL, NULL, NULL,62, NULL, 0, 0, 1, NULL, NULL);
-- financial accounts
SELECT @opval := value FROM civicrm_option_value WHERE name = 'Revenue' and option_group_id = @option_group_id_fat;