added EGroupware PRODID and DURATION for VTODO

This commit is contained in:
Ralf Becker 2011-10-05 09:24:08 +00:00
parent e05ce4d614
commit f1029c07c9
2 changed files with 19 additions and 6 deletions

View File

@ -72,7 +72,7 @@ class addressbook_vcal extends addressbook_bo
'X-ASSISTANT' => array('assistent'), 'X-ASSISTANT' => array('assistent'),
'X-ASSISTANT-TEL' => array('tel_assistent'), 'X-ASSISTANT-TEL' => array('tel_assistent'),
'UID' => array('uid'), 'UID' => array('uid'),
); );
/** /**
* VCard version * 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); #Horde::logMessage("vCalAddressbook clientProperties:\n" . print_r($this->clientProperties, true), __FILE__, __LINE__, PEAR_LOG_DEBUG);
$vCard = new Horde_iCalendar_vcard($this->version); $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(); $sysCharSet = $GLOBALS['egw']->translation->charset();
@ -795,7 +797,7 @@ class addressbook_vcal extends addressbook_bo
{ {
$finalRowNames['TEL;OTHER'] = $vcardKey; $finalRowNames['TEL;OTHER'] = $vcardKey;
} }
break; break;
case 'TEL;PAGER;WORK': case 'TEL;PAGER;WORK':
case 'TEL;PAGER;HOME': case 'TEL;PAGER;HOME':
if (!in_array('TEL;PAGER', $rowNames) if (!in_array('TEL;PAGER', $rowNames)
@ -803,7 +805,7 @@ class addressbook_vcal extends addressbook_bo
{ {
$finalRowNames['TEL;PAGER'] = $vcardKey; $finalRowNames['TEL;PAGER'] = $vcardKey;
} }
break; break;
case 'TEL;CAR;VOICE': case 'TEL;CAR;VOICE':
case 'TEL;CAR;CELL': case 'TEL;CAR;CELL':
case 'TEL;CAR;CELL;VOICE': case 'TEL;CAR;CELL;VOICE':
@ -966,7 +968,7 @@ class addressbook_vcal extends addressbook_bo
} }
$this->fixup_contact($contact); $this->fixup_contact($contact);
if ($this->log) if ($this->log)
{ {
error_log(__FILE__.'['.__LINE__.'] '.__METHOD__ . error_log(__FILE__.'['.__LINE__.'] '.__METHOD__ .

View File

@ -167,6 +167,8 @@ class infolog_ical extends infolog_bo
} }
$vcal = new Horde_iCalendar; $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); $vcal->setAttribute('VERSION',$_version);
if ($_method) $vcal->setAttribute('METHOD',$_method); if ($_method) $vcal->setAttribute('METHOD',$_method);
@ -573,7 +575,7 @@ class infolog_ical extends infolog_bo
{ {
$taskData['info_id'] = $_taskID; $taskData['info_id'] = $_taskID;
} }
foreach ($component->_attributes as $attribute) foreach ($component->getAllAttributes() as $attribute)
{ {
//$attribute['value'] = trim($attribute['value']); //$attribute['value'] = trim($attribute['value']);
if (!strlen($attribute['value'])) continue; 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']); $taskData['info_location'] = str_replace("\r\n", "\n", $attribute['value']);
break; break;
case 'DURATION':
if (!isset($taskData['info_startdate']))
{
$taskData['info_startdate'] = $component->getAttribute('DTSTART');
}
$attribute['value'] += $taskData['info_startdate'];
// fall throught
case 'DUE': case 'DUE':
// eGroupWare uses date only // eGroupWare uses date only
$parts = @getdate($attribute['value']); $parts = @getdate($attribute['value']);
@ -724,7 +733,9 @@ class infolog_ical extends infolog_bo
translation::charset(), $charset); translation::charset(), $charset);
} }
$vnote = new Horde_iCalendar_vnote(); $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'], foreach (array( 'SUMMARY' => $note['info_subject'],
'BODY' => $note['info_des'], 'BODY' => $note['info_des'],
'CATEGORIES' => $note['info_cat'], 'CATEGORIES' => $note['info_cat'],