1 {**************************************************************************}
3 {* Copyright (C) 2003-2007 Polytechnique.org *}
4 {* http://opensource.polytechnique.org/ *}
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. *}
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. *}
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 *}
21 {**************************************************************************}
25 <script type="text/javascript">//<![CDATA[
28 var val = document.forms.prof_annu['medal_sel'].value;
29 if (val == '' || document.getElementById('medal_' + val) != null) {
30 document.getElementById('medal_add').display.style = 'none';
32 document.getElementById('medal_add').display.style = '';
36 var valid = new array();
39 var selid = document.forms.prof_annu.medal_sel.selectedIndex;
40 document.forms.prof_annu.medal_id.value = document.forms.prof_annu.medal_sel.options[selid].value;
41 document.forms.prof_annu.grade_id.value = document.forms.prof_annu.grade_sel.value;
42 document.forms.prof_annu.medal_op.value = "ajouter";
43 document.forms.prof_annu.submit();
46 function medal_del( id )
48 document.forms.prof_annu.medal_id.value = id;
49 document.forms.prof_annu.medal_op.value = "retirer";
50 document.forms.prof_annu.submit();
53 function medal_cancel(stamp)
55 document.forms.prof_annu.medal_id.value = stamp;
56 document.forms.prof_annu.medal_op.value = "annuler";
57 document.forms.prof_annu.submit();
59 var subgrades = new array();
60 function getoption( select_input, j)
64 return select_input.options[j];
71 function medal_grades( sel_medal )
73 var subg = subgrades[sel_medal.selectedIndex];
74 document.getElementById("grade_sel_div").style.display = subg?"inline":"none";
76 var select = document.getElementById("grade_sel");
77 while (select.length > 1)
82 for (i=0; i < subg.length; i++)
84 var dmc = document.createElement("option");
86 dmc.value = subg[i][0];
87 select.add(dmc,getoption(select,i));
89 var vide = document.createElement("option");
92 select.add(vide,getoption(select,0));
93 select.remove(subg.length+1);
97 {foreach from=$medal_list key=type item=list}
98 {foreach from=$list item=m}{if $grades[$m.id]|@count}
99 subgrades[{$m.id}] = new array({$grades[$m.id]|@count});
101 {foreach from=$grades[$m.id] item=g}
102 subgrades[{$m.id}][i] = [{$g.gid},"{$g.text}"];
110 <table class="bicol">
113 Médailles, Décorations, Prix, ...
119 <div class="vert" style="float: left">
120 <input type="checkbox" name="medals_pub"{if $medals_pub eq 'public'} checked="checked"{/if} />
123 ces informations sont normalement publiques (JO, ...) mais tu peux choisir de les associer a ta fiche publique
126 <div style="clear: both; margin-top: 0.2em">
127 <select name="medal_sel" onchange="update()">
128 <option value=''></option>
129 {foreach from=$medal_list key=type item=list}
130 <optgroup label="{$trad[$type]}...">
131 {foreach from=$list item=m}
132 <option value="{$m.id}">{$m.text}</option>
137 <span id="medal_add">
138 <a href="javascript:add();">{icon name=add title="Ajouter cette médaille"}</a>
141 {foreach from=$medals item=medal key=id}
142 {include file="profile/deco.medal.tpl" medal=$medal id=$id}
148 <script type="text/javascript">
152 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}