From: yashodha Date: Thu, 5 Nov 2015 07:12:28 +0000 (+0530) Subject: CRM-17485: Event participant role filter not working in Participant list Count Report X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=75314e6741e96b572832e092461d4bdca2cdef2c;p=civicrm-core.git CRM-17485: Event participant role filter not working in Participant list Count Report ---------------------------------------- * CRM-17485: Event participant role filter not working in Participant list Count Report https://issues.civicrm.org/jira/browse/CRM-17485 --- diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index af72c422ec..16d51f7b32 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -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; diff --git a/CRM/Report/Form/Case/Summary.php b/CRM/Report/Form/Case/Summary.php index 9aafef26ad..5dedbb2b8e 100644 --- a/CRM/Report/Form/Case/Summary.php +++ b/CRM/Report/Form/Case/Summary.php @@ -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; diff --git a/CRM/Report/Form/Event/ParticipantListing.php b/CRM/Report/Form/Event/ParticipantListing.php index b1ef746849..f5fcb538ea 100644 --- a/CRM/Report/Form/Event/ParticipantListing.php +++ b/CRM/Report/Form/Event/ParticipantListing.php @@ -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;