[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] syncml/inc class.syncml_database.inc.php
From: |
Johan Gunnarsson |
Subject: |
[Phpgroupware-cvs] syncml/inc class.syncml_database.inc.php |
Date: |
Fri, 17 Aug 2007 09:45:37 +0000 |
CVSROOT: /sources/phpgroupware
Module name: syncml
Changes by: Johan Gunnarsson <johang> 07/08/17 09:45:37
Modified files:
inc : class.syncml_database.inc.php
Log message:
Minor clean-up.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/syncml/inc/class.syncml_database.inc.php?cvsroot=phpgroupware&r1=1.2&r2=1.3
Patches:
Index: class.syncml_database.inc.php
===================================================================
RCS file: /sources/phpgroupware/syncml/inc/class.syncml_database.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- class.syncml_database.inc.php 5 Aug 2007 17:15:40 -0000 1.2
+++ class.syncml_database.inc.php 17 Aug 2007 09:45:37 -0000 1.3
@@ -7,7 +7,7 @@
* @copyright Copyright (c) 2007 Free Software Foundation, Inc.
* @license GNU General Public License 3 or later
* @package syncml
- * @version $Id: class.syncml_database.inc.php,v 1.2 2007/08/05
17:15:40 johang Exp $
+ * @version $Id: class.syncml_database.inc.php,v 1.3 2007/08/17
09:45:37 johang Exp $
*/
require_once 'inc/class.somappings.inc.php';
@@ -172,16 +172,17 @@
*/
function add_item($luid, $data, $type, $override = FALSE)
{
- $h = $this->replace_item($luid, $data, $type,
$override);
+ list($status_code, $guid) =
+ $this->replace_item($luid, $data, $type,
$override);
- switch($h[0])
+ switch($status_code)
{
case SYNCML_STATUS_OK:
case SYNCML_STATUS_ITEMADDED:
- return array(SYNCML_STATUS_ITEMADDED,
$h[1]);
+ return array(SYNCML_STATUS_ITEMADDED,
$guid);
case
SYNCML_STATUS_CONFLICTRESOLVEDWITHDUPLICATE:
return array(
-
SYNCML_STATUS_CONFLICTRESOLVEDWITHDUPLICATE, $h[1]);
+
SYNCML_STATUS_CONFLICTRESOLVEDWITHDUPLICATE, $guid);
}
}
@@ -199,22 +200,12 @@
$mappings = $this->somappings->get_mapping(
$this->channel_id, $luid, NULL, NULL);
- if(count($mappings) == 0)
- {
- $dirty = NULL;
- $guid = NULL;
- }
- else
+ if(count($mappings) > 0)
{
list(list(,, $guid, $dirty)) = $mappings;
}
- if($override)
- {
- $dirty = NULL;
- }
-
- if($dirty)
+ if(!$override && $dirty)
{
$new_guid = $this->ipc->adddata($data, $type);
@@ -230,7 +221,7 @@
return
array(SYNCML_STATUS_CONFLICTRESOLVEDWITHDUPLICATE,
$guid);
}
- else if($guid)
+ else if(count($mappings) > 0)
{
$this->ipc->replacedata($guid, $data, $type);
- [Phpgroupware-cvs] syncml/inc class.syncml_database.inc.php,
Johan Gunnarsson <=