Merge branch 'platal-1.0.0'
[platal.git] / templates / profile / jobs.job.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2010 Polytechnique.org                             *}
4 {*  http://opensource.polytechnique.org/                                  *}
5 {*                                                                        *}
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.                                   *}
10 {*                                                                        *}
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.                          *}
15 {*                                                                        *}
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               *}
20 {*                                                                        *}
21 {**************************************************************************}
22
23
24 <script type="text/javascript" src="javascript/jquery.jstree.js"></script>
25 {assign var=jobid value="job_"|cat:$i}
26 {assign var=jobpref value="jobs[`$i`]"}
27 {assign var=sector_text value="sector_text_"|cat:$i}
28 {assign var=sector value="sector_"|cat:$i}
29 {assign var=entreprise value="entreprise_"|cat:$i}
30 {if !hasPerm('directory_private') && ($job.pub eq 'private') && !$new}
31 {assign var=hiddenjob value=true}
32 {else}
33 {assign var=hiddenjob value=false}
34 {/if}
35 <div id="{$jobid}">
36   <input type="hidden" name="{$jobpref}[removed]" value="0" />
37   <input type="hidden" name="{$jobpref}[new]" value="{if $new}1{else}0{/if}" />
38   <input type="hidden" name="{$jobpref}[id]" value="{$i}" />
39   <input type="hidden" name="{$jobpref}[jobid]" value="{$job.jobid}" />
40   <table id="{$jobid}_grayed" class="bicol" style="display: none; margin-bottom: 1em">
41     <tr>
42       <th class="grayed">
43         <div style="float: right">
44           <a href="javascript:restoreJob('{$jobid}','{$jobpref}')">{icon name=arrow_refresh title="Restaure l'emploi"}</a>
45         </div>
46         Restaurer l'entreprise n°{$i+1}&nbsp;:&nbsp;{if $hiddenjob}(masquée){else}<span id="{$jobid}_grayed_name"></span>{/if}
47       </th>
48     </tr>
49   </table>
50
51   <table id="{$jobid}_cont" class="bicol" summary="Entreprise n°{$i+1}" style="margin-bottom: 1em">
52     <tr>
53       <th colspan="2" style="text-align: right">
54         <div class="flags" style="float: left; text-align: left">
55           {include file="include/flags.radio.tpl" name="`$jobpref`[pub]" val=$job.pub disabled=$hiddenjob}
56         </div>
57         Entreprise n°{$i+1}&nbsp;:
58         {if $hiddenjob}
59         (masquée)
60         {if !$job.tmp_name}
61         <input type="hidden" name="{$jobpref}[name]" value="{$job.name}" />
62         {/if}
63         {else}
64         {if $job.tmp_name}{$job.tmp_name} <small>(en cours de validation)</small>{else}
65         <input type="text" class="enterpriseName{if $job.name_error} error{/if}" size="35" maxlength="100"
66                name="{$jobpref}[name]" value="{$job.name}" />
67         {/if}
68         {/if}
69         <a href="javascript:removeJob('{$jobid}','{$jobpref}')">
70           {icon name=cross title="Supprimer cet emploi"}
71         </a>
72       </th>
73     </tr>
74     {if !$job.tmp_name && !$job.name}
75     <tr class="{$entreprise}" {if $hiddenjob}style="display: none"{/if}>
76       <td class="center" colspan="2">
77         <small>Si l'entreprise ne figure pas dans la liste,
78         <a href="javascript:addEntreprise({$i})">clique ici</a> et complète les informations la concernant.</small>
79       </td>
80     </tr>
81     <tr class="{$entreprise}" style="display: none">
82       <td class="titre">Acronyme</td>
83       <td>
84         <input type="text" size="35" maxlength="255" name="{$jobpref}[hq_acronym]" />
85       </td>
86     </tr>
87     <tr class="{$entreprise}" style="display: none">
88       <td class="titre">Page web</td>
89       <td>
90         <input type="text" size="35" maxlength="255" name="{$jobpref}[hq_url]" />
91       </td>
92     </tr>
93     <tr class="{$entreprise}" style="display: none">
94       <td class="titre">Email de contact</td>
95       <td>
96         <input type="text" maxlength="60" name="{$jobpref}[hq_email]" />
97       </td>
98     </tr>
99     <tr class="{$entreprise}" style="display: none">
100       <td class="titre">Adresse du siège</td>
101       <td>
102         <textarea name="{$jobpref}[hq_address]" cols="30" rows="4"></textarea>
103       </td>
104     </tr>
105     <tr class="{$entreprise}" style="display: none">
106       <td class="titre">Téléphone</td>
107       <td>
108         <input type="text" maxlength="28" name="{$jobpref}[hq_fixed]" />
109       </td>
110     </tr>
111     <tr class="{$entreprise}" style="display: none">
112       <td class="titre">Fax</td>
113       <td>
114         <input type="text" maxlength="28" name="{$jobpref}[hq_fax]" />
115       </td>
116     </tr>
117     {/if}
118
119     <tr class="pair" {if $hiddenjob}style="display: none"{/if}>
120       <td colspan="2" class="center" style="font-style: italic">Place dans l'entreprise</td>
121     </tr>
122     <tr class="pair" ${sector_text} {if $hiddenjob}style="display: none"{/if}>
123       <td class="titre">Mots-clefs</td>
124       <td class="job_terms">
125         <input type="text" class="term_search" size="35"/>
126         <a href="javascript:toggleJobTermsTree({$i})">{icon name="table" title="Tous les mots-clefs"}</a>
127         <script type="text/javascript">
128         /* <![CDATA[ */
129         $(function() {ldelim}
130           {foreach from=$job.terms item=term}
131           addJobTerm("{$i}", "{$term.jtid}", "{$term.full_name|replace:'"':'\\"'}");
132           {/foreach}
133           $('#job_{$i} .term_search').autocomplete(platal_baseurl + 'profile/jobterms',
134             {ldelim}
135               "formatItem" : displayJobTerm,
136               "extraParams" : {ldelim} "jobid" : "{$i}" {rdelim},
137               "width" : $('#job_{$i} .term_search').width()*2,
138               "onItemSelect" : selectJobTerm,
139               "matchSubset" : false
140             {rdelim});
141         {rdelim});
142         /* ]]> */
143         </script>
144       </td>
145     </tr>
146     <tr class="pair" {if $hiddenjob}style="display: none"{/if}>
147       <td colspan="2" class="term_tree">
148       </td>
149     </tr>
150     <tr class="pair" {if $hiddenjob}style="display: none"{/if}>
151       <td class="titre">Description</td>
152       <td>
153         <input type="text" size="35" maxlength="120" {if $job.description_error}class="error"{/if}
154            name="{$jobpref}[description]" value="{$job.description}" />
155       </td>
156     </tr>
157     <tr class="pair" {if $hiddenjob}style="display: none"{/if}>
158       <td class="titre">Page&nbsp;perso</td>
159       <td>
160           <input type="text" size="35" maxlength="255" {if $job.w_rul}class="error"{/if}
161                  name="{$jobpref}[w_url]" value="{$job.w_url}" />
162       </td>
163     </tr>
164     <tr class="pair" {if $hiddenjob}style="display: none"{/if}>
165       <td colspan="2">
166         <div style="float: left">
167           <div class="titre">Adresse</div>
168           <div class="flags">
169             {include file="include/flags.radio.tpl" name="`$jobpref`[w_address][pub]" val=$job.w_address.pub}
170           </div>
171           <div style="margin-top: 20px; clear: both">
172             {include file="geoloc/form.address.tpl" prefname="`$jobpref`[w_address]"
173                      prefid=$jobid address=$job.w_address}
174           </div>
175         </div>
176       </td>
177     </tr>
178     {if $hiddenjob}
179     <tr class="pair" {if $hiddenjob}style="display: none"{/if}>
180       <td colspan="2">
181         <input type="hidden" name="{$jobpref}[w_email]" value="{$job.w_email}" />
182         <input type="hidden" name="{$jobpref}[w_email_pub]" value="{$job.w_email_pub}" />
183       </td>
184     </tr>
185     {else}
186     {include file="include/emails.combobox.tpl" name=$jobpref|cat:'[w_email]' val=$job.w_email
187              class="pair" i=$i error=$job.w_email_error prefix="w_" pub=$job.w_email_pub id=$i}
188     {/if}
189     <tr class="pair" {if $hiddenjob}style="display: none"{/if}>
190       <td colspan="2">
191         {foreach from=$job.w_phone key=t item=phone}
192           <div id="{"`$jobid`_w_phone_`$t`"}" style="clear: both">
193             {include file="profile/phone.tpl" prefname="`$jobpref`[w_phone]" prefid="`$jobid`_w_phone" telid=$t tel=$phone}
194           </div>
195         {/foreach}
196         {if $job.w_phone|@count eq 0}
197           <div id="{"`$jobid`_w_phone_0"}" style="clear: both">
198             {include file="profile/phone.tpl" prefname="`$jobpref`[w_phone]" prefid="`$jobid`_w_phone" telid=0 tel=0}
199           </div>
200         {/if}
201         <div id="{$jobid}_w_phone_add" class="center" style="clear: both; padding-top: 4px;">
202           <a href="javascript:addTel('{$jobid}_w_phone','{$jobpref}[w_phone]')">
203             {icon name=add title="Ajouter un numéro de téléphone"} Ajouter un numéro de téléphone
204           </a>
205         </div>
206       </td>
207     </tr>
208   </table>
209 </div>
210
211 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}