| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 4 |
|
| 5 |
$status = get_post_meta( $post_id, '_status', TRUE ); |
| 6 |
$feedback_status = get_post_meta( $post_id, '_feedback_status', TRUE ); |
| 7 |
|
| 8 |
echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="propertyhive_viewing_actions_meta_box"> |
| 9 |
|
| 10 |
<div class="options_group" style="padding-top:8px;">'; |
| 11 |
|
| 12 |
$show_cancelled_meta_boxes = false; |
| 13 |
$show_feedback_meta_boxes = false; |
| 14 |
$show_customise_confirmation_meta_boxes = false; |
| 15 |
$show_customise_cancellation_notification_meta_boxes = false; |
| 16 |
|
| 17 |
$actions = array(); |
| 18 |
|
| 19 |
if ( $status == 'pending' ) |
| 20 |
{ |
| 21 |
$property_id = get_post_meta( $post_id, '_property_id', TRUE ); |
| 22 |
$applicant_contact_ids = get_post_meta( $post_id, '_applicant_contact_id' ); |
| 23 |
$applicant_email_addresses = array(); |
| 24 |
foreach ($applicant_contact_ids as $applicant_contact_id) |
| 25 |
{ |
| 26 |
$applicant_email_addresses[] = get_post_meta( $applicant_contact_id, '_email_address', TRUE ); |
| 27 |
} |
| 28 |
|
| 29 |
if ( in_array((int)$property_id, array(0, '')) || !is_array($applicant_contact_ids) || count($applicant_contact_ids) == 0 || count($applicant_email_addresses) == 0 ) |
| 30 |
{ |
| 31 |
|
| 32 |
} |
| 33 |
else |
| 34 |
{ |
| 35 |
$applicant_booking_confirmation_sent_at = get_post_meta( $post_id, '_applicant_booking_confirmation_sent_at', TRUE ); |
| 36 |
$owner_booking_confirmation_sent_at = get_post_meta( $post_id, '_owner_booking_confirmation_sent_at', TRUE ); |
| 37 |
$attending_negotiator_booking_confirmation_sent_at = get_post_meta( $post_id, '_attending_negotiator_booking_confirmation_sent_at', TRUE ); |
| 38 |
|
| 39 |
// Applicant |
| 40 |
if ( apply_filters( 'propertyhive_show_viewing_email_applicant_booking_confirmation', true ) === true ) |
| 41 |
{ |
| 42 |
if ( get_option( 'propertyhive_customise_confirmation_emails', '' ) == 'yes' ) |
| 43 |
{ |
| 44 |
$actions[] = '<a |
| 45 |
href="#action_panel_viewing_email_applicant_booking_confirmation_customise" |
| 46 |
class="button viewing-action" |
| 47 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 48 |
>' . ( ( $applicant_booking_confirmation_sent_at == '' ) ? __('Email Applicant Booking Confirmation', 'propertyhive') : __('Re-Email Applicant Booking Confirmation', 'propertyhive') ) . '</a>'; |
| 49 |
|
| 50 |
$show_customise_confirmation_meta_boxes = true; |
| 51 |
} |
| 52 |
else |
| 53 |
{ |
| 54 |
$actions[] = '<a |
| 55 |
href="#action_panel_viewing_email_applicant_booking_confirmation" |
| 56 |
class="button viewing-action" |
| 57 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 58 |
>' . ( ( $applicant_booking_confirmation_sent_at == '' ) ? __('Email Applicant Booking Confirmation', 'propertyhive') : __('Re-Email Applicant Booking Confirmation', 'propertyhive') ) . '</a>'; |
| 59 |
} |
| 60 |
|
| 61 |
$actions[] = '<div id="viewing_applicant_confirmation_date" style="text-align:center; font-size:12px; color:#999; margin-bottom:7px;' . ( ( $applicant_booking_confirmation_sent_at == '' ) ? 'display:none' : '' ) . '">' . ( ( $applicant_booking_confirmation_sent_at != '' ) ? 'Previously sent to applicant on <span title="' . $applicant_booking_confirmation_sent_at . '">' . date("jS F", strtotime($applicant_booking_confirmation_sent_at)) : '' ) . '</span></div>'; |
| 62 |
} |
| 63 |
|
| 64 |
// Owner/Landlord |
| 65 |
if ( apply_filters( 'propertyhive_show_viewing_email_owner_booking_confirmation', true ) === true ) |
| 66 |
{ |
| 67 |
$property_department = get_post_meta( $property_id, '_department', TRUE ); |
| 68 |
$owner_contact_ids = get_post_meta( $property_id, '_owner_contact_id', TRUE ); |
| 69 |
$owner_or_landlord = ( $property_department == 'residential-lettings' ? 'Landlord' : 'Owner' ); |
| 70 |
|
| 71 |
if ( is_array($owner_contact_ids) && count($owner_contact_ids) > 0) { |
| 72 |
|
| 73 |
if ( get_option( 'propertyhive_customise_confirmation_emails', '' ) == 'yes' ) |
| 74 |
{ |
| 75 |
$actions[] = '<a |
| 76 |
href="#action_panel_viewing_email_owner_booking_confirmation_customise" |
| 77 |
class="button viewing-action" |
| 78 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 79 |
>' . ( ( $owner_booking_confirmation_sent_at == '' ) ? __('Email ' . $owner_or_landlord . ' Booking Confirmation', 'propertyhive') : __('Re-Email ' . $owner_or_landlord . ' Booking Confirmation', 'propertyhive') ) . '</a>'; |
| 80 |
|
| 81 |
$show_customise_confirmation_meta_boxes = true; |
| 82 |
} |
| 83 |
else |
| 84 |
{ |
| 85 |
$actions[] = '<a |
| 86 |
href="#action_panel_viewing_email_owner_booking_confirmation" |
| 87 |
class="button viewing-action" |
| 88 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 89 |
>' . ( ( $owner_booking_confirmation_sent_at == '' ) ? __('Email ' . $owner_or_landlord . ' Booking Confirmation', 'propertyhive') : __('Re-Email ' . $owner_or_landlord . ' Booking Confirmation', 'propertyhive') ) . '</a>'; |
| 90 |
} |
| 91 |
$actions[] = '<div id="viewing_owner_confirmation_date" style="text-align:center; font-size:12px; color:#999; margin-bottom:7px;' . ( ( $owner_booking_confirmation_sent_at == '' ) ? 'display:none' : '' ) . '">' . ( ( $owner_booking_confirmation_sent_at != '' ) ? 'Previously sent to ' . strtolower($owner_or_landlord) . ' on <span title="' . $owner_booking_confirmation_sent_at . '">' . date("jS F", strtotime($owner_booking_confirmation_sent_at)) : '' ) . '</span></div>'; |
| 92 |
} |
| 93 |
} |
| 94 |
|
| 95 |
// Attending Negotiators |
| 96 |
if ( apply_filters( 'propertyhive_show_viewing_email_attending_negotiator_booking_confirmation', true ) === true ) |
| 97 |
{ |
| 98 |
$attending_negotiators = get_post_meta( $property_id, '_negotiator_id' ); |
| 99 |
if ( !empty($attending_negotiators) ) |
| 100 |
{ |
| 101 |
if ( get_option( 'propertyhive_customise_confirmation_emails', '' ) == 'yes' ) |
| 102 |
{ |
| 103 |
$actions[] = '<a |
| 104 |
href="#action_panel_viewing_email_attending_negotiator_booking_confirmation_customise" |
| 105 |
class="button viewing-action" |
| 106 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 107 |
>' . ( ( $attending_negotiator_booking_confirmation_sent_at == '' ) ? __('Email Negotiator Booking Confirmation', 'propertyhive') : __('Re-Email Negotiator Booking Confirmation', 'propertyhive') ) . '</a>'; |
| 108 |
|
| 109 |
$show_customise_confirmation_meta_boxes = true; |
| 110 |
} |
| 111 |
else |
| 112 |
{ |
| 113 |
$actions[] = '<a |
| 114 |
href="#action_panel_viewing_email_attending_negotiator_booking_confirmation" |
| 115 |
class="button viewing-action" |
| 116 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 117 |
>' . ( ( $attending_negotiator_booking_confirmation_sent_at == '' ) ? __('Email Negotiator Booking Confirmation', 'propertyhive') : __('Re-Email Negotiator Booking Confirmation', 'propertyhive') ) . '</a>'; |
| 118 |
} |
| 119 |
|
| 120 |
$actions[] = '<div id="viewing_attending_negotiator_confirmation_date" style="text-align:center; font-size:12px; color:#999; margin-bottom:7px;' . ( ( $attending_negotiator_booking_confirmation_sent_at == '' ) ? 'display:none' : '' ) . '">' . ( ( $attending_negotiator_booking_confirmation_sent_at != '' ) ? 'Previously sent to attending negotiators on <span title="' . $attending_negotiator_booking_confirmation_sent_at . '">' . date("jS F", strtotime($attending_negotiator_booking_confirmation_sent_at)) : '' ) . '</span></div>'; |
| 121 |
} |
| 122 |
} |
| 123 |
|
| 124 |
$actions[] = '<hr>'; |
| 125 |
} |
| 126 |
|
| 127 |
$actions[] = '<a |
| 128 |
href="#action_panel_viewing_carried_out" |
| 129 |
class="button button-success viewing-action" |
| 130 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 131 |
>' . __('Viewing Carried Out', 'propertyhive') . '</a>'; |
| 132 |
$actions[] = '<a |
| 133 |
href="#action_panel_viewing_cancelled" |
| 134 |
class="button viewing-action" |
| 135 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 136 |
>' . __('Viewing Cancelled', 'propertyhive') . '</a>'; |
| 137 |
$actions[] = '<a |
| 138 |
href="#action_panel_viewing_no_show" |
| 139 |
class="button viewing-action" |
| 140 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 141 |
>' . __('Applicant No Show', 'propertyhive') . '</a>'; |
| 142 |
|
| 143 |
$show_cancelled_meta_boxes = true; |
| 144 |
} |
| 145 |
|
| 146 |
if ( $status == 'carried_out' ) |
| 147 |
{ |
| 148 |
if ( $feedback_status == '' ) |
| 149 |
{ |
| 150 |
$actions[] = '<a |
| 151 |
href="#action_panel_viewing_interested" |
| 152 |
class="button button-success viewing-action" |
| 153 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 154 |
>' . wp_kses_post( __('Applicant Interested', 'propertyhive') ) . '</a>'; |
| 155 |
|
| 156 |
$actions[] = '<a |
| 157 |
href="#action_panel_viewing_not_interested" |
| 158 |
class="button button-danger viewing-action" |
| 159 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 160 |
>' . wp_kses_post( __('Applicant Not Interested', 'propertyhive') ) . '</a>'; |
| 161 |
|
| 162 |
$actions[] = '<a |
| 163 |
href="#action_panel_viewing_feedback_not_required" |
| 164 |
class="button viewing-action" |
| 165 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 166 |
>' . wp_kses_post( __('Feedback Not Required', 'propertyhive') ) . '</a>'; |
| 167 |
|
| 168 |
$show_feedback_meta_boxes = true; |
| 169 |
} |
| 170 |
|
| 171 |
if ( $feedback_status == 'interested' ) |
| 172 |
{ |
| 173 |
$actions[] = '<a |
| 174 |
href="' . trim(admin_url(), '/') . '/post-new.php?post_type=viewing&applicant_contact_id=' . implode('|', get_post_meta( $post_id, '_applicant_contact_id' )) . '&property_id=' . get_post_meta( $post_id, '_property_id', TRUE ) . '&viewing_id=' . $post_id .'" |
| 175 |
class="button button-success" |
| 176 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 177 |
>' . wp_kses_post( __('Book Second Viewing', 'propertyhive') ) . '</a>'; |
| 178 |
|
| 179 |
if ( get_option('propertyhive_module_disabled_offers_sales', '') != 'yes' ) |
| 180 |
{ |
| 181 |
$property_id = get_post_meta( $post_id, '_property_id', TRUE ); |
| 182 |
if ( get_post_meta( $property_id, '_department', TRUE ) == 'residential-sales' ) |
| 183 |
{ |
| 184 |
// See if an offer has this viewing id associated with it |
| 185 |
$offer_id = get_post_meta( $post_id, '_offer_id', TRUE ); |
| 186 |
if ( $offer_id != '' && get_post_status($offer_id) != 'publish' ) |
| 187 |
{ |
| 188 |
$offer_id = ''; |
| 189 |
} |
| 190 |
|
| 191 |
if ( $offer_id != '' ) |
| 192 |
{ |
| 193 |
$actions[] = '<a |
| 194 |
href="' . get_edit_post_link( $offer_id, '' ) . '" |
| 195 |
class="button" |
| 196 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 197 |
>' . wp_kses_post( __('View Offer', 'propertyhive') ) . '</a>'; |
| 198 |
} |
| 199 |
else |
| 200 |
{ |
| 201 |
$actions[] = '<a |
| 202 |
href="' . wp_nonce_url( admin_url( 'post.php?post=' . $post_id . '&action=edit' ), '1', 'create_offer' ) . '" |
| 203 |
class="button button-success" |
| 204 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 205 |
>' . wp_kses_post( __('Record Offer', 'propertyhive') ) . '</a>'; |
| 206 |
} |
| 207 |
} |
| 208 |
} |
| 209 |
} |
| 210 |
|
| 211 |
if ( get_post_meta( $post_id, '_feedback_passed_on', TRUE ) != 'yes' && ( $feedback_status == 'interested' || $feedback_status == 'not_interested' ) ) |
| 212 |
{ |
| 213 |
$actions[] = '<a |
| 214 |
href="#action_panel_viewing_revert_feedback_passed_on" |
| 215 |
class="button viewing-action" |
| 216 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 217 |
>' . wp_kses_post( __('Feedback Passed On To Owner', 'propertyhive') ) . '</a>'; |
| 218 |
} |
| 219 |
|
| 220 |
if ( $feedback_status == 'interested' || $feedback_status == 'not_interested' || $feedback_status == 'not_required' ) |
| 221 |
{ |
| 222 |
$actions[] = '<a |
| 223 |
href="#action_panel_viewing_revert_feedback_pending" |
| 224 |
class="button viewing-action" |
| 225 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 226 |
>' . wp_kses_post( __('Revert To Feedback Pending', 'propertyhive') ) . '</a>'; |
| 227 |
} |
| 228 |
} |
| 229 |
|
| 230 |
if ( $status == 'offer_made' ) |
| 231 |
{ |
| 232 |
if ( get_option('propertyhive_module_disabled_offers_sales', '') != 'yes' ) |
| 233 |
{ |
| 234 |
$offer_id = get_post_meta( $post_id, '_offer_id', TRUE ); |
| 235 |
if ( $offer_id != '' && get_post_status($offer_id) != 'publish' ) |
| 236 |
{ |
| 237 |
$offer_id = ''; |
| 238 |
} |
| 239 |
|
| 240 |
if ( $offer_id != '' ) |
| 241 |
{ |
| 242 |
$actions[] = '<a |
| 243 |
href="' . get_edit_post_link( $offer_id, '' ) . '" |
| 244 |
class="button" |
| 245 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 246 |
>' . wp_kses_post( __('View Offer', 'propertyhive') ) . '</a>'; |
| 247 |
} |
| 248 |
} |
| 249 |
} |
| 250 |
|
| 251 |
if ( $status == 'cancelled' ) |
| 252 |
{ |
| 253 |
$property_id = get_post_meta( $post_id, '_property_id', TRUE ); |
| 254 |
$applicant_contact_ids = get_post_meta( $post_id, '_applicant_contact_id' ); |
| 255 |
$applicant_email_addresses = array(); |
| 256 |
foreach ($applicant_contact_ids as $applicant_contact_id) |
| 257 |
{ |
| 258 |
$applicant_email_addresses[] = get_post_meta( $applicant_contact_id, '_email_address', TRUE ); |
| 259 |
} |
| 260 |
|
| 261 |
if ( in_array((int)$property_id, array(0, '')) || !is_array($applicant_contact_ids) || count($applicant_contact_ids) == 0 || count($applicant_email_addresses) == 0 ) |
| 262 |
{ |
| 263 |
|
| 264 |
} |
| 265 |
else |
| 266 |
{ |
| 267 |
$applicant_cancellation_notification_sent_at = get_post_meta( $post_id, '_applicant_cancellation_notification_sent_at', TRUE ); |
| 268 |
$owner_cancellation_notification_sent_at = get_post_meta( $post_id, '_owner_cancellation_notification_sent_at', TRUE ); |
| 269 |
$attending_negotiator_cancellation_notification_sent_at = get_post_meta( $post_id, '_attending_negotiator_cancellation_notification_sent_at', TRUE ); |
| 270 |
|
| 271 |
// Applicant |
| 272 |
if ( apply_filters( 'propertyhive_show_viewing_email_applicant_cancellation_notification', true ) === true ) |
| 273 |
{ |
| 274 |
if ( get_option( 'propertyhive_customise_confirmation_emails', '' ) == 'yes' ) |
| 275 |
{ |
| 276 |
$actions[] = '<a |
| 277 |
href="#action_panel_viewing_email_applicant_cancellation_notification_customise" |
| 278 |
class="button viewing-action" |
| 279 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 280 |
>' . ( ( $applicant_cancellation_notification_sent_at == '' ) ? __('Email Applicant Cancellation Notification', 'propertyhive') : __('Re-Email Applicant Cancellation Notification', 'propertyhive') ) . '</a>'; |
| 281 |
|
| 282 |
$show_customise_cancellation_notification_meta_boxes = true; |
| 283 |
} |
| 284 |
else |
| 285 |
{ |
| 286 |
$actions[] = '<a |
| 287 |
href="#action_panel_viewing_email_applicant_cancellation_notification" |
| 288 |
class="button viewing-action" |
| 289 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 290 |
>' . ( ( $applicant_cancellation_notification_sent_at == '' ) ? __('Email Applicant Cancellation Notification', 'propertyhive') : __('Re-Email Applicant Cancellation Notification', 'propertyhive') ) . '</a>'; |
| 291 |
} |
| 292 |
|
| 293 |
$actions[] = '<div id="viewing_applicant_cancellation_notification_date" style="text-align:center; font-size:12px; color:#999; margin-bottom:7px;' . ( ( $applicant_cancellation_notification_sent_at == '' ) ? 'display:none' : '' ) . '">' . ( ( $applicant_cancellation_notification_sent_at != '' ) ? 'Previously sent to applicant on <span title="' . $applicant_cancellation_notification_sent_at . '">' . date("jS F", strtotime($applicant_cancellation_notification_sent_at)) : '' ) . '</span></div>'; |
| 294 |
} |
| 295 |
|
| 296 |
// Owner/Landlord |
| 297 |
if ( apply_filters( 'propertyhive_show_viewing_email_owner_cancellation_notification', true ) === true ) |
| 298 |
{ |
| 299 |
$property_department = get_post_meta( $property_id, '_department', TRUE ); |
| 300 |
$owner_contact_ids = get_post_meta( $property_id, '_owner_contact_id', TRUE ); |
| 301 |
$owner_or_landlord = ( $property_department == 'residential-lettings' ? 'Landlord' : 'Owner' ); |
| 302 |
|
| 303 |
if ( is_array($owner_contact_ids) && count($owner_contact_ids) > 0) { |
| 304 |
|
| 305 |
if ( get_option( 'propertyhive_customise_confirmation_emails', '' ) == 'yes' ) |
| 306 |
{ |
| 307 |
$actions[] = '<a |
| 308 |
href="#action_panel_viewing_email_owner_cancellation_notification_customise" |
| 309 |
class="button viewing-action" |
| 310 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 311 |
>' . ( ( $owner_cancellation_notification_sent_at == '' ) ? __('Email ' . $owner_or_landlord . ' Cancellation Notification', 'propertyhive') : __('Re-Email ' . $owner_or_landlord . ' Cancellation Notification', 'propertyhive') ) . '</a>'; |
| 312 |
|
| 313 |
$show_customise_cancellation_notification_meta_boxes = true; |
| 314 |
} |
| 315 |
else |
| 316 |
{ |
| 317 |
$actions[] = '<a |
| 318 |
href="#action_panel_viewing_email_owner_cancellation_notification" |
| 319 |
class="button viewing-action" |
| 320 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 321 |
>' . ( ( $owner_cancellation_notification_sent_at == '' ) ? __('Email ' . $owner_or_landlord . ' Cancellation Notification', 'propertyhive') : __('Re-Email ' . $owner_or_landlord . ' Cancellation Notification', 'propertyhive') ) . '</a>'; |
| 322 |
} |
| 323 |
$actions[] = '<div id="viewing_owner_cancellation_notification_date" style="text-align:center; font-size:12px; color:#999; margin-bottom:7px;' . ( ( $owner_cancellation_notification_sent_at == '' ) ? 'display:none' : '' ) . '">' . ( ( $owner_cancellation_notification_sent_at != '' ) ? 'Previously sent to ' . strtolower($owner_or_landlord) . ' on <span title="' . $owner_cancellation_notification_sent_at . '">' . date("jS F", strtotime($owner_cancellation_notification_sent_at)) : '' ) . '</span></div>'; |
| 324 |
} |
| 325 |
} |
| 326 |
|
| 327 |
// Attending Negotiators |
| 328 |
if ( apply_filters( 'propertyhive_show_viewing_email_attending_negotiator_cancellation_notification', true ) === true ) |
| 329 |
{ |
| 330 |
$attending_negotiators = get_post_meta( $property_id, '_negotiator_id' ); |
| 331 |
if ( !empty($attending_negotiators) ) |
| 332 |
{ |
| 333 |
if ( get_option( 'propertyhive_customise_confirmation_emails', '' ) == 'yes' ) |
| 334 |
{ |
| 335 |
$actions[] = '<a |
| 336 |
href="#action_panel_viewing_email_attending_negotiator_cancellation_notification_customise" |
| 337 |
class="button viewing-action" |
| 338 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 339 |
>' . ( ( $attending_negotiator_cancellation_notification_sent_at == '' ) ? __('Email Negotiator Cancellation Notification', 'propertyhive') : __('Re-Email Negotiator Cancellation Notification', 'propertyhive') ) . '</a>'; |
| 340 |
|
| 341 |
$show_customise_cancellation_notification_meta_boxes = true; |
| 342 |
} |
| 343 |
else |
| 344 |
{ |
| 345 |
$actions[] = '<a |
| 346 |
href="#action_panel_viewing_email_attending_negotiator_cancellation_notification" |
| 347 |
class="button viewing-action" |
| 348 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 349 |
>' . ( ( $attending_negotiator_cancellation_notification_sent_at == '' ) ? __('Email Negotiator Cancellation Notification', 'propertyhive') : __('Re-Email Negotiator Cancellation Notification', 'propertyhive') ) . '</a>'; |
| 350 |
} |
| 351 |
|
| 352 |
$actions[] = '<div id="viewing_attending_negotiator_cancellation_notification_date" style="text-align:center; font-size:12px; color:#999; margin-bottom:7px;' . ( ( $attending_negotiator_cancellation_notification_sent_at == '' ) ? 'display:none' : '' ) . '">' . ( ( $attending_negotiator_cancellation_notification_sent_at != '' ) ? 'Previously sent to attending negotiators on <span title="' . $attending_negotiator_cancellation_notification_sent_at . '">' . date("jS F", strtotime($attending_negotiator_cancellation_notification_sent_at)) : '' ) . '</span></div>'; |
| 353 |
} |
| 354 |
} |
| 355 |
|
| 356 |
$actions[] = '<hr>'; |
| 357 |
} |
| 358 |
} |
| 359 |
|
| 360 |
if ( ( $status == 'carried_out' && $feedback_status == '' ) || in_array( $status, array('cancelled', 'no_show') ) ) |
| 361 |
{ |
| 362 |
$actions[] = '<a |
| 363 |
href="#action_panel_viewing_revert_pending" |
| 364 |
class="button viewing-action" |
| 365 |
style="width:100%; margin-bottom:7px; text-align:center" |
| 366 |
>' . wp_kses_post( __('Revert To Pending', 'propertyhive') ) . '</a>'; |
| 367 |
} |
| 368 |
|
| 369 |
$actions = apply_filters( 'propertyhive_admin_viewing_actions', $actions, $post_id ); |
| 370 |
$actions = apply_filters( 'propertyhive_admin_post_actions', $actions, $post_id ); |
| 371 |
|
| 372 |
if ( !empty($actions) ) |
| 373 |
{ |
| 374 |
echo implode("", $actions); |
| 375 |
} |
| 376 |
else |
| 377 |
{ |
| 378 |
echo '<div style="text-align:center">' . wp_kses_post( __( 'No actions to display', 'propertyhive' ) ) . '</div>'; |
| 379 |
} |
| 380 |
|
| 381 |
echo '</div> |
| 382 |
|
| 383 |
</div>'; |
| 384 |
|
| 385 |
// Success action panel |
| 386 |
echo '<div id="action_panel_success" class="propertyhive_meta_box propertyhive_meta_box_actions" style="display:none;"> |
| 387 |
|
| 388 |
<div class="options_group" style="padding-top:8px;"> |
| 389 |
|
| 390 |
<div id="success_actions"></div> |
| 391 |
|
| 392 |
<a class="button action-cancel" style="width:100%;" href="#">' . esc_html(__( 'Back To Actions', 'propertyhive' )) . '</a> |
| 393 |
|
| 394 |
</div> |
| 395 |
|
| 396 |
</div>'; |
| 397 |
|
| 398 |
do_action( 'propertyhive_admin_viewing_action_options', $post_id ); |
| 399 |
do_action( 'propertyhive_admin_post_action_options', $post_id ); |
| 400 |
|
| 401 |
if ( $show_customise_confirmation_meta_boxes ) |
| 402 |
{ |
| 403 |
$subject = get_option( 'propertyhive_viewing_owner_booking_confirmation_email_subject', '' ); |
| 404 |
$body = get_option( 'propertyhive_viewing_owner_booking_confirmation_email_body', '' ); |
| 405 |
|
| 406 |
echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="action_panel_viewing_email_owner_booking_confirmation_customise" style="display:none;"> |
| 407 |
|
| 408 |
<div class="options_group" style="padding-top:8px;"> |
| 409 |
|
| 410 |
<div class="form-field"> |
| 411 |
|
| 412 |
<label for="_owner_confirmation_email_subject">' . __( 'Subject', 'propertyhive' ) . '</label> |
| 413 |
|
| 414 |
<input id="_owner_confirmation_email_subject" name="_owner_confirmation_email_subject" style="width:100%;" value="' . esc_attr($subject) . '"> |
| 415 |
|
| 416 |
</div> |
| 417 |
|
| 418 |
<div class="form-field"> |
| 419 |
|
| 420 |
<label for="_owner_confirmation_email_body">' . __( 'Body', 'propertyhive' ) . '</label> |
| 421 |
|
| 422 |
<textarea id="_owner_confirmation_email_body" name="_owner_confirmation_email_body" style="width:100%; height:100px;">' . $body . '</textarea> |
| 423 |
|
| 424 |
</div> |
| 425 |
|
| 426 |
<div class="form-field"> |
| 427 |
|
| 428 |
<label for="_owner_confirmation_email_attachment">' . __( 'Attach File(s)', 'propertyhive' ) . '</label> |
| 429 |
|
| 430 |
<input type="file" id="_owner_confirmation_email_attachment" name="_owner_confirmation_email_attachment" style="width:100%;" multiple> |
| 431 |
|
| 432 |
</div> |
| 433 |
|
| 434 |
<a class="button action-cancel" href="#">' . esc_html(__( 'Cancel', 'propertyhive' )) . '</a> |
| 435 |
<a class="button button-primary owner-booking-confirmation-action-submit" href="#">' . esc_html(__( 'Send', 'propertyhive' )) . '</a> |
| 436 |
|
| 437 |
</div> |
| 438 |
|
| 439 |
</div>'; |
| 440 |
|
| 441 |
$subject = get_option( 'propertyhive_viewing_applicant_booking_confirmation_email_subject', '' ); |
| 442 |
$body = get_option( 'propertyhive_viewing_applicant_booking_confirmation_email_body', '' ); |
| 443 |
|
| 444 |
echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="action_panel_viewing_email_applicant_booking_confirmation_customise" style="display:none;"> |
| 445 |
|
| 446 |
<div class="options_group" style="padding-top:8px;"> |
| 447 |
|
| 448 |
<div class="form-field"> |
| 449 |
|
| 450 |
<label for="_applicant_confirmation_email_subject">' . esc_html(__( 'Subject', 'propertyhive' )) . '</label> |
| 451 |
|
| 452 |
<input id="_applicant_confirmation_email_subject" name="_applicant_confirmation_email_subject" style="width:100%;" value="' . esc_attr($subject) . '"> |
| 453 |
|
| 454 |
</div> |
| 455 |
|
| 456 |
<div class="form-field"> |
| 457 |
|
| 458 |
<label for="_applicant_confirmation_email_body">' . esc_html(__( 'Body', 'propertyhive' )) . '</label> |
| 459 |
|
| 460 |
<textarea id="_applicant_confirmation_email_body" name="_applicant_confirmation_email_body" style="width:100%; height:100px;">' . $body . '</textarea> |
| 461 |
|
| 462 |
</div> |
| 463 |
|
| 464 |
<div class="form-field"> |
| 465 |
|
| 466 |
<label for="_applicant_confirmation_email_attachment">' . esc_html(__( 'Attach File(s)', 'propertyhive' )) . '</label> |
| 467 |
|
| 468 |
<input type="file" id="_applicant_confirmation_email_attachment" name="_applicant_confirmation_email_attachment" style="width:100%;" multiple> |
| 469 |
|
| 470 |
</div> |
| 471 |
|
| 472 |
<a class="button action-cancel" href="#">' . esc_html(__( 'Cancel', 'propertyhive' )) . '</a> |
| 473 |
<a class="button button-primary applicant-booking-confirmation-action-submit" href="#">' . esc_html(__( 'Send', 'propertyhive' )) . '</a> |
| 474 |
|
| 475 |
</div> |
| 476 |
|
| 477 |
</div>'; |
| 478 |
|
| 479 |
$subject = get_option( 'propertyhive_viewing_attending_negotiator_booking_confirmation_email_subject', '' ); |
| 480 |
$body = get_option( 'propertyhive_viewing_attending_negotiator_booking_confirmation_email_body', '' ); |
| 481 |
|
| 482 |
echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="action_panel_viewing_email_attending_negotiator_booking_confirmation_customise" style="display:none;"> |
| 483 |
|
| 484 |
<div class="options_group" style="padding-top:8px;"> |
| 485 |
|
| 486 |
<div class="form-field"> |
| 487 |
|
| 488 |
<label for="_attending_negotiator_confirmation_email_subject">' . esc_html(__( 'Subject', 'propertyhive' )) . '</label> |
| 489 |
|
| 490 |
<input id="_attending_negotiator_confirmation_email_subject" name="_attending_negotiator_confirmation_email_subject" style="width:100%;" value="' . esc_attr($subject) . '"> |
| 491 |
|
| 492 |
</div> |
| 493 |
|
| 494 |
<div class="form-field"> |
| 495 |
|
| 496 |
<label for="_attending_negotiator_confirmation_email_body">' . esc_html(__( 'Body', 'propertyhive' )) . '</label> |
| 497 |
|
| 498 |
<textarea id="_attending_negotiator_confirmation_email_body" name="_attending_negotiator_confirmation_email_body" style="width:100%; height:100px;">' . $body . '</textarea> |
| 499 |
|
| 500 |
</div> |
| 501 |
|
| 502 |
<div class="form-field"> |
| 503 |
|
| 504 |
<label for="_attending_negotiator_confirmation_email_attachment">' . esc_html(__( 'Attach File(s)', 'propertyhive' )) . '</label> |
| 505 |
|
| 506 |
<input type="file" id="_attending_negotiator_confirmation_email_attachment" name="_attending_negotiator_confirmation_email_attachment" style="width:100%;" multiple> |
| 507 |
|
| 508 |
</div> |
| 509 |
|
| 510 |
<a class="button action-cancel" href="#">' . esc_html(__( 'Cancel', 'propertyhive' )) . '</a> |
| 511 |
<a class="button button-primary attending-negotiator-booking-confirmation-action-submit" href="#">' . esc_html(__( 'Send', 'propertyhive' )) . '</a> |
| 512 |
|
| 513 |
</div> |
| 514 |
|
| 515 |
</div>'; |
| 516 |
} |
| 517 |
|
| 518 |
if ( $show_customise_cancellation_notification_meta_boxes ) |
| 519 |
{ |
| 520 |
$subject = get_option( 'propertyhive_viewing_owner_cancellation_notification_email_subject', '' ); |
| 521 |
$body = get_option( 'propertyhive_viewing_owner_cancellation_notification_email_body', '' ); |
| 522 |
|
| 523 |
echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="action_panel_viewing_email_owner_cancellation_notification_customise" style="display:none;"> |
| 524 |
|
| 525 |
<div class="options_group" style="padding-top:8px;"> |
| 526 |
|
| 527 |
<div class="form-field"> |
| 528 |
|
| 529 |
<label for="_owner_cancellation_notification_email_subject">' . __( 'Subject', 'propertyhive' ) . '</label> |
| 530 |
|
| 531 |
<input id="_owner_cancellation_notification_email_subject" name="_owner_cancellation_notification_email_subject" style="width:100%;" value="' . esc_attr($subject) . '"> |
| 532 |
|
| 533 |
</div> |
| 534 |
|
| 535 |
<div class="form-field"> |
| 536 |
|
| 537 |
<label for="_owner_cancellation_notification_email_body">' . __( 'Body', 'propertyhive' ) . '</label> |
| 538 |
|
| 539 |
<textarea id="_owner_cancellation_notification_email_body" name="_owner_cancellation_notification_email_body" style="width:100%; height:100px;">' . $body . '</textarea> |
| 540 |
|
| 541 |
</div> |
| 542 |
|
| 543 |
<div class="form-field"> |
| 544 |
|
| 545 |
<label for="_owner_cancellation_notification_email_attachment">' . __( 'Attach File(s)', 'propertyhive' ) . '</label> |
| 546 |
|
| 547 |
<input type="file" id="_owner_cancellation_notification_email_attachment" name="_owner_cancellation_notification_email_attachment" style="width:100%;" multiple> |
| 548 |
|
| 549 |
</div> |
| 550 |
|
| 551 |
<a class="button action-cancel" href="#">' . esc_html(__( 'Cancel', 'propertyhive' )) . '</a> |
| 552 |
<a class="button button-primary owner-cancellation-notification-action-submit" href="#">' . esc_html(__( 'Send', 'propertyhive' )) . '</a> |
| 553 |
|
| 554 |
</div> |
| 555 |
|
| 556 |
</div>'; |
| 557 |
|
| 558 |
$subject = get_option( 'propertyhive_viewing_applicant_cancellation_notification_email_subject', '' ); |
| 559 |
$body = get_option( 'propertyhive_viewing_applicant_cancellation_notification_email_body', '' ); |
| 560 |
|
| 561 |
echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="action_panel_viewing_email_applicant_cancellation_notification_customise" style="display:none;"> |
| 562 |
|
| 563 |
<div class="options_group" style="padding-top:8px;"> |
| 564 |
|
| 565 |
<div class="form-field"> |
| 566 |
|
| 567 |
<label for="_applicant_cancellation_notification_email_subject">' . esc_html(__( 'Subject', 'propertyhive' )) . '</label> |
| 568 |
|
| 569 |
<input id="_applicant_cancellation_notification_email_subject" name="_applicant_cancellation_notification_email_subject" style="width:100%;" value="' . esc_attr($subject) . '"> |
| 570 |
|
| 571 |
</div> |
| 572 |
|
| 573 |
<div class="form-field"> |
| 574 |
|
| 575 |
<label for="_applicant_cancellation_notification_email_body">' . esc_html(__( 'Body', 'propertyhive' )) . '</label> |
| 576 |
|
| 577 |
<textarea id="_applicant_cancellation_notification_email_body" name="_applicant_cancellation_notification_email_body" style="width:100%; height:100px;">' . $body . '</textarea> |
| 578 |
|
| 579 |
</div> |
| 580 |
|
| 581 |
<div class="form-field"> |
| 582 |
|
| 583 |
<label for="_applicant_cancellation_notification_email_attachment">' . esc_html(__( 'Attach File(s)', 'propertyhive' )) . '</label> |
| 584 |
|
| 585 |
<input type="file" id="_applicant_cancellation_notification_email_attachment" name="_applicant_cancellation_notification_email_attachment" style="width:100%;" multiple> |
| 586 |
|
| 587 |
</div> |
| 588 |
|
| 589 |
<a class="button action-cancel" href="#">' . esc_html(__( 'Cancel', 'propertyhive' )) . '</a> |
| 590 |
<a class="button button-primary applicant-cancellation-notification-action-submit" href="#">' . esc_html(__( 'Send', 'propertyhive' )) . '</a> |
| 591 |
|
| 592 |
</div> |
| 593 |
|
| 594 |
</div>'; |
| 595 |
|
| 596 |
$subject = get_option( 'propertyhive_viewing_attending_negotiator_cancellation_notification_email_subject', '' ); |
| 597 |
$body = get_option( 'propertyhive_viewing_attending_negotiator_cancellation_notification_email_body', '' ); |
| 598 |
|
| 599 |
echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="action_panel_viewing_email_attending_negotiator_cancellation_notification_customise" style="display:none;"> |
| 600 |
|
| 601 |
<div class="options_group" style="padding-top:8px;"> |
| 602 |
|
| 603 |
<div class="form-field"> |
| 604 |
|
| 605 |
<label for="_attending_negotiator_cancellation_notification_email_subject">' . esc_html(__( 'Subject', 'propertyhive' )) . '</label> |
| 606 |
|
| 607 |
<input id="_attending_negotiator_cancellation_notification_email_subject" name="_attending_negotiator_cancellation_notification_email_subject" style="width:100%;" value="' . esc_attr($subject) . '"> |
| 608 |
|
| 609 |
</div> |
| 610 |
|
| 611 |
<div class="form-field"> |
| 612 |
|
| 613 |
<label for="_attending_negotiator_cancellation_notification_email_body">' . esc_html(__( 'Body', 'propertyhive' )) . '</label> |
| 614 |
|
| 615 |
<textarea id="_attending_negotiator_cancellation_notification_email_body" name="_attending_negotiator_cancellation_notification_email_body" style="width:100%; height:100px;">' . $body . '</textarea> |
| 616 |
|
| 617 |
</div> |
| 618 |
|
| 619 |
<div class="form-field"> |
| 620 |
|
| 621 |
<label for="_attending_negotiator_cancellation_notification_email_attachment">' . esc_html(__( 'Attach File(s)', 'propertyhive' )) . '</label> |
| 622 |
|
| 623 |
<input type="file" id="_attending_negotiator_cancellation_notification_email_attachment" name="_attending_negotiator_cancellation_notification_email_attachment" style="width:100%;" multiple> |
| 624 |
|
| 625 |
</div> |
| 626 |
|
| 627 |
<a class="button action-cancel" href="#">' . esc_html(__( 'Cancel', 'propertyhive' )) . '</a> |
| 628 |
<a class="button button-primary attending-negotiator-cancellation-notification-action-submit" href="#">' . esc_html(__( 'Send', 'propertyhive' )) . '</a> |
| 629 |
|
| 630 |
</div> |
| 631 |
|
| 632 |
</div>'; |
| 633 |
} |
| 634 |
|
| 635 |
if ( $show_cancelled_meta_boxes ) |
| 636 |
{ |
| 637 |
echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="action_panel_viewing_cancelled" style="display:none;"> |
| 638 |
|
| 639 |
<div class="options_group" style="padding-top:8px;"> |
| 640 |
|
| 641 |
<div class="form-field"> |
| 642 |
|
| 643 |
<label for="_cancelled_reason">' . esc_html(__( 'Reason Cancelled', 'propertyhive' )) . '</label> |
| 644 |
|
| 645 |
<textarea id="_cancelled_reason" name="_cancelled_reason" style="width:100%;">' . get_post_meta( $post_id, '_cancelled_reason', TRUE ) . '</textarea> |
| 646 |
|
| 647 |
</div> |
| 648 |
|
| 649 |
<div class="form-field"> |
| 650 |
|
| 651 |
<label><input type="checkbox" id="_cancelled_reason_public" name="_cancelled_reason_public" value="yes"> ' . esc_html(__( 'Make Reason Public?', 'propertyhive' )) . '</label> |
| 652 |
<em><small>' . esc_html( __( 'If checked, the reason for cancellation entered will be visible to applicants and owners/landlords in their login area and any cancellation emails sent.', 'propertyhive' ) ) . '</small></em> |
| 653 |
|
| 654 |
</div> |
| 655 |
|
| 656 |
<a class="button action-cancel" href="#">' . esc_html(__( 'Cancel', 'propertyhive' )) . '</a> |
| 657 |
<a class="button button-primary cancelled-reason-action-submit" href="#">' . esc_html(__( 'Save', 'propertyhive' )) . '</a> |
| 658 |
|
| 659 |
</div> |
| 660 |
|
| 661 |
</div>'; |
| 662 |
} |
| 663 |
|
| 664 |
if ( $show_feedback_meta_boxes ) |
| 665 |
{ |
| 666 |
echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="action_panel_viewing_interested" style="display:none;"> |
| 667 |
|
| 668 |
<div class="options_group" style="padding-top:8px;"> |
| 669 |
|
| 670 |
<div class="form-field"> |
| 671 |
|
| 672 |
<label for="_viewing_interested_feedback">' . esc_html(__( 'Applicant Feedback', 'propertyhive' )) . '</label> |
| 673 |
|
| 674 |
<textarea id="_interested_feedback" name="_interested_feedback" style="width:100%;">' . get_post_meta( $post_id, '_feedback', TRUE ) . '</textarea> |
| 675 |
|
| 676 |
</div> |
| 677 |
|
| 678 |
<a class="button action-cancel" href="#">' . esc_html(__( 'Cancel', 'propertyhive' )) . '</a> |
| 679 |
<a class="button button-primary interested-feedback-action-submit" href="#">' . wp_kses_post( __( 'Save Feedback', 'propertyhive' ) ) . '</a> |
| 680 |
|
| 681 |
</div> |
| 682 |
|
| 683 |
</div>'; |
| 684 |
|
| 685 |
echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="action_panel_viewing_not_interested" style="display:none;"> |
| 686 |
|
| 687 |
<div class="options_group" style="padding-top:8px;"> |
| 688 |
|
| 689 |
<div class="form-field"> |
| 690 |
|
| 691 |
<label for="_viewing_not_interested_feedback">' . esc_html(__( 'Applicant Feedback', 'propertyhive' )) . '</label> |
| 692 |
|
| 693 |
<textarea id="_not_interested_feedback" name="_not_interested_feedback" style="width:100%;">' . get_post_meta( $post_id, '_feedback', TRUE ) . '</textarea> |
| 694 |
|
| 695 |
</div> |
| 696 |
|
| 697 |
<a class="button action-cancel" href="#">' . esc_html(__( 'Cancel', 'propertyhive' )) . '</a> |
| 698 |
<a class="button button-primary not-interested-feedback-action-submit" href="#">' . wp_kses_post( __( 'Save Feedback', 'propertyhive' ) ) . '</a> |
| 699 |
|
| 700 |
</div> |
| 701 |
|
| 702 |
</div>'; |
| 703 |
} |