I must be having a bad day. I can't figure out to get a list of the applications for a given job.

Can anyone put me on the right track?

Comments

szermierz’s picture

I've got the same problem.

I followed the instructions on this page, http://drupal.org/node/341762 .

And am stuck exactly in the same place you are.

Most likely the missing step in the instructions is setting up Views.

szermierz’s picture

I think these instructions were what I was looking for.

http://drupal.org/node/329093#comment-1089205

ccurvey’s picture

Hmm, I'm working with Drupal 6.9. I think that other thread is specific to D5.2.

I have my own CCK types set up. (Jobsearch.job points to "job_posting", and jobsearch.resume points to "resume")

What I'm trying to do is create a view that takes a job id and shows me the applications for that job. I'm guessing that there's something I have to do with the "Relationships" so that my query can return all the applications for a given job, but I can't figure out how to make that happen.

I wonder if this has something to do with http://drupal.org/node/365626

szermierz’s picture

I'm using Drupal 6.9 as well, with the JobSearch version for 6.x .

I haven't looked throught the source yet but I didn't see any 'default views provided by the jobsearch module'.

So I am starting to create my own. Without success so far.

Sounds like you want to pass Job Id as an argument for a view you are creating. I did this the other day for something. Anyway, if I get anyway I will post something.

I'm of two minds about the approach Job Search is presented. It reminds me of the Event versus Calendar argument. Use Event, have most things done for you but lose flexibility. Or use Calendar, along with Date etc, have an underlying API, more flexibility, and build Views as you wish.

I've been using Drupal for about two weeks so it's taking me a little while to get familiar with all the moving parts.

ccurvey’s picture

I guess we're both at about the same point. I did find a way to get just the applications for a single job to appear, by editing the PHP code in job.module.

1) in the function declaration for job_view, add "$nid = NULL" as a parameter. Then pass $nid through job_get_list().
2) add the parameter "$nid = NULL" to job_get_list()
3) In job_get_list, dynamically change the SQL depending on whether you get the node ID ($nid) or not.

281 $sql = "SELECT n.nid, j.uid, j.resume_nid, j.timestamp
282 FROM {node} n INNER JOIN {job} j USING(nid)
283 WHERE n.uid = %d
284 ";
285
286 if ($nid) {
287 $sql .= " and n.nid = %d";
288 }
289
290 $sql .= "
291 AND j.status = 1
292 ORDER by j.timestamp ASC";
293
294 if ($nid) {
295 $result = db_query($sql, $uid, $nid);
296 } else {
297 $result = db_query($sql, $uid);

There may be a better way of doing this (and constructive criticism gladly accepted), but it works for me right now.

szermierz’s picture

I'm going through the function job_views_default_views() looking at it and some documentation about Views past and present. It would be really nice for these to work straight out of the box. And after that I'd like to see what can be done for new Views in the View UI.

It's taking a little time because I can only squeeze in moments between my actual work.

jrosen’s picture

Take a look at the patch in Issue #391774: Patch for Job Search 6.x-1.x-dev - User profile updates and Views 2 integration.

It provides a Relationship from Job => User.

It also provides 3 default views that may help you as a starting point:
* my_applications - My applications: shows job applications by the currently logged in user.
* job_applications - Job applications: Recruiter/employer view of all jobs applied for.
* seeker_applications - Seeker applications: a view that accepts an optional UID argument to list all applications, or a specific user's applications

If you try the patch, please post a comment in Issue #391774, so we can get community feedback and get the patch rolled into the next Drupal 6 release of the Job Search module.

Jason

xamount’s picture

Status: Active » Closed (duplicate)

This issue can be definitely be solved by a View once this patch gets into the job search module: #391774: Patch for Job Search 6.x-1.x-dev - User profile updates and Views 2 integration.

Please apply that patch, create the View that you want and report any issues in the issue I just quoted. I am marking this issue as a duplicate.