69dd6d0ee7ea7baaa79ce609b5e601aa94267627
[platal.git] / templates / profile / adresses.address.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2014 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 {assign var=prefname value="addresses[$i]"}
24 {assign var=prefid value="addresses_$i"}
25 {if !hasPerm('directory_private') && ($address.pub eq 'private') && !$new}
26 {assign var=hiddenaddr value=true}
27 {else}
28 {assign var=hiddenaddr value=false}
29 {/if}
30
31 <table class="bicol" style="display: none; margin-bottom: 1em" id="{$prefid}_grayed">
32   <tr>
33     <th class="grayed">
34       <div style="float: right">
35         <a href="javascript:toggleAddress('{$i}',0)">{icon name=arrow_refresh title="Restaurer l'adresse"}</a>
36       </div>
37       Restaurer l'adresse n°{$i+1}
38     </th>
39   </tr>
40 </table>
41 <table class="bicol" style="margin-bottom: 1em" id="{$prefid}">
42   <tr>
43     <th colspan="2">
44       <div style="float: left">
45         <label>
46           <input name="{$prefname}[current]" type="radio" {if $address.current}checked="checked"{/if}
47                       onchange="checkCurrentAddress({$i})" />
48           <span class="smaller" style="font-weight: normal">actuelle</span>
49         </label>
50       </div>
51       <div style="float: right">
52         <a href="javascript:toggleAddress('{$i}',1)">
53           {icon name=cross title="Supprimer l'adresse"}
54         </a>
55       </div>
56       Adresse n°{$i+1}{if $hiddenaddr} (masquée){/if}
57     </th>
58   </tr>
59   <tr {if $hiddenaddr}style="display: none"{/if}>
60     <td colspan="2" class="flags">
61       {include file="include/flags.radio.tpl" name="`$prefname`[pub]" val=$address.pub mainField='addresses' mainId=$i subField='phones' subId=-1}
62     </td>
63   </tr>
64   {include file="geoloc/form.address.tpl" prefname=$prefname prefid=$prefid address=$address id=$i hiddenaddr=$hiddenaddr}
65   <tr {if $hiddenaddr}style="display: none"{/if}>
66   {if !$isMe}
67     <td>
68       <small><strong>Adresse postale&nbsp;:</strong><br />{$address.postalText|nl2br}</small>
69     </td>
70     <td>
71   {else}
72     <td colspan="2">
73   {/if}
74       <div style="float: left">
75         <div>
76           <label>
77             <input type="radio" name="{$prefname}[temporary]" value="0"
78                    {if !$address.temporary}checked="checked"{/if} />
79             permanente
80           </label>
81           <label>
82             <input type="radio" name="{$prefname}[temporary]" value="1"
83                    {if $address.temporary}checked="checked"{/if} />
84             temporaire
85           </label>
86         </div>
87         <div>
88           <label>
89             <input type="radio" name="{$prefname}[secondary]" value="0"
90                    {if !$address.secondary}checked="checked"{/if} />
91             ma résidence principale
92           </label>
93           <label>
94             <input type="radio" name="{$prefname}[secondary]" value="1"
95                    {if $address.secondary}checked="checked"{/if} />
96             une résidence secondaire
97           </label>
98         </div>
99         <div>
100           <label>
101             <input type="checkbox" name="{$prefname}[mail]" {if $address.mail}checked="checked"{/if} />
102             on peut {if $isMe}m'{/if}y envoyer du courrier par la poste
103           </label>
104         </div>
105         {if !t($isMe)}
106         <div>
107           <label>
108             <input type="checkbox" name="{$prefname}[deliveryIssue]" {if $address.deliveryIssue}checked="checked"{/if} />
109             n'habite pas à l'adresse indiquée
110           </label>
111         </div>
112         {else}
113         <div style="display: none"><input type="hidden" name="deliveryIssue" value="{$address.deliveryIssue}" /></div>
114         {/if}
115         <div>
116           <label>
117             Commentaire&nbsp;:
118             <input type="text" size="35" maxlength="100"
119                    name="{$prefname}[comment]" value="{$address.comment}" />
120           </label>
121         </div>
122       </div>
123     </td>
124   </tr>
125   <tr class="pair" {if $hiddenaddr}style="display: none"{/if}>
126     <td colspan="2">
127       {foreach from=$address.phones key=t item=tel}
128         <div id="{"`$prefid`_phones_`$t`"}" style="clear: both">
129           {include file="profile/phone.tpl" prefname="`$prefname`[phones]" prefid="`$prefid`_phones" telid=$t tel=$tel
130                    subField='phones' mainField='addresses' mainId=$i}
131         </div>
132       {/foreach}
133       {if $address.phones|@count eq 0}
134         <div id="{"`$prefid`_phones_0"}" style="clear: both">
135           {include file="profile/phone.tpl" prefname="`$prefname`[phones]" prefid="`$prefid`_phones" telid=0 tel=0
136                    subField='phones' mainField='addresses' mainId=$i}
137         </div>
138       {/if}
139       <div id="{$prefid}_phones_add" class="center" style="clear: both; padding-top: 4px">
140         <a href="javascript:addTel('{$prefid}_phones','{$prefname}[phones]','phones','addresses','{$i}')">
141           {icon name=add title="Ajouter un numéro de téléphone"} Ajouter un numéro de téléphone
142         </a>
143       </div>
144     </td>
145   </tr>
146 </table>
147
148 {* vim:set et sw=2 sts=2 sws=2 fenc=utf-8: *}