From aceb083a3801df9088a2eb0cd6b7e32e1503c771 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 3 Aug 2016 10:38:37 +1200 Subject: [PATCH] CRM-19167 add is_deceased filter to contact summary report --- CRM/Report/Form.php | 46 +++++++++++++++++++++++++++++ CRM/Report/Form/Contact/Summary.php | 34 +-------------------- 2 files changed, 47 insertions(+), 33 deletions(-) diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 9851120fdb..04be6ad607 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -4414,6 +4414,52 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a ); } + /** + * Get a standard set of contact filters. + * + * @return array + */ + public function getBasicContactFilters() { + return array( + 'sort_name' => array( + 'title' => ts('Contact Name'), + ), + 'source' => array( + 'title' => ts('Contact Source'), + 'type' => CRM_Utils_Type::T_STRING, + ), + 'id' => array( + 'title' => ts('Contact ID'), + 'no_display' => TRUE, + ), + 'gender_id' => array( + 'title' => ts('Gender'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'), + ), + 'birth_date' => array( + 'title' => ts('Birth Date'), + 'operatorType' => CRM_Report_Form::OP_DATE, + ), + 'contact_type' => array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => array( + 'title' => ts('Contact Subtype'), + ), + 'modified_date' => array( + 'title' => ts('Contact Modified'), + 'operatorType' => CRM_Report_Form::OP_DATE, + 'type' => CRM_Utils_Type::T_DATE, + ), + 'is_deceased' => array( + 'title' => ts('Deceased'), + 'type' => CRM_Utils_Type::T_BOOLEAN, + 'default' => 0, + ), + ); + } + /** * Add contact to group. * diff --git a/CRM/Report/Form/Contact/Summary.php b/CRM/Report/Form/Contact/Summary.php index ab82a89d68..40b44d581b 100644 --- a/CRM/Report/Form/Contact/Summary.php +++ b/CRM/Report/Form/Contact/Summary.php @@ -65,39 +65,7 @@ class CRM_Report_Form_Contact_Summary extends CRM_Report_Form { ), ) ), - 'filters' => array( - 'sort_name' => array( - 'title' => ts('Contact Name'), - ), - 'source' => array( - 'title' => ts('Contact Source'), - 'type' => CRM_Utils_Type::T_STRING, - ), - 'id' => array( - 'title' => ts('Contact ID'), - 'no_display' => TRUE, - ), - 'gender_id' => array( - 'title' => ts('Gender'), - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'), - ), - 'birth_date' => array( - 'title' => ts('Birth Date'), - 'operatorType' => CRM_Report_Form::OP_DATE, - ), - 'contact_type' => array( - 'title' => ts('Contact Type'), - ), - 'contact_sub_type' => array( - 'title' => ts('Contact Subtype'), - ), - 'modified_date' => array( - 'title' => ts('Modified Date'), - 'operatorType' => CRM_Report_Form::OP_DATE, - 'type' => CRM_Utils_Type::T_DATE, - ), - ), + 'filters' => $this->getBasicContactFilters(), 'grouping' => 'contact-fields', 'order_bys' => array( 'sort_name' => array( -- 2.25.1