From f5aedad3fedc7aa00e35fb4ffc7d35988f779514 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Thu, 11 Aug 2016 18:27:02 +0530 Subject: [PATCH] CRM-16189, added docblock and removed cruft code ---------------------------------------- * CRM-16189: Improve support for Accrual Method bookkeeping https://issues.civicrm.org/jira/browse/CRM-16189 --- .../Form/Contribute/DeferredRevenue.php | 63 ++++++++----------- 1 file changed, 25 insertions(+), 38 deletions(-) diff --git a/CRM/Report/Form/Contribute/DeferredRevenue.php b/CRM/Report/Form/Contribute/DeferredRevenue.php index 4af1321e6c..4d283b2bc0 100644 --- a/CRM/Report/Form/Contribute/DeferredRevenue.php +++ b/CRM/Report/Form/Contribute/DeferredRevenue.php @@ -243,10 +243,18 @@ class CRM_Report_Form_Contribute_DeferredRevenue extends CRM_Report_Form { parent::__construct(); } + /** + * Pre process function. + * + * Called prior to build form. + */ public function preProcess() { parent::preProcess(); } + /** + * Build from clause. + */ public function from() { $deferredRelationship = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Deferred Revenue Account is' ")); $revenueRelationship = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Income Account is' ")); @@ -299,27 +307,23 @@ LEFT JOIN civicrm_event {$this->_aliases['civicrm_event']} ON {$this->_aliases[' } } + /** + * Post process function. + */ public function postProcess() { $this->_noFields = TRUE; - // get ready with post process params - $this->beginPostProcess(); - - // build query - $sql = $this->buildQuery(FALSE); - - // build array of result based on column headers. This method also allows - // modifying column headers before using it to build result set i.e $rows. - $rows = array(); - $this->buildRows($sql, $rows); - - // format result set. - $this->formatDisplay($rows); - - // assign variables to templates - $this->doTemplateAssignment($rows); + parent::postProcess(); + } - // do print / pdf / instance stuff if needed - $this->endPostProcess($rows); + /** + * Set limit. + * + * @param int $rowCount + * + * @return array + */ + public function limit($rowCount = self::ROW_COUNT_LIMIT) { + $this->_limit = NULL; } /** @@ -332,6 +336,9 @@ LEFT JOIN civicrm_event {$this->_aliases['civicrm_event']} ON {$this->_aliases[' $this->_where .= " AND {$this->_aliases['civicrm_financial_trxn_1']}.trxn_date BETWEEN '{$startDate}' AND '{$endDate}'"; } + /** + * Build group by clause. + */ public function groupBy() { $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_financial_account']}.id, {$this->_aliases['civicrm_financial_account_1']}.id, {$this->_aliases['civicrm_financial_item']}.id"; } @@ -395,25 +402,5 @@ LEFT JOIN civicrm_event {$this->_aliases['civicrm_event']} ON {$this->_aliases[' } $this->_columnHeaders = $columns; } - /** - * @param $rows - * - */ - public function statistics(&$rows) { - - } - - /** - * Alter display of rows. - * - * Iterate through the rows retrieved via SQL and make changes for display purposes, - * such as rendering contacts as links. - * - * @param array $rows - * Rows generated by SQL, with an array for each row. - */ - public function alterDisplay(&$rows) { - - } } -- 2.25.1