summaryrefslogtreecommitdiff
path: root/plugins/calendar/drivers/kolab/kolab_driver.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/calendar/drivers/kolab/kolab_driver.php')
-rw-r--r--plugins/calendar/drivers/kolab/kolab_driver.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php
index 8720dd8..559931c 100644
--- a/plugins/calendar/drivers/kolab/kolab_driver.php
+++ b/plugins/calendar/drivers/kolab/kolab_driver.php
@@ -1422,6 +1422,30 @@ class kolab_driver extends calendar_driver
}
/**
+ * Set CSS class according to the event's attendde partstat
+ */
+ public static function add_partstat_class($event, $partstats, $user = null)
+ {
+ // set classes according to PARTSTAT
+ if (is_array($event['attendees'])) {
+ $user_emails = libcalendaring::get_instance()->get_user_emails($user);
+ $partstat = 'UNKNOWN';
+ foreach ($event['attendees'] as $attendee) {
+ if (in_array($attendee['email'], $user_emails)) {
+ $partstat = $attendee['status'];
+ break;
+ }
+ }
+
+ if (in_array($partstat, $partstats)) {
+ $event['className'] = trim($event['className'] . ' fc-invitation-' . strtolower($partstat));
+ }
+ }
+
+ return $event;
+ }
+
+ /**
* Provide a list of revisions for the given event
*
* @param array $event Hash array with event properties