phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] sync/inc/class.bo_sync.inc.php, 1.56


From: nomail
Subject: [Phpgroupware-cvs] sync/inc/class.bo_sync.inc.php, 1.56
Date: Wed, 7 Jul 2004 13:14:58 +0200

Update of /sync/inc
Modified Files:
        Branch: 
          class.bo_sync.inc.php

date: 2004/07/07 11:14:58;  author: mleonhardt;  state: Exp;  lines: +19 -9

Log Message:
- bugfixes for ConvertAndAddConfict and SaveSolvedConflict
- conflicthandling with nothing (phpgw solves) now working
=====================================================================
Index: sync/inc/class.bo_sync.inc.php
diff -u sync/inc/class.bo_sync.inc.php:1.55 sync/inc/class.bo_sync.inc.php:1.56
--- sync/inc/class.bo_sync.inc.php:1.55 Tue Jul  6 10:11:40 2004
+++ sync/inc/class.bo_sync.inc.php      Wed Jul  7 11:14:58 2004
@@ -689,21 +689,31 @@
    function ConvertAndAddConfict($deviceid, $source, $LUID, $LData)
    {
      // get the responsible IPC class
-     $this->GetIpcforSource($source);
+     $modulename = $this->GetIpcforSource($source);
      if (!isset($this->ipc) or ($this->ipc == false)) 
      {
        error_log("Sync Module: Error: There is no source called '$source'. Can 
not synchronize");
        return -1;
      }     
      
-     $mimetype = 
$session_data['sync_currentsourceinfo']['contentType.RX.type'];
-     $mimeversion = 
$session_data['sync_currentsourceinfo']['contentType.RX.version'];
-     $typeOut = "x-phpgroupware/$source-appl-data-array";
+        $session_data = 
$GLOBALS['phpgw']->session->appsession('session_data','sync');
+     if (isset($session_data))
+     {
+       $mimetype = 
$session_data['sync_currentsourceinfo']['contentType.RX.type'];
+       $mimeversion = 
$session_data['sync_currentsourceinfo']['contentType.RX.version'];
+     }
+     else 
+     {
+        error_log("error getting mimetype and version while getting data from 
source $source");
+       return -1;
+     }
+
+     $typeOut = "x-phpgroupware/$modulename-appl-data-array";
     
-     $data = $this->ipc->convertData($LData, $mimetype, $mimeversion, 
$typeOut, '1.0');
-     if (!isarray($data)) 
+     $data = $this->ipc->convertData(base64_decode($LData), $mimetype, 
$mimeversion, $typeOut, '1.0');
+     if (!is_array($data)) 
      {
-       error_log("Error: Could not convert data $deviceid $source $LUID 
".serialize($LData));
+       error_log("Error: Could not convert data $deviceid $source $LUID 
mime[$mimetype] version[$mimeversion] data: ".serialize($LData));
        return -1;  
      }
      $data = base64_encode(serialize($data));
@@ -754,7 +764,7 @@
                        {
        //                      $ldata = 
$this->ipc->convertdata(base64_decode($ldata), 'text/vcard', '3.0', 
$conflictmimetype, '');
                                $ldata = unserialize(base64_decode($ldata));
-                               $result = $this->replaceData($GUID, $ldata, 
$conflictmimetype, '', time());
+                               $result = $this->ipc->replaceData($GUID, 
$ldata, $conflictmimetype, '', time());
                        }
        
        if ($result >= -1)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]