<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
/**
* @param $formValues
*/
- function __construct(&$formValues) {
+ public function __construct(&$formValues) {
$this->_formValues = $formValues;
- /**
- * Define the columns for search result rows
- */
+ // Define the columns for search result rows
$this->_columns = array(
ts('Contact ID') => 'contact_id',
ts('Name') => 'sort_name',
- ts('Donation Count') => 'donation_count',
- ts('Donation Amount') => 'donation_amount',
+ ts('Contribution Count') => 'donation_count',
+ ts('Contribution Amount') => 'donation_amount',
);
// define component access permission needed
}
/**
- * @param $form
+ * @param CRM_Core_Form $form
*/
- function buildForm(&$form) {
+ public function buildForm(&$form) {
/**
* You can define a custom title for the search form
$form->addDate('end_date', ts('...through'), FALSE, array('formatType' => 'custom'));
$financial_types = CRM_Contribute_PseudoConstant::financialType();
- foreach($financial_types as $financial_type_id => $financial_type) {
+ foreach ($financial_types as $financial_type_id => $financial_type) {
$form->addElement('checkbox', "financial_type_id[{$financial_type_id}]", 'Financial Type', $financial_type);
}
/**
* Define the smarty template used to layout the search form and results listings.
+ *
+ * @return string
*/
- function templateFile() {
+ public function templateFile() {
return 'CRM/Contact/Form/Search/Custom/ContributionAggregate.tpl';
}
/**
* Construct the search query
+ *
+ * @param int $offset
+ * @param int $rowcount
+ * @param string|object $sort
+ * @param bool $includeContactIDs
+ * @param bool $justIDs
+ *
+ * @return string
*/
- function all($offset = 0, $rowcount = 0, $sort = NULL,
+ function all(
+ $offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
/**
* @return string
*/
- function from() {
+ public function from() {
return "
civicrm_contribution AS contrib,
civicrm_contact AS contact_a
";
}
- /*
- * WHERE clause is an array built from any required JOINS plus conditional filters based on search criteria field values
- *
- */
/**
+ * WHERE clause is an array built from any required JOINS plus conditional filters based on search criteria field values
+ *
* @param bool $includeContactIDs
*
* @return string
*/
- function where($includeContactIDs = FALSE) {
+ public function where($includeContactIDs = FALSE) {
$clauses = array();
$clauses[] = "contrib.contact_id = contact_a.id";
*
* @return string
*/
- function having($includeContactIDs = FALSE) {
+ public function having($includeContactIDs = FALSE) {
$clauses = array();
$min = CRM_Utils_Array::value('min_amount', $this->_formValues);
if ($min) {
}
/*
- * Functions below generally don't need to be modified
- */
- function count() {
+ * Functions below generally don't need to be modified
+ */
+
+ /**
+ * @inheritDoc
+ */
+ public function count() {
$sql = $this->all();
$dao = CRM_Core_DAO::executeQuery($sql,
*
* @return string
*/
- function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) {
+ public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL) {
return $this->all($offset, $rowcount, $sort, FALSE, TRUE);
}
/**
* @return array
*/
- function &columns() {
+ public function &columns() {
return $this->_columns;
}
/**
* @param $title
*/
- function setTitle($title) {
+ public function setTitle($title) {
if ($title) {
CRM_Utils_System::setTitle($title);
}
/**
* @return null
*/
- function summary() {
+ public function summary() {
return NULL;
}
}
-