PluginProbe
Property Hive / 2.3.0
Property Hive v2.3.0
2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 1.4.62 All 260 releases
propertyhive / includes / admin / views / html-viewing-actions.php

html-viewing-actions.php in Property Hive 2.3.0, at includes/admin/views/html-viewing-actions.php

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