X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile%2Fmentor.inc.php;fp=modules%2Fprofile%2Fmentor.inc.php;h=a9690fd053ee1012f3e2bf5845478b0aab23d534;hb=5b2c99878fc75a6acffb2239e284f2cb1782142c;hp=54858b99416a6412660b6a6bc3c9331684279e47;hpb=a93519575833e6886e055abb8b43b3ada6f163bc;p=platal.git diff --git a/modules/profile/mentor.inc.php b/modules/profile/mentor.inc.php index 54858b9..a9690fd 100644 --- a/modules/profile/mentor.inc.php +++ b/modules/profile/mentor.inc.php @@ -31,7 +31,7 @@ class ProfileSecteurs implements ProfileSetting INNER JOIN profile_job_sector_enum AS s ON (m.sectorid = s.id) INNER JOIN profile_job_subsector_enum AS ss ON (s.id = ss.sectorid AND m.subsectorid = ss.id) WHERE m.uid = {?}", - S::i('uid')); + $page->pid()); while (list($s, $ss, $ssname) = $res->next()) { if (!isset($value[$s])) { $value[$s] = array($ss => $ssname); @@ -57,7 +57,7 @@ class ProfileSecteurs implements ProfileSetting XDB::execute("DELETE FROM profile_mentor_sector WHERE uid = {?}", - S::i('uid')); + $page->pid()); if (!count($value)) { return; } @@ -65,7 +65,7 @@ class ProfileSecteurs implements ProfileSetting foreach ($sect as $sid=>&$name) { XDB::execute("INSERT INTO profile_mentor_sector (uid, sectorid, subsectorid) VALUES ({?}, {?}, {?})", - S::i('uid'), $id, $sid); + $page->pid(), $id, $sid); } } } @@ -82,7 +82,7 @@ class ProfileCountry implements ProfileSetting FROM profile_mentor_country AS m INNER JOIN geoloc_countries AS gc ON (m.country = gc.iso_3166_1_a2) WHERE m.uid = {?}", - S::i('uid')); + $page->pid()); while (list($id, $name) = $res->next()) { $value[$id] = $name; } @@ -100,11 +100,11 @@ class ProfileCountry implements ProfileSetting { XDB::execute("DELETE FROM profile_mentor_country WHERE uid = {?}", - S::i('uid')); + $page->pid()); foreach ($value as $id=>&$name) { XDB::execute("INSERT INTO profile_mentor_country (uid, country) VALUES ({?}, {?})", - S::i('uid'), $id); + $page->pid(), $id); } } } @@ -127,7 +127,7 @@ class ProfileMentor extends ProfilePage $res = XDB::query("SELECT expertise FROM mentor WHERE uid = {?}", - S::i('uid')); + $this->pid()); $this->values['expertise'] = $res->fetchOneCell(); } @@ -138,12 +138,12 @@ class ProfileMentor extends ProfilePage if (empty($expertise)) { XDB::execute("DELETE FROM mentor WHERE uid = {?}", - S::i('uid')); + $this->pid()); $this->values['expertise'] = null; } else { XDB::execute("REPLACE INTO mentor (uid, expertise) VALUES ({?}, {?})", - S::i('uid'), $expertise); + $this->pid(), $expertise); $this->values['expertise'] = $expertise; } }