Merge commit 'origin/master' into fusionax
[platal.git] / htdocs / javascript / profile.js
1 /***************************************************************************
2 * Copyright (C) 2003-2009 Polytechnique.org *
3 * http://opensource.polytechnique.org/ *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software *
17 * Foundation, Inc., *
18 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
19 ***************************************************************************/
20
21 // Page initialization
22
23 function wizPage_onLoad(id)
24 {
25 switch (id) {
26 case 'general':
27 var i = 0;
28 var prefix = 'edu_';
29 while ($('.' + prefix + i).length != 0) {
30 i++;
31 }
32 i--;
33 for (var j = 0; j < i; j++) {
34 prepareType(j);
35 }
36 break;
37 case 'poly':
38 updateGroupSubLink(document.forms.prof_annu.groupesx_sub);
39 break;
40 case 'deco':
41 for (var i in names) {
42 if (typeof names[i] != 'function') {
43 if (document.getElementById("medal_" + i) != null) {
44 getMedalName(i);
45 buildGrade(i, document.forms.prof_annu["medal_" + i + "_grade"].value);
46 }
47 }
48 }
49 break;
50 case 'emploi':
51 for (var i = 0 ; document.getElementById('job_' + i) != null ; ++i) {
52 updateJobSecteur(i, 'job_' + i, 'jobs[' + i + ']',
53 document.forms.prof_annu["jobs[" + i + "][ss_secteur]"].value);
54 updateJobSousSecteur(i, 'job_' + i, 'jobs[' + i + ']',
55 document.forms.prof_annu["jobs[" + i + "][sss_secteur]"].value);
56 }
57 setTimeout('registerEnterpriseAutocomplete(-1)', 100);
58 break;
59 }
60 }
61
62 var educationDegree;
63 var educationDegreeAll;
64 var educationDegreeName;
65
66 // General
67
68 var subgrades;
69 var names;
70 function fillType(selectCtrl, edu, fill)
71 {
72 var i;
73 var i0 = 0;
74
75 for (i = selectCtrl.options.length; i >= 0; i--) {
76 selectCtrl.options[i] = null;
77 }
78
79 if (fill || edu < 0) {
80 selectCtrl.options[0] = new Option(' ');
81 i0 = 1;
82 }
83 if (edu >= 0) {
84 for (i = 0; i < educationDegree[edu].length; i++) {
85 selectCtrl.options[i0 + i] = new Option(educationDegreeName[educationDegree[edu][i] - 1], educationDegree[edu][i]);
86 }
87 } else if (fill) {
88 for (i = 0; i < educationDegreeAll.length; i++) {
89 selectCtrl.options[i0 + i] = new Option(educationDegreeName[educationDegreeAll[i] - 1], educationDegreeAll[i]);
90 }
91 }
92 }
93
94
95 function selectType(selectCtrl, type)
96 {
97 for (i = 0; i < selectCtrl.options.length; i++) {
98 if (selectCtrl.options[i].value == type) {
99 selectCtrl.selectedIndex = i;
100 }
101 }
102 }
103
104 function prepareType(i)
105 {
106 fillType(document.forms.prof_annu["edus[" + i + "][degreeid]"], document.forms.prof_annu["edus[" + i + "][eduid]"].selectedIndex - 1);
107 selectType(document.forms.prof_annu["edus[" + i + "][degreeid]"], document.forms.prof_annu["edu_" + i + "_tmp"].value);
108 }
109
110 function displayNamesAdvanced()
111 {
112 $('.names_advanced').show();
113 }
114
115 function addSearchName()
116 {
117 var i = 0;
118 while ($('#search_name_' + i).length != 0) {
119 i++;
120 }
121 Ajax.update_html('search_name_' + i, 'profile/ajax/searchname/' + i, function(data){
122 $('#searchname').before(data);
123 changeNameFlag(i);
124 });
125 }
126
127 function removeSearchName(i)
128 {
129 $('#search_name_' + i).remove();
130 updateNameDisplay();
131 }
132
133 function changeNameFlag(i)
134 {
135 $('#flag_' + i).remove();
136 var typeid = $('#search_name_' + i).find('select').val();
137 var type = $('#search_name_' + i).find('select :selected').text();
138 if ($('[@name=sn_type_' + typeid + '_' + i + ']').val() > 0) {
139 $('#flag_cb_' + i).after('<span id="flag_' + i + '">&nbsp;' +
140 '<img src="images/icons/flag_green.gif" alt="site public" title="site public" />' +
141 '<input type="hidden" name="search_names[' + i + '][pub]" value="1"/>' +
142 '<input type="hidden" name="search_names[' + i + '][typeid]" value="' + typeid + '"/>' +
143 '<input type="hidden" name="search_names[' + i + '][type]" value="' + type + '"/></span>');
144 } else {
145 $('#flag_cb_' + i).after('<span id="flag_' + i + '">&nbsp;' +
146 '<img src="images/icons/flag_red.gif" alt="site privé" title="site privé" />' +
147 '<input type="hidden" name="search_names[' + i + '][typeid]" value="' + typeid + '"/>' +
148 '<input type="hidden" name="search_names[' + i + '][type]" value="' + type + '"/></span>');
149 }
150 }
151
152 function updateNameDisplay()
153 {
154 var searchnames = '';
155 for (var i = 0; i < 10; i++) {
156 if ($('#search_name_' + i).find(':text').val()) {
157 searchnames += $('#search_name_' + i).find('[name*=typeid]').val() + ';';
158 searchnames += $('#search_name_' + i).find(':checked').length-1 + ';';
159 searchnames += $('#search_name_' + i).find(':text').val() + ';;';
160 }
161 }
162 Ajax.update_html(null, 'profile/ajax/buildnames/' + searchnames, function(data){
163 var name = data.split(';');
164 $('#public_name').html(name[0]);
165 $('#private_name').html(name[0] + name[1]);
166 });
167 }
168
169 function delNationality(i)
170 {
171 $('#nationalite' + i).hide().find('select').val('');
172 }
173
174 function addNationality()
175 {
176 var i = 0;
177 if ($('#nationalite2').find('select').val() == "") {
178 i = 2;
179 } else if ($('#nationalite3').find('select').val() == "") {
180 i = 3;
181 }
182 if ((i == 2) || (i == 3)) {
183 $('#nationalite' + i).show();
184 }
185 }
186
187 function addNetworking()
188 {
189 var i = 0;
190 var nws = 'networking_';
191 while (document.getElementById(nws + i) != null) {
192 i++;
193 }
194 var namefirst = '';
195 var html = '<tr id="networking_' + i + '">'
196 + ' <td colspan="2">'
197 + ' <div style="float: left; width: 200px;">'
198 + ' <span class="flags">'
199 + ' <input type="checkbox" name="networking[' + i + '][pub]"/>'
200 + ' <img src="images/icons/flag_green.gif" alt="site public" title="site public">'
201 + ' </span>&nbsp;'
202 + ' <select id="networking_type_' + i + '" name="networking[' + i + '][type]" onchange="javascript:updateNetworking(' + i + ');">';
203 for (nw in nw_list) {
204 if (namefirst == '') {
205 namefirst = nw;
206 }
207 html += ' <option value="' + nw_list[nw] + '">' + nw + '</option>';
208 }
209 html += '</select>'
210 + ' <input type="hidden" id="networking_name_' + i + '" name="networking[' + i + '][name]" value="' + namefirst + '"/>'
211 + ' </div>'
212 + ' <div style="float: left">'
213 + ' <input type="text" name="networking[' + i + '][address]" value="" size="30"/>'
214 + ' <a href="javascript:removeNetworking(' + i + ')">'
215 + ' <img src="images/icons/cross.gif" alt="cross" title="Supprimer cet élément"/>'
216 + ' </a>'
217 + ' </div>'
218 + ' </td>'
219 + '</tr>';
220
221 $('#networking').before(html);
222 }
223
224 function removeNetworking(id)
225 {
226 $('#networking_' + id).remove();
227 }
228
229 function updateNetworking(i)
230 {
231 var name = document.getElementById('networking_name_' + i);
232 var type = document.getElementById('networking_type_' + i);
233 if (type != null && name != null) {
234 name.value = type.options[type.selectedIndex].text;
235 }
236
237 }
238
239 // Addresses
240
241 function removeObject(id, pref)
242 {
243 document.getElementById(id).style.display = "none";
244 document.forms.prof_annu[pref + "[removed]"].value = "1";
245 }
246
247 function restoreObject(id, pref)
248 {
249 document.getElementById(id).style.display = '';
250 document.forms.prof_annu[pref + "[removed]"].value = "0";
251 }
252
253 function getAddressElement(adrid, adelement)
254 {
255 return document.forms.prof_annu["addresses[" + adrid + "][" + adelement + "]"];
256 }
257
258 function checkCurrentAddress(newCurrent)
259 {
260 var hasCurrent = false;
261 var i = 0;
262 while (getAddressElement(i, 'pub') != null) {
263 var radio = getAddressElement(i, 'current');
264 var removed = getAddressElement(i, 'removed');
265 if (removed.value == "1" && radio.checked) {
266 radio.checked = false;
267 } else if (radio.checked && radio != newCurrent) {
268 radio.checked = false;
269 } else if (radio.checked) {
270 hasCurrent = true;
271 }
272 i++;
273 }
274 if (!hasCurrent) {
275 i = 0;
276 while (getAddressElement(i, 'pub') != null) {
277 var radio = getAddressElement(i, 'current');
278 var removed = getAddressElement(i, 'removed');
279 if (removed.value != "1") {
280 radio.checked= true;
281 return;
282 }
283 i++;
284 }
285 }
286 }
287
288 function removeAddress(id, pref)
289 {
290 removeObject(id, pref);
291 checkCurrentAddress(null);
292 if (document.forms.prof_annu[pref + '[datemaj]'].value != '') {
293 document.getElementById(id + '_grayed').style.display = '';
294 }
295 }
296
297 function restoreAddress(id, pref)
298 {
299 document.getElementById(id + '_grayed').style.display = 'none';
300 checkCurrentAddress(null);
301 restoreObject(id, pref);
302 }
303
304 function addAddress()
305 {
306 var i = 0;
307 while (getAddressElement(i, 'pub') != null) {
308 i++;
309 }
310 $("#add_adr").before('<div id="addresses_' + i + '_cont"></div>');
311 Ajax.update_html('addresses_' + i + '_cont', 'profile/ajax/address/' + i, checkCurrentAddress);
312 }
313
314 function addEdu()
315 {
316 var i = 0;
317 var j = 0;
318 var prefix = 'edu_';
319 var class_parity;
320
321 while (!$('#edu_add').hasClass(prefix + i)) {
322 if ($('.' + prefix + i).length != 0) {
323 j++;
324 }
325 i++;
326 }
327 if (j % 2) {
328 class_parity = 'pair';
329 } else {
330 class_parity = 'impair';
331 }
332 $('#edu_add').removeClass(prefix + i);
333 i++;
334 $('#edu_add').addClass(prefix + i);
335 i--;
336 $.get(platal_baseurl + 'profile/ajax/edu/' + i + '/' + class_parity,
337 function(data) {
338 $('#edu_add').before(data);
339 prepareType(i);
340 });
341 }
342
343 function removeEdu(i)
344 {
345 var prefix = 'edu_';
346 $('.' + prefix + i).remove();
347 while (!$('#edu_add').hasClass(prefix + i)) {
348 $('.' + prefix + i).toggleClass('pair');
349 $('.' + prefix + i).toggleClass('impair');
350 i++;
351 }
352 }
353
354 function addTel(prefid, prefname)
355 {
356 var i = 0;
357 var prefix = prefid + '_';
358 while (document.getElementById(prefix + i) != null) {
359 i++;
360 }
361 $('#' + prefix + 'add').before('<div id="' + prefix + i + '" style="clear: both; padding-top: 4px; padding-bottom: 4px"></div>');
362 Ajax.update_html(prefix + i, 'profile/ajax/tel/' + prefid + '/' + prefname + '/' + i);
363 }
364
365 function removeTel(id)
366 {
367 $('#' + id).remove();
368 }
369
370 function addPhoneComment(id, pref)
371 {
372 document.getElementById(id+'_comment').style.display = '';
373 document.getElementById(id+'_addComment').style.display = 'none';
374 }
375
376 function removePhoneComment(id, pref)
377 {
378 document.getElementById(id+'_comment').style.display = 'none';
379 document.forms.prof_annu[pref+ '[comment]'].value = '';
380 document.getElementById(id+'_addComment').style.display = '';
381 }
382
383 // Geoloc
384
385 function validGeoloc(id, pref)
386 {
387 document.getElementById(id + '_geoloc').style.display = 'none';
388 document.getElementById(id + '_geoloc_error').style.display = 'none';
389 document.getElementById(id + '_geoloc_valid').style.display = 'none';
390 document.forms.prof_annu[pref + "[parsevalid]"].value = "1";
391 document.forms.prof_annu[pref + "[text]"].value = document.forms.prof_annu[pref + "[geoloc]"].value;
392 document.forms.prof_annu[pref + "[cityid]"].value = document.forms.prof_annu[pref + "[geoloc_cityid]"].value;
393 $(document.forms.prof_annu[pref + "[text]"]).click(function() { document.forms.prof_annu[pref + "[text]"].blur(); });
394 document.forms.prof_annu[pref + "[text]"].className = '';
395 }
396
397 function validAddress(id, pref)
398 {
399 document.getElementById(id + '_geoloc').style.display = 'none';
400 document.getElementById(id + '_geoloc_error').style.display = 'none';
401 document.getElementById(id + '_geoloc_valid').style.display = 'none';
402 document.forms.prof_annu[pref + "[parsevalid]"].value = "1";
403 $(document.forms.prof_annu[pref + "[text]"]).click(function() { document.forms.prof_annu[pref + "[text]"].blur(); });
404 document.forms.prof_annu[pref + "[text]"].className = '';
405 }
406
407
408 // Groups
409
410 function updateGroup(type)
411 {
412 var val = document.forms.prof_annu[type + '_sel'].value;
413 if (val == '0' || document.getElementById(type + '_' + val) != null) {
414 document.getElementById(type + '_add').style.display = 'none';
415 } else {
416 document.getElementById(type + '_add').style.display = '';
417 }
418 }
419
420 function removeGroup(cat, id)
421 {
422 $('#' + cat + '_' + id).remove();
423 updateGroup(cat);
424 }
425
426 function addGroup(cat)
427 {
428 var cb = document.forms.prof_annu[cat + '_sel'];
429 var id = cb.value;
430 var text = cb.options[cb.selectedIndex].text;
431 var html = '<tr id="' + cat + '_' + id + '">'
432 + ' <td>'
433 + ' <input type="hidden" name="' + cat + '[' + id + ']" value="' + text + '" />'
434 + ' </td>'
435 + ' <td>'
436 + ' <div style="float: left; width: 70%">'
437 + text
438 + ' </div>'
439 + ' <a href="javascript:removeGroup(\'' + cat + '\', ' + id + ')">'
440 + ' <img src="images/icons/cross.gif" alt="cross" title="Supprimer ce groupe" />'
441 + ' </a>'
442 + ' </td>'
443 + '</tr>';
444 $('#' + cat).after(html);
445 updateGroup(cat);
446 }
447
448 function updateGroupSubLink(cb)
449 {
450 var href = cb.value ? cb.value : "http://www.polytechnique.net";
451 document.getElementById("groupesx_sub").href = href;
452 }
453
454
455 // Medals
456
457 function updateMedal()
458 {
459 var val = document.forms.prof_annu['medal_sel'].value;
460 if (val == '' || document.getElementById('medal_' + val) != null) {
461 document.getElementById('medal_add').style.display = 'none';
462 } else {
463 document.getElementById('medal_add').style.display = '';
464 }
465 }
466
467 function getMedalName(id)
468 {
469 document.getElementById('medal_name_' + id).innerHTML = names[id];
470 }
471
472 function buildGrade(id, current)
473 {
474 var grade;
475 var subg = subgrades[id];
476 var obj = $('#medal_grade_' + id);
477 if (!subg) {
478 obj.prepend('<input type="hidden" name="medals[' + id + '][grade]" value="0" />');
479 } else {
480 var html = 'Agrafe : <select name="medals[' + id + '][grade]">';
481 html += '<option value="0">Non précisée</option>';
482 for (grade = 0 ; grade < subg.length ; grade++) {
483 html += '<option value="' + subg[grade][0] + '"';
484 if (subg[grade][0] == current) {
485 html += ' selected="selected"';
486 }
487 html += '>' + subg[grade][1] + '</option>';
488 }
489
490 html += '</select>';
491 obj.prepend(html);
492 }
493 }
494
495 function makeAddProcess(id)
496 {
497 return function(data)
498 {
499 $('#medals').after(data);
500 updateMedal();
501 getMedalName(id);
502 buildGrade(id, 0);
503 };
504 }
505
506 function addMedal()
507 {
508 var id = document.forms.prof_annu['medal_sel'].value;
509 $.get(platal_baseurl + 'profile/ajax/medal/' + id, makeAddProcess(id));
510 }
511
512 function removeMedal(id)
513 {
514 $("#medal_" + id).remove();
515 updateMedal();
516 }
517
518
519 // Jobs
520
521 function removeJob(id, pref)
522 {
523 document.getElementById(id + '_cont').style.display = 'none';
524 if (document.forms.prof_annu[pref + '[new]'].value == '0') {
525 document.getElementById(id + '_grayed').style.display = '';
526 document.getElementById(id + '_grayed_name').innerHTML =
527 document.forms.prof_annu[pref + "[name]"].value.replace('<', '&lt;');
528 }
529 document.forms.prof_annu[pref + "[removed]"].value = "1";
530 }
531
532 function restoreJob(id, pref)
533 {
534 document.getElementById(id + '_cont').style.display = '';
535 document.getElementById(id + '_grayed').style.display = 'none';
536 document.forms.prof_annu[pref + "[removed]"].value = "0";
537 }
538
539 function updateJobSecteur(nb, id, pref, sel)
540 {
541 var secteur = document.forms.prof_annu[pref + '[secteur]'].value;
542 if (secteur == '') {
543 secteur = '-1';
544 }
545 Ajax.update_html(id + '_ss_secteur', 'profile/ajax/secteur/' + nb + '/' + id + '/' + pref + '/' + secteur + '/' + sel);
546 }
547
548 function updateJobSousSecteur(nb, id, pref, sel)
549 {
550 var ssecteur = document.forms.prof_annu[pref + '[ss_secteur]'].value;
551 if (ssecteur == '') {
552 ssecteur = '-1';
553 }
554 Ajax.update_html(id + '_sss_secteur', 'profile/ajax/ssecteur/' + nb + '/' + ssecteur + '/' + sel);
555 }
556
557 function displayAllSector(id)
558 {
559 $('.sector_text_' + id).remove();
560 $('.sector_' + id).show();
561 }
562
563 function makeAddJob(id)
564 {
565 return function(data)
566 {
567 $('#add_job').before(data);
568 registerEnterpriseAutocomplete(id);
569 updateSecteur('job_' + id, 'jobs[' + id + ']', '');
570 };
571 }
572
573 function addJob()
574 {
575 var i = 0;
576 while (document.getElementById('job_' + i) != null) {
577 ++i;
578 }
579 $.get(platal_baseurl + 'profile/ajax/job/' + i, makeAddJob(i));
580 }
581
582 function addEntreprise(id)
583 {
584 $('.entreprise_' + id).toggle();
585 }
586
587 // Skills
588
589 function updateSkill(cat)
590 {
591 var val = document.forms.prof_annu[cat + '_sel'].value;
592 var show = true;
593 if (val == '') {
594 show = false;
595 }
596 if (document.getElementById(cat + '_' + val) != null) {
597 show = false;
598 }
599 document.getElementById(cat + '_add').style.display = show ? '' : 'none';
600 }
601
602 function addSkill(cat)
603 {
604 var sel = document.forms.prof_annu[cat + '_sel'];
605 var val = sel.value;
606 var text = sel.options[sel.selectedIndex].text;
607 $.get(platal_baseurl + 'profile/ajax/skill/' + cat + '/' + val,
608 function(data) {
609 $('#' + cat).append(data);
610 document.getElementById(cat + '_' + val + '_title').innerHTML = text;
611 updateSkill(cat);
612 });
613 }
614
615 function removeSkill(cat, id)
616 {
617 $('#' + cat + '_' + id).remove();
618 updateSkill(cat);
619 }
620
621
622 // Mentor
623
624 function updateCountry()
625 {
626 var val = document.forms.prof_annu.countries_sel.value;
627 var show = true;
628 if (val == '' || val == '00') {
629 show = false;
630 }
631 if (document.getElementById('countries_' + val) != null) {
632 show = false;
633 }
634 document.getElementById('countries_add').style.display = show ? '' : 'none';
635 }
636
637 function addCountry()
638 {
639 var cb = document.forms.prof_annu.countries_sel;
640 var val = cb.value;
641 var text = cb.options[cb.selectedIndex].text;
642 var html = '<div id="countries_' + val + '" style="clear: both; margin-bottom: 0.7em">'
643 + ' <a href="javascript:removeCountry(\'' + val + '\')" style="display: block; float:right">'
644 + ' <img src="images/icons/cross.gif" alt="" title="Supprimer ce pays" />'
645 + ' </a>'
646 + ' <div style="float: left; width: 50%">' + text + '</div>'
647 + ' <input type="hidden" name="countries[' + val + ']" value="' + text + '" />'
648 + '</div>';
649 $('#countries').append(html);
650 updateCountry();
651 }
652
653 function removeCountry(id)
654 {
655 $('#countries_' + id).remove();
656 updateCountry();
657 }
658 function updateSSecteur()
659 {
660 var s = document.forms.prof_annu.secteur_sel.value;
661 var ss = document.forms.prof_annu['jobs[-1][ss_secteur]'].value;
662 var show = true;
663 if (s == '' || ss == '') {
664 show = false;
665 }
666 if (document.getElementById('secteurs_' + s + '_' + ss) != null) {
667 show = false;
668 }
669 document.getElementById('secteurs_add').style.display = show ? 'block' : 'none';
670 }
671
672 function updateSecteur()
673 {
674 var secteur = document.forms.prof_annu.secteur_sel.value;
675 if (secteur == '') {
676 secteur = '-1';
677 document.getElementById('ss_secteur_sel').innerHTML = '';
678 return;
679 }
680 $.get(platal_baseurl + 'profile/ajax/secteur/-1/0/0/' + secteur,
681 function(data) {
682 data = '<a href="javascript:addSecteur()" style="display: none; float: right" id="secteurs_add">'
683 + ' <img src="images/icons/add.gif" alt="" title="Ajouter ce secteur" />'
684 + '</a>' + data;
685 document.getElementById('ss_secteur_sel').innerHTML = data;
686 $(document.forms.prof_annu['jobs[-1][ss_secteur]']).change(updateSSecteur);
687 });
688 }
689
690 function addSecteur()
691 {
692 var scb = document.forms.prof_annu.secteur_sel;
693 var s = scb.value;
694 var st = scb.options[scb.selectedIndex].text;
695
696 var sscb = document.forms.prof_annu['jobs[-1][ss_secteur]'];
697 var ss = sscb.value;
698 var sst = sscb.options[sscb.selectedIndex].text;
699
700 var html = '<div id="secteurs_' + s + '_' + ss + '" style="clear: both; margin-top: 0.5em" class="titre">'
701 + ' <a href="javascript:removeSecteur(\'' + s + '\', \'' + ss + '\')" style="display: block; float: right">'
702 + ' <img src="images/icons/cross.gif" alt="" title="Supprimer ce secteur" />'
703 + ' </a>'
704 + ' <input type="hidden" name="secteurs[' + s + '][' + ss + ']" value="' + sst + '" />'
705 + ' ' + sst
706 + '</div>';
707 $('#secteurs').append(html);
708 updateSSecteur();
709 }
710
711 function removeSecteur(s, ss)
712 {
713 $('#secteurs_' + s + '_' + ss).remove();
714 updateSSecteur();
715 }
716
717 function registerEnterpriseAutocomplete(id)
718 {
719 $(".enterprise_name").each(
720 function() {
721 if (id == -1 || this.name == "jobs[" + id + "][name]") {
722 $(this).autocomplete(platal_baseurl + "search/autocomplete/entreprise",
723 {
724 selectOnly:1,
725 field:this.name,
726 matchSubset:0,
727 width:$(this).width()
728 });
729 }
730 }
731 );
732
733 $(".sector_name").each(
734 function() {
735 if (id == -1 || this.name == "jobs[" + id + "][sss_secteur_name]") {
736 $(this).autocomplete(platal_baseurl + "search/autocomplete/sss_secteur",
737 {
738 selectOnly:1,
739 field:this.name,
740 matchSubset:0,
741 width:$(this).width()
742 });
743 }
744 }
745 );
746 }
747
748 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: