From 8f7c2652a0d2079d8735f38f5f87ba9245fbfe02 Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Thu, 25 Feb 2016 21:58:34 +0530 Subject: [PATCH] CRM-18064 fix --- CRM/Contribute/BAO/Query.php | 7 ++++++- CRM/Contribute/Selector/Search.php | 2 +- templates/CRM/Contribute/Form/Selector.tpl | 9 +++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index e86b91fabd..1b6d4cac2b 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -864,7 +864,7 @@ class CRM_Contribute_BAO_Query { * kills a small kitten so add carefully. */ public static function selectorReturnProperties() { - return array( + $properties = array( 'contact_type' => 1, 'contact_sub_type' => 1, 'sort_name' => 1, @@ -887,6 +887,11 @@ class CRM_Contribute_BAO_Query { 'contribution_product_id' => 1, 'product_name' => 1, ); + if (self::isSoftCreditOptionEnabled()) { + $properties = array_merge($properties, self::softCreditReturnProperties()); + } + + return $properties; } /** diff --git a/CRM/Contribute/Selector/Search.php b/CRM/Contribute/Selector/Search.php index fd1327706d..ef60698c88 100644 --- a/CRM/Contribute/Selector/Search.php +++ b/CRM/Contribute/Selector/Search.php @@ -311,7 +311,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C 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"; + $sort = $sort->orderBy() . ", civicrm_contribution.id, civicrm_contribution_soft.id"; } $result = $this->_query->searchQuery($offset, $rowCount, $sort, FALSE, FALSE, diff --git a/templates/CRM/Contribute/Form/Selector.tpl b/templates/CRM/Contribute/Form/Selector.tpl index ceb19bb823..8b0322074d 100644 --- a/templates/CRM/Contribute/Form/Selector.tpl +++ b/templates/CRM/Contribute/Form/Selector.tpl @@ -59,9 +59,11 @@ {$row.contact_type}   {$row.sort_name} {/if} - -   {if !$row.contribution_soft_credit_amount}{$row.total_amount|crmMoney:$row.currency}{/if} - + {if !$row.contribution_soft_credit_amount} + +   {$row.total_amount|crmMoney:$row.currency} + + {/if} {if $row.amount_level }
({$row.amount_level}){/if} {if $row.contribution_recur_id}
{ts}(Recurring Contribution){/ts}{/if} @@ -104,4 +106,3 @@ {include file="CRM/common/pager.tpl" location="bottom"} {crmScript file='js/crm.expandRow.js'} - -- 2.25.1