From 9cd28c89b4f5cc24951e81751f0a3654dca55fcb Mon Sep 17 00:00:00 2001 From: "Donald A. Lobo" Date: Tue, 14 May 2013 11:34:47 -0700 Subject: [PATCH] CRM-12607 ---------------------------------------- * CRM-12607: Add employer and address fields to the Event Participants List report http://issues.civicrm.org/jira/browse/CRM-12607 --- .../Form/Event/ParticipantListCount.php | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/CRM/Report/Form/Event/ParticipantListCount.php b/CRM/Report/Form/Event/ParticipantListCount.php index 42761946a3..d4698163d6 100644 --- a/CRM/Report/Form/Event/ParticipantListCount.php +++ b/CRM/Report/Form/Event/ParticipantListCount.php @@ -69,6 +69,22 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event { ), ), ), + 'civicrm_employer' => + array( + 'dao' => 'CRM_Contact_DAO_Contact', + 'grouping' => 'contact-fields', + 'fields' => array( + 'id' => array( + 'no_display' => true, + 'required' => true, + ), + 'organization_name' => array( + 'title' => 'Employer', + 'default' => TRUE, + 'no_repeat' => TRUE, + ), + ), + ), 'civicrm_email' => array( 'dao' => 'CRM_Core_DAO_Email', @@ -104,6 +120,14 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event { 'fields' => array( 'street_address' => NULL, + 'city' => NULL, + 'postal_code' => NULL, + 'state_province_id' => + array('title' => ts('State/Province'), + ), + 'country_id' => + array('title' => ts('Country'), + ), ), 'grouping' => 'contact-fields', ), @@ -352,7 +376,9 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event { LEFT JOIN civicrm_contact {$this->_aliases['civicrm_contact']} ON ({$this->_aliases['civicrm_participant']}.contact_id = {$this->_aliases['civicrm_contact']}.id ) {$this->_aclFrom} - LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']} + LEFT JOIN civicrm_contact {$this->_aliases['civicrm_employer']} + ON ({$this->_aliases['civicrm_employer']}.id = {$this->_aliases['civicrm_contact']}.employer_id ) + LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']} ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_address']}.contact_id AND {$this->_aliases['civicrm_address']}.is_primary = 1 LEFT JOIN civicrm_email {$this->_aliases['civicrm_email']} -- 2.25.1