Commit | Line | Data |
---|---|---|
0337d704 | 1 | {**************************************************************************} |
2 | {* *} | |
9891bd15 | 3 | {* Copyright (C) 2003-2009 Polytechnique.org *} |
0337d704 | 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 | {**************************************************************************} | |
29b12e6e | 22 | {iterate from=$users item=vcard} |
0337d704 | 23 | BEGIN:VCARD |
24 | VERSION:3.0 | |
25 | {if $vcard.nom_usage} | |
c9d11694 | 26 | FN:{$vcard.prenom|vcard_enc} {$vcard.nom_usage|vcard_enc} ({$vcard.nom|vcard_enc}) |
0337d704 | 27 | {else} |
c9d11694 | 28 | FN:{$vcard.prenom|vcard_enc} {$vcard.nom|vcard_enc} |
0337d704 | 29 | {/if} |
c9d11694 | 30 | N:{$vcard.nom|vcard_enc};{$vcard.prenom|vcard_enc};{$vcard.nom_usage|vcard_enc};; |
d865c4a0 | 31 | {if $vcard.nickname} |
c9d11694 | 32 | NICKNAME:{$vcard.nickname|vcard_enc} |
d865c4a0 | 33 | {/if} |
c9d11694 | 34 | EMAIL;TYPE=internet,pref:{$vcard.bestalias}@{#globals.mail.domain#} |
3b4d124b | 35 | EMAIL;TYPE=internet:{$vcard.bestalias}@{#globals.mail.domain2#} |
0337d704 | 36 | {if $vcard.bestalias neq $vcard.forlife} |
7d73bb7b | 37 | EMAIL;TYPE=internet:{$vcard.forlife}@{#globals.mail.domain#} |
3b4d124b | 38 | EMAIL;TYPE=internet:{$vcard.forlife}@{#globals.mail.domain2#} |
0337d704 | 39 | {/if} |
40 | {if $vcard.virtualalias} | |
41 | EMAIL;TYPE=internet:{$vcard.virtualalias} | |
42 | {/if} | |
bde2be3b GB |
43 | {if $vcard.tels} |
44 | {foreach item=tel from=$vcard.tels} | |
45 | {if $tel.tel_type eq 'mobile'}TEL;TYPE=cell{else}{if $tel.tel_type eq 'fax'}FAX{else}TEL{/if};TYPE=home{/if}:{$tel.tel|vcard_enc} | |
46 | {/foreach} | |
0337d704 | 47 | {/if} |
48 | {if $vcard.adr_pro} | |
49 | {if $vcard.adr_pro[0].entreprise} | |
c9d11694 | 50 | ORG:{$vcard.adr_pro[0].entreprise|vcard_enc} |
0337d704 | 51 | {/if} |
52 | {if $vcard.adr_pro[0].poste} | |
c9d11694 | 53 | TITLE:{$vcard.adr_pro[0].poste|vcard_enc} |
0337d704 | 54 | {/if} |
55 | {if $vcard.adr_pro[0].fonction} | |
c9d11694 | 56 | ROLE:{$vcard.adr_pro[0].fonction|vcard_enc} |
0337d704 | 57 | {/if} |
bde2be3b GB |
58 | {if $vcard.adr_pro[0].tels} |
59 | {foreach item=tel from=$vcard.adr_pro[0].tels} | |
60 | {if $tel.tel_type eq 'mobile'}TEL;TYPE=cell,work{else}{if $tel.tel_type eq 'fax'}FAX{else}TEL{/if};TYPE=work{/if}:{$tel.tel|vcard_enc} | |
61 | {/foreach} | |
0337d704 | 62 | {/if} |
c9d11694 | 63 | ADR;TYPE=work:{format_adr adr=$vcard.adr_pro[0]} |
0337d704 | 64 | {/if} |
65 | {foreach item=adr from=$vcard.adr} | |
c9d11694 | 66 | ADR;TYPE=home{if $adr.courier},postal{/if}:{format_adr adr=$adr} |
bde2be3b | 67 | {if $adr.tels} |
79a5acea | 68 | {foreach item=tel from=$adr.tels} |
bde2be3b | 69 | {if $tel.tel_type eq 'mobile'}TEL;TYPE=cell,home{else}{if $tel.tel_type eq 'fax'}FAX{else}TEL{/if};TYPE=home{/if}:{$tel.tel|vcard_enc} |
0337d704 | 70 | {/foreach} |
bde2be3b | 71 | {/if} |
79a5acea | 72 | {/foreach} |
1052148d GB |
73 | {foreach from=$vcard.networking item=nw} |
74 | {if $nw.filter eq 'web'} | |
75 | URL:{$nw.address} | |
0337d704 | 76 | {/if} |
1052148d | 77 | {/foreach} |
d865c4a0 | 78 | {if strlen(trim($vcard.freetext)) == 0} |
c9d11694 | 79 | NOTE:(X{$vcard.promo}) |
a77a3269 | 80 | {else} |
613ba9ff | 81 | NOTE:(X{$vcard.promo})\n{$vcard.freetext|miniwiki:'no_title':'text'|vcard_enc} |
a77a3269 | 82 | {/if} |
ae2f9e35 | 83 | {if $vcard.section} |
84 | X-SECTION:{$vcard.section} | |
85 | {/if} | |
86 | {if $vcard.binets_vcardjoin} | |
87 | X-BINETS:{$vcard.binets_vcardjoin} | |
88 | {/if} | |
89 | {if $vcard.gpxs_vcardjoin} | |
90 | X-GROUPS:{$vcard.gpxs_vcardjoin} | |
91 | {/if} | |
937e3c82 | 92 | {if $vcard.photo} |
29b12e6e | 93 | PHOTO;ENCODING=b;TYPE={$vcard.photo.attachmime}:{$vcard.photo.attach|base64_encode|vcard_enc} |
937e3c82 | 94 | {/if} |
c9d11694 | 95 | SORT-STRING:{$vcard.nom|vcard_enc} |
0337d704 | 96 | REV:{$vcard.date|date_format:"%Y%m%dT000000Z"} |
5e193297 | 97 | END:VCARD{"\n"} |
29b12e6e | 98 | {/iterate} |
a7de4ef7 | 99 | {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} |