From c54d7e7961269e4dbcc55c2c3c3d38fe04a4daed Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 16 Oct 2015 16:17:17 -0400 Subject: [PATCH] Update the output of the jobs and add new field for phone phone was missing. --- controllers/front.php | 17 +++++++++++++---- models/job.php | 4 ++++ views/admin/job_meta.php | 9 +++++++-- views/front/jobDetail.php | 37 +++++++++++++++++++++++-------------- 4 files changed, 47 insertions(+), 20 deletions(-) diff --git a/controllers/front.php b/controllers/front.php index 20513c4..01866b5 100644 --- a/controllers/front.php +++ b/controllers/front.php @@ -415,10 +415,16 @@ class emmet_employment_front $job->emmet_jobs_email = $custom['emmet_jobs_email'][0]; $job->emmet_jobs_comments = $custom['emmet_jobs_comments'][0]; $job->emmet_jobs_code = $custom['emmet_jobs_code'][0]; - //$current_url = esc_url(add_query_arg($wp->query_string, '', home_url($wp->request))); - //$applyOnlineHref = $current_url - //. ((strpos($current_url, '?')) ? '&' : '?') - //. self::FORM_VAR . "=1&job=" . $job->ID; + $job->emmet_jobs_contact = $custom['emmet_jobs_contact'][0]; + $job->emmet_jobs_phone = $custom['emmet_jobs_phone'][0]; + $job->emmet_jobs_email = $custom['emmet_jobs_email'][0]; + + $cats = wp_get_post_terms($job->ID, EMMET_EMP_TAX_DEPARTMENTS, array('fields' => 'names')); + $terms = wp_get_post_terms($job->ID, EMMET_EMP_TAX_CATEGORIES, array('fields' => 'names')); + + $job->terms = $terms; + $job->cats = $cats; + include $this->frontViewDir . '/jobDetail.php'; return; } @@ -492,6 +498,9 @@ class emmet_employment_front $job->emmet_jobs_email = $custom['emmet_jobs_email'][0]; $job->emmet_jobs_comments = $custom['emmet_jobs_comments'][0]; $job->emmet_jobs_code = $custom['emmet_jobs_code'][0]; + $job->emmet_jobs_contact = $custom['emmet_jobs_contact'][0]; + $job->emmet_jobs_phone = $custom['emmet_jobs_phone'][0]; + $job->emmet_jobs_email = $custom['emmet_jobs_email'][0]; $job->href = $current_url . ((strpos($current_url, '?')) ? '&' : '?') . "job=" . $job->ID; diff --git a/models/job.php b/models/job.php index ead637e..6f47b9c 100644 --- a/models/job.php +++ b/models/job.php @@ -246,6 +246,9 @@ class emmet_employment_job $emmet_jobs_email = (isset($emmet_jobs_email[0])) ? $emmet_jobs_email[0] : ''; + $emmet_jobs_phone = (isset($emmet_jobs_phone[0])) + ? $emmet_jobs_phone[0] + : ''; $emmet_jobs_comments = (isset($emmet_jobs_comments[0])) ? $emmet_jobs_comments[0] : ''; @@ -299,6 +302,7 @@ class emmet_employment_job update_post_meta($post->ID, 'emmet_jobs_contact', $_POST['emmet_jobs_contact']); update_post_meta($post->ID, 'emmet_jobs_email', $_POST['emmet_jobs_email']); + update_post_meta($post->ID, 'emmet_jobs_phone', $_POST['emmet_jobs_phone']); update_post_meta($post->ID, 'emmet_jobs_comments', $_POST['emmet_jobs_comments']); update_post_meta($post->ID, 'emmet_jobs_code', $_POST['emmet_jobs_code']); diff --git a/views/admin/job_meta.php b/views/admin/job_meta.php index cd74b3b..7a7d1cb 100644 --- a/views/admin/job_meta.php +++ b/views/admin/job_meta.php @@ -37,12 +37,17 @@ value="" />
  • - +
  • - + + +
  • +
  • +
  • diff --git a/views/front/jobDetail.php b/views/front/jobDetail.php index ea3a34a..d1e99a5 100644 --- a/views/front/jobDetail.php +++ b/views/front/jobDetail.php @@ -1,6 +1,16 @@ Back To Search

    post_title; ?>

    - emmet_jobs_status):?> + cats) > 0) :?> +
    Category: cats as $cat) : ?> + +
    + + terms) > 0) : ?> +
    Department: terms as $term) : ?> + +
    + + emmet_jobs_status):?>
    Status: emmet_jobs_status; ?>
    emmet_jobs_pay_grade):?> @@ -8,24 +18,23 @@ emmet_jobs_shift):?> -
    Shift: emmet_jobs_shift; ?>
    - - - emmet_jobs_contact):?> -
    Contact: - emmet_jobs_email):?> - - - emmet_jobs_contact; ?> - emmet_jobs_email):?> - - -
    +
    Primary Shift: emmet_jobs_shift; ?>
    +
    post_content);?>
    emmet_jobs_code):?>
    Job Code: emmet_jobs_code; ?>
    + + emmet_jobs_contact):?> +
    Contact: emmet_jobs_contact; ?>
    + + emmet_jobs_phone):?> +
    Phone: emmet_jobs_phone; ?>
    + + emmet_jobs_email):?> +
    Email: emmet_jobs_email; ?>
    + Employment Application -- 2.17.1