From 30f85891f58b9dc2bf8309a341bf56f1b2dc4643 Mon Sep 17 00:00:00 2001 From: Ravish Nair Date: Fri, 23 Aug 2013 18:04:25 +0530 Subject: [PATCH] -- CRM-13250 Added Contact Type and Contact SubType columns in report ---------------------------------------- * CRM-13250: Add Contact Type and Subtype as a Column to Reports http://issues.civicrm.org/jira/browse/CRM-13250 --- CRM/Report/Form/Contact/CurrentEmployer.php | 8 ++++++++ CRM/Report/Form/Contact/Detail.php | 14 +++++++++++-- CRM/Report/Form/Contact/Relationship.php | 20 +++++++++++++++++++ CRM/Report/Form/Contact/Summary.php | 14 +++++++++++-- CRM/Report/Form/Contribute/Bookkeeping.php | 8 ++++++++ CRM/Report/Form/Contribute/Detail.php | 8 ++++++++ CRM/Report/Form/Contribute/History.php | 8 ++++++++ .../Form/Contribute/HouseholdSummary.php | 8 ++++++++ CRM/Report/Form/Contribute/Lybunt.php | 14 +++++++++++-- .../Form/Contribute/OrganizationSummary.php | 8 ++++++++ CRM/Report/Form/Contribute/PCP.php | 8 ++++++++ CRM/Report/Form/Contribute/Repeat.php | 12 +++++++++++ CRM/Report/Form/Contribute/SoftCredit.php | 8 ++++++++ CRM/Report/Form/Contribute/Summary.php | 8 ++++++++ CRM/Report/Form/Contribute/Sybunt.php | 14 +++++++++++-- CRM/Report/Form/Contribute/TopDonor.php | 14 +++++++++++-- CRM/Report/Form/Member/ContributionDetail.php | 5 +++++ CRM/Report/Form/Member/Detail.php | 8 ++++++++ CRM/Report/Form/Member/Lapse.php | 8 ++++++++ CRM/Report/Form/Member/Summary.php | 8 ++++++++ 20 files changed, 193 insertions(+), 10 deletions(-) diff --git a/CRM/Report/Form/Contact/CurrentEmployer.php b/CRM/Report/Form/Contact/CurrentEmployer.php index b67a6b03f2..f8fa02059e 100644 --- a/CRM/Report/Form/Contact/CurrentEmployer.php +++ b/CRM/Report/Form/Contact/CurrentEmployer.php @@ -94,6 +94,14 @@ class CRM_Report_Form_Contact_CurrentEmployer extends CRM_Report_Form { 'no_display' => TRUE, 'required' => TRUE, ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), + ), ), 'filters' => array( diff --git a/CRM/Report/Form/Contact/Detail.php b/CRM/Report/Form/Contact/Detail.php index 8e0ae0facd..2e162199bb 100644 --- a/CRM/Report/Form/Contact/Detail.php +++ b/CRM/Report/Form/Contact/Detail.php @@ -53,15 +53,25 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { 'required' => TRUE, 'no_repeat' => TRUE, ), - 'first_name' => array('title' => ts('First Name'), + 'first_name' => array( + 'title' => ts('First Name'), ), - 'last_name' => array('title' => ts('Last Name'), + 'last_name' => array( + 'title' => ts('Last Name'), ), 'id' => array( 'no_display' => TRUE, 'required' => TRUE, ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), + ), ), 'filters' => array( diff --git a/CRM/Report/Form/Contact/Relationship.php b/CRM/Report/Form/Contact/Relationship.php index 4ed768f5d8..07ef819c99 100644 --- a/CRM/Report/Form/Contact/Relationship.php +++ b/CRM/Report/Form/Contact/Relationship.php @@ -62,6 +62,16 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { 'no_display' => TRUE, 'required' => TRUE, ), + 'contact_type_a' => + array( + 'title' => ts('Contact Type (Contact A)'), + 'name' => 'contact_type', + ), + 'contact_sub_type_a' => + array( + 'title' => ts('Contact SubType (Contact A)'), + 'name' => 'contact_sub_type', + ), ), 'filters' => array( @@ -90,6 +100,16 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { 'no_display' => TRUE, 'required' => TRUE, ), + 'contact_type_b' => + array( + 'title' => ts('Contact Type (Contact B)'), + 'name' => 'contact_type', + ), + 'contact_sub_type_b' => + array( + 'title' => ts('Contact SubType (Contact B)'), + 'name' => 'contact_sub_type', + ), ), 'filters' => array( diff --git a/CRM/Report/Form/Contact/Summary.php b/CRM/Report/Form/Contact/Summary.php index 0961bda73a..9e1330d0e3 100644 --- a/CRM/Report/Form/Contact/Summary.php +++ b/CRM/Report/Form/Contact/Summary.php @@ -59,15 +59,25 @@ class CRM_Report_Form_Contact_Summary extends CRM_Report_Form { 'required' => TRUE, 'no_repeat' => TRUE, ), - 'first_name' => array('title' => ts('First Name'), + 'first_name' => array( + 'title' => ts('First Name'), ), - 'last_name' => array('title' => ts('Last Name'), + 'last_name' => array( + 'title' => ts('Last Name'), ), 'id' => array( 'no_display' => TRUE, 'required' => TRUE, ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), + ), ), 'filters' => array( diff --git a/CRM/Report/Form/Contribute/Bookkeeping.php b/CRM/Report/Form/Contribute/Bookkeeping.php index 5d6e99f23d..72565cec57 100644 --- a/CRM/Report/Form/Contribute/Bookkeeping.php +++ b/CRM/Report/Form/Contribute/Bookkeeping.php @@ -60,6 +60,14 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { 'no_display' => TRUE, 'required' => TRUE, ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), + ), ), 'filters' => array( diff --git a/CRM/Report/Form/Contribute/Detail.php b/CRM/Report/Form/Contribute/Detail.php index 6bf7a14f93..f8683dbf72 100644 --- a/CRM/Report/Form/Contribute/Detail.php +++ b/CRM/Report/Form/Contribute/Detail.php @@ -74,6 +74,14 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form { 'no_display' => TRUE, 'required' => TRUE, ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), + ), ), 'filters' => array( diff --git a/CRM/Report/Form/Contribute/History.php b/CRM/Report/Form/Contribute/History.php index b2d705def9..413588a7fb 100644 --- a/CRM/Report/Form/Contribute/History.php +++ b/CRM/Report/Form/Contribute/History.php @@ -93,6 +93,14 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { 'default' => TRUE, 'required' => TRUE, ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), + ), ), 'grouping' => 'contact-fields', 'filters' => diff --git a/CRM/Report/Form/Contribute/HouseholdSummary.php b/CRM/Report/Form/Contribute/HouseholdSummary.php index d112e0bf8f..da307f2856 100644 --- a/CRM/Report/Form/Contribute/HouseholdSummary.php +++ b/CRM/Report/Form/Contribute/HouseholdSummary.php @@ -69,6 +69,14 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { 'no_display' => TRUE, 'required' => TRUE, ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), + ), ), 'filters' => array( diff --git a/CRM/Report/Form/Contribute/Lybunt.php b/CRM/Report/Form/Contribute/Lybunt.php index 75bdbdf59a..870fd4e223 100644 --- a/CRM/Report/Form/Contribute/Lybunt.php +++ b/CRM/Report/Form/Contribute/Lybunt.php @@ -77,9 +77,19 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { 'default' => TRUE, 'required' => TRUE, ), - 'first_name' => array('title' => ts('First Name'), + 'first_name' => array( + 'title' => ts('First Name'), ), - 'last_name' => array('title' => ts('Last Name'), + 'last_name' => array( + 'title' => ts('Last Name'), + ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), ), ), 'filters' => diff --git a/CRM/Report/Form/Contribute/OrganizationSummary.php b/CRM/Report/Form/Contribute/OrganizationSummary.php index d0b9b2a6c3..f99c85587a 100644 --- a/CRM/Report/Form/Contribute/OrganizationSummary.php +++ b/CRM/Report/Form/Contribute/OrganizationSummary.php @@ -69,6 +69,14 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form { 'no_display' => TRUE, 'required' => TRUE, ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), + ), ), 'filters' => array( diff --git a/CRM/Report/Form/Contribute/PCP.php b/CRM/Report/Form/Contribute/PCP.php index d47e6c7b23..be1b0016bf 100644 --- a/CRM/Report/Form/Contribute/PCP.php +++ b/CRM/Report/Form/Contribute/PCP.php @@ -51,6 +51,14 @@ class CRM_Report_Form_Contribute_PCP extends CRM_Report_Form { 'required' => TRUE, 'no_display' => TRUE, ), + 'contact_type' => + array( + 'title' => ts('Supporter Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Supporter Contact SubType'), + ), ), 'filters' => array( diff --git a/CRM/Report/Form/Contribute/Repeat.php b/CRM/Report/Form/Contribute/Repeat.php index 1b41993cbe..5d44ec245b 100644 --- a/CRM/Report/Form/Contribute/Repeat.php +++ b/CRM/Report/Form/Contribute/Repeat.php @@ -67,6 +67,16 @@ class CRM_Report_Form_Contribute_Repeat extends CRM_Report_Form { 'no_display' => TRUE, 'required' => TRUE, ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + 'no_repeat' => TRUE, + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), + 'no_repeat' => TRUE, + ), ), 'filters' => array( @@ -454,6 +464,8 @@ LEFT JOIN civicrm_temp_civireport_repeat2 {$this->_aliases['civicrm_contribution 'sort_name', 'display_name', 'addressee_display', + 'contact_type', + 'contact_sub_type', 'email', 'phone', 'state_province_id', diff --git a/CRM/Report/Form/Contribute/SoftCredit.php b/CRM/Report/Form/Contribute/SoftCredit.php index b2bab5fd0e..29c0dcd4e0 100644 --- a/CRM/Report/Form/Contribute/SoftCredit.php +++ b/CRM/Report/Form/Contribute/SoftCredit.php @@ -89,6 +89,14 @@ class CRM_Report_Form_Contribute_SoftCredit extends CRM_Report_Form { 'no_display' => TRUE, 'required' => TRUE, ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), + ), ), 'filters' => array( diff --git a/CRM/Report/Form/Contribute/Summary.php b/CRM/Report/Form/Contribute/Summary.php index ab37082750..246e17c90b 100644 --- a/CRM/Report/Form/Contribute/Summary.php +++ b/CRM/Report/Form/Contribute/Summary.php @@ -73,6 +73,14 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { 'no_display' => TRUE, 'required' => TRUE, ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), + ), ), 'grouping' => 'contact-fields', 'group_bys' => diff --git a/CRM/Report/Form/Contribute/Sybunt.php b/CRM/Report/Form/Contribute/Sybunt.php index 406a893be8..42b6f3653c 100644 --- a/CRM/Report/Form/Contribute/Sybunt.php +++ b/CRM/Report/Form/Contribute/Sybunt.php @@ -73,9 +73,19 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { array('title' => ts('Donor Name'), 'required' => TRUE, ), - 'first_name' => array('title' => ts('First Name'), + 'first_name' => array( + 'title' => ts('First Name'), ), - 'last_name' => array('title' => ts('Last Name'), + 'last_name' => array( + 'title' => ts('Last Name'), + ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), ), ), 'filters' => diff --git a/CRM/Report/Form/Contribute/TopDonor.php b/CRM/Report/Form/Contribute/TopDonor.php index e74c7b54bb..ec65ae9d38 100644 --- a/CRM/Report/Form/Contribute/TopDonor.php +++ b/CRM/Report/Form/Contribute/TopDonor.php @@ -62,9 +62,19 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { 'required' => TRUE, 'no_repeat' => TRUE, ), - 'first_name' => array('title' => ts('First Name'), + 'first_name' => array( + 'title' => ts('First Name'), ), - 'last_name' => array('title' => ts('Last Name'), + 'last_name' => array( + 'title' => ts('Last Name'), + ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), ), ), ), diff --git a/CRM/Report/Form/Member/ContributionDetail.php b/CRM/Report/Form/Member/ContributionDetail.php index 2c150088a7..6eb6e24983 100644 --- a/CRM/Report/Form/Member/ContributionDetail.php +++ b/CRM/Report/Form/Member/ContributionDetail.php @@ -77,6 +77,11 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { array('title' => ts('Contact Type'), 'no_repeat' => TRUE, ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), + 'no_repeat' => TRUE, + ), 'do_not_email' => array('title' => ts('Do Not Email'), 'no_repeat' => TRUE, diff --git a/CRM/Report/Form/Member/Detail.php b/CRM/Report/Form/Member/Detail.php index 140d29fb71..7271933684 100644 --- a/CRM/Report/Form/Member/Detail.php +++ b/CRM/Report/Form/Member/Detail.php @@ -93,6 +93,14 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { 'no_display' => TRUE, 'required' => TRUE, ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), + ), ), 'filters' => array( diff --git a/CRM/Report/Form/Member/Lapse.php b/CRM/Report/Form/Member/Lapse.php index 088093088e..695ac4dc3b 100644 --- a/CRM/Report/Form/Member/Lapse.php +++ b/CRM/Report/Form/Member/Lapse.php @@ -90,6 +90,14 @@ class CRM_Report_Form_Member_Lapse extends CRM_Report_Form { 'no_display' => TRUE, 'required' => TRUE, ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), + ), ), 'grouping' => 'contact-fields', ), diff --git a/CRM/Report/Form/Member/Summary.php b/CRM/Report/Form/Member/Summary.php index 94b14e264c..db8e7ed36d 100644 --- a/CRM/Report/Form/Member/Summary.php +++ b/CRM/Report/Form/Member/Summary.php @@ -137,6 +137,14 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { array( 'no_display' => TRUE, ), + 'contact_type' => + array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => + array( + 'title' => ts('Contact SubType'), + ), ), ), 'civicrm_contribution' => -- 2.25.1