Only uses autoload to require validation classes.
[platal.git] / templates / include / emails.combobox.tpl
CommitLineData
b715c1e1
SJ
1{**************************************************************************}
2{* *}
d4c08d89 3{* Copyright (C) 2003-2010 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}
b715c1e1 25<tr {if $class}class="{$class}"{/if}>
541e8d03
SJ
26 <td class="titre">
27 {if $name eq "email_directory"}
0fbd1f3f 28 Email&nbsp;annuaire&nbsp;AX
541e8d03
SJ
29 {elseif $name eq "email"}
30 Ajouter&nbsp;une&nbsp;adresse&nbsp;email
31 {else}
32 Email&nbsp;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
SJ
46 <optgroup label="Emails polytechniciens">
47 {if $melix}
48 <option value="{$melix}@{#globals.mail.alias_dom#}" {if
49 $val eq $melix|cat:'@'|cat:#globals.mail.alias_dom#}selected="selected"{/if}>
50 {$melix}@{#globals.mail.alias_dom#}</option>
51 <option value="{$melix}@{#globals.mail.alias_dom2#}" {if
52 $val eq $melix|cat:'@'|cat:#globals.mail.alias_dom2#}selected="selected"{/if}>
53 {$melix}@{#globals.mail.alias_dom2#}</option>
54 {/if}
55 {foreach from=$list_email_X item=email}
56 <option value="{$email.alias}@{#globals.mail.domain#}" {if
57 $val eq $email.alias|cat:'@'|cat:#globals.mail.domain#}selected="selected"{/if}>
58 {$email.alias}@{#globals.mail.domain#}</option>
59 <option value="{$email.alias}@{#globals.mail.domain2#}" {if
60 $val eq $email.alias|cat:'@'|cat:#globals.mail.domain2#}selected="selected"{/if}>
61 {$email.alias}@{#globals.mail.domain2#}</option>
62 {/foreach}
63 </optgroup>
b715c1e1
SJ
64 {/if}
65 {if (($name neq "email") && ($list_email_redir|@count neq 0))}
541e8d03
SJ
66 <optgroup label="Redirections">
67 {foreach from=$list_email_redir item=email}
68 <option value="{$email}" {if $val eq $email}selected="selected"{/if}>{$email}</option>
69 {/foreach}
70 </optgroup>
b715c1e1
SJ
71 {/if}
72 {if $list_email_pro|@count neq 0}
541e8d03
SJ
73 <optgroup label="Emails professionels">
74 {foreach from=$list_email_pro item=email}
75 <option value="{$email}" {if
76 $val eq $email}selected="selected"{/if}>{$email}</option>
77 {/foreach}
78 </optgroup>
b715c1e1
SJ
79 {/if}
80 <optgroup label="Autres choix">
cbbf5ac9
SJ
81 <option value="new@example.org" {if ($val eq '' && !$error && $name eq 'email') || $error}selected="selected"{/if}>Nouvelle adresse email</option>
82 <option value="" {if $val eq '' && !$error && $name neq 'email'}selected="selected"{/if}>{if $name neq "email"}Ne pas mettre d'adresse email{else}&nbsp;{/if}</option>
b715c1e1
SJ
83 </optgroup>
84 </select>
541e8d03
SJ
85 {if $name neq "email"}
86 </div>
87 <div style="float: right" class="flags">
b715c1e1
SJ
88 {if $name eq "email_directory"}
89 <input type="checkbox" disabled="disabled" checked="checked"/>
90 {icon name="flag_orange" title="Visible sur l'annuaire"}
541e8d03
SJ
91 {elseif $name neq "email"}
92 {include file="include/flags.radio.tpl" name="`$jobpref`[`$prefix`email_pub]" val=$pub}
93 {/if}
94 </div>
b715c1e1 95 {/if}
541e8d03
SJ
96 </td>
97 {if $name eq "email"}<td></td>{/if}
98</tr>
99<tr {if $class}class="{$class} {$new}"{else}class="{$new}"{/if} style="display: none">
100 <td></td>
101 {if $name eq "email"}<td></td>{/if}
102 <td>
4f06d57b 103 <span class="{$new}" style="display: none">
b715c1e1 104 <input type="text" maxlength="60" {if $error}class="error" value="{$val}"{/if} name="{if (($name neq "email_directory")
c7139c07 105 && ($name neq "email"))}jobs[{$i}][{$prefix}email_new]{else}{$name}_new{/if}"/>
b715c1e1
SJ
106 </span>
107 <script type="text/javascript">//<![CDATA[
108 {literal}
109 $(function() {
4f06d57b
SJ
110 var i = {/literal}{$i}{literal};
111 $('select#combobox' + i).change(function() {
112 $('.new' + i).hide();
113 if ($('select#combobox' + i).val() == "new@example.org") {
114 $('.new' + i).show();
b715c1e1
SJ
115 }
116 }).change();
117 });
118 {/literal}
119 // ]]></script>
120 </td>
121 {if $name eq "email"}<td></td>{/if}
122</tr>
123{if $name neq "email"}
541e8d03
SJ
124<tr {if $class}class="{$class} {$new}"{else}class="{$new}"{/if} style="display: none">
125 <td colspan="2">
126 <small><strong><em>Attention :</em></strong> cette adresse email figurera dans
127 {if $name eq "email_directory"}l'annuaire papier{else}tes informations professionnelles
128 {/if} mais n'est pas ajoutée à la liste de tes redirections. Nous te conseillons fortement de
129 <strong><a href="emails/redirect">l'ajouter là</a></strong>, surtout
130 si tu n'en as plus de valide.</small>
131 </td>
132</tr>
b715c1e1
SJ
133{/if}
134
135{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}