phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] sync/inc/class.so_sync.inc.php, 1.38


From: nomail
Subject: [Phpgroupware-cvs] sync/inc/class.so_sync.inc.php, 1.38
Date: Sun, 23 May 2004 09:29:50 -0000

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

date: 2004/05/03 15:03:12;  author: mleonhardt;  state: Exp;  lines: +25 -12

Log Message:
- change to integer result in 3 routines
=====================================================================
Index: sync/inc/class.so_sync.inc.php
diff -u sync/inc/class.so_sync.inc.php:1.37 sync/inc/class.so_sync.inc.php:1.38
--- sync/inc/class.so_sync.inc.php:1.37 Mon May  3 13:23:12 2004
+++ sync/inc/class.so_sync.inc.php      Mon May  3 15:03:12 2004
@@ -696,26 +696,32 @@
     * Delete mapping referenced by mappingid
     *
     * @param integer mappingid (index of phpgw_syncmapping)
-    * @return boolean true if successfull, false in case of error  
+    * @return integer >= 0 if successfull, < 0 in case of error  
     */
 
     function DeleteMapping($mappingid)
     {
       $GLOBALS['phpgw']->db->query("DELETE FROM phpgw_syncmapping WHERE 
mappingid='$mappingid'",__LINE__,__FILE__);
-      return !($GLOBALS['phpgw']->db->Error);
+      if ($GLOBALS['phpgw']->db->Error) 
+        return -1;
+      else
+        return 0;
     }
 
    /**
     * Delete all mappings referenced by channelid 
     *
     * @param integer channelid
-    * @return boolean true if successfull, false in case of error  
+    * @return integer >= 0 if successfull, < 0 in case of error  
     */
 
     function DeleteMappings($channelid)
     {
       $GLOBALS['phpgw']->db->query("DELETE FROM phpgw_syncmapping WHERE 
channelid='$channelid'",__LINE__,__FILE__);
-      return !($GLOBALS['phpgw']->db->Error);
+      if ($GLOBALS['phpgw']->db->Error) 
+        return -1;
+      else
+        return 0;
     }
 
    /**
@@ -723,14 +729,17 @@
     *
     * @param integer $deviceid unique device ID for internal devices database
     * @param string $newdescription new description of the device
-    * @return boolean true if successfull, false in case of error  
+    * @return integer >= 0 if successfull, < 0 in case of error  
     */
 
     function setDeviceDescription($deviceid, $newdescription)
     {
       $GLOBALS['phpgw']->db->query("UPDATE phpgw_syncdevices SET 
description='$newdescription' " .
                              " WHERE deviceid='$deviceid'",__LINE__,__FILE__);
-      return !($GLOBALS['phpgw']->db->Error);
+      if ($GLOBALS['phpgw']->db->Error) 
+        return -1;
+      else
+        return 0;
     }
 
    /**
@@ -740,18 +749,22 @@
     *
     * @param integer $deviceid unique device ID for internal devices database
     * @param string $source Source name from device (e.g. 'contacts')
-    * @return boolean true if successfull, false in case of error  
+    * @return integer >= 0 if successfull, < 0 in case of error  
     */
 
     function resetChanneltoFullsync($deviceid, $source)
     {
-      $result = SetTimestamp($deviceid, $source, '', '', '');
+      $result = $this->SetTimestamp($deviceid, $source, '', '', '');
+      error_log($result);
       if ($result >= 0) 
       {
-        $result = GetChannelIDfromSourceAndDeviceID($deviceid, $source);
-        if ($result >= 0)
+        $channel = $this->GetChannelIDfromSourceAndDeviceID($deviceid, 
$source);
+        $result = $channel;
+      error_log($result);
+        if ($channel >= 0)
         {
-          $result = DeleteMappings($result);
+          $result = $this->DeleteMappings($channel);
+      error_log($result);
         }
       } 
       return $result; 




reply via email to

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