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