R26307 - in /trunk: addressbook/ addressbook/inc/ calendar/inc/ icalsrv/inc/ infolog/inc/ phpgwapi/inc/ phpgwapi/inc/horde/H

Author: ralfbecker
New Revision: 26307

URL: http://www.egroupware.org/viewvc?rev=3D26307&view=3Drev
Log:
Big patch from Philip Herbert (Knauber) modifying the SyncML code to no
longer use GUIDs containing eGW’s install_id, as the information is
irrellevant for SyncML and cause doublications of entries if the
install_id changes.
I plan to have a new rc4 Wednesday or Thursday containing these changes.

Modified:
trunk/addressbook/csv_import.php
trunk/addressbook/inc/class.addressbook_vcal.inc.php
trunk/calendar/inc/class.calendar_ical.inc.php
trunk/icalsrv/inc/class.eicnvutils.inc.php
trunk/infolog/inc/class.infolog_ical.inc.php
trunk/infolog/inc/class.infolog_sif.inc.php
trunk/phpgwapi/inc/class.contenthistory.inc.php
trunk/phpgwapi/inc/horde/Horde/SyncML/State.php
trunk/phpgwapi/inc/horde/Horde/SyncML/State_egw.php
trunk/phpgwapi/inc/horde/Horde/SyncML/Sync.php
trunk/phpgwapi/inc/horde/Horde/SyncML/Sync/RefreshFromServerSync.php
trunk/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php
trunk/phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php
trunk/phpgwapi/setup/setup.inc.php
trunk/phpgwapi/setup/tables_current.inc.php
trunk/phpgwapi/setup/tables_update.inc.php
trunk/syncml/calendar/lib/api.php
trunk/syncml/caltasks/lib/api.php
trunk/syncml/contacts/lib/api.php
trunk/syncml/notes/lib/api.php
trunk/syncml/setup/setup.inc.php
trunk/syncml/setup/tables_update.inc.php
trunk/syncml/tasks/lib/api.php

Modified: trunk/addressbook/csv_import.php
URL: http://www.egroupware.org/viewvc/trunk/addressbook/csv_import.php?rev=
=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/addressbook/csv_import.php (original)
+++ trunk/addressbook/csv_import.php Mon Nov 3 08:44:02 2008
@@ -243,7 +243,8 @@
‘trans’ =3D> $_POST[‘trans’]
));
@set_time_limit(0);

  •   $fp=3Dfopen($csvfile,'rb');
    
  •   ini_set('auto_detect_line_endings',true);	// to allow to import files cr=
    

eated eg. on a mac

  •   $fp=3Dfopen($csvfile,'r');
      $csv_fields =3D fgetcsv($fp,8000,$_POST['fieldsep']);
      $csv_fields =3D $GLOBALS['egw']->translation->convert($csv_fields,$_POST=
    

[‘charset’]);
$csv_fields[] =3D ‘no CSV 1’; // eg. for static assignments

Modified: trunk/addressbook/inc/class.addressbook_vcal.inc.php
URL: http://www.egroupware.org/viewvc/trunk/addressbook/inc/class.addressbo=
ok_vcal.inc.php?rev=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/addressbook/inc/class.addressbook_vcal.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_vcal.inc.php Mon Nov 3 08:44:0=
2 2008
@@ -421,9 +421,9 @@
));

	$defaultFields[9] =3D array(	// nokia e90
  •   	'ADR;WORK'	=3D> array('','','adr_one_street','adr_one_locality','adr_on=
    

e_region’,

  •   	'ADR;WORK'	=3D> array('','adr_one_street2','adr_one_street','adr_one_lo=
    

cality’,‘adr_one_region’,
‘adr_one_postalcode’,‘adr_one_countryname’),

  •   	'ADR;HOME'	=3D> array('','','adr_two_street','adr_two_locality','adr_tw=
    

o_region’,

  •   	'ADR;HOME'	=3D> array('','adr_two_street2','adr_two_street','adr_two_lo=
    

cality’,‘adr_two_region’,
‘adr_two_postalcode’,‘adr_two_countryname’),
‘BDAY’ =3D> array(‘bday’),
‘X-CLASS’ =3D> array(‘private’),
@@ -441,7 +441,7 @@
‘TEL;PAGER;WORK’ =3D> array(‘tel_pager’),
‘TEL;VOICE;WORK’ =3D> array(‘tel_work’),
‘TEL;VOICE;HOME’ =3D> array(‘tel_home’),

  •   	'TITLE'		=3D> array('contact_role'),
    
  •   	'TITLE'		=3D> array('title'),
      	'URL;WORK'	=3D> array('url'),
      	'URL;HOME'	=3D> array('url_home'),
      	'X-ASSISTANT'		=3D> array('assistent'),
    

@@ -539,6 +539,7 @@
break;
case ‘e51’:
case ‘e90’:

  •   			case 'e71':
      				$this->supportedFields =3D $defaultFields[9];
      				break;
      			case '9300':
    

Modified: trunk/calendar/inc/class.calendar_ical.inc.php
URL: http://www.egroupware.org/viewvc/trunk/calendar/inc/class.calendar_ica=
l.inc.php?rev=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/calendar/inc/class.calendar_ical.inc.php (original)
+++ trunk/calendar/inc/class.calendar_ical.inc.php Mon Nov 3 08:44:02 2008
@@ -391,8 +391,8 @@
}
}

  •   	$modified =3D $GLOBALS['egw']->contenthistory->getTSforAction($eventGUI=
    

D,‘modify’);

  •   	$created =3D $GLOBALS['egw']->contenthistory->getTSforAction($eventGUID=
    

,‘add’);

  •   	$modified =3D $GLOBALS['egw']->contenthistory->getTSforAction('calendar=
    

',$event[‘id’],‘modify’);

  •   	$created =3D $GLOBALS['egw']->contenthistory->getTSforAction('calendar'=
    

,$event[‘id’],‘add’);
if (!$created && !$modified) $created =3D $event[‘modified’];
if ($created) $attributes[‘CREATED’] =3D $created;
if (!$modified) $modified =3D $event[‘modified’];
@@ -443,7 +443,8 @@
}
}

  •   	$attributes['UID'] =3D $force_own_uid ? $eventGUID : $event['uid'];
    
  •   	//$attributes['UID'] =3D $force_own_uid ? $eventGUID : $event['uid'];
    
  •   	$attributes['UID'] =3D $event['uid'];
      	foreach($attributes as $key =3D> $value)
      	{
      		foreach(is_array($value)&&$parameters[$key]['VALUE']!=3D'DATE' ? $valu=
    

e : array($value) as $valueID =3D> $valueData)
@@ -1166,6 +1167,11 @@
case ‘e61’:
$this->supportedFields =3D $defaultFields[‘minimal’];
break;

  •   			case 'e51':
    
  •   			case 'e90':
    
  •   			case 'e71':
    
  •   				$this->supportedFields =3D $defaultFields['basic'];
    
  •   				break;
      			default:
      				error_log("Unknown Nokia phone '$_productName', assuming E61");
      				$this->supportedFields =3D $defaultFields['minimal'];
    

Modified: trunk/icalsrv/inc/class.eicnvutils.inc.php
URL: http://www.egroupware.org/viewvc/trunk/icalsrv/inc/class.eicnvutils.in=
c.php?rev=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/icalsrv/inc/class.eicnvutils.inc.php (original)
+++ trunk/icalsrv/inc/class.eicnvutils.inc.php Mon Nov 3 08:44:02 2008
@@ -365,12 +365,8 @@
{
return false;
}

  •   	if (! $auid =3D $GLOBALS['egw']->common->generate_uid($appname,$id))
    
  •   	{
    
  •   		return false;
    
  •   	}
    
  •   	return $GLOBALS['egw']->contenthistory->getTSforAction($auid,'add');
    
  •   	return $GLOBALS['egw']->contenthistory->getTSforAction($appname,$id,'ad=
    

d’);
}

  /**

Modified: trunk/infolog/inc/class.infolog_ical.inc.php
URL: http://www.egroupware.org/viewvc/trunk/infolog/inc/class.infolog_ical.=
inc.php?rev=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/infolog/inc/class.infolog_ical.inc.php (original)
+++ trunk/infolog/inc/class.infolog_ical.inc.php Mon Nov 3 08:44:02 2008
@@ -81,9 +81,10 @@
if($taskData[‘info_datecompleted’])
$vevent->setAttribute(‘COMPLETED’,$taskData[‘info_datecompleted’]);
$vevent->setAttribute(‘DTSTAMP’,time());

  •   $vevent->setAttribute('CREATED',$GLOBALS['egw']->contenthistory->getTSfo=
    

rAction($eventGUID,‘add’));

  •   $vevent->setAttribute('LAST-MODIFIED',$GLOBALS['egw']->contenthistory->g=
    

etTSforAction($eventGUID,‘modify’));

  •   $vevent->setAttribute('UID',$force_own_uid ? $taskGUID : $taskData['info=
    

_uid’]);

  •   $vevent->setAttribute('CREATED',$GLOBALS['egw']->contenthistory->getTSfo=
    

rAction(‘infolog_task’,$_taskID,‘add’));

  •   $vevent->setAttribute('LAST-MODIFIED',$GLOBALS['egw']->contenthistory->g=
    

etTSforAction(‘infolog_task’,$_taskID,‘modify’));

  •   //$vevent->setAttribute('UID',$force_own_uid ? $taskGUID : $taskData['in=
    

fo_uid’]);

  •   $vevent->setAttribute('UID',$taskData['info_uid']);
      $vevent->setAttribute('CLASS',$taskData['info_access'] =3D=3D 'public' ?=
    

‘PUBLIC’ : ‘PRIVATE’);
$vevent->setAttribute(‘STATUS’,$this->status2vtodo($taskData[‘info_statu=
s’]));
// we try to preserv the original infolog status as X-INFOLOG-STATUS, so=
we can restore it, if the user does not modify STATUS
@@ -253,8 +254,8 @@
$vnote->setAttribute(‘BODY’,$note[‘info_des’]);
if($note[‘info_startdate’])
$vnote->setAttribute(‘DCREATED’,$note[‘info_startdate’]);

  •   		$vnote->setAttribute('DCREATED',$GLOBALS['egw']->contenthistory->getTS=
    

forAction($eventGUID,‘add’));

  •   		$vnote->setAttribute('LAST-MODIFIED',$GLOBALS['egw']->contenthistory->=
    

getTSforAction($eventGUID,‘modify’));

  •   		$vnote->setAttribute('DCREATED',$GLOBALS['egw']->contenthistory->getTS=
    

forAction(‘infolog_note’,$_noteID,‘add’));

  •   		$vnote->setAttribute('LAST-MODIFIED',$GLOBALS['egw']->contenthistory->=
    

getTSforAction(‘infolog_note’,$_noteID,‘modify’));
if (!empty($note[‘info_cat’]))
{
$cats =3D $this->get_categories(array($note[‘info_cat’]));

Modified: trunk/infolog/inc/class.infolog_sif.inc.php
URL: http://www.egroupware.org/viewvc/trunk/infolog/inc/class.infolog_sif.i=
nc.php?rev=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/infolog/inc/class.infolog_sif.inc.php (original)
+++ trunk/infolog/inc/class.infolog_sif.inc.php Mon Nov 3 08:44:02 2008
@@ -459,8 +459,8 @@
if($taskData[‘info_enddate’])
$vevent->setAttribute(‘DUE’,$taskData[‘info_enddate’]);
$vevent->setAttribute(‘DTSTAMP’,time());

  •   $vevent->setAttribute('CREATED',$GLOBALS['phpgw']->contenthistory->getTS=
    

forAction($eventGUID,‘add’));

  •   $vevent->setAttribute('LAST-MODIFIED',$GLOBALS['phpgw']->contenthistory-=
    

getTSforAction($eventGUID,‘modify’));

  •   $vevent->setAttribute('CREATED',$GLOBALS['phpgw']->contenthistory->getTS=
    

forAction(‘infolog_task’,$_taskID,‘add’));

  •   $vevent->setAttribute('LAST-MODIFIED',$GLOBALS['phpgw']->contenthistory-=
    

getTSforAction(‘infolog_task’,$_taskID,‘modify’));
$vevent->setAttribute(‘UID’,$taskGUID);
$vevent->setAttribute(‘CLASS’,(($taskData[‘info_access’] =3D=3D ‘public’=
)?‘PUBLIC’:‘PRIVATE’));
$vevent->setAttribute(‘STATUS’,(($taskData[‘info_status’] =3D=3D ‘comple=
ted’)?‘COMPLETED’:‘NEEDS-ACTION’));

Modified: trunk/phpgwapi/inc/class.contenthistory.inc.php
URL: http://www.egroupware.org/viewvc/trunk/phpgwapi/inc/class.contenthisto=
ry.inc.php?rev=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/phpgwapi/inc/class.contenthistory.inc.php (original)
+++ trunk/phpgwapi/inc/class.contenthistory.inc.php Mon Nov 3 08:44:02 2008
@@ -58,7 +58,7 @@
* @param string$_appName the appname example: infolog_notes
* @param string $_action can be modify, add or delete
* @param string $_ts timestamp where to start searching from =

    • @return array containing the global UID’s
    • @return array containing contentIds with changes
      */
      function getHistory($_appName, $_action, $_ts)
      {
      @@ -79,13 +79,13 @@
      // no valid $_action set
      return array();
      }
  •   $guidList =3D array();
    
  •   foreach($this->db->select(self::TABLE,'sync_guid',$where,__LINE__,__FILE=
    

__) as $row)

  •   $idList =3D array();
    
  •   foreach($this->db->select(self::TABLE,'sync_contentid',$where,__LINE__,_=
    

FILE_) as $row)
{

  •   	$guidList[] =3D $row['sync_guid'];
    
  •   	$idList[] =3D $row['sync_contentid'];
      }
      =
    
  •   return $guidList;
    
  •   return $idList;
    

    }

    /**
    @@ -95,7 +95,7 @@

    • @param $_action string can be add, delete or modify
    • @return string the last timestamp
      */
  • function getTSforAction($_guid, $_action)
  • function getTSforAction($_appName, $_id, $_action)
    {
    switch($_action)
    {
    @@ -112,7 +112,8 @@
    return false;
    }
    $where =3D array (
  •   	'sync_guid' =3D> $_guid,
    
  •   	'sync_appname' =3D> $_appName,
    
  •   	'sync_contentid' =3D> $_id,
      );
    

=

	if (($ts =3D $this->db->select(self::TABLE,$col,$where,__LINE__,__FILE__=

)->fetchSingle()))
@@ -137,7 +138,6 @@
‘sync_appname’ =3D> $_appName,
‘sync_contentid’ =3D> $_id,
‘sync_added’ =3D> $this->db->to_timestamp($_ts),

  •   	'sync_guid'			=3D> $GLOBALS['egw']->common->generate_uid($_appName, $_i=
    

d),
‘sync_changedby’ =3D> $GLOBALS[‘egw_info’][‘user’][‘account_id’],
);

Modified: trunk/phpgwapi/inc/horde/Horde/SyncML/State.php
URL: http://www.egroupware.org/viewvc/trunk/phpgwapi/inc/horde/Horde/SyncML=
/State.php?rev=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/phpgwapi/inc/horde/Horde/SyncML/State.php (original)
+++ trunk/phpgwapi/inc/horde/Horde/SyncML/State.php Mon Nov 3 08:44:02 2008
@@ -779,8 +779,11 @@
break;

		case 'calendar':
  •   		return 'calendar';
    
  •   		break;
    
  •   	case 'caltasks':
    
  •   		return 'calendar';
    
  •   		return 'caltasks';
      		break;
    

=

		# funambol related types

Modified: trunk/phpgwapi/inc/horde/Horde/SyncML/State_egw.php
URL: http://www.egroupware.org/viewvc/trunk/phpgwapi/inc/horde/Horde/SyncML=
/State_egw.php?rev=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/phpgwapi/inc/horde/Horde/SyncML/State_egw.php (original)
+++ trunk/phpgwapi/inc/horde/Horde/SyncML/State_egw.php Mon Nov 3 08:44:02=
2008
@@ -17,12 +17,67 @@
class EGW_SyncML_State extends Horde_SyncML_State
{
var $table_devinfo =3D ‘egw_syncmldevinfo’;

  • =

    /*

    • store the mappings of egw uids to client uids
      */
      var $uidMappings =3D array();
      =
  • /**

  •   * get the local content id from a syncid
    
  •   *
    
  •   * @param sting $_syncid id used in syncml
    
  •   * @return int local egw content id
    
  •   */
    
  • function get_egwID($_syncid)

  • {

  •   $syncIDParts =3D explode('-',$_syncid);
    
  •   array_shift($syncIDParts);
    
  •   $_id =3D implode ('', $syncIDParts);
    
  •   return $_id;
    
  • } =

  • =

  • /**

    • when got a entry last added/modified/deleted
    • @param $_syncid containing appName-contentid
    • @param $_action string can be add, delete or modify =
    • @return string the last timestamp
  • */

  • function getSyncTSforAction($_syncid, $_action)

  • {

  •   $syncIDParts =3D explode('-',$_syncid);
    
  •   $_appName =3D array_shift($syncIDParts);
    
  •   $_id =3D implode ('', $syncIDParts);
    
  •   =
    
  •   $ts =3D $GLOBALS['egw']->contenthistory->getTSforAction($_appName, $_id,=
    

$_action);

  •   =
    
  •   return $ts;
    
  • } =

  • =

  • /**

    • get the timestamp for action
    • find which content changed since $_ts for application $_appName
    • @param string$_appName the appname example: infolog_notes
    • @param string $_action can be modify, add or delete
    • @param string $_ts timestamp where to start searching from =
    • @return array containing syncIDs with changes
  • */

  • function getHistory($_appName, $_action, $_ts)

  • {

  •   $guidList =3D array ();
    
  •   $syncIdList =3D array ();
    
  •   $idList =3D $GLOBALS['egw']->contenthistory->getHistory($_appName, $_act=
    

ion, $_ts);

  •   foreach ($idList as $idItem)
    
  •   {
    
  •   	$syncIdList[] =3D $_appName . '-' . $idItem;
    
  •   }
    
  • return $syncIdList; =

  • }

  • =

    /**

    • Returns the timestamp (if set) of the last change to the
    • obj:guid, that was caused by the client. This is stored to
      @@ -257,7 +312,7 @@
      function removeUID($type, $locid)
      {
      $mapID =3D $this->_locName . $this->_sourceURI . $type;
  •   =
    
      $where =3D array (
      	'map_id'	=3D> $mapID,
      	'map_locuid'	=3D> $locid
    

@@ -301,6 +356,9 @@
$guid =3D $this->getUIDMapping($_guid);
if($guid =3D=3D=3D false)
{

  •       // this message is not really usefull here because setUIDMapping =
    

is only called when adding content to the client,

  •       // however setUID is called also when adding content from the cli=
    

ent. So in all other conditions this =

  •       // message will be logged. =
    
          Horde::logMessage("SyncML: setUID $type, $locid, $guid something =
    

went wrong!!! Mapping not found.", FILE, LINE, PEAR_LOG_INFO);
$guid =3D $_guid;
//return false;

Modified: trunk/phpgwapi/inc/horde/Horde/SyncML/Sync.php
URL: http://www.egroupware.org/viewvc/trunk/phpgwapi/inc/horde/Horde/SyncML=
/Sync.php?rev=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/phpgwapi/inc/horde/Horde/SyncML/Sync.php (original)
+++ trunk/phpgwapi/inc/horde/Horde/SyncML/Sync.php Mon Nov 3 08:44:02 2008
@@ -163,7 +163,7 @@
array($state->convertClient2Server($syncItem->getContent(), $contentT=
ype), $contentType));
=

			if (!is_a($guid, 'PEAR_Error')) {
  •   			$ts =3D $history->getTSforAction($guid, 'add');
    
  •   			$ts =3D $state->getSyncTSforAction($guid, 'add');
      			$state->setUID($type, $syncItem->getLocURI(), $guid, $ts);
      			$state->log("Client-Add");
      			Horde::logMessage('SyncML: added client entry as ' . $guid, __FILE__,=
    

LINE, PEAR_LOG_DEBUG);
@@ -180,7 +180,7 @@
=

			if (!is_a($guid, 'PEAR_Error') && $guid !=3D false) {
				$registry->call($hordeType . '/delete', array($guid));
  •   			#$ts =3D $history->getTSforAction($guid, 'delete');
    
  •   			#$ts =3D $state->getSyncTSforAction($guid, 'delete');
      			#$state->setUID($type, $syncItem->getLocURI(), $guid, $ts);
      			$state->log("Client-Delete");
      			Horde::logMessage('SyncML: deleted entry ' . $guid . ' due to client =
    

request’, FILE, LINE, PEAR_LOG_DEBUG);
@@ -194,13 +194,14 @@
if ($guid) {
Horde::logMessage(‘SyncML: locuri’. $syncItem->getLocURI() . ’ guid '=
. $guid , FILE, LINE, PEAR_LOG_ERR);
// Entry exists: replace current one.

  •   			$ok =3D $registry->call($hordeType . '/replace',
    
  •   				array($guid, $state->convertClient2Server($syncItem->getContent(), $=
    

contentType), $contentType));

  •   		  $ok =3D $registry->call($hordeType . '/replace',
    
  •   			array($guid, $state->convertClient2Server($syncItem->getContent(), $c=
    

ontentType), $contentType));
if (!is_a($ok, ‘PEAR_Error’)) {

  •   				$ts =3D $history->getTSforAction($guid, 'modify');
    
  •   				$ts =3D $state->getSyncTSforAction($guid, 'modify');
      				$state->setUID($type, $syncItem->getLocURI(), $guid, $ts);
      				Horde::logMessage('SyncML: replaced entry due to client request guid=
    

: ’ .$guid. ’ ts: ’ .$ts, FILE, LINE, PEAR_LOG_DEBUG);
$state->log(“Client-Replace”);

  •   				error_log("done_replace");
      				$ok =3D true;
      			} else {
      				// Entry may have been deleted; try adding it.
    

@@ -214,7 +215,7 @@
$guid =3D $registry->call($hordeType . ‘/import’,
array($state->convertClient2Server($syncItem->getContent(), $content=
Type), $contentType));
if (!is_a($guid, ‘PEAR_Error’)) {

  •   				$ts =3D $history->getTSforAction($guid, 'add');
    
  •   				$ts =3D $state->getSyncTSforAction($guid, 'add');
      				$state->setUID($type, $syncItem->getLocURI(), $guid, $ts);
      				$state->log("Client-AddReplace");
      				Horde::logMessage('SyncML: r/ added client entry as ' . $guid, __FIL=
    

E__, LINE, PEAR_LOG_DEBUG);

Modified: trunk/phpgwapi/inc/horde/Horde/SyncML/Sync/RefreshFromServerSync.=
php
URL: http://www.egroupware.org/viewvc/trunk/phpgwapi/inc/horde/Horde/SyncML=
/Sync/RefreshFromServerSync.php?rev=3D26307&r1=3D26306&r2=3D26307&view=3Ddi=
ff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/phpgwapi/inc/horde/Horde/SyncML/Sync/RefreshFromServerSync.php (o=
riginal)
+++ trunk/phpgwapi/inc/horde/Horde/SyncML/Sync/RefreshFromServerSync.php Mo=
n Nov 3 08:44:02 2008
@@ -19,7 +19,6 @@
function handleSync($currentCmdID, $hordeType, $syncType, &$output, $reft=
s) {
global $registry;
=

  •   $history =3D $GLOBALS['egw']->contenthistory;
      $state =3D &$_SESSION['SyncML.state'];
      =
    
      $adds =3D &$state->getAddedItems($hordeType);
    

Modified: trunk/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php
URL: http://www.egroupware.org/viewvc/trunk/phpgwapi/inc/horde/Horde/SyncML=
/Sync/SlowSync.php?rev=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php (original)
+++ trunk/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php Mon Nov 3 08:4=
4:02 2008
@@ -160,7 +160,7 @@
$guid =3D $registry->call($hordeType . ‘/import’,
array($state->convertClient2Server($syncItem->getContent(), $contentT=
ype), $contentType));
if (!is_a($guid, ‘PEAR_Error’)) {

  •   			$ts =3D $history->getTSforAction($guid, 'add');
    
  •   			$ts =3D $state->getSyncTSforAction($guid, 'add');
      			$state->setUID($type, $syncItem->getLocURI(), $guid, $ts);
      			$state->log("Client-AddReplace");
      			Horde::logMessage('SyncML: r/ added client entry as ' . $guid, __FILE=
    

__, LINE, PEAR_LOG_DEBUG);

Modified: trunk/phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php
URL: http://www.egroupware.org/viewvc/trunk/phpgwapi/inc/horde/Horde/SyncML=
/Sync/TwoWaySync.php?rev=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php (original)
+++ trunk/phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php Mon Nov 3 08=
:44:02 2008
@@ -60,7 +60,7 @@
// handle changes
if(is_array($changes)) {
while($guid =3D array_shift($changes)) {

  •   		$guid_ts =3D $history->getTSforAction($guid, 'modify');
    
  •   		$guid_ts =3D $state->getSyncTSforAction($guid, 'modify');
      		$sync_ts =3D $state->getChangeTS($syncType, $guid);
      		Horde::logMessage("SyncML: timestamp modify guid_ts: $guid_ts sync_ts:=
    

$sync_ts", FILE, LINE, PEAR_LOG_DEBUG);
if ($sync_ts && $sync_ts =3D=3D $guid_ts) {
@@ -115,7 +115,7 @@
// handle deletes
if(is_array($deletes)) {
while($guid =3D array_shift($deletes)) {

  •   		$guid_ts =3D $history->getTSforAction($guid, 'delete');
    
  •   		$guid_ts =3D $state->getSyncTSforAction($guid, 'delete');
      		$sync_ts =3D $state->getChangeTS($syncType, $guid);
      		Horde::logMessage("SyncML: timestamp delete guid_ts: $guid_ts sync_ts:=
    

$sync_ts", FILE, LINE, PEAR_LOG_DEBUG);
if ($sync_ts && $sync_ts =3D=3D $guid_ts) {
@@ -163,7 +163,7 @@

	if(is_array($adds)) {
		while($guid =3D array_shift($adds)) {
  •   		$guid_ts =3D $history->getTSforAction($guid, 'add');
    
  •   		$guid_ts =3D $state->getSyncTSforAction($guid, 'add');
      		$sync_ts =3D $state->getChangeTS($syncType, $guid);
      		Horde::logMessage("SyncML: timestamp add $guid guid_ts: $guid_ts sync_=
    

ts: $sync_ts", FILE, LINE, PEAR_LOG_DEBUG);
if ($sync_ts && $sync_ts =3D=3D $guid_ts) {

Modified: trunk/phpgwapi/setup/setup.inc.php
URL: http://www.egroupware.org/viewvc/trunk/phpgwapi/setup/setup.inc.php?re=
v=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/phpgwapi/setup/setup.inc.php (original)
+++ trunk/phpgwapi/setup/setup.inc.php Mon Nov 3 08:44:02 2008
@@ -12,7 +12,7 @@
/* Basic information about this app */
$setup_info[‘phpgwapi’][‘name’] =3D ‘phpgwapi’;
$setup_info[‘phpgwapi’][‘title’] =3D ‘eGroupWare API’;
-$setup_info[‘phpgwapi’][‘version’] =3D ‘1.5.016’;
+$setup_info[‘phpgwapi’][‘version’] =3D ‘1.5.017’;
$setup_info[‘phpgwapi’][‘versions’][‘current_header’] =3D ‘1.29’;
$setup_info[‘phpgwapi’][‘enable’] =3D 3;
$setup_info[‘phpgwapi’][‘app_order’] =3D 1;

Modified: trunk/phpgwapi/setup/tables_current.inc.php
URL: http://www.egroupware.org/viewvc/trunk/phpgwapi/setup/tables_current.i=
nc.php?rev=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/phpgwapi/setup/tables_current.inc.php (original)
+++ trunk/phpgwapi/setup/tables_current.inc.php Mon Nov 3 08:44:02 2008
@@ -302,7 +302,6 @@
‘sync_modified’ =3D> array(‘type’ =3D> ‘timestamp’),
‘sync_deleted’ =3D> array(‘type’ =3D> ‘timestamp’),
‘sync_id’ =3D> array(‘type’ =3D> ‘auto’,‘nullable’ =3D> False),

  •   	'sync_guid' =3D> array('type' =3D> 'varchar','precision' =3D> '120','nu=
    

llable’ =3D> False),
‘sync_changedby’ =3D> array(‘type’ =3D> ‘int’,‘precision’ =3D> ‘4’,‘nul=
lable’ =3D> False)
),
‘pk’ =3D> array(‘sync_id’),

Modified: trunk/phpgwapi/setup/tables_update.inc.php
URL: http://www.egroupware.org/viewvc/trunk/phpgwapi/setup/tables_update.in=
c.php?rev=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/phpgwapi/setup/tables_update.inc.php (original)
+++ trunk/phpgwapi/setup/tables_update.inc.php Mon Nov 3 08:44:02 2008
@@ -578,3 +578,27 @@

return $GLOBALS['setup_info']['phpgwapi']['currentver'] =3D '1.5.016';

}
+
+/**

    • Drop no longer needed egw_api_content_history.sync_guid column
  • */
    +function phpgwapi_upgrade1_5_016()
    +{
  • $GLOBALS[‘egw_setup’]->oProc->DropColumn(‘egw_api_content_history’,array(
  •   'fd' =3D> array(
    
  •   	'sync_appname' =3D> array('type' =3D> 'varchar','precision' =3D> '60','=
    

nullable’ =3D> False),

  •   	'sync_contentid' =3D> array('type' =3D> 'varchar','precision' =3D> '60'=
    

,‘nullable’ =3D> False),

  •   	'sync_added' =3D> array('type' =3D> 'timestamp'),
    
  •   	'sync_modified' =3D> array('type' =3D> 'timestamp'),
    
  •   	'sync_deleted' =3D> array('type' =3D> 'timestamp'),
    
  •   	'sync_id' =3D> array('type' =3D> 'auto','nullable' =3D> False),
    
  •   	'sync_changedby' =3D> array('type' =3D> 'int','precision' =3D> '4','nul=
    

lable’ =3D> False)

  •   ),
    
  •   'pk' =3D> array('sync_id'),
    
  •   'fk' =3D> array(),
    
  •   'ix' =3D> array('sync_added','sync_modified','sync_deleted','sync_guid',=
    

‘sync_changedby’,array(‘sync_appname’,‘sync_contentid’)),

  •   'uc' =3D> array()
    
  • ),‘sync_guid’);
  • return $GLOBALS[‘setup_info’][‘phpgwapi’][‘currentver’] =3D ‘1.5.017’;
    +}

Modified: trunk/syncml/calendar/lib/api.php
URL: http://www.egroupware.org/viewvc/trunk/syncml/calendar/lib/api.php?rev=
=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/syncml/calendar/lib/api.php (original)
+++ trunk/syncml/calendar/lib/api.php Mon Nov 3 08:44:02 2008
@@ -74,7 +74,7 @@

foreach((array)$events as $event)
{
  •   $guids[] =3D $GLOBALS['egw']->common->generate_uid('calendar',$event['id=
    

']);

  •   $guids[] =3D 'calendar-' . $event['id'];
    
    }
    return $guids;
    }
    @@ -91,8 +91,8 @@
    function &_egwcalendarsync_listBy($action, $timestamp)
    {
    Horde::logMessage(“SymcML: egwcalendarsync listBy action: $action timesta=
    mp: $timestamp”, FILE, LINE, PEAR_LOG_DEBUG);
  • $allChangedItems =3D $GLOBALS[‘egw’]->contenthistory->getHistory(‘calenda=
    r’, $action, $timestamp);
  • $state =3D $_SESSION[‘SyncML.state’];

  • $allChangedItems =3D $state->getHistory(‘calendar’, $action, $timestamp);
    Horde::logMessage(“SymcML: egwcalendarsync getHistory(‘calendar’, $action=
    , $timestamp)=3D”.print_r($allChangedItems,true), FILE, LINE, PEAR_=
    LOG_DEBUG);
    =

    if($action =3D=3D ‘delete’)
    @@ -109,7 +109,7 @@
    $ids =3D $guids =3D array();
    foreach($allChangedItems as $guid)
    {

  •   $ids[] =3D $GLOBALS['egw']->common->get_egwId($guid);
    
  •   $ids[] =3D $state->get_egwId($guid);
    

    }
    =

    // read all events in one go, and check if the user participats
    @@ -120,7 +120,7 @@
    Horde::logMessage(“SymcML: egwcalendarsync check participation for $eve=
    nt[id] / $event[title]”, FILE, LINE, PEAR_LOG_DEBUG);
    if (isset($event[‘participants’][$user]) && ($show_rejected || $event[’=
    participants’][$user] !=3D ‘R’))
    {

  •   		$guids[] =3D $guid =3D $GLOBALS['egw']->common->generate_uid('calendar=
    

',$event[‘id’]);

  •   		$guids[] =3D $guid =3D 'calendar-' . $event['id'];
      		Horde::logMessage("SymcML: egwcalendarsync added id $event[id] ($guid)=
    

/ $event[title]", FILE, LINE, PEAR_LOG_DEBUG);
}
}
@@ -184,10 +184,10 @@

if (is_a($calendarId, 'PEAR_Error'))
{
  •   return $calendarId;
    
  • }
  • $guid =3D $GLOBALS[‘egw’]->common->generate_uid(‘calendar’,$calendarId);
  •   return 'calendar-' . $calendarId;
    
  • }

  • $guid =3D ‘calendar-’ . $calendarId;
    Horde::logMessage("SymcML: egwcalendarsync import imported: ".$guid, FI=
    LE
    , LINE, PEAR_LOG_DEBUG);
    return $guid;
    }
    @@ -245,7 +245,7 @@
    =

    if (is_a($eventId, ‘PEAR_Error’))
    {

  •   return $eventId;
    
  •   return 'calendar-' . $eventId;
    

    }
    =

    if(!$eventId)
    @@ -254,7 +254,7 @@
    }
    else
    {

  •   $eventId =3D $GLOBALS['egw']->common->generate_uid('calendar', $eventId);
    
  •   $eventId =3D 'calendar-' . $eventId;
      Horde::logMessage('SymcML: egwcalendarsync search found: '. $eventId, __=
    

FILE__, LINE, PEAR_LOG_DEBUG);
return $eventId;
}
@@ -291,7 +291,7 @@

return PEAR::raiseError(_(“Permission Denied”));

}

  • $state =3D $_SESSION[‘SyncML.state’];
    if (is_array($contentType))
    {
    $options =3D $contentType;
    @@ -306,7 +306,7 @@
    Horde::logMessage("SymcML: egwcalendarsync export guid: $guid contenttype=
    : ".$contentType, FILE, LINE, PEAR_LOG_DEBUG);
    =

=

  • $eventID =3D $GLOBALS[‘egw’]->common->get_egwId($guid);
  • $eventID =3D $state->get_egwId($guid);
    =

    switch ($contentType)
    {
    @@ -354,6 +354,7 @@
    {
    // Handle an arrray of GUIDs for convenience of deleting multiple
    // contacts at once.

  • $state =3D $_SESSION[‘SyncML.state’];
    if (is_array($guid))
    {
    foreach ($guid as $g)
    @@ -371,11 +372,11 @@
    #if (!array_key_exists($memo[‘memolist_id’], Mnemo::listNotepads(false, P=
    ERMS_DELETE))) {

    return PEAR::raiseError(_(“Permission Denied”));

    #}

  • Horde::logMessage("SymcML: egwcalendarsync delete id: ".$GLOBALS[‘egw’]->=
    common->get_egwId($guid), FILE, LINE, PEAR_LOG_DEBUG);
  • Horde::logMessage("SymcML: egwcalendarsync delete id: ".$state->get_egwId=
    ($guid), FILE, LINE, PEAR_LOG_DEBUG);
    =

    $bocalendar =3D& new calendar_boupdate();
    =

  • return $bocalendar->delete($GLOBALS[‘egw’]->common->get_egwId($guid));
  • return $bocalendar->delete($state->get_egwId($guid));
    #return $bocalendar->expunge();
    }
    =

@@ -394,7 +395,7 @@
function _egwcalendarsync_replace($guid, $content, $contentType)
{
Horde::logMessage(“SymcML: egwcalendarsync replace guid: $guid content: $=
content contenttype: $contentType”, FILE, LINE, PEAR_LOG_DEBUG);

  • =

    if (is_array($contentType))
    {
    $options =3D $contentType;
    @@ -405,15 +406,14 @@
    {
    $options =3D array();
    }

  • $eventID =3D $GLOBALS[‘egw’]->common->get_egwId($guid);
  • $state =3D $_SESSION[‘SyncML.state’];

  • $eventID =3D $state->get_egwId($guid);
    =

    switch ($contentType)
    {
    case ‘text/x-vcalendar’:
    case ‘text/vcalendar’:
    case ‘text/calendar’:

  •   	$state =3D $_SESSION['SyncML.state'];
      	$deviceInfo =3D $state->getClientDeviceInfo();
      	$boical	=3D new calendar_ical();
      	$boical->setSupportedFields($deviceInfo['manufacturer'],$deviceInfo['mo=
    

del’]);

Modified: trunk/syncml/caltasks/lib/api.php
URL: http://www.egroupware.org/viewvc/trunk/syncml/caltasks/lib/api.php?rev=
=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/syncml/caltasks/lib/api.php (original)
+++ trunk/syncml/caltasks/lib/api.php Mon Nov 3 08:44:02 2008
@@ -75,7 +75,7 @@
Horde::logMessage(‘SymcML: egwcaltaskssync list found: ‘. count($events) =
.’ events’, FILE, LINE, PEAR_LOG_DEBUG);

foreach((array)$events as $event) {
  •   $guids[] =3D $GLOBALS['egw']->common->generate_uid('calendar',$event['id=
    

']);

  •   $guids[] =3D 'calendar-'.$event['id'];
    
    }
    =

=

@@ -96,7 +96,7 @@
Horde::logMessage(‘SymcML: egwcaltaskssync list found: ‘. count($tasks) .=
’ tasks’, FILE, LINE, PEAR_LOG_DEBUG);

foreach((array)$tasks as $task) {
  •   $guids[] =3D $GLOBALS['egw']->common->generate_uid('infolog_task',$task[=
    

‘info_id’]);

  •   $guids[] =3D 'infolog_task-' . $task['info_id'];
    

    }
    =

    return $guids;
    @@ -114,9 +114,9 @@
    function &_egwcaltaskssync_listBy($action, $timestamp)
    {
    Horde::logMessage(“SymcML: egwcaltaskssync listBy action: $action timesta=
    mp: $timestamp”, FILE, LINE, PEAR_LOG_DEBUG);

  • $allChangedCalendarItems =3D $GLOBALS[‘egw’]->contenthistory->getHistory(=
    ‘calendar’, $action, $timestamp);
  • $allChangedTasksItems =3D $GLOBALS[‘egw’]->contenthistory->getHistory(‘in=
    folog_task’, $action, $timestamp);
  • $state =3D $_SESSION[‘SyncML.state’];

  • $allChangedCalendarItems =3D $state->getHistory(‘calendar’, $action, $tim=
    estamp);

  • $allChangedTasksItems =3D $state->getHistory(‘infolog_task’, $action, $ti=
    mestamp);
    Horde::logMessage(“SymcML: egwcaltaskssync getHistory(‘calendar and infol=
    og_task’, $action, $timestamp)”, FILE, LINE, PEAR_LOG_DEBUG);
    =

    if($action =3D=3D ‘delete’) {
    @@ -133,14 +133,14 @@
    $ids =3D $guids =3D array();
    =

    foreach($allChangedCalendarItems as $guid) {

  •   $ids[] =3D $GLOBALS['egw']->common->get_egwId($guid);
    
  •   $ids[] =3D $state->get_egwId($guid);
    
    }
    // read all events in one go, and check if the user participats
    if (count($ids) && ($events =3D& $boCalendar->read($ids))) {
    foreach((array)$boCalendar->read($ids) as $event) {
    Horde::logMessage(“SymcML: egwcaltaskssync check participation for $eve=
    nt[id] / $event[title]”, FILE, LINE, PEAR_LOG_DEBUG);
    if (isset($event[‘participants’][$user]) && ($show_rejected || $event[’=
    participants’][$user] !=3D ‘R’)) {
  •   		$guids[] =3D $guid =3D $GLOBALS['egw']->common->generate_uid('calendar=
    

',$event[‘id’]);

  •   		$guids[] =3D $guid =3D 'calendar-' . $event['id'];
      		Horde::logMessage("SymcML: egwcaltaskssync added id $event[id] ($guid)=
    

/ $event[title]", FILE, LINE, PEAR_LOG_DEBUG);
}
}
@@ -150,7 +150,7 @@
$user =3D $GLOBALS[‘egw_info’][‘user’][‘account_id’];

foreach($allChangedTasksItems as $guid) {
  •   $uid =3D $GLOBALS['egw']->common->get_egwId($guid);
    
  •   $uid =3D $state->get_egwId($guid);
    

=

	if(($info =3D $infolog_bo->read($uid)) &&		// checks READ rights too and=

returns false if none
// for filter my =3D all items the user is responsible for:
@@ -203,10 +203,10 @@
}

if (is_a($id, 'PEAR_Error')) {
  •   return $id;
    
  • }
  • $guid =3D $GLOBALS[‘egw’]->common->generate_uid($type, $id);
  •   return $type . '-' .$id;
    
  • }

  • $guid =3D $type .’-’ .$id;
    Horde::logMessage("SymcML: egwcaltaskssync import imported: ".$guid, FI=
    LE
    , LINE, PEAR_LOG_DEBUG);
    return $guid;
    }
    @@ -246,14 +246,14 @@
    }
    =

    if (is_a($id, ‘PEAR_Error’)) {

  •   return $id;
    
  •   return $type . '-' . $id;
    

    }
    =

    if(!$id) {
    Horde::logMessage(‘SymcML: egwcaltaskssync search nothing found’, __FILE=
    __, LINE, PEAR_LOG_DEBUG);
    return false;
    } else {

  •   $id =3D $GLOBALS['egw']->common->generate_uid($type, $id);
    
  •   $id =3D $type . '-' . $id;
    

=

	Horde::logMessage('SymcML: egwcaltaskssync search found: '. $id, __FILE_=

_, LINE, PEAR_LOG_DEBUG);

@@ -294,7 +294,7 @@

if(strrpos($guid, 'infolog_task') !=3D=3D false) {
	Horde::logMessage("SymcML: egwcaltaskssync export exporting tasks", __FI=

LE__, LINE, PEAR_LOG_DEBUG);

  •   $taskID	=3D $GLOBALS['egw']->common->get_egwId($guid);
    
  •   $taskID	=3D $state->get_egwId($guid);
    

=

	switch ($contentType) {
		case 'text/x-vcalendar':

@@ -310,7 +310,7 @@
$boical =3D new calendar_ical();
$boical->setSupportedFields($deviceInfo[‘manufacturer’],$deviceInfo[‘mod=
el’]);

  •   $eventID	=3D $GLOBALS['egw']->common->get_egwId($guid);
    
  •   $eventID	=3D $state->get_egwId($guid);
    

=

	switch ($contentType) {
		case 'text/x-vcalendar':

@@ -337,6 +337,7 @@
*/
function _egwcaltaskssync_delete($guid)
{

  • $state =3D $_SESSION[‘SyncML.state’];
    // Handle an arrray of GUIDs for convenience of deleting multiple
    // contacts at once.
    if (is_array($guid)) {
    @@ -353,16 +354,16 @@
    #if (!array_key_exists($memo[‘memolist_id’], Mnemo::listNotepads(false, P=
    ERMS_DELETE))) {

    return PEAR::raiseError(_(“Permission Denied”));

    #}
  • Horde::logMessage("SymcML: egwcaltaskssync delete id: ".$GLOBALS[‘egw’]->=
    common->get_egwId($guid), FILE, LINE, PEAR_LOG_DEBUG);
  • Horde::logMessage("SymcML: egwcaltaskssync delete id: ".$state->get_egwId=
    ($guid), FILE, LINE, PEAR_LOG_DEBUG);
    =

    if(strrpos($guid, ‘infolog_task’) !=3D=3D false) {
    Horde::logMessage(“SymcML: egwcaltaskssync delete deleting task”, __FILE=
    __, LINE, PEAR_LOG_DEBUG);

  •   return ExecMethod('infolog.infolog_bo.delete',$GLOBALS['egw']->common->g=
    

et_egwId($guid));

  •   return ExecMethod('infolog.infolog_bo.delete',$state->get_egwId($guid));
    
    } else {
    Horde::logMessage(“SymcML: egwcaltaskssync delete deleting event”, FIL=
    E
    , LINE, PEAR_LOG_DEBUG);
    $bocalendar =3D& new calendar_boupdate();
    =
  •   return $bocalendar->delete($GLOBALS['egw']->common->get_egwId($guid));
    
  •   return $bocalendar->delete($state->get_egwId($guid));
    
    }
    #return $bocalendar->expunge();
    }
    @@ -390,7 +391,7 @@
    case ‘text/calendar’:
    if(strrpos($guid, ‘infolog_task’) !=3D=3D false) {
    Horde::logMessage(“SymcML: egwcaltaskssync replace replacing task”, =
    FILE
    , LINE, PEAR_LOG_DEBUG);
  •   		$taskID =3D $GLOBALS['egw']->common->get_egwId($guid);
    
  •   		$taskID =3D $state->get_egwId($guid);
      		$infolog_ical	=3D new infolog_ical();
    

=

			return $infolog_ical->importVTODO($content, $taskID);

@@ -399,7 +400,7 @@
$boical =3D new calendar_ical();
$boical->setSupportedFields($deviceInfo[‘manufacturer’],$deviceInfo[‘m=
odel’]);

  •   		$eventID =3D $GLOBALS['egw']->common->get_egwId($guid);
    
  •   		$eventID =3D $state->get_egwId($guid);
    

=

			return $boical->importVCal($content, $eventID);
		}

Modified: trunk/syncml/contacts/lib/api.php
URL: http://www.egroupware.org/viewvc/trunk/syncml/contacts/lib/api.php?rev=
=3D26307&r1=3D26306&r2=3D26307&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— trunk/syncml/contacts/lib/api.php (original)
+++ trunk/syncml/contacts/lib/api.php Mon Nov 3 08:44:02 2008
@@ -76,9 +76,11 @@
$guids =3D array();
foreach((array)$allContacts as $contact)
{

  •    #Horde::logMessage("SymcML: egwcontactssync list generate id for: =
    

". $contact[‘id’], FILE, LINE, PEAR_LOG_DEBUG);

  •    #Horde::logMessage("SymcML: egwcontactssync list generate id for: =
    

". print_r($contact, true), FILE, LINE, PEAR_LOG_DEBUG);

  •   $guids[] =3D $GLOBALS['egw']->common->generate_uid('contacts', $contact[=
    

‘id’]);

  • #Horde::logMessage("SymcML: egwcontactssync list generate id for: ". $=
    contact[‘id’], FILE, LINE, PEAR_LOG_DEBUG);
  • #Horde::logMessage("SymcML: egwcontactssync list generate id for: ". p=
    rint_r($contact, true), FILE, LINE, PEAR_LOG_DEBUG);
  • $guids[] =3D "contacts-".$contact['id'];
    
  • =
}

=

#Horde::logMessage("SymcML: egwcontactssync list found ids: ". print_r($g=

uids, true), FILE, LINE, PEAR_LOG_DEBUG);
@@ -100,7 +102,7 @@
#Horde::logMessage(“SymcML: egwcontactssync listBy action: $action timest=
amp: $timestamp”, FILE, LINE, PEAR_LOG_DEBUG);
$state =3D $_SESSION[‘SyncML.state’];

  • $allChangedItems =3D (array)$GLOBALS[‘egw’]->contenthistory->getHistory(’=
    contacts’, $action, $timestamp);
  • $allChangedItems =3D (array)$state->getHistory(‘contacts’, $action, $time=
    stamp);
    #Horde::logMessage('SymcML: egwcontactssync listBy $allChangedItems: '. p=
    rint_r($allChangedItems,true), FILE, LINE, PEAR_LOG_DEBUG);
    $allReadAbleItems =3D (array)_egwcontactssync_list();
    #Horde::logMessage('SymcML: egwcontactssync listBy $allReadAbleItems: '. =
    print_r($allReadAbleItems,true), FILE, LINE, PEAR_LOG_DEBUG);
    @@ -173,11 +175,12 @@
    }
    =

    if (is_a($contactId, ‘PEAR_Error’)) {

  •   return $contactId;
    
  •   return 'contacts-' .$contactId;
    

    }
    =

    #Horde::logMessage("SymcML: egwcontactssync import imported: ".$GLOBALS[’=
    egw’]->common->generate_uid(‘contacts’,$contactId), FILE, LINE, PEA=
    R_LOG_DEBUG);

  • return $GLOBALS[‘egw’]->common->generate_uid(‘contacts’,$contactId);
  • //return $GLOBALS[‘egw’]->common->generate_uid(‘contacts’,$contactId);
  • return ‘contacts-’ .$contactId;
    }
    =

/**
@@ -193,7 +196,6 @@
*/
function _egwcontactssync_search($content, $contentType)
{
-//error_log("_egwcontactssync_search");
Horde::logMessage(“SymcML: egwcontactssync search content: $content conte=
nttype: $contentType”, FILE, LINE, PEAR_LOG_DEBUG);

$state			=3D $_SESSION['SyncML.state'];

@@ -222,15 +224,15 @@
}

if (is_a($contactId, 'PEAR_Error')) {
  •   return $contactId;
    
  •   return 'contacts-' .$contactId;
    

    }
    =

    #error_log(“SymcML: egwcontactssync search found: $contactId”);

  • Horde::logMessage("SymcML: egwcontactssync search found: ".$GLOBALS[‘egw’=
    ]->common->generate_uid(‘contacts’,$contactId), FILE, LINE, PEAR_LO=
    G_DEBUG);
  • Horde::logMessage(“SymcML: egwcontactssync search found: contacts-”.$cont=
    actId, FILE, LINE, PEAR_LOG_DEBUG);
    if(!$contactId) {
    return false;
    } else {
  •   return $GLOBALS['egw']->common->generate_uid('contacts',$contactId);
    
  •   return 'contacts-' . $contactId;
    
    }
    }
    =

@@ -265,7 +267,7 @@
$state =3D $_SESSION[‘SyncML.state’];
$deviceInfo =3D $state->getClientDeviceInfo();

  • $contactID =3D $GLOBALS[‘egw’]->common->get_egwId($guid);
  • $contactID =3D $state->get_egwId($guid);
    =

    switch ($contentType)
    {
    @@ -291,7 +293,7 @@
    /* fall through */
    case ‘text/x-s4j-sifc’:
    $sifaddressbook =3D new addressbook_sif();

  •   	$contactID	=3D $GLOBALS['egw']->common->get_egwId($guid);
    
  •   	$contactID	=3D $state->get_egwId($guid);
      	if($sifcard =3D $sifaddressbook->getSIF($contactID))
      	{
      		return $sifcard;
    

@@ -319,6 +321,7 @@
*/
function _egwcontactssync_delete($guid)
{

  • $state =3D $_SESSION[‘SyncML.state’];
    // Handle an arrray of GUIDs for convenience of deleting multiple
    // contacts at once.
    if (is_array($guid)) {
    @@ -331,13 +334,14 @@
    =

    return true;
    

    }

  • Horde::logMessage("SymcML: egwcontactssync delete guid: $guid egwid: ". $=
    GLOBALS[‘egw’]->common->get_egwId($guid), FILE, __LI