From 02b6d470826afa4d555efe48dd853712e9777bba Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sun, 30 Oct 2011 16:05:14 +1300 Subject: [PATCH] Add the $c->hide_alarms functionality into DAVResource class. --- inc/DAVResource.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/inc/DAVResource.php b/inc/DAVResource.php index 486ed5f1..eb196b66 100644 --- a/inc/DAVResource.php +++ b/inc/DAVResource.php @@ -283,6 +283,17 @@ class DAVResource $this->resource->location = null; $this->resource->url = null; } + else if ( isset($c->hide_alarms) && $c->hide_alarms && !$this->HavePrivilegeTo('write') ) { + $vcal1 = new iCalComponent($this->resource->caldav_data); + $comps = $vcal1->GetComponents(); + $vcal2 = new iCalComponent(); + $vcal2->VCalendar(); + foreach( $comps AS $comp ) { + $comp->ClearComponents('VALARM'); + $vcal2->AddComponent($comp); + } + $this->resource->caldav_data = $vcal2->Render(); + } } else if ( strtoupper(substr($this->resource->caldav_data,0,11)) == 'BEGIN:VCARD' ) { $this->contenttype = 'text/vcard';