storing unsupported (valarm-)components like unsupported (X-)properties

This commit is contained in:
Ralf Becker 2012-01-31 01:02:21 +00:00
parent 1f93855172
commit c3cadea4f4
2 changed files with 34 additions and 6 deletions

View File

@ -77,13 +77,16 @@ class historylog_widget
$options = implode(',',array($rows,$type1,$type2,$type3,$type4,$type5,$type6));
}
$cell = etemplate::empty_cell($type,$cell['name'],array('readonly' => true,'size' => $options));
// display unsupported iCal properties, which have multiple values or attributes
if ($type === 'label' && $value[1] === ':' && ($v = unserialize($value)))
// display unsupported iCal properties, which have multiple values or attributes, or multiple components
if ($type === 'label' && $value[1] === ':' && ($values = unserialize($value)))
{
$values = $v['values'];
foreach((array)$v['params'] as $name => $val)
if (isset($values['values']))
{
$values[] = $name.': '.$val;
foreach((array)$values['params'] as $name => $val)
{
$values['values'][] = $name.': '.$val;
}
$values = $values['values'];
}
$value = implode("\n", $values);
}

View File

@ -334,7 +334,17 @@ class infolog_ical extends infolog_bo
{
if (substr($name, 0, 2) == '##')
{
if ($value[1] == ':' && ($attr = unserialize($value)) !== false)
if ($name[2] == ':')
{
if ($value[1] == ':' && ($v = unserialize($value)) !== false) $value = $v;
foreach((array)$value as $compvData)
{
$comp = Horde_iCalendar::newComponent(substr($name,3), $vevent);
$comp->parsevCalendar($compvData,substr($name,3),'utf-8');
$vevent->addComponent($comp);
}
}
elseif ($value[1] == ':' && ($attr = unserialize($value)) !== false)
{
$vevent->setAttribute(substr($name, 2), $attr['value'], $attr['params'], true, $attr['values']);
}
@ -726,6 +736,21 @@ class infolog_ical extends infolog_bo
}
break;
}
// store included, but unsupported components like valarm as x-properties
foreach($component->getComponents() as $comp)
{
$name = '##:'.strtoupper($comp->getType());
$compvData = $comp->exportvCalendar($comp,'utf-8');
if (isset($taskData[$name]))
{
$taskData[$name] = array($taskData[$name]);
$taskData[$name][] = $compvData;
}
else
{
$taskData[$name] = $compvData;
}
}
if ($this->log)
{
error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."($_taskID)\n" .