From: Raphaël Barrois Date: Wed, 20 Oct 2010 09:59:20 +0000 (+0200) Subject: Fix jobterm edition in profile. X-Git-Tag: xorg/1.0.1~30 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=1a0064e8bad2be38f5e3c785f581354ed4c66b6b;p=platal.git Fix jobterm edition in profile. Signed-off-by: Raphaël Barrois --- diff --git a/modules/profile/jobs.inc.php b/modules/profile/jobs.inc.php index 785a48f..694f0af 100644 --- a/modules/profile/jobs.inc.php +++ b/modules/profile/jobs.inc.php @@ -83,7 +83,7 @@ class ProfileSettingJob implements ProfileSetting $backtrack = array(); foreach ($jobs as $key=>$job) { $compagnies[] = $job['jobid']; - $backtrack[$job['jobid']] = $key; + $backtrack[$job['id']] = $key; } $it = Address::iterate(array($page->pid()), array(Address::LINK_JOB)); @@ -94,18 +94,19 @@ class ProfileSettingJob implements ProfileSetting while ($phone = $it->next()) { $jobs[$phone->linkId()]['w_phone'][$phone->id()] = $phone->toFormArray(); } - $res = XDB::iterator("SELECT e.jtid, e.full_name, j.jid AS jobid + $res = XDB::iterator("SELECT e.jtid, e.full_name, j.jid FROM profile_job_term_enum AS e INNER JOIN profile_job_term AS j USING(jtid) WHERE pid = {?} ORDER BY j.jid", $page->pid()); while ($term = $res->next()) { - $jobid = $term['jobid']; - if (!isset($backtrack[$jobid])) { + // $jid is the ID of the job among this user's jobs + $jid = $term['jid']; + if (!isset($backtrack[$jid])) { continue; } - $job =& $jobs[$backtrack[$jobid]]; + $job =& $jobs[$backtrack[$jid]]; if (!isset($job['terms'])) { $job['terms'] = array(); }