From 43190660a4308482498bc3399e270b141f379e15 Mon Sep 17 00:00:00 2001 From: Christian Binder Date: Tue, 29 Dec 2009 13:51:07 +0000 Subject: [PATCH] implemented different priority values for funambol/outlook clients since outlook does not support the RFC defined PRIORITY values, fixed some typos --- calendar/inc/class.calendar_ical.inc.php | 41 +++++++++++++++++++++--- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index 1710f006a3..a82747ca2f 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -54,7 +54,7 @@ class calendar_ical extends calendar_boupdate ); /** - * @var array $status_ical2egw conversion of the priority egw => ical + * @var array $priority_egw2ical conversion of the priority egw => ical */ var $priority_egw2ical = array( 0 => 0, // undefined @@ -64,7 +64,7 @@ class calendar_ical extends calendar_boupdate ); /** - * @var array $status_ical2egw conversion of the priority ical => egw + * @var array $priority_ical2egw conversion of the priority ical => egw */ var $priority_ical2egw = array( 0 => 0, // undefined @@ -72,6 +72,25 @@ class calendar_ical extends calendar_boupdate 5 => 2, // normal 4 => 3, 3 => 3, 2 => 3, 1 => 3, // high ); + + /** + * @var array $priority_egw2funambol conversion of the priority egw => funambol + */ + var $priority_egw2funambol = array( + 0 => 1, // undefined (mapped to normal since undefined does not exist) + 1 => 0, // low + 2 => 1, // normal + 3 => 2, // high + ); + + /** + * @var array $priority_funambol2egw conversion of the priority funambol => egw + */ + var $priority_funambol2egw = array( + 0 => 1, // low + 1 => 2, // normal + 2 => 3, // high + ); /** * manufacturer and name of the sync-client @@ -474,7 +493,14 @@ class calendar_ical extends calendar_boupdate break; case 'PRIORITY': - $attributes['PRIORITY'] = (int) $this->priority_egw2ical[$event['priority']]; + if($this->productManufacturer == 'funambol') + { + $attributes['PRIORITY'] = (int) $this->priority_egw2funambol[$event['priority']]; + } + else + { + $attributes['PRIORITY'] = (int) $this->priority_egw2ical[$event['priority']]; + } break; case 'TRANSP': @@ -1843,7 +1869,14 @@ class calendar_ical extends calendar_boupdate } break; case 'PRIORITY': - $vcardData['priority'] = (int) $this->priority_ical2egw[$attributes['value']]; + if($this->productManufacturer == 'funambol') + { + $vcardData['priority'] = (int) $this->priority_funambol2egw[$attributes['value']]; + } + else + { + $vcardData['priority'] = (int) $this->priority_ical2egw[$attributes['value']]; + } break; case 'CATEGORIES': if ($attributes['value'])