fixes empty dtend by assuming 30 minutes duration
[tine20] / 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
+}