Completed
Branch ADMIN-REFRESH (41ec76)
by
unknown
03:25 queued 28s
created
admin/extend/registrations/Extend_Registrations_Admin_Page.core.php 2 patches
Indentation   +1228 added lines, -1228 removed lines patch added patch discarded remove patch
@@ -16,1286 +16,1286 @@
 block discarded – undo
16 16
 {
17 17
 
18 18
 
19
-    /**
20
-     * This is used to hold the reports template data which is setup early in the request.
21
-     *
22
-     * @type array
23
-     */
24
-    protected $_reports_template_data = array();
19
+	/**
20
+	 * This is used to hold the reports template data which is setup early in the request.
21
+	 *
22
+	 * @type array
23
+	 */
24
+	protected $_reports_template_data = array();
25 25
 
26 26
 
27
-    /**
28
-     * Extend_Registrations_Admin_Page constructor.
29
-     *
30
-     * @param bool $routing
31
-     */
32
-    public function __construct($routing = true)
33
-    {
34
-        parent::__construct($routing);
35
-        if (! defined('REG_CAF_TEMPLATE_PATH')) {
36
-            define('REG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/templates/');
37
-            define('REG_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/assets/');
38
-            define('REG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'registrations/assets/');
39
-        }
40
-    }
27
+	/**
28
+	 * Extend_Registrations_Admin_Page constructor.
29
+	 *
30
+	 * @param bool $routing
31
+	 */
32
+	public function __construct($routing = true)
33
+	{
34
+		parent::__construct($routing);
35
+		if (! defined('REG_CAF_TEMPLATE_PATH')) {
36
+			define('REG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/templates/');
37
+			define('REG_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/assets/');
38
+			define('REG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'registrations/assets/');
39
+		}
40
+	}
41 41
 
42 42
 
43
-    /**
44
-     * Extending page configuration.
45
-     */
46
-    protected function _extend_page_config()
47
-    {
48
-        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'registrations';
49
-        $reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID'])
50
-            ? $this->_req_data['_REG_ID']
51
-            : 0;
52
-        $new_page_routes = array(
53
-            'reports'                      => array(
54
-                'func'       => '_registration_reports',
55
-                'capability' => 'ee_read_registrations',
56
-            ),
57
-            'registration_checkins'        => array(
58
-                'func'       => '_registration_checkin_list_table',
59
-                'capability' => 'ee_read_checkins',
60
-            ),
61
-            'newsletter_selected_send'     => array(
62
-                'func'       => '_newsletter_selected_send',
63
-                'noheader'   => true,
64
-                'capability' => 'ee_send_message',
65
-            ),
66
-            'delete_checkin_rows'          => array(
67
-                'func'       => '_delete_checkin_rows',
68
-                'noheader'   => true,
69
-                'capability' => 'ee_delete_checkins',
70
-            ),
71
-            'delete_checkin_row'           => array(
72
-                'func'       => '_delete_checkin_row',
73
-                'noheader'   => true,
74
-                'capability' => 'ee_delete_checkin',
75
-                'obj_id'     => $reg_id,
76
-            ),
77
-            'toggle_checkin_status'        => array(
78
-                'func'       => '_toggle_checkin_status',
79
-                'noheader'   => true,
80
-                'capability' => 'ee_edit_checkin',
81
-                'obj_id'     => $reg_id,
82
-            ),
83
-            'toggle_checkin_status_bulk'   => array(
84
-                'func'       => '_toggle_checkin_status',
85
-                'noheader'   => true,
86
-                'capability' => 'ee_edit_checkins',
87
-            ),
88
-            'event_registrations'          => array(
89
-                'func'       => '_event_registrations_list_table',
90
-                'capability' => 'ee_read_checkins',
91
-            ),
92
-            'registrations_checkin_report' => array(
93
-                'func'       => '_registrations_checkin_report',
94
-                'noheader'   => true,
95
-                'capability' => 'ee_read_registrations',
96
-            ),
97
-        );
98
-        $this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
99
-        $new_page_config = array(
100
-            'reports'               => array(
101
-                'nav'           => array(
102
-                    'label' => esc_html__('Reports', 'event_espresso'),
103
-                    'order' => 30,
104
-                ),
105
-                'help_tabs'     => array(
106
-                    'registrations_reports_help_tab' => array(
107
-                        'title'    => esc_html__('Registration Reports', 'event_espresso'),
108
-                        'filename' => 'registrations_reports',
109
-                    ),
110
-                ),
111
-                'require_nonce' => false,
112
-            ),
113
-            'event_registrations'   => array(
114
-                'nav'           => array(
115
-                    'label'      => esc_html__('Event Check-In', 'event_espresso'),
116
-                    'order'      => 10,
117
-                    'persistent' => true,
118
-                ),
119
-                'help_tabs'     => array(
120
-                    'registrations_event_checkin_help_tab'                       => array(
121
-                        'title'    => esc_html__('Registrations Event Check-In', 'event_espresso'),
122
-                        'filename' => 'registrations_event_checkin',
123
-                    ),
124
-                    'registrations_event_checkin_table_column_headings_help_tab' => array(
125
-                        'title'    => esc_html__('Event Check-In Table Column Headings', 'event_espresso'),
126
-                        'filename' => 'registrations_event_checkin_table_column_headings',
127
-                    ),
128
-                    'registrations_event_checkin_filters_help_tab'               => array(
129
-                        'title'    => esc_html__('Event Check-In Filters', 'event_espresso'),
130
-                        'filename' => 'registrations_event_checkin_filters',
131
-                    ),
132
-                    'registrations_event_checkin_views_help_tab'                 => array(
133
-                        'title'    => esc_html__('Event Check-In Views', 'event_espresso'),
134
-                        'filename' => 'registrations_event_checkin_views',
135
-                    ),
136
-                    'registrations_event_checkin_other_help_tab'                 => array(
137
-                        'title'    => esc_html__('Event Check-In Other', 'event_espresso'),
138
-                        'filename' => 'registrations_event_checkin_other',
139
-                    ),
140
-                ),
141
-                'list_table'    => 'EE_Event_Registrations_List_Table',
142
-                'metaboxes'     => array(),
143
-                'require_nonce' => false,
144
-            ),
145
-            'registration_checkins' => array(
146
-                'nav'           => array(
147
-                    'label'      => esc_html__('Check-In Records', 'event_espresso'),
148
-                    'order'      => 15,
149
-                    'persistent' => false,
150
-                    'url'        => '',
151
-                ),
152
-                'list_table'    => 'EE_Registration_CheckIn_List_Table',
153
-                'metaboxes'     => array(),
154
-                'require_nonce' => false,
155
-            ),
156
-        );
157
-        $this->_page_config = array_merge($this->_page_config, $new_page_config);
158
-        $this->_page_config['contact_list']['list_table'] = 'Extend_EE_Attendee_Contact_List_Table';
159
-        $this->_page_config['default']['list_table'] = 'Extend_EE_Registrations_List_Table';
160
-    }
43
+	/**
44
+	 * Extending page configuration.
45
+	 */
46
+	protected function _extend_page_config()
47
+	{
48
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'registrations';
49
+		$reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID'])
50
+			? $this->_req_data['_REG_ID']
51
+			: 0;
52
+		$new_page_routes = array(
53
+			'reports'                      => array(
54
+				'func'       => '_registration_reports',
55
+				'capability' => 'ee_read_registrations',
56
+			),
57
+			'registration_checkins'        => array(
58
+				'func'       => '_registration_checkin_list_table',
59
+				'capability' => 'ee_read_checkins',
60
+			),
61
+			'newsletter_selected_send'     => array(
62
+				'func'       => '_newsletter_selected_send',
63
+				'noheader'   => true,
64
+				'capability' => 'ee_send_message',
65
+			),
66
+			'delete_checkin_rows'          => array(
67
+				'func'       => '_delete_checkin_rows',
68
+				'noheader'   => true,
69
+				'capability' => 'ee_delete_checkins',
70
+			),
71
+			'delete_checkin_row'           => array(
72
+				'func'       => '_delete_checkin_row',
73
+				'noheader'   => true,
74
+				'capability' => 'ee_delete_checkin',
75
+				'obj_id'     => $reg_id,
76
+			),
77
+			'toggle_checkin_status'        => array(
78
+				'func'       => '_toggle_checkin_status',
79
+				'noheader'   => true,
80
+				'capability' => 'ee_edit_checkin',
81
+				'obj_id'     => $reg_id,
82
+			),
83
+			'toggle_checkin_status_bulk'   => array(
84
+				'func'       => '_toggle_checkin_status',
85
+				'noheader'   => true,
86
+				'capability' => 'ee_edit_checkins',
87
+			),
88
+			'event_registrations'          => array(
89
+				'func'       => '_event_registrations_list_table',
90
+				'capability' => 'ee_read_checkins',
91
+			),
92
+			'registrations_checkin_report' => array(
93
+				'func'       => '_registrations_checkin_report',
94
+				'noheader'   => true,
95
+				'capability' => 'ee_read_registrations',
96
+			),
97
+		);
98
+		$this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
99
+		$new_page_config = array(
100
+			'reports'               => array(
101
+				'nav'           => array(
102
+					'label' => esc_html__('Reports', 'event_espresso'),
103
+					'order' => 30,
104
+				),
105
+				'help_tabs'     => array(
106
+					'registrations_reports_help_tab' => array(
107
+						'title'    => esc_html__('Registration Reports', 'event_espresso'),
108
+						'filename' => 'registrations_reports',
109
+					),
110
+				),
111
+				'require_nonce' => false,
112
+			),
113
+			'event_registrations'   => array(
114
+				'nav'           => array(
115
+					'label'      => esc_html__('Event Check-In', 'event_espresso'),
116
+					'order'      => 10,
117
+					'persistent' => true,
118
+				),
119
+				'help_tabs'     => array(
120
+					'registrations_event_checkin_help_tab'                       => array(
121
+						'title'    => esc_html__('Registrations Event Check-In', 'event_espresso'),
122
+						'filename' => 'registrations_event_checkin',
123
+					),
124
+					'registrations_event_checkin_table_column_headings_help_tab' => array(
125
+						'title'    => esc_html__('Event Check-In Table Column Headings', 'event_espresso'),
126
+						'filename' => 'registrations_event_checkin_table_column_headings',
127
+					),
128
+					'registrations_event_checkin_filters_help_tab'               => array(
129
+						'title'    => esc_html__('Event Check-In Filters', 'event_espresso'),
130
+						'filename' => 'registrations_event_checkin_filters',
131
+					),
132
+					'registrations_event_checkin_views_help_tab'                 => array(
133
+						'title'    => esc_html__('Event Check-In Views', 'event_espresso'),
134
+						'filename' => 'registrations_event_checkin_views',
135
+					),
136
+					'registrations_event_checkin_other_help_tab'                 => array(
137
+						'title'    => esc_html__('Event Check-In Other', 'event_espresso'),
138
+						'filename' => 'registrations_event_checkin_other',
139
+					),
140
+				),
141
+				'list_table'    => 'EE_Event_Registrations_List_Table',
142
+				'metaboxes'     => array(),
143
+				'require_nonce' => false,
144
+			),
145
+			'registration_checkins' => array(
146
+				'nav'           => array(
147
+					'label'      => esc_html__('Check-In Records', 'event_espresso'),
148
+					'order'      => 15,
149
+					'persistent' => false,
150
+					'url'        => '',
151
+				),
152
+				'list_table'    => 'EE_Registration_CheckIn_List_Table',
153
+				'metaboxes'     => array(),
154
+				'require_nonce' => false,
155
+			),
156
+		);
157
+		$this->_page_config = array_merge($this->_page_config, $new_page_config);
158
+		$this->_page_config['contact_list']['list_table'] = 'Extend_EE_Attendee_Contact_List_Table';
159
+		$this->_page_config['default']['list_table'] = 'Extend_EE_Registrations_List_Table';
160
+	}
161 161
 
162 162
 
163
-    /**
164
-     * Ajax hooks for all routes in this page.
165
-     */
166
-    protected function _ajax_hooks()
167
-    {
168
-        parent::_ajax_hooks();
169
-        add_action('wp_ajax_get_newsletter_form_content', array($this, 'get_newsletter_form_content'));
170
-    }
163
+	/**
164
+	 * Ajax hooks for all routes in this page.
165
+	 */
166
+	protected function _ajax_hooks()
167
+	{
168
+		parent::_ajax_hooks();
169
+		add_action('wp_ajax_get_newsletter_form_content', array($this, 'get_newsletter_form_content'));
170
+	}
171 171
 
172 172
 
173
-    /**
174
-     * Global scripts for all routes in this page.
175
-     */
176
-    public function load_scripts_styles()
177
-    {
178
-        parent::load_scripts_styles();
179
-        // if newsletter message type is active then let's add filter and load js for it.
180
-        if (EEH_MSG_Template::is_mt_active('newsletter')) {
181
-            // enqueue newsletter js
182
-            wp_enqueue_script(
183
-                'ee-newsletter-trigger',
184
-                REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.js',
185
-                array('ee-dialog'),
186
-                EVENT_ESPRESSO_VERSION,
187
-                true
188
-            );
189
-            wp_enqueue_style(
190
-                'ee-newsletter-trigger-css',
191
-                REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.css',
192
-                array(),
193
-                EVENT_ESPRESSO_VERSION
194
-            );
195
-            // hook in buttons for newsletter message type trigger.
196
-            add_action(
197
-                'AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons',
198
-                array($this, 'add_newsletter_action_buttons'),
199
-                10
200
-            );
201
-        }
202
-    }
173
+	/**
174
+	 * Global scripts for all routes in this page.
175
+	 */
176
+	public function load_scripts_styles()
177
+	{
178
+		parent::load_scripts_styles();
179
+		// if newsletter message type is active then let's add filter and load js for it.
180
+		if (EEH_MSG_Template::is_mt_active('newsletter')) {
181
+			// enqueue newsletter js
182
+			wp_enqueue_script(
183
+				'ee-newsletter-trigger',
184
+				REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.js',
185
+				array('ee-dialog'),
186
+				EVENT_ESPRESSO_VERSION,
187
+				true
188
+			);
189
+			wp_enqueue_style(
190
+				'ee-newsletter-trigger-css',
191
+				REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.css',
192
+				array(),
193
+				EVENT_ESPRESSO_VERSION
194
+			);
195
+			// hook in buttons for newsletter message type trigger.
196
+			add_action(
197
+				'AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons',
198
+				array($this, 'add_newsletter_action_buttons'),
199
+				10
200
+			);
201
+		}
202
+	}
203 203
 
204 204
 
205
-    /**
206
-     * Scripts and styles for just the reports route.
207
-     */
208
-    public function load_scripts_styles_reports()
209
-    {
210
-        wp_register_script(
211
-            'ee-reg-reports-js',
212
-            REG_CAF_ASSETS_URL . 'ee-registration-admin-reports.js',
213
-            array('google-charts'),
214
-            EVENT_ESPRESSO_VERSION,
215
-            true
216
-        );
217
-        wp_enqueue_script('ee-reg-reports-js');
218
-        $this->_registration_reports_js_setup();
219
-    }
205
+	/**
206
+	 * Scripts and styles for just the reports route.
207
+	 */
208
+	public function load_scripts_styles_reports()
209
+	{
210
+		wp_register_script(
211
+			'ee-reg-reports-js',
212
+			REG_CAF_ASSETS_URL . 'ee-registration-admin-reports.js',
213
+			array('google-charts'),
214
+			EVENT_ESPRESSO_VERSION,
215
+			true
216
+		);
217
+		wp_enqueue_script('ee-reg-reports-js');
218
+		$this->_registration_reports_js_setup();
219
+	}
220 220
 
221 221
 
222
-    /**
223
-     * Register screen options for event_registrations route.
224
-     */
225
-    protected function _add_screen_options_event_registrations()
226
-    {
227
-        $this->_per_page_screen_option();
228
-    }
222
+	/**
223
+	 * Register screen options for event_registrations route.
224
+	 */
225
+	protected function _add_screen_options_event_registrations()
226
+	{
227
+		$this->_per_page_screen_option();
228
+	}
229 229
 
230 230
 
231
-    /**
232
-     * Register screen options for registration_checkins route
233
-     */
234
-    protected function _add_screen_options_registration_checkins()
235
-    {
236
-        $page_title = $this->_admin_page_title;
237
-        $this->_admin_page_title = esc_html__('Check-In Records', 'event_espresso');
238
-        $this->_per_page_screen_option();
239
-        $this->_admin_page_title = $page_title;
240
-    }
231
+	/**
232
+	 * Register screen options for registration_checkins route
233
+	 */
234
+	protected function _add_screen_options_registration_checkins()
235
+	{
236
+		$page_title = $this->_admin_page_title;
237
+		$this->_admin_page_title = esc_html__('Check-In Records', 'event_espresso');
238
+		$this->_per_page_screen_option();
239
+		$this->_admin_page_title = $page_title;
240
+	}
241 241
 
242 242
 
243
-    /**
244
-     * Set views property for event_registrations route.
245
-     */
246
-    protected function _set_list_table_views_event_registrations()
247
-    {
248
-        $this->_views = array(
249
-            'all' => array(
250
-                'slug'        => 'all',
251
-                'label'       => esc_html__('All', 'event_espresso'),
252
-                'count'       => 0,
253
-                'bulk_action' => ! isset($this->_req_data['event_id'])
254
-                    ? array()
255
-                    : array(
256
-                        'toggle_checkin_status_bulk' => esc_html__('Toggle Check-In', 'event_espresso'),
257
-                    ),
258
-            ),
259
-        );
260
-    }
243
+	/**
244
+	 * Set views property for event_registrations route.
245
+	 */
246
+	protected function _set_list_table_views_event_registrations()
247
+	{
248
+		$this->_views = array(
249
+			'all' => array(
250
+				'slug'        => 'all',
251
+				'label'       => esc_html__('All', 'event_espresso'),
252
+				'count'       => 0,
253
+				'bulk_action' => ! isset($this->_req_data['event_id'])
254
+					? array()
255
+					: array(
256
+						'toggle_checkin_status_bulk' => esc_html__('Toggle Check-In', 'event_espresso'),
257
+					),
258
+			),
259
+		);
260
+	}
261 261
 
262 262
 
263
-    /**
264
-     * Set views property for registration_checkins route.
265
-     */
266
-    protected function _set_list_table_views_registration_checkins()
267
-    {
268
-        $this->_views = array(
269
-            'all' => array(
270
-                'slug'        => 'all',
271
-                'label'       => esc_html__('All', 'event_espresso'),
272
-                'count'       => 0,
273
-                'bulk_action' => array('delete_checkin_rows' => esc_html__('Delete Check-In Rows', 'event_espresso')),
274
-            ),
275
-        );
276
-    }
263
+	/**
264
+	 * Set views property for registration_checkins route.
265
+	 */
266
+	protected function _set_list_table_views_registration_checkins()
267
+	{
268
+		$this->_views = array(
269
+			'all' => array(
270
+				'slug'        => 'all',
271
+				'label'       => esc_html__('All', 'event_espresso'),
272
+				'count'       => 0,
273
+				'bulk_action' => array('delete_checkin_rows' => esc_html__('Delete Check-In Rows', 'event_espresso')),
274
+			),
275
+		);
276
+	}
277 277
 
278 278
 
279
-    /**
280
-     * callback for ajax action.
281
-     *
282
-     * @since 4.3.0
283
-     * @return void (JSON)
284
-     * @throws EE_Error
285
-     * @throws InvalidArgumentException
286
-     * @throws InvalidDataTypeException
287
-     * @throws InvalidInterfaceException
288
-     */
289
-    public function get_newsletter_form_content()
290
-    {
291
-        // do a nonce check cause we're not coming in from an normal route here.
292
-        $nonce = isset($this->_req_data['get_newsletter_form_content_nonce']) ? sanitize_text_field(
293
-            $this->_req_data['get_newsletter_form_content_nonce']
294
-        ) : '';
295
-        $nonce_ref = 'get_newsletter_form_content_nonce';
296
-        $this->_verify_nonce($nonce, $nonce_ref);
297
-        // let's get the mtp for the incoming MTP_ ID
298
-        if (! isset($this->_req_data['GRP_ID'])) {
299
-            EE_Error::add_error(
300
-                esc_html__(
301
-                    'There must be something broken with the js or html structure because the required data for getting a message template group is not present (need an GRP_ID).',
302
-                    'event_espresso'
303
-                ),
304
-                __FILE__,
305
-                __FUNCTION__,
306
-                __LINE__
307
-            );
308
-            $this->_template_args['success'] = false;
309
-            $this->_template_args['error'] = true;
310
-            $this->_return_json();
311
-        }
312
-        $MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID($this->_req_data['GRP_ID']);
313
-        if (! $MTPG instanceof EE_Message_Template_Group) {
314
-            EE_Error::add_error(
315
-                sprintf(
316
-                    esc_html__(
317
-                        'The GRP_ID given (%d) does not appear to have a corresponding row in the database.',
318
-                        'event_espresso'
319
-                    ),
320
-                    $this->_req_data['GRP_ID']
321
-                ),
322
-                __FILE__,
323
-                __FUNCTION__,
324
-                __LINE__
325
-            );
326
-            $this->_template_args['success'] = false;
327
-            $this->_template_args['error'] = true;
328
-            $this->_return_json();
329
-        }
330
-        $MTPs = $MTPG->context_templates();
331
-        $MTPs = $MTPs['attendee'];
332
-        $template_fields = array();
333
-        /** @var EE_Message_Template $MTP */
334
-        foreach ($MTPs as $MTP) {
335
-            $field = $MTP->get('MTP_template_field');
336
-            if ($field === 'content') {
337
-                $content = $MTP->get('MTP_content');
338
-                if (! empty($content['newsletter_content'])) {
339
-                    $template_fields['newsletter_content'] = $content['newsletter_content'];
340
-                }
341
-                continue;
342
-            }
343
-            $template_fields[ $MTP->get('MTP_template_field') ] = $MTP->get('MTP_content');
344
-        }
345
-        $this->_template_args['success'] = true;
346
-        $this->_template_args['error'] = false;
347
-        $this->_template_args['data'] = array(
348
-            'batch_message_from'    => isset($template_fields['from'])
349
-                ? $template_fields['from']
350
-                : '',
351
-            'batch_message_subject' => isset($template_fields['subject'])
352
-                ? $template_fields['subject']
353
-                : '',
354
-            'batch_message_content' => isset($template_fields['newsletter_content'])
355
-                ? $template_fields['newsletter_content']
356
-                : '',
357
-        );
358
-        $this->_return_json();
359
-    }
279
+	/**
280
+	 * callback for ajax action.
281
+	 *
282
+	 * @since 4.3.0
283
+	 * @return void (JSON)
284
+	 * @throws EE_Error
285
+	 * @throws InvalidArgumentException
286
+	 * @throws InvalidDataTypeException
287
+	 * @throws InvalidInterfaceException
288
+	 */
289
+	public function get_newsletter_form_content()
290
+	{
291
+		// do a nonce check cause we're not coming in from an normal route here.
292
+		$nonce = isset($this->_req_data['get_newsletter_form_content_nonce']) ? sanitize_text_field(
293
+			$this->_req_data['get_newsletter_form_content_nonce']
294
+		) : '';
295
+		$nonce_ref = 'get_newsletter_form_content_nonce';
296
+		$this->_verify_nonce($nonce, $nonce_ref);
297
+		// let's get the mtp for the incoming MTP_ ID
298
+		if (! isset($this->_req_data['GRP_ID'])) {
299
+			EE_Error::add_error(
300
+				esc_html__(
301
+					'There must be something broken with the js or html structure because the required data for getting a message template group is not present (need an GRP_ID).',
302
+					'event_espresso'
303
+				),
304
+				__FILE__,
305
+				__FUNCTION__,
306
+				__LINE__
307
+			);
308
+			$this->_template_args['success'] = false;
309
+			$this->_template_args['error'] = true;
310
+			$this->_return_json();
311
+		}
312
+		$MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID($this->_req_data['GRP_ID']);
313
+		if (! $MTPG instanceof EE_Message_Template_Group) {
314
+			EE_Error::add_error(
315
+				sprintf(
316
+					esc_html__(
317
+						'The GRP_ID given (%d) does not appear to have a corresponding row in the database.',
318
+						'event_espresso'
319
+					),
320
+					$this->_req_data['GRP_ID']
321
+				),
322
+				__FILE__,
323
+				__FUNCTION__,
324
+				__LINE__
325
+			);
326
+			$this->_template_args['success'] = false;
327
+			$this->_template_args['error'] = true;
328
+			$this->_return_json();
329
+		}
330
+		$MTPs = $MTPG->context_templates();
331
+		$MTPs = $MTPs['attendee'];
332
+		$template_fields = array();
333
+		/** @var EE_Message_Template $MTP */
334
+		foreach ($MTPs as $MTP) {
335
+			$field = $MTP->get('MTP_template_field');
336
+			if ($field === 'content') {
337
+				$content = $MTP->get('MTP_content');
338
+				if (! empty($content['newsletter_content'])) {
339
+					$template_fields['newsletter_content'] = $content['newsletter_content'];
340
+				}
341
+				continue;
342
+			}
343
+			$template_fields[ $MTP->get('MTP_template_field') ] = $MTP->get('MTP_content');
344
+		}
345
+		$this->_template_args['success'] = true;
346
+		$this->_template_args['error'] = false;
347
+		$this->_template_args['data'] = array(
348
+			'batch_message_from'    => isset($template_fields['from'])
349
+				? $template_fields['from']
350
+				: '',
351
+			'batch_message_subject' => isset($template_fields['subject'])
352
+				? $template_fields['subject']
353
+				: '',
354
+			'batch_message_content' => isset($template_fields['newsletter_content'])
355
+				? $template_fields['newsletter_content']
356
+				: '',
357
+		);
358
+		$this->_return_json();
359
+	}
360 360
 
361 361
 
362
-    /**
363
-     * callback for AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons action
364
-     *
365
-     * @since 4.3.0
366
-     * @param EE_Admin_List_Table $list_table
367
-     * @return void
368
-     * @throws InvalidArgumentException
369
-     * @throws InvalidDataTypeException
370
-     * @throws InvalidInterfaceException
371
-     */
372
-    public function add_newsletter_action_buttons(EE_Admin_List_Table $list_table)
373
-    {
374
-        if (
375
-            ! EE_Registry::instance()->CAP->current_user_can(
376
-                'ee_send_message',
377
-                'espresso_registrations_newsletter_selected_send'
378
-            )
379
-        ) {
380
-            return;
381
-        }
382
-        $routes_to_add_to = array(
383
-            'contact_list',
384
-            'event_registrations',
385
-            'default',
386
-        );
387
-        if ($this->_current_page === 'espresso_registrations' && in_array($this->_req_action, $routes_to_add_to)) {
388
-            if (
389
-                ($this->_req_action === 'event_registrations' && empty($this->_req_data['event_id']))
390
-                || (isset($this->_req_data['status']) && $this->_req_data['status'] === 'trash')
391
-            ) {
392
-                echo '';
393
-            } else {
394
-                $button_text = sprintf(
395
-                    esc_html__('Send Batch Message (%s selected)', 'event_espresso'),
396
-                    '<span class="send-selected-newsletter-count">0</span>'
397
-                );
398
-                echo '<button id="selected-batch-send-trigger" class="button button--secondary">'
399
-                     . '<span class="dashicons dashicons-email "></span>'
400
-                     . $button_text
401
-                     . '</button>';
402
-                add_action('admin_footer', array($this, 'newsletter_send_form_skeleton'));
403
-            }
404
-        }
405
-    }
362
+	/**
363
+	 * callback for AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons action
364
+	 *
365
+	 * @since 4.3.0
366
+	 * @param EE_Admin_List_Table $list_table
367
+	 * @return void
368
+	 * @throws InvalidArgumentException
369
+	 * @throws InvalidDataTypeException
370
+	 * @throws InvalidInterfaceException
371
+	 */
372
+	public function add_newsletter_action_buttons(EE_Admin_List_Table $list_table)
373
+	{
374
+		if (
375
+			! EE_Registry::instance()->CAP->current_user_can(
376
+				'ee_send_message',
377
+				'espresso_registrations_newsletter_selected_send'
378
+			)
379
+		) {
380
+			return;
381
+		}
382
+		$routes_to_add_to = array(
383
+			'contact_list',
384
+			'event_registrations',
385
+			'default',
386
+		);
387
+		if ($this->_current_page === 'espresso_registrations' && in_array($this->_req_action, $routes_to_add_to)) {
388
+			if (
389
+				($this->_req_action === 'event_registrations' && empty($this->_req_data['event_id']))
390
+				|| (isset($this->_req_data['status']) && $this->_req_data['status'] === 'trash')
391
+			) {
392
+				echo '';
393
+			} else {
394
+				$button_text = sprintf(
395
+					esc_html__('Send Batch Message (%s selected)', 'event_espresso'),
396
+					'<span class="send-selected-newsletter-count">0</span>'
397
+				);
398
+				echo '<button id="selected-batch-send-trigger" class="button button--secondary">'
399
+					 . '<span class="dashicons dashicons-email "></span>'
400
+					 . $button_text
401
+					 . '</button>';
402
+				add_action('admin_footer', array($this, 'newsletter_send_form_skeleton'));
403
+			}
404
+		}
405
+	}
406 406
 
407 407
 
408
-    /**
409
-     * @throws DomainException
410
-     * @throws EE_Error
411
-     * @throws InvalidArgumentException
412
-     * @throws InvalidDataTypeException
413
-     * @throws InvalidInterfaceException
414
-     */
415
-    public function newsletter_send_form_skeleton()
416
-    {
417
-        $list_table = $this->_list_table_object;
418
-        $codes = array();
419
-        // need to templates for the newsletter message type for the template selector.
420
-        $values[] = array('text' => esc_html__('Select Template to Use', 'event_espresso'), 'id' => 0);
421
-        $mtps = EEM_Message_Template_Group::instance()->get_all(
422
-            array(array('MTP_message_type' => 'newsletter', 'MTP_messenger' => 'email'))
423
-        );
424
-        foreach ($mtps as $mtp) {
425
-            $name = $mtp->name();
426
-            $values[] = array(
427
-                'text' => empty($name) ? esc_html__('Global', 'event_espresso') : $name,
428
-                'id'   => $mtp->ID(),
429
-            );
430
-        }
431
-        // need to get a list of shortcodes that are available for the newsletter message type.
432
-        $shortcodes = EEH_MSG_Template::get_shortcodes(
433
-            'newsletter',
434
-            'email',
435
-            array(),
436
-            'attendee',
437
-            false
438
-        );
439
-        foreach ($shortcodes as $field => $shortcode_array) {
440
-            $available_shortcodes = array();
441
-            foreach ($shortcode_array as $shortcode => $shortcode_details) {
442
-                $field_id = $field === '[NEWSLETTER_CONTENT]'
443
-                    ? 'content'
444
-                    : $field;
445
-                $field_id = 'batch-message-' . strtolower($field_id);
446
-                $available_shortcodes[] = '<span class="js-shortcode-selection" data-value="'
447
-                                          . $shortcode
448
-                                          . '" data-linked-input-id="' . $field_id . '">'
449
-                                          . $shortcode
450
-                                          . '</span>';
451
-            }
452
-            $codes[ $field ] = implode(', ', $available_shortcodes);
453
-        }
454
-        $shortcodes = $codes;
455
-        $form_template = REG_CAF_TEMPLATE_PATH . 'newsletter-send-form.template.php';
456
-        $form_template_args = array(
457
-            'form_action'       => admin_url('admin.php?page=espresso_registrations'),
458
-            'form_route'        => 'newsletter_selected_send',
459
-            'form_nonce_name'   => 'newsletter_selected_send_nonce',
460
-            'form_nonce'        => wp_create_nonce('newsletter_selected_send_nonce'),
461
-            'redirect_back_to'  => $this->_req_action,
462
-            'ajax_nonce'        => wp_create_nonce('get_newsletter_form_content_nonce'),
463
-            'template_selector' => EEH_Form_Fields::select_input('newsletter_mtp_selected', $values),
464
-            'shortcodes'        => $shortcodes,
465
-            'id_type'           => $list_table instanceof EE_Attendee_Contact_List_Table ? 'contact' : 'registration',
466
-        );
467
-        EEH_Template::display_template($form_template, $form_template_args);
468
-    }
408
+	/**
409
+	 * @throws DomainException
410
+	 * @throws EE_Error
411
+	 * @throws InvalidArgumentException
412
+	 * @throws InvalidDataTypeException
413
+	 * @throws InvalidInterfaceException
414
+	 */
415
+	public function newsletter_send_form_skeleton()
416
+	{
417
+		$list_table = $this->_list_table_object;
418
+		$codes = array();
419
+		// need to templates for the newsletter message type for the template selector.
420
+		$values[] = array('text' => esc_html__('Select Template to Use', 'event_espresso'), 'id' => 0);
421
+		$mtps = EEM_Message_Template_Group::instance()->get_all(
422
+			array(array('MTP_message_type' => 'newsletter', 'MTP_messenger' => 'email'))
423
+		);
424
+		foreach ($mtps as $mtp) {
425
+			$name = $mtp->name();
426
+			$values[] = array(
427
+				'text' => empty($name) ? esc_html__('Global', 'event_espresso') : $name,
428
+				'id'   => $mtp->ID(),
429
+			);
430
+		}
431
+		// need to get a list of shortcodes that are available for the newsletter message type.
432
+		$shortcodes = EEH_MSG_Template::get_shortcodes(
433
+			'newsletter',
434
+			'email',
435
+			array(),
436
+			'attendee',
437
+			false
438
+		);
439
+		foreach ($shortcodes as $field => $shortcode_array) {
440
+			$available_shortcodes = array();
441
+			foreach ($shortcode_array as $shortcode => $shortcode_details) {
442
+				$field_id = $field === '[NEWSLETTER_CONTENT]'
443
+					? 'content'
444
+					: $field;
445
+				$field_id = 'batch-message-' . strtolower($field_id);
446
+				$available_shortcodes[] = '<span class="js-shortcode-selection" data-value="'
447
+										  . $shortcode
448
+										  . '" data-linked-input-id="' . $field_id . '">'
449
+										  . $shortcode
450
+										  . '</span>';
451
+			}
452
+			$codes[ $field ] = implode(', ', $available_shortcodes);
453
+		}
454
+		$shortcodes = $codes;
455
+		$form_template = REG_CAF_TEMPLATE_PATH . 'newsletter-send-form.template.php';
456
+		$form_template_args = array(
457
+			'form_action'       => admin_url('admin.php?page=espresso_registrations'),
458
+			'form_route'        => 'newsletter_selected_send',
459
+			'form_nonce_name'   => 'newsletter_selected_send_nonce',
460
+			'form_nonce'        => wp_create_nonce('newsletter_selected_send_nonce'),
461
+			'redirect_back_to'  => $this->_req_action,
462
+			'ajax_nonce'        => wp_create_nonce('get_newsletter_form_content_nonce'),
463
+			'template_selector' => EEH_Form_Fields::select_input('newsletter_mtp_selected', $values),
464
+			'shortcodes'        => $shortcodes,
465
+			'id_type'           => $list_table instanceof EE_Attendee_Contact_List_Table ? 'contact' : 'registration',
466
+		);
467
+		EEH_Template::display_template($form_template, $form_template_args);
468
+	}
469 469
 
470 470
 
471
-    /**
472
-     * Handles sending selected registrations/contacts a newsletter.
473
-     *
474
-     * @since  4.3.0
475
-     * @return void
476
-     * @throws EE_Error
477
-     * @throws InvalidArgumentException
478
-     * @throws InvalidDataTypeException
479
-     * @throws InvalidInterfaceException
480
-     */
481
-    protected function _newsletter_selected_send()
482
-    {
483
-        $success = true;
484
-        // first we need to make sure we have a GRP_ID so we know what template we're sending and updating!
485
-        if (empty($this->_req_data['newsletter_mtp_selected'])) {
486
-            EE_Error::add_error(
487
-                esc_html__(
488
-                    'In order to send a message, a Message Template GRP_ID is needed. It was not provided so messages were not sent.',
489
-                    'event_espresso'
490
-                ),
491
-                __FILE__,
492
-                __FUNCTION__,
493
-                __LINE__
494
-            );
495
-            $success = false;
496
-        }
497
-        if ($success) {
498
-            // update Message template in case there are any changes
499
-            $Message_Template_Group = EEM_Message_Template_Group::instance()->get_one_by_ID(
500
-                $this->_req_data['newsletter_mtp_selected']
501
-            );
502
-            $Message_Templates = $Message_Template_Group instanceof EE_Message_Template_Group
503
-                ? $Message_Template_Group->context_templates()
504
-                : array();
505
-            if (empty($Message_Templates)) {
506
-                EE_Error::add_error(
507
-                    esc_html__(
508
-                        'Unable to retrieve message template fields from the db. Messages not sent.',
509
-                        'event_espresso'
510
-                    ),
511
-                    __FILE__,
512
-                    __FUNCTION__,
513
-                    __LINE__
514
-                );
515
-            }
516
-            // let's just update the specific fields
517
-            foreach ($Message_Templates['attendee'] as $Message_Template) {
518
-                if ($Message_Template instanceof EE_Message_Template) {
519
-                    $field = $Message_Template->get('MTP_template_field');
520
-                    $content = $Message_Template->get('MTP_content');
521
-                    $new_content = $content;
522
-                    switch ($field) {
523
-                        case 'from':
524
-                            $new_content = ! empty($this->_req_data['batch_message']['from'])
525
-                                ? $this->_req_data['batch_message']['from']
526
-                                : $content;
527
-                            break;
528
-                        case 'subject':
529
-                            $new_content = ! empty($this->_req_data['batch_message']['subject'])
530
-                                ? $this->_req_data['batch_message']['subject']
531
-                                : $content;
532
-                            break;
533
-                        case 'content':
534
-                            $new_content = $content;
535
-                            $new_content['newsletter_content'] = ! empty($this->_req_data['batch_message']['content'])
536
-                                ? $this->_req_data['batch_message']['content']
537
-                                : $content['newsletter_content'];
538
-                            break;
539
-                        default:
540
-                            // continue the foreach loop, we don't want to set $new_content nor save.
541
-                            continue 2;
542
-                    }
543
-                    $Message_Template->set('MTP_content', $new_content);
544
-                    $Message_Template->save();
545
-                }
546
-            }
547
-            // great fields are updated!  now let's make sure we just have contact objects (EE_Attendee).
548
-            $id_type = ! empty($this->_req_data['batch_message']['id_type'])
549
-                ? $this->_req_data['batch_message']['id_type']
550
-                : 'registration';
551
-            // id_type will affect how we assemble the ids.
552
-            $ids = ! empty($this->_req_data['batch_message']['ids'])
553
-                ? json_decode(stripslashes($this->_req_data['batch_message']['ids']))
554
-                : array();
555
-            $registrations_used_for_contact_data = array();
556
-            // using switch because eventually we'll have other contexts that will be used for generating messages.
557
-            switch ($id_type) {
558
-                case 'registration':
559
-                    $registrations_used_for_contact_data = EEM_Registration::instance()->get_all(
560
-                        array(
561
-                            array(
562
-                                'REG_ID' => array('IN', $ids),
563
-                            ),
564
-                        )
565
-                    );
566
-                    break;
567
-                case 'contact':
568
-                    $registrations_used_for_contact_data = EEM_Registration::instance()
569
-                                                                           ->get_latest_registration_for_each_of_given_contacts(
570
-                                                                               $ids
571
-                                                                           );
572
-                    break;
573
-            }
574
-            do_action_ref_array(
575
-                'AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send__with_registrations',
576
-                array(
577
-                    $registrations_used_for_contact_data,
578
-                    $Message_Template_Group->ID(),
579
-                )
580
-            );
581
-            // kept for backward compat, internally we no longer use this action.
582
-            // @deprecated 4.8.36.rc.002
583
-            $contacts = $id_type === 'registration'
584
-                ? EEM_Attendee::instance()->get_array_of_contacts_from_reg_ids($ids)
585
-                : EEM_Attendee::instance()->get_all(array(array('ATT_ID' => array('in', $ids))));
586
-            do_action_ref_array(
587
-                'AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send',
588
-                array(
589
-                    $contacts,
590
-                    $Message_Template_Group->ID(),
591
-                )
592
-            );
593
-        }
594
-        $query_args = array(
595
-            'action' => ! empty($this->_req_data['redirect_back_to'])
596
-                ? $this->_req_data['redirect_back_to']
597
-                : 'default',
598
-        );
599
-        $this->_redirect_after_action(false, '', '', $query_args, true);
600
-    }
471
+	/**
472
+	 * Handles sending selected registrations/contacts a newsletter.
473
+	 *
474
+	 * @since  4.3.0
475
+	 * @return void
476
+	 * @throws EE_Error
477
+	 * @throws InvalidArgumentException
478
+	 * @throws InvalidDataTypeException
479
+	 * @throws InvalidInterfaceException
480
+	 */
481
+	protected function _newsletter_selected_send()
482
+	{
483
+		$success = true;
484
+		// first we need to make sure we have a GRP_ID so we know what template we're sending and updating!
485
+		if (empty($this->_req_data['newsletter_mtp_selected'])) {
486
+			EE_Error::add_error(
487
+				esc_html__(
488
+					'In order to send a message, a Message Template GRP_ID is needed. It was not provided so messages were not sent.',
489
+					'event_espresso'
490
+				),
491
+				__FILE__,
492
+				__FUNCTION__,
493
+				__LINE__
494
+			);
495
+			$success = false;
496
+		}
497
+		if ($success) {
498
+			// update Message template in case there are any changes
499
+			$Message_Template_Group = EEM_Message_Template_Group::instance()->get_one_by_ID(
500
+				$this->_req_data['newsletter_mtp_selected']
501
+			);
502
+			$Message_Templates = $Message_Template_Group instanceof EE_Message_Template_Group
503
+				? $Message_Template_Group->context_templates()
504
+				: array();
505
+			if (empty($Message_Templates)) {
506
+				EE_Error::add_error(
507
+					esc_html__(
508
+						'Unable to retrieve message template fields from the db. Messages not sent.',
509
+						'event_espresso'
510
+					),
511
+					__FILE__,
512
+					__FUNCTION__,
513
+					__LINE__
514
+				);
515
+			}
516
+			// let's just update the specific fields
517
+			foreach ($Message_Templates['attendee'] as $Message_Template) {
518
+				if ($Message_Template instanceof EE_Message_Template) {
519
+					$field = $Message_Template->get('MTP_template_field');
520
+					$content = $Message_Template->get('MTP_content');
521
+					$new_content = $content;
522
+					switch ($field) {
523
+						case 'from':
524
+							$new_content = ! empty($this->_req_data['batch_message']['from'])
525
+								? $this->_req_data['batch_message']['from']
526
+								: $content;
527
+							break;
528
+						case 'subject':
529
+							$new_content = ! empty($this->_req_data['batch_message']['subject'])
530
+								? $this->_req_data['batch_message']['subject']
531
+								: $content;
532
+							break;
533
+						case 'content':
534
+							$new_content = $content;
535
+							$new_content['newsletter_content'] = ! empty($this->_req_data['batch_message']['content'])
536
+								? $this->_req_data['batch_message']['content']
537
+								: $content['newsletter_content'];
538
+							break;
539
+						default:
540
+							// continue the foreach loop, we don't want to set $new_content nor save.
541
+							continue 2;
542
+					}
543
+					$Message_Template->set('MTP_content', $new_content);
544
+					$Message_Template->save();
545
+				}
546
+			}
547
+			// great fields are updated!  now let's make sure we just have contact objects (EE_Attendee).
548
+			$id_type = ! empty($this->_req_data['batch_message']['id_type'])
549
+				? $this->_req_data['batch_message']['id_type']
550
+				: 'registration';
551
+			// id_type will affect how we assemble the ids.
552
+			$ids = ! empty($this->_req_data['batch_message']['ids'])
553
+				? json_decode(stripslashes($this->_req_data['batch_message']['ids']))
554
+				: array();
555
+			$registrations_used_for_contact_data = array();
556
+			// using switch because eventually we'll have other contexts that will be used for generating messages.
557
+			switch ($id_type) {
558
+				case 'registration':
559
+					$registrations_used_for_contact_data = EEM_Registration::instance()->get_all(
560
+						array(
561
+							array(
562
+								'REG_ID' => array('IN', $ids),
563
+							),
564
+						)
565
+					);
566
+					break;
567
+				case 'contact':
568
+					$registrations_used_for_contact_data = EEM_Registration::instance()
569
+																		   ->get_latest_registration_for_each_of_given_contacts(
570
+																			   $ids
571
+																		   );
572
+					break;
573
+			}
574
+			do_action_ref_array(
575
+				'AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send__with_registrations',
576
+				array(
577
+					$registrations_used_for_contact_data,
578
+					$Message_Template_Group->ID(),
579
+				)
580
+			);
581
+			// kept for backward compat, internally we no longer use this action.
582
+			// @deprecated 4.8.36.rc.002
583
+			$contacts = $id_type === 'registration'
584
+				? EEM_Attendee::instance()->get_array_of_contacts_from_reg_ids($ids)
585
+				: EEM_Attendee::instance()->get_all(array(array('ATT_ID' => array('in', $ids))));
586
+			do_action_ref_array(
587
+				'AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send',
588
+				array(
589
+					$contacts,
590
+					$Message_Template_Group->ID(),
591
+				)
592
+			);
593
+		}
594
+		$query_args = array(
595
+			'action' => ! empty($this->_req_data['redirect_back_to'])
596
+				? $this->_req_data['redirect_back_to']
597
+				: 'default',
598
+		);
599
+		$this->_redirect_after_action(false, '', '', $query_args, true);
600
+	}
601 601
 
602 602
 
603
-    /**
604
-     * This is called when javascript is being enqueued to setup the various data needed for the reports js.
605
-     * Also $this->{$_reports_template_data} property is set for later usage by the _registration_reports method.
606
-     */
607
-    protected function _registration_reports_js_setup()
608
-    {
609
-        $this->_reports_template_data['admin_reports'][] = $this->_registrations_per_day_report();
610
-        $this->_reports_template_data['admin_reports'][] = $this->_registrations_per_event_report();
611
-    }
603
+	/**
604
+	 * This is called when javascript is being enqueued to setup the various data needed for the reports js.
605
+	 * Also $this->{$_reports_template_data} property is set for later usage by the _registration_reports method.
606
+	 */
607
+	protected function _registration_reports_js_setup()
608
+	{
609
+		$this->_reports_template_data['admin_reports'][] = $this->_registrations_per_day_report();
610
+		$this->_reports_template_data['admin_reports'][] = $this->_registrations_per_event_report();
611
+	}
612 612
 
613 613
 
614
-    /**
615
-     *        generates Business Reports regarding Registrations
616
-     *
617
-     * @access protected
618
-     * @return void
619
-     * @throws DomainException
620
-     */
621
-    protected function _registration_reports()
622
-    {
623
-        $template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php';
624
-        $this->_template_args['admin_page_content'] = EEH_Template::display_template(
625
-            $template_path,
626
-            $this->_reports_template_data,
627
-            true
628
-        );
629
-        // the final template wrapper
630
-        $this->display_admin_page_with_no_sidebar();
631
-    }
614
+	/**
615
+	 *        generates Business Reports regarding Registrations
616
+	 *
617
+	 * @access protected
618
+	 * @return void
619
+	 * @throws DomainException
620
+	 */
621
+	protected function _registration_reports()
622
+	{
623
+		$template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php';
624
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(
625
+			$template_path,
626
+			$this->_reports_template_data,
627
+			true
628
+		);
629
+		// the final template wrapper
630
+		$this->display_admin_page_with_no_sidebar();
631
+	}
632 632
 
633 633
 
634
-    /**
635
-     * Generates Business Report showing total registrations per day.
636
-     *
637
-     * @param string $period The period (acceptable by PHP Datetime constructor) for which the report is generated.
638
-     * @return string
639
-     * @throws EE_Error
640
-     * @throws InvalidArgumentException
641
-     * @throws InvalidDataTypeException
642
-     * @throws InvalidInterfaceException
643
-     */
644
-    private function _registrations_per_day_report($period = '-1 month')
645
-    {
646
-        $report_ID = 'reg-admin-registrations-per-day-report-dv';
647
-        $results = EEM_Registration::instance()->get_registrations_per_day_and_per_status_report($period);
648
-        $results = (array) $results;
649
-        $regs = array();
650
-        $subtitle = '';
651
-        if ($results) {
652
-            $column_titles = array();
653
-            $tracker = 0;
654
-            foreach ($results as $result) {
655
-                $report_column_values = array();
656
-                foreach ($result as $property_name => $property_value) {
657
-                    $property_value = $property_name === 'Registration_REG_date' ? $property_value
658
-                        : (int) $property_value;
659
-                    $report_column_values[] = $property_value;
660
-                    if ($tracker === 0) {
661
-                        if ($property_name === 'Registration_REG_date') {
662
-                            $column_titles[] = esc_html__(
663
-                                'Date (only days with registrations are shown)',
664
-                                'event_espresso'
665
-                            );
666
-                        } else {
667
-                            $column_titles[] = EEH_Template::pretty_status($property_name, false, 'sentence');
668
-                        }
669
-                    }
670
-                }
671
-                $tracker++;
672
-                $regs[] = $report_column_values;
673
-            }
674
-            // make sure the column_titles is pushed to the beginning of the array
675
-            array_unshift($regs, $column_titles);
676
-            // setup the date range.
677
-            $DateTimeZone = new DateTimeZone(EEH_DTT_Helper::get_timezone());
678
-            $beginning_date = new DateTime("now " . $period, $DateTimeZone);
679
-            $ending_date = new DateTime("now", $DateTimeZone);
680
-            $subtitle = sprintf(
681
-                wp_strip_all_tags(
682
-                    _x('For the period: %1$s to %2$s', 'Used to give date range', 'event_espresso')
683
-                ),
684
-                $beginning_date->format('Y-m-d'),
685
-                $ending_date->format('Y-m-d')
686
-            );
687
-        }
688
-        $report_title = wp_strip_all_tags(__('Total Registrations per Day', 'event_espresso'));
689
-        $report_params = array(
690
-            'title'     => $report_title,
691
-            'subtitle'  => $subtitle,
692
-            'id'        => $report_ID,
693
-            'regs'      => $regs,
694
-            'noResults' => empty($regs),
695
-            'noRegsMsg' => sprintf(
696
-                wp_strip_all_tags(
697
-                    __(
698
-                        '%sThere are currently no registration records in the last month for this report.%s',
699
-                        'event_espresso'
700
-                    )
701
-                ),
702
-                '<h2>' . $report_title . '</h2><p>',
703
-                '</p>'
704
-            ),
705
-        );
706
-        wp_localize_script('ee-reg-reports-js', 'regPerDay', $report_params);
707
-        return $report_ID;
708
-    }
634
+	/**
635
+	 * Generates Business Report showing total registrations per day.
636
+	 *
637
+	 * @param string $period The period (acceptable by PHP Datetime constructor) for which the report is generated.
638
+	 * @return string
639
+	 * @throws EE_Error
640
+	 * @throws InvalidArgumentException
641
+	 * @throws InvalidDataTypeException
642
+	 * @throws InvalidInterfaceException
643
+	 */
644
+	private function _registrations_per_day_report($period = '-1 month')
645
+	{
646
+		$report_ID = 'reg-admin-registrations-per-day-report-dv';
647
+		$results = EEM_Registration::instance()->get_registrations_per_day_and_per_status_report($period);
648
+		$results = (array) $results;
649
+		$regs = array();
650
+		$subtitle = '';
651
+		if ($results) {
652
+			$column_titles = array();
653
+			$tracker = 0;
654
+			foreach ($results as $result) {
655
+				$report_column_values = array();
656
+				foreach ($result as $property_name => $property_value) {
657
+					$property_value = $property_name === 'Registration_REG_date' ? $property_value
658
+						: (int) $property_value;
659
+					$report_column_values[] = $property_value;
660
+					if ($tracker === 0) {
661
+						if ($property_name === 'Registration_REG_date') {
662
+							$column_titles[] = esc_html__(
663
+								'Date (only days with registrations are shown)',
664
+								'event_espresso'
665
+							);
666
+						} else {
667
+							$column_titles[] = EEH_Template::pretty_status($property_name, false, 'sentence');
668
+						}
669
+					}
670
+				}
671
+				$tracker++;
672
+				$regs[] = $report_column_values;
673
+			}
674
+			// make sure the column_titles is pushed to the beginning of the array
675
+			array_unshift($regs, $column_titles);
676
+			// setup the date range.
677
+			$DateTimeZone = new DateTimeZone(EEH_DTT_Helper::get_timezone());
678
+			$beginning_date = new DateTime("now " . $period, $DateTimeZone);
679
+			$ending_date = new DateTime("now", $DateTimeZone);
680
+			$subtitle = sprintf(
681
+				wp_strip_all_tags(
682
+					_x('For the period: %1$s to %2$s', 'Used to give date range', 'event_espresso')
683
+				),
684
+				$beginning_date->format('Y-m-d'),
685
+				$ending_date->format('Y-m-d')
686
+			);
687
+		}
688
+		$report_title = wp_strip_all_tags(__('Total Registrations per Day', 'event_espresso'));
689
+		$report_params = array(
690
+			'title'     => $report_title,
691
+			'subtitle'  => $subtitle,
692
+			'id'        => $report_ID,
693
+			'regs'      => $regs,
694
+			'noResults' => empty($regs),
695
+			'noRegsMsg' => sprintf(
696
+				wp_strip_all_tags(
697
+					__(
698
+						'%sThere are currently no registration records in the last month for this report.%s',
699
+						'event_espresso'
700
+					)
701
+				),
702
+				'<h2>' . $report_title . '</h2><p>',
703
+				'</p>'
704
+			),
705
+		);
706
+		wp_localize_script('ee-reg-reports-js', 'regPerDay', $report_params);
707
+		return $report_ID;
708
+	}
709 709
 
710 710
 
711
-    /**
712
-     * Generates Business Report showing total registrations per event.
713
-     *
714
-     * @param string $period The period (acceptable by PHP Datetime constructor) for which the report is generated.
715
-     * @return string
716
-     * @throws EE_Error
717
-     * @throws InvalidArgumentException
718
-     * @throws InvalidDataTypeException
719
-     * @throws InvalidInterfaceException
720
-     */
721
-    private function _registrations_per_event_report($period = '-1 month')
722
-    {
723
-        $report_ID = 'reg-admin-registrations-per-event-report-dv';
724
-        $results = EEM_Registration::instance()->get_registrations_per_event_and_per_status_report($period);
725
-        $results = (array) $results;
726
-        $regs = array();
727
-        $subtitle = '';
728
-        if ($results) {
729
-            $column_titles = array();
730
-            $tracker = 0;
731
-            foreach ($results as $result) {
732
-                $report_column_values = array();
733
-                foreach ($result as $property_name => $property_value) {
734
-                    $property_value = $property_name === 'Registration_Event' ? wp_trim_words(
735
-                        $property_value,
736
-                        4,
737
-                        '...'
738
-                    ) : (int) $property_value;
739
-                    $report_column_values[] = $property_value;
740
-                    if ($tracker === 0) {
741
-                        if ($property_name === 'Registration_Event') {
742
-                            $column_titles[] = esc_html__('Event', 'event_espresso');
743
-                        } else {
744
-                            $column_titles[] = EEH_Template::pretty_status($property_name, false, 'sentence');
745
-                        }
746
-                    }
747
-                }
748
-                $tracker++;
749
-                $regs[] = $report_column_values;
750
-            }
751
-            // make sure the column_titles is pushed to the beginning of the array
752
-            array_unshift($regs, $column_titles);
753
-            // setup the date range.
754
-            $DateTimeZone = new DateTimeZone(EEH_DTT_Helper::get_timezone());
755
-            $beginning_date = new DateTime("now " . $period, $DateTimeZone);
756
-            $ending_date = new DateTime("now", $DateTimeZone);
757
-            $subtitle = sprintf(
758
-                wp_strip_all_tags(
759
-                    _x('For the period: %1$s to %2$s', 'Used to give date range', 'event_espresso')
760
-                ),
761
-                $beginning_date->format('Y-m-d'),
762
-                $ending_date->format('Y-m-d')
763
-            );
764
-        }
765
-        $report_title = wp_strip_all_tags(__('Total Registrations per Event', 'event_espresso'));
766
-        $report_params = array(
767
-            'title'     => $report_title,
768
-            'subtitle'  => $subtitle,
769
-            'id'        => $report_ID,
770
-            'regs'      => $regs,
771
-            'noResults' => empty($regs),
772
-            'noRegsMsg' => sprintf(
773
-                wp_strip_all_tags(
774
-                    __(
775
-                        '%sThere are currently no registration records in the last month for this report.%s',
776
-                        'event_espresso'
777
-                    )
778
-                ),
779
-                '<h2>' . $report_title . '</h2><p>',
780
-                '</p>'
781
-            ),
782
-        );
783
-        wp_localize_script('ee-reg-reports-js', 'regPerEvent', $report_params);
784
-        return $report_ID;
785
-    }
711
+	/**
712
+	 * Generates Business Report showing total registrations per event.
713
+	 *
714
+	 * @param string $period The period (acceptable by PHP Datetime constructor) for which the report is generated.
715
+	 * @return string
716
+	 * @throws EE_Error
717
+	 * @throws InvalidArgumentException
718
+	 * @throws InvalidDataTypeException
719
+	 * @throws InvalidInterfaceException
720
+	 */
721
+	private function _registrations_per_event_report($period = '-1 month')
722
+	{
723
+		$report_ID = 'reg-admin-registrations-per-event-report-dv';
724
+		$results = EEM_Registration::instance()->get_registrations_per_event_and_per_status_report($period);
725
+		$results = (array) $results;
726
+		$regs = array();
727
+		$subtitle = '';
728
+		if ($results) {
729
+			$column_titles = array();
730
+			$tracker = 0;
731
+			foreach ($results as $result) {
732
+				$report_column_values = array();
733
+				foreach ($result as $property_name => $property_value) {
734
+					$property_value = $property_name === 'Registration_Event' ? wp_trim_words(
735
+						$property_value,
736
+						4,
737
+						'...'
738
+					) : (int) $property_value;
739
+					$report_column_values[] = $property_value;
740
+					if ($tracker === 0) {
741
+						if ($property_name === 'Registration_Event') {
742
+							$column_titles[] = esc_html__('Event', 'event_espresso');
743
+						} else {
744
+							$column_titles[] = EEH_Template::pretty_status($property_name, false, 'sentence');
745
+						}
746
+					}
747
+				}
748
+				$tracker++;
749
+				$regs[] = $report_column_values;
750
+			}
751
+			// make sure the column_titles is pushed to the beginning of the array
752
+			array_unshift($regs, $column_titles);
753
+			// setup the date range.
754
+			$DateTimeZone = new DateTimeZone(EEH_DTT_Helper::get_timezone());
755
+			$beginning_date = new DateTime("now " . $period, $DateTimeZone);
756
+			$ending_date = new DateTime("now", $DateTimeZone);
757
+			$subtitle = sprintf(
758
+				wp_strip_all_tags(
759
+					_x('For the period: %1$s to %2$s', 'Used to give date range', 'event_espresso')
760
+				),
761
+				$beginning_date->format('Y-m-d'),
762
+				$ending_date->format('Y-m-d')
763
+			);
764
+		}
765
+		$report_title = wp_strip_all_tags(__('Total Registrations per Event', 'event_espresso'));
766
+		$report_params = array(
767
+			'title'     => $report_title,
768
+			'subtitle'  => $subtitle,
769
+			'id'        => $report_ID,
770
+			'regs'      => $regs,
771
+			'noResults' => empty($regs),
772
+			'noRegsMsg' => sprintf(
773
+				wp_strip_all_tags(
774
+					__(
775
+						'%sThere are currently no registration records in the last month for this report.%s',
776
+						'event_espresso'
777
+					)
778
+				),
779
+				'<h2>' . $report_title . '</h2><p>',
780
+				'</p>'
781
+			),
782
+		);
783
+		wp_localize_script('ee-reg-reports-js', 'regPerEvent', $report_params);
784
+		return $report_ID;
785
+	}
786 786
 
787 787
 
788
-    /**
789
-     * generates HTML for the Registration Check-in list table (showing all Check-ins for a specific registration)
790
-     *
791
-     * @access protected
792
-     * @return void
793
-     * @throws EE_Error
794
-     * @throws InvalidArgumentException
795
-     * @throws InvalidDataTypeException
796
-     * @throws InvalidInterfaceException
797
-     * @throws \EventEspresso\core\exceptions\EntityNotFoundException
798
-     */
799
-    protected function _registration_checkin_list_table()
800
-    {
801
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
802
-        $reg_id = isset($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : null;
803
-        /** @var EE_Registration $registration */
804
-        $registration = EEM_Registration::instance()->get_one_by_ID($reg_id);
805
-        if (! $registration instanceof EE_Registration) {
806
-            throw new EE_Error(
807
-                sprintf(
808
-                    esc_html__('An error occurred. There is no registration with ID (%d)', 'event_espresso'),
809
-                    $reg_id
810
-                )
811
-            );
812
-        }
813
-        $attendee = $registration->attendee();
814
-        $this->_admin_page_title .= $this->get_action_link_or_button(
815
-            'new_registration',
816
-            'add-registrant',
817
-            array('event_id' => $registration->event_ID()),
818
-            'add-new-h2'
819
-        );
820
-        $checked_in = new CheckinStatusDashicon(EE_Checkin::status_checked_in);
821
-        $checked_out = new CheckinStatusDashicon(EE_Checkin::status_checked_out);
822
-        $legend_items = array(
823
-            'checkin'  => array(
824
-                'class' => $checked_in->cssClasses(),
825
-                'desc'  => $checked_in->legendLabel(),
826
-            ),
827
-            'checkout' => array(
828
-                'class' => $checked_out->cssClasses(),
829
-                'desc'  => $checked_out->legendLabel(),
830
-            ),
831
-        );
832
-        $this->_template_args['after_list_table'] = $this->_display_legend($legend_items);
833
-        $dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : null;
834
-        /** @var EE_Datetime $datetime */
835
-        $datetime = EEM_Datetime::instance()->get_one_by_ID($dtt_id);
836
-        $datetime_label = '';
837
-        if ($datetime instanceof EE_Datetime) {
838
-            $datetime_label = $datetime->get_dtt_display_name(true);
839
-            $datetime_label .= ! empty($datetime_label)
840
-                ? ' (' . $datetime->get_dtt_display_name() . ')'
841
-                : $datetime->get_dtt_display_name();
842
-        }
843
-        $datetime_link = ! empty($dtt_id) && $registration instanceof EE_Registration
844
-            ? EE_Admin_Page::add_query_args_and_nonce(
845
-                array(
846
-                    'action'   => 'event_registrations',
847
-                    'event_id' => $registration->event_ID(),
848
-                    'DTT_ID'   => $dtt_id,
849
-                ),
850
-                $this->_admin_base_url
851
-            )
852
-            : '';
853
-        $datetime_link = ! empty($datetime_link)
854
-            ? '<a href="' . $datetime_link . '">'
855
-              . '<span id="checkin-dtt">'
856
-              . $datetime_label
857
-              . '</span></a>'
858
-            : $datetime_label;
859
-        $attendee_name = $attendee instanceof EE_Attendee
860
-            ? $attendee->full_name()
861
-            : '';
862
-        $attendee_link = $attendee instanceof EE_Attendee
863
-            ? $attendee->get_admin_details_link()
864
-            : '';
865
-        $attendee_link = ! empty($attendee_link)
866
-            ? '<a href="' . $attendee->get_admin_details_link() . '"'
867
-              . ' title="' . esc_html__('Click for attendee details', 'event_espresso') . '">'
868
-              . '<span id="checkin-attendee-name">'
869
-              . $attendee_name
870
-              . '</span></a>'
871
-            : '';
872
-        $event_link = $registration->event() instanceof EE_Event
873
-            ? $registration->event()->get_admin_details_link()
874
-            : '';
875
-        $event_link = ! empty($event_link)
876
-            ? '<a href="' . $event_link . '"'
877
-              . ' title="' . esc_html__('Click here to edit event.', 'event_espresso') . '">'
878
-              . '<span id="checkin-event-name">'
879
-              . $registration->event_name()
880
-              . '</span>'
881
-              . '</a>'
882
-            : '';
883
-        $this->_template_args['before_list_table'] = ! empty($reg_id) && ! empty($dtt_id)
884
-            ? '<h2>' . sprintf(
885
-                esc_html__('Displaying check in records for %1$s for %2$s at the event, %3$s', 'event_espresso'),
886
-                $attendee_link,
887
-                $datetime_link,
888
-                $event_link
889
-            ) . '</h2>'
890
-            : '';
891
-        $this->_template_args['list_table_hidden_fields'] = ! empty($reg_id)
892
-            ? '<input type="hidden" name="_REG_ID" value="' . $reg_id . '">' : '';
893
-        $this->_template_args['list_table_hidden_fields'] .= ! empty($dtt_id)
894
-            ? '<input type="hidden" name="DTT_ID" value="' . $dtt_id . '">' : '';
895
-        $this->display_admin_list_table_page_with_no_sidebar();
896
-    }
788
+	/**
789
+	 * generates HTML for the Registration Check-in list table (showing all Check-ins for a specific registration)
790
+	 *
791
+	 * @access protected
792
+	 * @return void
793
+	 * @throws EE_Error
794
+	 * @throws InvalidArgumentException
795
+	 * @throws InvalidDataTypeException
796
+	 * @throws InvalidInterfaceException
797
+	 * @throws \EventEspresso\core\exceptions\EntityNotFoundException
798
+	 */
799
+	protected function _registration_checkin_list_table()
800
+	{
801
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
802
+		$reg_id = isset($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : null;
803
+		/** @var EE_Registration $registration */
804
+		$registration = EEM_Registration::instance()->get_one_by_ID($reg_id);
805
+		if (! $registration instanceof EE_Registration) {
806
+			throw new EE_Error(
807
+				sprintf(
808
+					esc_html__('An error occurred. There is no registration with ID (%d)', 'event_espresso'),
809
+					$reg_id
810
+				)
811
+			);
812
+		}
813
+		$attendee = $registration->attendee();
814
+		$this->_admin_page_title .= $this->get_action_link_or_button(
815
+			'new_registration',
816
+			'add-registrant',
817
+			array('event_id' => $registration->event_ID()),
818
+			'add-new-h2'
819
+		);
820
+		$checked_in = new CheckinStatusDashicon(EE_Checkin::status_checked_in);
821
+		$checked_out = new CheckinStatusDashicon(EE_Checkin::status_checked_out);
822
+		$legend_items = array(
823
+			'checkin'  => array(
824
+				'class' => $checked_in->cssClasses(),
825
+				'desc'  => $checked_in->legendLabel(),
826
+			),
827
+			'checkout' => array(
828
+				'class' => $checked_out->cssClasses(),
829
+				'desc'  => $checked_out->legendLabel(),
830
+			),
831
+		);
832
+		$this->_template_args['after_list_table'] = $this->_display_legend($legend_items);
833
+		$dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : null;
834
+		/** @var EE_Datetime $datetime */
835
+		$datetime = EEM_Datetime::instance()->get_one_by_ID($dtt_id);
836
+		$datetime_label = '';
837
+		if ($datetime instanceof EE_Datetime) {
838
+			$datetime_label = $datetime->get_dtt_display_name(true);
839
+			$datetime_label .= ! empty($datetime_label)
840
+				? ' (' . $datetime->get_dtt_display_name() . ')'
841
+				: $datetime->get_dtt_display_name();
842
+		}
843
+		$datetime_link = ! empty($dtt_id) && $registration instanceof EE_Registration
844
+			? EE_Admin_Page::add_query_args_and_nonce(
845
+				array(
846
+					'action'   => 'event_registrations',
847
+					'event_id' => $registration->event_ID(),
848
+					'DTT_ID'   => $dtt_id,
849
+				),
850
+				$this->_admin_base_url
851
+			)
852
+			: '';
853
+		$datetime_link = ! empty($datetime_link)
854
+			? '<a href="' . $datetime_link . '">'
855
+			  . '<span id="checkin-dtt">'
856
+			  . $datetime_label
857
+			  . '</span></a>'
858
+			: $datetime_label;
859
+		$attendee_name = $attendee instanceof EE_Attendee
860
+			? $attendee->full_name()
861
+			: '';
862
+		$attendee_link = $attendee instanceof EE_Attendee
863
+			? $attendee->get_admin_details_link()
864
+			: '';
865
+		$attendee_link = ! empty($attendee_link)
866
+			? '<a href="' . $attendee->get_admin_details_link() . '"'
867
+			  . ' title="' . esc_html__('Click for attendee details', 'event_espresso') . '">'
868
+			  . '<span id="checkin-attendee-name">'
869
+			  . $attendee_name
870
+			  . '</span></a>'
871
+			: '';
872
+		$event_link = $registration->event() instanceof EE_Event
873
+			? $registration->event()->get_admin_details_link()
874
+			: '';
875
+		$event_link = ! empty($event_link)
876
+			? '<a href="' . $event_link . '"'
877
+			  . ' title="' . esc_html__('Click here to edit event.', 'event_espresso') . '">'
878
+			  . '<span id="checkin-event-name">'
879
+			  . $registration->event_name()
880
+			  . '</span>'
881
+			  . '</a>'
882
+			: '';
883
+		$this->_template_args['before_list_table'] = ! empty($reg_id) && ! empty($dtt_id)
884
+			? '<h2>' . sprintf(
885
+				esc_html__('Displaying check in records for %1$s for %2$s at the event, %3$s', 'event_espresso'),
886
+				$attendee_link,
887
+				$datetime_link,
888
+				$event_link
889
+			) . '</h2>'
890
+			: '';
891
+		$this->_template_args['list_table_hidden_fields'] = ! empty($reg_id)
892
+			? '<input type="hidden" name="_REG_ID" value="' . $reg_id . '">' : '';
893
+		$this->_template_args['list_table_hidden_fields'] .= ! empty($dtt_id)
894
+			? '<input type="hidden" name="DTT_ID" value="' . $dtt_id . '">' : '';
895
+		$this->display_admin_list_table_page_with_no_sidebar();
896
+	}
897 897
 
898 898
 
899
-    /**
900
-     * toggle the Check-in status for the given registration (coming from ajax)
901
-     *
902
-     * @return void (JSON)
903
-     * @throws EE_Error
904
-     * @throws InvalidArgumentException
905
-     * @throws InvalidDataTypeException
906
-     * @throws InvalidInterfaceException
907
-     */
908
-    public function toggle_checkin_status()
909
-    {
910
-        // first make sure we have the necessary data
911
-        if (! isset($this->_req_data['_regid'])) {
912
-            EE_Error::add_error(
913
-                esc_html__(
914
-                    'There must be something broken with the html structure because the required data for toggling the Check-in status is not being sent via ajax',
915
-                    'event_espresso'
916
-                ),
917
-                __FILE__,
918
-                __FUNCTION__,
919
-                __LINE__
920
-            );
921
-            $this->_template_args['success'] = false;
922
-            $this->_template_args['error'] = true;
923
-            $this->_return_json();
924
-        };
925
-        // do a nonce check cause we're not coming in from an normal route here.
926
-        $nonce = isset($this->_req_data['checkinnonce']) ? sanitize_text_field($this->_req_data['checkinnonce'])
927
-            : '';
928
-        $nonce_ref = 'checkin_nonce';
929
-        $this->_verify_nonce($nonce, $nonce_ref);
930
-        // beautiful! Made it this far so let's get the status.
931
-        $new_status = new CheckinStatusDashicon($this->_toggle_checkin_status());
932
-        // setup new class to return via ajax
933
-        $this->_template_args['admin_page_content'] = 'clickable trigger-checkin ' . $new_status->cssClasses();
934
-        $this->_template_args['success'] = true;
935
-        $this->_return_json();
936
-    }
899
+	/**
900
+	 * toggle the Check-in status for the given registration (coming from ajax)
901
+	 *
902
+	 * @return void (JSON)
903
+	 * @throws EE_Error
904
+	 * @throws InvalidArgumentException
905
+	 * @throws InvalidDataTypeException
906
+	 * @throws InvalidInterfaceException
907
+	 */
908
+	public function toggle_checkin_status()
909
+	{
910
+		// first make sure we have the necessary data
911
+		if (! isset($this->_req_data['_regid'])) {
912
+			EE_Error::add_error(
913
+				esc_html__(
914
+					'There must be something broken with the html structure because the required data for toggling the Check-in status is not being sent via ajax',
915
+					'event_espresso'
916
+				),
917
+				__FILE__,
918
+				__FUNCTION__,
919
+				__LINE__
920
+			);
921
+			$this->_template_args['success'] = false;
922
+			$this->_template_args['error'] = true;
923
+			$this->_return_json();
924
+		};
925
+		// do a nonce check cause we're not coming in from an normal route here.
926
+		$nonce = isset($this->_req_data['checkinnonce']) ? sanitize_text_field($this->_req_data['checkinnonce'])
927
+			: '';
928
+		$nonce_ref = 'checkin_nonce';
929
+		$this->_verify_nonce($nonce, $nonce_ref);
930
+		// beautiful! Made it this far so let's get the status.
931
+		$new_status = new CheckinStatusDashicon($this->_toggle_checkin_status());
932
+		// setup new class to return via ajax
933
+		$this->_template_args['admin_page_content'] = 'clickable trigger-checkin ' . $new_status->cssClasses();
934
+		$this->_template_args['success'] = true;
935
+		$this->_return_json();
936
+	}
937 937
 
938 938
 
939
-    /**
940
-     * handles toggling the checkin status for the registration,
941
-     *
942
-     * @access protected
943
-     * @return int|void
944
-     * @throws EE_Error
945
-     * @throws InvalidArgumentException
946
-     * @throws InvalidDataTypeException
947
-     * @throws InvalidInterfaceException
948
-     */
949
-    protected function _toggle_checkin_status()
950
-    {
951
-        // first let's get the query args out of the way for the redirect
952
-        $query_args = array(
953
-            'action'   => 'event_registrations',
954
-            'event_id' => isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null,
955
-            'DTT_ID'   => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : null,
956
-        );
957
-        $new_status = false;
958
-        // bulk action check in toggle
959
-        if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
960
-            // cycle thru checkboxes
961
-            while (list($REG_ID, $value) = each($this->_req_data['checkbox'])) {
962
-                $DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : null;
963
-                $new_status = $this->_toggle_checkin($REG_ID, $DTT_ID);
964
-            }
965
-        } elseif (isset($this->_req_data['_regid'])) {
966
-            // coming from ajax request
967
-            $DTT_ID = isset($this->_req_data['dttid']) ? $this->_req_data['dttid'] : null;
968
-            $query_args['DTT_ID'] = $DTT_ID;
969
-            $new_status = $this->_toggle_checkin($this->_req_data['_regid'], $DTT_ID);
970
-        } else {
971
-            EE_Error::add_error(
972
-                esc_html__('Missing some required data to toggle the Check-in', 'event_espresso'),
973
-                __FILE__,
974
-                __FUNCTION__,
975
-                __LINE__
976
-            );
977
-        }
978
-        if (defined('DOING_AJAX')) {
979
-            return $new_status;
980
-        }
981
-        $this->_redirect_after_action(false, '', '', $query_args, true);
982
-    }
939
+	/**
940
+	 * handles toggling the checkin status for the registration,
941
+	 *
942
+	 * @access protected
943
+	 * @return int|void
944
+	 * @throws EE_Error
945
+	 * @throws InvalidArgumentException
946
+	 * @throws InvalidDataTypeException
947
+	 * @throws InvalidInterfaceException
948
+	 */
949
+	protected function _toggle_checkin_status()
950
+	{
951
+		// first let's get the query args out of the way for the redirect
952
+		$query_args = array(
953
+			'action'   => 'event_registrations',
954
+			'event_id' => isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null,
955
+			'DTT_ID'   => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : null,
956
+		);
957
+		$new_status = false;
958
+		// bulk action check in toggle
959
+		if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
960
+			// cycle thru checkboxes
961
+			while (list($REG_ID, $value) = each($this->_req_data['checkbox'])) {
962
+				$DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : null;
963
+				$new_status = $this->_toggle_checkin($REG_ID, $DTT_ID);
964
+			}
965
+		} elseif (isset($this->_req_data['_regid'])) {
966
+			// coming from ajax request
967
+			$DTT_ID = isset($this->_req_data['dttid']) ? $this->_req_data['dttid'] : null;
968
+			$query_args['DTT_ID'] = $DTT_ID;
969
+			$new_status = $this->_toggle_checkin($this->_req_data['_regid'], $DTT_ID);
970
+		} else {
971
+			EE_Error::add_error(
972
+				esc_html__('Missing some required data to toggle the Check-in', 'event_espresso'),
973
+				__FILE__,
974
+				__FUNCTION__,
975
+				__LINE__
976
+			);
977
+		}
978
+		if (defined('DOING_AJAX')) {
979
+			return $new_status;
980
+		}
981
+		$this->_redirect_after_action(false, '', '', $query_args, true);
982
+	}
983 983
 
984 984
 
985
-    /**
986
-     * This is toggles a single Check-in for the given registration and datetime.
987
-     *
988
-     * @param  int $REG_ID The registration we're toggling
989
-     * @param  int $DTT_ID The datetime we're toggling
990
-     * @return int The new status toggled to.
991
-     * @throws EE_Error
992
-     * @throws InvalidArgumentException
993
-     * @throws InvalidDataTypeException
994
-     * @throws InvalidInterfaceException
995
-     */
996
-    private function _toggle_checkin($REG_ID, $DTT_ID)
997
-    {
998
-        /** @var EE_Registration $REG */
999
-        $REG = EEM_Registration::instance()->get_one_by_ID($REG_ID);
1000
-        $new_status = $REG->toggle_checkin_status($DTT_ID);
1001
-        if ($new_status !== false) {
1002
-            EE_Error::add_success($REG->get_checkin_msg($DTT_ID));
1003
-        } else {
1004
-            EE_Error::add_error($REG->get_checkin_msg($DTT_ID, true), __FILE__, __FUNCTION__, __LINE__);
1005
-            $new_status = false;
1006
-        }
1007
-        return $new_status;
1008
-    }
985
+	/**
986
+	 * This is toggles a single Check-in for the given registration and datetime.
987
+	 *
988
+	 * @param  int $REG_ID The registration we're toggling
989
+	 * @param  int $DTT_ID The datetime we're toggling
990
+	 * @return int The new status toggled to.
991
+	 * @throws EE_Error
992
+	 * @throws InvalidArgumentException
993
+	 * @throws InvalidDataTypeException
994
+	 * @throws InvalidInterfaceException
995
+	 */
996
+	private function _toggle_checkin($REG_ID, $DTT_ID)
997
+	{
998
+		/** @var EE_Registration $REG */
999
+		$REG = EEM_Registration::instance()->get_one_by_ID($REG_ID);
1000
+		$new_status = $REG->toggle_checkin_status($DTT_ID);
1001
+		if ($new_status !== false) {
1002
+			EE_Error::add_success($REG->get_checkin_msg($DTT_ID));
1003
+		} else {
1004
+			EE_Error::add_error($REG->get_checkin_msg($DTT_ID, true), __FILE__, __FUNCTION__, __LINE__);
1005
+			$new_status = false;
1006
+		}
1007
+		return $new_status;
1008
+	}
1009 1009
 
1010 1010
 
1011
-    /**
1012
-     * Takes care of deleting multiple EE_Checkin table rows
1013
-     *
1014
-     * @access protected
1015
-     * @return void
1016
-     * @throws EE_Error
1017
-     * @throws InvalidArgumentException
1018
-     * @throws InvalidDataTypeException
1019
-     * @throws InvalidInterfaceException
1020
-     */
1021
-    protected function _delete_checkin_rows()
1022
-    {
1023
-        $query_args = array(
1024
-            'action'  => 'registration_checkins',
1025
-            'DTT_ID'  => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0,
1026
-            '_REG_ID' => isset($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0,
1027
-        );
1028
-        $errors = 0;
1029
-        if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1030
-            while (list($CHK_ID, $value) = each($this->_req_data['checkbox'])) {
1031
-                if (! EEM_Checkin::instance()->delete_by_ID($CHK_ID)) {
1032
-                    $errors++;
1033
-                }
1034
-            }
1035
-        } else {
1036
-            EE_Error::add_error(
1037
-                esc_html__(
1038
-                    'So, something went wrong with the bulk delete because there was no data received for instructions on WHAT to delete!',
1039
-                    'event_espresso'
1040
-                ),
1041
-                __FILE__,
1042
-                __FUNCTION__,
1043
-                __LINE__
1044
-            );
1045
-            $this->_redirect_after_action(false, '', '', $query_args, true);
1046
-        }
1047
-        if ($errors > 0) {
1048
-            EE_Error::add_error(
1049
-                sprintf(esc_html__('There were %d records that did not delete successfully', 'event_espresso'), $errors),
1050
-                __FILE__,
1051
-                __FUNCTION__,
1052
-                __LINE__
1053
-            );
1054
-        } else {
1055
-            EE_Error::add_success(esc_html__('Records were successfully deleted', 'event_espresso'));
1056
-        }
1057
-        $this->_redirect_after_action(false, '', '', $query_args, true);
1058
-    }
1011
+	/**
1012
+	 * Takes care of deleting multiple EE_Checkin table rows
1013
+	 *
1014
+	 * @access protected
1015
+	 * @return void
1016
+	 * @throws EE_Error
1017
+	 * @throws InvalidArgumentException
1018
+	 * @throws InvalidDataTypeException
1019
+	 * @throws InvalidInterfaceException
1020
+	 */
1021
+	protected function _delete_checkin_rows()
1022
+	{
1023
+		$query_args = array(
1024
+			'action'  => 'registration_checkins',
1025
+			'DTT_ID'  => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0,
1026
+			'_REG_ID' => isset($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0,
1027
+		);
1028
+		$errors = 0;
1029
+		if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1030
+			while (list($CHK_ID, $value) = each($this->_req_data['checkbox'])) {
1031
+				if (! EEM_Checkin::instance()->delete_by_ID($CHK_ID)) {
1032
+					$errors++;
1033
+				}
1034
+			}
1035
+		} else {
1036
+			EE_Error::add_error(
1037
+				esc_html__(
1038
+					'So, something went wrong with the bulk delete because there was no data received for instructions on WHAT to delete!',
1039
+					'event_espresso'
1040
+				),
1041
+				__FILE__,
1042
+				__FUNCTION__,
1043
+				__LINE__
1044
+			);
1045
+			$this->_redirect_after_action(false, '', '', $query_args, true);
1046
+		}
1047
+		if ($errors > 0) {
1048
+			EE_Error::add_error(
1049
+				sprintf(esc_html__('There were %d records that did not delete successfully', 'event_espresso'), $errors),
1050
+				__FILE__,
1051
+				__FUNCTION__,
1052
+				__LINE__
1053
+			);
1054
+		} else {
1055
+			EE_Error::add_success(esc_html__('Records were successfully deleted', 'event_espresso'));
1056
+		}
1057
+		$this->_redirect_after_action(false, '', '', $query_args, true);
1058
+	}
1059 1059
 
1060 1060
 
1061
-    /**
1062
-     * Deletes a single EE_Checkin row
1063
-     *
1064
-     * @return void
1065
-     * @throws EE_Error
1066
-     * @throws InvalidArgumentException
1067
-     * @throws InvalidDataTypeException
1068
-     * @throws InvalidInterfaceException
1069
-     */
1070
-    protected function _delete_checkin_row()
1071
-    {
1072
-        $query_args = array(
1073
-            'action'  => 'registration_checkins',
1074
-            'DTT_ID'  => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0,
1075
-            '_REG_ID' => isset($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0,
1076
-        );
1077
-        if (! empty($this->_req_data['CHK_ID'])) {
1078
-            if (! EEM_Checkin::instance()->delete_by_ID($this->_req_data['CHK_ID'])) {
1079
-                EE_Error::add_error(
1080
-                    esc_html__('Something went wrong and this check-in record was not deleted', 'event_espresso'),
1081
-                    __FILE__,
1082
-                    __FUNCTION__,
1083
-                    __LINE__
1084
-                );
1085
-            } else {
1086
-                EE_Error::add_success(esc_html__('Check-In record successfully deleted', 'event_espresso'));
1087
-            }
1088
-        } else {
1089
-            EE_Error::add_error(
1090
-                esc_html__(
1091
-                    'In order to delete a Check-in record, there must be a Check-In ID available. There is not. It is not your fault, there is just a gremlin living in the code',
1092
-                    'event_espresso'
1093
-                ),
1094
-                __FILE__,
1095
-                __FUNCTION__,
1096
-                __LINE__
1097
-            );
1098
-        }
1099
-        $this->_redirect_after_action(false, '', '', $query_args, true);
1100
-    }
1061
+	/**
1062
+	 * Deletes a single EE_Checkin row
1063
+	 *
1064
+	 * @return void
1065
+	 * @throws EE_Error
1066
+	 * @throws InvalidArgumentException
1067
+	 * @throws InvalidDataTypeException
1068
+	 * @throws InvalidInterfaceException
1069
+	 */
1070
+	protected function _delete_checkin_row()
1071
+	{
1072
+		$query_args = array(
1073
+			'action'  => 'registration_checkins',
1074
+			'DTT_ID'  => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0,
1075
+			'_REG_ID' => isset($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0,
1076
+		);
1077
+		if (! empty($this->_req_data['CHK_ID'])) {
1078
+			if (! EEM_Checkin::instance()->delete_by_ID($this->_req_data['CHK_ID'])) {
1079
+				EE_Error::add_error(
1080
+					esc_html__('Something went wrong and this check-in record was not deleted', 'event_espresso'),
1081
+					__FILE__,
1082
+					__FUNCTION__,
1083
+					__LINE__
1084
+				);
1085
+			} else {
1086
+				EE_Error::add_success(esc_html__('Check-In record successfully deleted', 'event_espresso'));
1087
+			}
1088
+		} else {
1089
+			EE_Error::add_error(
1090
+				esc_html__(
1091
+					'In order to delete a Check-in record, there must be a Check-In ID available. There is not. It is not your fault, there is just a gremlin living in the code',
1092
+					'event_espresso'
1093
+				),
1094
+				__FILE__,
1095
+				__FUNCTION__,
1096
+				__LINE__
1097
+			);
1098
+		}
1099
+		$this->_redirect_after_action(false, '', '', $query_args, true);
1100
+	}
1101 1101
 
1102 1102
 
1103
-    /**
1104
-     *        generates HTML for the Event Registrations List Table
1105
-     *
1106
-     * @access protected
1107
-     * @return void
1108
-     * @throws EE_Error
1109
-     * @throws InvalidArgumentException
1110
-     * @throws InvalidDataTypeException
1111
-     * @throws InvalidInterfaceException
1112
-     */
1113
-    protected function _event_registrations_list_table()
1114
-    {
1115
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1116
-        $this->_admin_page_title .= isset($this->_req_data['event_id'])
1117
-            ? $this->get_action_link_or_button(
1118
-                'new_registration',
1119
-                'add-registrant',
1120
-                array('event_id' => $this->_req_data['event_id']),
1121
-                'add-new-h2',
1122
-                '',
1123
-                false
1124
-            )
1125
-            : '';
1126
-        $checked_in = new CheckinStatusDashicon(EE_Checkin::status_checked_in);
1127
-        $checked_out = new CheckinStatusDashicon(EE_Checkin::status_checked_out);
1128
-        $checked_never = new CheckinStatusDashicon(EE_Checkin::status_checked_never);
1129
-        $checkin_invalid = new CheckinStatusDashicon(EE_Checkin::status_invalid);
1130
-        $legend_items = array(
1131
-            'star-icon'        => array(
1132
-                'class' => 'dashicons dashicons-star-filled gold-icon',
1133
-                'desc'  => esc_html__('This Registrant is the Primary Registrant', 'event_espresso'),
1134
-            ),
1135
-            'checkin'          => array(
1136
-                'class' => $checked_in->cssClasses(),
1137
-                'desc'  => $checked_in->legendLabel(),
1138
-            ),
1139
-            'checkout'         => array(
1140
-                'class' => $checked_out->cssClasses(),
1141
-                'desc'  => $checked_out->legendLabel(),
1142
-            ),
1143
-            'nocheckinrecord'  => array(
1144
-                'class' => $checked_never->cssClasses(),
1145
-                'desc'  => $checked_never->legendLabel(),
1146
-            ),
1147
-            'canNotCheckin'  => array(
1148
-                'class' => $checkin_invalid->cssClasses(),
1149
-                'desc'  => $checkin_invalid->legendLabel(),
1150
-            ),
1151
-            'approved_status'  => array(
1152
-                'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_approved,
1153
-                'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_approved, false, 'sentence'),
1154
-            ),
1155
-            'cancelled_status' => array(
1156
-                'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_cancelled,
1157
-                'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, false, 'sentence'),
1158
-            ),
1159
-            'declined_status'  => array(
1160
-                'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_declined,
1161
-                'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_declined, false, 'sentence'),
1162
-            ),
1163
-            'not_approved'     => array(
1164
-                'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_not_approved,
1165
-                'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, false, 'sentence'),
1166
-            ),
1167
-            'pending_status'   => array(
1168
-                'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_pending_payment,
1169
-                'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, false, 'sentence'),
1170
-            ),
1171
-            'wait_list'        => array(
1172
-                'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_wait_list,
1173
-                'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_wait_list, false, 'sentence'),
1174
-            ),
1175
-        );
1176
-        $this->_template_args['after_list_table'] = $this->_display_legend($legend_items);
1177
-        $event_id = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : 0;
1178
-        /** @var EE_Event $event */
1179
-        $event = EEM_Event::instance()->get_one_by_ID($event_id);
1180
-        $this->_template_args['before_list_table'] = $event instanceof EE_Event
1181
-            ? '<h2>
1103
+	/**
1104
+	 *        generates HTML for the Event Registrations List Table
1105
+	 *
1106
+	 * @access protected
1107
+	 * @return void
1108
+	 * @throws EE_Error
1109
+	 * @throws InvalidArgumentException
1110
+	 * @throws InvalidDataTypeException
1111
+	 * @throws InvalidInterfaceException
1112
+	 */
1113
+	protected function _event_registrations_list_table()
1114
+	{
1115
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1116
+		$this->_admin_page_title .= isset($this->_req_data['event_id'])
1117
+			? $this->get_action_link_or_button(
1118
+				'new_registration',
1119
+				'add-registrant',
1120
+				array('event_id' => $this->_req_data['event_id']),
1121
+				'add-new-h2',
1122
+				'',
1123
+				false
1124
+			)
1125
+			: '';
1126
+		$checked_in = new CheckinStatusDashicon(EE_Checkin::status_checked_in);
1127
+		$checked_out = new CheckinStatusDashicon(EE_Checkin::status_checked_out);
1128
+		$checked_never = new CheckinStatusDashicon(EE_Checkin::status_checked_never);
1129
+		$checkin_invalid = new CheckinStatusDashicon(EE_Checkin::status_invalid);
1130
+		$legend_items = array(
1131
+			'star-icon'        => array(
1132
+				'class' => 'dashicons dashicons-star-filled gold-icon',
1133
+				'desc'  => esc_html__('This Registrant is the Primary Registrant', 'event_espresso'),
1134
+			),
1135
+			'checkin'          => array(
1136
+				'class' => $checked_in->cssClasses(),
1137
+				'desc'  => $checked_in->legendLabel(),
1138
+			),
1139
+			'checkout'         => array(
1140
+				'class' => $checked_out->cssClasses(),
1141
+				'desc'  => $checked_out->legendLabel(),
1142
+			),
1143
+			'nocheckinrecord'  => array(
1144
+				'class' => $checked_never->cssClasses(),
1145
+				'desc'  => $checked_never->legendLabel(),
1146
+			),
1147
+			'canNotCheckin'  => array(
1148
+				'class' => $checkin_invalid->cssClasses(),
1149
+				'desc'  => $checkin_invalid->legendLabel(),
1150
+			),
1151
+			'approved_status'  => array(
1152
+				'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_approved,
1153
+				'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_approved, false, 'sentence'),
1154
+			),
1155
+			'cancelled_status' => array(
1156
+				'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_cancelled,
1157
+				'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, false, 'sentence'),
1158
+			),
1159
+			'declined_status'  => array(
1160
+				'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_declined,
1161
+				'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_declined, false, 'sentence'),
1162
+			),
1163
+			'not_approved'     => array(
1164
+				'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_not_approved,
1165
+				'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, false, 'sentence'),
1166
+			),
1167
+			'pending_status'   => array(
1168
+				'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_pending_payment,
1169
+				'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, false, 'sentence'),
1170
+			),
1171
+			'wait_list'        => array(
1172
+				'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_wait_list,
1173
+				'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_wait_list, false, 'sentence'),
1174
+			),
1175
+		);
1176
+		$this->_template_args['after_list_table'] = $this->_display_legend($legend_items);
1177
+		$event_id = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : 0;
1178
+		/** @var EE_Event $event */
1179
+		$event = EEM_Event::instance()->get_one_by_ID($event_id);
1180
+		$this->_template_args['before_list_table'] = $event instanceof EE_Event
1181
+			? '<h2>
1182 1182
                 ' . sprintf(
1183
-                        esc_html__('Viewing Registrations for Event: %s', 'event_espresso'),
1184
-                        "<span class='ee-event-name'>{$event->name()}</span>"
1185
-                    )
1186
-            : '';
1187
-        // need to get the number of datetimes on the event and set default datetime_id if there is only one datetime on
1188
-        // the event.
1189
-        $DTT_ID = ! empty($this->_req_data['DTT_ID']) ? absint($this->_req_data['DTT_ID']) : 0;
1190
-        $datetime = null;
1191
-        if ($event instanceof EE_Event) {
1192
-            $datetimes_on_event = $event->datetimes();
1193
-            if (count($datetimes_on_event) === 1) {
1194
-                $datetime = reset($datetimes_on_event);
1195
-            }
1196
-        }
1197
-        $datetime = $datetime instanceof EE_Datetime ? $datetime : EEM_Datetime::instance()->get_one_by_ID($DTT_ID);
1198
-        if ($datetime instanceof EE_Datetime && $this->_template_args['before_list_table'] !== '') {
1199
-            $active_status   = $datetime->get_active_status();
1200
-            $datetime_status =
1201
-                '<span class="ee-status ee-status-bg--' . esc_attr($active_status) . ' event-active-status-' .
1202
-                esc_attr($active_status) . '">'
1203
-                . EEH_Template::pretty_status($active_status, false, 'sentence')
1204
-                . '</span>';
1205
-            $this->_template_args['before_list_table'] .= '<span class="ee-event-datetime-name">';
1206
-            $this->_template_args['before_list_table'] .= '<span class="dashicons dashicons-calendar-alt"></span>';
1207
-            $this->_template_args['before_list_table'] .= $datetime->name();
1208
-            $this->_template_args['before_list_table'] .= ' ( ' . $datetime->date_and_time_range() . ' )';
1209
-            $this->_template_args['before_list_table'] .= $datetime_status;
1210
-            $this->_template_args['before_list_table'] .= '</span>';
1211
-        }
1212
-        $this->_template_args['before_list_table'] .= '</h2>';
1213
-        // if no datetime, then we're on the initial view, so let's give some helpful instructions on what the status
1214
-        // column represents
1215
-        if (! $datetime instanceof EE_Datetime) {
1216
-            $this->_template_args['before_list_table'] .= '<h3 class="description">'
1217
-                                                          . esc_html__(
1218
-                                                              'In this view, the check-in status represents the latest check-in record for the registration in that row.',
1219
-                                                              'event_espresso'
1220
-                                                          )
1221
-                                                          . '</h3>';
1222
-        }
1223
-        $this->display_admin_list_table_page_with_no_sidebar();
1224
-    }
1183
+						esc_html__('Viewing Registrations for Event: %s', 'event_espresso'),
1184
+						"<span class='ee-event-name'>{$event->name()}</span>"
1185
+					)
1186
+			: '';
1187
+		// need to get the number of datetimes on the event and set default datetime_id if there is only one datetime on
1188
+		// the event.
1189
+		$DTT_ID = ! empty($this->_req_data['DTT_ID']) ? absint($this->_req_data['DTT_ID']) : 0;
1190
+		$datetime = null;
1191
+		if ($event instanceof EE_Event) {
1192
+			$datetimes_on_event = $event->datetimes();
1193
+			if (count($datetimes_on_event) === 1) {
1194
+				$datetime = reset($datetimes_on_event);
1195
+			}
1196
+		}
1197
+		$datetime = $datetime instanceof EE_Datetime ? $datetime : EEM_Datetime::instance()->get_one_by_ID($DTT_ID);
1198
+		if ($datetime instanceof EE_Datetime && $this->_template_args['before_list_table'] !== '') {
1199
+			$active_status   = $datetime->get_active_status();
1200
+			$datetime_status =
1201
+				'<span class="ee-status ee-status-bg--' . esc_attr($active_status) . ' event-active-status-' .
1202
+				esc_attr($active_status) . '">'
1203
+				. EEH_Template::pretty_status($active_status, false, 'sentence')
1204
+				. '</span>';
1205
+			$this->_template_args['before_list_table'] .= '<span class="ee-event-datetime-name">';
1206
+			$this->_template_args['before_list_table'] .= '<span class="dashicons dashicons-calendar-alt"></span>';
1207
+			$this->_template_args['before_list_table'] .= $datetime->name();
1208
+			$this->_template_args['before_list_table'] .= ' ( ' . $datetime->date_and_time_range() . ' )';
1209
+			$this->_template_args['before_list_table'] .= $datetime_status;
1210
+			$this->_template_args['before_list_table'] .= '</span>';
1211
+		}
1212
+		$this->_template_args['before_list_table'] .= '</h2>';
1213
+		// if no datetime, then we're on the initial view, so let's give some helpful instructions on what the status
1214
+		// column represents
1215
+		if (! $datetime instanceof EE_Datetime) {
1216
+			$this->_template_args['before_list_table'] .= '<h3 class="description">'
1217
+														  . esc_html__(
1218
+															  'In this view, the check-in status represents the latest check-in record for the registration in that row.',
1219
+															  'event_espresso'
1220
+														  )
1221
+														  . '</h3>';
1222
+		}
1223
+		$this->display_admin_list_table_page_with_no_sidebar();
1224
+	}
1225 1225
 
1226
-    /**
1227
-     * Download the registrations check-in report (same as the normal registration report, but with different where
1228
-     * conditions)
1229
-     *
1230
-     * @return void ends the request by a redirect or download
1231
-     */
1232
-    public function _registrations_checkin_report()
1233
-    {
1234
-        $this->_registrations_report_base('_get_checkin_query_params_from_request');
1235
-    }
1226
+	/**
1227
+	 * Download the registrations check-in report (same as the normal registration report, but with different where
1228
+	 * conditions)
1229
+	 *
1230
+	 * @return void ends the request by a redirect or download
1231
+	 */
1232
+	public function _registrations_checkin_report()
1233
+	{
1234
+		$this->_registrations_report_base('_get_checkin_query_params_from_request');
1235
+	}
1236 1236
 
1237
-    /**
1238
-     * Gets the query params from the request, plus adds a where condition for the registration status,
1239
-     * because on the checkin page we only ever want to see approved and pending-approval registrations
1240
-     *
1241
-     * @param array $request
1242
-     * @param int   $per_page
1243
-     * @param bool  $count
1244
-     * @return array
1245
-     * @throws EE_Error
1246
-     */
1247
-    protected function _get_checkin_query_params_from_request(
1248
-        $request,
1249
-        $per_page = 10,
1250
-        $count = false
1251
-    ) {
1252
-        $query_params = $this->_get_registration_query_parameters($request, $per_page, $count);
1253
-        // unlike the regular registrations list table,
1254
-        $status_ids_array = apply_filters(
1255
-            'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array',
1256
-            array(EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved)
1257
-        );
1258
-        $query_params[0]['STS_ID'] = array('IN', $status_ids_array);
1259
-        return $query_params;
1260
-    }
1237
+	/**
1238
+	 * Gets the query params from the request, plus adds a where condition for the registration status,
1239
+	 * because on the checkin page we only ever want to see approved and pending-approval registrations
1240
+	 *
1241
+	 * @param array $request
1242
+	 * @param int   $per_page
1243
+	 * @param bool  $count
1244
+	 * @return array
1245
+	 * @throws EE_Error
1246
+	 */
1247
+	protected function _get_checkin_query_params_from_request(
1248
+		$request,
1249
+		$per_page = 10,
1250
+		$count = false
1251
+	) {
1252
+		$query_params = $this->_get_registration_query_parameters($request, $per_page, $count);
1253
+		// unlike the regular registrations list table,
1254
+		$status_ids_array = apply_filters(
1255
+			'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array',
1256
+			array(EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved)
1257
+		);
1258
+		$query_params[0]['STS_ID'] = array('IN', $status_ids_array);
1259
+		return $query_params;
1260
+	}
1261 1261
 
1262 1262
 
1263
-    /**
1264
-     * Gets registrations for an event
1265
-     *
1266
-     * @param int    $per_page
1267
-     * @param bool   $count whether to return count or data.
1268
-     * @param bool   $trash
1269
-     * @param string $orderby
1270
-     * @return EE_Registration[]|int
1271
-     * @throws EE_Error
1272
-     * @throws InvalidArgumentException
1273
-     * @throws InvalidDataTypeException
1274
-     * @throws InvalidInterfaceException
1275
-     */
1276
-    public function get_event_attendees($per_page = 10, $count = false, $trash = false, $orderby = 'ATT_fname')
1277
-    {
1278
-        // normalize some request params that get setup by the parent `get_registrations` method.
1279
-        $request = $this->_req_data;
1280
-        $request['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : $orderby;
1281
-        $request['order'] = ! empty($this->_req_data['order']) ? $this->_req_data['order'] : 'ASC';
1282
-        if ($trash) {
1283
-            $request['status'] = 'trash';
1284
-        }
1285
-        $query_params = $this->_get_checkin_query_params_from_request($request, $per_page, $count);
1286
-        /**
1287
-         * Override the default groupby added by EEM_Base so that sorts with multiple order bys work as expected
1288
-         *
1289
-         * @link https://events.codebasehq.com/projects/event-espresso/tickets/10093
1290
-         * @see https://github.com/eventespresso/event-espresso-core/tree/master/docs/G--Model-System/model-query-params.md
1291
-         *                             or if you have the development copy of EE you can view this at the path:
1292
-         *                             /docs/G--Model-System/model-query-params.md
1293
-         */
1294
-        $query_params['group_by'] = '';
1263
+	/**
1264
+	 * Gets registrations for an event
1265
+	 *
1266
+	 * @param int    $per_page
1267
+	 * @param bool   $count whether to return count or data.
1268
+	 * @param bool   $trash
1269
+	 * @param string $orderby
1270
+	 * @return EE_Registration[]|int
1271
+	 * @throws EE_Error
1272
+	 * @throws InvalidArgumentException
1273
+	 * @throws InvalidDataTypeException
1274
+	 * @throws InvalidInterfaceException
1275
+	 */
1276
+	public function get_event_attendees($per_page = 10, $count = false, $trash = false, $orderby = 'ATT_fname')
1277
+	{
1278
+		// normalize some request params that get setup by the parent `get_registrations` method.
1279
+		$request = $this->_req_data;
1280
+		$request['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : $orderby;
1281
+		$request['order'] = ! empty($this->_req_data['order']) ? $this->_req_data['order'] : 'ASC';
1282
+		if ($trash) {
1283
+			$request['status'] = 'trash';
1284
+		}
1285
+		$query_params = $this->_get_checkin_query_params_from_request($request, $per_page, $count);
1286
+		/**
1287
+		 * Override the default groupby added by EEM_Base so that sorts with multiple order bys work as expected
1288
+		 *
1289
+		 * @link https://events.codebasehq.com/projects/event-espresso/tickets/10093
1290
+		 * @see https://github.com/eventespresso/event-espresso-core/tree/master/docs/G--Model-System/model-query-params.md
1291
+		 *                             or if you have the development copy of EE you can view this at the path:
1292
+		 *                             /docs/G--Model-System/model-query-params.md
1293
+		 */
1294
+		$query_params['group_by'] = '';
1295 1295
 
1296
-        return $count
1297
-            ? EEM_Registration::instance()->count($query_params)
1298
-            /** @type EE_Registration[] */
1299
-            : EEM_Registration::instance()->get_all($query_params);
1300
-    }
1296
+		return $count
1297
+			? EEM_Registration::instance()->count($query_params)
1298
+			/** @type EE_Registration[] */
1299
+			: EEM_Registration::instance()->get_all($query_params);
1300
+	}
1301 1301
 }
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
     public function __construct($routing = true)
33 33
     {
34 34
         parent::__construct($routing);
35
-        if (! defined('REG_CAF_TEMPLATE_PATH')) {
36
-            define('REG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/templates/');
37
-            define('REG_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/assets/');
38
-            define('REG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'registrations/assets/');
35
+        if ( ! defined('REG_CAF_TEMPLATE_PATH')) {
36
+            define('REG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'registrations/templates/');
37
+            define('REG_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND.'registrations/assets/');
38
+            define('REG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'registrations/assets/');
39 39
         }
40 40
     }
41 41
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     protected function _extend_page_config()
47 47
     {
48
-        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'registrations';
48
+        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'registrations';
49 49
         $reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID'])
50 50
             ? $this->_req_data['_REG_ID']
51 51
             : 0;
@@ -181,14 +181,14 @@  discard block
 block discarded – undo
181 181
             // enqueue newsletter js
182 182
             wp_enqueue_script(
183 183
                 'ee-newsletter-trigger',
184
-                REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.js',
184
+                REG_CAF_ASSETS_URL.'ee-newsletter-trigger.js',
185 185
                 array('ee-dialog'),
186 186
                 EVENT_ESPRESSO_VERSION,
187 187
                 true
188 188
             );
189 189
             wp_enqueue_style(
190 190
                 'ee-newsletter-trigger-css',
191
-                REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.css',
191
+                REG_CAF_ASSETS_URL.'ee-newsletter-trigger.css',
192 192
                 array(),
193 193
                 EVENT_ESPRESSO_VERSION
194 194
             );
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
     {
210 210
         wp_register_script(
211 211
             'ee-reg-reports-js',
212
-            REG_CAF_ASSETS_URL . 'ee-registration-admin-reports.js',
212
+            REG_CAF_ASSETS_URL.'ee-registration-admin-reports.js',
213 213
             array('google-charts'),
214 214
             EVENT_ESPRESSO_VERSION,
215 215
             true
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
         $nonce_ref = 'get_newsletter_form_content_nonce';
296 296
         $this->_verify_nonce($nonce, $nonce_ref);
297 297
         // let's get the mtp for the incoming MTP_ ID
298
-        if (! isset($this->_req_data['GRP_ID'])) {
298
+        if ( ! isset($this->_req_data['GRP_ID'])) {
299 299
             EE_Error::add_error(
300 300
                 esc_html__(
301 301
                     'There must be something broken with the js or html structure because the required data for getting a message template group is not present (need an GRP_ID).',
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
             $this->_return_json();
311 311
         }
312 312
         $MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID($this->_req_data['GRP_ID']);
313
-        if (! $MTPG instanceof EE_Message_Template_Group) {
313
+        if ( ! $MTPG instanceof EE_Message_Template_Group) {
314 314
             EE_Error::add_error(
315 315
                 sprintf(
316 316
                     esc_html__(
@@ -335,12 +335,12 @@  discard block
 block discarded – undo
335 335
             $field = $MTP->get('MTP_template_field');
336 336
             if ($field === 'content') {
337 337
                 $content = $MTP->get('MTP_content');
338
-                if (! empty($content['newsletter_content'])) {
338
+                if ( ! empty($content['newsletter_content'])) {
339 339
                     $template_fields['newsletter_content'] = $content['newsletter_content'];
340 340
                 }
341 341
                 continue;
342 342
             }
343
-            $template_fields[ $MTP->get('MTP_template_field') ] = $MTP->get('MTP_content');
343
+            $template_fields[$MTP->get('MTP_template_field')] = $MTP->get('MTP_content');
344 344
         }
345 345
         $this->_template_args['success'] = true;
346 346
         $this->_template_args['error'] = false;
@@ -442,17 +442,17 @@  discard block
 block discarded – undo
442 442
                 $field_id = $field === '[NEWSLETTER_CONTENT]'
443 443
                     ? 'content'
444 444
                     : $field;
445
-                $field_id = 'batch-message-' . strtolower($field_id);
445
+                $field_id = 'batch-message-'.strtolower($field_id);
446 446
                 $available_shortcodes[] = '<span class="js-shortcode-selection" data-value="'
447 447
                                           . $shortcode
448
-                                          . '" data-linked-input-id="' . $field_id . '">'
448
+                                          . '" data-linked-input-id="'.$field_id.'">'
449 449
                                           . $shortcode
450 450
                                           . '</span>';
451 451
             }
452
-            $codes[ $field ] = implode(', ', $available_shortcodes);
452
+            $codes[$field] = implode(', ', $available_shortcodes);
453 453
         }
454 454
         $shortcodes = $codes;
455
-        $form_template = REG_CAF_TEMPLATE_PATH . 'newsletter-send-form.template.php';
455
+        $form_template = REG_CAF_TEMPLATE_PATH.'newsletter-send-form.template.php';
456 456
         $form_template_args = array(
457 457
             'form_action'       => admin_url('admin.php?page=espresso_registrations'),
458 458
             'form_route'        => 'newsletter_selected_send',
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
      */
621 621
     protected function _registration_reports()
622 622
     {
623
-        $template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php';
623
+        $template_path = EE_ADMIN_TEMPLATE.'admin_reports.template.php';
624 624
         $this->_template_args['admin_page_content'] = EEH_Template::display_template(
625 625
             $template_path,
626 626
             $this->_reports_template_data,
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
             array_unshift($regs, $column_titles);
676 676
             // setup the date range.
677 677
             $DateTimeZone = new DateTimeZone(EEH_DTT_Helper::get_timezone());
678
-            $beginning_date = new DateTime("now " . $period, $DateTimeZone);
678
+            $beginning_date = new DateTime("now ".$period, $DateTimeZone);
679 679
             $ending_date = new DateTime("now", $DateTimeZone);
680 680
             $subtitle = sprintf(
681 681
                 wp_strip_all_tags(
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
                         'event_espresso'
700 700
                     )
701 701
                 ),
702
-                '<h2>' . $report_title . '</h2><p>',
702
+                '<h2>'.$report_title.'</h2><p>',
703 703
                 '</p>'
704 704
             ),
705 705
         );
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
             array_unshift($regs, $column_titles);
753 753
             // setup the date range.
754 754
             $DateTimeZone = new DateTimeZone(EEH_DTT_Helper::get_timezone());
755
-            $beginning_date = new DateTime("now " . $period, $DateTimeZone);
755
+            $beginning_date = new DateTime("now ".$period, $DateTimeZone);
756 756
             $ending_date = new DateTime("now", $DateTimeZone);
757 757
             $subtitle = sprintf(
758 758
                 wp_strip_all_tags(
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
                         'event_espresso'
777 777
                     )
778 778
                 ),
779
-                '<h2>' . $report_title . '</h2><p>',
779
+                '<h2>'.$report_title.'</h2><p>',
780 780
                 '</p>'
781 781
             ),
782 782
         );
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
         $reg_id = isset($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : null;
803 803
         /** @var EE_Registration $registration */
804 804
         $registration = EEM_Registration::instance()->get_one_by_ID($reg_id);
805
-        if (! $registration instanceof EE_Registration) {
805
+        if ( ! $registration instanceof EE_Registration) {
806 806
             throw new EE_Error(
807 807
                 sprintf(
808 808
                     esc_html__('An error occurred. There is no registration with ID (%d)', 'event_espresso'),
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
         if ($datetime instanceof EE_Datetime) {
838 838
             $datetime_label = $datetime->get_dtt_display_name(true);
839 839
             $datetime_label .= ! empty($datetime_label)
840
-                ? ' (' . $datetime->get_dtt_display_name() . ')'
840
+                ? ' ('.$datetime->get_dtt_display_name().')'
841 841
                 : $datetime->get_dtt_display_name();
842 842
         }
843 843
         $datetime_link = ! empty($dtt_id) && $registration instanceof EE_Registration
@@ -851,7 +851,7 @@  discard block
 block discarded – undo
851 851
             )
852 852
             : '';
853 853
         $datetime_link = ! empty($datetime_link)
854
-            ? '<a href="' . $datetime_link . '">'
854
+            ? '<a href="'.$datetime_link.'">'
855 855
               . '<span id="checkin-dtt">'
856 856
               . $datetime_label
857 857
               . '</span></a>'
@@ -863,8 +863,8 @@  discard block
 block discarded – undo
863 863
             ? $attendee->get_admin_details_link()
864 864
             : '';
865 865
         $attendee_link = ! empty($attendee_link)
866
-            ? '<a href="' . $attendee->get_admin_details_link() . '"'
867
-              . ' title="' . esc_html__('Click for attendee details', 'event_espresso') . '">'
866
+            ? '<a href="'.$attendee->get_admin_details_link().'"'
867
+              . ' title="'.esc_html__('Click for attendee details', 'event_espresso').'">'
868 868
               . '<span id="checkin-attendee-name">'
869 869
               . $attendee_name
870 870
               . '</span></a>'
@@ -873,25 +873,25 @@  discard block
 block discarded – undo
873 873
             ? $registration->event()->get_admin_details_link()
874 874
             : '';
875 875
         $event_link = ! empty($event_link)
876
-            ? '<a href="' . $event_link . '"'
877
-              . ' title="' . esc_html__('Click here to edit event.', 'event_espresso') . '">'
876
+            ? '<a href="'.$event_link.'"'
877
+              . ' title="'.esc_html__('Click here to edit event.', 'event_espresso').'">'
878 878
               . '<span id="checkin-event-name">'
879 879
               . $registration->event_name()
880 880
               . '</span>'
881 881
               . '</a>'
882 882
             : '';
883 883
         $this->_template_args['before_list_table'] = ! empty($reg_id) && ! empty($dtt_id)
884
-            ? '<h2>' . sprintf(
884
+            ? '<h2>'.sprintf(
885 885
                 esc_html__('Displaying check in records for %1$s for %2$s at the event, %3$s', 'event_espresso'),
886 886
                 $attendee_link,
887 887
                 $datetime_link,
888 888
                 $event_link
889
-            ) . '</h2>'
889
+            ).'</h2>'
890 890
             : '';
891 891
         $this->_template_args['list_table_hidden_fields'] = ! empty($reg_id)
892
-            ? '<input type="hidden" name="_REG_ID" value="' . $reg_id . '">' : '';
892
+            ? '<input type="hidden" name="_REG_ID" value="'.$reg_id.'">' : '';
893 893
         $this->_template_args['list_table_hidden_fields'] .= ! empty($dtt_id)
894
-            ? '<input type="hidden" name="DTT_ID" value="' . $dtt_id . '">' : '';
894
+            ? '<input type="hidden" name="DTT_ID" value="'.$dtt_id.'">' : '';
895 895
         $this->display_admin_list_table_page_with_no_sidebar();
896 896
     }
897 897
 
@@ -908,7 +908,7 @@  discard block
 block discarded – undo
908 908
     public function toggle_checkin_status()
909 909
     {
910 910
         // first make sure we have the necessary data
911
-        if (! isset($this->_req_data['_regid'])) {
911
+        if ( ! isset($this->_req_data['_regid'])) {
912 912
             EE_Error::add_error(
913 913
                 esc_html__(
914 914
                     'There must be something broken with the html structure because the required data for toggling the Check-in status is not being sent via ajax',
@@ -930,7 +930,7 @@  discard block
 block discarded – undo
930 930
         // beautiful! Made it this far so let's get the status.
931 931
         $new_status = new CheckinStatusDashicon($this->_toggle_checkin_status());
932 932
         // setup new class to return via ajax
933
-        $this->_template_args['admin_page_content'] = 'clickable trigger-checkin ' . $new_status->cssClasses();
933
+        $this->_template_args['admin_page_content'] = 'clickable trigger-checkin '.$new_status->cssClasses();
934 934
         $this->_template_args['success'] = true;
935 935
         $this->_return_json();
936 936
     }
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
         );
957 957
         $new_status = false;
958 958
         // bulk action check in toggle
959
-        if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
959
+        if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
960 960
             // cycle thru checkboxes
961 961
             while (list($REG_ID, $value) = each($this->_req_data['checkbox'])) {
962 962
                 $DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : null;
@@ -1026,9 +1026,9 @@  discard block
 block discarded – undo
1026 1026
             '_REG_ID' => isset($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0,
1027 1027
         );
1028 1028
         $errors = 0;
1029
-        if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1029
+        if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1030 1030
             while (list($CHK_ID, $value) = each($this->_req_data['checkbox'])) {
1031
-                if (! EEM_Checkin::instance()->delete_by_ID($CHK_ID)) {
1031
+                if ( ! EEM_Checkin::instance()->delete_by_ID($CHK_ID)) {
1032 1032
                     $errors++;
1033 1033
                 }
1034 1034
             }
@@ -1074,8 +1074,8 @@  discard block
 block discarded – undo
1074 1074
             'DTT_ID'  => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0,
1075 1075
             '_REG_ID' => isset($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0,
1076 1076
         );
1077
-        if (! empty($this->_req_data['CHK_ID'])) {
1078
-            if (! EEM_Checkin::instance()->delete_by_ID($this->_req_data['CHK_ID'])) {
1077
+        if ( ! empty($this->_req_data['CHK_ID'])) {
1078
+            if ( ! EEM_Checkin::instance()->delete_by_ID($this->_req_data['CHK_ID'])) {
1079 1079
                 EE_Error::add_error(
1080 1080
                     esc_html__('Something went wrong and this check-in record was not deleted', 'event_espresso'),
1081 1081
                     __FILE__,
@@ -1149,27 +1149,27 @@  discard block
 block discarded – undo
1149 1149
                 'desc'  => $checkin_invalid->legendLabel(),
1150 1150
             ),
1151 1151
             'approved_status'  => array(
1152
-                'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_approved,
1152
+                'class' => 'ee-status-legend ee-status-bg--'.EEM_Registration::status_id_approved,
1153 1153
                 'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_approved, false, 'sentence'),
1154 1154
             ),
1155 1155
             'cancelled_status' => array(
1156
-                'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_cancelled,
1156
+                'class' => 'ee-status-legend ee-status-bg--'.EEM_Registration::status_id_cancelled,
1157 1157
                 'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, false, 'sentence'),
1158 1158
             ),
1159 1159
             'declined_status'  => array(
1160
-                'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_declined,
1160
+                'class' => 'ee-status-legend ee-status-bg--'.EEM_Registration::status_id_declined,
1161 1161
                 'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_declined, false, 'sentence'),
1162 1162
             ),
1163 1163
             'not_approved'     => array(
1164
-                'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_not_approved,
1164
+                'class' => 'ee-status-legend ee-status-bg--'.EEM_Registration::status_id_not_approved,
1165 1165
                 'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, false, 'sentence'),
1166 1166
             ),
1167 1167
             'pending_status'   => array(
1168
-                'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_pending_payment,
1168
+                'class' => 'ee-status-legend ee-status-bg--'.EEM_Registration::status_id_pending_payment,
1169 1169
                 'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, false, 'sentence'),
1170 1170
             ),
1171 1171
             'wait_list'        => array(
1172
-                'class' => 'ee-status-legend ee-status-bg--' . EEM_Registration::status_id_wait_list,
1172
+                'class' => 'ee-status-legend ee-status-bg--'.EEM_Registration::status_id_wait_list,
1173 1173
                 'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_wait_list, false, 'sentence'),
1174 1174
             ),
1175 1175
         );
@@ -1198,21 +1198,21 @@  discard block
 block discarded – undo
1198 1198
         if ($datetime instanceof EE_Datetime && $this->_template_args['before_list_table'] !== '') {
1199 1199
             $active_status   = $datetime->get_active_status();
1200 1200
             $datetime_status =
1201
-                '<span class="ee-status ee-status-bg--' . esc_attr($active_status) . ' event-active-status-' .
1202
-                esc_attr($active_status) . '">'
1201
+                '<span class="ee-status ee-status-bg--'.esc_attr($active_status).' event-active-status-'.
1202
+                esc_attr($active_status).'">'
1203 1203
                 . EEH_Template::pretty_status($active_status, false, 'sentence')
1204 1204
                 . '</span>';
1205 1205
             $this->_template_args['before_list_table'] .= '<span class="ee-event-datetime-name">';
1206 1206
             $this->_template_args['before_list_table'] .= '<span class="dashicons dashicons-calendar-alt"></span>';
1207 1207
             $this->_template_args['before_list_table'] .= $datetime->name();
1208
-            $this->_template_args['before_list_table'] .= ' ( ' . $datetime->date_and_time_range() . ' )';
1208
+            $this->_template_args['before_list_table'] .= ' ( '.$datetime->date_and_time_range().' )';
1209 1209
             $this->_template_args['before_list_table'] .= $datetime_status;
1210 1210
             $this->_template_args['before_list_table'] .= '</span>';
1211 1211
         }
1212 1212
         $this->_template_args['before_list_table'] .= '</h2>';
1213 1213
         // if no datetime, then we're on the initial view, so let's give some helpful instructions on what the status
1214 1214
         // column represents
1215
-        if (! $datetime instanceof EE_Datetime) {
1215
+        if ( ! $datetime instanceof EE_Datetime) {
1216 1216
             $this->_template_args['before_list_table'] .= '<h3 class="description">'
1217 1217
                                                           . esc_html__(
1218 1218
                                                               'In this view, the check-in status represents the latest check-in record for the registration in that row.',
Please login to merge, or discard this patch.
admin/extend/registrations/EE_Event_Registrations_List_Table.class.php 2 patches
Indentation   +633 added lines, -633 removed lines patch added patch discarded remove patch
@@ -16,278 +16,278 @@  discard block
 block discarded – undo
16 16
 class EE_Event_Registrations_List_Table extends EE_Admin_List_Table
17 17
 {
18 18
 
19
-    /**
20
-     * @var RequestInterface
21
-     */
22
-    protected $request;
19
+	/**
20
+	 * @var RequestInterface
21
+	 */
22
+	protected $request;
23 23
     
24
-    /**
25
-     * @var Extend_Registrations_Admin_Page
26
-     */
27
-    protected $_admin_page;
28
-
29
-    /**
30
-     * The event ID if one is specified in the request
31
-     *
32
-     * @var int
33
-     */
34
-    protected $event_id = 0;
35
-
36
-    /**
37
-     * This property will hold the related Datetimes on an event IF the event id is included in the request.
38
-     *
39
-     * @var DatetimesForEventCheckIn
40
-     */
41
-    protected $datetimes_for_event = [];
42
-
43
-    /**
44
-     * The DTT_ID if the current view has a specified datetime.
45
-     *
46
-     * @var int
47
-     */
48
-    protected $datetime_id = 0;
49
-
50
-    /**
51
-     * @var EE_Datetime
52
-     */
53
-    protected $datetime;
54
-
55
-    /**
56
-     * @var DatetimesForEventCheckIn
57
-     */
58
-    protected $datetimes_for_current_row;
59
-
60
-
61
-    /**
62
-     * EE_Event_Registrations_List_Table constructor.
63
-     *
64
-     * @param Registrations_Admin_Page $admin_page
65
-     * @throws EE_Error
66
-     * @throws ReflectionException
67
-     */
68
-    public function __construct($admin_page)
69
-    {
70
-        $this->request = LoaderFactory::getLoader()->getShared(RequestInterface::class);
71
-        $this->resolveRequestVars();
72
-        parent::__construct($admin_page);
73
-    }
74
-
75
-
76
-    /**
77
-     * @throws EE_Error
78
-     * @throws ReflectionException
79
-     * @since $VID:$
80
-     */
81
-    private function resolveRequestVars()
82
-    {
83
-        $this->event_id = $this->request->getRequestParam('event_id', 0, 'int');
84
-        $this->datetimes_for_event = DatetimesForEventCheckIn::fromEventID($this->event_id);
85
-        // if we're filtering for a specific event and it only has one datetime, then grab its ID
86
-        $datetime          = $this->datetimes_for_event->getOneActiveDatetimeForEvent();
87
-        $this->datetime_id = $datetime instanceof EE_Datetime ? $datetime->ID() : 0;
88
-        // else check the request, but use the above as the default (and hope they match if BOTH exist, LOLZ)
89
-        $this->datetime_id = $this->request->getRequestParam(
90
-            'DTT_ID',
91
-            $this->datetime_id,
92
-            'int'
93
-        );
94
-    }
95
-
96
-
97
-    /**
98
-     * @throws EE_Error
99
-     */
100
-    protected function _setup_data()
101
-    {
102
-        $this->_data = $this->_view !== 'trash'
103
-            ? $this->_admin_page->get_event_attendees($this->_per_page)
104
-            : $this->_admin_page->get_event_attendees($this->_per_page, false, true);
105
-
106
-        $this->_all_data_count = $this->_view !== 'trash'
107
-            ? $this->_admin_page->get_event_attendees($this->_per_page, true)
108
-            : $this->_admin_page->get_event_attendees($this->_per_page, true, true);
109
-    }
110
-
111
-
112
-    protected function _set_properties()
113
-    {
114
-        $this->_wp_list_args = [
115
-            'singular' => esc_html__('registrant', 'event_espresso'),
116
-            'plural'   => esc_html__('registrants', 'event_espresso'),
117
-            'ajax'     => true,
118
-            'screen'   => $this->_admin_page->get_current_screen()->id,
119
-        ];
120
-
121
-        $this->_columns      = [
122
-            'cb' => '<input type="checkbox" />', // Render a checkbox instead of text
123
-            '_REG_att_checked_in' => esc_html__('Check In', 'event_espresso'),
124
-            'ATT_name'            => esc_html__('Registrant', 'event_espresso'),
125
-            'ATT_email'           => esc_html__('Email Address', 'event_espresso'),
126
-            'Event'               => esc_html__('Event', 'event_espresso'),
127
-            'PRC_name'            => esc_html__('TKT Option', 'event_espresso'),
128
-            '_REG_final_price'    => esc_html__('Price', 'event_espresso'),
129
-            'TXN_paid'            => esc_html__('Paid', 'event_espresso'),
130
-            'TXN_total'           => esc_html__('Total', 'event_espresso'),
131
-        ];
132
-        $this->_primary_column = '_REG_att_checked_in';
133
-
134
-        // Add/remove columns when an event has been selected
135
-        if ($this->event_id) {
136
-            // Render a checkbox column
137
-            $this->_columns['cb'] = '<input type="checkbox" />';
138
-            $this->_has_checkbox_column = true;
139
-            // Remove the 'Event' column
140
-            unset($this->_columns['Event']);
141
-            $this->setBottomButtons();
142
-        }
143
-
144
-        $this->_sortable_columns = [
145
-            /**
146
-             * Allows users to change the default sort if they wish.
147
-             * Returning a falsey on this filter will result in the default sort to be by firstname rather than last name.
148
-             *
149
-             * Note: usual naming conventions for filters aren't followed here so that just one filter can be used to
150
-             * change the sorts on any list table involving registration contacts.  If you want to only change the filter
151
-             * for a specific list table you can use the provided reference to this object instance.
152
-             */
153
-            'ATT_name' => [
154
-                'FHEE__EE_Registrations_List_Table___set_properties__default_sort_by_registration_last_name',
155
-                true,
156
-                $this,
157
-            ]
158
-                ? ['ATT_lname' => true]
159
-                : ['ATT_fname' => true],
160
-            'Event'    => ['Event.EVT_name' => false],
161
-        ];
162
-
163
-        $this->_hidden_columns = [];
164
-    }
165
-
166
-
167
-    private function setBottomButtons()
168
-    {
169
-        if (
170
-            ! EE_Registry::instance()->CAP->current_user_can(
171
-                'ee_read_registrations',
172
-                'espresso_registrations_registrations_reports',
173
-                $this->event_id
174
-            )
175
-        ) {
176
-            return;
177
-        }
178
-
179
-        $return_url = $this->getReturnUrl();
180
-        $this->_bottom_buttons = [
181
-            'report' => [
182
-                'route'         => 'registrations_report',
183
-                'extra_request' =>
184
-                    [
185
-                        'EVT_ID'     => $this->event_id,
186
-                        'return_url' => $return_url,
187
-                    ],
188
-            ],
189
-        ];
190
-
191
-        $request_params = $this->request->requestParams();
192
-
193
-        $this->_bottom_buttons['report_filtered'] = [
194
-            'route'         => 'registrations_checkin_report',
195
-            'extra_request' => [
196
-                'use_filters' => true,
197
-                'filters'     => array_merge(
198
-                    [
199
-                        'EVT_ID' => $this->event_id,
200
-                    ],
201
-                    array_diff_key(
202
-                        $request_params,
203
-                        array_flip(
204
-                            [
205
-                                'page',
206
-                                'action',
207
-                                'default_nonce',
208
-                            ]
209
-                        )
210
-                    )
211
-                ),
212
-                'return_url'  => $return_url,
213
-            ],
214
-        ];
215
-    }
216
-
217
-
218
-    /**
219
-     * @param EE_Registration $item
220
-     * @return string
221
-     */
222
-    protected function _get_row_class($item): string
223
-    {
224
-        $class = parent::_get_row_class($item);
225
-        if ($this->_has_checkbox_column) {
226
-            $class .= ' has-checkbox-column';
227
-        }
228
-        return $class;
229
-    }
230
-
231
-
232
-    /**
233
-     * @return array
234
-     * @throws EE_Error
235
-     * @throws ReflectionException
236
-     */
237
-    protected function _get_table_filters(): array
238
-    {
239
-        $filters = [];
240
-        $hide_expired = $this->request->getRequestParam('hide_expired', true, 'bool');
241
-        $hide_upcoming = $this->request->getRequestParam('hide_upcoming', true, 'bool');
242
-        $hide_expired_checked = $hide_expired ? 'checked' : '';
243
-        $hide_upcoming_checked = $hide_upcoming ? 'checked' : '';
244
-        // get datetimes for ALL active events (note possible capability restrictions)
245
-        $events   = $this->datetimes_for_event->getAllActiveDatetimesForAllEvents();
246
-        $event_options[] = [
247
-            'id'   => 0,
248
-            'text' => esc_html__(' - select an event - ', 'event_espresso'),
249
-        ];
250
-        /** @var EE_Event $event */
251
-        foreach ($events as $event) {
252
-            // any registrations for this event?
253
-            if (! $event instanceof EE_Event/* || ! $event->get_count_of_all_registrations()*/) {
254
-                continue;
255
-            }
256
-            $expired_class = $event->is_expired() ? 'ee-expired-event' : '';
257
-            $upcoming_class  = $event->is_upcoming() ? ' ee-upcoming-event' : '';
258
-            $event_options[] = [
259
-                'id'    => $event->ID(),
260
-                'text'  => apply_filters(
261
-                    'FHEE__EE_Event_Registrations___get_table_filters__event_name',
262
-                    $event->name(),
263
-                    $event
264
-                ),
265
-                'class' => $expired_class . $upcoming_class,
266
-            ];
267
-            if ($event->ID() === $this->event_id) {
268
-                $hide_expired = $expired_class === '';
269
-                $hide_expired_checked  = $expired_class === '' ? $hide_expired_checked : '';
270
-                $hide_upcoming = $upcoming_class === '';
271
-                $hide_upcoming_checked = $upcoming_class === '' ? $hide_upcoming_checked : '';
272
-            }
273
-        }
274
-
275
-        $select_class = $hide_expired ? 'ee-hide-expired-events' : '';
276
-        $select_class .= $hide_upcoming ? ' ee-hide-upcoming-events' : '';
277
-
278
-        $filters[] = '
24
+	/**
25
+	 * @var Extend_Registrations_Admin_Page
26
+	 */
27
+	protected $_admin_page;
28
+
29
+	/**
30
+	 * The event ID if one is specified in the request
31
+	 *
32
+	 * @var int
33
+	 */
34
+	protected $event_id = 0;
35
+
36
+	/**
37
+	 * This property will hold the related Datetimes on an event IF the event id is included in the request.
38
+	 *
39
+	 * @var DatetimesForEventCheckIn
40
+	 */
41
+	protected $datetimes_for_event = [];
42
+
43
+	/**
44
+	 * The DTT_ID if the current view has a specified datetime.
45
+	 *
46
+	 * @var int
47
+	 */
48
+	protected $datetime_id = 0;
49
+
50
+	/**
51
+	 * @var EE_Datetime
52
+	 */
53
+	protected $datetime;
54
+
55
+	/**
56
+	 * @var DatetimesForEventCheckIn
57
+	 */
58
+	protected $datetimes_for_current_row;
59
+
60
+
61
+	/**
62
+	 * EE_Event_Registrations_List_Table constructor.
63
+	 *
64
+	 * @param Registrations_Admin_Page $admin_page
65
+	 * @throws EE_Error
66
+	 * @throws ReflectionException
67
+	 */
68
+	public function __construct($admin_page)
69
+	{
70
+		$this->request = LoaderFactory::getLoader()->getShared(RequestInterface::class);
71
+		$this->resolveRequestVars();
72
+		parent::__construct($admin_page);
73
+	}
74
+
75
+
76
+	/**
77
+	 * @throws EE_Error
78
+	 * @throws ReflectionException
79
+	 * @since $VID:$
80
+	 */
81
+	private function resolveRequestVars()
82
+	{
83
+		$this->event_id = $this->request->getRequestParam('event_id', 0, 'int');
84
+		$this->datetimes_for_event = DatetimesForEventCheckIn::fromEventID($this->event_id);
85
+		// if we're filtering for a specific event and it only has one datetime, then grab its ID
86
+		$datetime          = $this->datetimes_for_event->getOneActiveDatetimeForEvent();
87
+		$this->datetime_id = $datetime instanceof EE_Datetime ? $datetime->ID() : 0;
88
+		// else check the request, but use the above as the default (and hope they match if BOTH exist, LOLZ)
89
+		$this->datetime_id = $this->request->getRequestParam(
90
+			'DTT_ID',
91
+			$this->datetime_id,
92
+			'int'
93
+		);
94
+	}
95
+
96
+
97
+	/**
98
+	 * @throws EE_Error
99
+	 */
100
+	protected function _setup_data()
101
+	{
102
+		$this->_data = $this->_view !== 'trash'
103
+			? $this->_admin_page->get_event_attendees($this->_per_page)
104
+			: $this->_admin_page->get_event_attendees($this->_per_page, false, true);
105
+
106
+		$this->_all_data_count = $this->_view !== 'trash'
107
+			? $this->_admin_page->get_event_attendees($this->_per_page, true)
108
+			: $this->_admin_page->get_event_attendees($this->_per_page, true, true);
109
+	}
110
+
111
+
112
+	protected function _set_properties()
113
+	{
114
+		$this->_wp_list_args = [
115
+			'singular' => esc_html__('registrant', 'event_espresso'),
116
+			'plural'   => esc_html__('registrants', 'event_espresso'),
117
+			'ajax'     => true,
118
+			'screen'   => $this->_admin_page->get_current_screen()->id,
119
+		];
120
+
121
+		$this->_columns      = [
122
+			'cb' => '<input type="checkbox" />', // Render a checkbox instead of text
123
+			'_REG_att_checked_in' => esc_html__('Check In', 'event_espresso'),
124
+			'ATT_name'            => esc_html__('Registrant', 'event_espresso'),
125
+			'ATT_email'           => esc_html__('Email Address', 'event_espresso'),
126
+			'Event'               => esc_html__('Event', 'event_espresso'),
127
+			'PRC_name'            => esc_html__('TKT Option', 'event_espresso'),
128
+			'_REG_final_price'    => esc_html__('Price', 'event_espresso'),
129
+			'TXN_paid'            => esc_html__('Paid', 'event_espresso'),
130
+			'TXN_total'           => esc_html__('Total', 'event_espresso'),
131
+		];
132
+		$this->_primary_column = '_REG_att_checked_in';
133
+
134
+		// Add/remove columns when an event has been selected
135
+		if ($this->event_id) {
136
+			// Render a checkbox column
137
+			$this->_columns['cb'] = '<input type="checkbox" />';
138
+			$this->_has_checkbox_column = true;
139
+			// Remove the 'Event' column
140
+			unset($this->_columns['Event']);
141
+			$this->setBottomButtons();
142
+		}
143
+
144
+		$this->_sortable_columns = [
145
+			/**
146
+			 * Allows users to change the default sort if they wish.
147
+			 * Returning a falsey on this filter will result in the default sort to be by firstname rather than last name.
148
+			 *
149
+			 * Note: usual naming conventions for filters aren't followed here so that just one filter can be used to
150
+			 * change the sorts on any list table involving registration contacts.  If you want to only change the filter
151
+			 * for a specific list table you can use the provided reference to this object instance.
152
+			 */
153
+			'ATT_name' => [
154
+				'FHEE__EE_Registrations_List_Table___set_properties__default_sort_by_registration_last_name',
155
+				true,
156
+				$this,
157
+			]
158
+				? ['ATT_lname' => true]
159
+				: ['ATT_fname' => true],
160
+			'Event'    => ['Event.EVT_name' => false],
161
+		];
162
+
163
+		$this->_hidden_columns = [];
164
+	}
165
+
166
+
167
+	private function setBottomButtons()
168
+	{
169
+		if (
170
+			! EE_Registry::instance()->CAP->current_user_can(
171
+				'ee_read_registrations',
172
+				'espresso_registrations_registrations_reports',
173
+				$this->event_id
174
+			)
175
+		) {
176
+			return;
177
+		}
178
+
179
+		$return_url = $this->getReturnUrl();
180
+		$this->_bottom_buttons = [
181
+			'report' => [
182
+				'route'         => 'registrations_report',
183
+				'extra_request' =>
184
+					[
185
+						'EVT_ID'     => $this->event_id,
186
+						'return_url' => $return_url,
187
+					],
188
+			],
189
+		];
190
+
191
+		$request_params = $this->request->requestParams();
192
+
193
+		$this->_bottom_buttons['report_filtered'] = [
194
+			'route'         => 'registrations_checkin_report',
195
+			'extra_request' => [
196
+				'use_filters' => true,
197
+				'filters'     => array_merge(
198
+					[
199
+						'EVT_ID' => $this->event_id,
200
+					],
201
+					array_diff_key(
202
+						$request_params,
203
+						array_flip(
204
+							[
205
+								'page',
206
+								'action',
207
+								'default_nonce',
208
+							]
209
+						)
210
+					)
211
+				),
212
+				'return_url'  => $return_url,
213
+			],
214
+		];
215
+	}
216
+
217
+
218
+	/**
219
+	 * @param EE_Registration $item
220
+	 * @return string
221
+	 */
222
+	protected function _get_row_class($item): string
223
+	{
224
+		$class = parent::_get_row_class($item);
225
+		if ($this->_has_checkbox_column) {
226
+			$class .= ' has-checkbox-column';
227
+		}
228
+		return $class;
229
+	}
230
+
231
+
232
+	/**
233
+	 * @return array
234
+	 * @throws EE_Error
235
+	 * @throws ReflectionException
236
+	 */
237
+	protected function _get_table_filters(): array
238
+	{
239
+		$filters = [];
240
+		$hide_expired = $this->request->getRequestParam('hide_expired', true, 'bool');
241
+		$hide_upcoming = $this->request->getRequestParam('hide_upcoming', true, 'bool');
242
+		$hide_expired_checked = $hide_expired ? 'checked' : '';
243
+		$hide_upcoming_checked = $hide_upcoming ? 'checked' : '';
244
+		// get datetimes for ALL active events (note possible capability restrictions)
245
+		$events   = $this->datetimes_for_event->getAllActiveDatetimesForAllEvents();
246
+		$event_options[] = [
247
+			'id'   => 0,
248
+			'text' => esc_html__(' - select an event - ', 'event_espresso'),
249
+		];
250
+		/** @var EE_Event $event */
251
+		foreach ($events as $event) {
252
+			// any registrations for this event?
253
+			if (! $event instanceof EE_Event/* || ! $event->get_count_of_all_registrations()*/) {
254
+				continue;
255
+			}
256
+			$expired_class = $event->is_expired() ? 'ee-expired-event' : '';
257
+			$upcoming_class  = $event->is_upcoming() ? ' ee-upcoming-event' : '';
258
+			$event_options[] = [
259
+				'id'    => $event->ID(),
260
+				'text'  => apply_filters(
261
+					'FHEE__EE_Event_Registrations___get_table_filters__event_name',
262
+					$event->name(),
263
+					$event
264
+				),
265
+				'class' => $expired_class . $upcoming_class,
266
+			];
267
+			if ($event->ID() === $this->event_id) {
268
+				$hide_expired = $expired_class === '';
269
+				$hide_expired_checked  = $expired_class === '' ? $hide_expired_checked : '';
270
+				$hide_upcoming = $upcoming_class === '';
271
+				$hide_upcoming_checked = $upcoming_class === '' ? $hide_upcoming_checked : '';
272
+			}
273
+		}
274
+
275
+		$select_class = $hide_expired ? 'ee-hide-expired-events' : '';
276
+		$select_class .= $hide_upcoming ? ' ee-hide-upcoming-events' : '';
277
+
278
+		$filters[] = '
279 279
         <div class="ee-event-filter">
280 280
             <span>
281 281
                 <label for="event_id">
282 282
                     ' . esc_html__('Check-in Status for', 'event_espresso') . '
283 283
                 </label>
284 284
                 ' . EEH_Form_Fields::select_input(
285
-                    'event_id',
286
-                    $event_options,
287
-                    $this->event_id,
288
-                '',
289
-                    $select_class
290
-            ) . '
285
+					'event_id',
286
+					$event_options,
287
+					$this->event_id,
288
+				'',
289
+					$select_class
290
+			) . '
291 291
             </span>
292 292
             <span>
293 293
                 <label for="js-ee-hide-upcoming-events">
@@ -295,11 +295,11 @@  discard block
 block discarded – undo
295 295
                     ' . esc_html__('Hide Upcoming Events', 'event_espresso') . '
296 296
                 </label>
297 297
                 <span class="dashicons dashicons-editor-help ee-aria-tooltip" aria-label="'
298
-                     . esc_html__(
299
-                         'Will not display events with start dates in the future (ie: have not yet begun)',
300
-                         'event_espresso'
301
-                     )
302
-                     . '"></span>
298
+					 . esc_html__(
299
+						 'Will not display events with start dates in the future (ie: have not yet begun)',
300
+						 'event_espresso'
301
+					 )
302
+					 . '"></span>
303 303
             </span>
304 304
             <span>
305 305
                 <label for="js-ee-hide-expired-events">
@@ -307,386 +307,386 @@  discard block
 block discarded – undo
307 307
                     ' . esc_html__('Hide Expired Events', 'event_espresso') . '
308 308
                 </label>
309 309
                 <span class="dashicons dashicons-editor-help ee-aria-tooltip" aria-label="'
310
-                     . esc_html__(
311
-                         'Will not display events with end dates in the past (ie: have already finished)',
312
-                         'event_espresso'
313
-                     )
314
-                     . '"></span>
310
+					 . esc_html__(
311
+						 'Will not display events with end dates in the past (ie: have already finished)',
312
+						 'event_espresso'
313
+					 )
314
+					 . '"></span>
315 315
             </span>
316 316
         </div>';
317
-        // DTT datetimes filter
318
-        $datetimes_for_event = $this->datetimes_for_event->getAllActiveDatetimesForEvent($hide_upcoming_checked === 'checked');
319
-        if (count($datetimes_for_event) > 1) {
320
-            $datetimes[0] = esc_html__(' - select a datetime - ', 'event_espresso');
321
-            foreach ($datetimes_for_event as $datetime) {
322
-                $datetime_string              = $datetime->name();
323
-                $datetime_string              = ! empty($datetime_string) ? ' (' . $datetime_string . ')' : '';
324
-                $datetime_string              =
325
-                    $datetime->start_date_and_time() . ' - ' . $datetime->end_date_and_time() . $datetime_string;
326
-                $datetimes[ $datetime->ID() ] = $datetime_string;
327
-            }
328
-            $input     = new EE_Select_Input(
329
-                $datetimes,
330
-                [
331
-                    'html_name' => 'DTT_ID',
332
-                    'html_id'   => 'DTT_ID',
333
-                    'default'   => $this->datetime_id,
334
-                ]
335
-            );
336
-            $filters[] = $input->get_html_for_input();
337
-        }
338
-        return $filters;
339
-    }
340
-
341
-
342
-    /**
343
-     * @throws EE_Error
344
-     * @throws ReflectionException
345
-     */
346
-    protected function _add_view_counts()
347
-    {
348
-        $this->_views['all']['count'] = $this->_get_total_event_attendees();
349
-    }
350
-
351
-
352
-    /**
353
-     * @return int
354
-     * @throws EE_Error
355
-     * @throws ReflectionException
356
-     */
357
-    protected function _get_total_event_attendees(): int
358
-    {
359
-        $query_params      = [];
360
-        if ($this->event_id) {
361
-            $query_params[0]['EVT_ID'] = $this->event_id;
362
-        }
363
-        // if DTT is included we only show for that datetime.  Otherwise we're showing for all datetimes (the event).
364
-        if ($this->datetime_id) {
365
-            $query_params[0]['Ticket.Datetime.DTT_ID'] = $this->datetime_id;
366
-        }
367
-        $status_ids_array          = apply_filters(
368
-            'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array',
369
-            [EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved]
370
-        );
371
-        $query_params[0]['STS_ID'] = ['IN', $status_ids_array];
372
-        return EEM_Registration::instance()->count($query_params);
373
-    }
374
-
375
-
376
-    /**
377
-     * @param EE_Registration $item
378
-     * @return string
379
-     * @throws EE_Error
380
-     * @throws ReflectionException
381
-     */
382
-    public function column_cb($item): string
383
-    {
384
-        return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', $item->ID());
385
-    }
386
-
387
-
388
-    /**
389
-     * column_REG_att_checked_in
390
-     *
391
-     * @param EE_Registration $registration
392
-     * @return string
393
-     * @throws EE_Error
394
-     * @throws InvalidArgumentException
395
-     * @throws InvalidDataTypeException
396
-     * @throws InvalidInterfaceException
397
-     * @throws ReflectionException
398
-     */
399
-    public function column__REG_att_checked_in(EE_Registration $registration): string
400
-    {
401
-        // we need a local variable for the datetime for each row
402
-        // (so that we don't pollute state for the entire table)
403
-        // so let's try to get it from the registration's event
404
-        $this->datetimes_for_current_row = DatetimesForEventCheckIn::fromRegistration($registration);
405
-        $datetime = $this->datetimes_for_current_row->getOneActiveDatetimeForEvent();
406
-
407
-        $DTD_ID = $datetime instanceof EE_Datetime ? $datetime->ID() : 0;
408
-
409
-        $checkin_status_dashicon = CheckinStatusDashicon::fromRegistrationAndDatetimeId(
410
-            $registration,
411
-            $DTD_ID
412
-        );
413
-
414
-        $aria_label = $checkin_status_dashicon->ariaLabel();
415
-        $dashicon_class = $checkin_status_dashicon->cssClasses();
416
-        $attributes = ' onClick="return false"';
417
-        $button_class = 'button button--secondary button--icon-only ee-aria-tooltip ee-aria-tooltip--big-box';
418
-
419
-        if (
420
-            $DTD_ID
421
-            && EE_Registry::instance()->CAP->current_user_can(
422
-                'ee_edit_checkin',
423
-                'espresso_registrations_toggle_checkin_status',
424
-                $registration->ID()
425
-            )
426
-        ) {
427
-            // overwrite the disabled attribute with data attributes for performing checkin
428
-            $attributes = 'data-_regid="' . $registration->ID() . '"';
429
-            $attributes .= ' data-dttid="' . $DTD_ID . '"';
430
-            $attributes .= ' data-nonce="' . wp_create_nonce('checkin_nonce') . '"';
431
-            $button_class .= ' clickable trigger-checkin';
432
-        }
433
-
434
-        $content = '
317
+		// DTT datetimes filter
318
+		$datetimes_for_event = $this->datetimes_for_event->getAllActiveDatetimesForEvent($hide_upcoming_checked === 'checked');
319
+		if (count($datetimes_for_event) > 1) {
320
+			$datetimes[0] = esc_html__(' - select a datetime - ', 'event_espresso');
321
+			foreach ($datetimes_for_event as $datetime) {
322
+				$datetime_string              = $datetime->name();
323
+				$datetime_string              = ! empty($datetime_string) ? ' (' . $datetime_string . ')' : '';
324
+				$datetime_string              =
325
+					$datetime->start_date_and_time() . ' - ' . $datetime->end_date_and_time() . $datetime_string;
326
+				$datetimes[ $datetime->ID() ] = $datetime_string;
327
+			}
328
+			$input     = new EE_Select_Input(
329
+				$datetimes,
330
+				[
331
+					'html_name' => 'DTT_ID',
332
+					'html_id'   => 'DTT_ID',
333
+					'default'   => $this->datetime_id,
334
+				]
335
+			);
336
+			$filters[] = $input->get_html_for_input();
337
+		}
338
+		return $filters;
339
+	}
340
+
341
+
342
+	/**
343
+	 * @throws EE_Error
344
+	 * @throws ReflectionException
345
+	 */
346
+	protected function _add_view_counts()
347
+	{
348
+		$this->_views['all']['count'] = $this->_get_total_event_attendees();
349
+	}
350
+
351
+
352
+	/**
353
+	 * @return int
354
+	 * @throws EE_Error
355
+	 * @throws ReflectionException
356
+	 */
357
+	protected function _get_total_event_attendees(): int
358
+	{
359
+		$query_params      = [];
360
+		if ($this->event_id) {
361
+			$query_params[0]['EVT_ID'] = $this->event_id;
362
+		}
363
+		// if DTT is included we only show for that datetime.  Otherwise we're showing for all datetimes (the event).
364
+		if ($this->datetime_id) {
365
+			$query_params[0]['Ticket.Datetime.DTT_ID'] = $this->datetime_id;
366
+		}
367
+		$status_ids_array          = apply_filters(
368
+			'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array',
369
+			[EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved]
370
+		);
371
+		$query_params[0]['STS_ID'] = ['IN', $status_ids_array];
372
+		return EEM_Registration::instance()->count($query_params);
373
+	}
374
+
375
+
376
+	/**
377
+	 * @param EE_Registration $item
378
+	 * @return string
379
+	 * @throws EE_Error
380
+	 * @throws ReflectionException
381
+	 */
382
+	public function column_cb($item): string
383
+	{
384
+		return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', $item->ID());
385
+	}
386
+
387
+
388
+	/**
389
+	 * column_REG_att_checked_in
390
+	 *
391
+	 * @param EE_Registration $registration
392
+	 * @return string
393
+	 * @throws EE_Error
394
+	 * @throws InvalidArgumentException
395
+	 * @throws InvalidDataTypeException
396
+	 * @throws InvalidInterfaceException
397
+	 * @throws ReflectionException
398
+	 */
399
+	public function column__REG_att_checked_in(EE_Registration $registration): string
400
+	{
401
+		// we need a local variable for the datetime for each row
402
+		// (so that we don't pollute state for the entire table)
403
+		// so let's try to get it from the registration's event
404
+		$this->datetimes_for_current_row = DatetimesForEventCheckIn::fromRegistration($registration);
405
+		$datetime = $this->datetimes_for_current_row->getOneActiveDatetimeForEvent();
406
+
407
+		$DTD_ID = $datetime instanceof EE_Datetime ? $datetime->ID() : 0;
408
+
409
+		$checkin_status_dashicon = CheckinStatusDashicon::fromRegistrationAndDatetimeId(
410
+			$registration,
411
+			$DTD_ID
412
+		);
413
+
414
+		$aria_label = $checkin_status_dashicon->ariaLabel();
415
+		$dashicon_class = $checkin_status_dashicon->cssClasses();
416
+		$attributes = ' onClick="return false"';
417
+		$button_class = 'button button--secondary button--icon-only ee-aria-tooltip ee-aria-tooltip--big-box';
418
+
419
+		if (
420
+			$DTD_ID
421
+			&& EE_Registry::instance()->CAP->current_user_can(
422
+				'ee_edit_checkin',
423
+				'espresso_registrations_toggle_checkin_status',
424
+				$registration->ID()
425
+			)
426
+		) {
427
+			// overwrite the disabled attribute with data attributes for performing checkin
428
+			$attributes = 'data-_regid="' . $registration->ID() . '"';
429
+			$attributes .= ' data-dttid="' . $DTD_ID . '"';
430
+			$attributes .= ' data-nonce="' . wp_create_nonce('checkin_nonce') . '"';
431
+			$button_class .= ' clickable trigger-checkin';
432
+		}
433
+
434
+		$content = '
435 435
         <button aria-label="' . $aria_label . '" class="' . $button_class . '" ' . $attributes . '>   
436 436
             <span class="' . $dashicon_class . '" ></span>
437 437
         </button>
438 438
         <span class="show-on-mobile-view-only">' . $this->column_ATT_name($registration) . '</span>';
439
-        return $this->columnContent('_REG_att_checked_in', $content, 'center');
440
-    }
441
-
442
-
443
-    /**
444
-     * @param EE_Registration $registration
445
-     * @return string
446
-     * @throws EE_Error
447
-     * @throws ReflectionException
448
-     */
449
-    public function column_ATT_name(EE_Registration $registration): string
450
-    {
451
-        $attendee = $registration->attendee();
452
-        if (! $attendee instanceof EE_Attendee) {
453
-            return esc_html__('No contact record for this registration.', 'event_espresso');
454
-        }
455
-        // edit attendee link
456
-        $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(
457
-            ['action' => 'view_registration', '_REG_ID' => $registration->ID()],
458
-            REG_ADMIN_URL
459
-        );
460
-        $name_link    = '
439
+		return $this->columnContent('_REG_att_checked_in', $content, 'center');
440
+	}
441
+
442
+
443
+	/**
444
+	 * @param EE_Registration $registration
445
+	 * @return string
446
+	 * @throws EE_Error
447
+	 * @throws ReflectionException
448
+	 */
449
+	public function column_ATT_name(EE_Registration $registration): string
450
+	{
451
+		$attendee = $registration->attendee();
452
+		if (! $attendee instanceof EE_Attendee) {
453
+			return esc_html__('No contact record for this registration.', 'event_espresso');
454
+		}
455
+		// edit attendee link
456
+		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(
457
+			['action' => 'view_registration', '_REG_ID' => $registration->ID()],
458
+			REG_ADMIN_URL
459
+		);
460
+		$name_link    = '
461 461
             <span class="ee-status-dot ee-status-bg--' . esc_attr($registration->status_ID()) . ' ee-aria-tooltip"
462 462
             aria-label="' . EEH_Template::pretty_status($registration->status_ID(), false, 'sentence') . '">
463 463
             </span>';
464
-        $name_link    .= EE_Registry::instance()->CAP->current_user_can(
465
-            'ee_edit_contacts',
466
-            'espresso_registrations_edit_attendee'
467
-        )
468
-            ? '<a class="ee-aria-tooltip" href="' . $edit_lnk_url . '" aria-label="' . esc_attr__(
469
-                'View Registration Details',
470
-                'event_espresso'
471
-            ) . '">'
472
-              . $registration->attendee()->full_name()
473
-              . '</a>'
474
-            : $registration->attendee()->full_name();
475
-        $name_link    .= $registration->count() === 1
476
-            ? '&nbsp;<sup><div class="dashicons dashicons-star-filled gold-icon"></div></sup>	'
477
-            : '';
478
-        // add group details
479
-        $name_link .= '&nbsp;' . sprintf(
480
-            esc_html__('(%s of %s)', 'event_espresso'),
481
-            $registration->count(),
482
-            $registration->group_size()
483
-        );
484
-        // add regcode
485
-        $link      = EE_Admin_Page::add_query_args_and_nonce(
486
-            ['action' => 'view_registration', '_REG_ID' => $registration->ID()],
487
-            REG_ADMIN_URL
488
-        );
489
-        $name_link .= '<br>';
490
-        $name_link .= EE_Registry::instance()->instance()->CAP->current_user_can(
491
-            'ee_read_registration',
492
-            'view_registration',
493
-            $registration->ID()
494
-        )
495
-            ? '<a class="ee-aria-tooltip" href="' . $link . '" aria-label="' . esc_attr__(
496
-                'View Registration Details',
497
-                'event_espresso'
498
-            ) . '">'
499
-              . $registration->reg_code()
500
-              . '</a>'
501
-            : $registration->reg_code();
502
-
503
-        $actions                 = [];
504
-        if (
505
-            $this->datetime_id
506
-            && EE_Registry::instance()->CAP->current_user_can(
507
-                'ee_read_checkins',
508
-                'espresso_registrations_registration_checkins'
509
-            )
510
-        ) {
511
-            $checkin_list_url = EE_Admin_Page::add_query_args_and_nonce(
512
-                ['action' => 'registration_checkins', '_REG_ID' => $registration->ID(), 'DTT_ID' => $this->datetime_id],
513
-                REG_ADMIN_URL
514
-            );
515
-            // get the timestamps for this registration's checkins, related to the selected datetime
516
-            /** @var EE_Checkin[] $checkins */
517
-            $checkins = $registration->get_many_related('Checkin', [['DTT_ID' => $this->datetime_id]]);
518
-            if (! empty($checkins)) {
519
-                // get the last timestamp
520
-                $last_checkin = end($checkins);
521
-                // get timestamp string
522
-                $timestamp_string   = $last_checkin->get_datetime('CHK_timestamp');
523
-                $actions['checkin'] = '
464
+		$name_link    .= EE_Registry::instance()->CAP->current_user_can(
465
+			'ee_edit_contacts',
466
+			'espresso_registrations_edit_attendee'
467
+		)
468
+			? '<a class="ee-aria-tooltip" href="' . $edit_lnk_url . '" aria-label="' . esc_attr__(
469
+				'View Registration Details',
470
+				'event_espresso'
471
+			) . '">'
472
+			  . $registration->attendee()->full_name()
473
+			  . '</a>'
474
+			: $registration->attendee()->full_name();
475
+		$name_link    .= $registration->count() === 1
476
+			? '&nbsp;<sup><div class="dashicons dashicons-star-filled gold-icon"></div></sup>	'
477
+			: '';
478
+		// add group details
479
+		$name_link .= '&nbsp;' . sprintf(
480
+			esc_html__('(%s of %s)', 'event_espresso'),
481
+			$registration->count(),
482
+			$registration->group_size()
483
+		);
484
+		// add regcode
485
+		$link      = EE_Admin_Page::add_query_args_and_nonce(
486
+			['action' => 'view_registration', '_REG_ID' => $registration->ID()],
487
+			REG_ADMIN_URL
488
+		);
489
+		$name_link .= '<br>';
490
+		$name_link .= EE_Registry::instance()->instance()->CAP->current_user_can(
491
+			'ee_read_registration',
492
+			'view_registration',
493
+			$registration->ID()
494
+		)
495
+			? '<a class="ee-aria-tooltip" href="' . $link . '" aria-label="' . esc_attr__(
496
+				'View Registration Details',
497
+				'event_espresso'
498
+			) . '">'
499
+			  . $registration->reg_code()
500
+			  . '</a>'
501
+			: $registration->reg_code();
502
+
503
+		$actions                 = [];
504
+		if (
505
+			$this->datetime_id
506
+			&& EE_Registry::instance()->CAP->current_user_can(
507
+				'ee_read_checkins',
508
+				'espresso_registrations_registration_checkins'
509
+			)
510
+		) {
511
+			$checkin_list_url = EE_Admin_Page::add_query_args_and_nonce(
512
+				['action' => 'registration_checkins', '_REG_ID' => $registration->ID(), 'DTT_ID' => $this->datetime_id],
513
+				REG_ADMIN_URL
514
+			);
515
+			// get the timestamps for this registration's checkins, related to the selected datetime
516
+			/** @var EE_Checkin[] $checkins */
517
+			$checkins = $registration->get_many_related('Checkin', [['DTT_ID' => $this->datetime_id]]);
518
+			if (! empty($checkins)) {
519
+				// get the last timestamp
520
+				$last_checkin = end($checkins);
521
+				// get timestamp string
522
+				$timestamp_string   = $last_checkin->get_datetime('CHK_timestamp');
523
+				$actions['checkin'] = '
524 524
                     <a  class="ee-aria-tooltip" 
525 525
                         href="' . $checkin_list_url . '" 
526 526
                         aria-label="' . esc_attr__(
527
-                                          'View this registrant\'s check-ins/checkouts for the datetime',
528
-                                          'event_espresso'
529
-                                      ) . '"
527
+										  'View this registrant\'s check-ins/checkouts for the datetime',
528
+										  'event_espresso'
529
+									  ) . '"
530 530
                     >
531 531
                         ' . $last_checkin->getCheckInText() . ': ' . $timestamp_string . '
532 532
                     </a>';
533
-            }
534
-        }
535
-        $content = (! empty($this->datetime_id) && ! empty($checkins))
536
-            ? sprintf('%1$s %2$s', $name_link, $this->row_actions($actions, true))
537
-            : $name_link;
538
-        return $this->columnContent('ATT_name', $content);
539
-    }
540
-
541
-
542
-    /**
543
-     * @param EE_Registration $registration
544
-     * @return string
545
-     * @throws EE_Error
546
-     * @throws EE_Error
547
-     */
548
-    public function column_ATT_email(EE_Registration $registration): string
549
-    {
550
-        $attendee = $registration->attendee();
551
-        $content = $attendee instanceof EE_Attendee ? $attendee->email() : '';
552
-        return $this->columnContent('ATT_email', $content);
553
-    }
554
-
555
-
556
-    /**
557
-     * @param EE_Registration $registration
558
-     * @return bool|string
559
-     * @throws EE_Error
560
-     * @throws ReflectionException
561
-     */
562
-    public function column_Event(EE_Registration $registration)
563
-    {
564
-        try {
565
-            $event            = $this->_evt instanceof EE_Event ? $this->_evt : $registration->event();
566
-            $checkin_link_url = EE_Admin_Page::add_query_args_and_nonce(
567
-                ['action' => 'event_registrations', 'event_id' => $event->ID()],
568
-                REG_ADMIN_URL
569
-            );
570
-            $content      = EE_Registry::instance()->CAP->current_user_can(
571
-                'ee_read_checkins',
572
-                'espresso_registrations_registration_checkins'
573
-            ) ? '<a class="ee-aria-tooltip" href="' . $checkin_link_url . '" aria-label="'
574
-                . esc_attr__(
575
-                    'View Checkins for this Event',
576
-                    'event_espresso'
577
-                ) . '">' . $event->name() . '</a>' : $event->name();
578
-        } catch (EntityNotFoundException $e) {
579
-            $content = esc_html__('Unknown', 'event_espresso');
580
-        }
581
-        return $this->columnContent('Event', $content);
582
-    }
583
-
584
-
585
-    /**
586
-     * @param EE_Registration $registration
587
-     * @return string
588
-     * @throws EE_Error
589
-     * @throws ReflectionException
590
-     */
591
-    public function column_PRC_name(EE_Registration $registration): string
592
-    {
593
-        $content = $registration->ticket() instanceof EE_Ticket
594
-            ? $registration->ticket()->name()
595
-            : esc_html__(
596
-                "Unknown",
597
-                "event_espresso"
598
-            );
599
-        return $this->columnContent('PRC_name', $content);
600
-    }
601
-
602
-
603
-    /**
604
-     * column_REG_final_price
605
-     *
606
-     * @param EE_Registration $registration
607
-     * @return string
608
-     * @throws EE_Error
609
-     */
610
-    public function column__REG_final_price(EE_Registration $registration): string
611
-    {
612
-        return $this->columnContent('_REG_final_price', $registration->pretty_final_price(), 'end');
613
-    }
614
-
615
-
616
-    /**
617
-     * column_TXN_paid
618
-     *
619
-     * @param EE_Registration $registration
620
-     * @return string
621
-     * @throws EE_Error
622
-     * @throws ReflectionException
623
-     */
624
-    public function column_TXN_paid(EE_Registration $registration): string
625
-    {
626
-        $content = '';
627
-        if ($registration->count() === 1) {
628
-            if ($registration->transaction()->paid() >= $registration->transaction()->total()) {
629
-                return '<div class="dashicons dashicons-yes green-icon"></div>';
630
-            } else {
631
-                $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(
632
-                    ['action' => 'view_transaction', 'TXN_ID' => $registration->transaction_ID()],
633
-                    TXN_ADMIN_URL
634
-                );
635
-                $content = EE_Registry::instance()->CAP->current_user_can(
636
-                    'ee_read_transaction',
637
-                    'espresso_transactions_view_transaction'
638
-                ) ? '
533
+			}
534
+		}
535
+		$content = (! empty($this->datetime_id) && ! empty($checkins))
536
+			? sprintf('%1$s %2$s', $name_link, $this->row_actions($actions, true))
537
+			: $name_link;
538
+		return $this->columnContent('ATT_name', $content);
539
+	}
540
+
541
+
542
+	/**
543
+	 * @param EE_Registration $registration
544
+	 * @return string
545
+	 * @throws EE_Error
546
+	 * @throws EE_Error
547
+	 */
548
+	public function column_ATT_email(EE_Registration $registration): string
549
+	{
550
+		$attendee = $registration->attendee();
551
+		$content = $attendee instanceof EE_Attendee ? $attendee->email() : '';
552
+		return $this->columnContent('ATT_email', $content);
553
+	}
554
+
555
+
556
+	/**
557
+	 * @param EE_Registration $registration
558
+	 * @return bool|string
559
+	 * @throws EE_Error
560
+	 * @throws ReflectionException
561
+	 */
562
+	public function column_Event(EE_Registration $registration)
563
+	{
564
+		try {
565
+			$event            = $this->_evt instanceof EE_Event ? $this->_evt : $registration->event();
566
+			$checkin_link_url = EE_Admin_Page::add_query_args_and_nonce(
567
+				['action' => 'event_registrations', 'event_id' => $event->ID()],
568
+				REG_ADMIN_URL
569
+			);
570
+			$content      = EE_Registry::instance()->CAP->current_user_can(
571
+				'ee_read_checkins',
572
+				'espresso_registrations_registration_checkins'
573
+			) ? '<a class="ee-aria-tooltip" href="' . $checkin_link_url . '" aria-label="'
574
+				. esc_attr__(
575
+					'View Checkins for this Event',
576
+					'event_espresso'
577
+				) . '">' . $event->name() . '</a>' : $event->name();
578
+		} catch (EntityNotFoundException $e) {
579
+			$content = esc_html__('Unknown', 'event_espresso');
580
+		}
581
+		return $this->columnContent('Event', $content);
582
+	}
583
+
584
+
585
+	/**
586
+	 * @param EE_Registration $registration
587
+	 * @return string
588
+	 * @throws EE_Error
589
+	 * @throws ReflectionException
590
+	 */
591
+	public function column_PRC_name(EE_Registration $registration): string
592
+	{
593
+		$content = $registration->ticket() instanceof EE_Ticket
594
+			? $registration->ticket()->name()
595
+			: esc_html__(
596
+				"Unknown",
597
+				"event_espresso"
598
+			);
599
+		return $this->columnContent('PRC_name', $content);
600
+	}
601
+
602
+
603
+	/**
604
+	 * column_REG_final_price
605
+	 *
606
+	 * @param EE_Registration $registration
607
+	 * @return string
608
+	 * @throws EE_Error
609
+	 */
610
+	public function column__REG_final_price(EE_Registration $registration): string
611
+	{
612
+		return $this->columnContent('_REG_final_price', $registration->pretty_final_price(), 'end');
613
+	}
614
+
615
+
616
+	/**
617
+	 * column_TXN_paid
618
+	 *
619
+	 * @param EE_Registration $registration
620
+	 * @return string
621
+	 * @throws EE_Error
622
+	 * @throws ReflectionException
623
+	 */
624
+	public function column_TXN_paid(EE_Registration $registration): string
625
+	{
626
+		$content = '';
627
+		if ($registration->count() === 1) {
628
+			if ($registration->transaction()->paid() >= $registration->transaction()->total()) {
629
+				return '<div class="dashicons dashicons-yes green-icon"></div>';
630
+			} else {
631
+				$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(
632
+					['action' => 'view_transaction', 'TXN_ID' => $registration->transaction_ID()],
633
+					TXN_ADMIN_URL
634
+				);
635
+				$content = EE_Registry::instance()->CAP->current_user_can(
636
+					'ee_read_transaction',
637
+					'espresso_transactions_view_transaction'
638
+				) ? '
639 639
 				<a class="ee-aria-tooltip ee-status-color--'
640
-                    . $registration->transaction()->status_ID()
641
-                    . '" href="'
642
-                    . $view_txn_lnk_url
643
-                    . '"  aria-label="'
644
-                    . esc_attr__('View Transaction', 'event_espresso')
645
-                    . '">
640
+					. $registration->transaction()->status_ID()
641
+					. '" href="'
642
+					. $view_txn_lnk_url
643
+					. '"  aria-label="'
644
+					. esc_attr__('View Transaction', 'event_espresso')
645
+					. '">
646 646
 						'
647
-                    . $registration->transaction()->pretty_paid()
648
-                    . '
647
+					. $registration->transaction()->pretty_paid()
648
+					. '
649 649
 					</a>
650 650
 				' : $registration->transaction()->pretty_paid();
651
-            }
652
-        }
653
-        return $this->columnContent('TXN_paid', $content, 'end');
654
-    }
655
-
656
-
657
-    /**
658
-     *        column_TXN_total
659
-     *
660
-     * @param EE_Registration $registration
661
-     * @return string
662
-     * @throws EE_Error
663
-     * @throws ReflectionException
664
-     */
665
-    public function column_TXN_total(EE_Registration $registration): string
666
-    {
667
-        $content = '';
668
-        $txn = $registration->transaction();
669
-        $view_txn_url = add_query_arg(['action' => 'view_transaction', 'TXN_ID' => $txn->ID()], TXN_ADMIN_URL);
670
-        if ($registration->get('REG_count') === 1) {
671
-            $line_total_obj = $txn->total_line_item();
672
-            $txn_total      = $line_total_obj instanceof EE_Line_Item
673
-                ? $line_total_obj->get_pretty('LIN_total')
674
-                : esc_html__(
675
-                    'View Transaction',
676
-                    'event_espresso'
677
-                );
678
-            $content = EE_Registry::instance()->CAP->current_user_can(
679
-                'ee_read_transaction',
680
-                'espresso_transactions_view_transaction'
681
-            ) ? '<a class="ee-aria-tooltip" href="'
682
-                . $view_txn_url
683
-                . '" aria-label="'
684
-                . esc_attr__('View Transaction', 'event_espresso')
685
-                . '">'
686
-                . $txn_total
687
-                . '</a>'
688
-                : $txn_total;
689
-        }
690
-        return $this->columnContent('TXN_total', $content, 'end');
691
-    }
651
+			}
652
+		}
653
+		return $this->columnContent('TXN_paid', $content, 'end');
654
+	}
655
+
656
+
657
+	/**
658
+	 *        column_TXN_total
659
+	 *
660
+	 * @param EE_Registration $registration
661
+	 * @return string
662
+	 * @throws EE_Error
663
+	 * @throws ReflectionException
664
+	 */
665
+	public function column_TXN_total(EE_Registration $registration): string
666
+	{
667
+		$content = '';
668
+		$txn = $registration->transaction();
669
+		$view_txn_url = add_query_arg(['action' => 'view_transaction', 'TXN_ID' => $txn->ID()], TXN_ADMIN_URL);
670
+		if ($registration->get('REG_count') === 1) {
671
+			$line_total_obj = $txn->total_line_item();
672
+			$txn_total      = $line_total_obj instanceof EE_Line_Item
673
+				? $line_total_obj->get_pretty('LIN_total')
674
+				: esc_html__(
675
+					'View Transaction',
676
+					'event_espresso'
677
+				);
678
+			$content = EE_Registry::instance()->CAP->current_user_can(
679
+				'ee_read_transaction',
680
+				'espresso_transactions_view_transaction'
681
+			) ? '<a class="ee-aria-tooltip" href="'
682
+				. $view_txn_url
683
+				. '" aria-label="'
684
+				. esc_attr__('View Transaction', 'event_espresso')
685
+				. '">'
686
+				. $txn_total
687
+				. '</a>'
688
+				: $txn_total;
689
+		}
690
+		return $this->columnContent('TXN_total', $content, 'end');
691
+	}
692 692
 }
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             'screen'   => $this->_admin_page->get_current_screen()->id,
119 119
         ];
120 120
 
121
-        $this->_columns      = [
121
+        $this->_columns = [
122 122
             'cb' => '<input type="checkbox" />', // Render a checkbox instead of text
123 123
             '_REG_att_checked_in' => esc_html__('Check In', 'event_espresso'),
124 124
             'ATT_name'            => esc_html__('Registrant', 'event_espresso'),
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
         $hide_expired_checked = $hide_expired ? 'checked' : '';
243 243
         $hide_upcoming_checked = $hide_upcoming ? 'checked' : '';
244 244
         // get datetimes for ALL active events (note possible capability restrictions)
245
-        $events   = $this->datetimes_for_event->getAllActiveDatetimesForAllEvents();
245
+        $events = $this->datetimes_for_event->getAllActiveDatetimesForAllEvents();
246 246
         $event_options[] = [
247 247
             'id'   => 0,
248 248
             'text' => esc_html__(' - select an event - ', 'event_espresso'),
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
         /** @var EE_Event $event */
251 251
         foreach ($events as $event) {
252 252
             // any registrations for this event?
253
-            if (! $event instanceof EE_Event/* || ! $event->get_count_of_all_registrations()*/) {
253
+            if ( ! $event instanceof EE_Event/* || ! $event->get_count_of_all_registrations()*/) {
254 254
                 continue;
255 255
             }
256 256
             $expired_class = $event->is_expired() ? 'ee-expired-event' : '';
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                     $event->name(),
263 263
                     $event
264 264
                 ),
265
-                'class' => $expired_class . $upcoming_class,
265
+                'class' => $expired_class.$upcoming_class,
266 266
             ];
267 267
             if ($event->ID() === $this->event_id) {
268 268
                 $hide_expired = $expired_class === '';
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
         <div class="ee-event-filter">
280 280
             <span>
281 281
                 <label for="event_id">
282
-                    ' . esc_html__('Check-in Status for', 'event_espresso') . '
282
+                    ' . esc_html__('Check-in Status for', 'event_espresso').'
283 283
                 </label>
284 284
                 ' . EEH_Form_Fields::select_input(
285 285
                     'event_id',
@@ -287,12 +287,12 @@  discard block
 block discarded – undo
287 287
                     $this->event_id,
288 288
                 '',
289 289
                     $select_class
290
-            ) . '
290
+            ).'
291 291
             </span>
292 292
             <span>
293 293
                 <label for="js-ee-hide-upcoming-events">
294
-                    <input type="checkbox" id="js-ee-hide-upcoming-events" name="hide_upcoming" ' . $hide_upcoming_checked . '>
295
-                    ' . esc_html__('Hide Upcoming Events', 'event_espresso') . '
294
+                    <input type="checkbox" id="js-ee-hide-upcoming-events" name="hide_upcoming" ' . $hide_upcoming_checked.'>
295
+                    ' . esc_html__('Hide Upcoming Events', 'event_espresso').'
296 296
                 </label>
297 297
                 <span class="dashicons dashicons-editor-help ee-aria-tooltip" aria-label="'
298 298
                      . esc_html__(
@@ -303,8 +303,8 @@  discard block
 block discarded – undo
303 303
             </span>
304 304
             <span>
305 305
                 <label for="js-ee-hide-expired-events">
306
-                    <input type="checkbox" id="js-ee-hide-expired-events" name="hide_expired" ' . $hide_expired_checked . '>
307
-                    ' . esc_html__('Hide Expired Events', 'event_espresso') . '
306
+                    <input type="checkbox" id="js-ee-hide-expired-events" name="hide_expired" ' . $hide_expired_checked.'>
307
+                    ' . esc_html__('Hide Expired Events', 'event_espresso').'
308 308
                 </label>
309 309
                 <span class="dashicons dashicons-editor-help ee-aria-tooltip" aria-label="'
310 310
                      . esc_html__(
@@ -320,12 +320,12 @@  discard block
 block discarded – undo
320 320
             $datetimes[0] = esc_html__(' - select a datetime - ', 'event_espresso');
321 321
             foreach ($datetimes_for_event as $datetime) {
322 322
                 $datetime_string              = $datetime->name();
323
-                $datetime_string              = ! empty($datetime_string) ? ' (' . $datetime_string . ')' : '';
323
+                $datetime_string              = ! empty($datetime_string) ? ' ('.$datetime_string.')' : '';
324 324
                 $datetime_string              =
325
-                    $datetime->start_date_and_time() . ' - ' . $datetime->end_date_and_time() . $datetime_string;
326
-                $datetimes[ $datetime->ID() ] = $datetime_string;
325
+                    $datetime->start_date_and_time().' - '.$datetime->end_date_and_time().$datetime_string;
326
+                $datetimes[$datetime->ID()] = $datetime_string;
327 327
             }
328
-            $input     = new EE_Select_Input(
328
+            $input = new EE_Select_Input(
329 329
                 $datetimes,
330 330
                 [
331 331
                     'html_name' => 'DTT_ID',
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
      */
357 357
     protected function _get_total_event_attendees(): int
358 358
     {
359
-        $query_params      = [];
359
+        $query_params = [];
360 360
         if ($this->event_id) {
361 361
             $query_params[0]['EVT_ID'] = $this->event_id;
362 362
         }
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
         if ($this->datetime_id) {
365 365
             $query_params[0]['Ticket.Datetime.DTT_ID'] = $this->datetime_id;
366 366
         }
367
-        $status_ids_array          = apply_filters(
367
+        $status_ids_array = apply_filters(
368 368
             'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array',
369 369
             [EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved]
370 370
         );
@@ -425,17 +425,17 @@  discard block
 block discarded – undo
425 425
             )
426 426
         ) {
427 427
             // overwrite the disabled attribute with data attributes for performing checkin
428
-            $attributes = 'data-_regid="' . $registration->ID() . '"';
429
-            $attributes .= ' data-dttid="' . $DTD_ID . '"';
430
-            $attributes .= ' data-nonce="' . wp_create_nonce('checkin_nonce') . '"';
428
+            $attributes = 'data-_regid="'.$registration->ID().'"';
429
+            $attributes .= ' data-dttid="'.$DTD_ID.'"';
430
+            $attributes .= ' data-nonce="'.wp_create_nonce('checkin_nonce').'"';
431 431
             $button_class .= ' clickable trigger-checkin';
432 432
         }
433 433
 
434 434
         $content = '
435
-        <button aria-label="' . $aria_label . '" class="' . $button_class . '" ' . $attributes . '>   
436
-            <span class="' . $dashicon_class . '" ></span>
435
+        <button aria-label="' . $aria_label.'" class="'.$button_class.'" '.$attributes.'>   
436
+            <span class="' . $dashicon_class.'" ></span>
437 437
         </button>
438
-        <span class="show-on-mobile-view-only">' . $this->column_ATT_name($registration) . '</span>';
438
+        <span class="show-on-mobile-view-only">' . $this->column_ATT_name($registration).'</span>';
439 439
         return $this->columnContent('_REG_att_checked_in', $content, 'center');
440 440
     }
441 441
 
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
     public function column_ATT_name(EE_Registration $registration): string
450 450
     {
451 451
         $attendee = $registration->attendee();
452
-        if (! $attendee instanceof EE_Attendee) {
452
+        if ( ! $attendee instanceof EE_Attendee) {
453 453
             return esc_html__('No contact record for this registration.', 'event_espresso');
454 454
         }
455 455
         // edit attendee link
@@ -457,32 +457,32 @@  discard block
 block discarded – undo
457 457
             ['action' => 'view_registration', '_REG_ID' => $registration->ID()],
458 458
             REG_ADMIN_URL
459 459
         );
460
-        $name_link    = '
461
-            <span class="ee-status-dot ee-status-bg--' . esc_attr($registration->status_ID()) . ' ee-aria-tooltip"
462
-            aria-label="' . EEH_Template::pretty_status($registration->status_ID(), false, 'sentence') . '">
460
+        $name_link = '
461
+            <span class="ee-status-dot ee-status-bg--' . esc_attr($registration->status_ID()).' ee-aria-tooltip"
462
+            aria-label="' . EEH_Template::pretty_status($registration->status_ID(), false, 'sentence').'">
463 463
             </span>';
464
-        $name_link    .= EE_Registry::instance()->CAP->current_user_can(
464
+        $name_link .= EE_Registry::instance()->CAP->current_user_can(
465 465
             'ee_edit_contacts',
466 466
             'espresso_registrations_edit_attendee'
467 467
         )
468
-            ? '<a class="ee-aria-tooltip" href="' . $edit_lnk_url . '" aria-label="' . esc_attr__(
468
+            ? '<a class="ee-aria-tooltip" href="'.$edit_lnk_url.'" aria-label="'.esc_attr__(
469 469
                 'View Registration Details',
470 470
                 'event_espresso'
471
-            ) . '">'
471
+            ).'">'
472 472
               . $registration->attendee()->full_name()
473 473
               . '</a>'
474 474
             : $registration->attendee()->full_name();
475
-        $name_link    .= $registration->count() === 1
475
+        $name_link .= $registration->count() === 1
476 476
             ? '&nbsp;<sup><div class="dashicons dashicons-star-filled gold-icon"></div></sup>	'
477 477
             : '';
478 478
         // add group details
479
-        $name_link .= '&nbsp;' . sprintf(
479
+        $name_link .= '&nbsp;'.sprintf(
480 480
             esc_html__('(%s of %s)', 'event_espresso'),
481 481
             $registration->count(),
482 482
             $registration->group_size()
483 483
         );
484 484
         // add regcode
485
-        $link      = EE_Admin_Page::add_query_args_and_nonce(
485
+        $link = EE_Admin_Page::add_query_args_and_nonce(
486 486
             ['action' => 'view_registration', '_REG_ID' => $registration->ID()],
487 487
             REG_ADMIN_URL
488 488
         );
@@ -492,15 +492,15 @@  discard block
 block discarded – undo
492 492
             'view_registration',
493 493
             $registration->ID()
494 494
         )
495
-            ? '<a class="ee-aria-tooltip" href="' . $link . '" aria-label="' . esc_attr__(
495
+            ? '<a class="ee-aria-tooltip" href="'.$link.'" aria-label="'.esc_attr__(
496 496
                 'View Registration Details',
497 497
                 'event_espresso'
498
-            ) . '">'
498
+            ).'">'
499 499
               . $registration->reg_code()
500 500
               . '</a>'
501 501
             : $registration->reg_code();
502 502
 
503
-        $actions                 = [];
503
+        $actions = [];
504 504
         if (
505 505
             $this->datetime_id
506 506
             && EE_Registry::instance()->CAP->current_user_can(
@@ -515,24 +515,24 @@  discard block
 block discarded – undo
515 515
             // get the timestamps for this registration's checkins, related to the selected datetime
516 516
             /** @var EE_Checkin[] $checkins */
517 517
             $checkins = $registration->get_many_related('Checkin', [['DTT_ID' => $this->datetime_id]]);
518
-            if (! empty($checkins)) {
518
+            if ( ! empty($checkins)) {
519 519
                 // get the last timestamp
520 520
                 $last_checkin = end($checkins);
521 521
                 // get timestamp string
522 522
                 $timestamp_string   = $last_checkin->get_datetime('CHK_timestamp');
523 523
                 $actions['checkin'] = '
524 524
                     <a  class="ee-aria-tooltip" 
525
-                        href="' . $checkin_list_url . '" 
525
+                        href="' . $checkin_list_url.'" 
526 526
                         aria-label="' . esc_attr__(
527 527
                                           'View this registrant\'s check-ins/checkouts for the datetime',
528 528
                                           'event_espresso'
529
-                                      ) . '"
529
+                                      ).'"
530 530
                     >
531
-                        ' . $last_checkin->getCheckInText() . ': ' . $timestamp_string . '
531
+                        ' . $last_checkin->getCheckInText().': '.$timestamp_string.'
532 532
                     </a>';
533 533
             }
534 534
         }
535
-        $content = (! empty($this->datetime_id) && ! empty($checkins))
535
+        $content = ( ! empty($this->datetime_id) && ! empty($checkins))
536 536
             ? sprintf('%1$s %2$s', $name_link, $this->row_actions($actions, true))
537 537
             : $name_link;
538 538
         return $this->columnContent('ATT_name', $content);
@@ -567,14 +567,14 @@  discard block
 block discarded – undo
567 567
                 ['action' => 'event_registrations', 'event_id' => $event->ID()],
568 568
                 REG_ADMIN_URL
569 569
             );
570
-            $content      = EE_Registry::instance()->CAP->current_user_can(
570
+            $content = EE_Registry::instance()->CAP->current_user_can(
571 571
                 'ee_read_checkins',
572 572
                 'espresso_registrations_registration_checkins'
573
-            ) ? '<a class="ee-aria-tooltip" href="' . $checkin_link_url . '" aria-label="'
573
+            ) ? '<a class="ee-aria-tooltip" href="'.$checkin_link_url.'" aria-label="'
574 574
                 . esc_attr__(
575 575
                     'View Checkins for this Event',
576 576
                     'event_espresso'
577
-                ) . '">' . $event->name() . '</a>' : $event->name();
577
+                ).'">'.$event->name().'</a>' : $event->name();
578 578
         } catch (EntityNotFoundException $e) {
579 579
             $content = esc_html__('Unknown', 'event_espresso');
580 580
         }
Please login to merge, or discard this patch.