[owncloud-devel] Owncloud contact app address labels bug 284

Bert Haverkamp bert at bertenselena.net
Tue Feb 17 20:09:45 GMT 2015


Hi,

This is a followup on my earlier mails in December on this bug 284 and a 
call for help.
I have  now created a php script that can read a vcf file and outputs a 
new vcf with the LABEL field added.
The label can be for 33 different countries. So it can output the 
formatted address for 33 different layouts!

I have created this at the moment as a commandline tool. It consists of 
3 files:
the example script labels.php
The actual algorithm: formatlabels.php
and a list of countrycodes vs country names, countrycodes.php


I run into 2 obstacles now that I need to clear.
1) the home country of the user. This is an unknown in the contacts app. 
But it is needed to format the label when no country is specified in the 
vcf, and to suppress the country name in the formatted addreslabel, when 
it is the same as the country where the user lives.

I noticed that the calendar app already has a setting for this. 
Presumably to get the right timezone for the calendar. I would propose 
to make this a global parameter, somewhere in the user profile, so more 
apps can make use of this info. That would at least solve my problem. 
Alternatively, the contacts app has to be extended with a country field.

2) There is no clear way to get the country from an contact address. The 
country name is a free format text field, so it can be in any spelling.

My proposal is to use a dropdown list, in order to make this more 
structured. The names can be localized based on the language setting. I 
noticed  Outlook has the same approach to country entry. And the 
dropdown list already exists in the Calendar app for the setting I 
mentioned earlier.

However, I have no idea how to program the UI. And I am sure there are 
people who are very good at that in this list. I'm looking for help. I 
have created the formatting algorithm, who can help me incorporate it in 
the contact app?

Please let me know if you are interested in helping, or have any 
feedback.

Kind regards,

Bert







On 2014-11-28 11:49, Bert Haverkamp wrote:
> Dear Owncloud developers.
> 
> Some months ago, I filed bug 284.
> (https://github.com/owncloud/contacts/issues/284) It is relating to the 
> way
> owncloud updates (or doesn't update) the Address Label field in vcards. 
> This
> field is used by many address-sticker programms like for instance 
> Glabels. I
> would like to be able to download a subset of my contacts as a vcf 
> file,
> import them in to Glabels and print address stickers very easily.
> 
> However, the interest in this bug is not very high. (Basically, just me 
> at
> the moment:-)
> So I'm looking into adding this to owncloud myself. It would greatly 
> enhance
> the capability of printing address labels and I can't imagine there is 
> no
> one else with a usecase for this (Hint, christmas card season is 
> coming!)
> 
> In order to have this working correctly the address should be formatted
> according to the local situation.
> I live in the Netherlands and addresses are formatted differently than 
> for
> instance in the USA.
> Also if an address is in another country, it should pick that up and 
> format
> it accordingly.
> 
> I already downloaded the evolution sourcecode and found the code that 
> is
> responsible for constructing the address labels and their country 
> specific
> formats. They use a address_formats.dat file to list all countries and 
> their
> official address layout.
> 
> I'd now need to add this to owncloud. There are two possibilities. Do 
> this
> everytime when updating the address field, and doing this when 
> exporting to
> vcf. Which would be best in your view?
> 
> Also I'm still struggling to understand the owncloud source. php is not 
> my
> strongsuit:-(
> Can anyone give some guidance? Where would I need to hook into the code 
> that
> saves the vcf files? Or where is the code to store the fields in the
> database?
> 
> Kind regards,
> 
> Bert Haverkamp
> 
> P.S. I hope this wont become a double-post. My first post was rejected
> because I sent it before subscribing to the mailing-list.
> 
> 
> 
> --
> View this message in context:
> http://owncloud.10557.n7.nabble.com/Owncloud-contacts-and-address-stickers-tp13561.html
> Sent from the Developers mailing list archive at Nabble.com.
> _______________________________________________
> Devel mailing list
> Devel at owncloud.org
> http://mailman.owncloud.org/mailman/listinfo/devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: labels.php
Type: text/x-php
Size: 2845 bytes
Desc: not available
URL: <http://mailman.owncloud.org/pipermail/devel/attachments/20150217/0a71a0d5/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: countrycodes.php
Type: text/x-php
Size: 6364 bytes
Desc: not available
URL: <http://mailman.owncloud.org/pipermail/devel/attachments/20150217/0a71a0d5/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: formatlabel.php
Type: text/x-php
Size: 11912 bytes
Desc: not available
URL: <http://mailman.owncloud.org/pipermail/devel/attachments/20150217/0a71a0d5/attachment-0005.bin>


More information about the Devel mailing list