@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | |
5 | 5 | |
@@ -42,51 +42,51 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @param \Registrations_Admin_Page $admin_page |
44 | 44 | */ |
45 | - public function __construct( $admin_page ) { |
|
46 | - parent::__construct( $admin_page ); |
|
45 | + public function __construct($admin_page) { |
|
46 | + parent::__construct($admin_page); |
|
47 | 47 | $this->_status = $this->_admin_page->get_registration_status_array(); |
48 | 48 | } |
49 | 49 | |
50 | 50 | |
51 | 51 | |
52 | 52 | protected function _setup_data() { |
53 | - $this->_data = $this->_view !== 'trash' ? $this->_admin_page->get_event_attendees( $this->_per_page ) |
|
54 | - : $this->_admin_page->get_event_attendees( $this->_per_page, false, true ); |
|
53 | + $this->_data = $this->_view !== 'trash' ? $this->_admin_page->get_event_attendees($this->_per_page) |
|
54 | + : $this->_admin_page->get_event_attendees($this->_per_page, false, true); |
|
55 | 55 | $this->_all_data_count = $this->_view !== 'trash' ? $this->_admin_page->get_event_attendees( |
56 | 56 | $this->_per_page, |
57 | 57 | true |
58 | - ) : $this->_admin_page->get_event_attendees( $this->_per_page, true, true ); |
|
58 | + ) : $this->_admin_page->get_event_attendees($this->_per_page, true, true); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
62 | 62 | |
63 | 63 | protected function _set_properties() { |
64 | - $evt_id = isset( $this->_req_data['event_id'] ) ? $this->_req_data['event_id'] : null; |
|
64 | + $evt_id = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null; |
|
65 | 65 | $this->_wp_list_args = array( |
66 | - 'singular' => __( 'registrant', 'event_espresso' ), |
|
67 | - 'plural' => __( 'registrants', 'event_espresso' ), |
|
66 | + 'singular' => __('registrant', 'event_espresso'), |
|
67 | + 'plural' => __('registrants', 'event_espresso'), |
|
68 | 68 | 'ajax' => true, |
69 | 69 | 'screen' => $this->_admin_page->get_current_screen()->id, |
70 | 70 | ); |
71 | 71 | $columns = array(); |
72 | 72 | //$columns['_Reg_Status'] = ''; |
73 | - if ( ! empty( $evt_id ) ) { |
|
73 | + if ( ! empty($evt_id)) { |
|
74 | 74 | $columns['cb'] = '<input type="checkbox" />'; //Render a checkbox instead of text |
75 | 75 | $this->_has_checkbox_column = true; |
76 | 76 | } |
77 | 77 | $this->_columns = array( |
78 | 78 | '_REG_att_checked_in' => '<span class="dashicons dashicons-yes ee-icon-size-18"></span>', |
79 | - 'ATT_name' => __( 'Registrant', 'event_espresso' ), |
|
80 | - 'ATT_email' => __( 'Email Address', 'event_espresso' ), |
|
81 | - 'Event' => __( 'Event', 'event_espresso' ), |
|
82 | - 'PRC_name' => __( 'TKT Option', 'event_espresso' ), |
|
83 | - '_REG_final_price' => __( 'Price', 'event_espresso' ), |
|
84 | - 'TXN_paid' => __( 'Paid', 'event_espresso' ), |
|
85 | - 'TXN_total' => __( 'Total', 'event_espresso' ), |
|
79 | + 'ATT_name' => __('Registrant', 'event_espresso'), |
|
80 | + 'ATT_email' => __('Email Address', 'event_espresso'), |
|
81 | + 'Event' => __('Event', 'event_espresso'), |
|
82 | + 'PRC_name' => __('TKT Option', 'event_espresso'), |
|
83 | + '_REG_final_price' => __('Price', 'event_espresso'), |
|
84 | + 'TXN_paid' => __('Paid', 'event_espresso'), |
|
85 | + 'TXN_total' => __('Total', 'event_espresso'), |
|
86 | 86 | ); |
87 | - $this->_columns = array_merge( $columns, $this->_columns ); |
|
87 | + $this->_columns = array_merge($columns, $this->_columns); |
|
88 | 88 | $this->_primary_column = '_REG_att_checked_in'; |
89 | - if ( ! empty( $evt_id ) |
|
89 | + if ( ! empty($evt_id) |
|
90 | 90 | && EE_Registry::instance()->CAP->current_user_can( |
91 | 91 | 'ee_read_registrations', |
92 | 92 | 'espresso_registrations_registrations_reports', |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | 'extra_request' => |
100 | 100 | array( |
101 | 101 | 'EVT_ID' => $evt_id, |
102 | - 'return_url' => urlencode( "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" ), |
|
102 | + 'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"), |
|
103 | 103 | ), |
104 | 104 | ), |
105 | 105 | ); |
@@ -128,11 +128,11 @@ discard block |
||
128 | 128 | ); |
129 | 129 | $this->_sortable_columns = array( |
130 | 130 | //true means its already sorted |
131 | - 'ATT_name' => array( 'ATT_name' => true ), |
|
132 | - 'Event' => array( 'Event.EVT.Name' => false ), |
|
131 | + 'ATT_name' => array('ATT_name' => true), |
|
132 | + 'Event' => array('Event.EVT.Name' => false), |
|
133 | 133 | ); |
134 | 134 | $this->_hidden_columns = array(); |
135 | - $this->_evt = EEM_Event::instance()->get_one_by_ID( $evt_id ); |
|
135 | + $this->_evt = EEM_Event::instance()->get_one_by_ID($evt_id); |
|
136 | 136 | $this->_dtts_for_event = $this->_evt instanceof EE_Event ? $this->_evt->datetimes_ordered() : array(); |
137 | 137 | } |
138 | 138 | |
@@ -142,11 +142,11 @@ discard block |
||
142 | 142 | * @param \EE_Registration $item |
143 | 143 | * @return string |
144 | 144 | */ |
145 | - protected function _get_row_class( $item ) { |
|
146 | - $class = parent::_get_row_class( $item ); |
|
145 | + protected function _get_row_class($item) { |
|
146 | + $class = parent::_get_row_class($item); |
|
147 | 147 | //add status class |
148 | - $class .= ' ee-status-strip reg-status-' . $item->status_ID(); |
|
149 | - if ( $this->_has_checkbox_column ) { |
|
148 | + $class .= ' ee-status-strip reg-status-'.$item->status_ID(); |
|
149 | + if ($this->_has_checkbox_column) { |
|
150 | 150 | $class .= ' has-checkbox-column'; |
151 | 151 | } |
152 | 152 | return $class; |
@@ -160,61 +160,61 @@ discard block |
||
160 | 160 | */ |
161 | 161 | protected function _get_table_filters() { |
162 | 162 | $filters = $where = array(); |
163 | - $current_EVT_ID = isset( $this->_req_data['event_id'] ) ? (int) $this->_req_data['event_id'] : 0; |
|
164 | - if ( empty( $this->_dtts_for_event ) || count( $this->_dtts_for_event ) === 1 ) { |
|
163 | + $current_EVT_ID = isset($this->_req_data['event_id']) ? (int) $this->_req_data['event_id'] : 0; |
|
164 | + if (empty($this->_dtts_for_event) || count($this->_dtts_for_event) === 1) { |
|
165 | 165 | //this means we don't have an event so let's setup a filter dropdown for all the events to select |
166 | 166 | //note possible capability restrictions |
167 | - if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_events', 'get_events' ) ) { |
|
168 | - $where['status**'] = array( '!=', 'private' ); |
|
167 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) { |
|
168 | + $where['status**'] = array('!=', 'private'); |
|
169 | 169 | } |
170 | - if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_events', 'get_events' ) ) { |
|
170 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) { |
|
171 | 171 | $where['EVT_wp_user'] = get_current_user_id(); |
172 | 172 | } |
173 | 173 | $events = EEM_Event::instance()->get_all( |
174 | 174 | array( |
175 | 175 | $where, |
176 | - 'order_by' => array( 'Datetime.DTT_EVT_start' => 'DESC' ), |
|
176 | + 'order_by' => array('Datetime.DTT_EVT_start' => 'DESC'), |
|
177 | 177 | ) |
178 | 178 | ); |
179 | 179 | $evts[] = array( |
180 | 180 | 'id' => 0, |
181 | - 'text' => __( 'To toggle Check-in status, select an event', 'event_espresso' ), |
|
181 | + 'text' => __('To toggle Check-in status, select an event', 'event_espresso'), |
|
182 | 182 | ); |
183 | 183 | $checked = 'checked'; |
184 | 184 | /** @var EE_Event $evt */ |
185 | - foreach ( $events as $evt ) { |
|
185 | + foreach ($events as $evt) { |
|
186 | 186 | //any registrations for this event? |
187 | - if ( ! $evt->get_count_of_all_registrations() ) { |
|
187 | + if ( ! $evt->get_count_of_all_registrations()) { |
|
188 | 188 | continue; |
189 | 189 | } |
190 | 190 | $evts[] = array( |
191 | 191 | 'id' => $evt->ID(), |
192 | - 'text' => $evt->get( 'EVT_name' ), |
|
192 | + 'text' => $evt->get('EVT_name'), |
|
193 | 193 | 'class' => $evt->is_expired() ? 'ee-expired-event' : '', |
194 | 194 | ); |
195 | - if ( $evt->ID() === $current_EVT_ID && $evt->is_expired() ) { |
|
195 | + if ($evt->ID() === $current_EVT_ID && $evt->is_expired()) { |
|
196 | 196 | $checked = ''; |
197 | 197 | } |
198 | 198 | } |
199 | 199 | $event_filter = '<div class="ee-event-filter">'; |
200 | - $event_filter .= EEH_Form_Fields::select_input( 'event_id', $evts, $current_EVT_ID ); |
|
200 | + $event_filter .= EEH_Form_Fields::select_input('event_id', $evts, $current_EVT_ID); |
|
201 | 201 | $event_filter .= '<span class="ee-event-filter-toggle">'; |
202 | - $event_filter .= '<input type="checkbox" id="js-ee-hide-expired-events" ' . $checked . '> '; |
|
203 | - $event_filter .= __( 'Hide Expired Events', 'event_espresso' ); |
|
202 | + $event_filter .= '<input type="checkbox" id="js-ee-hide-expired-events" '.$checked.'> '; |
|
203 | + $event_filter .= __('Hide Expired Events', 'event_espresso'); |
|
204 | 204 | $event_filter .= '</span>'; |
205 | 205 | $event_filter .= '</div>'; |
206 | 206 | $filters[] = $event_filter; |
207 | 207 | } |
208 | - if ( ! empty( $this->_dtts_for_event ) ) { |
|
208 | + if ( ! empty($this->_dtts_for_event)) { |
|
209 | 209 | //DTT datetimes filter |
210 | - $this->_cur_dtt_id = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : 0; |
|
211 | - if ( count( $this->_dtts_for_event ) > 1 ) { |
|
212 | - $dtts[0] = __( 'To toggle check-in status, select a datetime.', 'event_espresso' ); |
|
213 | - foreach ( $this->_dtts_for_event as $dtt ) { |
|
210 | + $this->_cur_dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0; |
|
211 | + if (count($this->_dtts_for_event) > 1) { |
|
212 | + $dtts[0] = __('To toggle check-in status, select a datetime.', 'event_espresso'); |
|
213 | + foreach ($this->_dtts_for_event as $dtt) { |
|
214 | 214 | $datetime_string = $dtt->name(); |
215 | - $datetime_string = ! empty($datetime_string ) ? ' (' . $datetime_string . ')' : ''; |
|
216 | - $datetime_string = $dtt->start_date_and_time() . ' - ' . $dtt->end_date_and_time() . $datetime_string; |
|
217 | - $dtts[ $dtt->ID() ] = $datetime_string; |
|
215 | + $datetime_string = ! empty($datetime_string) ? ' ('.$datetime_string.')' : ''; |
|
216 | + $datetime_string = $dtt->start_date_and_time().' - '.$dtt->end_date_and_time().$datetime_string; |
|
217 | + $dtts[$dtt->ID()] = $datetime_string; |
|
218 | 218 | } |
219 | 219 | $input = new EE_Select_Input( |
220 | 220 | $dtts, |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | ) |
226 | 226 | ); |
227 | 227 | $filters[] = $input->get_html_for_input(); |
228 | - $filters[] = '<input type="hidden" name="event_id" value="' . $current_EVT_ID . '">'; |
|
228 | + $filters[] = '<input type="hidden" name="event_id" value="'.$current_EVT_ID.'">'; |
|
229 | 229 | } |
230 | 230 | } |
231 | 231 | return $filters; |
@@ -244,22 +244,22 @@ discard block |
||
244 | 244 | * @throws \EE_Error |
245 | 245 | */ |
246 | 246 | protected function _get_total_event_attendees() { |
247 | - $EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : false; |
|
247 | + $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : false; |
|
248 | 248 | $DTT_ID = $this->_cur_dtt_id; |
249 | 249 | $query_params = array(); |
250 | - if ( $EVT_ID ) { |
|
250 | + if ($EVT_ID) { |
|
251 | 251 | $query_params[0]['EVT_ID'] = $EVT_ID; |
252 | 252 | } |
253 | 253 | //if DTT is included we only show for that datetime. Otherwise we're showing for all datetimes (the event). |
254 | - if ( $DTT_ID ) { |
|
254 | + if ($DTT_ID) { |
|
255 | 255 | $query_params[0]['Ticket.Datetime.DTT_ID'] = $DTT_ID; |
256 | 256 | } |
257 | 257 | $status_ids_array = apply_filters( |
258 | 258 | 'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array', |
259 | - array( EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved ) |
|
259 | + array(EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved) |
|
260 | 260 | ); |
261 | - $query_params[0]['STS_ID'] = array( 'IN', $status_ids_array ); |
|
262 | - return EEM_Registration::instance()->count( $query_params ); |
|
261 | + $query_params[0]['STS_ID'] = array('IN', $status_ids_array); |
|
262 | + return EEM_Registration::instance()->count($query_params); |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | |
@@ -268,8 +268,8 @@ discard block |
||
268 | 268 | * @param \EE_Registration $item |
269 | 269 | * @return string |
270 | 270 | */ |
271 | - public function column__Reg_Status( EE_Registration $item ) { |
|
272 | - return '<span class="ee-status-strip ee-status-strip-td reg-status-' . $item->status_ID() . '"></span>'; |
|
271 | + public function column__Reg_Status(EE_Registration $item) { |
|
272 | + return '<span class="ee-status-strip ee-status-strip-td reg-status-'.$item->status_ID().'"></span>'; |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | |
@@ -279,8 +279,8 @@ discard block |
||
279 | 279 | * @return string |
280 | 280 | * @throws \EE_Error |
281 | 281 | */ |
282 | - public function column_cb( $item ) { |
|
283 | - return sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', $item->ID() ); |
|
282 | + public function column_cb($item) { |
|
283 | + return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', $item->ID()); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | |
@@ -292,20 +292,20 @@ discard block |
||
292 | 292 | * @return string |
293 | 293 | * @throws \EE_Error |
294 | 294 | */ |
295 | - public function column__REG_att_checked_in( EE_Registration $item ) { |
|
295 | + public function column__REG_att_checked_in(EE_Registration $item) { |
|
296 | 296 | $attendee = $item->attendee(); |
297 | 297 | $attendee_name = $attendee instanceof EE_Attendee ? $attendee->full_name() : ''; |
298 | 298 | |
299 | - if ( $this->_cur_dtt_id === 0 && count( $this->_dtts_for_event ) === 1 ) { |
|
299 | + if ($this->_cur_dtt_id === 0 && count($this->_dtts_for_event) === 1) { |
|
300 | 300 | $latest_related_datetime = $item->get_latest_related_datetime(); |
301 | - if ( $latest_related_datetime instanceof EE_Datetime ) { |
|
301 | + if ($latest_related_datetime instanceof EE_Datetime) { |
|
302 | 302 | $this->_cur_dtt_id = $latest_related_datetime->ID(); |
303 | 303 | } |
304 | 304 | } |
305 | 305 | |
306 | - $checkinstatus = $item->check_in_status_for_datetime( $this->_cur_dtt_id ); |
|
307 | - $nonce = wp_create_nonce( 'checkin_nonce' ); |
|
308 | - $toggle_active = ! empty ( $this->_cur_dtt_id ) |
|
306 | + $checkinstatus = $item->check_in_status_for_datetime($this->_cur_dtt_id); |
|
307 | + $nonce = wp_create_nonce('checkin_nonce'); |
|
308 | + $toggle_active = ! empty ($this->_cur_dtt_id) |
|
309 | 309 | && EE_Registry::instance()->CAP->current_user_can( |
310 | 310 | 'ee_edit_checkin', |
311 | 311 | 'espresso_registrations_toggle_checkin_status', |
@@ -313,11 +313,11 @@ discard block |
||
313 | 313 | ) |
314 | 314 | ? ' clickable trigger-checkin' |
315 | 315 | : ''; |
316 | - $mobile_view_content = ' <span class="show-on-mobile-view-only">' . $attendee_name . '</span>'; |
|
317 | - return '<span class="checkin-icons checkedin-status-' . $checkinstatus . $toggle_active . '"' |
|
318 | - . ' data-_regid="' . $item->ID() . '"' |
|
319 | - . ' data-dttid="' . $this->_cur_dtt_id . '"' |
|
320 | - . ' data-nonce="' . $nonce . '">' |
|
316 | + $mobile_view_content = ' <span class="show-on-mobile-view-only">'.$attendee_name.'</span>'; |
|
317 | + return '<span class="checkin-icons checkedin-status-'.$checkinstatus.$toggle_active.'"' |
|
318 | + . ' data-_regid="'.$item->ID().'"' |
|
319 | + . ' data-dttid="'.$this->_cur_dtt_id.'"' |
|
320 | + . ' data-nonce="'.$nonce.'">' |
|
321 | 321 | . '</span>' |
322 | 322 | . $mobile_view_content; |
323 | 323 | } |
@@ -329,21 +329,21 @@ discard block |
||
329 | 329 | * @return mixed|string|void |
330 | 330 | * @throws \EE_Error |
331 | 331 | */ |
332 | - public function column_ATT_name( EE_Registration $item ) { |
|
332 | + public function column_ATT_name(EE_Registration $item) { |
|
333 | 333 | $attendee = $item->attendee(); |
334 | - if ( ! $attendee instanceof EE_Attendee ) { |
|
335 | - return __( 'No contact record for this registration.', 'event_espresso' ); |
|
334 | + if ( ! $attendee instanceof EE_Attendee) { |
|
335 | + return __('No contact record for this registration.', 'event_espresso'); |
|
336 | 336 | } |
337 | 337 | // edit attendee link |
338 | 338 | $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( |
339 | - array( 'action' => 'view_registration', '_REG_ID' => $item->ID() ), |
|
339 | + array('action' => 'view_registration', '_REG_ID' => $item->ID()), |
|
340 | 340 | REG_ADMIN_URL |
341 | 341 | ); |
342 | 342 | $name_link = EE_Registry::instance()->CAP->current_user_can( |
343 | 343 | 'ee_edit_contacts', |
344 | 344 | 'espresso_registrations_edit_attendee' |
345 | 345 | ) |
346 | - ? '<a href="' . $edit_lnk_url . '" title="' . esc_attr__( 'Edit Contact', 'event_espresso' ) . '">' |
|
346 | + ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact', 'event_espresso').'">' |
|
347 | 347 | . $item->attendee()->full_name() |
348 | 348 | . '</a>' |
349 | 349 | : $item->attendee()->full_name(); |
@@ -351,10 +351,10 @@ discard block |
||
351 | 351 | ? ' <sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup> ' |
352 | 352 | : ''; |
353 | 353 | //add group details |
354 | - $name_link .= ' ' . sprintf( __( '(%s of %s)', 'event_espresso' ), $item->count(), $item->group_size() ); |
|
354 | + $name_link .= ' '.sprintf(__('(%s of %s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
355 | 355 | //add regcode |
356 | 356 | $link = EE_Admin_Page::add_query_args_and_nonce( |
357 | - array( 'action' => 'view_registration', '_REG_ID' => $item->ID() ), |
|
357 | + array('action' => 'view_registration', '_REG_ID' => $item->ID()), |
|
358 | 358 | REG_ADMIN_URL |
359 | 359 | ); |
360 | 360 | $name_link .= '<br>'; |
@@ -363,50 +363,50 @@ discard block |
||
363 | 363 | 'view_registration', |
364 | 364 | $item->ID() |
365 | 365 | ) |
366 | - ? '<a href="' . $link . '" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '">' |
|
366 | + ? '<a href="'.$link.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'">' |
|
367 | 367 | . $item->reg_code() |
368 | 368 | . '</a>' |
369 | 369 | : $item->reg_code(); |
370 | 370 | //status |
371 | 371 | $name_link .= '<br><span class="ee-status-text-small">'; |
372 | - $name_link .= EEH_Template::pretty_status( $item->status_ID(), false, 'sentence' ); |
|
372 | + $name_link .= EEH_Template::pretty_status($item->status_ID(), false, 'sentence'); |
|
373 | 373 | $name_link .= '</span>'; |
374 | 374 | $actions = array(); |
375 | 375 | $DTT_ID = $this->_cur_dtt_id; |
376 | - $latest_related_datetime = empty( $DTT_ID ) && ! empty( $this->_req_data['event_id'] ) && $item instanceof EE_Registration |
|
376 | + $latest_related_datetime = empty($DTT_ID) && ! empty($this->_req_data['event_id']) && $item instanceof EE_Registration |
|
377 | 377 | ? $item->get_latest_related_datetime() |
378 | 378 | : null; |
379 | 379 | $DTT_ID = $latest_related_datetime instanceof EE_Datetime |
380 | 380 | ? $latest_related_datetime->ID() |
381 | 381 | : $DTT_ID; |
382 | - if ( ! empty( $DTT_ID ) |
|
382 | + if ( ! empty($DTT_ID) |
|
383 | 383 | && EE_Registry::instance()->CAP->current_user_can( |
384 | 384 | 'ee_read_checkins', |
385 | 385 | 'espresso_registrations_registration_checkins' |
386 | 386 | ) |
387 | 387 | ) { |
388 | 388 | $checkin_list_url = EE_Admin_Page::add_query_args_and_nonce( |
389 | - array( 'action' => 'registration_checkins', '_REGID' => $item->ID(), 'DTT_ID' => $DTT_ID ) |
|
389 | + array('action' => 'registration_checkins', '_REGID' => $item->ID(), 'DTT_ID' => $DTT_ID) |
|
390 | 390 | ); |
391 | 391 | // get the timestamps for this registration's checkins, related to the selected datetime |
392 | - $timestamps = $item->get_many_related( 'Checkin', array( array( 'DTT_ID' => $DTT_ID ) ) ); |
|
393 | - if( ! empty( $timestamps ) ) { |
|
392 | + $timestamps = $item->get_many_related('Checkin', array(array('DTT_ID' => $DTT_ID))); |
|
393 | + if ( ! empty($timestamps)) { |
|
394 | 394 | // get the last timestamp |
395 | - $last_timestamp = end( $timestamps ); |
|
395 | + $last_timestamp = end($timestamps); |
|
396 | 396 | // checked in or checked out? |
397 | - $checkin_status = $last_timestamp->get( 'CHK_in' ) |
|
398 | - ? esc_html__( 'Checked In', 'event_espresso' ) |
|
399 | - : esc_html__( 'Checked Out', 'event_espresso' ); |
|
397 | + $checkin_status = $last_timestamp->get('CHK_in') |
|
398 | + ? esc_html__('Checked In', 'event_espresso') |
|
399 | + : esc_html__('Checked Out', 'event_espresso'); |
|
400 | 400 | // get timestamp string |
401 | - $timestamp_string = $last_timestamp->get_datetime( 'CHK_timestamp' ); |
|
402 | - $actions['checkin'] = '<a href="' . $checkin_list_url . '" title="' . esc_attr__( |
|
401 | + $timestamp_string = $last_timestamp->get_datetime('CHK_timestamp'); |
|
402 | + $actions['checkin'] = '<a href="'.$checkin_list_url.'" title="'.esc_attr__( |
|
403 | 403 | 'View this registrant\'s check-ins/checkouts for the datetime', |
404 | 404 | 'event_espresso' |
405 | - ) . '">' . $checkin_status . ': ' . $timestamp_string . '</a>'; |
|
405 | + ).'">'.$checkin_status.': '.$timestamp_string.'</a>'; |
|
406 | 406 | } |
407 | 407 | } |
408 | - return ( ! empty( $DTT_ID ) && ! empty( $timestamps ) ) |
|
409 | - ? sprintf( '%1$s %2$s', $name_link, $this->row_actions( $actions, true ) ) |
|
408 | + return ( ! empty($DTT_ID) && ! empty($timestamps)) |
|
409 | + ? sprintf('%1$s %2$s', $name_link, $this->row_actions($actions, true)) |
|
410 | 410 | : $name_link; |
411 | 411 | } |
412 | 412 | |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | * @param \EE_Registration $item |
417 | 417 | * @return string |
418 | 418 | */ |
419 | - public function column_ATT_email( EE_Registration $item ) { |
|
419 | + public function column_ATT_email(EE_Registration $item) { |
|
420 | 420 | $attendee = $item->attendee(); |
421 | 421 | return $attendee instanceof EE_Attendee ? $attendee->email() : ''; |
422 | 422 | } |
@@ -428,22 +428,22 @@ discard block |
||
428 | 428 | * @return bool|string |
429 | 429 | * @throws \EE_Error |
430 | 430 | */ |
431 | - public function column_Event( EE_Registration $item ) { |
|
431 | + public function column_Event(EE_Registration $item) { |
|
432 | 432 | try { |
433 | 433 | $event = $this->_evt instanceof EE_Event ? $this->_evt : $item->event(); |
434 | 434 | $chkin_lnk_url = EE_Admin_Page::add_query_args_and_nonce( |
435 | - array( 'action' => 'event_registrations', 'event_id' => $event->ID() ), |
|
435 | + array('action' => 'event_registrations', 'event_id' => $event->ID()), |
|
436 | 436 | REG_ADMIN_URL |
437 | 437 | ); |
438 | 438 | $event_label = EE_Registry::instance()->CAP->current_user_can( |
439 | 439 | 'ee_read_checkins', |
440 | 440 | 'espresso_registrations_registration_checkins' |
441 | - ) ? '<a href="' . $chkin_lnk_url . '" title="' . esc_attr__( |
|
441 | + ) ? '<a href="'.$chkin_lnk_url.'" title="'.esc_attr__( |
|
442 | 442 | 'View Checkins for this Event', |
443 | 443 | 'event_espresso' |
444 | - ) . '">' . $event->name() . '</a>' : $event->name(); |
|
445 | - } catch ( \EventEspresso\core\exceptions\EntityNotFoundException $e ) { |
|
446 | - $event_label = esc_html__( 'Unknown', 'event_espresso' ); |
|
444 | + ).'">'.$event->name().'</a>' : $event->name(); |
|
445 | + } catch (\EventEspresso\core\exceptions\EntityNotFoundException $e) { |
|
446 | + $event_label = esc_html__('Unknown', 'event_espresso'); |
|
447 | 447 | } |
448 | 448 | return $event_label; |
449 | 449 | } |
@@ -454,8 +454,8 @@ discard block |
||
454 | 454 | * @param \EE_Registration $item |
455 | 455 | * @return mixed|string|void |
456 | 456 | */ |
457 | - public function column_PRC_name( EE_Registration $item ) { |
|
458 | - return $item->ticket() instanceof EE_Ticket ? $item->ticket()->name() : __( "Unknown", "event_espresso" ); |
|
457 | + public function column_PRC_name(EE_Registration $item) { |
|
458 | + return $item->ticket() instanceof EE_Ticket ? $item->ticket()->name() : __("Unknown", "event_espresso"); |
|
459 | 459 | } |
460 | 460 | |
461 | 461 | |
@@ -466,8 +466,8 @@ discard block |
||
466 | 466 | * @param \EE_Registration $item |
467 | 467 | * @return string |
468 | 468 | */ |
469 | - public function column__REG_final_price( EE_Registration $item ) { |
|
470 | - return '<span class="reg-pad-rght">' . ' ' . $item->pretty_final_price() . '</span>'; |
|
469 | + public function column__REG_final_price(EE_Registration $item) { |
|
470 | + return '<span class="reg-pad-rght">'.' '.$item->pretty_final_price().'</span>'; |
|
471 | 471 | } |
472 | 472 | |
473 | 473 | |
@@ -479,13 +479,13 @@ discard block |
||
479 | 479 | * @return string |
480 | 480 | * @throws \EE_Error |
481 | 481 | */ |
482 | - public function column_TXN_paid( EE_Registration $item ) { |
|
483 | - if ( $item->count() === 1 ) { |
|
484 | - if ( $item->transaction()->paid() >= $item->transaction()->total() ) { |
|
482 | + public function column_TXN_paid(EE_Registration $item) { |
|
483 | + if ($item->count() === 1) { |
|
484 | + if ($item->transaction()->paid() >= $item->transaction()->total()) { |
|
485 | 485 | return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>'; |
486 | 486 | } else { |
487 | 487 | $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( |
488 | - array( 'action' => 'view_transaction', 'TXN_ID' => $item->transaction_ID() ), |
|
488 | + array('action' => 'view_transaction', 'TXN_ID' => $item->transaction_ID()), |
|
489 | 489 | TXN_ADMIN_URL |
490 | 490 | ); |
491 | 491 | return EE_Registry::instance()->CAP->current_user_can( |
@@ -498,13 +498,13 @@ discard block |
||
498 | 498 | . '" href="' |
499 | 499 | . $view_txn_lnk_url |
500 | 500 | . '" title="' |
501 | - . esc_attr__( 'View Transaction', 'event_espresso' ) |
|
501 | + . esc_attr__('View Transaction', 'event_espresso') |
|
502 | 502 | . '"> |
503 | 503 | ' |
504 | 504 | . $item->transaction()->pretty_paid() |
505 | 505 | . ' |
506 | 506 | </a> |
507 | - <span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>'; |
|
507 | + <span>' : '<span class="reg-pad-rght">'.$item->transaction()->pretty_paid().'</span>'; |
|
508 | 508 | } |
509 | 509 | } else { |
510 | 510 | return '<span class="reg-pad-rght"></span>'; |
@@ -520,13 +520,13 @@ discard block |
||
520 | 520 | * @return string |
521 | 521 | * @throws \EE_Error |
522 | 522 | */ |
523 | - public function column_TXN_total( EE_Registration $item ) { |
|
523 | + public function column_TXN_total(EE_Registration $item) { |
|
524 | 524 | $txn = $item->transaction(); |
525 | - $view_txn_url = add_query_arg( array( 'action' => 'view_transaction', 'TXN_ID' => $txn->ID() ), TXN_ADMIN_URL ); |
|
526 | - if ( $item->get( 'REG_count' ) === 1 ) { |
|
525 | + $view_txn_url = add_query_arg(array('action' => 'view_transaction', 'TXN_ID' => $txn->ID()), TXN_ADMIN_URL); |
|
526 | + if ($item->get('REG_count') === 1) { |
|
527 | 527 | $line_total_obj = $txn->total_line_item(); |
528 | 528 | $txn_total = $line_total_obj instanceof EE_Line_Item |
529 | - ? $line_total_obj->get_pretty( 'LIN_total' ) |
|
529 | + ? $line_total_obj->get_pretty('LIN_total') |
|
530 | 530 | : __( |
531 | 531 | 'View Transaction', |
532 | 532 | 'event_espresso' |
@@ -537,10 +537,10 @@ discard block |
||
537 | 537 | ) ? '<a href="' |
538 | 538 | . $view_txn_url |
539 | 539 | . '" title="' |
540 | - . esc_attr__( 'View Transaction', 'event_espresso' ) |
|
540 | + . esc_attr__('View Transaction', 'event_espresso') |
|
541 | 541 | . '"><span class="reg-pad-rght">' |
542 | 542 | . $txn_total |
543 | - . '</span></a>' : '<span class="reg-pad-rght">' . $txn_total . '</span>'; |
|
543 | + . '</span></a>' : '<span class="reg-pad-rght">'.$txn_total.'</span>'; |
|
544 | 544 | } else { |
545 | 545 | return '<span class="reg-pad-rght"></span>'; |
546 | 546 | } |