adding the management settings for page id to the detail page as well
authorAnthony Talarico <talarico@gaslightmedia.com>
Wed, 1 Aug 2018 14:53:02 +0000 (10:53 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Wed, 1 Aug 2018 14:53:02 +0000 (10:53 -0400)
detail page needs the page id for the action url in the search dropdown

models/front/jobs/detail.php
views/front/jobs/detail.html

index 63248f4..8d07faa 100644 (file)
@@ -106,6 +106,14 @@ class GlmMembersFront_jobs_detail extends GlmDatajobs
     {
         $job_titles = new GlmDataJobTitles($this->wpdb,$this->config);
         $job_titles = $job_titles->getList();
+        $listUrl                = GLM_MEMBERS_JOBS_SITE_BASE_URL ."/job-postings";
+
+        $sql = "SELECT list_page_id FROM " . GLM_MEMBERS_JOBS_PLUGIN_DB_PREFIX . "management";
+        $list_page_id = $this->wpdb->get_results($sql, 'ARRAY_A');
+
+        if(!empty($list_page_id)){
+            $listUrl  = get_permalink($list_page_id[0]['list_page_id']);
+        }
 
         $success_message = "";
         $option = false;
@@ -136,6 +144,7 @@ class GlmMembersFront_jobs_detail extends GlmDatajobs
             'jobTitles'     => $job_titles,
             'siteBaseUrl'   => GLM_MEMBERS_JOBS_SITE_BASE_URL, 
             'currentUrl'    => GLM_MEMBERS_JOBS_PLUGIN_CURRENT_URL,
+            'listUrl'       => $listUrl
         );
 
         // Return status, any suggested view, and any data to controller
index 1e3f2c9..0371323 100644 (file)
@@ -1,6 +1,6 @@
 <div class="front-job-listings-wrapper">
     <div class="job-title-search glm-row">
-        <form class="front-job-search" action="{$siteBaseUrl}job-postings" method="post" enctype="multipart/form-data">
+        <form class="front-job-search" action="{$listUrl}" method="post" enctype="multipart/form-data">
             <select name="job_titles" id="job_title_dropdown">
                 <option value="">Show All</option>
                 {foreach $jobTitles as $jtitle=>$title}