plugins/calendar plugins/libcalendaring plugins/libkolab
Thomas Brüderli
bruederli at kolabsys.com
Fri Aug 1 10:08:45 CEST 2014
plugins/calendar/calendar_ui.js | 6 +++++-
plugins/calendar/localization/en_US.inc | 1 +
plugins/calendar/skins/larry/calendar.css | 1 +
plugins/calendar/skins/larry/templates/calendar.html | 4 ++++
plugins/libcalendaring/libvcalendar.php | 5 +----
plugins/libkolab/lib/kolab_format_xcal.php | 8 ++++++++
6 files changed, 20 insertions(+), 5 deletions(-)
New commits:
commit 4ea51417ba0a56c7b8cff1c20f36f7b4d487a029
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date: Fri Aug 1 10:00:59 2014 +0200
Copy iTip inivitation comment to event objects and display it in calendar with the RSPV buttons (#419)
diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index 9d08c53..b24df47 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -534,9 +534,13 @@ function rcube_calendar_ui(settings)
.html(Q(rcmail.gettext('itip' + mystatus, 'libcalendaring')));
}
- $('#event-rsvp')[(rsvp && !is_organizer(event) && event.status != 'CANCELLED' ? 'show' : 'hide')]();
+ var show_rsvp = rsvp && !is_organizer(event) && event.status != 'CANCELLED';
+ $('#event-rsvp')[(show_rsvp ? 'show' : 'hide')]();
$('#event-rsvp .rsvp-buttons input').prop('disabled', false).filter('input[rel='+mystatus+']').prop('disabled', true);
+ if (show_rsvp && event.comment)
+ $('#event-rsvp-comment').show().children('.event-text').html(Q(event.comment));
+
$('#event-rsvp a.reply-comment-toggle').show();
$('#event-rsvp .itip-reply-comment textarea').hide().val('');
}
diff --git a/plugins/calendar/localization/en_US.inc b/plugins/calendar/localization/en_US.inc
index 7d1e7d2..d950daa 100644
--- a/plugins/calendar/localization/en_US.inc
+++ b/plugins/calendar/localization/en_US.inc
@@ -111,6 +111,7 @@ $labels['quickview'] = 'View only this calendar';
$labels['invitationspending'] = 'Pending invitations';
$labels['invitationsdeclined'] = 'Declined invitations';
$labels['changepartstat'] = 'Change participant status';
+$labels['rsvpcomment'] = 'Invitation text';
// agenda view
$labels['listrange'] = 'Range to display:';
diff --git a/plugins/calendar/skins/larry/calendar.css b/plugins/calendar/skins/larry/calendar.css
index 76b2587..1972dce 100644
--- a/plugins/calendar/skins/larry/calendar.css
+++ b/plugins/calendar/skins/larry/calendar.css
@@ -717,6 +717,7 @@ a.miniColors-trigger {
margin-left: 2em;
}
+.calendarmain .eventdialog #event-rsvp-comment,
.calendarmain .eventdialog #event-created-changed {
margin-top: 0.6em;
}
diff --git a/plugins/calendar/skins/larry/templates/calendar.html b/plugins/calendar/skins/larry/templates/calendar.html
index 50ad616..275725c 100644
--- a/plugins/calendar/skins/larry/templates/calendar.html
+++ b/plugins/calendar/skins/larry/templates/calendar.html
@@ -142,6 +142,10 @@
<label><roundcube:label name="calendar.changed" /></label>
<span class="event-text event-changed"></span>
</div>
+ <div class="event-line" id="event-rsvp-comment">
+ <label><roundcube:label name="calendar.rsvpcomment" /></label>
+ <span class="event-text"></span>
+ </div>
<roundcube:object name="plugin.event_rsvp_buttons" id="event-rsvp" class="event-dialog-message" style="display:none" />
</div>
diff --git a/plugins/libcalendaring/libvcalendar.php b/plugins/libcalendaring/libvcalendar.php
index a89cec2..a45da6e 100644
--- a/plugins/libcalendaring/libvcalendar.php
+++ b/plugins/libcalendaring/libvcalendar.php
@@ -465,6 +465,7 @@ class libvcalendar implements Iterator
case 'LOCATION':
case 'DESCRIPTION':
case 'URL':
+ case 'COMMENT':
$event[strtolower($prop->name)] = self::convert_string($prop);
break;
@@ -520,10 +521,6 @@ class libvcalendar implements Iterator
}
break;
- case 'COMMENT':
- $event['comment'] = $prop->value;
- break;
-
default:
if (substr($prop->name, 0, 2) == 'X-')
$event['x-custom'][] = array($prop->name, strval($prop->value));
diff --git a/plugins/libkolab/lib/kolab_format_xcal.php b/plugins/libkolab/lib/kolab_format_xcal.php
index 7d077b7..a18557b 100644
--- a/plugins/libkolab/lib/kolab_format_xcal.php
+++ b/plugins/libkolab/lib/kolab_format_xcal.php
@@ -127,6 +127,10 @@ abstract class kolab_format_xcal extends kolab_format
'start' => self::php_datetime($this->obj->start()),
);
+ if (method_exists($this->obj, 'comment')) {
+ $object['comment'] = $this->obj->comment();
+ }
+
// read organizer and attendees
if (($organizer = $this->obj->organizer()) && ($organizer->email() || $organizer->name())) {
$object['organizer'] = array(
@@ -340,6 +344,10 @@ abstract class kolab_format_xcal extends kolab_format
$this->obj->setCategories(self::array2vector($object['categories']));
$this->obj->setUrl(strval($object['url']));
+ if (method_exists($this->obj, 'setComment')) {
+ $this->obj->setComment($object['comment']);
+ }
+
// process event attendees
$attendees = new vectorattendee;
foreach ((array)$object['attendees'] as $attendee) {
More information about the commits
mailing list