Replace sectors by job terms in profile and search (job and mentoring).
[platal.git] / templates / profile / jobs.tpl
index 46fe55c..1146519 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2010 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 {*                                                                        *}
 {**************************************************************************}
 
-<script type="text/javascript">//<![CDATA[
-{literal}
-
-function removeJob(id, pref)
-{
-  document.getElementById(id + '_cont').style.display = 'none';
-  if (document.forms.prof_annu[pref + '[new]'].value == '0') {
-    document.getElementById(id + '_grayed').style.display = '';
-    document.getElementById(id + '_grayed_name').innerHTML =
-      document.forms.prof_annu[pref + "[name]"].value.replace('<', '&lt;');
-  }
-  document.forms.prof_annu[pref + "[removed]"].value = "1";
-}
-
-function restoreJob(id, pref)
-{
-  document.getElementById(id + '_cont').style.display = '';
-  document.getElementById(id + '_grayed').style.display = 'none';
-  document.forms.prof_annu[pref + "[removed]"].value = "0";
-}
-
-function updateSecteur(nb, id, pref, sel)
-{
-  var secteur = document.forms.prof_annu[pref + '[secteur]'].value;
-  if (secteur == '') {
-    secteur = '-1';
-  }
-  Ajax.update_html(id + '_ss_secteur', 'profile/ajax/secteur/' +nb + '/' + secteur + '/' + sel);
-}
-
-function makeAddJob(id)
-{
-  return function(data)
-         {
-           $('#add_job').before(data);
-           updateSecteur('job_' + id, 'jobs[' + id + ']', '');
-         };
-}
-
-function addJob()
-{
-  var i = 0;
-  while (document.getElementById('job_' + i) != null) {
-    ++i;
-  }
-  $.get(platal_baseurl + 'profile/ajax/job/' + i, makeAddJob(i));
-}
-
-function validGeoloc(id, pref)
-{
-  document.getElementById(id + '_geoloc').style.display = 'none';
-  document.getElementById(id + '_geoloc_error').style.display = 'none';
-  document.getElementById(id + '_geoloc_valid').style.display = 'none';
-  document.forms.prof_annu[pref + "[parsevalid]"].value = "1";
-  document.forms.prof_annu[pref + "[text]"].value = document.forms.prof_annu[pref + "[geoloc]"].value;
-  attachEvent(document.forms.prof_annu[pref + "[text]"], "click",
-              function() { document.forms.prof_annu[pref + "[text]"].blur(); });
-  document.forms.prof_annu[pref + "[text]"].className = '';
-}
-
-function validAddress(id, pref)
-{
-  document.getElementById(id + '_geoloc').style.display = 'none';
-  document.getElementById(id + '_geoloc_error').style.display = 'none';
-  document.getElementById(id + '_geoloc_valid').style.display = 'none';
-  document.forms.prof_annu[pref + "[parsevalid]"].value = "1";
-  attachEvent(document.forms.prof_annu[pref + "[text]"], "click",
-              function() { document.forms.prof_annu[pref + "[text]"].blur(); });
-  document.forms.prof_annu[pref + "[text]"].className = '';
-}
-
-{/literal}
-//]]></script>
-
+{javascript name=jobtermstree}
 {foreach from=$jobs item=job key=i}
 {include file="profile/jobs.job.tpl" i=$i job=$job new=false}
-<script type="text/javascript">updateSecteur({$i}, '{"job_`$i`"}', '{"jobs[`$i`]"}', '{$job.ss_secteur}');</script>
 {/foreach}
 {if $jobs|@count eq 0}
 {include file="profile/jobs.job.tpl" i=0 job=0 new=true}
-<script type="text/javascript">updateSecteur(0, 'job_0', 'jobs[0]', '-1');</script></script>
 {/if}
 
 <div id="add_job" class="center">
   <a href="javascript:addJob()">
     {icon name=add title="Ajouter un emploi"} Ajouter un emploi
   </a>
+  <br/><br/>
 </div>
 
+<table class="bicol" style="margin-bottom: 1em" summary="Corps">
+  <tr>
+    <th colspan="2">
+      <div class="flags" style="float: left; text-align: left">
+        {include file="include/flags.radio.tpl" name="corps[pub]" val=$corps.pub}
+      </div>
+      Corps
+    </th>
+  </tr>
+  <tr>
+    <td class="titre">Corps d'origine</td>
+    <td>
+      <select name="corps[original]">
+        {foreach from=$original_corps item=o_corps}
+        <option value="{$o_corps.id}" {if $o_corps.id eq $corps.original}selected="selected"{/if}>{$o_corps.name}</option>
+        {/foreach}
+      </select>
+    </td>
+  </tr>
+  <tr>
+    <td class="titre">Corps actuel</td>
+    <td>
+      <select name="corps[current]">
+        {foreach from=$current_corps item=c_corps}
+        <option value="{$c_corps.id}" {if $c_corps.id eq $corps.current}selected="selected"{/if}>{$c_corps.name}</option>
+        {/foreach}
+      </select>
+    </td>
+  </tr>
+  <tr>
+    <td class="titre">Grade</td>
+    <td>
+      <select name="corps[rank]">
+        {foreach from=$corps_rank item=rank}
+        <option value="{$rank.id}" {if $rank.id eq $corps.rank}selected="selected"{/if}>{$rank.name}</option>
+        {/foreach}
+      </select>
+    </td>
+  </tr>
+</table>
+
 <table class="bicol" summary="CV" style="margin-top: 1.5em">
   <tr>
     <th>
+      <div class="flags" style="float: left">
+        <input type="checkbox" name="accesCV" checked="checked" disabled="disabled" />
+        {icon name="flag_red" title="privĂ©"}
+      </div>
       Curriculum vitae
     </th>
   </tr>
   <tr>
     <td>
       <div style="float: left; width: 25%">
-        <div class="flags">
-          <span class="rouge"><input type="checkbox" name="accesCV" checked="checked" disabled="disabled" /></span>
-          <span class="texte">privĂ©</span>
-        </div>
-        <div class="smaller" style="margin-top: 30px">
+        <div class="smaller" style="margin-top: 40px">
           <a href="Xorg/FAQ?display=light#cv" class="popup_800x480">
             {icon name="lightbulb" title="Astuce"}Comment remplir mon CV&nbsp;?
           </a><br />