From 9f12c9aa65bf13fb61dffd52de75c953e0ee07f8 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 27 Aug 2018 13:29:22 +0200 Subject: [PATCH] Skip declined events in the agenda preview on iTip invitation (Bifrost#T81078) ... and style pending events with italic and lighter font. --- plugins/calendar/calendar.php | 13 +++++++++---- plugins/calendar/skins/larry/calendar.css | 5 +++++ .../libkolab/skins/elastic/include/calendar.less | 9 ++++++++- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php index 40976529..4b45cdb7 100644 --- a/plugins/calendar/calendar.php +++ b/plugins/calendar/calendar.php @@ -2662,11 +2662,16 @@ class calendar extends rcube_plugin $before = $after = array(); foreach ($events as $event) { - // TODO: skip events with free_busy == 'free' ? - if ($event['uid'] == $data['uid'] || $event['end'] < $day_start || $event['start'] > $day_end) + if ($event['uid'] == $data['uid'] + || $event['end'] < $day_start || $event['start'] > $day_end + || $event['status'] == 'CANCELLED' + || (!empty($event['className']) && strpos($event['className'], 'declined') !== false) + ) { continue; - else if ($event['start'] < $event_start) + } + + if ($event['start'] < $event_start) $before[] = $this->mail_agenda_event_row($event); else $after[] = $this->mail_agenda_event_row($event); @@ -2834,7 +2839,7 @@ class calendar extends rcube_plugin $this->rc->format_date($event['start'], $this->rc->config->get('time_format')) . ' - ' . $this->rc->format_date($event['end'], $this->rc->config->get('time_format')); - return html::div(rtrim('event-row ' . $class), + return html::div(rtrim('event-row ' . ($class ?: $event['className'])), html::span('event-date', $time) . html::span('event-title', rcube::Q($event['title'])) ); diff --git a/plugins/calendar/skins/larry/calendar.css b/plugins/calendar/skins/larry/calendar.css index 9ad25cbc..3a88258f 100644 --- a/plugins/calendar/skins/larry/calendar.css +++ b/plugins/calendar/skins/larry/calendar.css @@ -2238,6 +2238,11 @@ div.calendar-invitebox .calendar-agenda-preview .event-row.no-event { font-style: italic; } +div.calendar-invitebox .calendar-agenda-preview .event-row.fc-invitation-needs-action { + font-style: italic; + opacity: .5; +} + div.calendar-invitebox .calendar-agenda-preview .event-date { display: inline-block; min-width: 8em; diff --git a/plugins/libkolab/skins/elastic/include/calendar.less b/plugins/libkolab/skins/elastic/include/calendar.less index e0a62ac7..61246095 100644 --- a/plugins/libkolab/skins/elastic/include/calendar.less +++ b/plugins/libkolab/skins/elastic/include/calendar.less @@ -137,9 +137,16 @@ fieldset.categories .input-group { } &.no-event { - color: @color-black-shade-text; font-style: italic; } + + &.fc-invitation-needs-action { + color: @color-black-shade-text; + + .event-title { + font-style: italic; + } + } } .event-title {