From: Steve Sutton Date: Mon, 7 Dec 2015 21:31:25 +0000 (-0500) Subject: Updates for the taxonomy names. X-Git-Tag: v1.2.0^2~4 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=5a71388e339936297e7433324cef295a1c16a7e2;p=WP-Plugins%2Fglm-employment.git Updates for the taxonomy names. Setup defines for these and use theme. --- diff --git a/assets/click-here-to-print.jpg b/assets/click-here-to-print.jpg new file mode 100644 index 0000000..05ea0fa Binary files /dev/null and b/assets/click-here-to-print.jpg differ diff --git a/controllers/front.php b/controllers/front.php index 30aea10..4a84ed8 100644 --- a/controllers/front.php +++ b/controllers/front.php @@ -337,20 +337,28 @@ class glm_employment_front if (in_array($field['name'], array('fname', 'lname', 'mname'))) { $this->$field['name'] = $form[$rowKey][$fieldKey]['value']; } - if ( ($field['type'] == 'checkbox' || $field['type'] == 'radio') - && isset($field['opts']) && !empty($field['opts']) + if ( ($field['type'] == 'radio') && isset($field['opts']) && !empty($field['opts']) ) { foreach ($field['opts'] as $opKey => $option) { if (isset($_POST[$field['name']])) { $form[$rowKey][$fieldKey]['opts'][$opKey]['checked'] = true; - if ($field['type'] == 'checkbox') { - $_POST[$option['name']] = $option['value']; - } - } } } + if ( ($field['type'] == 'checkbox') && isset($field['opts']) && !empty($field['opts']) + ) { + $checkboxOptions = array(); + foreach ($field['opts'] as $opKey => $option) { + if (isset($_POST[$option['name']])) { + $form[$rowKey][$fieldKey]['opts'][$opKey]['checked'] = true; + $_POST[$option['name']][] = $option['value']; + $checkboxOptions[] = $option['value']; + } + } + $form[$rowKey][$fieldKey]['value'][] = implode(', ', $checkboxOptions); + $checkboxOptions = array(); + } if ( isset($field['req']) && $field['req'] == true && $_POST[$field['name']] == '' @@ -360,8 +368,7 @@ class glm_employment_front ++$this->errorCount; } - if ( isset($field['rule']) - && $_POST[$field['name']] != '' + if ( isset($field['rule']) && $_POST[$field['name']] != '' ) { switch ($field['rule']) { case 'email': @@ -406,6 +413,14 @@ class glm_employment_front global $wpdb, $wp; $job = get_post($job_id); $custom = get_post_custom($job->ID); + $depTax = wp_get_post_terms( $job->ID, GLM_EMP_TAX_DEPARTMENTS, 'name' ); + foreach ($depTax as $depTerm) { + $deps[] = $depTerm->name; + } + $catTax = wp_get_post_terms( $job->ID, GLM_EMP_TAX_CATEGORIES, 'name' ); + foreach ($catTax as $catTerm) { + $cats[] = $catTerm->name; + } $job->glm_jobs_startdate = $custom['glm_jobs_startdate'][0]; $job->glm_jobs_enddate = $custom['glm_jobs_enddate'][0]; $job->glm_jobs_contact = $custom['glm_jobs_contact'][0]; @@ -415,6 +430,8 @@ class glm_employment_front $job->glm_jobs_email = $custom['glm_jobs_email'][0]; $job->glm_jobs_comments = $custom['glm_jobs_comments'][0]; $job->glm_jobs_code = $custom['glm_jobs_code'][0]; + $job->glm_jobs_property = $deps; + $job->glm_jobs_category = $cats; $current_url = esc_url(add_query_arg($wp->query_string, '', home_url($wp->request))); $applyOnlineHref = $current_url . ((strpos($current_url, '?')) ? '&' : '?') @@ -443,6 +460,7 @@ class glm_employment_front ? filter_var($_REQUEST['glm_jobsdepartment']) : false; $args = array( + 'posts_per_page' => -1, 'post_type' => GLM_EMP_POST_TYPE, 'meta_query' => array( array( @@ -481,7 +499,16 @@ class glm_employment_front $current_url = esc_url(add_query_arg($wp->query_string, '', home_url($wp->request))); $iterator = 1; foreach ($jobs as $job) { + $deps = $cats = array(); $custom = get_post_custom($job->ID); + $depTax = wp_get_post_terms( $job->ID, GLM_EMP_TAX_DEPARTMENTS, 'name' ); + foreach ($depTax as $depTerm) { + $deps[] = $depTerm->name; + } + $catTax = wp_get_post_terms( $job->ID, GLM_EMP_TAX_CATEGORIES, 'name' ); + foreach ($catTax as $catTerm) { + $cats[] = $catTerm->name; + } $job->end = false; $job->glm_jobs_startdate = $custom['glm_jobs_startdate'][0]; $job->glm_jobs_enddate = $custom['glm_jobs_enddate'][0]; @@ -492,6 +519,8 @@ class glm_employment_front $job->glm_jobs_email = $custom['glm_jobs_email'][0]; $job->glm_jobs_comments = $custom['glm_jobs_comments'][0]; $job->glm_jobs_code = $custom['glm_jobs_code'][0]; + $job->glm_jobs_property = $deps; + $job->glm_jobs_category = $cats; $job->href = $current_url . ((strpos($current_url, '?')) ? '&' : '?') . "job=" . $job->ID; diff --git a/css/admin-print-application.css b/css/admin-print-application.css index 5dd923d..62bcdbb 100644 --- a/css/admin-print-application.css +++ b/css/admin-print-application.css @@ -22,8 +22,8 @@ width: 91.66667%; } .large-12 { width: 100%; } -#adminmenuback, #adminmenuwrap, #wpadminbar, #wpfooter { - display: none; +#adminmenu, #adminmenuback, #adminmenuwrap, #wpadminbar, #wpfooter, .updated, #print-this-page { + display: none !important; } #appForm { width: 100%; diff --git a/glm-employment.php b/glm-employment.php index 8f4b1f9..a081020 100644 --- a/glm-employment.php +++ b/glm-employment.php @@ -17,7 +17,11 @@ define('GLM_EMP_VERSION', '0.0.1'); define('GLM_EMP_VRS_OPTION_NAME', 'glm_jobs_db_version'); define('GLM_EMP_POST_TYPE', 'glm_jobs'); define('GLM_EMP_TAX_CATEGORIES', 'glm_jobscategory'); +define('GLM_EMP_CATEGORY_SINGLE', 'Category'); +define('GLM_EMP_CATEGORY_PLURAL', 'Categories'); define('GLM_EMP_TAX_DEPARTMENTS', 'glm_jobsdepartment'); +define('GLM_EMP_DEPARTMENT_SINGLE', 'Department'); +define('GLM_EMP_DEPARTMENT_PLURAL', 'Departments'); define('GLM_EMP_APPLICATION_TABLE', 'glm_jobs_application'); define('GLM_EMP_FORM_TABLE', 'glm_jobs_app_form'); $wp_upload_dir = wp_upload_dir(); diff --git a/models/job.php b/models/job.php index 21eb477..8c1b71d 100644 --- a/models/job.php +++ b/models/job.php @@ -328,7 +328,7 @@ class glm_employment_job 'menu_name' => 'Jobs' ); $args = array( -// 'label' => __('Jobs'), + 'label' => __('Jobs'), 'labels' => $labels, 'description' => 'Stores Jobs and Job data', 'public' => true, @@ -367,7 +367,7 @@ class glm_employment_job { global $post, $post_ID; - $messages['post'] = array( + $messages['glm_jobs'] = array( 0 => '', // Unused. Messages start at index 1. 1 => sprintf(__('Job updated. View item'), esc_url(get_permalink($post_ID))), @@ -404,28 +404,28 @@ class glm_employment_job public function createJobTaxonomy() { $labels = array( - 'name' => _x('Categories', + 'name' => _x(GLM_EMP_CATEGORY_PLURAL, 'taxonomy general name'), - 'singular_name' => _x('Category', + 'singular_name' => _x(GLM_EMP_CATEGORY_SINGLE, 'taxonomy singular name'), - 'search_items' => __('Search Categories'), - 'popular_items' => __('Popular Categories'), - 'all_items' => __('All Categories'), + 'search_items' => __('Search' . GLM_EMP_CATEGORY_PLURAL), + 'popular_items' => __('Popular ' . GLM_EMP_CATEGORY_PLURAL), + 'all_items' => __('All ' . GLM_EMP_CATEGORY_PLURAL), 'parent_item' => null, 'parent_item_colon' => null, - 'edit_item' => __('Edit Category'), - 'update_item' => __('Update Category'), - 'add_new_item' => __('Add New Category'), - 'new_item_name' => __('New Category Name'), - 'separate_items_with_commas' => __('Separate categories with commas'), - 'add_or_remove_items' => __('Add or remove categories'), - 'choose_from_most_used' => __('Choose from the most used categories'), + 'edit_item' => __('Edit ' . GLM_EMP_CATEGORY_SINGLE), + 'update_item' => __('Update ' . GLM_EMP_CATEGORY_SINGLE), + 'add_new_item' => __('Add New ' . GLM_EMP_CATEGORY_SINGLE), + 'new_item_name' => __('New ' . GLM_EMP_CATEGORY_SINGLE . ' Name'), + 'separate_items_with_commas' => __('Separate ' . strtolower( GLM_EMP_CATEGORY_PLURAL ) . ' with commas'), + 'add_or_remove_items' => __('Add or remove ' . strtolower( GLM_EMP_CATEGORY_PLURAL )), + 'choose_from_most_used' => __('Choose from the most used ' . strtolower( GLM_EMP_CATEGORY_PLURAL )), ); register_taxonomy( GLM_EMP_TAX_CATEGORIES, GLM_EMP_POST_TYPE, array( - 'label' => __('Job Category'), + 'label' => __('Job ' . GLM_EMP_CATEGORY_SINGLE), 'labels' => $labels, 'hierarchical' => true, 'show_ui' => true, @@ -436,28 +436,28 @@ class glm_employment_job )); $labels = array( - 'name' => _x('Departments', + 'name' => _x(GLM_EMP_DEPARTMENT_PLURAL, 'taxonomy general name'), - 'singular_name' => _x('Department', + 'singular_name' => _x(GLM_EMP_DEPARTMENT_SINGLE, 'taxonomy singular name'), - 'search_items' => __('Search Departments'), - 'popular_items' => __('Popular Departments'), - 'all_items' => __('All Departments'), + 'search_items' => __('Search ' . GLM_EMP_DEPARTMENT_PLURAL), + 'popular_items' => __('Popular ' . GLM_EMP_DEPARTMENT_PLURAL), + 'all_items' => __('All ' . GLM_EMP_DEPARTMENT_PLURAL), 'parent_item' => null, 'parent_item_colon' => null, - 'edit_item' => __('Edit Department'), - 'update_item' => __('Update Department'), - 'add_new_item' => __('Add New Department'), - 'new_item_name' => __('New Department Name'), - 'separate_items_with_commas' => __('Separate departments with commas'), - 'add_or_remove_items' => __('Add or remove departments'), - 'choose_from_most_used' => __('Choose from the most used departments'), + 'edit_item' => __('Edit ' . GLM_EMP_DEPARTMENT_SINGLE), + 'update_item' => __('Update ' . GLM_EMP_DEPARTMENT_SINGLE), + 'add_new_item' => __('Add New ' . GLM_EMP_DEPARTMENT_SINGLE), + 'new_item_name' => __('New ' . GLM_EMP_DEPARTMENT_SINGLE . ' Name'), + 'separate_items_with_commas' => __('Separate ' . strtolower( GLM_EMP_DEPARTMENT_PLURAL ) . ' with commas'), + 'add_or_remove_items' => __('Add or remove ' . strtolower( GLM_EMP_DEPARTMENT_PLURAL )), + 'choose_from_most_used' => __('Choose from the most used ' . strtolower( GLM_EMP_DEPARTMENT_PLURAL )), ); register_taxonomy( GLM_EMP_TAX_DEPARTMENTS, GLM_EMP_POST_TYPE, array( - 'label' => __('Job Department'), + 'label' => __('Job ' . GLM_EMP_DEPARTMENT_SINGLE), 'labels' => $labels, 'hierarchical' => true, 'show_ui' => true, diff --git a/views/admin/view-application.php b/views/admin/view-application.php index 8095610..8d8337f 100644 --- a/views/admin/view-application.php +++ b/views/admin/view-application.php @@ -1,5 +1,6 @@ - - + + +
diff --git a/views/front/formTemplate.php b/views/front/formTemplate.php index b3c5728..91f8c2a 100644 --- a/views/front/formTemplate.php +++ b/views/front/formTemplate.php @@ -1,22 +1,11 @@ -
+

@@ -28,9 +17,15 @@ - + + + -

+ +
+ +

+

@@ -40,9 +35,18 @@
-
+
class="error"> - + ' . $field['label'] . ''; + } else { + echo $field['label']; + } + if ( $field['label'] == '' && $field ['hdr'] ) { + echo '' . $field['hdr']['label'] . ''; + } + }?> @@ -115,7 +119,9 @@ - + + + @@ -140,10 +147,17 @@
- + +
+ +
-
+
+ + + +
diff --git a/views/front/jobDetail.php b/views/front/jobDetail.php index 752537c..09934f0 100644 --- a/views/front/jobDetail.php +++ b/views/front/jobDetail.php @@ -1,9 +1,32 @@ -Back To Search +
+

post_title; ?>

+ glm_jobs_property) : ?> +
+ glm_jobs_property ) > 1 ) ? GLM_EMP_DEPARTMENT_PLURAL . ':' : GLM_EMP_DEPARTMENT_SINGLE . ':' ?> + glm_jobs_property);?> +
+ + glm_jobs_category) : ?> +
+ glm_jobs_category ) > 1 ) ? GLM_EMP_CATEGORY_PLURAL . ':' : GLM_EMP_CATEGORY_SINGLE . ':' ?> + glm_jobs_category);?> +
+ + glm_jobs_status):?>
Status: glm_jobs_status; ?>
+ + glm_jobs_pay_grade):?>
Pay Grade: glm_jobs_pay_grade; ?>
+ + glm_jobs_email):?>
Shift: glm_jobs_shift; ?>
+ + glm_jobs_contact):?>
Contact: glm_jobs_email):?> @@ -13,6 +36,7 @@
+
post_content);?>
Apply Online -
\ No newline at end of file +
diff --git a/views/front/jobList.php b/views/front/jobList.php index 1cd1cc4..02774e2 100644 --- a/views/front/jobList.php +++ b/views/front/jobList.php @@ -1,11 +1,20 @@
-

List Jobs

-
+

post_title;?>

-
Status: glm_jobs_status;?>
- + glm_jobs_property) : ?> +
+ glm_jobs_property ) > 1 ) ? GLM_EMP_DEPARTMENT_PLURAL . ':' : GLM_EMP_DEPARTMENT_SINGLE . ':' ?> + glm_jobs_property);?> +
+ + glm_jobs_category) : ?> +
+ glm_jobs_category ) > 1 ) ? GLM_EMP_CATEGORY_PLURAL . ':' : GLM_EMP_CATEGORY_SINGLE . ':' ?> + glm_jobs_category);?> +
+
diff --git a/views/front/jobSearch.php b/views/front/jobSearch.php index 7dbaa99..b12a496 100644 --- a/views/front/jobSearch.php +++ b/views/front/jobSearch.php @@ -14,4 +14,4 @@
- \ No newline at end of file +