CRM_Core_BAO_Setting::getItem() - Fix calls which use deprecated parameters
authorTim Otten <totten@civicrm.org>
Thu, 20 Aug 2015 07:08:45 +0000 (00:08 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 17 Sep 2015 22:45:00 +0000 (15:45 -0700)
CRM/Core/BAO/ConfigSetting.php
CRM/Core/BAO/Email.php
CRM/Core/InnoDBIndexer.php
CRM/Core/Page.php
CRM/Core/Resources.php
CRM/Upgrade/Incremental/General.php
settings/Mailing.setting.php
tests/phpunit/api/v3/SyntaxConformanceTest.php

index 0086008db5bf3ae7cbf246d240f673f292b90f05..ddc5f16bcd7cddd9a1a10f4b7f2657cebcec3de6 100644 (file)
@@ -319,7 +319,7 @@ class CRM_Core_BAO_ConfigSetting {
       CRM_Core_BAO_Setting::retrieveDirectoryAndURLPreferences($defaults);
 
       // Pickup enabled-components from settings table if found.
-      $enableComponents = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enable_components', NULL, array());
+      $enableComponents = Civi::settings()->get('enable_components');
       if (!empty($enableComponents)) {
         $defaults['enableComponents'] = $enableComponents;
 
@@ -649,8 +649,7 @@ WHERE  option_group_id = (
     }
 
     // get enabled-components from DB and add to the list
-    $enabledComponents
-      = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enable_components', NULL, array());
+    $enabledComponents = Civi::settings()->get('enable_components');
     $enabledComponents[] = $componentName;
 
     self::setEnabledComponents($enabledComponents);
@@ -675,8 +674,7 @@ WHERE  option_group_id = (
     }
 
     // get enabled-components from DB and add to the list
-    $enabledComponents
-      = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enable_components', NULL, array());
+    $enabledComponents = Civi::settings()->get('enable_components');
     $enabledComponents = array_diff($enabledComponents, array($componentName));
 
     self::setEnabledComponents($enabledComponents);
index d4f343424b2e29b5a6b3e11539882e846994e11c..c4ccb4baccbdea45785a5727321103d4752a88da 100644 (file)
@@ -319,7 +319,7 @@ AND    reset_date IS NULL
    * @return object
    */
   public static function isMultipleBulkMail() {
-    return CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'civimail_multiple_bulk_emails', NULL, FALSE);
+    return Civi::settings()->get('civimail_multiple_bulk_emails');
   }
 
   /**
index 51da1ccda3b242f5f3049dfcad03d42a354bfc57..12f5ecd9148dc4f72de29b071f438cbb53c0bdbf 100644 (file)
@@ -75,7 +75,7 @@ class CRM_Core_InnoDBIndexer {
           array('name'),
         ),
       );
-      $active = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SEARCH_PREFERENCES_NAME, 'enable_innodb_fts', NULL, FALSE);
+      $active = Civi::settings()->get('enable_innodb_fts');
       self::$singleton = new self($active, $indices);
     }
     return self::$singleton;
index 84907ee01ddcce7f52e56cb0a48eb2ada3d37407..37979b198db24366373b0df7f858aa4316747f11 100644 (file)
@@ -217,9 +217,7 @@ class CRM_Core_Page {
     // Intermittent alert to admins
     CRM_Utils_Check::singleton()->showPeriodicAlerts();
 
-    if ($this->useLivePageJS &&
-      CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajaxPopupsEnabled', NULL, TRUE)
-    ) {
+    if ($this->useLivePageJS && Civi::settings()->get('ajaxPopupsEnabled')) {
       CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js', 1, 'html-header');
     }
 
index f5f57cfd4c6195c2934672ead91cef2b89691366..7d0e3649e474f18388a4a54cd8d812d4a4139a78 100644 (file)
@@ -143,9 +143,7 @@ class CRM_Core_Resources {
     if (!$this->cacheCode) {
       $this->resetCacheCode();
     }
-    $this->ajaxPopupsEnabled = (bool) CRM_Core_BAO_Setting::getItem(
-      CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajaxPopupsEnabled', NULL, TRUE
-    );
+    $this->ajaxPopupsEnabled = (bool) Civi::settings()->get('ajaxPopupsEnabled');
   }
 
   /**
index c2b4020ead819de36416e7e2cb202a8fc93b98af..9be29b28a26d1220f6420adff4995838481ba76d 100644 (file)
@@ -80,7 +80,7 @@ class CRM_Upgrade_Incremental_General {
       }
     }
 
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SEARCH_PREFERENCES_NAME, 'enable_innodb_fts', NULL, FALSE)) {
+    if (Civi::settings()->get('enable_innodb_fts')) {
       // The FTS indexing feature dynamically manipulates the schema which could
       // cause conflicts with other layers that manipulate the schema. The
       // simplest thing is to turn it off and back on.
index 4503aa0b2a11e32b955f34509c714f482be9e130..30a8bc973dcefc237064fa968f4e42ab22e0c224 100644 (file)
@@ -178,4 +178,18 @@ return array(
     'description' => 'If enabled, a randomized hash key will be used to reference the mailing URL in the mailing.viewUrl token, instead of the mailing ID',
     'help_text' => NULL,
   ),
+  'civimail_multiple_bulk_emails' => array(
+    'group_name' => 'Mailing Preferences',
+    'group' => 'mailing',
+    'name' => 'civimail_multiple_bulk_emails',
+    'type' => 'Integer',
+    'html_type' => 'checkbox',
+    'default' => 0,
+    'add' => '4.5',
+    'title' => ' Multiple Bulk Emails',
+    'is_domain' => 1,
+    'is_contact' => 0,
+    'description' => 'If enabled, CiviMail will deliver a copy of the email to each bulk email listed for the contact.',
+    'help_text' => NULL,
+  ),
 );
index 90be85cfcf8e354bee2d1060a7ffd37e693d4d40..1d9a1fe5fd116fa99b38dafdb51d29d8f2d88148 100644 (file)
@@ -240,7 +240,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
    */
   public static function custom_data_entities() {
     $entities = CRM_Core_BAO_CustomQuery::$extendsMap;
-    $enabledComponents = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enable_components', NULL, array());
+    $enabledComponents = Civi::settings()->get('enable_components');
     $customDataEntities = array();
     $invalidEntities = array('Individual', 'Organization', 'Household');
     $entitiesToFix = array('Case', 'Relationship');