Merge pull request #4777 from civicrm/revert-4766-CRM-15714
[civicrm-core.git] / CRM / Event / Form / Search.php
index 1e3aafd0ad37c7a4c835072d0d854dc2c6f57c88..1fb279ee12b5ba97b35522d15654b65b352bab14 100644 (file)
@@ -43,7 +43,7 @@
 class CRM_Event_Form_Search extends CRM_Core_Form_Search {
 
   /**
-   * the params that are sent to the query
+   * The params that are sent to the query
    *
    * @var array
    * @access protected
@@ -51,7 +51,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
   protected $_queryParams;
 
   /**
-   * are we restricting ourselves to a single contact
+   * Are we restricting ourselves to a single contact
    *
    * @access protected
    * @var boolean
@@ -59,7 +59,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
   protected $_single = FALSE;
 
   /**
-   * are we restricting ourselves to a single contact
+   * Are we restricting ourselves to a single contact
    *
    * @access protected
    * @var boolean
@@ -67,7 +67,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
   protected $_limit = NULL;
 
   /**
-   * prefix for the controller
+   * Prefix for the controller
    *
    */
   protected $_prefix = "event_";
@@ -75,7 +75,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
   protected $_defaults;
 
   /**
-   * the saved search ID retrieved from the GET vars
+   * The saved search ID retrieved from the GET vars
    *
    * @var int
    * @access protected
@@ -83,7 +83,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
   protected $_ssID;
 
   /**
-   * processing needed for buildForm and later
+   * Processing needed for buildForm and later
    *
    * @return void
    * @access public
@@ -169,7 +169,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
   }
 
   /**
-   * Build the form
+   * Build the form object
    *
    * @access public
    *
@@ -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);