Happy New Year!
[platal.git] / templates / include / emails.combobox.tpl
CommitLineData
b715c1e1
SJ
1{**************************************************************************}
2{* *}
c441aabe 3{* Copyright (C) 2003-2014 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&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}
17c6e7bb 38 {if $emails_count neq 0}
4f06d57b 39 <select name="{$name}" id="{$combobox}">
17c6e7bb
SJ
40 {foreach from=$email_lists item=email_list key=key}
41 {if $email_list|@count}
42 <optgroup label="{$key}">
43 {foreach from=$email_list item=email}
541e8d03
SJ
44 <option value="{$email}" {if $val eq $email}selected="selected"{/if}>{$email}</option>
45 {/foreach}
46 </optgroup>
b715c1e1 47 {/if}
17c6e7bb 48 {/foreach}
b715c1e1 49 <optgroup label="Autres choix">
cbbf5ac9 50 <option value="new@example.org" {if ($val eq '' && !$error && $name eq 'email') || $error}selected="selected"{/if}>Nouvelle adresse email</option>
17c6e7bb 51 {if $name neq "email"}<option value="" {if $val eq '' && !$error}selected="selected"{/if}>Ne pas mettre d'adresse email</option>{/if}
b715c1e1
SJ
52 </optgroup>
53 </select>
17c6e7bb
SJ
54 {else}
55 <input type="text" maxlength="255" {if $error}class="error" value="{$val}"{/if} name="{$name}"/>
56 {/if}
541e8d03
SJ
57 {if $name neq "email"}
58 </div>
59 <div style="float: right" class="flags">
b715c1e1
SJ
60 {if $name eq "email_directory"}
61 <input type="checkbox" disabled="disabled" checked="checked"/>
62 {icon name="flag_orange" title="Visible sur l'annuaire"}
541e8d03 63 {elseif $name neq "email"}
6fc390c7
SJ
64 {if t($mainField)}
65 {include file="include/flags.radio.tpl" name="`$jobpref`[`$prefix`email_pub]" val=$pub
66 mainField=$mainField mainId=$mainId subField=$subField subId=$subId}
67 {else}
541e8d03
SJ
68 {include file="include/flags.radio.tpl" name="`$jobpref`[`$prefix`email_pub]" val=$pub}
69 {/if}
6fc390c7 70 {/if}
541e8d03 71 </div>
b715c1e1 72 {/if}
541e8d03
SJ
73 </td>
74 {if $name eq "email"}<td></td>{/if}
75</tr>
76<tr {if $class}class="{$class} {$new}"{else}class="{$new}"{/if} style="display: none">
77 <td></td>
78 {if $name eq "email"}<td></td>{/if}
79 <td>
4f06d57b 80 <span class="{$new}" style="display: none">
cce8e893 81 <input type="text" maxlength="255" {if $error}class="error" value="{$val}"{/if} name="{if (($name neq "email_directory")
c7139c07 82 && ($name neq "email"))}jobs[{$i}][{$prefix}email_new]{else}{$name}_new{/if}"/>
b715c1e1
SJ
83 </span>
84 <script type="text/javascript">//<![CDATA[
85 {literal}
86 $(function() {
4f06d57b
SJ
87 var i = {/literal}{$i}{literal};
88 $('select#combobox' + i).change(function() {
89 $('.new' + i).hide();
90 if ($('select#combobox' + i).val() == "new@example.org") {
91 $('.new' + i).show();
b715c1e1
SJ
92 }
93 }).change();
94 });
95 {/literal}
96 // ]]></script>
97 </td>
98 {if $name eq "email"}<td></td>{/if}
99</tr>
100{if $name neq "email"}
541e8d03
SJ
101<tr {if $class}class="{$class} {$new}"{else}class="{$new}"{/if} style="display: none">
102 <td colspan="2">
103 <small><strong><em>Attention :</em></strong> cette adresse email figurera dans
104 {if $name eq "email_directory"}l'annuaire papier{else}tes informations professionnelles
105 {/if} mais n'est pas ajoutée à la liste de tes redirections. Nous te conseillons fortement de
106 <strong><a href="emails/redirect">l'ajouter là</a></strong>, surtout
107 si tu n'en as plus de valide.</small>
108 </td>
109</tr>
b715c1e1
SJ
110{/if}
111
112{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}