diff --git a/addressbook/inc/import/Import_from_Outlook_-_Italiano b/addressbook/inc/import/Import_from_Outlook_-_Italiano new file mode 100644 index 0000000000..70e8e59086 --- /dev/null +++ b/addressbook/inc/import/Import_from_Outlook_-_Italiano @@ -0,0 +1,187 @@ +First NameMiddle NameLast Name... +// PatrickWalsh... +// +// 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' => 'title', + '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','
',$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 '
'.$name.' => '.$value; + } + return $buffer; + } + + function import_end_file($buffer,$access='private',$cat_id=0) + { + $contacts = CreateObject('phpgwapi.contacts'); + //echo '
'; + for ($i=1;$i<=count($buffer);$i++) + { + while ( list($name,$value) = @each($buffer[$i]) ) + { + //echo '
'.$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 '
'; + $contacts->add($GLOBALS['phpgw_info']['user']['account_id'],$entry[$i],$access,$cat_id); + } + $num = $i - 1; + return lang('Successfully imported %1 records into your addressbook.',$num); + } + } +?>