From 343f3bea2cd45b21f46eac30fc995e8b9ef6bef0 Mon Sep 17 00:00:00 2001 From: Andrew Hunt Date: Fri, 22 Mar 2019 13:09:56 -0400 Subject: [PATCH] Grant detail report standardize from(), add phone, email and custom --- CRM/Report/Form/Grant/Detail.php | 34 ++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/CRM/Report/Form/Grant/Detail.php b/CRM/Report/Form/Grant/Detail.php index 6061d1d2e0..0bf2bee8d5 100644 --- a/CRM/Report/Form/Grant/Detail.php +++ b/CRM/Report/Form/Grant/Detail.php @@ -33,6 +33,10 @@ class CRM_Report_Form_Grant_Detail extends CRM_Report_Form { protected $_customGroupExtends = array( + 'Contact', + 'Individual', + 'Household', + 'Organization', 'Grant', ); @@ -47,6 +51,24 @@ class CRM_Report_Form_Grant_Detail extends CRM_Report_Form { 'no_field_disambiguation' => TRUE, )); $specificCols = array( + 'civicrm_email' => array( + 'dao' => 'CRM_Core_DAO_Email', + 'fields' => array( + 'email' => array( + 'title' => ts('Email'), + ), + ), + 'grouping' => 'contact-fields', + ), + 'civicrm_phone' => array( + 'dao' => 'CRM_Core_DAO_Phone', + 'fields' => array( + 'phone' => array( + 'title' => ts('Phone'), + ), + ), + 'grouping' => 'contact-fields', + ), 'civicrm_grant' => array( 'dao' => 'CRM_Grant_DAO_Grant', 'fields' => array( @@ -213,10 +235,14 @@ class CRM_Report_Form_Grant_Detail extends CRM_Report_Form { } public function from() { - $this->_from = " - FROM civicrm_grant {$this->_aliases['civicrm_grant']} - LEFT JOIN civicrm_contact {$this->_aliases['civicrm_contact']} - ON ({$this->_aliases['civicrm_grant']}.contact_id = {$this->_aliases['civicrm_contact']}.id ) "; + $this->setFromBase('civicrm_contact'); + $this->_from .= <<_aliases['civicrm_grant']} + ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_grant']}.contact_id +HERESQL; + + $this->joinEmailFromContact(); + $this->joinPhoneFromContact(); $this->joinAddressFromContact(); } -- 2.25.1