| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* This defines two actions- View and Edit.
*
* @var array
- * @static
*/
static $_links = NULL;
* We use desc to remind us what that column is, name is used in the tpl
*
* @var array
- * @static
*/
static $_columnHeaders;
/**
* Properties of contact we're interested in displaying
* @var array
- * @static
*/
static $_properties = array(
'contact_id',
/**
* Class constructor
*
- * @param array $queryParams array of parameters for query
+ * @param array $queryParams
+ * Array of parameters for query.
* @param \const|int $action - action of search basic or advanced.
- * @param string $contributionClause if the caller wants to further restrict the search (used in contributions)
- * @param boolean $single are we dealing only with one contact?
- * @param int $limit how many contributions do we want returned
+ * @param string $contributionClause
+ * If the caller wants to further restrict the search (used in contributions).
+ * @param bool $single
+ * Are we dealing only with one contact?.
+ * @param int $limit
+ * How many contributions do we want returned.
*
* @param string $context
* @param null $compContext
*
* @return \CRM_Contribute_Selector_Search
- @access public
*/
- function __construct(&$queryParams,
- $action = CRM_Core_Action::NONE,
+ public function __construct(
+ &$queryParams,
+ $action = CRM_Core_Action::NONE,
$contributionClause = NULL,
- $single = FALSE,
- $limit = NULL,
- $context = 'search',
- $compContext = NULL
+ $single = FALSE,
+ $limit = NULL,
+ $context = 'search',
+ $compContext = NULL
) {
// submitted form values
$this->_queryParams = &$queryParams;
- $this->_single = $single;
- $this->_limit = $limit;
- $this->_context = $context;
+ $this->_single = $single;
+ $this->_limit = $limit;
+ $this->_context = $context;
$this->_compContext = $compContext;
$this->_contributionClause = $contributionClause;
if ($this->_includeSoftCredits) {
$this->_query->_rowCountClause = " count(civicrm_contribution.id)";
$this->_query->_groupByComponentClause = " GROUP BY contribution_search_scredit_combined.id, contribution_search_scredit_combined.contact_id, contribution_search_scredit_combined.scredit_id ";
- } else {
+ }
+ else {
$this->_query->_distinctComponentClause = " civicrm_contribution.id";
$this->_query->_groupByComponentClause = " GROUP BY civicrm_contribution.id ";
}
/**
* Returns total number of rows for the query.
*
- * @param
+ * @param string $action
*
- * @return int Total number of rows
+ * @return int
+ * Total number of rows
*/
public function getTotalCount($action) {
return $this->_query->searchQuery(0, 0, NULL,
/**
* 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 string $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 string $output
+ * What should the result set include (web/email/csv).
*
- * @return int the total number of rows for this action
+ * @return int
+ * the total number of rows for this action
*/
public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) {
if ($this->_includeSoftCredits) {
$qfKey = $this->_key;
$componentId = $componentContext = NULL;
if ($this->_context != 'contribute') {
- $qfKey = CRM_Utils_Request::retrieve('key', 'String', CRM_Core_DAO::$_nullObject);
- $componentId = CRM_Utils_Request::retrieve('id', 'Positive', CRM_Core_DAO::$_nullObject);
- $componentAction = CRM_Utils_Request::retrieve('action', 'String', CRM_Core_DAO::$_nullObject);
+ $qfKey = CRM_Utils_Request::retrieve('key', 'String', CRM_Core_DAO::$_nullObject);
+ $componentId = CRM_Utils_Request::retrieve('id', 'Positive', CRM_Core_DAO::$_nullObject);
+ $componentAction = CRM_Utils_Request::retrieve('action', 'String', CRM_Core_DAO::$_nullObject);
$componentContext = CRM_Utils_Request::retrieve('compContext', 'String', CRM_Core_DAO::$_nullObject);
if (!$componentContext &&
//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) {
$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'])) {
}
/**
- * @return array $qill which contains an array of strings
+ * @inheritDoc
*/
-
- // the current internationalisation is bad, but should more or less work
- // for most of "European" languages
public function getQILL() {
return $this->_query->qill();
}
* 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 string $output
+ * What should the result set include (web/email/csv).
*
- * @return array the column headers that need to be displayed
+ * @return array
+ * the column headers that need to be displayed
*/
public function &getColumnHeaders($action = NULL, $output = NULL) {
self::$_columnHeaders = array(
),
);
if ($this->_includeSoftCredits) {
- self::$_columnHeaders =
- array_merge(
+ self::$_columnHeaders
+ = array_merge(
self::$_columnHeaders,
array(
array(
'name' => ts('Soft Credit Amount'),
'sort' => 'contribution_soft_credit_amount',
'direction' => CRM_Utils_Sort::DONTCARE,
- )
+ ),
)
);
}
- self::$_columnHeaders =
- array_merge(
+ self::$_columnHeaders
+ = array_merge(
self::$_columnHeaders,
array(
array(
'name' => ts('Type'),
- 'sort' => 'financial_type',
+ 'sort' => 'financial_type',
'direction' => CRM_Utils_Sort::DONTCARE,
),
array(
self::$_columnHeaders = array_merge($pre, self::$_columnHeaders);
}
if ($this->_includeSoftCredits) {
- self::$_columnHeaders =
- array_merge(
- self::$_columnHeaders,
+ self::$_columnHeaders = array_merge(
+ self::$_columnHeaders,
+ array(
array(
- array(
- 'name' => ts('Soft Credit For'),
- 'sort' => 'contribution_soft_credit_name',
- 'direction' => CRM_Utils_Sort::DONTCARE,
- ),
- array(
- 'name' => ts('Soft Credit Type'),
- 'sort' => 'contribution_soft_credit_type',
- 'direction' => CRM_Utils_Sort::ASCENDING,
- ),
- )
- );
+ 'name' => ts('Soft Credit For'),
+ 'sort' => 'contribution_soft_credit_name',
+ 'direction' => CRM_Utils_Sort::DONTCARE,
+ ),
+ array(
+ 'name' => ts('Soft Credit Type'),
+ 'sort' => 'contribution_soft_credit_type',
+ 'direction' => CRM_Utils_Sort::ASCENDING,
+ ),
+ )
+ );
}
- self::$_columnHeaders =
- array_merge(
+ self::$_columnHeaders
+ = array_merge(
self::$_columnHeaders, array(
- array('desc' => ts('Actions'))
+ array('desc' => ts('Actions')),
)
);
return self::$_columnHeaders;
/**
* Name of export file.
*
- * @param string $output type of output
+ * @param string $output
+ * Type of output.
*
- * @return string name of the file
+ * @return string
+ * name of the file
*/
public function getExportFileName($output = 'csv') {
return ts('CiviCRM Contribution Search');
public function getSummary() {
return $this->_query->summaryContribution($this->_context);
}
+
}