[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] sync/inc/class.so_sync.inc.php, 1.44
From: |
nomail |
Subject: |
[Phpgroupware-cvs] sync/inc/class.so_sync.inc.php, 1.44 |
Date: |
Sun, 6 Jun 2004 17:45:18 +0200 |
Update of /sync/inc
Modified Files:
Branch:
class.so_sync.inc.php
date: 2004/06/06 15:45:18; author: mleonhardt; state: Exp; lines: +39 -5
Log Message:
- Sourcelist for Admin
=====================================================================
Index: sync/inc/class.so_sync.inc.php
diff -u sync/inc/class.so_sync.inc.php:1.43 sync/inc/class.so_sync.inc.php:1.44
--- sync/inc/class.so_sync.inc.php:1.43 Tue Jun 1 14:25:30 2004
+++ sync/inc/class.so_sync.inc.php Sun Jun 6 15:45:18 2004
@@ -18,6 +18,12 @@
*/
class so_sync
{
+ /**
+ * @var boolean $debug enable debug-infos
+ * @access public
+ */
+ var $debug = true;
+
/******************************************************************/
/** functions for phpgw_syncdevices *******************************/
/******************************************************************/
@@ -286,17 +292,37 @@
*
* read from phpgw_syncsources
*
- * @return array of string (source URIs, e.g. 'notes', './contact')
+ * @param $talkative boolean optional parameter which requests more
deviceinformation fields
+ * @return array of string (source URIs, e.g. 'notes', './contact')
+ * or in case of $talkative == true return associative array with
uri, modulename
+ * and sourceid for each supported source
*
*/
- function getSupportedSources()
+ function getSupportedSources($talkative = false)
{
- $GLOBALS['phpgw']->db->query("SELECT uri FROM
phpgw_syncsources",__LINE__,__FILE__);
+ if ($talkative)
+ $talkativefields = ', modulename, sourceid';
+ else
+ $talkativefields = '';
+
+ $GLOBALS['phpgw']->db->query("SELECT uri $talkativefields FROM
phpgw_syncsources",__LINE__,__FILE__);
$result = array();
while ($GLOBALS['phpgw']->db->next_record())
- array_push($result, $GLOBALS['phpgw']->db->f('uri'));
+ {
+ if ($talkative)
+ {
+ array_push($result,
+ array('sourceid'=>$GLOBALS['phpgw']->db->f('sourceid'),
+ 'uri'=>$GLOBALS['phpgw']->db->f('uri'),
+ 'modulename'=>$GLOBALS['phpgw']->db->f('modulename')
+ )
+ );
+ }
+ else
+ array_push($result, $GLOBALS['phpgw']->db->f('uri'));
+ }
return $result;
}
@@ -400,9 +426,15 @@
{
$GLOBALS['phpgw']->db->query("SELECT channelid FROM phpgw_syncsources,
phpgw_syncchannels WHERE phpgw_syncsources.uri='".$source."' and
phpgw_syncchannels.deviceid='".$deviceid."' and phpgw_syncchannels.sourceid =
phpgw_syncsources.sourceid",__LINE__,__FILE__);
+ if ($debug)
+ error_log("setTimestamp for deviceid $deviceid and source $source");
+
if ($GLOBALS['phpgw']->db->next_record())
{
$channelid = $GLOBALS['phpgw']->db->f('channelid');
+ if ($debug)
+ error_log("channelid = $channelid");
+
$GLOBALS['phpgw']->db->query("UPDATE phpgw_syncchannels SET
lastanchor='$lastanchor', "
. " startsync='$startsync', stopsync='$stopsync' WHERE
channelid='$channelid'",__LINE__,__FILE__);
return $channelid;
@@ -795,7 +827,9 @@
function resetChanneltoFullsync($deviceid, $source)
{
$result = $this->SetTimestamp($deviceid, $source, '', '', '');
- error_log($result);
+ if ($this->debug)
+ error_log("reset Timestamp for Channel deviceid $deviceid source
$source returned $result");
+
if ($result >= 0)
{
$channel = $this->GetChannelIDfromSourceAndDeviceID($deviceid,
$source);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] sync/inc/class.so_sync.inc.php, 1.44,
nomail <=