From 3c74642259203c7f11e21ef0a75497660170c4ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sun, 5 Jun 2011 19:36:43 +0200 Subject: [PATCH] Fixes address form in new job edition. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- htdocs/javascript/profile.js | 4 ++-- modules/profile.php | 5 ++++- templates/profile/jobs.tpl | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/javascript/profile.js b/htdocs/javascript/profile.js index 765c43d..0d63c9b 100644 --- a/htdocs/javascript/profile.js +++ b/htdocs/javascript/profile.js @@ -549,13 +549,13 @@ function makeAddJob(id) }; } -function addJob() +function addJob(pid) { var i = 0; while ($('#jobs_' + i).length != 0) { ++i; } - $.xget('profile/ajax/job/' + i, makeAddJob(i)); + $.xget('profile/ajax/job/' + i + '/' + pid, makeAddJob(i)); } function addEntreprise(id) diff --git a/modules/profile.php b/modules/profile.php index 2327016..9333997 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -429,13 +429,16 @@ class ProfileModule extends PLModule $page->assign('medal', array('id' => $id, 'grade' => 0, 'valid' => 0)); } - function handler_ajax_job($page, $id) + function handler_ajax_job($page, $id, $pid) { pl_content_headers("text/html"); $page->changeTpl('profile/jobs.job.tpl', NO_SKIN); $page->assign('i', $id); $page->assign('job', array()); $page->assign('new', true); + $page->assign('profile', Profile::get($pid)); + $page->assign('isMe', true); + $page->assign('geocoding_removal', true); require_once "emails.combobox.inc.php"; fill_email_combobox($page, array('redirect', 'job', 'stripped_directory')); } diff --git a/templates/profile/jobs.tpl b/templates/profile/jobs.tpl index 67a8592..09f0a89 100644 --- a/templates/profile/jobs.tpl +++ b/templates/profile/jobs.tpl @@ -30,7 +30,7 @@ {/if}