$page->assign('job', array());
$page->assign('ajaxjob', true);
$page->assign('new', true);
+ $page->assign('secteurs', XDB::iterator("SELECT id, label
+ FROM emploi_secteur"));
+ $page->assign('fonctions', XDB::iterator("SELECT id, fonction_fr, FIND_IN_SET('titre', flags) AS title
+ FROM fonctions_def
+ ORDER BY id"));
}
function handler_ajax_secteur(&$page, $id, $sect, $ssect = -1)
}
$success = true;
foreach ($value as $key=>&$job) {
- if (@$job['removed']) {
+ if (@$job['removed'] || !trim($job['name'])) {
unset($value[$key]);
}
}
|| (@$address['text'] && !@$address['cityid'])) {
$address = array_merge($address, empty_address());
$new = get_address_infos(@$address['text']);
- if (compare_addresses_text(@$adress['text'], $geotxt = get_address_text($new))
- || @$address['parsevalid']) {
+ if (compare_addresses_text(@$address['text'], $geotxt = get_address_text($new))
+ || (@$address['parsevalid'] && @$address['cityid'])) {
$address = array_merge($address, $new);
+ } else if (@$address['parsevalid']) {
+ $address = array_merge($address, cut_address(@$address['text']));
} else {
$success = false;
$address = array_merge($address, cut_address(@$address['text']));
name="{$name}[geoloc]"
onclick="blur()"
>{$adr.geoloc}</textarea>
+<input type="hidden" name="{$name}[geoloc_cityid]" value="{$adr.geoloc_cityid}" />
<input type="hidden" name="{$name}[parsevalid]" value="0" />
</span>
</div>
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 = "1";
+ document.forms.prof_annu[pref + "[parsevalid]"].value = "0";
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_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 = '';