| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin View: Bulk Edit Properties |
| 4 |
*/ |
| 5 |
|
| 6 |
if ( ! defined( 'ABSPATH' ) ) { |
| 7 |
exit; // Exit if accessed directly |
| 8 |
} |
| 9 |
|
| 10 |
?> |
| 11 |
|
| 12 |
<fieldset class="inline-edit-col-right"> |
| 13 |
<div id="propertyhive-fields-bulk" class="inline-edit-col"> |
| 14 |
|
| 15 |
<?php do_action( 'propertyhive_property_bulk_edit_start' ); ?> |
| 16 |
|
| 17 |
<div class="inline-edit-group"> |
| 18 |
<label class="alignleft"> |
| 19 |
<span class="title"><?php echo esc_html(__( 'On Market', 'propertyhive' )); ?></span> |
| 20 |
<span class="input-text-wrap"> |
| 21 |
<select class="on_market" name="_on_market"> |
| 22 |
<?php |
| 23 |
$options = array( |
| 24 |
'' => __( '— No Change —', 'propertyhive' ), |
| 25 |
'yes' => __( 'Yes', 'propertyhive' ), |
| 26 |
'no' => __( 'No', 'propertyhive' ), |
| 27 |
); |
| 28 |
foreach ($options as $key => $value) { |
| 29 |
echo '<option value="' . esc_attr( $key ) . '">' . esc_html($value) . '</option>'; |
| 30 |
} |
| 31 |
?> |
| 32 |
</select> |
| 33 |
</span> |
| 34 |
</label> |
| 35 |
</div> |
| 36 |
|
| 37 |
<div class="inline-edit-group"> |
| 38 |
<label class="alignleft"> |
| 39 |
<span class="title"><?php echo esc_html(__( 'Featured', 'propertyhive' )); ?></span> |
| 40 |
<span class="input-text-wrap"> |
| 41 |
<select class="featured" name="_featured"> |
| 42 |
<?php |
| 43 |
$options = array( |
| 44 |
'' => __( '— No Change —', 'propertyhive' ), |
| 45 |
'yes' => __( 'Yes', 'propertyhive' ), |
| 46 |
'no' => __( 'No', 'propertyhive' ), |
| 47 |
); |
| 48 |
foreach ($options as $key => $value) { |
| 49 |
echo '<option value="' . esc_attr( $key ) . '">' . esc_html($value) . '</option>'; |
| 50 |
} |
| 51 |
?> |
| 52 |
</select> |
| 53 |
</span> |
| 54 |
</label> |
| 55 |
</div> |
| 56 |
|
| 57 |
<div class="inline-edit-group"> |
| 58 |
<label class="alignleft"> |
| 59 |
<span class="title"><?php echo esc_html(__( 'Availability', 'propertyhive' )); ?></span> |
| 60 |
<span class="input-text-wrap"> |
| 61 |
<select class="availability" name="_availability"> |
| 62 |
<?php |
| 63 |
|
| 64 |
$options = array( '' => __( '— No Change —', 'propertyhive' ) ); |
| 65 |
$args = array( |
| 66 |
'hide_empty' => false, |
| 67 |
'parent' => 0 |
| 68 |
); |
| 69 |
$terms = get_terms( 'availability', $args ); |
| 70 |
|
| 71 |
$selected_value = ''; |
| 72 |
if ( !empty( $terms ) && !is_wp_error( $terms ) ) |
| 73 |
{ |
| 74 |
foreach ($terms as $term) |
| 75 |
{ |
| 76 |
$options[$term->term_id] = $term->name; |
| 77 |
} |
| 78 |
} |
| 79 |
|
| 80 |
foreach ($options as $key => $value) { |
| 81 |
echo '<option value="' . esc_attr( $key ) . '">' . esc_html($value) . '</option>'; |
| 82 |
} |
| 83 |
?> |
| 84 |
</select> |
| 85 |
</span> |
| 86 |
</label> |
| 87 |
</div> |
| 88 |
|
| 89 |
<div class="inline-edit-group"> |
| 90 |
<label class="alignleft"> |
| 91 |
<span class="title"><?php echo esc_html(__( 'Negotiator', 'propertyhive' )); ?></span> |
| 92 |
<span class="input-text-wrap"> |
| 93 |
<?php |
| 94 |
$args = array( |
| 95 |
'name' => '_negotiator_id', |
| 96 |
'id' => '_negotiator_id', |
| 97 |
'show_option_none' => '— No Change —', |
| 98 |
'role__not_in' => apply_filters( 'property_negotiator_exclude_roles', array('property_hive_contact', 'subscriber') ) |
| 99 |
); |
| 100 |
wp_dropdown_users($args); |
| 101 |
?> |
| 102 |
</span> |
| 103 |
</label> |
| 104 |
</div> |
| 105 |
|
| 106 |
<div class="inline-edit-group"> |
| 107 |
<label class="alignleft"> |
| 108 |
<span class="title"><?php echo esc_html(__( 'Office', 'propertyhive' )); ?></span> |
| 109 |
<span class="input-text-wrap"> |
| 110 |
<select class="office_id" name="_office_id"> |
| 111 |
<?php |
| 112 |
|
| 113 |
$options = array( '' => __( '— No Change —', 'propertyhive' ) ); |
| 114 |
$args = array( |
| 115 |
'post_type' => 'office', |
| 116 |
'nopaging' => true, |
| 117 |
'orderby' => 'title', |
| 118 |
'order' => 'ASC' |
| 119 |
); |
| 120 |
$office_query = new WP_Query($args); |
| 121 |
|
| 122 |
if ($office_query->have_posts()) |
| 123 |
{ |
| 124 |
while ($office_query->have_posts()) |
| 125 |
{ |
| 126 |
$office_query->the_post(); |
| 127 |
|
| 128 |
$options[get_the_ID()] = get_the_title(); |
| 129 |
} |
| 130 |
} |
| 131 |
|
| 132 |
$office_query->reset_postdata(); |
| 133 |
|
| 134 |
foreach ($options as $key => $value) { |
| 135 |
echo '<option value="' . esc_attr( $key ) . '">' . esc_html($value) . '</option>'; |
| 136 |
} |
| 137 |
?> |
| 138 |
</select> |
| 139 |
</span> |
| 140 |
</label> |
| 141 |
</div> |
| 142 |
|
| 143 |
<?php do_action( 'propertyhive_property_bulk_edit_end' ); ?> |
| 144 |
|
| 145 |
<input type="hidden" name="propertyhive_bulk_edit" value="1" /> |
| 146 |
<input type="hidden" name="propertyhive_bulk_edit_nonce" value="<?php echo esc_attr(wp_create_nonce( 'propertyhive_bulk_edit_nonce' )); ?>" /> |
| 147 |
</div> |
| 148 |
</fieldset> |
| 149 |
|