If data is already a Horde_iCalendar object, use it instead of creating a new one

This commit is contained in:
Nathan Gray 2012-09-18 15:06:19 +00:00
parent 65bf21742a
commit 67289c346b

View File

@ -553,6 +553,8 @@ class addressbook_vcal extends addressbook_bo
require_once(EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar.php'); require_once(EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar.php');
if(!($_vcard instanceof Horde_iCalendar))
{
$container = false; $container = false;
$vCard = Horde_iCalendar::newComponent('vcard', $container); $vCard = Horde_iCalendar::newComponent('vcard', $container);
@ -560,6 +562,9 @@ class addressbook_vcal extends addressbook_bo
{ {
return False; return False;
} }
} else {
$vCard = $_vcard;
}
$vcardValues = $vCard->getAllAttributes(); $vcardValues = $vCard->getAllAttributes();
if (!empty($GLOBALS['egw_info']['user']['preferences']['syncml']['minimum_uid_length'])) if (!empty($GLOBALS['egw_info']['user']['preferences']['syncml']['minimum_uid_length']))