From 1a0064e8bad2be38f5e3c785f581354ed4c66b6b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Wed, 20 Oct 2010 11:59:20 +0200 Subject: [PATCH] Fix jobterm edition in profile. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- modules/profile/jobs.inc.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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(); } -- 2.1.4