*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
protected $_addressField = FALSE;
public $_drilldownReport = array('contribute/detail' => 'Link to Detail Report');
/**
+ * Class constructor.
*/
public function __construct() {
parent::__construct();
}
- public function preProcess() {
- parent::preProcess();
- }
-
/**
- * @param bool $freeze
- *
- * @return array
+ * Set select clause.
*/
- public function setDefaultValues($freeze = TRUE) {
- return parent::setDefaultValues($freeze);
- }
-
public function select() {
$select = array();
$this->_columnHeaders = array();
}
/**
- * @param $fields
- * @param $files
- * @param $self
+ * Set form rules.
+ *
+ * @param array $fields
+ * @param array $files
+ * @param CRM_Report_Form_Contribute_Summary $self
*
* @return array
*/
public static function formRule($fields, $files, $self) {
- $errors = $grouping = array();
- //check for searching combination of dispaly columns and
- //grouping criteria
+ // Check for searching combination of display columns and
+ // grouping criteria
$ignoreFields = array('total_amount', 'sort_name');
$errors = $self->customDataFormRule($fields, $ignoreFields);
return $errors;
}
+ /**
+ * Set from clause.
+ *
+ * @param string $entity
+ */
public function from($entity = NULL) {
$softCreditJoinType = "LEFT";
if (!empty($this->_params['fields']['soft_amount']) &&
}
}
+ /**
+ * Set group by clause.
+ */
public function groupBy() {
$this->_groupBy = "";
$append = FALSE;
}
}
+ /**
+ * Store having clauses as an array.
+ */
public function storeWhereHavingClauseArray() {
parent::storeWhereHavingClauseArray();
if (empty($this->_params['fields']['soft_amount']) &&
}
/**
- * @param $rows
+ * Set statistics.
+ *
+ * @param array $rows
*
* @return array
*/
$statistics = parent::statistics($rows);
$softCredit = CRM_Utils_Array::value('soft_amount', $this->_params['fields']);
- $onlySoftCredit = $softCredit &&
- !CRM_Utils_Array::value('total_amount', $this->_params['fields']);
- $totalAmount = $average = $softTotalAmount = $softAverage = array();
+ $onlySoftCredit = $softCredit && !CRM_Utils_Array::value('total_amount', $this->_params['fields']);
$group = "\nGROUP BY {$this->_aliases['civicrm_contribution']}.currency";
$this->from('contribution');
return $statistics;
}
+ /**
+ * Post process function.
+ */
public function postProcess() {
$this->buildACLClause($this->_aliases['civicrm_contact']);
parent::postProcess();
}
+ /**
+ * Build table rows for output.
+ *
+ * @param string $sql
+ * @param array $rows
+ */
public function buildRows($sql, &$rows) {
$dao = CRM_Core_DAO::executeQuery($sql);
if (!is_array($rows)) {
// use this method to modify $this->_columnHeaders
$this->modifyColumnHeaders();
-
+ $contriRows = array();
$unselectedSectionColumns = $this->unselectedSectionColumns();
//CRM-16338 if both soft-credit and contribution are enabled then process the contribution's
}
/**
- * @param $rows
+ * Build chart.
+ *
+ * @param array $rows
*/
public function buildChart(&$rows) {
$graphRows = array();