X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile%2Fjobs.inc.php;h=18a8f6aafb13b9dbc035c5ec811521553cd00c34;hb=d1e6167749fdad08c81e23d09e1bbbf76e3b989b;hp=c376f12dd50529099b9b981b0bd95bc1ca4adb1c;hpb=afaa2cc709e079cc03ccc656bc043140cd0da2c0;p=platal.git diff --git a/modules/profile/jobs.inc.php b/modules/profile/jobs.inc.php index c376f12..18a8f6a 100644 --- a/modules/profile/jobs.inc.php +++ b/modules/profile/jobs.inc.php @@ -270,9 +270,9 @@ class ProfileJobs extends ProfilePage { // Checkout the CV $res = XDB::query("SELECT cv - FROM auth_user_md5 - WHERE user_id = {?}", - S::i('uid')); + FROM profiles + WHERE pid = {?}", + $this->pid()); $this->values['cv'] = $res->fetchOneCell(); // Checkout the corps @@ -280,7 +280,7 @@ class ProfileJobs extends ProfilePage rankid AS rank, corps_pub AS pub FROM profile_corps WHERE uid = {?}", - S::i('uid')); + $this->pid()); $this->values['corps'] = $res->fetchOneAssoc(); // Build the jobs tree @@ -303,7 +303,7 @@ class ProfileJobs extends ProfilePage LEFT JOIN profile_addresses AS ah ON (ah.jobid = j.jobid AND ah.type = 'hq') WHERE j.uid = {?} ORDER BY j.id", - S::i('uid')); + $this->pid()); $this->values['jobs'] = array(); if ($res->numRows() > 0) { @@ -453,10 +453,10 @@ class ProfileJobs extends ProfilePage protected function _saveData() { if ($this->changed['cv']) { - XDB::execute("UPDATE auth_user_md5 + XDB::execute("UPDATE profiles SET cv = {?} - WHERE user_id = {?}", - $this->values['cv'], S::i('uid')); + WHERE pid = {?}", + $this->values['cv'], $this->pid()); } if ($this->changed['corps']) { @@ -465,14 +465,14 @@ class ProfileJobs extends ProfilePage rankid = {?}, corps_pub = {?} WHERE uid = {?}", $this->values['corps']['original'], $this->values['corps']['current'], - $this->values['corps']['rank'], $this->values['corps']['pub'], S::i('uid')); + $this->values['corps']['rank'], $this->values['corps']['pub'], $this->pid()); } } public function _prepare(PlPage &$page, $id) { require_once "emails.combobox.inc.php"; - fill_email_combobox($page); + fill_email_combobox($page, $this->owner, $this->profile); $res = XDB::query("SELECT id, name AS label FROM profile_job_sector_enum");