NFC - comments & removing unnecessary params, use Civi::settings()->get
authoreileenmcnaugton <eileen@fuzion.co.nz>
Mon, 1 Aug 2016 00:31:14 +0000 (12:31 +1200)
committereileenmcnaugton <eileen@fuzion.co.nz>
Mon, 1 Aug 2016 00:31:14 +0000 (12:31 +1200)
CRM/Core/DAO.php
CRM/Pledge/Form/Search.php
CRM/Pledge/Form/Task.php
CRM/Pledge/Page/DashBoard.php

index 70f7245ffbf9bbd1baeef78f4d21e78bcfdf2a6e..f621736dc956ec3a87ff784d4b1b9cd36b721b12 100644 (file)
@@ -2124,6 +2124,7 @@ SELECT contact_id
 
   /**
    * Get options for the called BAO object's field.
+   *
    * This function can be overridden by each BAO to add more logic related to context.
    * The overriding function will generally call the lower-level CRM_Core_PseudoConstant::get
    *
index cc098aaaee8e0af7fe6525a586ab5602272d9f0d..be47cfdc084b3ebfff3f88685b060b8366c576ca 100644 (file)
@@ -331,26 +331,20 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search {
     }
 
     // set pledge payment related fields
-    $status = CRM_Utils_Request::retrieve('status', 'String',
-      CRM_Core_DAO::$_nullObject
-    );
+    $status = CRM_Utils_Request::retrieve('status', 'String');
     if ($status) {
       $this->_formValues['pledge_payment_status_id'] = array($status => 1);
       $this->_defaults['pledge_payment_status_id'] = array($status => 1);
     }
 
-    $fromDate = CRM_Utils_Request::retrieve('start', 'Date',
-      CRM_Core_DAO::$_nullObject
-    );
+    $fromDate = CRM_Utils_Request::retrieve('start', 'Date');
     if ($fromDate) {
       list($date) = CRM_Utils_Date::setDateDefaults($fromDate);
       $this->_formValues['pledge_payment_date_low'] = $date;
       $this->_defaults['pledge_payment_date_low'] = $date;
     }
 
-    $toDate = CRM_Utils_Request::retrieve('end', 'Date',
-      CRM_Core_DAO::$_nullObject
-    );
+    $toDate = CRM_Utils_Request::retrieve('end', 'Date');
     if ($toDate) {
       list($date) = CRM_Utils_Date::setDateDefaults($toDate);
       $this->_formValues['pledge_payment_date_high'] = $date;
@@ -358,9 +352,7 @@ class CRM_Pledge_Form_Search extends CRM_Core_Form_Search {
     }
 
     // set pledge related fields
-    $pledgeStatus = CRM_Utils_Request::retrieve('pstatus', 'String',
-      CRM_Core_DAO::$_nullObject
-    );
+    $pledgeStatus = CRM_Utils_Request::retrieve('pstatus', 'String');
     if ($pledgeStatus) {
       $statusValues = CRM_Contribute_PseudoConstant::contributionStatus();
 
index d93408d2f9ca630fb5f838b4a99d43387cb20c06..9ba19f17b63d66f955feced62729f78e69f5bc77 100644 (file)
@@ -72,6 +72,8 @@ class CRM_Pledge_Form_Task extends CRM_Core_Form {
   }
 
   /**
+   * Common pre-processing.
+   *
    * @param CRM_Core_Form $form
    * @param bool $useTable
    */
index 68a1c3bde3551c6555529b7e80b2fa8ff017f679..5fcfb3e443c2a173631cf459a8d338fa2c3ac2ae 100644 (file)
@@ -37,8 +37,9 @@
 class CRM_Pledge_Page_DashBoard extends CRM_Core_Page {
 
   /**
-   * Heart of the viewing process: The runner gets all the meta data for
-   * the contact and calls the appropriate type of page to view.
+   * Heart of the viewing process.
+   *
+   * The runner gets all the meta data for the contact and calls the appropriate type of page to view.
    */
   public function preProcess() {
     CRM_Utils_System::setTitle(ts('CiviPledge'));
@@ -56,8 +57,7 @@ class CRM_Pledge_Page_DashBoard extends CRM_Core_Page {
     $startDateEnd = NULL;
 
     // current year - prefix = 'year'
-    $config = CRM_Core_Config::singleton();
-    $yearDate = $config->fiscalYearStart;
+    $yearDate = \Civi::settings()->get('fiscalYearStart');
     $year = array('Y' => date('Y'));
     $this->assign('curYear', $year['Y']);
     $yearDate = array_merge($year, $yearDate);
@@ -89,7 +89,8 @@ class CRM_Pledge_Page_DashBoard extends CRM_Core_Page {
   }
 
   /**
-   * the main function that is called when the page loads,
+   * The main function that is called when the page loads.
+   *
    * it decides which action has to be taken for the page.
    *
    * @return null