/***************************************************************************
- * Copyright (C) 2003-2007 Polytechnique.org *
+ * Copyright (C) 2003-2008 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
updateJobSecteur(i, 'job_' + i, 'jobs[' + i + ']',
document.forms.prof_annu["jobs[" + i + "][ss_secteur]"].value);
}
+ registerEnterpriseAutocomplete(-1);
break;
}
}
document.getElementById(id + '_geoloc_valid').style.display = 'none';
document.forms.prof_annu[pref + "[parsevalid]"].value = "1";
document.forms.prof_annu[pref + "[text]"].value = document.forms.prof_annu[pref + "[geoloc]"].value;
+ document.forms.prof_annu[pref + "[cityid]"].value = document.forms.prof_annu[pref + "[geoloc_cityid]"].value;
attachEvent(document.forms.prof_annu[pref + "[text]"], "click",
function() { document.forms.prof_annu[pref + "[text]"].blur(); });
document.forms.prof_annu[pref + "[text]"].className = '';
document.getElementById(id + '_geoloc').style.display = 'none';
document.getElementById(id + '_geoloc_error').style.display = 'none';
document.getElementById(id + '_geoloc_valid').style.display = 'none';
- document.forms.prof_annu[pref + "[parsevalid]"].value = "0";
+ document.forms.prof_annu[pref + "[parsevalid]"].value = "1";
attachEvent(document.forms.prof_annu[pref + "[text]"], "click",
function() { document.forms.prof_annu[pref + "[text]"].blur(); });
document.forms.prof_annu[pref + "[text]"].className = '';
return function(data)
{
$('#add_job').before(data);
+ registerEnterpriseAutocomplete(id);
updateSecteur('job_' + id, 'jobs[' + id + ']', '');
};
}
{
var val = document.forms.prof_annu.countries_sel.value;
var show = true;
- if (val == '') {
+ if (val == '' || val == '00') {
show = false;
}
if (document.getElementById('countries_' + val) != null) {
var val = cb.value;
var text = cb.options[cb.selectedIndex].text;
var html = '<div id="countries_' + val + '" style="clear: both; margin-bottom: 0.7em">'
- + ' <div style="float: left; width: 50%">' + text + '</div>'
- + ' <input type="hidden" name="countries[' + val + ']" value="' + text + '" />'
- + ' <a href="javascript:removeCountry(\'' + val + '\')">'
+ + ' <a href="javascript:removeCountry(\'' + val + '\')" style="display: block; float:right">'
+ ' <img src="images/icons/cross.gif" alt="" title="Supprimer ce pays" />'
+ ' </a>'
+ + ' <div style="float: left; width: 50%">' + text + '</div>'
+ + ' <input type="hidden" name="countries[' + val + ']" value="' + text + '" />'
+ '</div>';
$('#countries').append(html);
updateCountry();
var secteur = document.forms.prof_annu.secteur_sel.value;
if (secteur == '') {
secteur = '-1';
+ document.getElementById('ss_secteur_sel').innerHTML = '';
+ return;
}
$.get(platal_baseurl + 'profile/ajax/secteur/-1/' + secteur,
function(data) {
updateSSecteur();
}
+function registerEnterpriseAutocomplete(id)
+{
+ $(".enterprise_name").each(
+ function() {
+ if (id == -1 || this.name == "jobs[" + id + "][name]") {
+ $(this).autocomplete(platal_baseurl + "search/autocomplete/entreprise",
+ {
+ selectOnly:1,
+ field:this.name,
+ matchSubset:0,
+ width:$(this).width()
+ });
+ }
+ }
+ );
+}
+
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: