Merge commit 'origin/master' into account
[platal.git] / templates / profile / jobs.job.tpl
index ad699f3..e7c816f 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2010 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-{assign var=jobid value="job_`$i`"}
+{assign var=jobid value="job_"|cat:$i}
 {assign var=jobpref value="jobs[`$i`]"}
 {assign var=sector_text value="sector_text_"|cat:$i}
 {assign var=sector value="sector_"|cat:$i}
@@ -28,6 +28,8 @@
 <div id="{$jobid}">
   <input type="hidden" name="{$jobpref}[removed]" value="0" />
   <input type="hidden" name="{$jobpref}[new]" value="{if $new}1{else}0{/if}" />
+  <input type="hidden" name="{$jobpref}[id]" value="{$i}" />
+  <input type="hidden" name="{$jobpref}[jobid]" value="{$job.jobid}" />
   <table id="{$jobid}_grayed" class="bicol" style="display: none; margin-bottom: 1em">
     <tr>
       <th class="grayed">
@@ -38,6 +40,7 @@
       </th>
     </tr>
   </table>
+
   <table id="{$jobid}_cont" class="bicol" summary="Entreprise n°{$i+1}" style="margin-bottom: 1em">
     <tr>
       <th colspan="2" style="text-align: right">
@@ -46,7 +49,7 @@
         </div>
         Entreprise n°{$i+1}&nbsp;:
         {if $job.tmp_name}{$job.tmp_name} <small>(en cours de validation)</small>{else}
-        <input type="text" class="enterprise_name {if $job.name_error}error{/if}" size="35" maxlength="100"
+        <input type="text" class="enterpriseName {if $job.name_error}error{/if}" size="35" maxlength="100"
                name="{$jobpref}[name]" value="{$job.name}" />
         {/if}
         <a href="javascript:removeJob('{$jobid}', '{$jobpref}')">
@@ -54,7 +57,7 @@
         </a>
       </th>
     </tr>
-    {if !$job.tmp_name}
+    {if !$job.tmp_name && !$job.name}
     <tr class="{$entreprise}">
       <td class="center" colspan="2">
         <small>Si ton entreprise ne figure pas dans la liste,
       <td class="titre">Acronyme</td>
       <td>
         <input type="text" size="35" maxlength="255" {if $job.acronym_error}class="error"{/if}
-               name="{$jobpref}[acronym]" value="{$job.acronym}" />
+               name="{$jobpref}[hq_acronym]" value="{$job.hq_acronym}" />
       </td>
     </tr>
     <tr class="{$entreprise}" style="display: none">
       <td class="titre">Page web</td>
       <td>
-        <input type="text" size="35" maxlength="255" {if $job.hq_web_error}class="error"{/if}
-               name="{$jobpref}[hq_web]" value="{$job.hq_web}" />
+        <input type="text" size="35" maxlength="255" {if $job.hq_url}class="error"{/if}
+               name="{$jobpref}[hq_url]" value="{$job.hq_url}" />
       </td>
     </tr>
     <tr class="{$entreprise}" style="display: none">
@@ -88,7 +91,8 @@
         <div style="float: left">
           <div class="titre">Adresse du siège</div>
           <div style="margin-top: 20px; clear: both">
-            {include file="geoloc/form.address.tpl" name="`$jobpref`[hq_adr]" id="`$jobid`_adr" adr=$job.hq_adr}
+            {include file="geoloc/form.address.tpl" prefname="`$jobpref`[hq_address]"
+                     prefid="`$jobid`_address" address=$job.hq_address}
           </div>
         </div>
       </td>
       <td class="titre">Téléphone</td>
       <td>
         <input type="text" maxlength="28" {if $job.hq_tel_error}class="error"{/if}
-               name="{$jobpref}[hq_tel]" value="{$job.hq_tel}" />
+               name="{$jobpref}[hq_phone]" value="{$job.hq_phone}" />
       </td>
     </tr>
     <tr class="{$entreprise}" style="display: none">
     <tr class="pair {$sector_text}">
       <td class="titre">Secteur d'activité</td>
       <td>
-        <input type="text" class="sector_name {if $job.sector_error}error{/if}" size="35" maxlength="100"
-               name="{$jobpref}[sss_secteur_name]" value="{$job.sss_secteur_name}" />
+        <input type="text" class="sectorName {if $job.sector_error}error{/if}" size="35" maxlength="100"
+               name="{$jobpref}[subSubSectorName]" value="{$job.subSubSectorName}" />
         <a href="javascript:displayAllSector({$i})">{icon name="table" title="Tous les secteurs"}</a>
       </td>
     </tr>
     <tr class="pair {$sector}" style="display: none">
-      <td class="titre" rowspan="3">Secteur&nbsp;d'activité</td>
+      <td class="titre" rowspan="4">Secteur&nbsp;d'activité</td>
       <td>
-        <select name="{$jobpref}[secteur]" onchange="updateJobSector({$i}, '')">
-          <option value="">&nbsp;</option>
-          {foreach from=$secteurs item=secteur}
-          <option value="{$secteur.id}" {if $secteur.id eq $job.secteur}selected="selected"{/if}>
-            {$secteur.label}
+        <select name="{$jobpref}[sector]" onchange="updateJobSector({$i}, '')">
+          <option value="0">&nbsp;</option>
+          {foreach from=$sectors item=item}
+          <option value="{$item.id}" {if $item.id eq $job.sector}selected="selected"{/if}>
+            {$item.label}
           </option>
           {/foreach}
         </select>
       </td>
     </tr>
     <tr class="pair {$sector}" style="display: none">
-      <td id="{$jobid}_ss_secteur">
-        <input type="hidden" name="{$jobpref}[ss_secteur]" value="{$job.ss_secteur|default:'-1'}" />
+      <td id="{$jobid}_subSector">
+        <input type="hidden" name="{$jobpref}[subSector]" value="{$job.subSector|default:0}" />
       </td>
     </tr>
     <tr class="pair {$sector}" style="display: none">
-      <td id="{$jobid}_sss_secteur">
-        <input type="hidden" name="{$jobpref}[sss_secteur]" value="{$job.sss_secteur|default:'-1'}" />
+      <td id="{$jobid}_subSubSector">
+        <input type="hidden" name="{$jobpref}[subSubSector]" value="{$job.subSubSector|default:0}" />
       </td>
     </tr>
-    <tr class="pair">
-      <td class="titre">Fonction&nbsp;occupée</td>
-      <td>
-        <select name="{$jobpref}[fonction]">
-          <option value="">&nbsp;</option>
-          {assign var=ingroup value=false}
-          {foreach from=$fonctions item=fonct}
-          {if $fonct.title}
-            {if $ingroup}</optgroup>{/if}
-            <optgroup label="{$fonct.fonction_fr}">
-            {assign var=ingroup value=true}
-          {/if}
-          <option value="{$fonct.id}" {if $fonct.id eq $job.fonction}selected="selected"{/if}>
-            {$fonct.fonction_fr}
-          </option>
-          {/foreach}
-          {if $ingroup}</optgroup>{/if}
-        </select>
+    <tr class="pair {$sector}" style="display: none">
+      <td id="{$jobid}_alternates">
       </td>
     </tr>
     <tr class="pair">
       <td class="titre">Description</td>
       <td>
         <input type="text" size="35" maxlength="120" {if $job.description_error}class="error"{/if}
-           name="{$jobpref}[description]" value="{$job.description}" /><br /><br />
+           name="{$jobpref}[description]" value="{$job.description}" />
       </td>
     </tr>
     <tr class="pair">
       <td class="titre">Page&nbsp;perso</td>
       <td>
-          <input type="text" size="35" maxlength="255" {if $job.w_web_error}class="error"{/if}
-                 name="{$jobpref}[w_web]" value="{$job.w_web}" />
+          <input type="text" size="35" maxlength="255" {if $job.w_rul}class="error"{/if}
+                 name="{$jobpref}[w_url]" value="{$job.w_url}" />
       </td>
     </tr>
     <tr class="pair">
         <div style="float: left">
           <div class="titre">Adresse</div>
           <div class="flags">
-            {include file="include/flags.radio.tpl" name="`$jobpref`[w_adr][pub]" val=$job.w_adr.pub}
+            {include file="include/flags.radio.tpl" name="`$jobpref`[w_address][pub]" val=$job.w_address.pub}
           </div>
           <div style="margin-top: 20px; clear: both">
-            {include file="geoloc/form.address.tpl" name="`$jobpref`[hq_adr]" id="`$jobid`_adr" adr=$job.hq_adr}
+            {include file="geoloc/form.address.tpl" prefname="`$jobpref`[w_address]"
+                     prefid=$jobid address=$job.w_address}
           </div>
         </div>
       </td>
              class="pair" i=$i error=$job.w_email_error prefix="w_" pub=$job.w_email_pub id=$i}
     <tr class="pair">
       <td colspan="2">
-        {foreach from=$job.w_tel key=t item=tel}
-          <div id="{"`$jobid`_w_tel_`$t`"}" style="clear: both">
-            {include file="profile/phone.tpl" prefname="`$jobpref`[w_tel]" prefid="`$jobid`_w_tel" telid=$t tel=$tel}
+        {foreach from=$job.w_phone key=t item=phone}
+          <div id="{"`$jobid`_w_phone_`$t`"}" style="clear: both">
+            {include file="profile/phone.tpl" prefname="`$jobpref`[w_phone]" prefid="`$jobid`_w_phone" telid=$t tel=$phone}
           </div>
         {/foreach}
-        {if $job.w_tel|@count eq 0}
-          <div id="{"`$jobid`_w_tel_0"}" style="clear: both">
-            {include file="profile/phone.tpl" prefname="`$jobpref`[w_tel]" prefid="`$jobid`_w_tel" telid=0 tel=0}
+        {if $job.w_phone|@count eq 0}
+          <div id="{"`$jobid`_w_phone_0"}" style="clear: both">
+            {include file="profile/phone.tpl" prefname="`$jobpref`[w_phone]" prefid="`$jobid`_w_phone" telid=0 tel=0}
           </div>
         {/if}
-        <div id="{$jobid}_w_tel_add" class="center" style="clear: both; padding-top: 4px;">
-          <a href="javascript:addTel('{$jobid}_w_tel', '{$jobpref}[w_tel]')">
+        <div id="{$jobid}_w_phone_add" class="center" style="clear: both; padding-top: 4px;">
+          <a href="javascript:addTel('{$jobid}_w_phone', '{$jobpref}[w_phone]')">
             {icon name=add title="Ajouter un numéro de téléphone"} Ajouter un numéro de téléphone
           </a>
         </div>