Implement X.net ergonomy suggestions by BdB
[platal.git] / templates / core / vcard.tpl
... / ...
CommitLineData
1{**************************************************************************}
2{* *}
3{* Copyright (C) 2003-2008 Polytechnique.org *}
4{* http://opensource.polytechnique.org/ *}
5{* *}
6{* This program is free software; you can redistribute it and/or modify *}
7{* it under the terms of the GNU General Public License as published by *}
8{* the Free Software Foundation; either version 2 of the License, or *}
9{* (at your option) any later version. *}
10{* *}
11{* This program is distributed in the hope that it will be useful, *}
12{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
13{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
14{* GNU General Public License for more details. *}
15{* *}
16{* You should have received a copy of the GNU General Public License *}
17{* along with this program; if not, write to the Free Software *}
18{* Foundation, Inc., *}
19{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
20{* *}
21{**************************************************************************}
22{iterate from=$users item=vcard}
23BEGIN:VCARD
24VERSION:3.0
25{if $vcard.nom_usage}
26FN:{$vcard.prenom|vcard_enc} {$vcard.nom_usage|vcard_enc} ({$vcard.nom|vcard_enc})
27{else}
28FN:{$vcard.prenom|vcard_enc} {$vcard.nom|vcard_enc}
29{/if}
30N:{$vcard.nom|vcard_enc};{$vcard.prenom|vcard_enc};{$vcard.nom_usage|vcard_enc};;
31{if $vcard.nickname}
32NICKNAME:{$vcard.nickname|vcard_enc}
33{/if}
34EMAIL;TYPE=internet,pref:{$vcard.bestalias}@{#globals.mail.domain#}
35EMAIL;TYPE=internet:{$vcard.bestalias}@{#globals.mail.domain2#}
36{if $vcard.bestalias neq $vcard.forlife}
37EMAIL;TYPE=internet:{$vcard.forlife}@{#globals.mail.domain#}
38EMAIL;TYPE=internet:{$vcard.forlife}@{#globals.mail.domain2#}
39{/if}
40{if $vcard.virtualalias}
41EMAIL;TYPE=internet:{$vcard.virtualalias}
42{/if}
43{if $vcard.mobile}
44TEL;TYPE=cell:{$vcard.mobile|vcard_enc}
45{/if}
46{if $vcard.adr_pro}
47{if $vcard.adr_pro[0].entreprise}
48ORG:{$vcard.adr_pro[0].entreprise|vcard_enc}
49{/if}
50{if $vcard.adr_pro[0].poste}
51TITLE:{$vcard.adr_pro[0].poste|vcard_enc}
52{/if}
53{if $vcard.adr_pro[0].fonction}
54ROLE:{$vcard.adr_pro[0].fonction|vcard_enc}
55{/if}
56{if $vcard.adr_pro[0].tel}
57TEL;TYPE=work:{$vcard.adr_pro[0].tel|vcard_enc}
58{/if}
59{if $vcard.adr_pro[0].fax}
60FAX;TYPE=work:{$vcard.adr_pro[0].fax|vcard_enc}
61{/if}
62ADR;TYPE=work:{format_adr adr=$vcard.adr_pro[0]}
63{/if}
64{foreach item=adr from=$vcard.adr}
65ADR;TYPE=home{if $adr.courier},postal{/if}:{format_adr adr=$adr}
66{foreach item=tel from=$adr.tels}
67{if $tel.tel}
68{if $tel.tel_type neq 'Fax'}TEL{else}FAX{/if};TYPE=home:{$tel.tel}
69{/if}
70{/foreach}
71{/foreach}
72{if $vcard.web}
73URL:{$vcard.web}
74{/if}
75{if strlen(trim($vcard.freetext)) == 0}
76NOTE:(X{$vcard.promo})
77{else}
78NOTE:(X{$vcard.promo})\n{$vcard.freetext|miniwiki:'no_title':'text'|vcard_enc}
79{/if}
80{if $vcard.section}
81X-SECTION:{$vcard.section}
82{/if}
83{if $vcard.binets_vcardjoin}
84X-BINETS:{$vcard.binets_vcardjoin}
85{/if}
86{if $vcard.gpxs_vcardjoin}
87X-GROUPS:{$vcard.gpxs_vcardjoin}
88{/if}
89{if $vcard.photo}
90PHOTO;ENCODING=b;TYPE={$vcard.photo.attachmime}:{$vcard.photo.attach|base64_encode|vcard_enc}
91{/if}
92SORT-STRING:{$vcard.nom|vcard_enc}
93REV:{$vcard.date|date_format:"%Y%m%dT000000Z"}
94END:VCARD{"\n"}
95{/iterate}
96{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}