*/
/**
- *
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2017
*/
/**
- * This class is used to retrieve and display a range of
- * contacts that match the given criteria (specifically for
- * results of advanced search options.
- *
+ * Class to render contribution search results.
*/
class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements CRM_Core_Selector_API {
/**
- * This defines two actions- View and Edit.
+ * Array of action links.
*
* @var array
*/
$allCampaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE);
while ($result->fetch()) {
+ $this->_query->convertToPseudoNames($result);
$links = self::links($componentId,
$componentAction,
$qfKey,
if ($row['contribution_status_name'] == 'Pending refund') {
$buttonName = ts('Record Refund');
}
+ elseif (CRM_Core_Config::isEnabledBackOfficeCreditCardPayments()) {
+ $links[CRM_Core_Action::BASIC] = array(
+ 'name' => ts('Submit Credit Card payment'),
+ 'url' => 'civicrm/payment/add',
+ 'qs' => 'reset=1&id=%%id%%&cid=%%cid%%&action=add&component=contribution&mode=live',
+ 'title' => ts('Submit Credit Card payment'),
+ );
+ }
$links[CRM_Core_Action::ADD] = array(
'name' => $buttonName,
'url' => 'civicrm/payment',
'name' => $this->_includeSoftCredits ? ts('Contribution Amount') : ts('Amount'),
'sort' => 'total_amount',
'direction' => CRM_Utils_Sort::DONTCARE,
+ 'field_name' => 'total_amount',
),
);
if ($this->_includeSoftCredits) {
array(
'name' => ts('Soft Credit Amount'),
'sort' => 'contribution_soft_credit_amount',
+ 'field_name' => 'contribution_soft_credit_amount',
'direction' => CRM_Utils_Sort::DONTCARE,
),
)
array(
'name' => ts('Type'),
'sort' => 'financial_type',
+ 'field_name' => 'financial_type',
'direction' => CRM_Utils_Sort::DONTCARE,
),
array(
'name' => ts('Source'),
'sort' => 'contribution_source',
+ 'field_name' => 'contribution_source',
'direction' => CRM_Utils_Sort::DONTCARE,
),
array(
'name' => ts('Received'),
'sort' => 'receive_date',
+ 'field_name' => 'receive_date',
+ 'type' => 'date',
'direction' => CRM_Utils_Sort::DESCENDING,
),
array(
'name' => ts('Thank-you Sent'),
'sort' => 'thankyou_date',
+ 'field_name' => 'thankyou_date',
+ 'type' => 'date',
'direction' => CRM_Utils_Sort::DONTCARE,
),
array(
'name' => ts('Status'),
'sort' => 'contribution_status',
+ 'field_name' => 'contribution_status',
'direction' => CRM_Utils_Sort::DONTCARE,
),
array(
'name' => ts('Premium'),
'sort' => 'product_name',
+ 'field_name' => 'product_name',
'direction' => CRM_Utils_Sort::DONTCARE,
),
)
self::$_columnHeaders
= array_merge(
self::$_columnHeaders, array(
- array('desc' => ts('Actions')),
+ array('desc' => ts('Actions'), 'type' => 'actions'),
)
);
+ foreach (array_keys(self::$_columnHeaders) as $index) {
+ // Add weight & space it out a bit to allow headers to be inserted.
+ self::$_columnHeaders[$index]['weight'] = $index * 10;
+ }
+
CRM_Core_Smarty::singleton()->assign('softCreditColumns', $this->_includeSoftCredits);
return self::$_columnHeaders;
}