-
-{literal}
-<script type="text/javascript">//<![CDATA[
-function update()
-{
- var val = document.forms.prof_annu['medal_sel'].value;
- if (val == '' || document.getElementById('medal_' + val) != null) {
- document.getElementById('medal_add').display.style = 'none';
- } else {
- document.getElementById('medal_add').display.style = '';
- }
-}
-
- var valid = new array();
- function medal_add()
- {
- var selid = document.forms.prof_annu.medal_sel.selectedIndex;
- document.forms.prof_annu.medal_id.value = document.forms.prof_annu.medal_sel.options[selid].value;
- document.forms.prof_annu.grade_id.value = document.forms.prof_annu.grade_sel.value;
- document.forms.prof_annu.medal_op.value = "ajouter";
- document.forms.prof_annu.submit();
- }
-
- function medal_del( id )
- {
- document.forms.prof_annu.medal_id.value = id;
- document.forms.prof_annu.medal_op.value = "retirer";
- document.forms.prof_annu.submit();
- }
-
- function medal_cancel(stamp)
- {
- document.forms.prof_annu.medal_id.value = stamp;
- document.forms.prof_annu.medal_op.value = "annuler";
- document.forms.prof_annu.submit();
- }
- var subgrades = new array();
- function getoption( select_input, j)
- {
- if (!document.all)
- {
- return select_input.options[j];
- }
- else
- {
- return j;
- }
- }
- function medal_grades( sel_medal )
- {
- var subg = subgrades[sel_medal.selectedIndex];
- document.getElementById("grade_sel_div").style.display = subg?"inline":"none";
- if (!subg) return;
- var select = document.getElementById("grade_sel");
- while (select.length > 1)
- {
- select.remove(1);
- }
-
- for (i=0; i < subg.length; i++)
- {
- var dmc = document.createElement("option");
- dmc.text= subg[i][1];
- dmc.value = subg[i][0];
- select.add(dmc,getoption(select,i));
- }
- var vide = document.createElement("option");
- vide.text = "";
- vide.value = 0;
- select.add(vide,getoption(select,0));
- select.remove(subg.length+1);
- }
- //]]>
-{/literal}
-{foreach from=$medal_list key=type item=list}
- {foreach from=$list item=m}{if $grades[$m.id]|@count}
- subgrades[{$m.id}] = new array({$grades[$m.id]|@count});
- i = 0;
- {foreach from=$grades[$m.id] item=g}
- subgrades[{$m.id}][i] = [{$g.gid},"{$g.text}"];
- i++;
- {/foreach}
- {/if}{/foreach}
-{/foreach}
-
-</script>
-