mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-29 01:09:10 +01:00
SyncML fixes
This commit is contained in:
parent
31d02fcbf5
commit
fcbe2e5dd5
@ -56,6 +56,11 @@ class Horde_SyncML_Command_Sync_ContentSyncElement extends Horde_SyncML_Command_
|
|||||||
$this->_contentType = $c;
|
$this->_contentType = $c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setContentFormat($_format)
|
||||||
|
{
|
||||||
|
$this->_contentFormat = $_format;
|
||||||
|
}
|
||||||
|
|
||||||
function getContentType()
|
function getContentType()
|
||||||
{
|
{
|
||||||
return $this->_contentType;
|
return $this->_contentType;
|
||||||
@ -117,6 +122,14 @@ class Horde_SyncML_Command_Sync_ContentSyncElement extends Horde_SyncML_Command_
|
|||||||
$output->endElement($state->getURI(), 'Source');
|
$output->endElement($state->getURI(), 'Source');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isset($this->_contentFormat)) {
|
||||||
|
$output->startElement($state->getURI(), 'Meta', $attrs);
|
||||||
|
$output->startElement($state->getURIMeta(), 'Format', $attrs);
|
||||||
|
$output->characters($this->_contentFormat);
|
||||||
|
$output->endElement($state->getURIMeta(), 'Format');
|
||||||
|
$output->endElement($state->getURI(), 'Meta');
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->_targetURI != null) {
|
if ($this->_targetURI != null) {
|
||||||
$output->startElement($state->getURI(), 'Target', $attrs);
|
$output->startElement($state->getURI(), 'Target', $attrs);
|
||||||
$output->startElement($state->getURI(), 'LocURI', $attrs);
|
$output->startElement($state->getURI(), 'LocURI', $attrs);
|
||||||
|
@ -309,18 +309,25 @@ class EGW_SyncML_State extends Horde_SyncML_State
|
|||||||
|
|
||||||
$mapID = $this->_locName . $this->_sourceURI . $type;
|
$mapID = $this->_locName . $this->_sourceURI . $type;
|
||||||
|
|
||||||
|
// delete all client id's
|
||||||
|
$where = array(
|
||||||
|
'map_id' => $mapID,
|
||||||
|
'map_locuid' => $locid,
|
||||||
|
);
|
||||||
|
$db->delete('egw_contentmap', $where, __LINE__, __FILE__);
|
||||||
|
|
||||||
|
// delete all egw id's
|
||||||
$where = array(
|
$where = array(
|
||||||
'map_id' => $mapID,
|
'map_id' => $mapID,
|
||||||
'map_guid' => $guid,
|
'map_guid' => $guid,
|
||||||
);
|
);
|
||||||
|
$db->delete('egw_contentmap', $where, __LINE__, __FILE__);
|
||||||
|
|
||||||
$data = $where + array(
|
$data = $where + array(
|
||||||
'map_locuid' => $locid,
|
'map_locuid' => $locid,
|
||||||
'map_timestamp' => $ts,
|
'map_timestamp' => $ts,
|
||||||
'map_expired' => 0,
|
'map_expired' => 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
$db->delete('egw_contentmap', $where, __LINE__, __FILE__);
|
|
||||||
$db->insert('egw_contentmap', $data, $where, __LINE__, __FILE__);
|
$db->insert('egw_contentmap', $data, $where, __LINE__, __FILE__);
|
||||||
|
|
||||||
#Horde::logMessage("SyncML: setUID $type, $locid, $guid, $ts $mapID", __FILE__, __LINE__, PEAR_LOG_DEBUG);
|
#Horde::logMessage("SyncML: setUID $type, $locid, $guid, $ts $mapID", __FILE__, __LINE__, PEAR_LOG_DEBUG);
|
||||||
|
@ -73,6 +73,9 @@ class Horde_SyncML_Sync_SlowSync extends Horde_SyncML_Sync_TwoWaySync {
|
|||||||
// can happen.
|
// can happen.
|
||||||
#LK $cmd->setContent($state->convertServer2Client($c, $contentType));
|
#LK $cmd->setContent($state->convertServer2Client($c, $contentType));
|
||||||
$cmd->setContent($c);
|
$cmd->setContent($c);
|
||||||
|
if($hordeType == 'sifcalendar' || $hordeType == 'sifcontacts' || $hordeType == 'siftasks') {
|
||||||
|
$cmd->setContentFormat('b64');
|
||||||
|
}
|
||||||
$cmd->setContentType($contentType['ContentType']);
|
$cmd->setContentType($contentType['ContentType']);
|
||||||
$cmd->setSourceURI($guid);
|
$cmd->setSourceURI($guid);
|
||||||
$currentCmdID = $cmd->outputCommand($currentCmdID, $output, 'Add');
|
$currentCmdID = $cmd->outputCommand($currentCmdID, $output, 'Add');
|
||||||
|
@ -99,11 +99,14 @@ class Horde_SyncML_Sync_TwoWaySync extends Horde_SyncML_Sync {
|
|||||||
$cmd->setSourceURI($guid);
|
$cmd->setSourceURI($guid);
|
||||||
$cmd->setTargetURI($locid);
|
$cmd->setTargetURI($locid);
|
||||||
$cmd->setContentType($contentType['ContentType']);
|
$cmd->setContentType($contentType['ContentType']);
|
||||||
|
if($hordeType == 'sifcalendar' || $hordeType == 'sifcontacts' || $hordeType == 'siftasks') {
|
||||||
|
$cmd->setContentFormat('b64');
|
||||||
|
}
|
||||||
$currentCmdID = $cmd->outputCommand($currentCmdID, $output, 'Replace');
|
$currentCmdID = $cmd->outputCommand($currentCmdID, $output, 'Replace');
|
||||||
$state->log('Server-Replace');
|
$state->log('Server-Replace');
|
||||||
|
|
||||||
// return if we have to much data
|
// return if we have to much data
|
||||||
if(++$counter >= MAX_ENTRIES && $hordeType != 'sifcalender' && $hordeType != 'sifcontacts' &&$hordeType != 'siftasks') {
|
if(++$counter >= MAX_ENTRIES && $hordeType != 'sifcalendar' && $hordeType != 'sifcontacts' && $hordeType != 'siftasks') {
|
||||||
$state->setSyncStatus(SERVER_SYNC_DATA_PENDING);
|
$state->setSyncStatus(SERVER_SYNC_DATA_PENDING);
|
||||||
return $currentCmdID;
|
return $currentCmdID;
|
||||||
}
|
}
|
||||||
@ -194,13 +197,16 @@ class Horde_SyncML_Sync_TwoWaySync extends Horde_SyncML_Sync {
|
|||||||
if (!is_a($c, 'PEAR_Error')) {
|
if (!is_a($c, 'PEAR_Error')) {
|
||||||
// Item in history but not in database. Strange, but can happen.
|
// Item in history but not in database. Strange, but can happen.
|
||||||
$cmd->setContent($c);
|
$cmd->setContent($c);
|
||||||
|
if($hordeType == 'sifcalendar' || $hordeType == 'sifcontacts' || $hordeType == 'siftasks') {
|
||||||
|
$cmd->setContentFormat('b64');
|
||||||
|
}
|
||||||
$cmd->setContentType($contentType['ContentType']);
|
$cmd->setContentType($contentType['ContentType']);
|
||||||
$cmd->setSourceURI($guid);
|
$cmd->setSourceURI($guid);
|
||||||
$currentCmdID = $cmd->outputCommand($currentCmdID, $output, 'Add');
|
$currentCmdID = $cmd->outputCommand($currentCmdID, $output, 'Add');
|
||||||
$state->log('Server-Add');
|
$state->log('Server-Add');
|
||||||
|
|
||||||
// return if we have to much data
|
// return if we have to much data
|
||||||
if(++$counter >= MAX_ENTRIES && $hordeType != 'sifcalender' && $hordeType != 'sifcontacts' &&$hordeType != 'siftasks') {
|
if(++$counter >= MAX_ENTRIES && $hordeType != 'sifcalendar' && $hordeType != 'sifcontacts' &&$hordeType != 'siftasks') {
|
||||||
$state->setSyncStatus(SERVER_SYNC_DATA_PENDING);
|
$state->setSyncStatus(SERVER_SYNC_DATA_PENDING);
|
||||||
return $currentCmdID;
|
return $currentCmdID;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user