From: Stéphane Jacob Date: Sun, 5 Jun 2011 17:36:43 +0000 (+0200) Subject: Fixes address form in new job edition. X-Git-Tag: xorg/1.1.2~51 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=3c74642259203c7f11e21ef0a75497660170c4ec;p=platal.git Fixes address form in new job edition. Signed-off-by: Stéphane Jacob --- 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}