Hi All,
After 2 weeks' work base on job_search project, My site is almost done. This project is great. Thanks for the contributors for this project.
Recently, I need to add more fields of "Resume" into into job_applications view, how can I do it? Is there a simplest solution for this?
In current version of job_search, there are 2 fileds from "Resume": Resume: Applicant Name, Resume: Node ID.
How can I add other fields? for example, Resume-birthday, Resume-email...
Thanks for help!
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | can not get them from list.jpg | 42.53 KB | steve169 |
Comments
Comment #1
kbahey commentedAdd the fields using CCK to the resume content type.
Then create a NEW view and add whatever fields you want to it.
This is a views/cck question, not a job search one.
Comment #2
steve169 commentedThank you kbahey for help!
Maybe my question is not so clear.
Let's say, the "job" content type has job title, job descr, job number, job requirement, ...
the "resume" content type has resume nid, resume title, resume body, resume birth, resume college, resume major, resume cellphone, ...
The employer can view the job_applications with these fields: job title(nid), applyed for(datetime stamp), Resume: Applicant Name(uid), Resume: Node ID(resume_nid), status(boolean). Rite?
I need more fields from "resume" content, not the fields from "job" content. for example, job title(nid), applyed for(datetime stamp), Resume: Applicant Name(uid), Resume: Node ID(resume_nid), status(boolean), Resume: birth(???), Resume :college(???), Resume :major(???), Resume :cellphone(???)...
These addon fields are from "resume" content. I can get them from fields dropdown list. How to do it?
Thanks for help!
Comment #3
kbahey commentedAs I said ...
Create a new content type, call it CV or something , add to it the fields you want using CCK, and make then required.
Then in the settings, make the CV content type the resume type (under admin/settings/job or admin/settings/resume).
Then create a new view, restrict it to the employer/recruiter role, and put in it the fields you want.
Call it "applications", and you are done.
Comment #4
steve169 commentedI use your default view job_applications to check the seekers' applications for an employer.
I override the job_applications view by add a filter "Node author= current logined user".
There is another filter "Node type= job" for this view, rite? So, I can not get field from 'resume', cause the filter 'Node type= resume' is needed, rite?
Do I describe it clearly? :(
Thanks anyway!
Comment #5
steve169 commentedJust like the job/applications, there is a resume title in the results of job/applications, I need to add more resume detail into the results.
Comment #6
kbahey commentedI've answered you twice already, and I am not going to repeat myself.
Try what I suggested and do some experimentation before wasting other peoples' time.
Comment #7
steve169 commentedI still can not find the solution with your hint, kbahey. Sorry.
I hardcoded them in job.module to solve this problem. It works. ^_^
Add these code in function job_view_table()
'resume_nid' => array(
'name' => t('Resume: Node ID'),
'sortable' => TRUE,
//'option' => 'integer',
'option' => 'string',
//'handler' => 'views_handler_field_int',
'handler' => 'job_views_handler_field_title',
'help' => t('Displays the Node ID of the resume node.'),
),
'resume_name' => array(
'name' => t('Resume: Name'),
'sortable' => TRUE,
'notafield' => TRUE,
'option' => 'string',
'handler' => 'job_views_handler_field_name',
'help' => t('Displays the Resume: Name of the resume node.'),
),
'resume_cellphone' => array(
'name' => t('Resume: Cellphone'),
'sortable' => TRUE,
'notafield' => TRUE,
'option' => 'string',
'handler' => 'job_views_handler_field_cellphone',
'help' => t('Displays the Resume: Cellphone of the resume node.'),
),
'uid_email' => array(
'name' => t('Applicant: Email'),
'sortable' => TRUE,
'notafield' => TRUE,
'option' => 'string',
'handler' => 'job_views_handler_field_email',
'help' => t('Displays the Applicant: Email of the resume node.'),
),
'resume_idcard' => array(
'name' => t('Resume: idcard'),
'sortable' => TRUE,
'notafield' => TRUE,
'option' => 'string',
'handler' => 'job_views_handler_field_idcard',
'help' => t('Displays the Resume: idcard of the resume node.'),
),
And finally, add these handlers:
function job_views_handler_field_name($fieldinfo, $fielddata, $value, $data) {
$obj = new stdClass();
$obj = node_load(array('nid' => $data->job_resume_nid));
return $obj->field_name[0]['value'];
}
function job_views_handler_field_idcard($fieldinfo, $fielddata, $value, $data) {
$obj = new stdClass();
$obj = node_load(array('nid' => $data->job_resume_nid));
return $obj->field_idcard[0]['value'];
}
function job_views_handler_field_email($fieldinfo, $fielddata, $value, $data) {
$obj = new stdClass();
$obj = user_load(array('uid' => $data->job_uid));
return $obj->mail;
}
function job_views_handler_field_title($fieldinfo, $fielddata, $value, $data) {
$obj = new stdClass();
$obj = node_load(array('nid' => $value));
return $obj->title;
}
function job_views_handler_field_cellphone($fieldinfo, $fielddata, $value, $data) {
$obj = new stdClass();
$obj = node_load(array('nid' => $data->job_resume_nid));
return $obj->field_cellphone[0]['value'];
}
Is there a function to display value of $obj? """[0]['value'];""" is so ugly!
Thanks!
Comment #8
kbahey commentedThat is good, but it is not generic enough to include in the module. It has fields that are not standard in Drupal (e.g. cellphone).
If you can make a patch that includes only the generic standard fields, I will include it in the base module.
Comment #9
ButterFly-2 commentedComment #10
ButterFly-2 commentedComment #11
ButterFly-2 commentedGreat module. I placed pieces of the code quoted in #7 in the job.module becuase I wanted to present Jobseekers with a list of jobs they applied for and include the resume (title) that they used. It works!
But unfortunately it seems that the cache is not clearing (or there is some other problem) my system seems to keep the last users data when displaying the view, even when I log out, close my browser, and log in as a completely different user.
The only way I get the next users data when they log in, is if I first log in as admin, go to view/tools and clear the cache.
Any ideas of how I can resolve this?
Thanks!
Comment #12
ButterFly-2 commentedComment #13
xamountQuestion has been answered and no more support for D5 version