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 {**************************************************************************}
24 <script type="text/javascript">//<![CDATA[
26 var subgrades = new array();
27 var names = new array();
31 var val = document.forms.prof_annu['medal_sel'].value;
32 if (val == '' || document.getElementById('medal_' + val) != null) {
33 document.getElementById('medal_add').style.display = 'none';
35 document.getElementById('medal_add').style.display = '';
39 function getMedalName(id)
41 document.getElementById('medal_name_' + id).innerHTML = names[id];
44 function buildGrade(id, current)
47 var subg = subgrades[id];
48 var obj = $('#medal_grade_' + id);
50 obj.prepend('<input type="hidden" name="medals[' + id + '][grade]" value="0" />');
52 var html = 'Agrafe : <select name="medals[' + id + '][grade]">';
53 html += '<option value="0">Non précisée</option>';
54 for (grade = 0 ; grade < subg.length ; grade++) {
55 html += '<option value="' + subg[grade][0] + '">' + subg[grade][1] + '</option>';
65 var id = document.forms.prof_annu['medal_sel'].value;
66 $.get(platal_baseurl + 'profile/ajax/medal/' + id,
67 function(data) { $('#medals').after(data); update(); });
72 $("#medal_" + id).remove();
76 {foreach from=$medal_list key=type item=list}
77 {foreach from=$list item=m}
78 names[{$m.id}] = "{$m.text}";
79 {if $grades[$m.id]|@count}
80 names[{$m.id}] = "{$m.text}";
81 subgrades[{$m.id}] = new array({$grades[$m.id]|@count});
82 {foreach from=$grades[$m.id] item=g}
83 subgrades[{$m.id}][{$g.gid-1}] = [{$g.gid},"{$g.text}"];
92 Médailles, Décorations, Prix, ...
98 <div class="vert" style="float: left">
99 <input type="checkbox" name="medals_pub"{if $medals_pub eq 'public'} checked="checked"{/if} />
102 ces informations sont normalement publiques (JO, ...) mais tu peux choisir de les associer a ta fiche publique
105 <div style="clear: both; margin-top: 0.2em" id="medals">
106 <select name="medal_sel" onchange="update()">
107 <option value=''></option>
108 {foreach from=$medal_list key=type item=list}
109 <optgroup label="{$trad[$type]}...">
110 {foreach from=$list item=m}
111 <option value="{$m.id}">{$m.text}</option>
116 <span id="medal_add">
117 <a href="javascript:add();">{icon name=add title="Ajouter cette médaille"}</a>
120 {foreach from=$medals item=medal key=id}
121 {include file="profile/deco.medal.tpl" medal=$medal id=$id}
127 <script type="text/javascript">
131 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}