mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-18 11:21:23 +01:00
changed to use the bocontacts instead of boaddressbook, need to be tested
This commit is contained in:
parent
897b4e1e67
commit
455a96c873
@ -18,8 +18,8 @@
|
|||||||
{
|
{
|
||||||
var $sifMapping = array(
|
var $sifMapping = array(
|
||||||
'Anniversary' => '',
|
'Anniversary' => '',
|
||||||
'AssistantName' => '',
|
'AssistantName' => 'assistent',
|
||||||
'AssistantTelephoneNumber' => '',
|
'AssistantTelephoneNumber' => 'tel_assistent',
|
||||||
'BillingInformation' => '',
|
'BillingInformation' => '',
|
||||||
'Birthday' => 'bday',
|
'Birthday' => 'bday',
|
||||||
'Body' => 'note',
|
'Body' => 'note',
|
||||||
@ -27,13 +27,13 @@
|
|||||||
'BusinessAddressCity' => 'adr_one_locality',
|
'BusinessAddressCity' => 'adr_one_locality',
|
||||||
'BusinessAddressCountry' => 'adr_one_countryname',
|
'BusinessAddressCountry' => 'adr_one_countryname',
|
||||||
'BusinessAddressPostalCode' => 'adr_one_postalcode',
|
'BusinessAddressPostalCode' => 'adr_one_postalcode',
|
||||||
'BusinessAddressPostOfficeBox' => '',
|
'BusinessAddressPostOfficeBox' => 'adr_one_street2',
|
||||||
'BusinessAddressState' => 'adr_one_region',
|
'BusinessAddressState' => 'adr_one_region',
|
||||||
'BusinessAddressStreet' => 'adr_one_street',
|
'BusinessAddressStreet' => 'adr_one_street',
|
||||||
'BusinessFaxNumber' => 'tel_fax',
|
'BusinessFaxNumber' => 'tel_fax',
|
||||||
'BusinessTelephoneNumber' => 'tel_work',
|
'BusinessTelephoneNumber' => 'tel_work',
|
||||||
'CallbackTelephoneNumber' => '',
|
'CallbackTelephoneNumber' => '',
|
||||||
'CarTelephoneNumber' => '',
|
'CarTelephoneNumber' => 'tel_car',
|
||||||
'Categories' => 'cat_id',
|
'Categories' => 'cat_id',
|
||||||
'Children' => '',
|
'Children' => '',
|
||||||
'Companies' => '',
|
'Companies' => '',
|
||||||
@ -47,17 +47,17 @@
|
|||||||
'Email2AddressType' => '',
|
'Email2AddressType' => '',
|
||||||
'Email3Address' => '',
|
'Email3Address' => '',
|
||||||
'Email3AddressType' => '',
|
'Email3AddressType' => '',
|
||||||
'FileAs' => '',
|
'FileAs' => 'n_fileas',
|
||||||
'FirstName' => 'n_given',
|
'FirstName' => 'n_given',
|
||||||
'Hobby' => '',
|
'Hobby' => '',
|
||||||
'Home2TelephoneNumber' => '',
|
'Home2TelephoneNumber' => '',
|
||||||
'HomeAddressCity' => 'adr_two_locality',
|
'HomeAddressCity' => 'adr_two_locality',
|
||||||
'HomeAddressCountry' => 'adr_two_countryname',
|
'HomeAddressCountry' => 'adr_two_countryname',
|
||||||
'HomeAddressPostalCode' => 'adr_two_postalcode',
|
'HomeAddressPostalCode' => 'adr_two_postalcode',
|
||||||
'HomeAddressPostOfficeBox' => '',
|
'HomeAddressPostOfficeBox' => 'adr_two_street2',
|
||||||
'HomeAddressState' => 'adr_two_region',
|
'HomeAddressState' => 'adr_two_region',
|
||||||
'HomeAddressStreet' => 'adr_two_street',
|
'HomeAddressStreet' => 'adr_two_street',
|
||||||
'HomeFaxNumber' => '',
|
'HomeFaxNumber' => 'tel_fax_home',
|
||||||
'HomeTelephoneNumber' => 'tel_home',
|
'HomeTelephoneNumber' => 'tel_home',
|
||||||
'Importance' => '',
|
'Importance' => '',
|
||||||
'Initials' => '',
|
'Initials' => '',
|
||||||
@ -69,7 +69,7 @@
|
|||||||
'Mileage' => '',
|
'Mileage' => '',
|
||||||
'MobileTelephoneNumber' => 'tel_cell',
|
'MobileTelephoneNumber' => 'tel_cell',
|
||||||
'NickName' => '',
|
'NickName' => '',
|
||||||
'OfficeLocation' => '',
|
'OfficeLocation' => 'room',
|
||||||
'OrganizationalIDNumber' => '',
|
'OrganizationalIDNumber' => '',
|
||||||
'OtherAddressCity' => '',
|
'OtherAddressCity' => '',
|
||||||
'OtherAddressCountry' => '',
|
'OtherAddressCountry' => '',
|
||||||
@ -78,12 +78,12 @@
|
|||||||
'OtherAddressState' => '',
|
'OtherAddressState' => '',
|
||||||
'OtherAddressStreet' => '',
|
'OtherAddressStreet' => '',
|
||||||
'OtherFaxNumber' => '',
|
'OtherFaxNumber' => '',
|
||||||
'OtherTelephoneNumber' => '',
|
'OtherTelephoneNumber' => 'tel_other',
|
||||||
'PagerNumber' => 'tel_pager',
|
'PagerNumber' => 'tel_pager',
|
||||||
'PrimaryTelephoneNumber' => '',
|
'PrimaryTelephoneNumber' => '',
|
||||||
'Profession' => '',
|
'Profession' => 'role',
|
||||||
'RadioTelephoneNumber' => '',
|
'RadioTelephoneNumber' => '',
|
||||||
'Sensitivity' => 'access',
|
'Sensitivity' => 'private',
|
||||||
'Spouse' => '',
|
'Spouse' => '',
|
||||||
'Subject' => '',
|
'Subject' => '',
|
||||||
'Suffix' => 'n_suffix',
|
'Suffix' => 'n_suffix',
|
||||||
@ -93,7 +93,7 @@
|
|||||||
'YomiCompanyName' => '',
|
'YomiCompanyName' => '',
|
||||||
'YomiFirstName' => '',
|
'YomiFirstName' => '',
|
||||||
'YomiLastName' => '',
|
'YomiLastName' => '',
|
||||||
'HomeWebPage' => '',
|
'HomeWebPage' => 'url_home',
|
||||||
'Folder' => '',
|
'Folder' => '',
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -137,10 +137,6 @@
|
|||||||
foreach($this->contact as $key => $value) {
|
foreach($this->contact as $key => $value) {
|
||||||
$value = $GLOBALS['egw']->translation->convert($value, 'utf-8', $sysCharSet);
|
$value = $GLOBALS['egw']->translation->convert($value, 'utf-8', $sysCharSet);
|
||||||
switch($key) {
|
switch($key) {
|
||||||
case 'access':
|
|
||||||
$finalContact[$key] = ((int)$value > 0) ? 'private' : 'public';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'cat_id':
|
case 'cat_id':
|
||||||
if(!empty($value)) {
|
if(!empty($value)) {
|
||||||
$isAdmin = $GLOBALS['egw']->acl->check('run',1,'admin');
|
$isAdmin = $GLOBALS['egw']->acl->check('run',1,'admin');
|
||||||
@ -160,44 +156,41 @@
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'bday':
|
|
||||||
if(!empty($value)) {
|
|
||||||
$bdayParts = explode('-',$value);
|
|
||||||
$finalContact[$key] = $bdayParts[1]. '/' .$bdayParts[2]. '/' .$bdayParts[0];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$finalContact[$key] = $value;
|
$finalContact[$key] = $value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$middleName = ($finalContact['n_middle']) ? ' '.trim($finalContact['n_middle']) : '';
|
|
||||||
$finalContact['fn'] = trim($finalContact['n_given']. $middleName .' '. $finalContact['n_family']);
|
|
||||||
|
|
||||||
|
|
||||||
return $finalContact;
|
return $finalContact;
|
||||||
}
|
}
|
||||||
|
|
||||||
function search($_sifdata) {
|
/**
|
||||||
if(!$contact = $this->siftoegw($_sifdata)) {
|
* Search an exactly matching entry (used for slow sync)
|
||||||
|
*
|
||||||
|
* @param string $_sifdata
|
||||||
|
* @return boolean/int/string contact-id or false, if not found
|
||||||
|
*/
|
||||||
|
function search($_sifdata)
|
||||||
|
{
|
||||||
|
if(!$contact = $this->siftoegw($_sifdata))
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($foundContacts = $this->read_entries(array('query' => $contact))) {
|
if(($foundContacts = $this->search($contact)))
|
||||||
|
{
|
||||||
error_log(print_r($foundContacts,true));
|
error_log(print_r($foundContacts,true));
|
||||||
return $foundContacts[0][id];
|
return $foundContacts[0]['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* import a vard into addressbook
|
||||||
|
*
|
||||||
* @return int contact id
|
* @return int contact id
|
||||||
* @param string $_vcard the vcard
|
* @param string $_vcard the vcard
|
||||||
* @param int $_abID the internal addressbook id
|
* @param int $_abID the internal addressbook id
|
||||||
* @desc import a vard into addressbook
|
|
||||||
*/
|
*/
|
||||||
function addSIF($_sifdata, $_abID)
|
function addSIF($_sifdata, $_abID)
|
||||||
{
|
{
|
||||||
@ -208,17 +201,9 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_abID > 0)
|
if($_abID > 0) $contact['ab_id'] = $_abID;
|
||||||
{
|
|
||||||
// update entry
|
return $this->save($contact);
|
||||||
$contact['ab_id'] = $_abID;
|
|
||||||
return $this->update_entry($contact);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// add entry
|
|
||||||
return $this->add_entry($contact);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -233,79 +218,59 @@
|
|||||||
$fields = array_unique(array_values($this->sifMapping));
|
$fields = array_unique(array_values($this->sifMapping));
|
||||||
sort($fields);
|
sort($fields);
|
||||||
|
|
||||||
if($this->check_perms($_id,EGW_ACL_READ))
|
if(!($entry = $this->so->read_entry($_id)))
|
||||||
{
|
{
|
||||||
$sifContact = '<contact>';
|
return false;
|
||||||
//$data = array('id' => $_id, 'fields' => $fields);
|
}
|
||||||
$entry = $this->so->read_entry($_id,$fields);
|
$sifContact = '<contact>';
|
||||||
$entry = $this->strip_html($entry);
|
#error_log(print_r($entry,true));
|
||||||
if($this->xmlrpc)
|
$sysCharSet = $GLOBALS['egw']->translation->charset();
|
||||||
{
|
|
||||||
$entry = $this->data2xmlrpc($entry);
|
|
||||||
}
|
|
||||||
#error_log(print_r($entry,true));
|
|
||||||
$sysCharSet = $GLOBALS['egw']->translation->charset();
|
|
||||||
|
|
||||||
foreach($this->sifMapping as $sifField => $egwField)
|
foreach($this->sifMapping as $sifField => $egwField)
|
||||||
{
|
{
|
||||||
if(empty($egwField)) continue;
|
if(empty($egwField)) continue;
|
||||||
|
|
||||||
#error_log("$sifField => $egwField");
|
#error_log("$sifField => $egwField");
|
||||||
#error_log('VALUE1: '.$entry[0][$egwField]);
|
#error_log('VALUE1: '.$entry[0][$egwField]);
|
||||||
$value = $GLOBALS['egw']->translation->convert($entry[0][$egwField], $sysCharSet, 'utf-8');
|
$value = $GLOBALS['egw']->translation->convert($entry[0][$egwField], $sysCharSet, 'utf-8');
|
||||||
#error_log('VALUE2: '.$value);
|
#error_log('VALUE2: '.$value);
|
||||||
|
|
||||||
switch($sifField)
|
switch($sifField)
|
||||||
{
|
{
|
||||||
// TODO handle multiple categories
|
// TODO handle multiple categories
|
||||||
case 'Categories':
|
case 'Categories':
|
||||||
if(!empty($value)) {
|
if(!empty($value)) {
|
||||||
$egwCategories =& CreateObject('phpgwapi.categories',$GLOBALS['egw_info']['user']['account_id'],'addressbook');
|
$egwCategories =& CreateObject('phpgwapi.categories',$GLOBALS['egw_info']['user']['account_id'],'addressbook');
|
||||||
$categories = explode(',',$value);
|
$categories = explode(',',$value);
|
||||||
$value = '';
|
$value = '';
|
||||||
foreach($categories as $cat_id) {
|
foreach($categories as $cat_id) {
|
||||||
if($catData = $egwCategories->return_single($cat_id)) {
|
if(($catData = $egwCategories->return_single($cat_id)))
|
||||||
if(!empty($value)) $value .= '; ';
|
{
|
||||||
$value .= $catData[0]['name'];
|
if(!empty($value)) $value .= '; ';
|
||||||
}
|
$value .= $catData[0]['name'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sifContact .= "<$sifField>$value</$sifField>";
|
}
|
||||||
break;
|
$sifContact .= "<$sifField>$value</$sifField>";
|
||||||
|
break;
|
||||||
case 'Sensitivity':
|
|
||||||
$value = ($value == 'private' ? '2' : '0');
|
case 'Sensitivity':
|
||||||
$sifContact .= "<$sifField>$value</$sifField>";
|
$value = 2 * $value; // eGW private is 0 (public) or 1 (private)
|
||||||
break;
|
$sifContact .= "<$sifField>$value</$sifField>";
|
||||||
|
break;
|
||||||
case 'Birthday':
|
|
||||||
if(!empty($value)) {
|
case 'Folder':
|
||||||
$dateParts = explode('/',$value);
|
# skip currently. This is the folder where Outlook stores the contact.
|
||||||
$value = sprintf('%04-d%02-d%02',$dateParts[2],$dateParts[0],$dateParts[1]);
|
#$sifContact .= "<$sifField>/</$sifField>";
|
||||||
}
|
break;
|
||||||
$sifContact .= "<$sifField>$value</$sifField>";
|
|
||||||
break;
|
default:
|
||||||
|
$sifContact .= "<$sifField>$value</$sifField>";
|
||||||
case 'Folder':
|
break;
|
||||||
# skip currently. This is the folder where Outlook stores the contact.
|
|
||||||
#$sifContact .= "<$sifField>/</$sifField>";
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
$sifContact .= "<$sifField>$value</$sifField>";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$sifContact .= "</contact>";
|
|
||||||
|
|
||||||
return base64_encode($sifContact);
|
|
||||||
}
|
}
|
||||||
|
$sifContact .= "</contact>";
|
||||||
|
|
||||||
if($this->xmlrpc)
|
return base64_encode($sifContact);
|
||||||
{
|
|
||||||
$GLOBALS['server']->xmlrpc_error($GLOBALS['xmlrpcerr']['no_access'],$GLOBALS['xmlrpcstr']['no_access']);
|
|
||||||
}
|
|
||||||
return False;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,10 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
require_once EGW_SERVER_ROOT.'/addressbook/inc/class.boaddressbook.inc.php';
|
require_once EGW_SERVER_ROOT.'/addressbook/inc/class.bocontacts.inc.php';
|
||||||
require_once EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar.php';
|
require_once EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar.php';
|
||||||
|
|
||||||
class vcaladdressbook extends boaddressbook
|
class vcaladdressbook extends bocontacts
|
||||||
{
|
{
|
||||||
#function vcaladdressbook()
|
#function vcaladdressbook()
|
||||||
#{
|
#{
|
||||||
@ -30,27 +30,20 @@
|
|||||||
*/
|
*/
|
||||||
function addVCard($_vcard, $_abID)
|
function addVCard($_vcard, $_abID)
|
||||||
{
|
{
|
||||||
if(!$contact = $this->vcardtoegw($_vcard)) {
|
if(!($contact = $this->vcardtoegw($_vcard)))
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_abID > 0)
|
if($_abID > 0) $contact['ab_id'] = $_abID;
|
||||||
{
|
|
||||||
// update entry
|
return $this->save($contact);
|
||||||
$contact['ab_id'] = $_abID;
|
|
||||||
return $this->update_entry($contact);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// add entry
|
|
||||||
return $this->add_entry($contact);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return a vcard
|
* return a vcard
|
||||||
*
|
*
|
||||||
* @param int $_id the id of the contact
|
* @param int $_id the id of the contact
|
||||||
* @param int $_vcardProfile profile id for mapping from vcard values to egw addressbook
|
* @param int $_vcardProfile profile id for mapping from vcard values to egw addressbook
|
||||||
* @return string containing the vcard
|
* @return string containing the vcard
|
||||||
*/
|
*/
|
||||||
@ -65,28 +58,10 @@
|
|||||||
$this->setSupportedFields();
|
$this->setSupportedFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($this->supportedFields as $databaseFields)
|
|
||||||
{
|
|
||||||
foreach($databaseFields as $databaseField)
|
|
||||||
{
|
|
||||||
if(!empty($databaseField))
|
|
||||||
{
|
|
||||||
$fields[] = $databaseField;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#_debug_array($fields);
|
#_debug_array($fields);
|
||||||
|
|
||||||
if($this->check_perms($_id,EGW_ACL_READ))
|
if(($entry = $this->read($_id)))
|
||||||
{
|
{
|
||||||
//$data = array('id' => $_id, 'fields' => $fields);
|
|
||||||
$entry = $this->so->read_entry($_id,$fields);
|
|
||||||
$entry = $this->strip_html($entry);
|
|
||||||
if($this->xmlrpc)
|
|
||||||
{
|
|
||||||
$entry = $this->data2xmlrpc($entry);
|
|
||||||
}
|
|
||||||
#_debug_array($entry);
|
#_debug_array($entry);
|
||||||
$sysCharSet = $GLOBALS['egw']->translation->charset();
|
$sysCharSet = $GLOBALS['egw']->translation->charset();
|
||||||
|
|
||||||
@ -115,13 +90,13 @@
|
|||||||
$value = $catData[0]['name'];
|
$value = $catData[0]['name'];
|
||||||
break;
|
break;
|
||||||
case 'CLASS':
|
case 'CLASS':
|
||||||
$value = ($value == 'private' ? 'PRIVATE' : 'PUBLIC');
|
$value = $value ? 'PRIVATE' : 'PUBLIC';
|
||||||
break;
|
break;
|
||||||
case 'BDAY':
|
case 'BDAY':
|
||||||
if(!empty($value))
|
if(!empty($value))
|
||||||
{
|
{
|
||||||
$dateParts = explode('/',$value);
|
list($y,$m,$d) = explode('-',$value);
|
||||||
$value = sprintf('%04d%02d%02dT000000Z',$dateParts[2],$dateParts[0],$dateParts[1]);
|
$value = sprintf('%04d%02d%02dT000000Z',$y,$m,$d);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -148,23 +123,26 @@
|
|||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->xmlrpc)
|
|
||||||
{
|
|
||||||
$GLOBALS['server']->xmlrpc_error($GLOBALS['xmlrpcerr']['no_access'],$GLOBALS['xmlrpcstr']['no_access']);
|
|
||||||
}
|
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
function search($_vcard) {
|
/**
|
||||||
if(!$contact = $this->vcardtoegw($_vcard)) {
|
* Search an exactly matching entry (used for slow sync)
|
||||||
|
*
|
||||||
|
* @param string $_vcard
|
||||||
|
* @return boolean/int/string contact-id or false, if not found
|
||||||
|
*/
|
||||||
|
function search($_vcard)
|
||||||
|
{
|
||||||
|
if(!($contact = $this->vcardtoegw($_vcard)))
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($foundContacts = $this->read_entries(array('query' => $contact))) {
|
if(($foundContacts = $this->search($contact)))
|
||||||
return $foundContacts[0][id];
|
{
|
||||||
|
return $foundContacts[0]['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,7 +152,7 @@
|
|||||||
'ADR' => array('','','adr_one_street','adr_one_locality','adr_one_region',
|
'ADR' => array('','','adr_one_street','adr_one_locality','adr_one_region',
|
||||||
'adr_one_postalcode','adr_one_countryname'),
|
'adr_one_postalcode','adr_one_countryname'),
|
||||||
'CATEGORIES' => array('cat_id'),
|
'CATEGORIES' => array('cat_id'),
|
||||||
'CLASS' => array('access'),
|
'CLASS' => array('private'),
|
||||||
'EMAIL' => array('email'),
|
'EMAIL' => array('email'),
|
||||||
'N' => array('n_family','n_given','','',''),
|
'N' => array('n_family','n_given','','',''),
|
||||||
'NOTE' => array('note'),
|
'NOTE' => array('note'),
|
||||||
@ -212,7 +190,7 @@
|
|||||||
'adr_one_postalcode','adr_one_countryname'),
|
'adr_one_postalcode','adr_one_countryname'),
|
||||||
'BDAY' => array('bday'),
|
'BDAY' => array('bday'),
|
||||||
'CATEGORIES' => array('cat_id'),
|
'CATEGORIES' => array('cat_id'),
|
||||||
'CLASS' => array('access'),
|
'CLASS' => array('private'),
|
||||||
'EMAIL' => array('email'),
|
'EMAIL' => array('email'),
|
||||||
'N' => array('n_family','n_given','','',''),
|
'N' => array('n_family','n_given','','',''),
|
||||||
'NOTE' => array('note'),
|
'NOTE' => array('note'),
|
||||||
@ -309,7 +287,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function vcardtoegw($_vcard) {
|
function vcardtoegw($_vcard)
|
||||||
|
{
|
||||||
if(!is_array($this->supportedFields))
|
if(!is_array($this->supportedFields))
|
||||||
{
|
{
|
||||||
$this->setSupportedFields();
|
$this->setSupportedFields();
|
||||||
@ -335,8 +314,6 @@
|
|||||||
foreach($vcardValues as $key => $vcardRow)
|
foreach($vcardValues as $key => $vcardRow)
|
||||||
{
|
{
|
||||||
$rowName = $vcardRow['name'];
|
$rowName = $vcardRow['name'];
|
||||||
$mailtype = ';INTERNET';
|
|
||||||
$tempVal = ';WORK';
|
|
||||||
|
|
||||||
if(isset($vcardRow['params']['INTERNET']))
|
if(isset($vcardRow['params']['INTERNET']))
|
||||||
{
|
{
|
||||||
@ -401,7 +378,7 @@
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'CATEGORIESS':
|
case 'CATEGORIES':
|
||||||
#cat_id = 7,8
|
#cat_id = 7,8
|
||||||
$vcardData['category'] = array();
|
$vcardData['category'] = array();
|
||||||
if ($attributes['value'])
|
if ($attributes['value'])
|
||||||
@ -410,7 +387,7 @@
|
|||||||
{
|
{
|
||||||
if (!is_object($GLOBALS['egw']->categories))
|
if (!is_object($GLOBALS['egw']->categories))
|
||||||
{
|
{
|
||||||
$GLOBALS['egw']->categories =& CreateObject('phpgwapi.categories',$this->owner,'calendar');
|
$GLOBALS['egw']->categories =& CreateObject('phpgwapi.categories',$this->owner,'addressbook');
|
||||||
}
|
}
|
||||||
$this->cat =& $GLOBALS['egw']->categories;
|
$this->cat =& $GLOBALS['egw']->categories;
|
||||||
}
|
}
|
||||||
@ -447,15 +424,8 @@
|
|||||||
{
|
{
|
||||||
switch($fieldName)
|
switch($fieldName)
|
||||||
{
|
{
|
||||||
case 'access':
|
case 'private':
|
||||||
if($vcardValues[$vcardKey]['values'][$fieldKey] == 'PRIVATE')
|
$contact[$fieldName] = $vcardValues[$vcardKey]['values'][$fieldKey] == 'PRIVATE';
|
||||||
{
|
|
||||||
$contact[$fieldName] = 'private';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$contact[$fieldName] = 'public';
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'cat_id':
|
case 'cat_id':
|
||||||
if (!is_object($this->cat))
|
if (!is_object($this->cat))
|
||||||
@ -487,48 +457,6 @@
|
|||||||
#return true;
|
#return true;
|
||||||
|
|
||||||
/* _debug_array($contact);exit; */
|
/* _debug_array($contact);exit; */
|
||||||
$contact['fn'] = trim($contact['n_given'].' '.$contact['n_family']);
|
|
||||||
if(!$contact['tel_work'])
|
|
||||||
{
|
|
||||||
$contact['tel_work'] = '';
|
|
||||||
}
|
|
||||||
if(!$contact['tel_home'])
|
|
||||||
{
|
|
||||||
$contact['tel_home'] = '';
|
|
||||||
}
|
|
||||||
if(!$contact['tel_voice'])
|
|
||||||
{
|
|
||||||
$contact['tel_voice'] = '';
|
|
||||||
}
|
|
||||||
if(!$contact['tel_fax'])
|
|
||||||
{
|
|
||||||
$contact['tel_fax'] = '';
|
|
||||||
}
|
|
||||||
if(!$contact['tel_msg'])
|
|
||||||
{
|
|
||||||
$contact['tel_msg'] = '';
|
|
||||||
}
|
|
||||||
if(!$contact['tel_cell'])
|
|
||||||
{
|
|
||||||
$contact['tel_cell'] = '';
|
|
||||||
}
|
|
||||||
if(!$contact['tel_pager'])
|
|
||||||
{
|
|
||||||
$contact['tel_pager'] = '';
|
|
||||||
}
|
|
||||||
if(!$contact['tel_car'])
|
|
||||||
{
|
|
||||||
$contact['tel_car'] = '';
|
|
||||||
}
|
|
||||||
if(!$contact['tel_isdn'])
|
|
||||||
{
|
|
||||||
$contact['tel_isdn'] = '';
|
|
||||||
}
|
|
||||||
if(!$contact['tel_video'])
|
|
||||||
{
|
|
||||||
$contact['tel_video'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $contact;
|
return $contact;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user