From: Stéphane Jacob Date: Sun, 2 Oct 2011 12:03:06 +0000 (+0200) Subject: Switches entreprise name autocomplete to new autocomplete. X-Git-Tag: xorg/1.1.4~107 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=d4cb8f1fea2a6f2cc2bc0411f94c12195d2c99b2;p=platal.git Switches entreprise name autocomplete to new autocomplete. Signed-off-by: Stéphane Jacob --- diff --git a/htdocs/javascript/profile.js b/htdocs/javascript/profile.js index 6858861..a8b944d 100644 --- a/htdocs/javascript/profile.js +++ b/htdocs/javascript/profile.js @@ -766,31 +766,18 @@ function addCountry() function registerEnterpriseAutocomplete(id) { - $(".enterpriseName").each( - function() { + $('.enterprise_name').each(function() { if (id == -1 || this.name == "jobs[" + id + "][name]") { - $(this).autocomplete($.plURL("search/autocomplete/entreprise"), - { - selectOnly:1, - field:this.name, - matchSubset:0, - width:$(this).width() - }); + $(this).autocomplete({ + source: $.plURL('search/autocomplete/entreprise/') + this.name, + change: function(event, ui) { + if (ui.item != null && ui.item.field != null) { + $(this).val(ui.item.field); + } + } + }); } - }); - - $(".sectorName").each( - function() { - if (id == -1 || this.name == "jobs[" + id + "][subSubSectorName]") { - $(this).autocomplete($.plURL("search/autocomplete/subSubSector"), - { - selectOnly:1, - field:this.name, - matchSubset:0, - width:$(this).width() - }); - } - }); + }); } // {{{1 Multiusage functions diff --git a/modules/profile.php b/modules/profile.php index e200bd5..f516a2b 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -318,6 +318,7 @@ class ProfileModule extends PLModule } // Build the page + $page->addJsLink('jquery.ui.xorg.js'); $page->addJsLink('education.js', true, false); /* dynamic content */ $page->addJsLink('grades.js', true, false); /* dynamic content */ $page->addJsLink('profile.js'); diff --git a/templates/profile/jobs.job.tpl b/templates/profile/jobs.job.tpl index 68958f0..25cc2ca 100644 --- a/templates/profile/jobs.job.tpl +++ b/templates/profile/jobs.job.tpl @@ -73,7 +73,7 @@ {/if} {else} {if t($job.tmp_name)}{$job.tmp_name} (en cours de validation){else} - {/if} {/if}