From da7ac680933ffa547043b859d0ec094e32861c3a Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 13 Oct 2017 19:00:07 -0500 Subject: [PATCH] CRM-20545 - Exclude deleted contacts from reports --- CRM/Report/Form.php | 7 ++++++- CRM/Report/Form/Event/ParticipantListing.php | 22 +------------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 9149554ba9..c96d63ba0f 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -3051,7 +3051,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND $value = CRM_Utils_Array::value($op, $pair) . " " . $val; } } - if ($value) { + if ($value && empty($field['no_display'])) { $statistics['filters'][] = array( 'title' => CRM_Utils_Array::value('title', $field), 'value' => $value, @@ -4551,6 +4551,11 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a 'preferred_language' => array( 'title' => ts('Preferred Language'), ), + 'is_deleted' => array( + 'no_display' => TRUE, + 'default' => 0, + 'type' => CRM_Utils_Type::T_BOOLEAN, + ), ); } diff --git a/CRM/Report/Form/Event/ParticipantListing.php b/CRM/Report/Form/Event/ParticipantListing.php index 4a650cc4de..a9ded26d42 100644 --- a/CRM/Report/Form/Event/ParticipantListing.php +++ b/CRM/Report/Form/Event/ParticipantListing.php @@ -115,27 +115,7 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event { 'title' => ts('Contact Subtype'), ), ), - 'filters' => array( - 'sort_name' => array( - 'title' => ts('Participant Name'), - 'operator' => 'like', - ), - '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'), - ), - ), + 'filters' => CRM_Report_Form::getBasicContactFilters(), ), 'civicrm_email' => array( 'dao' => 'CRM_Core_DAO_Email', -- 2.25.1