{**************************************************************************}
{* *}
-{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* Copyright (C) 2003-2011 Polytechnique.org *}
{* http://opensource.polytechnique.org/ *}
{* *}
{* This program is free software; you can redistribute it and/or modify *}
{include wiki=Xorg.Antispam part=1}
-{javascript name=ajax}
<script type="text/javascript">//<![CDATA[
{literal}
- function bogoUpdated()
- {
- showTempMessage('bogo-msg', "Le changement de réglage de l'antispam a bien été effectué.", true);
- }
+ $(function() {
+ var url = '{/literal}{$globals->baseurl}/emails/antispam/{literal}';
+ var msg = "Le changement de réglage de l'antispam a bien été effectué pour toutes tes redirections.";
+ $(':radio[name=filter_status]').change(function() {
+ var val = $(this).val();
+ $(':radio[name*=filter_status_]').removeAttr('checked');
+ $(':radio[name*=filter_status_]').attr('checked', function(i, v) {
+ if ($(this).val() == val) {
+ return 'checked';
+ }
+ });
+ $("#bogo-msg").successMessage(url + val, msg);
+ });
+ });
+ $(function() {
+ var url = '{/literal}{$globals->baseurl}/emails/antispam/{literal}';
+ var msg = "Le changement de réglage de l'antispam a bien été effectué pour ";
+ $(':radio[name*=filter_status_]').change(function() {
+ var id = $(this).attr('name').replace('filter_status_', '');
+ var redirection = $('#bogo_' + id).val();
+ $(':radio[name=filter_status]').removeAttr('checked');
+ $("#bogo-msg-mult").successMessage(url + $(this).val() + "/" + redirection, msg + redirection.replace('googleapps', 'ton compte Google Apps') + ".");
+ });
+ });
{/literal}
-</script>
- <fieldset>
- <legend><strong>Choisis ton propre réglage :</strong></legend>
- <input id='s0' type='radio' name='statut_filtre' value='0' {if $filtre eq 0}checked="checked"{/if} onclick="Ajax.update_html(null, '{$globals->baseurl}/emails/antispam/'+this.value, bogoUpdated)" />
- <label for='s0'>(1) le filtre anti-spam n'agit pas sur tes emails</label>
- <br />
- <input id='s1' type='radio' name='statut_filtre' value='1' {if $filtre eq 1}checked="checked"{/if} onclick="Ajax.update_html(null, '{$globals->baseurl}/emails/antispam/'+this.value, bogoUpdated)" />
- <label for='s1'>(2) le filtre anti-spam marque les emails</label>
- <br />
- <input id='s2' type='radio' name='statut_filtre' value='2' {if $filtre eq 2}checked="checked"{/if} onclick="Ajax.update_html(null, '{$globals->baseurl}/emails/antispam/'+this.value, bogoUpdated)" />
- <label for='s2'>(3) le filtre anti-spam marque les emails, et élimine les spams avec des notes les plus hautes</label>
- <br />
- <input id='s3' type='radio' name='statut_filtre' value='3' {if $filtre eq 3}checked="checked"{/if} onclick="Ajax.update_html(null, '{$globals->baseurl}/emails/antispam/'+this.value, bogoUpdated)" />
- <label for='s3'>(4) le filtre anti-spam élimine les emails détectés comme spams</label>
- </fieldset>
-
- <div id="bogo-msg" style="position:absolute;"></div><br />
+//]]></script>
+<fieldset>
+ <legend><strong>Choisis ton propre réglage :</strong></legend>
+ {if !$single_state}<span class="erreur">
+ Attention, tu as actuellement un réglage spécifique pour chacune de tes redirections.
+ Les modifications dans ce cadre sont globales et entraineront une uniformisation de
+ l'antispam pour toutes tes redirections au niveau demandé.
+ </span><br />{/if}
+ <input id="s0" type="radio" name="filter_status" value="0" {if $single_state && $filter eq 0}checked="checked"{/if} />
+ <label for="s0"><strong>(0) fais confiance à Polytechnique.org et utilise le réglage recommandé</strong> (actuellement, le niveau {#globals.mail.antispam#})</label>
+ <br />
+ <input id="s1" type="radio" name="filter_status" value="1" {if $single_state && $filter eq 1}checked="checked"{/if} />
+ <label for="s1">(1) le filtre anti-spam n'agit pas sur tes emails</label>
+ <br />
+ <input id="s2" type="radio" name="filter_status" value="2" {if $single_state && $filter eq 2}checked="checked"{/if} />
+ <label for="s2">(2) le filtre anti-spam marque les emails</label>
+ <br />
+ <input id="s3" type="radio" name="filter_status" value="3" {if $single_state && $filter eq 3}checked="checked"{/if} />
+ <label for="s3">(3) le filtre anti-spam marque les emails, et élimine les spams avec des notes les plus hautes</label>
+ <br />
+ <input id="s4" type="radio" name="filter_status" value="4" {if $single_state && $filter eq 4}checked="checked"{/if} />
+ <label for="s4">(4) le filtre anti-spam élimine les emails détectés comme spams</label>
+</fieldset>
+
+<div id="bogo-msg" style="position:absolute;"></div><br />
+
+{if !$single_redirection}
+<h1>Réglages avancés</h1>
+<p>
+ Si tu le souhaites, tu peux adapter le niveau de ton antispam pour chacune de tes redirections. Par exemple,
+ tu peux éliminer tous les spams (niveau 4) vers ton adresse professionnelle, mais ne faire que marquer comme
+ spams (niveau 2) de tels emails vers ton adresse personnelle.
+</p>
+
+<div id="bogo-msg-mult" style="position:absolute;"></div><br />
+
+<table class="bicol">
+ <tr>
+ <th>Redirection</th>
+ <th>Niveau recommandé</th>
+ <th>Niveau 1</th>
+ <th>Niveau 2</th>
+ <th>Niveau 3</th>
+ <th>Niveau 4</th>
+ </tr>
+ {foreach from=$redirections key=i item=redirection}
+ <tr>
+ <td class="titre">
+ {$redirection.redirect|replace:'googleapps':'Compte Google Apps'}
+ <input id="bogo_{$i}" type="hidden" value="{$redirection.redirect}" />
+ </td>
+ <td class="center">
+ <input id="s0_{$i}" type="radio" name="filter_status_{$i}" value="0" {if $redirection.filter eq 0}checked="checked"{/if} />
+ </td>
+ <td class="center">
+ <input id="s1_{$i}" type="radio" name="filter_status_{$i}" value="1" {if $redirection.filter eq 1}checked="checked"{/if} />
+ </td>
+ <td class="center">
+ <input id="s2_{$i}" type="radio" name="filter_status_{$i}" value="2" {if $redirection.filter eq 2}checked="checked"{/if} />
+ </td>
+ <td class="center">
+ <input id="s3_{$i}" type="radio" name="filter_status_{$i}" value="3" {if $redirection.filter eq 3}checked="checked"{/if} />
+ </td>
+ <td class="center">
+ <input id="s4_{$i}" type="radio" name="filter_status_{$i}" value="4" {if $redirection.filter eq 4}checked="checked"{/if} />
+ </td>
+ </tr>
+ {/foreach}
+</table>
+
+<h2>Légende</h2>
+<ul>
+ <li>
+ <strong>Niveau recommandé : fais confiance à Polytechnique.org et utilise le réglage que nous recommandons</strong>
+ (actuellement, le niveau {#globals.mail.antispam#}).
+ </li>
+ <li>
+ Niveau 1 : le filtre anti-spam n'agit pas sur tes emails.
+ </li>
+ <li>
+ Niveau 2 : le filtre anti-spam marque les emails.
+ </li>
+ <li>
+ Niveau 3 : le filtre anti-spam marque les emails, et élimine les spams avec des notes les plus hautes.
+ </li>
+ <li>
+ Niveau 4 : le filtre anti-spam élimine les emails détectés comme spams.
+ </li>
+</ul>
+{/if}
{include wiki=Xorg.Antispam part=2}