CRM-15379 - Find Participants : Actual participant count is incorrect when multiple...
authoratif-shaikh <shaikh388@gmail.com>
Tue, 7 Oct 2014 12:58:37 +0000 (18:28 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Tue, 7 Oct 2014 12:58:37 +0000 (18:28 +0530)
https://issues.civicrm.org/jira/browse/CRM-15379

CRM/Event/Form/Search.php

index 1e3aafd0ad37c7a4c835072d0d854dc2c6f57c88..f69f4d63b91df1c3656bc90f03290f87fc6d0cbb 100644 (file)
@@ -212,6 +212,13 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
           $roles = array_keys($this->_formValues['participant_role_id']);
           $seatClause[] = '( participant.role_id IN ( ' . implode(' , ', $roles) . ' ) )';
         }
+        // CRM-15379
+        if (!empty($this->_formValues['participant_fee_id'])) {
+          $participant_fee_id = $this->_formValues['participant_fee_id'];
+          $feeLabel = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $participant_fee_id, 'label');
+          $feeLabel = CRM_Core_DAO::escapeString(trim($feeLabel));
+          $seatClause[] = "( participant.fee_level LIKE '%$feeLabel%' )";
+        }
         $clause = NULL;
         if (!empty($seatClause)) {
           $clause = implode(' AND ', $seatClause);