Branch 'roundcubemail-plugins-kolab-3.1' - 3 commits - plugins/calendar plugins/libcalendaring

Thomas Brüderli bruederli at kolabsys.com
Thu Feb 27 08:50:39 CET 2014


 plugins/calendar/calendar.php                      |    9 ++++++-
 plugins/calendar/skins/larry/calendar.css          |    1 
 plugins/libcalendaring/libvcalendar.php            |    8 ------
 plugins/libcalendaring/tests/libvcalendar.php      |   13 ++++++++++
 plugins/libcalendaring/tests/resources/escaped.ics |   25 +++++++++++++++++++++
 5 files changed, 48 insertions(+), 8 deletions(-)

New commits:
commit 24ad8c0f8347ff04494574d23da67ce51fb2cdb6
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Thu Feb 27 08:44:12 2014 +0100

    Load calendar CSS on iTip invitation screen (#2882)

diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index ced68e8..3931a0e 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -1758,6 +1758,8 @@ class calendar extends rcube_plugin
   public function itip_attend_response($p)
   {
     if ($p['action'] == 'attend') {
+      $this->ui->init();
+
       $this->rc->output->set_env('task', 'calendar');  // override some env vars
       $this->rc->output->set_env('refresh_interval', 0);
       $this->rc->output->set_pagetitle($this->gettext('calendar'));
diff --git a/plugins/calendar/skins/larry/calendar.css b/plugins/calendar/skins/larry/calendar.css
index 7baa487..ea88ffe 100644
--- a/plugins/calendar/skins/larry/calendar.css
+++ b/plugins/calendar/skins/larry/calendar.css
@@ -1427,6 +1427,7 @@ div.calendar-invitebox .rsvp-status.tentative {
 
 .calendaritipattend .centerbox {
 	width: 40em;
+	min-height: 7em;
 	margin: 80px auto 0 auto;
 	padding: 10px 10px 10px 90px;
 	background: url(images/invitation.png) 10px 10px no-repeat #fff;


commit cfc488283d45bff0d1c6c84a49bbf65895edcbef
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Wed Feb 26 19:33:11 2014 +0100

    Avoid fatal error if no changed date found in iTip message

diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index 27f2743..ced68e8 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -2122,7 +2122,12 @@ class calendar extends rcube_plugin
     if ($success) {
       $message = $this->ical->method == 'REPLY' ? 'attendeupdateesuccess' : ($deleted ? 'successremoval' : 'importedsuccessfully');
       $this->rc->output->command('display_message', $this->gettext(array('name' => $message, 'vars' => array('calendar' => $calendar['name']))), 'confirmation');
-      $this->rc->output->command('plugin.fetch_event_rsvp_status', array('uid' => $event['uid'], 'changed' => $event['changed']->format('U'), 'sequence' => intval($event['sequence']), 'fallback' => strtoupper($status)));
+      $this->rc->output->command('plugin.fetch_event_rsvp_status', array(
+          'uid' => $event['uid'],
+          'changed' => is_object($event['changed']) ? $event['changed']->format('U') : 0,
+          'sequence' => intval($event['sequence']),
+          'fallback' => strtoupper($status),
+      ));
       $error_msg = null;
     }
     else if ($error_msg)


commit 70fc4859b95521a751f3cc788d715769ca039246
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Wed Feb 26 12:15:03 2014 +0100

    Decode escaped commas in various ical property values

diff --git a/plugins/libcalendaring/libvcalendar.php b/plugins/libcalendaring/libvcalendar.php
index b179a9e..11d5972 100644
--- a/plugins/libcalendaring/libvcalendar.php
+++ b/plugins/libcalendaring/libvcalendar.php
@@ -443,14 +443,8 @@ class libvcalendar implements Iterator
 
             case 'LOCATION':
             case 'DESCRIPTION':
-                if ($this->is_apple()) {
-                    $event[strtolower($prop->name)] = str_replace('\,', ',', $prop->value);
-                    break;
-                }
-                // else: fall through
-
             case 'URL':
-                $event[strtolower($prop->name)] = $prop->value;
+                $event[strtolower($prop->name)] = str_replace('\,', ',', $prop->value);
                 break;
 
             case 'CATEGORY':
diff --git a/plugins/libcalendaring/tests/libvcalendar.php b/plugins/libcalendaring/tests/libvcalendar.php
index 28be822..0cc2b45 100644
--- a/plugins/libcalendaring/tests/libvcalendar.php
+++ b/plugins/libcalendaring/tests/libvcalendar.php
@@ -183,6 +183,19 @@ class libvcalendar_test extends PHPUnit_Framework_TestCase
     }
 
     /**
+     * 
+     */
+    function test_escaped_values()
+    {
+        $ical = new libvcalendar();
+        $events = $ical->import_from_file(__DIR__ . '/resources/escaped.ics', 'UTF-8');
+        $event = $events[0];
+
+        $this->assertEquals("House, Street, Zip Place", $event['location'], "Decode escaped commas in location value");
+        $this->assertEquals("Me, meets Them\nThem, meet Me", $event['description'], "Decode description value");
+    }
+
+    /**
      * @depends test_import
      */
     function test_freebusy()
diff --git a/plugins/libcalendaring/tests/resources/escaped.ics b/plugins/libcalendaring/tests/resources/escaped.ics
new file mode 100644
index 0000000..eb39a07
--- /dev/null
+++ b/plugins/libcalendaring/tests/resources/escaped.ics
@@ -0,0 +1,25 @@
+BEGIN:VCALENDAR
+PRODID:-//K Desktop Environment//NONSGML KOrganizer 4.11.3.0//EN
+VERSION:2.0
+X-KDE-ICAL-IMPLEMENTATION-VERSION:1.0
+METHOD:REQUEST
+BEGIN:VEVENT
+UID:4113ab9d-ffbb-aa00-c372-deb93de6b539
+ORGANIZER;CN="Organizor":MAILTO:organizor at example.org
+DTSTAMP:20140225T160532Z
+ATTENDEE;CN="Master of Desaster";RSVP=TRUE;PARTSTAT=NEEDS-ACTION;
+ ROLE=REQ-PARTICIPANT;X-UID=100156408:mailto:master at desaster.com
+ATTENDEE;CN="John Doe";RSVP=TRUE;PARTSTAT=NEEDS-ACTION;
+ ROLE=REQ-PARTICIPANT;X-UID=115484392:mailto:doe at example.com
+ATTENDEE;CN="Thomas Kolab";RSVP=TRUE;PARTSTAT=NEEDS-ACTION;
+ ROLE=REQ-PARTICIPANT;X-UID=115936264:mailto:thomas at kolab.org
+CREATED:20140225T160335Z
+LAST-MODIFIED:20140225T160335Z
+DESCRIPTION:Me\, meets Them\nThem\, meet Me
+SUMMARY:Meeting w/Them
+LOCATION:House\, Street\, Zip Place
+DTSTART:20140305T150000Z
+DTEND:20140305T170000Z
+TRANSP:OPAQUE
+END:VEVENT
+END:VCALENDAR




More information about the commits mailing list