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