From: Brian Shaughnessy Date: Thu, 10 Sep 2020 19:10:09 +0000 (-0400) Subject: dev/core#2009 filter grant dashboard to exclude trashed contacts X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7d9f60daadc66ca356862fbeeab6d72d61637422;p=civicrm-core.git dev/core#2009 filter grant dashboard to exclude trashed contacts --- diff --git a/CRM/Grant/BAO/Grant.php b/CRM/Grant/BAO/Grant.php index d38aeb5c41..e203d546f5 100644 --- a/CRM/Grant/BAO/Grant.php +++ b/CRM/Grant/BAO/Grant.php @@ -25,8 +25,13 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { */ public static function getGrantSummary($admin = FALSE) { $query = " - SELECT status_id, count(id) as status_total - FROM civicrm_grant GROUP BY status_id"; + SELECT status_id, count(g.id) as status_total + FROM civicrm_grant g + JOIN civicrm_contact c + ON g.contact_id = c.id + WHERE c.is_deleted = 0 + GROUP BY status_id + "; $dao = CRM_Core_DAO::executeQuery($query);