fixes empty dtend by assuming 30 minutes duration
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 15 Aug 2014 19:52:14 +0000 (21:52 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 15 Aug 2014 20:08:30 +0000 (22:08 +0200)
* should be improved by checking duration attribute

Change-Id: I8934c6c119c933bb9e437cfb5c7a4d9ef14159ec
Reviewed-on: http://gerrit.tine20.com/customers/1001
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Calendar/Convert/Event/VCalendar/Abstract.php

index fee2555..8d8bc03 100644 (file)
@@ -962,6 +962,16 @@ class Calendar_Convert_Event_VCalendar_Abstract implements Tinebase_Convert_Inte
             $event->class = Calendar_Model_Event::CLASS_PUBLIC;
         }
         
+        if (empty($event->dtend)) {
+            // TODO find out duration (see TRIGGER DURATION)
+//             if (isset($vevent->DURATION)) {
+//             }
+            if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__
+                    . ' Got event without dtend. Assuming 30 minutes duration');
+            $event->dtend = clone $event->dtstart;
+            $event->dtend->addMinute(30);
+        }
+        
         // convert all datetime fields to UTC
         $event->setTimezone('UTC');
     }
@@ -1080,4 +1090,4 @@ class Calendar_Convert_Event_VCalendar_Abstract implements Tinebase_Convert_Inte
         
         return $result;
     }
-}
\ No newline at end of file
+}