roundcube / roundcubemail

The Roundcube Webmail suite
https://roundcube.net
GNU General Public License v3.0
5.57k stars 1.6k forks source link

Contact import improvements #9431

Open johndoh opened 2 weeks ago

johndoh commented 2 weeks ago

For #9419

Some of the mappings in the current code work (pass the tests) but the result is different to what you get if you create the same contact manually through the UI and then export it as a vCard, for example Roundcube uses phone:mobile not phone:cell and there is no email:pref field. I have changed the mapping so it matches the fields in the UI. I added some more aliases rcube_vcard to show existing vCards with mismatched fields nicely.

I have removed the subtype other from the IM field because that does not exist in rcube_vcard which means if when you hit save in the UI the value simply disappears, it’s not saved.

I have removed the variable rcube_csv2vcard::$label_map because it’s a duplicate of contents of /program/localization/en_US/csv2vcard.incand just a bit confusing currently /program/localization/en_US/csv2vcard.inc is not used by the code and this PR changes that.

I have another reason for wanting to use /program/localization/en_US/csv2vcard.inc over rcube_csv2vcard::$label_map and if this PR gets merged then I will propose 1 additional change which will remove the rcube_csv2vcard::$csv2vcard_map variable and simplify the mapping process by storing both the source and destination for the map in /program/localization/en_US/csv2vcard.inc and allowing multiple sources (including multiple languages) for the same destination. This is a slightly larger and may be more controversial change hence the separate PR.