dev/core#682 Add basic contact filters to Summary Contributions Report
authorFrancesc Bassas i Bullich <francesc@babu.cat>
Fri, 25 Jan 2019 09:39:25 +0000 (10:39 +0100)
committerFrancesc Bassas i Bullich <francesc@babu.cat>
Fri, 25 Jan 2019 09:43:12 +0000 (10:43 +0100)
CRM/Report/Form.php
CRM/Report/Form/Contribute/Summary.php

index a5c1741f891b8d223404c1244b09515dc413677a..a69e37d51e9e60a2ce780d6c0e7133a1e4286276 100644 (file)
@@ -4834,9 +4834,11 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a
   /**
    * Get a standard set of contact filters.
    *
+   * @param array $defaults
+   *
    * @return array
    */
-  public function getBasicContactFilters() {
+  public function getBasicContactFilters($defaults = array()) {
     return array(
       'sort_name' => array(
         'title' => ts('Contact Name'),
@@ -4872,7 +4874,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a
       'is_deceased' => array(
         'title' => ts('Deceased'),
         'type' => CRM_Utils_Type::T_BOOLEAN,
-        'default' => 0,
+        'default' => CRM_Utils_Array::value('deceased', $defaults, 0),
       ),
       'do_not_email' => array(
         'title' => ts('Do not email'),
index 1ea03719f7d530288985ba17146cba695ec1e1bb..b5f682a98773b08d5502c5e8cd6258f1d38f028a 100644 (file)
@@ -81,6 +81,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form {
             ),
           )
         ),
+        'filters' => $this->getBasicContactFilters(array('deceased' => NULL)),
         'grouping' => 'contact-fields',
         'group_bys' => array(
           'id' => array('title' => ts('Contact ID')),