Ajout : ./garradin
[garradin.git] / templates / admin / membres / cotisations / gestion / rappels.tpl
1 {include file="admin/_head.tpl" title="Gestion des rappels automatiques" current="membres/cotisations" js=1}
2
3 <ul class="actions">
4 <li><a href="{$admin_url}membres/cotisations/">Cotisations</a></li>
5 <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li>
6 <li class="current"><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li>
7 </ul>
8
9 <p class="help">
10 Les rappels automatiques sont envoyés aux membres disposant d'une adresse e-mail
11 selon le délai défini. Il est possible de définir plusieurs rappels pour une même cotisation.
12 </p>
13
14 {if empty($liste)}
15 <p class="alert">Aucun rappel automatique n'est enregistré.</p>
16 {else}
17 <table class="list">
18 <thead>
19 <td>Cotisation</td>
20 <td>Délai de rappel</td>
21 <th>Sujet</th>
22 <td></td>
23 </thead>
24 <tbody>
25 {foreach from=$liste item="rappel"}
26 <tr>
27 <td>
28 {$rappel.intitule|escape}
29 — {$rappel.montant|html_money} {$config.monnaie|escape}
30 — {if $rappel.duree}pour {$rappel.duree|escape} jours
31 {elseif $rappel.debut}
32 du {$rappel.debut|format_sqlite_date_to_french} au {$rappel.fin|format_sqlite_date_to_french}
33 {else}
34 ponctuelle
35 {/if}
36 </td>
37 <td>
38 {if $rappel.delai == 0}le jour de l'expiration
39 {else}
40 {$rappel.delai|abs|escape}
41 {if abs($rappel.delai) > 1}jours{else}jour{/if}
42 {if $rappel.delai > 0}après{else}avant{/if}
43 expiration
44 {/if}
45 </td>
46 <th><a href="{$admin_url}membres/cotisations/rappel.php?id={$rappel.id|escape}">{$rappel.sujet|escape}</a></th>
47 <td class="actions">
48 <a class="icn" href="{$admin_url}membres/cotisations/gestion/rappel_modifier.php?id={$rappel.id|escape}" title="Modifier">✎</a>
49 <a class="icn" href="{$admin_url}membres/cotisations/gestion/rappel_supprimer.php?id={$rappel.id|escape}" title="Supprimer">✘</a>
50 </td>
51 </tr>
52 {/foreach}
53 </tbody>
54 </table>
55 {/if}
56
57 {if $error}
58 <p class="error">
59 {$error|escape}
60 </p>
61 {/if}
62
63 <form method="post" action="{$self_url|escape}" id="f_add">
64
65 <fieldset>
66 <legend>Ajouter un rappel automatique</legend>
67 <dl>
68 <dt><label for="f_id_cotisation">Cotisation associée</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
69 <dd>
70 <select name="id_cotisation" id="f_id_cotisation" required="required">
71 <option value="">--</option>
72 {foreach from=$cotisations item="co"}
73 <option value="{$co.id|escape}" {form_field name="id_cotisation" selected=$co.id}>
74 {$co.intitule|escape}
75 — {$co.montant|html_money} {$config.monnaie|escape}
76 — {if $co.duree}pour {$co.duree|escape} jours
77 {elseif $co.debut}
78 du {$co.debut|format_sqlite_date_to_french} au {$co.fin|format_sqlite_date_to_french}
79 {else}
80 ponctuelle
81 {/if}
82 </option>
83 {/foreach}
84 </select>
85 </dd>
86 <dt><label for="f_sujet">Sujet du mail</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
87 <dd><input type="text" name="sujet" id="f_sujet" value="{form_field name=sujet default=$default_subject}" required="required" size="50" /></dd>
88 <dt><label for="f_delai">Délai d'envoi</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
89 <dd><label><input type="radio" name="delai_choix" value="0" {form_field name="delai_choix" checked=0 default=0} /> Le jour de l'expiration de la cotisation</label></dd>
90 <dd>
91 <input type="radio" name="delai_choix" id="f_delai_pre" value="-1" {form_field name="delai_choix" checked=-1} />
92 <input type="number" name="delai_pre" id="f_delai_pre_nb" step="1" min="1" max="900" size="4" id="f_delai" value="{form_field name=delai_pre default=30}" />
93 <label for="f_delai_pre">jours avant expiration</label>
94 </dd>
95 <dd>
96 <input type="radio" name="delai_choix" id="f_delai_post" value="1" {form_field name="delai_choix" checked=1} />
97 <input type="number" name="delai_post" id="f_delai_post_nb" step="1" min="1" max="900" size="4" id="f_delai" value="{form_field name=delai_post default=30}" />
98 <label for="f_delai_post">jours après expiration</label>
99 </dd>
100 <dt><label for="f_texte">Texte du mail</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
101 <dd><textarea name="texte" id="f_texte" cols="70" rows="15" required="required">{form_field name=texte default=$default_text}</textarea></dd>
102 <dd class="help">Astuce : pour inclure dans le contenu du mail le nom du membre, utilisez #IDENTITE, pour inclure le délai de l'envoi utilisez #NB_JOURS.</dd>
103 </dl>
104 </fieldset>
105
106 <p class="submit">
107 {csrf_field key="new_rappel"}
108 <input type="submit" name="save" value="Ajouter &rarr;" />
109 </p>
110
111 </form>
112
113 <script type="text/javascript">
114 {literal}
115 (function () {
116 $('#f_delai_pre_nb').onclick = function () {
117 $('#f_delai_pre').checked = true;
118 };
119 $('#f_delai_post_nb').onclick = function () {
120 $('#f_delai_post').checked = true;
121 };
122 })();
123 {/literal}
124 </script>
125
126 {include file="admin/_foot.tpl"}