' . ts('Default versions of the following System Workflow Message Templates have been modified to handle new functionality: - Contributions - Receipt (off-line)
- Contributions - Receipt (on-line)
- Memberships - Receipt (on-line)
- Pledges - Acknowledgement
If you have modified these templates, please review the new default versions and implement updates as needed to your copies (Administer > Communications > Message Templates > System Workflow Messages).');
}
}
function upgrade_4_5_alpha1($rev) {
// task to process sql
$this->addTask(ts('Upgrade DB to 4.5.alpha1: SQL'), 'task_4_5_x_runSql', $rev);
$this->addTask(ts('Set default for Individual name fields configuration'), 'addNameFieldOptions');
return TRUE;
}
/**
* Add defaults for the newly introduced name fields configuration in 'contact_edit_options' setting
*
* @return bool TRUE for success
*/
static function addNameFieldOptions(CRM_Queue_TaskContext $ctx) {
$query = "SELECT `value` FROM `civicrm_setting` WHERE `group_name` = 'CiviCRM Preferences' AND `name` = 'contact_edit_options'";
$dao = CRM_Core_DAO::executeQuery($query);
$dao->fetch();
$oldValue = unserialize($dao->value);
$newValue = $oldValue . '1214151617';
$query = "UPDATE `civicrm_setting` SET `value` = %1 WHERE `group_name` = 'CiviCRM Preferences' AND `name` = 'contact_edit_options'";
$params = array(1 => array(serialize($newValue), 'String'));
CRM_Core_DAO::executeQuery($query, $params);
return TRUE;
}
/**
* (Queue Task Callback)
*/
static function task_4_5_x_runSql(CRM_Queue_TaskContext $ctx, $rev) {
$upgrade = new CRM_Upgrade_Form();
$upgrade->processSQL($rev);
return TRUE;
}
/**
* Syntatic sugar for adding a task which (a) is in this class and (b) has
* a high priority.
*
* After passing the $funcName, you can also pass parameters that will go to
* the function. Note that all params must be serializable.
*/
protected function addTask($title, $funcName) {
$queue = CRM_Queue_Service::singleton()->load(array(
'type' => 'Sql',
'name' => CRM_Upgrade_Form::QUEUE_NAME,
));
$args = func_get_args();
$title = array_shift($args);
$funcName = array_shift($args);
$task = new CRM_Queue_Task(
array(get_class($this), $funcName),
$args,
$title
);
$queue->createItem($task, array('weight' => -1));
}
}