2005-07-20 14:14:39 +02:00
|
|
|
<?php
|
2006-07-09 01:02:30 +02:00
|
|
|
/**
|
|
|
|
* Addressbook - vCard / iCal parser
|
|
|
|
*
|
|
|
|
* @link http://www.egroupware.org
|
|
|
|
* @author Lars Kneschke <lkneschke@egroupware.org>
|
|
|
|
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
|
|
|
* @package addressbook
|
2008-05-10 14:02:49 +02:00
|
|
|
* @subpackage export
|
2006-07-09 01:02:30 +02:00
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
2008-04-16 06:37:05 +02:00
|
|
|
* @version $Id$
|
2006-07-09 01:02:30 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
require_once EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar.php';
|
|
|
|
|
2008-05-10 14:02:49 +02:00
|
|
|
/**
|
|
|
|
* Addressbook - vCard parser
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class addressbook_vcal extends addressbook_bo
|
2006-07-09 01:02:30 +02:00
|
|
|
{
|
2008-05-10 14:02:49 +02:00
|
|
|
/**
|
|
|
|
* product manufacturer from setSupportedFields (lowercase!)
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
var $productManufacturer='file';
|
|
|
|
/**
|
|
|
|
* product name from setSupportedFields (lowercase!)
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
var $productName;
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
/**
|
|
|
|
* import a vard into addressbook
|
2008-04-16 06:37:05 +02:00
|
|
|
*
|
2006-07-09 01:02:30 +02:00
|
|
|
* @param string $_vcard the vcard
|
2006-07-10 01:35:16 +02:00
|
|
|
* @param int/string $_abID=null the internal addressbook id or !$_abID for a new enty
|
2006-07-09 01:02:30 +02:00
|
|
|
* @return int contact id
|
|
|
|
*/
|
|
|
|
function addVCard($_vcard, $_abID)
|
2005-07-20 14:14:39 +02:00
|
|
|
{
|
2006-07-09 01:02:30 +02:00
|
|
|
if(!$contact = $this->vcardtoegw($_vcard)) {
|
|
|
|
return false;
|
|
|
|
}
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2006-07-10 01:35:16 +02:00
|
|
|
if($_abID) {
|
2006-07-09 01:02:30 +02:00
|
|
|
// update entry
|
2006-07-09 15:29:19 +02:00
|
|
|
$contact['id'] = $_abID;
|
2005-07-20 14:14:39 +02:00
|
|
|
}
|
2006-07-10 00:59:22 +02:00
|
|
|
return $this->save($contact);
|
2006-07-09 01:02:30 +02:00
|
|
|
}
|
2005-07-20 14:14:39 +02:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
/**
|
|
|
|
* return a vcard
|
|
|
|
*
|
|
|
|
* @param int/string $_id the id of the contact
|
2008-04-22 10:55:18 +02:00
|
|
|
* @param string $_charset='utf-8' encoding of the vcard, default utf-8
|
2008-06-07 20:00:29 +02:00
|
|
|
* @param boolean $extra_charset_attribute=true GroupDAV/CalDAV dont need the charset attribute and some clients have problems with it
|
2006-07-09 01:02:30 +02:00
|
|
|
* @return string containing the vcard
|
|
|
|
*/
|
2008-06-07 20:00:29 +02:00
|
|
|
function getVCard($_id,$_charset='utf-8',$extra_charset_attribute=true)
|
2006-07-09 01:02:30 +02:00
|
|
|
{
|
|
|
|
require_once(EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar/vcard.php');
|
2005-07-20 14:14:39 +02:00
|
|
|
|
2009-08-27 09:30:50 +02:00
|
|
|
$vCard = new Horde_iCalendar_vcard;
|
2009-06-29 21:06:48 +02:00
|
|
|
|
2006-07-09 15:29:19 +02:00
|
|
|
if(!is_array($this->supportedFields)) {
|
2006-07-09 01:02:30 +02:00
|
|
|
$this->setSupportedFields();
|
|
|
|
}
|
|
|
|
$sysCharSet = $GLOBALS['egw']->translation->charset();
|
2009-04-02 14:31:44 +02:00
|
|
|
$called = microtime(true);
|
2006-07-09 15:29:19 +02:00
|
|
|
if(!($entry = $this->read($_id))) {
|
2006-07-09 01:02:30 +02:00
|
|
|
return false;
|
|
|
|
}
|
2009-04-02 14:31:44 +02:00
|
|
|
//error_log("entry before fixed:\n".print_r($entry,true));
|
2009-06-29 21:06:48 +02:00
|
|
|
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
$this->fixup_contact($entry);
|
2009-06-29 21:06:48 +02:00
|
|
|
|
|
|
|
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
foreach($this->supportedFields as $vcardField => $databaseFields)
|
|
|
|
{
|
|
|
|
$values = array();
|
2006-07-09 01:02:30 +02:00
|
|
|
$options = array();
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
$hasdata = 0;
|
|
|
|
foreach($databaseFields as $databaseField)
|
|
|
|
{
|
|
|
|
$value = "";
|
|
|
|
|
|
|
|
if (!empty($databaseField))
|
|
|
|
{
|
|
|
|
$value = trim($entry[$databaseField]);
|
2006-05-17 05:36:48 +02:00
|
|
|
}
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
|
|
|
|
switch($databaseField)
|
|
|
|
{
|
|
|
|
case 'private':
|
|
|
|
$value = $value ? 'PRIVATE' : 'PUBLIC';
|
|
|
|
$hasdata++;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'bday':
|
|
|
|
if (!empty($value))
|
|
|
|
{
|
|
|
|
$value = str_replace('-','',$value).'T000000Z';
|
|
|
|
$hasdata++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'jpegphoto':
|
|
|
|
if(!empty($value))
|
|
|
|
{
|
2009-08-27 09:30:50 +02:00
|
|
|
//error_log(__FILE__ ."\nThis vcard contains a JPEG\n '".$value."'");
|
2008-04-16 06:37:05 +02:00
|
|
|
$options['ENCODING'] = 'BASE64';
|
|
|
|
$options['TYPE'] = 'JPEG';
|
|
|
|
$value = base64_encode($value);
|
|
|
|
$hasdata++;
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'cat_id':
|
|
|
|
if (!empty($value))
|
|
|
|
{
|
|
|
|
$value = implode(",", $this->get_categories($value));
|
|
|
|
}
|
|
|
|
// fall-through to the normal processing of string values
|
|
|
|
default:
|
2008-06-07 20:00:29 +02:00
|
|
|
if(!empty($value) || in_array($vcardField,array('FN','ORG','N')))
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
{
|
2008-04-22 10:55:18 +02:00
|
|
|
$value = $GLOBALS['egw']->translation->convert(trim($value), $sysCharSet,$_charset);
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
|
2008-11-03 10:36:20 +01:00
|
|
|
if(($extra_charset_attribute || $this->productName == 'kde') && preg_match('/([\177-\377])/',$value))
|
2008-04-16 18:05:48 +02:00
|
|
|
{
|
2008-04-22 10:55:18 +02:00
|
|
|
$options['CHARSET'] = $_charset;
|
2008-05-10 14:02:49 +02:00
|
|
|
// KAddressbook requires non-ascii chars to be qprint encoded, other clients eg. nokia phones have trouble with that
|
2008-11-03 10:36:20 +01:00
|
|
|
if ($this->productName == 'kde')
|
2008-05-10 14:02:49 +02:00
|
|
|
{
|
|
|
|
$options['ENCODING'] = 'QUOTED-PRINTABLE';
|
|
|
|
}
|
2008-04-16 18:05:48 +02:00
|
|
|
}
|
2009-04-02 14:31:44 +02:00
|
|
|
// protect the CardDAV
|
|
|
|
elseif(($extra_charset_attribute && preg_match('/([\000-\012\015\016\020-\037\075])/',$value)))
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
{
|
|
|
|
$options['ENCODING'] = 'QUOTED-PRINTABLE';
|
|
|
|
}
|
|
|
|
$hasdata++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (empty($value))
|
|
|
|
{
|
|
|
|
$value = "";
|
|
|
|
}
|
2009-04-02 14:31:44 +02:00
|
|
|
//if(preg_match('/([\000-\010])/',$value)) error_log(__FILE__."#".__METHOD__."\nThis value has 000-010: $value");
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
|
|
|
|
$values[] = $value;
|
2006-03-21 14:19:38 +01:00
|
|
|
}
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
|
2008-06-07 20:00:29 +02:00
|
|
|
if ($hasdata <= 0)
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
{
|
2007-10-31 22:17:40 +01:00
|
|
|
// don't add the entry if there is no data for this field,
|
|
|
|
// except it's a mendatory field
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
continue;
|
2006-03-21 14:19:38 +01:00
|
|
|
}
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
|
|
|
|
$vCard->setAttribute($vcardField, implode(';', $values));
|
2006-07-09 01:02:30 +02:00
|
|
|
$vCard->setParameter($vcardField, $options);
|
|
|
|
}
|
|
|
|
$result = $vCard->exportvCalendar();
|
2009-08-27 09:30:50 +02:00
|
|
|
//error_log(__LINE__.__FILE__ . __METHOD__ ."\export vcard:".print_r($result,true));
|
2006-07-09 01:02:30 +02:00
|
|
|
return $result;
|
|
|
|
}
|
2006-03-21 14:19:38 +01:00
|
|
|
|
Big SyncML patch from Philip Herbert <pherbert(at)knauber.de>:
- change the processing of slowsync, to use the content_map instead of
trying to build a new one. This caused duplication issues on the
client if multiple similar records where stored, because only the first
one found in the server-db was matched, These duplicate entries at client
side had no entry at serverside, so deleting the wrong one
on the client (the content with a valid map entry) could cause
unwanted data loss at server side, because it is impossible for the
user to see what is a duplicate, and what is not.
see also:
http://www.nabble.com/again---syncml-duplication-issue-to20333619s3741.html
- reenabled UID from syncml clients, because it was partly used this caused
issues during SlowSync if the content was changed.
- infolog, calendar if a uid is found in the provided data, allway try to
find the corresponding content first using only the UID, instead of
using the content-id taken from content_map.
also fixed:
- a few fixes in ./notes
- creating an entry on the client that can not be imported,
(Example, Nokia E Series Appointment without a Title)
will no longer create an invalid content-map entry
However, at client side this is still counted in the Protocol as
Server-Add
2008-11-16 11:42:29 +01:00
|
|
|
function search($_vcard, $contentID=null)
|
2006-07-09 01:02:30 +02:00
|
|
|
{
|
2006-07-09 15:29:19 +02:00
|
|
|
if(!($contact = $this->vcardtoegw($_vcard))) {
|
2006-07-09 01:02:30 +02:00
|
|
|
return false;
|
|
|
|
}
|
2008-04-16 06:37:05 +02:00
|
|
|
|
Big SyncML patch from Philip Herbert <pherbert(at)knauber.de>:
- change the processing of slowsync, to use the content_map instead of
trying to build a new one. This caused duplication issues on the
client if multiple similar records where stored, because only the first
one found in the server-db was matched, These duplicate entries at client
side had no entry at serverside, so deleting the wrong one
on the client (the content with a valid map entry) could cause
unwanted data loss at server side, because it is impossible for the
user to see what is a duplicate, and what is not.
see also:
http://www.nabble.com/again---syncml-duplication-issue-to20333619s3741.html
- reenabled UID from syncml clients, because it was partly used this caused
issues during SlowSync if the content was changed.
- infolog, calendar if a uid is found in the provided data, allway try to
find the corresponding content first using only the UID, instead of
using the content-id taken from content_map.
also fixed:
- a few fixes in ./notes
- creating an entry on the client that can not be imported,
(Example, Nokia E Series Appointment without a Title)
will no longer create an invalid content-map entry
However, at client side this is still counted in the Protocol as
Server-Add
2008-11-16 11:42:29 +01:00
|
|
|
if ($contentID) {
|
|
|
|
$contact['contact_id'] = $contentID;
|
|
|
|
}
|
|
|
|
|
2006-07-09 15:29:19 +02:00
|
|
|
unset($contact['private']);
|
|
|
|
unset($contact['note']);
|
|
|
|
unset($contact['n_fn']);
|
2007-01-23 18:34:24 +01:00
|
|
|
unset($contact['email']);
|
|
|
|
unset($contact['email_home']);
|
|
|
|
unset($contact['url']);
|
|
|
|
unset($contact['url_home']);
|
2008-10-10 08:28:58 +02:00
|
|
|
unset($contact['n_fileas']);
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2007-01-23 18:34:24 +01:00
|
|
|
// some clients cut the values, because they do not support the same length of data like eGW
|
|
|
|
// at least the first 10 characters must match
|
|
|
|
$maybeCuttedFields = array('org_unit', 'org_name','title');
|
|
|
|
foreach($maybeCuttedFields as $fieldName) {
|
|
|
|
if(!empty($contact[$fieldName]) && strlen($contact[$fieldName]) > 10) {
|
|
|
|
$contact[$fieldName] .= '*';
|
|
|
|
}
|
|
|
|
}
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2007-03-01 21:17:51 +01:00
|
|
|
//error_log(print_r($contact, true));
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2007-01-23 18:34:24 +01:00
|
|
|
#if($foundContacts = parent::search($contact, true, '', '', '%')) {
|
2006-07-09 15:29:19 +02:00
|
|
|
if($foundContacts = parent::search($contact)) {
|
2006-07-09 01:02:30 +02:00
|
|
|
return $foundContacts[0]['id'];
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2006-03-21 14:19:38 +01:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
function setSupportedFields($_productManufacturer='file', $_productName='')
|
|
|
|
{
|
2008-05-10 14:02:49 +02:00
|
|
|
// store product manufacturer and name, to be able to use it elsewhere
|
|
|
|
$this->productManufacturer = strtolower($_productManufacturer);
|
|
|
|
$this->productName = strtolower($_productName);
|
2009-04-02 14:31:44 +02:00
|
|
|
//error_log("prodM- prodN".print_r($_productManufacturer,true).print_r($_productName,true));
|
2006-07-09 01:02:30 +02:00
|
|
|
/**
|
2008-04-16 06:37:05 +02:00
|
|
|
* ToDo Lars:
|
2006-07-09 01:02:30 +02:00
|
|
|
* + changes / renamed fields in 1.3+:
|
|
|
|
* - access --> private (already done by Ralf)
|
|
|
|
* - tel_msg --> tel_assistent
|
|
|
|
* - tel_modem --> tel_fax_home
|
|
|
|
* - tel_isdn --> tel_cell_private
|
|
|
|
* - tel_voice/ophone --> tel_other
|
|
|
|
* - address2 --> adr_one_street2
|
|
|
|
* - address3 --> adr_two_street2
|
|
|
|
* - freebusy_url --> freebusy_uri (i instead l !)
|
|
|
|
* - fn --> n_fn
|
|
|
|
* - last_mod --> modified
|
|
|
|
* + new fields in 1.3+:
|
|
|
|
* - n_fileas
|
|
|
|
* - role
|
|
|
|
* - assistent
|
|
|
|
* - room
|
|
|
|
* - calendar_uri
|
|
|
|
* - url_home
|
|
|
|
* - created
|
|
|
|
* - creator (preset with owner)
|
|
|
|
* - modifier
|
|
|
|
* - jpegphoto
|
|
|
|
*/
|
2007-10-25 08:26:50 +02:00
|
|
|
$defaultFields[0] = array( // multisync
|
2006-07-09 01:02:30 +02:00
|
|
|
'ADR' => array('','','adr_one_street','adr_one_locality','adr_one_region',
|
|
|
|
'adr_one_postalcode','adr_one_countryname'),
|
|
|
|
'CATEGORIES' => array('cat_id'),
|
|
|
|
'CLASS' => array('private'),
|
|
|
|
'EMAIL' => array('email'),
|
|
|
|
'N' => array('n_family','n_given','','',''),
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
'FN' => array('n_fn'),
|
2006-07-09 01:02:30 +02:00
|
|
|
'NOTE' => array('note'),
|
|
|
|
'ORG' => array('org_name',''),
|
|
|
|
'TEL;CELL' => array('tel_cell'),
|
|
|
|
'TEL;FAX' => array('tel_fax'),
|
|
|
|
'TEL;HOME' => array('tel_home'),
|
|
|
|
'TEL;WORK' => array('tel_work'),
|
|
|
|
'TITLE' => array('title'),
|
|
|
|
);
|
|
|
|
|
2008-11-03 10:36:20 +01:00
|
|
|
$defaultFields[1] = array( // all entries, nexthaus corporation, groupdav, ...
|
2006-07-09 01:02:30 +02:00
|
|
|
'ADR;WORK' => array('','','adr_one_street','adr_one_locality','adr_one_region',
|
|
|
|
'adr_one_postalcode','adr_one_countryname'),
|
|
|
|
'ADR;HOME' => array('','','adr_two_street','adr_two_locality','adr_two_region',
|
|
|
|
'adr_two_postalcode','adr_two_countryname'),
|
|
|
|
'BDAY' => array('bday'),
|
|
|
|
'CATEGORIES' => array('cat_id'),
|
2009-04-02 14:31:44 +02:00
|
|
|
'EMAIL;INTERNET' => array('email'),//tp4 tp43
|
|
|
|
'EMAIL;INTERNET;HOME' => array('email_home'),//tp42 tp42
|
|
|
|
#'EMAIL;INTERNET;WORK' => array('#email_work'),//tp43 lost
|
2006-07-09 01:02:30 +02:00
|
|
|
'N' => array('n_family','n_given','n_middle','n_prefix','n_suffix'),
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
'FN' => array('n_fn'),
|
2006-07-09 01:02:30 +02:00
|
|
|
'NOTE' => array('note'),
|
|
|
|
'ORG' => array('org_name','org_unit'),
|
|
|
|
'TEL;CELL;WORK' => array('tel_cell'),
|
2007-10-25 08:26:50 +02:00
|
|
|
'TEL;CELL;HOME' => array('tel_cell_private'),
|
2006-07-09 01:02:30 +02:00
|
|
|
'TEL;FAX;WORK' => array('tel_fax'),
|
2007-10-25 08:26:50 +02:00
|
|
|
'TEL;FAX;HOME' => array('tel_fax_home'),
|
2006-07-09 01:02:30 +02:00
|
|
|
'TEL;HOME' => array('tel_home'),
|
|
|
|
'TEL;PAGER;WORK' => array('tel_pager'),
|
|
|
|
'TEL;WORK' => array('tel_work'),
|
|
|
|
'TITLE' => array('title'),
|
|
|
|
'URL;WORK' => array('url'),
|
2006-07-09 15:29:19 +02:00
|
|
|
'ROLE' => array('role'),
|
2007-10-25 08:26:50 +02:00
|
|
|
'URL;HOME' => array('url_home'),
|
|
|
|
'FBURL' => array('freebusy_uri'),
|
2008-04-16 06:37:05 +02:00
|
|
|
'PHOTO' => array('jpegphoto'),
|
2008-05-10 23:01:53 +02:00
|
|
|
'UID' => array('uid'),
|
2006-07-09 01:02:30 +02:00
|
|
|
);
|
|
|
|
|
2007-10-25 08:26:50 +02:00
|
|
|
$defaultFields[2] = array( // sony ericson
|
2006-07-09 01:02:30 +02:00
|
|
|
'ADR;HOME' => array('','','adr_one_street','adr_one_locality','adr_one_region',
|
|
|
|
'adr_one_postalcode','adr_one_countryname'),
|
|
|
|
'BDAY' => array('bday'),
|
|
|
|
'CATEGORIES' => array('cat_id'),
|
|
|
|
'CLASS' => array('private'),
|
|
|
|
'EMAIL' => array('email'),
|
|
|
|
'N' => array('n_family','n_given','','',''),
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
'FN' => array('n_fn'),
|
2006-07-09 01:02:30 +02:00
|
|
|
'NOTE' => array('note'),
|
|
|
|
'ORG' => array('org_name',''),
|
|
|
|
'TEL;CELL;WORK' => array('tel_cell'),
|
|
|
|
'TEL;FAX;WORK' => array('tel_fax'),
|
|
|
|
'TEL;HOME' => array('tel_home'),
|
|
|
|
'TEL;WORK' => array('tel_work'),
|
|
|
|
'TITLE' => array('title'),
|
2006-07-09 15:29:19 +02:00
|
|
|
'URL;WORK' => array('url'),
|
2006-07-09 01:02:30 +02:00
|
|
|
);
|
|
|
|
|
2007-10-25 08:26:50 +02:00
|
|
|
$defaultFields[3] = array( // siemens
|
2006-07-09 01:02:30 +02:00
|
|
|
'ADR;WORK' => array('','','adr_one_street','adr_one_locality','adr_one_region',
|
|
|
|
'adr_one_postalcode','adr_one_countryname'),
|
|
|
|
'ADR;HOME' => array('','','adr_two_street','adr_two_locality','adr_two_region',
|
|
|
|
'adr_two_postalcode','adr_two_countryname'),
|
|
|
|
'BDAY' => array('bday'),
|
|
|
|
'EMAIL;INTERNET;WORK' => array('email'),
|
|
|
|
'EMAIL;INTERNET;HOME' => array('email_home'),
|
|
|
|
'N' => array('n_family','n_given','','',''),
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
'FN' => array('n_fn'),
|
2006-07-09 01:02:30 +02:00
|
|
|
'NOTE' => array('note'),
|
|
|
|
'ORG' => array('org_name','org_unit'),
|
|
|
|
'TEL;CELL;WORK' => array('tel_cell'),
|
|
|
|
'TEL;FAX;WORK' => array('tel_fax'),
|
|
|
|
'TEL;HOME' => array('tel_home'),
|
|
|
|
'TEL;PAGER;WORK' => array('tel_pager'),
|
|
|
|
'TEL;WORK' => array('tel_work'),
|
|
|
|
'TITLE' => array('title'),
|
|
|
|
'URL;WORK' => array('url'),
|
|
|
|
);
|
|
|
|
|
2007-10-25 08:26:50 +02:00
|
|
|
$defaultFields[4] = array( // nokia 6600
|
2006-07-23 20:10:37 +02:00
|
|
|
'ADR;WORK' => array('','','adr_one_street','adr_one_locality','adr_one_region',
|
|
|
|
'adr_one_postalcode','adr_one_countryname'),
|
|
|
|
'ADR;HOME' => array('','','adr_two_street','adr_two_locality','adr_two_region',
|
|
|
|
'adr_two_postalcode','adr_two_countryname'),
|
|
|
|
'BDAY' => array('bday'),
|
|
|
|
'EMAIL;INTERNET;WORK' => array('email'),
|
|
|
|
'EMAIL;INTERNET;HOME' => array('email_home'),
|
|
|
|
'N' => array('n_family','n_given','','',''),
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
'FN' => array('n_fn'),
|
2006-07-23 20:10:37 +02:00
|
|
|
'NOTE' => array('note'),
|
|
|
|
'ORG' => array('org_name',''),
|
|
|
|
'TEL;CELL;WORK' => array('tel_cell'),
|
|
|
|
'TEL;CELL;HOME' => array('tel_cell_private'),
|
|
|
|
'TEL;FAX;WORK' => array('tel_fax'),
|
|
|
|
'TEL;FAX;HOME' => array('tel_fax_home'),
|
|
|
|
'TEL;HOME' => array('tel_home'),
|
|
|
|
'TEL;PAGER;WORK' => array('tel_pager'),
|
|
|
|
'TEL;WORK' => array('tel_work'),
|
|
|
|
'TITLE' => array('title'),
|
|
|
|
'URL;WORK' => array('url'),
|
2006-08-15 14:46:26 +02:00
|
|
|
'URL;HOME' => array('url_home'),
|
2006-07-23 20:10:37 +02:00
|
|
|
);
|
|
|
|
|
2007-10-25 08:26:50 +02:00
|
|
|
$defaultFields[5] = array( // nokia e61
|
2006-08-15 14:46:26 +02:00
|
|
|
'ADR;WORK' => array('','','adr_one_street','adr_one_locality','adr_one_region',
|
|
|
|
'adr_one_postalcode','adr_one_countryname'),
|
|
|
|
'ADR;HOME' => array('','','adr_two_street','adr_two_locality','adr_two_region',
|
|
|
|
'adr_two_postalcode','adr_two_countryname'),
|
|
|
|
'BDAY' => array('bday'),
|
|
|
|
'EMAIL;INTERNET;WORK' => array('email'),
|
|
|
|
'EMAIL;INTERNET;HOME' => array('email_home'),
|
|
|
|
'N' => array('n_family','n_given','','n_prefix','n_suffix'),
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
'FN' => array('n_fn'),
|
2006-08-15 14:46:26 +02:00
|
|
|
'NOTE' => array('note'),
|
|
|
|
'ORG' => array('org_name',''),
|
|
|
|
'TEL;CELL;WORK' => array('tel_cell'),
|
|
|
|
'TEL;CELL;HOME' => array('tel_cell_private'),
|
|
|
|
'TEL;FAX;WORK' => array('tel_fax'),
|
|
|
|
'TEL;FAX;HOME' => array('tel_fax_home'),
|
|
|
|
'TEL;HOME' => array('tel_home'),
|
|
|
|
'TEL;PAGER;WORK' => array('tel_pager'),
|
|
|
|
'TEL;WORK' => array('tel_work'),
|
|
|
|
'TITLE' => array('title'),
|
|
|
|
'URL;WORK' => array('url'),
|
|
|
|
'URL;HOME' => array('url_home'),
|
|
|
|
);
|
2007-06-25 01:53:10 +02:00
|
|
|
|
2007-10-25 08:26:50 +02:00
|
|
|
$defaultFields[6] = array( // funambol: fmz-thunderbird-plugin
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
'ADR;WORK' => array('','','adr_one_street','adr_one_locality','adr_one_region',
|
|
|
|
'adr_one_postalcode','adr_one_countryname'),
|
|
|
|
'ADR;HOME' => array('','','adr_two_street','adr_two_locality','adr_two_region',
|
|
|
|
'adr_two_postalcode','adr_two_countryname'),
|
|
|
|
'EMAIL' => array('email'),
|
|
|
|
'EMAIL;HOME' => array('email_home'),
|
|
|
|
'N' => array('n_family','n_given','','',''),
|
|
|
|
'FN' => array('n_fn'),
|
|
|
|
'NOTE' => array('note'),
|
|
|
|
'ORG' => array('org_name','org_unit'),
|
|
|
|
'TEL;CELL' => array('tel_cell'),
|
|
|
|
'TEL;HOME;FAX' => array('tel_fax'),
|
2007-06-25 01:53:10 +02:00
|
|
|
'TEL;HOME;VOICE' => array('tel_home'),
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
'TEL;PAGER' => array('tel_pager'),
|
2007-06-25 01:53:10 +02:00
|
|
|
'TEL;WORK;VOICE' => array('tel_work'),
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
'TITLE' => array('title'),
|
|
|
|
'URL;WORK' => array('url'),
|
|
|
|
'URL' => array('url_home'),
|
2007-06-25 01:53:10 +02:00
|
|
|
);
|
2008-04-16 18:05:48 +02:00
|
|
|
|
|
|
|
$defaultFields[7] = array( // SyncEvolution
|
2007-12-03 11:21:50 +01:00
|
|
|
'N'=> array('n_family','n_given','n_middle','n_prefix','n_suffix'),
|
|
|
|
'TITLE' => array('title'),
|
|
|
|
'ROLE' => array('role'),
|
|
|
|
'ORG' => array('org_name','org_unit','room'),
|
|
|
|
'ADR;WORK' => array('','adr_one_street2','adr_one_street','adr_one_locality','adr_one_region', 'adr_one_postalcode','adr_one_countryname'),
|
|
|
|
'ADR;HOME' => array('','adr_two_street2','adr_two_street','adr_two_locality','adr_two_region', 'adr_two_postalcode','adr_two_countryname'),
|
|
|
|
'TEL;WORK;VOICE' => array('tel_work'),
|
|
|
|
'TEL;HOME;VOICE' => array('tel_home'),
|
|
|
|
'TEL;CELL;WORK' => array('tel_cell'),
|
|
|
|
'TEL;FAX;WORK' => array('tel_fax'),
|
|
|
|
'TEL;FAX;HOME' => array('tel_fax_home'),
|
|
|
|
'TEL;PAGER;WORK' => array('tel_pager'),
|
|
|
|
'TEL;CAR' => array('tel_car'),
|
|
|
|
'TEL;VOICE' => array('tel_other'),
|
|
|
|
'EMAIL;INTERNET;WORK' => array('email'),
|
|
|
|
'EMAIL;INTERNET;HOME' => array('email_home'),
|
|
|
|
'URL;WORK' => array('url'),
|
|
|
|
'BDAY' => array('bday'),
|
|
|
|
'CATEGORIES' => array('cat_id'),
|
|
|
|
'NOTE' => array('note'),
|
|
|
|
'X-EVOLUTION-ASSISTANT' => array('assistent'),
|
2008-04-16 06:37:05 +02:00
|
|
|
'PHOTO' => array('jpegphoto'),
|
2007-12-03 11:21:50 +01:00
|
|
|
);
|
|
|
|
|
2008-04-16 18:05:48 +02:00
|
|
|
$defaultFields[8] = array_merge($defaultFields[1],array( // KDE Addressbook, only changes from all=1
|
|
|
|
'ORG' => array('org_name'),
|
|
|
|
'X-KADDRESSBOOK-X-Department' => array('org_unit'),
|
|
|
|
'PHOTO' => array('jpegphoto'),
|
|
|
|
));
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
|
2008-09-03 19:09:17 +02:00
|
|
|
$defaultFields[9] = array( // nokia e90
|
2008-11-03 08:44:02 +01:00
|
|
|
'ADR;WORK' => array('','adr_one_street2','adr_one_street','adr_one_locality','adr_one_region',
|
2008-09-03 19:09:17 +02:00
|
|
|
'adr_one_postalcode','adr_one_countryname'),
|
2008-11-03 08:44:02 +01:00
|
|
|
'ADR;HOME' => array('','adr_two_street2','adr_two_street','adr_two_locality','adr_two_region',
|
2008-09-03 19:09:17 +02:00
|
|
|
'adr_two_postalcode','adr_two_countryname'),
|
|
|
|
'BDAY' => array('bday'),
|
|
|
|
'X-CLASS' => array('private'),
|
|
|
|
'EMAIL;INTERNET;WORK' => array('email'),
|
|
|
|
'EMAIL;INTERNET;HOME' => array('email_home'),
|
|
|
|
'N' => array('n_family','n_given','n_middle','n_prefix','n_suffix'),
|
|
|
|
'FN' => array('n_fn'),
|
|
|
|
'NOTE' => array('note'),
|
|
|
|
'ORG' => array('org_name','org_unit'),
|
|
|
|
'TEL;CELL;WORK' => array('tel_cell'),
|
|
|
|
'TEL;CELL;HOME' => array('tel_cell_private'),
|
|
|
|
'TEL;FAX;WORK' => array('tel_fax'),
|
|
|
|
'TEL;FAX;HOME' => array('tel_fax_home'),
|
|
|
|
'TEL;CAR' => array('tel_car'),
|
|
|
|
'TEL;PAGER;WORK' => array('tel_pager'),
|
|
|
|
'TEL;VOICE;WORK' => array('tel_work'),
|
2008-10-10 08:28:58 +02:00
|
|
|
'TEL;VOICE;HOME' => array('tel_home'),
|
2008-11-03 08:44:02 +01:00
|
|
|
'TITLE' => array('title'),
|
2008-09-03 19:09:17 +02:00
|
|
|
'URL;WORK' => array('url'),
|
|
|
|
'URL;HOME' => array('url_home'),
|
|
|
|
'X-ASSISTANT' => array('assistent'),
|
|
|
|
'X-ASSISTANT-TEL' => array('tel_assistent'),
|
|
|
|
'PHOTO' => array('jpegphoto'),
|
|
|
|
);
|
2008-10-10 08:28:58 +02:00
|
|
|
|
2008-09-03 19:09:17 +02:00
|
|
|
$defaultFields[10] = array( // nokia 9300
|
|
|
|
'ADR;WORK' => array('','','adr_one_street','adr_one_locality','adr_one_region',
|
|
|
|
'adr_one_postalcode','adr_one_countryname'),
|
|
|
|
'ADR;HOME' => array('','','adr_two_street','adr_two_locality','adr_two_region',
|
|
|
|
'adr_two_postalcode','adr_two_countryname'),
|
|
|
|
'BDAY' => array('bday'),
|
|
|
|
'EMAIL;INTERNET' => array('email'),
|
|
|
|
'N' => array('n_family','n_given','n_middle','n_prefix','n_suffix'),
|
|
|
|
'FN' => array('n_fn'),
|
|
|
|
'NOTE' => array('note'),
|
|
|
|
'ORG' => array('org_name','org_unit'),
|
|
|
|
'TEL;CELL' => array('tel_cell'),
|
|
|
|
'TEL;WORK;FAX' => array('tel_fax'),
|
|
|
|
'TEL;FAX' => array('tel_fax_home'),
|
|
|
|
'TEL;PAGER' => array('tel_pager'),
|
|
|
|
'TEL;WORK;VOICE' => array('tel_work'),
|
2008-10-10 08:28:58 +02:00
|
|
|
'TEL;HOME;VOICE' => array('tel_home'),
|
2008-09-03 19:09:17 +02:00
|
|
|
'TITLE' => array('contact_role'),
|
|
|
|
'URL' => array('url'),
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
$defaultFields[11] = array( // funambol: iphone
|
|
|
|
'ADR;WORK' => array('','','adr_one_street','adr_one_locality','adr_one_region',
|
|
|
|
'adr_one_postalcode','adr_one_countryname'),
|
|
|
|
'ADR;HOME' => array('','','adr_two_street','adr_two_locality','adr_two_region',
|
|
|
|
'adr_two_postalcode','adr_two_countryname'),
|
|
|
|
'EMAIL;INTERNET;WORK' => array('email'),
|
|
|
|
'EMAIL;INTERNET;HOME' => array('email_home'),
|
|
|
|
'N' => array('n_family','n_given','n_middle','n_prefix','n_suffix'),
|
|
|
|
'FN' => array('n_fn'),
|
|
|
|
'NOTE' => array('note'),
|
|
|
|
'ORG' => array('org_name','org_unit'),
|
|
|
|
'TEL;CELL' => array('tel_cell'),
|
|
|
|
'TEL;HOME;FAX' => array('tel_fax_home'),
|
|
|
|
'TEL;WORK;FAX' => array('tel_fax'),
|
|
|
|
'TEL;VOICE;HOME' => array('tel_home'),
|
|
|
|
'TEL;VOICE;WORK' => array('tel_work'),
|
|
|
|
'TEL;PAGER' => array('tel_pager'),
|
2008-10-10 08:28:58 +02:00
|
|
|
'TEL;CAR' => array('tel_car'),
|
2008-09-03 19:09:17 +02:00
|
|
|
'TITLE' => array('title'),
|
|
|
|
'URL;WORK' => array('url'),
|
|
|
|
'URL;HOME' => array('url_home'),
|
|
|
|
'PHOTO' => array('jpegphoto'),
|
|
|
|
);
|
|
|
|
|
2006-08-15 14:46:26 +02:00
|
|
|
//error_log("Client: $_productManufacturer $_productName");
|
2008-05-10 14:02:49 +02:00
|
|
|
switch($this->productManufacturer)
|
2006-07-09 01:02:30 +02:00
|
|
|
{
|
2007-06-25 01:53:10 +02:00
|
|
|
case 'funambol':
|
2008-09-03 19:09:17 +02:00
|
|
|
case 'funambol inc.':
|
2008-05-10 14:02:49 +02:00
|
|
|
switch ($this->productName)
|
2007-06-25 01:53:10 +02:00
|
|
|
{
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
case 'thunderbird':
|
|
|
|
$this->supportedFields = $defaultFields[6];
|
|
|
|
break;
|
|
|
|
|
2008-09-03 19:09:17 +02:00
|
|
|
case 'iphone':
|
|
|
|
$this->supportedFields = $defaultFields[11];
|
|
|
|
break;
|
|
|
|
|
2007-06-25 01:53:10 +02:00
|
|
|
default:
|
2009-04-02 14:31:44 +02:00
|
|
|
//error_log("Funambol product '$_productName', assuming same as thunderbird");
|
2007-06-25 01:53:10 +02:00
|
|
|
$this->supportedFields = $defaultFields[6];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
case 'nexthaus corporation':
|
2008-03-27 08:50:35 +01:00
|
|
|
case 'nexthaus corp':
|
2008-05-10 14:02:49 +02:00
|
|
|
switch($this->productName)
|
2006-03-21 14:19:38 +01:00
|
|
|
{
|
2006-07-09 01:02:30 +02:00
|
|
|
case 'syncje outlook edition':
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
$this->supportedFields = $defaultFields[1];
|
|
|
|
break;
|
2006-07-09 01:02:30 +02:00
|
|
|
default:
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
error_log("Nethaus product '$_productName', assuming same as 'syncje outlook'");
|
2006-07-09 01:02:30 +02:00
|
|
|
$this->supportedFields = $defaultFields[1];
|
|
|
|
break;
|
2006-03-21 14:19:38 +01:00
|
|
|
}
|
2006-07-09 01:02:30 +02:00
|
|
|
break;
|
|
|
|
|
2006-07-23 20:10:37 +02:00
|
|
|
case 'nokia':
|
2008-05-10 14:02:49 +02:00
|
|
|
switch($this->productName)
|
2006-07-23 20:10:37 +02:00
|
|
|
{
|
2006-08-15 14:46:26 +02:00
|
|
|
case 'e61':
|
|
|
|
$this->supportedFields = $defaultFields[5];
|
|
|
|
break;
|
2008-09-03 19:09:17 +02:00
|
|
|
case 'e51':
|
|
|
|
case 'e90':
|
2008-11-03 08:44:02 +01:00
|
|
|
case 'e71':
|
2008-09-03 19:09:17 +02:00
|
|
|
$this->supportedFields = $defaultFields[9];
|
|
|
|
break;
|
|
|
|
case '9300':
|
|
|
|
$this->supportedFields = $defaultFields[10];
|
|
|
|
break;
|
2006-07-23 20:10:37 +02:00
|
|
|
case '6600':
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
$this->supportedFields = $defaultFields[4];
|
|
|
|
break;
|
2006-07-23 20:10:37 +02:00
|
|
|
default:
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
error_log("Unknown Nokia phone '$_productName', assuming same as '6600'");
|
2006-07-23 20:10:37 +02:00
|
|
|
$this->supportedFields = $defaultFields[4];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2006-07-23 20:10:37 +02:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
// multisync does not provide anymore information then the manufacturer
|
|
|
|
// we suppose multisync with evolution
|
|
|
|
case 'the multisync project':
|
2008-05-10 14:02:49 +02:00
|
|
|
switch($this->productName)
|
2006-03-21 14:19:38 +01:00
|
|
|
{
|
2006-07-09 01:02:30 +02:00
|
|
|
default:
|
|
|
|
$this->supportedFields = $defaultFields[0];
|
|
|
|
break;
|
2006-03-21 14:19:38 +01:00
|
|
|
}
|
2006-07-09 01:02:30 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'siemens':
|
2008-05-10 14:02:49 +02:00
|
|
|
switch($this->productName)
|
2006-03-21 14:19:38 +01:00
|
|
|
{
|
2006-07-09 01:02:30 +02:00
|
|
|
case 'sx1':
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
$this->supportedFields = $defaultFields[3];
|
|
|
|
break;
|
2006-07-09 01:02:30 +02:00
|
|
|
default:
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
error_log("Unknown Siemens phone '$_productName', assuming same as 'sx1'");
|
2006-07-09 01:02:30 +02:00
|
|
|
$this->supportedFields = $defaultFields[3];
|
|
|
|
break;
|
2006-03-21 14:19:38 +01:00
|
|
|
}
|
2006-07-09 01:02:30 +02:00
|
|
|
break;
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
case 'sonyericsson':
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
case 'sony ericsson':
|
2008-05-10 14:02:49 +02:00
|
|
|
switch($this->productName)
|
2006-03-21 14:19:38 +01:00
|
|
|
{
|
2006-07-09 01:02:30 +02:00
|
|
|
case 'd750i':
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
$this->supportedFields = $defaultFields[2];
|
|
|
|
break;
|
|
|
|
case 'p910i':
|
2006-07-09 01:02:30 +02:00
|
|
|
default:
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
error_log("unknown Sony Ericsson phone '$_productName', assuming same as 'd750i'");
|
2006-07-09 01:02:30 +02:00
|
|
|
$this->supportedFields = $defaultFields[2];
|
|
|
|
break;
|
2006-03-21 14:19:38 +01:00
|
|
|
}
|
2006-07-09 01:02:30 +02:00
|
|
|
break;
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
case 'synthesis ag':
|
2008-05-10 14:02:49 +02:00
|
|
|
switch($this->productName)
|
2006-03-21 14:19:38 +01:00
|
|
|
{
|
2007-01-23 18:34:24 +01:00
|
|
|
case 'sysync client pocketpc pro':
|
2007-11-10 09:07:44 +01:00
|
|
|
case 'sysync client pocketpc std':
|
2007-01-23 18:34:24 +01:00
|
|
|
$this->supportedFields = $defaultFields[1];
|
|
|
|
#$this->supportedFields['PHOTO'] = array('jpegphoto');
|
|
|
|
break;
|
2006-07-09 01:02:30 +02:00
|
|
|
default:
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
error_log("Synthesis connector '$_productName', using default fields");
|
2006-07-09 01:02:30 +02:00
|
|
|
$this->supportedFields = $defaultFields[0];
|
|
|
|
break;
|
2006-03-21 14:19:38 +01:00
|
|
|
}
|
2006-07-09 01:02:30 +02:00
|
|
|
break;
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2007-12-03 11:21:50 +01:00
|
|
|
case 'patrick ohly': // SyncEvolution
|
|
|
|
$this->supportedFields = $defaultFields[7];
|
|
|
|
break;
|
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
case 'file': // used outside of SyncML, eg. by the calendar itself ==> all possible fields
|
|
|
|
$this->supportedFields = $defaultFields[1];
|
|
|
|
break;
|
2009-04-02 14:31:44 +02:00
|
|
|
case 'groupdav': // all GroupDAV access goes through here
|
2008-11-03 10:36:20 +01:00
|
|
|
switch($this->productName)
|
|
|
|
{
|
2009-04-02 14:31:44 +02:00
|
|
|
case 'kde': // KDE Addressbook
|
|
|
|
$this->supportedFields = $defaultFields[1];
|
2009-06-29 21:06:48 +02:00
|
|
|
error_log(__FILE__ . ":groupdav kde 1");
|
2008-11-03 10:36:20 +01:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$this->supportedFields = $defaultFields[1];
|
|
|
|
}
|
2009-06-29 21:06:48 +02:00
|
|
|
break;
|
2006-07-09 01:02:30 +02:00
|
|
|
// the fallback for SyncML
|
|
|
|
default:
|
2009-04-02 14:31:44 +02:00
|
|
|
error_log(__FILE__. __METHOD__ ."\nManufacturer-Product not found: '$_productManufacturer' '$_productName'");
|
2006-07-09 01:02:30 +02:00
|
|
|
$this->supportedFields = $defaultFields[0];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2008-04-16 06:37:05 +02:00
|
|
|
|
|
|
|
function vcardtoegw($_vcard)
|
2006-07-09 01:02:30 +02:00
|
|
|
{
|
2006-08-15 14:46:26 +02:00
|
|
|
// the horde class does the charset conversion. DO NOT CONVERT HERE.
|
2006-07-09 01:02:30 +02:00
|
|
|
|
2009-04-02 14:31:44 +02:00
|
|
|
//error_log("vcardin vtoe".print_r($_vcard, true));
|
2008-10-10 08:28:58 +02:00
|
|
|
if(!is_array($this->supportedFields))
|
2008-09-03 19:09:17 +02:00
|
|
|
{
|
2006-07-09 01:02:30 +02:00
|
|
|
$this->setSupportedFields();
|
|
|
|
}
|
|
|
|
|
|
|
|
require_once(EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar.php');
|
|
|
|
|
|
|
|
$vCard = Horde_iCalendar::newComponent('vcard', $container);
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2007-01-23 18:34:24 +01:00
|
|
|
// Unfold any folded lines.
|
|
|
|
$vCardUnfolded = preg_replace ('/(\r|\n)+ /', ' ', $_vcard);
|
2006-07-09 01:02:30 +02:00
|
|
|
|
2008-10-10 08:28:58 +02:00
|
|
|
if(!$vCard->parsevCalendar($vCardUnfolded, 'VCARD'))
|
2008-09-03 19:09:17 +02:00
|
|
|
{
|
2006-07-09 01:02:30 +02:00
|
|
|
return False;
|
|
|
|
}
|
|
|
|
$vcardValues = $vCard->getAllAttributes();
|
|
|
|
|
|
|
|
#print "<pre>$_vcard</pre>";
|
2006-03-21 14:19:38 +01:00
|
|
|
|
2006-07-23 20:10:37 +02:00
|
|
|
#error_log(print_r($vcardValues, true));
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
foreach($vcardValues as $key => $vcardRow)
|
|
|
|
{
|
|
|
|
$rowName = $vcardRow['name'];
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2008-10-10 08:28:58 +02:00
|
|
|
$vcardElementCount = count($vcardRow['params'],COUNT_RECURSIVE);
|
2007-10-25 08:26:50 +02:00
|
|
|
|
2008-09-03 19:09:17 +02:00
|
|
|
if( $vcardElementCount > 0 )
|
2007-12-03 11:21:50 +01:00
|
|
|
{
|
2008-09-03 19:09:17 +02:00
|
|
|
foreach($vcardRow['params'] as $VKey => $vcardParam)
|
|
|
|
{
|
|
|
|
if( ! strlen($vcardParam) )
|
|
|
|
{
|
|
|
|
$rowName .= ';'.$VKey;
|
|
|
|
}
|
|
|
|
if( $VKey == 'TYPE' && in_array(strtoupper($vcardParam),array('CELL','FAX','PAGER','WORK','HOME','VOICE','CAR')))
|
|
|
|
{
|
|
|
|
$rowName .= ';'.strtoupper($vcardParam);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-07-09 01:02:30 +02:00
|
|
|
$rowNames[$rowName] = $key;
|
|
|
|
}
|
|
|
|
|
2008-09-03 19:09:17 +02:00
|
|
|
|
2006-07-09 15:29:19 +02:00
|
|
|
#error_log(print_r($rowNames, true));
|
2006-03-21 14:19:38 +01:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
// now we have all rowNames the vcard provides
|
|
|
|
// we just need to map to the right addressbook fieldnames
|
|
|
|
// we need also to take care about ADR for example. we do not
|
|
|
|
// support this. We support only ADR;WORK or ADR;HOME
|
2006-03-21 14:19:38 +01:00
|
|
|
|
2009-06-29 21:06:48 +02:00
|
|
|
// njv: As the order of tag occurence is undefined and tags 1... to n are mapped to one addressbook
|
|
|
|
// fieldname and tags 1... to n may have conflicting content eg EMAIL is set but EMAIL;INTERNET is empty
|
|
|
|
// and both are mapped to "email" who wins?
|
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
foreach($rowNames as $rowName => $vcardKey)
|
|
|
|
{
|
2009-04-02 14:31:44 +02:00
|
|
|
// error_log("eachrownane:".print_r($rowName,true));
|
2008-10-10 08:28:58 +02:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
switch($rowName)
|
2006-03-21 14:19:38 +01:00
|
|
|
{
|
2009-06-29 21:06:48 +02:00
|
|
|
case 'TEL;VOICE;HOME':
|
|
|
|
case 'TEL;VOICE;WORK': // check if we have a mapping without VOICE
|
|
|
|
$replace = str_replace('VOICE;','',$rowName);
|
|
|
|
if (!isset($rowNames[$replace]) && array_key_exists($replace, $this->supportedFields))
|
|
|
|
{
|
|
|
|
$finalRowNames[$replace] = $vcardKey; // if yes use that
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$finalRowNames[$rowName] = $vcardKey; // else use existing mapping
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
case 'ADR':
|
|
|
|
case 'TEL':
|
2006-07-09 15:29:19 +02:00
|
|
|
case 'URL':
|
2006-07-09 01:02:30 +02:00
|
|
|
case 'TEL;FAX':
|
|
|
|
case 'TEL;CELL':
|
|
|
|
case 'TEL;PAGER':
|
2008-09-03 19:09:17 +02:00
|
|
|
case 'TEL;VOICE':
|
2008-10-10 08:28:58 +02:00
|
|
|
if(!isset($rowNames[$rowName. ';WORK']) && array_key_exists($rowName. ';WORK', $this->supportedFields) )
|
2006-07-09 01:02:30 +02:00
|
|
|
{
|
|
|
|
$finalRowNames[$rowName. ';WORK'] = $vcardKey;
|
|
|
|
}
|
2008-10-10 08:28:58 +02:00
|
|
|
else
|
2008-09-03 19:09:17 +02:00
|
|
|
{
|
|
|
|
$InvolvedValues = explode(';',$rowName.';WORK');
|
|
|
|
foreach($this->supportedFields as $suppFields => $suppFieldsValue )
|
|
|
|
{
|
|
|
|
$InvolvedHits = 0;
|
|
|
|
foreach($InvolvedValues as $hlparr => $hlparrKey )
|
|
|
|
{
|
|
|
|
if( ! stristr( $suppFields,$hlparrKey ) === FALSE )
|
|
|
|
{
|
|
|
|
$InvolvedHits++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if( count($InvolvedValues) == $InvolvedHits && !isset($finalRowNames[$suppFields]) )
|
|
|
|
{
|
|
|
|
$finalRowNames[$suppFields] = $vcardKey;
|
|
|
|
break; // if a combination of all words in $InvolvedValues were found
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if( count($InvolvedValues) != $InvolvedHits && ! isset($finalRowNames[$rowName]) && array_key_exists($rowName, $this->supportedFields) )
|
|
|
|
{
|
|
|
|
$finalRowNames[$rowName] = $vcardKey;
|
|
|
|
}
|
|
|
|
}
|
2006-07-09 01:02:30 +02:00
|
|
|
break;
|
|
|
|
case 'EMAIL':
|
2006-07-09 15:29:19 +02:00
|
|
|
case 'EMAIL;INTERNET':
|
2009-04-02 14:31:44 +02:00
|
|
|
$ckey = false;
|
|
|
|
foreach($this->supportedFields as $tag => $value)
|
|
|
|
{
|
|
|
|
if(in_array ('email', $value))
|
|
|
|
{
|
|
|
|
$ckey = $tag;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// error_log("key:$ckey:$vcardKey");
|
|
|
|
|
|
|
|
if( $ckey && !empty($vcardValues[$vcardKey]['value']))
|
|
|
|
{
|
|
|
|
// error_log("$akey : ".print_r($vcardKey,true));
|
|
|
|
$finalRowNames[$ckey] = $vcardKey;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'EMAIL;WORK':
|
2009-08-27 09:30:50 +02:00
|
|
|
$akey = false;
|
|
|
|
foreach($this->supportedFields as $tag => $value)
|
2006-07-09 01:02:30 +02:00
|
|
|
{
|
2009-08-27 09:30:50 +02:00
|
|
|
if(in_array ('email', $value))
|
2009-04-02 14:31:44 +02:00
|
|
|
{
|
|
|
|
$akey = $tag;
|
|
|
|
}
|
2009-08-27 09:30:50 +02:00
|
|
|
if(!isset($rowNames['EMAIL;INTERNET;WORK']))
|
|
|
|
{
|
|
|
|
//error_log(__METHOD__.print_r($rowName,true).'#'.print_r($vcardKey,true));
|
|
|
|
if(is_array($value) && in_array ('#email_work', $value))
|
|
|
|
{
|
|
|
|
$akey = $tag;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// error_log("key:$akey:$vcardKey");
|
2009-04-02 14:31:44 +02:00
|
|
|
}
|
|
|
|
if( $akey && !empty($vcardValues[$vcardKey]['value']))
|
|
|
|
{
|
|
|
|
//error_log("$akey : ".print_r($vcardKey,true));
|
|
|
|
$finalRowNames[$akey] = $vcardKey;
|
2006-07-09 01:02:30 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'EMAIL;HOME':
|
|
|
|
if(!isset($rowNames['EMAIL;INTERNET;HOME']))
|
|
|
|
{
|
|
|
|
$finalRowNames['EMAIL;INTERNET;HOME'] = $vcardKey;
|
|
|
|
}
|
2009-06-29 21:06:48 +02:00
|
|
|
|
2009-04-02 14:31:44 +02:00
|
|
|
// error_log("email_home-key: ".print_r($bkey, true));
|
2009-06-29 21:06:48 +02:00
|
|
|
|
2009-04-02 14:31:44 +02:00
|
|
|
if($bkey && !empty($vcardValues[$vcardKey]['value']))
|
|
|
|
{
|
|
|
|
// error_log("$bkey :".print_r($vcardKey,true));
|
|
|
|
$finalRowNames[$bkey] = $vcardKey;
|
|
|
|
}
|
2006-07-09 01:02:30 +02:00
|
|
|
break;
|
2006-03-21 14:19:38 +01:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
case 'VERSION':
|
|
|
|
break;
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
default:
|
2009-04-02 14:31:44 +02:00
|
|
|
//error_log("default row map".print_r($vcardKey,true));
|
2006-07-09 01:02:30 +02:00
|
|
|
$finalRowNames[$rowName] = $vcardKey;
|
|
|
|
break;
|
2006-03-21 14:19:38 +01:00
|
|
|
}
|
2006-07-09 01:02:30 +02:00
|
|
|
}
|
2009-04-02 14:31:44 +02:00
|
|
|
//error_log("finalrownames".print_r($finalRowNames, true));
|
2006-07-09 15:29:19 +02:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
$contact = array();
|
2006-03-21 14:19:38 +01:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
foreach($finalRowNames as $key => $vcardKey)
|
|
|
|
{
|
|
|
|
if(isset($this->supportedFields[$key]))
|
2006-03-21 14:19:38 +01:00
|
|
|
{
|
2006-07-09 01:02:30 +02:00
|
|
|
$fieldNames = $this->supportedFields[$key];
|
|
|
|
foreach($fieldNames as $fieldKey => $fieldName)
|
2006-03-21 14:19:38 +01:00
|
|
|
{
|
2006-07-09 01:02:30 +02:00
|
|
|
if(!empty($fieldName))
|
2006-03-21 14:19:38 +01:00
|
|
|
{
|
2008-04-16 18:05:48 +02:00
|
|
|
if ($fieldName == 'jpegphoto' || $vcardValues[$vcardKey]['params']['ENCODING'] == 'b')
|
|
|
|
{
|
|
|
|
$value = base64_decode($vcardValues[$vcardKey]['values'][$fieldKey]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$value = trim($vcardValues[$vcardKey]['values'][$fieldKey]);
|
|
|
|
}
|
2008-09-03 19:09:17 +02:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
switch($fieldName)
|
2006-03-21 14:19:38 +01:00
|
|
|
{
|
2006-07-09 15:29:19 +02:00
|
|
|
case 'bday':
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
if(!empty($value)) {
|
|
|
|
$contact[$fieldName] = date('Y-m-d', $value);
|
2007-01-23 18:34:24 +01:00
|
|
|
}
|
2006-07-09 15:29:19 +02:00
|
|
|
break;
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
case 'private':
|
2008-09-03 19:09:17 +02:00
|
|
|
$contact[$fieldName] = (int) ( strtoupper($value) == 'PRIVATE');
|
2006-07-09 01:02:30 +02:00
|
|
|
break;
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
case 'cat_id':
|
2009-04-02 14:31:44 +02:00
|
|
|
$contact[$fieldName] = implode(',',$this->find_or_add_categories(explode(',',$value),'private'));
|
2006-07-09 01:02:30 +02:00
|
|
|
break;
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
|
2007-07-04 21:13:00 +02:00
|
|
|
case 'note':
|
|
|
|
// note may contain ','s but maybe this needs to be fixed in vcard parser...
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
//$contact[$fieldName] = trim($vcardValues[$vcardKey]['value']);
|
|
|
|
//break;
|
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
default:
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
$contact[$fieldName] = $value;
|
2006-07-09 01:02:30 +02:00
|
|
|
break;
|
2006-03-21 14:19:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-04-16 06:37:05 +02:00
|
|
|
|
SyncML patches from patrick.bihan-faou-AT-mindstep.com (without
logout+mbstring stuff), small modification to use the already exiting
methodes to generate full name and fileas)
The code is commited to trunk only at the moment to allow testing of it.
If everything goes well, we intend to commit it to 1.4 branch too.
Here's the original description of the patch by Patrick:
- handles the default config for current versions of funambol (i.e. the
scard/stask/snote/scal locations)
- tries to be a bit smarter on how the data content should be encoded
based on what the client specified (sif+base64/vcard, / fragmented or
not, etc.)
- workaround a bug in some versions of funambol, where funambol does not
specify the proper sif type for the type of requested data
- imported patch #117 from egw's tracker
- make sure that the logs generated by the horde code go to stderr so
they can be view in the webserver's logs
- as much as possible reduce code duplication. For example, the
categories are handled in the parent classes for both the SIF avn VCAL
formats for each type of data (addressbook,infolog,calendar).
- make sure the code can handle more than one categories in each
direction
- treat the 'sony ericsson' vendor string just like 'sonyericsson', the
newer phones apparently have a space in the vendor string... (this
touches some files in the icalsrv as well)
- handle notes: these should now work with everything (funambol or
other)
- remove more code duplication: the syncml "api" for the various data
types (calendar, contacts, infolog) is now common for both the vcard and
sif data formats (cf the files that need to be removed)
- handle the "privat" filter in infolog like the "private" filter (some
part of the code use the name without the trailing e)
- imported patch # 267 from egw's tracker
2007-09-29 12:29:48 +02:00
|
|
|
$this->fixup_contact($contact);
|
2009-08-27 09:30:50 +02:00
|
|
|
//error_log(__LINE__.__FILE__ . __METHOD__ . "\nContact:\n " .print_r($contact,true));
|
2006-07-09 01:02:30 +02:00
|
|
|
return $contact;
|
|
|
|
}
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
/**
|
|
|
|
* Exports some contacts: download or write to a file
|
|
|
|
*
|
|
|
|
* @param array $ids contact-ids
|
|
|
|
* @param string $file filename or null for download
|
|
|
|
*/
|
|
|
|
function export($ids,$file=null)
|
|
|
|
{
|
|
|
|
if (!$file)
|
|
|
|
{
|
|
|
|
$browser =& CreateObject('phpgwapi.browser');
|
|
|
|
$browser->content_header('addressbook.vcf','text/x-vcard');
|
|
|
|
}
|
|
|
|
if (!($fp = fopen($file ? $file : 'php://output','w')))
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
foreach($ids as $id)
|
|
|
|
{
|
|
|
|
fwrite($fp,$this->getVCard($id));
|
|
|
|
}
|
|
|
|
fclose($fp);
|
2008-04-16 06:37:05 +02:00
|
|
|
|
2006-07-09 01:02:30 +02:00
|
|
|
if (!$file)
|
|
|
|
{
|
|
|
|
$GLOBALS['egw']->common->egw_exit();
|
2008-04-16 06:37:05 +02:00
|
|
|
}
|
2006-07-09 01:02:30 +02:00
|
|
|
return true;
|
2005-07-20 14:14:39 +02:00
|
|
|
}
|
2006-07-09 01:02:30 +02:00
|
|
|
}
|