Cleanup deprecated CRM_Core_BAO_Settings calls CRM-17507
[civicrm-core.git] / CRM / Admin / Form / Preferences / Contribute.php
index 18fcd62e23f3b52fe6034086f44711877a74fca5..0a5513cbd2b051261b22f9d7523d877f28a12e95 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  *
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
  */
 
 /**
- * This class generates form components for the display preferences
- *
+ * This class generates form components for the display preferences.
  */
 class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences {
   protected $_settings = array(
     'cvv_backoffice_required' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
   );
+
   /**
    * Process the form submission.
-   *
-   *
-   * @return void
    */
   public function preProcess() {
     $config = CRM_Core_Config::singleton();
@@ -121,8 +116,6 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences {
 
   /**
    * Build the form object.
-   *
-   * @return void
    */
   public function buildQuickForm() {
     //CRM-16691: Changes made related to settings of 'CVV'.
@@ -147,18 +140,17 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences {
       $this->assign("{$setting}_description", ts($props['description']));
     }
     $this->add('checkbox', 'invoicing', ts('Enable Tax and Invoicing'));
+    $this->add('checkbox', 'acl_financial_type', ts('Enable Access Control by Financial Type'));
     parent::buildQuickForm();
   }
 
   /**
    * Set default values for the form.
-   * default values are retrieved from the database
-   *
    *
-   * @return void
+   * 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));
@@ -175,9 +167,6 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences {
 
   /**
    * Process the form after the input has been submitted and validated.
-   *
-   *
-   * @return void
    */
   public function postProcess() {
     // store the submitted values in an array