CRM-17485: Event participant role filter not working in Participant list Count Report
authoryashodha <yashodha.chaku@webaccessglobal.com>
Thu, 5 Nov 2015 07:12:28 +0000 (12:42 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Thu, 5 Nov 2015 07:12:28 +0000 (12:42 +0530)
----------------------------------------
* CRM-17485: Event participant role filter not working in Participant list Count Report
  https://issues.civicrm.org/jira/browse/CRM-17485

CRM/Report/Form.php
CRM/Report/Form/Case/Summary.php
CRM/Report/Form/Event/ParticipantListing.php

index af72c422ecdb369995e622b2af71460aca0759ee..16d51f7b32bf95b597a0fc3877778369ac996fa2 100644 (file)
@@ -1740,9 +1740,7 @@ class CRM_Report_Form extends CRM_Core_Form {
         // mhas == multiple has
         if ($value !== NULL && count($value) > 0) {
           $sqlOP = $this->getSQLOperator($op);
-          $clause
-            = "{$field['dbAlias']} REGEXP '[[:cntrl:]]" . implode('|', $value) .
-            "[[:cntrl:]]'";
+          $clause = "( {$field['dbAlias']} REGEXP '[[:<:]]" . implode('[[:>:]]|[[:<:]]', $value) . "[[:>:]]' )";
         }
         break;
 
@@ -1750,9 +1748,7 @@ class CRM_Report_Form extends CRM_Core_Form {
         // mnot == multiple is not one of
         if ($value !== NULL && count($value) > 0) {
           $sqlOP = $this->getSQLOperator($op);
-          $clause
-            = "( {$field['dbAlias']} NOT REGEXP '[[:cntrl:]]" . implode('|', $value) .
-            "[[:cntrl:]]' OR {$field['dbAlias']} IS NULL )";
+          $clause = "( {$field['dbAlias']} NOT REGEXP '[[:<:]]" . implode('[[:>:]]|[[:<:]]', $value) . "[[:>:]]' )";
         }
         break;
 
index 9aafef26ade50af12ae9ae3fd01b2f8e42f069ef..5dedbb2b8ea5a9e77ce2416389bcf2613be842a6 100644 (file)
@@ -291,7 +291,11 @@ inner join civicrm_contact $c2 on ${c2}.id=${ccc}.contact_id
             if ($fieldName == 'case_type_id') {
               $value = CRM_Utils_Array::value("{$fieldName}_value", $this->_params);
               if (!empty($value)) {
-                $clause = "( {$field['dbAlias']} REGEXP '[[:<:]]" .
+                $operator = '';
+                if ($op == 'notin') {
+                  $operator = 'NOT';
+                }
+                $clause = "( {$field['dbAlias']} {$operator} REGEXP '[[:<:]]" .
                   implode('[[:>:]]|[[:<:]]', $value) . "[[:>:]]' )";
               }
               $op = NULL;
index b1ef746849d842b241701595b78e128f6ea2dc1f..f5fcb538ea86e6c674c775cacc1a280c4dab28c6 100644 (file)
@@ -572,7 +572,11 @@ ORDER BY  cv.label
             if ($fieldName == 'rid') {
               $value = CRM_Utils_Array::value("{$fieldName}_value", $this->_params);
               if (!empty($value)) {
-                $clause = "( {$field['dbAlias']} REGEXP '[[:<:]]" .
+                $operator = '';
+                if ($op == 'notin') {
+                  $operator = 'NOT';
+                }
+                $clause = "( {$field['dbAlias']} {$operator} REGEXP '[[:<:]]" .
                   implode('[[:>:]]|[[:<:]]', $value) . "[[:>:]]' )";
               }
               $op = NULL;