X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile%2Fmentor.inc.php;fp=modules%2Fprofile%2Fmentor.inc.php;h=2ecb60b653b895a356003ee4ffb0a6e645269905;hb=483da16573717c21c7e6da3eacc094048ab7d72f;hp=e85318c64e233a0456e7ded547dc67f5099775b5;hpb=4d336f59bad0da6714bc69fd71aa94056bc455c1;p=platal.git diff --git a/modules/profile/mentor.inc.php b/modules/profile/mentor.inc.php index e85318c..2ecb60b 100644 --- a/modules/profile/mentor.inc.php +++ b/modules/profile/mentor.inc.php @@ -31,7 +31,7 @@ class ProfileSectors 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 ProfileSectors 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 ProfileSectors 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 profile_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 profile_mentor WHERE uid = {?}", - S::i('uid')); + $this->pid()); $this->values['expertise'] = null; } else { XDB::execute("REPLACE INTO profile_mentor (uid, expertise) VALUES ({?}, {?})", - S::i('uid'), $expertise); + $this->pid(), $expertise); $this->values['expertise'] = $expertise; } }