Commit | Line | Data |
---|---|---|
b715c1e1 SJ |
1 | {**************************************************************************} |
2 | {* *} | |
5e1513f6 | 3 | {* Copyright (C) 2003-2011 Polytechnique.org *} |
b715c1e1 SJ |
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 | ||
4f06d57b SJ |
23 | {assign var=new value="new"|cat:$i} |
24 | {assign var=combobox value="combobox"|cat:$i} | |
6fc390c7 | 25 | <tr{if $class} class="{$class}"{/if}{if t($divId)} id="{$divId}"{/if}> |
541e8d03 SJ |
26 | <td class="titre"> |
27 | {if $name eq "email_directory"} | |
0fbd1f3f | 28 | Email annuaire AX |
541e8d03 SJ |
29 | {elseif $name eq "email"} |
30 | Ajouter une adresse email | |
31 | {else} | |
32 | Email professionnel | |
33 | {/if} | |
b715c1e1 SJ |
34 | </td> |
35 | {if $name eq "email"}<td></td>{/if} | |
36 | <td> | |
541e8d03 | 37 | {if $name neq "email"}<div style="float: left">{/if} |
4f06d57b | 38 | <select name="{$name}" id="{$combobox}"> |
b715c1e1 | 39 | {if $email_type eq "directory"} |
541e8d03 SJ |
40 | <optgroup label="Email annuaire AX"> |
41 | <option value="{$email_directory}" {if | |
42 | $val eq $email_directory}selected="selected"{/if}>{$email_directory}</option> | |
43 | </optgroup> | |
b715c1e1 SJ |
44 | {/if} |
45 | {if $name eq "email_directory"} | |
541e8d03 | 46 | <optgroup label="Emails polytechniciens"> |
541e8d03 | 47 | {foreach from=$list_email_X item=email} |
b4503762 | 48 | <option value="{$email.email}" {if $val eq $email.email}selected="selected"{/if}>{$email.email}</option> |
541e8d03 SJ |
49 | {/foreach} |
50 | </optgroup> | |
b715c1e1 SJ |
51 | {/if} |
52 | {if (($name neq "email") && ($list_email_redir|@count neq 0))} | |
541e8d03 SJ |
53 | <optgroup label="Redirections"> |
54 | {foreach from=$list_email_redir item=email} | |
55 | <option value="{$email}" {if $val eq $email}selected="selected"{/if}>{$email}</option> | |
56 | {/foreach} | |
57 | </optgroup> | |
b715c1e1 SJ |
58 | {/if} |
59 | {if $list_email_pro|@count neq 0} | |
541e8d03 SJ |
60 | <optgroup label="Emails professionels"> |
61 | {foreach from=$list_email_pro item=email} | |
62 | <option value="{$email}" {if | |
63 | $val eq $email}selected="selected"{/if}>{$email}</option> | |
64 | {/foreach} | |
65 | </optgroup> | |
b715c1e1 SJ |
66 | {/if} |
67 | <optgroup label="Autres choix"> | |
cbbf5ac9 SJ |
68 | <option value="new@example.org" {if ($val eq '' && !$error && $name eq 'email') || $error}selected="selected"{/if}>Nouvelle adresse email</option> |
69 | <option value="" {if $val eq '' && !$error && $name neq 'email'}selected="selected"{/if}>{if $name neq "email"}Ne pas mettre d'adresse email{else} {/if}</option> | |
b715c1e1 SJ |
70 | </optgroup> |
71 | </select> | |
541e8d03 SJ |
72 | {if $name neq "email"} |
73 | </div> | |
74 | <div style="float: right" class="flags"> | |
b715c1e1 SJ |
75 | {if $name eq "email_directory"} |
76 | <input type="checkbox" disabled="disabled" checked="checked"/> | |
77 | {icon name="flag_orange" title="Visible sur l'annuaire"} | |
541e8d03 | 78 | {elseif $name neq "email"} |
6fc390c7 SJ |
79 | {if t($mainField)} |
80 | {include file="include/flags.radio.tpl" name="`$jobpref`[`$prefix`email_pub]" val=$pub | |
81 | mainField=$mainField mainId=$mainId subField=$subField subId=$subId} | |
82 | {else} | |
541e8d03 SJ |
83 | {include file="include/flags.radio.tpl" name="`$jobpref`[`$prefix`email_pub]" val=$pub} |
84 | {/if} | |
6fc390c7 | 85 | {/if} |
541e8d03 | 86 | </div> |
b715c1e1 | 87 | {/if} |
541e8d03 SJ |
88 | </td> |
89 | {if $name eq "email"}<td></td>{/if} | |
90 | </tr> | |
91 | <tr {if $class}class="{$class} {$new}"{else}class="{$new}"{/if} style="display: none"> | |
92 | <td></td> | |
93 | {if $name eq "email"}<td></td>{/if} | |
94 | <td> | |
4f06d57b | 95 | <span class="{$new}" style="display: none"> |
cce8e893 | 96 | <input type="text" maxlength="255" {if $error}class="error" value="{$val}"{/if} name="{if (($name neq "email_directory") |
c7139c07 | 97 | && ($name neq "email"))}jobs[{$i}][{$prefix}email_new]{else}{$name}_new{/if}"/> |
b715c1e1 SJ |
98 | </span> |
99 | <script type="text/javascript">//<![CDATA[ | |
100 | {literal} | |
101 | $(function() { | |
4f06d57b SJ |
102 | var i = {/literal}{$i}{literal}; |
103 | $('select#combobox' + i).change(function() { | |
104 | $('.new' + i).hide(); | |
105 | if ($('select#combobox' + i).val() == "new@example.org") { | |
106 | $('.new' + i).show(); | |
b715c1e1 SJ |
107 | } |
108 | }).change(); | |
109 | }); | |
110 | {/literal} | |
111 | // ]]></script> | |
112 | </td> | |
113 | {if $name eq "email"}<td></td>{/if} | |
114 | </tr> | |
115 | {if $name neq "email"} | |
541e8d03 SJ |
116 | <tr {if $class}class="{$class} {$new}"{else}class="{$new}"{/if} style="display: none"> |
117 | <td colspan="2"> | |
118 | <small><strong><em>Attention :</em></strong> cette adresse email figurera dans | |
119 | {if $name eq "email_directory"}l'annuaire papier{else}tes informations professionnelles | |
120 | {/if} mais n'est pas ajoutée à la liste de tes redirections. Nous te conseillons fortement de | |
121 | <strong><a href="emails/redirect">l'ajouter là</a></strong>, surtout | |
122 | si tu n'en as plus de valide.</small> | |
123 | </td> | |
124 | </tr> | |
b715c1e1 SJ |
125 | {/if} |
126 | ||
127 | {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} |