Fixes address form in new job edition.
authorStéphane Jacob <sj@m4x.org>
Sun, 5 Jun 2011 17:36:43 +0000 (19:36 +0200)
committerStéphane Jacob <sj@m4x.org>
Sun, 5 Jun 2011 17:36:43 +0000 (19:36 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
htdocs/javascript/profile.js
modules/profile.php
templates/profile/jobs.tpl

index 765c43d..0d63c9b 100644 (file)
@@ -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)
index 2327016..9333997 100644 (file)
@@ -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'));
     }
index 67a8592..09f0a89 100644 (file)
@@ -30,7 +30,7 @@
 {/if}
 
 <div id="add_job" class="center">
-  <a href="javascript:addJob()">
+  <a href="javascript:addJob({$profile->id()})">
     {icon name=add title="Ajouter un emploi"} Ajouter un emploi
   </a>
   <br/><br/>