[sync] An extra ";" in Company after syncing to PPC contact

Naoyuki Tai ntai at smartfruit.com
Fri Mar 2 19:38:20 PST 2007


At this point, I'm fairly certain:

1. turba/lib/Driver.php rev. 1.123 was good
2. turba/lib/Driver.php rev. 1.124 needs to be backed out
3. framework/SyncML/SyncML/Device/Sync4j.php needs something like 
following diff:

The problem is that, 'ORG' coming out from vCard always has 
CompanyName;Department format which Sync4j driver does not
take care.
Actually, looking at Sync4j.php, I realized that the Department
is dropped.

I tried syncing and now CompanyName does not have extra ";"
anymore! Horay!

--
Naoyuki "Tai" Tai, ntai a t smartfruit d o t com


Index: Sync4j.php
===================================================================
RCS file: /repository/framework/SyncML/SyncML/Device/Sync4j.php,v
retrieving revision 1.27
diff -c -r1.27 Sync4j.php
*** Sync4j.php	14 Jan 2007 19:31:34 -0000	1.27
--- Sync4j.php	3 Mar 2007 03:28:23 -0000
***************
*** 244,250 ****
                                array('TYPE'=>'FAX'));
           $vcard->setAttribute('EMAIL', $a['Email1Address']);
           $vcard->setAttribute('TITLE', $a['JobTitle']);
!         $vcard->setAttribute('ORG', $a['CompanyName']);
           $vcard->setAttribute('NOTE', $a['Body']);
           $vcard->setAttribute('URL', $a['WebPage']);

--- 244,257 ----
                                array('TYPE'=>'FAX'));
           $vcard->setAttribute('EMAIL', $a['Email1Address']);
           $vcard->setAttribute('TITLE', $a['JobTitle']);
!         $vcard->setAttribute('ORG',
! 							 str_replace(array('\r\n', ';', ':'),
! 										 array('\\n', '\\;', '\\:'),
! 										 $a['CompanyName']) .
! 							 ';' .
! 							 str_replace(array('\r\n', ';', ':'),
! 										 array('\\n', '\\;', '\\:'),
! 										 $a['Department']));
           $vcard->setAttribute('NOTE', $a['Body']);
           $vcard->setAttribute('URL', $a['WebPage']);

***************
*** 621,627 ****
                   break;

               case 'ORG':
!                 $hash['CompanyName'] = $item['value'];
                   break;

               case 'NOTE':
--- 628,636 ----
                   break;

               case 'ORG':
!                 $values = preg_split('/(?<!\\\\);/', 
trim($item['value']));
!                 $hash['CompanyName'] = $values[0];
!                 $hash['Department'] = $values[1];
                   break;

               case 'NOTE':




More information about the sync mailing list