From c15d58abe6f96c01bc2db8efeffb140949c3e0ea Mon Sep 17 00:00:00 2001 From: PhilW Date: Wed, 1 May 2024 08:05:39 +0100 Subject: [PATCH 01/12] contact import: correct mismapped fields --- program/lib/Roundcube/rcube_csv2vcard.php | 34 +++++++++++------------ tests/src/Csv2vcard/email.vcf | 8 +++--- tests/src/Csv2vcard/gmail.vcf | 2 +- tests/src/Csv2vcard/outlook.vcf | 2 +- tests/src/Csv2vcard/tb_plain.vcf | 4 +-- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/program/lib/Roundcube/rcube_csv2vcard.php b/program/lib/Roundcube/rcube_csv2vcard.php index b8b79ca4d8c..91a3c5cc11d 100644 --- a/program/lib/Roundcube/rcube_csv2vcard.php +++ b/program/lib/Roundcube/rcube_csv2vcard.php @@ -35,7 +35,7 @@ class rcube_csv2vcard 'birthday' => 'birthday', 'business_city' => 'locality:work', 'business_countryregion' => 'country:work', - 'business_fax' => 'phone:work,fax', + 'business_fax' => 'phone:workfax', 'business_phone' => 'phone:work', 'business_phone_2' => 'phone:work2', 'business_postal_code' => 'zipcode:work', @@ -53,13 +53,13 @@ class rcube_csv2vcard // 'email_2_type' => '', 'email_3_address' => 'email:other', // 'email_3_type' => '', - 'email_address' => 'email:pref', + 'email_address' => 'email:other', // 'email_type' => '', 'first_name' => 'firstname', 'gender' => 'gender', 'home_city' => 'locality:home', 'home_countryregion' => 'country:home', - 'home_fax' => 'phone:home,fax', + 'home_fax' => 'phone:homefax', 'home_phone' => 'phone:home', 'home_phone_2' => 'phone:home2', 'home_postal_code' => 'zipcode:home', @@ -77,12 +77,12 @@ class rcube_csv2vcard 'managers_name' => 'manager', 'middle_name' => 'middlename', // 'mileage' => '', - 'mobile_phone' => 'phone:cell', + 'mobile_phone' => 'phone:mobile', 'notes' => 'notes', // 'office_location' => '', 'other_city' => 'locality:other', 'other_countryregion' => 'country:other', - 'other_fax' => 'phone:other,fax', + 'other_fax' => 'phone:other', 'other_phone' => 'phone:other', 'other_postal_code' => 'zipcode:other', 'other_state' => 'region:other', @@ -90,29 +90,29 @@ class rcube_csv2vcard // 'other_street_2' => '', // 'other_street_3' => '', 'pager' => 'phone:pager', - 'primary_phone' => 'phone:pref', + 'primary_phone' => 'phone:main', // 'profession' => '', // 'radio_phone' => '', 'spouse' => 'spouse', 'suffix' => 'suffix', - 'title' => 'title', + 'title' => 'prefix', 'web_page' => 'website:homepage', // Thunderbird 'birth_day' => 'birthday-d', 'birth_month' => 'birthday-m', 'birth_year' => 'birthday-y', - 'display_name' => 'displayname', - 'fax_number' => 'phone:fax', + 'display_name' => 'name', + 'fax_number' => 'phone:homefax', 'home_address' => 'street:home', // 'home_address_2' => '', 'home_country' => 'country:home', 'home_zipcode' => 'zipcode:home', - 'mobile_number' => 'phone:cell', + 'mobile_number' => 'phone:mobile', 'nickname' => 'nickname', 'organization' => 'organization', 'pager_number' => 'phone:pager', - 'primary_email' => 'email:pref', + 'primary_email' => 'email:home', 'secondary_email' => 'email:other', 'web_page_1' => 'website:homepage', 'web_page_2' => 'website:other', @@ -131,15 +131,15 @@ class rcube_csv2vcard // Atmail 'date_of_birth' => 'birthday', // 'email' => 'email:pref', - 'home_mobile' => 'phone:cell', + 'home_mobile' => 'phone:mobile', 'home_zip' => 'zipcode:home', 'info' => 'notes', 'user_photo' => 'photo', 'url' => 'website:homepage', 'work_company' => 'organization', 'work_dept' => 'department', - 'work_fax' => 'phone:work,fax', - 'work_mobile' => 'phone:work,cell', + 'work_fax' => 'phone:workfax', + 'work_mobile' => 'phone:other', 'work_title' => 'jobtitle', 'work_zip' => 'zipcode:work', 'group' => 'groups', @@ -150,7 +150,7 @@ class rcube_csv2vcard 'given_name' => 'firstname', 'additional_name' => 'middlename', 'family_name' => 'surname', - 'name' => 'displayname', + 'name' => 'name', 'name_prefix' => 'prefix', 'name_suffix' => 'suffix', @@ -319,9 +319,9 @@ class rcube_csv2vcard 'Value' => [ 'home' => 'phone:home', 'homefax' => 'phone:homefax', - 'main' => 'phone:pref', + 'main' => 'phone:main', 'pager' => 'phone:pager', - 'mobile' => 'phone:cell', + 'mobile' => 'phone:mobile', 'work' => 'phone:work', 'workfax' => 'phone:workfax', ], diff --git a/tests/src/Csv2vcard/email.vcf b/tests/src/Csv2vcard/email.vcf index 1cf7a36dc44..8e570db9411 100644 --- a/tests/src/Csv2vcard/email.vcf +++ b/tests/src/Csv2vcard/email.vcf @@ -2,23 +2,23 @@ BEGIN:VCARD VERSION:3.0 FN:test1@domain.tld N:;;;; -EMAIL;TYPE=pref:test1@domain.tld +EMAIL;TYPE=home:test1@domain.tld END:VCARD BEGIN:VCARD VERSION:3.0 FN:test2@domain.tld N:;;;; -EMAIL;TYPE=pref:test2@domain.tld +EMAIL;TYPE=home:test2@domain.tld END:VCARD BEGIN:VCARD VERSION:3.0 FN:test3@domain.tld N:;;;; -EMAIL;TYPE=pref:test3@domain.tld +EMAIL;TYPE=home:test3@domain.tld END:VCARD BEGIN:VCARD VERSION:3.0 FN:test4@domain.tld N:;;;; -EMAIL;TYPE=pref:test4@domain.tld +EMAIL;TYPE=home:test4@domain.tld END:VCARD diff --git a/tests/src/Csv2vcard/gmail.vcf b/tests/src/Csv2vcard/gmail.vcf index 96202189a1e..d588231b944 100644 --- a/tests/src/Csv2vcard/gmail.vcf +++ b/tests/src/Csv2vcard/gmail.vcf @@ -11,7 +11,7 @@ EMAIL;TYPE=work:work@email.pl EMAIL:unknown@email.com EMAIL:other@email.com TEL;TYPE=pager:pager -TEL;TYPE=pref:mainphone +TEL;TYPE=main:mainphone TEL;TYPE=home:homephone TEL;TYPE=homefax:homefax TEL;TYPE=cell:mobile diff --git a/tests/src/Csv2vcard/outlook.vcf b/tests/src/Csv2vcard/outlook.vcf index 79d6e74ffc9..17c9e5eca04 100644 --- a/tests/src/Csv2vcard/outlook.vcf +++ b/tests/src/Csv2vcard/outlook.vcf @@ -2,7 +2,7 @@ BEGIN:VCARD VERSION:3.0 FN:test1@domain.tld N:;;;; -EMAIL;TYPE=pref:test1@domain.tld +EMAIL:test1@domain.tld EMAIL:test2@domain.tld EMAIL:test3@domain.tld END:VCARD diff --git a/tests/src/Csv2vcard/tb_plain.vcf b/tests/src/Csv2vcard/tb_plain.vcf index b4d65872a4a..fe22b5a8a1e 100644 --- a/tests/src/Csv2vcard/tb_plain.vcf +++ b/tests/src/Csv2vcard/tb_plain.vcf @@ -3,11 +3,11 @@ VERSION:3.0 FN:Displayname N:Lastname;Firstname;;; NICKNAME:Nick -EMAIL;TYPE=pref:test@domain.tld +EMAIL;TYPE=home:test@domain.tld EMAIL:next@domain.tld TEL;TYPE=work:phone work TEL;TYPE=home:phone home -TEL;TYPE=fax:fax +TEL;TYPE=homefax:fax TEL;TYPE=pager:pager TEL;TYPE=cell:mobile TITLE:title From 08e3470605cc04cfe5aba636373a1f73f450dfed Mon Sep 17 00:00:00 2001 From: PhilW Date: Wed, 1 May 2024 08:20:29 +0100 Subject: [PATCH 02/12] contacts: remove im:other field from UI, it does not exist in the vCard --- program/actions/contacts/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/actions/contacts/index.php b/program/actions/contacts/index.php index d3851194591..cffe2a33cc2 100644 --- a/program/actions/contacts/index.php +++ b/program/actions/contacts/index.php @@ -201,7 +201,7 @@ class rcmail_action_contacts_index extends rcmail_action 'size' => 40, 'maxlength' => 128, 'label' => 'instantmessenger', - 'subtypes' => ['aim', 'icq', 'msn', 'yahoo', 'jabber', 'skype', 'other'], + 'subtypes' => ['aim', 'icq', 'msn', 'yahoo', 'jabber', 'skype'], 'category' => 'main', ], 'notes' => [ From 38f8d3789d95bb3354fc01a7260cb66dcc9057d0 Mon Sep 17 00:00:00 2001 From: PhilW Date: Wed, 1 May 2024 19:03:17 +0100 Subject: [PATCH 03/12] vcard: add some more maps for common vcard types to roundcube types --- program/lib/Roundcube/rcube_vcard.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/program/lib/Roundcube/rcube_vcard.php b/program/lib/Roundcube/rcube_vcard.php index 9552ba58212..0dc32c4acf4 100644 --- a/program/lib/Roundcube/rcube_vcard.php +++ b/program/lib/Roundcube/rcube_vcard.php @@ -51,6 +51,11 @@ class rcube_vcard 'IPHONE' => 'mobile', 'CELL' => 'mobile', 'WORK,FAX' => 'workfax', + 'WORK,CELL' => 'other', + 'HOOME,FAX' => 'homefax', + 'OTHER,FAX' => 'other', + 'FAX' => 'homefax', + 'TITLE' => 'prefix', ]; private $phonetypemap = [ 'HOME1' => 'HOME', @@ -208,6 +213,10 @@ public function get_assoc() $subtype = $typemap[$combined]; } elseif (!empty($typemap[$raw['type'][++$k]])) { $subtype = $typemap[$raw['type'][$k]]; + } elseif ($tag == 'TEL' && $raw['type'][$k] == 'pref') { + $subtype = "main"; + } elseif ($tag == 'EMAIL' && $raw['type'][$k] == 'pref') { + $subtype = "other"; } else { $subtype = $raw['type'][$k]; } From eb6e53c815b439782a1198878bc3796f817e792f Mon Sep 17 00:00:00 2001 From: PhilW Date: Wed, 1 May 2024 19:11:48 +0100 Subject: [PATCH 04/12] contact import: list all possible roundcube contact fields in csv import UI, remove hard coded $local_map --- program/actions/contacts/import.php | 44 ++++- program/lib/Roundcube/rcube_csv2vcard.php | 216 ++++++---------------- program/lib/Roundcube/rcube_vcard.php | 5 +- program/localization/en_US/csv2vcard.inc | 29 +++ program/localization/en_US/labels.inc | 5 + tests/Framework/Csv2vcardTest.php | 18 ++ tests/src/Csv2vcard/all.csv | 2 + tests/src/Csv2vcard/all.vcf | 48 +++++ 8 files changed, 192 insertions(+), 175 deletions(-) create mode 100644 tests/src/Csv2vcard/all.csv create mode 100644 tests/src/Csv2vcard/all.vcf diff --git a/program/actions/contacts/import.php b/program/actions/contacts/import.php index 42de7046598..bc00a779499 100644 --- a/program/actions/contacts/import.php +++ b/program/actions/contacts/import.php @@ -109,7 +109,6 @@ public function run($args = []) // save uploaded file for the real import in the next step $temp_csv = rcube_utils::temp_filename('csvimpt'); if (move_uploaded_file($filepath, $temp_csv) && file_exists($temp_csv)) { - $fields = $csv->get_fields(); $last_map = $map; $map = $csv->import($file_content, true); @@ -145,7 +144,6 @@ public function run($args = []) 'replace' => $replace, 'target' => $target, 'with_groups' => $with_groups, - 'fields' => !empty($fields) ? $fields : [], ]; // Stored separately due to nested array limitations in session @@ -370,16 +368,46 @@ public static function import_map($attrib) $rcmail = rcmail::get_instance(); $params = $_SESSION['contactcsvimport']['params']; - // hide groups field from list when group import disabled - if (empty($params['with_groups'])) { - unset($params['fields']['groups']); + $available_fields = []; + foreach (self::$CONTACT_COLTYPES as $id => $field) { + if ($id == 'photo') { + // skip photo field because there are no photos in CSV files + continue; + } + + if (!empty($field['subtypes'])) { + $subtype_names = array_map('rcmail_action_contacts_index::get_type_label', $field['subtypes']); + + for ($i = 0; $i < count($field['subtypes']); $i++) { + if (!empty($field['childs'])) { + foreach ($field['childs'] as $cid => $child) { + $available_fields[$cid . ':' . $field['subtypes'][$i]] = $rcmail->gettext(['name' => 'contactaddressfieldtype', 'vars' => ['field' => $child['label'], 'subtype' => $subtype_names[$i]]]); + } + } else { + $available_fields[$id . ':' . $field['subtypes'][$i]] = $rcmail->gettext(['name' => 'contactfieldsubtype', 'vars' => ['field' => $field['label'], 'subtype' => $subtype_names[$i]]]); + } + } + } else { + $available_fields[$id] = $field['label']; + } + } + + // allow importing of group assignments + if (!empty($params['with_groups'])) { + $available_fields['groups'] = $rcmail->gettext('groups'); } + // add separate birthday date parts fields for thunderbird imports + $available_fields['birthday-d'] = $rcmail->gettext('birth_day'); + $available_fields['birthday-m'] = $rcmail->gettext('birth_month'); + $available_fields['birthday-y'] = $rcmail->gettext('birth_year'); + + // sort by label for easy use + asort($available_fields); + $fieldlist = new html_select(['name' => '_map[]']); $fieldlist->add($rcmail->gettext('fieldnotmapped'), ''); - foreach ($params['fields'] as $id => $name) { - $fieldlist->add($name, $id); - } + $fieldlist->add(array_values($available_fields), array_keys($available_fields)); $field_table = new html_table(['cols' => 2] + $attrib); diff --git a/program/lib/Roundcube/rcube_csv2vcard.php b/program/lib/Roundcube/rcube_csv2vcard.php index 91a3c5cc11d..b69cdc2b63f 100644 --- a/program/lib/Roundcube/rcube_csv2vcard.php +++ b/program/lib/Roundcube/rcube_csv2vcard.php @@ -165,141 +165,33 @@ class rcube_csv2vcard 'phone1' => 'phone:home', 'phone' => 'phone:work', 'email' => 'email:home', + + // roundcube fields + 'email_home' => 'email:home', + 'email_work' => 'email:work', + 'email_other' => 'email:other', + 'phone_video' => 'phone:video', + 'maidenname' => 'maidenname', + 'im_aim' => 'im:aim', + 'im_icq' => 'im:icq', + 'im_jabber' => 'im:jabber', + 'im_msn' => 'im:msn', + 'im_other' => 'im:other', + 'im_skype' => 'im:skype', + 'im_yahoo' => 'im:yahoo', + 'web_blog' => 'website:blog', + 'web_home' => 'website:homepage', + 'web_other' => 'website:other', + 'web_profile' => 'website:profile', + 'web_work' => 'website:work', ]; /** - * CSV label to text mapping for English + * CSV label to text mapping for English read from localization * * @var array */ - protected $label_map = [ - // MS Outlook 2010 - 'anniversary' => 'Anniversary', - 'assistants_name' => "Assistant's Name", - 'assistants_phone' => "Assistant's Phone", - 'birthday' => 'Birthday', - 'business_city' => 'Business City', - 'business_countryregion' => 'Business Country/Region', - 'business_fax' => 'Business Fax', - 'business_phone' => 'Business Phone', - 'business_phone_2' => 'Business Phone 2', - 'business_postal_code' => 'Business Postal Code', - 'business_state' => 'Business State', - 'business_street' => 'Business Street', - // 'business_street_2' => "Business Street 2", - // 'business_street_3' => "Business Street 3", - 'car_phone' => 'Car Phone', - 'categories' => 'Categories', - // 'children' => "Children", - 'company' => 'Company', - // 'company_main_phone' => "Company Main Phone", - 'department' => 'Department', - // 'directory_server' => "Directory Server", - 'email_2_address' => 'E-mail 2 Address', - // 'email_2_type' => "E-mail 2 Type", - 'email_3_address' => 'E-mail 3 Address', - // 'email_3_type' => "E-mail 3 Type", - 'email_address' => 'E-mail Address', - // 'email_type' => "E-mail Type", - 'first_name' => 'First Name', - 'gender' => 'Gender', - 'home_city' => 'Home City', - 'home_countryregion' => 'Home Country/Region', - 'home_fax' => 'Home Fax', - 'home_phone' => 'Home Phone', - 'home_phone_2' => 'Home Phone 2', - 'home_postal_code' => 'Home Postal Code', - 'home_state' => 'Home State', - 'home_street' => 'Home Street', - // 'home_street_2' => "Home Street 2", - // 'home_street_3' => "Home Street 3", - // 'initials' => "Initials", - // 'isdn' => "ISDN", - 'job_title' => 'Job Title', - // 'keywords' => "Keywords", - // 'language' => "Language", - 'last_name' => 'Last Name', - // 'location' => "Location", - 'managers_name' => "Manager's Name", - 'middle_name' => 'Middle Name', - // 'mileage' => "Mileage", - 'mobile_phone' => 'Mobile Phone', - 'notes' => 'Notes', - // 'office_location' => "Office Location", - 'other_city' => 'Other City', - 'other_countryregion' => 'Other Country/Region', - 'other_fax' => 'Other Fax', - 'other_phone' => 'Other Phone', - 'other_postal_code' => 'Other Postal Code', - 'other_state' => 'Other State', - 'other_street' => 'Other Street', - // 'other_street_2' => "Other Street 2", - // 'other_street_3' => "Other Street 3", - 'pager' => 'Pager', - 'primary_phone' => 'Primary Phone', - // 'profession' => "Profession", - // 'radio_phone' => "Radio Phone", - 'spouse' => 'Spouse', - 'suffix' => 'Suffix', - 'title' => 'Title', - 'web_page' => 'Web Page', - - // Thunderbird - 'birth_day' => 'Birth Day', - 'birth_month' => 'Birth Month', - 'birth_year' => 'Birth Year', - 'display_name' => 'Display Name', - 'fax_number' => 'Fax Number', - 'home_address' => 'Home Address', - // 'home_address_2' => "Home Address 2", - 'home_country' => 'Home Country', - 'home_zipcode' => 'Home ZipCode', - 'mobile_number' => 'Mobile Number', - 'nickname' => 'Nickname', - 'organization' => 'Organization', - 'pager_number' => 'Pager Number', - 'primary_email' => 'Primary Email', - 'secondary_email' => 'Secondary Email', - 'web_page_1' => 'Web Page 1', - 'web_page_2' => 'Web Page 2', - 'work_phone' => 'Work Phone', - 'work_address' => 'Work Address', - // 'work_address_2' => "Work Address 2", - 'work_city' => 'Work City', - 'work_country' => 'Work Country', - 'work_state' => 'Work State', - 'work_zipcode' => 'Work ZipCode', - - // Atmail - 'date_of_birth' => 'Date of Birth', - 'email' => 'Email', - // 'email_2' => "Email2", - // 'email_3' => "Email3", - // 'email_4' => "Email4", - // 'email_5' => "Email5", - 'home_mobile' => 'Home Mobile', - 'home_zip' => 'Home Zip', - 'info' => 'Info', - 'user_photo' => 'User Photo', - 'url' => 'URL', - 'work_company' => 'Work Company', - 'work_dept' => 'Work Dept', - 'work_fax' => 'Work Fax', - 'work_mobile' => 'Work Mobile', - 'work_title' => 'Work Title', - 'work_zip' => 'Work Zip', - 'group' => 'Group', - - // GMail - 'groups' => 'Groups', - 'group_membership' => 'Group Membership', - 'given_name' => 'Given Name', - 'additional_name' => 'Additional Name', - 'family_name' => 'Family Name', - 'name' => 'Name', - 'name_prefix' => 'Name Prefix', - 'name_suffix' => 'Name Suffix', - ]; + protected $label_map = []; /** * Special fields map for GMail format @@ -390,14 +282,12 @@ class rcube_csv2vcard */ public function __construct($lang = 'en_US') { + $this->label_map = self::read_localization_file(RCUBE_LOCALIZATION_DIR . 'en_US/csv2vcard.inc'); + // Localize fields map - if ($lang && $lang != 'en_US') { - $map = null; - if (file_exists(RCUBE_LOCALIZATION_DIR . "{$lang}/csv2vcard.inc")) { - include RCUBE_LOCALIZATION_DIR . "{$lang}/csv2vcard.inc"; - } + if ($lang != 'en_US' && is_dir(RCUBE_LOCALIZATION_DIR . $lang)) { + $map = self::read_localization_file(RCUBE_LOCALIZATION_DIR . $lang . '/csv2vcard.inc'); - // @phpstan-ignore-next-line if (!empty($map)) { $this->local_label_map = array_merge($this->label_map, $map); } @@ -468,35 +358,6 @@ public function set_map($elements) $this->map = $elements; } - /** - * Set field mapping info - * - * @return array Array of vcard fields and localized names - */ - public function get_fields() - { - // get all vcard fields - $fields = array_unique($this->csv2vcard_map); - $local_field_names = $this->local_label_map ?: $this->label_map; - - // translate with the local map - $map = []; - foreach ($fields as $csv => $vcard) { - if ($vcard == '_auto_') { - continue; - } - - $map[$vcard] = $local_field_names[$csv]; - } - - // small fix to prevent "Groups" displaying as "Categories" - $map['groups'] = $local_field_names['groups']; - - asort($map); - - return $map; - } - /** * Export vCards * @@ -691,4 +552,31 @@ protected function csv_to_vcard($data) // add to the list $this->vcards[] = $vcard; } + + /** + * Load localization file + * + * @param string $file File location + * @param array $texts Additional texts to merge with + * + * @return array Localization csv2vcard map + */ + protected static function read_localization_file($file, $texts = []) + { + if (is_file($file) && is_readable($file)) { + $map = []; + + // use buffering to handle empty lines/spaces after closing PHP tag + ob_start(); + require $file; + ob_end_clean(); + + // @phpstan-ignore-next-line + if (!empty($map)) { + $texts = array_merge($texts, $map); + } + } + + return $texts; + } } diff --git a/program/lib/Roundcube/rcube_vcard.php b/program/lib/Roundcube/rcube_vcard.php index 0dc32c4acf4..3c4844fcc57 100644 --- a/program/lib/Roundcube/rcube_vcard.php +++ b/program/lib/Roundcube/rcube_vcard.php @@ -55,7 +55,6 @@ class rcube_vcard 'HOOME,FAX' => 'homefax', 'OTHER,FAX' => 'other', 'FAX' => 'homefax', - 'TITLE' => 'prefix', ]; private $phonetypemap = [ 'HOME1' => 'HOME', @@ -214,9 +213,9 @@ public function get_assoc() } elseif (!empty($typemap[$raw['type'][++$k]])) { $subtype = $typemap[$raw['type'][$k]]; } elseif ($tag == 'TEL' && $raw['type'][$k] == 'pref') { - $subtype = "main"; + $subtype = 'main'; } elseif ($tag == 'EMAIL' && $raw['type'][$k] == 'pref') { - $subtype = "other"; + $subtype = 'other'; } else { $subtype = $raw['type'][$k]; } diff --git a/program/localization/en_US/csv2vcard.inc b/program/localization/en_US/csv2vcard.inc index 1dd5def0fda..d398bd7f80c 100644 --- a/program/localization/en_US/csv2vcard.inc +++ b/program/localization/en_US/csv2vcard.inc @@ -106,3 +106,32 @@ $map['work_mobile'] = "Work Mobile"; $map['work_state'] = "Work State"; $map['work_title'] = "Work Title"; $map['work_zip'] = "Work Zip"; +$map['group'] = "Group"; + +// GMail +$map['groups'] = "Groups"; +$map['group_membership'] = "Group Membership"; +$map['given_name'] = "Given Name"; +$map['additional_name'] = "Additional Name"; +$map['family_name'] = "Family Name"; +$map['name'] = "Name"; +$map['name_prefix'] = "Name Prefix"; +$map['name_suffix'] = "Name Suffix"; + +// Roundcube fields +$map['email_home'] = "Email Home"; +$map['email_work'] = "Email Work"; +$map['email_other'] = "Email Other"; +$map['phone_video'] = "Phone Video"; +$map['maidenname'] = "Maiden Name"; +$map['im_aim'] = "IM Aim"; +$map['im_icq'] = "IM Icq"; +$map['im_jabber'] = "IM Jabber"; +$map['im_msn'] = "IM Msn"; +$map['im_skype'] = "IM Skype"; +$map['im_yahoo'] = "IM Yahoo"; +$map['web_blog'] = "Website Blog"; +$map['web_home'] = "Website Home Page"; +$map['web_other'] = "Website Other"; +$map['web_profile'] = "Website Profile"; +$map['web_work'] = "Website Work"; diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc index 2e095835a08..f3292564e98 100644 --- a/program/localization/en_US/labels.inc +++ b/program/localization/en_US/labels.inc @@ -507,6 +507,11 @@ $labels['importmapdesc'] = 'Confirm the field mapping information below is corre $labels['fieldnotmapped'] = 'Field not mapped (do not import)'; $labels['skipheader'] = 'Do not import first line (headers)'; $labels['done'] = 'Done'; +$labels['contactfieldsubtype'] = '$field $subtype'; +$labels['contactaddressfieldtype'] = '$subtype $field'; +$labels['birth_day'] = 'Birth Day'; +$labels['birth_month'] = 'Birth Month'; +$labels['birth_year'] = 'Birth Year'; // settings $labels['settingsfor'] = 'Settings for'; diff --git a/tests/Framework/Csv2vcardTest.php b/tests/Framework/Csv2vcardTest.php index cf1d10f276b..9cad1fe2f11 100644 --- a/tests/Framework/Csv2vcardTest.php +++ b/tests/Framework/Csv2vcardTest.php @@ -101,4 +101,22 @@ public function test_import_outlook() $this->assertSame($vcf_text, $vcard); } + + public function test_import_all() + { + $csv_text = file_get_contents(TESTS_DIR . '/src/Csv2vcard/all.csv'); + $vcf_text = file_get_contents(TESTS_DIR . '/src/Csv2vcard/all.vcf'); + + $csv = new rcube_csv2vcard(); + $csv->import($csv_text); + $result = $csv->export(); + + $this->assertCount(1, $result); + + $vcard = $result[0]->export(false); + $vcf_text = trim(str_replace("\r\n", "\n", $vcf_text)); + $vcard = trim(str_replace("\r\n", "\n", $vcard)); + + $this->assertSame($vcf_text, $vcard); + } } diff --git a/tests/src/Csv2vcard/all.csv b/tests/src/Csv2vcard/all.csv new file mode 100644 index 00000000000..6480ce13035 --- /dev/null +++ b/tests/src/Csv2vcard/all.csv @@ -0,0 +1,2 @@ +Display Name,Title,First Name,Middle Name,Last Name,Suffix,Nickname,Company,Department,Job Title,Email Home,Email Work,Email Other,Home Phone,Home Phone 2,Business Phone,Business Phone 2,Home Mobile,Primary Phone,Home Fax,Business Fax,Car Phone,Pager,Phone Video,Assistant's Phone,Other Phone,Home Street,Home City,Home State,Home Zip,Home Country,Business Street,Work City,Work State,Work Zip,Work Country,Other Street,Other City,Other State,Other Postal Code,Other Country/Region,Gender,Birthday,Maiden Name,Anniversary,Manager's Name,Assistant's Name,Spouse,Notes,IM Aim,IM Icq,IM Jabber,IM Msn,IM Skype,IM Yahoo,Website Blog,Website Home Page,Website Other,Website Profile,Website Work,Categories +Display Name,Prefix,First Name,Middle Name,Last Name,Suffix,Nickname,Company,Department,Job Title,home@example.com,work@example.com,other@example.com,100,200,300,400,500,600,700,800,900,111,222,333,444,Home Street,Home City,Home State,Home Zip,Home Country,Work Street,Work City,Work State,Work Zip,Work Country,Other Street,Other City,Other State,Other Zip,Other Country,female,20/01/1991,Maiden Name,20/02/1992,Manager,Assistant,Spouse,Notes,aim,icq,jabber,msn,skype,yahoo,https://blog,https://home,https://other,https://profile,https://work,test diff --git a/tests/src/Csv2vcard/all.vcf b/tests/src/Csv2vcard/all.vcf new file mode 100644 index 00000000000..3558d1196c8 --- /dev/null +++ b/tests/src/Csv2vcard/all.vcf @@ -0,0 +1,48 @@ +BEGIN:VCARD +VERSION:3.0 +FN:Display Name +N:Last Name;First Name;Middle Name;Prefix;Suffix +NICKNAME:Nickname +ORG:Company +X-DEPARTMENT:Department +TITLE:Job Title +EMAIL;TYPE=home:home@example.com +EMAIL;TYPE=work:work@example.com +EMAIL:other@example.com +TEL;TYPE=home:100 +TEL;TYPE=home2:200 +TEL;TYPE=work:300 +TEL;TYPE=work2:400 +TEL;TYPE=cell:500 +TEL;TYPE=main:600 +TEL;TYPE=homefax:700 +TEL;TYPE=workfax:800 +TEL;TYPE=car:900 +TEL;TYPE=pager:111 +TEL;TYPE=video:222 +TEL;TYPE=assistant:333 +TEL:444 +X-GENDER:female +BDAY;VALUE=date:1991-01-20 +X-MAIDENNAME:Maiden Name +X-ANNIVERSARY;VALUE=date:1992-02-20 +X-MANAGER:Manager +X-ASSISTANT:Assistant +X-SPOUSE:Spouse +NOTE:Notes +X-AIM:aim +X-ICQ:icq +X-JABBER:jabber +X-MSN:msn +X-SKYPE-USERNAME:skype +X-YAHOO:yahoo +URL;TYPE=blog:https://blog +URL;TYPE=homepage:https://home +URL:https://other +URL;TYPE=profile:https://profile +URL;TYPE=work:https://work +CATEGORIES:test +ADR;TYPE=home:;;Home Street;Home City;Home State;Home Zip;Home Country +ADR;TYPE=work:;;Work Street;Work City;Work State;Work Zip;Work Country +ADR:;;Other Street;Other City;Other State;Other Zip;Other Country +END:VCARD From 19b97d79f2e7a7fe6a3b2c85c0ea4934f0819318 Mon Sep 17 00:00:00 2001 From: PhilW Date: Sat, 1 Jun 2024 10:07:08 +0100 Subject: [PATCH 05/12] add SORT_LOCALE_STRING flag --- program/actions/contacts/import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/actions/contacts/import.php b/program/actions/contacts/import.php index bc00a779499..a8ce4d2130f 100644 --- a/program/actions/contacts/import.php +++ b/program/actions/contacts/import.php @@ -403,7 +403,7 @@ public static function import_map($attrib) $available_fields['birthday-y'] = $rcmail->gettext('birth_year'); // sort by label for easy use - asort($available_fields); + asort($available_fields, \SORT_LOCALE_STRING); $fieldlist = new html_select(['name' => '_map[]']); $fieldlist->add($rcmail->gettext('fieldnotmapped'), ''); From 9c051f86c721c30dd70841555cc4d57c51086d98 Mon Sep 17 00:00:00 2001 From: PhilW Date: Sat, 1 Jun 2024 13:08:32 +0100 Subject: [PATCH 06/12] fix typos --- program/lib/Roundcube/rcube_csv2vcard.php | 1 - program/lib/Roundcube/rcube_vcard.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/program/lib/Roundcube/rcube_csv2vcard.php b/program/lib/Roundcube/rcube_csv2vcard.php index b69cdc2b63f..b9bbdbd9646 100644 --- a/program/lib/Roundcube/rcube_csv2vcard.php +++ b/program/lib/Roundcube/rcube_csv2vcard.php @@ -176,7 +176,6 @@ class rcube_csv2vcard 'im_icq' => 'im:icq', 'im_jabber' => 'im:jabber', 'im_msn' => 'im:msn', - 'im_other' => 'im:other', 'im_skype' => 'im:skype', 'im_yahoo' => 'im:yahoo', 'web_blog' => 'website:blog', diff --git a/program/lib/Roundcube/rcube_vcard.php b/program/lib/Roundcube/rcube_vcard.php index 3c4844fcc57..0e4a3cdf1c8 100644 --- a/program/lib/Roundcube/rcube_vcard.php +++ b/program/lib/Roundcube/rcube_vcard.php @@ -52,7 +52,7 @@ class rcube_vcard 'CELL' => 'mobile', 'WORK,FAX' => 'workfax', 'WORK,CELL' => 'other', - 'HOOME,FAX' => 'homefax', + 'HOME,FAX' => 'homefax', 'OTHER,FAX' => 'other', 'FAX' => 'homefax', ]; From d0e46b7a6faf46eb0f09e81e8f25ef7d6c38b2b6 Mon Sep 17 00:00:00 2001 From: PhilW Date: Sat, 1 Jun 2024 13:12:44 +0100 Subject: [PATCH 07/12] remove unwanted label --- program/actions/contacts/import.php | 4 ++-- program/localization/en_US/labels.inc | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/program/actions/contacts/import.php b/program/actions/contacts/import.php index a8ce4d2130f..b75b0453f7b 100644 --- a/program/actions/contacts/import.php +++ b/program/actions/contacts/import.php @@ -381,10 +381,10 @@ public static function import_map($attrib) for ($i = 0; $i < count($field['subtypes']); $i++) { if (!empty($field['childs'])) { foreach ($field['childs'] as $cid => $child) { - $available_fields[$cid . ':' . $field['subtypes'][$i]] = $rcmail->gettext(['name' => 'contactaddressfieldtype', 'vars' => ['field' => $child['label'], 'subtype' => $subtype_names[$i]]]); + $available_fields[$cid . ':' . $field['subtypes'][$i]] = $child['label'] . ' - ' . $subtype_names[$i]; } } else { - $available_fields[$id . ':' . $field['subtypes'][$i]] = $rcmail->gettext(['name' => 'contactfieldsubtype', 'vars' => ['field' => $field['label'], 'subtype' => $subtype_names[$i]]]); + $available_fields[$id . ':' . $field['subtypes'][$i]] = $field['label'] . ' - ' . $subtype_names[$i]; } } } else { diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc index f3292564e98..781063f5c5a 100644 --- a/program/localization/en_US/labels.inc +++ b/program/localization/en_US/labels.inc @@ -507,8 +507,6 @@ $labels['importmapdesc'] = 'Confirm the field mapping information below is corre $labels['fieldnotmapped'] = 'Field not mapped (do not import)'; $labels['skipheader'] = 'Do not import first line (headers)'; $labels['done'] = 'Done'; -$labels['contactfieldsubtype'] = '$field $subtype'; -$labels['contactaddressfieldtype'] = '$subtype $field'; $labels['birth_day'] = 'Birth Day'; $labels['birth_month'] = 'Birth Month'; $labels['birth_year'] = 'Birth Year'; From 90a7802eb8b5191fc7a9929bfd99702f1b19da56 Mon Sep 17 00:00:00 2001 From: PhilW Date: Sun, 2 Jun 2024 09:49:29 +0100 Subject: [PATCH 08/12] move field list to csv2vcard --- program/actions/contacts/import.php | 38 ++---------------- program/lib/Roundcube/rcube_csv2vcard.php | 47 +++++++++++++++++++++++ 2 files changed, 51 insertions(+), 34 deletions(-) diff --git a/program/actions/contacts/import.php b/program/actions/contacts/import.php index b75b0453f7b..fe97a591b31 100644 --- a/program/actions/contacts/import.php +++ b/program/actions/contacts/import.php @@ -368,43 +368,13 @@ public static function import_map($attrib) $rcmail = rcmail::get_instance(); $params = $_SESSION['contactcsvimport']['params']; - $available_fields = []; - foreach (self::$CONTACT_COLTYPES as $id => $field) { - if ($id == 'photo') { - // skip photo field because there are no photos in CSV files - continue; - } - - if (!empty($field['subtypes'])) { - $subtype_names = array_map('rcmail_action_contacts_index::get_type_label', $field['subtypes']); - - for ($i = 0; $i < count($field['subtypes']); $i++) { - if (!empty($field['childs'])) { - foreach ($field['childs'] as $cid => $child) { - $available_fields[$cid . ':' . $field['subtypes'][$i]] = $child['label'] . ' - ' . $subtype_names[$i]; - } - } else { - $available_fields[$id . ':' . $field['subtypes'][$i]] = $field['label'] . ' - ' . $subtype_names[$i]; - } - } - } else { - $available_fields[$id] = $field['label']; - } - } + $available_fields = rcube_csv2vcard::list_fields(); - // allow importing of group assignments - if (!empty($params['with_groups'])) { - $available_fields['groups'] = $rcmail->gettext('groups'); + // remove groups field if group import is not enabled + if (empty($params['with_groups'])) { + unset($available_fields['groups']); } - // add separate birthday date parts fields for thunderbird imports - $available_fields['birthday-d'] = $rcmail->gettext('birth_day'); - $available_fields['birthday-m'] = $rcmail->gettext('birth_month'); - $available_fields['birthday-y'] = $rcmail->gettext('birth_year'); - - // sort by label for easy use - asort($available_fields, \SORT_LOCALE_STRING); - $fieldlist = new html_select(['name' => '_map[]']); $fieldlist->add($rcmail->gettext('fieldnotmapped'), ''); $fieldlist->add(array_values($available_fields), array_keys($available_fields)); diff --git a/program/lib/Roundcube/rcube_csv2vcard.php b/program/lib/Roundcube/rcube_csv2vcard.php index b9bbdbd9646..5addf35dc10 100644 --- a/program/lib/Roundcube/rcube_csv2vcard.php +++ b/program/lib/Roundcube/rcube_csv2vcard.php @@ -342,6 +342,53 @@ public function import($csv, $dry_run = false, $skip_head = true) return null; } + /** + * Get list of contact fields available for import + * + * @return array string List of fields + */ + public static function list_fields() + { + $rcmail = rcmail::get_instance(); + $available_fields = []; + + foreach (rcmail_action_contacts_index::$CONTACT_COLTYPES as $id => $field) { + if ($id == 'photo') { + // skip photo field because there are no photos in CSV files + continue; + } + + if (!empty($field['subtypes'])) { + $subtype_names = array_map('rcmail_action_contacts_index::get_type_label', $field['subtypes']); + + for ($i = 0; $i < count($field['subtypes']); $i++) { + if (!empty($field['childs'])) { + foreach ($field['childs'] as $cid => $child) { + $available_fields[$cid . ':' . $field['subtypes'][$i]] = $child['label'] . ' - ' . $subtype_names[$i]; + } + } else { + $available_fields[$id . ':' . $field['subtypes'][$i]] = $field['label'] . ' - ' . $subtype_names[$i]; + } + } + } else { + $available_fields[$id] = $field['label']; + } + } + + // allow importing of group assignments + $available_fields['groups'] = $rcmail->gettext('groups'); + + // add separate birthday date parts fields for thunderbird imports + $available_fields['birthday-d'] = $rcmail->gettext('birth_day'); + $available_fields['birthday-m'] = $rcmail->gettext('birth_month'); + $available_fields['birthday-y'] = $rcmail->gettext('birth_year'); + + // sort by label for easy use + asort($available_fields, \SORT_LOCALE_STRING); + + return $available_fields; + } + /** * Set field mapping info * From 7599443545c367ffb6fe9d8811d1552da08ac0e8 Mon Sep 17 00:00:00 2001 From: PhilW Date: Sun, 16 Jun 2024 11:17:45 +0100 Subject: [PATCH 09/12] move rcube_csv2vcard::list_fields to rcmail_action_contacts_import::list_fields as it relies on rcmail_action_contacts --- program/actions/contacts/import.php | 54 ++++++++++++++++++++--- program/lib/Roundcube/rcube_csv2vcard.php | 47 -------------------- 2 files changed, 48 insertions(+), 53 deletions(-) diff --git a/program/actions/contacts/import.php b/program/actions/contacts/import.php index fe97a591b31..6f234b4e8d6 100644 --- a/program/actions/contacts/import.php +++ b/program/actions/contacts/import.php @@ -368,12 +368,7 @@ public static function import_map($attrib) $rcmail = rcmail::get_instance(); $params = $_SESSION['contactcsvimport']['params']; - $available_fields = rcube_csv2vcard::list_fields(); - - // remove groups field if group import is not enabled - if (empty($params['with_groups'])) { - unset($available_fields['groups']); - } + $available_fields = self::list_fields(!empty($params['with_groups'])); $fieldlist = new html_select(['name' => '_map[]']); $fieldlist->add($rcmail->gettext('fieldnotmapped'), ''); @@ -470,4 +465,51 @@ public static function import_group_id($group_name, $contacts, $create, &$import return $group_id; } + + /** + * Returns the list of contact fields available for import + */ + public static function list_fields($groups) + { + $rcmail = rcmail::get_instance(); + $available_fields = []; + + foreach (self::$CONTACT_COLTYPES as $id => $field) { + if ($id == 'photo') { + // skip photo field because there are no photos in CSV files + continue; + } + + if (!empty($field['subtypes'])) { + $subtype_names = array_map('rcmail_action_contacts_index::get_type_label', $field['subtypes']); + + for ($i = 0; $i < count($field['subtypes']); $i++) { + if (!empty($field['childs'])) { + foreach ($field['childs'] as $cid => $child) { + $available_fields[$cid . ':' . $field['subtypes'][$i]] = $child['label'] . ' - ' . $subtype_names[$i]; + } + } else { + $available_fields[$id . ':' . $field['subtypes'][$i]] = $field['label'] . ' - ' . $subtype_names[$i]; + } + } + } else { + $available_fields[$id] = $field['label']; + } + } + + if ($groups) { + // allow importing of group assignments + $available_fields['groups'] = $rcmail->gettext('groups'); + } + + // add separate birthday date parts fields for thunderbird imports + $available_fields['birthday-d'] = $rcmail->gettext('birth_day'); + $available_fields['birthday-m'] = $rcmail->gettext('birth_month'); + $available_fields['birthday-y'] = $rcmail->gettext('birth_year'); + + // sort by label for easy use + asort($available_fields, \SORT_LOCALE_STRING); + + return $available_fields; + } } diff --git a/program/lib/Roundcube/rcube_csv2vcard.php b/program/lib/Roundcube/rcube_csv2vcard.php index 5addf35dc10..b9bbdbd9646 100644 --- a/program/lib/Roundcube/rcube_csv2vcard.php +++ b/program/lib/Roundcube/rcube_csv2vcard.php @@ -342,53 +342,6 @@ public function import($csv, $dry_run = false, $skip_head = true) return null; } - /** - * Get list of contact fields available for import - * - * @return array string List of fields - */ - public static function list_fields() - { - $rcmail = rcmail::get_instance(); - $available_fields = []; - - foreach (rcmail_action_contacts_index::$CONTACT_COLTYPES as $id => $field) { - if ($id == 'photo') { - // skip photo field because there are no photos in CSV files - continue; - } - - if (!empty($field['subtypes'])) { - $subtype_names = array_map('rcmail_action_contacts_index::get_type_label', $field['subtypes']); - - for ($i = 0; $i < count($field['subtypes']); $i++) { - if (!empty($field['childs'])) { - foreach ($field['childs'] as $cid => $child) { - $available_fields[$cid . ':' . $field['subtypes'][$i]] = $child['label'] . ' - ' . $subtype_names[$i]; - } - } else { - $available_fields[$id . ':' . $field['subtypes'][$i]] = $field['label'] . ' - ' . $subtype_names[$i]; - } - } - } else { - $available_fields[$id] = $field['label']; - } - } - - // allow importing of group assignments - $available_fields['groups'] = $rcmail->gettext('groups'); - - // add separate birthday date parts fields for thunderbird imports - $available_fields['birthday-d'] = $rcmail->gettext('birth_day'); - $available_fields['birthday-m'] = $rcmail->gettext('birth_month'); - $available_fields['birthday-y'] = $rcmail->gettext('birth_year'); - - // sort by label for easy use - asort($available_fields, \SORT_LOCALE_STRING); - - return $available_fields; - } - /** * Set field mapping info * From 2be7359b5302f69f36a5234c4243f119428abc14 Mon Sep 17 00:00:00 2001 From: PhilW Date: Sun, 16 Jun 2024 11:37:50 +0100 Subject: [PATCH 10/12] use single field map for csv2vcard imports, remove hardcoded version --- program/actions/contacts/import.php | 2 +- program/lib/Roundcube/rcube_csv2vcard.php | 239 +++------------------- program/localization/de_CH/csv2vcard.inc | 162 +++++++-------- program/localization/de_DE/csv2vcard.inc | 166 +++++++-------- program/localization/en_US/csv2vcard.inc | 216 +++++++++---------- program/localization/es_ES/csv2vcard.inc | 166 +++++++-------- program/localization/fi_FI/csv2vcard.inc | 62 +++--- program/localization/fr_FR/csv2vcard.inc | 132 ++++++------ program/localization/it_IT/csv2vcard.inc | 166 +++++++-------- program/localization/pl_PL/csv2vcard.inc | 74 +++---- program/localization/pt_BR/csv2vcard.inc | 166 +++++++-------- program/localization/ru_RU/csv2vcard.inc | 54 ++--- program/localization/sk_SK/csv2vcard.inc | 132 ++++++------ program/localization/zh_TW/csv2vcard.inc | 144 ++++++------- 14 files changed, 850 insertions(+), 1031 deletions(-) diff --git a/program/actions/contacts/import.php b/program/actions/contacts/import.php index 6f234b4e8d6..0e14909d742 100644 --- a/program/actions/contacts/import.php +++ b/program/actions/contacts/import.php @@ -101,7 +101,7 @@ public function run($args = []) $map = rcube_utils::get_input_value('_map', rcube_utils::INPUT_GPC); $map = array_filter($map); - $csv->set_map($map); + $csv->set_map($map, array_keys(self::list_fields($with_groups))); $csv->import($file_content, false, $skip_head); unlink($filepath); diff --git a/program/lib/Roundcube/rcube_csv2vcard.php b/program/lib/Roundcube/rcube_csv2vcard.php index b9bbdbd9646..6fc009f706a 100644 --- a/program/lib/Roundcube/rcube_csv2vcard.php +++ b/program/lib/Roundcube/rcube_csv2vcard.php @@ -22,169 +22,6 @@ */ class rcube_csv2vcard { - /** - * CSV to vCard fields mapping - * - * @var array - */ - protected $csv2vcard_map = [ - // MS Outlook 2010 - 'anniversary' => 'anniversary', - 'assistants_name' => 'assistant', - 'assistants_phone' => 'phone:assistant', - 'birthday' => 'birthday', - 'business_city' => 'locality:work', - 'business_countryregion' => 'country:work', - 'business_fax' => 'phone:workfax', - 'business_phone' => 'phone:work', - 'business_phone_2' => 'phone:work2', - 'business_postal_code' => 'zipcode:work', - 'business_state' => 'region:work', - 'business_street' => 'street:work', - // 'business_street_2' => '', - // 'business_street_3' => '', - 'car_phone' => 'phone:car', - 'categories' => 'groups', - // 'children' => '', - 'company' => 'organization', - // 'company_main_phone' => '', - 'department' => 'department', - 'email_2_address' => 'email:other', - // 'email_2_type' => '', - 'email_3_address' => 'email:other', - // 'email_3_type' => '', - 'email_address' => 'email:other', - // 'email_type' => '', - 'first_name' => 'firstname', - 'gender' => 'gender', - 'home_city' => 'locality:home', - 'home_countryregion' => 'country:home', - 'home_fax' => 'phone:homefax', - 'home_phone' => 'phone:home', - 'home_phone_2' => 'phone:home2', - 'home_postal_code' => 'zipcode:home', - 'home_state' => 'region:home', - 'home_street' => 'street:home', - // 'home_street_2' => '', - // 'home_street_3' => '', - // 'initials' => '', - // 'isdn' => '', - 'job_title' => 'jobtitle', - // 'keywords' => '', - // 'language' => '', - 'last_name' => 'surname', - // 'location' => '', - 'managers_name' => 'manager', - 'middle_name' => 'middlename', - // 'mileage' => '', - 'mobile_phone' => 'phone:mobile', - 'notes' => 'notes', - // 'office_location' => '', - 'other_city' => 'locality:other', - 'other_countryregion' => 'country:other', - 'other_fax' => 'phone:other', - 'other_phone' => 'phone:other', - 'other_postal_code' => 'zipcode:other', - 'other_state' => 'region:other', - 'other_street' => 'street:other', - // 'other_street_2' => '', - // 'other_street_3' => '', - 'pager' => 'phone:pager', - 'primary_phone' => 'phone:main', - // 'profession' => '', - // 'radio_phone' => '', - 'spouse' => 'spouse', - 'suffix' => 'suffix', - 'title' => 'prefix', - 'web_page' => 'website:homepage', - - // Thunderbird - 'birth_day' => 'birthday-d', - 'birth_month' => 'birthday-m', - 'birth_year' => 'birthday-y', - 'display_name' => 'name', - 'fax_number' => 'phone:homefax', - 'home_address' => 'street:home', - // 'home_address_2' => '', - 'home_country' => 'country:home', - 'home_zipcode' => 'zipcode:home', - 'mobile_number' => 'phone:mobile', - 'nickname' => 'nickname', - 'organization' => 'organization', - 'pager_number' => 'phone:pager', - 'primary_email' => 'email:home', - 'secondary_email' => 'email:other', - 'web_page_1' => 'website:homepage', - 'web_page_2' => 'website:other', - 'work_phone' => 'phone:work', - 'work_address' => 'street:work', - // 'work_address_2' => '', - 'work_country' => 'country:work', - 'work_zipcode' => 'zipcode:work', - 'last' => 'surname', - 'first' => 'firstname', - 'work_city' => 'locality:work', - 'work_state' => 'region:work', - 'home_city_short' => 'locality:home', - 'home_state_short' => 'region:home', - - // Atmail - 'date_of_birth' => 'birthday', - // 'email' => 'email:pref', - 'home_mobile' => 'phone:mobile', - 'home_zip' => 'zipcode:home', - 'info' => 'notes', - 'user_photo' => 'photo', - 'url' => 'website:homepage', - 'work_company' => 'organization', - 'work_dept' => 'department', - 'work_fax' => 'phone:workfax', - 'work_mobile' => 'phone:other', - 'work_title' => 'jobtitle', - 'work_zip' => 'zipcode:work', - 'group' => 'groups', - - // GMail - 'groups' => 'groups', - 'group_membership' => 'groups', - 'given_name' => 'firstname', - 'additional_name' => 'middlename', - 'family_name' => 'surname', - 'name' => 'name', - 'name_prefix' => 'prefix', - 'name_suffix' => 'suffix', - - // Format of Letter Hub test files from - // https://letterhub.com/sample-csv-file-with-contacts/ - 'company_name' => 'organization', - 'address' => 'street:home', - 'city' => 'locality:home', - // 'county' => '', - 'state' => 'region:home', - 'zip' => 'zipcode:home', - 'phone1' => 'phone:home', - 'phone' => 'phone:work', - 'email' => 'email:home', - - // roundcube fields - 'email_home' => 'email:home', - 'email_work' => 'email:work', - 'email_other' => 'email:other', - 'phone_video' => 'phone:video', - 'maidenname' => 'maidenname', - 'im_aim' => 'im:aim', - 'im_icq' => 'im:icq', - 'im_jabber' => 'im:jabber', - 'im_msn' => 'im:msn', - 'im_skype' => 'im:skype', - 'im_yahoo' => 'im:yahoo', - 'web_blog' => 'website:blog', - 'web_home' => 'website:homepage', - 'web_other' => 'website:other', - 'web_profile' => 'website:profile', - 'web_work' => 'website:work', - ]; - /** * CSV label to text mapping for English read from localization * @@ -265,9 +102,6 @@ class rcube_csv2vcard ], ]; - /** @var array Localized labels map */ - protected $local_label_map = []; - /** @var rcube_vcard[] List of contacts as vCards */ protected $vcards = []; @@ -288,7 +122,7 @@ public function __construct($lang = 'en_US') $map = self::read_localization_file(RCUBE_LOCALIZATION_DIR . $lang . '/csv2vcard.inc'); if (!empty($map)) { - $this->local_label_map = array_merge($this->label_map, $map); + $this->label_map = array_merge_recursive($this->label_map, $map); } } } @@ -347,11 +181,11 @@ public function import($csv, $dry_run = false, $skip_head = true) * * @param array $elements Field mapping */ - public function set_map($elements) + public function set_map($elements, $available) { // sanitize input - $elements = array_filter($elements, function ($val) { - return in_array($val, $this->csv2vcard_map); + $elements = array_filter($elements, function ($val) use ($available) { + return in_array($val, $available); }); $this->map = $elements; @@ -395,56 +229,20 @@ protected function parse_header($lines) { $elements = $this->parse_line($lines[0]); - $label_map = array_flip($this->label_map); - $local_label_map = array_flip($this->local_label_map); - if (count($lines) == 2) { // first line of contents needed to properly identify fields in gmail CSV $contents = $this->parse_line($lines[1]); } - $map1 = []; - $map2 = []; $size = count($elements); - // check English labels + // check labels for ($i = 0; $i < $size; $i++) { - if (!empty($label_map[$elements[$i]])) { - $label = $label_map[$elements[$i]]; - if (!empty($this->csv2vcard_map[$label])) { - $map1[$i] = $this->csv2vcard_map[$label]; - } - } - } - - // check localized labels - if (!empty($local_label_map)) { - for ($i = 0; $i < $size; $i++) { - $label = $local_label_map[$elements[$i]]; - - // special localization label - if ($label && $label[0] == '_') { - $label = substr($label, 1); - } - - if ($label && !empty($this->csv2vcard_map[$label])) { - $map2[$i] = $this->csv2vcard_map[$label]; - } + if ($field = self::search_map($elements[$i], $this->label_map)) { + $this->map[$i] = $field; } } - // If nothing recognized fallback to simple non-localized labels - if (empty($map1) && empty($map2)) { - for ($i = 0; $i < $size; $i++) { - $label = str_replace(' ', '_', strtolower($elements[$i])); - if (!empty($this->csv2vcard_map[$label])) { - $map1[$i] = $this->csv2vcard_map[$label]; - } - } - } - - $this->map = count($map1) >= count($map2) ? $map1 : $map2; - if (!empty($contents)) { foreach ($this->gmail_label_map as $key => $items) { $num = 1; @@ -572,10 +370,31 @@ protected static function read_localization_file($file, $texts = []) // @phpstan-ignore-next-line if (!empty($map)) { - $texts = array_merge($texts, $map); + $texts = array_merge_recursive($texts, $map); } } return $texts; } + + /** + * Search csv2vcard mapping array + * + * @param string $needle Field name to search for + * @param array $map Field map to be searched + * + * @return string|null vcard field id + */ + protected static function search_map($needle, $map) + { + $result = null; + foreach ($map as $key => $headings) { + if (array_search($needle, $headings) !== false) { + $result = $key; + break; + } + } + + return $result; + } } diff --git a/program/localization/de_CH/csv2vcard.inc b/program/localization/de_CH/csv2vcard.inc index 7d4b04d04ab..4f2bc3e8d88 100644 --- a/program/localization/de_CH/csv2vcard.inc +++ b/program/localization/de_CH/csv2vcard.inc @@ -16,84 +16,84 @@ +-----------------------------------------------------------------------+ */ $map = array(); -$map['anniversary'] = "Jahrestag"; -$map['assistants_name'] = "Name Assistent"; -$map['assistants_phone'] = "Telefon Assistent"; -$map['birthday'] = "Geburtstag"; -$map['business_city'] = "Ort geschäftlich"; -$map['business_countryregion'] = "Region geschäftlich"; -$map['business_fax'] = "Fax geschäftlich"; -$map['business_phone'] = "Telefon geschäftlich"; -$map['business_phone_2'] = "Telefon geschäftlich 2"; -$map['business_postal_code'] = "Postleitzahl geschäftlich"; -$map['business_state'] = "Land geschäftlich"; -$map['business_street'] = "Straße geschäftlich"; -$map['car_phone'] = "Autotelefon"; -$map['categories'] = "Kategorien"; -$map['company'] = "Firma"; -$map['department'] = "Abteilung"; -$map['email_address'] = "E-Mail-Adresse"; -$map['first_name'] = "Vorname"; -$map['gender'] = "Geschlecht"; -$map['home_city'] = "Ort privat"; -$map['home_countryregion'] = "Region privat"; -$map['home_fax'] = "Fax privat"; -$map['home_phone'] = "Telefon privat"; -$map['home_phone_2'] = "Telefon privat 2"; -$map['home_postal_code'] = "Postleitzahl privat"; -$map['home_state'] = "Land privat"; -$map['home_street'] = "Straße privat"; -$map['job_title'] = "Position"; -$map['last_name'] = "Nachname"; -$map['managers_name'] = "Manager's Name"; -$map['middle_name'] = "Weitere Vornamen"; -$map['mobile_phone'] = "Mobiltelefon"; -$map['notes'] = "Notizen"; -$map['other_city'] = "Weiterer Ort"; -$map['other_countryregion'] = "Weitere Region"; -$map['other_fax'] = "Weiteres Fax"; -$map['other_phone'] = "Weiteres Telefon"; -$map['other_postal_code'] = "Weitere Postleitzahl"; -$map['other_state'] = "Weiteres Land"; -$map['other_street'] = "Weitere Straße"; -$map['pager'] = "Pager"; -$map['primary_phone'] = "Haupttelefon"; -$map['spouse'] = "Spouse"; -$map['suffix'] = "Suffix"; -$map['title'] = "Title"; -$map['web_page'] = "Webseite"; -$map['birth_day'] = "Geburtstag"; -$map['birth_month'] = "Geburtsmonat"; -$map['birth_year'] = "Geburtsjahr"; -$map['display_name'] = "Anzeigename"; -$map['fax_number'] = "Fax-Nummer"; -$map['home_address'] = "Privat: Adresse"; -$map['home_country'] = "Privat: Land"; -$map['home_zipcode'] = "Privat: PLZ"; -$map['mobile_number'] = "Mobil-Tel.-Nr."; -$map['nickname'] = "Spitzname"; -$map['organization'] = "Organisation"; -$map['pager_number'] = "Pager-Nummer"; -$map['primary_email'] = "Primäre E-Mail-Adresse"; -$map['secondary_email'] = "Sekundäre E-Mail-Adresse"; -$map['web_page_1'] = "Webseite 1"; -$map['web_page_2'] = "Webseite 2"; -$map['work_phone'] = "Tel. dienstlich"; -$map['work_address'] = "Dienstlich: Adresse"; -$map['work_country'] = "Dienstlich: Land"; -$map['work_zipcode'] = "Dienstlich: PLZ"; -$map['date_of_birth'] = "Date of Birth"; -$map['email'] = "Email"; -$map['home_mobile'] = "Home Mobile"; -$map['home_zip'] = "Home Zip"; -$map['info'] = "Info"; -$map['user_photo'] = "User Photo"; -$map['url'] = "URL"; -$map['work_city'] = "Work City"; -$map['work_company'] = "Work Company"; -$map['work_dept'] = "Work Dept"; -$map['work_fax'] = "Work Fax"; -$map['work_mobile'] = "Work Mobile"; -$map['work_state'] = "Work State"; -$map['work_title'] = "Work Title"; -$map['work_zip'] = "Work Zip"; +$map['anniversary'][] = "Jahrestag"; +$map['assistant'][] = "Name Assistent"; +$map['phone:assistant'][] = "Telefon Assistent"; +$map['birthday'][] = "Geburtstag"; +$map['locality:work'][] = "Ort geschäftlich"; +$map['country:work'][] = "Region geschäftlich"; +$map['phone:workfax'][] = "Fax geschäftlich"; +$map['phone:work'][] = "Telefon geschäftlich"; +$map['phone:work2'][] = "Telefon geschäftlich 2"; +$map['zipcode:work'][] = "Postleitzahl geschäftlich"; +$map['region:work'][] = "Land geschäftlich"; +$map['street:work'][] = "Straße geschäftlich"; +$map['phone:car'][] = "Autotelefon"; +$map['groups'][] = "Kategorien"; +$map['organization'][] = "Firma"; +$map['department'][] = "Abteilung"; +$map['email:other'][] = "E-Mail-Adresse"; +$map['firstname'][] = "Vorname"; +$map['gender'][] = "Geschlecht"; +$map['locality:home'][] = "Ort privat"; +$map['country:home'][] = "Region privat"; +$map['phone:homefax'][] = "Fax privat"; +$map['phone:home'][] = "Telefon privat"; +$map['phone:home2'][] = "Telefon privat 2"; +$map['zipcode:home'][] = "Postleitzahl privat"; +$map['region:home'][] = "Land privat"; +$map['street:home'][] = "Straße privat"; +$map['jobtitle'][] = "Position"; +$map['surname'][] = "Nachname"; +$map['manager'][] = "Manager's Name"; +$map['middlename'][] = "Weitere Vornamen"; +$map['phone:mobile'][] = "Mobiltelefon"; +$map['notes'][] = "Notizen"; +$map['locality:other'][] = "Weiterer Ort"; +$map['country:other'][] = "Weitere Region"; +$map['phone:other'][] = "Weiteres Fax"; +$map['phone:other'][] = "Weiteres Telefon"; +$map['zipcode:other'][] = "Weitere Postleitzahl"; +$map['region:other'][] = "Weiteres Land"; +$map['street:other'][] = "Weitere Straße"; +$map['phone:pager'][] = "Pager"; +$map['phone:main'][] = "Haupttelefon"; +$map['spouse'][] = "Spouse"; +$map['suffix'][] = "Suffix"; +$map['prefix'][] = "Title"; +$map['website:homepage'][] = "Webseite"; +$map['birthday-d'][] = "Geburtstag"; +$map['birthday-m'][] = "Geburtsmonat"; +$map['birthday-y'][] = "Geburtsjahr"; +$map['name'][] = "Anzeigename"; +$map['phone:homefax'][] = "Fax-Nummer"; +$map['street:home'][] = "Privat: Adresse"; +$map['country:home'][] = "Privat: Land"; +$map['zipcode:home'][] = "Privat: PLZ"; +$map['phone:mobile'][] = "Mobil-Tel.-Nr."; +$map['nickname'][] = "Spitzname"; +$map['organization'][] = "Organisation"; +$map['phone:pager'][] = "Pager-Nummer"; +$map['email:home'][] = "Primäre E-Mail-Adresse"; +$map['email:other'][] = "Sekundäre E-Mail-Adresse"; +$map['website:homepage'][] = "Webseite 1"; +$map['website:other'][] = "Webseite 2"; +$map['phone:work'][] = "Tel. dienstlich"; +$map['street:work'][] = "Dienstlich: Adresse"; +$map['country:work'][] = "Dienstlich: Land"; +$map['zipcode:work'][] = "Dienstlich: PLZ"; +$map['birthday'][] = "Date of Birth"; +$map['email:home'][] = "Email"; +$map['phone:mobile'][] = "Home Mobile"; +$map['zipcode:home'][] = "Home Zip"; +$map['notes'][] = "Info"; +$map['photo'][] = "User Photo"; +$map['website:homepage'][] = "URL"; +$map['locality:work'][] = "Work City"; +$map['organization'][] = "Work Company"; +$map['department'][] = "Work Dept"; +$map['phone:workfax'][] = "Work Fax"; +$map['phone:other'][] = "Work Mobile"; +$map['region:work'][] = "Work State"; +$map['jobtitle'][] = "Work Title"; +$map['zipcode:work'][] = "Work Zip"; diff --git a/program/localization/de_DE/csv2vcard.inc b/program/localization/de_DE/csv2vcard.inc index 73341f7514b..b4fd322e1f3 100644 --- a/program/localization/de_DE/csv2vcard.inc +++ b/program/localization/de_DE/csv2vcard.inc @@ -16,86 +16,86 @@ +-----------------------------------------------------------------------+ */ $map = array(); -$map['anniversary'] = "Jahrestag"; -$map['assistants_name'] = "Name Assistent"; -$map['assistants_phone'] = "Telefon Assistent"; -$map['birthday'] = "Geburtstag"; -$map['business_city'] = "Ort geschäftlich"; -$map['business_countryregion'] = "Region geschäftlich"; -$map['business_fax'] = "Fax geschäftlich"; -$map['business_phone'] = "Telefon geschäftlich"; -$map['business_phone_2'] = "Telefon geschäftlich 2"; -$map['business_postal_code'] = "Postleitzahl geschäftlich"; -$map['business_state'] = "Land geschäftlich"; -$map['business_street'] = "Straße geschäftlich"; -$map['car_phone'] = "Autotelefon"; -$map['categories'] = "Kategorien"; -$map['company'] = "Firma"; -$map['department'] = "Abteilung"; -$map['email_address'] = "E-Mail-Adresse"; -$map['email_2_address'] = "E-Mail 2: Adresse"; -$map['email_3_address'] = "E-Mail 3: Adresse"; -$map['first_name'] = "Vorname"; -$map['gender'] = "Geschlecht"; -$map['home_city'] = "Ort privat"; -$map['home_countryregion'] = "Region privat"; -$map['home_fax'] = "Fax privat"; -$map['home_phone'] = "Telefon privat"; -$map['home_phone_2'] = "Telefon privat 2"; -$map['home_postal_code'] = "Postleitzahl privat"; -$map['home_state'] = "Land privat"; -$map['home_street'] = "Straße privat"; -$map['job_title'] = "Position"; -$map['last_name'] = "Nachname"; -$map['managers_name'] = "Manager's Name"; -$map['middle_name'] = "Weitere Vornamen"; -$map['mobile_phone'] = "Mobiltelefon"; -$map['notes'] = "Notizen"; -$map['other_city'] = "Weiterer Ort"; -$map['other_countryregion'] = "Weitere Region"; -$map['other_fax'] = "Weiteres Fax"; -$map['other_phone'] = "Weiteres Telefon"; -$map['other_postal_code'] = "Weitere Postleitzahl"; -$map['other_state'] = "Weiteres Land"; -$map['other_street'] = "Weitere Straße"; -$map['pager'] = "Pager"; -$map['primary_phone'] = "Haupttelefon"; -$map['spouse'] = "Spouse"; -$map['suffix'] = "Suffix"; -$map['title'] = "Title"; -$map['web_page'] = "Webseite"; -$map['birth_day'] = "Geburtstag"; -$map['birth_month'] = "Geburtsmonat"; -$map['birth_year'] = "Geburtsjahr"; -$map['display_name'] = "Anzeigename"; -$map['fax_number'] = "Fax-Nummer"; -$map['home_address'] = "Privat: Adresse"; -$map['home_country'] = "Privat: Land"; -$map['home_zipcode'] = "Privat: PLZ"; -$map['mobile_number'] = "Mobil-Tel.-Nr."; -$map['nickname'] = "Spitzname"; -$map['organization'] = "Organisation"; -$map['pager_number'] = "Pager-Nummer"; -$map['primary_email'] = "Primäre E-Mail-Adresse"; -$map['secondary_email'] = "Sekundäre E-Mail-Adresse"; -$map['web_page_1'] = "Webseite 1"; -$map['web_page_2'] = "Webseite 2"; -$map['work_phone'] = "Tel. dienstlich"; -$map['work_address'] = "Dienstlich: Adresse"; -$map['work_country'] = "Dienstlich: Land"; -$map['work_zipcode'] = "Dienstlich: PLZ"; -$map['date_of_birth'] = "Date of Birth"; -$map['email'] = "Email"; -$map['home_mobile'] = "Home Mobile"; -$map['home_zip'] = "Home Zip"; -$map['info'] = "Info"; -$map['user_photo'] = "User Photo"; -$map['url'] = "URL"; -$map['work_city'] = "Work City"; -$map['work_company'] = "Work Company"; -$map['work_dept'] = "Work Dept"; -$map['work_fax'] = "Work Fax"; -$map['work_mobile'] = "Work Mobile"; -$map['work_state'] = "Work State"; -$map['work_title'] = "Work Title"; -$map['work_zip'] = "Work Zip"; +$map['anniversary'][] = "Jahrestag"; +$map['assistant'][] = "Name Assistent"; +$map['phone:assistant'][] = "Telefon Assistent"; +$map['birthday'][] = "Geburtstag"; +$map['locality:work'][] = "Ort geschäftlich"; +$map['country:work'][] = "Region geschäftlich"; +$map['phone:workfax'][] = "Fax geschäftlich"; +$map['phone:work'][] = "Telefon geschäftlich"; +$map['phone:work2'][] = "Telefon geschäftlich 2"; +$map['zipcode:work'][] = "Postleitzahl geschäftlich"; +$map['region:work'][] = "Land geschäftlich"; +$map['street:work'][] = "Straße geschäftlich"; +$map['phone:car'][] = "Autotelefon"; +$map['groups'][] = "Kategorien"; +$map['organization'][] = "Firma"; +$map['department'][] = "Abteilung"; +$map['email:other'][] = "E-Mail-Adresse"; +$map['email:other'][] = "E-Mail 2: Adresse"; +$map['email:other'][] = "E-Mail 3: Adresse"; +$map['firstname'][] = "Vorname"; +$map['gender'][] = "Geschlecht"; +$map['locality:home'][] = "Ort privat"; +$map['country:home'][] = "Region privat"; +$map['phone:homefax'][] = "Fax privat"; +$map['phone:home'][] = "Telefon privat"; +$map['phone:home2'][] = "Telefon privat 2"; +$map['zipcode:home'][] = "Postleitzahl privat"; +$map['region:home'][] = "Land privat"; +$map['street:home'][] = "Straße privat"; +$map['jobtitle'][] = "Position"; +$map['surname'][] = "Nachname"; +$map['manager'][] = "Manager's Name"; +$map['middlename'][] = "Weitere Vornamen"; +$map['phone:mobile'][] = "Mobiltelefon"; +$map['notes'][] = "Notizen"; +$map['locality:other'][] = "Weiterer Ort"; +$map['country:other'][] = "Weitere Region"; +$map['phone:other'][] = "Weiteres Fax"; +$map['phone:other'][] = "Weiteres Telefon"; +$map['zipcode:other'][] = "Weitere Postleitzahl"; +$map['region:other'][] = "Weiteres Land"; +$map['street:other'][] = "Weitere Straße"; +$map['phone:pager'][] = "Pager"; +$map['phone:main'][] = "Haupttelefon"; +$map['spouse'][] = "Spouse"; +$map['suffix'][] = "Suffix"; +$map['prefix'][] = "Title"; +$map['website:homepage'][] = "Webseite"; +$map['birthday-d'][] = "Geburtstag"; +$map['birthday-m'][] = "Geburtsmonat"; +$map['birthday-y'][] = "Geburtsjahr"; +$map['name'][] = "Anzeigename"; +$map['phone:homefax'][] = "Fax-Nummer"; +$map['street:home'][] = "Privat: Adresse"; +$map['country:home'][] = "Privat: Land"; +$map['zipcode:home'][] = "Privat: PLZ"; +$map['phone:mobile'][] = "Mobil-Tel.-Nr."; +$map['nickname'][] = "Spitzname"; +$map['organization'][] = "Organisation"; +$map['phone:pager'][] = "Pager-Nummer"; +$map['email:home'][] = "Primäre E-Mail-Adresse"; +$map['email:other'][] = "Sekundäre E-Mail-Adresse"; +$map['website:homepage'][] = "Webseite 1"; +$map['website:other'][] = "Webseite 2"; +$map['phone:work'][] = "Tel. dienstlich"; +$map['street:work'][] = "Dienstlich: Adresse"; +$map['country:work'][] = "Dienstlich: Land"; +$map['zipcode:work'][] = "Dienstlich: PLZ"; +$map['birthday'][] = "Date of Birth"; +$map['email:home'][] = "Email"; +$map['phone:mobile'][] = "Home Mobile"; +$map['zipcode:home'][] = "Home Zip"; +$map['notes'][] = "Info"; +$map['photo'][] = "User Photo"; +$map['website:homepage'][] = "URL"; +$map['locality:work'][] = "Work City"; +$map['organization'][] = "Work Company"; +$map['department'][] = "Work Dept"; +$map['phone:workfax'][] = "Work Fax"; +$map['phone:other'][] = "Work Mobile"; +$map['region:work'][] = "Work State"; +$map['jobtitle'][] = "Work Title"; +$map['zipcode:work'][] = "Work Zip"; diff --git a/program/localization/en_US/csv2vcard.inc b/program/localization/en_US/csv2vcard.inc index d398bd7f80c..80e9efd3bc8 100644 --- a/program/localization/en_US/csv2vcard.inc +++ b/program/localization/en_US/csv2vcard.inc @@ -19,119 +19,119 @@ $map = []; // MS Outlook 2010 -$map['anniversary'] = "Anniversary"; -$map['assistants_name'] = "Assistant's Name"; -$map['assistants_phone'] = "Assistant's Phone"; -$map['birthday'] = "Birthday"; -$map['business_city'] = "Business City"; -$map['business_countryregion'] = "Business Country/Region"; -$map['business_fax'] = "Business Fax"; -$map['business_phone'] = "Business Phone"; -$map['business_phone_2'] = "Business Phone 2"; -$map['business_postal_code'] = "Business Postal Code"; -$map['business_state'] = "Business State"; -$map['business_street'] = "Business Street"; -$map['car_phone'] = "Car Phone"; -$map['categories'] = "Categories"; -$map['company'] = "Company"; -$map['department'] = "Department"; -$map['email_address'] = "E-mail Address"; -$map['email_2_address'] = "E-mail 2 Address"; -$map['email_3_address'] = "E-mail 3 Address"; -$map['first_name'] = "First Name"; -$map['gender'] = "Gender"; -$map['home_city'] = "Home City"; -$map['home_countryregion'] = "Home Country/Region"; -$map['home_fax'] = "Home Fax"; -$map['home_phone'] = "Home Phone"; -$map['home_phone_2'] = "Home Phone 2"; -$map['home_postal_code'] = "Home Postal Code"; -$map['home_state'] = "Home State"; -$map['home_street'] = "Home Street"; -$map['job_title'] = "Job Title"; -$map['last_name'] = "Last Name"; -$map['managers_name'] = "Manager's Name"; -$map['middle_name'] = "Middle Name"; -$map['mobile_phone'] = "Mobile Phone"; -$map['notes'] = "Notes"; -$map['other_city'] = "Other City"; -$map['other_countryregion'] = "Other Country/Region"; -$map['other_fax'] = "Other Fax"; -$map['other_phone'] = "Other Phone"; -$map['other_postal_code'] = "Other Postal Code"; -$map['other_state'] = "Other State"; -$map['other_street'] = "Other Street"; -$map['pager'] = "Pager"; -$map['primary_phone'] = "Primary Phone"; -$map['spouse'] = "Spouse"; -$map['suffix'] = "Suffix"; -$map['title'] = "Title"; -$map['web_page'] = "Web Page"; +$map['anniversary'][] = "Anniversary"; +$map['assistant'][] = "Assistant's Name"; +$map['phone:assistant'][] = "Assistant's Phone"; +$map['birthday'][] = "Birthday"; +$map['locality:work'][] = "Business City"; +$map['country:work'][] = "Business Country/Region"; +$map['phone:workfax'][] = "Business Fax"; +$map['phone:work'][] = "Business Phone"; +$map['phone:work2'][] = "Business Phone 2"; +$map['zipcode:work'][] = "Business Postal Code"; +$map['region:work'][] = "Business State"; +$map['street:work'][] = "Business Street"; +$map['phone:car'][] = "Car Phone"; +$map['groups'][] = "Categories"; +$map['organization'][] = "Company"; +$map['department'][] = "Department"; +$map['email:other'][] = "E-mail Address"; +$map['email:other'][] = "E-mail 2 Address"; +$map['email:other'][] = "E-mail 3 Address"; +$map['firstname'][] = "First Name"; +$map['gender'][] = "Gender"; +$map['locality:home'][] = "Home City"; +$map['country:home'][] = "Home Country/Region"; +$map['phone:homefax'][] = "Home Fax"; +$map['phone:home'][] = "Home Phone"; +$map['phone:home2'][] = "Home Phone 2"; +$map['zipcode:home'][] = "Home Postal Code"; +$map['region:home'][] = "Home State"; +$map['street:home'][] = "Home Street"; +$map['jobtitle'][] = "Job Title"; +$map['surname'][] = "Last Name"; +$map['manager'][] = "Manager's Name"; +$map['middlename'][] = "Middle Name"; +$map['phone:mobile'][] = "Mobile Phone"; +$map['notes'][] = "Notes"; +$map['locality:other'][] = "Other City"; +$map['country:other'][] = "Other Country/Region"; +$map['phone:other'][] = "Other Fax"; +$map['phone:other'][] = "Other Phone"; +$map['zipcode:other'][] = "Other Postal Code"; +$map['region:other'][] = "Other State"; +$map['street:other'][] = "Other Street"; +$map['phone:pager'][] = "Pager"; +$map['phone:main'][] = "Primary Phone"; +$map['spouse'][] = "Spouse"; +$map['suffix'][] = "Suffix"; +$map['prefix'][] = "Title"; +$map['website:homepage'][] = "Web Page"; // Thunderbird -$map['birth_day'] = "Birth Day"; -$map['birth_month'] = "Birth Month"; -$map['birth_year'] = "Birth Year"; -$map['display_name'] = "Display Name"; -$map['fax_number'] = "Fax Number"; -$map['home_address'] = "Home Address"; -$map['home_country'] = "Home Country"; -$map['home_zipcode'] = "Home ZipCode"; -$map['mobile_number'] = "Mobile Number"; -$map['nickname'] = "Nickname"; -$map['organization'] = "Organization"; -$map['pager_number'] = "Pager Number"; -$map['primary_email'] = "Primary Email"; -$map['secondary_email'] = "Secondary Email"; -$map['web_page_1'] = "Web Page 1"; -$map['web_page_2'] = "Web Page 2"; -$map['work_phone'] = "Work Phone"; -$map['work_address'] = "Work Address"; -$map['work_country'] = "Work Country"; -$map['work_zipcode'] = "Work ZipCode"; +$map['birthday-d'][] = "Birth Day"; +$map['birthday-m'][] = "Birth Month"; +$map['birthday-y'][] = "Birth Year"; +$map['name'][] = "Display Name"; +$map['phone:homefax'][] = "Fax Number"; +$map['street:home'][] = "Home Address"; +$map['country:home'][] = "Home Country"; +$map['zipcode:home'][] = "Home ZipCode"; +$map['phone:mobile'][] = "Mobile Number"; +$map['nickname'][] = "Nickname"; +$map['organization'][] = "Organization"; +$map['phone:pager'][] = "Pager Number"; +$map['email:home'][] = "Primary Email"; +$map['email:other'][] = "Secondary Email"; +$map['website:homepage'][] = "Web Page 1"; +$map['website:other'][] = "Web Page 2"; +$map['phone:work'][] = "Work Phone"; +$map['street:work'][] = "Work Address"; +$map['country:work'][] = "Work Country"; +$map['zipcode:work'][] = "Work ZipCode"; // Atmail -$map['date_of_birth'] = "Date of Birth"; -$map['email'] = "Email"; -$map['home_mobile'] = "Home Mobile"; -$map['home_zip'] = "Home Zip"; -$map['info'] = "Info"; -$map['user_photo'] = "User Photo"; -$map['url'] = "URL"; -$map['work_city'] = "Work City"; -$map['work_company'] = "Work Company"; -$map['work_dept'] = "Work Dept"; -$map['work_fax'] = "Work Fax"; -$map['work_mobile'] = "Work Mobile"; -$map['work_state'] = "Work State"; -$map['work_title'] = "Work Title"; -$map['work_zip'] = "Work Zip"; -$map['group'] = "Group"; +$map['birthday'][] = "Date of Birth"; +$map['email:home'][] = "Email"; +$map['phone:mobile'][] = "Home Mobile"; +$map['zipcode:home'][] = "Home Zip"; +$map['notes'][] = "Info"; +$map['photo'][] = "User Photo"; +$map['website:homepage'][] = "URL"; +$map['locality:work'][] = "Work City"; +$map['organization'][] = "Work Company"; +$map['department'][] = "Work Dept"; +$map['phone:workfax'][] = "Work Fax"; +$map['phone:other'][] = "Work Mobile"; +$map['region:work'][] = "Work State"; +$map['jobtitle'][] = "Work Title"; +$map['zipcode:work'][] = "Work Zip"; +$map['groups'][] = "Group"; // GMail -$map['groups'] = "Groups"; -$map['group_membership'] = "Group Membership"; -$map['given_name'] = "Given Name"; -$map['additional_name'] = "Additional Name"; -$map['family_name'] = "Family Name"; -$map['name'] = "Name"; -$map['name_prefix'] = "Name Prefix"; -$map['name_suffix'] = "Name Suffix"; +$map['groups'][] = "Groups"; +$map['groups'][] = "Group Membership"; +$map['firstname'][] = "Given Name"; +$map['middlename'][] = "Additional Name"; +$map['surname'][] = "Family Name"; +$map['name'][] = "Name"; +$map['prefix'][] = "Name Prefix"; +$map['suffix'][] = "Name Suffix"; // Roundcube fields -$map['email_home'] = "Email Home"; -$map['email_work'] = "Email Work"; -$map['email_other'] = "Email Other"; -$map['phone_video'] = "Phone Video"; -$map['maidenname'] = "Maiden Name"; -$map['im_aim'] = "IM Aim"; -$map['im_icq'] = "IM Icq"; -$map['im_jabber'] = "IM Jabber"; -$map['im_msn'] = "IM Msn"; -$map['im_skype'] = "IM Skype"; -$map['im_yahoo'] = "IM Yahoo"; -$map['web_blog'] = "Website Blog"; -$map['web_home'] = "Website Home Page"; -$map['web_other'] = "Website Other"; -$map['web_profile'] = "Website Profile"; -$map['web_work'] = "Website Work"; +$map['email:home'][] = "Email Home"; +$map['email:work'][] = "Email Work"; +$map['email:other'][] = "Email Other"; +$map['phone:video'][] = "Phone Video"; +$map['maidenname'][] = "Maiden Name"; +$map['im:aim'][] = "IM Aim"; +$map['im:icq'][] = "IM Icq"; +$map['im:jabber'][] = "IM Jabber"; +$map['im:msn'][] = "IM Msn"; +$map['im:skype'][] = "IM Skype"; +$map['im:yahoo'][] = "IM Yahoo"; +$map['website:blog'][] = "Website Blog"; +$map['website:homepage'][] = "Website Home Page"; +$map['website:other'][] = "Website Other"; +$map['website:profile'][] = "Website Profile"; +$map['website:work'][] = "Website Work"; diff --git a/program/localization/es_ES/csv2vcard.inc b/program/localization/es_ES/csv2vcard.inc index f5536d59e31..f4d712a0d2c 100644 --- a/program/localization/es_ES/csv2vcard.inc +++ b/program/localization/es_ES/csv2vcard.inc @@ -16,86 +16,86 @@ +-----------------------------------------------------------------------+ */ $map = array(); -$map['anniversary'] = "Anniversary"; -$map['assistants_name'] = "Assistant's Name"; -$map['assistants_phone'] = "Assistant's Phone"; -$map['birthday'] = "Birthday"; -$map['business_city'] = "Ciudad de trabajo"; -$map['business_countryregion'] = "Provincia o estado de trabajo"; -$map['business_fax'] = "Business Fax"; -$map['business_phone'] = "Teléfono del trabajo"; -$map['business_phone_2'] = "Business Phone 2"; -$map['business_postal_code'] = "Código postal del trabajo"; -$map['business_state'] = "País o región del trabajo"; -$map['business_street'] = "Calle del trabajo"; -$map['car_phone'] = "Car Phone"; -$map['categories'] = "Categorías"; -$map['company'] = "Organización"; -$map['department'] = "Department"; -$map['email_address'] = "E-mail Address"; -$map['email_2_address'] = "Dirección de correo electrónico 2"; -$map['email_3_address'] = "Dirección del correo electrónico 3"; -$map['first_name'] = "Nombre"; -$map['gender'] = "Género"; -$map['home_city'] = "Home City"; -$map['home_countryregion'] = "País o región del domicilio"; -$map['home_fax'] = "Home Fax"; -$map['home_phone'] = "Particular"; -$map['home_phone_2'] = "Home Phone 2"; -$map['home_postal_code'] = "Home Postal Code"; -$map['home_state'] = "Home State"; -$map['home_street'] = "Home Street"; -$map['job_title'] = "Puesto"; -$map['last_name'] = "Apellidos"; -$map['managers_name'] = "Nombre del director"; -$map['middle_name'] = "Segundo nombre"; -$map['mobile_phone'] = "Mobile Phone"; -$map['notes'] = "Notes"; -$map['other_city'] = "Otra ciudad"; -$map['other_countryregion'] = "Otra provincia o estado"; -$map['other_fax'] = "Otro fax"; -$map['other_phone'] = "Otro teléfono"; -$map['other_postal_code'] = "Otro código postal"; -$map['other_state'] = "Otro país o región"; -$map['other_street'] = "Otra calle"; -$map['pager'] = "Pager"; -$map['primary_phone'] = "Teléfono principal"; -$map['spouse'] = "Spouse"; -$map['suffix'] = "Suffix"; -$map['title'] = "Title"; -$map['web_page'] = "Página web"; -$map['birth_day'] = "Día de nacimiento"; -$map['birth_month'] = "Mes de nacimiento"; -$map['birth_year'] = "Año de nacimiento"; -$map['display_name'] = "Nombre en pantalla"; -$map['fax_number'] = "Fax"; -$map['home_address'] = "Dirección personal"; -$map['home_country'] = "País de residencia"; -$map['home_zipcode'] = "Código postal"; -$map['mobile_number'] = "Teléfono móvil"; -$map['nickname'] = "Apodo"; -$map['organization'] = "Organización"; -$map['pager_number'] = "Buscapersonas"; -$map['primary_email'] = "Dirección de correo electrónico principal"; -$map['secondary_email'] = "Dirección de correo electrónico secundaria"; -$map['web_page_1'] = "Página web 1"; -$map['web_page_2'] = "Página web 2"; -$map['work_phone'] = "Teléfono (Trabajo)"; -$map['work_address'] = "Dirección de trabajo"; -$map['work_country'] = "País (Trabajo)"; -$map['work_zipcode'] = "Código postal (Trabajo)"; -$map['date_of_birth'] = "Date of Birth"; -$map['email'] = "Email"; -$map['home_mobile'] = "Home Mobile"; -$map['home_zip'] = "Home Zip"; -$map['info'] = "Info"; -$map['user_photo'] = "User Photo"; -$map['url'] = "URL"; -$map['work_city'] = "Work City"; -$map['work_company'] = "Work Company"; -$map['work_dept'] = "Work Dept"; -$map['work_fax'] = "Work Fax"; -$map['work_mobile'] = "Work Mobile"; -$map['work_state'] = "Work State"; -$map['work_title'] = "Work Title"; -$map['work_zip'] = "Work Zip"; +$map['anniversary'][] = "Anniversary"; +$map['assistant'][] = "Assistant's Name"; +$map['phone:assistant'][] = "Assistant's Phone"; +$map['birthday'][] = "Birthday"; +$map['locality:work'][] = "Ciudad de trabajo"; +$map['country:work'][] = "Provincia o estado de trabajo"; +$map['phone:workfax'][] = "Business Fax"; +$map['phone:work'][] = "Teléfono del trabajo"; +$map['phone:work2'][] = "Business Phone 2"; +$map['zipcode:work'][] = "Código postal del trabajo"; +$map['region:work'][] = "País o región del trabajo"; +$map['street:work'][] = "Calle del trabajo"; +$map['phone:car'][] = "Car Phone"; +$map['groups'][] = "Categorías"; +$map['organization'][] = "Organización"; +$map['department'][] = "Department"; +$map['email:other'][] = "E-mail Address"; +$map['email:other'][] = "Dirección de correo electrónico 2"; +$map['email:other'][] = "Dirección del correo electrónico 3"; +$map['firstname'][] = "Nombre"; +$map['gender'][] = "Género"; +$map['locality:home'][] = "Home City"; +$map['country:home'][] = "País o región del domicilio"; +$map['phone:homefax'][] = "Home Fax"; +$map['phone:home'][] = "Particular"; +$map['phone:home2'][] = "Home Phone 2"; +$map['zipcode:home'][] = "Home Postal Code"; +$map['region:home'][] = "Home State"; +$map['street:home'][] = "Home Street"; +$map['jobtitle'][] = "Puesto"; +$map['surname'][] = "Apellidos"; +$map['manager'][] = "Nombre del director"; +$map['middlename'][] = "Segundo nombre"; +$map['phone:mobile'][] = "Mobile Phone"; +$map['notes'][] = "Notes"; +$map['locality:other'][] = "Otra ciudad"; +$map['country:other'][] = "Otra provincia o estado"; +$map['phone:other'][] = "Otro fax"; +$map['phone:other'][] = "Otro teléfono"; +$map['zipcode:other'][] = "Otro código postal"; +$map['region:other'][] = "Otro país o región"; +$map['street:other'][] = "Otra calle"; +$map['phone:pager'][] = "Pager"; +$map['phone:main'][] = "Teléfono principal"; +$map['spouse'][] = "Spouse"; +$map['suffix'][] = "Suffix"; +$map['prefix'][] = "Title"; +$map['website:homepage'][] = "Página web"; +$map['birthday-d'][] = "Día de nacimiento"; +$map['birthday-m'][] = "Mes de nacimiento"; +$map['birthday-y'][] = "Año de nacimiento"; +$map['name'][] = "Nombre en pantalla"; +$map['phone:homefax'][] = "Fax"; +$map['street:home'][] = "Dirección personal"; +$map['country:home'][] = "País de residencia"; +$map['zipcode:home'][] = "Código postal"; +$map['phone:mobile'][] = "Teléfono móvil"; +$map['nickname'][] = "Apodo"; +$map['organization'][] = "Organización"; +$map['phone:pager'][] = "Buscapersonas"; +$map['email:home'][] = "Dirección de correo electrónico principal"; +$map['email:other'][] = "Dirección de correo electrónico secundaria"; +$map['website:homepage'][] = "Página web 1"; +$map['website:other'][] = "Página web 2"; +$map['phone:work'][] = "Teléfono (Trabajo)"; +$map['street:work'][] = "Dirección de trabajo"; +$map['country:work'][] = "País (Trabajo)"; +$map['zipcode:work'][] = "Código postal (Trabajo)"; +$map['birthday'][] = "Date of Birth"; +$map['email:home'][] = "Email"; +$map['phone:mobile'][] = "Home Mobile"; +$map['zipcode:home'][] = "Home Zip"; +$map['notes'][] = "Info"; +$map['photo'][] = "User Photo"; +$map['website:homepage'][] = "URL"; +$map['locality:work'][] = "Work City"; +$map['organization'][] = "Work Company"; +$map['department'][] = "Work Dept"; +$map['phone:workfax'][] = "Work Fax"; +$map['phone:other'][] = "Work Mobile"; +$map['region:work'][] = "Work State"; +$map['jobtitle'][] = "Work Title"; +$map['zipcode:work'][] = "Work Zip"; diff --git a/program/localization/fi_FI/csv2vcard.inc b/program/localization/fi_FI/csv2vcard.inc index e0ab1f98886..56e2371f9a8 100644 --- a/program/localization/fi_FI/csv2vcard.inc +++ b/program/localization/fi_FI/csv2vcard.inc @@ -16,34 +16,34 @@ +-----------------------------------------------------------------------+ */ $map = array(); -$map['display_name'] = "Näyttönimi"; -$map['first_name'] = "Etunimi"; -$map['last_name'] = "Sukunimi"; -$map['home_phone'] = "Kotipuhelin"; -$map['home_city'] = "Kotikaupunki"; -$map['home_state'] = "Kodin lääni"; -$map['business_city'] = "Työpaikan kaupunki"; -$map['business_state'] = "Työpaikan lääni"; -$map['job_title'] = "Ammattinimi"; -$map['department'] = "Osasto"; -$map['notes'] = "Muistiinpanot"; -$map['birth_day'] = "Syntymäpäivä"; -$map['birth_month'] = "Syntymäkuukausi"; -$map['birth_year'] = "Syntymävuosi"; -$map['display_name'] = "Näytettävä nimi"; -$map['fax_number'] = "Faksin numero"; -$map['nickname'] = "Lempinimi"; -$map['primary_email'] = "Ensisijainen sähköposti"; -$map['secondary_email'] = "Toissijainen sähköposti"; -$map['work_phone'] = "Työpuhelin"; -$map['pager_number'] = "Hakulaitteen numero"; -$map['mobile_number'] = "Matkapuhelinnumero"; -$map['home_address'] = "Kotiosoite"; -$map['home_zipcode'] = "Kodin postinumero"; -$map['home_country'] = "Kotimaa"; -$map['work_address'] = "Työosoite"; -$map['work_zipcode'] = "Työpaikan postinumero"; -$map['work_country'] = "Työpaikan maa"; -$map['organization'] = "Järjestö"; -$map['web_page_1'] = "Verkkosivu 1"; -$map['web_page_2'] = "Verkkosivu 2"; +$map['name'][] = "Näyttönimi"; +$map['firstname'][] = "Etunimi"; +$map['surname'][] = "Sukunimi"; +$map['phone:home'][] = "Kotipuhelin"; +$map['locality:home'][] = "Kotikaupunki"; +$map['region:home'][] = "Kodin lääni"; +$map['locality:work'][] = "Työpaikan kaupunki"; +$map['region:work'][] = "Työpaikan lääni"; +$map['jobtitle'][] = "Ammattinimi"; +$map['department'][] = "Osasto"; +$map['notes'][] = "Muistiinpanot"; +$map['birthday-d'][] = "Syntymäpäivä"; +$map['birthday-m'][] = "Syntymäkuukausi"; +$map['birthday-y'][] = "Syntymävuosi"; +$map['name'][] = "Näytettävä nimi"; +$map['phone:homefax'][] = "Faksin numero"; +$map['nickname'][] = "Lempinimi"; +$map['email:home'][] = "Ensisijainen sähköposti"; +$map['email:other'][] = "Toissijainen sähköposti"; +$map['phone:work'][] = "Työpuhelin"; +$map['phone:pager'][] = "Hakulaitteen numero"; +$map['phone:mobile'][] = "Matkapuhelinnumero"; +$map['street:home'][] = "Kotiosoite"; +$map['zipcode:home'][] = "Kodin postinumero"; +$map['country:home'][] = "Kotimaa"; +$map['street:work'][] = "Työosoite"; +$map['zipcode:work'][] = "Työpaikan postinumero"; +$map['country:work'][] = "Työpaikan maa"; +$map['organization'][] = "Järjestö"; +$map['website:homepage'][] = "Verkkosivu 1"; +$map['website:other'][] = "Verkkosivu 2"; diff --git a/program/localization/fr_FR/csv2vcard.inc b/program/localization/fr_FR/csv2vcard.inc index d28df7a8aae..3c68d60298b 100644 --- a/program/localization/fr_FR/csv2vcard.inc +++ b/program/localization/fr_FR/csv2vcard.inc @@ -16,70 +16,70 @@ +-----------------------------------------------------------------------+ */ $map = array(); -$map['anniversary'] = "Anniversaire de mariage ou fête"; -$map['assistants_name'] = "Nom de l''assistant(e)"; -$map['assistants_phone'] = "Téléphone de l''assistant(e)"; -$map['birthday'] = "Anniversaire"; -$map['business_city'] = "Ville (bureau)"; -$map['business_countryregion'] = "Pays/Région (bureau)"; -$map['business_fax'] = "Télécopie (bureau)"; -$map['business_phone'] = "Téléphone (bureau)"; -$map['business_phone_2'] = "Téléphone 2 (bureau)"; -$map['business_postal_code'] = "Code postal (bureau)"; -$map['business_state'] = "Dép/Région (bureau)"; -$map['business_street'] = "Rue (bureau)"; -$map['car_phone'] = "Téléphone (voiture)"; -$map['categories'] = "Catégories"; -$map['company'] = "Société"; -$map['department'] = "Service"; -$map['email_address'] = "Adresse de messagerie"; -$map['first_name'] = "Prénom"; -$map['gender'] = "Sexe"; -$map['home_city'] = "Ville (domicile)"; -$map['home_countryregion'] = "Pays/Région (domicile)"; -$map['home_fax'] = "Télécopie (domicile)"; -$map['home_phone'] = "Téléphone (domicile)"; -$map['home_phone_2'] = "Téléphone 2 (domicile)"; -$map['home_postal_code'] = "Code postal (domicile)"; -$map['home_state'] = "Dép/Région (domicile)"; -$map['home_street'] = "Rue (domicile)"; -$map['job_title'] = "Profession"; -$map['last_name'] = "Nom"; -$map['managers_name'] = "Manager's Name"; -$map['middle_name'] = "Deuxième prénom"; -$map['mobile_phone'] = "Tél. mobile"; -$map['notes'] = "Notes"; -$map['other_city'] = "Ville (autre)"; -$map['other_countryregion'] = "Pays/Région (autre)"; -$map['other_fax'] = "Télécopie (autre)"; -$map['other_phone'] = "Téléphone (autre)"; -$map['other_postal_code'] = "Code postal (autre)"; -$map['other_state'] = "Dép/Région (autre)"; -$map['other_street'] = "Rue (autre)"; -$map['pager'] = "Récepteur de radiomessagerie"; -$map['primary_phone'] = "Téléphone principal"; -$map['spouse'] = "Conjoint(e)"; -$map['suffix'] = "Suffixe"; -$map['title'] = "Titre"; -$map['web_page'] = "Page Web"; -$map['birth_day'] = "Jour"; -$map['birth_month'] = "Mois"; -$map['birth_year'] = "Année de naissance"; -$map['display_name'] = "Nom à afficher"; -$map['fax_number'] = "Fax"; -$map['home_address'] = "Adresse privée"; -$map['home_country'] = "Région"; -$map['home_zipcode'] = "Code postal"; -$map['mobile_number'] = "Portable"; -$map['nickname'] = "Surnom"; -$map['organization'] = "Société"; -$map['pager_number'] = "Pager"; -$map['primary_email'] = "Adresse électronique principale"; -$map['secondary_email'] = "Adresse électronique secondaire"; -$map['web_page_1'] = "Site Web 1"; -$map['web_page_2'] = "Site Web 2"; -$map['work_phone'] = "Tél. professionnel"; -$map['work_address'] = "Adresse professionnelle"; -$map['work_country'] = "Région"; -$map['work_zipcode'] = "Code postal"; +$map['anniversary'][] = "Anniversaire de mariage ou fête"; +$map['assistant'][] = "Nom de l''assistant(e)"; +$map['phone:assistant'][] = "Téléphone de l''assistant(e)"; +$map['birthday'][] = "Anniversaire"; +$map['locality:work'][] = "Ville (bureau)"; +$map['country:work'][] = "Pays/Région (bureau)"; +$map['phone:workfax'][] = "Télécopie (bureau)"; +$map['phone:work'][] = "Téléphone (bureau)"; +$map['phone:work2'][] = "Téléphone 2 (bureau)"; +$map['zipcode:work'][] = "Code postal (bureau)"; +$map['region:work'][] = "Dép/Région (bureau)"; +$map['street:work'][] = "Rue (bureau)"; +$map['phone:car'][] = "Téléphone (voiture)"; +$map['groups'][] = "Catégories"; +$map['organization'][] = "Société"; +$map['department'][] = "Service"; +$map['email:other'][] = "Adresse de messagerie"; +$map['firstname'][] = "Prénom"; +$map['gender'][] = "Sexe"; +$map['locality:home'][] = "Ville (domicile)"; +$map['country:home'][] = "Pays/Région (domicile)"; +$map['phone:homefax'][] = "Télécopie (domicile)"; +$map['phone:home'][] = "Téléphone (domicile)"; +$map['phone:home2'][] = "Téléphone 2 (domicile)"; +$map['zipcode:home'][] = "Code postal (domicile)"; +$map['region:home'][] = "Dép/Région (domicile)"; +$map['street:home'][] = "Rue (domicile)"; +$map['jobtitle'][] = "Profession"; +$map['surname'][] = "Nom"; +$map['manager'][] = "Manager's Name"; +$map['middlename'][] = "Deuxième prénom"; +$map['phone:mobile'][] = "Tél. mobile"; +$map['notes'][] = "Notes"; +$map['locality:other'][] = "Ville (autre)"; +$map['country:other'][] = "Pays/Région (autre)"; +$map['phone:other'][] = "Télécopie (autre)"; +$map['phone:other'][] = "Téléphone (autre)"; +$map['zipcode:other'][] = "Code postal (autre)"; +$map['region:other'][] = "Dép/Région (autre)"; +$map['street:other'][] = "Rue (autre)"; +$map['phone:pager'][] = "Récepteur de radiomessagerie"; +$map['phone:main'][] = "Téléphone principal"; +$map['spouse'][] = "Conjoint(e)"; +$map['suffix'][] = "Suffixe"; +$map['prefix'][] = "Titre"; +$map['website:homepage'][] = "Page Web"; +$map['birthday-d'][] = "Jour"; +$map['birthday-m'][] = "Mois"; +$map['birthday-y'][] = "Année de naissance"; +$map['name'][] = "Nom à afficher"; +$map['phone:homefax'][] = "Fax"; +$map['street:home'][] = "Adresse privée"; +$map['country:home'][] = "Région"; +$map['zipcode:home'][] = "Code postal"; +$map['phone:mobile'][] = "Portable"; +$map['nickname'][] = "Surnom"; +$map['organization'][] = "Société"; +$map['phone:pager'][] = "Pager"; +$map['email:home'][] = "Adresse électronique principale"; +$map['email:other'][] = "Adresse électronique secondaire"; +$map['website:homepage'][] = "Site Web 1"; +$map['website:other'][] = "Site Web 2"; +$map['phone:work'][] = "Tél. professionnel"; +$map['street:work'][] = "Adresse professionnelle"; +$map['country:work'][] = "Région"; +$map['zipcode:work'][] = "Code postal"; $map['_home_city'] = "Ville"; diff --git a/program/localization/it_IT/csv2vcard.inc b/program/localization/it_IT/csv2vcard.inc index 75b6fdb108d..ae690cfce66 100644 --- a/program/localization/it_IT/csv2vcard.inc +++ b/program/localization/it_IT/csv2vcard.inc @@ -16,86 +16,86 @@ +-----------------------------------------------------------------------+ */ $map = array(); -$map['anniversary'] = "Anniversario"; -$map['assistants_name'] = "Nome dell'assistente"; -$map['assistants_phone'] = "Telefono dell'assistente"; -$map['birthday'] = "Compleanno"; -$map['business_city'] = "Città di lavoro"; -$map['business_countryregion'] = "Nazione/Regione di lavoro"; -$map['business_fax'] = "Fax di Lavoro"; -$map['business_phone'] = "Telefono di Lavoro"; -$map['business_phone_2'] = "Telefono di Lavoro 2"; -$map['business_postal_code'] = "CAP di Lavoro"; -$map['business_state'] = "Provincia di lavoro"; -$map['business_street'] = "Indirizzo di lavoro"; -$map['car_phone'] = "Telefono dell'Auto"; -$map['categories'] = "Categorie"; -$map['company'] = "Società"; -$map['department'] = "Reparto"; -$map['email_address'] = "Indirizzo E-mail"; -$map['email_2_address'] = "Indirizzo E-mail 2"; -$map['email_3_address'] = "Indirizzo E-mail 3"; -$map['first_name'] = "Nome"; -$map['gender'] = "Genere"; -$map['home_city'] = "Città di residenza"; -$map['home_countryregion'] = "Nazione/Regione di casa"; -$map['home_fax'] = "Fax di casa"; -$map['home_phone'] = "Telefono di casa"; -$map['home_phone_2'] = "Telefono di casa 2"; -$map['home_postal_code'] = "CAP di casa"; -$map['home_state'] = "Provincia di residenza"; -$map['home_street'] = "Indirizzo di casa"; -$map['job_title'] = "Qualifica"; -$map['last_name'] = "Cognome"; -$map['managers_name'] = "Nome del Responsabile"; -$map['middle_name'] = "Secondo Nome"; -$map['mobile_phone'] = "Telefono Mobile"; -$map['notes'] = "Note"; -$map['other_city'] = "Città Altro"; -$map['other_countryregion'] = "Nazione/Regione Altro"; -$map['other_fax'] = "Fax Altro"; -$map['other_phone'] = "Phone Altro"; -$map['other_postal_code'] = "CAP Postale Altro"; -$map['other_state'] = "Stato Altro"; -$map['other_street'] = "Via Altro"; -$map['pager'] = "Numero cercapersone"; -$map['primary_phone'] = "Telefono Principale"; -$map['spouse'] = "Coniuge"; -$map['suffix'] = "Suffisso"; -$map['title'] = "Titolo"; -$map['web_page'] = "Pagina Web"; -$map['birth_day'] = "Giorno di nascita"; -$map['birth_month'] = "Mese di nascita"; -$map['birth_year'] = "Anno di nascita"; -$map['display_name'] = "Nome visualizzato"; -$map['fax_number'] = "Numero fax"; -$map['home_address'] = "Indirizzo di casa 2"; -$map['home_country'] = "Nazione di residenza"; -$map['home_zipcode'] = "CAP di residenza"; -$map['mobile_number'] = "Numero cellulare"; -$map['nickname'] = "Soprannome"; -$map['organization'] = "Organizzazione"; -$map['pager_number'] = "Numero Pager"; -$map['primary_email'] = "Email principale"; -$map['secondary_email'] = "Email secondaria"; -$map['web_page_1'] = "Pagina web 1"; -$map['web_page_2'] = "Pagina web 2"; -$map['work_phone'] = "Telefono lavoro"; -$map['work_address'] = "Indirizzo di lavoro 2"; -$map['work_country'] = "Nazione di lavoro"; -$map['work_zipcode'] = "CAP di lavoro"; -$map['date_of_birth'] = "Data di Nascita"; -$map['email'] = "Email"; -$map['home_mobile'] = "Cellulare di Casa"; -$map['home_zip'] = "CAP di casa"; -$map['info'] = "Info"; -$map['user_photo'] = "Foto"; -$map['url'] = "URL"; -$map['work_city'] = "Città di Lavoro"; -$map['work_company'] = "Società di lavoro"; -$map['work_dept'] = "Reparto di lavoro"; -$map['work_fax'] = "Fax di lavoro"; -$map['work_mobile'] = "Cellulare di lavoro"; -$map['work_state'] = "Nazione/Regione di lavoro"; -$map['work_title'] = "Titolo di lavoro"; -$map['work_zip'] = "CAP di lavoro"; +$map['anniversary'][] = "Anniversario"; +$map['assistant'][] = "Nome dell'assistente"; +$map['phone:assistant'][] = "Telefono dell'assistente"; +$map['birthday'][] = "Compleanno"; +$map['locality:work'][] = "Città di lavoro"; +$map['country:work'][] = "Nazione/Regione di lavoro"; +$map['phone:workfax'][] = "Fax di Lavoro"; +$map['phone:work'][] = "Telefono di Lavoro"; +$map['phone:work2'][] = "Telefono di Lavoro 2"; +$map['zipcode:work'][] = "CAP di Lavoro"; +$map['region:work'][] = "Provincia di lavoro"; +$map['street:work'][] = "Indirizzo di lavoro"; +$map['phone:car'][] = "Telefono dell'Auto"; +$map['groups'][] = "Categorie"; +$map['organization'][] = "Società"; +$map['department'][] = "Reparto"; +$map['email:other'][] = "Indirizzo E-mail"; +$map['email:other'][] = "Indirizzo E-mail 2"; +$map['email:other'][] = "Indirizzo E-mail 3"; +$map['firstname'][] = "Nome"; +$map['gender'][] = "Genere"; +$map['locality:home'][] = "Città di residenza"; +$map['country:home'][] = "Nazione/Regione di casa"; +$map['phone:homefax'][] = "Fax di casa"; +$map['phone:home'][] = "Telefono di casa"; +$map['phone:home2'][] = "Telefono di casa 2"; +$map['zipcode:home'][] = "CAP di casa"; +$map['region:home'][] = "Provincia di residenza"; +$map['street:home'][] = "Indirizzo di casa"; +$map['jobtitle'][] = "Qualifica"; +$map['surname'][] = "Cognome"; +$map['manager'][] = "Nome del Responsabile"; +$map['middlename'][] = "Secondo Nome"; +$map['phone:mobile'][] = "Telefono Mobile"; +$map['notes'][] = "Note"; +$map['locality:other'][] = "Città Altro"; +$map['country:other'][] = "Nazione/Regione Altro"; +$map['phone:other'][] = "Fax Altro"; +$map['phone:other'][] = "Phone Altro"; +$map['zipcode:other'][] = "CAP Postale Altro"; +$map['region:other'][] = "Stato Altro"; +$map['street:other'][] = "Via Altro"; +$map['phone:pager'][] = "Numero cercapersone"; +$map['phone:main'][] = "Telefono Principale"; +$map['spouse'][] = "Coniuge"; +$map['suffix'][] = "Suffisso"; +$map['prefix'][] = "Titolo"; +$map['website:homepage'][] = "Pagina Web"; +$map['birthday-d'][] = "Giorno di nascita"; +$map['birthday-m'][] = "Mese di nascita"; +$map['birthday-y'][] = "Anno di nascita"; +$map['name'][] = "Nome visualizzato"; +$map['phone:homefax'][] = "Numero fax"; +$map['street:home'][] = "Indirizzo di casa 2"; +$map['country:home'][] = "Nazione di residenza"; +$map['zipcode:home'][] = "CAP di residenza"; +$map['phone:mobile'][] = "Numero cellulare"; +$map['nickname'][] = "Soprannome"; +$map['organization'][] = "Organizzazione"; +$map['phone:pager'][] = "Numero Pager"; +$map['email:home'][] = "Email principale"; +$map['email:other'][] = "Email secondaria"; +$map['website:homepage'][] = "Pagina web 1"; +$map['website:other'][] = "Pagina web 2"; +$map['phone:work'][] = "Telefono lavoro"; +$map['street:work'][] = "Indirizzo di lavoro 2"; +$map['country:work'][] = "Nazione di lavoro"; +$map['zipcode:work'][] = "CAP di lavoro"; +$map['birthday'][] = "Data di Nascita"; +$map['email:home'][] = "Email"; +$map['phone:mobile'][] = "Cellulare di Casa"; +$map['zipcode:home'][] = "CAP di casa"; +$map['notes'][] = "Info"; +$map['photo'][] = "Foto"; +$map['website:homepage'][] = "URL"; +$map['locality:work'][] = "Città di Lavoro"; +$map['organization'][] = "Società di lavoro"; +$map['department'][] = "Reparto di lavoro"; +$map['phone:workfax'][] = "Fax di lavoro"; +$map['phone:other'][] = "Cellulare di lavoro"; +$map['region:work'][] = "Nazione/Regione di lavoro"; +$map['jobtitle'][] = "Titolo di lavoro"; +$map['zipcode:work'][] = "CAP di lavoro"; diff --git a/program/localization/pl_PL/csv2vcard.inc b/program/localization/pl_PL/csv2vcard.inc index c6c5be414f5..a7b66f93801 100644 --- a/program/localization/pl_PL/csv2vcard.inc +++ b/program/localization/pl_PL/csv2vcard.inc @@ -16,40 +16,40 @@ +-----------------------------------------------------------------------+ */ $map = array(); -$map['anniversary'] = "Rocznica"; -$map['assistants_name'] = "Asystent"; -$map['assistants_phone'] = "Telefon asystenta"; -$map['birthday'] = "Urodziny"; -$map['business_city'] = "Miasto (biuro)"; -$map['business_countryregion'] = "Kraj/region (biuro)"; -$map['business_fax'] = "Faks służbowy"; -$map['business_phone'] = "Telefon służbowy"; -$map['business_phone_2'] = "Telefon służbowy 2"; -$map['business_postal_code'] = "Kod pocztowy (biuro)"; -$map['business_state'] = "Województwo (biuro)"; -$map['business_street'] = "Ulica (biuro)"; -$map['categories'] = "Kategorie"; -$map['company'] = "Firma"; -$map['department'] = "Oddział"; -$map['email_address'] = "Adres e-mail"; -$map['first_name'] = "Imię"; -$map['gender'] = "Płeć"; -$map['home_city'] = "Miasto (dom)"; -$map['home_countryregion'] = "Kraj/region (dom)"; -$map['home_fax'] = "Faks domowy"; -$map['home_phone'] = "Telefon domowy"; -$map['home_phone_2'] = "Home Phone 2"; -$map['home_postal_code'] = "Kod pocztowy (dom)"; -$map['home_state'] = "Województwo (dom)"; -$map['home_street'] = "Ulica (dom)"; -$map['job_title'] = "Stanowisko"; -$map['last_name'] = "Nazwisko"; -$map['managers_name'] = "Menadżer"; -$map['middle_name'] = "Drugie imię"; -$map['mobile_phone'] = "Telefon komórkowy"; -$map['notes'] = "Notatki"; -$map['pager'] = "Pager"; -$map['primary_phone'] = "Telefon główny"; -$map['title'] = "Tytuł"; -$map['web_page'] = "Osobista strona sieci Web"; -$map['nickname'] = "Przydomek"; +$map['anniversary'][] = "Rocznica"; +$map['assistant'][] = "Asystent"; +$map['phone:assistant'][] = "Telefon asystenta"; +$map['birthday'][] = "Urodziny"; +$map['locality:work'][] = "Miasto (biuro)"; +$map['country:work'][] = "Kraj/region (biuro)"; +$map['phone:workfax'][] = "Faks służbowy"; +$map['phone:work'][] = "Telefon służbowy"; +$map['phone:work2'][] = "Telefon służbowy 2"; +$map['zipcode:work'][] = "Kod pocztowy (biuro)"; +$map['region:work'][] = "Województwo (biuro)"; +$map['street:work'][] = "Ulica (biuro)"; +$map['groups'][] = "Kategorie"; +$map['organization'][] = "Firma"; +$map['department'][] = "Oddział"; +$map['email:other'][] = "Adres e-mail"; +$map['firstname'][] = "Imię"; +$map['gender'][] = "Płeć"; +$map['locality:home'][] = "Miasto (dom)"; +$map['country:home'][] = "Kraj/region (dom)"; +$map['phone:homefax'][] = "Faks domowy"; +$map['phone:home'][] = "Telefon domowy"; +$map['phone:home2'][] = "Home Phone 2"; +$map['zipcode:home'][] = "Kod pocztowy (dom)"; +$map['region:home'][] = "Województwo (dom)"; +$map['street:home'][] = "Ulica (dom)"; +$map['jobtitle'][] = "Stanowisko"; +$map['surname'][] = "Nazwisko"; +$map['manager'][] = "Menadżer"; +$map['middlename'][] = "Drugie imię"; +$map['phone:mobile'][] = "Telefon komórkowy"; +$map['notes'][] = "Notatki"; +$map['phone:pager'][] = "Pager"; +$map['phone:main'][] = "Telefon główny"; +$map['prefix'][] = "Tytuł"; +$map['website:homepage'][] = "Osobista strona sieci Web"; +$map['nickname'][] = "Przydomek"; diff --git a/program/localization/pt_BR/csv2vcard.inc b/program/localization/pt_BR/csv2vcard.inc index b4893c5bf38..adf69b906eb 100644 --- a/program/localization/pt_BR/csv2vcard.inc +++ b/program/localization/pt_BR/csv2vcard.inc @@ -16,86 +16,86 @@ +-----------------------------------------------------------------------+ */ $map = array(); -$map['anniversary'] = "Aniversário"; -$map['assistants_name'] = "Nome do Assistente"; -$map['assistants_phone'] = "Fone do Assistente"; -$map['birthday'] = "Aniversário"; -$map['business_city'] = "Cidade comercial"; -$map['business_countryregion'] = "Região/País comercial"; -$map['business_fax'] = "Fax comercial"; -$map['business_phone'] = "Fone comercial"; -$map['business_phone_2'] = "Fone comercial 2"; -$map['business_postal_code'] = "Código postal comercial"; -$map['business_state'] = "Estado comercial"; -$map['business_street'] = "Rua comercial"; -$map['car_phone'] = "Fone do carro"; -$map['categories'] = "Categorias"; -$map['company'] = "Empresa"; -$map['department'] = "Departamento"; -$map['email_address'] = "Endereço de E-mail"; -$map['email_2_address'] = "Endereço de E-mail 2"; -$map['email_3_address'] = "Endereço de E-mail 3"; -$map['first_name'] = "Primeiro nome"; -$map['gender'] = "Gênero"; -$map['home_city'] = "Cidade de casa"; -$map['home_countryregion'] = "Região/País de casa"; -$map['home_fax'] = "Fax de casa"; -$map['home_phone'] = "Fone de casa"; -$map['home_phone_2'] = "Fone de casa 2"; -$map['home_postal_code'] = "Código Postal de casa"; -$map['home_state'] = "Estado de casa"; -$map['home_street'] = "Rua de casa"; -$map['job_title'] = "Cargo"; -$map['last_name'] = "Último nome"; -$map['managers_name'] = "Nome do gerente"; -$map['middle_name'] = "Nome do meio"; -$map['mobile_phone'] = "Celular"; -$map['notes'] = "Notas"; -$map['other_city'] = "Outra cidade"; -$map['other_countryregion'] = "Outro País/Região"; -$map['other_fax'] = "Outro Fax"; -$map['other_phone'] = "Outro Fone"; -$map['other_postal_code'] = "Outro Código Postal"; -$map['other_state'] = "Outro Estado"; -$map['other_street'] = "Outra Rua"; -$map['pager'] = "Pager"; -$map['primary_phone'] = "Fone Primario"; -$map['spouse'] = "Spouse"; -$map['suffix'] = "Sufixo"; -$map['title'] = "Título"; -$map['web_page'] = "Página Web"; -$map['birth_day'] = "Dia de nascimento"; -$map['birth_month'] = "Mês de nascimento"; -$map['birth_year'] = "Ano de nascimento"; -$map['display_name'] = "Mostrar nome"; -$map['fax_number'] = "Número de Fax"; -$map['home_address'] = "Endereço de casa"; -$map['home_country'] = "País de casa"; -$map['home_zipcode'] = "CEP de casa"; -$map['mobile_number'] = "Celular"; -$map['nickname'] = "Apelido"; -$map['organization'] = "Organização"; -$map['pager_number'] = "Número do Pager"; -$map['primary_email'] = "E-mail primário"; -$map['secondary_email'] = "E-mail secundário"; -$map['web_page_1'] = "Web Page 1"; -$map['web_page_2'] = "Web Page 2"; -$map['work_phone'] = "Fone de trabalho"; -$map['work_address'] = "Endereço de trabalho"; -$map['work_country'] = "País de trabalho"; -$map['work_zipcode'] = "CEP de trabalho"; -$map['date_of_birth'] = "Data de nascimento"; -$map['email'] = "E-mail"; -$map['home_mobile'] = "Celular pessoal"; -$map['home_zip'] = "CEP pessoal"; -$map['info'] = "Informações"; -$map['user_photo'] = "Foto do Usuário"; -$map['url'] = "URL"; -$map['work_city'] = "Cidade de trabalho"; -$map['work_company'] = "Empresa"; -$map['work_dept'] = "Departamento"; -$map['work_fax'] = "Fax"; -$map['work_mobile'] = "Celular de trabalho"; -$map['work_state'] = "Estado"; -$map['work_title'] = "Cargo"; -$map['work_zip'] = "CEP"; +$map['anniversary'][] = "Aniversário"; +$map['assistant'][] = "Nome do Assistente"; +$map['phone:assistant'][] = "Fone do Assistente"; +$map['birthday'][] = "Aniversário"; +$map['locality:work'][] = "Cidade comercial"; +$map['country:work'][] = "Região/País comercial"; +$map['phone:workfax'][] = "Fax comercial"; +$map['phone:work'][] = "Fone comercial"; +$map['phone:work2'][] = "Fone comercial 2"; +$map['zipcode:work'][] = "Código postal comercial"; +$map['region:work'][] = "Estado comercial"; +$map['street:work'][] = "Rua comercial"; +$map['phone:car'][] = "Fone do carro"; +$map['groups'][] = "Categorias"; +$map['organization'][] = "Empresa"; +$map['department'][] = "Departamento"; +$map['email:other'][] = "Endereço de E-mail"; +$map['email:other'][] = "Endereço de E-mail 2"; +$map['email:other'][] = "Endereço de E-mail 3"; +$map['firstname'][] = "Primeiro nome"; +$map['gender'][] = "Gênero"; +$map['locality:home'][] = "Cidade de casa"; +$map['country:home'][] = "Região/País de casa"; +$map['phone:homefax'][] = "Fax de casa"; +$map['phone:home'][] = "Fone de casa"; +$map['phone:home2'][] = "Fone de casa 2"; +$map['zipcode:home'][] = "Código Postal de casa"; +$map['region:home'][] = "Estado de casa"; +$map['street:home'][] = "Rua de casa"; +$map['jobtitle'][] = "Cargo"; +$map['surname'][] = "Último nome"; +$map['manager'][] = "Nome do gerente"; +$map['middlename'][] = "Nome do meio"; +$map['phone:mobile'][] = "Celular"; +$map['notes'][] = "Notas"; +$map['locality:other'][] = "Outra cidade"; +$map['country:other'][] = "Outro País/Região"; +$map['phone:other'][] = "Outro Fax"; +$map['phone:other'][] = "Outro Fone"; +$map['zipcode:other'][] = "Outro Código Postal"; +$map['region:other'][] = "Outro Estado"; +$map['street:other'][] = "Outra Rua"; +$map['phone:pager'][] = "Pager"; +$map['phone:main'][] = "Fone Primario"; +$map['spouse'][] = "Spouse"; +$map['suffix'][] = "Sufixo"; +$map['prefix'][] = "Título"; +$map['website:homepage'][] = "Página Web"; +$map['birthday-d'][] = "Dia de nascimento"; +$map['birthday-m'][] = "Mês de nascimento"; +$map['birthday-y'][] = "Ano de nascimento"; +$map['name'][] = "Mostrar nome"; +$map['phone:homefax'][] = "Número de Fax"; +$map['street:home'][] = "Endereço de casa"; +$map['country:home'][] = "País de casa"; +$map['zipcode:home'][] = "CEP de casa"; +$map['phone:mobile'][] = "Celular"; +$map['nickname'][] = "Apelido"; +$map['organization'][] = "Organização"; +$map['phone:pager'][] = "Número do Pager"; +$map['email:home'][] = "E-mail primário"; +$map['email:other'][] = "E-mail secundário"; +$map['website:homepage'][] = "Web Page 1"; +$map['website:other'][] = "Web Page 2"; +$map['phone:work'][] = "Fone de trabalho"; +$map['street:work'][] = "Endereço de trabalho"; +$map['country:work'][] = "País de trabalho"; +$map['zipcode:work'][] = "CEP de trabalho"; +$map['birthday'][] = "Data de nascimento"; +$map['email:home'][] = "E-mail"; +$map['phone:mobile'][] = "Celular pessoal"; +$map['zipcode:home'][] = "CEP pessoal"; +$map['notes'][] = "Informações"; +$map['photo'][] = "Foto do Usuário"; +$map['website:homepage'][] = "URL"; +$map['locality:work'][] = "Cidade de trabalho"; +$map['organization'][] = "Empresa"; +$map['department'][] = "Departamento"; +$map['phone:workfax'][] = "Fax"; +$map['phone:other'][] = "Celular de trabalho"; +$map['region:work'][] = "Estado"; +$map['jobtitle'][] = "Cargo"; +$map['zipcode:work'][] = "CEP"; diff --git a/program/localization/ru_RU/csv2vcard.inc b/program/localization/ru_RU/csv2vcard.inc index 6f9cf3c23ff..e7a164e6e3c 100644 --- a/program/localization/ru_RU/csv2vcard.inc +++ b/program/localization/ru_RU/csv2vcard.inc @@ -15,31 +15,31 @@ | Author: Aleksander Machniak | +-----------------------------------------------------------------------+ */ -$map['birth_day'] = "День рождения"; -$map['birth_month'] = "Месяц рождения"; -$map['birth_year'] = "Год рождения"; -$map['display_name'] = "Отображаемое имя"; -$map['fax_number'] = "Номер факса"; -$map['home_address'] = "Адрес"; -$map['home_city_short'] = "Город"; -$map['home_state_short'] = "Штат"; -$map['home_country'] = "Страна"; -$map['home_zipcode'] = "Почтовый индекс"; -$map['mobile_number'] = "Номер сотового телефона"; -$map['nickname'] = "Псевдоним"; -$map['organization'] = "Организация"; -$map['pager_number'] = "Номер пейджера"; -$map['primary_email'] = "Адрес электронной почты"; -$map['secondary_email'] = "Альтернативный адрес электронной почты"; -$map['web_page_1'] = "Веб-страница 1"; -$map['web_page_2'] = "Веб-страница 2"; -$map['web_page'] = "Веб-страница"; -$map['notes'] = "Заметки"; -$map['work_phone'] = "Рабочий телефон"; -$map['work_address'] = "Адрес (раб.)"; -$map['work_country'] = "Страна (раб.)"; -$map['work_zipcode'] = "Почтовый индекс (раб.)"; -$map['last'] = "Фамилия"; -$map['first'] = "Имя"; -$map['work_city'] = "Город (раб.)"; +$map['birthday-d'][] = "День рождения"; +$map['birthday-m'][] = "Месяц рождения"; +$map['birthday-y'][] = "Год рождения"; +$map['name'][] = "Отображаемое имя"; +$map['phone:homefax'][] = "Номер факса"; +$map['street:home'][] = "Адрес"; +$map['locality:home'][] = "Город"; +$map['region:home'][] = "Штат"; +$map['country:home'][] = "Страна"; +$map['zipcode:home'][] = "Почтовый индекс"; +$map['phone:mobile'][] = "Номер сотового телефона"; +$map['nickname'][] = "Псевдоним"; +$map['organization'][] = "Организация"; +$map['phone:pager'][] = "Номер пейджера"; +$map['email:home'][] = "Адрес электронной почты"; +$map['email:other'][] = "Альтернативный адрес электронной почты"; +$map['website:homepage'][] = "Веб-страница 1"; +$map['website:other'][] = "Веб-страница 2"; +$map['website:homepage'][] = "Веб-страница"; +$map['notes'][] = "Заметки"; +$map['phone:work'][] = "Рабочий телефон"; +$map['street:work'][] = "Адрес (раб.)"; +$map['country:work'][] = "Страна (раб.)"; +$map['zipcode:work'][] = "Почтовый индекс (раб.)"; +$map['surname'][] = "Фамилия"; +$map['firstname'][] = "Имя"; +$map['locality:work'][] = "Город (раб.)"; $map['work_state_short'] = "Штат (раб.)"; diff --git a/program/localization/sk_SK/csv2vcard.inc b/program/localization/sk_SK/csv2vcard.inc index c53273af5fd..125803cdd4a 100644 --- a/program/localization/sk_SK/csv2vcard.inc +++ b/program/localization/sk_SK/csv2vcard.inc @@ -16,69 +16,69 @@ +-----------------------------------------------------------------------+ */ $map = array(); -$map['anniversary'] = "Výročie"; -$map['assistants_name'] = "Meno asistenta"; -$map['assistants_phone'] = "Telefón asistenta"; -$map['birthday'] = "Narodeniny"; -$map['business_city'] = "Mesto (práca)"; -$map['business_countryregion'] = "Krajina/oblasť (práca)"; -$map['business_fax'] = "Fax do práce"; -$map['business_phone'] = "Telefón do práce"; -$map['business_phone_2'] = "Telefón do práce 2"; -$map['business_postal_code'] = "PSČ (práca)"; -$map['business_state'] = "Okres (práca)"; -$map['business_street'] = "Ulica (práca)"; -$map['car_phone'] = "Autotelefón"; -$map['categories'] = "Kategórie"; -$map['company'] = "Spoločnosť"; -$map['department'] = "Oddelenie"; -$map['email_address'] = "E-mailová adresa"; -$map['first_name'] = "Krstné meno"; -$map['gender'] = "Pohlavie"; -$map['home_city'] = "Mesto (domov)"; -$map['home_countryregion'] = "Krajina/oblasť (domov)"; -$map['home_fax'] = "Fax domov"; -$map['home_phone'] = "Telefón domov"; -$map['home_phone_2'] = "Telefón domov 2"; -$map['home_postal_code'] = "PSČ (domov)"; -$map['home_state'] = "Okres (domov)"; -$map['home_street'] = "Ulica (domov)"; -$map['job_title'] = "Funkcia"; -$map['last_name'] = "Priezvisko"; -$map['managers_name'] = "Meno manažéra"; -$map['middle_name'] = "Ďalšie meno"; -$map['mobile_phone'] = "Mobilný telefón"; -$map['notes'] = "Poznámky"; -$map['other_city'] = "Iné mesto"; -$map['other_countryregion'] = "Krajina/oblasť (iné)"; -$map['other_fax'] = "Iný fax"; -$map['other_phone'] = "Iný telefón"; -$map['other_postal_code'] = "Iné PSČ"; -$map['other_state'] = "Krajina/oblasť (iné)"; -$map['other_street'] = "Iná ulica"; -$map['pager'] = "Operátor"; -$map['primary_phone'] = "Primárny telefón"; -$map['spouse'] = "Manžel(ka)"; -$map['suffix'] = "Prípona"; -$map['title'] = "Titul"; -$map['web_page'] = "Webová stránka"; -$map['birth_day'] = "Deň narodenia"; -$map['birth_month'] = "Mesiac narodenia"; -$map['birth_year'] = "Rok narodenia"; -$map['display_name'] = "Zobrazované meno"; -$map['fax_number'] = "Fax"; -$map['home_address'] = "Adresa domov"; -$map['home_country'] = "Štát domov"; -$map['home_zipcode'] = "PSČ domov"; -$map['mobile_number'] = "Mobil"; -$map['nickname'] = "Prezývka"; -$map['organization'] = "Organizácia"; -$map['pager_number'] = "Pager"; -$map['primary_email'] = "E-mailová adresa"; -$map['secondary_email'] = "Ďalšia e-mailová adresa"; -$map['web_page_1'] = "Webová stránka 1"; -$map['web_page_2'] = "Webová stránka 2"; -$map['work_phone'] = "Telefón do zamestnania"; -$map['work_address'] = "Pracovná adresa"; -$map['work_country'] = "Štát zamestnania"; -$map['work_zipcode'] = "PSČ zamestnania"; +$map['anniversary'][] = "Výročie"; +$map['assistant'][] = "Meno asistenta"; +$map['phone:assistant'][] = "Telefón asistenta"; +$map['birthday'][] = "Narodeniny"; +$map['locality:work'][] = "Mesto (práca)"; +$map['country:work'][] = "Krajina/oblasť (práca)"; +$map['phone:workfax'][] = "Fax do práce"; +$map['phone:work'][] = "Telefón do práce"; +$map['phone:work2'][] = "Telefón do práce 2"; +$map['zipcode:work'][] = "PSČ (práca)"; +$map['region:work'][] = "Okres (práca)"; +$map['street:work'][] = "Ulica (práca)"; +$map['phone:car'][] = "Autotelefón"; +$map['groups'][] = "Kategórie"; +$map['organization'][] = "Spoločnosť"; +$map['department'][] = "Oddelenie"; +$map['email:other'][] = "E-mailová adresa"; +$map['firstname'][] = "Krstné meno"; +$map['gender'][] = "Pohlavie"; +$map['locality:home'][] = "Mesto (domov)"; +$map['country:home'][] = "Krajina/oblasť (domov)"; +$map['phone:homefax'][] = "Fax domov"; +$map['phone:home'][] = "Telefón domov"; +$map['phone:home2'][] = "Telefón domov 2"; +$map['zipcode:home'][] = "PSČ (domov)"; +$map['region:home'][] = "Okres (domov)"; +$map['street:home'][] = "Ulica (domov)"; +$map['jobtitle'][] = "Funkcia"; +$map['surname'][] = "Priezvisko"; +$map['manager'][] = "Meno manažéra"; +$map['middlename'][] = "Ďalšie meno"; +$map['phone:mobile'][] = "Mobilný telefón"; +$map['notes'][] = "Poznámky"; +$map['locality:other'][] = "Iné mesto"; +$map['country:other'][] = "Krajina/oblasť (iné)"; +$map['phone:other'][] = "Iný fax"; +$map['phone:other'][] = "Iný telefón"; +$map['zipcode:other'][] = "Iné PSČ"; +$map['region:other'][] = "Krajina/oblasť (iné)"; +$map['street:other'][] = "Iná ulica"; +$map['phone:pager'][] = "Operátor"; +$map['phone:main'][] = "Primárny telefón"; +$map['spouse'][] = "Manžel(ka)"; +$map['suffix'][] = "Prípona"; +$map['prefix'][] = "Titul"; +$map['website:homepage'][] = "Webová stránka"; +$map['birthday-d'][] = "Deň narodenia"; +$map['birthday-m'][] = "Mesiac narodenia"; +$map['birthday-y'][] = "Rok narodenia"; +$map['name'][] = "Zobrazované meno"; +$map['phone:homefax'][] = "Fax"; +$map['street:home'][] = "Adresa domov"; +$map['country:home'][] = "Štát domov"; +$map['zipcode:home'][] = "PSČ domov"; +$map['phone:mobile'][] = "Mobil"; +$map['nickname'][] = "Prezývka"; +$map['organization'][] = "Organizácia"; +$map['phone:pager'][] = "Pager"; +$map['email:home'][] = "E-mailová adresa"; +$map['email:other'][] = "Ďalšia e-mailová adresa"; +$map['website:homepage'][] = "Webová stránka 1"; +$map['website:other'][] = "Webová stránka 2"; +$map['phone:work'][] = "Telefón do zamestnania"; +$map['street:work'][] = "Pracovná adresa"; +$map['country:work'][] = "Štát zamestnania"; +$map['zipcode:work'][] = "PSČ zamestnania"; diff --git a/program/localization/zh_TW/csv2vcard.inc b/program/localization/zh_TW/csv2vcard.inc index 36c5495e1fe..df4c1e2fe76 100644 --- a/program/localization/zh_TW/csv2vcard.inc +++ b/program/localization/zh_TW/csv2vcard.inc @@ -16,75 +16,75 @@ +-----------------------------------------------------------------------+ */ $map = array(); -$map['anniversary'] = "紀念日"; -$map['assistants_name'] = "助理"; -$map['assistants_phone'] = "助理電話"; -$map['birthday'] = "生日"; -$map['business_city'] = "商務 - 市/鎮"; -$map['business_countryregion'] = "商務 - 國家/地區"; -$map['business_fax'] = "商務傳真"; -$map['business_phone'] = "商務電話"; -$map['business_phone_2'] = "商務電話 2"; -$map['business_postal_code'] = "商務 - 郵遞區號"; -$map['business_state'] = "商務 - 縣市"; -$map['business_street'] = "商務 - 街"; -$map['car_phone'] = "汽車電話"; -$map['categories'] = "類別"; -$map['company'] = "公司"; -$map['department'] = "部門"; -$map['email_address'] = "電子郵件地址"; -$map['first_name'] = "名字"; -$map['gender'] = "性別"; -$map['home_city'] = "住家 - 市/鎮"; -$map['home_countryregion'] = "住家 - 國家/地區"; -$map['home_fax'] = "住家傳真"; -$map['home_phone'] = "住家電話"; -$map['home_phone_2'] = "住家電話 2"; -$map['home_postal_code'] = "住家 - 郵遞區號"; -$map['home_state'] = "住家 - 縣/市"; -$map['home_street'] = "住家 - 街"; -$map['job_title'] = "職稱"; -$map['last_name'] = "姓氏"; -$map['managers_name'] = "主管名稱"; -$map['middle_name'] = "中間名"; -$map['mobile_phone'] = "行動電話"; -$map['notes'] = "記事"; -$map['other_city'] = "其他 - 市/鎮"; -$map['other_countryregion'] = "其他 - 國家/地區"; -$map['other_fax'] = "其他傳真"; -$map['other_phone'] = "其他電話"; -$map['other_postal_code'] = "其他 - 郵遞區號"; -$map['other_state'] = "其他 - 縣/市"; -$map['other_street'] = "其他 - 街"; -$map['pager'] = "呼叫器"; -$map['primary_phone'] = "代表電話"; -$map['spouse'] = "配偶"; -$map['suffix'] = "稱謂"; -$map['title'] = "頭銜"; -$map['web_page'] = "網頁"; -$map['last'] = "姓"; -$map['first'] = "名"; -$map['birth_day'] = "生日 (日)"; -$map['birth_month'] = "生日 (月)"; -$map['birth_year'] = "生日 (年)"; -$map['display_name'] = "顯示名稱"; -$map['fax_number'] = "傳真號碼"; -$map['home_address'] = "住家住址"; -$map['home_country'] = "居住國家"; -$map['home_zipcode'] = "住址郵遞區號"; -$map['mobile_number'] = "手機號碼"; -$map['nickname'] = "暱稱"; -$map['organization'] = "Organization"; -$map['pager_number'] = "呼叫器號碼"; -$map['primary_email'] = "主要 Email"; -$map['secondary_email'] = "次要 Email"; -$map['web_page_1'] = "網頁 1"; -$map['web_page_2'] = "網頁 2"; -$map['work_phone'] = "商務電話"; -$map['work_address'] = "商務地址"; -$map['work_country'] = "商務國家"; -$map['work_zipcode'] = "商務郵遞區號"; -$map['work_city'] = "商務市鎮"; -$map['work_state'] = "商務縣市"; -$map['home_city_short'] = "居住市鎮"; -$map['home_state_short'] = "居住縣市"; +$map['anniversary'][] = "紀念日"; +$map['assistant'][] = "助理"; +$map['phone:assistant'][] = "助理電話"; +$map['birthday'][] = "生日"; +$map['locality:work'][] = "商務 - 市/鎮"; +$map['country:work'][] = "商務 - 國家/地區"; +$map['phone:workfax'][] = "商務傳真"; +$map['phone:work'][] = "商務電話"; +$map['phone:work2'][] = "商務電話 2"; +$map['zipcode:work'][] = "商務 - 郵遞區號"; +$map['region:work'][] = "商務 - 縣市"; +$map['street:work'][] = "商務 - 街"; +$map['phone:car'][] = "汽車電話"; +$map['groups'][] = "類別"; +$map['organization'][] = "公司"; +$map['department'][] = "部門"; +$map['email:other'][] = "電子郵件地址"; +$map['firstname'][] = "名字"; +$map['gender'][] = "性別"; +$map['locality:home'][] = "住家 - 市/鎮"; +$map['country:home'][] = "住家 - 國家/地區"; +$map['phone:homefax'][] = "住家傳真"; +$map['phone:home'][] = "住家電話"; +$map['phone:home2'][] = "住家電話 2"; +$map['zipcode:home'][] = "住家 - 郵遞區號"; +$map['region:home'][] = "住家 - 縣/市"; +$map['street:home'][] = "住家 - 街"; +$map['jobtitle'][] = "職稱"; +$map['surname'][] = "姓氏"; +$map['manager'][] = "主管名稱"; +$map['middlename'][] = "中間名"; +$map['phone:mobile'][] = "行動電話"; +$map['notes'][] = "記事"; +$map['locality:other'][] = "其他 - 市/鎮"; +$map['country:other'][] = "其他 - 國家/地區"; +$map['phone:other'][] = "其他傳真"; +$map['phone:other'][] = "其他電話"; +$map['zipcode:other'][] = "其他 - 郵遞區號"; +$map['region:other'][] = "其他 - 縣/市"; +$map['street:other'][] = "其他 - 街"; +$map['phone:pager'][] = "呼叫器"; +$map['phone:main'][] = "代表電話"; +$map['spouse'][] = "配偶"; +$map['suffix'][] = "稱謂"; +$map['prefix'][] = "頭銜"; +$map['website:homepage'][] = "網頁"; +$map['surname'][] = "姓"; +$map['firstname'][] = "名"; +$map['birthday-d'][] = "生日 (日)"; +$map['birthday-m'][] = "生日 (月)"; +$map['birthday-y'][] = "生日 (年)"; +$map['name'][] = "顯示名稱"; +$map['phone:homefax'][] = "傳真號碼"; +$map['street:home'][] = "住家住址"; +$map['country:home'][] = "居住國家"; +$map['zipcode:home'][] = "住址郵遞區號"; +$map['phone:mobile'][] = "手機號碼"; +$map['nickname'][] = "暱稱"; +$map['organization'][] = "Organization"; +$map['phone:pager'][] = "呼叫器號碼"; +$map['email:home'][] = "主要 Email"; +$map['email:other'][] = "次要 Email"; +$map['website:homepage'][] = "網頁 1"; +$map['website:other'][] = "網頁 2"; +$map['phone:work'][] = "商務電話"; +$map['street:work'][] = "商務地址"; +$map['country:work'][] = "商務國家"; +$map['zipcode:work'][] = "商務郵遞區號"; +$map['locality:work'][] = "商務市鎮"; +$map['region:work'][] = "商務縣市"; +$map['locality:home'][] = "居住市鎮"; +$map['region:home'][] = "居住縣市"; From c925b012996f43bbe24887e5b50926beaa285f6c Mon Sep 17 00:00:00 2001 From: PhilW Date: Sun, 16 Jun 2024 11:44:42 +0100 Subject: [PATCH 11/12] fix test --- tests/Framework/Csv2vcardTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Framework/Csv2vcardTest.php b/tests/Framework/Csv2vcardTest.php index 9cad1fe2f11..0ee8c0d826a 100644 --- a/tests/Framework/Csv2vcardTest.php +++ b/tests/Framework/Csv2vcardTest.php @@ -107,7 +107,7 @@ public function test_import_all() $csv_text = file_get_contents(TESTS_DIR . '/src/Csv2vcard/all.csv'); $vcf_text = file_get_contents(TESTS_DIR . '/src/Csv2vcard/all.vcf'); - $csv = new rcube_csv2vcard(); + $csv = new \rcube_csv2vcard(); $csv->import($csv_text); $result = $csv->export(); From 3a149b586ed55adc86a361a0b1dfac84319973a2 Mon Sep 17 00:00:00 2001 From: PhilW Date: Sun, 16 Jun 2024 11:49:11 +0100 Subject: [PATCH 12/12] small cs fix --- program/lib/Roundcube/rcube_csv2vcard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/lib/Roundcube/rcube_csv2vcard.php b/program/lib/Roundcube/rcube_csv2vcard.php index 6fc009f706a..fdfc6bab212 100644 --- a/program/lib/Roundcube/rcube_csv2vcard.php +++ b/program/lib/Roundcube/rcube_csv2vcard.php @@ -184,7 +184,7 @@ public function import($csv, $dry_run = false, $skip_head = true) public function set_map($elements, $available) { // sanitize input - $elements = array_filter($elements, function ($val) use ($available) { + $elements = array_filter($elements, static function ($val) use ($available) { return in_array($val, $available); });