From: Jon goldberg Date: Thu, 5 Feb 2015 21:56:03 +0000 (-0500) Subject: CRM-15917 - CiviReport - remove override of standard orderBy function; add orderBy... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8d44b0234a11329d06838128e919191f6dd1169d;p=civicrm-core.git CRM-15917 - CiviReport - remove override of standard orderBy function; add orderBy arrays to support ordering by Receive Date and Membership Type --- diff --git a/CRM/Report/Form/Member/Detail.php b/CRM/Report/Form/Member/Detail.php index 1a6d9e184e..3b85973ab6 100644 --- a/CRM/Report/Form/Member/Detail.php +++ b/CRM/Report/Form/Member/Detail.php @@ -148,6 +148,14 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { 'options' => CRM_Member_PseudoConstant::membershipType(), ), ), + 'order_bys' => array( + 'membership_type_id' => array( + 'title' => ts('Membership Type'), + 'default' => '0', + 'default_weight' => '1', + 'default_order' => 'ASC', + ), + ), 'grouping' => 'member-fields', ), 'civicrm_membership_status' => array( @@ -249,6 +257,13 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { ), 'total_amount' => array('title' => ts('Contribution Amount')), ), + 'order_bys' => array( + 'receive_date' => array( + 'title' => ts('Receive Date'), + 'default_weight' => '2', + 'default_order' => 'DESC', + ), + ), 'grouping' => 'contri-fields', ), ); @@ -359,14 +374,6 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_membership']}.membership_type_id"; } - public function orderBy() { - $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_membership']}.membership_type_id"; - - if ($this->_contribField) { - $this->_orderBy .= ", {$this->_aliases['civicrm_contribution']}.receive_date DESC"; - } - } - public function postProcess() { $this->beginPostProcess();