Commit 89595c92 authored by totten's avatar totten

CRM_Core_BAO_Setting::getItem() - Fix calls which use deprecated parameters

parent 84fb7424
......@@ -248,7 +248,7 @@ class CRM_Admin_Page_AJAX {
public static function mergeTagList() {
$name = CRM_Utils_Type::escape($_GET['term'], 'String');
$fromId = CRM_Utils_Type::escape($_GET['fromId'], 'Integer');
$limit = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'search_autocomplete_count', NULL, 10);
$limit = Civi::settings()->get('search_autocomplete_count');
// build used-for clause to be used in main query
$usedForTagA = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Tag', $fromId, 'used_for');
......
......@@ -42,7 +42,7 @@ class CRM_Case_Page_AJAX {
*/
public static function unclosedCases() {
$params = array(
'limit' => CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'search_autocomplete_count', NULL, 10),
'limit' => Civi::settings()->get('search_autocomplete_count'),
'sort_name' => CRM_Utils_Type::escape(CRM_Utils_Array::value('term', $_GET, ''), 'String'),
);
......
......@@ -782,7 +782,7 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer');
return FALSE;
}
// If trash is disabled in system settings then we always skip
if (!CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_undelete', NULL, 1)) {
if (!Civi::settings()->get('contact_undelete')) {
$skipUndelete = TRUE;
}
......
......@@ -121,7 +121,7 @@ class CRM_Contact_Form_Search_Criteria {
//added external ID
$form->addElement('text', 'external_identifier', ts('External ID'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'external_identifier'));
if (CRM_Core_Permission::check('access deleted contacts') and CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_undelete', NULL)) {
if (CRM_Core_Permission::check('access deleted contacts') and Civi::settings()->get('contact_undelete')) {
$form->add('checkbox', 'deleted_contacts', ts('Search in Trash') . '<br />' . ts('(deleted contacts)'));
}
......
......@@ -74,7 +74,7 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task {
CRM_Core_Error::fatal(ts('You do not have permission to delete this contact.'));
}
$this->assign('trash', CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_undelete', NULL) and !$this->_skipUndelete);
$this->assign('trash', Civi::settings()->get('contact_undelete') and !$this->_skipUndelete);
$this->assign('restore', $this->_restore);
if ($this->_restore) {
......
......@@ -83,7 +83,7 @@ class CRM_Contact_Page_AJAX {
$return = array_unique(array_merge(array('sort_name'), $list));
$limit = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'search_autocomplete_count', NULL, 10);
$limit = Civi::settings()->get('search_autocomplete_count');
$params = array('offset' => 0, 'rowCount' => $limit, 'version' => 3);
foreach ($return as $fld) {
......@@ -158,7 +158,7 @@ class CRM_Contact_Page_AJAX {
public static function getPCPList() {
$name = CRM_Utils_Array::value('term', $_GET);
$name = CRM_Utils_Type::escape($name, 'String');
$limit = $max = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'search_autocomplete_count', NULL, 10);
$limit = $max = Civi::settings()->get('search_autocomplete_count');
$where = ' AND pcp.page_id = cp.id AND pcp.contact_id = cc.id';
......@@ -403,7 +403,7 @@ class CRM_Contact_Page_AJAX {
if ($queryString) {
$offset = CRM_Utils_Array::value('offset', $_GET, 0);
$rowCount = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'search_autocomplete_count', NULL, 10);
$rowCount = Civi::settings()->get('search_autocomplete_count');
$offset = CRM_Utils_Type::escape($offset, 'Int');
......
......@@ -100,11 +100,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings {
* default include message ID
*/
public static function includeMessageId() {
return CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
'include_message_id',
NULL,
FALSE
);
return Civi::settings()->get('include_message_id');
}
/**
......
......@@ -756,7 +756,7 @@ function civicrm_api3_contact_getquick($params) {
}
$from = implode(' ', $from);
$limit = (int) CRM_Utils_Array::value('limit', $params);
$limit = $limit > 0 ? $limit : CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SEARCH_PREFERENCES_NAME, 'search_autocomplete_count', NULL, 10);
$limit = $limit > 0 ? $limit : Civi::settings()->get('search_autocomplete_count');
// add acl clause here
list($aclFrom, $aclWhere) = CRM_Contact_BAO_Contact_Permission::cacheClause('cc');
......
......@@ -105,7 +105,7 @@ function _civicrm_api3_generic_getList_defaults($entity, &$request, $apiDefaults
$defaults['description_field'][] = $field;
}
}
$resultsPerPage = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'search_autocomplete_count', NULL, 10);
$resultsPerPage = Civi::settings()->get('search_autocomplete_count');
if (isset($request['params']) && isset($apiDefaults['params'])) {
$request['params'] += $apiDefaults['params'];
}
......
......@@ -192,4 +192,18 @@ return array(
'description' => 'If enabled, CiviMail will deliver a copy of the email to each bulk email listed for the contact.',
'help_text' => NULL,
),
'include_message_id' => array(
'group_name' => 'Mailing Preferences',
'group' => 'mailing',
'name' => 'include_message_id',
'type' => 'Integer',
'html_type' => 'checkbox',
'default' => FALSE,
'add' => '4.5',
'title' => 'Enable CiviMail to generate Message-ID header',
'is_domain' => 1,
'is_contact' => 0,
'description' => '',
'help_text' => NULL,
),
);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment