{**************************************************************************}
{* *}
-{* Copyright (C) 2003-2010 Polytechnique.org *}
+{* Copyright (C) 2003-2011 Polytechnique.org *}
{* http://opensource.polytechnique.org/ *}
{* *}
{* This program is free software; you can redistribute it and/or modify *}
{assign var=prefname value="addresses[$i]"}
{assign var=prefid value="addresses_$i"}
+{if !hasPerm('directory_private') && ($address.pub eq 'private') && !$new}
+{assign var=hiddenaddr value=true}
+{else}
+{assign var=hiddenaddr value=false}
+{/if}
+
<table class="bicol" style="display: none; margin-bottom: 1em" id="{$prefid}_grayed">
<tr>
<th class="grayed">
</table>
<table class="bicol" style="margin-bottom: 1em" id="{$prefid}">
<tr>
- <th>
+ <th colspan="2">
<div style="float: left">
<label>
<input name="{$prefname}[current]" type="radio" {if $address.current}checked="checked"{/if}
{icon name=cross title="Supprimer l'adresse"}
</a>
</div>
- Adresse n°{$i+1}
+ Adresse n°{$i+1}{if $hiddenaddr} (masquée){/if}
</th>
</tr>
- <tr>
+ <tr {if $hiddenaddr}style="display: none"{/if}>
+ <td colspan="2" class="flags">
+ {include file="include/flags.radio.tpl" name="`$prefname`[pub]" val=$address.pub mainField='addresses' mainId=$i subField='phones' subId=-1}
+ </td>
+ </tr>
+ {include file="geoloc/form.address.tpl" prefname=$prefname prefid=$prefid address=$address id=$i}
+ <tr {if $hiddenaddr}style="display: none"{/if}>
+ {if !$isMe}
<td>
- <div style="margin-bottom: 0.2em" class="flags">
- {include file="include/flags.radio.tpl" name="`$prefname`[pub]" val=$address.pub}
- </div>
- <div style="clear: both"></div>
- <div style="float: left">
- {include file="geoloc/form.address.tpl" prefname=$prefname prefid=$prefid address=$address id=$i}
- </div>
+ <small><strong>Adresse postale :</strong><br />{$address.postalText|nl2br}</small>
+ </td>
+ <td>
+ {else}
+ <td colspan="2">
+ {/if}
<div style="float: left">
<div>
<label>
<div>
<label>
<input type="checkbox" name="{$prefname}[mail]" {if $address.mail}checked="checked"{/if} />
- on peut m'y envoyer du courrier par la poste
+ on peut {if $isMe}m'{/if}y envoyer du courrier par la poste
</label>
</div>
+ {if !t($isMe)}
+ <div>
+ <label>
+ <input type="checkbox" name="{$prefname}[deliveryIssue]" {if $address.deliveryIssue}checked="checked"{/if} />
+ n'habite pas à l'adresse indiquée
+ </label>
+ </div>
+ {else}
+ <div style="display: none"><input type="hidden" name="deliveryIssue" value="{$address.deliveryIssue}" /></div>
+ {/if}
<div>
<label>
Commentaire :
</div>
</td>
</tr>
- <tr class="pair">
- <td>
+ <tr class="pair" {if $hiddenaddr}style="display: none"{/if}>
+ <td colspan="2">
{foreach from=$address.phones key=t item=tel}
- <div id="{"`$prefid`_tel_`$t`"}" style="clear: both">
- {include file="profile/phone.tpl" prefname="`$prefname`[phones]"
- prefid="`$prefid`_tel" telid=$t tel=$tel}
+ <div id="{"`$prefid`_phones_`$t`"}" style="clear: both">
+ {include file="profile/phone.tpl" prefname="`$prefname`[phones]" prefid="`$prefid`_phones" telid=$t tel=$tel
+ subField='phones' mainField='addresses' mainId=$i}
</div>
{/foreach}
{if $address.phones|@count eq 0}
- <div id="{"`$prefid`_tel_0"}" style="clear: both">
- {include file="profile/phone.tpl" prefname="`$prefname`[phones]" prefid="`$prefid`_tel" telid=0 tel=0}
+ <div id="{"`$prefid`_phones_0"}" style="clear: both">
+ {include file="profile/phone.tpl" prefname="`$prefname`[phones]" prefid="`$prefid`_phones" telid=0 tel=0
+ subField='phones' mainField='addresses' mainId=$i}
</div>
{/if}
- <div id="{$prefid}_tel_add" class="center" style="clear: both; padding-top: 4px">
- <a href="javascript:addTel('{$prefid}_tel','{$prefname}[phones]')">
+ <div id="{$prefid}_phones_add" class="center" style="clear: both; padding-top: 4px">
+ <a href="javascript:addTel('{$prefid}_phones','{$prefname}[phones]','phones','addresses','{$i}')">
{icon name=add title="Ajouter un numéro de téléphone"} Ajouter un numéro de téléphone
</a>
</div>