removed not longer usable old import/export

This commit is contained in:
Ralf Becker 2007-06-03 12:01:31 +00:00
parent d5829fa68b
commit 6a001d1cdf
22 changed files with 0 additions and 3227 deletions

View File

@ -59,9 +59,6 @@ class contacts_admin_prefs
'no_lang' => true,
'link' => false
),
// Disabled til they are working again
// 'import contacts' => $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiXport.import'),
// 'export contacts' => $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiXport.export'),
'CSV-Import' => $GLOBALS['egw']->link('/addressbook/csv_import.php')
);
display_sidebox($appname,lang('Addressbook menu'),$file);

View File

@ -1,160 +0,0 @@
<?php
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// export file and the value of the array item will be used in
// the creation of the output file.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array("LastName" => "FullName","FirstName" => "+, ");
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
class export_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
//list of all id's
var $ids = array();
var $type = 'ldif';
var $export = array(
'title' => 'title',
'n_given' => 'givenname',
'n_family' => 'sn',
'fn' => 'cn',
'org_name' => 'o',
'org_unit' => 'ou',
'adr_one_street' => 'postaladdress',
'address2' => 'mozillaPostalAddress2',
'adr_one_locality' => 'l',
'adr_one_region' => 'st',
'adr_one_postalcode' => 'postalcode',
'adr_one_countryname' => 'c',
'adr_two_street' => 'homepostaladdress',
'adr_two_locality' => 'mozillahomelocalityname',
'adr_two_region' => 'mozillahomestate',
'adr_two_postalcode' => 'mozillahomepostalcode',
'adr_two_countryname' => 'mozillahomecountryname',
'tel_work' => 'telephonenumber',
'tel_home' => 'homephone',
'tel_fax' => 'facsimiletelephonenumber',
'ophone' => 'custom1',
'tel_cell' => 'mobile',
'note' => 'description',
'tel_pager' => 'pagerp',
'email' => 'mail',
'url' => 'workurl'
);
// This will store the contacts object
var $contacts = '';
// Read full list of user's contacts only to get id's for each
function export_start_file($buffer,$ncat_id='')
{
$this->id = -1;
if($ncat_id)
{
$filter = 'tid=n,cat_id=' . $ncat_id;
}
else
{
$filter = 'tid=n';
}
$this->contacts = CreateObject('phpgwapi.contacts');
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for($i=0;$i<count($tmp);$i++)
{
$this->ids[$i] = $tmp[$i]['id'];
}
// $ids is now an array of all id's for this user, e.g. $ids[0] = 21, etc...
// $buffer is still empty
return $buffer;
}
// Read each entry
function export_start_record($buffer)
{
$this->id++;
$top = $this->contacts->read_single_entry($this->ids[$this->id],$this->qfields);
$this->currentrecord = $top[0];
return $buffer;
}
// Read each attribute, populate buffer
// name/value are the fields from the export array above
function export_new_attrib($buffer,$name,$value)
{
if($this->export[$name])
{
if(strstr($value,"\n"))
{
$value = ': '.base64_encode($value);
}
else
{
$value = ' '.$value;
}
$buffer[$this->id][$this->export[$name]] = $value;
//echo '<br>'.$this->id.' - '.$this->export[$name].': '.$buffer[$this->id][$this->export[$name]];
}
return $buffer;
}
// Tack on some extra values
function export_end_record($buffer)
{
$buffer[$this->id]['dn'] = 'cn='.$buffer[$this->id]['cn'].',mail='.$buffer[$this->id]['mail'];
$buffer[$this->id]['xmozillauseconferenceserver'] = '0';
$buffer[$this->id]['xmozillanickname'] = '';
$buffer[$this->id]['xmozillausehtmlmail'] = 'False';
if($buffer[$this->id]['ophone'])
{
$buffer[$this->id]['xmozillaanyphone'] = $buffer[$this->id]['ophone'];
}
else
{
$buffer[$this->id]['xmozillaanyphone'] = $buffer[$this->id]['telephonenumber'];
}
//echo '<br>'.$this->id.' - '.$buffer[$this->id]['dn'];
return $buffer;
}
function export_end_file($buffer)
{
reset($this->ids);
for($i=0;$i<count($this->ids);$i++)
{
$entries .= 'dn: ' . $buffer[$i]['dn'] . "\n";
reset($this->export);
while(list($name,$value)=each($this->export))
{
if($value != 'dn')
{
$entries .= $value . ":" . $buffer[$i][$value] . "\n";
}
}
$entries .= 'xmozillauseconferenceserver: ' . $buffer[$i]['xmozillauseconferenceserver'] . "\n";
$entries .= 'xmozillanickname: ' . $buffer[$i]['xmozillanickname'] . "\n";
$entries .= 'xmozillausehtmlmail: ' . $buffer[$i]['xmozillausehtmlmail'] . "\n";
$entries .= 'xmozillaanyphone: ' . $buffer[$i]['xmozillaanyphone'] . "\n";
$entries .= 'objectClass: person' . "\n";
$entries .= 'objectClass: account' . "\n";
$entries .= 'objectClass: organizationalPerson' . "\n";
$entries .= 'objectClass: posixAccount' . "\n";
$entries .= 'objectClass: inetOrgPerson' . "\n";
$entries .= 'objectClass: shadowAccount' . "\n";
$entries .= "\n";
}
$buffer = $entries;
return $buffer;
}
}
?>

View File

@ -1,155 +0,0 @@
<?php
/*
This file defines a set of functions and an associative array.
The key of the array corresponds to a header in the source
export file and the value of the array item will be used in
the creation of the output file.
The array need not be in any order and any fields not defined will
not be transferred. If the val='+', the value will be appended to
the previous field and any text after the '+' will be appended
before the value. For example, the following would add a comma and
a space between LastName and FirstName and store it in FullName:
array("LastName" => "FullName","FirstName" => "+, ");
Also start with a '#' symbol and a comma separated list will be
turned into a number of the same entries.
*/
class export_conv
{
var $currentrecord = array(); /* used for buffering to allow uid lines to go first */
var $id;
/* list of all id's */
var $ids = array();
var $type = 'vcard';
/* This will store the contacts and vcard objects */
var $contacts = '';
var $vcard = '';
/* This will be filled by the vcard object */
var $export = array();
/* make sure to order how we ask for these */
var $qfields = array(
'fn' => 'fn',
'n_given' => 'n_given',
'n_family' => 'n_family',
'n_middle' => 'n_middle',
'n_prefix' => 'n_prefix',
'n_suffix' => 'n_suffix',
'sound' => 'sound',
'bday' => 'bday',
'note' => 'note',
'tz' => 'tz',
'geo' => 'geo',
'url' => 'url',
'pubkey' => 'pubkey',
'org_name' => 'org_name',
'org_unit' => 'org_unit',
'title' => 'title',
'adr_one_type' => 'adr_one_type',
'adr_two_type' => 'adr_two_type',
'tel_prefer' => 'tel_prefer',
'email_type' => 'email_type',
'email_home_type' => 'email_home_type',
'adr_one_street' => 'adr_one_street',
'adr_one_locality' => 'adr_one_locality',
'adr_one_region' => 'adr_one_region',
'adr_one_postalcode' => 'adr_one_postalcode',
'adr_one_countryname' => 'adr_one_countryname',
'label' => 'label',
'adr_two_street' => 'adr_two_street',
'adr_two_locality' => 'adr_two_locality',
'adr_two_region' => 'adr_two_region',
'adr_two_postalcode' => 'adr_two_postalcode',
'adr_two_countryname' => 'adr_two_countryname',
'tel_work' => 'tel_work',
'tel_home' => 'tel_home',
'tel_voice' => 'tel_voice',
'tel_fax' => 'tel_fax',
'tel_msg' => 'tel_msg',
'tel_cell' => 'tel_cell',
'tel_pager' => 'tel_pager',
'tel_bbs' => 'tel_bbs',
'tel_modem' => 'tel_modem',
'tel_car' => 'tel_car',
'tel_isdn' => 'tel_isdn',
'tel_video' => 'tel_video',
'email' => 'email',
'email_home' => 'email_home'
);
/* Read full list of user's contacts only to get id's for each */
function export_start_file($buffer,$ncat_id='')
{
$this->id=-1;
if ($ncat_id)
{
$filter = 'tid=n,cat_id='.$ncat_id;
}
else
{
$filter = 'tid=n';
}
/* Setup the contact and vcard objects, and the export fields var */
$this->contacts = CreateObject('phpgwapi.contacts');
$this->vcard = CreateObject('phpgwapi.vcard');
$this->export = $this->vcard->export;
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for ($i=0;$i<count($tmp);$i++)
{
$this->ids[$i] = $tmp[$i]['id'];
}
/*
$ids is now an array of all id's for this user, e.g. $ids[0] = 21, etc...
$buffer is still empty
*/
return $buffer;
}
/* Read each entry */
function export_start_record($buffer)
{
$this->id++;
$top = $this->contacts->read_single_entry($this->ids[$this->id],$this->qfields);
$this->currentrecord = $top[0];
return $buffer;
}
/*
Read each attribute, populate buffer
name/value are the fields from the export array in the vcard class
*/
function export_new_attrib($buffer,$name,$value)
{
if ($this->export[$name] && ($value != '') )
{
$buffer[$this->id][$this->export[$name]] = $value;
/* echo '<br>'.$this->id.' - '.$this->export[$name].': '.$buffer[$this->id][$this->export[$name]]; */
}
return $buffer;
}
function export_end_record($buffer)
{
return $buffer;
}
function export_end_file($buffer)
{
reset($this->ids);
for ($i=0;$i<count($this->ids);$i++)
{
$vcards .= $this->vcard->out($buffer[$i]);
}
$buffer = $vcards;
return $buffer;
}
}
?>

View File

@ -1,155 +0,0 @@
<?php
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// export file and the value of the array item will be used in
// the creation of the output file.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array("LastName" => "FullName","FirstName" => "+, ");
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
class export_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
//list of all id's
var $ids = array();
var $type = 'ldif';
var $export= array(
'title' => 'title',
'n_given' => 'givenname',
'n_family' => 'sn',
'fn' => 'cn',
'org_name' => 'o',
'org_unit' => 'ou',
'adr_one_street' => 'streetaddress',
'adr_one_locality' => 'locality',
'adr_one_region' => 'st',
'adr_one_postalcode' => 'postalcode',
'adr_one_countryname' => 'countryname',
'tel_work' => 'telephonenumber',
'tel_home' => 'homephone',
'tel_fax' => 'facsimiletelephonenumber',
'ophone' => 'xmozillaanyphone',
'tel_cell' => 'cellphone',
'note' => 'description',
'ophone' => 'ophone',
'tel_pager' => 'pagerphone',
'email' => 'mail',
'url' => 'homeurl',
);
// This will store the contacts object
var $contacts = '';
// Read full list of user's contacts only to get id's for each
function export_start_file($buffer,$ncat_id='')
{
$this->id=-1;
if ($ncat_id)
{
$filter = 'tid=n,cat_id=' . $ncat_id;
}
else
{
$filter = 'tid=n';
}
$this->contacts = CreateObject('phpgwapi.contacts');
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for ($i=0;$i<count($tmp);$i++)
{
$this->ids[$i] = $tmp[$i]['id'];
}
// $ids is now an array of all id's for this user, e.g. $ids[0] = 21, etc...
// $buffer is still empty
return $buffer;
}
// Read each entry
function export_start_record($buffer)
{
$this->id++;
$top = $this->contacts->read_single_entry($this->ids[$this->id],$this->qfields);
$this->currentrecord = $top[0];
return $buffer;
}
// Read each attribute, populate buffer
// name/value are the fields from the export array above
function export_new_attrib($buffer,$name,$value)
{
if ($this->export[$name])
{
if (strstr($value,"\n"))
{
$value = ': '.base64_encode($value);
}
else
{
$value = ' '.$value;
}
$buffer[$this->id][$this->export[$name]] = $value;
//echo '<br>'.$this->id.' - '.$this->export[$name].': '.$buffer[$this->id][$this->export[$name]];
}
return $buffer;
}
// Tack on some extra values
function export_end_record($buffer)
{
$buffer[$this->id]['dn'] = 'cn='.$buffer[$this->id]['cn'].',mail='.$buffer[$this->id]['mail'];
$buffer[$this->id]['xmozillauseconferenceserver'] = '0';
$buffer[$this->id]['xmozillanickname'] = '';
$buffer[$this->id]['xmozillausehtmlmail'] = 'False';
if ($buffer[$this->id]['ophone'])
{
$buffer[$this->id]['xmozillaanyphone'] = $buffer[$this->id]['ophone'];
}
else
{
$buffer[$this->id]['xmozillaanyphone'] = $buffer[$this->id]['telephonenumber'];
}
//echo '<br>'.$this->id.' - '.$buffer[$this->id]['dn'];
return $buffer;
}
function export_end_file($buffer)
{
reset($this->ids);
for ($i=0;$i<count($this->ids);$i++)
{
$entries .= 'dn: ' . $buffer[$i]['dn'] . "\n";
reset($this->export);
while (list($name,$value)=each($this->export))
{
if ($value != 'dn')
{
$entries .= $value . ":" . $buffer[$i][$value] . "\n";
}
}
$entries .= 'xmozillauseconferenceserver: ' . $buffer[$i]['xmozillauseconferenceserver'] . "\n";
$entries .= 'xmozillanickname: ' . $buffer[$i]['xmozillanickname'] . "\n";
$entries .= 'xmozillausehtmlmail: ' . $buffer[$i]['xmozillausehtmlmail'] . "\n";
$entries .= 'xmozillaanyphone: ' . $buffer[$i]['xmozillaanyphone'] . "\n";
$entries .= 'objectClass: person' . "\n";
$entries .= 'objectClass: account' . "\n";
$entries .= 'objectClass: organizationalPerson' . "\n";
$entries .= 'objectClass: posixAccount' . "\n";
$entries .= 'objectClass: inetOrgPerson' . "\n";
$entries .= 'objectClass: shadowAccount' . "\n";
$entries .= "\n";
}
$buffer = $entries;
return $buffer;
}
}
?>

View File

@ -1,149 +0,0 @@
<?php
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// export file and the value of the array item will be used in
// the creation of the output file.
//
// An exported Outlook file looks like this:
//
// Title<tab>First Name<tab>Middle Name<tab>Last Name<tab>...
// <tab>Patrick<tab><tab>Walsh<tab>...
//
// Where the first line explains each optional field. This is what
// will be looked up in the key.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array("LastName" => "FullName","FirstName" => "+, ");
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
class export_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
var $type = 'csv';
var $export = array(
'n_prefix' => 'Anrede',
'n_given' => 'Vorname',
'n_middle' => 'Weitere Vornamen',
'n_family' => 'Nachname',
'n_suffix' => 'Suffix',
'org_name' => 'Firma',
'org_unit' => 'Abteilung',
'title' => 'Position',
'adr_one_street' => 'Straße geschäftlich',
'address2' => 'Straße geschäftlich 2',
'address3' => 'Straße geschäftlich 3',
'adr_one_locality' => 'Ort geschäftlich',
'adr_one_region' => 'Region geschäftlich',
'adr_one_postalcode' => 'Postleitzahl geschäftlich',
'adr_one_countryname' => 'Land geschäftlich',
'adr_two_street' => 'Straße privat',
'adr_two_locality' => 'Ort privat',
'adr_two_region' => 'Region privat',
'adr_two_postalcode' => 'Postleitzahl privat',
'adr_two_countryname' => 'Land privat',
'tel_fax' => 'Fax geschäftlich',
'tel_work' => 'Telefon geschäftlich',
'tel_msg' => 'Telefon Assistent',
'tel_car' => 'Autotelefon',
'tel_isdn' => 'ISDN',
'tel_home' => 'Telefon privat',
'tel_cell' => 'Mobiltelefon',
'tel_pager' => 'Pager',
'ophone' => 'Telefon geschäftlich 2',
'bday' => 'Geburtstag',
'email' => 'E-Mail-Adresse',
'email_home' => 'E-Mail 2: Adresse',
'url' => 'Webseite',
'note' => 'Notizen'
);
// This will store the contacts object
var $contacts = '';
function export_start_file($buffer,$ncat_id='')
{
$this->id=-1;
if ($ncat_id)
{
$filter = 'tid=n,cat_id='.$ncat_id;
}
else
{
$filter = 'tid=n';
}
$this->contacts = CreateObject('phpgwapi.contacts');
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for ($i=0;$i<count($tmp);$i++)
{
$this->ids[$i] = $tmp[$i]['id'];
}
// $ids is now an array of all id's for this user, e.g. $ids[0] = 21, etc...
// $buffer is still empty
return $buffer;
}
// Read each entry
function export_start_record($buffer)
{
$this->id++;
$top = $this->contacts->read_single_entry($this->ids[$this->id],$this->qfields);
$this->currentrecord = $top[0];
return $buffer;
}
// Read each attribute, populate buffer
// name/value are the fields from the export array above
function export_new_attrib($buffer,$name,$value)
{
if ($this->export[$name])
{
$buffer[$this->id][$this->export[$name]] = $value;
//echo '<br>'.$this->id.' - '.$this->export[$name].': '.$buffer[$this->id][$this->export[$name]];
}
return $buffer;
}
// Tack on some extra values
function export_end_record($buffer)
{
return $buffer;
}
function export_end_file($buffer)
{
// Build the header for the file (field list)
reset($this->export);
while (list($name,$value)=each($this->export))
{
$entries .= $value . ',';
}
$entries = substr($entries,0,-1);
$entries .= "\r\n";
// Now add all the data
reset($this->ids);
for ($i=0;$i<count($this->ids);$i++)
{
reset($this->export);
while (list($name,$value)=each($this->export))
{
$entries .= $buffer[$i][$value] . ',';
}
$entries = substr($entries,0,-1);
$entries .= "\r\n";
}
$buffer = $entries;
return $buffer;
}
}
?>

View File

@ -1,149 +0,0 @@
<?php
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// export file and the value of the array item will be used in
// the creation of the output file.
//
// An exported Outlook file looks like this:
//
// Title<tab>First Name<tab>Middle Name<tab>Last Name<tab>...
// <tab>Patrick<tab><tab>Walsh<tab>...
//
// Where the first line explains each optional field. This is what
// will be looked up in the key.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array("LastName" => "FullName","FirstName" => "+, ");
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
class export_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
var $type = 'csv';
var $export = array(
'n_prefix' => 'Title',
'n_given' => 'First Name',
'n_middle' => 'Middle Name',
'n_family' => 'Last Name',
'n_suffix' => 'Suffix',
'org_name' => 'Company',
'org_unit' => 'Department',
'title' => 'Job Title',
'adr_one_street' => 'Business Street',
'address2' => 'Business Street 2',
'address3' => 'Business Street 3',
'adr_one_locality' => 'Business City',
'adr_one_region' => 'Business State',
'adr_one_postalcode' => 'Business Postal Code',
'adr_one_countryname' => 'Business Country',
'adr_two_street' => 'Home Street',
'adr_two_locality' => 'Home City',
'adr_two_region' => 'Home State',
'adr_two_postalcode' => 'Home Postal Code',
'adr_two_countryname' => 'Home Country',
'tel_fax' => 'Business Fax',
'tel_work' => 'Business Phone',
'tel_msg' => "Assistant's Phone",
'tel_car' => 'Car Phone',
'tel_isdn' => 'ISDN',
'tel_home' => 'Home Phone',
'tel_cell' => 'Mobile Phone',
'tel_pager' => 'Pager',
'ophone' => 'Business Phone 2',
'bday' => 'Birthday',
'email' => 'E-mail Address',
'email_home' => 'E-mail Address 2',
'url' => 'Web Page',
'note' => 'Notes'
);
// This will store the contacts object
var $contacts = '';
function export_start_file($buffer,$ncat_id='')
{
$this->id=-1;
if ($ncat_id)
{
$filter = 'tid=n,cat_id='.$ncat_id;
}
else
{
$filter = 'tid=n';
}
$this->contacts = CreateObject('phpgwapi.contacts');
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for ($i=0;$i<count($tmp);$i++)
{
$this->ids[$i] = $tmp[$i]['id'];
}
// $ids is now an array of all id's for this user, e.g. $ids[0] = 21, etc...
// $buffer is still empty
return $buffer;
}
// Read each entry
function export_start_record($buffer)
{
$this->id++;
$top = $this->contacts->read_single_entry($this->ids[$this->id],$this->qfields);
$this->currentrecord = $top[0];
return $buffer;
}
// Read each attribute, populate buffer
// name/value are the fields from the export array above
function export_new_attrib($buffer,$name,$value)
{
if ($this->export[$name])
{
$buffer[$this->id][$this->export[$name]] = $value;
//echo '<br>'.$this->id.' - '.$this->export[$name].': '.$buffer[$this->id][$this->export[$name]];
}
return $buffer;
}
// Tack on some extra values
function export_end_record($buffer)
{
return $buffer;
}
function export_end_file($buffer)
{
// Build the header for the file (field list)
reset($this->export);
while (list($name,$value)=each($this->export))
{
$entries .= $value . ',';
}
$entries = substr($entries,0,-1);
$entries .= "\r\n";
// Now add all the data
reset($this->ids);
for ($i=0;$i<count($this->ids);$i++)
{
reset($this->export);
while (list($name,$value)=each($this->export))
{
$entries .= $buffer[$i][$value] . ',';
}
$entries = substr($entries,0,-1);
$entries .= "\r\n";
}
$buffer = $entries;
return $buffer;
}
}
?>

View File

@ -1,148 +0,0 @@
<?php
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// export file and the value of the array item will be used in
// the creation of the output file.
//
// An exported Outlook file looks like this:
//
// Title<tab>First Name<tab>Middle Name<tab>Last Name<tab>...
// <tab>Patrick<tab><tab>Walsh<tab>...
//
// Where the first line explains each optional field. This is what
// will be looked up in the key.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array("LastName" => "FullName","FirstName" => "+, ");
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
class export_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
var $type = 'csv';
var $export = array(
'title' => 'Tehtävänimike',
'n_given' => 'Etunimi',
'n_middle' => 'Toinen nimi',
'n_family' => 'Sukunimi',
'n_suffix' => 'Jälkiliite',
'org_name' => 'Yritys',
'org_unit' => 'Osasto',
'adr_one_street' => 'Lähiosoite (työ)',
'Business Street 2' => 'Lähiosoite (työ) 2',
'Business Street 3' => 'Lähiosoite (työ) 3',
'Business City' => 'Postitoimipaikka (työ)',
'Business State' => 'Sijaintitiedot (työ)',
'Business Postal Code' => 'Postinumero (työ)',
'Business Country' => 'Maa (työ)',
'Home Street' => 'Lähiosoite (koti)',
'Home City' => 'Postitoimipaikka (koti)',
'Home State' => 'Sijaintitiedot (koti)',
'Home Postal Code' => 'Postinumero (koti)',
'Home Country' => 'Maa (koti)',
'Business Fax' => 'Työfaksi',
'Business Phone' => 'Työpuhelin',
"Assistant's Phone" => 'Avustajan puhelinnumero',
'Car Phone' => 'Autopuhelin',
'ISDN' => 'ISDN',
'Home Phone' => 'Kotipuhelin',
'Mobile Phone' => 'Matkapuhelin',
'Pager' => 'Hakulaite',
'Business Phone 2' => 'Työpuhelin 2',
'Birthday' => 'Syntymäpäivä',
'E-mail Address' => 'Sähköpostiosoite',
'E-mail Address 2' => 'Säköpostiosoite 2',// Note! Typo error in Finnish Outlook 2003 export addressbook to csv-file!
'Web Page' => 'Web-sivu',
'Notes' => 'Muistilaput'
);
// This will store the contacts object
var $contacts = '';
function export_start_file($buffer,$ncat_id='')
{
$this->id=-1;
if ($ncat_id)
{
$filter = 'tid=n,cat_id='.$ncat_id;
}
else
{
$filter = 'tid=n';
}
$this->contacts = CreateObject('phpgwapi.contacts');
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for ($i=0;$i<count($tmp);$i++)
{
$this->ids[$i] = $tmp[$i]['id'];
}
// $ids is now an array of all id's for this user, e.g. $ids[0] = 21, etc...
// $buffer is still empty
return $buffer;
}
// Read each entry
function export_start_record($buffer)
{
$this->id++;
$top = $this->contacts->read_single_entry($this->ids[$this->id],$this->qfields);
$this->currentrecord = $top[0];
return $buffer;
}
// Read each attribute, populate buffer
// name/value are the fields from the export array above
function export_new_attrib($buffer,$name,$value)
{
if ($this->export[$name])
{
$buffer[$this->id][$this->export[$name]] = $value;
//echo '<br>'.$this->id.' - '.$this->export[$name].': '.$buffer[$this->id][$this->export[$name]];
}
return $buffer;
}
// Tack on some extra values
function export_end_record($buffer)
{
return $buffer;
}
function export_end_file($buffer)
{
// Build the header for the file (field list)
reset($this->export);
while (list($name,$value)=each($this->export))
{
$entries .= $value . ',';
}
$entries = substr($entries,0,-1);
$entries .= "\r\n";
// Now add all the data
reset($this->ids);
for ($i=0;$i<count($this->ids);$i++)
{
reset($this->export);
while (list($name,$value)=each($this->export))
{
$entries .= $buffer[$i][$value] . ',';
}
$entries = substr($entries,0,-1);
$entries .= "\r\n";
}
$buffer = $entries;
return $buffer;
}
}
?>

View File

@ -1,148 +0,0 @@
<?php
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// export file and the value of the array item will be used in
// the creation of the output file.
//
// An exported Outlook file looks like this:
//
// Title<tab>First Name<tab>Middle Name<tab>Last Name<tab>...
// <tab>Patrick<tab><tab>Walsh<tab>...
//
// Where the first line explains each optional field. This is what
// will be looked up in the key.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array("LastName" => "FullName","FirstName" => "+, ");
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
class export_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
var $type = 'csv';
var $export = array(
'title' => 'Fonction',
'n_given' => 'Prénom',
'n_middle' => 'Deuxième prénom',
'n_family' => 'Nom',
'n_suffix' => 'Suffixe',
'org_name' => 'Société',
'org_unit' => 'Service',
'adr_one_street' => 'Rue (bureau)',
'address2' => 'Rue (bureau) 2',
'address3' => 'Rue (bureau) 3',
'adr_one_locality' => 'Ville (bureau)',
'adr_one_region' => 'État/Prov (bureau)',
'adr_one_postalcode' => 'Code postal (bureau)',
'adr_one_countryname' => 'Pays (bureau)',
'adr_two_street' => 'Rue (domicile)',
'adr_two_locality' => 'Ville (domicile)',
'adr_two_region' => 'État/Prov (domicile)',
'adr_two_postalcode' => 'Code postal (domicile)',
'adr_two_countryname' => 'Pays (domicile)',
'tel_fax' => 'Télécopie (bureau)',
'tel_work' => 'Téléphone (bureau)',
'tel_msg' => "Téléphone de l'assistant(e)",
'tel_car' => 'Téléphone (voiture)',
'tel_isdn' => 'RNIS',
'tel_home' => 'Téléphone (domicile)',
'tel_cell' => 'Tél. mobile',
'tel_pager' => 'Récepteur de radiomessagerie',
'ophone' => 'Téléphone 2 (bureau)',
'bday' => 'Anniversaire',
'email' => 'Adresse e-mail',
'email_home' => 'Adresse e-mail 2',
'url' => 'Page Web',
'note' => 'Notes'
);
// This will store the contacts object
var $contacts = '';
function export_start_file($buffer,$ncat_id='')
{
$this->id=-1;
if ($ncat_id)
{
$filter = 'tid=n,cat_id='.$ncat_id;
}
else
{
$filter = 'tid=n';
}
$this->contacts = CreateObject('phpgwapi.contacts');
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for ($i=0;$i<count($tmp);$i++)
{
$this->ids[$i] = $tmp[$i]['id'];
}
// $ids is now an array of all id's for this user, e.g. $ids[0] = 21, etc...
// $buffer is still empty
return $buffer;
}
// Read each entry
function export_start_record($buffer)
{
$this->id++;
$top = $this->contacts->read_single_entry($this->ids[$this->id],$this->qfields);
$this->currentrecord = $top[0];
return $buffer;
}
// Read each attribute, populate buffer
// name/value are the fields from the export array above
function export_new_attrib($buffer,$name,$value)
{
if ($this->export[$name])
{
$buffer[$this->id][$this->export[$name]] = $value;
//echo '<br>'.$this->id.' - '.$this->export[$name].': '.$buffer[$this->id][$this->export[$name]];
}
return $buffer;
}
// Tack on some extra values
function export_end_record($buffer)
{
return $buffer;
}
function export_end_file($buffer)
{
// Build the header for the file (field list)
reset($this->export);
while (list($name,$value)=each($this->export))
{
$entries .= $value . ',';
}
$entries = substr($entries,0,-1);
$entries .= "\r\n";
// Now add all the data
reset($this->ids);
for ($i=0;$i<count($this->ids);$i++)
{
reset($this->export);
while (list($name,$value)=each($this->export))
{
$entries .= $buffer[$i][$value] . ',';
}
$entries = substr($entries,0,-1);
$entries .= "\r\n";
}
$buffer = $entries;
return $buffer;
}
}
?>

View File

@ -1,163 +0,0 @@
<?php
// file for outlook italian version
// based on Outlook_CSV_-_English - modified fields names and birthday treatment
// by Simone Capra - capra@erweb.it - http://www.erweb.it
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// export file and the value of the array item will be used in
// the creation of the output file.
//
// An exported Outlook file looks like this:
//
// Title<tab>First Name<tab>Middle Name<tab>Last Name<tab>...
// <tab>Patrick<tab><tab>Walsh<tab>...
//
// Where the first line explains each optional field. This is what
// will be looked up in the key.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array("LastName" => "FullName","FirstName" => "+, ");
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
class export_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
var $type = 'csv';
var $export = array(
'title' => 'Posizione',
'n_prefix' => 'Titolo',
'n_given' => 'Nome',
'n_middle' => 'Secondo nome',
'n_family' => 'Cognome',
'n_suffix' => 'Titolo straniero',
'org_name' => 'Società',
'org_unit' => 'Reparto',
'adr_one_street' => 'Via (uff.)',
'address2' => 'Via (uff.) 2',
'address3' => 'Via (uff.) 3',
'adr_one_locality' => 'Città (uff.)',
'adr_one_region' => 'Provincia (uff.)',
'adr_one_postalcode' => 'CAP (uff.)',
'adr_one_countryname' => 'Paese (uff.)',
'adr_two_street' => 'Via (ab.)',
'adr_two_locality' => 'Città (ab.)',
'adr_two_region' => 'Provincia (ab.)',
'adr_two_postalcode' => 'CAP (ab.)',
'adr_two_countryname' => 'Paese (ab.)',
'tel_fax' => 'Fax (uff.)',
'tel_work' => 'Ufficio',
'tel_msg' => 'Telefono assistente',
'tel_car' => 'Telefono auto',
'tel_isdn' => 'ISDN',
'tel_home' => 'Abitazione',
'tel_cell' => 'Cellulare',
'tel_pager' => 'Pager',
'ophone' => 'Business Phone 2',
'bday' => 'Compleanno',
'email' => 'Indirizzo posta elettronica',
'email_home' => 'Indirizzo posta elettronica 2',
'url' => 'Pagina Web',
'note' => 'Notes'
);
// This will store the contacts object
var $contacts = '';
function export_start_file($buffer,$ncat_id='')
{
$this->id=-1;
if ($ncat_id)
{
$filter = 'tid=n,cat_id='.$ncat_id;
}
else
{
$filter = 'tid=n';
}
$this->contacts = CreateObject('phpgwapi.contacts');
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for ($i=0;$i<count($tmp);$i++)
{
$this->ids[$i] = $tmp[$i]['id'];
}
// $ids is now an array of all id's for this user, e.g. $ids[0] = 21, etc...
// $buffer is still empty
return $buffer;
}
// Read each entry
function export_start_record($buffer)
{
$this->id++;
$top = $this->contacts->read_single_entry($this->ids[$this->id],$this->qfields);
$this->currentrecord = $top[0];
return $buffer;
}
// Read each attribute, populate buffer
// name/value are the fields from the export array above
function export_new_attrib($buffer,$name,$value)
{
if ($this->export[$name])
{
if($name=='bday'){
list($m,$d,$y) = explode("/",$value );
$value = $d.'/'.$m.'/'.$y;
}
$buffer[$this->id][$this->export[$name]] = $value;
//echo '<br>'.$this->id.' - '.$this->export[$name].': '.$buffer[$this->id][$this->export[$name]];
}
return $buffer;
}
// Tack on some extra values
function export_end_record($buffer)
{
return $buffer;
}
function export_end_file($buffer)
{
// Build the header for the file (field list)
reset($this->export);
while (list($name,$value)=each($this->export))
{
$entries .= $value . ',';
}
$entries = substr($entries,0,-1);
$entries .= "\r\n";
// Now add all the data
reset($this->ids);
for ($i=0;$i<count($this->ids);$i++)
{
reset($this->export);
while (list($name,$value)=each($this->export))
{
$entries .= $buffer[$i][$value] . ',';
}
$entries = substr($entries,0,-1);
$entries .= "\r\n";
}
$buffer = $entries;
return $buffer;
}
}
?>

View File

@ -1,136 +0,0 @@
<?php
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// export file and the value of the array item will be used in
// the creation of the output file.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array("LastName" => "FullName","FirstName" => "+, ");
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
class export_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
//list of all id's
var $ids = array();
var $type = 'pdb';
var $export = array(
'title' => 'Title',
'n_given' => 'First',
'n_middle' => 'Middle',
'n_family' => 'Last',
'n_suffix' => 'Suffix',
'org_name' => 'Company',
'org_unit' => 'Dept',
'adr_one_street' => 'Bus. Street',
'address2' => 'Bus. St. 2',
'address3' => 'Bus. St. 3',
'adr_one_locality' => 'Bus. City',
'adr_one_region' => 'Bus. State',
'adr_one_postalcode' => 'Bus. Postal Code',
'adr_one_countryname' => 'Bus. Country',
'adr_two_street' => 'Home Street',
'adr_two_locality' => 'Home City',
'adr_two_region' => 'Home State',
'adr_two_postalcode' => 'Home Postal Code',
'adr_two_countryname' => 'Home Country',
'tel_fax' => 'Bus. Fax',
'tel_work' => 'Bus. Phone',
'tel_msg' => "Assistant's Phone",
'tel_car' => 'Car Phone',
'tel_isdn' => 'ISDN',
'tel_home' => 'Home Phone',
'tel_cell' => 'Mobile Phone',
'tel_pager' => 'Pager',
'ophone' => 'Bus. Phone2',
'bday' => 'Birthday',
'email' => 'Email Addr',
'email_home' => 'Email Addr2',
'url' => 'URL',
'note' => 'Notes'
);
// This will store the contacts object
var $contacts = '';
// Read full list of user's contacts only to get id's for each
function export_start_file($buffer,$ncat_id='')
{
$this->id=-1;
if ($ncat_id)
{
$filter = 'tid=n,cat_id='.$ncat_id;
}
else
{
$filter = 'tid=n';
}
$this->contacts = CreateObject('phpgwapi.contacts');
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for ($i=0;$i<count($tmp);$i++)
{
$this->ids[$i] = $tmp[$i]['id'];
}
// $ids is now an array of all id's for this user, e.g. $ids[0] = 21, etc...
// $buffer is still empty
return $buffer;
}
// Read each entry
function export_start_record($buffer)
{
$this->id++;
$top = $this->contacts->read_single_entry($this->ids[$this->id],$this->qfields);
$this->currentrecord = $top[0];
return $buffer;
}
// Read each attribute, populate buffer array
// name/value are the fields from the export array above
function export_new_attrib($buffer,$name,$value)
{
if ($this->export[$name])
{
$buffer[$this->id][$this->export[$name]] = $value;
//echo '<br>'.$this->id.' - '.$this->export[$name].': '.$buffer[$this->id][$this->export[$name]];
}
return $buffer;
}
// Tack on some extra values - none for this file
function export_end_record($buffer)
{
return $buffer;
}
// Parse it all into a string
function export_end_file($buffer)
{
reset($this->ids);
for($i=0;$i<count($this->ids);$i++)
{
$j = $i + 1;
reset($this->export);
$entries .= "#" . $j . ":" . $buffer[$i]['n_given'] . $buffer[$i]['n_family'] . "\r\n";
while (list($name,$value)=each($this->export))
{
$entries .= $value . ":\t" . $buffer[$i][$value] . "\n";
}
$entries .= "\r\n";
}
return $entries;
}
}
?>

View File

@ -1,173 +0,0 @@
<?php
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// export file and the value of the array item will be used in
// the creation of the output file.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array("LastName" => "FullName","FirstName" => "+, ");
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
class export_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
//list of all id's
var $ids = array();
var $type = 'ldif';
var $export = array(
'id' => 'uidnumber',
'lid' => 'uid',
'tid' => 'phpgwcontacttypeid',
'owner' => 'phpgwcontactowner',
'access' => 'phpgwcontactaccess',
'fn' => 'cn', // 'prefix given middle family suffix'
'n_given' => 'givenname', // firstname
'n_family' => 'sn', // lastname
'n_middle' => 'phpgwmiddlename',
'n_prefix' => 'phpgwprefix',
'n_suffix' => 'phpgwsuffix',
'sound' => 'phpgwaudio',
'bday' => 'phpgwbirthday',
'note' => 'description',
'tz' => 'phpgwtz',
'geo' => 'phpgwgeo',
'url' => 'phpgwurl',
'pubkey' => 'phpgwpublickey',
'org_name' => 'o', // company
'org_unit' => 'ou', // division
'title' => 'title',
'adr_one_street' => 'streetaddress',
'adr_one_locality' => 'localityname',
'adr_one_region' => 'st',
'adr_one_postalcode' => 'postalcode',
'adr_one_countryname' => 'co',
'adr_one_type' => 'phpgwadronetype', // address is domestic/intl/postal/parcel/work/home
'label' => 'phpgwaddresslabel', // address label
'adr_two_street' => 'phpgwadrtwostreet',
'adr_two_locality' => 'phpgwadrtwolocality',
'adr_two_region' => 'phpgwadrtworegion',
'adr_two_postalcode' => 'phpgwadrtwopostalcode',
'adr_two_countryname' => 'phpgwadrtwocountryname',
'adr_two_type' => 'phpgwadrtwotype', // address is domestic/intl/postal/parcel/work/home
'tel_work' => 'telephonenumber',
'tel_home' => 'homephone',
'tel_voice' => 'phpgwvoicetelephonenumber',
'tel_fax' => 'facsimiletelephonenumber',
'tel_msg' => 'phpgwmsgtelephonenumber',
'tel_cell' => 'phpgwcelltelephonenumber',
'tel_pager' => 'phpgwpagertelephonenumber',
'tel_bbs' => 'phpgwbbstelephonenumber',
'tel_modem' => 'phpgwmodemtelephonenumber',
'tel_car' => 'phpgwmobiletelephonenumber',
'tel_isdn' => 'phpgwisdnphonenumber',
'tel_video' => 'phpgwvideophonenumber',
'tel_prefer' => 'phpgwpreferphone', // home, work, voice, etc
'email' => 'mail',
'email_type' => 'phpgwmailtype', //'INTERNET','CompuServe',etc...
'email_home' => 'phpgwmailhome',
'email_home_type' => 'phpgwmailhometype' //'INTERNET','CompuServe',etc...
);
// This will store the contacts object
var $contacts = '';
// Read full list of user's contacts only to get id's for each
function export_start_file($buffer,$ncat_id='')
{
$this->id=-1;
if ($ncat_id)
{
$filter = 'tid=n,cat_id='.$ncat_id;
}
else
{
$filter = 'tid=n';
}
$this->contacts = CreateObject('phpgwapi.contacts');
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for ($i=0;$i<count($tmp);$i++)
{
$this->ids[$i] = $tmp[$i]['id'];
}
// $ids is now an array of all id's for this user, e.g. $ids[0] = 21, etc...
// $buffer is still empty
return $buffer;
}
// Read each entry
function export_start_record($buffer)
{
$this->id++;
$top = $this->contacts->read_single_entry($this->ids[$this->id],$this->qfields);
$this->currentrecord = $top[0];
return $buffer;
}
// Read each attribute, populate buffer
// name/value are the fields from the export array above
function export_new_attrib($buffer,$name,$value)
{
if ($this->export[$name] && ($value != '') )
{
$buffer[$this->id][$this->export[$name]] = $value;
//echo '<br>'.$this->id.' - '.$this->export[$name].': '.$buffer[$this->id][$this->export[$name]];
}
return $buffer;
}
// Tack on some extra values
function export_end_record($buffer)
{
$context = 'ou=contacts,dc=domain,dc=com'; // some default to replace later
if ($GLOBALS['egw_info']['server']['ldap_contact_context'])
{
$context = $GLOBALS['egw_info']['server']['ldap_contact_context'];
}
$buffer[$this->id]['uid'] = time().':'.$this->id.($buffer[$this->id]['cn'] ? ':'.str_replace(',','',$buffer[$this->id]['cn']) : '');
$buffer[$this->id]['dn'] = 'uid='.$buffer[$this->id]['uid'].','.$context;
$buffer[$this->id]['description'] = ereg_replace("\r\n",';',$buffer[$this->id]['description']);
//echo '<br>'.$this->id.' - '.$buffer[$this->id]['dn'];
return $buffer;
}
function export_end_file($buffer)
{
reset($this->ids);
for ($i=0;$i<count($this->ids);$i++)
{
$entries .= 'dn: '.$buffer[$i]['dn'] . "\n";
reset($this->export);
while (list($name,$value)=each($this->export))
{
if (($value != 'dn') && !empty($buffer[$i][$value]))
{
$tmp = str_replace(',','',$buffer[$i][$value]);
$entries .= $value . ': ' . $tmp . "\n";
}
}
$entries .= 'objectClass: person' . "\n";
$entries .= 'objectClass: organizationalPerson' . "\n";
# not needed for openldap > 2.1 anymore
#$entries .= 'objectClass: inetOrgPerson' . "\n";
$entries .= 'objectClass: phpgwContact' . "\n";
$entries .= "\n";
}
$buffer = $entries;
return $buffer;
}
}
?>

View File

@ -1,159 +0,0 @@
<?php
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// export file and the value of the array item will be used in
// the creation of the output file.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array("LastName" => "FullName","FirstName" => "+, ");
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
class export_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
//list of all id's
var $ids = array();
var $type = 'sql';
var $export= array(
'id' => 'id',
'lid' => 'lid',
'tid' => 'tid',
'owner' => 'owner',
'fn' => 'fn',
'n_given' => 'n_given',
'n_family' => 'n_family',
'n_middle' => 'n_middle',
'n_prefix' => 'n_prefix',
'n_suffix' => 'n_suffix',
'sound' => 'sound',
'bday' => 'bday',
'note' => 'note',
'tz' => 'tz',
'geo' => 'geo',
'url' => 'url',
'pubkey' => 'pubkey',
'org_name' => 'org_name',
'org_unit' => 'org_unit',
'title' => 'title',
'adr_one_street' => 'adr_one_street',
'adr_one_locality' => 'adr_one_locality',
'adr_one_region' => 'adr_one_region',
'adr_one_postalcode' => 'adr_one_postalcode',
'adr_one_countryname' => 'adr_one_countryname',
'adr_one_type' => 'adr_one_type',
'label' => 'label',
'adr_two_street' => 'adr_two_street',
'adr_two_locality' => 'adr_two_locality',
'adr_two_region' => 'adr_two_region',
'adr_two_postalcode' => 'adr_two_postalcode',
'adr_two_countryname' => 'adr_two_countryname',
'adr_two_type' => 'adr_two_type',
'tel_work' => 'tel_work',
'tel_home' => 'tel_home',
'tel_voice' => 'tel_voice',
'tel_fax' => 'tel_fax',
'tel_msg' => 'tel_msg',
'tel_cell' => 'tel_cell',
'tel_pager' => 'tel_pager',
'tel_bbs' => 'tel_bbs',
'tel_modem' => 'tel_modem',
'tel_car' => 'tel_car',
'tel_isdn' => 'tel_isdn',
'tel_video' => 'tel_video',
'tel_prefer' => 'tel_prefer',
'email' => 'email',
'email_type' => 'email_type',
'email_home' => 'email_home',
'email_home_type' => 'email_home_type'
);
// This will store the contacts object
var $contacts = '';
// Read full list of user's contacts only to get id's for each
function export_start_file($buffer,$ncat_id='')
{
$this->id=-1;
if ($ncat_id)
{
$filter = 'tid=n,cat_id=' . $ncat_id;
}
else
{
$filter = 'tid=n';
}
$this->contacts = CreateObject('phpgwapi.contacts');
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for ($i=0;$i<count($tmp);$i++)
{
$this->ids[$i] = $tmp[$i]['id'];
}
// $ids is now an array of all id's for this user, e.g. $ids[0] = 21, etc...
// $buffer is still empty
return $buffer;
}
// Read each entry
function export_start_record($buffer)
{
$this->id++;
$top = $this->contacts->read_single_entry($this->ids[$this->id],$this->qfields);
$this->currentrecord = $top[0];
return $buffer;
}
// Read each attribute, populate buffer array
// name/value are the fields from the export array above
function export_new_attrib($buffer,$name,$value)
{
if ($this->export[$name])
{
$buffer[$this->id][$this->export[$name]] = $value;
//echo '<br>'.$this->id.' - '.$this->export[$name].': '.$buffer[$this->id][$this->export[$name]];
}
return $buffer;
}
// Tack on some extra values - none for this file
function export_end_record($buffer)
{
return $buffer;
}
// Parse it all into a string
function export_end_file($buffer)
{
$top = 'INSERT INTO egw_addressbook(';
reset($this->ids);
for ($i=0;$i<count($this->ids);$i++)
{
reset($this->export);
$fields = $values = "";
while (list($name,$value) = each($this->export))
{
$fields .= $value . ",";
$values .= "'" . $buffer[$i][$value] . "',";
}
$fields = substr($fields,0,-1) . ")\n VALUES(";
$values = substr($values,0,-1) . ");\n";
$entries .= $top . $fields . $values;
}
$buffer = $entries;
return $buffer;
}
}
?>

View File

@ -1,90 +0,0 @@
<?php
/*
This file defines a set of functions and an associative array.
The key of the array corresponds to a header in the source
import file and the value of the array item will be used in
the creation of the output file.
The array need not be in any order and any fields not defined will
not be transferred. If the val='+', the value will be appended to
the previous field and any text after the '+' will be appended
before the value. For example, the following would add a comma and
a space between LastName and FirstName and store it in FullName:
array('LastName' => 'FullName','FirstName' => '+, ');
Also start with a '#' symbol and a comma separated list will be
turned into a number of the same entries.
*/
/* $Id$ */
class import_conv
{
var $currentrecord = array(); /* used for buffering to allow uid lines to go first */
var $id;
var $type = 'vcard';
/* These will hold the class objects */
var $contacts = '';
var $vcard = '';
/* This will be populated via the vcard->import var */
var $import = array();
function import_start_file($buffer)
{
$this->id = 0;
$this->contacts = CreateObject('phpgwapi.contacts');
$this->vcard = CreateObject('phpgwapi.vcard');
$this->import = $this->vcard->import;
return $buffer;
}
function import_start_record($buffer)
{
++$this->id;
$this->currentrecord = array();
return $buffer;
}
function import_new_attrib($buffer,$name,$value)
{
$value = trim($value);
$value = str_replace('=0D=0A',"\n",$value);
/* echo '<br>'.$this->id.': '.$name.' => '.$value; */
$this->currentrecord += array($name => $value);
return $buffer;
}
function import_end_record($buffer)
{
$buffer[$this->id]='';
while ( list($name, $value) = each($this->currentrecord))
{
$buffer[$this->id][$name] = $value;
/* $buffer[$this->id]['private'] = $private; */
/* echo '<br>'.$name.' => '.$value; */
}
return $buffer;
}
function import_end_file($buffer,$access='private',$cat_id=0)
{
for ($i=1;$i<=count($buffer);$i++)
{
/*
Send the entire array to the vcard class in function.
It will parse the vcard fields and clean the array of extra
bogus values that get stuffed in.
*/
$entry = $this->vcard->in($buffer[$i]);
/* Now actually add the new entry */
$this->contacts->add($GLOBALS['egw_info']['user']['account_id'],$entry,$access,$cat_id);
}
$num = $i - 1;
return lang('Successfully imported %1 records into your addressbook.',$num);
}
}
?>

View File

@ -1,118 +0,0 @@
<?php
/*
This file defines a set of functions and an associative array.
The key of the array corresponds to a header in the source
import file and the value of the array item will be used in
the creation of the output file.
The array need not be in any order and any fields not defined will
not be transferred. If the val='+', the value will be appended to
the previous field and any text after the '+' will be appended
before the value. For example, the following would add a comma and
a space between LastName and FirstName and store it in FullName:
array('LastName' => 'FullName','FirstName' => '+, ');
Also start with a '#' symbol and a comma separated list will be
turned into a number of the same entries.
*/
/* $Id$ */
class import_conv
{
var $currentrecord = array(); /* used for buffering to allow uid lines to go first */
var $id;
var $type = 'ldif';
var $import = array(
'title' => 'title',
'givenname' => 'n_given',
'sn' => 'n_family',
'cn' => 'fn',
'o' => 'org_name',
'ou' => 'org_unit',
'streetaddress' => 'adr_one_street',
'postaladdress' => 'adr_one_street',
'mozillaPostalAddress2' => 'address2',
'locality' => 'adr_one_locality',
'l' => 'adr_one_locality',
'st' => 'adr_one_region',
'postalcode' => 'adr_one_postalcode',
'countryname' => 'adr_one_countryname',
'c' => 'adr_one_countryname',
'homepostaladdress' => 'adr_two_street',
'mozillahomelocalityname' => 'adr_two_locality',
'mozillahomestate' => 'adr_two_region',
'mozillahomepostalcode' => 'adr_two_postalcode',
'mozillahomecountryname' => 'adr_two_countryname',
'telephonenumber' => 'tel_work',
'homephone' => 'tel_home',
'facsimiletelephonenumber' => 'tel_fax',
'xmozillaanyphone' => 'ophone',
'mobile' => 'tel_cell',
'description' => 'note',
'pager' => 'tel_pager',
'mail' => 'email',
'homeurl' => 'url',
'workurl' => 'url'
);
function import_start_file($buffer)
{
return $buffer;
}
function import_start_record($buffer)
{
$top = array();
++$this->id;
$this->currentrecord = $top;
return $buffer;
}
function import_new_attrib($buffer,$name,$value)
{
/* chop leading space from value */
$value = trim($value);
$value = str_replace('\r','',$value);
/* echo '<br>'.$name.' => '.$value; */
$this->currentrecord += array($name => $value);
return $buffer;
}
function import_end_record($buffer)
{
$buffer[$this->id] = '';
while(list($name, $value) = each($this->currentrecord))
{
$buffer[$this->id][$name] = $value;
/* echo '<br>'.$this->id.': '.$name.' => '.$value; */
}
return $buffer;
}
function import_end_file($buffer,$access='private',$cat_id=0)
{
$contacts = CreateObject('phpgwapi.contacts');
/* echo '<br>'; */
for($i=1;$i<=count($buffer);$i++)
{
while(list($name,$value) = @each($buffer[$i]))
{
/* echo '<br>'.$i.': '.$name.' => '.$value; */
$entry[$i][$name] = $value;
}
$entry[$i]['email_type'] = 'INTERNET';
$entry[$i]['email_home_type'] = 'INTERNET';
$entry[$i]['adr_one_type'] = 'intl';
$entry[$i]['adr_two_type'] = 'intl';
/* echo '<br>'; */
$contacts->add($GLOBALS['egw_info']['user']['account_id'],$entry[$i],$access,$cat_id);
}
$num = $i - 1;
return lang('Successfully imported %1 records into your addressbook.',$num);
}
}
?>

View File

@ -1,113 +0,0 @@
<?php
/*
This file defines a set of functions and an associative array.
The key of the array corresponds to a header in the source
import file and the value of the array item will be used in
the creation of the output file.
The array need not be in any order and any fields not defined will
not be transferred. If the val='+', the value will be appended to
the previous field and any text after the '+' will be appended
before the value. For example, the following would add a comma and
a space between LastName and FirstName and store it in FullName:
array('LastName' => 'FullName','FirstName' => '+, ');
Also start with a '#' symbol and a comma separated list will be
turned into a number of the same entries.
*/
/* $Id$ */
class import_conv
{
var $currentrecord = array(); /* used for buffering to allow uid lines to go first */
var $id;
var $type = 'ldif';
var $import = array(
'title' => 'title',
'givenname' => 'n_given',
'sn' => 'n_family',
'cn' => 'fn',
'o' => 'org_name',
'ou' => 'org_unit',
'streetaddress' => 'adr_one_street',
'locality' => 'adr_one_locality',
'st' => 'adr_one_region',
'postalcode' => 'adr_one_postalcode',
'countryname' => 'adr_one_countryname',
'telephonenumber' => 'tel_work',
'homephone' => 'tel_home',
'facsimiletelephonenumber' => 'tel_fax',
'xmozillaanyphone' => 'ophone',
'cellphone' => 'tel_cell',
'description' => 'note',
'pagerphone' => 'tel_pager',
'mail' => 'email',
'homeurl' => 'url',
'xmozillauseconferenceserver' => '',
'xmozillanickname' => '',
'xmozillausehtmlmail' => '',
'modifytimestamp' => '',
'objectclass' => ''
);
function import_start_file($buffer)
{
return $buffer;
}
function import_start_record($buffer)
{
$top = array();
++$this->id;
$this->currentrecord = $top;
return $buffer;
}
function import_new_attrib($buffer,$name,$value)
{
/* chop leading space from value */
$value = trim($value);
$value = str_replace('\r','',$value);
/* echo '<br>'.$name.' => '.$value; */
$this->currentrecord += array($name => $value);
return $buffer;
}
function import_end_record($buffer)
{
$buffer[$this->id] = '';
while(list($name, $value) = each($this->currentrecord))
{
$buffer[$this->id][$name] = $value;
/* echo '<br>'.$this->id.': '.$name.' => '.$value; */
}
return $buffer;
}
function import_end_file($buffer,$access='private',$cat_id=0)
{
$contacts = CreateObject('phpgwapi.contacts');
/* echo '<br>'; */
for($i=1;$i<=count($buffer);$i++)
{
while(list($name,$value) = @each($buffer[$i]))
{
/* echo '<br>'.$i.': '.$name.' => '.$value; */
$entry[$i][$name] = $value;
}
$entry[$i]['email_type'] = 'INTERNET';
$entry[$i]['email_home_type'] = 'INTERNET';
$entry[$i]['adr_one_type'] = 'intl';
$entry[$i]['adr_two_type'] = 'intl';
/* echo '<br>'; */
$contacts->add($GLOBALS['egw_info']['user']['account_id'],$entry[$i],$access,$cat_id);
}
$num = $i - 1;
return lang('Successfully imported %1 records into your addressbook.',$num);
}
}
?>

View File

@ -1,182 +0,0 @@
<?php
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// import file and the value of the array item will be used in
// the creation of the output file.
//
// An exported Outlook file looks like this:
//
// Title<tab>First Name<tab>Middle Name<tab>Last Name<tab>...
// <tab>Patrick<tab><tab>Walsh<tab>...
//
// Where the first line explains each optional field. This is what
// will be looked up in the key.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array('LastName' => 'FullName','FirstName' => '+, ');
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
/* $Id$ */
class import_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
var $type = 'csv';
/* Thanks to knecke for the Outlook fields */
var $import = array(
'Anrede' => 'n_prefix',
'Vorname' => 'n_given',
'Weitere Vornamen' => 'n_middle',
'Nachname' => 'n_family',
'Suffix' => 'n_suffix',
'Firma' => 'org_name',
'Abteilung' => 'org_unit',
'Position' => 'title',
'Straße geschäftlich' => 'adr_one_street',
'Straße geschäftlich 2' => 'address2',
'Straße geschäftlich 3' => 'address3',
'Ort geschäftlich' => 'adr_one_locality',
'Region geschäftlich' => 'adr_one_region',
'Postleitzahl geschäftlich' => 'adr_one_postalcode',
'Land geschäftlich' => 'adr_one_countryname',
'Straße privat' => 'adr_two_street',
'Straße privat 2' => '',
'Straße privat 3' => '',
'Ort privat' => 'adr_two_locality',
'Region privat' => 'adr_two_region',
'Postleitzahl privat' => 'adr_two_postalcode',
'Land privat' => 'adr_two_countryname',
'Weitere Straße' => '',
'Weitere Straße 2' => '',
'Weitere Straße 3' => '',
'Weiterer Ort' => '',
'Weitere Region' => '',
'Weitere Postleitzahl' => '',
'Weiteres Land' => '',
'Telefon Assistent' => 'tel_msg',
'Fax geschäftlich' => 'tel_fax',
'Telefon geschäftlich' => 'tel_work',
'Telefon geschäftlich 2' => 'ophone',
'Rückmeldung' => '',
'Autotelefon' => 'tel_car',
'Telefon Firma' => '',
'Fax privat' => '',
'Telefon privat' => 'tel_home',
'Telefon privat 2' => '',
'ISDN' => 'tel_isdn',
'Mobiltelefon' => 'tel_cell',
'Weiteres Fax' => '',
'Weiteres Telefon' => '',
'Pager' => 'tel_pager',
'Haupttelefon' => '',
'Mobiltelefon 2' => '',
'Telefon für Hörbehinderte' => '',
'Telex' => '',
'Abrechnungsinformation' => '',
'Benutzer 1' => '',
'Benutzer 2' => '',
'Benutzer 3' => '',
'Benutzer 4' => '',
'Beruf' => '',
'Büro' => '',
'E-Mail-Adresse' => 'email',
'E-Mail: Angezeigter Name' => '',
'E-Mail 2: Adresse' => 'email_home',
'E-Mail 2: Angezeigter Name' => '',
'E-Mail 3: Adresse' => '',
'E-Mail 3: Angezeigter Name' => '',
'Empfohlen von' => '',
'Geburtstag' => 'bday',
'Geschlecht' => '',
'Hobby' => '',
'Initialen' => '',
'Internet-Frei/Gebucht' => '',
'Jahrestag' => '',
'Kategorien' => '',
'Kinder' => '',
'Konto' => '',
'Name Assistent' => '',
'Name des/der Vorgesetzten' => '',
'Notizen' => 'note',
'Organisations-Nr.' => '',
'Ort' => '',
'Partner' => '',
'Postfach' => '',
'Priorität' => '',
'Privat' => '',
'Regierungs-Nr.' => '',
'Reisekilometer' => '',
'Sprache' => '',
'Stichwörter' => '',
'Vertraulichkeit' => '',
'Verzeichnisserver' => '',
'Webseite' => 'url'
);
function import_start_file($buffer)
{
return $buffer;
}
function import_start_record($buffer)
{
$top = array();
++$this->id;
$this->currentrecord = $top;
return $buffer;
}
function import_new_attrib($buffer,$name,$value)
{
$value = trim($value);
$value = str_replace('\n','<BR>',$value);
$value = str_replace('\r','',$value);
$this->currentrecord += array($name => $value);
return $buffer;
}
function import_end_record($buffer)
{
$buffer[$this->id] = '';
while(list($name, $value) = each($this->currentrecord))
{
$buffer[$this->id][$name] = $value;
//echo '<br>'.$name.' => '.$value;
}
return $buffer;
}
function import_end_file($buffer,$access='private',$cat_id=0)
{
$contacts = CreateObject('phpgwapi.contacts');
//echo '<br>';
for($i=1;$i<=count($buffer);$i++)
{
while(list($name,$value) = @each($buffer[$i]))
{
//echo '<br>'.$i.': '.$name.' => '.$value;
$entry[$i][$name] = $value;
}
$entry[$i]['email_type'] = 'INTERNET';
$entry[$i]['email_home_type'] = 'INTERNET';
$entry[$i]['adr_one_type'] = 'intl';
$entry[$i]['adr_two_type'] = 'intl';
$entry[$i]['fn'] = $entry[$i]['n_given'] . ' ' . $entry[$i]['n_family'];
//echo '<br>';
$contacts->add($GLOBALS['egw_info']['user']['account_id'],$entry[$i],$access,$cat_id);
}
$num = $i - 1;
return lang('Successfully imported %1 records into your addressbook.',$num);
}
}
?>

View File

@ -1,178 +0,0 @@
<?php
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// import file and the value of the array item will be used in
// the creation of the output file.
//
// An exported Outlook file looks like this:
//
// Title<tab>First Name<tab>Middle Name<tab>Last Name<tab>...
// <tab>Patrick<tab><tab>Walsh<tab>...
//
// Where the first line explains each optional field. This is what
// will be looked up in the key.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array('LastName' => 'FullName','FirstName' => '+, ');
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
/* $Id$ */
class import_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
var $type = 'csv';
var $import = array(
'Title' => 'n_prefix',
'First Name' => 'n_given',
'Middle Name' => 'n_middle',
'Last Name' => 'n_family',
'Suffix' => 'n_suffix',
'Company' => 'org_name', //objectclass: organization
'Department' => 'org_unit', //objectclass: organizationalPerson
'Job Title' => 'title', //objectclass: organizationalPerson
'Business Street' => 'adr_one_street',
'Business Street 2' => 'address2',
'Business Street 3' => 'address3',
'Business City' => 'adr_one_locality',
'Business State' => 'adr_one_region',
'Business Postal Code' => 'adr_one_postalcode',
'Business Country' => 'adr_one_countryname',
'Home Street' => 'adr_two_street',
'Home City' => 'adr_two_locality',
'Home State' => 'adr_two_region',
'Home Postal Code' => 'adr_two_postalcode',
'Home Country' => 'adr_two_countryname',
'Home Street 2' => '',
'Home Street 3' => '',
'Other Street' => '',
'Other City' => '',
'Other State' => '',
'Other Postal Code' => '',
'Other Country' => '',
"Assistant's Phone" => 'tel_msg',
'Business Fax' => 'tel_fax',
'Business Phone' => 'tel_work',
'Business Phone 2' => 'ophone',
'Callback' => '',
'Car Phone' => 'tel_car',
'Company Main Phone' => '',
'Home Fax' => '',
'Home Phone' => 'tel_home',
'Home Phone 2' => '', //This will make another homePhone entry
'ISDN' => 'tel_isdn',
'Mobile Phone' => 'tel_cell', //newPilotPerson
'Other Fax' => '',
'Other Phone' => '',
'Pager' => 'tel_pager',
'Primary Phone' => '',
'Radio Phone' => '',
'TTY/TDD Phone' => '',
'Telex' => '', //organization
'Account' => '',
'Anniversary' => '',
"Assistant's Name" => '', //newPilotPerson
'Billing Information' => '',
'Birthday' => 'bday',
'Categories' => '',
'Children' => '',
'Directory Server' => '',
'E-mail Address' => 'email',
'E-mail Display Name' => '',
'E-mail 2 Address' => 'email_home',
'E-mail 2 Display Name' => '',
'E-mail 3 Address' => '', //add another...
'E-mail 3 Display Name' => '',
'Gender' => '',
'Government ID Number' => '',
'Hobby' => '',
'Initials' => '',
'Internet Free Busy' => '',
'Keywords' => '',
'Language' => '',
'Location' => '',
"Manager's Name" => '',
'Mileage' => '',
'Notes' => 'note',
'Office Location' => '',
'Organizational ID Number' => '',
'PO Box' => '',
'Priority' => '',
'Private Profession' => '',
'Referred By' => '',
'Sensitivity' => '',
'Spouse' => '',
'User 1' => '',
'User 2' => '',
'User 3' => '',
'User 4' => '',
'Web Page' => 'url'
);
function import_start_file($buffer)
{
return $buffer;
}
function import_start_record($buffer)
{
$top = array();
++$this->id;
$this->currentrecord = $top;
return $buffer;
}
function import_new_attrib($buffer,$name,$value)
{
$value = trim($value);
$value = str_replace('\n','<BR>',$value);
$value = str_replace('\r','',$value);
$this->currentrecord += array($name => $value);
return $buffer;
}
function import_end_record($buffer)
{
$buffer[$this->id] = '';
while(list($name, $value) = each($this->currentrecord))
{
$buffer[$this->id][$name] = $value;
//echo '<br>'.$name.' => '.$value;
}
return $buffer;
}
function import_end_file($buffer,$access='private',$cat_id=0)
{
$contacts = CreateObject('phpgwapi.contacts');
//echo '<br>';
for($i=1;$i<=count($buffer);$i++)
{
while(list($name,$value) = @each($buffer[$i]))
{
//echo '<br>'.$i.': '.$name.' => '.$value;
$entry[$i][$name] = $value;
}
$entry[$i]['email_type'] = 'INTERNET';
$entry[$i]['email_home_type'] = 'INTERNET';
$entry[$i]['adr_one_type'] = 'intl';
$entry[$i]['adr_two_type'] = 'intl';
$entry[$i]['fn'] = $entry[$i]['n_given'] . ' ' . $entry[$i]['n_family'];
//echo '<br>';
$contacts->add($GLOBALS['egw_info']['user']['account_id'],$entry[$i],$access,$cat_id);
}
$num = $i - 1;
return lang('Successfully imported %1 records into your addressbook.',$num);
}
}
?>

View File

@ -1,180 +0,0 @@
<?php
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// import file and the value of the array item will be used in
// the creation of the output file.
//
// An exported Outlook file looks like this:
//
// Title<tab>First Name<tab>Middle Name<tab>Last Name<tab>...
// <tab>Patrick<tab><tab>Walsh<tab>...
//
// Where the first line explains each optional field. This is what
// will be looked up in the key.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array('LastName' => 'FullName','FirstName' => '+, ');
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
/* $Id$ */
/* File submitted by Alejandro Pedraza - alpeb@sourceforge.net */
class import_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
var $type = 'csv';
var $import = array(
'Tratamiento' => 'n_prefix',
'Nombre' => 'n_given',
'Segundo Nombre' => 'n_middle',
'Apellidos' => 'n_family',
'Sufijo' => 'n_suffix',
'Organización' => 'org_name', //objectclass: organization
'Departmento' => 'org_unit', //objectclass: organizationalPerson
'Puesto' => 'title', //objectclass: organizationalPerson
'Calle del trabajo' => 'adr_one_street',
'Calle del trabajo 2' => 'address2',
'Calle del trabajo 3' => 'address3',
'Ciudad de trabajo' => 'adr_one_locality',
'Provincia o estado de trabajo' => 'adr_one_region',
'Código postal del trabajo' => 'adr_one_postalcode',
'País de trabajo' => 'adr_one_countryname',
'Calle del domicilio' => 'adr_two_street',
'Ciudad de residencia' => 'adr_two_locality',
'Provincia o estado de residencia' => 'adr_two_region',
'Código postal de residencia' => 'adr_two_postalcode',
'País de residencia' => 'adr_two_countryname',
'Calle del domicilio 2' => '',
'Calle del domicilio 3' => '',
'Otra calle' => '',
'Otra ciudad' => '',
'Otra provincia o estado' => '',
'Otro código postal' => '',
'Otro país' => '',
"Teléfono del ayudante" => 'tel_msg',
'Fax del trabajo' => 'tel_fax',
'Teléfono del trabajo' => 'tel_work',
'Teléfono del trabajo 2' => 'ophone',
'Devolución de llamada' => '',
'Teléfono del automóvil' => 'tel_car',
'Número de centralita de la organización' => '',
'Fax particular' => '',
'Particular' => 'tel_home',
'Número de teléfono particular 2' => '', //This will make another homePhone entry
'RDSI' => 'tel_isdn',
'Móvil' => 'tel_cell', //newPilotPerson
'Otro fax' => '',
'Otro teléfono' => '',
'Localizador' => 'tel_pager',
'Teléfono principal' => '',
'Radioteléfono' => '',
'Número de teletipo' => '',
'Télex' => '', //organization
'Cuenta' => '',
'Aniversario' => '',
"Nombre del ayudante" => '', //newPilotPerson
'Facturación' => '',
'Cumpleaños' => 'bday',
'Categorías' => '',
'Hijos' => '',
'Servidor de directorio' => '',
'Dirección de correo electrónico' => 'email',
'Nombre de pantalla de correo electrónico' => '',
'Dirección de correo electrónico 2' => 'email_home',
'Nombre de pantalla de correo electrónico 2' => '',
'Dirección del correo electrónico 3' => '', //add another...
'Nombre de pantalla de correo electrónico 3' => '',
'Género' => '',
'Número de id. oficial' => '',
'Aficiones' => '',
'Iniciales' => '',
'Internet Free Busy' => '',
'Palabras clave' => '',
'Idioma' => '',
'Ubicación' => '',
"Nombre del director" => '',
'Kilometraje' => '',
'Notas' => 'note',
'Ubicación de la oficina' => '',
'Número de id. de la organización' => '',
'Apartado postal' => '',
'Importancia' => '',
'Privado'=>'',
'Profesión' => '',
'Remitido por' => '',
'Confidencialidad' => '',
'Cónyuge' => '',
'Usuario 1' => '',
'Usuario 2' => '',
'Usuario 3' => '',
'Usuario 4' => '',
'Página Web' => 'url'
);
function import_start_file($buffer)
{
return $buffer;
}
function import_start_record($buffer)
{
$top=array();
++$this->id;
$this->currentrecord = $top;
return $buffer;
}
function import_new_attrib($buffer,$name,$value)
{
$value = trim($value);
$value = str_replace('\n','<BR>',$value);
$value = str_replace('\r','',$value);
$this->currentrecord += array($name => $value);
return $buffer;
}
function import_end_record($buffer)
{
$buffer[$this->id]='';
while ( list($name, $value) = each($this->currentrecord))
{
$buffer[$this->id][$name] = $value;
//echo '<br>'.$name.' => '.$value;
}
return $buffer;
}
function import_end_file($buffer,$access='private',$cat_id=0)
{
$contacts = CreateObject('phpgwapi.contacts');
//echo '<br>';
for ($i=1;$i<=count($buffer);$i++)
{
while ( list($name,$value) = @each($buffer[$i]) )
{
//echo '<br>'.$i.': '.$name.' => '.$value;
$entry[$i][$name] = $value;
}
$entry[$i]['email_type'] = 'INTERNET';
$entry[$i]['email_home_type'] = 'INTERNET';
$entry[$i]['adr_one_type'] = 'intl';
$entry[$i]['adr_two_type'] = 'intl';
$entry[$i]['fn'] = $entry[$i]['n_given'] . ' ' . $entry[$i]['n_family'];
//echo '<br>';
$contacts->add($GLOBALS['egw_info']['user']['account_id'],$entry[$i],$access,$cat_id);
}
$num = $i - 1;
return lang('Successfully imported %1 records into your addressbook.',$num);
}
}
?>

View File

@ -1,127 +0,0 @@
<?php
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// import file and the value of the array item will be used in
// the creation of the output file.
//
// An exported Outlook file looks like this:
//
// Title<tab>First Name<tab>Middle Name<tab>Last Name<tab>...
// <tab>Patrick<tab><tab>Walsh<tab>...
//
// Where the first line explains each optional field. This is what
// will be looked up in the key.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array('LastName' => 'FullName','FirstName' => '+, ');
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
/* $Id$ */
class import_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
var $type = 'csv';
var $import = array(
'Tehtävänimike' => 'title',
'Etunimi' => 'n_given',
'Toinen nimi' => 'n_middle',
'Sukunimi' => 'n_family',
'Jälkiliite' => 'n_suffix',
'Yritys' => 'org_name',
'Osasto' => 'org_unit',
'Lähiosoite (työ)' => 'adr_one_street',
'Lähiosoite (työ) 2' => 'address2',
'Lähiosoite (työ) 3' => 'address3',
'Postitoimipaikka (työ)' => 'adr_one_locality',
'Sijaintitiedot (työ)' => 'adr_one_region',
'Postinumero (työ)' => 'adr_one_postalcode',
'Maa (työ)' => 'adr_one_country',
'Lähiosoite (koti)' => 'adr_two_street',
'Postitoimipaikka (koti)' => 'adr_two_locality',
'Sijaintitiedot (koti)' => 'adr_two_region',
'Postinumero (koti)' => 'adr_two_postalcode',
'Maa (koti)' => 'adr_two_country',
'Työfaksi' => 'tel_fax',
'Työpuhelin' => 'tel_work',
'Avustajan puhelinnumero' => 'tel_msg',
'Autopuhelin' => 'tel_car',
'ISDN' => 'tel_isdn',
'Kotipuhelin' => 'tel_home',
'Matkapuhelin' => 'tel_cell',
'Hakulaite' => 'tel_pager',
'Työpuhelin 2' => 'ophone',
'Syntymäpäivä' => 'bday',
'Sähköpostiosoite' => 'email',
'Säköpostiosoite 2' => 'email_home',// Note! Typo error in Finnish Outlook 2003 export addressbook to csv-file!
'Web-sivu' => 'url',
'Muistilaput' => 'note'
);
function import_start_file($buffer)
{
return $buffer;
}
function import_start_record($buffer)
{
$top = array();
++$this->id;
$this->currentrecord = $top;
return $buffer;
}
function import_new_attrib($buffer,$name,$value)
{
$value = trim($value);
$value = str_replace('\n','<BR>',$value);
$value = str_replace('\r','',$value);
$this->currentrecord += array($name => $value);
return $buffer;
}
function import_end_record($buffer)
{
$buffer[$this->id] = '';
while(list($name, $value) = each($this->currentrecord))
{
$buffer[$this->id][$name] = $value;
//echo '<br>'.$name.' => '.$value;
}
return $buffer;
}
function import_end_file($buffer,$access='private',$cat_id=0)
{
$contacts = CreateObject('phpgwapi.contacts');
//echo '<br>';
for($i=1;$i<=count($buffer);$i++)
{
while(list($name,$value) = @each($buffer[$i]))
{
//echo '<br>'.$i.': '.$name.' => '.$value;
$entry[$i][$name] = $value;
}
$entry[$i]['email_type'] = 'INTERNET';
$entry[$i]['email_home_type'] = 'INTERNET';
$entry[$i]['adr_one_type'] = 'intl';
$entry[$i]['adr_two_type'] = 'intl';
$entry[$i]['fn'] = $entry[$i]['n_given'] . ' ' . $entry[$i]['n_family'];
//echo '<br>';
$contacts->add($GLOBALS['egw_info']['user']['account_id'],$entry[$i],$access,$cat_id);
}
$num = $i - 1;
return lang('Successfully imported %1 records into your addressbook.',$num);
}
}
?>

View File

@ -1,176 +0,0 @@
<?php
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// import file and the value of the array item will be used in
// the creation of the output file.
//
// An exported Outlook file looks like this:
//
// Title<tab>First Name<tab>Middle Name<tab>Last Name<tab>...
// <tab>Patrick<tab><tab>Walsh<tab>...
//
// Where the first line explains each optional field. This is what
// will be looked up in the key.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array('LastName' => 'FullName','FirstName' => '+, ');
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
/* $Id$ */
class import_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
var $type = 'csv';
/* Thanks to ledruide for the Outlook fields */
var $import = array(
'Fonction' => 'title',
'Prénom' => 'n_given',
'Deuxième prénom' => 'n_middle',
'Nom' => 'n_family',
'Suffixe' => 'n_suffix',
'Société' => 'org_name',
'Service' => 'org_unit',
'Rue (bureau)' => 'adr_one_street',
'Rue (bureau) 2' => 'address2',
'Rue (bureau) 3' => 'address3',
'Ville (bureau)' => 'adr_one_locality',
'État/Prov (bureau)' => 'adr_one_region',
'Code postal (bureau)' => 'adr_one_postalcode',
'Pays (bureau)' => 'adr_one_countryname',
'Rue (domicile)' => 'adr_two_street',
'Rue (domicile) 3' => '',
'Rue (domicile) 3' => '',
'Ville (domicile)' => 'adr_two_locality',
'État/Prov (domicile)' => 'adr_two_region',
'Code postal (domicile)' => 'adr_two_postalcode',
'Pays (domicile)' => 'adr_two_countryname',
'Rue (autre)' => '',
'Rue (autre) 2' => '',
'Rue (autre) 3' => '',
'Ville (autre)' => '',
'État/Prov (autre)' => '',
'Code postal (autre)' => '',
'Pays (autre)' => '',
"Téléphone de l'assistant(e)" => 'tel_msg',
'Télécopie (bureau)' => 'tel_fax',
'Téléphone (bureau)' => 'tel_work',
'Téléphone 2 (bureau)' => 'ophone',
'Rappel' => '',
'Téléphone (voiture)' => 'tel_car',
'Téléphone société' => '',
'Télécopie (domicile)' => '',
'Téléphone (domicile)' => 'tel_home',
'Téléphone 2 (domicile)' => '',
'RNIS' => 'tel_isdn',
'Tél. mobile' => 'tel_cell',
'Télécopie (autre)' => '',
'Téléphone (autre)' => '',
'Récepteur de radiomessagerie' => 'tel_pager',
'Téléphone principal' => '',
'Radio téléphone' => '',
'Téléphone TDD/TTY' => '',
'Télex' => '',
'Compte' => '',
'Anniversaire de mariage ou fête' => '',
"Nom de l'assistant(e)" => '',
'Informations facturation' => '',
'Anniversaire' => 'bday',
'Catégories' => '',
'Enfants' => '',
'Adresse e-mail' => 'email',
"Nom complet de l'adresse e-mail" => '',
'Adresse e-mail 2' => 'email_home',
"Nom complet de l'adresse e-mail 2" => '',
'Adresse e-mail 3' => '',
"Nom complet de l'adresse e-mail 3" => '',
'Sexe' => '',
'Code gouvernement' => '',
'Passe-temps' => '',
'Initiales' => '',
'Mots clés' => '',
'Langue' => '',
'Lieu' => '',
'Kilométrage' => '',
'Notes' => 'note',
'Bureau' => '',
"Numéro d'identification de l'organisation" => '',
'B.P.' => '',
'Privé' => '',
'Profession' => '',
'Recommandé par' => '',
'Conjoint(e)' => '',
'Utilisateur 1' => '',
'Utilisateur 2' => '',
'Utilisateur 3' => '',
'Utilisateur 4' => '',
'Page Web' => 'url'
);
function import_start_file($buffer)
{
return $buffer;
}
function import_start_record($buffer)
{
$top = array();
++$this->id;
$this->currentrecord = $top;
return $buffer;
}
function import_new_attrib($buffer,$name,$value)
{
$value = trim($value);
$value = str_replace('\n','<BR>',$value);
$value = str_replace('\r','',$value);
$this->currentrecord += array($name => $value);
return $buffer;
}
function import_end_record($buffer)
{
$buffer[$this->id] = '';
while(list($name, $value) = each($this->currentrecord))
{
$buffer[$this->id][$name] = $value;
//echo '<br>'.$name.' => '.$value;
}
return $buffer;
}
function import_end_file($buffer,$access='private',$cat_id=0)
{
$contacts = CreateObject('phpgwapi.contacts');
//echo '<br>';
for($i=1;$i<=count($buffer);$i++)
{
while(list($name,$value) = @each($buffer[$i]))
{
//echo '<br>'.$i.': '.$name.' => '.$value;
$entry[$i][$name] = $value;
}
$entry[$i]['email_type'] = 'INTERNET';
$entry[$i]['email_home_type'] = 'INTERNET';
$entry[$i]['adr_one_type'] = 'intl';
$entry[$i]['adr_two_type'] = 'intl';
$entry[$i]['fn'] = $entry[$i]['n_given'] . ' ' . $entry[$i]['n_family'];
//echo '<br>';
$contacts->add($GLOBALS['egw_info']['user']['account_id'],$entry[$i],$access,$cat_id);
}
$num = $i - 1;
return lang('Successfully imported %1 records into your addressbook.',$num);
}
}
?>

View File

@ -1,178 +0,0 @@
<?php
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// import file and the value of the array item will be used in
// the creation of the output file.
//
// An exported Outlook file looks like this:
//
// Title<tab>First Name<tab>Middle Name<tab>Last Name<tab>...
// <tab>Patrick<tab><tab>Walsh<tab>...
//
// Where the first line explains each optional field. This is what
// will be looked up in the key.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array('LastName' => 'FullName','FirstName' => '+, ');
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
/* $Id$ */
class import_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
var $type = 'csv';
var $import = array(
'Cím' => 'n_prefix',
'Utónév' => 'n_given',
'Középsõ' => 'n_middle',
'Vezetéknév' => 'n_family',
'Utótag' => 'n_suffix',
'Cég' => 'org_name', //objectclass: organization
'Osztály' => 'org_unit', //objectclass: organizationalPerson
'Beosztás' => 'title', //objectclass: organizationalPerson
'Mukahely címe' => 'adr_one_street',
'2. vállalati utcacím' => 'address2',
'3. vállalati utcacím' => 'address3',
'Város (hivatal)' => 'adr_one_locality',
'Megye (hivatal)' => 'adr_one_region',
'Munkahely irányítószám' => 'adr_one_postalcode',
'Ország (hivatal)' => 'adr_one_countryname',
'Lakcím' => 'adr_two_street',
'Város (lakás)' => 'adr_two_locality',
'Megye (lakás)' => 'adr_two_region',
'Irányítószám (lakás)' => 'adr_two_postalcode',
'Ország (lakás)' => 'adr_two_countryname',
'2. otthoni utcacím' => '',
'3. otthoni utcacím' => '',
'Más utcacím' => '',
'Más város' => '',
'Más állam' => '',
'Más irányítószám' => '',
'Más ország' => '',
"Titkár telefonszáma" => 'tel_msg',
'Hivatali fax' => 'tel_fax',
'Hivatali telefon' => 'tel_work',
'Másik hivatali telefon' => 'ophone',
'Visszahívás' => '',
'Autótelefon' => 'tel_car',
'Cég fõvonala' => '',
'Otthoni fax' => '',
'Otthoni telefon' => 'tel_home',
'Másik otthoni telefon' => '', //This will make another homePhone entry
'ISDN' => 'tel_isdn',
'Mobiltelefon' => 'tel_cell', //newPilotPerson
'Egyéb fax' => '',
'Egyéb telefon' => '',
'Személyhívó' => 'tel_pager',
'Elsõdleges telefon' => '',
'Rádiótelefon' => '',
'TTY/TDD telefon' => '',
'Telex' => '', //organization
'Címkiszolgáló' => '',
'Évforduló' => '',
"Titkár neve" => '', //newPilotPerson
'Számlaadatok' => '',
'Születésnap' => 'bday',
'Kategóriák' => '',
'Gyerekek' => '',
'Címkiszolgáló' => '',
'Elektronikus levélcím' => 'email',
'Elektronikus levélhez megjelenítendõ név' => '',
'2. elektronikus levélcím' => 'email_home',
'2. elektronikus levélhez megjelenítendõ név' => '',
'3. elektronikus levélcím' => '', //add another...
'3. elektronikus levélhez megjelenítendõ név' => '',
'Nem' => '',
'Kormányzati azonosító' => '',
'Hobbi' => '',
'Monogram' => '',
'Elfoglaltság közzététele az Interneten' => '',
'Kulcsszavak' => '',
'Nyelv' => '',
'Hely' => '',
"Felettes neve" => '',
'Távolság' => '',
'Feljegyzések' => 'note',
'Iroda helye' => '',
'Szervezeti azonosító' => '',
'Egyéb cím, postafiók' => '',
'Prioritás' => '',
'Magánjellegû' => '',
'Referencia' => '',
'Sensitivity' => '',
'Házastárs' => '',
'Felhasználói 1' => '',
'Felhasználói 2' => '',
'Felhasználói 3' => '',
'Felhasználói 4' => '',
'Weblap' => 'url'
);
function import_start_file($buffer)
{
return $buffer;
}
function import_start_record($buffer)
{
$top = array();
++$this->id;
$this->currentrecord = $top;
return $buffer;
}
function import_new_attrib($buffer,$name,$value)
{
$value = trim($value);
$value = str_replace('\n','<BR>',$value);
$value = str_replace('\r','',$value);
$this->currentrecord += array($name => $value);
return $buffer;
}
function import_end_record($buffer)
{
$buffer[$this->id] = '';
while(list($name, $value) = each($this->currentrecord))
{
$buffer[$this->id][$name] = $value;
//echo '<br>'.$name.' => '.$value;
}
return $buffer;
}
function import_end_file($buffer,$access='private',$cat_id=0)
{
$contacts = CreateObject('phpgwapi.contacts');
//echo '<br>';
for($i=1;$i<=count($buffer);$i++)
{
while(list($name,$value) = @each($buffer[$i]))
{
//echo '<br>'.$i.': '.$name.' => '.$value;
$entry[$i][$name] = $value;
}
$entry[$i]['email_type'] = 'INTERNET';
$entry[$i]['email_home_type'] = 'INTERNET';
$entry[$i]['adr_one_type'] = 'intl';
$entry[$i]['adr_two_type'] = 'intl';
$entry[$i]['fn'] = $entry[$i]['n_family'] . ' ' . $entry[$i]['n_given'];
//echo '<br>';
$contacts->add($GLOBALS['egw_info']['user']['account_id'],$entry[$i],$access,$cat_id);
}
$num = $i - 1;
return lang('Successfully imported %1 records into your addressbook.',$num);
}
}
?>

View File

@ -1,187 +0,0 @@
<?php
// This file defines a set of functions and an associative array.
// The key of the array corresponds to a header in the source
// import file and the value of the array item will be used in
// the creation of the output file.
//
// An exported Outlook file looks like this:
//
// Title<tab>First Name<tab>Middle Name<tab>Last Name<tab>...
// <tab>Patrick<tab><tab>Walsh<tab>...
//
// Where the first line explains each optional field. This is what
// will be looked up in the key.
//
// The array need not be in any order and any fields not defined will
// not be transferred. If the val='+', the value will be appended to
// the previous field and any text after the '+' will be appended
// before the value. For example, the following would add a comma and
// a space between LastName and FirstName and store it in FullName:
//
// array('LastName' => 'FullName','FirstName' => '+, ');
//
// Also start with a '#' symbol and a comma separated list will be
// turned into a number of the same entries.
/* $Id$ */
class import_conv
{
var $currentrecord = array(); //used for buffering to allow uid lines to go first
var $id;
var $type = 'csv';
var $import = array(
'Titolo' => 'n_prefix',
'Nome' => 'n_given',
'Secondo nome' => 'n_middle',
'Cognome' => 'n_family',
'Titolo straniero' => 'n_suffix',
'Società' => 'org_name', //objectclass: organization
'Reparto' => 'org_unit', //objectclass: organizationalPerson
'Posizione' => 'title', //objectclass: organizationalPerson
'Via (uff.)' => 'adr_one_street',
'Via (uff.) 2' => 'address2',
'Via (uff.) 3' => 'address3',
'Città (uff.)' => 'adr_one_locality',
'Provincia (uff.)' => 'adr_one_region',
'CAP (uff.)' => 'adr_one_postalcode',
'Paese (uff.)' => 'adr_one_countryname',
'Via (ab.)' => 'adr_two_street',
'Città (ab.)' => 'adr_two_locality',
'Provincia (ab.)' => 'adr_two_region',
'CAP (ab.)' => 'adr_two_postalcode',
'Paese (ab.)' => 'adr_two_countryname',
'Via (ab.) 2' => '',
'Via (ab.) 3' => '',
'Altra via' => '',
'Altra via 2' => '',
'Altra via 3' => '',
'Altra città' => '',
'Altra provincia' => '',
'Altro CAP' => '',
'Altro paese' => '',
"Telefono assistente" => 'tel_msg',
'Fax (uff.)' => 'tel_fax',
'Ufficio' => 'tel_work',
'Ufficio 2' => 'ophone',
'Richiamata automatica' => '',
'Telefono auto' => 'tel_car',
'Telefono principale società' => '',
'Fax (ab.)' => '',
'Abitazione' => 'tel_home',
'Abitazione 2' => '', //This will make another homePhone entry
'ISDN' => 'tel_isdn',
'Cellulare' => 'tel_cell', //newPilotPerson
'Altro fax' => '',
'Altro telefono' => '',
'Cercapersone' => 'tel_pager',
'Telefono principale' => '',
'Radiotelefono' => '',
'Telefono TTY/TDD' => '',
'Telex' => '', //organization
'Account' => '',
'Anniversario' => '',
'Nome assistente' => '', //newPilotPerson
'Dati fatturazione' => '',
'Compleanno' => 'bday',
'Categorie' => '',
'Figli' => '',
'Server di elenchi in linea' => '',
'Indirizzo posta elettronica' => 'email',
'Nome visualizzato posta elettronica' => '',
'Indirizzo posta elettronica 2' => 'email_home',
'Nome visualizzato posta elettronica 2' => '',
'Indirizzo posta elettronica 3' => '', //add another...
'Nome visualizzato posta elettronica 3' => '',
'Sesso' => '',
'Cod. Fisc./P. IVA' => '',
'Hobby' => '',
'Iniziali' => '',
'Disponibilità Internet' => '',
'Parole chiave' => '',
'Lingua' => '',
'Luogo' => '',
'Tipo posta elettronica' => '',
'Tipo posta elettronica 2' => '',
'Tipo posta elettronica 3' => '',
'Privato' => '',
'Sesso' => '',
'Ubicazione ufficio' => '',
'Indirizzo (ab.) - Casella postale' => '',
'Nome manager' => '',
'Indennità trasferta' => '',
'Notes' => 'note',
'Indirizzo (uff.) - Casella postale' => '',
'Numero ID organizzativo' => '',
'Altro indirizzo - Casella postale' => '',
'Priorità' => '',
'Professione' => '',
'Presentato da' => '',
'Riservatezza' => '',
'Nome coniuge' => '',
'Utente 1' => '',
'Utente 2' => '',
'Utente 3' => '',
'Utente 4' => '',
'Pagina Web' => 'url'
);
function import_start_file($buffer)
{
return $buffer;
}
function import_start_record($buffer)
{
$top = array();
++$this->id;
$this->currentrecord = $top;
return $buffer;
}
function import_new_attrib($buffer,$name,$value)
{
$value = trim($value);
$value = str_replace('\n','<BR>',$value);
$value = str_replace('\r','',$value);
$this->currentrecord += array($name => $value);
return $buffer;
}
function import_end_record($buffer)
{
$buffer[$this->id] = '';
while(list($name, $value) = each($this->currentrecord))
{
$buffer[$this->id][$name] = $value;
//echo '<br>'.$name.' => '.$value;
}
return $buffer;
}
function import_end_file($buffer,$access='private',$cat_id=0)
{
$contacts = CreateObject('phpgwapi.contacts');
//echo '<br>';
for($i=1;$i<=count($buffer);$i++)
{
while(list($name,$value) = @each($buffer[$i]))
{
//echo '<br>'.$i.': '.$name.' => '.$value;
$entry[$i][$name] = $value;
}
$entry[$i]['email_type'] = 'INTERNET';
$entry[$i]['email_home_type'] = 'INTERNET';
$entry[$i]['adr_one_type'] = 'intl';
$entry[$i]['adr_two_type'] = 'intl';
$entry[$i]['fn'] = $entry[$i]['n_given'] . ' ' . $entry[$i]['n_family'];
//echo '<br>';
$contacts->add($GLOBALS['egw_info']['user']['account_id'],$entry[$i],$access,$cat_id);
}
$num = $i - 1;
return lang('Successfully imported %1 records into your addressbook.',$num);
}
}
?>