From 7251eee8b892f1ae9f6d1a5a9561165ee6bc014e Mon Sep 17 00:00:00 2001 From: Lars Kneschke Date: Thu, 24 Aug 2006 09:46:46 +0000 Subject: [PATCH] patch from christian binder class.boical.inc.php 285: handle exceptions field on export (delimiter changed to ";") 295: handle TRANSP value (0 or 1) on export 554: handle exceptions field on import 568: handle TRANSP value (0 or 1) on import 774-777: set supported fields for recur_exceptions and non_blocking added support for handling non blocking events for vcal(1.0) and ical(2.0) --- calendar/inc/class.boical.inc.php | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/calendar/inc/class.boical.inc.php b/calendar/inc/class.boical.inc.php index 4a7ed12c32..6518819a78 100644 --- a/calendar/inc/class.boical.inc.php +++ b/calendar/inc/class.boical.inc.php @@ -282,7 +282,7 @@ { $days[] = date('Ymd',$day); } - $attributes['EXDATE'] = implode(',',$days); + $attributes['EXDATE'] = implode(';',$days); $parameters['EXDATE']['VALUE'] = 'DATE'; } break; @@ -292,7 +292,11 @@ break; case 'TRANSP': - $attributes['TRANSP'] = $event['non_blocking'] ? 'TRANSPARENT' : 'OPAQUE'; + if ($version == '1.0') { + $attributes['TRANSP'] = $event['non_blocking'] ? 1 : 0; + } else { + $attributes['TRANSP'] = $event['non_blocking'] ? 'TRANSPARENT' : 'OPAQUE'; + } break; case 'CATEGORIES': @@ -361,11 +365,13 @@ $_vcalData = preg_replace("/[\r\n]+ /",'',$_vcalData); $vcal = &new Horde_iCalendar; - if(!$vcal->parsevCalendar($_vcalData)) + if(!$vcal->parsevCalendar($_vcalData)) { return FALSE; } + $version = $vcal->getAttribute('VERSION'); + if(!is_array($this->supportedFields)) { $this->setSupportedFields(); @@ -551,7 +557,7 @@ } break; case 'EXDATE': - // ToDo: $vcardData['recur_exception'] = ... + $vcardData['recur_exception'] = $attributes['value']; break; case 'SUMMARY': $vcardData['title'] = $attributes['value']; @@ -565,7 +571,11 @@ } break; case 'TRANSP': - $vcardData['non_blocking'] = $attributes['value'] == 'TRANSPARENT'; + if($version = '1.0') { + $vcardData['non_blocking'] = $attributes['value'] == 1; + } else { + $vcardData['non_blocking'] = $attributes['value'] == 'TRANSPARENT'; + } break; case 'PRIORITY': $vcardData['priority'] = (int) $this->priority_ical2egw[$attributes['value']]; @@ -771,7 +781,10 @@ switch(strtolower($_productName)) { default: - $this->supportedFields = $defaultFields; + $this->supportedFields = $defaultFields + array( + 'recur_exception' => 'recur_exception', + 'non_blocking' => 'non_blocking', + ); break; } break; @@ -941,7 +954,7 @@ } break; case 'EXDATE': - // ToDo: $vcardData['recur_exception'] = ... + $vcardData['recur_exception'] = $attributes['value']; break; case 'SUMMARY': $vcardData['title'] = $attributes['value'];