PluginProbe
Property Hive / 2.3.1
Property Hive v2.3.1
2.3.1 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 All 261 releases
← All changes | includes/admin/views/html-viewing-actions.php +132 -41 2.2.32.3.1 View file →
@@ -2,8 +2,9 @@
2 2
3 3 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4 4
5 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.
6 7 $feedback_status = get_post_meta( $post_id, '_feedback_status', TRUE );
7 8
8 9 echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="propertyhive_viewing_actions_meta_box">
9 10
@@ -8,22 +9,32 @@
8 9 echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="propertyhive_viewing_actions_meta_box">
9 10
10 11 <div class="options_group" style="padding-top:8px;">';
11 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.
12 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.
13 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.
14 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.
15 20 $show_customise_cancellation_notification_meta_boxes = false;
16 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.
17 23 $actions = array();
18 24
19 25 if ( $status == 'pending' )
20 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.
21 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.
22 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.
23 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.
24 34 foreach ($applicant_contact_ids as $applicant_contact_id)
25 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.
26 37 $applicant_email_addresses[] = get_post_meta( $applicant_contact_id, '_email_address', TRUE );
27 38 }
28 39
29 40 if ( in_array((int)$property_id, array(0, '')) || !is_array($applicant_contact_ids) || count($applicant_contact_ids) == 0 || count($applicant_email_addresses) == 0 )
@@ -31,10 +42,13 @@
31 42
32 43 }
33 44 else
34 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.
35 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.
36 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.
37 51 $attending_negotiator_booking_confirmation_sent_at = get_post_meta( $post_id, '_attending_negotiator_booking_confirmation_sent_at', TRUE );
38 52
39 53 // Applicant
40 54 if ( apply_filters( 'propertyhive_show_viewing_email_applicant_booking_confirmation', true ) === true )
@@ -40,33 +54,40 @@
40 54 if ( apply_filters( 'propertyhive_show_viewing_email_applicant_booking_confirmation', true ) === true )
41 55 {
42 56 if ( get_option( 'propertyhive_customise_confirmation_emails', '' ) == 'yes' )
43 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.
44 59 $actions[] = '<a
45 60 href="#action_panel_viewing_email_applicant_booking_confirmation_customise"
46 61 class="button viewing-action"
47 62 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>';
63 + >' . ( ( $applicant_booking_confirmation_sent_at == '' ) ? esc_html__('Email Applicant Booking Confirmation', 'propertyhive') : esc_html__('Re-Email Applicant Booking Confirmation', 'propertyhive') ) . '</a>';
49 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.
50 66 $show_customise_confirmation_meta_boxes = true;
51 67 }
52 68 else
53 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.
54 71 $actions[] = '<a
55 72 href="#action_panel_viewing_email_applicant_booking_confirmation"
56 73 class="button viewing-action"
57 74 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>';
75 + >' . ( ( $applicant_booking_confirmation_sent_at == '' ) ? esc_html__('Email Applicant Booking Confirmation', 'propertyhive') : esc_html__('Re-Email Applicant Booking Confirmation', 'propertyhive') ) . '</a>';
59 76 }
60 77
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>';
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>';
62 80 }
63 81
64 82 // Owner/Landlord
65 83 if ( apply_filters( 'propertyhive_show_viewing_email_owner_booking_confirmation', true ) === true )
66 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.
67 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.
68 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.
69 90 $owner_or_landlord = ( $property_department == 'residential-lettings' ? 'Landlord' : 'Owner' );
70 91
71 92 if ( is_array($owner_contact_ids) && count($owner_contact_ids) > 0) {
72 93
@@ -71,25 +92,29 @@
71 92 if ( is_array($owner_contact_ids) && count($owner_contact_ids) > 0) {
72 93
73 94 if ( get_option( 'propertyhive_customise_confirmation_emails', '' ) == 'yes' )
74 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.
75 97 $actions[] = '<a
76 98 href="#action_panel_viewing_email_owner_booking_confirmation_customise"
77 99 class="button viewing-action"
78 100 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>';
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>';
80 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.
81 104 $show_customise_confirmation_meta_boxes = true;
82 105 }
83 106 else
84 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.
85 109 $actions[] = '<a
86 110 href="#action_panel_viewing_email_owner_booking_confirmation"
87 111 class="button viewing-action"
88 112 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>';
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>';
90 114 }
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>';
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>';
92 117 }
93 118 }
94 119
95 120 // Attending Negotiators
@@ -94,53 +119,63 @@
94 119
95 120 // Attending Negotiators
96 121 if ( apply_filters( 'propertyhive_show_viewing_email_attending_negotiator_booking_confirmation', true ) === true )
97 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.
98 124 $attending_negotiators = get_post_meta( $property_id, '_negotiator_id' );
99 125 if ( !empty($attending_negotiators) )
100 126 {
101 127 if ( get_option( 'propertyhive_customise_confirmation_emails', '' ) == 'yes' )
102 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.
103 130 $actions[] = '<a
104 131 href="#action_panel_viewing_email_attending_negotiator_booking_confirmation_customise"
105 132 class="button viewing-action"
106 133 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>';
134 + >' . ( ( $attending_negotiator_booking_confirmation_sent_at == '' ) ? esc_html__('Email Negotiator Booking Confirmation', 'propertyhive') : esc_html__('Re-Email Negotiator Booking Confirmation', 'propertyhive') ) . '</a>';
108 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.
109 137 $show_customise_confirmation_meta_boxes = true;
110 138 }
111 139 else
112 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.
113 142 $actions[] = '<a
114 143 href="#action_panel_viewing_email_attending_negotiator_booking_confirmation"
115 144 class="button viewing-action"
116 145 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>';
146 + >' . ( ( $attending_negotiator_booking_confirmation_sent_at == '' ) ? esc_html__('Email Negotiator Booking Confirmation', 'propertyhive') : esc_html__('Re-Email Negotiator Booking Confirmation', 'propertyhive') ) . '</a>';
118 147 }
119 148
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>';
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>';
121 151 }
122 152 }
123 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.
124 155 $actions[] = '<hr>';
125 156 }
126 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.
127 159 $actions[] = '<a
128 160 href="#action_panel_viewing_carried_out"
129 161 class="button button-success viewing-action"
130 162 style="width:100%; margin-bottom:7px; text-align:center"
131 - >' . __('Viewing Carried Out', 'propertyhive') . '</a>';
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.
132 165 $actions[] = '<a
133 166 href="#action_panel_viewing_cancelled"
134 167 class="button viewing-action"
135 168 style="width:100%; margin-bottom:7px; text-align:center"
136 - >' . __('Viewing Cancelled', 'propertyhive') . '</a>';
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.
137 171 $actions[] = '<a
138 172 href="#action_panel_viewing_no_show"
139 173 class="button viewing-action"
140 174 style="width:100%; margin-bottom:7px; text-align:center"
141 - >' . __('Applicant No Show', 'propertyhive') . '</a>';
175 + >' . esc_html__('Applicant No Show', 'propertyhive') . '</a>';
142 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.
143 178 $show_cancelled_meta_boxes = true;
144 179 }
145 180
146 181 if ( $status == 'carried_out' )
@@ -146,8 +181,9 @@
146 181 if ( $status == 'carried_out' )
147 182 {
148 183 if ( $feedback_status == '' )
149 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.
150 186 $actions[] = '<a
151 187 href="#action_panel_viewing_interested"
152 188 class="button button-success viewing-action"
153 189 style="width:100%; margin-bottom:7px; text-align:center"
@@ -152,8 +188,9 @@
152 188 class="button button-success viewing-action"
153 189 style="width:100%; margin-bottom:7px; text-align:center"
154 190 >' . wp_kses_post( __('Applicant Interested', 'propertyhive') ) . '</a>';
155 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.
156 193 $actions[] = '<a
157 194 href="#action_panel_viewing_not_interested"
158 195 class="button button-danger viewing-action"
159 196 style="width:100%; margin-bottom:7px; text-align:center"
@@ -158,8 +195,9 @@
158 195 class="button button-danger viewing-action"
159 196 style="width:100%; margin-bottom:7px; text-align:center"
160 197 >' . wp_kses_post( __('Applicant Not Interested', 'propertyhive') ) . '</a>';
161 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.
162 200 $actions[] = '<a
163 201 href="#action_panel_viewing_feedback_not_required"
164 202 class="button viewing-action"
165 203 style="width:100%; margin-bottom:7px; text-align:center"
@@ -164,15 +202,17 @@
164 202 class="button viewing-action"
165 203 style="width:100%; margin-bottom:7px; text-align:center"
166 204 >' . wp_kses_post( __('Feedback Not Required', 'propertyhive') ) . '</a>';
167 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.
168 207 $show_feedback_meta_boxes = true;
169 208 }
170 209
171 210 if ( $feedback_status == 'interested' )
172 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.
173 213 $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 .'"
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' ) ) ) .'"
175 215 class="button button-success"
176 216 style="width:100%; margin-bottom:7px; text-align:center"
177 217 >' . wp_kses_post( __('Book Second Viewing', 'propertyhive') ) . '</a>';
178 218
@@ -177,22 +217,26 @@
177 217 >' . wp_kses_post( __('Book Second Viewing', 'propertyhive') ) . '</a>';
178 218
179 219 if ( get_option('propertyhive_module_disabled_offers_sales', '') != 'yes' )
180 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.
181 222 $property_id = get_post_meta( $post_id, '_property_id', TRUE );
182 223 if ( get_post_meta( $property_id, '_department', TRUE ) == 'residential-sales' )
183 224 {
184 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.
185 227 $offer_id = get_post_meta( $post_id, '_offer_id', TRUE );
186 228 if ( $offer_id != '' && get_post_status($offer_id) != 'publish' )
187 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.
188 231 $offer_id = '';
189 232 }
190 233
191 234 if ( $offer_id != '' )
192 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.
193 237 $actions[] = '<a
194 - href="' . get_edit_post_link( $offer_id, '' ) . '"
238 + href="' . esc_url( get_edit_post_link( $offer_id, '' ) ) . '"
195 239 class="button"
196 240 style="width:100%; margin-bottom:7px; text-align:center"
197 241 >' . wp_kses_post( __('View Offer', 'propertyhive') ) . '</a>';
198 242 }
@@ -197,10 +241,11 @@
197 241 >' . wp_kses_post( __('View Offer', 'propertyhive') ) . '</a>';
198 242 }
199 243 else
200 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.
201 246 $actions[] = '<a
202 - href="' . wp_nonce_url( admin_url( 'post.php?post=' . $post_id . '&action=edit' ), '1', 'create_offer' ) . '"
247 + href="' . esc_url( wp_nonce_url( admin_url( 'post.php?post=' . $post_id . '&action=edit' ), 'propertyhive-create_offer-' . $post_id, 'create_offer' ) ) . '"
203 248 class="button button-success"
204 249 style="width:100%; margin-bottom:7px; text-align:center"
205 250 >' . wp_kses_post( __('Record Offer', 'propertyhive') ) . '</a>';
206 251 }
@@ -209,8 +254,9 @@
209 254 }
210 255
211 256 if ( get_post_meta( $post_id, '_feedback_passed_on', TRUE ) != 'yes' && ( $feedback_status == 'interested' || $feedback_status == 'not_interested' ) )
212 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.
213 259 $actions[] = '<a
214 260 href="#action_panel_viewing_revert_feedback_passed_on"
215 261 class="button viewing-action"
216 262 style="width:100%; margin-bottom:7px; text-align:center"
@@ -218,8 +264,9 @@
218 264 }
219 265
220 266 if ( $feedback_status == 'interested' || $feedback_status == 'not_interested' || $feedback_status == 'not_required' )
221 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.
222 269 $actions[] = '<a
223 270 href="#action_panel_viewing_revert_feedback_pending"
224 271 class="button viewing-action"
225 272 style="width:100%; margin-bottom:7px; text-align:center"
@@ -230,18 +277,21 @@
230 277 if ( $status == 'offer_made' )
231 278 {
232 279 if ( get_option('propertyhive_module_disabled_offers_sales', '') != 'yes' )
233 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.
234 282 $offer_id = get_post_meta( $post_id, '_offer_id', TRUE );
235 283 if ( $offer_id != '' && get_post_status($offer_id) != 'publish' )
236 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.
237 286 $offer_id = '';
238 287 }
239 288
240 289 if ( $offer_id != '' )
241 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.
242 292 $actions[] = '<a
243 - href="' . get_edit_post_link( $offer_id, '' ) . '"
293 + href="' . esc_url( get_edit_post_link( $offer_id, '' ) ) . '"
244 294 class="button"
245 295 style="width:100%; margin-bottom:7px; text-align:center"
246 296 >' . wp_kses_post( __('View Offer', 'propertyhive') ) . '</a>';
247 297 }
@@ -249,13 +299,18 @@
249 299 }
250 300
251 301 if ( $status == 'cancelled' )
252 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.
253 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.
254 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.
255 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.
256 310 foreach ($applicant_contact_ids as $applicant_contact_id)
257 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.
258 313 $applicant_email_addresses[] = get_post_meta( $applicant_contact_id, '_email_address', TRUE );
259 314 }
260 315
261 316 if ( in_array((int)$property_id, array(0, '')) || !is_array($applicant_contact_ids) || count($applicant_contact_ids) == 0 || count($applicant_email_addresses) == 0 )
@@ -263,10 +318,13 @@
263 318
264 319 }
265 320 else
266 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.
267 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.
268 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.
269 327 $attending_negotiator_cancellation_notification_sent_at = get_post_meta( $post_id, '_attending_negotiator_cancellation_notification_sent_at', TRUE );
270 328
271 329 // Applicant
272 330 if ( apply_filters( 'propertyhive_show_viewing_email_applicant_cancellation_notification', true ) === true )
@@ -272,33 +330,40 @@
272 330 if ( apply_filters( 'propertyhive_show_viewing_email_applicant_cancellation_notification', true ) === true )
273 331 {
274 332 if ( get_option( 'propertyhive_customise_confirmation_emails', '' ) == 'yes' )
275 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.
276 335 $actions[] = '<a
277 336 href="#action_panel_viewing_email_applicant_cancellation_notification_customise"
278 337 class="button viewing-action"
279 338 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>';
339 + >' . ( ( $applicant_cancellation_notification_sent_at == '' ) ? esc_html__('Email Applicant Cancellation Notification', 'propertyhive') : esc_html__('Re-Email Applicant Cancellation Notification', 'propertyhive') ) . '</a>';
281 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.
282 342 $show_customise_cancellation_notification_meta_boxes = true;
283 343 }
284 344 else
285 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.
286 347 $actions[] = '<a
287 348 href="#action_panel_viewing_email_applicant_cancellation_notification"
288 349 class="button viewing-action"
289 350 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>';
351 + >' . ( ( $applicant_cancellation_notification_sent_at == '' ) ? esc_html__('Email Applicant Cancellation Notification', 'propertyhive') : esc_html__('Re-Email Applicant Cancellation Notification', 'propertyhive') ) . '</a>';
291 352 }
292 353
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>';
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>';
294 356 }
295 357
296 358 // Owner/Landlord
297 359 if ( apply_filters( 'propertyhive_show_viewing_email_owner_cancellation_notification', true ) === true )
298 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.
299 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.
300 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.
301 366 $owner_or_landlord = ( $property_department == 'residential-lettings' ? 'Landlord' : 'Owner' );
302 367
303 368 if ( is_array($owner_contact_ids) && count($owner_contact_ids) > 0) {
304 369
@@ -303,25 +368,29 @@
303 368 if ( is_array($owner_contact_ids) && count($owner_contact_ids) > 0) {
304 369
305 370 if ( get_option( 'propertyhive_customise_confirmation_emails', '' ) == 'yes' )
306 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.
307 373 $actions[] = '<a
308 374 href="#action_panel_viewing_email_owner_cancellation_notification_customise"
309 375 class="button viewing-action"
310 376 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>';
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>';
312 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.
313 380 $show_customise_cancellation_notification_meta_boxes = true;
314 381 }
315 382 else
316 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.
317 385 $actions[] = '<a
318 386 href="#action_panel_viewing_email_owner_cancellation_notification"
319 387 class="button viewing-action"
320 388 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>';
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>';
322 390 }
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>';
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>';
324 393 }
325 394 }
326 395
327 396 // Attending Negotiators
@@ -326,34 +395,40 @@
326 395
327 396 // Attending Negotiators
328 397 if ( apply_filters( 'propertyhive_show_viewing_email_attending_negotiator_cancellation_notification', true ) === true )
329 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.
330 400 $attending_negotiators = get_post_meta( $property_id, '_negotiator_id' );
331 401 if ( !empty($attending_negotiators) )
332 402 {
333 403 if ( get_option( 'propertyhive_customise_confirmation_emails', '' ) == 'yes' )
334 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.
335 406 $actions[] = '<a
336 407 href="#action_panel_viewing_email_attending_negotiator_cancellation_notification_customise"
337 408 class="button viewing-action"
338 409 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>';
410 + >' . ( ( $attending_negotiator_cancellation_notification_sent_at == '' ) ? esc_html__('Email Negotiator Cancellation Notification', 'propertyhive') : esc_html__('Re-Email Negotiator Cancellation Notification', 'propertyhive') ) . '</a>';
340 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.
341 413 $show_customise_cancellation_notification_meta_boxes = true;
342 414 }
343 415 else
344 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.
345 418 $actions[] = '<a
346 419 href="#action_panel_viewing_email_attending_negotiator_cancellation_notification"
347 420 class="button viewing-action"
348 421 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>';
422 + >' . ( ( $attending_negotiator_cancellation_notification_sent_at == '' ) ? esc_html__('Email Negotiator Cancellation Notification', 'propertyhive') : esc_html__('Re-Email Negotiator Cancellation Notification', 'propertyhive') ) . '</a>';
350 423 }
351 424
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>';
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>';
353 427 }
354 428 }
355 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.
356 431 $actions[] = '<hr>';
357 432 }
358 433 }
359 434
@@ -358,8 +433,9 @@
358 433 }
359 434
360 435 if ( ( $status == 'carried_out' && $feedback_status == '' ) || in_array( $status, array('cancelled', 'no_show') ) )
361 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.
362 438 $actions[] = '<a
363 439 href="#action_panel_viewing_revert_pending"
364 440 class="button viewing-action"
365 441 style="width:100%; margin-bottom:7px; text-align:center"
@@ -365,18 +441,21 @@
365 441 style="width:100%; margin-bottom:7px; text-align:center"
366 442 >' . wp_kses_post( __('Revert To Pending', 'propertyhive') ) . '</a>';
367 443 }
368 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.
369 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.
370 448 $actions = apply_filters( 'propertyhive_admin_post_actions', $actions, $post_id );
371 449
372 450 if ( !empty($actions) )
373 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.
374 453 echo implode("", $actions);
375 454 }
376 455 else
377 456 {
378 - echo '<div style="text-align:center">' . wp_kses_post( __( 'No actions to display', 'propertyhive' ) ) . '</div>';
457 + echo '<div style="text-align:center">' . esc_html( __( 'No actions to display', 'propertyhive' ) ) . '</div>';
379 458 }
380 459
381 460 echo '</div>
382 461
@@ -399,9 +478,11 @@
399 478 do_action( 'propertyhive_admin_post_action_options', $post_id );
400 479
401 480 if ( $show_customise_confirmation_meta_boxes )
402 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.
403 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.
404 485 $body = get_option( 'propertyhive_viewing_owner_booking_confirmation_email_body', '' );
405 486
406 487 echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="action_panel_viewing_email_owner_booking_confirmation_customise" style="display:none;">
407 488
@@ -408,9 +489,9 @@
408 489 <div class="options_group" style="padding-top:8px;">
409 490
410 491 <div class="form-field">
411 492
412 - <label for="_owner_confirmation_email_subject">' . __( 'Subject', 'propertyhive' ) . '</label>
493 + <label for="_owner_confirmation_email_subject">' . esc_html__( 'Subject', 'propertyhive' ) . '</label>
413 494
414 495 <input id="_owner_confirmation_email_subject" name="_owner_confirmation_email_subject" style="width:100%;" value="' . esc_attr($subject) . '">
415 496
416 497 </div>
@@ -416,17 +497,17 @@
416 497 </div>
417 498
418 499 <div class="form-field">
419 500
420 - <label for="_owner_confirmation_email_body">' . __( 'Body', 'propertyhive' ) . '</label>
501 + <label for="_owner_confirmation_email_body">' . esc_html__( 'Body', 'propertyhive' ) . '</label>
421 502
422 - <textarea id="_owner_confirmation_email_body" name="_owner_confirmation_email_body" style="width:100%; height:100px;">' . $body . '</textarea>
503 + <textarea id="_owner_confirmation_email_body" name="_owner_confirmation_email_body" style="width:100%; height:100px;">' . esc_textarea( $body ) . '</textarea>
423 504
424 505 </div>
425 506
426 507 <div class="form-field">
427 508
428 - <label for="_owner_confirmation_email_attachment">' . __( 'Attach File(s)', 'propertyhive' ) . '</label>
509 + <label for="_owner_confirmation_email_attachment">' . esc_html__( 'Attach File(s)', 'propertyhive' ) . '</label>
429 510
430 511 <input type="file" id="_owner_confirmation_email_attachment" name="_owner_confirmation_email_attachment" style="width:100%;" multiple>
431 512
432 513 </div>
@@ -437,9 +518,11 @@
437 518 </div>
438 519
439 520 </div>';
440 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.
441 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.
442 525 $body = get_option( 'propertyhive_viewing_applicant_booking_confirmation_email_body', '' );
443 526
444 527 echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="action_panel_viewing_email_applicant_booking_confirmation_customise" style="display:none;">
445 528
@@ -456,9 +539,9 @@
456 539 <div class="form-field">
457 540
458 541 <label for="_applicant_confirmation_email_body">' . esc_html(__( 'Body', 'propertyhive' )) . '</label>
459 542
460 - <textarea id="_applicant_confirmation_email_body" name="_applicant_confirmation_email_body" style="width:100%; height:100px;">' . $body . '</textarea>
543 + <textarea id="_applicant_confirmation_email_body" name="_applicant_confirmation_email_body" style="width:100%; height:100px;">' . esc_textarea( $body ) . '</textarea>
461 544
462 545 </div>
463 546
464 547 <div class="form-field">
@@ -475,9 +558,11 @@
475 558 </div>
476 559
477 560 </div>';
478 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.
479 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.
480 565 $body = get_option( 'propertyhive_viewing_attending_negotiator_booking_confirmation_email_body', '' );
481 566
482 567 echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="action_panel_viewing_email_attending_negotiator_booking_confirmation_customise" style="display:none;">
483 568
@@ -494,9 +579,9 @@
494 579 <div class="form-field">
495 580
496 581 <label for="_attending_negotiator_confirmation_email_body">' . esc_html(__( 'Body', 'propertyhive' )) . '</label>
497 582
498 - <textarea id="_attending_negotiator_confirmation_email_body" name="_attending_negotiator_confirmation_email_body" style="width:100%; height:100px;">' . $body . '</textarea>
583 + <textarea id="_attending_negotiator_confirmation_email_body" name="_attending_negotiator_confirmation_email_body" style="width:100%; height:100px;">' . esc_textarea( $body ) . '</textarea>
499 584
500 585 </div>
501 586
502 587 <div class="form-field">
@@ -516,9 +601,11 @@
516 601 }
517 602
518 603 if ( $show_customise_cancellation_notification_meta_boxes )
519 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.
520 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.
521 608 $body = get_option( 'propertyhive_viewing_owner_cancellation_notification_email_body', '' );
522 609
523 610 echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="action_panel_viewing_email_owner_cancellation_notification_customise" style="display:none;">
524 611
@@ -525,9 +612,9 @@
525 612 <div class="options_group" style="padding-top:8px;">
526 613
527 614 <div class="form-field">
528 615
529 - <label for="_owner_cancellation_notification_email_subject">' . __( 'Subject', 'propertyhive' ) . '</label>
616 + <label for="_owner_cancellation_notification_email_subject">' . esc_html__( 'Subject', 'propertyhive' ) . '</label>
530 617
531 618 <input id="_owner_cancellation_notification_email_subject" name="_owner_cancellation_notification_email_subject" style="width:100%;" value="' . esc_attr($subject) . '">
532 619
533 620 </div>
@@ -533,17 +620,17 @@
533 620 </div>
534 621
535 622 <div class="form-field">
536 623
537 - <label for="_owner_cancellation_notification_email_body">' . __( 'Body', 'propertyhive' ) . '</label>
624 + <label for="_owner_cancellation_notification_email_body">' . esc_html__( 'Body', 'propertyhive' ) . '</label>
538 625
539 - <textarea id="_owner_cancellation_notification_email_body" name="_owner_cancellation_notification_email_body" style="width:100%; height:100px;">' . $body . '</textarea>
626 + <textarea id="_owner_cancellation_notification_email_body" name="_owner_cancellation_notification_email_body" style="width:100%; height:100px;">' . esc_textarea( $body ) . '</textarea>
540 627
541 628 </div>
542 629
543 630 <div class="form-field">
544 631
545 - <label for="_owner_cancellation_notification_email_attachment">' . __( 'Attach File(s)', 'propertyhive' ) . '</label>
632 + <label for="_owner_cancellation_notification_email_attachment">' . esc_html__( 'Attach File(s)', 'propertyhive' ) . '</label>
546 633
547 634 <input type="file" id="_owner_cancellation_notification_email_attachment" name="_owner_cancellation_notification_email_attachment" style="width:100%;" multiple>
548 635
549 636 </div>
@@ -554,9 +641,11 @@
554 641 </div>
555 642
556 643 </div>';
557 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.
558 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.
559 648 $body = get_option( 'propertyhive_viewing_applicant_cancellation_notification_email_body', '' );
560 649
561 650 echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="action_panel_viewing_email_applicant_cancellation_notification_customise" style="display:none;">
562 651
@@ -573,9 +662,9 @@
573 662 <div class="form-field">
574 663
575 664 <label for="_applicant_cancellation_notification_email_body">' . esc_html(__( 'Body', 'propertyhive' )) . '</label>
576 665
577 - <textarea id="_applicant_cancellation_notification_email_body" name="_applicant_cancellation_notification_email_body" style="width:100%; height:100px;">' . $body . '</textarea>
666 + <textarea id="_applicant_cancellation_notification_email_body" name="_applicant_cancellation_notification_email_body" style="width:100%; height:100px;">' . esc_textarea( $body ) . '</textarea>
578 667
579 668 </div>
580 669
581 670 <div class="form-field">
@@ -592,9 +681,11 @@
592 681 </div>
593 682
594 683 </div>';
595 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.
596 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.
597 688 $body = get_option( 'propertyhive_viewing_attending_negotiator_cancellation_notification_email_body', '' );
598 689
599 690 echo '<div class="propertyhive_meta_box propertyhive_meta_box_actions" id="action_panel_viewing_email_attending_negotiator_cancellation_notification_customise" style="display:none;">
600 691
@@ -611,9 +702,9 @@
611 702 <div class="form-field">
612 703
613 704 <label for="_attending_negotiator_cancellation_notification_email_body">' . esc_html(__( 'Body', 'propertyhive' )) . '</label>
614 705
615 - <textarea id="_attending_negotiator_cancellation_notification_email_body" name="_attending_negotiator_cancellation_notification_email_body" style="width:100%; height:100px;">' . $body . '</textarea>
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>
616 707
617 708 </div>
618 709
619 710 <div class="form-field">
@@ -641,9 +732,9 @@
641 732 <div class="form-field">
642 733
643 734 <label for="_cancelled_reason">' . esc_html(__( 'Reason Cancelled', 'propertyhive' )) . '</label>
644 735
645 - <textarea id="_cancelled_reason" name="_cancelled_reason" style="width:100%;">' . get_post_meta( $post_id, '_cancelled_reason', TRUE ) . '</textarea>
736 + <textarea id="_cancelled_reason" name="_cancelled_reason" style="width:100%;">' . esc_textarea( get_post_meta( $post_id, '_cancelled_reason', TRUE ) ) . '</textarea>
646 737
647 738 </div>
648 739
649 740 <div class="form-field">
@@ -670,9 +761,9 @@
670 761 <div class="form-field">
671 762
672 763 <label for="_viewing_interested_feedback">' . esc_html(__( 'Applicant Feedback', 'propertyhive' )) . '</label>
673 764
674 - <textarea id="_interested_feedback" name="_interested_feedback" style="width:100%;">' . get_post_meta( $post_id, '_feedback', TRUE ) . '</textarea>
765 + <textarea id="_interested_feedback" name="_interested_feedback" style="width:100%;">' . esc_textarea( get_post_meta( $post_id, '_feedback', TRUE ) ) . '</textarea>
675 766
676 767 </div>
677 768
678 769 <a class="button action-cancel" href="#">' . esc_html(__( 'Cancel', 'propertyhive' )) . '</a>
@@ -689,9 +780,9 @@
689 780 <div class="form-field">
690 781
691 782 <label for="_viewing_not_interested_feedback">' . esc_html(__( 'Applicant Feedback', 'propertyhive' )) . '</label>
692 783
693 - <textarea id="_not_interested_feedback" name="_not_interested_feedback" style="width:100%;">' . get_post_meta( $post_id, '_feedback', TRUE ) . '</textarea>
784 + <textarea id="_not_interested_feedback" name="_not_interested_feedback" style="width:100%;">' . esc_textarea( get_post_meta( $post_id, '_feedback', TRUE ) ) . '</textarea>
694 785
695 786 </div>
696 787
697 788 <a class="button action-cancel" href="#">' . esc_html(__( 'Cancel', 'propertyhive' )) . '</a>