From 6f5155f02ceaba3c969d79eb103a71ac26f07a70 Mon Sep 17 00:00:00 2001 From: Brian Shaughnessy Date: Sat, 1 Apr 2017 13:34:19 -0400 Subject: [PATCH] CRM-20368 contact relationship report --- CRM/Report/Form/Contact/Relationship.php | 28 ++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/CRM/Report/Form/Contact/Relationship.php b/CRM/Report/Form/Contact/Relationship.php index 431b2b8fb1..c08a7a7e11 100644 --- a/CRM/Report/Form/Contact/Relationship.php +++ b/CRM/Report/Form/Contact/Relationship.php @@ -112,6 +112,13 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { 'type' => CRM_Utils_Type::T_STRING, ), ), + 'order_bys' => array( + 'sort_name_a' => array( + 'title' => ts('Contact A'), + 'name' => 'sort_name', + 'default_weight' => '1', + ), + ), 'grouping' => 'contact_a_fields', ), 'civicrm_contact_b' => array( @@ -155,6 +162,13 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { 'type' => CRM_Utils_Type::T_STRING, ), ), + 'order_bys' => array( + 'sort_name_b' => array( + 'title' => ts('Contact B'), + 'name' => 'sort_name', + 'default_weight' => '2', + ), + ), 'grouping' => 'contact_b_fields', ), 'civicrm_email' => array( @@ -220,6 +234,16 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { 'default' => TRUE, ), ), + 'order_bys' => array( + 'label_a_b' => array( + 'title' => ts('Relationship A-B'), + 'name' => 'label_a_b', + ), + 'label_b_A' => array( + 'title' => ts('Relationship B-A'), + 'name' => 'label_b_a', + ), + ), 'grouping' => 'relation-fields', ), 'civicrm_relationship' => array( @@ -581,10 +605,6 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { $this->_groupBy = CRM_Contact_BAO_Query::getGroupByFromSelectColumns($this->_selectClauses, $groupBy); } - public function orderBy() { - $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_contact_b']}.sort_name "; - } - public function postProcess() { $this->beginPostProcess(); -- 2.25.1