From 23df97648daf74194277d35a8fed825916f7d0f9 Mon Sep 17 00:00:00 2001 From: Lars Kneschke Date: Mon, 27 Mar 2006 23:24:17 +0000 Subject: [PATCH] various bugfixes --- phpgwapi/inc/horde/Horde/SyncML/Command/Sync.php | 1 + phpgwapi/inc/horde/Horde/SyncML/State.php | 14 +++++--------- phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php | 5 ++++- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/phpgwapi/inc/horde/Horde/SyncML/Command/Sync.php b/phpgwapi/inc/horde/Horde/SyncML/Command/Sync.php index addcd4c199..7ebd3e50a4 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Command/Sync.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Command/Sync.php @@ -51,6 +51,7 @@ class Horde_SyncML_Command_Sync extends Horde_Syncml_Command { $currentCmdID = $status->output($currentCmdID, $output); if($sync = $state->getSync($this->_targetURI)) { + Horde::logMessage('SyncML: starting from client for $this->_targetURI = ' . $this->_targetURI, __FILE__, __LINE__, PEAR_LOG_DEBUG); $currentCmdID = $sync->startSync($currentCmdID, $output); foreach ($this->_syncElements as $element) { diff --git a/phpgwapi/inc/horde/Horde/SyncML/State.php b/phpgwapi/inc/horde/Horde/SyncML/State.php index 4921e16393..9f5c097320 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/State.php +++ b/phpgwapi/inc/horde/Horde/SyncML/State.php @@ -630,20 +630,16 @@ class Horde_SyncML_State { */ function getPreferedContentType($type) { -# if ($type == 'contacts') { -# return 'text/x-vcard'; -# } elseif ($type == 'notes') { -# return 'text/x-vnote'; -# } elseif ($type == 'tasks') { -# return 'text/x-vcalendar'; -# } elseif ($type == 'calendar') { -# return 'text/x-vcalendar'; -# } switch($type) { case 'contacts': return 'text/x-vcard'; break; + case 'sifcalendar': + case './sifcalendar': + return 'text/x-s4j-sife'; + break; + case 'sifcontacts': case './sifcontacts': return 'text/x-s4j-sifc'; diff --git a/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php b/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php index 2a6bdd1c1e..e6b36e1c26 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php @@ -99,7 +99,7 @@ class Horde_SyncML_Sync_SlowSync extends Horde_SyncML_Sync_TwoWaySync { * from the server database by using Horde API (Registry) calls. */ function runSyncCommand(&$command) { - #Horde::logMessage('SyncML: content type is ' . $command->getContentType() .' moreData '. $command->_moreData, __FILE__, __LINE__, PEAR_LOG_DEBUG); + Horde::logMessage('SyncML: content type is ' . $command->getContentType() .' moreData '. $command->_moreData, __FILE__, __LINE__, PEAR_LOG_DEBUG); global $registry; $history = $GLOBALS['egw']->contenthistory; @@ -153,6 +153,7 @@ class Horde_SyncML_Sync_SlowSync extends Horde_SyncML_Sync_TwoWaySync { $hordeType = str_replace('./','',$hordeType); $syncElementItems = $command->getSyncElementItems(); + Horde::logMessage('SyncML: found '. count($syncElementItems) .' items to import', __FILE__, __LINE__, PEAR_LOG_DEBUG); foreach($syncElementItems as $syncItem) { if(!$contentType = $syncItem->getContentType()) { @@ -178,8 +179,10 @@ class Horde_SyncML_Sync_SlowSync extends Horde_SyncML_Sync_TwoWaySync { # } # } elseif (is_a($command, 'Horde_SyncML_Command_Sync_Replace')) { #$guid = $state->getGlobalUID($type, $syncItem->getLocURI()); + Horde::logMessage('SyncML: start search for '. $syncItem->getContent() .' ('. $contentType .')' , __FILE__, __LINE__, PEAR_LOG_DEBUG); $guid = $registry->call($hordeType . '/search', array($state->convertClient2Server($syncItem->getContent(), $contentType), $contentType)); + Horde::logMessage('SyncML: found guid: '. ($guid ? $guid : 'not found') , __FILE__, __LINE__, PEAR_LOG_DEBUG); $ok = false; if ($guid) { #Horde::logMessage('SyncML: locuri'. $syncItem->getLocURI() . ' guid ' . $guid , __FILE__, __LINE__, PEAR_LOG_ERR);