CRM-20236 Added participant note column (#13029)
authorMadhavi <madhavim2694@gmail.com>
Tue, 30 Oct 2018 07:55:56 +0000 (13:25 +0530)
committerEileen McNaughton <eileen@mcnaughty.com>
Tue, 30 Oct 2018 07:55:56 +0000 (20:55 +1300)
* CRM-20236 Added participant note column in Event Participant Listing report

* fix code style warnings and switch to $this->isTableSelected

CRM/Report/Form/Event/ParticipantListing.php

index 29ee945c1d7a739b0e3511e68e106ff8c3bd5e61..71595ad9559b0bb3686c0ae412b542f1b92440f2 100644 (file)
@@ -294,6 +294,15 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event {
           ),
         ),
       ),
+      'civicrm_note' => array(
+        'dao' => 'CRM_Core_DAO_Note',
+        'fields' => array(
+          'participant_note' => array(
+            'name' => 'note',
+            'title' => ts('Participant Note'),
+          ),
+        ),
+      ),
       'civicrm_contribution' => array(
         'dao' => 'CRM_Contribute_DAO_Contribution',
         'fields' => array(
@@ -519,6 +528,14 @@ ORDER BY  cv.label
     $this->joinPhoneFromContact();
     $this->joinEmailFromContact();
 
+    // Include participant note.
+    if ($this->isTableSelected('civicrm_note')) {
+      $this->_from .= "
+            LEFT JOIN civicrm_note {$this->_aliases['civicrm_note']}
+                   ON ( {$this->_aliases['civicrm_note']}.entity_table = 'civicrm_participant' AND
+                   {$this->_aliases['civicrm_participant']}.id = {$this->_aliases['civicrm_note']}.entity_id )";
+    }
+
     if ($this->_contribField) {
       $this->_from .= "
              LEFT JOIN civicrm_participant_payment pp