From: Chris Doten Date: Sat, 4 May 2013 22:42:55 +0000 (+0000) Subject: Fixed order_by functions for names X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5752b04fe8b932c64d28d468c1d1f64b6f8ea5d6;p=civicrm-core.git Fixed order_by functions for names --- diff --git a/CRM/Report/Form/Member/Detail.php b/CRM/Report/Form/Member/Detail.php index af0d1b1aab..f2aef32b64 100644 --- a/CRM/Report/Form/Member/Detail.php +++ b/CRM/Report/Form/Member/Detail.php @@ -105,6 +105,15 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { 'id' => array('no_display' => TRUE), ), + 'order_bys' => + array( + 'sort_name' => array( + 'title' => ts('Last Name, First Name'), + 'default' => '1', + 'default_weight' => '0', + 'default_order' => 'ASC' + ), + ), 'grouping' => 'contact-fields', ), 'civicrm_membership' => @@ -278,6 +287,7 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { 'options' => $this->activeCampaigns, ); $this->_columns['civicrm_membership']['order_bys']['campaign_id'] = array('title' => ts('Campaign')); + } $this->_currencyColumn = 'civicrm_contribution_currency'; @@ -423,9 +433,10 @@ 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"; } - function orderBy() { - $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_membership']}.membership_type_id"; - } +// This function overrides the default Form.php orderBy and breaks dynamic order +// function orderBy() { +// $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_membership']}.membership_type_id"; +// } function postProcess() { @@ -433,7 +444,10 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { // get the acl clauses built before we assemble the query $this->buildACLClause($this->_aliases['civicrm_contact']); + print_r("!!!! I'm about to build my query\n"); $sql = $this->buildQuery(TRUE); + + print_r("My SQL is currently " . $sql); $rows = array(); $this->buildRows($sql, $rows);