Merge branch 'fusionax' of /home/git/platal into fusionax
[platal.git] / templates / include / emails.combobox.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2008 Polytechnique.org                             *}
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
23 <tr {if $class}class="{$class}"{/if}>
24   <td>
25     <span class="titre">{if $name eq "email_directory"}Email annuaire AX
26     {elseif $name eq "email"}Ajouter une adresse email{else}
27     Email professionnel{/if}</span>
28   </td>
29   {if $name eq "email"}<td></td>{/if}
30   <td>
31     <select name="{$name}" id="combobox">
32       {if $email_type eq "directory"}
33         <optgroup label="Email annuaire AX">
34           <option value="{$email_directory}" {if
35           $val eq $email_directory}selected="selected"{/if}>{$email_directory}</option>
36         </optgroup>
37       {/if}
38       {if $name eq "email_directory"}
39         <optgroup label="Emails polytechniciens">
40           {if $melix}
41             <option value="{$melix}@{#globals.mail.alias_dom#}" {if
42             $val eq $melix|cat:'@'|cat:#globals.mail.alias_dom#}selected="selected"{/if}>
43             {$melix}@{#globals.mail.alias_dom#}</option>
44             <option value="{$melix}@{#globals.mail.alias_dom2#}" {if
45             $val eq $melix|cat:'@'|cat:#globals.mail.alias_dom2#}selected="selected"{/if}>
46             {$melix}@{#globals.mail.alias_dom2#}</option>
47           {/if}
48           {foreach from=$list_email_X item=email}
49             <option value="{$email.alias}@{#globals.mail.domain#}" {if
50             $val eq $email.alias|cat:'@'|cat:#globals.mail.domain#}selected="selected"{/if}>
51             {$email.alias}@{#globals.mail.domain#}</option>
52             <option value="{$email.alias}@{#globals.mail.domain2#}" {if
53             $val eq $email.alias|cat:'@'|cat:#globals.mail.domain2#}selected="selected"{/if}>
54             {$email.alias}@{#globals.mail.domain2#}</option>
55           {/foreach}
56         </optgroup>
57       {/if}
58       {if (($name neq "email") && ($list_email_redir|@count neq 0))}
59         <optgroup label="Redirections">
60           {foreach from=$list_email_redir item=email}
61             <option value="{$email}" {if $val eq $email}selected="selected"{/if}>{$email}</option>
62           {/foreach}
63         </optgroup>
64       {/if}
65       {if $list_email_pro|@count neq 0}
66         <optgroup label="Emails professionels">
67           {foreach from=$list_email_pro item=email}
68             <option value="{$email}" {if
69             $val eq $email}selected="selected"{/if}>{$email}</option>
70           {/foreach}
71         </optgroup>
72       {/if}
73       <optgroup label="Autres choix">
74         <option value="new@example.org" {if $error}selected="selected"{/if}>Utiliser une autre adresse email</option>
75         <option value="" {if (($val eq '') && (!$error))}selected="selected"{/if}>{if
76         $name neq "email"}Ne pas mettre d'adresse email{else}&nbsp;{/if}</option>
77       </optgroup>
78     </select>
79     {if $name eq "email_directory"}
80       <input type="checkbox" disabled="disabled" checked="checked"/>
81       {icon name="flag_orange" title="Visible sur l'annuaire"}
82     {elseif $name neq "email"}
83       <span class="flags">
84         {include file="include/flags.radio.tpl" name="`$jobpref`[email_pub]" val=$job.mail_pub}
85       </span>
86     {/if}
87     <br />
88     <span class="new" style="display: none">
89       <input type="text" maxlength="60" {if $error}class="error" value="{$val}"{/if} name="{if (($name neq "email_directory")
90       && ($name neq "email"))}jobs[{$i}][email_new]{else}{$name}_new{/if}"/>
91     </span>
92     <script type="text/javascript">//<![CDATA[
93       {literal}
94       $(function() {
95         $("select#combobox").change(function() {
96           $(".new").hide();
97           if ($("select#combobox").val() == "new@example.org") {
98             $(".new").show();
99           }
100         }).change();
101       });
102       {/literal}
103     // ]]></script>
104   </td>
105   {if $name eq "email"}<td></td>{/if}
106 </tr>
107 {if $name neq "email"}
108   <tr {if $class}class="{$class}"{/if} class="new" style="display: none">
109     <td colspan="2">
110       <p><small><strong><em>Attention :</em></strong> cette adresse email figurera dans
111       {if $name eq "email_directory"}l'annuaire papier{else}tes informations professionnelles
112       {/if} mais n'est pas ajoutée à la liste de tes redirections. Nous te conseillons fortement de
113       <strong><a href="emails/redirect">l'ajouter là</a></strong>, surtout
114       si tu n'en as plus de valide.</small></p>
115     </td>
116   </tr>
117 {/if}
118
119 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}