First version of the addresses page
[platal.git] / templates / profile / adresses.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2007 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
23 <script type="text/javascript">//<![CDATA[
24 {literal}
25 function removeAddress(id, pref)
26 {
27   document.getElementById(id).style.display = "none";
28   document.forms.prof_annu[pref + "[removed]"].value = "1";
29 }
30
31 {/literal}
32 //]]></script>
33
34 {foreach key=i item=adr from=$addresses}
35 {assign var=adpref value="addresses[$i]"}
36 {assign var=adid value="addresses_$i"}
37 <table class="bicol" id="{$adid}" style="margin-bottom: 1em">
38   <tr>
39     <th>
40       <div style="float: left">
41         <input name="{$adpref}[active]" type="radio" value="{$adr.id}" {if $adr.current}checked="checked"{/if}
42                id="{$adid}_active"/>
43         <label for="{$adid}_active" class="smaller" style="font-weight: normal">actuelle</label>
44       </div>
45       <div style="float: right">
46         <a href="javascript:removeAddress('{$adid}', '{$adpref}')">{icon name=cross title="Supprimer l'adresse"}</a>
47       </div>
48       Adresse n°{$i + 1}
49     </th>
50   </tr>
51   <tr>
52     <td>
53       <div>{include file="include/flags.radio.tpl" name="$adpref[pub]" notable=true val=$adr.pub}</div>
54       <div {if !$adr.geoloc}class="center"{/if}>{include file="geoloc/form.address.tpl" name=$adpref id=$adid adr=$adr}</div>
55     </td>
56   </tr>
57 </table>
58 <input type="hidden" name="{$adpref}[removed]" value="0"/>
59 {/foreach}
60
61 {*
62     {section name=i loop=$nb_adr start=1 max=$nb_adr}
63     {assign var='adrid' value=$ordre_adrid[i]}
64     {assign var='adr' value=$adresses.$adrid}
65     {include file="geoloc/form.address.tpl" adr=$adr titre=$titre}
66     <tr>
67       <td class="colg">
68         <span class="titre">Adresse:</span>
69       </td>
70       <td class="cold" colspan="4">
71         <input type="radio" name="temporaire[{$adrid}]" value="0" {if !$adr.temporaire}checked="checked"{/if} />
72         permanente
73         <input type="radio" name="temporaire[{$adrid}]" value="1" {if $adr.temporaire}checked="checked"{/if} />
74         temporaire
75       </td>
76     </tr>
77     <tr>
78       <td class="colg">
79         &nbsp;
80       </td>
81       <td class="cold" colspan="4">
82         <input type="radio" name="secondaire[{$adrid}]" value="0" {if !$adr.secondaire}checked="checked"{/if} />
83         ma résidence principale
84         <input type="radio" name="secondaire[{$adrid}]" value="1" {if $adr.secondaire}checked="checked"{/if} />
85         une résidence secondaire
86       </td>
87     </tr>
88     <tr>
89       <td class="colg">
90         &nbsp;
91       </td>
92       <td class="cold" colspan="4">
93         <input type="checkbox" name="courrier[{$adrid}]" value="1" {if $adr.courrier}checked="checked"{/if} /> on peut m'y envoyer du courrier par la poste
94       </td>
95     </tr>
96     {foreach from=$adr.tels item="tel"}
97     <tr class="flags">
98       <td class="colg">
99         <input type="hidden" name="telid{$tel.telid}[{$adrid}]" value="{$tel.telid}"/>
100         {if $tel.new_tel && !$tel.tel}
101           <input type="hidden" name="new_tel{$tel.telid}[{$adrid}]" value="1"/>
102         {/if}
103         <span class="titre" onclick="this.style.display='none';var d = document.getElementById('tel_type{$adrid}_{$tel.telid}');d.style.display='inline';d.select();d.focus();">{$tel.tel_type}&nbsp;:</span>
104         <input id="tel_type{$adrid}_{$tel.telid}" style="display:none" type="text" size="5" maxlength="30" name="tel_type{$tel.telid}[{$adrid}]" value="{$tel.tel_type}"/>
105       </td>
106       <td>
107         <input type="text" size="19" maxlength="28" name="tel{$tel.telid}[{$adrid}]" value="{$tel.tel}" />
108         {if $tel.tel}
109                 <a href="profile/edit/{$onglet}?adrid={$adrid}&telid={$tel.telid}&deltel=1">{icon name=cross title="Supprimer ce tél."}</a>
110         {/if}
111       </td>
112       {include file="include/flags.radio.tpl" name="tel_pub`$tel.telid`[$adrid]" val=$tel.tel_pub display="mini"}
113     </tr>
114     {/foreach}
115     <tr><td colspan="5">&nbsp;</td></tr>
116     {/section}
117     <tr><td colspan="5">&nbsp;</td></tr>
118   </table>
119 *}
120 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}