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.54


From: nomail
Subject: [Phpgroupware-cvs] sync/inc/class.bo_sync.inc.php, 1.54
Date: Thu, 1 Jul 2004 10:46:44 +0200

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

date: 2004/07/01 08:46:44;  author: mleonhardt;  state: Exp;  lines: +48 -1

Log Message:
- handful new functions for conflict-view in UI
=====================================================================
Index: sync/inc/class.bo_sync.inc.php
diff -u sync/inc/class.bo_sync.inc.php:1.53 sync/inc/class.bo_sync.inc.php:1.54
--- sync/inc/class.bo_sync.inc.php:1.53 Wed Jun 30 09:41:07 2004
+++ sync/inc/class.bo_sync.inc.php      Thu Jul  1 08:46:44 2004
@@ -625,6 +625,53 @@
       else
         return $devinfo["uri"];       
     }    
+    
+   /**
+    * create an array of two conflictitems - each field with its 
+    * representation in the other data entry
+    *
+    * @param string $source Source-URI of the source to sync
+    * @param string $LUID - the Items Unique Identifier ID (also called key)
+    * @param mixed $ldata data of the Entry on which a conflict occured
+    * @return string array 
+    */
+    
+    function getConflictArray($deviceid, $source, $LUID, $ldata) {
+                       $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;
+                       }     
+     
+                       $GUID = $this->so->getGUIDExt($deviceid, $source, 
$LUID);
+                       $conflictmimetype = 'x-phpgroupware/' . $modulename . 
'-show-data-array'; 
+
+                       $gdata = $this->ipc->getdata($GUID, $conflictmimetype);
+                       $ldata = $this->ipc->convertdata(base64_decode($ldata), 
'text/vcard', '3.0', $conflictmimetype, '');
+//                     $ldata = unserialize(base64_decode($ldata));
+                       
+                       $result = array();
+      foreach($gdata as $gdata_array)
+      {
+       $fieldentry = array();
+       foreach($gdata_array as $gkey => $gvalue)
+       {
+                                       $fieldentry["$gkey"] = $gvalue;
+                                       // find the corresponding fieldvalue of 
the second entry
+                                       foreach($ldata as $ldata_array)
+                                       {
+                                                  if 
($ldata_array["fieldName"] == $fieldentry["fieldName"])
+                                                    
$fieldentry["displayValue2"] = $ldata_array["displayValue"];
+                                       }
+       }
+               $result[] = $fieldentry;
+      }
+      if ($this->debug)
+       error_log("getConflictArray: " . serialize($result));
+
+      return $result;
+    }
      
   /**
    * Convert and save conflict data




reply via email to

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