X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile%2Fjobs.inc.php;h=33690c4abef66888535f52d2b65d970e7f70c3f6;hb=7b642046b0dbaf122f12beeb565879f3b3dd8171;hp=5b497c98c7e347bb82bb604f1cd151526519ba4a;hpb=be6ab042d1dc34d9e42557281b48dd8da400231b;p=platal.git diff --git a/modules/profile/jobs.inc.php b/modules/profile/jobs.inc.php index 5b497c9..33690c4 100644 --- a/modules/profile/jobs.inc.php +++ b/modules/profile/jobs.inc.php @@ -1,6 +1,6 @@ settings['cv'] = null; $this->settings['jobs'] = new ProfileJob(); + $this->watched['cv'] = $this->watched['jobs'] = true; } - protected function fetchData() + 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 @@ -149,9 +149,10 @@ class ProfileJobs extends ProfilePage e.country, gp.pays, gp.display, FIND_IN_SET('geoloc', flags), e.tel, e.fax, e.mobile, e.email, e.web, e.pub, - e.adr_pub, e.tel_pub, e.email_pub + e.adr_pub, e.tel_pub, e.email_pub, + e.glat AS precise_lat, e.glng AS precise_lon FROM entreprises AS e - INNER JOIN geoloc_pays AS gp ON(gp.a2 = e.country) + LEFT JOIN geoloc_pays AS gp ON(gp.a2 = e.country) WHERE uid = {?} AND entreprise != '' ORDER BY entrid", S::i('uid')); $this->values['jobs'] = array(); @@ -159,7 +160,7 @@ class ProfileJobs extends ProfilePage $adr1, $adr2, $adr3, $postcode, $city, $cityid, $region, $regiontxt, $country, $countrytxt, $display, $checked, $tel, $fax, $mobile, $email, $web, - $pub, $adr_pub, $tel_pub, $email_pub) = $res->next()) { + $pub, $adr_pub, $tel_pub, $email_pub, $glat, $glng) = $res->next()) { $this->values['jobs'][] = array('name' => $name, 'secteur' => $secteur, 'ss_secteur' => $ss_secteur, @@ -177,21 +178,21 @@ class ProfileJobs extends ProfilePage 'countrytxt' => $countrytxt, 'display' => $display, 'pub' => $adr_pub, - 'checked' => $checked), + 'checked' => $checked, + 'precise_lat'=> $glat, + 'precise_lon'=> $glng), '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() + protected function _saveData() { if ($this->changed['cv']) { XDB::execute("UPDATE auth_user_md5 @@ -199,12 +200,10 @@ class ProfileJobs extends ProfilePage WHERE user_id = {?}", $this->values['cv'], S::i('uid')); } - parent::saveData(); } - public function prepare(PlatalPage &$page) + public function _prepare(PlatalPage &$page, $id) { - parent::prepare($page); $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