CRM-12607
authorDonald A. Lobo <lobo@civicrm.org>
Tue, 14 May 2013 18:34:47 +0000 (11:34 -0700)
committerDonald A. Lobo <lobo@civicrm.org>
Tue, 14 May 2013 18:34:47 +0000 (11:34 -0700)
----------------------------------------
* CRM-12607: Add employer and address fields to the Event Participants List report
  http://issues.civicrm.org/jira/browse/CRM-12607

CRM/Report/Form/Event/ParticipantListCount.php

index 42761946a377b1c93b51d595d6fc3087bc9adddc..d4698163d620a935ae7bdd7df30e9ac646afc344 100644 (file)
@@ -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']}