From f1029c07c97fe218c927d09397284666e381d9f2 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 5 Oct 2011 09:24:08 +0000 Subject: [PATCH] added EGroupware PRODID and DURATION for VTODO --- addressbook/inc/class.addressbook_vcal.inc.php | 10 ++++++---- infolog/inc/class.infolog_ical.inc.php | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/addressbook/inc/class.addressbook_vcal.inc.php b/addressbook/inc/class.addressbook_vcal.inc.php index 3de0f5f8f8..511561a00e 100644 --- a/addressbook/inc/class.addressbook_vcal.inc.php +++ b/addressbook/inc/class.addressbook_vcal.inc.php @@ -72,7 +72,7 @@ class addressbook_vcal extends addressbook_bo 'X-ASSISTANT' => array('assistent'), 'X-ASSISTANT-TEL' => array('tel_assistent'), 'UID' => array('uid'), - ); + ); /** * VCard version @@ -203,6 +203,8 @@ class addressbook_vcal extends addressbook_bo #Horde::logMessage("vCalAddressbook clientProperties:\n" . print_r($this->clientProperties, true), __FILE__, __LINE__, PEAR_LOG_DEBUG); $vCard = new Horde_iCalendar_vcard($this->version); + $vCard->setAttribute('PRODID','-//EGroupware//NONSGML EGroupware Addressbook '.$GLOBALS['egw_info']['apps']['addressbook']['version'].'//'. + strtoupper($GLOBALS['egw_info']['user']['preferences']['common']['lang'])); $sysCharSet = $GLOBALS['egw']->translation->charset(); @@ -795,7 +797,7 @@ class addressbook_vcal extends addressbook_bo { $finalRowNames['TEL;OTHER'] = $vcardKey; } - break; + break; case 'TEL;PAGER;WORK': case 'TEL;PAGER;HOME': if (!in_array('TEL;PAGER', $rowNames) @@ -803,7 +805,7 @@ class addressbook_vcal extends addressbook_bo { $finalRowNames['TEL;PAGER'] = $vcardKey; } - break; + break; case 'TEL;CAR;VOICE': case 'TEL;CAR;CELL': case 'TEL;CAR;CELL;VOICE': @@ -966,7 +968,7 @@ class addressbook_vcal extends addressbook_bo } $this->fixup_contact($contact); - + if ($this->log) { error_log(__FILE__.'['.__LINE__.'] '.__METHOD__ . diff --git a/infolog/inc/class.infolog_ical.inc.php b/infolog/inc/class.infolog_ical.inc.php index f2961fd1a0..270efe8844 100644 --- a/infolog/inc/class.infolog_ical.inc.php +++ b/infolog/inc/class.infolog_ical.inc.php @@ -167,6 +167,8 @@ class infolog_ical extends infolog_bo } $vcal = new Horde_iCalendar; + $vcal->setAttribute('PRODID','-//EGroupware//NONSGML EGroupware InfoLog '.$GLOBALS['egw_info']['apps']['infolog']['version'].'//'. + strtoupper($GLOBALS['egw_info']['user']['preferences']['common']['lang'])); $vcal->setAttribute('VERSION',$_version); if ($_method) $vcal->setAttribute('METHOD',$_method); @@ -573,7 +575,7 @@ class infolog_ical extends infolog_bo { $taskData['info_id'] = $_taskID; } - foreach ($component->_attributes as $attribute) + foreach ($component->getAllAttributes() as $attribute) { //$attribute['value'] = trim($attribute['value']); if (!strlen($attribute['value'])) continue; @@ -611,6 +613,13 @@ class infolog_ical extends infolog_bo $taskData['info_location'] = str_replace("\r\n", "\n", $attribute['value']); break; + case 'DURATION': + if (!isset($taskData['info_startdate'])) + { + $taskData['info_startdate'] = $component->getAttribute('DTSTART'); + } + $attribute['value'] += $taskData['info_startdate']; + // fall throught case 'DUE': // eGroupWare uses date only $parts = @getdate($attribute['value']); @@ -724,7 +733,9 @@ class infolog_ical extends infolog_bo translation::charset(), $charset); } $vnote = new Horde_iCalendar_vnote(); - $vNote->setAttribute('VERSION', '1.1'); + $vnote->setAttribute('PRODID','-//EGroupware//NONSGML EGroupware InfoLog '.$GLOBALS['egw_info']['apps']['infolog']['version'].'//'. + strtoupper($GLOBALS['egw_info']['user']['preferences']['common']['lang'])); + $vnote->setAttribute('VERSION', '1.1'); foreach (array( 'SUMMARY' => $note['info_subject'], 'BODY' => $note['info_des'], 'CATEGORIES' => $note['info_cat'],