0013222: Allow to filter for rrule
authorMichael Spahn <m.spahn@metaways.de>
Fri, 16 Jun 2017 16:13:34 +0000 (18:13 +0200)
committerMichael Spahn <m.spahn@metaways.de>
Tue, 20 Jun 2017 10:23:57 +0000 (12:23 +0200)
Skip rrule computation

https://forge.tine20.org/view.php?id=13222

Change-Id: I9f7d56869483d9f943b6d690e28c778f466abc7f
Reviewed-on: http://gerrit.tine20.com/customers/4889
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Michael Spahn <m.spahn@metaways.de>
Tested-by: Michael Spahn <m.spahn@metaways.de>
tine20/Calendar/Convert/Event/Json.php
tine20/Tinebase/js/data/GroupedStoreCollection.js

index c1b14a1..a40aed6 100644 (file)
@@ -132,7 +132,20 @@ class Calendar_Convert_Event_Json extends Tinebase_Convert_Json
         Calendar_Controller_Event::getInstance()->getAlarms($_records);
         
         Calendar_Convert_Event_Json::resolveGrantsOfExternalOrganizers($_records);
-        Calendar_Model_Rrule::mergeAndRemoveNonMatchingRecurrences($_records, $_filter);
+
+        $skipRruleComputation = false;
+
+        if (null !== $_filter) {
+            $rruleFilter = $_filter->getFilter('rrule', false, true);
+            if ($rruleFilter && in_array($rruleFilter->getOperator(), ['in', 'notin'])) {
+                $skipRruleComputation = true;
+            }
+
+            if (!$skipRruleComputation) {
+                Calendar_Model_Rrule::mergeAndRemoveNonMatchingRecurrences($_records, $_filter);
+            }
+        }
+
         $_records->sortByPagination($_pagination);
         
         Tinebase_Frontend_Json_Abstract::resolveContainersAndTags($_records, array('container_id'));
index 5fa7e37..646d0dc 100644 (file)
@@ -35,7 +35,7 @@ Tine.Tinebase.data.GroupedStoreCollection = function(config) {
     if (this.group) {
         this.applyGrouping();
     }
-}
+};
 
 Ext.extend(Tine.Tinebase.data.GroupedStoreCollection, Ext.util.MixedCollection, {
     /**