-
Notifications
You must be signed in to change notification settings - Fork 174
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
Support X-ABLabel and ITEM2.xxx properties #42
Comments
Could one of the developers please point me in the right direction here? I would like to develop the fix. Where in the code can I add a functioncall for my function that will update the LABEL field, upon import or change of the address? |
Since the vcard lib was updated, does the issue still occur with current master branch? |
No, this functionality is beyond the scope ov the vcard lib. The lib
supports reading and writing the Label field. But this requires extra
logic to format the address label (which is country specific) and fill
the field in the Vcard accordingly.
I attached my 2 php functions that I created based on address_format.dat
that I found in the Evolution email client. (hope this works by email)
labels.php simply takes an input vcf and goes through all the vcards to
format the LABEL fields according to the ADDRESS field and outputs it
again. The input and output filenames are hardcoded.
formatlabels.php contains one function that takes the address
information and returns an addresslabel based on the formatting in a
country. It is a long case based on the countrycode
function formatlabel($n,$m,$p,$e,$s,$l,$r,$z,$c,$t,$cc,$hcc)
this function is basically a long case structure.
Hope this clarifies what I meant.
Bert
On 07/12/16 15:24, Alexander Weidinger wrote:
Since the vcard lib was updated, does the issue still occur?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#42 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC6ObgWE8Z8culEZPKpyp9fFrhJSuEesks5rFsG4gaJpZM4K92rU>.
[at]
AddressFormat=%0(%n\n)%0(%m\n)%0(Postfach %p\n)%0(%s\n)%z%w%l
BusinessAddressFormat=%0(%m\n)%0(z.Hd. %n\n)%0(Postfach %p\n)%0(%s\n)%0(%z)%w%l
CountryPosition=below
[au]
AddressFormat=%0(%n\n)%0(%m\n)%0(%s\n)%0(PO BOX %p\n)%L%w%w%R%w%w%z
CountryPosition=below
[ax]
AddressFormat=%0(%m\n)%0(%n\n)%0(PB %p\n)%0(%s\n)%z%w%L
CountryPosition=below
[be]
AddressFormat=%0(%n\n)%0(%m\n)%0(Postbus %p\n)%0(%s\n)%z%w%l
CountryPosition=below
[be_nl]
AddressFormat=%0(%n\n)%0(%m\n)%0(Postbus %p\n)%0(%s\n)%z%w%l
CountryPosition=below
[be_fr]
AddressFormat=%0(%n\n)%0(%m\n)%0(Boîte Postale %p\n)%0(%s\n)%z%w%l
CountryPosition=below
[be_de]
AddressFormat=%0(%n\n)%0(%m\n)%0(Postfach %p\n)%0(%s\n)%z%w%l
CountryPosition=below
[ca]
AddressFormat=%0(%N\n)%0(%M\n)%0(%S\n)%0(PO BOX %p\n)%L%w%R%,%w%z
CountryPosition=below
[ch]
AddressFormat=%0(%m\n)%0(%n\n)%0(P.O. Box %p\n)%0(%s\n)%z%w%l
CountryPosition=below
[ch_de]
AddressFormat=%0(%m\n)%0(%n\n)%0(Postfach %p\n)%0(%s\n)%z%w%l
[ch_fr]
AddressFormat=%0(%m\n)%0(%n\n)%0(Case postale %p\n)%0(%s\n)%z%w%l
[ch_it]
AddressFormat=%0(%m\n)%0(%n\n)%0(Casella postale %p\n)%0(%s\n)%z%w%l
[cz]
AddressFormat=%0(%m\n)%0(%n\n)%0(p. p. %p\n)%0(%s\n)%z%w%w%l
CountryPosition=below
[de]
AddressFormat=%0(%m\n)%0(%n\n)%0(Postfach %p\n)%0(%s\n)%z%w%l
CountryPosition=below
[de_nds]
AddressFormat=%0(%n\n)%0(- %m -\n)%0(Postfach %p\n)%0(%s\n)%z%w%l
[dk]
AddressFormat=%0(%n\n)%0(%m\n)%0(%s\n)%0(Postboks %p\n)%z%w%l
CountryPosition=below
[fi]
AddressFormat=%0(%m\n)%0(%n\n)%0(PB %p\n)%0(%s\n)%z%w%L
CountryPosition=below
[fr]
AddressFormat=%0(%m\n)%0(%n\n)%0(%s\n)%0(BP %p\n)%z%w%L
CountryPosition=below
[gl]
AddressFormat=%0(%n\n)%0(%m\n)%0(%s\n)%0(Postboks %p\n)%z%w%l
CountryPosition=below
[hu]
AddressFormat=%0(%n\n)%0(%l\n)%0(%s\n)%0(PF. %p\n)%0(%z\n)%0(%r\n)
BusinessAddressFormat=%0(%n\n)%0(%m\n)%0(%z%w%l\n)%0(%s\n)%0(PF. %p\n)%0(%r\n)
CountryPosition=below
[il]
AddressFormat=%0(%n\n)%0(%m\n)%0(ת.ד. %p\n)%0(%s\n)%l%w%z
CountryPosition=below
[it]
AddressFormat=%0(%n\n)%0(%m\n)%0(CASELLA POSTALE %p\n)%0(%s\n)%z%w%l
CountryPosition=below
[jp]
AddressFormat=%0(%z%w%r\n)%0(%w%l\n)%0(%s\n)%0(%m\n)%0(%n\n)
CountryPosition=above
[kh]
AddressFormat=%0(%m\n)%0(%n\n)%0(%s\n)%0(P.O. Box %p\n)%0(%z%w%L\n)%r
CountryPosition=below
[me]
AddressFormat=%0(%m\n)%0(%n\n)%0(%s\n)%0(poštanski fah %p\n)%z%w%l
CountryPosition=below
[me_sr]
AddressFormat=%0(%m\n)%0(%n\n)%0(%s\n)%0(поштански фах %p\n)%z%w%l
[na]
AddressFormat=%0(%m\n)%0(%n\n)%0(P.O. Box %p\n)%l
[nl]
AddressFormat=%0(%n\n)%0(%m\n)%0(Postbus %p\n)%0(%s\n)%z%w%w%l
CountryPosition=below
[no]
AddressFormat=%0(%m\n)%0(%n\n)%0(Postboks %p\n)%0(%s\n)%z%w%w%L
CountryPosition=below
[rs]
AddressFormat=%0(%m\n)%0(%n\n)%0(%s\n)%0(поштански фах %p\n)%z%w%l
CountryPosition=below
[rs_sr]
AddressFormat=%0(%m\n)%0(%n\n)%0(%s\n)%0(poštanski fah %p\n)%z%w%l
[se]
AddressFormat=%0(%n\n)%0(%m\n)%0(Box %p\n)%0(%s\n)%z%w%w%L
CountryPosition=below
[us]
AddressFormat=%0(%n\n)%0(%m\n)%0(%s\n)%0(PO BOX %p\n)%l%,%w%r%w%z
CountryPosition=below
|
Would it be possible (as a stop-gap measure) to just reset the LABEL when the entry is modified? I think it would be great if that change went into the next stable update. To explain, let me tell how I was recently bitten by this bug: Note: the above issue happened with NextCloud 10, I haven't yet verified if the issue is the same with NextCloud 11. |
Hello tbleher, |
@brjhaverkamp Hey! This is an old issue! Can you check if this is still happening on the 3.0.0 alpha? :) |
Hi, thanks for taking time to look at this.I can look on the latest release. Or has anything relevant been included in 3.0.0-alpha? |
Lots of things, but not relevant to this ;) |
I can at at least confirm that the LABEL is not kept in sync with the ADDRESS properties are not kept in sync in Contacts 2.1.5 so for me it is still an issue. |
Is there a solution to the issue? Paul |
@Pablo1978 not yet ! |
Hello everyone! |
At what time is the function triggered? Does it only work on a vcard import or on a sync activity? I've exported the whole address book to a vcf file and searched for "ITEM" entries, which I then selected using the GUI. I would have expected to get the mentioned address entry displayed too. |
@j-ed it happens for every card. |
Hmm, I'm a little bit confused because I couldn't see the described behavior.
|
I'm starting to have doubts! 😁 |
You did it! 😄 The mentioned records are now correctly displayed. |
@j-ed 🙈 Thanks for your patience 😁 Other than properly being display, could you wander around this a bit? Go back to an existing LABEL, change the custom label... etc :) |
@skjnldsv Unfortunately I cannot run tests on an iPhone at the moment, only on an Android phone. But, as usual, I will play around with the app. I hope @brjhaverkamp will be able to run tests on an iPhone to close the testing gap. |
It means you can now enter custom stuff with ABLABEL (like android+davdroid supports or iOS deals wit those. This is a full support, so if you change it on nc or in android, the data will be displayed and compatible with both. BEGIN:VCARD
VERSION:3.0
N:Doe;John;;;
FN:John Doe
item1.EMAIL;type=INTERNET:[email protected]
item1.X-ABLabel:iCloud
END:VCARD |
@skjnldsv I've created a new record on my Android phone and the result looks pretty good, except for instant messaging addresses. A custom phone number label: 👍 A custom Instant Messaging label: is not correctly displayed. Instead the record itself is prefixed with the label and in front of the field you find the request to select a type:** 👎 |
@j-ed thanks!! 😁 |
@skjnldsv Oh sorry, my fault. Here it is:
I looks like Android is handling labels for instant messaging entries differently. I found this issue which already covers it: #800 BTW, I think I've found some more issues which are related to this issue ticket, e.g.
Should I open separate issue tickets for it so that it can better be tracked or do you want me to add it to this conversation? |
Please do open an issue yes! :) |
@skjnldsv [x] done. I hope you agree that the issues are related 😉 |
@j-ed thanks!! I'll give them a review & analysis each! |
Hi Guys, I'm onboard. I downloaded the contacts.tar.gz and unpacked it in the nextcloud/apps (after moving the original contacts dir to contacts-orig. Is that sufficient? Sofar I don't see anything to labels.. |
@brjhaverkamp it should be for the nextcloud part. |
Hi John, I wasn't sure if the contacts.tar.gz was the one including the label patches, so I downloaded the latest from github and compiled it. I got the following error at the end of the make, but since it is in testing I asumed it is not critical. I uploaded the result to my nextcloud server, and changed a few letters in appinfo.xml. So I am now 100% sure I am using the latest contacts. But I think I am looking in the wrong place. Where can I add a custom label? or edit the label? |
Oh, and I'm afraid I can't help with the Iphone testing. I am on the android side as well. |
@brjhaverkamp As far as I understood, the contacts app now supports the described fields which are created on other devices, but didn't allow to create it in the GUI yet. I created e.g. a new contact on my Android device, selected the field type "custom" and entered a custom description. After syncing it to Nextcloud, the custom field types are displayed in the GUI. |
@brjhaverkamp you can also create custom labels. For a phone number, for example, you can click the select right next to the left of the phone input, and enter your own label (e.g. 'UK Office' or whatever). For the phpunit error, you can ignore :) |
@skjnldsv Wow, It didn't catch that. 👍 |
I copied this issue from the owncloud/contacts github issue list where it was issued by rfc2822.
I have a keen interest in this feature as well, as it would simplify creating address sticker for my mailings.
I even created the php code to create the address label already, but lack the skills to integrate them in the contacts app. but it would be very simple with the right skills to hook it up on import or address change! If one of the devs would like to do this or mentor me, that would be great.
Steps to reproduce
GET …/owncloud/remote.php/dav/addressbooks/users/test/default/bc2620f7-2ed3-4f5f-9404-b2bafd12ae16.vcf http/1.1 Accept: text/vcard;version=4.0, text/vcard;charset=utf-8;q=0.8, text/vcard;q=0.5
It will look like this:
BEGIN:VCARD
VERSION:4.0
PRODID:-//Sabre//Sabre VObject 3.5.0//EN
FN:Alpha Beta
UID:bc2620f7-2ed3-4f5f-9404-b2bafd12ae16
ADR;TYPE=HOME:1;;Street 2;Virtual;;333;Schland
END:VCARD
Note there's no LABEL in the ADR property, so that clients will generated the formatted address themselves.
PUT …
Content-Type: text/vcard;version=4.0
BEGIN:VCARD
VERSION:4.0
PRODID:+//IDN bitfire.at//DAVdroid/1.2.3-gplay vcard4android ez-vcard/0.9.1
1
UID:bc2620f7-2ed3-4f5f-9404-b2bafd12ae16
FN:Alpha Beta
N:Beta;Alpha;;;
ADR;LABEL=Street 2a^n1^nVirtual 333^nSchland;TYPE=home:1;;Street 2a;Virtual
;;333;Schland
REV:20160901T213222Z
END:VCARD
Here, the LABEL has been set (and RFC 6868 has been used for the line breaks).
BEGIN:VCARD
VERSION:4.0
PRODID:-//Sabre//Sabre VObject 3.5.0//EN
UID:bc2620f7-2ed3-4f5f-9404-b2bafd12ae16
FN:Alpha Beta
N:Beta;Alpha;;;
ADR;LABEL="Street 2a^n1^nVirtual 333^nSchland";TYPE=home:1;;Street 3a;Virtu
al;;333;Schland
REV:20160901T213222Z
END:VCARD
Expected behaviour
The LABEL parameter of the ADR property should be handled correctly. For instance, it could be dismissed when a change is done in the Web UI. However, an incorrect LABEL should never be sent.
Actual behaviour
LABEL is stored when received, and then sent without modification, even when the content of the address field has been modified in the OwnCloud Contacts app.
Required change.
the contacts app should be able to update the LABEL field when the address changes or fill it on importing an contact vcard with an empty LABEL field.
Since different countries have different address formats (some have postal code before the city, some city before the postal code, etc.) the contacts app has to be aware of the county that the address is refering to or if the country field empty default to a predefined default country. This default county can not be derived from the language; many people use a different language than the language of the country they live in. So it should be seperate setting, either in the contact app or overall in nextcloud.
Another potential challenge is that the country name in the vcard can be spelled in many differeny ways.
Detecting the destination for hte address formatting can be tricky because of this. Having the county be filled from a drop down box based on international standard country-codes might be the right solution (with a free format option for the exceptions, of course)
The address format can then be a simple lookup table from the country-code to the address format in that county.
The text was updated successfully, but these errors were encountered: