From 37d44b3b542764eda8d4f9c3febc814ae37f8157 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 9 Sep 2007 00:33:27 +0200 Subject: [PATCH] Job page should work Signed-off-by: Florent Bruneau --- include/geoloc.inc.php | 2 +- modules/profile/addresses.inc.php | 32 +------ modules/profile/assign_emploi.inc.php | 47 ---------- modules/profile/get_emploi.inc.php | 86 ----------------- modules/profile/jobs.inc.php | 167 ++++++++++++++++++++++++++++++++++ modules/profile/page.inc.php | 50 +++++++++- modules/profile/update_emploi.inc.php | 46 ---------- modules/profile/verif_emploi.inc.php | 125 ------------------------- templates/profile/adresses.tpl | 4 +- templates/profile/jobs.job.tpl | 34 +++++-- templates/profile/jobs.secteur.tpl | 2 +- templates/profile/jobs.tpl | 33 ++++++- upgrade/0.9.15/02_entreprises.sql | 7 ++ 13 files changed, 281 insertions(+), 354 deletions(-) delete mode 100644 modules/profile/assign_emploi.inc.php delete mode 100644 modules/profile/get_emploi.inc.php delete mode 100644 modules/profile/update_emploi.inc.php delete mode 100644 modules/profile/verif_emploi.inc.php create mode 100644 upgrade/0.9.15/02_entreprises.sql diff --git a/include/geoloc.inc.php b/include/geoloc.inc.php index de0d4d4..a1939b8 100644 --- a/include/geoloc.inc.php +++ b/include/geoloc.inc.php @@ -225,7 +225,7 @@ function compare_addresses_text($a, $b) return false; } foreach ($la as $i=>$l) { - if (levenshtein($l, $lb[$i]) > 3) { + if (levenshtein(trim($l), trim($lb[$i])) > 3) { return false; } } diff --git a/modules/profile/addresses.inc.php b/modules/profile/addresses.inc.php index feb3692..1edfbc1 100644 --- a/modules/profile/addresses.inc.php +++ b/modules/profile/addresses.inc.php @@ -19,7 +19,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -class ProfileAddress +class ProfileAddress extends ProfileGeoloc { private $bool; private $pub; @@ -32,31 +32,6 @@ class ProfileAddress $this->tel = new ProfileTel(); } - private function geolocAddress(array &$address, &$success) - { - require_once 'geoloc.inc.php'; - $success = true; - unset($address['geoloc']); - unset($address['geoloc_cityid']); - if (@$address['parsevalid'] || (@$address['text'] && @$address['changed']) || !@$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']) { - $address = array_merge($address, $new); - } else { - $success = false; - $address = array_merge($address, cut_address(@$address['text'])); - $address['geoloc'] = $geotxt; - $address['geoloc_cityid'] = $new['cityid']; - } - } - if (@$address['changed']) { - $address['datemaj'] = time(); - } - $address['text'] = get_address_text($address); - } - private function cleanAddress(ProfilePage &$page, array &$address, &$success) { if (@$address['changed']) { @@ -76,9 +51,6 @@ class ProfileAddress } unset($tel['removed']); } - if (@$address['changed']) { - $address['datemaj'] = time(); - } $address['secondaire'] = $this->bool->value($page, 'secondaire', $address['secondaire'], $s); $address['mail'] = $this->bool->value($page, 'mail', $address['mail'], $s); $address['temporary'] = $this->bool->value($page, 'temporary', $address['temporary'], $s); @@ -214,7 +186,7 @@ class ProfileAddresses extends ProfilePage FIND_IN_SET('temporaire', a.statut) AS temporary, FIND_IN_SET('active', a.statut) AS current FROM adresses AS a - INNER JOIN geoloc_pays AS gp ON(gp.a2 = a.country) + INNER JOIN geoloc_pays AS gp ON(gp.a2 = a.country) WHERE uid = {?} AND NOT FIND_IN_SET('pro', statut) ORDER BY adrid", S::i('uid')); diff --git a/modules/profile/assign_emploi.inc.php b/modules/profile/assign_emploi.inc.php deleted file mode 100644 index ce9a5f4..0000000 --- a/modules/profile/assign_emploi.inc.php +++ /dev/null @@ -1,47 +0,0 @@ -assign('endrid',$endrid); -$page->assign('entreprise',$entreprise); -$page->assign('secteur',$secteur); -$page->assign('ss_secteur',$ss_secteur); -$page->assign('poste',$poste); -$page->assign('fonction',$fonction); -$page->assign('adrpro1',$adrpro1); -$page->assign('adrpro2',$adrpro2); -$page->assign('adrpro3',$adrpro3); -$page->assign('postcodepro',$postcodepro); -$page->assign('citypro',$citypro); -$page->assign('countrypro',$countrypro); -$page->assign('regionpro',$regionpro); -$page->assign('telpro',$telpro); -$page->assign('faxpro',$faxpro); -$page->assign('mobilepro', $mobilepro); -$page->assign('pubpro',$pubpro); -$page->assign('adr_pubpro',$adr_pubpro); -$page->assign('tel_pubpro',$tel_pubpro); -$page->assign('emailpro',$emailpro); -$page->assign('email_pubpro',$email_pubpro); -$page->assign('webpro',$webpro); -$page->assign('cv',$cv); - -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: -?> diff --git a/modules/profile/get_emploi.inc.php b/modules/profile/get_emploi.inc.php deleted file mode 100644 index 8397612..0000000 --- a/modules/profile/get_emploi.inc.php +++ /dev/null @@ -1,86 +0,0 @@ -total(); -for($i = 0; $i < $nb_res ; $i++){ - list($endrid[$i], $entreprise[$i], $secteur[$i], $ss_secteur[$i], $poste[$i], $fonction[$i], - $adrpro1[$i], $adrpro2[$i], $adrpro3[$i], $postcodeppro[$i], $citypro[$i], $countrypro[$i], $regionpro[$i], - $telpro[$i], $faxpro[$i], $mobilepro[$i], $pubpro[$i], $adr_pubpro[$i], - $tel_pubpro[$i], $emailpro[$i], $email_pubpro[$i], $webpro[$i]) = $res->next(); -} -//limite dure a 2 -for($i = $nb_res; $i < 2 ; $i++){ - $endrid[$i] = $i; - $entreprise[$i] = ''; - $secteur[$i] = ''; - $ss_secteur[$i] = ''; - $poste[$i] = ''; - $fonction[$i] = '0'; - $adrpro1[$i] = ''; - $adrpro2[$i] = ''; - $adrpro3[$i] = ''; - $postcodepro[$i] = ''; - $citypro[$i] = ''; - $countrypro[$i] = '00'; - $regionpro[$i] = ''; - $telpro[$i] = ''; - $faxpro[$i] = ''; - $mobilepro[$i] = ''; - $pubpro[$i] = ''; - $adr_pubpro[$i] = ''; - $tel_pubpro[$i] = ''; - $emailpro[$i] = ''; - $email_pubpro[$i] = ''; - $webpro[$i] = ''; -} - -//recuperation des donnees sur les secteurs : - -$res = XDB::iterRow("SELECT id, label FROM emploi_secteur"); - -while(list($tmp_secteur_id, $tmp_secteur_label) = $res->next()){ - $secteurs[$tmp_secteur_id] = $tmp_secteur_label; -} - -//recuperation des donnees sur les fonctions : -$res = XDB::iterRow("SELECT id, fonction_fr, FIND_IN_SET('titre', flags) FROM fonctions_def ORDER BY id"); - -while(list($tmp_fonction_id, $tmp_fonction_label, $tmp_fonction_titre) = $res->next()){ - $fonctions[$tmp_fonction_id] = $tmp_fonction_label; - $fonctions_titre[$tmp_fonction_id] = $tmp_fonction_titre; -} - -//recuperation du CV -$res = XDB::query("SELECT cv FROM auth_user_md5 WHERE user_id = {?}", S::v('uid', -1)); -$cv = $res->fetchOneCell(); - -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: -?> diff --git a/modules/profile/jobs.inc.php b/modules/profile/jobs.inc.php index 05e538c..b81c8f9 100644 --- a/modules/profile/jobs.inc.php +++ b/modules/profile/jobs.inc.php @@ -19,6 +19,100 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ +class ProfileJob extends ProfileGeoloc +{ + private $pub; + private $mail; + private $web; + private $tel; + private $checks; + + public function __construct() + { + $this->pub = new ProfilePub(); + $this->mail = new ProfileEmail(); + $this->web = new ProfileWeb(); + $this->tel = new ProfileTel(); + $this->checks = array('web' => array('web'), + 'mail' => array('email'), + 'tel' => array('tel', 'fax', 'mobile'), + 'pub' => array('pub', 'tel_pub', 'email_pub')); + } + + private function cleanJob(ProfilePage &$page, array &$job, &$success) + { + $success = true; + foreach ($this->checks as $obj=>&$fields) { + $chk =& $this->$obj; + foreach ($fields as $field) { + $job[$field] = $chk->value($page, $field, $job[$field], $s); + if (!$s) { + $success = false; + $job[$field . '_error'] = true; + } + } + } + unset($job['removed']); + unset($job['new']); + unset($job['adr']['changed']); + unset($job['adr']['parsevalid']); + unset($job['adr']['display']); + } + + public function value(ProfilePage &$page, $field, $value, &$success) + { + $init = false; + if (is_null($value)) { + $value = $page->values['jobs']; + $init = true; + } + $success = true; + foreach ($value as $key=>&$job) { + if (@$job['removed']) { + unset($value[$key]); + } + } + foreach ($value as $key=>&$job) { + $ls = true; + $this->geolocAddress($job['adr'], $s); + $ls = ($ls && $s); + $this->cleanJob($page, $job, $s); + $ls = ($ls && $s); + if (!$init) { + $success = ($success && $ls); + } + } + return $value; + } + + public function save(ProfilePage &$page, $field, $value) + { + XDB::execute("DELETE FROM entreprises + WHERE uid = {?}", + S::i('uid')); + $i = 0; + foreach ($value as &$job) { + XDB::execute("INSERT INTO entreprises (uid, entrid, entreprise, secteur, ss_secteur, + fonction, poste, adr1, adr2, adr3, postcode, + city, cityid, country, region, regiontxt, + tel, fax, mobile, email, web, + pub, adr_pub, tel_pub, email_pub) + VALUES ({?}, {?}, {?}, {?}, {?}, + {?}, {?}, {?}, {?}, {?}, {?}, + {?}, {?}, {?}, {?}, {?}, + {?}, {?}, {?}, {?}, {?}, + {?}, {?}, {?}, {?})", + S::i('uid'), $i++, $job['name'], $job['secteur'], $job['ss_secteur'], + $job['fonction'], $job['poste'], $job['adr']['adr1'], $job['adr']['adr2'], $job['adr']['adr3'], + $job['adr']['postcode'], + $job['adr']['city'], $job['adr']['cityid'], $job['adr']['country'], $job['adr']['region'], + $job['adr']['regiontxt'], + $job['tel'], $job['fax'], $job['mobile'], $job['email'], $job['web'], + $job['pub'], $job['adr']['pub'], $job['tel_pub'], $job['email_pub']); + } + } +} + class ProfileJobs extends ProfilePage { protected $pg_template = 'profile/jobs.tpl'; @@ -26,6 +120,79 @@ class ProfileJobs extends ProfilePage public function __construct(PlWizard &$wiz) { parent::__construct($wiz); + $this->settings['cv'] = null; + $this->settings['jobs'] = new ProfileJob(); + } + + protected function fetchData() + { + if (count($this->orig) > 0) { + $this->values = $this->orig; + return; + } + // Checkout the CV + $res = XDB::query("SELECT cv + FROM auth_user_md5 + WHERE user_id = {?}", + S::i('uid')); + $this->values['cv'] = $res->fetchOneCell(); + + // Build the jobs tree + $res = XDB::iterRow("SELECT e.entreprise, e.secteur, e.ss_secteur, + e.fonction, e.poste, e.adr1, e.adr2, e.adr3, + e.postcode, e.city, e.cityid, e.region, e.regiontxt, + e.country, gp.pays, gp.display, + e.tel, e.fax, e.mobile, e.email, e.web, e.pub, + e.adr_pub, e.tel_pub, e.email_pub + FROM entreprises AS e + INNER JOIN geoloc_pays AS gp ON(gp.a2 = e.country) + WHERE uid = {?} AND entreprise != '' + ORDER BY entrid", S::i('uid')); + $this->values['jobs'] = array(); + while (list($name, $secteur, $ss_secteur, $fonction, $poste, + $adr1, $adr2, $adr3, $postcode, $city, $cityid, + $region, $regiontxt, $country, $countrytxt, $display, + $tel, $fax, $mobile, $email, $web, + $pub, $adr_pub, $tel_pub, $email_pub) = $res->next()) { + $this->values['jobs'][] = array('name' => $name, + 'secteur' => $secteur, + 'ss_secteur' => $ss_secteur, + 'fonction' => $fonction, + 'poste' => $poste, + 'adr' => array('adr1' => $adr1, + 'adr2' => $adr2, + 'adr3' => $adr3, + 'postcode' => $postcode, + 'city' => $city, + 'cityid' => $cityid, + 'region' => $region, + 'regiontxt' => $regiontxt, + 'country' => $country, + 'countrytxt' => $countrytxt, + 'display' => $display, + 'pub' => $adr_pub), + 'tel' => $tel, + 'fax' => $fax, + 'mobile' => $mobile, + 'email' => $email, + 'web' => $web, + 'pub' => $pub, + 'adr_pub' => $adr_pub, + 'tel_pub' => $tel_pub, + 'email_pub' => $email_pub); + } + parent::fetchData(); + } + + protected function saveData() + { + if ($this->changed['cv']) { + XDB::execute("UPDATE auth_user_md5 + SET cv = {?} + WHERE user_id = {?}", + $this->values['cv'], S::i('uid')); + } + parent::saveData(); } public function prepare(PlatalPage &$page) diff --git a/modules/profile/page.inc.php b/modules/profile/page.inc.php index 6decf81..411be43 100644 --- a/modules/profile/page.inc.php +++ b/modules/profile/page.inc.php @@ -50,7 +50,8 @@ class ProfileWeb extends ProfileNoSave if (is_null($value)) { return isset($page->values[$field]) ? $page->values[$field] : S::v($field); } - $success = !trim($value) || preg_match("{^(https?|ftp)://[a-zA-Z0-9._%#+/?=&~-]+$}i", $value); + $value = trim($value); + $success = empty($value) || preg_match("{^(https?|ftp)://[a-zA-Z0-9._%#+/?=&~-]+$}i", $value); if (!$success) { global $page; $page->trig('URL Incorrecte : une url doit commencer par http:// ou https:// ou ftp://' @@ -60,6 +61,25 @@ class ProfileWeb extends ProfileNoSave } } +class ProfileEmail extends ProfileNoSave +{ + public function value(ProfilePage &$page, $field, $value, &$success) + { + if (is_null($value)) { + return isset($page->values[$field]) ? $page->values[$field] : S::v($field); + } + $value = trim($value); + require_once 'xorg.misc.inc.php'; + $success = empty($value) || isvalid_email($value); + if (!$success) { + global $page; + $page->trig('Adresse Email invalide'); + } + return $value; + } +} + + class ProfileTel extends ProfileNoSave { public function value(ProfilePage &$page, $field, $value, &$success) @@ -105,6 +125,34 @@ class ProfileBool extends ProfileNoSave } } +abstract class ProfileGeoloc implements ProfileSetting +{ + protected function geolocAddress(array &$address, &$success) + { + require_once 'geoloc.inc.php'; + $success = true; + unset($address['geoloc']); + unset($address['geoloc_cityid']); + if (@$address['parsevalid'] + || (@$address['text'] && @$address['changed']) + || (@$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']) { + $address = array_merge($address, $new); + } else { + $success = false; + $address = array_merge($address, cut_address(@$address['text'])); + $address['geoloc'] = $geotxt; + $address['geoloc_cityid'] = $new['cityid']; + } + } + $address['text'] = get_address_text($address); + } +} + + abstract class ProfilePage implements PlWizardPage { protected $wizard; diff --git a/modules/profile/update_emploi.inc.php b/modules/profile/update_emploi.inc.php deleted file mode 100644 index 622cbb5..0000000 --- a/modules/profile/update_emploi.inc.php +++ /dev/null @@ -1,46 +0,0 @@ - diff --git a/modules/profile/verif_emploi.inc.php b/modules/profile/verif_emploi.inc.php deleted file mode 100644 index 7c96990..0000000 --- a/modules/profile/verif_emploi.inc.php +++ /dev/null @@ -1,125 +0,0 @@ -{}#~;!§*`[]|%^=")) < strlen($entreprise[$i])) -{ - $page->trig("Le champ 'Entreprise $j' contient un caractère interdit."); -} - -//validité du poste -if (strlen(strtok($poste[$i],"<>{}~?!§*`|%$^=+")) < strlen($poste[$i])) -{ - $page->trig("Le champ 'Poste $j' contient un caractère interdit."); -} - -// correction du champ web si vide -if ($webpro[$i]=="http://" or $webpro[$i] == '') { - $webpro[$i]=''; -} elseif (!preg_match("{^(https?|ftp)://[a-zA-Z0-9._%#+/?=&~-]+$}i", $webpro[$i])) { - // validité de l'url donnée dans web - $page->trig("URL incorrecte dans le champ 'Page web', une url doit commencer par - http:// ou https:// ou ftp:// et ne pas contenir de caractères interdits"); -} else { - $webpro[$i] = str_replace('&', '&', $webpro[$i]); -} - -// validité de l'e-mail -if ($emailpro[$i]) { - $emailpro[$i] = strtolower(trim($emailpro[$i])); - if (!isvalid_email($emailpro[$i])) { - $page->trig("Adresse e-mail incorrecte dans le champ 'E-mail'"); - } -} - -if (strlen(strtok($adrpro1[$i],"<>{}@~?!§*`|%$^=+")) < strlen($adrpro1[$i])) - { - $page->trig("Le champ 'Adresse professionnelle $j - Ligne 1' contient un caractère interdit."); - } - if (strlen(strtok($adrpro2[$i],"<>{}@~?!§*`|%$^=+")) < strlen($adrpro2[$i])) - { - $page->trig("Le champ 'Adresse professionnelle $j - Ligne 2' contient un caractère interdit."); - } - if (strlen(strtok($adrpro3[$i],"<>{}@~?!§*`|%$^=+")) < strlen($adrpro3[$i])) - { - $page->trig("Le champ 'Adresse professionnelle $j - Ligne 3' contient un caractère interdit."); - } - if (strlen(strtok($postcodepro[$i],"<>{}@~?!§*`|%$^=+")) < strlen($postcodepro[$i])) - { - $page->trig("Le champ 'Code Postal professionnel $j' contient un caractère interdit."); - } - if (strlen(strtok($citypro[$i],"<>{}@~?!§*`|%$^=+")) < strlen($citypro[$i])) - { - $page->trig("Le champ 'Ville professionnelle $j' contient un caractère interdit."); - } - if (strlen(strtok($telpro[$i],"<>{}@&#~\/:;?,!§*_`[]|%$^=")) < strlen($telpro[$i])) - { - $page->trig("Le champ 'Téléphone professionnel $j' contient un caractère interdit."); - } - if (strlen(strtok($faxpro[$i],"<>{}@&#~\/:;?,!§*_`[]|%$^=")) < strlen($faxpro[$i])) - { - $page->trig("Le champ 'Fax professionnel $j' contient un caractère interdit."); - } - if (strlen(strtok($mobilepro[$i],"<>{}@&#~\/:;?,!§*_`[]|%$^=")) < strlen($mobilepro[$i])) - { - $page->trig("Le champ 'Mobile professionnel $j' contient un caractère interdit."); - } - -} -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: -?> diff --git a/templates/profile/adresses.tpl b/templates/profile/adresses.tpl index 5439dc0..f87b691 100644 --- a/templates/profile/adresses.tpl +++ b/templates/profile/adresses.tpl @@ -112,7 +112,7 @@ function validGeoloc(id, pref) 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]"] = "1"; + document.forms.prof_annu[pref + "[parsevalid]"].value = "1"; document.forms.prof_annu[pref + "[text]"].value = document.forms.prof_annu[pref + "[geoloc]"].value; attachEvent(document.forms.prof_annu[pref + "[text]"], "click", function() { document.forms.prof_annu[pref + "[text]"].blur(); }); @@ -124,7 +124,7 @@ function validAddress(id, pref) 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]"] = "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 = ''; diff --git a/templates/profile/jobs.job.tpl b/templates/profile/jobs.job.tpl index bfdb471..ce1e07d 100644 --- a/templates/profile/jobs.job.tpl +++ b/templates/profile/jobs.job.tpl @@ -24,7 +24,7 @@ {/if} {assign var=jobid value="job_`$i`"} -{assign var=jobpref value="job[`$i`]"} +{assign var=jobpref value="jobs[`$i`]"}
@@ -34,7 +34,7 @@
{icon name=arrow_refresh title="Restaure l'emploi"}
- Restaurer l'entreprise n°{$i+1} : + Restaurer l'entreprise n°{$i+1} :  @@ -45,7 +45,8 @@ {include file="include/flags.radio.tpl" notable=true display="div" name="`$jobpref`[pub]" value=$job.pub}
Entreprise n°{$i+1} : - + {icon name=cross title="Supprimer cet emploi"} @@ -53,7 +54,10 @@ Page Web - + + + Secteur d'activité @@ -76,7 +80,8 @@ Poste occupé - + @@ -102,7 +107,8 @@ E-mail professionnel : - + {include file="include/flags.radio.tpl" name="`$jobpref`[email_pub]" val=$job.mail_pub display="div"} @@ -116,7 +122,7 @@ {include file="include/flags.radio.tpl" name="`$jobpref`[adr][pub]" val=$job.adr.pub display="div"}
- {include file="geoloc/form.address.tpl" name="`$jobpref`[adr]" id="`$jobpref`_adr" adr=$job.adr} + {include file="geoloc/form.address.tpl" name="`$jobpref`[adr]" id="`$jobid`_adr" adr=$job.adr}
@@ -127,15 +133,23 @@ - + - + - +
Bureau : + +
Fax : +
Mobile : + +
diff --git a/templates/profile/jobs.secteur.tpl b/templates/profile/jobs.secteur.tpl index 5af83dd..dac620c 100644 --- a/templates/profile/jobs.secteur.tpl +++ b/templates/profile/jobs.secteur.tpl @@ -21,7 +21,7 @@ {**************************************************************************} - {iterate from=$ssecteurs item=ssecteur} diff --git a/templates/profile/jobs.tpl b/templates/profile/jobs.tpl index f0bfd77..46fe55c 100644 --- a/templates/profile/jobs.tpl +++ b/templates/profile/jobs.tpl @@ -55,7 +55,7 @@ function makeAddJob(id) return function(data) { $('#add_job').before(data); - updateSecteur('job_' + id, 'job[' + id + ']', ''); + updateSecteur('job_' + id, 'jobs[' + id + ']', ''); }; } @@ -68,16 +68,39 @@ function addJob() $.get(platal_baseurl + 'profile/ajax/job/' + i, makeAddJob(i)); } +function validGeoloc(id, pref) +{ + 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 + "[text]"].value = document.forms.prof_annu[pref + "[geoloc]"].value; + attachEvent(document.forms.prof_annu[pref + "[text]"], "click", + function() { document.forms.prof_annu[pref + "[text]"].blur(); }); + document.forms.prof_annu[pref + "[text]"].className = ''; +} + +function validAddress(id, pref) +{ + 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"; + attachEvent(document.forms.prof_annu[pref + "[text]"], "click", + function() { document.forms.prof_annu[pref + "[text]"].blur(); }); + document.forms.prof_annu[pref + "[text]"].className = ''; +} + {/literal} //]]> -{foreach from=$entreprises item=job key=i} +{foreach from=$jobs item=job key=i} {include file="profile/jobs.job.tpl" i=$i job=$job new=false} - + {/foreach} {if $jobs|@count eq 0} {include file="profile/jobs.job.tpl" i=0 job=0 new=true} - + {/if}
@@ -114,7 +137,7 @@ function addJob()
- +
diff --git a/upgrade/0.9.15/02_entreprises.sql b/upgrade/0.9.15/02_entreprises.sql new file mode 100644 index 0000000..859e9ae --- /dev/null +++ b/upgrade/0.9.15/02_entreprises.sql @@ -0,0 +1,7 @@ +alter table entreprises add column cityid int(11) default null after city; +alter table entreprises add column regiontxt varchar(80) not null after region; +alter table entreprises add key cityid (cityid); +alter table entreprises add key country (country); +alter table entreprises add key region (region); + +# vim:set syntax=mysql: -- 2.1.4