'label' => 'Salary Desired',
'grid' => 6
];
+$properties = get_terms(STAFFORDS_EMP_TAX_DEPARTMENTS, array(
+ 'heirarchical' => false,
+ 'hide_empty' => false
+));
+$opts = array();
+foreach ( $properties as $term ) {
+ $opts[] = array(
+ 'name' => 'location_preference_' . $term->slug,
+ 'label' => $term->name,
+ 'value' => $term->name
+ );
+}
$location_preference = [
'type' => 'checkbox',
'name' => 'location_preference',
'label' => 'Property',
- 'grid' => 12,
+ 'grid' => 12,
'req' => false,
- 'opts' => [[
- 'name' => 'location_preference_bayview',
- 'label' => 'Bay View Inn',
- 'value' => 'Bay View Inn'
- ],[
- 'name' => 'location_preference_crookedriver',
- 'label' => 'Crooked River Lodge',
- 'value' => 'Crooked River Lodge'
- ],[
- 'name' => 'location_preference_perryhotel',
- 'label' => 'Perry Hotel',
- 'value' => 'Perry Hotel'
- ],[
- 'name' => 'location_preference_pier',
- 'label' => 'Pier Restaurant',
- 'value' => 'Pier Restaurant'
- ],[
- 'name' => 'location_preference_weathervane',
- 'label' => 'Weathervane Restaurant',
- 'value' => 'Weathervane Restaurant'
- ],[
- 'name' => 'location_preference_drawbridge',
- 'label' => 'Drawbridge Bistro',
- 'value' => 'Drawbridge Bistro'
- ]]
+ 'opts' => $opts
];
$high_school_name = [
'type' => 'text',
}
$formPart = 1;
$form = $this->load_form_settings($formPart);
+ $termArray = array();
+ if ( $jobId ) {
+ $terms = wp_get_post_terms( $jobId, STAFFORDS_EMP_TAX_DEPARTMENTS, 'name' );
+ foreach ($terms as $term) {
+ $termArray[] = $term->name;
+ }
+ if ( !empty( $termArray ) ) {
+ foreach ( $form as $key => $formPart ) {
+ if ( is_array( $formPart[0] ) && $formPart[0]['name'] == 'location_preference' ) {
+ foreach ( $termArray as $termName ) {
+ foreach ( $formPart[0]['opts'] as $optkey => $option ) {
+ if ( $option['label'] == $termName ) {
+ $form[$key][0]['opts'][$optkey]['checked'] = 'checked';
+ }
+ }
+ }
+ }
+ }
+ }
+ }
include $this->frontViewDir . '/' . self::FORM_TEMPLATE;
break;
}
));
$labels = array(
- 'name' => _x('Departments',
+ 'name' => _x('Properties',
'taxonomy general name'),
- 'singular_name' => _x('Department',
+ 'singular_name' => _x('Property',
'taxonomy singular name'),
- 'search_items' => __('Search Departments'),
- 'popular_items' => __('Popular Departments'),
- 'all_items' => __('All Departments'),
+ 'search_items' => __('Search Properties'),
+ 'popular_items' => __('Popular Properties'),
+ 'all_items' => __('All Properties'),
'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'),
+ 'edit_item' => __('Edit Property'),
+ 'update_item' => __('Update Property'),
+ 'add_new_item' => __('Add New Property'),
+ 'new_item_name' => __('New Property 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'),
register_taxonomy(
STAFFORDS_EMP_TAX_DEPARTMENTS, STAFFORDS_EMP_POST_TYPE,
array(
- 'label' => __('Job Department'),
+ 'label' => __('Job Property'),
'labels' => $labels,
'hierarchical' => true,
'show_ui' => true,
"cb" => "<input type=\"checkbox\" />",
"title" => "Job Title",
"glmjobs_col_cat" => "Category",
- "glmjobs_col_dep" => "Department",
+ "glmjobs_col_dep" => "Property",
"glmjobs_col_date" => "Dates",
);
return $columns;
<?php endforeach;?>
<?php break;?>
<?php case 'checkbox':?>
- <?php foreach($field['opts'] as $option) :?>
+ <?php $opCounter = 1; $totalOpts = count($field['opts']);?>
+ <?php foreach($field['opts'] as $option) :?><label for="<?php echo $option['name'];?>"
+ class="small-12 medium-6 large-4 columns<?php if ($opCounter == $totalOpts) {echo ' end';}?>">
<input
<?php if (isset($field['error']) && $field['error']){echo 'class="error"';}?>
<?php if (isset($field['req']) && $field['req']){echo 'required';}?>
<?php if (isset($option['checked']) && $option['checked']) {
echo 'checked';
}?> />
- <label for="<?php echo $option['name'];?>"><?php echo $option['label'];?></label>
+ <?php echo $option['label'];?></label>
+ <?php ++$opCounter;?>
<?php endforeach;?>
<?php break;?>
<?php endswitch;?>
<?php wp_dropdown_categories( $cat_args );?>
</div>
<div class="small-12 medium-5 columns">
- <label>Search by Department</label>
+ <label>Search by Property</label>
<?php wp_dropdown_categories( $dep_args );?>
</div>
<div class="small-12 medium-2 columns">
<input class="button" type="submit" value="Search">
</div>
</div>
-</form>
\ No newline at end of file
+</form>