From: eileenmcnaugton Date: Mon, 1 Aug 2016 00:31:14 +0000 (+1200) Subject: NFC - comments & removing unnecessary params, use Civi::settings()->get X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=167bcb5fea005a879d172d0d3b985862db48dcb0;p=civicrm-core.git NFC - comments & removing unnecessary params, use Civi::settings()->get --- diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 70f7245ffb..f621736dc9 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -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 * diff --git a/CRM/Pledge/Form/Search.php b/CRM/Pledge/Form/Search.php index cc098aaaee..be47cfdc08 100644 --- a/CRM/Pledge/Form/Search.php +++ b/CRM/Pledge/Form/Search.php @@ -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(); diff --git a/CRM/Pledge/Form/Task.php b/CRM/Pledge/Form/Task.php index d93408d2f9..9ba19f17b6 100644 --- a/CRM/Pledge/Form/Task.php +++ b/CRM/Pledge/Form/Task.php @@ -72,6 +72,8 @@ class CRM_Pledge_Form_Task extends CRM_Core_Form { } /** + * Common pre-processing. + * * @param CRM_Core_Form $form * @param bool $useTable */ diff --git a/CRM/Pledge/Page/DashBoard.php b/CRM/Pledge/Page/DashBoard.php index 68a1c3bde3..5fcfb3e443 100644 --- a/CRM/Pledge/Page/DashBoard.php +++ b/CRM/Pledge/Page/DashBoard.php @@ -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