minor fix
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Fri, 26 Feb 2016 13:16:41 +0000 (18:46 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Fri, 26 Feb 2016 13:16:41 +0000 (18:46 +0530)
CRM/Event/BAO/Query.php
templates/CRM/Event/Form/Search/Common.tpl

index c40c084c118ff714f05f0dec3a3ad123f7e046de..cddba764ad964bd9befbda984cdccfa88f506d3d 100644 (file)
@@ -283,13 +283,13 @@ class CRM_Event_BAO_Query {
               $exEventId = $val;
               $extractEventId = explode(" ", $val);
               $value = $extractEventId[2];
-              unset($query->_where[$grouping][$key]);
+              $where = $query->_where[$grouping][$key];
             }
             else if (strstr($val, 'civicrm_event.id IN')) {
               //extract the first event id if multiple events are selected
               preg_match('/civicrm_event.id IN \(\"(\d+)/', $val, $matches);
               $value = $matches[1];
-              unset($query->_where[$grouping][$key]);
+              $where = $query->_where[$grouping][$key];
             }
           }
           if ($exEventId) {
@@ -299,7 +299,7 @@ class CRM_Event_BAO_Query {
           else if(!empty($matches[1])) {
             $value = $matches[1];
           }
-          unset($query->_where[$grouping][$key]);
+          $where = $query->_where[$grouping][$key];
         }
         $thisEventHasParent = CRM_Core_BAO_RecurringEntity::getParentFor($value, 'civicrm_event');
         if ($thisEventHasParent) {
@@ -313,7 +313,7 @@ class CRM_Event_BAO_Query {
             $value = "(" . implode(",", $allEventIds) . ")";
           }
         }
-        $query->_where[$grouping][] = "civicrm_event.id $op {$value}";
+        $query->_where[$grouping][] = "{$where} OR civicrm_event.id $op {$value}";
         $query->_qill[$grouping][] = ts('Include Repeating Events');
         $query->_tables['civicrm_event'] = $query->_whereTables['civicrm_event'] = 1;
         return;
index 0b16f48066056bbb4f66550b1d68b7cb616654cd..f714ee2a38665cc3ffd5a1e8f39190581689fa4f 100644 (file)
@@ -98,7 +98,8 @@ CRM.$(function($) {
       if (!$(this).data('select2')) {
         $(this).crmEntityRef();
       }
-      if (!$.isEmptyObject($(this).select2('data')[0].extra)) {
+      // allow repeat checkbox to be shown for first event selected
+      if (!$.isEmptyObject($(this).select2('data')[0])) {
         isRepeating = $(this).select2('data')[0].extra.is_recur;
       }
     }