</p>
{/if}
{if $retour == $smarty.const.ERROR_INVALID_EMAIL}
+ {assign var='error_email' value='1'}
<p class="erreur">
Erreur : l'email n'est pas valide.
</p>
Ajax.update_html(null, 'emails/redirect/' + (checked ? '' : 'in') + 'active/' + email, redirectUpdate);
}
+ function rewriteUpdate(mail, allow, box)
+ {
+ return function() {
+ if (!allow) {
+ if (box.value != '') {
+ alert("Un mail de validation vient d'être envoyer sur " + mail
+ + ". La réécriture ne sera active que lorsque tu auras cliqué sur le lien indiqué dans ce mail.");
+ }
+ }
+ redirectUpdate();
+ };
+ }
+
{/literal}
//]]></script>
{test_email}
{if $e->active}checked="checked"{/if}
{if $smarty.foreach.redirect.total eq 1}disabled="disabled"{/if}
onchange="updateRedirect(this.checked, '{$e->email}')" /></td>
- <td>
+ <td style="text-align: left">
{if $e->has_rewrite()}
- <select onchange="Ajax.update_html(null,'emails/redirect/rewrite/{$e->email}/'+this.value, redirectUpdate)">
+ <select onchange="Ajax.update_html(null,'emails/redirect/rewrite/{$e->email}/'+this.value, rewriteUpdate('{$e->email}', {$e->allow_rewrite|default:"0"}, this))">
<option value=''>--- aucune ---</option>
{assign var=dom1 value=#globals.mail.domain#}
{assign var=dom2 value=#globals.mail.domain2#}
value='{$a.alias}@{#globals.mail.domain2#}'>{$a.alias}@{#globals.mail.domain2#}</option>
{/foreach}
</select>
+ {if $e->rewrite neq '' && !$e->allow_rewrite}{icon name="error" title="en attente de validation"}{/if}
{else}
<em>pas de réécriture</em>
{/if}
</td>
</tr>
{/foreach}
- <tr class="{cycle values="pair,impair"}"><td colspan="4">
- <form action="emails/redirect" method="post">
- <div>
- <br />
- Ajouter une adresse email :
- <input type="text" size="35" maxlength="60" name="email" value="" />
- <input type="submit" value="ajouter" name="emailop" />
+ <form action="emails/redirect" method="post">
+ {cycle values="pair,impair" assign=class_combobox}
+ {include file="include/emails.combobox.tpl" name="email" val=$email class=$class_combobox error=$error_email}
+ <tr class=$class_combobox><td colspan="4"><div>
+ <input type="submit" value="ajouter" name="emailop" />
{xsrf_token_field}
- </div>
- </form>
- </td></tr>
+ </div></td></tr>
+ </form>
</table>
<script type="text/javascript">showRemove(); activeEnable();</script>
</div>