-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Contact import improvements #9431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I moved the Also I completed the second part of my suggestion to remove the hard coded mapping information entirely and use 1 to define the source and destination. |
You're removing this variable in this PR already and to me it looks like information gets lost there, because there's no mapping e.g. of |
|
I should have updated my comment when I changed my approach. You are totally right that this PR now removes that variable. It happens in this commit.
The $map['email:other'][] = "E-mail Address";
$map['email:other'][] = "E-mail 2 Address";
$map['email:other'][] = "E-mail 3 Address"; |
|
@pabzm any chance this could be part of 1.7? |
|
From my point of view, yes. I don't really like the syntax in the @alecpl What do you think about this? |
3a149b5 to
95d5a79
Compare
|
the format of |
…ort UI, remove hard coded $local_map
…ist_fields as it relies on rcmail_action_contacts
b58fdd3 to
5ddfb9d
Compare
|
Much nicer, thank you! Can we make the format even more close by swapping keys and values in the inc-files, and run |
|
I put them this way round because multiple CSV fields are mapped to the same vCard field so, I think, its either: $map['email:other'][] = "E-mail Address";
$map['email:other'][] = "E-mail 2 Address";
$map['email:other'][] = "E-mail 3 Address";or $map['E-mail Address'] = 'email:other';
$map['E-mail 2 Address'] = 'email:other';
$map['E-mail 3 Address'] = 'email:other'; |
|
Oh, alright! Then I prefer the second and current way. Thank you again! |
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:mobilenotphone:celland there is noemail:preffield. I have changed the mapping so it matches the fields in the UI. I added some more aliasesrcube_vcardto show existing vCards with mismatched fields nicely.I have removed the subtype
otherfrom the IM field because that does not exist inrcube_vcardwhich 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_mapbecause it’s a duplicate of contents of/program/localization/en_US/csv2vcard.incand just a bit confusing currently/program/localization/en_US/csv2vcard.incis not used by the code and this PR changes that.I have another reason for wanting to use
/program/localization/en_US/csv2vcard.incoverrcube_csv2vcard::$label_mapand if this PR gets merged then I will propose 1 additional change which will remove thercube_csv2vcard::$csv2vcard_mapvariable and simplify the mapping process by storing both the source and destination for the map in/program/localization/en_US/csv2vcard.incand 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.