Cleanup deprecated CRM_Core_BAO_Settings calls CRM-17507
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Wed, 18 Nov 2015 13:03:17 +0000 (18:33 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 19 Nov 2015 11:03:41 +0000 (16:33 +0530)
98 files changed:
CRM/Activity/BAO/ICalendar.php
CRM/Activity/Form/Activity.php
CRM/Activity/Form/ActivityFilter.php
CRM/Admin/Form/Preferences/Contribute.php
CRM/Admin/Form/Preferences/Display.php
CRM/Admin/Form/Preferences/Mailing.php
CRM/Admin/Form/Setting.php
CRM/Admin/Form/Setting/Smtp.php
CRM/Campaign/BAO/Petition.php
CRM/Campaign/Form/Petition/Signature.php
CRM/Case/Form/Activity.php
CRM/Case/Form/Activity/OpenCase.php
CRM/Case/XMLProcessor/Process.php
CRM/Contact/BAO/Contact.php
CRM/Contact/BAO/Group.php
CRM/Contact/BAO/Individual.php
CRM/Contact/BAO/Query.php
CRM/Contact/Form/Edit/Individual.php
CRM/Contact/Form/Task/EmailCommon.php
CRM/Contact/Form/Task/Label.php
CRM/Contact/Form/Task/LabelCommon.php
CRM/Contact/Page/View.php
CRM/Contact/Page/View/GroupContact.php
CRM/Contact/Page/View/Summary.php
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/BAO/ContributionPage.php
CRM/Contribute/Form/AdditionalInfo.php
CRM/Contribute/Form/AdditionalPayment.php
CRM/Contribute/Form/Contribution.php
CRM/Contribute/Form/Contribution/Confirm.php
CRM/Contribute/Form/Contribution/ThankYou.php
CRM/Contribute/Form/ContributionView.php
CRM/Contribute/Form/Task/Invoice.php
CRM/Contribute/Page/UserDashboard.php
CRM/Contribute/Task.php
CRM/Core/BAO/Address.php
CRM/Core/BAO/Domain.php
CRM/Core/BAO/File.php
CRM/Core/BAO/Navigation.php
CRM/Core/BAO/UFGroup.php
CRM/Core/BAO/UFMatch.php
CRM/Core/I18n.php
CRM/Core/Lock.php
CRM/Core/Payment/AuthorizeNet.php
CRM/Core/Payment/Elavon.php
CRM/Core/Payment/FirstData.php
CRM/Core/Payment/Google.php
CRM/Core/Payment/PayPalImpl.php
CRM/Core/Payment/PayflowPro.php
CRM/Core/Payment/PaymentExpressUtils.php
CRM/Core/Payment/Realex.php
CRM/Core/Permission.php
CRM/Core/Resources.php
CRM/Cxn/ApiRouter.php
CRM/Cxn/BAO/Cxn.php
CRM/Cxn/CiviCxnHttp.php
CRM/Dashlet/Page/Blog.php
CRM/Event/BAO/Event.php
CRM/Event/BAO/Participant.php
CRM/Event/Form/EventFees.php
CRM/Event/Form/ManageEvent/TabHeader.php
CRM/Event/Form/Participant.php
CRM/Event/Form/ParticipantView.php
CRM/Event/Form/Registration/Confirm.php
CRM/Event/Form/Registration/ThankYou.php
CRM/Event/Page/DashBoard.php
CRM/Event/Page/EventInfo.php
CRM/Event/Page/ICalendar.php
CRM/Event/Page/ManageEvent.php
CRM/Financial/BAO/ExportFormat/CSV.php
CRM/Financial/BAO/FinancialItem.php
CRM/Financial/BAO/FinancialType.php
CRM/Mailing/BAO/Mailing.php
CRM/Mailing/BAO/MailingJob.php
CRM/Mailing/Info.php
CRM/Mailing/Page/View.php
CRM/Member/Form/Membership.php
CRM/Member/Form/MembershipRenewal.php
CRM/Member/Page/UserDashboard.php
CRM/Pledge/Form/Pledge.php
CRM/Price/BAO/LineItem.php
CRM/Price/BAO/PriceField.php
CRM/Price/Page/Field.php
CRM/Price/Page/Option.php
CRM/Upgrade/Incremental/php/FourSeven.php
CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php
CRM/Utils/Address.php
CRM/Utils/Address/USPS.php
CRM/Utils/Check/Env.php
CRM/Utils/Date.php
CRM/Utils/HttpClient.php
CRM/Utils/Mail.php
CRM/Utils/PDF/Label.php
CRM/Utils/QueryFormatter.php
CRM/Utils/System.php
CRM/Utils/System/WordPress.php
CRM/Utils/VersionCheck.php
settings/Event.setting.php

index a6e4c40f68de3c910bd77603a2fd700bad78cb7c..c02d08ad0ae78916a7a4d3914f81dcfb6d25a68d 100644 (file)
@@ -66,7 +66,7 @@ class CRM_Activity_BAO_ICalendar {
    */
   public function addAttachment(&$attachments, $contacts) {
     // Check preferences setting
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'activity_assignee_notification_ics')) {
+    if (Civi::settings()->get('activity_assignee_notification_ics')) {
       $config = &CRM_Core_Config::singleton();
       $this->icsfile = tempnam($config->customFileUploadDir, 'ics');
       if ($this->icsfile !== FALSE) {
index 943b40e90b1875be9177c956b82086a27119aa63..fde9ebeac3635d1a7331749b0aa83894c1092461 100644 (file)
@@ -790,11 +790,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
 
     $this->addFormRule(array('CRM_Activity_Form_Activity', 'formRule'), $this);
 
-    if (CRM_Core_BAO_Setting::getItem(
-      CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-      'activity_assignee_notification'
-    )
-    ) {
+    if (Civi::settings()->get('activity_assignee_notification')) {
       $this->assign('activityAssigneeNotification', TRUE);
     }
     else {
@@ -1054,9 +1050,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
     // send copy to assignee contacts.CRM-4509
     $mailStatus = '';
 
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-      'activity_assignee_notification')
-    ) {
+    if (Civi::settings()->get('activity_assignee_notification')) {
       $activityIDs = array($activity->id);
       if ($followupActivity) {
         $activityIDs = array_merge($activityIDs, array($followupActivity->id));
index 84c20e9207ea87eb80c998ce1b824f536cfc5acd..bb47aafc8750ddb63c82498095dbabe92838ffae 100644 (file)
@@ -60,12 +60,9 @@ class CRM_Activity_Form_ActivityFilter extends CRM_Core_Form {
     $session = CRM_Core_Session::singleton();
     $userID = $session->get('userID');
     if ($userID) {
-      $defaults = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::PERSONAL_PREFERENCES_NAME,
-        'activity_tab_filter',
-        NULL,
-        NULL,
-        $userID
-      );
+      $defaults = Civi::service('settings_manager')
+        ->getBagByContact(NULL, $userID)
+        ->get('activity_tab_filter');
     }
     return $defaults;
   }
index e5a46fb565c03736e1dd5a2b86f0e93379e1bc4b..0a5513cbd2b051261b22f9d7523d877f28a12e95 100644 (file)
@@ -150,7 +150,7 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences {
    * default values are retrieved from the database
    */
   public function setDefaultValues() {
-    $defaults = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $defaults = Civi::settings()->get('contribution_invoice_settings');
     //CRM-16691: Changes made related to settings of 'CVV'.
     foreach ($this->_settings as $setting => $group) {
       $settingMetaData = civicrm_api3('setting', 'getfields', array('name' => $setting));
index b164585e704e143705d258c81c71e5ae3a5aa032..6ba66f8eaf3077969a62ed428571b7a321314264 100644 (file)
@@ -129,7 +129,7 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences {
     $wysiwyg_options = CRM_Core_OptionGroup::values('wysiwyg_editor', FALSE, FALSE, FALSE, NULL, 'label', TRUE, FALSE, 'name');
 
     //changes for freezing the invoices/credit notes checkbox if invoicing is uncheck
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     $this->assign('invoicing', $invoicing);
     $extra = array();
index e1beccc42ec57fbff90eb8aabbef704aab594638..63bdb2072a244ce467cd9dfd144dd25d8ae75c72 100644 (file)
@@ -119,10 +119,7 @@ class CRM_Admin_Form_Preferences_Mailing extends CRM_Admin_Form_Preferences {
     $params = $this->controller->exportValues($this->_name);
 
     if (empty($params['write_activity_record'])) {
-      $existingViewOptions = CRM_Core_BAO_Setting::getItem(
-        CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-        'contact_view_options'
-      );
+      $existingViewOptions = Civi::settings()->get('contact_view_options');
 
       $displayValue = CRM_Core_OptionGroup::getValue('contact_view_options', 'CiviMail', 'name');
       $viewOptions = explode(CRM_Core_DAO::VALUE_SEPARATOR, $existingViewOptions);
index 60625eb657163f7c9f2e74845d13b57ef57bfeb1..90b494806d31d690bc67452078692f9f5cf8b1a8 100644 (file)
@@ -68,8 +68,8 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
 
       $this->_defaults['contact_autocomplete_options'] = self::getAutocompleteContactSearch();
       $this->_defaults['contact_reference_options'] = self::getAutocompleteContactReference();
-      $this->_defaults['enableSSL'] = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enableSSL');
-      $this->_defaults['verifySSL'] = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL');
+      $this->_defaults['enableSSL'] = Civi::settings()->get('enableSSL');
+      $this->_defaults['verifySSL'] = Civi::settings()->get('verifySSL');
       $this->_defaults['enableComponents'] = Civi::settings()->get('enable_components');
     }
 
index e7569919edb86b54ce2fcafcb12f16ba7aab13c9..25c80062e1d98a6389ee9471579f6462dc229e8f 100644 (file)
@@ -176,9 +176,7 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting {
       }
     }
 
-    $mailingBackend = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
-      'mailing_backend'
-    );
+    $mailingBackend = Civi::settings()->get('mailing_backend');
 
     if (!empty($mailingBackend)) {
       $formValues = array_merge($mailingBackend, $formValues);
@@ -240,9 +238,7 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting {
     if (!$this->_defaults) {
       $this->_defaults = array();
 
-      $mailingBackend = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
-        'mailing_backend'
-      );
+      $mailingBackend = Civi::settings()->get('mailing_backend');
       if (!empty($mailingBackend)) {
         $this->_defaults = $mailingBackend;
 
index 03622c74b6b324c9db8dc86804ff048f3de53749..d5e4c0a2ecbd37f0e9816c20ee743cc8aeebd483 100644 (file)
@@ -251,11 +251,7 @@ SELECT  petition.id                         as id,
     $sql = 'UPDATE civicrm_activity_contact SET contact_id = %2 WHERE activity_id = %1 AND record_type_id = %3';
     CRM_Core_DAO::executeQuery($sql, $params);
     // remove 'Unconfirmed' tag for this contact
-    $tag_name = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-      'tag_unconfirmed',
-      NULL,
-      'Unconfirmed'
-    );
+    $tag_name = Civi::settings()->get('tag_unconfirmed');
 
     $sql = "
 DELETE FROM civicrm_entity_tag
@@ -560,11 +556,7 @@ AND         tag_id = ( SELECT id FROM civicrm_tag WHERE name = %2 )";
      */
 
     // check if the group defined by CIVICRM_PETITION_CONTACTS exists, else create it
-    $petitionGroupName = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-      'petition_contacts',
-      NULL,
-      'Petition Contacts'
-    );
+    $petitionGroupName = Civi::settings()->get('petition_contacts');
 
     $dao = new CRM_Contact_DAO_Group();
     $dao->title = $petitionGroupName;
index b4c9c1902320552da96f12ade36322e0ae7be710..23ed93be12f1b0f8d57c937dbb21a1c1db98b637 100644 (file)
@@ -327,9 +327,7 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
    * Form submission of petition signature.
    */
   public function postProcess() {
-    $tag_name = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CAMPAIGN_PREFERENCES_NAME,
-      'tag_unconfirmed'
-    );
+    $tag_name = Civi::settings()->get('tag_unconfirmed');
 
     if ($tag_name) {
       // Check if contact 'email confirmed' tag exists, else create one
index 44a99f08239e0a5bd15fee4ed0a58534da813e53..03feaa4f55031419ec145a769bc1be4d64e6937a 100644 (file)
@@ -585,10 +585,7 @@ class CRM_Case_Form_Activity extends CRM_Activity_Form_Activity {
     $selectedContacts = array('contact_check');
     $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
     $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-      'activity_assignee_notification'
-    )
-    ) {
+    if (Civi::settings()->get('activity_assignee_notification')) {
       $selectedContacts[] = 'assignee_contact_id';
     }
 
index d78d32617ec174ee26d23afb0b6d8fb74b02c080..cd56766a8050942b2f4af769e651f7f7faeeccf3 100644 (file)
@@ -330,7 +330,7 @@ class CRM_Case_Form_Activity_OpenCase {
     }
 
     // Add parameters for attachments
-    $numAttachments = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'max_attachments');
+    $numAttachments = Civi::settings()->get('max_attachments');
     for ($i = 1; $i <= $numAttachments; $i++) {
       $attachName = "attachFile_$i";
       if (isset($params[$attachName]) && !empty($params[$attachName])) {
index b97411828aa869156ddb6bb01533aca205af5dc2..a920f9b80810fc6ead4ea193d0cb02573dea355a 100644 (file)
@@ -497,7 +497,7 @@ AND        a.is_deleted = 0
 
       // Add parameters for attachments
 
-      $numAttachments = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'max_attachments');
+      $numAttachments = Civi::settings()->get('max_attachments');
       for ($i = 1; $i <= $numAttachments; $i++) {
         $attachName = "attachFile_$i";
         if (isset($params[$attachName]) && !empty($params[$attachName])) {
index 3225d8173cafa138b43d9fec44f639f4fd5e81a4..13c69e603d6e59c748409f8ebab0421845628ca1 100644 (file)
@@ -319,7 +319,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
 
     $params['contact_id'] = $contact->id;
 
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME, 'is_enabled')) {
+    if (Civi::settings()->get('is_enabled')) {
       // Enabling multisite causes the contact to be added to the domain group.
       $domainGroupID = CRM_Core_BAO_Domain::getGroupId();
       if (!empty($domainGroupID)) {
@@ -2352,7 +2352,7 @@ SELECT     civicrm_contact.id as contact_id,
 FROM       civicrm_contact
 INNER JOIN civicrm_email    ON ( civicrm_contact.id = civicrm_email.contact_id )";
 
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME, 'uniq_email_per_site')) {
+    if (Civi::settings()->get('uniq_email_per_site')) {
       // try to find a match within a site (multisite).
       $groups = CRM_Core_BAO_Domain::getChildGroupIds();
       if (!empty($groups)) {
index e8356829f531dd8127a0e083cb1d09c2bf08c145..dd44875a455de7b40be787f64019da1176f79645 100644 (file)
@@ -107,10 +107,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
     $query = "DELETE FROM civicrm_acl_entity_role where entity_table = 'civicrm_group' AND entity_id = %1";
     CRM_Core_DAO::executeQuery($query, $params);
 
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME,
-      'is_enabled'
-    )
-    ) {
+    if (Civi::settings()->get('is_enabled')) {
       // clear any descendant groups cache if exists
       CRM_Core_BAO_Cache::deleteGroup('descendant groups for an org');
     }
@@ -427,9 +424,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
     if (CRM_Utils_Array::value('no_parent', $params) !== 1) {
       if (empty($params['parents']) &&
         $domainGroupID != $group->id &&
-        CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME,
-          'is_enabled'
-        ) &&
+        Civi::settings()->get('is_enabled') &&
         !CRM_Contact_BAO_GroupNesting::hasParentGroups($group->id)
       ) {
         // if no parent present and the group doesn't already have any parents,
index 578fec08f5ddbf06a557893c463db7ee0893ae66..d5346628e5b46ffed2d06a6e985fb65190c3f5e2 100644 (file)
@@ -214,18 +214,14 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
       }
 
       //build the sort name.
-      $format = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-        'sort_name_format'
-      );
+      $format = Civi::settings()->get('sort_name_format');
       $sortName = CRM_Utils_Address::format($formatted, $format,
         FALSE, FALSE, TRUE, $tokenFields
       );
       $sortName = trim($sortName);
 
       //build the display name.
-      $format = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-        'display_name_format'
-      );
+      $format = Civi::settings()->get('display_name_format');
       $displayName = CRM_Utils_Address::format($formatted, $format,
         FALSE, FALSE, TRUE, $tokenFields
       );
index e4e6a48ba6d40960f20510398b6df84209f28a7f..5343c290d5d6699b8adf13b9c581320087a11ba8 100644 (file)
@@ -1112,9 +1112,7 @@ class CRM_Contact_BAO_Query {
             $this->_element["{$tName}_id"] = 1;
             if (substr($tName, -15) == '-state_province') {
               // FIXME: hack to fix CRM-1900
-              $a = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-                'address_format'
-              );
+              $a = Civi::settings()->get('address_format');
 
               if (substr_count($a, 'state_province_name') > 0) {
                 $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"] = array(
index 9db0633cb5ed4a9f65d9a03d054f60646310da64..dd345f21b576a44c7e64bc94e4bcdf9516ef325c 100644 (file)
@@ -96,11 +96,7 @@ class CRM_Contact_Form_Edit_Individual {
     }
 
     if (!$inlineEditMode) {
-      $checkSimilar = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-        'contact_ajax_check_similar',
-        NULL,
-        TRUE
-      );
+      $checkSimilar = Civi::settings()->get('contact_ajax_check_similar');
 
       if ($checkSimilar == NULL) {
         $checkSimilar = 0;
index 0f64c32a06a6404e1d111e8eee0663d47171ea88..b4a5142fddb35e07cc90f4bd4d2a0512206a0b18 100644 (file)
@@ -524,7 +524,7 @@ class CRM_Contact_Form_Task_EmailCommon {
         $followupActivity = CRM_Activity_BAO_Activity::createFollowupActivity($activityId, $params);
         $followupStatus = ts('A followup activity has been scheduled.');
 
-        if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'activity_assignee_notification')) {
+        if (Civi::settings()->get('activity_assignee_notification')) {
           if ($followupActivity) {
             $mailToFollowupContacts = array();
             $assignee = array($followupActivity->id);
index 6ea5c7fa048d303a78f3487f84d1185db425f2eb..1ff219d514d53674d6f9130c15edbee706e591a7 100644 (file)
@@ -104,9 +104,7 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
     $config = CRM_Core_Config::singleton();
     $locName = NULL;
     //get the address format sequence from the config file
-    $mailingFormat = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-      'mailing_format'
-    );
+    $mailingFormat = Civi::settings()->get('mailing_format');
 
     $sequence = CRM_Utils_Address::sequence($mailingFormat);
 
@@ -120,9 +118,7 @@ class CRM_Contact_Form_Task_Label extends CRM_Contact_Form_Task {
 
     //build the returnproperties
     $returnProperties = array('display_name' => 1, 'contact_type' => 1, 'prefix_id' => 1);
-    $mailingFormat = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-      'mailing_format'
-    );
+    $mailingFormat = Civi::settings()->get('mailing_format');
 
     $mailingFormatProperties = array();
     if ($mailingFormat) {
index 992b7e17ada39d55543bce4e51d390802cc86020..00d44fd3297234cc39bb99ff8953fde3c0384364 100644 (file)
@@ -85,9 +85,7 @@ class CRM_Contact_Form_Task_LabelCommon {
 
     //build the return properties
     $returnProperties = array('display_name' => 1, 'contact_type' => 1, 'prefix_id' => 1);
-    $mailingFormat = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-      'mailing_format'
-    );
+    $mailingFormat = Civi::settings()->get('mailing_format');
 
     $mailingFormatProperties = array();
     if ($mailingFormat) {
@@ -252,9 +250,7 @@ class CRM_Contact_Form_Task_LabelCommon {
    *   [street_address => 1, supplemental_address_1 => 1, supplemental_address_2 => 1]
    */
   public static function getAddressReturnProperties() {
-    $mailingFormat = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-      'mailing_format'
-    );
+    $mailingFormat = Civi::settings()->get('mailing_format');
 
     $addressFields = CRM_Utils_Address::sequence($mailingFormat);
     $addressReturnProperties = array_fill_keys($addressFields, 1);
@@ -271,9 +267,7 @@ class CRM_Contact_Form_Task_LabelCommon {
    * @return array
    */
   public static function getTokenData(&$contacts) {
-    $mailingFormat = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-      'mailing_format'
-    );
+    $mailingFormat = Civi::settings()->get('mailing_format');
     $tokens = $tokenFields = array();
     $messageToken = CRM_Utils_Token::getTokens($mailingFormat);
 
index 449c0c2f0485845c6d5eba3d4b4264c497eb967b..499ddbcf179d4224bc516c248fe80812593089f3 100644 (file)
@@ -153,7 +153,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
       //CRM-7265 --time being fix.
       $config = CRM_Core_Config::singleton();
       $image_URL = str_replace('https://', 'http://', $image_URL);
-      if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enableSSL')) {
+      if (Civi::settings()->get('enableSSL')) {
         $image_URL = str_replace('http://', 'https://', $image_URL);
       }
 
@@ -230,10 +230,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
 
     if ($contactType == 'Organization' &&
       CRM_Core_Permission::check('administer Multiple Organizations') &&
-      CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME,
-        'is_enabled'
-      )
-    ) {
+      Civi::settings()->get('is_enabled')) {
       //check is any relationship between the organization and groups
       $groupOrg = CRM_Contact_BAO_GroupOrganization::hasGroupAssociated($this->_contactId);
       if ($groupOrg) {
index d5a2bf45f05168cbba6a85d0063ed70182066c0b..5828f414efbcbe6e93d3120426772eff774cd3de 100644 (file)
@@ -58,8 +58,7 @@ class CRM_Contact_Page_View_GroupContact extends CRM_Core_Page {
     $this->assign_by_ref('groupOut', $out);
 
     // get the info on contact smart groups
-    $contactSmartGroupSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-      'contact_smart_group_display');
+    $contactSmartGroupSettings = Civi::settings()->get('contact_smart_group_display');
     $this->assign('contactSmartGroupSettings', $contactSmartGroupSettings);
 
     $this->ajaxResponse['tabCount'] = count($in);
@@ -172,12 +171,7 @@ class CRM_Contact_Page_View_GroupContact extends CRM_Core_Page {
     }
 
     $groupNum = CRM_Contact_BAO_GroupContact::getContactGroup($contactID, 'Added', NULL, TRUE, TRUE);
-    if ($groupNum == 1 &&
-      $groupStatus == 'Removed' &&
-      CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME,
-        'is_enabled'
-      )
-    ) {
+    if ($groupNum == 1 && $groupStatus == 'Removed' && Civi::settings()->get('is_enabled')) {
       CRM_Core_Session::setStatus(ts('Please ensure at least one contact group association is maintained.'), ts('Could Not Remove'));
       return FALSE;
     }
index 832fe39696cc06f128b2c4212ddbaca03c1243af..eac81adab983c35fca70e1ed3bf6b0d4a8f482a2 100644 (file)
@@ -141,7 +141,7 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View {
     $params['noRelationships'] = $params['noNotes'] = $params['noGroups'] = TRUE;
     $contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults, TRUE);
     // Let summary page know if outbound mail is disabled so email links can be built conditionally
-    $mailingBackend = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'mailing_backend');
+    $mailingBackend = Civi::settings()->get('mailing_backend');
     $this->assign('mailingOutboundOption', $mailingBackend['outBound_option']);
 
     $communicationType = array(
index 291793a85ce078b87f879cb031c39b1b946449af..ac0767209262144a3fa68479e3defd8398d4bcbb 100644 (file)
@@ -3354,7 +3354,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac
           CRM_Financial_BAO_FinancialItem::create($itemParams, NULL, $trxnIds);
 
           if ($fieldValues['tax_amount']) {
-            $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+            $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
             $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
             $itemParams['amount'] = $diff * $fieldValues['tax_amount'];
             $itemParams['description'] = $taxTerm;
@@ -4410,7 +4410,7 @@ LIMIT 1;";
    *   Credit Note Id.
    */
   public static function createCreditNoteId() {
-    $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $prefixValue = Civi::settings()->get('contribution_invoice_settings');
 
     $creditNoteNum = CRM_Core_DAO::singleValueQuery("SELECT count(creditnote_id) as creditnote_number FROM civicrm_contribution");
     $creditNoteId = NULL;
index 24be98770ef6d07ecf1ffd30a6f713c490637d69..1008aef34e5ecd1ef3eb2af0f78ab0ae017acf13 100644 (file)
@@ -420,7 +420,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio
         //send email with pdf invoice
         $template = CRM_Core_Smarty::singleton();
         $taxAmt = $template->get_template_vars('dataArray');
-        $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+        $prefixValue = Civi::settings()->get('contribution_invoice_settings');
         $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
         if (isset($invoicing) && isset($prefixValue['is_email_pdf'])) {
           $sendTemplateParams['isEmailPdf'] = TRUE;
index 455ddd9154947403d64fbb8448994331e25d1e2f..d59606a1a155b3c7b55aa6601ed6a69bb133767c 100644 (file)
@@ -476,7 +476,7 @@ class CRM_Contribute_Form_AdditionalInfo {
     $template = CRM_Core_Smarty::singleton();
     $taxAmt = $template->get_template_vars('dataArray');
     $eventTaxAmt = $template->get_template_vars('totalTaxAmount');
-    $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $prefixValue = Civi::settings()->get('contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
     if ((!empty($taxAmt) || isset($eventTaxAmt)) && (isset($invoicing) && isset($prefixValue['is_email_pdf']))) {
       $isEmailPdf = TRUE;
index 49bd5e98a03c9d6a6ad58e6d7280a6493506c9e5..641d560d514adda37db65649b0822aa5e05767ed 100644 (file)
@@ -329,9 +329,7 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract
         ),
       )
     );
-    $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
-      'mailing_backend'
-    );
+    $mailingInfo = Civi::settings()->get('mailing_backend');
     $this->assign('outBound_option', $mailingInfo['outBound_option']);
 
     $this->addFormRule(array('CRM_Contribute_Form_AdditionalPayment', 'formRule'), $this);
index e9d5bb8db2d5eaaf7b87cf040738a8475b04040f..71de60eb75fc3274dd51639f54f54c62bf3575c2 100644 (file)
@@ -477,7 +477,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
 
     // build price set form.
     $buildPriceSet = FALSE;
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     $this->assign('invoicing', $invoicing);
 
@@ -832,9 +832,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
       $js = array('onclick' => "return verify( );");
     }
 
-    $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
-      'mailing_backend'
-    );
+    $mailingInfo = Civi::settings()->get('mailing_backend');
     $this->assign('outBound_option', $mailingInfo['outBound_option']);
 
     $this->addButtons(array(
@@ -1735,7 +1733,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
    */
   protected function invoicingPostProcessHook($submittedValues, $action, $lineItem) {
 
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
     if (!CRM_Utils_Array::value('invoicing', $invoiceSettings)) {
       return;
     }
index 38c8bafb44e50d76b3306f62a9c8621891aad242..399b429c73a08ad4ad055984a2681bfc805b88ea 100644 (file)
@@ -405,7 +405,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
     $amount_block_is_active = $this->get('amount_block_is_active');
     $this->assign('amount_block_is_active', $amount_block_is_active);
 
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     if ($invoicing) {
       $getTaxDetails = FALSE;
@@ -854,7 +854,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
       );
       $contribution = CRM_Contribute_BAO_Contribution::add($contributionParams);
 
-      $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+      $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
       $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
       if ($invoicing) {
         $dataArray = array();
index 972994b7fa5dcc85c38a5ac0e1522475f26f5fbd..4e431d891e4e4e715200ecde2812c7c9e8769ea7 100644 (file)
@@ -110,7 +110,7 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
     $this->assign('useForMember', $this->get('useForMember'));
 
     $params = $this->_params;
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     if ($invoicing) {
       $getTaxDetails = FALSE;
index 62580e0a00931f21ddaf933459e67acfb1fe0add..d89a611de29d6f9cbe3a297f3038c8e8d8d5fc5a 100644 (file)
@@ -167,7 +167,7 @@ class CRM_Contribute_Form_ContributionView extends CRM_Core_Form {
 
     // assign values to the template
     $this->assign($values);
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     $this->assign('invoicing', $invoicing);
     if ($invoicing && isset($values['tax_amount'])) {
index 454b4c33d0458a3437cd8417a821d76ed7c0b9ba..f0a0c912ecd40018a86ae4d85f8ef3103d089314 100644 (file)
@@ -247,7 +247,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task {
     $cancelledStatusId = CRM_Utils_Array::key('Cancelled', $contributionStatusID);
 
     // getting data from admin page
-    $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $prefixValue = Civi::settings()->get('contribution_invoice_settings');
 
     foreach ($invoiceElements['details'] as $contribID => $detail) {
       $input = $ids = $objects = array();
index 2e16e0b1dd6ef469d4ac400f68c64aa0cd16cf3b..b255854d0ca15b14f7ac83d361065dac90e04448 100644 (file)
@@ -139,7 +139,7 @@ class CRM_Contribute_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBo
    * loads, it decides the which action has to be taken for the page.
    */
   public function run() {
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     $this->assign('invoicing', $invoicing);
     parent::preProcess();
index 8de48e139dc8d9b51796bd6cf5509e2d23936f02..fae3005e3cd7895a6ecb864d91751e032f965353 100644 (file)
@@ -126,7 +126,7 @@ class CRM_Contribute_Task {
       }
 
       // remove action "Invoices - print or email"
-      $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+      $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
       $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
       if (!$invoicing) {
         unset(self::$_tasks[9]);
index 5beb1e53ed5c1ca67a1c5d006748d931c6016a8e..acc47d95ab5407de87545b330912becfc0368cbe 100644 (file)
@@ -342,9 +342,7 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address {
 
     $config = CRM_Core_Config::singleton();
 
-    $asp = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::ADDRESS_STANDARDIZATION_PREFERENCES_NAME,
-      'address_standardization_provider'
-    );
+    $asp = Civi::settings()->get('address_standardization_provider');
     // clean up the address via USPS web services if enabled
     if ($asp === 'USPS' &&
       $params['country_id'] == 1228
@@ -1039,7 +1037,7 @@ SELECT is_primary,
         'first_name' => $rows[$rowID]['first_name'],
         'individual_prefix' => $rows[$rowID]['individual_prefix'],
       );
-      $format = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'display_name_format');
+      $format = Civi::settings()->get('display_name_format');
       $firstNameWithPrefix = CRM_Utils_Address::format($formatted, $format, FALSE, FALSE, TRUE);
       $firstNameWithPrefix = trim($firstNameWithPrefix);
 
index 6ac3a75664426cf3819672b737327ea0798dc90b..ffc1709faeea46f6418a4e8e303c55a053085ab7 100644 (file)
@@ -253,12 +253,8 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain {
       return $groupID;
     }
 
-    $domainGroupID = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME,
-      'domain_group_id'
-    );
-    $multisite = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME,
-      'is_enabled'
-    );
+    $domainGroupID = Civi::settings()->get('domain_group_id');
+    $multisite = Civi::settings()->get('is_enabled');
 
     if ($domainGroupID) {
       $groupID = $domainGroupID;
index c9456b3231c05f082f23de33421f5b55b2daf36a..d3d9d0073613256560df9d1948b87eed15bce2a2 100644 (file)
@@ -413,7 +413,7 @@ AND       CEF.entity_id    = %2";
   public static function buildAttachment(&$form, $entityTable, $entityID = NULL, $numAttachments = NULL, $ajaxDelete = FALSE) {
 
     if (!$numAttachments) {
-      $numAttachments = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'max_attachments');
+      $numAttachments = Civi::settings()->get('max_attachments');
     }
     // Assign maxAttachments count to template for help message
     $form->assign('maxAttachments', $numAttachments);
@@ -530,7 +530,7 @@ AND       CEF.entity_id    = %2";
       CRM_Core_BAO_File::deleteEntityFile($entityTable, $entityID);
     }
 
-    $numAttachments = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'max_attachments');
+    $numAttachments = Civi::settings()->get('max_attachments');
 
     $now = date('Ymdhis');
 
@@ -572,7 +572,7 @@ AND       CEF.entity_id    = %2";
    * @param int $entityID
    */
   public static function processAttachment(&$params, $entityTable, $entityID) {
-    $numAttachments = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'max_attachments');
+    $numAttachments = Civi::settings()->get('max_attachments');
 
     for ($i = 1; $i <= $numAttachments; $i++) {
       if (
@@ -598,7 +598,7 @@ AND       CEF.entity_id    = %2";
    * @return array
    */
   public static function uploadNames() {
-    $numAttachments = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'max_attachments');
+    $numAttachments = Civi::settings()->get('max_attachments');
 
     $names = array();
     for ($i = 1; $i <= $numAttachments; $i++) {
index 4d93fd71fff7fcd54da2d667ff0cd4cb35d94e20..0a5c7da17a8b5b45df50dbf7a165b31159d1825a 100644 (file)
@@ -1097,13 +1097,9 @@ ORDER BY parent_id, weight";
    * @return object|string
    */
   public static function getCacheKey($cid) {
-    $key = CRM_Core_BAO_Setting::getItem(
-      CRM_Core_BAO_Setting::PERSONAL_PREFERENCES_NAME,
-      'navigation',
-      NULL,
-      '',
-      $cid
-    );
+    $key = Civi::service('settings_manager')
+      ->getBagByContact(NULL, $cid)
+      ->get('navigation');
     if (strlen($key) !== self::CACHE_KEY_STRLEN) {
       $key = self::resetNavigation($cid);
     }
index 3a1c3b5b1ce8284432787f0d9c92ae13501d1b95..1f52489a143865339e778f652e536a5d59459ae2 100644 (file)
@@ -3611,9 +3611,7 @@ SELECT  group_id
     // check for double optin
     $config = CRM_Core_Config::singleton();
     if (in_array('CiviMail', $config->enableComponents)) {
-      return CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
-        'profile_double_optin', NULL, FALSE
-      );
+      return Civi::settings()->get('profile_double_optin');
     }
     return FALSE;
   }
@@ -3625,9 +3623,7 @@ SELECT  group_id
     // check for add to group double optin
     $config = CRM_Core_Config::singleton();
     if (in_array('CiviMail', $config->enableComponents)) {
-      return CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
-        'profile_add_to_group_double_optin', NULL, FALSE
-      );
+      return Civi::settings()->get('profile_add_to_group_double_optin');
     }
     return FALSE;
   }
index e6891dccfc1ae3cdd5cf74cab0dd7d922db81eba..84bacc1c4c4af2aac5548402fa8a00943d6c1fde 100644 (file)
@@ -209,12 +209,7 @@ class CRM_Core_BAO_UFMatch extends CRM_Core_DAO_UFMatch {
         $dedupeParams['check_permission'] = FALSE;
         $ids = CRM_Dedupe_Finder::dupesByParams($dedupeParams, 'Individual');
 
-        if (!empty($ids) &&
-          CRM_Core_BAO_Setting::getItem(
-            CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME,
-            'uniq_email_per_site'
-          )
-        ) {
+        if (!empty($ids) && Civi::settings()->get('uniq_email_per_site')) {
           // restrict dupeIds to ones that belong to current domain/site.
           $siteContacts = CRM_Core_BAO_Domain::getContactList();
           foreach ($ids as $index => $dupeId) {
index d16b380feb45e0b3d00fa9ec75dc6c9ac7c2d904..59a5f7b2c7a611098affa59f9e14f959681736a3 100644 (file)
@@ -637,7 +637,7 @@ class CRM_Core_I18n {
    * @return string
    */
   public static  function getContactDefaultLanguage() {
-    $language = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME, 'contact_default_language');
+    $language = Civi::settings()->get('contact_default_language');
     if ($language == 'undefined') {
       return NULL;
     }
index 2f37b2dbad426ede0338cea791f1ce2126e7f574..b594e0b0efcb2a4acce3043dee00dc6f2ee69035 100644 (file)
@@ -89,10 +89,7 @@ class CRM_Core_Lock implements \Civi\Core\Lock\LockInterface {
    * @deprecated
    */
   public static function createCivimailLock($name) {
-    $serverWideLock = \CRM_Core_BAO_Setting::getItem(
-      \CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
-      'civimail_server_wide_lock'
-    );
+    $serverWideLock = \Civi::settings()->get('civimail_server_wide_lock');
     return new static($name, NULL, $serverWideLock);
   }
 
index a112cd5066b9a1dd6a9dd31067f8255b0cc35cd9..aca12821e631648c24ccb680f69d1932274e71cd 100644 (file)
@@ -156,7 +156,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
     curl_setopt($submit, CURLOPT_POST, TRUE);
     curl_setopt($submit, CURLOPT_RETURNTRANSFER, TRUE);
     curl_setopt($submit, CURLOPT_POSTFIELDS, implode('&', $postFields));
-    curl_setopt($submit, CURLOPT_SSL_VERIFYPEER, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL'));
+    curl_setopt($submit, CURLOPT_SSL_VERIFYPEER, Civi::settings()->get('verifySSL'));
 
     $response = curl_exec($submit);
 
@@ -315,7 +315,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
     curl_setopt($submit, CURLOPT_HEADER, 1);
     curl_setopt($submit, CURLOPT_POSTFIELDS, $arbXML);
     curl_setopt($submit, CURLOPT_POST, 1);
-    curl_setopt($submit, CURLOPT_SSL_VERIFYPEER, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL'));
+    curl_setopt($submit, CURLOPT_SSL_VERIFYPEER, Civi::settings()->get('verifySSL'));
 
     $response = curl_exec($submit);
 
@@ -670,7 +670,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
     curl_setopt($submit, CURLOPT_HEADER, 1);
     curl_setopt($submit, CURLOPT_POSTFIELDS, $arbXML);
     curl_setopt($submit, CURLOPT_POST, 1);
-    curl_setopt($submit, CURLOPT_SSL_VERIFYPEER, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL'));
+    curl_setopt($submit, CURLOPT_SSL_VERIFYPEER, Civi::settings()->get('verifySSL'));
 
     $response = curl_exec($submit);
 
@@ -729,7 +729,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
     curl_setopt($submit, CURLOPT_HEADER, 1);
     curl_setopt($submit, CURLOPT_POSTFIELDS, $arbXML);
     curl_setopt($submit, CURLOPT_POST, 1);
-    curl_setopt($submit, CURLOPT_SSL_VERIFYPEER, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL'));
+    curl_setopt($submit, CURLOPT_SSL_VERIFYPEER, Civi::settings()->get('verifySSL'));
 
     $response = curl_exec($submit);
 
@@ -791,7 +791,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
     curl_setopt($submit, CURLOPT_HEADER, 1);
     curl_setopt($submit, CURLOPT_POSTFIELDS, $arbXML);
     curl_setopt($submit, CURLOPT_POST, 1);
-    curl_setopt($submit, CURLOPT_SSL_VERIFYPEER, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL'));
+    curl_setopt($submit, CURLOPT_SSL_VERIFYPEER, Civi::settings()->get('verifySSL'));
 
     $response = curl_exec($submit);
 
index 5efc2c47e019490c0e90d6f691cc7287f1616a7b..9e5f68405f1ed1ecc3173e596a1fdb884e672cb2 100644 (file)
@@ -161,8 +161,8 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment {
       return self::errorExit(9004, 'Could not initiate connection to payment gateway');
     }
 
-    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL') ? 2 : 0);
-    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL'));
+    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, Civi::settings()->get('verifySSL') ? 2 : 0);
+    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, Civi::settings()->get('verifySSL'));
     // return the result on success, FALSE on failure
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_TIMEOUT, 36000);
index daaaf465a4904b3dfc9734ed96b81669a708e685..116d2322ba533dee6440f013610e11320502007c 100644 (file)
@@ -210,8 +210,8 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment {
     curl_setopt($ch, CURLOPT_POST, 1);
     curl_setopt($ch, CURLOPT_POSTFIELDS, $requestxml);
     curl_setopt($ch, CURLOPT_SSLCERT, $key);
-    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL') ? 2 : 0);
-    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL'));
+    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, Civi::settings()->get('verifySSL') ? 2 : 0);
+    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, Civi::settings()->get('verifySSL'));
     // return the result on success, FALSE on failure
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_TIMEOUT, 36000);
index b1837d5c0513dce8e7b7628e14c5fb9506e8569f..3d82a5df43f9f3cc7a4f38c2ec82368a6c58968e 100644 (file)
@@ -294,8 +294,8 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment {
     curl_setopt($ch, CURLOPT_VERBOSE, 1);
 
     //turning off the server and peer verification(TrustManager Concept).
-    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL'));
-    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL') ? 2 : 0);
+    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, Civi::settings()->get('verifySSL'));
+    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, Civi::settings()->get('verifySSL') ? 2 : 0);
 
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_POST, 1);
index 24f572ac7c0116f55e94df08a3a4dee3963235c6..377a5613d3f0414f43eb891ef361deb8010d8efb 100644 (file)
@@ -979,8 +979,8 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment {
     curl_setopt($ch, CURLOPT_VERBOSE, 1);
 
     //turning off the server and peer verification(TrustManager Concept).
-    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL'));
-    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL') ? 2 : 0);
+    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, Civi::settings()->get('verifySSL'));
+    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, Civi::settings()->get('verifySSL') ? 2 : 0);
 
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_POST, 1);
index ee5a2bddc41ea2d62b855fe20c37afd65ff6d6c9..f94448c53328db2c52bf0c0b4f0199e48623b12e 100644 (file)
@@ -495,11 +495,11 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment {
     if (ini_get('open_basedir') == '' && ini_get('safe_mode') == 'Off') {
       curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
     }
-    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL'));
+    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, Civi::settings()->get('verifySSL'));
     // this line makes it work under https
     curl_setopt($ch, CURLOPT_POSTFIELDS, $payflow_query);
     //adding POST data
-    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL') ? 2 : 0);
+    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, Civi::settings()->get('verifySSL') ? 2 : 0);
     //verifies ssl certificate
     curl_setopt($ch, CURLOPT_FORBID_REUSE, TRUE);
     //forces closure of connection when done
index dd36b19b6ca1956d1c269ba10cc81a81d15ccd86..194f870b9b6228cdf480e4554ab2d68e684019df 100644 (file)
@@ -101,8 +101,8 @@ class CRM_Core_Payment_PaymentExpressUtils {
     curl_setopt($curl, CURLOPT_SSLVERSION, 0);
 
     if (strtoupper(substr(@php_uname('s'), 0, 3)) === 'WIN') {
-      curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL'));
-      curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL') ? 2 : 0);
+      curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, Civi::settings()->get('verifySSL'));
+      curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, Civi::settings()->get('verifySSL') ? 2 : 0);
     }
     return $curl;
   }
index 077db4b72bb1ce662ba1e518c6ca52b97e905a20..9af1649742aeb19b211d1d8cfcc0c588cb461b63 100644 (file)
@@ -150,7 +150,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
     curl_setopt($submit, CURLOPT_HTTPHEADER, array('SOAPAction: ""'));
     curl_setopt($submit, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($submit, CURLOPT_TIMEOUT, 60);
-    curl_setopt($submit, CURLOPT_SSL_VERIFYPEER, CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL'));
+    curl_setopt($submit, CURLOPT_SSL_VERIFYPEER, Civi::settings()->get('verifySSL'));
     curl_setopt($submit, CURLOPT_HEADER, 0);
 
     // take caching out of the picture
index d3eb354d0adc88b98f6e9a051ab18c3a233aefb1..554d31d5a908b5de17a031da48ec866e0071ef8d 100644 (file)
@@ -956,9 +956,7 @@ class CRM_Core_Permission {
    * @return bool
    */
   public static function isMultisiteEnabled() {
-    return CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME,
-      'is_enabled'
-    ) ? TRUE : FALSE;
+    return Civi::settings()->get('is_enabled') ? TRUE : FALSE;
   }
 
   /**
index 95a74f13e814a0cbe5131870bcaf2415f511029b..08d6f05a0986982134675cb10faa6e106810e505 100644 (file)
@@ -140,7 +140,7 @@ class CRM_Core_Resources {
     $this->strings = new CRM_Core_Resources_Strings($cache);
     $this->cacheCodeKey = $cacheCodeKey;
     if ($cacheCodeKey !== NULL) {
-      $this->cacheCode = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, $cacheCodeKey);
+      $this->cacheCode = Civi::settings()->get($cacheCodeKey);
     }
     if (!$this->cacheCode) {
       $this->resetCacheCode();
@@ -644,7 +644,7 @@ class CRM_Core_Resources {
       if (!empty($config->customCSSURL)) {
         $this->addStyleUrl($config->customCSSURL, 99, $region);
       }
-      if (!CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'disable_core_css')) {
+      if (!Civi::settings()->get('disable_core_css')) {
         $this->addStyleFile('civicrm', 'css/civicrm.css', -99, $region);
       }
       // crm-i.css added ahead of other styles so it can be overridden by FA.
@@ -724,7 +724,7 @@ class CRM_Core_Resources {
       "js/wysiwyg/crm.wysiwyg.js",
     );
     // add wysiwyg editor
-    $editor = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'editor_id');
+    $editor = Civi::settings()->get('editor_id');
     if ($editor == "CKEditor") {
       $items[] = "js/wysiwyg/crm.ckeditor.js";
       $ckConfig = CRM_Admin_Page_CKEditorConfig::getConfigUrl();
index 5642a0a56efa60c1f7961622120667c7c319b632..c53ade7bd475419a09e512fb0e6dff9f22f912c3 100644 (file)
@@ -46,7 +46,7 @@ class CRM_Cxn_ApiRouter {
     require_once 'api/v3/utils.php';
 
     // FIXME: Shouldn't the X-Forwarded-Proto check be part of CRM_Utils_System::isSSL()?
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enableSSL') &&
+    if (Civi::settings()->get('enableSSL') &&
       !CRM_Utils_System::isSSL() &&
       strtolower(CRM_Utils_Array::value('X_FORWARDED_PROTO', CRM_Utils_System::getRequestHeaders())) != 'https'
     ) {
index b8f4415080bd170fa53077bc650ba076b8f727c0..16d5fe25f933ae4ef952aa30f5b39eacac42ee46 100644 (file)
@@ -56,7 +56,7 @@ class CRM_Cxn_BAO_Cxn extends CRM_Cxn_DAO_Cxn {
 
     // In practice, this may not be necessary, but we want to prevent
     // edge-cases that downgrade security-level below system policy.
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enableSSL')) {
+    if (Civi::settings()->get('enableSSL')) {
       $civiUrl = preg_replace('/^http:/', 'https:', $civiUrl);
     }
 
index d1b5e7f48b15a04e485dc7e90c7722081a8f4d84..da03e65167f34aaa35137277bd781344e8525ab6 100644 (file)
@@ -83,7 +83,7 @@ class CRM_Cxn_CiviCxnHttp extends \Civi\Cxn\Rpc\Http\PhpHttp {
     $result = parent::createStreamOpts($verb, $url, $blob, $headers);
 
     $caConfig = CA_Config_Stream::probe(array(
-      'verify_peer' => (bool) CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL'),
+      'verify_peer' => (bool) Civi::settings()->get('verifySSL'),
     ));
     if ($caConfig->isEnableSSL()) {
       $result['ssl'] = $caConfig->toStreamOptions();
index f5fad57bd70972fbcacd2ec9f36751eb573e0218..0b019f6b6de22213d05fa951a15a245d7d4be251 100644 (file)
@@ -50,7 +50,7 @@ class CRM_Dashlet_Page_Blog extends CRM_Core_Page {
   public function getBlogUrl() {
     // Note: We use "*default*" as the default (rather than self::BLOG_URL) so that future
     // developers can change BLOG_URL without needing to update {civicrm_setting}.
-    $url = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'blogUrl', NULL, '*default*');
+    $url = Civi::settings()->get('blogUrl');
     if ($url === '*default*') {
       $url = self::BLOG_URL;
     }
index cce8709032b7ae91207d307cdb729d15db04fb61..d499e45c748f17870284fc0f9ed15490d665f503 100644 (file)
@@ -380,9 +380,7 @@ WHERE      civicrm_event.is_active = 1 AND
       $optionGroupId = $optionGroupDAO->id;
     }
     // Get the event summary display preferences
-    $show_max_events = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME,
-      'show_events'
-    );
+    $show_max_events = Civi::settings()->get('show_events');
     // default to 10 if no option is set
     if (is_null($show_max_events)) {
       $show_max_events = 10;
@@ -847,9 +845,7 @@ WHERE civicrm_event.is_active = 1
     $permissions = CRM_Core_Permission::event(CRM_Core_Permission::VIEW);
 
     // check if we're in shopping cart mode for events
-    $enable_cart = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME,
-      'enable_cart'
-    );
+    $enable_cart = Civi::settings()->get('enable_cart');
     if ($enable_cart) {
     }
     while ($dao->fetch()) {
@@ -1240,7 +1236,7 @@ WHERE civicrm_event.is_active = 1
           // append invoice pdf to email
           $template = CRM_Core_Smarty::singleton();
           $taxAmt = $template->get_template_vars('totalTaxAmount');
-          $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+          $prefixValue = Civi::settings()->get('contribution_invoice_settings');
           $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
           if (isset($invoicing) && isset($prefixValue['is_email_pdf']) && !empty($values['contributionId'])) {
             $sendTemplateParams['isEmailPdf'] = TRUE;
index ea73cc3850cd9e55a5d9801ecb3478341d9fae87..8cc1ade13cdb31bf8c3922df615f2bbb011a971d 100644 (file)
@@ -1905,7 +1905,7 @@ GROUP BY li.entity_table, li.entity_id, price_field_value_id
       $updateFinancialItemInfoDAO = CRM_Core_DAO::executeQuery($updateFinancialItem);
       $trxn = CRM_Core_BAO_FinancialTrxn::getFinancialTrxnId($contributionId, 'DESC', TRUE);
       $trxnId['id'] = $trxn['financialTrxnId'];
-      $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+      $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
       $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
       $updateFinancialItemInfoValues = array();
       $financialItemsArray = array();
@@ -2210,7 +2210,7 @@ WHERE (entity_table = 'civicrm_participant' AND entity_id = {$participantId} AND
     if ($fieldName == 'status_id' && $context != 'validate') {
       // Get rid of cart-related option if disabled
       // FIXME: Why does this option even exist if cart is disabled?
-      if (!CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME, 'enable_cart')) {
+      if (!Civi::settings()->get('enable_cart')) {
         $params['condition'][] = "name <> 'Pending in cart'";
       }
     }
index 92dc9a4b161f055c46e0d9fce42fdbb123341c62..54c4ca77562d7bbbee95888eb06165413621e515 100644 (file)
@@ -370,7 +370,7 @@ SELECT  id, html_type
       CRM_Event_Form_Registration::initEventFee($form, $event['id']);
       CRM_Event_Form_Registration_Register::buildAmount($form, TRUE, $form->_discountId);
       $lineItem = array();
-      $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+      $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
       $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
       $totalTaxAmount = 0;
       if (!CRM_Utils_System::isNull(CRM_Utils_Array::value('line_items', $form->_values))) {
@@ -507,9 +507,7 @@ SELECT  id, html_type
       }
     }
 
-    $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
-      'mailing_backend'
-    );
+    $mailingInfo = Civi::settings()->get('mailing_backend');
     $form->assign('outBound_option', $mailingInfo['outBound_option']);
     $form->assign('hasPayment', $form->_paymentId);
   }
index d707a725214ca3845d8fa541940d8c6317c9c365..49ea6670ae88fdb0e4160d754abf5a89991bfa9b 100644 (file)
@@ -99,9 +99,7 @@ class CRM_Event_Form_ManageEvent_TabHeader {
     }
 
     // check if we're in shopping cart mode for events
-    $enableCart = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME,
-      'enable_cart'
-    );
+    $enableCart = Civi::settings()->get('enable_cart');
     if (!$enableCart) {
       unset($tabs['conference']);
     }
index 4c776e58a36c5346dbef9445a673532eea6e375b..373da816fb29ff2ceea3a8f1f7a7a3a6c9a20750 100644 (file)
@@ -1623,7 +1623,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
         if ($this->_isPaidEvent) {
           // fix amount for each of participants ( for bulk mode )
           $eventAmount = array();
-          $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+          $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
           $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
           $totalTaxAmount = 0;
 
@@ -1689,7 +1689,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
         $contributionId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment',
           $this->_id, 'contribution_id', 'participant_id'
         );
-        $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+        $prefixValue = Civi::settings()->get('contribution_invoice_settings');
         $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
         if (count($taxAmt) > 0 && (isset($invoicing) && isset($prefixValue['is_email_pdf']))) {
           $sendTemplateParams['isEmailPdf'] = TRUE;
index 23f798838aa6451aaff33a103b3632e8e6e07296..652f61f7226e66b30e70956a4c591acc2166c7eb 100644 (file)
@@ -178,7 +178,7 @@ class CRM_Event_Form_ParticipantView extends CRM_Core_Form {
     $displayName = CRM_Contact_BAO_Contact::displayName($values[$participantID]['contact_id']);
 
     $participantCount = array();
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     $totalTaxAmount = 0;
     foreach ($lineItem as $k => $v) {
index 0a6aff672ddd02b8edf7aa493d1469433a60a0c1..8656e539b3b33c44eda85e7abd462fa1877dd1ee 100644 (file)
@@ -258,7 +258,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
         }
       }
 
-      $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+      $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
       $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
       $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
       if ($invoicing) {
@@ -715,7 +715,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
       }
 
       $entityTable = 'civicrm_participant';
-      $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+      $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
       $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
       $totalTaxAmount = 0;
       $dataArray = array();
index 401858d1acfed58c377188d0b9f61ad47f04afa8..c12d6c6a5790c5f745dba5952e48363cf14b81d1 100644 (file)
@@ -96,7 +96,7 @@ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration {
     }
     $this->assignToTemplate();
 
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
     $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     $getTaxDetails = FALSE;
index 88041dbcb7174f5b39302057c49aaa648d1be59a..bcba40c66f0c8cb56915f99f57690e43fc0598f2 100644 (file)
@@ -48,9 +48,7 @@ class CRM_Event_Page_DashBoard extends CRM_Core_Page {
     CRM_Utils_System::setTitle(ts('CiviEvent'));
 
     $eventSummary = CRM_Event_BAO_Event::getEventSummary();
-    $enableCart = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME,
-      'enable_cart'
-    );
+    $enableCart = Civi::settings()->get('enable_cart');
     $eventSummary['tab'] = CRM_Event_Page_ManageEvent::tabs($enableCart);
 
     $actionColumn = FALSE;
index 5f8a1182c1f2f9b01c4c1861c779f313412142bb..0afdebb66fd13bebae9d98ce4deadfee0afac8c1 100644 (file)
@@ -146,7 +146,7 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page {
               $labelClass = 'price_set_field-label';
             }
             // show tax rate with amount
-            $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+            $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
             $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
             $displayOpt = CRM_Utils_Array::value('tax_display_settings', $invoiceSettings);
             $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
@@ -287,10 +287,7 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page {
           }
 
           // check if we're in shopping cart mode for events
-          $enable_cart = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME,
-            'enable_cart'
-          );
-
+          $enable_cart = Civi::settings()->get('enable_cart');
           if ($enable_cart) {
             $link = CRM_Event_Cart_BAO_EventInCart::get_registration_link($this->_id);
             $registerText = $link['label'];
@@ -357,7 +354,7 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page {
     $this->assign('location', $values['location']);
 
     if (CRM_Core_Permission::check('access CiviEvent')) {
-      $enableCart = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME, 'enable_cart');
+      $enableCart = Civi::settings()->get('enable_cart');
       $this->assign('manageEventLinks', CRM_Event_Page_ManageEvent::tabs($enableCart));
     }
 
index 003013ededc3bda8267e13033ce9cbfb6a7755b5..a6a3268f7582f6b59c51248ac07014753492175a 100644 (file)
@@ -75,9 +75,7 @@ class CRM_Event_Page_ICalendar extends CRM_Core_Page {
     }
     elseif ($html) {
       // check if we're in shopping cart mode for events
-      $enable_cart = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME,
-        'enable_cart'
-      );
+      $enable_cart = Civi::settings()->get('enable_cart');
       if ($enable_cart) {
         $this->assign('registration_links', TRUE);
       }
index dc57ff0cbd843af53f6a2a3cb22a5c44359c5438..3c58fd5e6274a4e18b4f4344e1bb0341b1797521 100644 (file)
@@ -311,9 +311,7 @@ ORDER BY start_date desc
       $eventPCPS[$pcpDao->entity_id] = $pcpDao->entity_id;
     }
     // check if we're in shopping cart mode for events
-    $enableCart = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME,
-      'enable_cart'
-    );
+    $enableCart = Civi::settings()->get('enable_cart');
     $this->assign('eventCartEnabled', $enableCart);
     $mapping = CRM_Utils_Array::first(CRM_Core_BAO_ActionSchedule::getMappings(array(
       'id' => CRM_Event_ActionMapping::EVENT_NAME_MAPPING_ID,
index 841e4530188b4720142e3deb9766e99735f747fb..d3c36ac0a7853051b67d1242f951fc07fd20cdc2 100644 (file)
@@ -174,7 +174,7 @@ class CRM_Financial_BAO_ExportFormat_CSV extends CRM_Financial_BAO_ExportFormat
    */
   public function makeCSV($export) {
     // getting data from admin page
-    $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $prefixValue = Civi::settings()->get('contribution_invoice_settings');
 
     foreach ($export as $batchId => $dao) {
       $financialItems = array();
index cf14e860d972851c7cbf9e17b6457cc8356f7a2c..5a62341b3ce4a7abde52c37eb06e244a7ca1e97a 100644 (file)
@@ -101,7 +101,7 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem {
     );
 
     if ($taxTrxnID) {
-      $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+      $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
       $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
       $params['amount'] = $lineItem->tax_amount;
       $params['description'] = $taxTerm;
@@ -250,7 +250,7 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem {
       return FALSE;
     }
 
-    $allowPermDelete = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'allowPermDeleteFinancial');
+    $allowPermDelete = Civi::settings()->get('allowPermDeleteFinancial');
 
     if (!$allowPermDelete) {
       $sql = 'SELECT DISTINCT(cc.id), cc.display_name FROM civicrm_contact cc
index 4c3c5ce83355c968f769d7153c2f05b7835473a7..1b248bfa92b6a01d407d0d290c6c78e51d6f0a93 100644 (file)
@@ -402,9 +402,7 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType {
     if (array_key_exists('acl_financial_type', self::$_statusACLFt)) {
       return self::$_statusACLFt['acl_financial_type'];
     }
-    $contributeSettings = CRM_Core_BAO_Setting::getItem(
-      CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings'
-    );
+    $contributeSettings = Civi::settings()->get('contribution_invoice_settings');
     self::$_statusACLFt['acl_financial_type'] = FALSE;
     if (CRM_Utils_Array::value('acl_financial_type', $contributeSettings)) {
       self::$_statusACLFt['acl_financial_type'] = TRUE;
index 7b2b0b910fd4bf061fa0ee04c2658c4c983232dd..c88f386adee112cbe426ef38260e1894cc2f0e6e 100644 (file)
@@ -1775,7 +1775,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
       $errors['body'] = ts('Field "body_html" or "body_text" is required.');
     }
 
-    if (!CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'disable_mandatory_tokens_check')) {
+    if (!Civi::settings()->get('disable_mandatory_tokens_check')) {
       $header = $mailing->header_id && $mailing->header_id != 'null' ? CRM_Mailing_BAO_Component::findById($mailing->header_id) : NULL;
       $footer = $mailing->footer_id && $mailing->footer_id != 'null' ? CRM_Mailing_BAO_Component::findById($mailing->footer_id) : NULL;
       foreach (array('body_html', 'body_text') as $field) {
@@ -1830,7 +1830,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
    */
   public static function getMailingHash($id) {
     $hash = NULL;
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'hash_mailing_url')) {
+    if (Civi::settings()->get('hash_mailing_url')) {
       $hash = CRM_Core_DAO::getFieldValue('CRM_Mailing_BAO_Mailing', $id, 'hash', 'id');
     }
     return $hash;
index 998e046a61f43107a7696fe4b598846ee1e26798..e6023f77a864a3cb38abde42c1d7a540aa340d9b 100644 (file)
@@ -926,12 +926,7 @@ AND    status IN ( 'Scheduled', 'Running', 'Paused' )
     }
 
     if ($writeActivity === NULL) {
-      $writeActivity = CRM_Core_BAO_Setting::getItem(
-        CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
-        'write_activity_record',
-        NULL,
-        TRUE
-      );
+      $writeActivity = Civi::settings()->get('write_activity_record');
     }
 
     if (!$writeActivity) {
index 2bc5c972be7a627b2e98c49f92f8498654b42a5e..6702e275447a6dff5db0af6eb3286e05aa9c6efd 100644 (file)
@@ -165,8 +165,8 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info {
           'mailTokens' => $mailTokens['values'],
           'contactid' => $contactID,
           'requiredTokens' => CRM_Utils_Token::getRequiredTokens(),
-          'enableReplyTo' => (int) CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'replyTo'),
-          'disableMandatoryTokensCheck' => (int) CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'disable_mandatory_tokens_check'),
+          'enableReplyTo' => (int) Civi::settings()->get('replyTo'),
+          'disableMandatoryTokensCheck' => (int) Civi::settings()->get('disable_mandatory_tokens_check'),
           'fromAddress' => $fromAddress['values'],
           'defaultTestEmail' => civicrm_api3('Contact', 'getvalue', array(
               'id' => 'user_contact_id',
@@ -206,11 +206,7 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info {
       return FALSE;
     }
 
-    $enableWorkflow = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
-      'civimail_workflow',
-      NULL,
-      FALSE
-    );
+    $enableWorkflow = Civi::settings()->get('civimail_workflow');
 
     return ($enableWorkflow &&
       $config->userSystem->is_drupal
index 49c75879a1ef20a6472a7539735b1471ea39d12f..411cbd0c0fb5a9ab10073d15c0d9479399fbb260 100644 (file)
@@ -99,7 +99,7 @@ class CRM_Mailing_Page_View extends CRM_Core_Page {
     }
 
     // mailing key check
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'hash_mailing_url')) {
+    if (Civi::settings()->get('hash_mailing_url')) {
       $this->_mailing = new CRM_Mailing_BAO_Mailing();
 
       if (!is_numeric($this->_mailingID)) {
index 51cf19ad8f438accbcee090dc3484deedf2a7e7c..cd312ff947e561aa8cde30d1ca6e71cf74624e05 100644 (file)
@@ -411,7 +411,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
     $this->assign('taxRates', json_encode(CRM_Core_PseudoConstant::getTaxRates()));
 
     $this->assign('currency', CRM_Core_Config::singleton()->defaultCurrencySymbol);
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     if (isset($invoicing)) {
       $this->assign('taxTerm', CRM_Utils_Array::value('tax_term', $invoiceSettings));
@@ -719,8 +719,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
 
     $this->addFormRule(array('CRM_Member_Form_Membership', 'formRule'), $this);
 
-    $this->assign('outBound_option', CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
-      'mailing_backend'));
+    $this->assign('outBound_option', Civi::settings()->get('mailing_backend'));
 
     parent::buildQuickForm();
   }
@@ -1082,7 +1081,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
     $template = CRM_Core_Smarty::singleton();
     $taxAmt = $template->get_template_vars('dataArray');
     $eventTaxAmt = $template->get_template_vars('totalTaxAmount');
-    $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $prefixValue = Civi::settings()->get('contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
     if ((!empty($taxAmt) || isset($eventTaxAmt)) && (isset($invoicing) && isset($prefixValue['is_email_pdf']))) {
       $isEmailPdf = TRUE;
@@ -1653,7 +1652,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
     }
 
     if (!empty($lineItem[$this->_priceSetId])) {
-      $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+      $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
       $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
       $taxAmount = FALSE;
       $totalTaxAmount = 0;
index 2db99745c8b1373b95c471a1b9286def19ad46bf..3945daf1cba4d64263aa80f96e2703f7abaa4b58 100644 (file)
@@ -261,7 +261,7 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
     $taxRates = CRM_Core_PseudoConstant::getTaxRates();
     $taxRate = CRM_Utils_Array::value($allMemberships[$defaults['membership_type_id']]['financial_type_id'], $taxRates);
 
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
 
     // auto renew options if enabled for the membership
     $options = CRM_Core_SelectValues::memberAutoRenew();
@@ -398,9 +398,7 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
     // The member form uses emailExists. Assigning both while we transition / synchronise.
     $this->assign('emailExists', $this->_contributorEmail);
 
-    $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
-      'mailing_backend'
-    );
+    $mailingInfo = Civi::settings()->get('mailing_backend');
     $this->assign('outBound_option', $mailingInfo['outBound_option']);
 
     if (CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $this->_id, 'contribution_recur_id')) {
index b416da1b8a9e63cc27ec7af88f012e76ce2752ec..8cdcd78e7969c575f3164b6f90a020a5d47788b3 100644 (file)
@@ -68,9 +68,7 @@ class CRM_Member_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard
       $membership[$dao->id]['renewPageId'] = CRM_Member_BAO_Membership::getContributionPageId($dao->id);
       if (!$membership[$dao->id]['renewPageId']) {
         // Membership payment was not done via online contribution page or free membership. Check for default membership renewal page from CiviMember Settings
-        $defaultRenewPageId = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MEMBER_PREFERENCES_NAME,
-          'default_renewal_contribution_page'
-        );
+        $defaultRenewPageId = Civi::settings()->get('default_renewal_contribution_page');
         if ($defaultRenewPageId) {
           //CRM-14831 - check if membership type is present in contrib page
           $memBlock = CRM_Member_BAO_Membership::getMembershipBlock($defaultRenewPageId);
index 354ba2e0dac0b5225524fa83a386e14ab5ebafd6..6a4456ed6001fa67fbd2468ceae166917c455435 100644 (file)
@@ -396,9 +396,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
       array('' => ts('- select -')) + $pledgePages
     );
 
-    $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
-      'mailing_backend'
-    );
+    $mailingInfo = Civi::settings()->get('mailing_backend');
     $this->assign('outBound_option', $mailingInfo['outBound_option']);
 
     // build custom data
index 0e8dccce32d53fcd6a03799e90a927433d196deb..c793357db2b0e589f91ea84bba67085adf60d697 100644 (file)
@@ -219,7 +219,7 @@ AND li.entity_id = {$entityId}
     );
 
     $getTaxDetails = FALSE;
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     if ($overrideWhereClause) {
       $whereClause = $overrideWhereClause;
index b15df0b3b4bcde910abb7dc861940b71da5acc1a..75fcf0b610d85c3ae492a33af854c5642bc753b7 100644 (file)
@@ -298,7 +298,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
     //use value field.
     $valueFieldName = 'amount';
     $seperator = '|';
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
     $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
     $displayOpt = CRM_Utils_Array::value('tax_display_settings', $invoiceSettings);
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
index 85b3a27fb45726fd7261665b684797739c598263..34b4ba6d25330d5318dbfc87476b49a7f993d74e 100644 (file)
@@ -128,7 +128,7 @@ class CRM_Price_Page_Field extends CRM_Core_Page {
     $priceFieldBAO->find();
 
     // display taxTerm for priceFields
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
     $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     $getTaxDetails = FALSE;
index 5113766055d84738f50cc88730f5e9d79a514997..5d2a8bbca3ff80085fd95e37760fa61fa9cc476e 100644 (file)
@@ -137,7 +137,7 @@ class CRM_Price_Page_Option extends CRM_Core_Page {
     $financialType = CRM_Contribute_PseudoConstant::financialType();
     $taxRate = CRM_Core_PseudoConstant::getTaxRates();
     // display taxTerm for priceFields
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+    $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
     $taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     $getTaxDetails = FALSE;
index 06734d693f74a22f8f7b69da57bd7adcc9773cff..d9c9b411a2e3d1e82cee3306c03f19c1ce189f5c 100644 (file)
@@ -130,7 +130,7 @@ class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base
    * @return int
    */
   public static function updateWysiwyg() {
-    $editorID = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'editor_id');
+    $editorID = Civi::settings()->get('editor_id');
     // Previously a numeric value indicated one of 4 wysiwyg editors shipped in core, and no value indicated 'Textarea'
     // Now the options are "Textarea", "CKEditor", and the rest have been dropped from core.
     $newEditor = $editorID ? "CKEditor" : "Textarea";
index 7dfdd90ef188fc247db18893499d6b48090cf3af..dedae1bb73ca7dd715e7aa54c4b566a1754ec9c3 100644 (file)
@@ -1123,10 +1123,7 @@ GROUP BY     mt.member_of_contact_id";
    * @return object
    */
   public static function eventPriceSetDomainID() {
-    return CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME,
-      'event_price_set_domain_id',
-      NULL, FALSE
-    );
+    return Civi::settings()->get('event_price_set_domain_id');
   }
 
   /**
index 6656f34e253c97af11ad267484e453dc301c094d..62c7a31b4922026f59861a5a5548745d441a8dcd 100644 (file)
@@ -67,11 +67,11 @@ class CRM_Utils_Address {
     static $config = NULL;
 
     if (!$format) {
-      $format = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'address_format');
+      $format = Civi::settings()->get('address_format');
     }
 
     if ($mailing) {
-      $format = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'mailing_format');
+      $format = Civi::settings()->get('mailing_format');
     }
 
     $formatted = $format;
index 74fab74f9c43a81fa1d4d709796a5bfcb9e5c70c..2f26dd8f9c6f6b406778569fd870d8c1a713b1a5 100644 (file)
@@ -52,12 +52,8 @@ class CRM_Utils_Address_USPS {
       return FALSE;
     }
 
-    $userID = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::ADDRESS_STANDARDIZATION_PREFERENCES_NAME,
-      'address_standardization_userid'
-    );
-    $url = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::ADDRESS_STANDARDIZATION_PREFERENCES_NAME,
-      'address_standardization_url'
-    );
+    $userID = Civi::settings()->get('address_standardization_userid');
+    $url = Civi::settings()->get('address_standardization_url');
 
     if (empty($userID) ||
       empty($url)
index 9e1aaaef48e9b2d356cb3d11addc179149b4fc42..2efc00c8488915a9d5ded0d52bf1bba7da4c75bb 100644 (file)
@@ -145,7 +145,7 @@ class CRM_Utils_Check_Env {
   public function checkOutboundMail() {
     $messages = array();
 
-    $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'mailing_backend');
+    $mailingInfo = Civi::settings()->get('mailing_backend');
     if (($mailingInfo['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_REDIRECT_TO_DB
       || (defined('CIVICRM_MAIL_LOG') && CIVICRM_MAIL_LOG)
       || $mailingInfo['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_DISABLED
index 5276f7c631f688cfd248de429748b8dd271fa738..892ad15fb83294a9b967c98e9dd1dcdcdce97531 100644 (file)
@@ -179,7 +179,7 @@ class CRM_Utils_Date {
     static $days = array();
     if (!$days) {
       // First day of the week
-      $firstDay = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME, 'weekBegins', NULL, 0);
+      $firstDay = Civi::settings()->get('weekBegins');
 
       // set LC_TIME and build the arrays from locale-provided names
       // June 1st, 1970 was a Monday
@@ -208,7 +208,7 @@ class CRM_Utils_Date {
     static $days = array();
     if (!$days) {
       // First day of the week
-      $firstDay = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME, 'weekBegins', NULL, 0);
+      $firstDay = Civi::settings()->get('weekBegins');
 
       // set LC_TIME and build the arrays from locale-provided names
       // June 1st, 1970 was a Monday
@@ -1487,7 +1487,7 @@ class CRM_Utils_Date {
         break;
 
       case 'week':
-        $weekFirst = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME, 'weekBegins', NULL, 0);
+        $weekFirst = Civi::settings()->get('weekBegins');
         $thisDay = $now['wday'];
         if ($weekFirst > $thisDay) {
           $diffDay = $thisDay - $weekFirst + 7;
index 790fb37dd6e0d1a05af667d419a54fd8577ee4fa..ee4cb5171fac1d8253821ac496e8158458512e61 100644 (file)
@@ -198,7 +198,7 @@ class CRM_Utils_HttpClient {
    */
   protected function createCurl($remoteFile) {
     $caConfig = CA_Config_Curl::probe(array(
-      'verify_peer' => (bool) CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL'),
+      'verify_peer' => (bool) Civi::settings()->get('verifySSL'),
     ));
 
     $ch = curl_init();
index 6f096eafbce6599a464b6fee2873257f3d7e4567..f80bcb45a804c259e6c202ed3199e3427e2e83b8 100644 (file)
@@ -43,9 +43,7 @@ class CRM_Utils_Mail {
    * @return Mail
    */
   public static function createMailer() {
-    $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
-      'mailing_backend'
-    );
+    $mailingInfo = Civi::settings()->get('mailing_backend');
 
     if ($mailingInfo['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_REDIRECT_TO_DB ||
       (defined('CIVICRM_MAILER_SPOOL') && CIVICRM_MAILER_SPOOL)
@@ -375,9 +373,7 @@ class CRM_Utils_Mail {
    *   TRUE if valid outBound email configuration found, false otherwise.
    */
   public static function validOutBoundMail() {
-    $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
-      'mailing_backend'
-    );
+    $mailingInfo = Civi::settings()->get('mailing_backend');
     if ($mailingInfo['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_MAIL) {
       return TRUE;
     }
index 4dd4ffff009c71f19f9ea65ed291a9c9ea8b47b4..78c4ae422c6ba8661e3bcba6e29243e38d5da277 100644 (file)
@@ -269,7 +269,7 @@ class CRM_Utils_PDF_Label extends TCPDF {
     // Check to see if we have any additional fonts to add. You can specify more fonts in
     // civicrm.settings.php via: $config['CiviCRM Preferences']['additional_fonts']
     // CRM-13307
-    $additionalFonts = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'additional_fonts');
+    $additionalFonts = Civi::settings()->get('additional_fonts');
     if (is_array($additionalFonts)) {
       $fontLabel = array_merge($fontLabel, $additionalFonts);
     }
index e4d8af9e9f5a76315e56ae0912e94ec64671a6d7..3fc17410b135673da9f40448b787b89947542564 100644 (file)
@@ -81,14 +81,14 @@ class CRM_Utils_QueryFormatter {
    */
   public static function singleton($fresh = FALSE) {
     if ($fresh || self::$singleton === NULL) {
-      $mode = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SEARCH_PREFERENCES_NAME, 'fts_query_mode', NULL, self::MODE_NONE);
+      $mode = Civi::settings()->get('fts_query_mode');
       self::$singleton = new CRM_Utils_QueryFormatter($mode);
     }
     return self::$singleton;
   }
 
   /**
-   * @var string 
+   * @var string
    *   eg MODE_NONE
    */
   protected $mode;
index 2ca8294c6291de4ac97268e75e7a6a10b6810755..d14f0259452ed15d03fe50581e52642e6c78e8d3 100644 (file)
@@ -1196,7 +1196,7 @@ class CRM_Utils_System {
     $config = CRM_Core_Config::singleton();
     $req_headers = self::getRequestHeaders();
     // FIXME: Shouldn't the X-Forwarded-Proto check be part of CRM_Utils_System::isSSL()?
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enableSSL') &&
+    if (Civi::settings()->get('enableSSL') &&
       !self::isSSL() &&
       strtolower(CRM_Utils_Array::value('X_FORWARDED_PROTO', $req_headers)) != 'https'
     ) {
@@ -1823,7 +1823,7 @@ class CRM_Utils_System {
    * @return string
    */
   public static function getSiteID() {
-    $sid = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'site_id');
+    $sid = Civi::settings()->get('site_id');
     if (!$sid) {
       $config = CRM_Core_Config::singleton();
       $sid = md5('sid_' . (defined('CIVICRM_SITE_KEY') ? CIVICRM_SITE_KEY : '') . '_' . $config->userFrameworkBaseURL);
index dea048da3bd14799fdbb00835d587dfd111e0997..0b815191fe7c705811fd3a0642f67bddb14a0896 100644 (file)
@@ -381,7 +381,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
     if (!$cmsRootPath) {
       CRM_Core_Error::fatal("Could not find the install directory for WordPress");
     }
-    $path = CRM_Core_BAO_Setting::getItem('CiviCRM Preferences', 'wpLoadPhp');
+    $path = Civi::settings()->get('wpLoadPhp');
     if (!empty($path)) {
       require_once $path;
     }
index 583c5d115304c07c7c7de9d124c14b5006d515b6..eff22b55068032209619d3767fa3f28bab1d978b 100644 (file)
@@ -104,7 +104,7 @@ class CRM_Utils_VersionCheck {
       $this->localMajorVersion = $this->getMajorVersion($this->localVersion);
     }
     // Populate $versionInfo
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'versionCheck', NULL, 1)) {
+    if (Civi::settings()->get('versionCheck')) {
       // Use cached data if available and not stale
       if (!$this->readCacheFile()) {
         // Collect stats for pingback
index bc0f7859915f39f9915079431e03937972560abf..d7358097ef3fb7a2d489dd5cfd3ef3290ea6d8c0 100644 (file)
@@ -50,4 +50,19 @@ return array(
     'description' => "WRITE ME",
     'help_text' => 'WRITE ME',
   ),
+  'show_events' => array(
+    'name' => 'show_events',
+    'group_name' => 'Event Preferences',
+    'group' => 'event',
+    'type' => 'Integer',
+    'quick_form_type' => 'Element',
+    'default' => 10,
+    'add' => '4.5',
+    'title' => 'Dashboard entries',
+    'html_type' => 'select',
+    'is_domain' => 1,
+    'is_contact' => 0,
+    'description' => "Configure how many events should be shown on the dashboard. This overrides the default value of 10 entries.",
+    'help_text' => NULL,
+  ),
 );