X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FForm%2FSearch%2FCustom%2FContributionAggregate.php;h=cd1abd2a63cccb128cd226d2fd558e8f7998dd6f;hb=e98a98049142cec1b405f66dab5ced1be07336ec;hp=3c7f67a9a16eadec9f099f8515fa55f5d80529b9;hpb=c3880b0aee27b293b8fe4cd2bedbc2b19a1dbe49;p=civicrm-core.git diff --git a/CRM/Contact/Form/Search/Custom/ContributionAggregate.php b/CRM/Contact/Form/Search/Custom/ContributionAggregate.php index 3c7f67a9a1..cd1abd2a63 100644 --- a/CRM/Contact/Form/Search/Custom/ContributionAggregate.php +++ b/CRM/Contact/Form/Search/Custom/ContributionAggregate.php @@ -1,7 +1,7 @@ _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 @@ -58,9 +56,9 @@ class CRM_Contact_Form_Search_Custom_ContributionAggregate extends CRM_Contact_F } /** - * @param $form + * @param CRM_Core_Form $form */ - function buildForm(&$form) { + public function buildForm(&$form) { /** * You can define a custom title for the search form @@ -86,7 +84,7 @@ class CRM_Contact_Form_Search_Custom_ContributionAggregate extends CRM_Contact_F $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); } @@ -99,15 +97,26 @@ class CRM_Contact_Form_Search_Custom_ContributionAggregate extends CRM_Contact_F /** * 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 + * 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, + public function all( + $offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE ) { @@ -167,23 +176,21 @@ $having /** * @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"; @@ -228,7 +235,7 @@ civicrm_contact AS contact_a * * @return string */ - function having($includeContactIDs = FALSE) { + public function having($includeContactIDs = FALSE) { $clauses = array(); $min = CRM_Utils_Array::value('min_amount', $this->_formValues); if ($min) { @@ -246,9 +253,13 @@ civicrm_contact AS contact_a } /* - * 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, @@ -265,21 +276,21 @@ civicrm_contact AS contact_a * * @return string */ - function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = TRUE) { + public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL = TRUE) { 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); } @@ -291,8 +302,8 @@ civicrm_contact AS contact_a /** * @return null */ - function summary() { + public function summary() { return NULL; } -} +}