Branch 'roundcubemail-plugins-kolab-0.7' - plugins/calendar

Aleksander Machniak machniak at kolabsys.com
Fri Dec 21 11:09:57 CET 2012


 plugins/calendar/lib/calendar_ical.php |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit a64c1e7ba71e9ec0ef3018f3530c07ed1e8b6a6a
Author: Aleksander Machniak <machniak at kolabsys.com>
Date:   Fri Dec 21 11:09:48 2012 +0100

    Export sequence attribute; fix UTC date formatting in iCal exports
    
    Conflicts:
    
    	plugins/calendar/lib/calendar_ical.php

diff --git a/plugins/calendar/lib/calendar_ical.php b/plugins/calendar/lib/calendar_ical.php
index 9bd10e1..fbb4aa6 100644
--- a/plugins/calendar/lib/calendar_ical.php
+++ b/plugins/calendar/lib/calendar_ical.php
@@ -370,6 +370,8 @@ class calendar_ical
         $vevent = "BEGIN:VEVENT" . self::EOL;
         $vevent .= "UID:" . self::escpape($event['uid']) . self::EOL;
         $vevent .= $this->format_datetime("DTSTAMP", $event['changed'] ? $event['changed'] : new DateTime(), false, true) . self::EOL;
+        if ($event['sequence'])
+            $vevent .= "SEQUENCE:" . intval($event['sequence']) . self::EOL;
         // correctly set all-day dates
         if ($event['allday']) {
           $event['end'] = new DateTime('@'.($event['end']->format('U') + 86400));  // ends the next day
@@ -456,8 +458,7 @@ class calendar_ical
     else {
       // <ATTR>;TZID=Europe/Zurich:20120706T210000
       $tz = $dt->getTimezone();
-      $tzname = $tz ? $tz->getName() : 'UTC';
-      $tzid = $tzname != 'UTC' && $tzname != '+00:00' ? ';TZID=' . $tzname : '';
+      $tzid = $tz && $tz->getName() != 'UTC' ? ';TZID=' . $tz->getName() : '';
       return $attr . $tzid . ':' . $dt->format('Ymd\THis' . ($tzid ? '' : '\Z'));
     }
   }





More information about the commits mailing list