Turn on the application form
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 27 Nov 2015 13:46:40 +0000 (08:46 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 27 Nov 2015 13:46:40 +0000 (08:46 -0500)
controllers/front.php
views/front/formTemplate.php
views/front/jobDetail.php

index 01866b5..9c0c3ba 100644 (file)
@@ -418,13 +418,17 @@ class emmet_employment_front
         $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'));
+
+        $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;
-        
+
+        $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;
         include $this->frontViewDir . '/jobDetail.php';
         return;
     }
index 07051fe..b3c5728 100644 (file)
@@ -1,4 +1,3 @@
-<?php return; ?>
 <style>
     div.static {
         text-align:left;
index 95e2190..3a8f2ed 100644 (file)
@@ -37,4 +37,5 @@
     <div><strong>Email: </strong><a href="mailto: <?php echo $job->emmet_jobs_email; ?>"><?php echo $job->emmet_jobs_email; ?></a></div>
     <?php endif;?>
 
-    <a target="_blank" href="<?php echo get_template_directory_uri();?>/assets/employment-form.pdf">Employment Application</a>
+    <a target="_blank" href="<?php echo get_template_directory_uri();?>/assets/employment-form.pdf">Employment Application</a><br>
+    <a href="<?php echo $applyOnlineHref;?>">Apply Online</a>