X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FSelector%2FSearch.php;h=7ed80e6d57b73c8028e28b1052693bd0fa7e3e94;hb=874c9be71a0eaece92406de8089dc7de42298084;hp=7166d025e448b9dcde094008517e0dce02065db1;hpb=d92623decb352eab5b403d0c9cab181a831bfaac;p=civicrm-core.git diff --git a/CRM/Contribute/Selector/Search.php b/CRM/Contribute/Selector/Search.php index 7166d025e4..7ed80e6d57 100644 --- a/CRM/Contribute/Selector/Search.php +++ b/CRM/Contribute/Selector/Search.php @@ -1,7 +1,7 @@ _query->_groupByComponentClause = " GROUP BY civicrm_contribution.id "; } } - //end of constructor /** * This method returns the links that are given for each search row. @@ -218,15 +215,14 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C * - View * - Edit * - * @param null $componentId + * @param int $componentId * @param null $componentAction * @param null $key * @param null $compContext * * @return array - * @access public */ - static function &links($componentId = NULL, $componentAction = NULL, $key = NULL, $compContext = NULL) { + public static function &links($componentId = NULL, $componentAction = NULL, $key = NULL, $compContext = NULL) { $extraParams = NULL; if ($componentId) { $extraParams = "&compId={$componentId}&compAction={$componentAction}"; @@ -262,17 +258,14 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C } return self::$_links; } - //end of function /** - * getter for array of the parameters required for creating pager. + * Getter for array of the parameters required for creating pager. * * @param $action - * @param $params - * @internal param $ - * @access public + * @param array $params */ - function getPagerParams($action, &$params) { + public function getPagerParams($action, &$params) { $params['status'] = ts('Contribution') . ' %%StatusMessage%%'; $params['csvString'] = NULL; if ($this->_limit) { @@ -285,7 +278,6 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C $params['buttonTop'] = 'PagerTopButton'; $params['buttonBottom'] = 'PagerBottomButton'; } - //end of function /** * Returns total number of rows for the query. @@ -293,9 +285,8 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C * @param * * @return int Total number of rows - * @access public */ - function getTotalCount($action) { + public function getTotalCount($action) { return $this->_query->searchQuery(0, 0, NULL, TRUE, FALSE, FALSE, FALSE, @@ -305,17 +296,22 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C } /** - * returns all the rows in the given offset and rowCount + * Returns all the rows in the given offset and rowCount * - * @param enum $action the action being performed - * @param int $offset the row number to start from - * @param int $rowCount the number of rows to return - * @param string $sort the sql string that describes the sort order - * @param enum $output what should the result set include (web/email/csv) + * @param enum $action + * The action being performed. + * @param int $offset + * The row number to start from. + * @param int $rowCount + * The number of rows to return. + * @param string $sort + * The sql string that describes the sort order. + * @param enum $output + * What should the result set include (web/email/csv). * * @return int the total number of rows for this action */ - function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { + public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { if ($this->_includeSoftCredits) { // especial sort order when rows include soft credits $sort = "civicrm_contribution.receive_date DESC, civicrm_contribution.id, civicrm_contribution_soft.id"; @@ -363,7 +359,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C //get all campaigns. $allCampaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE); - While ($result->fetch()) { + while ($result->fetch()) { $row = array(); // the columns we are interested in foreach (self::$_properties as $property) { @@ -414,8 +410,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C $result->contribution_id ); - $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? - $result->contact_sub_type : $result->contact_type, FALSE, $result->contact_id + $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type, FALSE, $result->contact_id ); if (!empty($row['amount_level'])) { @@ -429,9 +424,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C } /** - * * @return array $qill which contains an array of strings - * @access public */ // the current internationalisation is bad, but should more or less work @@ -441,14 +434,15 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C } /** - * returns the column headers as an array of tuples: + * Returns the column headers as an array of tuples: * (name, sortName (key to the sort array)) * - * @param string $action the action being performed - * @param enum $output what should the result set include (web/email/csv) + * @param string $action + * The action being performed. + * @param enum $output + * What should the result set include (web/email/csv). * * @return array the column headers that need to be displayed - * @access public */ public function &getColumnHeaders($action = NULL, $output = NULL) { self::$_columnHeaders = array( @@ -477,7 +471,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C array( array( 'name' => ts('Type'), - 'sort' => 'financial_type_id', + 'sort' => 'financial_type', 'direction' => CRM_Utils_Sort::DONTCARE, ), array( @@ -497,7 +491,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C ), array( 'name' => ts('Status'), - 'sort' => 'contribution_status_id', + 'sort' => 'contribution_status', 'direction' => CRM_Utils_Sort::DONTCARE, ), array( @@ -548,33 +542,33 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C /** * @return mixed */ - function alphabetQuery() { + public function alphabetQuery() { return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE); } /** * @return string */ - function &getQuery() { + public function &getQuery() { return $this->_query; } /** - * name of export file. + * Name of export file. * - * @param string $output type of output + * @param string $output + * Type of output. * * @return string name of the file */ - function getExportFileName($output = 'csv') { + public function getExportFileName($output = 'csv') { return ts('CiviCRM Contribution Search'); } /** * @return mixed */ - function getSummary() { + public function getSummary() { return $this->_query->summaryContribution($this->_context); } } -