1 {**************************************************************************}
3 {* Copyright (C) 2003-2006 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 selid = document.forms.prof_annu.medal_sel.selectedIndex;
29 document.forms.prof_annu.medal_id.value = document.forms.prof_annu.medal_sel.options[selid].value;
30 document.forms.prof_annu.grade_id.value = document.forms.prof_annu.grade_sel.value;
31 document.forms.prof_annu.medal_op.value = "ajouter";
32 document.forms.prof_annu.submit();
35 function medal_del( id )
37 document.forms.prof_annu.medal_id.value = id;
38 document.forms.prof_annu.medal_op.value = "retirer";
39 document.forms.prof_annu.submit();
42 function medal_cancel(stamp)
44 document.forms.prof_annu.medal_id.value = stamp;
45 document.forms.prof_annu.medal_op.value = "annuler";
46 document.forms.prof_annu.submit();
48 var subgrades = new array();
49 function getoption( select_input, j)
53 return select_input.options[j];
60 function medal_grades( sel_medal )
62 var subg = subgrades[sel_medal.selectedIndex];
63 document.getElementById("grade_sel_div").style.display = subg?"inline":"none";
65 var select = document.getElementById("grade_sel");
66 while (select.length > 1)
71 for (i=0; i < subg.length; i++)
73 var dmc = document.createElement("option");
75 dmc.value = subg[i][0];
76 select.add(dmc,getoption(select,i));
78 var vide = document.createElement("option");
81 select.add(vide,getoption(select,0));
82 select.remove(subg.length+1);
86 {foreach from=$medal_list key=type item=list}
87 {foreach from=$list item=m}{if $grades[$m.id]|@count}
88 subgrades[{$m.id}] = new array({$grades[$m.id]|@count});
90 {foreach from=$grades[$m.id] item=g}
91 subgrades[{$m.id}][i] = [{$g.gid},"{$g.text}"];
99 {if $smarty.request.medal_op eq "ajouter"}
101 Ta demande a bien été prise en compte, elle sera validée prochainement par un administrateur.
104 <div class="blocunite_tab">
105 <input type="hidden" value="" name="medal_op" />
106 <input type="hidden" value="" name="medal_id" />
107 <input type="hidden" value="" name="grade_id" />
108 <table class="bicol" cellspacing="0" cellpadding="0">
111 Médailles, Décorations, Prix, ...
115 <td colspan="3" class="pflags">
116 <table class="flags" summary="Flags" cellpadding="0" cellspacing="0">
119 <input type="checkbox" name="medals_pub"{if $medals_pub eq 'public'} checked="checked"{/if} />
122 ces informations sont normalement publiques (JO, ...) mais tu peux choisir de les associer a ta fiche publique
128 {foreach from=$medals item=m}
131 <img src='images/medals/{$m.img}' width="32" alt="{$m.medal}" title="{$m.medal}" />
134 <span class="valeur">{$m.medal}</span><br />
135 {if $grades[$m.id]|@count}
136 {foreach from=$grades[$m.id] item=g}
137 {if $g.gid eq $m.gid}{$g.text}{/if}
143 <a href="javascript:medal_del({$m.id});">retirer</a>
148 {foreach from=$medals_valid item=v}
152 {foreach from=$medal_list item=list}
153 {foreach from=$list item=m}
154 {if $m.id eq $v->mid}src="images/medals/{$m.img}"{/if}
157 title="Validation" alt="Validation" width="32" />
159 <span class="valeur">
160 {foreach from=$medal_list item=list}
161 {foreach from=$list item=m}
162 {if $m.id eq $v->mid}{$m.text} <em>(en attente de validation)</em>{/if}
166 {foreach from=$grades key=mid item=grd}
168 {foreach from=$grd item=g}
169 {if $g.gid eq $v->gid}{$g.text}{/if}
176 <a href="javascript:medal_cancel({$v->stamp});">annuler</a>
186 <select name="medal_sel" onchange="medal_grades(this)">
187 <option value=''></option>
188 {foreach from=$medal_list key=type item=list}
189 <optgroup label="{$trad[$type]}">
190 {foreach from=$list item=m}
191 <option value="{$m.id}">{$m.text}</option>
196 <div id="grade_sel_div" style="display:none"><br/>
197 <select name="grade_sel" id="grade_sel">
198 <option value="0"></option>
204 <a href="javascript:medal_add();">ajouter</a>
211 {* vim:set et sw=2 sts=2 sws=2: *}