Completed
Branch dev (810229)
by
unknown
09:00 queued 06:28
created
core/domain/services/capabilities/FeatureFlags.php 1 patch
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -14,73 +14,73 @@
 block discarded – undo
14 14
 class FeatureFlags
15 15
 {
16 16
 
17
-    /**
18
-     * @var CapabilitiesChecker $capabilities_checker
19
-     */
20
-    private $capabilities_checker;
17
+	/**
18
+	 * @var CapabilitiesChecker $capabilities_checker
19
+	 */
20
+	private $capabilities_checker;
21 21
 
22
-    /**
23
-     * array of key value pairs where the key is the feature flag in question
24
-     * and the value is either a boolean or a CapCheck object defining the required permissions
25
-     * example:
26
-     *       [
27
-     *          'use_bulk_edit' => true,
28
-     *          'use_death_ray' => new CapCheck( 'ee-death-ray-cap', 'context-desc' )
29
-     *      ]
30
-     * array is filterable via FHEE__EventEspresso_core_domain_services_capabilities_FeatureFlags
31
-     *
32
-     * @var boolean[]|CapCheck[]
33
-     */
34
-    private $feature_flags;
22
+	/**
23
+	 * array of key value pairs where the key is the feature flag in question
24
+	 * and the value is either a boolean or a CapCheck object defining the required permissions
25
+	 * example:
26
+	 *       [
27
+	 *          'use_bulk_edit' => true,
28
+	 *          'use_death_ray' => new CapCheck( 'ee-death-ray-cap', 'context-desc' )
29
+	 *      ]
30
+	 * array is filterable via FHEE__EventEspresso_core_domain_services_capabilities_FeatureFlags
31
+	 *
32
+	 * @var boolean[]|CapCheck[]
33
+	 */
34
+	private $feature_flags;
35 35
 
36 36
 
37
-    /**
38
-     * FeatureFlags constructor.
39
-     *
40
-     * @param CapabilitiesChecker $capabilities_checker
41
-     */
42
-    public function __construct(CapabilitiesChecker $capabilities_checker)
43
-    {
44
-        $this->capabilities_checker = $capabilities_checker;
45
-        $this->feature_flags = apply_filters(
46
-            'FHEE__EventEspresso_core_domain_services_capabilities_FeatureFlags',
47
-            [
48
-                'use_advanced_event_editor'  => false,
49
-                'ee_event_editor_bulk_edit'  => false,
50
-                'use_default_ticket_manager' => false,
51
-                'use_event_description_rte'  => false,
52
-                'use_experimental_rte'       => false,
53
-                'use_reg_form_builder'       => false,
54
-                'use_reg_options_meta_box'   => false,
55
-            ]
56
-        );
57
-    }
37
+	/**
38
+	 * FeatureFlags constructor.
39
+	 *
40
+	 * @param CapabilitiesChecker $capabilities_checker
41
+	 */
42
+	public function __construct(CapabilitiesChecker $capabilities_checker)
43
+	{
44
+		$this->capabilities_checker = $capabilities_checker;
45
+		$this->feature_flags = apply_filters(
46
+			'FHEE__EventEspresso_core_domain_services_capabilities_FeatureFlags',
47
+			[
48
+				'use_advanced_event_editor'  => false,
49
+				'ee_event_editor_bulk_edit'  => false,
50
+				'use_default_ticket_manager' => false,
51
+				'use_event_description_rte'  => false,
52
+				'use_experimental_rte'       => false,
53
+				'use_reg_form_builder'       => false,
54
+				'use_reg_options_meta_box'   => false,
55
+			]
56
+		);
57
+	}
58 58
 
59 59
 
60
-    /**
61
-     * @param string $feature
62
-     * @return bool
63
-     */
64
-    public function allowed(string $feature): bool
65
-    {
66
-        $flag = $this->feature_flags[ $feature ] ?? false;
67
-        try {
68
-            return $flag instanceof CapCheck
69
-                ? $this->capabilities_checker->processCapCheck($flag)
70
-                : filter_var($flag, FILTER_VALIDATE_BOOLEAN);
71
-        } catch (InsufficientPermissionsException $e) {
72
-            // eat the exception
73
-        }
74
-        return false;
75
-    }
60
+	/**
61
+	 * @param string $feature
62
+	 * @return bool
63
+	 */
64
+	public function allowed(string $feature): bool
65
+	{
66
+		$flag = $this->feature_flags[ $feature ] ?? false;
67
+		try {
68
+			return $flag instanceof CapCheck
69
+				? $this->capabilities_checker->processCapCheck($flag)
70
+				: filter_var($flag, FILTER_VALIDATE_BOOLEAN);
71
+		} catch (InsufficientPermissionsException $e) {
72
+			// eat the exception
73
+		}
74
+		return false;
75
+	}
76 76
 
77 77
 
78
-    /**
79
-     * @return array
80
-     */
81
-    public function getAllowedFeatures(): array
82
-    {
83
-        $allowed = array_filter($this->feature_flags, [$this, 'allowed'], ARRAY_FILTER_USE_KEY);
84
-        return array_keys($allowed);
85
-    }
78
+	/**
79
+	 * @return array
80
+	 */
81
+	public function getAllowedFeatures(): array
82
+	{
83
+		$allowed = array_filter($this->feature_flags, [$this, 'allowed'], ARRAY_FILTER_USE_KEY);
84
+		return array_keys($allowed);
85
+	}
86 86
 }
Please login to merge, or discard this patch.
caffeinated/admin/extend/events/Extend_Events_Admin_Page.core.php 1 patch
Indentation   +1358 added lines, -1358 removed lines patch added patch discarded remove patch
@@ -15,1362 +15,1362 @@
 block discarded – undo
15 15
 class Extend_Events_Admin_Page extends Events_Admin_Page
16 16
 {
17 17
 
18
-    /**
19
-     * @var EE_Admin_Config
20
-     */
21
-    protected $admin_config;
22
-
23
-
24
-    /**
25
-     * Extend_Events_Admin_Page constructor.
26
-     *
27
-     * @param bool $routing
28
-     * @throws EE_Error
29
-     * @throws ReflectionException
30
-     */
31
-    public function __construct($routing = true)
32
-    {
33
-        if (! defined('EVENTS_CAF_TEMPLATE_PATH')) {
34
-            define('EVENTS_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'events/templates/');
35
-            define('EVENTS_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'events/assets/');
36
-            define('EVENTS_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'events/assets/');
37
-        }
38
-        parent::__construct($routing);
39
-        $this->admin_config = $this->loader->getShared('EE_Admin_Config');
40
-    }
41
-
42
-
43
-    /**
44
-     * Sets routes.
45
-     *
46
-     * @throws EE_Error
47
-     */
48
-    protected function _extend_page_config()
49
-    {
50
-        $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'events';
51
-        // is there a evt_id in the request?
52
-        $EVT_ID             = $this->request->getRequestParam('EVT_ID', 0, 'int');
53
-        $EVT_ID             = $this->request->getRequestParam('post', $EVT_ID, 'int');
54
-        $TKT_ID             = $this->request->getRequestParam('TKT_ID', 0, 'int');
55
-        $new_page_routes    = [
56
-            'duplicate_event'          => [
57
-                'func'       => '_duplicate_event',
58
-                'capability' => 'ee_edit_event',
59
-                'obj_id'     => $EVT_ID,
60
-                'noheader'   => true,
61
-            ],
62
-            'import_page'              => [
63
-                'func'       => '_import_page',
64
-                'capability' => 'import',
65
-            ],
66
-            'import'                   => [
67
-                'func'       => '_import_events',
68
-                'capability' => 'import',
69
-                'noheader'   => true,
70
-            ],
71
-            'import_events'            => [
72
-                'func'       => '_import_events',
73
-                'capability' => 'import',
74
-                'noheader'   => true,
75
-            ],
76
-            'export_events'            => [
77
-                'func'       => '_events_export',
78
-                'capability' => 'export',
79
-                'noheader'   => true,
80
-            ],
81
-            'export_categories'        => [
82
-                'func'       => '_categories_export',
83
-                'capability' => 'export',
84
-                'noheader'   => true,
85
-            ],
86
-            'sample_export_file'       => [
87
-                'func'       => '_sample_export_file',
88
-                'capability' => 'export',
89
-                'noheader'   => true,
90
-            ],
91
-            'update_template_settings' => [
92
-                'func'       => '_update_template_settings',
93
-                'capability' => 'manage_options',
94
-                'noheader'   => true,
95
-            ],
96
-            'ticket_list_table'        => [
97
-                'func'       => '_tickets_overview_list_table',
98
-                'capability' => 'ee_read_default_tickets',
99
-            ],
100
-        ];
101
-        $this->_page_config['create_new']['metaboxes'][] = '_premium_event_editor_meta_boxes';
102
-        $this->_page_config['edit']['metaboxes'][]       = '_premium_event_editor_meta_boxes';
103
-        // don't load these meta boxes if using the advanced editor
104
-        if (
105
-            ! $this->admin_config->useAdvancedEditor()
106
-            || ! $this->feature->allowed('use_default_ticket_manager')
107
-        ) {
108
-            $this->_page_config['create_new']['qtips'][] = 'EE_Event_Editor_Tips';
109
-            $this->_page_config['edit']['qtips'][]       = 'EE_Event_Editor_Tips';
110
-
111
-            $legacy_editor_page_routes = [
112
-                'trash_ticket'    => [
113
-                    'func'       => '_trash_or_restore_ticket',
114
-                    'capability' => 'ee_delete_default_ticket',
115
-                    'obj_id'     => $TKT_ID,
116
-                    'noheader'   => true,
117
-                    'args'       => ['trash' => true],
118
-                ],
119
-                'trash_tickets'   => [
120
-                    'func'       => '_trash_or_restore_ticket',
121
-                    'capability' => 'ee_delete_default_tickets',
122
-                    'noheader'   => true,
123
-                    'args'       => ['trash' => true],
124
-                ],
125
-                'restore_ticket'  => [
126
-                    'func'       => '_trash_or_restore_ticket',
127
-                    'capability' => 'ee_delete_default_ticket',
128
-                    'obj_id'     => $TKT_ID,
129
-                    'noheader'   => true,
130
-                ],
131
-                'restore_tickets' => [
132
-                    'func'       => '_trash_or_restore_ticket',
133
-                    'capability' => 'ee_delete_default_tickets',
134
-                    'noheader'   => true,
135
-                ],
136
-                'delete_ticket'   => [
137
-                    'func'       => '_delete_ticket',
138
-                    'capability' => 'ee_delete_default_ticket',
139
-                    'obj_id'     => $TKT_ID,
140
-                    'noheader'   => true,
141
-                ],
142
-                'delete_tickets'  => [
143
-                    'func'       => '_delete_ticket',
144
-                    'capability' => 'ee_delete_default_tickets',
145
-                    'noheader'   => true,
146
-                ],
147
-            ];
148
-            $new_page_routes           = array_merge($new_page_routes, $legacy_editor_page_routes);
149
-        }
150
-
151
-        $this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
152
-        // partial route/config override
153
-        $this->_page_config['import_events']['metaboxes'] = $this->_default_espresso_metaboxes;
154
-        $this->_page_config['default']['list_table']      = 'Extend_Events_Admin_List_Table';
155
-        // add tickets tab but only if there are more than one default ticket!
156
-        $ticket_count = EEM_Ticket::instance()->count_deleted_and_undeleted(
157
-            [['TKT_is_default' => 1]],
158
-            'TKT_ID',
159
-            true
160
-        );
161
-        if ($ticket_count > 1) {
162
-            $new_page_config = [
163
-                'ticket_list_table' => [
164
-                    'nav'           => [
165
-                        'label' => esc_html__('Default Tickets', 'event_espresso'),
166
-                        'order' => 60,
167
-                    ],
168
-                    'list_table'    => 'Tickets_List_Table',
169
-                    'require_nonce' => false,
170
-                ],
171
-            ];
172
-        }
173
-        // template settings
174
-        $new_page_config['template_settings'] = [
175
-            'nav'           => [
176
-                'label' => esc_html__('Templates', 'event_espresso'),
177
-                'order' => 30,
178
-            ],
179
-            'metaboxes'     => array_merge($this->_default_espresso_metaboxes, ['_publish_post_box']),
180
-            'help_tabs'     => [
181
-                'general_settings_templates_help_tab' => [
182
-                    'title'    => esc_html__('Templates', 'event_espresso'),
183
-                    'filename' => 'general_settings_templates',
184
-                ],
185
-            ],
186
-            'require_nonce' => false,
187
-        ];
188
-        $this->_page_config                   = array_merge($this->_page_config, $new_page_config);
189
-        // add filters and actions
190
-        // modifying _views
191
-        add_filter(
192
-            'FHEE_event_datetime_metabox_add_additional_date_time_template',
193
-            [$this, 'add_additional_datetime_button'],
194
-            10,
195
-            2
196
-        );
197
-        add_filter(
198
-            'FHEE_event_datetime_metabox_clone_button_template',
199
-            [$this, 'add_datetime_clone_button'],
200
-            10,
201
-            2
202
-        );
203
-        add_filter(
204
-            'FHEE_event_datetime_metabox_timezones_template',
205
-            [$this, 'datetime_timezones_template'],
206
-            10,
207
-            2
208
-        );
209
-        // filters for event list table
210
-        add_filter('FHEE__Extend_Events_Admin_List_Table__filters', [$this, 'list_table_filters'], 10, 2);
211
-        add_filter(
212
-            'FHEE__Events_Admin_List_Table__column_actions__action_links',
213
-            [$this, 'extra_list_table_actions'],
214
-            10,
215
-            2
216
-        );
217
-        // legend item
218
-        add_filter('FHEE__Events_Admin_Page___event_legend_items__items', [$this, 'additional_legend_items']);
219
-        add_action('admin_init', [$this, 'admin_init']);
220
-    }
221
-
222
-
223
-    /**
224
-     * admin_init
225
-     */
226
-    public function admin_init()
227
-    {
228
-        EE_Registry::$i18n_js_strings = array_merge(
229
-            EE_Registry::$i18n_js_strings,
230
-            [
231
-                'image_confirm'          => esc_html__(
232
-                    'Do you really want to delete this image? Please remember to update your event to complete the removal.',
233
-                    'event_espresso'
234
-                ),
235
-                'event_starts_on'        => esc_html__('Event Starts on', 'event_espresso'),
236
-                'event_ends_on'          => esc_html__('Event Ends on', 'event_espresso'),
237
-                'event_datetime_actions' => esc_html__('Actions', 'event_espresso'),
238
-                'event_clone_dt_msg'     => esc_html__('Clone this Event Date and Time', 'event_espresso'),
239
-                'remove_event_dt_msg'    => esc_html__('Remove this Event Time', 'event_espresso'),
240
-            ]
241
-        );
242
-    }
243
-
244
-
245
-    /**
246
-     * Add per page screen options to the default ticket list table view.
247
-     *
248
-     * @throws InvalidArgumentException
249
-     * @throws InvalidDataTypeException
250
-     * @throws InvalidInterfaceException
251
-     */
252
-    protected function _add_screen_options_ticket_list_table()
253
-    {
254
-        $this->_per_page_screen_option();
255
-    }
256
-
257
-
258
-    /**
259
-     * @param string $return
260
-     * @param int    $id
261
-     * @param string $new_title
262
-     * @param string $new_slug
263
-     * @return string
264
-     */
265
-    public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug)
266
-    {
267
-        $return = parent::extra_permalink_field_buttons($return, $id, $new_title, $new_slug);
268
-        // make sure this is only when editing
269
-        if (! empty($id)) {
270
-            $href   = EE_Admin_Page::add_query_args_and_nonce(
271
-                ['action' => 'duplicate_event', 'EVT_ID' => $id],
272
-                $this->_admin_base_url
273
-            );
274
-            $title  = esc_attr__('Duplicate Event', 'event_espresso');
275
-            $return .= '<a href="'
276
-                       . $href
277
-                       . '" title="'
278
-                       . $title
279
-                       . '" id="ee-duplicate-event-button" class="button button-small"  value="duplicate_event">'
280
-                       . $title
281
-                       . '</a>';
282
-        }
283
-        return $return;
284
-    }
285
-
286
-
287
-    /**
288
-     * Set the list table views for the default ticket list table view.
289
-     */
290
-    public function _set_list_table_views_ticket_list_table()
291
-    {
292
-        $this->_views = [
293
-            'all'     => [
294
-                'slug'        => 'all',
295
-                'label'       => esc_html__('All', 'event_espresso'),
296
-                'count'       => 0,
297
-                'bulk_action' => [
298
-                    'trash_tickets' => esc_html__('Move to Trash', 'event_espresso'),
299
-                ],
300
-            ],
301
-            'trashed' => [
302
-                'slug'        => 'trashed',
303
-                'label'       => esc_html__('Trash', 'event_espresso'),
304
-                'count'       => 0,
305
-                'bulk_action' => [
306
-                    'restore_tickets' => esc_html__('Restore from Trash', 'event_espresso'),
307
-                    'delete_tickets'  => esc_html__('Delete Permanently', 'event_espresso'),
308
-                ],
309
-            ],
310
-        ];
311
-    }
312
-
313
-
314
-    /**
315
-     * Enqueue scripts and styles for the event editor.
316
-     */
317
-    public function load_scripts_styles_edit()
318
-    {
319
-        if (! $this->admin_config->useAdvancedEditor()) {
320
-            wp_register_script(
321
-                'ee-event-editor-heartbeat',
322
-                EVENTS_CAF_ASSETS_URL . 'event-editor-heartbeat.js',
323
-                ['ee_admin_js', 'heartbeat'],
324
-                EVENT_ESPRESSO_VERSION,
325
-                true
326
-            );
327
-            wp_enqueue_script('ee-accounting');
328
-            wp_enqueue_script('ee-event-editor-heartbeat');
329
-        }
330
-        wp_enqueue_script('event_editor_js');
331
-        // styles
332
-        wp_enqueue_style('espresso-ui-theme');
333
-    }
334
-
335
-
336
-    /**
337
-     * Returns template for the additional datetime.
338
-     *
339
-     * @param string $template
340
-     * @param array  $template_args
341
-     * @return string
342
-     * @throws DomainException
343
-     */
344
-    public function add_additional_datetime_button($template, $template_args)
345
-    {
346
-        return EEH_Template::display_template(
347
-            EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_add_additional_time.template.php',
348
-            $template_args,
349
-            true
350
-        );
351
-    }
352
-
353
-
354
-    /**
355
-     * Returns the template for cloning a datetime.
356
-     *
357
-     * @param $template
358
-     * @param $template_args
359
-     * @return string
360
-     * @throws DomainException
361
-     */
362
-    public function add_datetime_clone_button($template, $template_args)
363
-    {
364
-        return EEH_Template::display_template(
365
-            EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_metabox_clone_button.template.php',
366
-            $template_args,
367
-            true
368
-        );
369
-    }
370
-
371
-
372
-    /**
373
-     * Returns the template for datetime timezones.
374
-     *
375
-     * @param $template
376
-     * @param $template_args
377
-     * @return string
378
-     * @throws DomainException
379
-     */
380
-    public function datetime_timezones_template($template, $template_args)
381
-    {
382
-        return EEH_Template::display_template(
383
-            EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_timezones.template.php',
384
-            $template_args,
385
-            true
386
-        );
387
-    }
388
-
389
-
390
-    /**
391
-     * Sets the views for the default list table view.
392
-     *
393
-     * @throws EE_Error
394
-     */
395
-    protected function _set_list_table_views_default()
396
-    {
397
-        parent::_set_list_table_views_default();
398
-        $new_views    = [
399
-            'today' => [
400
-                'slug'        => 'today',
401
-                'label'       => esc_html__('Today', 'event_espresso'),
402
-                'count'       => $this->total_events_today(),
403
-                'bulk_action' => [
404
-                    'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
405
-                ],
406
-            ],
407
-            'month' => [
408
-                'slug'        => 'month',
409
-                'label'       => esc_html__('This Month', 'event_espresso'),
410
-                'count'       => $this->total_events_this_month(),
411
-                'bulk_action' => [
412
-                    'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
413
-                ],
414
-            ],
415
-        ];
416
-        $this->_views = array_merge($this->_views, $new_views);
417
-    }
418
-
419
-
420
-    /**
421
-     * Returns the extra action links for the default list table view.
422
-     *
423
-     * @param array    $action_links
424
-     * @param EE_Event $event
425
-     * @return array
426
-     * @throws EE_Error
427
-     * @throws ReflectionException
428
-     */
429
-    public function extra_list_table_actions(array $action_links, EE_Event $event)
430
-    {
431
-        if (
432
-            EE_Registry::instance()->CAP->current_user_can(
433
-                'ee_read_registrations',
434
-                'espresso_registrations_reports',
435
-                $event->ID()
436
-            )
437
-        ) {
438
-            $reports_query_args = [
439
-                'action' => 'reports',
440
-                'EVT_ID' => $event->ID(),
441
-            ];
442
-            $reports_link       = EE_Admin_Page::add_query_args_and_nonce($reports_query_args, REG_ADMIN_URL);
443
-            $action_links[]     = '<a href="'
444
-                                  . $reports_link
445
-                                  . '" title="'
446
-                                  . esc_attr__('View Report', 'event_espresso')
447
-                                  . '"><div class="dashicons dashicons-chart-bar"></div></a>'
448
-                                  . "\n\t";
449
-        }
450
-        if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
451
-            EE_Registry::instance()->load_helper('MSG_Template');
452
-            $action_links[] = EEH_MSG_Template::get_message_action_link(
453
-                'see_notifications_for',
454
-                null,
455
-                ['EVT_ID' => $event->ID()]
456
-            );
457
-        }
458
-        return $action_links;
459
-    }
460
-
461
-
462
-    /**
463
-     * @param $items
464
-     * @return mixed
465
-     */
466
-    public function additional_legend_items($items)
467
-    {
468
-        if (
469
-            EE_Registry::instance()->CAP->current_user_can(
470
-                'ee_read_registrations',
471
-                'espresso_registrations_reports'
472
-            )
473
-        ) {
474
-            $items['reports'] = [
475
-                'class' => 'dashicons dashicons-chart-bar',
476
-                'desc'  => esc_html__('Event Reports', 'event_espresso'),
477
-            ];
478
-        }
479
-        if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
480
-            $related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for');
481
-            // $related_for_icon can sometimes be a string so 'css_class' would be an illegal offset
482
-            // (can only use numeric offsets when treating strings as arrays)
483
-            if (is_array($related_for_icon) && isset($related_for_icon['css_class'], $related_for_icon['label'])) {
484
-                $items['view_related_messages'] = [
485
-                    'class' => $related_for_icon['css_class'],
486
-                    'desc'  => $related_for_icon['label'],
487
-                ];
488
-            }
489
-        }
490
-        return $items;
491
-    }
492
-
493
-
494
-    /**
495
-     * This is the callback method for the duplicate event route
496
-     * Method looks for 'EVT_ID' in the request and retrieves that event and its details and duplicates them
497
-     * into a new event.  We add a hook so that any plugins that add extra event details can hook into this
498
-     * action.  Note that the dupe will have **DUPLICATE** as its title and slug.
499
-     * After duplication the redirect is to the new event edit page.
500
-     *
501
-     * @return void
502
-     * @throws EE_Error If EE_Event is not available with given ID
503
-     * @throws ReflectionException
504
-     * @access protected
505
-     */
506
-    protected function _duplicate_event()
507
-    {
508
-        // first make sure the ID for the event is in the request.
509
-        //  If it isn't then we need to bail and redirect back to overview list table (cause how did we get here?)
510
-        $EVT_ID = $this->request->getRequestParam('EVT_ID', 0, 'int');
511
-        if (! $EVT_ID) {
512
-            EE_Error::add_error(
513
-                esc_html__(
514
-                    'In order to duplicate an event an Event ID is required.  None was given.',
515
-                    'event_espresso'
516
-                ),
517
-                __FILE__,
518
-                __FUNCTION__,
519
-                __LINE__
520
-            );
521
-            $this->_redirect_after_action(false, '', '', [], true);
522
-            return;
523
-        }
524
-        // k we've got EVT_ID so let's use that to get the event we'll duplicate
525
-        $orig_event = EEM_Event::instance()->get_one_by_ID($EVT_ID);
526
-        if (! $orig_event instanceof EE_Event) {
527
-            throw new EE_Error(
528
-                sprintf(
529
-                    esc_html__('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso'),
530
-                    $EVT_ID
531
-                )
532
-            );
533
-        }
534
-        // k now let's clone the $orig_event before getting relations
535
-        $new_event = clone $orig_event;
536
-        // original datetimes
537
-        $orig_datetimes = $orig_event->get_many_related('Datetime');
538
-        // other original relations
539
-        $orig_ven = $orig_event->get_many_related('Venue');
540
-        // reset the ID and modify other details to make it clear this is a dupe
541
-        $new_event->set('EVT_ID', 0);
542
-        $new_name = $new_event->name() . ' ' . esc_html__('**DUPLICATE**', 'event_espresso');
543
-        $new_event->set('EVT_name', $new_name);
544
-        $new_event->set(
545
-            'EVT_slug',
546
-            wp_unique_post_slug(
547
-                sanitize_title($orig_event->name()),
548
-                0,
549
-                'publish',
550
-                'espresso_events',
551
-                0
552
-            )
553
-        );
554
-        $new_event->set('status', 'draft');
555
-        // duplicate discussion settings
556
-        $new_event->set('comment_status', $orig_event->get('comment_status'));
557
-        $new_event->set('ping_status', $orig_event->get('ping_status'));
558
-        // save the new event
559
-        $new_event->save();
560
-        // venues
561
-        foreach ($orig_ven as $ven) {
562
-            $new_event->_add_relation_to($ven, 'Venue');
563
-        }
564
-        $new_event->save();
565
-        // now we need to get the question group relations and handle that
566
-        // first primary question groups
567
-        $orig_primary_qgs = $orig_event->get_many_related(
568
-            'Question_Group',
569
-            [['Event_Question_Group.EQG_primary' => true]]
570
-        );
571
-        if (! empty($orig_primary_qgs)) {
572
-            foreach ($orig_primary_qgs as $obj) {
573
-                if ($obj instanceof EE_Question_Group) {
574
-                    $new_event->_add_relation_to($obj, 'Question_Group', ['EQG_primary' => true]);
575
-                }
576
-            }
577
-        }
578
-        // next additional attendee question groups
579
-        $orig_additional_qgs = $orig_event->get_many_related(
580
-            'Question_Group',
581
-            [['Event_Question_Group.EQG_additional' => true]]
582
-        );
583
-        if (! empty($orig_additional_qgs)) {
584
-            foreach ($orig_additional_qgs as $obj) {
585
-                if ($obj instanceof EE_Question_Group) {
586
-                    $new_event->_add_relation_to($obj, 'Question_Group', ['EQG_additional' => true]);
587
-                }
588
-            }
589
-        }
590
-
591
-        $new_event->save();
592
-
593
-        // k now that we have the new event saved we can loop through the datetimes and start adding relations.
594
-        $cloned_tickets = [];
595
-        foreach ($orig_datetimes as $orig_dtt) {
596
-            if (! $orig_dtt instanceof EE_Datetime) {
597
-                continue;
598
-            }
599
-            $new_dtt      = clone $orig_dtt;
600
-            $orig_tickets = $orig_dtt->tickets();
601
-            // save new dtt then add to event
602
-            $new_dtt->set('DTT_ID', 0);
603
-            $new_dtt->set('DTT_sold', 0);
604
-            $new_dtt->set_reserved(0);
605
-            $new_dtt->save();
606
-            $new_event->_add_relation_to($new_dtt, 'Datetime');
607
-            $new_event->save();
608
-            // now let's get the ticket relations setup.
609
-            foreach ((array) $orig_tickets as $orig_ticket) {
610
-                // it's possible a datetime will have no tickets so let's verify we HAVE a ticket first.
611
-                if (! $orig_ticket instanceof EE_Ticket) {
612
-                    continue;
613
-                }
614
-                // is this ticket archived?  If it is then let's skip
615
-                if ($orig_ticket->get('TKT_deleted')) {
616
-                    continue;
617
-                }
618
-                // does this original ticket already exist in the clone_tickets cache?
619
-                //  If so we'll just use the new ticket from it.
620
-                if (isset($cloned_tickets[ $orig_ticket->ID() ])) {
621
-                    $new_ticket = $cloned_tickets[ $orig_ticket->ID() ];
622
-                } else {
623
-                    $new_ticket = clone $orig_ticket;
624
-                    // get relations on the $orig_ticket that we need to setup.
625
-                    $orig_prices = $orig_ticket->prices();
626
-                    $new_ticket->set('TKT_ID', 0);
627
-                    $new_ticket->set('TKT_sold', 0);
628
-                    $new_ticket->set('TKT_reserved', 0);
629
-                    $new_ticket->save(); // make sure new ticket has ID.
630
-                    // price relations on new ticket need to be setup.
631
-                    foreach ($orig_prices as $orig_price) {
632
-                        $new_price = clone $orig_price;
633
-                        $new_price->set('PRC_ID', 0);
634
-                        $new_price->save();
635
-                        $new_ticket->_add_relation_to($new_price, 'Price');
636
-                        $new_ticket->save();
637
-                    }
638
-
639
-                    do_action(
640
-                        'AHEE__Extend_Events_Admin_Page___duplicate_event__duplicate_ticket__after',
641
-                        $orig_ticket,
642
-                        $new_ticket,
643
-                        $orig_prices,
644
-                        $orig_event,
645
-                        $orig_dtt,
646
-                        $new_dtt
647
-                    );
648
-                }
649
-                // k now we can add the new ticket as a relation to the new datetime
650
-                // and make sure its added to our cached $cloned_tickets array
651
-                // for use with later datetimes that have the same ticket.
652
-                $new_dtt->_add_relation_to($new_ticket, 'Ticket');
653
-                $new_dtt->save();
654
-                $cloned_tickets[ $orig_ticket->ID() ] = $new_ticket;
655
-            }
656
-        }
657
-        // clone taxonomy information
658
-        $taxonomies_to_clone_with = apply_filters(
659
-            'FHEE__Extend_Events_Admin_Page___duplicate_event__taxonomies_to_clone',
660
-            ['espresso_event_categories', 'espresso_event_type', 'post_tag']
661
-        );
662
-        // get terms for original event (notice)
663
-        $orig_terms = wp_get_object_terms($orig_event->ID(), $taxonomies_to_clone_with);
664
-        // loop through terms and add them to new event.
665
-        foreach ($orig_terms as $term) {
666
-            wp_set_object_terms($new_event->ID(), $term->term_id, $term->taxonomy, true);
667
-        }
668
-
669
-        // duplicate other core WP_Post items for this event.
670
-        // post thumbnail (feature image).
671
-        $feature_image_id = get_post_thumbnail_id($orig_event->ID());
672
-        if ($feature_image_id) {
673
-            update_post_meta($new_event->ID(), '_thumbnail_id', $feature_image_id);
674
-        }
675
-
676
-        // duplicate page_template setting
677
-        $page_template = get_post_meta($orig_event->ID(), '_wp_page_template', true);
678
-        if ($page_template) {
679
-            update_post_meta($new_event->ID(), '_wp_page_template', $page_template);
680
-        }
681
-
682
-        do_action('AHEE__Extend_Events_Admin_Page___duplicate_event__after', $new_event, $orig_event);
683
-        // now let's redirect to the edit page for this duplicated event if we have a new event id.
684
-        if ($new_event->ID()) {
685
-            $redirect_args = [
686
-                'post'   => $new_event->ID(),
687
-                'action' => 'edit',
688
-            ];
689
-            EE_Error::add_success(
690
-                esc_html__(
691
-                    'Event successfully duplicated.  Please review the details below and make any necessary edits',
692
-                    'event_espresso'
693
-                )
694
-            );
695
-        } else {
696
-            $redirect_args = [
697
-                'action' => 'default',
698
-            ];
699
-            EE_Error::add_error(
700
-                esc_html__('Not able to duplicate event.  Something went wrong.', 'event_espresso'),
701
-                __FILE__,
702
-                __FUNCTION__,
703
-                __LINE__
704
-            );
705
-        }
706
-        $this->_redirect_after_action(false, '', '', $redirect_args, true);
707
-    }
708
-
709
-
710
-    /**
711
-     * Generates output for the import page.
712
-     *
713
-     * @throws EE_Error
714
-     */
715
-    protected function _import_page()
716
-    {
717
-        $title                                      = esc_html__('Import', 'event_espresso');
718
-        $intro                                      = esc_html__(
719
-            'If you have a previously exported Event Espresso 4 information in a Comma Separated Value (CSV) file format, you can upload the file here: ',
720
-            'event_espresso'
721
-        );
722
-
723
-        $form_url = EVENTS_ADMIN_URL;
724
-        $action   = 'import_events';
725
-        $type     = 'csv';
726
-
727
-        $this->_template_args['form'] = EE_Import::instance()->upload_form(
728
-            $title,
729
-            $intro,
730
-            $form_url,
731
-            $action,
732
-            $type
733
-        );
734
-
735
-        $this->_template_args['sample_file_link']   = EE_Admin_Page::add_query_args_and_nonce(
736
-            ['action' => 'sample_export_file'],
737
-            $this->_admin_base_url
738
-        );
739
-        $this->_template_args['admin_page_content'] = EEH_Template::display_template(
740
-            EVENTS_CAF_TEMPLATE_PATH . 'import_page.template.php',
741
-            $this->_template_args,
742
-            true
743
-        );
744
-        $this->display_admin_page_with_sidebar();
745
-    }
746
-
747
-
748
-    /**
749
-     * _import_events
750
-     * This handles displaying the screen and running imports for importing events.
751
-     *
752
-     * @return void
753
-     * @throws EE_Error
754
-     */
755
-    protected function _import_events()
756
-    {
757
-        require_once(EE_CLASSES . 'EE_Import.class.php');
758
-        $success = EE_Import::instance()->import();
759
-        $this->_redirect_after_action(
760
-            $success,
761
-            esc_html__('Import File', 'event_espresso'),
762
-            'ran',
763
-            ['action' => 'import_page'],
764
-            true
765
-        );
766
-    }
767
-
768
-
769
-    /**
770
-     * _events_export
771
-     * Will export all (or just the given event) to a Excel compatible file.
772
-     *
773
-     * @access protected
774
-     * @return void
775
-     */
776
-    protected function _events_export()
777
-    {
778
-        $EVT_ID = $this->request->getRequestParam('EVT_ID', 0, 'int');
779
-        $EVT_ID = $this->request->getRequestParam('EVT_IDs', $EVT_ID, 'int');
780
-        $this->request->mergeRequestParams(
781
-            [
782
-                'export' => 'report',
783
-                'action' => 'all_event_data',
784
-                'EVT_ID' => $EVT_ID,
785
-            ]
786
-        );
787
-        if (is_readable(EE_CLASSES . 'EE_Export.class.php')) {
788
-            require_once(EE_CLASSES . 'EE_Export.class.php');
789
-            $EE_Export = EE_Export::instance($this->request->requestParams());
790
-            $EE_Export->export();
791
-        }
792
-    }
793
-
794
-
795
-    /**
796
-     * handle category exports()
797
-     *
798
-     * @return void
799
-     */
800
-    protected function _categories_export()
801
-    {
802
-        $EVT_ID = $this->request->getRequestParam('EVT_CAT_ID', 0, 'int');
803
-        $this->request->mergeRequestParams(
804
-            [
805
-                'export' => 'report',
806
-                'action' => 'categories',
807
-                'EVT_ID' => $EVT_ID,
808
-            ]
809
-        );
810
-        if (is_readable(EE_CLASSES . 'EE_Export.class.php')) {
811
-            require_once(EE_CLASSES . 'EE_Export.class.php');
812
-            $EE_Export = EE_Export::instance($this->request->requestParams());
813
-            $EE_Export->export();
814
-        }
815
-    }
816
-
817
-
818
-    /**
819
-     * Creates a sample CSV file for importing
820
-     */
821
-    protected function _sample_export_file()
822
-    {
823
-        $EE_Export = EE_Export::instance();
824
-        if ($EE_Export instanceof EE_Export) {
825
-            $EE_Export->export();
826
-        }
827
-    }
828
-
829
-
830
-    /*************        Template Settings        *************/
831
-    /**
832
-     * Generates template settings page output
833
-     *
834
-     * @throws DomainException
835
-     * @throws EE_Error
836
-     * @throws InvalidArgumentException
837
-     * @throws InvalidDataTypeException
838
-     * @throws InvalidInterfaceException
839
-     */
840
-    protected function _template_settings()
841
-    {
842
-        $this->_template_args['values'] = $this->_yes_no_values;
843
-        /**
844
-         * Note leaving this filter in for backward compatibility this was moved in 4.6.x
845
-         * from General_Settings_Admin_Page to here.
846
-         */
847
-        $this->_template_args = apply_filters(
848
-            'FHEE__General_Settings_Admin_Page__template_settings__template_args',
849
-            $this->_template_args
850
-        );
851
-        $this->_set_add_edit_form_tags('update_template_settings');
852
-        $this->_set_publish_post_box_vars(null, false, false, null, false);
853
-        $this->_template_args['admin_page_content'] = EEH_Template::display_template(
854
-            EVENTS_CAF_TEMPLATE_PATH . 'template_settings.template.php',
855
-            $this->_template_args,
856
-            true
857
-        );
858
-        $this->display_admin_page_with_sidebar();
859
-    }
860
-
861
-
862
-    /**
863
-     * Handler for updating template settings.
864
-     *
865
-     * @throws EE_Error
866
-     */
867
-    protected function _update_template_settings()
868
-    {
869
-        /**
870
-         * Note leaving this filter in for backward compatibility this was moved in 4.6.x
871
-         * from General_Settings_Admin_Page to here.
872
-         */
873
-        EE_Registry::instance()->CFG->template_settings = apply_filters(
874
-            'FHEE__General_Settings_Admin_Page__update_template_settings__data',
875
-            EE_Registry::instance()->CFG->template_settings,
876
-            $this->request->requestParams()
877
-        );
878
-        // update custom post type slugs and detect if we need to flush rewrite rules
879
-        $old_slug = EE_Registry::instance()->CFG->core->event_cpt_slug;
880
-
881
-        $event_cpt_slug = $this->request->getRequestParam('event_cpt_slug');
882
-
883
-        EE_Registry::instance()->CFG->core->event_cpt_slug = $event_cpt_slug
884
-            ? EEH_URL::slugify($event_cpt_slug, 'events')
885
-            : EE_Registry::instance()->CFG->core->event_cpt_slug;
886
-
887
-        $what    = esc_html__('Template Settings', 'event_espresso');
888
-        $success = $this->_update_espresso_configuration(
889
-            $what,
890
-            EE_Registry::instance()->CFG->template_settings,
891
-            __FILE__,
892
-            __FUNCTION__,
893
-            __LINE__
894
-        );
895
-        if (EE_Registry::instance()->CFG->core->event_cpt_slug !== $old_slug) {
896
-            /** @var EventEspresso\core\domain\services\custom_post_types\RewriteRules $rewrite_rules */
897
-            $rewrite_rules = LoaderFactory::getLoader()->getShared(
898
-                'EventEspresso\core\domain\services\custom_post_types\RewriteRules'
899
-            );
900
-            $rewrite_rules->flush();
901
-        }
902
-        $this->_redirect_after_action($success, $what, 'updated', ['action' => 'template_settings']);
903
-    }
904
-
905
-
906
-    /**
907
-     * _premium_event_editor_meta_boxes
908
-     * add all metaboxes related to the event_editor
909
-     *
910
-     * @access protected
911
-     * @return void
912
-     * @throws EE_Error
913
-     * @throws ReflectionException
914
-     */
915
-    protected function _premium_event_editor_meta_boxes()
916
-    {
917
-        $this->verify_cpt_object();
918
-        // check if the new EDTR reg options meta box is being used, and if so, don't load the legacy version
919
-        if (
920
-            ! $this->admin_config->useAdvancedEditor()
921
-            || ! $this->feature->allowed('use_reg_options_meta_box')
922
-        ) {
923
-            add_meta_box(
924
-                'espresso_event_editor_event_options',
925
-                esc_html__('Event Registration Options', 'event_espresso'),
926
-                [$this, 'registration_options_meta_box'],
927
-                $this->page_slug,
928
-                'side',
929
-                'core'
930
-            );
931
-        }
932
-    }
933
-
934
-
935
-    /**
936
-     * override caf metabox
937
-     *
938
-     * @return void
939
-     * @throws EE_Error
940
-     * @throws ReflectionException
941
-     */
942
-    public function registration_options_meta_box()
943
-    {
944
-        $yes_no_values = [
945
-            ['id' => true, 'text' => esc_html__('Yes', 'event_espresso')],
946
-            ['id' => false, 'text' => esc_html__('No', 'event_espresso')],
947
-        ];
948
-
949
-        $default_reg_status_values = EEM_Registration::reg_status_array(
950
-            [
951
-                EEM_Registration::status_id_cancelled,
952
-                EEM_Registration::status_id_declined,
953
-                EEM_Registration::status_id_incomplete,
954
-                EEM_Registration::status_id_wait_list,
955
-            ],
956
-            true
957
-        );
958
-
959
-        $template_args['active_status']    = $this->_cpt_model_obj->pretty_active_status(false);
960
-        $template_args['_event']           = $this->_cpt_model_obj;
961
-        $template_args['additional_limit'] = $this->_cpt_model_obj->additional_limit();
962
-
963
-        $template_args['default_registration_status']     = EEH_Form_Fields::select_input(
964
-            'default_reg_status',
965
-            $default_reg_status_values,
966
-            $this->_cpt_model_obj->default_registration_status()
967
-        );
968
-        $template_args['display_description']             = EEH_Form_Fields::select_input(
969
-            'display_desc',
970
-            $yes_no_values,
971
-            $this->_cpt_model_obj->display_description()
972
-        );
973
-        $template_args['display_ticket_selector']         = EEH_Form_Fields::select_input(
974
-            'display_ticket_selector',
975
-            $yes_no_values,
976
-            $this->_cpt_model_obj->display_ticket_selector(),
977
-            '',
978
-            '',
979
-            false
980
-        );
981
-        $template_args['EVT_default_registration_status'] = EEH_Form_Fields::select_input(
982
-            'EVT_default_registration_status',
983
-            $default_reg_status_values,
984
-            $this->_cpt_model_obj->default_registration_status()
985
-        );
986
-        $template_args['additional_registration_options'] = apply_filters(
987
-            'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options',
988
-            '',
989
-            $template_args,
990
-            $yes_no_values,
991
-            $default_reg_status_values
992
-        );
993
-        EEH_Template::display_template(
994
-            EVENTS_CAF_TEMPLATE_PATH . 'event_registration_options.template.php',
995
-            $template_args
996
-        );
997
-    }
998
-
999
-
1000
-
1001
-    /**
1002
-     * wp_list_table_mods for caf
1003
-     * ============================
1004
-     */
1005
-    /**
1006
-     * hook into list table filters and provide filters for caffeinated list table
1007
-     *
1008
-     * @param array $old_filters    any existing filters present
1009
-     * @param array $list_table_obj the list table object
1010
-     * @return array                  new filters
1011
-     * @throws EE_Error
1012
-     * @throws ReflectionException
1013
-     */
1014
-    public function list_table_filters($old_filters, $list_table_obj)
1015
-    {
1016
-        $filters = [];
1017
-        // first month/year filters
1018
-        $filters[] = $this->espresso_event_months_dropdown();
1019
-        $status    = $this->request->getRequestParam('status');
1020
-        // active status dropdown
1021
-        if ($status !== 'draft') {
1022
-            $filters[] = $this->active_status_dropdown($this->request->getRequestParam('active_status'));
1023
-            $filters[] = $this->venuesDropdown($this->request->getRequestParam('venue'));
1024
-        }
1025
-        // category filter
1026
-        $filters[] = $this->category_dropdown();
1027
-        return array_merge($old_filters, $filters);
1028
-    }
1029
-
1030
-
1031
-    /**
1032
-     * espresso_event_months_dropdown
1033
-     *
1034
-     * @access public
1035
-     * @return string                dropdown listing month/year selections for events.
1036
-     * @throws EE_Error
1037
-     */
1038
-    public function espresso_event_months_dropdown()
1039
-    {
1040
-        // what we need to do is get all PRIMARY datetimes for all events to filter on.
1041
-        // Note we need to include any other filters that are set!
1042
-        return EEH_Form_Fields::generate_event_months_dropdown(
1043
-            $this->request->getRequestParam('month_range'),
1044
-            $this->request->getRequestParam('status'),
1045
-            $this->request->getRequestParam('EVT_CAT', 0, 'int'),
1046
-            $this->request->getRequestParam('active_status')
1047
-        );
1048
-    }
1049
-
1050
-
1051
-    /**
1052
-     * returns a list of "active" statuses on the event
1053
-     *
1054
-     * @param string $current_value whatever the current active status is
1055
-     * @return string
1056
-     */
1057
-    public function active_status_dropdown($current_value = '')
1058
-    {
1059
-        $select_name = 'active_status';
1060
-        $values      = [
1061
-            'none'     => esc_html__('Show Active/Inactive', 'event_espresso'),
1062
-            'active'   => esc_html__('Active', 'event_espresso'),
1063
-            'upcoming' => esc_html__('Upcoming', 'event_espresso'),
1064
-            'expired'  => esc_html__('Expired', 'event_espresso'),
1065
-            'inactive' => esc_html__('Inactive', 'event_espresso'),
1066
-        ];
1067
-
1068
-        return EEH_Form_Fields::select_input($select_name, $values, $current_value, '', 'wide');
1069
-    }
1070
-
1071
-
1072
-    /**
1073
-     * returns a list of "venues"
1074
-     *
1075
-     * @param string $current_value whatever the current active status is
1076
-     * @return string
1077
-     * @throws EE_Error
1078
-     * @throws ReflectionException
1079
-     */
1080
-    protected function venuesDropdown($current_value = '')
1081
-    {
1082
-        $values = ['' => esc_html__('All Venues', 'event_espresso')];
1083
-        // populate the list of venues.
1084
-        $venues = EEM_Venue::instance()->get_all(['order_by' => ['VNU_name' => 'ASC']]);
1085
-
1086
-        foreach ($venues as $venue) {
1087
-            $values[ $venue->ID() ] = $venue->name();
1088
-        }
1089
-
1090
-        return EEH_Form_Fields::select_input('venue', $values, $current_value, '', 'wide');
1091
-    }
1092
-
1093
-
1094
-    /**
1095
-     * output a dropdown of the categories for the category filter on the event admin list table
1096
-     *
1097
-     * @access  public
1098
-     * @return string html
1099
-     * @throws EE_Error
1100
-     * @throws ReflectionException
1101
-     */
1102
-    public function category_dropdown()
1103
-    {
1104
-        return EEH_Form_Fields::generate_event_category_dropdown(
1105
-            $this->request->getRequestParam('EVT_CAT', -1, 'int')
1106
-        );
1107
-    }
1108
-
1109
-
1110
-    /**
1111
-     * get total number of events today
1112
-     *
1113
-     * @access public
1114
-     * @return int
1115
-     * @throws EE_Error
1116
-     * @throws InvalidArgumentException
1117
-     * @throws InvalidDataTypeException
1118
-     * @throws InvalidInterfaceException
1119
-     */
1120
-    public function total_events_today()
1121
-    {
1122
-        $start = EEM_Datetime::instance()->convert_datetime_for_query(
1123
-            'DTT_EVT_start',
1124
-            date('Y-m-d') . ' 00:00:00',
1125
-            'Y-m-d H:i:s',
1126
-            'UTC'
1127
-        );
1128
-        $end   = EEM_Datetime::instance()->convert_datetime_for_query(
1129
-            'DTT_EVT_start',
1130
-            date('Y-m-d') . ' 23:59:59',
1131
-            'Y-m-d H:i:s',
1132
-            'UTC'
1133
-        );
1134
-        $where = [
1135
-            'Datetime.DTT_EVT_start' => ['BETWEEN', [$start, $end]],
1136
-        ];
1137
-        return EEM_Event::instance()->count([$where, 'caps' => 'read_admin'], 'EVT_ID', true);
1138
-    }
1139
-
1140
-
1141
-    /**
1142
-     * get total number of events this month
1143
-     *
1144
-     * @access public
1145
-     * @return int
1146
-     * @throws EE_Error
1147
-     * @throws InvalidArgumentException
1148
-     * @throws InvalidDataTypeException
1149
-     * @throws InvalidInterfaceException
1150
-     */
1151
-    public function total_events_this_month()
1152
-    {
1153
-        // Dates
1154
-        $this_year_r     = date('Y');
1155
-        $this_month_r    = date('m');
1156
-        $days_this_month = date('t');
1157
-        $start           = EEM_Datetime::instance()->convert_datetime_for_query(
1158
-            'DTT_EVT_start',
1159
-            $this_year_r . '-' . $this_month_r . '-01 00:00:00',
1160
-            'Y-m-d H:i:s',
1161
-            'UTC'
1162
-        );
1163
-        $end             = EEM_Datetime::instance()->convert_datetime_for_query(
1164
-            'DTT_EVT_start',
1165
-            $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' 23:59:59',
1166
-            'Y-m-d H:i:s',
1167
-            'UTC'
1168
-        );
1169
-        $where           = [
1170
-            'Datetime.DTT_EVT_start' => ['BETWEEN', [$start, $end]],
1171
-        ];
1172
-        return EEM_Event::instance()->count([$where, 'caps' => 'read_admin'], 'EVT_ID', true);
1173
-    }
1174
-
1175
-
1176
-    /** DEFAULT TICKETS STUFF **/
1177
-
1178
-    /**
1179
-     * Output default tickets list table view.
1180
-     *
1181
-     * @throws EE_Error
1182
-     */
1183
-    public function _tickets_overview_list_table()
1184
-    {
1185
-        if (
1186
-            $this->admin_config->useAdvancedEditor()
1187
-            && $this->feature->allowed('use_default_ticket_manager')
1188
-        ) {
1189
-            // check if the new EDTR reg options meta box is being used, and if so, don't load the legacy version
1190
-            $this->_template_args['admin_page_content'] = EEH_Template::display_template(
1191
-                EVENTS_CAF_TEMPLATE_PATH . 'default_tickets_moved_notice.template.php',
1192
-                [],
1193
-                true
1194
-            );
1195
-            $this->display_admin_page_with_no_sidebar();
1196
-        } else {
1197
-            $this->_search_btn_label = esc_html__('Tickets', 'event_espresso');
1198
-            $this->display_admin_list_table_page_with_no_sidebar();
1199
-        }
1200
-    }
1201
-
1202
-
1203
-    /**
1204
-     * @param int  $per_page
1205
-     * @param bool $count
1206
-     * @param bool $trashed
1207
-     * @return EE_Soft_Delete_Base_Class[]|int
1208
-     * @throws EE_Error
1209
-     */
1210
-    public function get_default_tickets($per_page = 10, $count = false, $trashed = false)
1211
-    {
1212
-        $orderby = $this->request->getRequestParam('orderby', 'TKT_name');
1213
-        $order   = $this->request->getRequestParam('order', 'ASC');
1214
-        switch ($orderby) {
1215
-            case 'TKT_name':
1216
-                $orderby = ['TKT_name' => $order];
1217
-                break;
1218
-            case 'TKT_price':
1219
-                $orderby = ['TKT_price' => $order];
1220
-                break;
1221
-            case 'TKT_uses':
1222
-                $orderby = ['TKT_uses' => $order];
1223
-                break;
1224
-            case 'TKT_min':
1225
-                $orderby = ['TKT_min' => $order];
1226
-                break;
1227
-            case 'TKT_max':
1228
-                $orderby = ['TKT_max' => $order];
1229
-                break;
1230
-            case 'TKT_qty':
1231
-                $orderby = ['TKT_qty' => $order];
1232
-                break;
1233
-        }
1234
-
1235
-        $current_page = $this->request->getRequestParam('paged', 1, 'int');
1236
-        $per_page     = $this->request->getRequestParam('perpage', $per_page, 'int');
1237
-        $offset       = ($current_page - 1) * $per_page;
1238
-
1239
-        $where = [
1240
-            'TKT_is_default' => 1,
1241
-            'TKT_deleted'    => $trashed,
1242
-        ];
1243
-
1244
-        $search_term = $this->request->getRequestParam('s');
1245
-        if ($search_term) {
1246
-            $search_term = '%' . $search_term . '%';
1247
-            $where['OR'] = [
1248
-                'TKT_name'        => ['LIKE', $search_term],
1249
-                'TKT_description' => ['LIKE', $search_term],
1250
-            ];
1251
-        }
1252
-
1253
-        return $count
1254
-            ? EEM_Ticket::instance()->count_deleted_and_undeleted([$where])
1255
-            : EEM_Ticket::instance()->get_all_deleted_and_undeleted(
1256
-                [
1257
-                    $where,
1258
-                    'order_by' => $orderby,
1259
-                    'limit'    => [$offset, $per_page],
1260
-                    'group_by' => 'TKT_ID',
1261
-                ]
1262
-            );
1263
-    }
1264
-
1265
-
1266
-    /**
1267
-     * @param bool $trash
1268
-     * @throws EE_Error
1269
-     * @throws InvalidArgumentException
1270
-     * @throws InvalidDataTypeException
1271
-     * @throws InvalidInterfaceException
1272
-     */
1273
-    protected function _trash_or_restore_ticket($trash = false)
1274
-    {
1275
-        $success = 1;
1276
-        $TKT     = EEM_Ticket::instance();
1277
-        // checkboxes?
1278
-        $checkboxes = $this->request->getRequestParam('checkbox', [], 'int', true);
1279
-        if (! empty($checkboxes)) {
1280
-            // if array has more than one element then success message should be plural
1281
-            $success = count($checkboxes) > 1 ? 2 : 1;
1282
-            // cycle thru the boxes
1283
-            while (list($TKT_ID, $value) = each($checkboxes)) {
1284
-                if ($trash) {
1285
-                    if (! $TKT->delete_by_ID($TKT_ID)) {
1286
-                        $success = 0;
1287
-                    }
1288
-                } elseif (! $TKT->restore_by_ID($TKT_ID)) {
1289
-                    $success = 0;
1290
-                }
1291
-            }
1292
-        } else {
1293
-            // grab single id and trash
1294
-            $TKT_ID = $this->request->getRequestParam('TKT_ID', 0, 'int');
1295
-            if ($trash) {
1296
-                if (! $TKT->delete_by_ID($TKT_ID)) {
1297
-                    $success = 0;
1298
-                }
1299
-            } elseif (! $TKT->restore_by_ID($TKT_ID)) {
1300
-                $success = 0;
1301
-            }
1302
-        }
1303
-        $action_desc = $trash ? 'moved to the trash' : 'restored';
1304
-        $query_args  = [
1305
-            'action' => 'ticket_list_table',
1306
-            'status' => $trash ? '' : 'trashed',
1307
-        ];
1308
-        $this->_redirect_after_action($success, esc_html__('Tickets', 'event_espresso'), $action_desc, $query_args);
1309
-    }
1310
-
1311
-
1312
-    /**
1313
-     * Handles trashing default ticket.
1314
-     *
1315
-     * @throws EE_Error
1316
-     * @throws ReflectionException
1317
-     */
1318
-    protected function _delete_ticket()
1319
-    {
1320
-        $success = 1;
1321
-        // checkboxes?
1322
-        $checkboxes = $this->request->getRequestParam('checkbox', [], 'int', true);
1323
-        if (! empty($checkboxes)) {
1324
-            // if array has more than one element then success message should be plural
1325
-            $success = count($checkboxes) > 1 ? 2 : 1;
1326
-            // cycle thru the boxes
1327
-            while (list($TKT_ID, $value) = each($checkboxes)) {
1328
-                // delete
1329
-                if (! $this->_delete_the_ticket($TKT_ID)) {
1330
-                    $success = 0;
1331
-                }
1332
-            }
1333
-        } else {
1334
-            // grab single id and trash
1335
-            $TKT_ID = $this->request->getRequestParam('TKT_ID', 0, 'int');
1336
-            if (! $this->_delete_the_ticket($TKT_ID)) {
1337
-                $success = 0;
1338
-            }
1339
-        }
1340
-        $action_desc = 'deleted';
1341
-        $query_args  = [
1342
-            'action' => 'ticket_list_table',
1343
-            'status' => 'trashed',
1344
-        ];
1345
-        // fail safe.  If the default ticket count === 1 then we need to redirect to event overview.
1346
-        if (
1347
-            EEM_Ticket::instance()->count_deleted_and_undeleted(
1348
-                [['TKT_is_default' => 1]],
1349
-                'TKT_ID',
1350
-                true
1351
-            )
1352
-        ) {
1353
-            $query_args = [];
1354
-        }
1355
-        $this->_redirect_after_action($success, esc_html__('Tickets', 'event_espresso'), $action_desc, $query_args);
1356
-    }
1357
-
1358
-
1359
-    /**
1360
-     * @param int $TKT_ID
1361
-     * @return bool|int
1362
-     * @throws EE_Error
1363
-     * @throws ReflectionException
1364
-     */
1365
-    protected function _delete_the_ticket($TKT_ID)
1366
-    {
1367
-        $ticket = EEM_Ticket::instance()->get_one_by_ID($TKT_ID);
1368
-        if (! $ticket instanceof EE_Ticket) {
1369
-            return false;
1370
-        }
1371
-        $ticket->_remove_relations('Datetime');
1372
-        // delete all related prices first
1373
-        $ticket->delete_related_permanently('Price');
1374
-        return $ticket->delete_permanently();
1375
-    }
18
+	/**
19
+	 * @var EE_Admin_Config
20
+	 */
21
+	protected $admin_config;
22
+
23
+
24
+	/**
25
+	 * Extend_Events_Admin_Page constructor.
26
+	 *
27
+	 * @param bool $routing
28
+	 * @throws EE_Error
29
+	 * @throws ReflectionException
30
+	 */
31
+	public function __construct($routing = true)
32
+	{
33
+		if (! defined('EVENTS_CAF_TEMPLATE_PATH')) {
34
+			define('EVENTS_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'events/templates/');
35
+			define('EVENTS_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'events/assets/');
36
+			define('EVENTS_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'events/assets/');
37
+		}
38
+		parent::__construct($routing);
39
+		$this->admin_config = $this->loader->getShared('EE_Admin_Config');
40
+	}
41
+
42
+
43
+	/**
44
+	 * Sets routes.
45
+	 *
46
+	 * @throws EE_Error
47
+	 */
48
+	protected function _extend_page_config()
49
+	{
50
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'events';
51
+		// is there a evt_id in the request?
52
+		$EVT_ID             = $this->request->getRequestParam('EVT_ID', 0, 'int');
53
+		$EVT_ID             = $this->request->getRequestParam('post', $EVT_ID, 'int');
54
+		$TKT_ID             = $this->request->getRequestParam('TKT_ID', 0, 'int');
55
+		$new_page_routes    = [
56
+			'duplicate_event'          => [
57
+				'func'       => '_duplicate_event',
58
+				'capability' => 'ee_edit_event',
59
+				'obj_id'     => $EVT_ID,
60
+				'noheader'   => true,
61
+			],
62
+			'import_page'              => [
63
+				'func'       => '_import_page',
64
+				'capability' => 'import',
65
+			],
66
+			'import'                   => [
67
+				'func'       => '_import_events',
68
+				'capability' => 'import',
69
+				'noheader'   => true,
70
+			],
71
+			'import_events'            => [
72
+				'func'       => '_import_events',
73
+				'capability' => 'import',
74
+				'noheader'   => true,
75
+			],
76
+			'export_events'            => [
77
+				'func'       => '_events_export',
78
+				'capability' => 'export',
79
+				'noheader'   => true,
80
+			],
81
+			'export_categories'        => [
82
+				'func'       => '_categories_export',
83
+				'capability' => 'export',
84
+				'noheader'   => true,
85
+			],
86
+			'sample_export_file'       => [
87
+				'func'       => '_sample_export_file',
88
+				'capability' => 'export',
89
+				'noheader'   => true,
90
+			],
91
+			'update_template_settings' => [
92
+				'func'       => '_update_template_settings',
93
+				'capability' => 'manage_options',
94
+				'noheader'   => true,
95
+			],
96
+			'ticket_list_table'        => [
97
+				'func'       => '_tickets_overview_list_table',
98
+				'capability' => 'ee_read_default_tickets',
99
+			],
100
+		];
101
+		$this->_page_config['create_new']['metaboxes'][] = '_premium_event_editor_meta_boxes';
102
+		$this->_page_config['edit']['metaboxes'][]       = '_premium_event_editor_meta_boxes';
103
+		// don't load these meta boxes if using the advanced editor
104
+		if (
105
+			! $this->admin_config->useAdvancedEditor()
106
+			|| ! $this->feature->allowed('use_default_ticket_manager')
107
+		) {
108
+			$this->_page_config['create_new']['qtips'][] = 'EE_Event_Editor_Tips';
109
+			$this->_page_config['edit']['qtips'][]       = 'EE_Event_Editor_Tips';
110
+
111
+			$legacy_editor_page_routes = [
112
+				'trash_ticket'    => [
113
+					'func'       => '_trash_or_restore_ticket',
114
+					'capability' => 'ee_delete_default_ticket',
115
+					'obj_id'     => $TKT_ID,
116
+					'noheader'   => true,
117
+					'args'       => ['trash' => true],
118
+				],
119
+				'trash_tickets'   => [
120
+					'func'       => '_trash_or_restore_ticket',
121
+					'capability' => 'ee_delete_default_tickets',
122
+					'noheader'   => true,
123
+					'args'       => ['trash' => true],
124
+				],
125
+				'restore_ticket'  => [
126
+					'func'       => '_trash_or_restore_ticket',
127
+					'capability' => 'ee_delete_default_ticket',
128
+					'obj_id'     => $TKT_ID,
129
+					'noheader'   => true,
130
+				],
131
+				'restore_tickets' => [
132
+					'func'       => '_trash_or_restore_ticket',
133
+					'capability' => 'ee_delete_default_tickets',
134
+					'noheader'   => true,
135
+				],
136
+				'delete_ticket'   => [
137
+					'func'       => '_delete_ticket',
138
+					'capability' => 'ee_delete_default_ticket',
139
+					'obj_id'     => $TKT_ID,
140
+					'noheader'   => true,
141
+				],
142
+				'delete_tickets'  => [
143
+					'func'       => '_delete_ticket',
144
+					'capability' => 'ee_delete_default_tickets',
145
+					'noheader'   => true,
146
+				],
147
+			];
148
+			$new_page_routes           = array_merge($new_page_routes, $legacy_editor_page_routes);
149
+		}
150
+
151
+		$this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
152
+		// partial route/config override
153
+		$this->_page_config['import_events']['metaboxes'] = $this->_default_espresso_metaboxes;
154
+		$this->_page_config['default']['list_table']      = 'Extend_Events_Admin_List_Table';
155
+		// add tickets tab but only if there are more than one default ticket!
156
+		$ticket_count = EEM_Ticket::instance()->count_deleted_and_undeleted(
157
+			[['TKT_is_default' => 1]],
158
+			'TKT_ID',
159
+			true
160
+		);
161
+		if ($ticket_count > 1) {
162
+			$new_page_config = [
163
+				'ticket_list_table' => [
164
+					'nav'           => [
165
+						'label' => esc_html__('Default Tickets', 'event_espresso'),
166
+						'order' => 60,
167
+					],
168
+					'list_table'    => 'Tickets_List_Table',
169
+					'require_nonce' => false,
170
+				],
171
+			];
172
+		}
173
+		// template settings
174
+		$new_page_config['template_settings'] = [
175
+			'nav'           => [
176
+				'label' => esc_html__('Templates', 'event_espresso'),
177
+				'order' => 30,
178
+			],
179
+			'metaboxes'     => array_merge($this->_default_espresso_metaboxes, ['_publish_post_box']),
180
+			'help_tabs'     => [
181
+				'general_settings_templates_help_tab' => [
182
+					'title'    => esc_html__('Templates', 'event_espresso'),
183
+					'filename' => 'general_settings_templates',
184
+				],
185
+			],
186
+			'require_nonce' => false,
187
+		];
188
+		$this->_page_config                   = array_merge($this->_page_config, $new_page_config);
189
+		// add filters and actions
190
+		// modifying _views
191
+		add_filter(
192
+			'FHEE_event_datetime_metabox_add_additional_date_time_template',
193
+			[$this, 'add_additional_datetime_button'],
194
+			10,
195
+			2
196
+		);
197
+		add_filter(
198
+			'FHEE_event_datetime_metabox_clone_button_template',
199
+			[$this, 'add_datetime_clone_button'],
200
+			10,
201
+			2
202
+		);
203
+		add_filter(
204
+			'FHEE_event_datetime_metabox_timezones_template',
205
+			[$this, 'datetime_timezones_template'],
206
+			10,
207
+			2
208
+		);
209
+		// filters for event list table
210
+		add_filter('FHEE__Extend_Events_Admin_List_Table__filters', [$this, 'list_table_filters'], 10, 2);
211
+		add_filter(
212
+			'FHEE__Events_Admin_List_Table__column_actions__action_links',
213
+			[$this, 'extra_list_table_actions'],
214
+			10,
215
+			2
216
+		);
217
+		// legend item
218
+		add_filter('FHEE__Events_Admin_Page___event_legend_items__items', [$this, 'additional_legend_items']);
219
+		add_action('admin_init', [$this, 'admin_init']);
220
+	}
221
+
222
+
223
+	/**
224
+	 * admin_init
225
+	 */
226
+	public function admin_init()
227
+	{
228
+		EE_Registry::$i18n_js_strings = array_merge(
229
+			EE_Registry::$i18n_js_strings,
230
+			[
231
+				'image_confirm'          => esc_html__(
232
+					'Do you really want to delete this image? Please remember to update your event to complete the removal.',
233
+					'event_espresso'
234
+				),
235
+				'event_starts_on'        => esc_html__('Event Starts on', 'event_espresso'),
236
+				'event_ends_on'          => esc_html__('Event Ends on', 'event_espresso'),
237
+				'event_datetime_actions' => esc_html__('Actions', 'event_espresso'),
238
+				'event_clone_dt_msg'     => esc_html__('Clone this Event Date and Time', 'event_espresso'),
239
+				'remove_event_dt_msg'    => esc_html__('Remove this Event Time', 'event_espresso'),
240
+			]
241
+		);
242
+	}
243
+
244
+
245
+	/**
246
+	 * Add per page screen options to the default ticket list table view.
247
+	 *
248
+	 * @throws InvalidArgumentException
249
+	 * @throws InvalidDataTypeException
250
+	 * @throws InvalidInterfaceException
251
+	 */
252
+	protected function _add_screen_options_ticket_list_table()
253
+	{
254
+		$this->_per_page_screen_option();
255
+	}
256
+
257
+
258
+	/**
259
+	 * @param string $return
260
+	 * @param int    $id
261
+	 * @param string $new_title
262
+	 * @param string $new_slug
263
+	 * @return string
264
+	 */
265
+	public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug)
266
+	{
267
+		$return = parent::extra_permalink_field_buttons($return, $id, $new_title, $new_slug);
268
+		// make sure this is only when editing
269
+		if (! empty($id)) {
270
+			$href   = EE_Admin_Page::add_query_args_and_nonce(
271
+				['action' => 'duplicate_event', 'EVT_ID' => $id],
272
+				$this->_admin_base_url
273
+			);
274
+			$title  = esc_attr__('Duplicate Event', 'event_espresso');
275
+			$return .= '<a href="'
276
+					   . $href
277
+					   . '" title="'
278
+					   . $title
279
+					   . '" id="ee-duplicate-event-button" class="button button-small"  value="duplicate_event">'
280
+					   . $title
281
+					   . '</a>';
282
+		}
283
+		return $return;
284
+	}
285
+
286
+
287
+	/**
288
+	 * Set the list table views for the default ticket list table view.
289
+	 */
290
+	public function _set_list_table_views_ticket_list_table()
291
+	{
292
+		$this->_views = [
293
+			'all'     => [
294
+				'slug'        => 'all',
295
+				'label'       => esc_html__('All', 'event_espresso'),
296
+				'count'       => 0,
297
+				'bulk_action' => [
298
+					'trash_tickets' => esc_html__('Move to Trash', 'event_espresso'),
299
+				],
300
+			],
301
+			'trashed' => [
302
+				'slug'        => 'trashed',
303
+				'label'       => esc_html__('Trash', 'event_espresso'),
304
+				'count'       => 0,
305
+				'bulk_action' => [
306
+					'restore_tickets' => esc_html__('Restore from Trash', 'event_espresso'),
307
+					'delete_tickets'  => esc_html__('Delete Permanently', 'event_espresso'),
308
+				],
309
+			],
310
+		];
311
+	}
312
+
313
+
314
+	/**
315
+	 * Enqueue scripts and styles for the event editor.
316
+	 */
317
+	public function load_scripts_styles_edit()
318
+	{
319
+		if (! $this->admin_config->useAdvancedEditor()) {
320
+			wp_register_script(
321
+				'ee-event-editor-heartbeat',
322
+				EVENTS_CAF_ASSETS_URL . 'event-editor-heartbeat.js',
323
+				['ee_admin_js', 'heartbeat'],
324
+				EVENT_ESPRESSO_VERSION,
325
+				true
326
+			);
327
+			wp_enqueue_script('ee-accounting');
328
+			wp_enqueue_script('ee-event-editor-heartbeat');
329
+		}
330
+		wp_enqueue_script('event_editor_js');
331
+		// styles
332
+		wp_enqueue_style('espresso-ui-theme');
333
+	}
334
+
335
+
336
+	/**
337
+	 * Returns template for the additional datetime.
338
+	 *
339
+	 * @param string $template
340
+	 * @param array  $template_args
341
+	 * @return string
342
+	 * @throws DomainException
343
+	 */
344
+	public function add_additional_datetime_button($template, $template_args)
345
+	{
346
+		return EEH_Template::display_template(
347
+			EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_add_additional_time.template.php',
348
+			$template_args,
349
+			true
350
+		);
351
+	}
352
+
353
+
354
+	/**
355
+	 * Returns the template for cloning a datetime.
356
+	 *
357
+	 * @param $template
358
+	 * @param $template_args
359
+	 * @return string
360
+	 * @throws DomainException
361
+	 */
362
+	public function add_datetime_clone_button($template, $template_args)
363
+	{
364
+		return EEH_Template::display_template(
365
+			EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_metabox_clone_button.template.php',
366
+			$template_args,
367
+			true
368
+		);
369
+	}
370
+
371
+
372
+	/**
373
+	 * Returns the template for datetime timezones.
374
+	 *
375
+	 * @param $template
376
+	 * @param $template_args
377
+	 * @return string
378
+	 * @throws DomainException
379
+	 */
380
+	public function datetime_timezones_template($template, $template_args)
381
+	{
382
+		return EEH_Template::display_template(
383
+			EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_timezones.template.php',
384
+			$template_args,
385
+			true
386
+		);
387
+	}
388
+
389
+
390
+	/**
391
+	 * Sets the views for the default list table view.
392
+	 *
393
+	 * @throws EE_Error
394
+	 */
395
+	protected function _set_list_table_views_default()
396
+	{
397
+		parent::_set_list_table_views_default();
398
+		$new_views    = [
399
+			'today' => [
400
+				'slug'        => 'today',
401
+				'label'       => esc_html__('Today', 'event_espresso'),
402
+				'count'       => $this->total_events_today(),
403
+				'bulk_action' => [
404
+					'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
405
+				],
406
+			],
407
+			'month' => [
408
+				'slug'        => 'month',
409
+				'label'       => esc_html__('This Month', 'event_espresso'),
410
+				'count'       => $this->total_events_this_month(),
411
+				'bulk_action' => [
412
+					'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
413
+				],
414
+			],
415
+		];
416
+		$this->_views = array_merge($this->_views, $new_views);
417
+	}
418
+
419
+
420
+	/**
421
+	 * Returns the extra action links for the default list table view.
422
+	 *
423
+	 * @param array    $action_links
424
+	 * @param EE_Event $event
425
+	 * @return array
426
+	 * @throws EE_Error
427
+	 * @throws ReflectionException
428
+	 */
429
+	public function extra_list_table_actions(array $action_links, EE_Event $event)
430
+	{
431
+		if (
432
+			EE_Registry::instance()->CAP->current_user_can(
433
+				'ee_read_registrations',
434
+				'espresso_registrations_reports',
435
+				$event->ID()
436
+			)
437
+		) {
438
+			$reports_query_args = [
439
+				'action' => 'reports',
440
+				'EVT_ID' => $event->ID(),
441
+			];
442
+			$reports_link       = EE_Admin_Page::add_query_args_and_nonce($reports_query_args, REG_ADMIN_URL);
443
+			$action_links[]     = '<a href="'
444
+								  . $reports_link
445
+								  . '" title="'
446
+								  . esc_attr__('View Report', 'event_espresso')
447
+								  . '"><div class="dashicons dashicons-chart-bar"></div></a>'
448
+								  . "\n\t";
449
+		}
450
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
451
+			EE_Registry::instance()->load_helper('MSG_Template');
452
+			$action_links[] = EEH_MSG_Template::get_message_action_link(
453
+				'see_notifications_for',
454
+				null,
455
+				['EVT_ID' => $event->ID()]
456
+			);
457
+		}
458
+		return $action_links;
459
+	}
460
+
461
+
462
+	/**
463
+	 * @param $items
464
+	 * @return mixed
465
+	 */
466
+	public function additional_legend_items($items)
467
+	{
468
+		if (
469
+			EE_Registry::instance()->CAP->current_user_can(
470
+				'ee_read_registrations',
471
+				'espresso_registrations_reports'
472
+			)
473
+		) {
474
+			$items['reports'] = [
475
+				'class' => 'dashicons dashicons-chart-bar',
476
+				'desc'  => esc_html__('Event Reports', 'event_espresso'),
477
+			];
478
+		}
479
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
480
+			$related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for');
481
+			// $related_for_icon can sometimes be a string so 'css_class' would be an illegal offset
482
+			// (can only use numeric offsets when treating strings as arrays)
483
+			if (is_array($related_for_icon) && isset($related_for_icon['css_class'], $related_for_icon['label'])) {
484
+				$items['view_related_messages'] = [
485
+					'class' => $related_for_icon['css_class'],
486
+					'desc'  => $related_for_icon['label'],
487
+				];
488
+			}
489
+		}
490
+		return $items;
491
+	}
492
+
493
+
494
+	/**
495
+	 * This is the callback method for the duplicate event route
496
+	 * Method looks for 'EVT_ID' in the request and retrieves that event and its details and duplicates them
497
+	 * into a new event.  We add a hook so that any plugins that add extra event details can hook into this
498
+	 * action.  Note that the dupe will have **DUPLICATE** as its title and slug.
499
+	 * After duplication the redirect is to the new event edit page.
500
+	 *
501
+	 * @return void
502
+	 * @throws EE_Error If EE_Event is not available with given ID
503
+	 * @throws ReflectionException
504
+	 * @access protected
505
+	 */
506
+	protected function _duplicate_event()
507
+	{
508
+		// first make sure the ID for the event is in the request.
509
+		//  If it isn't then we need to bail and redirect back to overview list table (cause how did we get here?)
510
+		$EVT_ID = $this->request->getRequestParam('EVT_ID', 0, 'int');
511
+		if (! $EVT_ID) {
512
+			EE_Error::add_error(
513
+				esc_html__(
514
+					'In order to duplicate an event an Event ID is required.  None was given.',
515
+					'event_espresso'
516
+				),
517
+				__FILE__,
518
+				__FUNCTION__,
519
+				__LINE__
520
+			);
521
+			$this->_redirect_after_action(false, '', '', [], true);
522
+			return;
523
+		}
524
+		// k we've got EVT_ID so let's use that to get the event we'll duplicate
525
+		$orig_event = EEM_Event::instance()->get_one_by_ID($EVT_ID);
526
+		if (! $orig_event instanceof EE_Event) {
527
+			throw new EE_Error(
528
+				sprintf(
529
+					esc_html__('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso'),
530
+					$EVT_ID
531
+				)
532
+			);
533
+		}
534
+		// k now let's clone the $orig_event before getting relations
535
+		$new_event = clone $orig_event;
536
+		// original datetimes
537
+		$orig_datetimes = $orig_event->get_many_related('Datetime');
538
+		// other original relations
539
+		$orig_ven = $orig_event->get_many_related('Venue');
540
+		// reset the ID and modify other details to make it clear this is a dupe
541
+		$new_event->set('EVT_ID', 0);
542
+		$new_name = $new_event->name() . ' ' . esc_html__('**DUPLICATE**', 'event_espresso');
543
+		$new_event->set('EVT_name', $new_name);
544
+		$new_event->set(
545
+			'EVT_slug',
546
+			wp_unique_post_slug(
547
+				sanitize_title($orig_event->name()),
548
+				0,
549
+				'publish',
550
+				'espresso_events',
551
+				0
552
+			)
553
+		);
554
+		$new_event->set('status', 'draft');
555
+		// duplicate discussion settings
556
+		$new_event->set('comment_status', $orig_event->get('comment_status'));
557
+		$new_event->set('ping_status', $orig_event->get('ping_status'));
558
+		// save the new event
559
+		$new_event->save();
560
+		// venues
561
+		foreach ($orig_ven as $ven) {
562
+			$new_event->_add_relation_to($ven, 'Venue');
563
+		}
564
+		$new_event->save();
565
+		// now we need to get the question group relations and handle that
566
+		// first primary question groups
567
+		$orig_primary_qgs = $orig_event->get_many_related(
568
+			'Question_Group',
569
+			[['Event_Question_Group.EQG_primary' => true]]
570
+		);
571
+		if (! empty($orig_primary_qgs)) {
572
+			foreach ($orig_primary_qgs as $obj) {
573
+				if ($obj instanceof EE_Question_Group) {
574
+					$new_event->_add_relation_to($obj, 'Question_Group', ['EQG_primary' => true]);
575
+				}
576
+			}
577
+		}
578
+		// next additional attendee question groups
579
+		$orig_additional_qgs = $orig_event->get_many_related(
580
+			'Question_Group',
581
+			[['Event_Question_Group.EQG_additional' => true]]
582
+		);
583
+		if (! empty($orig_additional_qgs)) {
584
+			foreach ($orig_additional_qgs as $obj) {
585
+				if ($obj instanceof EE_Question_Group) {
586
+					$new_event->_add_relation_to($obj, 'Question_Group', ['EQG_additional' => true]);
587
+				}
588
+			}
589
+		}
590
+
591
+		$new_event->save();
592
+
593
+		// k now that we have the new event saved we can loop through the datetimes and start adding relations.
594
+		$cloned_tickets = [];
595
+		foreach ($orig_datetimes as $orig_dtt) {
596
+			if (! $orig_dtt instanceof EE_Datetime) {
597
+				continue;
598
+			}
599
+			$new_dtt      = clone $orig_dtt;
600
+			$orig_tickets = $orig_dtt->tickets();
601
+			// save new dtt then add to event
602
+			$new_dtt->set('DTT_ID', 0);
603
+			$new_dtt->set('DTT_sold', 0);
604
+			$new_dtt->set_reserved(0);
605
+			$new_dtt->save();
606
+			$new_event->_add_relation_to($new_dtt, 'Datetime');
607
+			$new_event->save();
608
+			// now let's get the ticket relations setup.
609
+			foreach ((array) $orig_tickets as $orig_ticket) {
610
+				// it's possible a datetime will have no tickets so let's verify we HAVE a ticket first.
611
+				if (! $orig_ticket instanceof EE_Ticket) {
612
+					continue;
613
+				}
614
+				// is this ticket archived?  If it is then let's skip
615
+				if ($orig_ticket->get('TKT_deleted')) {
616
+					continue;
617
+				}
618
+				// does this original ticket already exist in the clone_tickets cache?
619
+				//  If so we'll just use the new ticket from it.
620
+				if (isset($cloned_tickets[ $orig_ticket->ID() ])) {
621
+					$new_ticket = $cloned_tickets[ $orig_ticket->ID() ];
622
+				} else {
623
+					$new_ticket = clone $orig_ticket;
624
+					// get relations on the $orig_ticket that we need to setup.
625
+					$orig_prices = $orig_ticket->prices();
626
+					$new_ticket->set('TKT_ID', 0);
627
+					$new_ticket->set('TKT_sold', 0);
628
+					$new_ticket->set('TKT_reserved', 0);
629
+					$new_ticket->save(); // make sure new ticket has ID.
630
+					// price relations on new ticket need to be setup.
631
+					foreach ($orig_prices as $orig_price) {
632
+						$new_price = clone $orig_price;
633
+						$new_price->set('PRC_ID', 0);
634
+						$new_price->save();
635
+						$new_ticket->_add_relation_to($new_price, 'Price');
636
+						$new_ticket->save();
637
+					}
638
+
639
+					do_action(
640
+						'AHEE__Extend_Events_Admin_Page___duplicate_event__duplicate_ticket__after',
641
+						$orig_ticket,
642
+						$new_ticket,
643
+						$orig_prices,
644
+						$orig_event,
645
+						$orig_dtt,
646
+						$new_dtt
647
+					);
648
+				}
649
+				// k now we can add the new ticket as a relation to the new datetime
650
+				// and make sure its added to our cached $cloned_tickets array
651
+				// for use with later datetimes that have the same ticket.
652
+				$new_dtt->_add_relation_to($new_ticket, 'Ticket');
653
+				$new_dtt->save();
654
+				$cloned_tickets[ $orig_ticket->ID() ] = $new_ticket;
655
+			}
656
+		}
657
+		// clone taxonomy information
658
+		$taxonomies_to_clone_with = apply_filters(
659
+			'FHEE__Extend_Events_Admin_Page___duplicate_event__taxonomies_to_clone',
660
+			['espresso_event_categories', 'espresso_event_type', 'post_tag']
661
+		);
662
+		// get terms for original event (notice)
663
+		$orig_terms = wp_get_object_terms($orig_event->ID(), $taxonomies_to_clone_with);
664
+		// loop through terms and add them to new event.
665
+		foreach ($orig_terms as $term) {
666
+			wp_set_object_terms($new_event->ID(), $term->term_id, $term->taxonomy, true);
667
+		}
668
+
669
+		// duplicate other core WP_Post items for this event.
670
+		// post thumbnail (feature image).
671
+		$feature_image_id = get_post_thumbnail_id($orig_event->ID());
672
+		if ($feature_image_id) {
673
+			update_post_meta($new_event->ID(), '_thumbnail_id', $feature_image_id);
674
+		}
675
+
676
+		// duplicate page_template setting
677
+		$page_template = get_post_meta($orig_event->ID(), '_wp_page_template', true);
678
+		if ($page_template) {
679
+			update_post_meta($new_event->ID(), '_wp_page_template', $page_template);
680
+		}
681
+
682
+		do_action('AHEE__Extend_Events_Admin_Page___duplicate_event__after', $new_event, $orig_event);
683
+		// now let's redirect to the edit page for this duplicated event if we have a new event id.
684
+		if ($new_event->ID()) {
685
+			$redirect_args = [
686
+				'post'   => $new_event->ID(),
687
+				'action' => 'edit',
688
+			];
689
+			EE_Error::add_success(
690
+				esc_html__(
691
+					'Event successfully duplicated.  Please review the details below and make any necessary edits',
692
+					'event_espresso'
693
+				)
694
+			);
695
+		} else {
696
+			$redirect_args = [
697
+				'action' => 'default',
698
+			];
699
+			EE_Error::add_error(
700
+				esc_html__('Not able to duplicate event.  Something went wrong.', 'event_espresso'),
701
+				__FILE__,
702
+				__FUNCTION__,
703
+				__LINE__
704
+			);
705
+		}
706
+		$this->_redirect_after_action(false, '', '', $redirect_args, true);
707
+	}
708
+
709
+
710
+	/**
711
+	 * Generates output for the import page.
712
+	 *
713
+	 * @throws EE_Error
714
+	 */
715
+	protected function _import_page()
716
+	{
717
+		$title                                      = esc_html__('Import', 'event_espresso');
718
+		$intro                                      = esc_html__(
719
+			'If you have a previously exported Event Espresso 4 information in a Comma Separated Value (CSV) file format, you can upload the file here: ',
720
+			'event_espresso'
721
+		);
722
+
723
+		$form_url = EVENTS_ADMIN_URL;
724
+		$action   = 'import_events';
725
+		$type     = 'csv';
726
+
727
+		$this->_template_args['form'] = EE_Import::instance()->upload_form(
728
+			$title,
729
+			$intro,
730
+			$form_url,
731
+			$action,
732
+			$type
733
+		);
734
+
735
+		$this->_template_args['sample_file_link']   = EE_Admin_Page::add_query_args_and_nonce(
736
+			['action' => 'sample_export_file'],
737
+			$this->_admin_base_url
738
+		);
739
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(
740
+			EVENTS_CAF_TEMPLATE_PATH . 'import_page.template.php',
741
+			$this->_template_args,
742
+			true
743
+		);
744
+		$this->display_admin_page_with_sidebar();
745
+	}
746
+
747
+
748
+	/**
749
+	 * _import_events
750
+	 * This handles displaying the screen and running imports for importing events.
751
+	 *
752
+	 * @return void
753
+	 * @throws EE_Error
754
+	 */
755
+	protected function _import_events()
756
+	{
757
+		require_once(EE_CLASSES . 'EE_Import.class.php');
758
+		$success = EE_Import::instance()->import();
759
+		$this->_redirect_after_action(
760
+			$success,
761
+			esc_html__('Import File', 'event_espresso'),
762
+			'ran',
763
+			['action' => 'import_page'],
764
+			true
765
+		);
766
+	}
767
+
768
+
769
+	/**
770
+	 * _events_export
771
+	 * Will export all (or just the given event) to a Excel compatible file.
772
+	 *
773
+	 * @access protected
774
+	 * @return void
775
+	 */
776
+	protected function _events_export()
777
+	{
778
+		$EVT_ID = $this->request->getRequestParam('EVT_ID', 0, 'int');
779
+		$EVT_ID = $this->request->getRequestParam('EVT_IDs', $EVT_ID, 'int');
780
+		$this->request->mergeRequestParams(
781
+			[
782
+				'export' => 'report',
783
+				'action' => 'all_event_data',
784
+				'EVT_ID' => $EVT_ID,
785
+			]
786
+		);
787
+		if (is_readable(EE_CLASSES . 'EE_Export.class.php')) {
788
+			require_once(EE_CLASSES . 'EE_Export.class.php');
789
+			$EE_Export = EE_Export::instance($this->request->requestParams());
790
+			$EE_Export->export();
791
+		}
792
+	}
793
+
794
+
795
+	/**
796
+	 * handle category exports()
797
+	 *
798
+	 * @return void
799
+	 */
800
+	protected function _categories_export()
801
+	{
802
+		$EVT_ID = $this->request->getRequestParam('EVT_CAT_ID', 0, 'int');
803
+		$this->request->mergeRequestParams(
804
+			[
805
+				'export' => 'report',
806
+				'action' => 'categories',
807
+				'EVT_ID' => $EVT_ID,
808
+			]
809
+		);
810
+		if (is_readable(EE_CLASSES . 'EE_Export.class.php')) {
811
+			require_once(EE_CLASSES . 'EE_Export.class.php');
812
+			$EE_Export = EE_Export::instance($this->request->requestParams());
813
+			$EE_Export->export();
814
+		}
815
+	}
816
+
817
+
818
+	/**
819
+	 * Creates a sample CSV file for importing
820
+	 */
821
+	protected function _sample_export_file()
822
+	{
823
+		$EE_Export = EE_Export::instance();
824
+		if ($EE_Export instanceof EE_Export) {
825
+			$EE_Export->export();
826
+		}
827
+	}
828
+
829
+
830
+	/*************        Template Settings        *************/
831
+	/**
832
+	 * Generates template settings page output
833
+	 *
834
+	 * @throws DomainException
835
+	 * @throws EE_Error
836
+	 * @throws InvalidArgumentException
837
+	 * @throws InvalidDataTypeException
838
+	 * @throws InvalidInterfaceException
839
+	 */
840
+	protected function _template_settings()
841
+	{
842
+		$this->_template_args['values'] = $this->_yes_no_values;
843
+		/**
844
+		 * Note leaving this filter in for backward compatibility this was moved in 4.6.x
845
+		 * from General_Settings_Admin_Page to here.
846
+		 */
847
+		$this->_template_args = apply_filters(
848
+			'FHEE__General_Settings_Admin_Page__template_settings__template_args',
849
+			$this->_template_args
850
+		);
851
+		$this->_set_add_edit_form_tags('update_template_settings');
852
+		$this->_set_publish_post_box_vars(null, false, false, null, false);
853
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(
854
+			EVENTS_CAF_TEMPLATE_PATH . 'template_settings.template.php',
855
+			$this->_template_args,
856
+			true
857
+		);
858
+		$this->display_admin_page_with_sidebar();
859
+	}
860
+
861
+
862
+	/**
863
+	 * Handler for updating template settings.
864
+	 *
865
+	 * @throws EE_Error
866
+	 */
867
+	protected function _update_template_settings()
868
+	{
869
+		/**
870
+		 * Note leaving this filter in for backward compatibility this was moved in 4.6.x
871
+		 * from General_Settings_Admin_Page to here.
872
+		 */
873
+		EE_Registry::instance()->CFG->template_settings = apply_filters(
874
+			'FHEE__General_Settings_Admin_Page__update_template_settings__data',
875
+			EE_Registry::instance()->CFG->template_settings,
876
+			$this->request->requestParams()
877
+		);
878
+		// update custom post type slugs and detect if we need to flush rewrite rules
879
+		$old_slug = EE_Registry::instance()->CFG->core->event_cpt_slug;
880
+
881
+		$event_cpt_slug = $this->request->getRequestParam('event_cpt_slug');
882
+
883
+		EE_Registry::instance()->CFG->core->event_cpt_slug = $event_cpt_slug
884
+			? EEH_URL::slugify($event_cpt_slug, 'events')
885
+			: EE_Registry::instance()->CFG->core->event_cpt_slug;
886
+
887
+		$what    = esc_html__('Template Settings', 'event_espresso');
888
+		$success = $this->_update_espresso_configuration(
889
+			$what,
890
+			EE_Registry::instance()->CFG->template_settings,
891
+			__FILE__,
892
+			__FUNCTION__,
893
+			__LINE__
894
+		);
895
+		if (EE_Registry::instance()->CFG->core->event_cpt_slug !== $old_slug) {
896
+			/** @var EventEspresso\core\domain\services\custom_post_types\RewriteRules $rewrite_rules */
897
+			$rewrite_rules = LoaderFactory::getLoader()->getShared(
898
+				'EventEspresso\core\domain\services\custom_post_types\RewriteRules'
899
+			);
900
+			$rewrite_rules->flush();
901
+		}
902
+		$this->_redirect_after_action($success, $what, 'updated', ['action' => 'template_settings']);
903
+	}
904
+
905
+
906
+	/**
907
+	 * _premium_event_editor_meta_boxes
908
+	 * add all metaboxes related to the event_editor
909
+	 *
910
+	 * @access protected
911
+	 * @return void
912
+	 * @throws EE_Error
913
+	 * @throws ReflectionException
914
+	 */
915
+	protected function _premium_event_editor_meta_boxes()
916
+	{
917
+		$this->verify_cpt_object();
918
+		// check if the new EDTR reg options meta box is being used, and if so, don't load the legacy version
919
+		if (
920
+			! $this->admin_config->useAdvancedEditor()
921
+			|| ! $this->feature->allowed('use_reg_options_meta_box')
922
+		) {
923
+			add_meta_box(
924
+				'espresso_event_editor_event_options',
925
+				esc_html__('Event Registration Options', 'event_espresso'),
926
+				[$this, 'registration_options_meta_box'],
927
+				$this->page_slug,
928
+				'side',
929
+				'core'
930
+			);
931
+		}
932
+	}
933
+
934
+
935
+	/**
936
+	 * override caf metabox
937
+	 *
938
+	 * @return void
939
+	 * @throws EE_Error
940
+	 * @throws ReflectionException
941
+	 */
942
+	public function registration_options_meta_box()
943
+	{
944
+		$yes_no_values = [
945
+			['id' => true, 'text' => esc_html__('Yes', 'event_espresso')],
946
+			['id' => false, 'text' => esc_html__('No', 'event_espresso')],
947
+		];
948
+
949
+		$default_reg_status_values = EEM_Registration::reg_status_array(
950
+			[
951
+				EEM_Registration::status_id_cancelled,
952
+				EEM_Registration::status_id_declined,
953
+				EEM_Registration::status_id_incomplete,
954
+				EEM_Registration::status_id_wait_list,
955
+			],
956
+			true
957
+		);
958
+
959
+		$template_args['active_status']    = $this->_cpt_model_obj->pretty_active_status(false);
960
+		$template_args['_event']           = $this->_cpt_model_obj;
961
+		$template_args['additional_limit'] = $this->_cpt_model_obj->additional_limit();
962
+
963
+		$template_args['default_registration_status']     = EEH_Form_Fields::select_input(
964
+			'default_reg_status',
965
+			$default_reg_status_values,
966
+			$this->_cpt_model_obj->default_registration_status()
967
+		);
968
+		$template_args['display_description']             = EEH_Form_Fields::select_input(
969
+			'display_desc',
970
+			$yes_no_values,
971
+			$this->_cpt_model_obj->display_description()
972
+		);
973
+		$template_args['display_ticket_selector']         = EEH_Form_Fields::select_input(
974
+			'display_ticket_selector',
975
+			$yes_no_values,
976
+			$this->_cpt_model_obj->display_ticket_selector(),
977
+			'',
978
+			'',
979
+			false
980
+		);
981
+		$template_args['EVT_default_registration_status'] = EEH_Form_Fields::select_input(
982
+			'EVT_default_registration_status',
983
+			$default_reg_status_values,
984
+			$this->_cpt_model_obj->default_registration_status()
985
+		);
986
+		$template_args['additional_registration_options'] = apply_filters(
987
+			'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options',
988
+			'',
989
+			$template_args,
990
+			$yes_no_values,
991
+			$default_reg_status_values
992
+		);
993
+		EEH_Template::display_template(
994
+			EVENTS_CAF_TEMPLATE_PATH . 'event_registration_options.template.php',
995
+			$template_args
996
+		);
997
+	}
998
+
999
+
1000
+
1001
+	/**
1002
+	 * wp_list_table_mods for caf
1003
+	 * ============================
1004
+	 */
1005
+	/**
1006
+	 * hook into list table filters and provide filters for caffeinated list table
1007
+	 *
1008
+	 * @param array $old_filters    any existing filters present
1009
+	 * @param array $list_table_obj the list table object
1010
+	 * @return array                  new filters
1011
+	 * @throws EE_Error
1012
+	 * @throws ReflectionException
1013
+	 */
1014
+	public function list_table_filters($old_filters, $list_table_obj)
1015
+	{
1016
+		$filters = [];
1017
+		// first month/year filters
1018
+		$filters[] = $this->espresso_event_months_dropdown();
1019
+		$status    = $this->request->getRequestParam('status');
1020
+		// active status dropdown
1021
+		if ($status !== 'draft') {
1022
+			$filters[] = $this->active_status_dropdown($this->request->getRequestParam('active_status'));
1023
+			$filters[] = $this->venuesDropdown($this->request->getRequestParam('venue'));
1024
+		}
1025
+		// category filter
1026
+		$filters[] = $this->category_dropdown();
1027
+		return array_merge($old_filters, $filters);
1028
+	}
1029
+
1030
+
1031
+	/**
1032
+	 * espresso_event_months_dropdown
1033
+	 *
1034
+	 * @access public
1035
+	 * @return string                dropdown listing month/year selections for events.
1036
+	 * @throws EE_Error
1037
+	 */
1038
+	public function espresso_event_months_dropdown()
1039
+	{
1040
+		// what we need to do is get all PRIMARY datetimes for all events to filter on.
1041
+		// Note we need to include any other filters that are set!
1042
+		return EEH_Form_Fields::generate_event_months_dropdown(
1043
+			$this->request->getRequestParam('month_range'),
1044
+			$this->request->getRequestParam('status'),
1045
+			$this->request->getRequestParam('EVT_CAT', 0, 'int'),
1046
+			$this->request->getRequestParam('active_status')
1047
+		);
1048
+	}
1049
+
1050
+
1051
+	/**
1052
+	 * returns a list of "active" statuses on the event
1053
+	 *
1054
+	 * @param string $current_value whatever the current active status is
1055
+	 * @return string
1056
+	 */
1057
+	public function active_status_dropdown($current_value = '')
1058
+	{
1059
+		$select_name = 'active_status';
1060
+		$values      = [
1061
+			'none'     => esc_html__('Show Active/Inactive', 'event_espresso'),
1062
+			'active'   => esc_html__('Active', 'event_espresso'),
1063
+			'upcoming' => esc_html__('Upcoming', 'event_espresso'),
1064
+			'expired'  => esc_html__('Expired', 'event_espresso'),
1065
+			'inactive' => esc_html__('Inactive', 'event_espresso'),
1066
+		];
1067
+
1068
+		return EEH_Form_Fields::select_input($select_name, $values, $current_value, '', 'wide');
1069
+	}
1070
+
1071
+
1072
+	/**
1073
+	 * returns a list of "venues"
1074
+	 *
1075
+	 * @param string $current_value whatever the current active status is
1076
+	 * @return string
1077
+	 * @throws EE_Error
1078
+	 * @throws ReflectionException
1079
+	 */
1080
+	protected function venuesDropdown($current_value = '')
1081
+	{
1082
+		$values = ['' => esc_html__('All Venues', 'event_espresso')];
1083
+		// populate the list of venues.
1084
+		$venues = EEM_Venue::instance()->get_all(['order_by' => ['VNU_name' => 'ASC']]);
1085
+
1086
+		foreach ($venues as $venue) {
1087
+			$values[ $venue->ID() ] = $venue->name();
1088
+		}
1089
+
1090
+		return EEH_Form_Fields::select_input('venue', $values, $current_value, '', 'wide');
1091
+	}
1092
+
1093
+
1094
+	/**
1095
+	 * output a dropdown of the categories for the category filter on the event admin list table
1096
+	 *
1097
+	 * @access  public
1098
+	 * @return string html
1099
+	 * @throws EE_Error
1100
+	 * @throws ReflectionException
1101
+	 */
1102
+	public function category_dropdown()
1103
+	{
1104
+		return EEH_Form_Fields::generate_event_category_dropdown(
1105
+			$this->request->getRequestParam('EVT_CAT', -1, 'int')
1106
+		);
1107
+	}
1108
+
1109
+
1110
+	/**
1111
+	 * get total number of events today
1112
+	 *
1113
+	 * @access public
1114
+	 * @return int
1115
+	 * @throws EE_Error
1116
+	 * @throws InvalidArgumentException
1117
+	 * @throws InvalidDataTypeException
1118
+	 * @throws InvalidInterfaceException
1119
+	 */
1120
+	public function total_events_today()
1121
+	{
1122
+		$start = EEM_Datetime::instance()->convert_datetime_for_query(
1123
+			'DTT_EVT_start',
1124
+			date('Y-m-d') . ' 00:00:00',
1125
+			'Y-m-d H:i:s',
1126
+			'UTC'
1127
+		);
1128
+		$end   = EEM_Datetime::instance()->convert_datetime_for_query(
1129
+			'DTT_EVT_start',
1130
+			date('Y-m-d') . ' 23:59:59',
1131
+			'Y-m-d H:i:s',
1132
+			'UTC'
1133
+		);
1134
+		$where = [
1135
+			'Datetime.DTT_EVT_start' => ['BETWEEN', [$start, $end]],
1136
+		];
1137
+		return EEM_Event::instance()->count([$where, 'caps' => 'read_admin'], 'EVT_ID', true);
1138
+	}
1139
+
1140
+
1141
+	/**
1142
+	 * get total number of events this month
1143
+	 *
1144
+	 * @access public
1145
+	 * @return int
1146
+	 * @throws EE_Error
1147
+	 * @throws InvalidArgumentException
1148
+	 * @throws InvalidDataTypeException
1149
+	 * @throws InvalidInterfaceException
1150
+	 */
1151
+	public function total_events_this_month()
1152
+	{
1153
+		// Dates
1154
+		$this_year_r     = date('Y');
1155
+		$this_month_r    = date('m');
1156
+		$days_this_month = date('t');
1157
+		$start           = EEM_Datetime::instance()->convert_datetime_for_query(
1158
+			'DTT_EVT_start',
1159
+			$this_year_r . '-' . $this_month_r . '-01 00:00:00',
1160
+			'Y-m-d H:i:s',
1161
+			'UTC'
1162
+		);
1163
+		$end             = EEM_Datetime::instance()->convert_datetime_for_query(
1164
+			'DTT_EVT_start',
1165
+			$this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' 23:59:59',
1166
+			'Y-m-d H:i:s',
1167
+			'UTC'
1168
+		);
1169
+		$where           = [
1170
+			'Datetime.DTT_EVT_start' => ['BETWEEN', [$start, $end]],
1171
+		];
1172
+		return EEM_Event::instance()->count([$where, 'caps' => 'read_admin'], 'EVT_ID', true);
1173
+	}
1174
+
1175
+
1176
+	/** DEFAULT TICKETS STUFF **/
1177
+
1178
+	/**
1179
+	 * Output default tickets list table view.
1180
+	 *
1181
+	 * @throws EE_Error
1182
+	 */
1183
+	public function _tickets_overview_list_table()
1184
+	{
1185
+		if (
1186
+			$this->admin_config->useAdvancedEditor()
1187
+			&& $this->feature->allowed('use_default_ticket_manager')
1188
+		) {
1189
+			// check if the new EDTR reg options meta box is being used, and if so, don't load the legacy version
1190
+			$this->_template_args['admin_page_content'] = EEH_Template::display_template(
1191
+				EVENTS_CAF_TEMPLATE_PATH . 'default_tickets_moved_notice.template.php',
1192
+				[],
1193
+				true
1194
+			);
1195
+			$this->display_admin_page_with_no_sidebar();
1196
+		} else {
1197
+			$this->_search_btn_label = esc_html__('Tickets', 'event_espresso');
1198
+			$this->display_admin_list_table_page_with_no_sidebar();
1199
+		}
1200
+	}
1201
+
1202
+
1203
+	/**
1204
+	 * @param int  $per_page
1205
+	 * @param bool $count
1206
+	 * @param bool $trashed
1207
+	 * @return EE_Soft_Delete_Base_Class[]|int
1208
+	 * @throws EE_Error
1209
+	 */
1210
+	public function get_default_tickets($per_page = 10, $count = false, $trashed = false)
1211
+	{
1212
+		$orderby = $this->request->getRequestParam('orderby', 'TKT_name');
1213
+		$order   = $this->request->getRequestParam('order', 'ASC');
1214
+		switch ($orderby) {
1215
+			case 'TKT_name':
1216
+				$orderby = ['TKT_name' => $order];
1217
+				break;
1218
+			case 'TKT_price':
1219
+				$orderby = ['TKT_price' => $order];
1220
+				break;
1221
+			case 'TKT_uses':
1222
+				$orderby = ['TKT_uses' => $order];
1223
+				break;
1224
+			case 'TKT_min':
1225
+				$orderby = ['TKT_min' => $order];
1226
+				break;
1227
+			case 'TKT_max':
1228
+				$orderby = ['TKT_max' => $order];
1229
+				break;
1230
+			case 'TKT_qty':
1231
+				$orderby = ['TKT_qty' => $order];
1232
+				break;
1233
+		}
1234
+
1235
+		$current_page = $this->request->getRequestParam('paged', 1, 'int');
1236
+		$per_page     = $this->request->getRequestParam('perpage', $per_page, 'int');
1237
+		$offset       = ($current_page - 1) * $per_page;
1238
+
1239
+		$where = [
1240
+			'TKT_is_default' => 1,
1241
+			'TKT_deleted'    => $trashed,
1242
+		];
1243
+
1244
+		$search_term = $this->request->getRequestParam('s');
1245
+		if ($search_term) {
1246
+			$search_term = '%' . $search_term . '%';
1247
+			$where['OR'] = [
1248
+				'TKT_name'        => ['LIKE', $search_term],
1249
+				'TKT_description' => ['LIKE', $search_term],
1250
+			];
1251
+		}
1252
+
1253
+		return $count
1254
+			? EEM_Ticket::instance()->count_deleted_and_undeleted([$where])
1255
+			: EEM_Ticket::instance()->get_all_deleted_and_undeleted(
1256
+				[
1257
+					$where,
1258
+					'order_by' => $orderby,
1259
+					'limit'    => [$offset, $per_page],
1260
+					'group_by' => 'TKT_ID',
1261
+				]
1262
+			);
1263
+	}
1264
+
1265
+
1266
+	/**
1267
+	 * @param bool $trash
1268
+	 * @throws EE_Error
1269
+	 * @throws InvalidArgumentException
1270
+	 * @throws InvalidDataTypeException
1271
+	 * @throws InvalidInterfaceException
1272
+	 */
1273
+	protected function _trash_or_restore_ticket($trash = false)
1274
+	{
1275
+		$success = 1;
1276
+		$TKT     = EEM_Ticket::instance();
1277
+		// checkboxes?
1278
+		$checkboxes = $this->request->getRequestParam('checkbox', [], 'int', true);
1279
+		if (! empty($checkboxes)) {
1280
+			// if array has more than one element then success message should be plural
1281
+			$success = count($checkboxes) > 1 ? 2 : 1;
1282
+			// cycle thru the boxes
1283
+			while (list($TKT_ID, $value) = each($checkboxes)) {
1284
+				if ($trash) {
1285
+					if (! $TKT->delete_by_ID($TKT_ID)) {
1286
+						$success = 0;
1287
+					}
1288
+				} elseif (! $TKT->restore_by_ID($TKT_ID)) {
1289
+					$success = 0;
1290
+				}
1291
+			}
1292
+		} else {
1293
+			// grab single id and trash
1294
+			$TKT_ID = $this->request->getRequestParam('TKT_ID', 0, 'int');
1295
+			if ($trash) {
1296
+				if (! $TKT->delete_by_ID($TKT_ID)) {
1297
+					$success = 0;
1298
+				}
1299
+			} elseif (! $TKT->restore_by_ID($TKT_ID)) {
1300
+				$success = 0;
1301
+			}
1302
+		}
1303
+		$action_desc = $trash ? 'moved to the trash' : 'restored';
1304
+		$query_args  = [
1305
+			'action' => 'ticket_list_table',
1306
+			'status' => $trash ? '' : 'trashed',
1307
+		];
1308
+		$this->_redirect_after_action($success, esc_html__('Tickets', 'event_espresso'), $action_desc, $query_args);
1309
+	}
1310
+
1311
+
1312
+	/**
1313
+	 * Handles trashing default ticket.
1314
+	 *
1315
+	 * @throws EE_Error
1316
+	 * @throws ReflectionException
1317
+	 */
1318
+	protected function _delete_ticket()
1319
+	{
1320
+		$success = 1;
1321
+		// checkboxes?
1322
+		$checkboxes = $this->request->getRequestParam('checkbox', [], 'int', true);
1323
+		if (! empty($checkboxes)) {
1324
+			// if array has more than one element then success message should be plural
1325
+			$success = count($checkboxes) > 1 ? 2 : 1;
1326
+			// cycle thru the boxes
1327
+			while (list($TKT_ID, $value) = each($checkboxes)) {
1328
+				// delete
1329
+				if (! $this->_delete_the_ticket($TKT_ID)) {
1330
+					$success = 0;
1331
+				}
1332
+			}
1333
+		} else {
1334
+			// grab single id and trash
1335
+			$TKT_ID = $this->request->getRequestParam('TKT_ID', 0, 'int');
1336
+			if (! $this->_delete_the_ticket($TKT_ID)) {
1337
+				$success = 0;
1338
+			}
1339
+		}
1340
+		$action_desc = 'deleted';
1341
+		$query_args  = [
1342
+			'action' => 'ticket_list_table',
1343
+			'status' => 'trashed',
1344
+		];
1345
+		// fail safe.  If the default ticket count === 1 then we need to redirect to event overview.
1346
+		if (
1347
+			EEM_Ticket::instance()->count_deleted_and_undeleted(
1348
+				[['TKT_is_default' => 1]],
1349
+				'TKT_ID',
1350
+				true
1351
+			)
1352
+		) {
1353
+			$query_args = [];
1354
+		}
1355
+		$this->_redirect_after_action($success, esc_html__('Tickets', 'event_espresso'), $action_desc, $query_args);
1356
+	}
1357
+
1358
+
1359
+	/**
1360
+	 * @param int $TKT_ID
1361
+	 * @return bool|int
1362
+	 * @throws EE_Error
1363
+	 * @throws ReflectionException
1364
+	 */
1365
+	protected function _delete_the_ticket($TKT_ID)
1366
+	{
1367
+		$ticket = EEM_Ticket::instance()->get_one_by_ID($TKT_ID);
1368
+		if (! $ticket instanceof EE_Ticket) {
1369
+			return false;
1370
+		}
1371
+		$ticket->_remove_relations('Datetime');
1372
+		// delete all related prices first
1373
+		$ticket->delete_related_permanently('Price');
1374
+		return $ticket->delete_permanently();
1375
+	}
1376 1376
 }
Please login to merge, or discard this patch.
admin_pages/events/Events_Admin_Page.core.php 1 patch
Indentation   +2887 added lines, -2887 removed lines patch added patch discarded remove patch
@@ -17,2894 +17,2894 @@
 block discarded – undo
17 17
 class Events_Admin_Page extends EE_Admin_Page_CPT
18 18
 {
19 19
 
20
-    /**
21
-     * This will hold the event object for event_details screen.
20
+	/**
21
+	 * This will hold the event object for event_details screen.
22
+	 *
23
+	 * @var EE_Event $_event
24
+	 */
25
+	protected $_event;
26
+
27
+
28
+	/**
29
+	 * This will hold the category object for category_details screen.
30
+	 *
31
+	 * @var stdClass $_category
32
+	 */
33
+	protected $_category;
34
+
35
+
36
+	/**
37
+	 * This will hold the event model instance
38
+	 *
39
+	 * @var EEM_Event $_event_model
40
+	 */
41
+	protected $_event_model;
42
+
43
+
44
+	/**
45
+	 * @var EE_Event
46
+	 */
47
+	protected $_cpt_model_obj = false;
48
+
49
+
50
+	/**
51
+	 * @var NodeGroupDao
52
+	 */
53
+	protected $model_obj_node_group_persister;
54
+
55
+	/**
56
+	 * @var AdvancedEditorAdminFormSection
57
+	 */
58
+	protected $advanced_editor_admin_form;
59
+
60
+
61
+	/**
62
+	 * Initialize page props for this admin page group.
63
+	 */
64
+	protected function _init_page_props()
65
+	{
66
+		$this->page_slug        = EVENTS_PG_SLUG;
67
+		$this->page_label       = EVENTS_LABEL;
68
+		$this->_admin_base_url  = EVENTS_ADMIN_URL;
69
+		$this->_admin_base_path = EVENTS_ADMIN;
70
+		$this->_cpt_model_names = [
71
+			'create_new' => 'EEM_Event',
72
+			'edit'       => 'EEM_Event',
73
+		];
74
+		$this->_cpt_edit_routes = [
75
+			'espresso_events' => 'edit',
76
+		];
77
+		add_action(
78
+			'AHEE__EE_Admin_Page_CPT__set_model_object__after_set_object',
79
+			[$this, 'verify_event_edit'],
80
+			10,
81
+			2
82
+		);
83
+	}
84
+
85
+
86
+	/**
87
+	 * Sets the ajax hooks used for this admin page group.
88
+	 */
89
+	protected function _ajax_hooks()
90
+	{
91
+		add_action('wp_ajax_ee_save_timezone_setting', [$this, 'saveTimezoneString']);
92
+	}
93
+
94
+
95
+	/**
96
+	 * Sets the page properties for this admin page group.
97
+	 */
98
+	protected function _define_page_props()
99
+	{
100
+		$this->_admin_page_title = EVENTS_LABEL;
101
+		$this->_labels           = [
102
+			'buttons'      => [
103
+				'add'             => esc_html__('Add New Event', 'event_espresso'),
104
+				'edit'            => esc_html__('Edit Event', 'event_espresso'),
105
+				'delete'          => esc_html__('Delete Event', 'event_espresso'),
106
+				'add_category'    => esc_html__('Add New Category', 'event_espresso'),
107
+				'edit_category'   => esc_html__('Edit Category', 'event_espresso'),
108
+				'delete_category' => esc_html__('Delete Category', 'event_espresso'),
109
+			],
110
+			'editor_title' => [
111
+				'espresso_events' => esc_html__('Enter event title here', 'event_espresso'),
112
+			],
113
+			'publishbox'   => [
114
+				'create_new'        => esc_html__('Save New Event', 'event_espresso'),
115
+				'edit'              => esc_html__('Update Event', 'event_espresso'),
116
+				'add_category'      => esc_html__('Save New Category', 'event_espresso'),
117
+				'edit_category'     => esc_html__('Update Category', 'event_espresso'),
118
+				'template_settings' => esc_html__('Update Settings', 'event_espresso'),
119
+			],
120
+		];
121
+	}
122
+
123
+
124
+	/**
125
+	 * Sets the page routes property for this admin page group.
126
+	 */
127
+	protected function _set_page_routes()
128
+	{
129
+		// load formatter helper
130
+		// load field generator helper
131
+		// is there a evt_id in the request?
132
+		$EVT_ID = $this->request->getRequestParam('EVT_ID', 0, 'int');
133
+		$EVT_ID = $this->request->getRequestParam('post', $EVT_ID, 'int');
134
+
135
+		$this->_page_routes = [
136
+			'default'                       => [
137
+				'func'       => '_events_overview_list_table',
138
+				'capability' => 'ee_read_events',
139
+			],
140
+			'create_new'                    => [
141
+				'func'       => '_create_new_cpt_item',
142
+				'capability' => 'ee_edit_events',
143
+			],
144
+			'edit'                          => [
145
+				'func'       => '_edit_cpt_item',
146
+				'capability' => 'ee_edit_event',
147
+				'obj_id'     => $EVT_ID,
148
+			],
149
+			'copy_event'                    => [
150
+				'func'       => '_copy_events',
151
+				'capability' => 'ee_edit_event',
152
+				'obj_id'     => $EVT_ID,
153
+				'noheader'   => true,
154
+			],
155
+			'trash_event'                   => [
156
+				'func'       => '_trash_or_restore_event',
157
+				'args'       => ['event_status' => 'trash'],
158
+				'capability' => 'ee_delete_event',
159
+				'obj_id'     => $EVT_ID,
160
+				'noheader'   => true,
161
+			],
162
+			'trash_events'                  => [
163
+				'func'       => '_trash_or_restore_events',
164
+				'args'       => ['event_status' => 'trash'],
165
+				'capability' => 'ee_delete_events',
166
+				'noheader'   => true,
167
+			],
168
+			'restore_event'                 => [
169
+				'func'       => '_trash_or_restore_event',
170
+				'args'       => ['event_status' => 'draft'],
171
+				'capability' => 'ee_delete_event',
172
+				'obj_id'     => $EVT_ID,
173
+				'noheader'   => true,
174
+			],
175
+			'restore_events'                => [
176
+				'func'       => '_trash_or_restore_events',
177
+				'args'       => ['event_status' => 'draft'],
178
+				'capability' => 'ee_delete_events',
179
+				'noheader'   => true,
180
+			],
181
+			'delete_event'                  => [
182
+				'func'       => '_delete_event',
183
+				'capability' => 'ee_delete_event',
184
+				'obj_id'     => $EVT_ID,
185
+				'noheader'   => true,
186
+			],
187
+			'delete_events'                 => [
188
+				'func'       => '_delete_events',
189
+				'capability' => 'ee_delete_events',
190
+				'noheader'   => true,
191
+			],
192
+			'view_report'                   => [
193
+				'func'       => '_view_report',
194
+				'capability' => 'ee_edit_events',
195
+			],
196
+			'default_event_settings'        => [
197
+				'func'       => '_default_event_settings',
198
+				'capability' => 'manage_options',
199
+			],
200
+			'update_default_event_settings' => [
201
+				'func'       => '_update_default_event_settings',
202
+				'capability' => 'manage_options',
203
+				'noheader'   => true,
204
+			],
205
+			'template_settings'             => [
206
+				'func'       => '_template_settings',
207
+				'capability' => 'manage_options',
208
+			],
209
+			// event category tab related
210
+			'add_category'                  => [
211
+				'func'       => '_category_details',
212
+				'capability' => 'ee_edit_event_category',
213
+				'args'       => ['add'],
214
+			],
215
+			'edit_category'                 => [
216
+				'func'       => '_category_details',
217
+				'capability' => 'ee_edit_event_category',
218
+				'args'       => ['edit'],
219
+			],
220
+			'delete_categories'             => [
221
+				'func'       => '_delete_categories',
222
+				'capability' => 'ee_delete_event_category',
223
+				'noheader'   => true,
224
+			],
225
+			'delete_category'               => [
226
+				'func'       => '_delete_categories',
227
+				'capability' => 'ee_delete_event_category',
228
+				'noheader'   => true,
229
+			],
230
+			'insert_category'               => [
231
+				'func'       => '_insert_or_update_category',
232
+				'args'       => ['new_category' => true],
233
+				'capability' => 'ee_edit_event_category',
234
+				'noheader'   => true,
235
+			],
236
+			'update_category'               => [
237
+				'func'       => '_insert_or_update_category',
238
+				'args'       => ['new_category' => false],
239
+				'capability' => 'ee_edit_event_category',
240
+				'noheader'   => true,
241
+			],
242
+			'category_list'                 => [
243
+				'func'       => '_category_list_table',
244
+				'capability' => 'ee_manage_event_categories',
245
+			],
246
+			'preview_deletion'              => [
247
+				'func'       => 'previewDeletion',
248
+				'capability' => 'ee_delete_events',
249
+			],
250
+			'confirm_deletion'              => [
251
+				'func'       => 'confirmDeletion',
252
+				'capability' => 'ee_delete_events',
253
+				'noheader'   => true,
254
+			],
255
+		];
256
+	}
257
+
258
+
259
+	/**
260
+	 * Set the _page_config property for this admin page group.
261
+	 */
262
+	protected function _set_page_config()
263
+	{
264
+		$post_id            = $this->request->getRequestParam('post', 0, 'int');
265
+		$EVT_CAT_ID         = $this->request->getRequestParam('EVT_CAT_ID', 0, 'int');
266
+		$this->_page_config = [
267
+			'default'                => [
268
+				'nav'           => [
269
+					'label' => esc_html__('Overview', 'event_espresso'),
270
+					'order' => 10,
271
+				],
272
+				'list_table'    => 'Events_Admin_List_Table',
273
+				'help_tabs'     => [
274
+					'events_overview_help_tab'                       => [
275
+						'title'    => esc_html__('Events Overview', 'event_espresso'),
276
+						'filename' => 'events_overview',
277
+					],
278
+					'events_overview_table_column_headings_help_tab' => [
279
+						'title'    => esc_html__('Events Overview Table Column Headings', 'event_espresso'),
280
+						'filename' => 'events_overview_table_column_headings',
281
+					],
282
+					'events_overview_filters_help_tab'               => [
283
+						'title'    => esc_html__('Events Overview Filters', 'event_espresso'),
284
+						'filename' => 'events_overview_filters',
285
+					],
286
+					'events_overview_view_help_tab'                  => [
287
+						'title'    => esc_html__('Events Overview Views', 'event_espresso'),
288
+						'filename' => 'events_overview_views',
289
+					],
290
+					'events_overview_other_help_tab'                 => [
291
+						'title'    => esc_html__('Events Overview Other', 'event_espresso'),
292
+						'filename' => 'events_overview_other',
293
+					],
294
+				],
295
+				'qtips'         => [
296
+					'EE_Event_List_Table_Tips',
297
+				],
298
+				'require_nonce' => false,
299
+			],
300
+			'create_new'             => [
301
+				'nav'           => [
302
+					'label'      => esc_html__('Add Event', 'event_espresso'),
303
+					'order'      => 5,
304
+					'persistent' => false,
305
+				],
306
+				'metaboxes'     => ['_register_event_editor_meta_boxes'],
307
+				'help_tabs'     => [
308
+					'event_editor_help_tab'                            => [
309
+						'title'    => esc_html__('Event Editor', 'event_espresso'),
310
+						'filename' => 'event_editor',
311
+					],
312
+					'event_editor_title_richtexteditor_help_tab'       => [
313
+						'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
314
+						'filename' => 'event_editor_title_richtexteditor',
315
+					],
316
+					'event_editor_venue_details_help_tab'              => [
317
+						'title'    => esc_html__('Event Venue Details', 'event_espresso'),
318
+						'filename' => 'event_editor_venue_details',
319
+					],
320
+					'event_editor_event_datetimes_help_tab'            => [
321
+						'title'    => esc_html__('Event Datetimes', 'event_espresso'),
322
+						'filename' => 'event_editor_event_datetimes',
323
+					],
324
+					'event_editor_event_tickets_help_tab'              => [
325
+						'title'    => esc_html__('Event Tickets', 'event_espresso'),
326
+						'filename' => 'event_editor_event_tickets',
327
+					],
328
+					'event_editor_event_registration_options_help_tab' => [
329
+						'title'    => esc_html__('Event Registration Options', 'event_espresso'),
330
+						'filename' => 'event_editor_event_registration_options',
331
+					],
332
+					'event_editor_tags_categories_help_tab'            => [
333
+						'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
334
+						'filename' => 'event_editor_tags_categories',
335
+					],
336
+					'event_editor_questions_registrants_help_tab'      => [
337
+						'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
338
+						'filename' => 'event_editor_questions_registrants',
339
+					],
340
+					'event_editor_save_new_event_help_tab'             => [
341
+						'title'    => esc_html__('Save New Event', 'event_espresso'),
342
+						'filename' => 'event_editor_save_new_event',
343
+					],
344
+					'event_editor_other_help_tab'                      => [
345
+						'title'    => esc_html__('Event Other', 'event_espresso'),
346
+						'filename' => 'event_editor_other',
347
+					],
348
+				],
349
+				'qtips'         => ['EE_Event_Editor_Decaf_Tips'],
350
+				'require_nonce' => false,
351
+			],
352
+			'edit'                   => [
353
+				'nav'           => [
354
+					'label'      => esc_html__('Edit Event', 'event_espresso'),
355
+					'order'      => 5,
356
+					'persistent' => false,
357
+					'url'        => $post_id
358
+						? EE_Admin_Page::add_query_args_and_nonce(
359
+							['post' => $post_id, 'action' => 'edit'],
360
+							$this->_current_page_view_url
361
+						)
362
+						: $this->_admin_base_url,
363
+				],
364
+				'metaboxes'     => ['_register_event_editor_meta_boxes'],
365
+				'help_tabs'     => [
366
+					'event_editor_help_tab'                            => [
367
+						'title'    => esc_html__('Event Editor', 'event_espresso'),
368
+						'filename' => 'event_editor',
369
+					],
370
+					'event_editor_title_richtexteditor_help_tab'       => [
371
+						'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
372
+						'filename' => 'event_editor_title_richtexteditor',
373
+					],
374
+					'event_editor_venue_details_help_tab'              => [
375
+						'title'    => esc_html__('Event Venue Details', 'event_espresso'),
376
+						'filename' => 'event_editor_venue_details',
377
+					],
378
+					'event_editor_event_datetimes_help_tab'            => [
379
+						'title'    => esc_html__('Event Datetimes', 'event_espresso'),
380
+						'filename' => 'event_editor_event_datetimes',
381
+					],
382
+					'event_editor_event_tickets_help_tab'              => [
383
+						'title'    => esc_html__('Event Tickets', 'event_espresso'),
384
+						'filename' => 'event_editor_event_tickets',
385
+					],
386
+					'event_editor_event_registration_options_help_tab' => [
387
+						'title'    => esc_html__('Event Registration Options', 'event_espresso'),
388
+						'filename' => 'event_editor_event_registration_options',
389
+					],
390
+					'event_editor_tags_categories_help_tab'            => [
391
+						'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
392
+						'filename' => 'event_editor_tags_categories',
393
+					],
394
+					'event_editor_questions_registrants_help_tab'      => [
395
+						'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
396
+						'filename' => 'event_editor_questions_registrants',
397
+					],
398
+					'event_editor_save_new_event_help_tab'             => [
399
+						'title'    => esc_html__('Save New Event', 'event_espresso'),
400
+						'filename' => 'event_editor_save_new_event',
401
+					],
402
+					'event_editor_other_help_tab'                      => [
403
+						'title'    => esc_html__('Event Other', 'event_espresso'),
404
+						'filename' => 'event_editor_other',
405
+					],
406
+				],
407
+				'require_nonce' => false,
408
+			],
409
+			'default_event_settings' => [
410
+				'nav'           => [
411
+					'label' => esc_html__('Default Settings', 'event_espresso'),
412
+					'order' => 40,
413
+				],
414
+				'metaboxes'     => array_merge($this->_default_espresso_metaboxes, ['_publish_post_box']),
415
+				'labels'        => [
416
+					'publishbox' => esc_html__('Update Settings', 'event_espresso'),
417
+				],
418
+				'help_tabs'     => [
419
+					'default_settings_help_tab'        => [
420
+						'title'    => esc_html__('Default Event Settings', 'event_espresso'),
421
+						'filename' => 'events_default_settings',
422
+					],
423
+					'default_settings_status_help_tab' => [
424
+						'title'    => esc_html__('Default Registration Status', 'event_espresso'),
425
+						'filename' => 'events_default_settings_status',
426
+					],
427
+					'default_maximum_tickets_help_tab' => [
428
+						'title'    => esc_html__('Default Maximum Tickets Per Order', 'event_espresso'),
429
+						'filename' => 'events_default_settings_max_tickets',
430
+					],
431
+				],
432
+				'require_nonce' => false,
433
+			],
434
+			// template settings
435
+			'template_settings'      => [
436
+				'nav'           => [
437
+					'label' => esc_html__('Templates', 'event_espresso'),
438
+					'order' => 30,
439
+				],
440
+				'metaboxes'     => $this->_default_espresso_metaboxes,
441
+				'help_tabs'     => [
442
+					'general_settings_templates_help_tab' => [
443
+						'title'    => esc_html__('Templates', 'event_espresso'),
444
+						'filename' => 'general_settings_templates',
445
+					],
446
+				],
447
+				'require_nonce' => false,
448
+			],
449
+			// event category stuff
450
+			'add_category'           => [
451
+				'nav'           => [
452
+					'label'      => esc_html__('Add Category', 'event_espresso'),
453
+					'order'      => 15,
454
+					'persistent' => false,
455
+				],
456
+				'help_tabs'     => [
457
+					'add_category_help_tab' => [
458
+						'title'    => esc_html__('Add New Event Category', 'event_espresso'),
459
+						'filename' => 'events_add_category',
460
+					],
461
+				],
462
+				'metaboxes'     => ['_publish_post_box'],
463
+				'require_nonce' => false,
464
+			],
465
+			'edit_category'          => [
466
+				'nav'           => [
467
+					'label'      => esc_html__('Edit Category', 'event_espresso'),
468
+					'order'      => 15,
469
+					'persistent' => false,
470
+					'url'        => $EVT_CAT_ID
471
+						? add_query_arg(
472
+							['EVT_CAT_ID' => $EVT_CAT_ID],
473
+							$this->_current_page_view_url
474
+						)
475
+						: $this->_admin_base_url,
476
+				],
477
+				'help_tabs'     => [
478
+					'edit_category_help_tab' => [
479
+						'title'    => esc_html__('Edit Event Category', 'event_espresso'),
480
+						'filename' => 'events_edit_category',
481
+					],
482
+				],
483
+				'metaboxes'     => ['_publish_post_box'],
484
+				'require_nonce' => false,
485
+			],
486
+			'category_list'          => [
487
+				'nav'           => [
488
+					'label' => esc_html__('Categories', 'event_espresso'),
489
+					'order' => 20,
490
+				],
491
+				'list_table'    => 'Event_Categories_Admin_List_Table',
492
+				'help_tabs'     => [
493
+					'events_categories_help_tab'                       => [
494
+						'title'    => esc_html__('Event Categories', 'event_espresso'),
495
+						'filename' => 'events_categories',
496
+					],
497
+					'events_categories_table_column_headings_help_tab' => [
498
+						'title'    => esc_html__('Event Categories Table Column Headings', 'event_espresso'),
499
+						'filename' => 'events_categories_table_column_headings',
500
+					],
501
+					'events_categories_view_help_tab'                  => [
502
+						'title'    => esc_html__('Event Categories Views', 'event_espresso'),
503
+						'filename' => 'events_categories_views',
504
+					],
505
+					'events_categories_other_help_tab'                 => [
506
+						'title'    => esc_html__('Event Categories Other', 'event_espresso'),
507
+						'filename' => 'events_categories_other',
508
+					],
509
+				],
510
+				'metaboxes'     => $this->_default_espresso_metaboxes,
511
+				'require_nonce' => false,
512
+			],
513
+			'preview_deletion'       => [
514
+				'nav'           => [
515
+					'label'      => esc_html__('Preview Deletion', 'event_espresso'),
516
+					'order'      => 15,
517
+					'persistent' => false,
518
+					'url'        => '',
519
+				],
520
+				'require_nonce' => false,
521
+			],
522
+		];
523
+	}
524
+
525
+
526
+	/**
527
+	 * Used to register any global screen options if necessary for every route in this admin page group.
528
+	 */
529
+	protected function _add_screen_options()
530
+	{
531
+	}
532
+
533
+
534
+	/**
535
+	 * Implementing the screen options for the 'default' route.
536
+	 *
537
+	 * @throws InvalidArgumentException
538
+	 * @throws InvalidDataTypeException
539
+	 * @throws InvalidInterfaceException
540
+	 */
541
+	protected function _add_screen_options_default()
542
+	{
543
+		$this->_per_page_screen_option();
544
+	}
545
+
546
+
547
+	/**
548
+	 * Implementing screen options for the category list route.
549
+	 *
550
+	 * @throws InvalidArgumentException
551
+	 * @throws InvalidDataTypeException
552
+	 * @throws InvalidInterfaceException
553
+	 */
554
+	protected function _add_screen_options_category_list()
555
+	{
556
+		$page_title              = $this->_admin_page_title;
557
+		$this->_admin_page_title = esc_html__('Categories', 'event_espresso');
558
+		$this->_per_page_screen_option();
559
+		$this->_admin_page_title = $page_title;
560
+	}
561
+
562
+
563
+	/**
564
+	 * Used to register any global feature pointers for the admin page group.
565
+	 */
566
+	protected function _add_feature_pointers()
567
+	{
568
+	}
569
+
570
+
571
+	/**
572
+	 * Registers and enqueues any global scripts and styles for the entire admin page group.
573
+	 */
574
+	public function load_scripts_styles()
575
+	{
576
+		wp_register_style(
577
+			'events-admin-css',
578
+			EVENTS_ASSETS_URL . 'events-admin-page.css',
579
+			[],
580
+			EVENT_ESPRESSO_VERSION
581
+		);
582
+		wp_register_style(
583
+			'ee-cat-admin',
584
+			EVENTS_ASSETS_URL . 'ee-cat-admin.css',
585
+			[],
586
+			EVENT_ESPRESSO_VERSION
587
+		);
588
+		wp_enqueue_style('events-admin-css');
589
+		wp_enqueue_style('ee-cat-admin');
590
+		// scripts
591
+		wp_register_script(
592
+			'event_editor_js',
593
+			EVENTS_ASSETS_URL . 'event_editor.js',
594
+			['ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon'],
595
+			EVENT_ESPRESSO_VERSION,
596
+			true
597
+		);
598
+	}
599
+
600
+
601
+	/**
602
+	 * Enqueuing scripts and styles specific to this view
603
+	 */
604
+	public function load_scripts_styles_create_new()
605
+	{
606
+		$this->load_scripts_styles_edit();
607
+	}
608
+
609
+
610
+	/**
611
+	 * Enqueuing scripts and styles specific to this view
612
+	 */
613
+	public function load_scripts_styles_edit()
614
+	{
615
+		// styles
616
+		wp_enqueue_style('espresso-ui-theme');
617
+		wp_register_style(
618
+			'event-editor-css',
619
+			EVENTS_ASSETS_URL . 'event-editor.css',
620
+			['ee-admin-css'],
621
+			EVENT_ESPRESSO_VERSION
622
+		);
623
+		wp_enqueue_style('event-editor-css');
624
+		// scripts
625
+		if (! $this->admin_config->useAdvancedEditor()) {
626
+			wp_register_script(
627
+				'event-datetime-metabox',
628
+				EVENTS_ASSETS_URL . 'event-datetime-metabox.js',
629
+				['event_editor_js', 'ee-datepicker'],
630
+				EVENT_ESPRESSO_VERSION
631
+			);
632
+			wp_enqueue_script('event-datetime-metabox');
633
+		}
634
+	}
635
+
636
+
637
+	/**
638
+	 * Populating the _views property for the category list table view.
639
+	 */
640
+	protected function _set_list_table_views_category_list()
641
+	{
642
+		$this->_views = [
643
+			'all' => [
644
+				'slug'        => 'all',
645
+				'label'       => esc_html__('All', 'event_espresso'),
646
+				'count'       => 0,
647
+				'bulk_action' => [
648
+					'delete_categories' => esc_html__('Delete Permanently', 'event_espresso'),
649
+				],
650
+			],
651
+		];
652
+	}
653
+
654
+
655
+	/**
656
+	 * For adding anything that fires on the admin_init hook for any route within this admin page group.
657
+	 */
658
+	public function admin_init()
659
+	{
660
+		EE_Registry::$i18n_js_strings['image_confirm'] = esc_html__(
661
+			'Do you really want to delete this image? Please remember to update your event to complete the removal.',
662
+			'event_espresso'
663
+		);
664
+	}
665
+
666
+
667
+	/**
668
+	 * For adding anything that should be triggered on the admin_notices hook for any route within this admin page
669
+	 * group.
670
+	 */
671
+	public function admin_notices()
672
+	{
673
+	}
674
+
675
+
676
+	/**
677
+	 * For adding anything that should be triggered on the `admin_print_footer_scripts` hook for any route within
678
+	 * this admin page group.
679
+	 */
680
+	public function admin_footer_scripts()
681
+	{
682
+	}
683
+
684
+
685
+	/**
686
+	 * Call this function to verify if an event is public and has tickets for sale.  If it does, then we need to show a
687
+	 * warning (via EE_Error::add_error());
688
+	 *
689
+	 * @param EE_Event $event Event object
690
+	 * @param string   $req_type
691
+	 * @return void
692
+	 * @throws EE_Error
693
+	 * @throws ReflectionException
694
+	 */
695
+	public function verify_event_edit($event = null, $req_type = '')
696
+	{
697
+		// don't need to do this when processing
698
+		if (! empty($req_type)) {
699
+			return;
700
+		}
701
+		// no event?
702
+		if (! $event instanceof EE_Event) {
703
+			$event = $this->_cpt_model_obj;
704
+		}
705
+		// STILL no event?
706
+		if (! $event instanceof EE_Event) {
707
+			return;
708
+		}
709
+		$orig_status = $event->status();
710
+		// first check if event is active.
711
+		if (
712
+			$orig_status === EEM_Event::cancelled
713
+			|| $orig_status === EEM_Event::postponed
714
+			|| $event->is_expired()
715
+			|| $event->is_inactive()
716
+		) {
717
+			return;
718
+		}
719
+		// made it here so it IS active... next check that any of the tickets are sold.
720
+		if ($event->is_sold_out(true)) {
721
+			if ($orig_status !== EEM_Event::sold_out && $event->status() !== $orig_status) {
722
+				EE_Error::add_attention(
723
+					sprintf(
724
+						esc_html__(
725
+							'Please note that the Event Status has automatically been changed to %s because there are no more spaces available for this event.  However, this change is not permanent until you update the event.  You can change the status back to something else before updating if you wish.',
726
+							'event_espresso'
727
+						),
728
+						EEH_Template::pretty_status(EEM_Event::sold_out, false, 'sentence')
729
+					)
730
+				);
731
+			}
732
+			return;
733
+		}
734
+		if ($orig_status === EEM_Event::sold_out) {
735
+			EE_Error::add_attention(
736
+				sprintf(
737
+					esc_html__(
738
+						'Please note that the Event Status has automatically been changed to %s because more spaces have become available for this event, most likely due to abandoned transactions freeing up reserved tickets.  However, this change is not permanent until you update the event. If you wish, you can change the status back to something else before updating.',
739
+						'event_espresso'
740
+					),
741
+					EEH_Template::pretty_status($event->status(), false, 'sentence')
742
+				)
743
+			);
744
+		}
745
+		// now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
746
+		if (! $event->tickets_on_sale()) {
747
+			return;
748
+		}
749
+		// made it here so show warning
750
+		$this->_edit_event_warning();
751
+	}
752
+
753
+
754
+	/**
755
+	 * This is the text used for when an event is being edited that is public and has tickets for sale.
756
+	 * When needed, hook this into a EE_Error::add_error() notice.
757
+	 *
758
+	 * @access protected
759
+	 * @return void
760
+	 */
761
+	protected function _edit_event_warning()
762
+	{
763
+		// we don't want to add warnings during these requests
764
+		if ($this->request->getRequestParam('action') === 'editpost') {
765
+			return;
766
+		}
767
+		EE_Error::add_attention(
768
+			sprintf(
769
+				esc_html__(
770
+					'Your event is open for registration. Making changes may disrupt any transactions in progress. %sLearn more%s',
771
+					'event_espresso'
772
+				),
773
+				'<a class="espresso-help-tab-lnk">',
774
+				'</a>'
775
+			)
776
+		);
777
+	}
778
+
779
+
780
+	/**
781
+	 * When a user is creating a new event, notify them if they haven't set their timezone.
782
+	 * Otherwise, do the normal logic
783
+	 *
784
+	 * @return void
785
+	 * @throws EE_Error
786
+	 * @throws InvalidArgumentException
787
+	 * @throws InvalidDataTypeException
788
+	 * @throws InvalidInterfaceException
789
+	 */
790
+	protected function _create_new_cpt_item()
791
+	{
792
+		$has_timezone_string = get_option('timezone_string');
793
+		// only nag them about setting their timezone if it's their first event, and they haven't already done it
794
+		if (! $has_timezone_string && ! EEM_Event::instance()->exists([])) {
795
+			EE_Error::add_attention(
796
+				sprintf(
797
+					esc_html__(
798
+						'Your website\'s timezone is currently set to a UTC offset. We recommend updating your timezone to a city or region near you before you create an event. Change your timezone now:%1$s%2$s%3$sChange Timezone%4$s',
799
+						'event_espresso'
800
+					),
801
+					'<br>',
802
+					'<select id="timezone_string" name="timezone_string" aria-describedby="timezone-description">'
803
+					. EEH_DTT_Helper::wp_timezone_choice('', EEH_DTT_Helper::get_user_locale())
804
+					. '</select>',
805
+					'<button class="button button-secondary timezone-submit">',
806
+					'</button><span class="spinner"></span>'
807
+				),
808
+				__FILE__,
809
+				__FUNCTION__,
810
+				__LINE__
811
+			);
812
+		}
813
+		parent::_create_new_cpt_item();
814
+	}
815
+
816
+
817
+	/**
818
+	 * Sets the _views property for the default route in this admin page group.
819
+	 */
820
+	protected function _set_list_table_views_default()
821
+	{
822
+		$this->_views = [
823
+			'all'   => [
824
+				'slug'        => 'all',
825
+				'label'       => esc_html__('View All Events', 'event_espresso'),
826
+				'count'       => 0,
827
+				'bulk_action' => [
828
+					'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
829
+				],
830
+			],
831
+			'draft' => [
832
+				'slug'        => 'draft',
833
+				'label'       => esc_html__('Draft', 'event_espresso'),
834
+				'count'       => 0,
835
+				'bulk_action' => [
836
+					'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
837
+				],
838
+			],
839
+		];
840
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
841
+			$this->_views['trash'] = [
842
+				'slug'        => 'trash',
843
+				'label'       => esc_html__('Trash', 'event_espresso'),
844
+				'count'       => 0,
845
+				'bulk_action' => [
846
+					'restore_events' => esc_html__('Restore From Trash', 'event_espresso'),
847
+					'delete_events'  => esc_html__('Delete Permanently', 'event_espresso'),
848
+				],
849
+			];
850
+		}
851
+	}
852
+
853
+
854
+	/**
855
+	 * Provides the legend item array for the default list table view.
856
+	 *
857
+	 * @return array
858
+	 * @throws EE_Error
859
+	 * @throws EE_Error
860
+	 */
861
+	protected function _event_legend_items()
862
+	{
863
+		$items    = [
864
+			'view_details'   => [
865
+				'class' => 'dashicons dashicons-search',
866
+				'desc'  => esc_html__('View Event', 'event_espresso'),
867
+			],
868
+			'edit_event'     => [
869
+				'class' => 'ee-icon ee-icon-calendar-edit',
870
+				'desc'  => esc_html__('Edit Event Details', 'event_espresso'),
871
+			],
872
+			'view_attendees' => [
873
+				'class' => 'dashicons dashicons-groups',
874
+				'desc'  => esc_html__('View Registrations for Event', 'event_espresso'),
875
+			],
876
+		];
877
+		$items    = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items);
878
+		$statuses = [
879
+			'sold_out_status'  => [
880
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out,
881
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::sold_out, false, 'sentence'),
882
+			],
883
+			'active_status'    => [
884
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active,
885
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::active, false, 'sentence'),
886
+			],
887
+			'upcoming_status'  => [
888
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming,
889
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::upcoming, false, 'sentence'),
890
+			],
891
+			'postponed_status' => [
892
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed,
893
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::postponed, false, 'sentence'),
894
+			],
895
+			'cancelled_status' => [
896
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled,
897
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::cancelled, false, 'sentence'),
898
+			],
899
+			'expired_status'   => [
900
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired,
901
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::expired, false, 'sentence'),
902
+			],
903
+			'inactive_status'  => [
904
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive,
905
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::inactive, false, 'sentence'),
906
+			],
907
+		];
908
+		$statuses = apply_filters('FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses);
909
+		return array_merge($items, $statuses);
910
+	}
911
+
912
+
913
+	/**
914
+	 * @return EEM_Event
915
+	 * @throws EE_Error
916
+	 * @throws InvalidArgumentException
917
+	 * @throws InvalidDataTypeException
918
+	 * @throws InvalidInterfaceException
919
+	 * @throws ReflectionException
920
+	 */
921
+	private function _event_model()
922
+	{
923
+		if (! $this->_event_model instanceof EEM_Event) {
924
+			$this->_event_model = EE_Registry::instance()->load_model('Event');
925
+		}
926
+		return $this->_event_model;
927
+	}
928
+
929
+
930
+	/**
931
+	 * Adds extra buttons to the WP CPT permalink field row.
932
+	 * Method is called from parent and is hooked into the wp 'get_sample_permalink_html' filter.
933
+	 *
934
+	 * @param string $return    the current html
935
+	 * @param int    $id        the post id for the page
936
+	 * @param string $new_title What the title is
937
+	 * @param string $new_slug  what the slug is
938
+	 * @return string            The new html string for the permalink area
939
+	 */
940
+	public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug)
941
+	{
942
+		// make sure this is only when editing
943
+		if (! empty($id)) {
944
+			$post   = get_post($id);
945
+			$return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'
946
+					   . esc_html__('Shortcode', 'event_espresso')
947
+					   . '</a> ';
948
+			$return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id='
949
+					   . $post->ID
950
+					   . ']">';
951
+		}
952
+		return $return;
953
+	}
954
+
955
+
956
+	/**
957
+	 * _events_overview_list_table
958
+	 * This contains the logic for showing the events_overview list
959
+	 *
960
+	 * @access protected
961
+	 * @return void
962
+	 * @throws DomainException
963
+	 * @throws EE_Error
964
+	 * @throws InvalidArgumentException
965
+	 * @throws InvalidDataTypeException
966
+	 * @throws InvalidInterfaceException
967
+	 */
968
+	protected function _events_overview_list_table()
969
+	{
970
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
971
+		$after_list_table                           = [];
972
+		$after_list_table['view_event_list_button'] = EEH_HTML::br();
973
+		$after_list_table['view_event_list_button'] .= EEH_Template::get_button_or_link(
974
+			get_post_type_archive_link('espresso_events'),
975
+			esc_html__('View Event Archive Page', 'event_espresso'),
976
+			'button'
977
+		);
978
+		$after_list_table['legend']                 = $this->_display_legend($this->_event_legend_items());
979
+		$this->_admin_page_title                    .= ' ' . $this->get_action_link_or_button(
980
+			'create_new',
981
+			'add',
982
+			[],
983
+			'add-new-h2'
984
+		);
985
+		$this->_template_args['after_list_table']   = array_merge(
986
+			(array) $this->_template_args['after_list_table'],
987
+			$after_list_table
988
+		);
989
+		$this->display_admin_list_table_page_with_no_sidebar();
990
+	}
991
+
992
+
993
+	/**
994
+	 * this allows for extra misc actions in the default WP publish box
995
+	 *
996
+	 * @return void
997
+	 * @throws DomainException
998
+	 * @throws EE_Error
999
+	 * @throws InvalidArgumentException
1000
+	 * @throws InvalidDataTypeException
1001
+	 * @throws InvalidInterfaceException
1002
+	 * @throws ReflectionException
1003
+	 */
1004
+	public function extra_misc_actions_publish_box()
1005
+	{
1006
+		$this->_generate_publish_box_extra_content();
1007
+	}
1008
+
1009
+
1010
+	/**
1011
+	 * This is hooked into the WordPress do_action('save_post') hook and runs after the custom post type has been
1012
+	 * saved.
1013
+	 * Typically you would use this to save any additional data.
1014
+	 * Keep in mind also that "save_post" runs on EVERY post update to the database.
1015
+	 * ALSO very important.  When a post transitions from scheduled to published,
1016
+	 * the save_post action is fired but you will NOT have any _POST data containing any extra info you may have from
1017
+	 * other meta saves. So MAKE sure that you handle this accordingly.
1018
+	 *
1019
+	 * @access protected
1020
+	 * @abstract
1021
+	 * @param string $post_id The ID of the cpt that was saved (so you can link relationally)
1022
+	 * @param object $post    The post object of the cpt that was saved.
1023
+	 * @return void
1024
+	 * @throws EE_Error
1025
+	 * @throws InvalidArgumentException
1026
+	 * @throws InvalidDataTypeException
1027
+	 * @throws InvalidInterfaceException
1028
+	 * @throws ReflectionException
1029
+	 */
1030
+	protected function _insert_update_cpt_item($post_id, $post)
1031
+	{
1032
+		if ($post instanceof WP_Post && $post->post_type !== 'espresso_events') {
1033
+			// get out we're not processing an event save.
1034
+			return;
1035
+		}
1036
+		$event_values = [
1037
+			'EVT_member_only'     => $this->request->getRequestParam('member_only', false, 'bool'),
1038
+			'EVT_allow_overflow'  => $this->request->getRequestParam('EVT_allow_overflow', false, 'bool'),
1039
+			'EVT_timezone_string' => $this->request->getRequestParam('timezone_string'),
1040
+		];
1041
+		// check if the new EDTR reg options meta box is being used, and if so, don't run updates for legacy version
1042
+		if (! $this->admin_config->useAdvancedEditor() || ! $this->feature->allowed('use_reg_options_meta_box')) {
1043
+			$event_values['EVT_display_ticket_selector']     = $this->request->getRequestParam(
1044
+				'display_ticket_selector',
1045
+				false,
1046
+				'bool'
1047
+			);
1048
+			$event_values['EVT_additional_limit']            = min(
1049
+				apply_filters('FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255),
1050
+				$this->request->getRequestParam('additional_limit', null, 'int')
1051
+			);
1052
+			$event_values['EVT_default_registration_status'] = $this->request->getRequestParam(
1053
+				'EVT_default_registration_status',
1054
+				EE_Registry::instance()->CFG->registration->default_STS_ID
1055
+			);
1056
+
1057
+			$event_values['EVT_external_URL'] = $this->request->getRequestParam('externalURL');
1058
+			$event_values['EVT_phone']        = $this->request->getRequestParam('event_phone');
1059
+			$event_values['EVT_display_desc'] = $this->request->getRequestParam('display_desc', false, 'bool');
1060
+		}
1061
+		// update event
1062
+		$success = $this->_event_model()->update_by_ID($event_values, $post_id);
1063
+		// get event_object for other metaboxes...
1064
+		// though it would seem to make sense to just use $this->_event_model()->get_one_by_ID( $post_id )..
1065
+		// i have to setup where conditions to override the filters in the model
1066
+		// that filter out autodraft and inherit statuses so we GET the inherit id!
1067
+		$event = $this->_event_model()->get_one(
1068
+			[
1069
+				[
1070
+					$this->_event_model()->primary_key_name() => $post_id,
1071
+					'OR'                                      => [
1072
+						'status'   => $post->post_status,
1073
+						// if trying to "Publish" a sold out event, it's status will get switched back to "sold_out" in the db,
1074
+						// but the returned object here has a status of "publish", so use the original post status as well
1075
+						'status*1' => $this->request->getRequestParam('original_post_status'),
1076
+					],
1077
+				],
1078
+			]
1079
+		);
1080
+
1081
+		// the following are default callbacks for event attachment updates
1082
+		// that can be overridden by caffeinated functionality and/or addons.
1083
+		$event_update_callbacks = [];
1084
+		if (! $this->admin_config->useAdvancedEditor()) {
1085
+			$event_update_callbacks['_default_venue_update']   = [$this, '_default_venue_update'];
1086
+			$event_update_callbacks['_default_tickets_update'] = [$this, '_default_tickets_update'];
1087
+		}
1088
+		$event_update_callbacks = apply_filters(
1089
+			'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks',
1090
+			$event_update_callbacks
1091
+		);
1092
+
1093
+		$att_success = true;
1094
+		foreach ($event_update_callbacks as $e_callback) {
1095
+			$_success = is_callable($e_callback)
1096
+				? $e_callback($event, $this->request->requestParams())
1097
+				: false;
1098
+			// if ANY of these updates fail then we want the appropriate global error message
1099
+			$att_success = $_success !== false ? $att_success : false;
1100
+		}
1101
+		// any errors?
1102
+		if ($success && $att_success === false) {
1103
+			EE_Error::add_error(
1104
+				esc_html__(
1105
+					'Event Details saved successfully but something went wrong with saving attachments.',
1106
+					'event_espresso'
1107
+				),
1108
+				__FILE__,
1109
+				__FUNCTION__,
1110
+				__LINE__
1111
+			);
1112
+		} elseif ($success === false) {
1113
+			EE_Error::add_error(
1114
+				esc_html__('Event Details did not save successfully.', 'event_espresso'),
1115
+				__FILE__,
1116
+				__FUNCTION__,
1117
+				__LINE__
1118
+			);
1119
+		}
1120
+	}
1121
+
1122
+
1123
+	/**
1124
+	 * @param int $post_id
1125
+	 * @param int $revision_id
1126
+	 * @throws EE_Error
1127
+	 * @throws EE_Error
1128
+	 * @throws ReflectionException
1129
+	 * @see parent::restore_item()
1130
+	 */
1131
+	protected function _restore_cpt_item($post_id, $revision_id)
1132
+	{
1133
+		// copy existing event meta to new post
1134
+		$post_evt = $this->_event_model()->get_one_by_ID($post_id);
1135
+		if ($post_evt instanceof EE_Event) {
1136
+			// meta revision restore
1137
+			$post_evt->restore_revision($revision_id);
1138
+			// related objs restore
1139
+			$post_evt->restore_revision($revision_id, ['Venue', 'Datetime', 'Price']);
1140
+		}
1141
+	}
1142
+
1143
+
1144
+	/**
1145
+	 * Attach the venue to the Event
1146
+	 *
1147
+	 * @param EE_Event $event Event Object to add the venue to
1148
+	 * @param array    $data  The request data from the form
1149
+	 * @return bool           Success or fail.
1150
+	 * @throws EE_Error
1151
+	 * @throws ReflectionException
1152
+	 */
1153
+	protected function _default_venue_update(EE_Event $event, $data)
1154
+	{
1155
+		require_once(EE_MODELS . 'EEM_Venue.model.php');
1156
+		$venue_model = EE_Registry::instance()->load_model('Venue');
1157
+		$venue_id    = ! empty($data['venue_id']) ? $data['venue_id'] : null;
1158
+		// very important.  If we don't have a venue name...
1159
+		// then we'll get out because not necessary to create empty venue
1160
+		if (empty($data['venue_title'])) {
1161
+			return false;
1162
+		}
1163
+		$venue_array = [
1164
+			'VNU_wp_user'         => $event->get('EVT_wp_user'),
1165
+			'VNU_name'            => ! empty($data['venue_title']) ? $data['venue_title'] : null,
1166
+			'VNU_desc'            => ! empty($data['venue_description']) ? $data['venue_description'] : null,
1167
+			'VNU_identifier'      => ! empty($data['venue_identifier']) ? $data['venue_identifier'] : null,
1168
+			'VNU_short_desc'      => ! empty($data['venue_short_description'])
1169
+				? $data['venue_short_description']
1170
+				: null,
1171
+			'VNU_address'         => ! empty($data['address']) ? $data['address'] : null,
1172
+			'VNU_address2'        => ! empty($data['address2']) ? $data['address2'] : null,
1173
+			'VNU_city'            => ! empty($data['city']) ? $data['city'] : null,
1174
+			'STA_ID'              => ! empty($data['state']) ? $data['state'] : null,
1175
+			'CNT_ISO'             => ! empty($data['countries']) ? $data['countries'] : null,
1176
+			'VNU_zip'             => ! empty($data['zip']) ? $data['zip'] : null,
1177
+			'VNU_phone'           => ! empty($data['venue_phone']) ? $data['venue_phone'] : null,
1178
+			'VNU_capacity'        => ! empty($data['venue_capacity']) ? $data['venue_capacity'] : null,
1179
+			'VNU_url'             => ! empty($data['venue_url']) ? $data['venue_url'] : null,
1180
+			'VNU_virtual_phone'   => ! empty($data['virtual_phone']) ? $data['virtual_phone'] : null,
1181
+			'VNU_virtual_url'     => ! empty($data['virtual_url']) ? $data['virtual_url'] : null,
1182
+			'VNU_enable_for_gmap' => isset($data['enable_for_gmap']) ? 1 : 0,
1183
+			'status'              => 'publish',
1184
+		];
1185
+		// if we've got the venue_id then we're just updating the existing venue so let's do that and then get out.
1186
+		if (! empty($venue_id)) {
1187
+			$update_where  = [$venue_model->primary_key_name() => $venue_id];
1188
+			$rows_affected = $venue_model->update($venue_array, [$update_where]);
1189
+			// we've gotta make sure that the venue is always attached to a revision..
1190
+			// add_relation_to should take care of making sure that the relation is already present.
1191
+			$event->_add_relation_to($venue_id, 'Venue');
1192
+			return $rows_affected > 0;
1193
+		}
1194
+		// we insert the venue
1195
+		$venue_id = $venue_model->insert($venue_array);
1196
+		$event->_add_relation_to($venue_id, 'Venue');
1197
+		return ! empty($venue_id);
1198
+		// when we have the ancestor come in it's already been handled by the revision save.
1199
+	}
1200
+
1201
+
1202
+	/**
1203
+	 * Handles saving everything related to Tickets (datetimes, tickets, prices)
1204
+	 *
1205
+	 * @param EE_Event $event The Event object we're attaching data to
1206
+	 * @param array    $data  The request data from the form
1207
+	 * @return array
1208
+	 * @throws EE_Error
1209
+	 * @throws ReflectionException
1210
+	 * @throws Exception
1211
+	 */
1212
+	protected function _default_tickets_update(EE_Event $event, $data)
1213
+	{
1214
+		if ($this->admin_config->useAdvancedEditor()) {
1215
+			return [];
1216
+		}
1217
+		$datetime       = null;
1218
+		$saved_tickets  = [];
1219
+		$event_timezone = $event->get_timezone();
1220
+		$date_formats   = ['Y-m-d', 'h:i a'];
1221
+		foreach ($data['edit_event_datetimes'] as $row => $datetime_data) {
1222
+			// trim all values to ensure any excess whitespace is removed.
1223
+			$datetime_data                = array_map('trim', $datetime_data);
1224
+			$datetime_data['DTT_EVT_end'] =
1225
+				isset($datetime_data['DTT_EVT_end']) && ! empty($datetime_data['DTT_EVT_end'])
1226
+					? $datetime_data['DTT_EVT_end']
1227
+					: $datetime_data['DTT_EVT_start'];
1228
+			$datetime_values              = [
1229
+				'DTT_ID'        => ! empty($datetime_data['DTT_ID']) ? $datetime_data['DTT_ID'] : null,
1230
+				'DTT_EVT_start' => $datetime_data['DTT_EVT_start'],
1231
+				'DTT_EVT_end'   => $datetime_data['DTT_EVT_end'],
1232
+				'DTT_reg_limit' => empty($datetime_data['DTT_reg_limit']) ? EE_INF : $datetime_data['DTT_reg_limit'],
1233
+				'DTT_order'     => $row,
1234
+			];
1235
+			// if we have an id then let's get existing object first and then set the new values.
1236
+			//  Otherwise we instantiate a new object for save.
1237
+			if (! empty($datetime_data['DTT_ID'])) {
1238
+				$datetime = EEM_Datetime::instance($event_timezone)->get_one_by_ID($datetime_data['DTT_ID']);
1239
+				if (! $datetime instanceof EE_Datetime) {
1240
+					throw new RuntimeException(
1241
+						sprintf(
1242
+							esc_html__(
1243
+								'Something went wrong! A valid Datetime could not be retrieved from the database using the supplied ID: %1$d',
1244
+								'event_espresso'
1245
+							),
1246
+							$datetime_data['DTT_ID']
1247
+						)
1248
+					);
1249
+				}
1250
+				$datetime->set_date_format($date_formats[0]);
1251
+				$datetime->set_time_format($date_formats[1]);
1252
+				foreach ($datetime_values as $field => $value) {
1253
+					$datetime->set($field, $value);
1254
+				}
1255
+			} else {
1256
+				$datetime = EE_Datetime::new_instance($datetime_values, $event_timezone, $date_formats);
1257
+			}
1258
+			if (! $datetime instanceof EE_Datetime) {
1259
+				throw new RuntimeException(
1260
+					sprintf(
1261
+						esc_html__(
1262
+							'Something went wrong! A valid Datetime could not be generated or retrieved using the supplied data: %1$s',
1263
+							'event_espresso'
1264
+						),
1265
+						print_r($datetime_values, true)
1266
+					)
1267
+				);
1268
+			}
1269
+			// before going any further make sure our dates are setup correctly
1270
+			// so that the end date is always equal or greater than the start date.
1271
+			if ($datetime->get_raw('DTT_EVT_start') > $datetime->get_raw('DTT_EVT_end')) {
1272
+				$datetime->set('DTT_EVT_end', $datetime->get('DTT_EVT_start'));
1273
+				$datetime = EEH_DTT_Helper::date_time_add($datetime, 'DTT_EVT_end', 'days');
1274
+			}
1275
+			$datetime->save();
1276
+			$event->_add_relation_to($datetime, 'Datetime');
1277
+		}
1278
+		// no datetimes get deleted so we don't do any of that logic here.
1279
+		// update tickets next
1280
+		$old_tickets = isset($data['ticket_IDs']) ? explode(',', $data['ticket_IDs']) : [];
1281
+
1282
+		// set up some default start and end dates in case those are not present in the incoming data
1283
+		$default_start_date = new DateTime('now', new DateTimeZone($event->get_timezone()));
1284
+		$default_start_date = $default_start_date->format($date_formats[0] . ' ' . $date_formats[1]);
1285
+		// use the start date of the first datetime for the end date
1286
+		$first_datetime   = $event->first_datetime();
1287
+		$default_end_date = $first_datetime->start_date_and_time($date_formats[0], $date_formats[1]);
1288
+
1289
+		// now process the incoming data
1290
+		foreach ($data['edit_tickets'] as $row => $ticket_data) {
1291
+			$update_prices = false;
1292
+			$ticket_price  = isset($data['edit_prices'][ $row ][1]['PRC_amount'])
1293
+				? $data['edit_prices'][ $row ][1]['PRC_amount']
1294
+				: 0;
1295
+			// trim inputs to ensure any excess whitespace is removed.
1296
+			$ticket_data   = array_map('trim', $ticket_data);
1297
+			$ticket_values = [
1298
+				'TKT_ID'          => ! empty($ticket_data['TKT_ID']) ? $ticket_data['TKT_ID'] : null,
1299
+				'TTM_ID'          => ! empty($ticket_data['TTM_ID']) ? $ticket_data['TTM_ID'] : 0,
1300
+				'TKT_name'        => ! empty($ticket_data['TKT_name']) ? $ticket_data['TKT_name'] : '',
1301
+				'TKT_description' => ! empty($ticket_data['TKT_description']) ? $ticket_data['TKT_description'] : '',
1302
+				'TKT_start_date'  => ! empty($ticket_data['TKT_start_date'])
1303
+					? $ticket_data['TKT_start_date']
1304
+					: $default_start_date,
1305
+				'TKT_end_date'    => ! empty($ticket_data['TKT_end_date'])
1306
+					? $ticket_data['TKT_end_date']
1307
+					: $default_end_date,
1308
+				'TKT_qty'         => ! empty($ticket_data['TKT_qty'])
1309
+									 || (isset($ticket_data['TKT_qty']) && (int) $ticket_data['TKT_qty'] === 0)
1310
+					? $ticket_data['TKT_qty']
1311
+					: EE_INF,
1312
+				'TKT_uses'        => ! empty($ticket_data['TKT_uses'])
1313
+									 || (isset($ticket_data['TKT_uses']) && (int) $ticket_data['TKT_uses'] === 0)
1314
+					? $ticket_data['TKT_uses']
1315
+					: EE_INF,
1316
+				'TKT_min'         => ! empty($ticket_data['TKT_min']) ? $ticket_data['TKT_min'] : 0,
1317
+				'TKT_max'         => ! empty($ticket_data['TKT_max']) ? $ticket_data['TKT_max'] : EE_INF,
1318
+				'TKT_order'       => isset($ticket_data['TKT_order']) ? $ticket_data['TKT_order'] : $row,
1319
+				'TKT_price'       => $ticket_price,
1320
+				'TKT_row'         => $row,
1321
+			];
1322
+			// if this is a default ticket, then we need to set the TKT_ID to 0 and update accordingly,
1323
+			// which means in turn that the prices will become new prices as well.
1324
+			if (isset($ticket_data['TKT_is_default']) && $ticket_data['TKT_is_default']) {
1325
+				$ticket_values['TKT_ID']         = 0;
1326
+				$ticket_values['TKT_is_default'] = 0;
1327
+				$update_prices                   = true;
1328
+			}
1329
+			// if we have a TKT_ID then we need to get that existing TKT_obj and update it
1330
+			// we actually do our saves ahead of adding any relations because its entirely possible that this
1331
+			// ticket didn't get removed or added to any datetime in the session but DID have it's items modified.
1332
+			// keep in mind that if the ticket has been sold (and we have changed pricing information),
1333
+			// then we won't be updating the tkt but instead a new tkt will be created and the old one archived.
1334
+			if (! empty($ticket_data['TKT_ID'])) {
1335
+				$existing_ticket = EEM_Ticket::instance($event_timezone)->get_one_by_ID($ticket_data['TKT_ID']);
1336
+				if (! $existing_ticket instanceof EE_Ticket) {
1337
+					throw new RuntimeException(
1338
+						sprintf(
1339
+							esc_html__(
1340
+								'Something went wrong! A valid Ticket could not be retrieved from the database using the supplied ID: %1$d',
1341
+								'event_espresso'
1342
+							),
1343
+							$ticket_data['TKT_ID']
1344
+						)
1345
+					);
1346
+				}
1347
+				$ticket_sold = $existing_ticket->count_related(
1348
+					'Registration',
1349
+					[
1350
+							[
1351
+								'STS_ID' => [
1352
+									'NOT IN',
1353
+									[EEM_Registration::status_id_incomplete],
1354
+								],
1355
+							],
1356
+						]
1357
+				) > 0;
1358
+				// let's just check the total price for the existing ticket and determine if it matches the new total price.
1359
+				// if they are different then we create a new ticket (if $ticket_sold)
1360
+				// if they aren't different then we go ahead and modify existing ticket.
1361
+				$create_new_ticket = $ticket_sold
1362
+									 && $ticket_price !== $existing_ticket->price()
1363
+									 && ! $existing_ticket->deleted();
1364
+				$existing_ticket->set_date_format($date_formats[0]);
1365
+				$existing_ticket->set_time_format($date_formats[1]);
1366
+				// set new values
1367
+				foreach ($ticket_values as $field => $value) {
1368
+					if ($field == 'TKT_qty') {
1369
+						$existing_ticket->set_qty($value);
1370
+					} elseif ($field == 'TKT_price') {
1371
+						$existing_ticket->set('TKT_price', $ticket_price);
1372
+					} else {
1373
+						$existing_ticket->set($field, $value);
1374
+					}
1375
+				}
1376
+				$ticket = $existing_ticket;
1377
+				// if $create_new_ticket is false then we can safely update the existing ticket.
1378
+				//  Otherwise we have to create a new ticket.
1379
+				if ($create_new_ticket) {
1380
+					// archive the old ticket first
1381
+					$existing_ticket->set('TKT_deleted', 1);
1382
+					$existing_ticket->save();
1383
+					// make sure this ticket is still recorded in our $saved_tickets
1384
+					// so we don't run it through the regular trash routine.
1385
+					$saved_tickets[ $existing_ticket->ID() ] = $existing_ticket;
1386
+					// create new ticket that's a copy of the existing except,
1387
+					// (a new id of course and not archived) AND has the new TKT_price associated with it.
1388
+					$new_ticket = clone $existing_ticket;
1389
+					$new_ticket->set('TKT_ID', 0);
1390
+					$new_ticket->set('TKT_deleted', 0);
1391
+					$new_ticket->set('TKT_sold', 0);
1392
+					// now we need to make sure that $new prices are created as well and attached to new ticket.
1393
+					$update_prices = true;
1394
+					$ticket        = $new_ticket;
1395
+				}
1396
+			} else {
1397
+				// no TKT_id so a new ticket
1398
+				$ticket_values['TKT_price'] = $ticket_price;
1399
+				$ticket                     = EE_Ticket::new_instance($ticket_values, $event_timezone, $date_formats);
1400
+				$update_prices              = true;
1401
+			}
1402
+			if (! $ticket instanceof EE_Ticket) {
1403
+				throw new RuntimeException(
1404
+					sprintf(
1405
+						esc_html__(
1406
+							'Something went wrong! A valid Ticket could not be generated or retrieved using the supplied data: %1$s',
1407
+							'event_espresso'
1408
+						),
1409
+						print_r($ticket_values, true)
1410
+					)
1411
+				);
1412
+			}
1413
+			// cap ticket qty by datetime reg limits
1414
+			$ticket->set_qty(min($ticket->qty(), $ticket->qty('reg_limit')));
1415
+			// update ticket.
1416
+			$ticket->save();
1417
+			// before going any further make sure our dates are setup correctly
1418
+			// so that the end date is always equal or greater than the start date.
1419
+			if ($ticket->get_raw('TKT_start_date') > $ticket->get_raw('TKT_end_date')) {
1420
+				$ticket->set('TKT_end_date', $ticket->get('TKT_start_date'));
1421
+				$ticket = EEH_DTT_Helper::date_time_add($ticket, 'TKT_end_date', 'days');
1422
+				$ticket->save();
1423
+			}
1424
+			// initially let's add the ticket to the datetime
1425
+			$datetime->_add_relation_to($ticket, 'Ticket');
1426
+			$saved_tickets[ $ticket->ID() ] = $ticket;
1427
+			// add prices to ticket
1428
+			$this->_add_prices_to_ticket($data['edit_prices'][ $row ], $ticket, $update_prices);
1429
+		}
1430
+		// however now we need to handle permanently deleting tickets via the ui.
1431
+		//  Keep in mind that the ui does not allow deleting/archiving tickets that have ticket sold.
1432
+		//  However, it does allow for deleting tickets that have no tickets sold,
1433
+		// in which case we want to get rid of permanently because there is no need to save in db.
1434
+		$old_tickets     = isset($old_tickets[0]) && $old_tickets[0] === '' ? [] : $old_tickets;
1435
+		$tickets_removed = array_diff($old_tickets, array_keys($saved_tickets));
1436
+		foreach ($tickets_removed as $id) {
1437
+			$id = absint($id);
1438
+			// get the ticket for this id
1439
+			$ticket_to_remove = EEM_Ticket::instance()->get_one_by_ID($id);
1440
+			if (! $ticket_to_remove instanceof EE_Ticket) {
1441
+				continue;
1442
+			}
1443
+			// need to get all the related datetimes on this ticket and remove from every single one of them
1444
+			// (remember this process can ONLY kick off if there are NO tickets sold)
1445
+			$related_datetimes = $ticket_to_remove->get_many_related('Datetime');
1446
+			foreach ($related_datetimes as $related_datetime) {
1447
+				$ticket_to_remove->_remove_relation_to($related_datetime, 'Datetime');
1448
+			}
1449
+			// need to do the same for prices (except these prices can also be deleted because again,
1450
+			// tickets can only be trashed if they don't have any TKTs sold (otherwise they are just archived))
1451
+			$ticket_to_remove->delete_related_permanently('Price');
1452
+			// finally let's delete this ticket
1453
+			// (which should not be blocked at this point b/c we've removed all our relationships)
1454
+			$ticket_to_remove->delete_permanently();
1455
+		}
1456
+		return [$datetime, $saved_tickets];
1457
+	}
1458
+
1459
+
1460
+	/**
1461
+	 * This attaches a list of given prices to a ticket.
1462
+	 * Note we dont' have to worry about ever removing relationships (or archiving prices)
1463
+	 * because if there is a change in price information on a ticket, a new ticket is created anyways
1464
+	 * so the archived ticket will retain the old price info and prices are automatically "archived" via the ticket.
1465
+	 *
1466
+	 * @access  private
1467
+	 * @param array     $prices_data Array of prices from the form.
1468
+	 * @param EE_Ticket $ticket      EE_Ticket object that prices are being attached to.
1469
+	 * @param bool      $new_prices  Whether attach existing incoming prices or create new ones.
1470
+	 * @return  void
1471
+	 * @throws EE_Error
1472
+	 * @throws ReflectionException
1473
+	 */
1474
+	private function _add_prices_to_ticket($prices_data, EE_Ticket $ticket, $new_prices = false)
1475
+	{
1476
+		$timezone = $ticket->get_timezone();
1477
+		foreach ($prices_data as $row => $price_data) {
1478
+			$price_values = [
1479
+				'PRC_ID'         => ! empty($price_data['PRC_ID']) ? $price_data['PRC_ID'] : null,
1480
+				'PRT_ID'         => ! empty($price_data['PRT_ID']) ? $price_data['PRT_ID'] : null,
1481
+				'PRC_amount'     => ! empty($price_data['PRC_amount']) ? $price_data['PRC_amount'] : 0,
1482
+				'PRC_name'       => ! empty($price_data['PRC_name']) ? $price_data['PRC_name'] : '',
1483
+				'PRC_desc'       => ! empty($price_data['PRC_desc']) ? $price_data['PRC_desc'] : '',
1484
+				'PRC_is_default' => 0, // make sure prices are NOT set as default from this context
1485
+				'PRC_order'      => $row,
1486
+			];
1487
+			if ($new_prices || empty($price_values['PRC_ID'])) {
1488
+				$price_values['PRC_ID'] = 0;
1489
+				$price                  = EE_Price::new_instance($price_values, $timezone);
1490
+			} else {
1491
+				$price = EEM_Price::instance($timezone)->get_one_by_ID($price_data['PRC_ID']);
1492
+				// update this price with new values
1493
+				foreach ($price_values as $field => $new_price) {
1494
+					$price->set($field, $new_price);
1495
+				}
1496
+			}
1497
+			if (! $price instanceof EE_Price) {
1498
+				throw new RuntimeException(
1499
+					sprintf(
1500
+						esc_html__(
1501
+							'Something went wrong! A valid Price could not be generated or retrieved using the supplied data: %1$s',
1502
+							'event_espresso'
1503
+						),
1504
+						print_r($price_values, true)
1505
+					)
1506
+				);
1507
+			}
1508
+			$price->save();
1509
+			$ticket->_add_relation_to($price, 'Price');
1510
+		}
1511
+	}
1512
+
1513
+
1514
+	/**
1515
+	 * Add in our autosave ajax handlers
1516
+	 *
1517
+	 */
1518
+	protected function _ee_autosave_create_new()
1519
+	{
1520
+	}
1521
+
1522
+
1523
+	/**
1524
+	 * More autosave handlers.
1525
+	 */
1526
+	protected function _ee_autosave_edit()
1527
+	{
1528
+	}
1529
+
1530
+
1531
+	/**
1532
+	 * @throws EE_Error
1533
+	 * @throws ReflectionException
1534
+	 */
1535
+	private function _generate_publish_box_extra_content()
1536
+	{
1537
+		// load formatter helper
1538
+		// args for getting related registrations
1539
+		$approved_query_args        = [
1540
+			[
1541
+				'REG_deleted' => 0,
1542
+				'STS_ID'      => EEM_Registration::status_id_approved,
1543
+			],
1544
+		];
1545
+		$not_approved_query_args    = [
1546
+			[
1547
+				'REG_deleted' => 0,
1548
+				'STS_ID'      => EEM_Registration::status_id_not_approved,
1549
+			],
1550
+		];
1551
+		$pending_payment_query_args = [
1552
+			[
1553
+				'REG_deleted' => 0,
1554
+				'STS_ID'      => EEM_Registration::status_id_pending_payment,
1555
+			],
1556
+		];
1557
+		// publish box
1558
+		$publish_box_extra_args = [
1559
+			'view_approved_reg_url'        => add_query_arg(
1560
+				[
1561
+					'action'      => 'default',
1562
+					'event_id'    => $this->_cpt_model_obj->ID(),
1563
+					'_reg_status' => EEM_Registration::status_id_approved,
1564
+				],
1565
+				REG_ADMIN_URL
1566
+			),
1567
+			'view_not_approved_reg_url'    => add_query_arg(
1568
+				[
1569
+					'action'      => 'default',
1570
+					'event_id'    => $this->_cpt_model_obj->ID(),
1571
+					'_reg_status' => EEM_Registration::status_id_not_approved,
1572
+				],
1573
+				REG_ADMIN_URL
1574
+			),
1575
+			'view_pending_payment_reg_url' => add_query_arg(
1576
+				[
1577
+					'action'      => 'default',
1578
+					'event_id'    => $this->_cpt_model_obj->ID(),
1579
+					'_reg_status' => EEM_Registration::status_id_pending_payment,
1580
+				],
1581
+				REG_ADMIN_URL
1582
+			),
1583
+			'approved_regs'                => $this->_cpt_model_obj->count_related(
1584
+				'Registration',
1585
+				$approved_query_args
1586
+			),
1587
+			'not_approved_regs'            => $this->_cpt_model_obj->count_related(
1588
+				'Registration',
1589
+				$not_approved_query_args
1590
+			),
1591
+			'pending_payment_regs'         => $this->_cpt_model_obj->count_related(
1592
+				'Registration',
1593
+				$pending_payment_query_args
1594
+			),
1595
+			'misc_pub_section_class'       => apply_filters(
1596
+				'FHEE_Events_Admin_Page___generate_publish_box_extra_content__misc_pub_section_class',
1597
+				'misc-pub-section'
1598
+			),
1599
+		];
1600
+		ob_start();
1601
+		do_action(
1602
+			'AHEE__Events_Admin_Page___generate_publish_box_extra_content__event_editor_overview_add',
1603
+			$this->_cpt_model_obj
1604
+		);
1605
+		$publish_box_extra_args['event_editor_overview_add'] = ob_get_clean();
1606
+		// load template
1607
+		EEH_Template::display_template(
1608
+			EVENTS_TEMPLATE_PATH . 'event_publish_box_extras.template.php',
1609
+			$publish_box_extra_args
1610
+		);
1611
+	}
1612
+
1613
+
1614
+	/**
1615
+	 * @return EE_Event
1616
+	 */
1617
+	public function get_event_object()
1618
+	{
1619
+		return $this->_cpt_model_obj;
1620
+	}
1621
+
1622
+
1623
+
1624
+
1625
+	/** METABOXES * */
1626
+	/**
1627
+	 * _register_event_editor_meta_boxes
1628
+	 * add all metaboxes related to the event_editor
1629
+	 *
1630
+	 * @return void
1631
+	 * @throws EE_Error
1632
+	 * @throws ReflectionException
1633
+	 */
1634
+	protected function _register_event_editor_meta_boxes()
1635
+	{
1636
+		$this->verify_cpt_object();
1637
+		$use_advanced_editor = $this->admin_config->useAdvancedEditor();
1638
+		// check if the new EDTR reg options meta box is being used, and if so, don't load the legacy version
1639
+		if (! $use_advanced_editor || ! $this->feature->allowed('use_reg_options_meta_box')) {
1640
+			add_meta_box(
1641
+				'espresso_event_editor_event_options',
1642
+				esc_html__('Event Registration Options', 'event_espresso'),
1643
+				[$this, 'registration_options_meta_box'],
1644
+				$this->page_slug,
1645
+				'side'
1646
+			);
1647
+		}
1648
+		if (! $use_advanced_editor) {
1649
+			add_meta_box(
1650
+				'espresso_event_editor_tickets',
1651
+				esc_html__('Event Datetime & Ticket', 'event_espresso'),
1652
+				[$this, 'ticket_metabox'],
1653
+				$this->page_slug,
1654
+				'normal',
1655
+				'high'
1656
+			);
1657
+		} elseif ($this->feature->allowed('use_reg_options_meta_box')) {
1658
+			add_action(
1659
+				'add_meta_boxes_espresso_events',
1660
+				function () {
1661
+					global $current_screen;
1662
+					remove_meta_box('authordiv', $current_screen, 'normal');
1663
+				},
1664
+				99
1665
+			);
1666
+		}
1667
+		// NOTE: if you're looking for other metaboxes in here,
1668
+		// where a metabox has a related management page in the admin
1669
+		// you will find it setup in the related management page's "_Hooks" file.
1670
+		// i.e. messages metabox is found in "espresso_events_Messages_Hooks.class.php".
1671
+	}
1672
+
1673
+
1674
+	/**
1675
+	 * @throws DomainException
1676
+	 * @throws EE_Error
1677
+	 * @throws ReflectionException
1678
+	 */
1679
+	public function ticket_metabox()
1680
+	{
1681
+		$existing_datetime_ids = $existing_ticket_ids = [];
1682
+		// defaults for template args
1683
+		$template_args = [
1684
+			'existing_datetime_ids'    => '',
1685
+			'event_datetime_help_link' => '',
1686
+			'ticket_options_help_link' => '',
1687
+			'time'                     => null,
1688
+			'ticket_rows'              => '',
1689
+			'existing_ticket_ids'      => '',
1690
+			'total_ticket_rows'        => 1,
1691
+			'ticket_js_structure'      => '',
1692
+			'trash_icon'               => 'ee-lock-icon',
1693
+			'disabled'                 => '',
1694
+		];
1695
+		$event_id      = is_object($this->_cpt_model_obj) ? $this->_cpt_model_obj->ID() : null;
1696
+		/**
1697
+		 * 1. Start with retrieving Datetimes
1698
+		 * 2. Fore each datetime get related tickets
1699
+		 * 3. For each ticket get related prices
1700
+		 */
1701
+		/** @var EEM_Datetime $datetime_model */
1702
+		$datetime_model = EE_Registry::instance()->load_model('Datetime');
1703
+		/** @var EEM_Ticket $datetime_model */
1704
+		$ticket_model = EE_Registry::instance()->load_model('Ticket');
1705
+		$times        = $datetime_model->get_all_event_dates($event_id);
1706
+		/** @type EE_Datetime $first_datetime */
1707
+		$first_datetime = reset($times);
1708
+		// do we get related tickets?
1709
+		if (
1710
+			$first_datetime instanceof EE_Datetime
1711
+			&& $first_datetime->ID() !== 0
1712
+		) {
1713
+			$existing_datetime_ids[] = $first_datetime->get('DTT_ID');
1714
+			$template_args['time']   = $first_datetime;
1715
+			$related_tickets         = $first_datetime->tickets(
1716
+				[
1717
+					['OR' => ['TKT_deleted' => 1, 'TKT_deleted*' => 0]],
1718
+					'default_where_conditions' => 'none',
1719
+				]
1720
+			);
1721
+			if (! empty($related_tickets)) {
1722
+				$template_args['total_ticket_rows'] = count($related_tickets);
1723
+				$row                                = 0;
1724
+				foreach ($related_tickets as $ticket) {
1725
+					$existing_ticket_ids[]        = $ticket->get('TKT_ID');
1726
+					$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, false, $row);
1727
+					$row++;
1728
+				}
1729
+			} else {
1730
+				$template_args['total_ticket_rows'] = 1;
1731
+				/** @type EE_Ticket $ticket */
1732
+				$ticket                       = $ticket_model->create_default_object();
1733
+				$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket);
1734
+			}
1735
+		} else {
1736
+			$template_args['time'] = $times[0];
1737
+			/** @type EE_Ticket[] $tickets */
1738
+			$tickets                      = $ticket_model->get_all_default_tickets();
1739
+			$template_args['ticket_rows'] .= $this->_get_ticket_row($tickets[1]);
1740
+			// NOTE: we're just sending the first default row
1741
+			// (decaf can't manage default tickets so this should be sufficient);
1742
+		}
1743
+		$template_args['event_datetime_help_link'] = $this->_get_help_tab_link(
1744
+			'event_editor_event_datetimes_help_tab'
1745
+		);
1746
+		$template_args['ticket_options_help_link'] = $this->_get_help_tab_link('ticket_options_info');
1747
+		$template_args['existing_datetime_ids']    = implode(',', $existing_datetime_ids);
1748
+		$template_args['existing_ticket_ids']      = implode(',', $existing_ticket_ids);
1749
+		$template_args['ticket_js_structure']      = $this->_get_ticket_row(
1750
+			$ticket_model->create_default_object(),
1751
+			true
1752
+		);
1753
+		$template                                  = apply_filters(
1754
+			'FHEE__Events_Admin_Page__ticket_metabox__template',
1755
+			EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php'
1756
+		);
1757
+		EEH_Template::display_template($template, $template_args);
1758
+	}
1759
+
1760
+
1761
+	/**
1762
+	 * Setup an individual ticket form for the decaf event editor page
1763
+	 *
1764
+	 * @access private
1765
+	 * @param EE_Ticket $ticket   the ticket object
1766
+	 * @param boolean   $skeleton whether we're generating a skeleton for js manipulation
1767
+	 * @param int       $row
1768
+	 * @return string generated html for the ticket row.
1769
+	 * @throws EE_Error
1770
+	 * @throws ReflectionException
1771
+	 */
1772
+	private function _get_ticket_row($ticket, $skeleton = false, $row = 0)
1773
+	{
1774
+		$template_args = [
1775
+			'tkt_status_class'    => ' tkt-status-' . $ticket->ticket_status(),
1776
+			'tkt_archive_class'   => $ticket->ticket_status() === EE_Ticket::archived && ! $skeleton ? ' tkt-archived'
1777
+				: '',
1778
+			'ticketrow'           => $skeleton ? 'TICKETNUM' : $row,
1779
+			'TKT_ID'              => $ticket->get('TKT_ID'),
1780
+			'TKT_name'            => $ticket->get('TKT_name'),
1781
+			'TKT_start_date'      => $skeleton ? '' : $ticket->get_date('TKT_start_date', 'Y-m-d h:i a'),
1782
+			'TKT_end_date'        => $skeleton ? '' : $ticket->get_date('TKT_end_date', 'Y-m-d h:i a'),
1783
+			'TKT_is_default'      => $ticket->get('TKT_is_default'),
1784
+			'TKT_qty'             => $ticket->get_pretty('TKT_qty', 'input'),
1785
+			'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1786
+			'TKT_sold'            => $skeleton ? 0 : $ticket->get('TKT_sold'),
1787
+			'trash_icon'          => ($skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')))
1788
+									 && (! empty($ticket) && $ticket->get('TKT_sold') === 0)
1789
+				? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1790
+			'disabled'            => $skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')) ? ''
1791
+				: ' disabled=disabled',
1792
+		];
1793
+		$price         = $ticket->ID() !== 0
1794
+			? $ticket->get_first_related('Price', ['default_where_conditions' => 'none'])
1795
+			: null;
1796
+		$price         = $price instanceof EE_Price
1797
+			? $price
1798
+			: EEM_Price::instance()->create_default_object();
1799
+		$price_args    = [
1800
+			'price_currency_symbol' => EE_Registry::instance()->CFG->currency->sign,
1801
+			'PRC_amount'            => $price->get('PRC_amount'),
1802
+			'PRT_ID'                => $price->get('PRT_ID'),
1803
+			'PRC_ID'                => $price->get('PRC_ID'),
1804
+			'PRC_is_default'        => $price->get('PRC_is_default'),
1805
+		];
1806
+		// make sure we have default start and end dates if skeleton
1807
+		// handle rows that should NOT be empty
1808
+		if (empty($template_args['TKT_start_date'])) {
1809
+			// if empty then the start date will be now.
1810
+			$template_args['TKT_start_date'] = date('Y-m-d h:i a', current_time('timestamp'));
1811
+		}
1812
+		if (empty($template_args['TKT_end_date'])) {
1813
+			// get the earliest datetime (if present);
1814
+			$earliest_datetime             = $this->_cpt_model_obj->ID() > 0
1815
+				? $this->_cpt_model_obj->get_first_related(
1816
+					'Datetime',
1817
+					['order_by' => ['DTT_EVT_start' => 'ASC']]
1818
+				)
1819
+				: null;
1820
+			$template_args['TKT_end_date'] = $earliest_datetime instanceof EE_Datetime
1821
+				? $earliest_datetime->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a')
1822
+				: date('Y-m-d h:i a', mktime(0, 0, 0, date('m'), date('d') + 7, date('Y')));
1823
+		}
1824
+		$template_args = array_merge($template_args, $price_args);
1825
+		$template      = apply_filters(
1826
+			'FHEE__Events_Admin_Page__get_ticket_row__template',
1827
+			EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_ticket_row.template.php',
1828
+			$ticket
1829
+		);
1830
+		return EEH_Template::display_template($template, $template_args, true);
1831
+	}
1832
+
1833
+
1834
+	/**
1835
+	 * @throws EE_Error
1836
+	 * @throws ReflectionException
1837
+	 */
1838
+	public function registration_options_meta_box()
1839
+	{
1840
+		$yes_no_values             = [
1841
+			['id' => true, 'text' => esc_html__('Yes', 'event_espresso')],
1842
+			['id' => false, 'text' => esc_html__('No', 'event_espresso')],
1843
+		];
1844
+		$default_reg_status_values = EEM_Registration::reg_status_array(
1845
+			[
1846
+				EEM_Registration::status_id_cancelled,
1847
+				EEM_Registration::status_id_declined,
1848
+				EEM_Registration::status_id_incomplete,
1849
+			],
1850
+			true
1851
+		);
1852
+		// $template_args['is_active_select'] = EEH_Form_Fields::select_input('is_active', $yes_no_values, $this->_cpt_model_obj->is_active());
1853
+		$template_args['_event']                          = $this->_cpt_model_obj;
1854
+		$template_args['event']                           = $this->_cpt_model_obj;
1855
+		$template_args['active_status']                   = $this->_cpt_model_obj->pretty_active_status(false);
1856
+		$template_args['additional_limit']                = $this->_cpt_model_obj->additional_limit();
1857
+		$template_args['default_registration_status']     = EEH_Form_Fields::select_input(
1858
+			'default_reg_status',
1859
+			$default_reg_status_values,
1860
+			$this->_cpt_model_obj->default_registration_status()
1861
+		);
1862
+		$template_args['display_description']             = EEH_Form_Fields::select_input(
1863
+			'display_desc',
1864
+			$yes_no_values,
1865
+			$this->_cpt_model_obj->display_description()
1866
+		);
1867
+		$template_args['display_ticket_selector']         = EEH_Form_Fields::select_input(
1868
+			'display_ticket_selector',
1869
+			$yes_no_values,
1870
+			$this->_cpt_model_obj->display_ticket_selector(),
1871
+			'',
1872
+			'',
1873
+			false
1874
+		);
1875
+		$template_args['additional_registration_options'] = apply_filters(
1876
+			'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options',
1877
+			'',
1878
+			$template_args,
1879
+			$yes_no_values,
1880
+			$default_reg_status_values
1881
+		);
1882
+		EEH_Template::display_template(
1883
+			EVENTS_TEMPLATE_PATH . 'event_registration_options.template.php',
1884
+			$template_args
1885
+		);
1886
+	}
1887
+
1888
+
1889
+	/**
1890
+	 * _get_events()
1891
+	 * This method simply returns all the events (for the given _view and paging)
1892
+	 *
1893
+	 * @access public
1894
+	 * @param int  $per_page     count of items per page (20 default);
1895
+	 * @param int  $current_page what is the current page being viewed.
1896
+	 * @param bool $count        if TRUE then we just return a count of ALL events matching the given _view.
1897
+	 *                           If FALSE then we return an array of event objects
1898
+	 *                           that match the given _view and paging parameters.
1899
+	 * @return array|int         an array of event objects or a count of them.
1900
+	 * @throws Exception
1901
+	 */
1902
+	public function get_events($per_page = 10, $current_page = 1, $count = false)
1903
+	{
1904
+		$EEM_Event   = $this->_event_model();
1905
+		$offset      = ($current_page - 1) * $per_page;
1906
+		$limit       = $count ? null : $offset . ',' . $per_page;
1907
+		$orderby     = $this->request->getRequestParam('orderby', 'EVT_ID');
1908
+		$order       = $this->request->getRequestParam('order', 'DESC');
1909
+		$month_range = $this->request->getRequestParam('month_range');
1910
+		if ($month_range) {
1911
+			$pieces = explode(' ', $month_range, 3);
1912
+			// simulate the FIRST day of the month, that fixes issues for months like February
1913
+			// where PHP doesn't know what to assume for date.
1914
+			// @see https://events.codebasehq.com/projects/event-espresso/tickets/10437
1915
+			$month_r = ! empty($pieces[0]) ? date('m', EEH_DTT_Helper::first_of_month_timestamp($pieces[0])) : '';
1916
+			$year_r  = ! empty($pieces[1]) ? $pieces[1] : '';
1917
+		}
1918
+		$where  = [];
1919
+		$status = $this->request->getRequestParam('status');
1920
+		// determine what post_status our condition will have for the query.
1921
+		switch ($status) {
1922
+			case 'month':
1923
+			case 'today':
1924
+			case null:
1925
+			case 'all':
1926
+				break;
1927
+			case 'draft':
1928
+				$where['status'] = ['IN', ['draft', 'auto-draft']];
1929
+				break;
1930
+			default:
1931
+				$where['status'] = $status;
1932
+		}
1933
+		// categories? The default for all categories is -1
1934
+		$category = $this->request->getRequestParam('EVT_CAT', -1, 'int');
1935
+		if ($category !== -1) {
1936
+			$where['Term_Taxonomy.taxonomy'] = EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY;
1937
+			$where['Term_Taxonomy.term_id']  = $category;
1938
+		}
1939
+		// date where conditions
1940
+		$start_formats = EEM_Datetime::instance()->get_formats_for('DTT_EVT_start');
1941
+		if ($month_range) {
1942
+			$DateTime = new DateTime(
1943
+				$year_r . '-' . $month_r . '-01 00:00:00',
1944
+				new DateTimeZone('UTC')
1945
+			);
1946
+			$start    = $DateTime->getTimestamp();
1947
+			// set the datetime to be the end of the month
1948
+			$DateTime->setDate(
1949
+				$year_r,
1950
+				$month_r,
1951
+				$DateTime->format('t')
1952
+			)->setTime(23, 59, 59);
1953
+			$end                             = $DateTime->getTimestamp();
1954
+			$where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1955
+		} elseif ($status === 'today') {
1956
+			$DateTime                        =
1957
+				new DateTime('now', new DateTimeZone(EEM_Event::instance()->get_timezone()));
1958
+			$start                           = $DateTime->setTime(0, 0)->format(implode(' ', $start_formats));
1959
+			$end                             = $DateTime->setTime(23, 59, 59)->format(implode(' ', $start_formats));
1960
+			$where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1961
+		} elseif ($status === 'month') {
1962
+			$now                             = date('Y-m-01');
1963
+			$DateTime                        =
1964
+				new DateTime($now, new DateTimeZone(EEM_Event::instance()->get_timezone()));
1965
+			$start                           = $DateTime->setTime(0, 0)->format(implode(' ', $start_formats));
1966
+			$end                             = $DateTime->setDate(date('Y'), date('m'), $DateTime->format('t'))
1967
+														->setTime(23, 59, 59)
1968
+														->format(implode(' ', $start_formats));
1969
+			$where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1970
+		}
1971
+		if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1972
+			$where['EVT_wp_user'] = get_current_user_id();
1973
+		} else {
1974
+			if (! isset($where['status'])) {
1975
+				if (! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) {
1976
+					$where['OR'] = [
1977
+						'status*restrict_private' => ['!=', 'private'],
1978
+						'AND'                     => [
1979
+							'status*inclusive' => ['=', 'private'],
1980
+							'EVT_wp_user'      => get_current_user_id(),
1981
+						],
1982
+					];
1983
+				}
1984
+			}
1985
+		}
1986
+		$wp_user = $this->request->getRequestParam('EVT_wp_user', 0, 'int');
1987
+		if (
1988
+			$wp_user
1989
+			&& $wp_user !== get_current_user_id()
1990
+			&& EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')
1991
+		) {
1992
+			$where['EVT_wp_user'] = $wp_user;
1993
+		}
1994
+		// search query handling
1995
+		$search_term = $this->request->getRequestParam('s');
1996
+		if ($search_term) {
1997
+			$search_term = '%' . $search_term . '%';
1998
+			$where['OR'] = [
1999
+				'EVT_name'       => ['LIKE', $search_term],
2000
+				'EVT_desc'       => ['LIKE', $search_term],
2001
+				'EVT_short_desc' => ['LIKE', $search_term],
2002
+			];
2003
+		}
2004
+		// filter events by venue.
2005
+		$venue = $this->request->getRequestParam('venue', 0, 'int');
2006
+		if ($venue) {
2007
+			$where['Venue.VNU_ID'] = $venue;
2008
+		}
2009
+		$request_params = $this->request->requestParams();
2010
+		$where          = apply_filters('FHEE__Events_Admin_Page__get_events__where', $where, $request_params);
2011
+		$query_params   = apply_filters(
2012
+			'FHEE__Events_Admin_Page__get_events__query_params',
2013
+			[
2014
+				$where,
2015
+				'limit'    => $limit,
2016
+				'order_by' => $orderby,
2017
+				'order'    => $order,
2018
+				'group_by' => 'EVT_ID',
2019
+			],
2020
+			$request_params
2021
+		);
2022
+
2023
+		// let's first check if we have special requests coming in.
2024
+		$active_status = $this->request->getRequestParam('active_status');
2025
+		if ($active_status) {
2026
+			switch ($active_status) {
2027
+				case 'upcoming':
2028
+					return $EEM_Event->get_upcoming_events($query_params, $count);
2029
+				case 'expired':
2030
+					return $EEM_Event->get_expired_events($query_params, $count);
2031
+				case 'active':
2032
+					return $EEM_Event->get_active_events($query_params, $count);
2033
+				case 'inactive':
2034
+					return $EEM_Event->get_inactive_events($query_params, $count);
2035
+			}
2036
+		}
2037
+
2038
+		return $count ? $EEM_Event->count([$where], 'EVT_ID', true) : $EEM_Event->get_all($query_params);
2039
+	}
2040
+
2041
+
2042
+	/**
2043
+	 * handling for WordPress CPT actions (trash, restore, delete)
2044
+	 *
2045
+	 * @param string $post_id
2046
+	 * @throws EE_Error
2047
+	 * @throws ReflectionException
2048
+	 */
2049
+	public function trash_cpt_item($post_id)
2050
+	{
2051
+		$this->request->setRequestParam('EVT_ID', $post_id);
2052
+		$this->_trash_or_restore_event('trash', false);
2053
+	}
2054
+
2055
+
2056
+	/**
2057
+	 * @param string $post_id
2058
+	 * @throws EE_Error
2059
+	 * @throws ReflectionException
2060
+	 */
2061
+	public function restore_cpt_item($post_id)
2062
+	{
2063
+		$this->request->setRequestParam('EVT_ID', $post_id);
2064
+		$this->_trash_or_restore_event('draft', false);
2065
+	}
2066
+
2067
+
2068
+	/**
2069
+	 * @param string $post_id
2070
+	 * @throws EE_Error
2071
+	 * @throws EE_Error
2072
+	 */
2073
+	public function delete_cpt_item($post_id)
2074
+	{
2075
+		throw new EE_Error(
2076
+			esc_html__(
2077
+				'Please contact Event Espresso support with the details of the steps taken to produce this error.',
2078
+				'event_espresso'
2079
+			)
2080
+		);
2081
+		// $this->request->setRequestParam('EVT_ID', $post_id);
2082
+		// $this->_delete_event();
2083
+	}
2084
+
2085
+
2086
+	/**
2087
+	 * _trash_or_restore_event
2088
+	 *
2089
+	 * @access protected
2090
+	 * @param string $event_status
2091
+	 * @param bool   $redirect_after
2092
+	 * @throws EE_Error
2093
+	 * @throws EE_Error
2094
+	 * @throws ReflectionException
2095
+	 */
2096
+	protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = true)
2097
+	{
2098
+		// determine the event id and set to array.
2099
+		$EVT_ID = $this->request->getRequestParam('EVT_ID', 0, 'int');
2100
+		// loop thru events
2101
+		if ($EVT_ID) {
2102
+			// clean status
2103
+			$event_status = sanitize_key($event_status);
2104
+			// grab status
2105
+			if (! empty($event_status)) {
2106
+				$success = $this->_change_event_status($EVT_ID, $event_status);
2107
+			} else {
2108
+				$success = false;
2109
+				$msg     = esc_html__(
2110
+					'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
2111
+					'event_espresso'
2112
+				);
2113
+				EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2114
+			}
2115
+		} else {
2116
+			$success = false;
2117
+			$msg     = esc_html__(
2118
+				'An error occurred. The event could not be moved to the trash because a valid event ID was not not supplied.',
2119
+				'event_espresso'
2120
+			);
2121
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2122
+		}
2123
+		$action = $event_status === 'trash' ? 'moved to the trash' : 'restored from the trash';
2124
+		if ($redirect_after) {
2125
+			$this->_redirect_after_action($success, 'Event', $action, ['action' => 'default']);
2126
+		}
2127
+	}
2128
+
2129
+
2130
+	/**
2131
+	 * _trash_or_restore_events
2132
+	 *
2133
+	 * @access protected
2134
+	 * @param string $event_status
2135
+	 * @return void
2136
+	 * @throws EE_Error
2137
+	 * @throws EE_Error
2138
+	 * @throws ReflectionException
2139
+	 */
2140
+	protected function _trash_or_restore_events($event_status = 'trash')
2141
+	{
2142
+		// clean status
2143
+		$event_status = sanitize_key($event_status);
2144
+		// grab status
2145
+		if (! empty($event_status)) {
2146
+			$success = true;
2147
+			// determine the event id and set to array.
2148
+			$EVT_IDs = $this->request->getRequestParam('EVT_IDs', [], 'int', true);
2149
+			// loop thru events
2150
+			foreach ($EVT_IDs as $EVT_ID) {
2151
+				if ($EVT_ID = absint($EVT_ID)) {
2152
+					$results = $this->_change_event_status($EVT_ID, $event_status);
2153
+					$success = $results !== false ? $success : false;
2154
+				} else {
2155
+					$msg = sprintf(
2156
+						esc_html__(
2157
+							'An error occurred. Event #%d could not be moved to the trash because a valid event ID was not not supplied.',
2158
+							'event_espresso'
2159
+						),
2160
+						$EVT_ID
2161
+					);
2162
+					EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2163
+					$success = false;
2164
+				}
2165
+			}
2166
+		} else {
2167
+			$success = false;
2168
+			$msg     = esc_html__(
2169
+				'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
2170
+				'event_espresso'
2171
+			);
2172
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2173
+		}
2174
+		// in order to force a pluralized result message we need to send back a success status greater than 1
2175
+		$success = $success ? 2 : false;
2176
+		$action  = $event_status === 'trash' ? 'moved to the trash' : 'restored from the trash';
2177
+		$this->_redirect_after_action($success, 'Events', $action, ['action' => 'default']);
2178
+	}
2179
+
2180
+
2181
+	/**
2182
+	 * @param int    $EVT_ID
2183
+	 * @param string $event_status
2184
+	 * @return bool
2185
+	 * @throws EE_Error
2186
+	 * @throws ReflectionException
2187
+	 */
2188
+	private function _change_event_status($EVT_ID = 0, $event_status = '')
2189
+	{
2190
+		// grab event id
2191
+		if (! $EVT_ID) {
2192
+			$msg = esc_html__(
2193
+				'An error occurred. No Event ID or an invalid Event ID was received.',
2194
+				'event_espresso'
2195
+			);
2196
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2197
+			return false;
2198
+		}
2199
+		$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2200
+		// clean status
2201
+		$event_status = sanitize_key($event_status);
2202
+		// grab status
2203
+		if (empty($event_status)) {
2204
+			$msg = esc_html__(
2205
+				'An error occurred. No Event Status or an invalid Event Status was received.',
2206
+				'event_espresso'
2207
+			);
2208
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2209
+			return false;
2210
+		}
2211
+		// was event trashed or restored ?
2212
+		switch ($event_status) {
2213
+			case 'draft':
2214
+				$action = 'restored from the trash';
2215
+				$hook   = 'AHEE_event_restored_from_trash';
2216
+				break;
2217
+			case 'trash':
2218
+				$action = 'moved to the trash';
2219
+				$hook   = 'AHEE_event_moved_to_trash';
2220
+				break;
2221
+			default:
2222
+				$action = 'updated';
2223
+				$hook   = false;
2224
+		}
2225
+		// use class to change status
2226
+		$this->_cpt_model_obj->set_status($event_status);
2227
+		$success = $this->_cpt_model_obj->save();
2228
+		if (! $success) {
2229
+			$msg = sprintf(esc_html__('An error occurred. The event could not be %s.', 'event_espresso'), $action);
2230
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2231
+			return false;
2232
+		}
2233
+		if ($hook) {
2234
+			do_action($hook);
2235
+		}
2236
+		return true;
2237
+	}
2238
+
2239
+
2240
+	/**
2241
+	 * @param array $event_ids
2242
+	 * @return array
2243
+	 * @since   4.10.23.p
2244
+	 */
2245
+	private function cleanEventIds(array $event_ids)
2246
+	{
2247
+		return array_map('absint', $event_ids);
2248
+	}
2249
+
2250
+
2251
+	/**
2252
+	 * @return array
2253
+	 * @since   4.10.23.p
2254
+	 */
2255
+	private function getEventIdsFromRequest()
2256
+	{
2257
+		if ($this->request->requestParamIsSet('EVT_IDs')) {
2258
+			return $this->request->getRequestParam('EVT_IDs', [], 'int', true);
2259
+		} else {
2260
+			return $this->request->getRequestParam('EVT_ID', [], 'int', true);
2261
+		}
2262
+	}
2263
+
2264
+
2265
+	/**
2266
+	 * @param bool $preview_delete
2267
+	 * @throws EE_Error
2268
+	 */
2269
+	protected function _delete_event($preview_delete = true)
2270
+	{
2271
+		$this->_delete_events($preview_delete);
2272
+	}
2273
+
2274
+
2275
+	/**
2276
+	 * Gets the tree traversal batch persister.
2277
+	 *
2278
+	 * @return NodeGroupDao
2279
+	 * @throws InvalidArgumentException
2280
+	 * @throws InvalidDataTypeException
2281
+	 * @throws InvalidInterfaceException
2282
+	 * @since 4.10.12.p
2283
+	 */
2284
+	protected function getModelObjNodeGroupPersister()
2285
+	{
2286
+		if (! $this->model_obj_node_group_persister instanceof NodeGroupDao) {
2287
+			$this->model_obj_node_group_persister =
2288
+				$this->getLoader()->load('\EventEspresso\core\services\orm\tree_traversal\NodeGroupDao');
2289
+		}
2290
+		return $this->model_obj_node_group_persister;
2291
+	}
2292
+
2293
+
2294
+	/**
2295
+	 * @param bool $preview_delete
2296
+	 * @return void
2297
+	 * @throws EE_Error
2298
+	 */
2299
+	protected function _delete_events($preview_delete = true)
2300
+	{
2301
+		$event_ids = $this->getEventIdsFromRequest();
2302
+		if ($preview_delete) {
2303
+			$this->generateDeletionPreview($event_ids);
2304
+		} else {
2305
+			EEM_Event::instance()->delete_permanently([['EVT_ID' => ['IN', $event_ids]]]);
2306
+		}
2307
+	}
2308
+
2309
+
2310
+	/**
2311
+	 * @param array $event_ids
2312
+	 */
2313
+	protected function generateDeletionPreview(array $event_ids)
2314
+	{
2315
+		$event_ids = $this->cleanEventIds($event_ids);
2316
+		// Set a code we can use to reference this deletion task in the batch jobs and preview page.
2317
+		$deletion_job_code = $this->getModelObjNodeGroupPersister()->generateGroupCode();
2318
+		$return_url        = EE_Admin_Page::add_query_args_and_nonce(
2319
+			[
2320
+				'action'            => 'preview_deletion',
2321
+				'deletion_job_code' => $deletion_job_code,
2322
+			],
2323
+			$this->_admin_base_url
2324
+		);
2325
+		EEH_URL::safeRedirectAndExit(
2326
+			EE_Admin_Page::add_query_args_and_nonce(
2327
+				[
2328
+					'page'              => 'espresso_batch',
2329
+					'batch'             => EED_Batch::batch_job,
2330
+					'EVT_IDs'           => $event_ids,
2331
+					'deletion_job_code' => $deletion_job_code,
2332
+					'job_handler'       => urlencode('EventEspressoBatchRequest\JobHandlers\PreviewEventDeletion'),
2333
+					'return_url'        => urlencode($return_url),
2334
+				],
2335
+				admin_url()
2336
+			)
2337
+		);
2338
+	}
2339
+
2340
+
2341
+	/**
2342
+	 * Checks for a POST submission
2343
+	 *
2344
+	 * @since 4.10.12.p
2345
+	 */
2346
+	protected function confirmDeletion()
2347
+	{
2348
+		$deletion_redirect_logic =
2349
+			$this->getLoader()->getShared('\EventEspresso\core\domain\services\admin\events\data\ConfirmDeletion');
2350
+		$deletion_redirect_logic->handle($this->get_request_data(), $this->admin_base_url());
2351
+	}
2352
+
2353
+
2354
+	/**
2355
+	 * A page for users to preview what exactly will be deleted, and confirm they want to delete it.
2356
+	 *
2357
+	 * @throws EE_Error
2358
+	 * @since 4.10.12.p
2359
+	 */
2360
+	protected function previewDeletion()
2361
+	{
2362
+		$preview_deletion_logic =
2363
+			$this->getLoader()->getShared('\EventEspresso\core\domain\services\admin\events\data\PreviewDeletion');
2364
+		$this->set_template_args($preview_deletion_logic->handle($this->get_request_data(), $this->admin_base_url()));
2365
+		$this->display_admin_page_with_no_sidebar();
2366
+	}
2367
+
2368
+
2369
+	/**
2370
+	 * get total number of events
2371
+	 *
2372
+	 * @access public
2373
+	 * @return int
2374
+	 * @throws EE_Error
2375
+	 * @throws EE_Error
2376
+	 */
2377
+	public function total_events()
2378
+	{
2379
+		return EEM_Event::instance()->count(
2380
+			['caps' => 'read_admin'],
2381
+			'EVT_ID',
2382
+			true
2383
+		);
2384
+	}
2385
+
2386
+
2387
+	/**
2388
+	 * get total number of draft events
2389
+	 *
2390
+	 * @access public
2391
+	 * @return int
2392
+	 * @throws EE_Error
2393
+	 * @throws EE_Error
2394
+	 */
2395
+	public function total_events_draft()
2396
+	{
2397
+		return EEM_Event::instance()->count(
2398
+			[
2399
+				['status' => ['IN', ['draft', 'auto-draft']]],
2400
+				'caps' => 'read_admin',
2401
+			],
2402
+			'EVT_ID',
2403
+			true
2404
+		);
2405
+	}
2406
+
2407
+
2408
+	/**
2409
+	 * get total number of trashed events
2410
+	 *
2411
+	 * @access public
2412
+	 * @return int
2413
+	 * @throws EE_Error
2414
+	 * @throws EE_Error
2415
+	 */
2416
+	public function total_trashed_events()
2417
+	{
2418
+		return EEM_Event::instance()->count(
2419
+			[
2420
+				['status' => 'trash'],
2421
+				'caps' => 'read_admin',
2422
+			],
2423
+			'EVT_ID',
2424
+			true
2425
+		);
2426
+	}
2427
+
2428
+
2429
+	/**
2430
+	 *    _default_event_settings
2431
+	 *    This generates the Default Settings Tab
2432
+	 *
2433
+	 * @return void
2434
+	 * @throws DomainException
2435
+	 * @throws EE_Error
2436
+	 * @throws InvalidArgumentException
2437
+	 * @throws InvalidDataTypeException
2438
+	 * @throws InvalidInterfaceException
2439
+	 */
2440
+	protected function _default_event_settings()
2441
+	{
2442
+		$this->_set_add_edit_form_tags('update_default_event_settings');
2443
+		$this->_set_publish_post_box_vars(null, false, false, null, false);
2444
+		$this->_template_args['admin_page_content'] = $this->_default_event_settings_form()->get_html();
2445
+		$this->display_admin_page_with_sidebar();
2446
+	}
2447
+
2448
+
2449
+	/**
2450
+	 * Return the form for event settings.
2451
+	 *
2452
+	 * @return EE_Form_Section_Proper
2453
+	 * @throws EE_Error
2454
+	 */
2455
+	protected function _default_event_settings_form()
2456
+	{
2457
+		$registration_config              = EE_Registry::instance()->CFG->registration;
2458
+		$registration_stati_for_selection = EEM_Registration::reg_status_array(
2459
+		// exclude
2460
+			[
2461
+				EEM_Registration::status_id_cancelled,
2462
+				EEM_Registration::status_id_declined,
2463
+				EEM_Registration::status_id_incomplete,
2464
+				EEM_Registration::status_id_wait_list,
2465
+			],
2466
+			true
2467
+		);
2468
+		// setup Advanced Editor ???
2469
+		if (
2470
+			$this->raw_req_action === 'default_event_settings'
2471
+			|| $this->raw_req_action === 'update_default_event_settings'
2472
+		) {
2473
+			$this->advanced_editor_admin_form = $this->loader->getShared(AdvancedEditorAdminFormSection::class);
2474
+		}
2475
+		return new EE_Form_Section_Proper(
2476
+			[
2477
+				'name'            => 'update_default_event_settings',
2478
+				'html_id'         => 'update_default_event_settings',
2479
+				'html_class'      => 'form-table',
2480
+				'layout_strategy' => new EE_Admin_Two_Column_Layout(),
2481
+				'subsections'     => apply_filters(
2482
+					'FHEE__Events_Admin_Page___default_event_settings_form__form_subsections',
2483
+					[
2484
+						'default_reg_status'  => new EE_Select_Input(
2485
+							$registration_stati_for_selection,
2486
+							[
2487
+								'default'         => isset($registration_config->default_STS_ID)
2488
+													 && array_key_exists(
2489
+														 $registration_config->default_STS_ID,
2490
+														 $registration_stati_for_selection
2491
+													 )
2492
+									? sanitize_text_field($registration_config->default_STS_ID)
2493
+									: EEM_Registration::status_id_pending_payment,
2494
+								'html_label_text' => esc_html__('Default Registration Status', 'event_espresso')
2495
+													 . EEH_Template::get_help_tab_link(
2496
+														 'default_settings_status_help_tab'
2497
+													 ),
2498
+								'html_help_text'  => esc_html__(
2499
+									'This setting allows you to preselect what the default registration status setting is when creating an event.  Note that changing this setting does NOT retroactively apply it to existing events.',
2500
+									'event_espresso'
2501
+								),
2502
+							]
2503
+						),
2504
+						'default_max_tickets' => new EE_Integer_Input(
2505
+							[
2506
+								'default'         => isset($registration_config->default_maximum_number_of_tickets)
2507
+									? $registration_config->default_maximum_number_of_tickets
2508
+									: EEM_Event::get_default_additional_limit(),
2509
+								'html_label_text' => esc_html__(
2510
+									'Default Maximum Tickets Allowed Per Order:',
2511
+									'event_espresso'
2512
+								)
2513
+													 . EEH_Template::get_help_tab_link(
2514
+														 'default_maximum_tickets_help_tab"'
2515
+													 ),
2516
+								'html_help_text'  => esc_html__(
2517
+									'This setting allows you to indicate what will be the default for the maximum number of tickets per order when creating new events.',
2518
+									'event_espresso'
2519
+								),
2520
+							]
2521
+						),
2522
+					]
2523
+				),
2524
+			]
2525
+		);
2526
+	}
2527
+
2528
+
2529
+	/**
2530
+	 * @return void
2531
+	 * @throws EE_Error
2532
+	 * @throws InvalidArgumentException
2533
+	 * @throws InvalidDataTypeException
2534
+	 * @throws InvalidInterfaceException
2535
+	 */
2536
+	protected function _update_default_event_settings()
2537
+	{
2538
+		$form = $this->_default_event_settings_form();
2539
+		if ($form->was_submitted()) {
2540
+			$form->receive_form_submission();
2541
+			if ($form->is_valid()) {
2542
+				$registration_config = EE_Registry::instance()->CFG->registration;
2543
+				$valid_data          = $form->valid_data();
2544
+				if (isset($valid_data['default_reg_status'])) {
2545
+					$registration_config->default_STS_ID = $valid_data['default_reg_status'];
2546
+				}
2547
+				if (isset($valid_data['default_max_tickets'])) {
2548
+					$registration_config->default_maximum_number_of_tickets = $valid_data['default_max_tickets'];
2549
+				}
2550
+				do_action(
2551
+					'AHEE__Events_Admin_Page___update_default_event_settings',
2552
+					$valid_data,
2553
+					EE_Registry::instance()->CFG,
2554
+					$this
2555
+				);
2556
+				// update because data was valid!
2557
+				EE_Registry::instance()->CFG->update_espresso_config();
2558
+				EE_Error::overwrite_success();
2559
+				EE_Error::add_success(
2560
+					esc_html__('Default Event Settings were updated', 'event_espresso')
2561
+				);
2562
+			}
2563
+		}
2564
+		$this->_redirect_after_action(0, '', '', ['action' => 'default_event_settings'], true);
2565
+	}
2566
+
2567
+
2568
+	/*************        Templates        *************
22 2569
      *
23
-     * @var EE_Event $_event
24
-     */
25
-    protected $_event;
26
-
27
-
28
-    /**
29
-     * This will hold the category object for category_details screen.
30
-     *
31
-     * @var stdClass $_category
32
-     */
33
-    protected $_category;
34
-
35
-
36
-    /**
37
-     * This will hold the event model instance
38
-     *
39
-     * @var EEM_Event $_event_model
40
-     */
41
-    protected $_event_model;
42
-
43
-
44
-    /**
45
-     * @var EE_Event
46
-     */
47
-    protected $_cpt_model_obj = false;
48
-
49
-
50
-    /**
51
-     * @var NodeGroupDao
52
-     */
53
-    protected $model_obj_node_group_persister;
54
-
55
-    /**
56
-     * @var AdvancedEditorAdminFormSection
57
-     */
58
-    protected $advanced_editor_admin_form;
59
-
60
-
61
-    /**
62
-     * Initialize page props for this admin page group.
63
-     */
64
-    protected function _init_page_props()
65
-    {
66
-        $this->page_slug        = EVENTS_PG_SLUG;
67
-        $this->page_label       = EVENTS_LABEL;
68
-        $this->_admin_base_url  = EVENTS_ADMIN_URL;
69
-        $this->_admin_base_path = EVENTS_ADMIN;
70
-        $this->_cpt_model_names = [
71
-            'create_new' => 'EEM_Event',
72
-            'edit'       => 'EEM_Event',
73
-        ];
74
-        $this->_cpt_edit_routes = [
75
-            'espresso_events' => 'edit',
76
-        ];
77
-        add_action(
78
-            'AHEE__EE_Admin_Page_CPT__set_model_object__after_set_object',
79
-            [$this, 'verify_event_edit'],
80
-            10,
81
-            2
82
-        );
83
-    }
84
-
85
-
86
-    /**
87
-     * Sets the ajax hooks used for this admin page group.
88
-     */
89
-    protected function _ajax_hooks()
90
-    {
91
-        add_action('wp_ajax_ee_save_timezone_setting', [$this, 'saveTimezoneString']);
92
-    }
93
-
94
-
95
-    /**
96
-     * Sets the page properties for this admin page group.
97
-     */
98
-    protected function _define_page_props()
99
-    {
100
-        $this->_admin_page_title = EVENTS_LABEL;
101
-        $this->_labels           = [
102
-            'buttons'      => [
103
-                'add'             => esc_html__('Add New Event', 'event_espresso'),
104
-                'edit'            => esc_html__('Edit Event', 'event_espresso'),
105
-                'delete'          => esc_html__('Delete Event', 'event_espresso'),
106
-                'add_category'    => esc_html__('Add New Category', 'event_espresso'),
107
-                'edit_category'   => esc_html__('Edit Category', 'event_espresso'),
108
-                'delete_category' => esc_html__('Delete Category', 'event_espresso'),
109
-            ],
110
-            'editor_title' => [
111
-                'espresso_events' => esc_html__('Enter event title here', 'event_espresso'),
112
-            ],
113
-            'publishbox'   => [
114
-                'create_new'        => esc_html__('Save New Event', 'event_espresso'),
115
-                'edit'              => esc_html__('Update Event', 'event_espresso'),
116
-                'add_category'      => esc_html__('Save New Category', 'event_espresso'),
117
-                'edit_category'     => esc_html__('Update Category', 'event_espresso'),
118
-                'template_settings' => esc_html__('Update Settings', 'event_espresso'),
119
-            ],
120
-        ];
121
-    }
122
-
123
-
124
-    /**
125
-     * Sets the page routes property for this admin page group.
126
-     */
127
-    protected function _set_page_routes()
128
-    {
129
-        // load formatter helper
130
-        // load field generator helper
131
-        // is there a evt_id in the request?
132
-        $EVT_ID = $this->request->getRequestParam('EVT_ID', 0, 'int');
133
-        $EVT_ID = $this->request->getRequestParam('post', $EVT_ID, 'int');
134
-
135
-        $this->_page_routes = [
136
-            'default'                       => [
137
-                'func'       => '_events_overview_list_table',
138
-                'capability' => 'ee_read_events',
139
-            ],
140
-            'create_new'                    => [
141
-                'func'       => '_create_new_cpt_item',
142
-                'capability' => 'ee_edit_events',
143
-            ],
144
-            'edit'                          => [
145
-                'func'       => '_edit_cpt_item',
146
-                'capability' => 'ee_edit_event',
147
-                'obj_id'     => $EVT_ID,
148
-            ],
149
-            'copy_event'                    => [
150
-                'func'       => '_copy_events',
151
-                'capability' => 'ee_edit_event',
152
-                'obj_id'     => $EVT_ID,
153
-                'noheader'   => true,
154
-            ],
155
-            'trash_event'                   => [
156
-                'func'       => '_trash_or_restore_event',
157
-                'args'       => ['event_status' => 'trash'],
158
-                'capability' => 'ee_delete_event',
159
-                'obj_id'     => $EVT_ID,
160
-                'noheader'   => true,
161
-            ],
162
-            'trash_events'                  => [
163
-                'func'       => '_trash_or_restore_events',
164
-                'args'       => ['event_status' => 'trash'],
165
-                'capability' => 'ee_delete_events',
166
-                'noheader'   => true,
167
-            ],
168
-            'restore_event'                 => [
169
-                'func'       => '_trash_or_restore_event',
170
-                'args'       => ['event_status' => 'draft'],
171
-                'capability' => 'ee_delete_event',
172
-                'obj_id'     => $EVT_ID,
173
-                'noheader'   => true,
174
-            ],
175
-            'restore_events'                => [
176
-                'func'       => '_trash_or_restore_events',
177
-                'args'       => ['event_status' => 'draft'],
178
-                'capability' => 'ee_delete_events',
179
-                'noheader'   => true,
180
-            ],
181
-            'delete_event'                  => [
182
-                'func'       => '_delete_event',
183
-                'capability' => 'ee_delete_event',
184
-                'obj_id'     => $EVT_ID,
185
-                'noheader'   => true,
186
-            ],
187
-            'delete_events'                 => [
188
-                'func'       => '_delete_events',
189
-                'capability' => 'ee_delete_events',
190
-                'noheader'   => true,
191
-            ],
192
-            'view_report'                   => [
193
-                'func'       => '_view_report',
194
-                'capability' => 'ee_edit_events',
195
-            ],
196
-            'default_event_settings'        => [
197
-                'func'       => '_default_event_settings',
198
-                'capability' => 'manage_options',
199
-            ],
200
-            'update_default_event_settings' => [
201
-                'func'       => '_update_default_event_settings',
202
-                'capability' => 'manage_options',
203
-                'noheader'   => true,
204
-            ],
205
-            'template_settings'             => [
206
-                'func'       => '_template_settings',
207
-                'capability' => 'manage_options',
208
-            ],
209
-            // event category tab related
210
-            'add_category'                  => [
211
-                'func'       => '_category_details',
212
-                'capability' => 'ee_edit_event_category',
213
-                'args'       => ['add'],
214
-            ],
215
-            'edit_category'                 => [
216
-                'func'       => '_category_details',
217
-                'capability' => 'ee_edit_event_category',
218
-                'args'       => ['edit'],
219
-            ],
220
-            'delete_categories'             => [
221
-                'func'       => '_delete_categories',
222
-                'capability' => 'ee_delete_event_category',
223
-                'noheader'   => true,
224
-            ],
225
-            'delete_category'               => [
226
-                'func'       => '_delete_categories',
227
-                'capability' => 'ee_delete_event_category',
228
-                'noheader'   => true,
229
-            ],
230
-            'insert_category'               => [
231
-                'func'       => '_insert_or_update_category',
232
-                'args'       => ['new_category' => true],
233
-                'capability' => 'ee_edit_event_category',
234
-                'noheader'   => true,
235
-            ],
236
-            'update_category'               => [
237
-                'func'       => '_insert_or_update_category',
238
-                'args'       => ['new_category' => false],
239
-                'capability' => 'ee_edit_event_category',
240
-                'noheader'   => true,
241
-            ],
242
-            'category_list'                 => [
243
-                'func'       => '_category_list_table',
244
-                'capability' => 'ee_manage_event_categories',
245
-            ],
246
-            'preview_deletion'              => [
247
-                'func'       => 'previewDeletion',
248
-                'capability' => 'ee_delete_events',
249
-            ],
250
-            'confirm_deletion'              => [
251
-                'func'       => 'confirmDeletion',
252
-                'capability' => 'ee_delete_events',
253
-                'noheader'   => true,
254
-            ],
255
-        ];
256
-    }
257
-
258
-
259
-    /**
260
-     * Set the _page_config property for this admin page group.
261
-     */
262
-    protected function _set_page_config()
263
-    {
264
-        $post_id            = $this->request->getRequestParam('post', 0, 'int');
265
-        $EVT_CAT_ID         = $this->request->getRequestParam('EVT_CAT_ID', 0, 'int');
266
-        $this->_page_config = [
267
-            'default'                => [
268
-                'nav'           => [
269
-                    'label' => esc_html__('Overview', 'event_espresso'),
270
-                    'order' => 10,
271
-                ],
272
-                'list_table'    => 'Events_Admin_List_Table',
273
-                'help_tabs'     => [
274
-                    'events_overview_help_tab'                       => [
275
-                        'title'    => esc_html__('Events Overview', 'event_espresso'),
276
-                        'filename' => 'events_overview',
277
-                    ],
278
-                    'events_overview_table_column_headings_help_tab' => [
279
-                        'title'    => esc_html__('Events Overview Table Column Headings', 'event_espresso'),
280
-                        'filename' => 'events_overview_table_column_headings',
281
-                    ],
282
-                    'events_overview_filters_help_tab'               => [
283
-                        'title'    => esc_html__('Events Overview Filters', 'event_espresso'),
284
-                        'filename' => 'events_overview_filters',
285
-                    ],
286
-                    'events_overview_view_help_tab'                  => [
287
-                        'title'    => esc_html__('Events Overview Views', 'event_espresso'),
288
-                        'filename' => 'events_overview_views',
289
-                    ],
290
-                    'events_overview_other_help_tab'                 => [
291
-                        'title'    => esc_html__('Events Overview Other', 'event_espresso'),
292
-                        'filename' => 'events_overview_other',
293
-                    ],
294
-                ],
295
-                'qtips'         => [
296
-                    'EE_Event_List_Table_Tips',
297
-                ],
298
-                'require_nonce' => false,
299
-            ],
300
-            'create_new'             => [
301
-                'nav'           => [
302
-                    'label'      => esc_html__('Add Event', 'event_espresso'),
303
-                    'order'      => 5,
304
-                    'persistent' => false,
305
-                ],
306
-                'metaboxes'     => ['_register_event_editor_meta_boxes'],
307
-                'help_tabs'     => [
308
-                    'event_editor_help_tab'                            => [
309
-                        'title'    => esc_html__('Event Editor', 'event_espresso'),
310
-                        'filename' => 'event_editor',
311
-                    ],
312
-                    'event_editor_title_richtexteditor_help_tab'       => [
313
-                        'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
314
-                        'filename' => 'event_editor_title_richtexteditor',
315
-                    ],
316
-                    'event_editor_venue_details_help_tab'              => [
317
-                        'title'    => esc_html__('Event Venue Details', 'event_espresso'),
318
-                        'filename' => 'event_editor_venue_details',
319
-                    ],
320
-                    'event_editor_event_datetimes_help_tab'            => [
321
-                        'title'    => esc_html__('Event Datetimes', 'event_espresso'),
322
-                        'filename' => 'event_editor_event_datetimes',
323
-                    ],
324
-                    'event_editor_event_tickets_help_tab'              => [
325
-                        'title'    => esc_html__('Event Tickets', 'event_espresso'),
326
-                        'filename' => 'event_editor_event_tickets',
327
-                    ],
328
-                    'event_editor_event_registration_options_help_tab' => [
329
-                        'title'    => esc_html__('Event Registration Options', 'event_espresso'),
330
-                        'filename' => 'event_editor_event_registration_options',
331
-                    ],
332
-                    'event_editor_tags_categories_help_tab'            => [
333
-                        'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
334
-                        'filename' => 'event_editor_tags_categories',
335
-                    ],
336
-                    'event_editor_questions_registrants_help_tab'      => [
337
-                        'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
338
-                        'filename' => 'event_editor_questions_registrants',
339
-                    ],
340
-                    'event_editor_save_new_event_help_tab'             => [
341
-                        'title'    => esc_html__('Save New Event', 'event_espresso'),
342
-                        'filename' => 'event_editor_save_new_event',
343
-                    ],
344
-                    'event_editor_other_help_tab'                      => [
345
-                        'title'    => esc_html__('Event Other', 'event_espresso'),
346
-                        'filename' => 'event_editor_other',
347
-                    ],
348
-                ],
349
-                'qtips'         => ['EE_Event_Editor_Decaf_Tips'],
350
-                'require_nonce' => false,
351
-            ],
352
-            'edit'                   => [
353
-                'nav'           => [
354
-                    'label'      => esc_html__('Edit Event', 'event_espresso'),
355
-                    'order'      => 5,
356
-                    'persistent' => false,
357
-                    'url'        => $post_id
358
-                        ? EE_Admin_Page::add_query_args_and_nonce(
359
-                            ['post' => $post_id, 'action' => 'edit'],
360
-                            $this->_current_page_view_url
361
-                        )
362
-                        : $this->_admin_base_url,
363
-                ],
364
-                'metaboxes'     => ['_register_event_editor_meta_boxes'],
365
-                'help_tabs'     => [
366
-                    'event_editor_help_tab'                            => [
367
-                        'title'    => esc_html__('Event Editor', 'event_espresso'),
368
-                        'filename' => 'event_editor',
369
-                    ],
370
-                    'event_editor_title_richtexteditor_help_tab'       => [
371
-                        'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
372
-                        'filename' => 'event_editor_title_richtexteditor',
373
-                    ],
374
-                    'event_editor_venue_details_help_tab'              => [
375
-                        'title'    => esc_html__('Event Venue Details', 'event_espresso'),
376
-                        'filename' => 'event_editor_venue_details',
377
-                    ],
378
-                    'event_editor_event_datetimes_help_tab'            => [
379
-                        'title'    => esc_html__('Event Datetimes', 'event_espresso'),
380
-                        'filename' => 'event_editor_event_datetimes',
381
-                    ],
382
-                    'event_editor_event_tickets_help_tab'              => [
383
-                        'title'    => esc_html__('Event Tickets', 'event_espresso'),
384
-                        'filename' => 'event_editor_event_tickets',
385
-                    ],
386
-                    'event_editor_event_registration_options_help_tab' => [
387
-                        'title'    => esc_html__('Event Registration Options', 'event_espresso'),
388
-                        'filename' => 'event_editor_event_registration_options',
389
-                    ],
390
-                    'event_editor_tags_categories_help_tab'            => [
391
-                        'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
392
-                        'filename' => 'event_editor_tags_categories',
393
-                    ],
394
-                    'event_editor_questions_registrants_help_tab'      => [
395
-                        'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
396
-                        'filename' => 'event_editor_questions_registrants',
397
-                    ],
398
-                    'event_editor_save_new_event_help_tab'             => [
399
-                        'title'    => esc_html__('Save New Event', 'event_espresso'),
400
-                        'filename' => 'event_editor_save_new_event',
401
-                    ],
402
-                    'event_editor_other_help_tab'                      => [
403
-                        'title'    => esc_html__('Event Other', 'event_espresso'),
404
-                        'filename' => 'event_editor_other',
405
-                    ],
406
-                ],
407
-                'require_nonce' => false,
408
-            ],
409
-            'default_event_settings' => [
410
-                'nav'           => [
411
-                    'label' => esc_html__('Default Settings', 'event_espresso'),
412
-                    'order' => 40,
413
-                ],
414
-                'metaboxes'     => array_merge($this->_default_espresso_metaboxes, ['_publish_post_box']),
415
-                'labels'        => [
416
-                    'publishbox' => esc_html__('Update Settings', 'event_espresso'),
417
-                ],
418
-                'help_tabs'     => [
419
-                    'default_settings_help_tab'        => [
420
-                        'title'    => esc_html__('Default Event Settings', 'event_espresso'),
421
-                        'filename' => 'events_default_settings',
422
-                    ],
423
-                    'default_settings_status_help_tab' => [
424
-                        'title'    => esc_html__('Default Registration Status', 'event_espresso'),
425
-                        'filename' => 'events_default_settings_status',
426
-                    ],
427
-                    'default_maximum_tickets_help_tab' => [
428
-                        'title'    => esc_html__('Default Maximum Tickets Per Order', 'event_espresso'),
429
-                        'filename' => 'events_default_settings_max_tickets',
430
-                    ],
431
-                ],
432
-                'require_nonce' => false,
433
-            ],
434
-            // template settings
435
-            'template_settings'      => [
436
-                'nav'           => [
437
-                    'label' => esc_html__('Templates', 'event_espresso'),
438
-                    'order' => 30,
439
-                ],
440
-                'metaboxes'     => $this->_default_espresso_metaboxes,
441
-                'help_tabs'     => [
442
-                    'general_settings_templates_help_tab' => [
443
-                        'title'    => esc_html__('Templates', 'event_espresso'),
444
-                        'filename' => 'general_settings_templates',
445
-                    ],
446
-                ],
447
-                'require_nonce' => false,
448
-            ],
449
-            // event category stuff
450
-            'add_category'           => [
451
-                'nav'           => [
452
-                    'label'      => esc_html__('Add Category', 'event_espresso'),
453
-                    'order'      => 15,
454
-                    'persistent' => false,
455
-                ],
456
-                'help_tabs'     => [
457
-                    'add_category_help_tab' => [
458
-                        'title'    => esc_html__('Add New Event Category', 'event_espresso'),
459
-                        'filename' => 'events_add_category',
460
-                    ],
461
-                ],
462
-                'metaboxes'     => ['_publish_post_box'],
463
-                'require_nonce' => false,
464
-            ],
465
-            'edit_category'          => [
466
-                'nav'           => [
467
-                    'label'      => esc_html__('Edit Category', 'event_espresso'),
468
-                    'order'      => 15,
469
-                    'persistent' => false,
470
-                    'url'        => $EVT_CAT_ID
471
-                        ? add_query_arg(
472
-                            ['EVT_CAT_ID' => $EVT_CAT_ID],
473
-                            $this->_current_page_view_url
474
-                        )
475
-                        : $this->_admin_base_url,
476
-                ],
477
-                'help_tabs'     => [
478
-                    'edit_category_help_tab' => [
479
-                        'title'    => esc_html__('Edit Event Category', 'event_espresso'),
480
-                        'filename' => 'events_edit_category',
481
-                    ],
482
-                ],
483
-                'metaboxes'     => ['_publish_post_box'],
484
-                'require_nonce' => false,
485
-            ],
486
-            'category_list'          => [
487
-                'nav'           => [
488
-                    'label' => esc_html__('Categories', 'event_espresso'),
489
-                    'order' => 20,
490
-                ],
491
-                'list_table'    => 'Event_Categories_Admin_List_Table',
492
-                'help_tabs'     => [
493
-                    'events_categories_help_tab'                       => [
494
-                        'title'    => esc_html__('Event Categories', 'event_espresso'),
495
-                        'filename' => 'events_categories',
496
-                    ],
497
-                    'events_categories_table_column_headings_help_tab' => [
498
-                        'title'    => esc_html__('Event Categories Table Column Headings', 'event_espresso'),
499
-                        'filename' => 'events_categories_table_column_headings',
500
-                    ],
501
-                    'events_categories_view_help_tab'                  => [
502
-                        'title'    => esc_html__('Event Categories Views', 'event_espresso'),
503
-                        'filename' => 'events_categories_views',
504
-                    ],
505
-                    'events_categories_other_help_tab'                 => [
506
-                        'title'    => esc_html__('Event Categories Other', 'event_espresso'),
507
-                        'filename' => 'events_categories_other',
508
-                    ],
509
-                ],
510
-                'metaboxes'     => $this->_default_espresso_metaboxes,
511
-                'require_nonce' => false,
512
-            ],
513
-            'preview_deletion'       => [
514
-                'nav'           => [
515
-                    'label'      => esc_html__('Preview Deletion', 'event_espresso'),
516
-                    'order'      => 15,
517
-                    'persistent' => false,
518
-                    'url'        => '',
519
-                ],
520
-                'require_nonce' => false,
521
-            ],
522
-        ];
523
-    }
524
-
525
-
526
-    /**
527
-     * Used to register any global screen options if necessary for every route in this admin page group.
528
-     */
529
-    protected function _add_screen_options()
530
-    {
531
-    }
532
-
533
-
534
-    /**
535
-     * Implementing the screen options for the 'default' route.
536
-     *
537
-     * @throws InvalidArgumentException
538
-     * @throws InvalidDataTypeException
539
-     * @throws InvalidInterfaceException
540
-     */
541
-    protected function _add_screen_options_default()
542
-    {
543
-        $this->_per_page_screen_option();
544
-    }
545
-
546
-
547
-    /**
548
-     * Implementing screen options for the category list route.
549
-     *
550
-     * @throws InvalidArgumentException
551
-     * @throws InvalidDataTypeException
552
-     * @throws InvalidInterfaceException
553
-     */
554
-    protected function _add_screen_options_category_list()
555
-    {
556
-        $page_title              = $this->_admin_page_title;
557
-        $this->_admin_page_title = esc_html__('Categories', 'event_espresso');
558
-        $this->_per_page_screen_option();
559
-        $this->_admin_page_title = $page_title;
560
-    }
561
-
562
-
563
-    /**
564
-     * Used to register any global feature pointers for the admin page group.
565
-     */
566
-    protected function _add_feature_pointers()
567
-    {
568
-    }
569
-
570
-
571
-    /**
572
-     * Registers and enqueues any global scripts and styles for the entire admin page group.
573
-     */
574
-    public function load_scripts_styles()
575
-    {
576
-        wp_register_style(
577
-            'events-admin-css',
578
-            EVENTS_ASSETS_URL . 'events-admin-page.css',
579
-            [],
580
-            EVENT_ESPRESSO_VERSION
581
-        );
582
-        wp_register_style(
583
-            'ee-cat-admin',
584
-            EVENTS_ASSETS_URL . 'ee-cat-admin.css',
585
-            [],
586
-            EVENT_ESPRESSO_VERSION
587
-        );
588
-        wp_enqueue_style('events-admin-css');
589
-        wp_enqueue_style('ee-cat-admin');
590
-        // scripts
591
-        wp_register_script(
592
-            'event_editor_js',
593
-            EVENTS_ASSETS_URL . 'event_editor.js',
594
-            ['ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon'],
595
-            EVENT_ESPRESSO_VERSION,
596
-            true
597
-        );
598
-    }
599
-
600
-
601
-    /**
602
-     * Enqueuing scripts and styles specific to this view
603
-     */
604
-    public function load_scripts_styles_create_new()
605
-    {
606
-        $this->load_scripts_styles_edit();
607
-    }
608
-
609
-
610
-    /**
611
-     * Enqueuing scripts and styles specific to this view
612
-     */
613
-    public function load_scripts_styles_edit()
614
-    {
615
-        // styles
616
-        wp_enqueue_style('espresso-ui-theme');
617
-        wp_register_style(
618
-            'event-editor-css',
619
-            EVENTS_ASSETS_URL . 'event-editor.css',
620
-            ['ee-admin-css'],
621
-            EVENT_ESPRESSO_VERSION
622
-        );
623
-        wp_enqueue_style('event-editor-css');
624
-        // scripts
625
-        if (! $this->admin_config->useAdvancedEditor()) {
626
-            wp_register_script(
627
-                'event-datetime-metabox',
628
-                EVENTS_ASSETS_URL . 'event-datetime-metabox.js',
629
-                ['event_editor_js', 'ee-datepicker'],
630
-                EVENT_ESPRESSO_VERSION
631
-            );
632
-            wp_enqueue_script('event-datetime-metabox');
633
-        }
634
-    }
635
-
636
-
637
-    /**
638
-     * Populating the _views property for the category list table view.
639
-     */
640
-    protected function _set_list_table_views_category_list()
641
-    {
642
-        $this->_views = [
643
-            'all' => [
644
-                'slug'        => 'all',
645
-                'label'       => esc_html__('All', 'event_espresso'),
646
-                'count'       => 0,
647
-                'bulk_action' => [
648
-                    'delete_categories' => esc_html__('Delete Permanently', 'event_espresso'),
649
-                ],
650
-            ],
651
-        ];
652
-    }
653
-
654
-
655
-    /**
656
-     * For adding anything that fires on the admin_init hook for any route within this admin page group.
657
-     */
658
-    public function admin_init()
659
-    {
660
-        EE_Registry::$i18n_js_strings['image_confirm'] = esc_html__(
661
-            'Do you really want to delete this image? Please remember to update your event to complete the removal.',
662
-            'event_espresso'
663
-        );
664
-    }
665
-
666
-
667
-    /**
668
-     * For adding anything that should be triggered on the admin_notices hook for any route within this admin page
669
-     * group.
670
-     */
671
-    public function admin_notices()
672
-    {
673
-    }
674
-
675
-
676
-    /**
677
-     * For adding anything that should be triggered on the `admin_print_footer_scripts` hook for any route within
678
-     * this admin page group.
679
-     */
680
-    public function admin_footer_scripts()
681
-    {
682
-    }
683
-
684
-
685
-    /**
686
-     * Call this function to verify if an event is public and has tickets for sale.  If it does, then we need to show a
687
-     * warning (via EE_Error::add_error());
688
-     *
689
-     * @param EE_Event $event Event object
690
-     * @param string   $req_type
691
-     * @return void
692
-     * @throws EE_Error
693
-     * @throws ReflectionException
694
-     */
695
-    public function verify_event_edit($event = null, $req_type = '')
696
-    {
697
-        // don't need to do this when processing
698
-        if (! empty($req_type)) {
699
-            return;
700
-        }
701
-        // no event?
702
-        if (! $event instanceof EE_Event) {
703
-            $event = $this->_cpt_model_obj;
704
-        }
705
-        // STILL no event?
706
-        if (! $event instanceof EE_Event) {
707
-            return;
708
-        }
709
-        $orig_status = $event->status();
710
-        // first check if event is active.
711
-        if (
712
-            $orig_status === EEM_Event::cancelled
713
-            || $orig_status === EEM_Event::postponed
714
-            || $event->is_expired()
715
-            || $event->is_inactive()
716
-        ) {
717
-            return;
718
-        }
719
-        // made it here so it IS active... next check that any of the tickets are sold.
720
-        if ($event->is_sold_out(true)) {
721
-            if ($orig_status !== EEM_Event::sold_out && $event->status() !== $orig_status) {
722
-                EE_Error::add_attention(
723
-                    sprintf(
724
-                        esc_html__(
725
-                            'Please note that the Event Status has automatically been changed to %s because there are no more spaces available for this event.  However, this change is not permanent until you update the event.  You can change the status back to something else before updating if you wish.',
726
-                            'event_espresso'
727
-                        ),
728
-                        EEH_Template::pretty_status(EEM_Event::sold_out, false, 'sentence')
729
-                    )
730
-                );
731
-            }
732
-            return;
733
-        }
734
-        if ($orig_status === EEM_Event::sold_out) {
735
-            EE_Error::add_attention(
736
-                sprintf(
737
-                    esc_html__(
738
-                        'Please note that the Event Status has automatically been changed to %s because more spaces have become available for this event, most likely due to abandoned transactions freeing up reserved tickets.  However, this change is not permanent until you update the event. If you wish, you can change the status back to something else before updating.',
739
-                        'event_espresso'
740
-                    ),
741
-                    EEH_Template::pretty_status($event->status(), false, 'sentence')
742
-                )
743
-            );
744
-        }
745
-        // now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
746
-        if (! $event->tickets_on_sale()) {
747
-            return;
748
-        }
749
-        // made it here so show warning
750
-        $this->_edit_event_warning();
751
-    }
752
-
753
-
754
-    /**
755
-     * This is the text used for when an event is being edited that is public and has tickets for sale.
756
-     * When needed, hook this into a EE_Error::add_error() notice.
757
-     *
758
-     * @access protected
759
-     * @return void
760
-     */
761
-    protected function _edit_event_warning()
762
-    {
763
-        // we don't want to add warnings during these requests
764
-        if ($this->request->getRequestParam('action') === 'editpost') {
765
-            return;
766
-        }
767
-        EE_Error::add_attention(
768
-            sprintf(
769
-                esc_html__(
770
-                    'Your event is open for registration. Making changes may disrupt any transactions in progress. %sLearn more%s',
771
-                    'event_espresso'
772
-                ),
773
-                '<a class="espresso-help-tab-lnk">',
774
-                '</a>'
775
-            )
776
-        );
777
-    }
778
-
779
-
780
-    /**
781
-     * When a user is creating a new event, notify them if they haven't set their timezone.
782
-     * Otherwise, do the normal logic
783
-     *
784
-     * @return void
785
-     * @throws EE_Error
786
-     * @throws InvalidArgumentException
787
-     * @throws InvalidDataTypeException
788
-     * @throws InvalidInterfaceException
789
-     */
790
-    protected function _create_new_cpt_item()
791
-    {
792
-        $has_timezone_string = get_option('timezone_string');
793
-        // only nag them about setting their timezone if it's their first event, and they haven't already done it
794
-        if (! $has_timezone_string && ! EEM_Event::instance()->exists([])) {
795
-            EE_Error::add_attention(
796
-                sprintf(
797
-                    esc_html__(
798
-                        'Your website\'s timezone is currently set to a UTC offset. We recommend updating your timezone to a city or region near you before you create an event. Change your timezone now:%1$s%2$s%3$sChange Timezone%4$s',
799
-                        'event_espresso'
800
-                    ),
801
-                    '<br>',
802
-                    '<select id="timezone_string" name="timezone_string" aria-describedby="timezone-description">'
803
-                    . EEH_DTT_Helper::wp_timezone_choice('', EEH_DTT_Helper::get_user_locale())
804
-                    . '</select>',
805
-                    '<button class="button button-secondary timezone-submit">',
806
-                    '</button><span class="spinner"></span>'
807
-                ),
808
-                __FILE__,
809
-                __FUNCTION__,
810
-                __LINE__
811
-            );
812
-        }
813
-        parent::_create_new_cpt_item();
814
-    }
815
-
816
-
817
-    /**
818
-     * Sets the _views property for the default route in this admin page group.
819
-     */
820
-    protected function _set_list_table_views_default()
821
-    {
822
-        $this->_views = [
823
-            'all'   => [
824
-                'slug'        => 'all',
825
-                'label'       => esc_html__('View All Events', 'event_espresso'),
826
-                'count'       => 0,
827
-                'bulk_action' => [
828
-                    'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
829
-                ],
830
-            ],
831
-            'draft' => [
832
-                'slug'        => 'draft',
833
-                'label'       => esc_html__('Draft', 'event_espresso'),
834
-                'count'       => 0,
835
-                'bulk_action' => [
836
-                    'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
837
-                ],
838
-            ],
839
-        ];
840
-        if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
841
-            $this->_views['trash'] = [
842
-                'slug'        => 'trash',
843
-                'label'       => esc_html__('Trash', 'event_espresso'),
844
-                'count'       => 0,
845
-                'bulk_action' => [
846
-                    'restore_events' => esc_html__('Restore From Trash', 'event_espresso'),
847
-                    'delete_events'  => esc_html__('Delete Permanently', 'event_espresso'),
848
-                ],
849
-            ];
850
-        }
851
-    }
852
-
853
-
854
-    /**
855
-     * Provides the legend item array for the default list table view.
856
-     *
857
-     * @return array
858
-     * @throws EE_Error
859
-     * @throws EE_Error
860
-     */
861
-    protected function _event_legend_items()
862
-    {
863
-        $items    = [
864
-            'view_details'   => [
865
-                'class' => 'dashicons dashicons-search',
866
-                'desc'  => esc_html__('View Event', 'event_espresso'),
867
-            ],
868
-            'edit_event'     => [
869
-                'class' => 'ee-icon ee-icon-calendar-edit',
870
-                'desc'  => esc_html__('Edit Event Details', 'event_espresso'),
871
-            ],
872
-            'view_attendees' => [
873
-                'class' => 'dashicons dashicons-groups',
874
-                'desc'  => esc_html__('View Registrations for Event', 'event_espresso'),
875
-            ],
876
-        ];
877
-        $items    = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items);
878
-        $statuses = [
879
-            'sold_out_status'  => [
880
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out,
881
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::sold_out, false, 'sentence'),
882
-            ],
883
-            'active_status'    => [
884
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active,
885
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::active, false, 'sentence'),
886
-            ],
887
-            'upcoming_status'  => [
888
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming,
889
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::upcoming, false, 'sentence'),
890
-            ],
891
-            'postponed_status' => [
892
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed,
893
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::postponed, false, 'sentence'),
894
-            ],
895
-            'cancelled_status' => [
896
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled,
897
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::cancelled, false, 'sentence'),
898
-            ],
899
-            'expired_status'   => [
900
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired,
901
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::expired, false, 'sentence'),
902
-            ],
903
-            'inactive_status'  => [
904
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive,
905
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::inactive, false, 'sentence'),
906
-            ],
907
-        ];
908
-        $statuses = apply_filters('FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses);
909
-        return array_merge($items, $statuses);
910
-    }
911
-
912
-
913
-    /**
914
-     * @return EEM_Event
915
-     * @throws EE_Error
916
-     * @throws InvalidArgumentException
917
-     * @throws InvalidDataTypeException
918
-     * @throws InvalidInterfaceException
919
-     * @throws ReflectionException
920
-     */
921
-    private function _event_model()
922
-    {
923
-        if (! $this->_event_model instanceof EEM_Event) {
924
-            $this->_event_model = EE_Registry::instance()->load_model('Event');
925
-        }
926
-        return $this->_event_model;
927
-    }
928
-
929
-
930
-    /**
931
-     * Adds extra buttons to the WP CPT permalink field row.
932
-     * Method is called from parent and is hooked into the wp 'get_sample_permalink_html' filter.
933
-     *
934
-     * @param string $return    the current html
935
-     * @param int    $id        the post id for the page
936
-     * @param string $new_title What the title is
937
-     * @param string $new_slug  what the slug is
938
-     * @return string            The new html string for the permalink area
939
-     */
940
-    public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug)
941
-    {
942
-        // make sure this is only when editing
943
-        if (! empty($id)) {
944
-            $post   = get_post($id);
945
-            $return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'
946
-                       . esc_html__('Shortcode', 'event_espresso')
947
-                       . '</a> ';
948
-            $return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id='
949
-                       . $post->ID
950
-                       . ']">';
951
-        }
952
-        return $return;
953
-    }
954
-
955
-
956
-    /**
957
-     * _events_overview_list_table
958
-     * This contains the logic for showing the events_overview list
959
-     *
960
-     * @access protected
961
-     * @return void
962
-     * @throws DomainException
963
-     * @throws EE_Error
964
-     * @throws InvalidArgumentException
965
-     * @throws InvalidDataTypeException
966
-     * @throws InvalidInterfaceException
967
-     */
968
-    protected function _events_overview_list_table()
969
-    {
970
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
971
-        $after_list_table                           = [];
972
-        $after_list_table['view_event_list_button'] = EEH_HTML::br();
973
-        $after_list_table['view_event_list_button'] .= EEH_Template::get_button_or_link(
974
-            get_post_type_archive_link('espresso_events'),
975
-            esc_html__('View Event Archive Page', 'event_espresso'),
976
-            'button'
977
-        );
978
-        $after_list_table['legend']                 = $this->_display_legend($this->_event_legend_items());
979
-        $this->_admin_page_title                    .= ' ' . $this->get_action_link_or_button(
980
-            'create_new',
981
-            'add',
982
-            [],
983
-            'add-new-h2'
984
-        );
985
-        $this->_template_args['after_list_table']   = array_merge(
986
-            (array) $this->_template_args['after_list_table'],
987
-            $after_list_table
988
-        );
989
-        $this->display_admin_list_table_page_with_no_sidebar();
990
-    }
991
-
992
-
993
-    /**
994
-     * this allows for extra misc actions in the default WP publish box
995
-     *
996
-     * @return void
997
-     * @throws DomainException
998
-     * @throws EE_Error
999
-     * @throws InvalidArgumentException
1000
-     * @throws InvalidDataTypeException
1001
-     * @throws InvalidInterfaceException
1002
-     * @throws ReflectionException
1003
-     */
1004
-    public function extra_misc_actions_publish_box()
1005
-    {
1006
-        $this->_generate_publish_box_extra_content();
1007
-    }
1008
-
1009
-
1010
-    /**
1011
-     * This is hooked into the WordPress do_action('save_post') hook and runs after the custom post type has been
1012
-     * saved.
1013
-     * Typically you would use this to save any additional data.
1014
-     * Keep in mind also that "save_post" runs on EVERY post update to the database.
1015
-     * ALSO very important.  When a post transitions from scheduled to published,
1016
-     * the save_post action is fired but you will NOT have any _POST data containing any extra info you may have from
1017
-     * other meta saves. So MAKE sure that you handle this accordingly.
1018
-     *
1019
-     * @access protected
1020
-     * @abstract
1021
-     * @param string $post_id The ID of the cpt that was saved (so you can link relationally)
1022
-     * @param object $post    The post object of the cpt that was saved.
1023
-     * @return void
1024
-     * @throws EE_Error
1025
-     * @throws InvalidArgumentException
1026
-     * @throws InvalidDataTypeException
1027
-     * @throws InvalidInterfaceException
1028
-     * @throws ReflectionException
1029
-     */
1030
-    protected function _insert_update_cpt_item($post_id, $post)
1031
-    {
1032
-        if ($post instanceof WP_Post && $post->post_type !== 'espresso_events') {
1033
-            // get out we're not processing an event save.
1034
-            return;
1035
-        }
1036
-        $event_values = [
1037
-            'EVT_member_only'     => $this->request->getRequestParam('member_only', false, 'bool'),
1038
-            'EVT_allow_overflow'  => $this->request->getRequestParam('EVT_allow_overflow', false, 'bool'),
1039
-            'EVT_timezone_string' => $this->request->getRequestParam('timezone_string'),
1040
-        ];
1041
-        // check if the new EDTR reg options meta box is being used, and if so, don't run updates for legacy version
1042
-        if (! $this->admin_config->useAdvancedEditor() || ! $this->feature->allowed('use_reg_options_meta_box')) {
1043
-            $event_values['EVT_display_ticket_selector']     = $this->request->getRequestParam(
1044
-                'display_ticket_selector',
1045
-                false,
1046
-                'bool'
1047
-            );
1048
-            $event_values['EVT_additional_limit']            = min(
1049
-                apply_filters('FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255),
1050
-                $this->request->getRequestParam('additional_limit', null, 'int')
1051
-            );
1052
-            $event_values['EVT_default_registration_status'] = $this->request->getRequestParam(
1053
-                'EVT_default_registration_status',
1054
-                EE_Registry::instance()->CFG->registration->default_STS_ID
1055
-            );
1056
-
1057
-            $event_values['EVT_external_URL'] = $this->request->getRequestParam('externalURL');
1058
-            $event_values['EVT_phone']        = $this->request->getRequestParam('event_phone');
1059
-            $event_values['EVT_display_desc'] = $this->request->getRequestParam('display_desc', false, 'bool');
1060
-        }
1061
-        // update event
1062
-        $success = $this->_event_model()->update_by_ID($event_values, $post_id);
1063
-        // get event_object for other metaboxes...
1064
-        // though it would seem to make sense to just use $this->_event_model()->get_one_by_ID( $post_id )..
1065
-        // i have to setup where conditions to override the filters in the model
1066
-        // that filter out autodraft and inherit statuses so we GET the inherit id!
1067
-        $event = $this->_event_model()->get_one(
1068
-            [
1069
-                [
1070
-                    $this->_event_model()->primary_key_name() => $post_id,
1071
-                    'OR'                                      => [
1072
-                        'status'   => $post->post_status,
1073
-                        // if trying to "Publish" a sold out event, it's status will get switched back to "sold_out" in the db,
1074
-                        // but the returned object here has a status of "publish", so use the original post status as well
1075
-                        'status*1' => $this->request->getRequestParam('original_post_status'),
1076
-                    ],
1077
-                ],
1078
-            ]
1079
-        );
1080
-
1081
-        // the following are default callbacks for event attachment updates
1082
-        // that can be overridden by caffeinated functionality and/or addons.
1083
-        $event_update_callbacks = [];
1084
-        if (! $this->admin_config->useAdvancedEditor()) {
1085
-            $event_update_callbacks['_default_venue_update']   = [$this, '_default_venue_update'];
1086
-            $event_update_callbacks['_default_tickets_update'] = [$this, '_default_tickets_update'];
1087
-        }
1088
-        $event_update_callbacks = apply_filters(
1089
-            'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks',
1090
-            $event_update_callbacks
1091
-        );
1092
-
1093
-        $att_success = true;
1094
-        foreach ($event_update_callbacks as $e_callback) {
1095
-            $_success = is_callable($e_callback)
1096
-                ? $e_callback($event, $this->request->requestParams())
1097
-                : false;
1098
-            // if ANY of these updates fail then we want the appropriate global error message
1099
-            $att_success = $_success !== false ? $att_success : false;
1100
-        }
1101
-        // any errors?
1102
-        if ($success && $att_success === false) {
1103
-            EE_Error::add_error(
1104
-                esc_html__(
1105
-                    'Event Details saved successfully but something went wrong with saving attachments.',
1106
-                    'event_espresso'
1107
-                ),
1108
-                __FILE__,
1109
-                __FUNCTION__,
1110
-                __LINE__
1111
-            );
1112
-        } elseif ($success === false) {
1113
-            EE_Error::add_error(
1114
-                esc_html__('Event Details did not save successfully.', 'event_espresso'),
1115
-                __FILE__,
1116
-                __FUNCTION__,
1117
-                __LINE__
1118
-            );
1119
-        }
1120
-    }
1121
-
1122
-
1123
-    /**
1124
-     * @param int $post_id
1125
-     * @param int $revision_id
1126
-     * @throws EE_Error
1127
-     * @throws EE_Error
1128
-     * @throws ReflectionException
1129
-     * @see parent::restore_item()
1130
-     */
1131
-    protected function _restore_cpt_item($post_id, $revision_id)
1132
-    {
1133
-        // copy existing event meta to new post
1134
-        $post_evt = $this->_event_model()->get_one_by_ID($post_id);
1135
-        if ($post_evt instanceof EE_Event) {
1136
-            // meta revision restore
1137
-            $post_evt->restore_revision($revision_id);
1138
-            // related objs restore
1139
-            $post_evt->restore_revision($revision_id, ['Venue', 'Datetime', 'Price']);
1140
-        }
1141
-    }
1142
-
1143
-
1144
-    /**
1145
-     * Attach the venue to the Event
1146
-     *
1147
-     * @param EE_Event $event Event Object to add the venue to
1148
-     * @param array    $data  The request data from the form
1149
-     * @return bool           Success or fail.
1150
-     * @throws EE_Error
1151
-     * @throws ReflectionException
1152
-     */
1153
-    protected function _default_venue_update(EE_Event $event, $data)
1154
-    {
1155
-        require_once(EE_MODELS . 'EEM_Venue.model.php');
1156
-        $venue_model = EE_Registry::instance()->load_model('Venue');
1157
-        $venue_id    = ! empty($data['venue_id']) ? $data['venue_id'] : null;
1158
-        // very important.  If we don't have a venue name...
1159
-        // then we'll get out because not necessary to create empty venue
1160
-        if (empty($data['venue_title'])) {
1161
-            return false;
1162
-        }
1163
-        $venue_array = [
1164
-            'VNU_wp_user'         => $event->get('EVT_wp_user'),
1165
-            'VNU_name'            => ! empty($data['venue_title']) ? $data['venue_title'] : null,
1166
-            'VNU_desc'            => ! empty($data['venue_description']) ? $data['venue_description'] : null,
1167
-            'VNU_identifier'      => ! empty($data['venue_identifier']) ? $data['venue_identifier'] : null,
1168
-            'VNU_short_desc'      => ! empty($data['venue_short_description'])
1169
-                ? $data['venue_short_description']
1170
-                : null,
1171
-            'VNU_address'         => ! empty($data['address']) ? $data['address'] : null,
1172
-            'VNU_address2'        => ! empty($data['address2']) ? $data['address2'] : null,
1173
-            'VNU_city'            => ! empty($data['city']) ? $data['city'] : null,
1174
-            'STA_ID'              => ! empty($data['state']) ? $data['state'] : null,
1175
-            'CNT_ISO'             => ! empty($data['countries']) ? $data['countries'] : null,
1176
-            'VNU_zip'             => ! empty($data['zip']) ? $data['zip'] : null,
1177
-            'VNU_phone'           => ! empty($data['venue_phone']) ? $data['venue_phone'] : null,
1178
-            'VNU_capacity'        => ! empty($data['venue_capacity']) ? $data['venue_capacity'] : null,
1179
-            'VNU_url'             => ! empty($data['venue_url']) ? $data['venue_url'] : null,
1180
-            'VNU_virtual_phone'   => ! empty($data['virtual_phone']) ? $data['virtual_phone'] : null,
1181
-            'VNU_virtual_url'     => ! empty($data['virtual_url']) ? $data['virtual_url'] : null,
1182
-            'VNU_enable_for_gmap' => isset($data['enable_for_gmap']) ? 1 : 0,
1183
-            'status'              => 'publish',
1184
-        ];
1185
-        // if we've got the venue_id then we're just updating the existing venue so let's do that and then get out.
1186
-        if (! empty($venue_id)) {
1187
-            $update_where  = [$venue_model->primary_key_name() => $venue_id];
1188
-            $rows_affected = $venue_model->update($venue_array, [$update_where]);
1189
-            // we've gotta make sure that the venue is always attached to a revision..
1190
-            // add_relation_to should take care of making sure that the relation is already present.
1191
-            $event->_add_relation_to($venue_id, 'Venue');
1192
-            return $rows_affected > 0;
1193
-        }
1194
-        // we insert the venue
1195
-        $venue_id = $venue_model->insert($venue_array);
1196
-        $event->_add_relation_to($venue_id, 'Venue');
1197
-        return ! empty($venue_id);
1198
-        // when we have the ancestor come in it's already been handled by the revision save.
1199
-    }
1200
-
1201
-
1202
-    /**
1203
-     * Handles saving everything related to Tickets (datetimes, tickets, prices)
1204
-     *
1205
-     * @param EE_Event $event The Event object we're attaching data to
1206
-     * @param array    $data  The request data from the form
1207
-     * @return array
1208
-     * @throws EE_Error
1209
-     * @throws ReflectionException
1210
-     * @throws Exception
1211
-     */
1212
-    protected function _default_tickets_update(EE_Event $event, $data)
1213
-    {
1214
-        if ($this->admin_config->useAdvancedEditor()) {
1215
-            return [];
1216
-        }
1217
-        $datetime       = null;
1218
-        $saved_tickets  = [];
1219
-        $event_timezone = $event->get_timezone();
1220
-        $date_formats   = ['Y-m-d', 'h:i a'];
1221
-        foreach ($data['edit_event_datetimes'] as $row => $datetime_data) {
1222
-            // trim all values to ensure any excess whitespace is removed.
1223
-            $datetime_data                = array_map('trim', $datetime_data);
1224
-            $datetime_data['DTT_EVT_end'] =
1225
-                isset($datetime_data['DTT_EVT_end']) && ! empty($datetime_data['DTT_EVT_end'])
1226
-                    ? $datetime_data['DTT_EVT_end']
1227
-                    : $datetime_data['DTT_EVT_start'];
1228
-            $datetime_values              = [
1229
-                'DTT_ID'        => ! empty($datetime_data['DTT_ID']) ? $datetime_data['DTT_ID'] : null,
1230
-                'DTT_EVT_start' => $datetime_data['DTT_EVT_start'],
1231
-                'DTT_EVT_end'   => $datetime_data['DTT_EVT_end'],
1232
-                'DTT_reg_limit' => empty($datetime_data['DTT_reg_limit']) ? EE_INF : $datetime_data['DTT_reg_limit'],
1233
-                'DTT_order'     => $row,
1234
-            ];
1235
-            // if we have an id then let's get existing object first and then set the new values.
1236
-            //  Otherwise we instantiate a new object for save.
1237
-            if (! empty($datetime_data['DTT_ID'])) {
1238
-                $datetime = EEM_Datetime::instance($event_timezone)->get_one_by_ID($datetime_data['DTT_ID']);
1239
-                if (! $datetime instanceof EE_Datetime) {
1240
-                    throw new RuntimeException(
1241
-                        sprintf(
1242
-                            esc_html__(
1243
-                                'Something went wrong! A valid Datetime could not be retrieved from the database using the supplied ID: %1$d',
1244
-                                'event_espresso'
1245
-                            ),
1246
-                            $datetime_data['DTT_ID']
1247
-                        )
1248
-                    );
1249
-                }
1250
-                $datetime->set_date_format($date_formats[0]);
1251
-                $datetime->set_time_format($date_formats[1]);
1252
-                foreach ($datetime_values as $field => $value) {
1253
-                    $datetime->set($field, $value);
1254
-                }
1255
-            } else {
1256
-                $datetime = EE_Datetime::new_instance($datetime_values, $event_timezone, $date_formats);
1257
-            }
1258
-            if (! $datetime instanceof EE_Datetime) {
1259
-                throw new RuntimeException(
1260
-                    sprintf(
1261
-                        esc_html__(
1262
-                            'Something went wrong! A valid Datetime could not be generated or retrieved using the supplied data: %1$s',
1263
-                            'event_espresso'
1264
-                        ),
1265
-                        print_r($datetime_values, true)
1266
-                    )
1267
-                );
1268
-            }
1269
-            // before going any further make sure our dates are setup correctly
1270
-            // so that the end date is always equal or greater than the start date.
1271
-            if ($datetime->get_raw('DTT_EVT_start') > $datetime->get_raw('DTT_EVT_end')) {
1272
-                $datetime->set('DTT_EVT_end', $datetime->get('DTT_EVT_start'));
1273
-                $datetime = EEH_DTT_Helper::date_time_add($datetime, 'DTT_EVT_end', 'days');
1274
-            }
1275
-            $datetime->save();
1276
-            $event->_add_relation_to($datetime, 'Datetime');
1277
-        }
1278
-        // no datetimes get deleted so we don't do any of that logic here.
1279
-        // update tickets next
1280
-        $old_tickets = isset($data['ticket_IDs']) ? explode(',', $data['ticket_IDs']) : [];
1281
-
1282
-        // set up some default start and end dates in case those are not present in the incoming data
1283
-        $default_start_date = new DateTime('now', new DateTimeZone($event->get_timezone()));
1284
-        $default_start_date = $default_start_date->format($date_formats[0] . ' ' . $date_formats[1]);
1285
-        // use the start date of the first datetime for the end date
1286
-        $first_datetime   = $event->first_datetime();
1287
-        $default_end_date = $first_datetime->start_date_and_time($date_formats[0], $date_formats[1]);
1288
-
1289
-        // now process the incoming data
1290
-        foreach ($data['edit_tickets'] as $row => $ticket_data) {
1291
-            $update_prices = false;
1292
-            $ticket_price  = isset($data['edit_prices'][ $row ][1]['PRC_amount'])
1293
-                ? $data['edit_prices'][ $row ][1]['PRC_amount']
1294
-                : 0;
1295
-            // trim inputs to ensure any excess whitespace is removed.
1296
-            $ticket_data   = array_map('trim', $ticket_data);
1297
-            $ticket_values = [
1298
-                'TKT_ID'          => ! empty($ticket_data['TKT_ID']) ? $ticket_data['TKT_ID'] : null,
1299
-                'TTM_ID'          => ! empty($ticket_data['TTM_ID']) ? $ticket_data['TTM_ID'] : 0,
1300
-                'TKT_name'        => ! empty($ticket_data['TKT_name']) ? $ticket_data['TKT_name'] : '',
1301
-                'TKT_description' => ! empty($ticket_data['TKT_description']) ? $ticket_data['TKT_description'] : '',
1302
-                'TKT_start_date'  => ! empty($ticket_data['TKT_start_date'])
1303
-                    ? $ticket_data['TKT_start_date']
1304
-                    : $default_start_date,
1305
-                'TKT_end_date'    => ! empty($ticket_data['TKT_end_date'])
1306
-                    ? $ticket_data['TKT_end_date']
1307
-                    : $default_end_date,
1308
-                'TKT_qty'         => ! empty($ticket_data['TKT_qty'])
1309
-                                     || (isset($ticket_data['TKT_qty']) && (int) $ticket_data['TKT_qty'] === 0)
1310
-                    ? $ticket_data['TKT_qty']
1311
-                    : EE_INF,
1312
-                'TKT_uses'        => ! empty($ticket_data['TKT_uses'])
1313
-                                     || (isset($ticket_data['TKT_uses']) && (int) $ticket_data['TKT_uses'] === 0)
1314
-                    ? $ticket_data['TKT_uses']
1315
-                    : EE_INF,
1316
-                'TKT_min'         => ! empty($ticket_data['TKT_min']) ? $ticket_data['TKT_min'] : 0,
1317
-                'TKT_max'         => ! empty($ticket_data['TKT_max']) ? $ticket_data['TKT_max'] : EE_INF,
1318
-                'TKT_order'       => isset($ticket_data['TKT_order']) ? $ticket_data['TKT_order'] : $row,
1319
-                'TKT_price'       => $ticket_price,
1320
-                'TKT_row'         => $row,
1321
-            ];
1322
-            // if this is a default ticket, then we need to set the TKT_ID to 0 and update accordingly,
1323
-            // which means in turn that the prices will become new prices as well.
1324
-            if (isset($ticket_data['TKT_is_default']) && $ticket_data['TKT_is_default']) {
1325
-                $ticket_values['TKT_ID']         = 0;
1326
-                $ticket_values['TKT_is_default'] = 0;
1327
-                $update_prices                   = true;
1328
-            }
1329
-            // if we have a TKT_ID then we need to get that existing TKT_obj and update it
1330
-            // we actually do our saves ahead of adding any relations because its entirely possible that this
1331
-            // ticket didn't get removed or added to any datetime in the session but DID have it's items modified.
1332
-            // keep in mind that if the ticket has been sold (and we have changed pricing information),
1333
-            // then we won't be updating the tkt but instead a new tkt will be created and the old one archived.
1334
-            if (! empty($ticket_data['TKT_ID'])) {
1335
-                $existing_ticket = EEM_Ticket::instance($event_timezone)->get_one_by_ID($ticket_data['TKT_ID']);
1336
-                if (! $existing_ticket instanceof EE_Ticket) {
1337
-                    throw new RuntimeException(
1338
-                        sprintf(
1339
-                            esc_html__(
1340
-                                'Something went wrong! A valid Ticket could not be retrieved from the database using the supplied ID: %1$d',
1341
-                                'event_espresso'
1342
-                            ),
1343
-                            $ticket_data['TKT_ID']
1344
-                        )
1345
-                    );
1346
-                }
1347
-                $ticket_sold = $existing_ticket->count_related(
1348
-                    'Registration',
1349
-                    [
1350
-                            [
1351
-                                'STS_ID' => [
1352
-                                    'NOT IN',
1353
-                                    [EEM_Registration::status_id_incomplete],
1354
-                                ],
1355
-                            ],
1356
-                        ]
1357
-                ) > 0;
1358
-                // let's just check the total price for the existing ticket and determine if it matches the new total price.
1359
-                // if they are different then we create a new ticket (if $ticket_sold)
1360
-                // if they aren't different then we go ahead and modify existing ticket.
1361
-                $create_new_ticket = $ticket_sold
1362
-                                     && $ticket_price !== $existing_ticket->price()
1363
-                                     && ! $existing_ticket->deleted();
1364
-                $existing_ticket->set_date_format($date_formats[0]);
1365
-                $existing_ticket->set_time_format($date_formats[1]);
1366
-                // set new values
1367
-                foreach ($ticket_values as $field => $value) {
1368
-                    if ($field == 'TKT_qty') {
1369
-                        $existing_ticket->set_qty($value);
1370
-                    } elseif ($field == 'TKT_price') {
1371
-                        $existing_ticket->set('TKT_price', $ticket_price);
1372
-                    } else {
1373
-                        $existing_ticket->set($field, $value);
1374
-                    }
1375
-                }
1376
-                $ticket = $existing_ticket;
1377
-                // if $create_new_ticket is false then we can safely update the existing ticket.
1378
-                //  Otherwise we have to create a new ticket.
1379
-                if ($create_new_ticket) {
1380
-                    // archive the old ticket first
1381
-                    $existing_ticket->set('TKT_deleted', 1);
1382
-                    $existing_ticket->save();
1383
-                    // make sure this ticket is still recorded in our $saved_tickets
1384
-                    // so we don't run it through the regular trash routine.
1385
-                    $saved_tickets[ $existing_ticket->ID() ] = $existing_ticket;
1386
-                    // create new ticket that's a copy of the existing except,
1387
-                    // (a new id of course and not archived) AND has the new TKT_price associated with it.
1388
-                    $new_ticket = clone $existing_ticket;
1389
-                    $new_ticket->set('TKT_ID', 0);
1390
-                    $new_ticket->set('TKT_deleted', 0);
1391
-                    $new_ticket->set('TKT_sold', 0);
1392
-                    // now we need to make sure that $new prices are created as well and attached to new ticket.
1393
-                    $update_prices = true;
1394
-                    $ticket        = $new_ticket;
1395
-                }
1396
-            } else {
1397
-                // no TKT_id so a new ticket
1398
-                $ticket_values['TKT_price'] = $ticket_price;
1399
-                $ticket                     = EE_Ticket::new_instance($ticket_values, $event_timezone, $date_formats);
1400
-                $update_prices              = true;
1401
-            }
1402
-            if (! $ticket instanceof EE_Ticket) {
1403
-                throw new RuntimeException(
1404
-                    sprintf(
1405
-                        esc_html__(
1406
-                            'Something went wrong! A valid Ticket could not be generated or retrieved using the supplied data: %1$s',
1407
-                            'event_espresso'
1408
-                        ),
1409
-                        print_r($ticket_values, true)
1410
-                    )
1411
-                );
1412
-            }
1413
-            // cap ticket qty by datetime reg limits
1414
-            $ticket->set_qty(min($ticket->qty(), $ticket->qty('reg_limit')));
1415
-            // update ticket.
1416
-            $ticket->save();
1417
-            // before going any further make sure our dates are setup correctly
1418
-            // so that the end date is always equal or greater than the start date.
1419
-            if ($ticket->get_raw('TKT_start_date') > $ticket->get_raw('TKT_end_date')) {
1420
-                $ticket->set('TKT_end_date', $ticket->get('TKT_start_date'));
1421
-                $ticket = EEH_DTT_Helper::date_time_add($ticket, 'TKT_end_date', 'days');
1422
-                $ticket->save();
1423
-            }
1424
-            // initially let's add the ticket to the datetime
1425
-            $datetime->_add_relation_to($ticket, 'Ticket');
1426
-            $saved_tickets[ $ticket->ID() ] = $ticket;
1427
-            // add prices to ticket
1428
-            $this->_add_prices_to_ticket($data['edit_prices'][ $row ], $ticket, $update_prices);
1429
-        }
1430
-        // however now we need to handle permanently deleting tickets via the ui.
1431
-        //  Keep in mind that the ui does not allow deleting/archiving tickets that have ticket sold.
1432
-        //  However, it does allow for deleting tickets that have no tickets sold,
1433
-        // in which case we want to get rid of permanently because there is no need to save in db.
1434
-        $old_tickets     = isset($old_tickets[0]) && $old_tickets[0] === '' ? [] : $old_tickets;
1435
-        $tickets_removed = array_diff($old_tickets, array_keys($saved_tickets));
1436
-        foreach ($tickets_removed as $id) {
1437
-            $id = absint($id);
1438
-            // get the ticket for this id
1439
-            $ticket_to_remove = EEM_Ticket::instance()->get_one_by_ID($id);
1440
-            if (! $ticket_to_remove instanceof EE_Ticket) {
1441
-                continue;
1442
-            }
1443
-            // need to get all the related datetimes on this ticket and remove from every single one of them
1444
-            // (remember this process can ONLY kick off if there are NO tickets sold)
1445
-            $related_datetimes = $ticket_to_remove->get_many_related('Datetime');
1446
-            foreach ($related_datetimes as $related_datetime) {
1447
-                $ticket_to_remove->_remove_relation_to($related_datetime, 'Datetime');
1448
-            }
1449
-            // need to do the same for prices (except these prices can also be deleted because again,
1450
-            // tickets can only be trashed if they don't have any TKTs sold (otherwise they are just archived))
1451
-            $ticket_to_remove->delete_related_permanently('Price');
1452
-            // finally let's delete this ticket
1453
-            // (which should not be blocked at this point b/c we've removed all our relationships)
1454
-            $ticket_to_remove->delete_permanently();
1455
-        }
1456
-        return [$datetime, $saved_tickets];
1457
-    }
1458
-
1459
-
1460
-    /**
1461
-     * This attaches a list of given prices to a ticket.
1462
-     * Note we dont' have to worry about ever removing relationships (or archiving prices)
1463
-     * because if there is a change in price information on a ticket, a new ticket is created anyways
1464
-     * so the archived ticket will retain the old price info and prices are automatically "archived" via the ticket.
1465
-     *
1466
-     * @access  private
1467
-     * @param array     $prices_data Array of prices from the form.
1468
-     * @param EE_Ticket $ticket      EE_Ticket object that prices are being attached to.
1469
-     * @param bool      $new_prices  Whether attach existing incoming prices or create new ones.
1470
-     * @return  void
1471
-     * @throws EE_Error
1472
-     * @throws ReflectionException
1473
-     */
1474
-    private function _add_prices_to_ticket($prices_data, EE_Ticket $ticket, $new_prices = false)
1475
-    {
1476
-        $timezone = $ticket->get_timezone();
1477
-        foreach ($prices_data as $row => $price_data) {
1478
-            $price_values = [
1479
-                'PRC_ID'         => ! empty($price_data['PRC_ID']) ? $price_data['PRC_ID'] : null,
1480
-                'PRT_ID'         => ! empty($price_data['PRT_ID']) ? $price_data['PRT_ID'] : null,
1481
-                'PRC_amount'     => ! empty($price_data['PRC_amount']) ? $price_data['PRC_amount'] : 0,
1482
-                'PRC_name'       => ! empty($price_data['PRC_name']) ? $price_data['PRC_name'] : '',
1483
-                'PRC_desc'       => ! empty($price_data['PRC_desc']) ? $price_data['PRC_desc'] : '',
1484
-                'PRC_is_default' => 0, // make sure prices are NOT set as default from this context
1485
-                'PRC_order'      => $row,
1486
-            ];
1487
-            if ($new_prices || empty($price_values['PRC_ID'])) {
1488
-                $price_values['PRC_ID'] = 0;
1489
-                $price                  = EE_Price::new_instance($price_values, $timezone);
1490
-            } else {
1491
-                $price = EEM_Price::instance($timezone)->get_one_by_ID($price_data['PRC_ID']);
1492
-                // update this price with new values
1493
-                foreach ($price_values as $field => $new_price) {
1494
-                    $price->set($field, $new_price);
1495
-                }
1496
-            }
1497
-            if (! $price instanceof EE_Price) {
1498
-                throw new RuntimeException(
1499
-                    sprintf(
1500
-                        esc_html__(
1501
-                            'Something went wrong! A valid Price could not be generated or retrieved using the supplied data: %1$s',
1502
-                            'event_espresso'
1503
-                        ),
1504
-                        print_r($price_values, true)
1505
-                    )
1506
-                );
1507
-            }
1508
-            $price->save();
1509
-            $ticket->_add_relation_to($price, 'Price');
1510
-        }
1511
-    }
1512
-
1513
-
1514
-    /**
1515
-     * Add in our autosave ajax handlers
1516
-     *
1517
-     */
1518
-    protected function _ee_autosave_create_new()
1519
-    {
1520
-    }
1521
-
1522
-
1523
-    /**
1524
-     * More autosave handlers.
1525
-     */
1526
-    protected function _ee_autosave_edit()
1527
-    {
1528
-    }
1529
-
1530
-
1531
-    /**
1532
-     * @throws EE_Error
1533
-     * @throws ReflectionException
1534
-     */
1535
-    private function _generate_publish_box_extra_content()
1536
-    {
1537
-        // load formatter helper
1538
-        // args for getting related registrations
1539
-        $approved_query_args        = [
1540
-            [
1541
-                'REG_deleted' => 0,
1542
-                'STS_ID'      => EEM_Registration::status_id_approved,
1543
-            ],
1544
-        ];
1545
-        $not_approved_query_args    = [
1546
-            [
1547
-                'REG_deleted' => 0,
1548
-                'STS_ID'      => EEM_Registration::status_id_not_approved,
1549
-            ],
1550
-        ];
1551
-        $pending_payment_query_args = [
1552
-            [
1553
-                'REG_deleted' => 0,
1554
-                'STS_ID'      => EEM_Registration::status_id_pending_payment,
1555
-            ],
1556
-        ];
1557
-        // publish box
1558
-        $publish_box_extra_args = [
1559
-            'view_approved_reg_url'        => add_query_arg(
1560
-                [
1561
-                    'action'      => 'default',
1562
-                    'event_id'    => $this->_cpt_model_obj->ID(),
1563
-                    '_reg_status' => EEM_Registration::status_id_approved,
1564
-                ],
1565
-                REG_ADMIN_URL
1566
-            ),
1567
-            'view_not_approved_reg_url'    => add_query_arg(
1568
-                [
1569
-                    'action'      => 'default',
1570
-                    'event_id'    => $this->_cpt_model_obj->ID(),
1571
-                    '_reg_status' => EEM_Registration::status_id_not_approved,
1572
-                ],
1573
-                REG_ADMIN_URL
1574
-            ),
1575
-            'view_pending_payment_reg_url' => add_query_arg(
1576
-                [
1577
-                    'action'      => 'default',
1578
-                    'event_id'    => $this->_cpt_model_obj->ID(),
1579
-                    '_reg_status' => EEM_Registration::status_id_pending_payment,
1580
-                ],
1581
-                REG_ADMIN_URL
1582
-            ),
1583
-            'approved_regs'                => $this->_cpt_model_obj->count_related(
1584
-                'Registration',
1585
-                $approved_query_args
1586
-            ),
1587
-            'not_approved_regs'            => $this->_cpt_model_obj->count_related(
1588
-                'Registration',
1589
-                $not_approved_query_args
1590
-            ),
1591
-            'pending_payment_regs'         => $this->_cpt_model_obj->count_related(
1592
-                'Registration',
1593
-                $pending_payment_query_args
1594
-            ),
1595
-            'misc_pub_section_class'       => apply_filters(
1596
-                'FHEE_Events_Admin_Page___generate_publish_box_extra_content__misc_pub_section_class',
1597
-                'misc-pub-section'
1598
-            ),
1599
-        ];
1600
-        ob_start();
1601
-        do_action(
1602
-            'AHEE__Events_Admin_Page___generate_publish_box_extra_content__event_editor_overview_add',
1603
-            $this->_cpt_model_obj
1604
-        );
1605
-        $publish_box_extra_args['event_editor_overview_add'] = ob_get_clean();
1606
-        // load template
1607
-        EEH_Template::display_template(
1608
-            EVENTS_TEMPLATE_PATH . 'event_publish_box_extras.template.php',
1609
-            $publish_box_extra_args
1610
-        );
1611
-    }
1612
-
1613
-
1614
-    /**
1615
-     * @return EE_Event
1616
-     */
1617
-    public function get_event_object()
1618
-    {
1619
-        return $this->_cpt_model_obj;
1620
-    }
1621
-
1622
-
1623
-
1624
-
1625
-    /** METABOXES * */
1626
-    /**
1627
-     * _register_event_editor_meta_boxes
1628
-     * add all metaboxes related to the event_editor
1629
-     *
1630
-     * @return void
1631
-     * @throws EE_Error
1632
-     * @throws ReflectionException
1633
-     */
1634
-    protected function _register_event_editor_meta_boxes()
1635
-    {
1636
-        $this->verify_cpt_object();
1637
-        $use_advanced_editor = $this->admin_config->useAdvancedEditor();
1638
-        // check if the new EDTR reg options meta box is being used, and if so, don't load the legacy version
1639
-        if (! $use_advanced_editor || ! $this->feature->allowed('use_reg_options_meta_box')) {
1640
-            add_meta_box(
1641
-                'espresso_event_editor_event_options',
1642
-                esc_html__('Event Registration Options', 'event_espresso'),
1643
-                [$this, 'registration_options_meta_box'],
1644
-                $this->page_slug,
1645
-                'side'
1646
-            );
1647
-        }
1648
-        if (! $use_advanced_editor) {
1649
-            add_meta_box(
1650
-                'espresso_event_editor_tickets',
1651
-                esc_html__('Event Datetime & Ticket', 'event_espresso'),
1652
-                [$this, 'ticket_metabox'],
1653
-                $this->page_slug,
1654
-                'normal',
1655
-                'high'
1656
-            );
1657
-        } elseif ($this->feature->allowed('use_reg_options_meta_box')) {
1658
-            add_action(
1659
-                'add_meta_boxes_espresso_events',
1660
-                function () {
1661
-                    global $current_screen;
1662
-                    remove_meta_box('authordiv', $current_screen, 'normal');
1663
-                },
1664
-                99
1665
-            );
1666
-        }
1667
-        // NOTE: if you're looking for other metaboxes in here,
1668
-        // where a metabox has a related management page in the admin
1669
-        // you will find it setup in the related management page's "_Hooks" file.
1670
-        // i.e. messages metabox is found in "espresso_events_Messages_Hooks.class.php".
1671
-    }
1672
-
1673
-
1674
-    /**
1675
-     * @throws DomainException
1676
-     * @throws EE_Error
1677
-     * @throws ReflectionException
1678
-     */
1679
-    public function ticket_metabox()
1680
-    {
1681
-        $existing_datetime_ids = $existing_ticket_ids = [];
1682
-        // defaults for template args
1683
-        $template_args = [
1684
-            'existing_datetime_ids'    => '',
1685
-            'event_datetime_help_link' => '',
1686
-            'ticket_options_help_link' => '',
1687
-            'time'                     => null,
1688
-            'ticket_rows'              => '',
1689
-            'existing_ticket_ids'      => '',
1690
-            'total_ticket_rows'        => 1,
1691
-            'ticket_js_structure'      => '',
1692
-            'trash_icon'               => 'ee-lock-icon',
1693
-            'disabled'                 => '',
1694
-        ];
1695
-        $event_id      = is_object($this->_cpt_model_obj) ? $this->_cpt_model_obj->ID() : null;
1696
-        /**
1697
-         * 1. Start with retrieving Datetimes
1698
-         * 2. Fore each datetime get related tickets
1699
-         * 3. For each ticket get related prices
1700
-         */
1701
-        /** @var EEM_Datetime $datetime_model */
1702
-        $datetime_model = EE_Registry::instance()->load_model('Datetime');
1703
-        /** @var EEM_Ticket $datetime_model */
1704
-        $ticket_model = EE_Registry::instance()->load_model('Ticket');
1705
-        $times        = $datetime_model->get_all_event_dates($event_id);
1706
-        /** @type EE_Datetime $first_datetime */
1707
-        $first_datetime = reset($times);
1708
-        // do we get related tickets?
1709
-        if (
1710
-            $first_datetime instanceof EE_Datetime
1711
-            && $first_datetime->ID() !== 0
1712
-        ) {
1713
-            $existing_datetime_ids[] = $first_datetime->get('DTT_ID');
1714
-            $template_args['time']   = $first_datetime;
1715
-            $related_tickets         = $first_datetime->tickets(
1716
-                [
1717
-                    ['OR' => ['TKT_deleted' => 1, 'TKT_deleted*' => 0]],
1718
-                    'default_where_conditions' => 'none',
1719
-                ]
1720
-            );
1721
-            if (! empty($related_tickets)) {
1722
-                $template_args['total_ticket_rows'] = count($related_tickets);
1723
-                $row                                = 0;
1724
-                foreach ($related_tickets as $ticket) {
1725
-                    $existing_ticket_ids[]        = $ticket->get('TKT_ID');
1726
-                    $template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, false, $row);
1727
-                    $row++;
1728
-                }
1729
-            } else {
1730
-                $template_args['total_ticket_rows'] = 1;
1731
-                /** @type EE_Ticket $ticket */
1732
-                $ticket                       = $ticket_model->create_default_object();
1733
-                $template_args['ticket_rows'] .= $this->_get_ticket_row($ticket);
1734
-            }
1735
-        } else {
1736
-            $template_args['time'] = $times[0];
1737
-            /** @type EE_Ticket[] $tickets */
1738
-            $tickets                      = $ticket_model->get_all_default_tickets();
1739
-            $template_args['ticket_rows'] .= $this->_get_ticket_row($tickets[1]);
1740
-            // NOTE: we're just sending the first default row
1741
-            // (decaf can't manage default tickets so this should be sufficient);
1742
-        }
1743
-        $template_args['event_datetime_help_link'] = $this->_get_help_tab_link(
1744
-            'event_editor_event_datetimes_help_tab'
1745
-        );
1746
-        $template_args['ticket_options_help_link'] = $this->_get_help_tab_link('ticket_options_info');
1747
-        $template_args['existing_datetime_ids']    = implode(',', $existing_datetime_ids);
1748
-        $template_args['existing_ticket_ids']      = implode(',', $existing_ticket_ids);
1749
-        $template_args['ticket_js_structure']      = $this->_get_ticket_row(
1750
-            $ticket_model->create_default_object(),
1751
-            true
1752
-        );
1753
-        $template                                  = apply_filters(
1754
-            'FHEE__Events_Admin_Page__ticket_metabox__template',
1755
-            EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php'
1756
-        );
1757
-        EEH_Template::display_template($template, $template_args);
1758
-    }
1759
-
1760
-
1761
-    /**
1762
-     * Setup an individual ticket form for the decaf event editor page
1763
-     *
1764
-     * @access private
1765
-     * @param EE_Ticket $ticket   the ticket object
1766
-     * @param boolean   $skeleton whether we're generating a skeleton for js manipulation
1767
-     * @param int       $row
1768
-     * @return string generated html for the ticket row.
1769
-     * @throws EE_Error
1770
-     * @throws ReflectionException
1771
-     */
1772
-    private function _get_ticket_row($ticket, $skeleton = false, $row = 0)
1773
-    {
1774
-        $template_args = [
1775
-            'tkt_status_class'    => ' tkt-status-' . $ticket->ticket_status(),
1776
-            'tkt_archive_class'   => $ticket->ticket_status() === EE_Ticket::archived && ! $skeleton ? ' tkt-archived'
1777
-                : '',
1778
-            'ticketrow'           => $skeleton ? 'TICKETNUM' : $row,
1779
-            'TKT_ID'              => $ticket->get('TKT_ID'),
1780
-            'TKT_name'            => $ticket->get('TKT_name'),
1781
-            'TKT_start_date'      => $skeleton ? '' : $ticket->get_date('TKT_start_date', 'Y-m-d h:i a'),
1782
-            'TKT_end_date'        => $skeleton ? '' : $ticket->get_date('TKT_end_date', 'Y-m-d h:i a'),
1783
-            'TKT_is_default'      => $ticket->get('TKT_is_default'),
1784
-            'TKT_qty'             => $ticket->get_pretty('TKT_qty', 'input'),
1785
-            'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1786
-            'TKT_sold'            => $skeleton ? 0 : $ticket->get('TKT_sold'),
1787
-            'trash_icon'          => ($skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')))
1788
-                                     && (! empty($ticket) && $ticket->get('TKT_sold') === 0)
1789
-                ? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1790
-            'disabled'            => $skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')) ? ''
1791
-                : ' disabled=disabled',
1792
-        ];
1793
-        $price         = $ticket->ID() !== 0
1794
-            ? $ticket->get_first_related('Price', ['default_where_conditions' => 'none'])
1795
-            : null;
1796
-        $price         = $price instanceof EE_Price
1797
-            ? $price
1798
-            : EEM_Price::instance()->create_default_object();
1799
-        $price_args    = [
1800
-            'price_currency_symbol' => EE_Registry::instance()->CFG->currency->sign,
1801
-            'PRC_amount'            => $price->get('PRC_amount'),
1802
-            'PRT_ID'                => $price->get('PRT_ID'),
1803
-            'PRC_ID'                => $price->get('PRC_ID'),
1804
-            'PRC_is_default'        => $price->get('PRC_is_default'),
1805
-        ];
1806
-        // make sure we have default start and end dates if skeleton
1807
-        // handle rows that should NOT be empty
1808
-        if (empty($template_args['TKT_start_date'])) {
1809
-            // if empty then the start date will be now.
1810
-            $template_args['TKT_start_date'] = date('Y-m-d h:i a', current_time('timestamp'));
1811
-        }
1812
-        if (empty($template_args['TKT_end_date'])) {
1813
-            // get the earliest datetime (if present);
1814
-            $earliest_datetime             = $this->_cpt_model_obj->ID() > 0
1815
-                ? $this->_cpt_model_obj->get_first_related(
1816
-                    'Datetime',
1817
-                    ['order_by' => ['DTT_EVT_start' => 'ASC']]
1818
-                )
1819
-                : null;
1820
-            $template_args['TKT_end_date'] = $earliest_datetime instanceof EE_Datetime
1821
-                ? $earliest_datetime->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a')
1822
-                : date('Y-m-d h:i a', mktime(0, 0, 0, date('m'), date('d') + 7, date('Y')));
1823
-        }
1824
-        $template_args = array_merge($template_args, $price_args);
1825
-        $template      = apply_filters(
1826
-            'FHEE__Events_Admin_Page__get_ticket_row__template',
1827
-            EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_ticket_row.template.php',
1828
-            $ticket
1829
-        );
1830
-        return EEH_Template::display_template($template, $template_args, true);
1831
-    }
1832
-
1833
-
1834
-    /**
1835
-     * @throws EE_Error
1836
-     * @throws ReflectionException
1837
-     */
1838
-    public function registration_options_meta_box()
1839
-    {
1840
-        $yes_no_values             = [
1841
-            ['id' => true, 'text' => esc_html__('Yes', 'event_espresso')],
1842
-            ['id' => false, 'text' => esc_html__('No', 'event_espresso')],
1843
-        ];
1844
-        $default_reg_status_values = EEM_Registration::reg_status_array(
1845
-            [
1846
-                EEM_Registration::status_id_cancelled,
1847
-                EEM_Registration::status_id_declined,
1848
-                EEM_Registration::status_id_incomplete,
1849
-            ],
1850
-            true
1851
-        );
1852
-        // $template_args['is_active_select'] = EEH_Form_Fields::select_input('is_active', $yes_no_values, $this->_cpt_model_obj->is_active());
1853
-        $template_args['_event']                          = $this->_cpt_model_obj;
1854
-        $template_args['event']                           = $this->_cpt_model_obj;
1855
-        $template_args['active_status']                   = $this->_cpt_model_obj->pretty_active_status(false);
1856
-        $template_args['additional_limit']                = $this->_cpt_model_obj->additional_limit();
1857
-        $template_args['default_registration_status']     = EEH_Form_Fields::select_input(
1858
-            'default_reg_status',
1859
-            $default_reg_status_values,
1860
-            $this->_cpt_model_obj->default_registration_status()
1861
-        );
1862
-        $template_args['display_description']             = EEH_Form_Fields::select_input(
1863
-            'display_desc',
1864
-            $yes_no_values,
1865
-            $this->_cpt_model_obj->display_description()
1866
-        );
1867
-        $template_args['display_ticket_selector']         = EEH_Form_Fields::select_input(
1868
-            'display_ticket_selector',
1869
-            $yes_no_values,
1870
-            $this->_cpt_model_obj->display_ticket_selector(),
1871
-            '',
1872
-            '',
1873
-            false
1874
-        );
1875
-        $template_args['additional_registration_options'] = apply_filters(
1876
-            'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options',
1877
-            '',
1878
-            $template_args,
1879
-            $yes_no_values,
1880
-            $default_reg_status_values
1881
-        );
1882
-        EEH_Template::display_template(
1883
-            EVENTS_TEMPLATE_PATH . 'event_registration_options.template.php',
1884
-            $template_args
1885
-        );
1886
-    }
1887
-
1888
-
1889
-    /**
1890
-     * _get_events()
1891
-     * This method simply returns all the events (for the given _view and paging)
1892
-     *
1893
-     * @access public
1894
-     * @param int  $per_page     count of items per page (20 default);
1895
-     * @param int  $current_page what is the current page being viewed.
1896
-     * @param bool $count        if TRUE then we just return a count of ALL events matching the given _view.
1897
-     *                           If FALSE then we return an array of event objects
1898
-     *                           that match the given _view and paging parameters.
1899
-     * @return array|int         an array of event objects or a count of them.
1900
-     * @throws Exception
1901
-     */
1902
-    public function get_events($per_page = 10, $current_page = 1, $count = false)
1903
-    {
1904
-        $EEM_Event   = $this->_event_model();
1905
-        $offset      = ($current_page - 1) * $per_page;
1906
-        $limit       = $count ? null : $offset . ',' . $per_page;
1907
-        $orderby     = $this->request->getRequestParam('orderby', 'EVT_ID');
1908
-        $order       = $this->request->getRequestParam('order', 'DESC');
1909
-        $month_range = $this->request->getRequestParam('month_range');
1910
-        if ($month_range) {
1911
-            $pieces = explode(' ', $month_range, 3);
1912
-            // simulate the FIRST day of the month, that fixes issues for months like February
1913
-            // where PHP doesn't know what to assume for date.
1914
-            // @see https://events.codebasehq.com/projects/event-espresso/tickets/10437
1915
-            $month_r = ! empty($pieces[0]) ? date('m', EEH_DTT_Helper::first_of_month_timestamp($pieces[0])) : '';
1916
-            $year_r  = ! empty($pieces[1]) ? $pieces[1] : '';
1917
-        }
1918
-        $where  = [];
1919
-        $status = $this->request->getRequestParam('status');
1920
-        // determine what post_status our condition will have for the query.
1921
-        switch ($status) {
1922
-            case 'month':
1923
-            case 'today':
1924
-            case null:
1925
-            case 'all':
1926
-                break;
1927
-            case 'draft':
1928
-                $where['status'] = ['IN', ['draft', 'auto-draft']];
1929
-                break;
1930
-            default:
1931
-                $where['status'] = $status;
1932
-        }
1933
-        // categories? The default for all categories is -1
1934
-        $category = $this->request->getRequestParam('EVT_CAT', -1, 'int');
1935
-        if ($category !== -1) {
1936
-            $where['Term_Taxonomy.taxonomy'] = EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY;
1937
-            $where['Term_Taxonomy.term_id']  = $category;
1938
-        }
1939
-        // date where conditions
1940
-        $start_formats = EEM_Datetime::instance()->get_formats_for('DTT_EVT_start');
1941
-        if ($month_range) {
1942
-            $DateTime = new DateTime(
1943
-                $year_r . '-' . $month_r . '-01 00:00:00',
1944
-                new DateTimeZone('UTC')
1945
-            );
1946
-            $start    = $DateTime->getTimestamp();
1947
-            // set the datetime to be the end of the month
1948
-            $DateTime->setDate(
1949
-                $year_r,
1950
-                $month_r,
1951
-                $DateTime->format('t')
1952
-            )->setTime(23, 59, 59);
1953
-            $end                             = $DateTime->getTimestamp();
1954
-            $where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1955
-        } elseif ($status === 'today') {
1956
-            $DateTime                        =
1957
-                new DateTime('now', new DateTimeZone(EEM_Event::instance()->get_timezone()));
1958
-            $start                           = $DateTime->setTime(0, 0)->format(implode(' ', $start_formats));
1959
-            $end                             = $DateTime->setTime(23, 59, 59)->format(implode(' ', $start_formats));
1960
-            $where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1961
-        } elseif ($status === 'month') {
1962
-            $now                             = date('Y-m-01');
1963
-            $DateTime                        =
1964
-                new DateTime($now, new DateTimeZone(EEM_Event::instance()->get_timezone()));
1965
-            $start                           = $DateTime->setTime(0, 0)->format(implode(' ', $start_formats));
1966
-            $end                             = $DateTime->setDate(date('Y'), date('m'), $DateTime->format('t'))
1967
-                                                        ->setTime(23, 59, 59)
1968
-                                                        ->format(implode(' ', $start_formats));
1969
-            $where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1970
-        }
1971
-        if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1972
-            $where['EVT_wp_user'] = get_current_user_id();
1973
-        } else {
1974
-            if (! isset($where['status'])) {
1975
-                if (! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) {
1976
-                    $where['OR'] = [
1977
-                        'status*restrict_private' => ['!=', 'private'],
1978
-                        'AND'                     => [
1979
-                            'status*inclusive' => ['=', 'private'],
1980
-                            'EVT_wp_user'      => get_current_user_id(),
1981
-                        ],
1982
-                    ];
1983
-                }
1984
-            }
1985
-        }
1986
-        $wp_user = $this->request->getRequestParam('EVT_wp_user', 0, 'int');
1987
-        if (
1988
-            $wp_user
1989
-            && $wp_user !== get_current_user_id()
1990
-            && EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')
1991
-        ) {
1992
-            $where['EVT_wp_user'] = $wp_user;
1993
-        }
1994
-        // search query handling
1995
-        $search_term = $this->request->getRequestParam('s');
1996
-        if ($search_term) {
1997
-            $search_term = '%' . $search_term . '%';
1998
-            $where['OR'] = [
1999
-                'EVT_name'       => ['LIKE', $search_term],
2000
-                'EVT_desc'       => ['LIKE', $search_term],
2001
-                'EVT_short_desc' => ['LIKE', $search_term],
2002
-            ];
2003
-        }
2004
-        // filter events by venue.
2005
-        $venue = $this->request->getRequestParam('venue', 0, 'int');
2006
-        if ($venue) {
2007
-            $where['Venue.VNU_ID'] = $venue;
2008
-        }
2009
-        $request_params = $this->request->requestParams();
2010
-        $where          = apply_filters('FHEE__Events_Admin_Page__get_events__where', $where, $request_params);
2011
-        $query_params   = apply_filters(
2012
-            'FHEE__Events_Admin_Page__get_events__query_params',
2013
-            [
2014
-                $where,
2015
-                'limit'    => $limit,
2016
-                'order_by' => $orderby,
2017
-                'order'    => $order,
2018
-                'group_by' => 'EVT_ID',
2019
-            ],
2020
-            $request_params
2021
-        );
2022
-
2023
-        // let's first check if we have special requests coming in.
2024
-        $active_status = $this->request->getRequestParam('active_status');
2025
-        if ($active_status) {
2026
-            switch ($active_status) {
2027
-                case 'upcoming':
2028
-                    return $EEM_Event->get_upcoming_events($query_params, $count);
2029
-                case 'expired':
2030
-                    return $EEM_Event->get_expired_events($query_params, $count);
2031
-                case 'active':
2032
-                    return $EEM_Event->get_active_events($query_params, $count);
2033
-                case 'inactive':
2034
-                    return $EEM_Event->get_inactive_events($query_params, $count);
2035
-            }
2036
-        }
2037
-
2038
-        return $count ? $EEM_Event->count([$where], 'EVT_ID', true) : $EEM_Event->get_all($query_params);
2039
-    }
2040
-
2041
-
2042
-    /**
2043
-     * handling for WordPress CPT actions (trash, restore, delete)
2044
-     *
2045
-     * @param string $post_id
2046
-     * @throws EE_Error
2047
-     * @throws ReflectionException
2048
-     */
2049
-    public function trash_cpt_item($post_id)
2050
-    {
2051
-        $this->request->setRequestParam('EVT_ID', $post_id);
2052
-        $this->_trash_or_restore_event('trash', false);
2053
-    }
2054
-
2055
-
2056
-    /**
2057
-     * @param string $post_id
2058
-     * @throws EE_Error
2059
-     * @throws ReflectionException
2060
-     */
2061
-    public function restore_cpt_item($post_id)
2062
-    {
2063
-        $this->request->setRequestParam('EVT_ID', $post_id);
2064
-        $this->_trash_or_restore_event('draft', false);
2065
-    }
2066
-
2067
-
2068
-    /**
2069
-     * @param string $post_id
2070
-     * @throws EE_Error
2071
-     * @throws EE_Error
2072
-     */
2073
-    public function delete_cpt_item($post_id)
2074
-    {
2075
-        throw new EE_Error(
2076
-            esc_html__(
2077
-                'Please contact Event Espresso support with the details of the steps taken to produce this error.',
2078
-                'event_espresso'
2079
-            )
2080
-        );
2081
-        // $this->request->setRequestParam('EVT_ID', $post_id);
2082
-        // $this->_delete_event();
2083
-    }
2084
-
2085
-
2086
-    /**
2087
-     * _trash_or_restore_event
2088
-     *
2089
-     * @access protected
2090
-     * @param string $event_status
2091
-     * @param bool   $redirect_after
2092
-     * @throws EE_Error
2093
-     * @throws EE_Error
2094
-     * @throws ReflectionException
2095
-     */
2096
-    protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = true)
2097
-    {
2098
-        // determine the event id and set to array.
2099
-        $EVT_ID = $this->request->getRequestParam('EVT_ID', 0, 'int');
2100
-        // loop thru events
2101
-        if ($EVT_ID) {
2102
-            // clean status
2103
-            $event_status = sanitize_key($event_status);
2104
-            // grab status
2105
-            if (! empty($event_status)) {
2106
-                $success = $this->_change_event_status($EVT_ID, $event_status);
2107
-            } else {
2108
-                $success = false;
2109
-                $msg     = esc_html__(
2110
-                    'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
2111
-                    'event_espresso'
2112
-                );
2113
-                EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2114
-            }
2115
-        } else {
2116
-            $success = false;
2117
-            $msg     = esc_html__(
2118
-                'An error occurred. The event could not be moved to the trash because a valid event ID was not not supplied.',
2119
-                'event_espresso'
2120
-            );
2121
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2122
-        }
2123
-        $action = $event_status === 'trash' ? 'moved to the trash' : 'restored from the trash';
2124
-        if ($redirect_after) {
2125
-            $this->_redirect_after_action($success, 'Event', $action, ['action' => 'default']);
2126
-        }
2127
-    }
2128
-
2129
-
2130
-    /**
2131
-     * _trash_or_restore_events
2132
-     *
2133
-     * @access protected
2134
-     * @param string $event_status
2135
-     * @return void
2136
-     * @throws EE_Error
2137
-     * @throws EE_Error
2138
-     * @throws ReflectionException
2139
-     */
2140
-    protected function _trash_or_restore_events($event_status = 'trash')
2141
-    {
2142
-        // clean status
2143
-        $event_status = sanitize_key($event_status);
2144
-        // grab status
2145
-        if (! empty($event_status)) {
2146
-            $success = true;
2147
-            // determine the event id and set to array.
2148
-            $EVT_IDs = $this->request->getRequestParam('EVT_IDs', [], 'int', true);
2149
-            // loop thru events
2150
-            foreach ($EVT_IDs as $EVT_ID) {
2151
-                if ($EVT_ID = absint($EVT_ID)) {
2152
-                    $results = $this->_change_event_status($EVT_ID, $event_status);
2153
-                    $success = $results !== false ? $success : false;
2154
-                } else {
2155
-                    $msg = sprintf(
2156
-                        esc_html__(
2157
-                            'An error occurred. Event #%d could not be moved to the trash because a valid event ID was not not supplied.',
2158
-                            'event_espresso'
2159
-                        ),
2160
-                        $EVT_ID
2161
-                    );
2162
-                    EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2163
-                    $success = false;
2164
-                }
2165
-            }
2166
-        } else {
2167
-            $success = false;
2168
-            $msg     = esc_html__(
2169
-                'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
2170
-                'event_espresso'
2171
-            );
2172
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2173
-        }
2174
-        // in order to force a pluralized result message we need to send back a success status greater than 1
2175
-        $success = $success ? 2 : false;
2176
-        $action  = $event_status === 'trash' ? 'moved to the trash' : 'restored from the trash';
2177
-        $this->_redirect_after_action($success, 'Events', $action, ['action' => 'default']);
2178
-    }
2179
-
2180
-
2181
-    /**
2182
-     * @param int    $EVT_ID
2183
-     * @param string $event_status
2184
-     * @return bool
2185
-     * @throws EE_Error
2186
-     * @throws ReflectionException
2187
-     */
2188
-    private function _change_event_status($EVT_ID = 0, $event_status = '')
2189
-    {
2190
-        // grab event id
2191
-        if (! $EVT_ID) {
2192
-            $msg = esc_html__(
2193
-                'An error occurred. No Event ID or an invalid Event ID was received.',
2194
-                'event_espresso'
2195
-            );
2196
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2197
-            return false;
2198
-        }
2199
-        $this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2200
-        // clean status
2201
-        $event_status = sanitize_key($event_status);
2202
-        // grab status
2203
-        if (empty($event_status)) {
2204
-            $msg = esc_html__(
2205
-                'An error occurred. No Event Status or an invalid Event Status was received.',
2206
-                'event_espresso'
2207
-            );
2208
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2209
-            return false;
2210
-        }
2211
-        // was event trashed or restored ?
2212
-        switch ($event_status) {
2213
-            case 'draft':
2214
-                $action = 'restored from the trash';
2215
-                $hook   = 'AHEE_event_restored_from_trash';
2216
-                break;
2217
-            case 'trash':
2218
-                $action = 'moved to the trash';
2219
-                $hook   = 'AHEE_event_moved_to_trash';
2220
-                break;
2221
-            default:
2222
-                $action = 'updated';
2223
-                $hook   = false;
2224
-        }
2225
-        // use class to change status
2226
-        $this->_cpt_model_obj->set_status($event_status);
2227
-        $success = $this->_cpt_model_obj->save();
2228
-        if (! $success) {
2229
-            $msg = sprintf(esc_html__('An error occurred. The event could not be %s.', 'event_espresso'), $action);
2230
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2231
-            return false;
2232
-        }
2233
-        if ($hook) {
2234
-            do_action($hook);
2235
-        }
2236
-        return true;
2237
-    }
2238
-
2239
-
2240
-    /**
2241
-     * @param array $event_ids
2242
-     * @return array
2243
-     * @since   4.10.23.p
2244
-     */
2245
-    private function cleanEventIds(array $event_ids)
2246
-    {
2247
-        return array_map('absint', $event_ids);
2248
-    }
2249
-
2250
-
2251
-    /**
2252
-     * @return array
2253
-     * @since   4.10.23.p
2254
-     */
2255
-    private function getEventIdsFromRequest()
2256
-    {
2257
-        if ($this->request->requestParamIsSet('EVT_IDs')) {
2258
-            return $this->request->getRequestParam('EVT_IDs', [], 'int', true);
2259
-        } else {
2260
-            return $this->request->getRequestParam('EVT_ID', [], 'int', true);
2261
-        }
2262
-    }
2263
-
2264
-
2265
-    /**
2266
-     * @param bool $preview_delete
2267
-     * @throws EE_Error
2268
-     */
2269
-    protected function _delete_event($preview_delete = true)
2270
-    {
2271
-        $this->_delete_events($preview_delete);
2272
-    }
2273
-
2274
-
2275
-    /**
2276
-     * Gets the tree traversal batch persister.
2277
-     *
2278
-     * @return NodeGroupDao
2279
-     * @throws InvalidArgumentException
2280
-     * @throws InvalidDataTypeException
2281
-     * @throws InvalidInterfaceException
2282
-     * @since 4.10.12.p
2283
-     */
2284
-    protected function getModelObjNodeGroupPersister()
2285
-    {
2286
-        if (! $this->model_obj_node_group_persister instanceof NodeGroupDao) {
2287
-            $this->model_obj_node_group_persister =
2288
-                $this->getLoader()->load('\EventEspresso\core\services\orm\tree_traversal\NodeGroupDao');
2289
-        }
2290
-        return $this->model_obj_node_group_persister;
2291
-    }
2292
-
2293
-
2294
-    /**
2295
-     * @param bool $preview_delete
2296
-     * @return void
2297
-     * @throws EE_Error
2298
-     */
2299
-    protected function _delete_events($preview_delete = true)
2300
-    {
2301
-        $event_ids = $this->getEventIdsFromRequest();
2302
-        if ($preview_delete) {
2303
-            $this->generateDeletionPreview($event_ids);
2304
-        } else {
2305
-            EEM_Event::instance()->delete_permanently([['EVT_ID' => ['IN', $event_ids]]]);
2306
-        }
2307
-    }
2308
-
2309
-
2310
-    /**
2311
-     * @param array $event_ids
2312
-     */
2313
-    protected function generateDeletionPreview(array $event_ids)
2314
-    {
2315
-        $event_ids = $this->cleanEventIds($event_ids);
2316
-        // Set a code we can use to reference this deletion task in the batch jobs and preview page.
2317
-        $deletion_job_code = $this->getModelObjNodeGroupPersister()->generateGroupCode();
2318
-        $return_url        = EE_Admin_Page::add_query_args_and_nonce(
2319
-            [
2320
-                'action'            => 'preview_deletion',
2321
-                'deletion_job_code' => $deletion_job_code,
2322
-            ],
2323
-            $this->_admin_base_url
2324
-        );
2325
-        EEH_URL::safeRedirectAndExit(
2326
-            EE_Admin_Page::add_query_args_and_nonce(
2327
-                [
2328
-                    'page'              => 'espresso_batch',
2329
-                    'batch'             => EED_Batch::batch_job,
2330
-                    'EVT_IDs'           => $event_ids,
2331
-                    'deletion_job_code' => $deletion_job_code,
2332
-                    'job_handler'       => urlencode('EventEspressoBatchRequest\JobHandlers\PreviewEventDeletion'),
2333
-                    'return_url'        => urlencode($return_url),
2334
-                ],
2335
-                admin_url()
2336
-            )
2337
-        );
2338
-    }
2339
-
2340
-
2341
-    /**
2342
-     * Checks for a POST submission
2343
-     *
2344
-     * @since 4.10.12.p
2345
-     */
2346
-    protected function confirmDeletion()
2347
-    {
2348
-        $deletion_redirect_logic =
2349
-            $this->getLoader()->getShared('\EventEspresso\core\domain\services\admin\events\data\ConfirmDeletion');
2350
-        $deletion_redirect_logic->handle($this->get_request_data(), $this->admin_base_url());
2351
-    }
2352
-
2353
-
2354
-    /**
2355
-     * A page for users to preview what exactly will be deleted, and confirm they want to delete it.
2356
-     *
2357
-     * @throws EE_Error
2358
-     * @since 4.10.12.p
2359
-     */
2360
-    protected function previewDeletion()
2361
-    {
2362
-        $preview_deletion_logic =
2363
-            $this->getLoader()->getShared('\EventEspresso\core\domain\services\admin\events\data\PreviewDeletion');
2364
-        $this->set_template_args($preview_deletion_logic->handle($this->get_request_data(), $this->admin_base_url()));
2365
-        $this->display_admin_page_with_no_sidebar();
2366
-    }
2367
-
2368
-
2369
-    /**
2370
-     * get total number of events
2371
-     *
2372
-     * @access public
2373
-     * @return int
2374
-     * @throws EE_Error
2375
-     * @throws EE_Error
2376
-     */
2377
-    public function total_events()
2378
-    {
2379
-        return EEM_Event::instance()->count(
2380
-            ['caps' => 'read_admin'],
2381
-            'EVT_ID',
2382
-            true
2383
-        );
2384
-    }
2385
-
2386
-
2387
-    /**
2388
-     * get total number of draft events
2389
-     *
2390
-     * @access public
2391
-     * @return int
2392
-     * @throws EE_Error
2393
-     * @throws EE_Error
2394
-     */
2395
-    public function total_events_draft()
2396
-    {
2397
-        return EEM_Event::instance()->count(
2398
-            [
2399
-                ['status' => ['IN', ['draft', 'auto-draft']]],
2400
-                'caps' => 'read_admin',
2401
-            ],
2402
-            'EVT_ID',
2403
-            true
2404
-        );
2405
-    }
2406
-
2407
-
2408
-    /**
2409
-     * get total number of trashed events
2410
-     *
2411
-     * @access public
2412
-     * @return int
2413
-     * @throws EE_Error
2414
-     * @throws EE_Error
2415
-     */
2416
-    public function total_trashed_events()
2417
-    {
2418
-        return EEM_Event::instance()->count(
2419
-            [
2420
-                ['status' => 'trash'],
2421
-                'caps' => 'read_admin',
2422
-            ],
2423
-            'EVT_ID',
2424
-            true
2425
-        );
2426
-    }
2427
-
2428
-
2429
-    /**
2430
-     *    _default_event_settings
2431
-     *    This generates the Default Settings Tab
2432
-     *
2433
-     * @return void
2434
-     * @throws DomainException
2435
-     * @throws EE_Error
2436
-     * @throws InvalidArgumentException
2437
-     * @throws InvalidDataTypeException
2438
-     * @throws InvalidInterfaceException
2439
-     */
2440
-    protected function _default_event_settings()
2441
-    {
2442
-        $this->_set_add_edit_form_tags('update_default_event_settings');
2443
-        $this->_set_publish_post_box_vars(null, false, false, null, false);
2444
-        $this->_template_args['admin_page_content'] = $this->_default_event_settings_form()->get_html();
2445
-        $this->display_admin_page_with_sidebar();
2446
-    }
2447
-
2448
-
2449
-    /**
2450
-     * Return the form for event settings.
2451
-     *
2452
-     * @return EE_Form_Section_Proper
2453
-     * @throws EE_Error
2454
-     */
2455
-    protected function _default_event_settings_form()
2456
-    {
2457
-        $registration_config              = EE_Registry::instance()->CFG->registration;
2458
-        $registration_stati_for_selection = EEM_Registration::reg_status_array(
2459
-        // exclude
2460
-            [
2461
-                EEM_Registration::status_id_cancelled,
2462
-                EEM_Registration::status_id_declined,
2463
-                EEM_Registration::status_id_incomplete,
2464
-                EEM_Registration::status_id_wait_list,
2465
-            ],
2466
-            true
2467
-        );
2468
-        // setup Advanced Editor ???
2469
-        if (
2470
-            $this->raw_req_action === 'default_event_settings'
2471
-            || $this->raw_req_action === 'update_default_event_settings'
2472
-        ) {
2473
-            $this->advanced_editor_admin_form = $this->loader->getShared(AdvancedEditorAdminFormSection::class);
2474
-        }
2475
-        return new EE_Form_Section_Proper(
2476
-            [
2477
-                'name'            => 'update_default_event_settings',
2478
-                'html_id'         => 'update_default_event_settings',
2479
-                'html_class'      => 'form-table',
2480
-                'layout_strategy' => new EE_Admin_Two_Column_Layout(),
2481
-                'subsections'     => apply_filters(
2482
-                    'FHEE__Events_Admin_Page___default_event_settings_form__form_subsections',
2483
-                    [
2484
-                        'default_reg_status'  => new EE_Select_Input(
2485
-                            $registration_stati_for_selection,
2486
-                            [
2487
-                                'default'         => isset($registration_config->default_STS_ID)
2488
-                                                     && array_key_exists(
2489
-                                                         $registration_config->default_STS_ID,
2490
-                                                         $registration_stati_for_selection
2491
-                                                     )
2492
-                                    ? sanitize_text_field($registration_config->default_STS_ID)
2493
-                                    : EEM_Registration::status_id_pending_payment,
2494
-                                'html_label_text' => esc_html__('Default Registration Status', 'event_espresso')
2495
-                                                     . EEH_Template::get_help_tab_link(
2496
-                                                         'default_settings_status_help_tab'
2497
-                                                     ),
2498
-                                'html_help_text'  => esc_html__(
2499
-                                    'This setting allows you to preselect what the default registration status setting is when creating an event.  Note that changing this setting does NOT retroactively apply it to existing events.',
2500
-                                    'event_espresso'
2501
-                                ),
2502
-                            ]
2503
-                        ),
2504
-                        'default_max_tickets' => new EE_Integer_Input(
2505
-                            [
2506
-                                'default'         => isset($registration_config->default_maximum_number_of_tickets)
2507
-                                    ? $registration_config->default_maximum_number_of_tickets
2508
-                                    : EEM_Event::get_default_additional_limit(),
2509
-                                'html_label_text' => esc_html__(
2510
-                                    'Default Maximum Tickets Allowed Per Order:',
2511
-                                    'event_espresso'
2512
-                                )
2513
-                                                     . EEH_Template::get_help_tab_link(
2514
-                                                         'default_maximum_tickets_help_tab"'
2515
-                                                     ),
2516
-                                'html_help_text'  => esc_html__(
2517
-                                    'This setting allows you to indicate what will be the default for the maximum number of tickets per order when creating new events.',
2518
-                                    'event_espresso'
2519
-                                ),
2520
-                            ]
2521
-                        ),
2522
-                    ]
2523
-                ),
2524
-            ]
2525
-        );
2526
-    }
2527
-
2528
-
2529
-    /**
2530
-     * @return void
2531
-     * @throws EE_Error
2532
-     * @throws InvalidArgumentException
2533
-     * @throws InvalidDataTypeException
2534
-     * @throws InvalidInterfaceException
2535
-     */
2536
-    protected function _update_default_event_settings()
2537
-    {
2538
-        $form = $this->_default_event_settings_form();
2539
-        if ($form->was_submitted()) {
2540
-            $form->receive_form_submission();
2541
-            if ($form->is_valid()) {
2542
-                $registration_config = EE_Registry::instance()->CFG->registration;
2543
-                $valid_data          = $form->valid_data();
2544
-                if (isset($valid_data['default_reg_status'])) {
2545
-                    $registration_config->default_STS_ID = $valid_data['default_reg_status'];
2546
-                }
2547
-                if (isset($valid_data['default_max_tickets'])) {
2548
-                    $registration_config->default_maximum_number_of_tickets = $valid_data['default_max_tickets'];
2549
-                }
2550
-                do_action(
2551
-                    'AHEE__Events_Admin_Page___update_default_event_settings',
2552
-                    $valid_data,
2553
-                    EE_Registry::instance()->CFG,
2554
-                    $this
2555
-                );
2556
-                // update because data was valid!
2557
-                EE_Registry::instance()->CFG->update_espresso_config();
2558
-                EE_Error::overwrite_success();
2559
-                EE_Error::add_success(
2560
-                    esc_html__('Default Event Settings were updated', 'event_espresso')
2561
-                );
2562
-            }
2563
-        }
2564
-        $this->_redirect_after_action(0, '', '', ['action' => 'default_event_settings'], true);
2565
-    }
2566
-
2567
-
2568
-    /*************        Templates        *************
2569
-     *
2570
-     * @throws EE_Error
2571
-     */
2572
-    protected function _template_settings()
2573
-    {
2574
-        $this->_admin_page_title              = esc_html__('Template Settings (Preview)', 'event_espresso');
2575
-        $this->_template_args['preview_img']  = '<img src="'
2576
-                                                . EVENTS_ASSETS_URL
2577
-                                                . '/images/'
2578
-                                                . 'caffeinated_template_features.jpg" alt="'
2579
-                                                . esc_attr__('Template Settings Preview screenshot', 'event_espresso')
2580
-                                                . '" />';
2581
-        $this->_template_args['preview_text'] = '<strong>'
2582
-                                                . esc_html__(
2583
-                                                    'Template Settings is a feature that is only available in the premium version of Event Espresso 4 which is available with a support license purchase on EventEspresso.com. Template Settings allow you to configure some of the appearance options for both the Event List and Event Details pages.',
2584
-                                                    'event_espresso'
2585
-                                                ) . '</strong>';
2586
-        $this->display_admin_caf_preview_page('template_settings_tab');
2587
-    }
2588
-
2589
-
2590
-    /** Event Category Stuff **/
2591
-    /**
2592
-     * set the _category property with the category object for the loaded page.
2593
-     *
2594
-     * @access private
2595
-     * @return void
2596
-     */
2597
-    private function _set_category_object()
2598
-    {
2599
-        if (isset($this->_category->id) && ! empty($this->_category->id)) {
2600
-            return;
2601
-        } //already have the category object so get out.
2602
-        // set default category object
2603
-        $this->_set_empty_category_object();
2604
-        // only set if we've got an id
2605
-        $category_ID = $this->request->getRequestParam('EVT_CAT_ID', 0, 'int');
2606
-        if (! $category_ID) {
2607
-            return;
2608
-        }
2609
-        $term = get_term($category_ID, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2610
-        if (! empty($term)) {
2611
-            $this->_category->category_name       = $term->name;
2612
-            $this->_category->category_identifier = $term->slug;
2613
-            $this->_category->category_desc       = $term->description;
2614
-            $this->_category->id                  = $term->term_id;
2615
-            $this->_category->parent              = $term->parent;
2616
-        }
2617
-    }
2618
-
2619
-
2620
-    /**
2621
-     * Clears out category properties.
2622
-     */
2623
-    private function _set_empty_category_object()
2624
-    {
2625
-        $this->_category                = new stdClass();
2626
-        $this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc = '';
2627
-        $this->_category->id            = $this->_category->parent = 0;
2628
-    }
2629
-
2630
-
2631
-    /**
2632
-     * @throws DomainException
2633
-     * @throws EE_Error
2634
-     * @throws InvalidArgumentException
2635
-     * @throws InvalidDataTypeException
2636
-     * @throws InvalidInterfaceException
2637
-     */
2638
-    protected function _category_list_table()
2639
-    {
2640
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2641
-        $this->_search_btn_label = esc_html__('Categories', 'event_espresso');
2642
-        $this->_admin_page_title .= ' ';
2643
-        $this->_admin_page_title .= $this->get_action_link_or_button(
2644
-            'add_category',
2645
-            'add_category',
2646
-            [],
2647
-            'add-new-h2'
2648
-        );
2649
-        $this->display_admin_list_table_page_with_sidebar();
2650
-    }
2651
-
2652
-
2653
-    /**
2654
-     * Output category details view.
2655
-     *
2656
-     * @throws EE_Error
2657
-     * @throws EE_Error
2658
-     */
2659
-    protected function _category_details($view)
2660
-    {
2661
-        // load formatter helper
2662
-        // load field generator helper
2663
-        $route = $view === 'edit' ? 'update_category' : 'insert_category';
2664
-        $this->_set_add_edit_form_tags($route);
2665
-        $this->_set_category_object();
2666
-        $id            = ! empty($this->_category->id) ? $this->_category->id : '';
2667
-        $delete_action = 'delete_category';
2668
-        // custom redirect
2669
-        $redirect = EE_Admin_Page::add_query_args_and_nonce(
2670
-            ['action' => 'category_list'],
2671
-            $this->_admin_base_url
2672
-        );
2673
-        $this->_set_publish_post_box_vars('EVT_CAT_ID', $id, $delete_action, $redirect);
2674
-        // take care of contents
2675
-        $this->_template_args['admin_page_content'] = $this->_category_details_content();
2676
-        $this->display_admin_page_with_sidebar();
2677
-    }
2678
-
2679
-
2680
-    /**
2681
-     * Output category details content.
2682
-     *
2683
-     * @throws DomainException
2684
-     */
2685
-    protected function _category_details_content()
2686
-    {
2687
-        $editor_args['category_desc'] = [
2688
-            'type'          => 'wp_editor',
2689
-            'value'         => EEH_Formatter::admin_format_content($this->_category->category_desc),
2690
-            'class'         => 'my_editor_custom',
2691
-            'wpeditor_args' => ['media_buttons' => false],
2692
-        ];
2693
-        $_wp_editor                   = $this->_generate_admin_form_fields($editor_args, 'array');
2694
-        $all_terms                    = get_terms(
2695
-            [EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY],
2696
-            ['hide_empty' => 0, 'exclude' => [$this->_category->id]]
2697
-        );
2698
-        // setup category select for term parents.
2699
-        $category_select_values[] = [
2700
-            'text' => esc_html__('No Parent', 'event_espresso'),
2701
-            'id'   => 0,
2702
-        ];
2703
-        foreach ($all_terms as $term) {
2704
-            $category_select_values[] = [
2705
-                'text' => $term->name,
2706
-                'id'   => $term->term_id,
2707
-            ];
2708
-        }
2709
-        $category_select = EEH_Form_Fields::select_input(
2710
-            'category_parent',
2711
-            $category_select_values,
2712
-            $this->_category->parent
2713
-        );
2714
-        $template_args   = [
2715
-            'category'                 => $this->_category,
2716
-            'category_select'          => $category_select,
2717
-            'unique_id_info_help_link' => $this->_get_help_tab_link('unique_id_info'),
2718
-            'category_desc_editor'     => $_wp_editor['category_desc']['field'],
2719
-            'disable'                  => '',
2720
-            'disabled_message'         => false,
2721
-        ];
2722
-        $template        = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
2723
-        return EEH_Template::display_template($template, $template_args, true);
2724
-    }
2725
-
2726
-
2727
-    /**
2728
-     * Handles deleting categories.
2729
-     *
2730
-     * @throws EE_Error
2731
-     */
2732
-    protected function _delete_categories()
2733
-    {
2734
-        $category_IDs = $this->request->getRequestParam('EVT_CAT_ID', 0, 'int', true);
2735
-        foreach ($category_IDs as $category_ID) {
2736
-            $this->_delete_category($category_ID);
2737
-        }
2738
-        // doesn't matter what page we're coming from... we're going to the same place after delete.
2739
-        $query_args = [
2740
-            'action' => 'category_list',
2741
-        ];
2742
-        $this->_redirect_after_action(0, '', '', $query_args);
2743
-    }
2744
-
2745
-
2746
-    /**
2747
-     * Handles deleting specific category.
2748
-     *
2749
-     * @param int $cat_id
2750
-     */
2751
-    protected function _delete_category($cat_id)
2752
-    {
2753
-        $cat_id = absint($cat_id);
2754
-        wp_delete_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2755
-    }
2756
-
2757
-
2758
-    /**
2759
-     * Handles triggering the update or insertion of a new category.
2760
-     *
2761
-     * @param bool $new_category true means we're triggering the insert of a new category.
2762
-     * @throws EE_Error
2763
-     * @throws EE_Error
2764
-     */
2765
-    protected function _insert_or_update_category($new_category)
2766
-    {
2767
-        $cat_id  = $new_category ? $this->_insert_category() : $this->_insert_category(true);
2768
-        $success = 0; // we already have a success message so lets not send another.
2769
-        if ($cat_id) {
2770
-            $query_args = [
2771
-                'action'     => 'edit_category',
2772
-                'EVT_CAT_ID' => $cat_id,
2773
-            ];
2774
-        } else {
2775
-            $query_args = ['action' => 'add_category'];
2776
-        }
2777
-        $this->_redirect_after_action($success, '', '', $query_args, true);
2778
-    }
2779
-
2780
-
2781
-    /**
2782
-     * Inserts or updates category
2783
-     *
2784
-     * @param bool $update (true indicates we're updating a category).
2785
-     * @return bool|mixed|string
2786
-     */
2787
-    private function _insert_category($update = false)
2788
-    {
2789
-        $category_ID         = $update ? $this->request->getRequestParam('EVT_CAT_ID', 0, 'int') : 0;
2790
-        $category_name       = $this->request->getRequestParam('category_name', '');
2791
-        $category_desc       = $this->request->getRequestParam('category_desc', '');
2792
-        $category_parent     = $this->request->getRequestParam('category_parent', 0, 'int');
2793
-        $category_identifier = $this->request->getRequestParam('category_identifier', '');
2794
-
2795
-        if (empty($category_name)) {
2796
-            $msg = esc_html__('You must add a name for the category.', 'event_espresso');
2797
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2798
-            return false;
2799
-        }
2800
-        $term_args = [
2801
-            'name'        => $category_name,
2802
-            'description' => $category_desc,
2803
-            'parent'      => $category_parent,
2804
-        ];
2805
-        // was the category_identifier input disabled?
2806
-        if ($category_identifier) {
2807
-            $term_args['slug'] = $category_identifier;
2808
-        }
2809
-        $insert_ids = $update
2810
-            ? wp_update_term($category_ID, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args)
2811
-            : wp_insert_term($category_name, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args);
2812
-        if (! is_array($insert_ids)) {
2813
-            $msg = esc_html__(
2814
-                'An error occurred and the category has not been saved to the database.',
2815
-                'event_espresso'
2816
-            );
2817
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2818
-        } else {
2819
-            $category_ID = $insert_ids['term_id'];
2820
-            $msg         = sprintf(
2821
-                esc_html__('The category %s was successfully saved', 'event_espresso'),
2822
-                $category_name
2823
-            );
2824
-            EE_Error::add_success($msg);
2825
-        }
2826
-        return $category_ID;
2827
-    }
2828
-
2829
-
2830
-    /**
2831
-     * Gets categories or count of categories matching the arguments in the request.
2832
-     *
2833
-     * @param int  $per_page
2834
-     * @param int  $current_page
2835
-     * @param bool $count
2836
-     * @return EE_Term_Taxonomy[]|int
2837
-     * @throws EE_Error
2838
-     */
2839
-    public function get_categories($per_page = 10, $current_page = 1, $count = false)
2840
-    {
2841
-        // testing term stuff
2842
-        $orderby     = $this->request->getRequestParam('orderby', 'Term.term_id');
2843
-        $order       = $this->request->getRequestParam('order', 'DESC');
2844
-        $limit       = ($current_page - 1) * $per_page;
2845
-        $where       = ['taxonomy' => EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY];
2846
-        $search_term = $this->request->getRequestParam('s');
2847
-        if ($search_term) {
2848
-            $search_term = '%' . $search_term . '%';
2849
-            $where['OR'] = [
2850
-                'Term.name'   => ['LIKE', $search_term],
2851
-                'description' => ['LIKE', $search_term],
2852
-            ];
2853
-        }
2854
-        $query_params = [
2855
-            $where,
2856
-            'order_by'   => [$orderby => $order],
2857
-            'limit'      => $limit . ',' . $per_page,
2858
-            'force_join' => ['Term'],
2859
-        ];
2860
-        return $count
2861
-            ? EEM_Term_Taxonomy::instance()->count($query_params, 'term_id')
2862
-            : EEM_Term_Taxonomy::instance()->get_all($query_params);
2863
-    }
2864
-
2865
-    /* end category stuff */
2866
-
2867
-
2868
-    /**************/
2869
-
2870
-
2871
-    /**
2872
-     * Callback for the `ee_save_timezone_setting` ajax action.
2873
-     *
2874
-     * @throws EE_Error
2875
-     * @throws InvalidArgumentException
2876
-     * @throws InvalidDataTypeException
2877
-     * @throws InvalidInterfaceException
2878
-     */
2879
-    public function saveTimezoneString()
2880
-    {
2881
-        $timezone_string = $this->request->getRequestParam('timezone_selected');
2882
-        if (empty($timezone_string) || ! EEH_DTT_Helper::validate_timezone($timezone_string, false)) {
2883
-            EE_Error::add_error(
2884
-                esc_html__('An invalid timezone string submitted.', 'event_espresso'),
2885
-                __FILE__,
2886
-                __FUNCTION__,
2887
-                __LINE__
2888
-            );
2889
-            $this->_template_args['error'] = true;
2890
-            $this->_return_json();
2891
-        }
2892
-
2893
-        update_option('timezone_string', $timezone_string);
2894
-        EE_Error::add_success(
2895
-            esc_html__('Your timezone string was updated.', 'event_espresso')
2896
-        );
2897
-        $this->_template_args['success'] = true;
2898
-        $this->_return_json(true, ['action' => 'create_new']);
2899
-    }
2900
-
2901
-
2902
-    /**
2903 2570
      * @throws EE_Error
2904
-     * @deprecated 4.10.25.p
2905 2571
      */
2906
-    public function save_timezonestring_setting()
2907
-    {
2908
-        $this->saveTimezoneString();
2909
-    }
2572
+	protected function _template_settings()
2573
+	{
2574
+		$this->_admin_page_title              = esc_html__('Template Settings (Preview)', 'event_espresso');
2575
+		$this->_template_args['preview_img']  = '<img src="'
2576
+												. EVENTS_ASSETS_URL
2577
+												. '/images/'
2578
+												. 'caffeinated_template_features.jpg" alt="'
2579
+												. esc_attr__('Template Settings Preview screenshot', 'event_espresso')
2580
+												. '" />';
2581
+		$this->_template_args['preview_text'] = '<strong>'
2582
+												. esc_html__(
2583
+													'Template Settings is a feature that is only available in the premium version of Event Espresso 4 which is available with a support license purchase on EventEspresso.com. Template Settings allow you to configure some of the appearance options for both the Event List and Event Details pages.',
2584
+													'event_espresso'
2585
+												) . '</strong>';
2586
+		$this->display_admin_caf_preview_page('template_settings_tab');
2587
+	}
2588
+
2589
+
2590
+	/** Event Category Stuff **/
2591
+	/**
2592
+	 * set the _category property with the category object for the loaded page.
2593
+	 *
2594
+	 * @access private
2595
+	 * @return void
2596
+	 */
2597
+	private function _set_category_object()
2598
+	{
2599
+		if (isset($this->_category->id) && ! empty($this->_category->id)) {
2600
+			return;
2601
+		} //already have the category object so get out.
2602
+		// set default category object
2603
+		$this->_set_empty_category_object();
2604
+		// only set if we've got an id
2605
+		$category_ID = $this->request->getRequestParam('EVT_CAT_ID', 0, 'int');
2606
+		if (! $category_ID) {
2607
+			return;
2608
+		}
2609
+		$term = get_term($category_ID, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2610
+		if (! empty($term)) {
2611
+			$this->_category->category_name       = $term->name;
2612
+			$this->_category->category_identifier = $term->slug;
2613
+			$this->_category->category_desc       = $term->description;
2614
+			$this->_category->id                  = $term->term_id;
2615
+			$this->_category->parent              = $term->parent;
2616
+		}
2617
+	}
2618
+
2619
+
2620
+	/**
2621
+	 * Clears out category properties.
2622
+	 */
2623
+	private function _set_empty_category_object()
2624
+	{
2625
+		$this->_category                = new stdClass();
2626
+		$this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc = '';
2627
+		$this->_category->id            = $this->_category->parent = 0;
2628
+	}
2629
+
2630
+
2631
+	/**
2632
+	 * @throws DomainException
2633
+	 * @throws EE_Error
2634
+	 * @throws InvalidArgumentException
2635
+	 * @throws InvalidDataTypeException
2636
+	 * @throws InvalidInterfaceException
2637
+	 */
2638
+	protected function _category_list_table()
2639
+	{
2640
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2641
+		$this->_search_btn_label = esc_html__('Categories', 'event_espresso');
2642
+		$this->_admin_page_title .= ' ';
2643
+		$this->_admin_page_title .= $this->get_action_link_or_button(
2644
+			'add_category',
2645
+			'add_category',
2646
+			[],
2647
+			'add-new-h2'
2648
+		);
2649
+		$this->display_admin_list_table_page_with_sidebar();
2650
+	}
2651
+
2652
+
2653
+	/**
2654
+	 * Output category details view.
2655
+	 *
2656
+	 * @throws EE_Error
2657
+	 * @throws EE_Error
2658
+	 */
2659
+	protected function _category_details($view)
2660
+	{
2661
+		// load formatter helper
2662
+		// load field generator helper
2663
+		$route = $view === 'edit' ? 'update_category' : 'insert_category';
2664
+		$this->_set_add_edit_form_tags($route);
2665
+		$this->_set_category_object();
2666
+		$id            = ! empty($this->_category->id) ? $this->_category->id : '';
2667
+		$delete_action = 'delete_category';
2668
+		// custom redirect
2669
+		$redirect = EE_Admin_Page::add_query_args_and_nonce(
2670
+			['action' => 'category_list'],
2671
+			$this->_admin_base_url
2672
+		);
2673
+		$this->_set_publish_post_box_vars('EVT_CAT_ID', $id, $delete_action, $redirect);
2674
+		// take care of contents
2675
+		$this->_template_args['admin_page_content'] = $this->_category_details_content();
2676
+		$this->display_admin_page_with_sidebar();
2677
+	}
2678
+
2679
+
2680
+	/**
2681
+	 * Output category details content.
2682
+	 *
2683
+	 * @throws DomainException
2684
+	 */
2685
+	protected function _category_details_content()
2686
+	{
2687
+		$editor_args['category_desc'] = [
2688
+			'type'          => 'wp_editor',
2689
+			'value'         => EEH_Formatter::admin_format_content($this->_category->category_desc),
2690
+			'class'         => 'my_editor_custom',
2691
+			'wpeditor_args' => ['media_buttons' => false],
2692
+		];
2693
+		$_wp_editor                   = $this->_generate_admin_form_fields($editor_args, 'array');
2694
+		$all_terms                    = get_terms(
2695
+			[EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY],
2696
+			['hide_empty' => 0, 'exclude' => [$this->_category->id]]
2697
+		);
2698
+		// setup category select for term parents.
2699
+		$category_select_values[] = [
2700
+			'text' => esc_html__('No Parent', 'event_espresso'),
2701
+			'id'   => 0,
2702
+		];
2703
+		foreach ($all_terms as $term) {
2704
+			$category_select_values[] = [
2705
+				'text' => $term->name,
2706
+				'id'   => $term->term_id,
2707
+			];
2708
+		}
2709
+		$category_select = EEH_Form_Fields::select_input(
2710
+			'category_parent',
2711
+			$category_select_values,
2712
+			$this->_category->parent
2713
+		);
2714
+		$template_args   = [
2715
+			'category'                 => $this->_category,
2716
+			'category_select'          => $category_select,
2717
+			'unique_id_info_help_link' => $this->_get_help_tab_link('unique_id_info'),
2718
+			'category_desc_editor'     => $_wp_editor['category_desc']['field'],
2719
+			'disable'                  => '',
2720
+			'disabled_message'         => false,
2721
+		];
2722
+		$template        = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
2723
+		return EEH_Template::display_template($template, $template_args, true);
2724
+	}
2725
+
2726
+
2727
+	/**
2728
+	 * Handles deleting categories.
2729
+	 *
2730
+	 * @throws EE_Error
2731
+	 */
2732
+	protected function _delete_categories()
2733
+	{
2734
+		$category_IDs = $this->request->getRequestParam('EVT_CAT_ID', 0, 'int', true);
2735
+		foreach ($category_IDs as $category_ID) {
2736
+			$this->_delete_category($category_ID);
2737
+		}
2738
+		// doesn't matter what page we're coming from... we're going to the same place after delete.
2739
+		$query_args = [
2740
+			'action' => 'category_list',
2741
+		];
2742
+		$this->_redirect_after_action(0, '', '', $query_args);
2743
+	}
2744
+
2745
+
2746
+	/**
2747
+	 * Handles deleting specific category.
2748
+	 *
2749
+	 * @param int $cat_id
2750
+	 */
2751
+	protected function _delete_category($cat_id)
2752
+	{
2753
+		$cat_id = absint($cat_id);
2754
+		wp_delete_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2755
+	}
2756
+
2757
+
2758
+	/**
2759
+	 * Handles triggering the update or insertion of a new category.
2760
+	 *
2761
+	 * @param bool $new_category true means we're triggering the insert of a new category.
2762
+	 * @throws EE_Error
2763
+	 * @throws EE_Error
2764
+	 */
2765
+	protected function _insert_or_update_category($new_category)
2766
+	{
2767
+		$cat_id  = $new_category ? $this->_insert_category() : $this->_insert_category(true);
2768
+		$success = 0; // we already have a success message so lets not send another.
2769
+		if ($cat_id) {
2770
+			$query_args = [
2771
+				'action'     => 'edit_category',
2772
+				'EVT_CAT_ID' => $cat_id,
2773
+			];
2774
+		} else {
2775
+			$query_args = ['action' => 'add_category'];
2776
+		}
2777
+		$this->_redirect_after_action($success, '', '', $query_args, true);
2778
+	}
2779
+
2780
+
2781
+	/**
2782
+	 * Inserts or updates category
2783
+	 *
2784
+	 * @param bool $update (true indicates we're updating a category).
2785
+	 * @return bool|mixed|string
2786
+	 */
2787
+	private function _insert_category($update = false)
2788
+	{
2789
+		$category_ID         = $update ? $this->request->getRequestParam('EVT_CAT_ID', 0, 'int') : 0;
2790
+		$category_name       = $this->request->getRequestParam('category_name', '');
2791
+		$category_desc       = $this->request->getRequestParam('category_desc', '');
2792
+		$category_parent     = $this->request->getRequestParam('category_parent', 0, 'int');
2793
+		$category_identifier = $this->request->getRequestParam('category_identifier', '');
2794
+
2795
+		if (empty($category_name)) {
2796
+			$msg = esc_html__('You must add a name for the category.', 'event_espresso');
2797
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2798
+			return false;
2799
+		}
2800
+		$term_args = [
2801
+			'name'        => $category_name,
2802
+			'description' => $category_desc,
2803
+			'parent'      => $category_parent,
2804
+		];
2805
+		// was the category_identifier input disabled?
2806
+		if ($category_identifier) {
2807
+			$term_args['slug'] = $category_identifier;
2808
+		}
2809
+		$insert_ids = $update
2810
+			? wp_update_term($category_ID, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args)
2811
+			: wp_insert_term($category_name, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args);
2812
+		if (! is_array($insert_ids)) {
2813
+			$msg = esc_html__(
2814
+				'An error occurred and the category has not been saved to the database.',
2815
+				'event_espresso'
2816
+			);
2817
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2818
+		} else {
2819
+			$category_ID = $insert_ids['term_id'];
2820
+			$msg         = sprintf(
2821
+				esc_html__('The category %s was successfully saved', 'event_espresso'),
2822
+				$category_name
2823
+			);
2824
+			EE_Error::add_success($msg);
2825
+		}
2826
+		return $category_ID;
2827
+	}
2828
+
2829
+
2830
+	/**
2831
+	 * Gets categories or count of categories matching the arguments in the request.
2832
+	 *
2833
+	 * @param int  $per_page
2834
+	 * @param int  $current_page
2835
+	 * @param bool $count
2836
+	 * @return EE_Term_Taxonomy[]|int
2837
+	 * @throws EE_Error
2838
+	 */
2839
+	public function get_categories($per_page = 10, $current_page = 1, $count = false)
2840
+	{
2841
+		// testing term stuff
2842
+		$orderby     = $this->request->getRequestParam('orderby', 'Term.term_id');
2843
+		$order       = $this->request->getRequestParam('order', 'DESC');
2844
+		$limit       = ($current_page - 1) * $per_page;
2845
+		$where       = ['taxonomy' => EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY];
2846
+		$search_term = $this->request->getRequestParam('s');
2847
+		if ($search_term) {
2848
+			$search_term = '%' . $search_term . '%';
2849
+			$where['OR'] = [
2850
+				'Term.name'   => ['LIKE', $search_term],
2851
+				'description' => ['LIKE', $search_term],
2852
+			];
2853
+		}
2854
+		$query_params = [
2855
+			$where,
2856
+			'order_by'   => [$orderby => $order],
2857
+			'limit'      => $limit . ',' . $per_page,
2858
+			'force_join' => ['Term'],
2859
+		];
2860
+		return $count
2861
+			? EEM_Term_Taxonomy::instance()->count($query_params, 'term_id')
2862
+			: EEM_Term_Taxonomy::instance()->get_all($query_params);
2863
+	}
2864
+
2865
+	/* end category stuff */
2866
+
2867
+
2868
+	/**************/
2869
+
2870
+
2871
+	/**
2872
+	 * Callback for the `ee_save_timezone_setting` ajax action.
2873
+	 *
2874
+	 * @throws EE_Error
2875
+	 * @throws InvalidArgumentException
2876
+	 * @throws InvalidDataTypeException
2877
+	 * @throws InvalidInterfaceException
2878
+	 */
2879
+	public function saveTimezoneString()
2880
+	{
2881
+		$timezone_string = $this->request->getRequestParam('timezone_selected');
2882
+		if (empty($timezone_string) || ! EEH_DTT_Helper::validate_timezone($timezone_string, false)) {
2883
+			EE_Error::add_error(
2884
+				esc_html__('An invalid timezone string submitted.', 'event_espresso'),
2885
+				__FILE__,
2886
+				__FUNCTION__,
2887
+				__LINE__
2888
+			);
2889
+			$this->_template_args['error'] = true;
2890
+			$this->_return_json();
2891
+		}
2892
+
2893
+		update_option('timezone_string', $timezone_string);
2894
+		EE_Error::add_success(
2895
+			esc_html__('Your timezone string was updated.', 'event_espresso')
2896
+		);
2897
+		$this->_template_args['success'] = true;
2898
+		$this->_return_json(true, ['action' => 'create_new']);
2899
+	}
2900
+
2901
+
2902
+	/**
2903
+	 * @throws EE_Error
2904
+	 * @deprecated 4.10.25.p
2905
+	 */
2906
+	public function save_timezonestring_setting()
2907
+	{
2908
+		$this->saveTimezoneString();
2909
+	}
2910 2910
 }
Please login to merge, or discard this patch.
languages/event_espresso-translations-js.php 1 patch
Spacing   +700 added lines, -700 removed lines patch added patch discarded remove patch
@@ -2,137 +2,137 @@  discard block
 block discarded – undo
2 2
 /* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */
3 3
 $generated_i18n_strings = array(
4 4
 	// Reference: packages/ui-components/src/Pagination/constants.ts:6
5
-	__( '2', 'event_espresso' ),
5
+	__('2', 'event_espresso'),
6 6
 
7 7
 	// Reference: packages/ui-components/src/Pagination/constants.ts:7
8
-	__( '6', 'event_espresso' ),
8
+	__('6', 'event_espresso'),
9 9
 
10 10
 	// Reference: packages/ui-components/src/Pagination/constants.ts:8
11
-	__( '12', 'event_espresso' ),
11
+	__('12', 'event_espresso'),
12 12
 
13 13
 	// Reference: packages/ui-components/src/Pagination/constants.ts:9
14
-	__( '24', 'event_espresso' ),
14
+	__('24', 'event_espresso'),
15 15
 
16 16
 	// Reference: packages/ui-components/src/Pagination/constants.ts:10
17
-	__( '48', 'event_espresso' ),
17
+	__('48', 'event_espresso'),
18 18
 
19 19
 	// Reference: domains/core/admin/blocks/src/components/AvatarImage.tsx:27
20
-	__( 'contact avatar', 'event_espresso' ),
20
+	__('contact avatar', 'event_espresso'),
21 21
 
22 22
 	// Reference: domains/core/admin/blocks/src/components/OrderByControl.tsx:12
23
-	__( 'Order by', 'event_espresso' ),
23
+	__('Order by', 'event_espresso'),
24 24
 
25 25
 	// Reference: domains/core/admin/blocks/src/components/RegStatusControl.tsx:17
26 26
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectStatus.tsx:13
27
-	__( 'Select Registration Status', 'event_espresso' ),
27
+	__('Select Registration Status', 'event_espresso'),
28 28
 
29 29
 	// Reference: domains/core/admin/blocks/src/components/SortOrderControl.tsx:14
30
-	__( 'Ascending', 'event_espresso' ),
30
+	__('Ascending', 'event_espresso'),
31 31
 
32 32
 	// Reference: domains/core/admin/blocks/src/components/SortOrderControl.tsx:18
33
-	__( 'Descending', 'event_espresso' ),
33
+	__('Descending', 'event_espresso'),
34 34
 
35 35
 	// Reference: domains/core/admin/blocks/src/components/SortOrderControl.tsx:24
36
-	__( 'Sort order:', 'event_espresso' ),
36
+	__('Sort order:', 'event_espresso'),
37 37
 
38 38
 	// Reference: domains/core/admin/blocks/src/event-attendees/AttendeesDisplay.tsx:41
39
-	__( 'There was some error fetching attendees list', 'event_espresso' ),
39
+	__('There was some error fetching attendees list', 'event_espresso'),
40 40
 
41 41
 	// Reference: domains/core/admin/blocks/src/event-attendees/AttendeesDisplay.tsx:47
42
-	__( 'To get started, select what event you want to show attendees from in the block settings.', 'event_espresso' ),
42
+	__('To get started, select what event you want to show attendees from in the block settings.', 'event_espresso'),
43 43
 
44 44
 	// Reference: domains/core/admin/blocks/src/event-attendees/AttendeesDisplay.tsx:53
45
-	__( 'There are no attendees for selected options.', 'event_espresso' ),
45
+	__('There are no attendees for selected options.', 'event_espresso'),
46 46
 
47 47
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/ArchiveSettings.tsx:12
48
-	__( 'Display on Archives', 'event_espresso' ),
48
+	__('Display on Archives', 'event_espresso'),
49 49
 
50 50
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/ArchiveSettings.tsx:17
51
-	__( 'Attendees are shown whenever this post is listed in an archive view.', 'event_espresso' ),
51
+	__('Attendees are shown whenever this post is listed in an archive view.', 'event_espresso'),
52 52
 
53 53
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/ArchiveSettings.tsx:18
54
-	__( 'Attendees are hidden whenever this post is listed in an archive view.', 'event_espresso' ),
54
+	__('Attendees are hidden whenever this post is listed in an archive view.', 'event_espresso'),
55 55
 
56 56
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/AttendeeLimit.tsx:29
57
-	__( 'Number of Attendees to Display:', 'event_espresso' ),
57
+	__('Number of Attendees to Display:', 'event_espresso'),
58 58
 
59 59
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/AttendeeLimit.tsx:34
60 60
 	/* translators: %d attendees count */
61
-	_n_noop( 'Used to adjust the number of attendees displayed (There is %d total attendee for the current filter settings).', 'Used to adjust the number of attendees displayed (There are %d total attendees for the current filter settings).', 'event_espresso' ),
61
+	_n_noop('Used to adjust the number of attendees displayed (There is %d total attendee for the current filter settings).', 'Used to adjust the number of attendees displayed (There are %d total attendees for the current filter settings).', 'event_espresso'),
62 62
 
63 63
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/GravatarSettings.tsx:27
64
-	__( 'Display Gravatar', 'event_espresso' ),
64
+	__('Display Gravatar', 'event_espresso'),
65 65
 
66 66
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/GravatarSettings.tsx:32
67
-	__( 'Gravatar images are shown for each attendee.', 'event_espresso' ),
67
+	__('Gravatar images are shown for each attendee.', 'event_espresso'),
68 68
 
69 69
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/GravatarSettings.tsx:33
70
-	__( 'No gravatar images are shown for each attendee.', 'event_espresso' ),
70
+	__('No gravatar images are shown for each attendee.', 'event_espresso'),
71 71
 
72 72
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/GravatarSettings.tsx:38
73
-	__( 'Size of Gravatar', 'event_espresso' ),
73
+	__('Size of Gravatar', 'event_espresso'),
74 74
 
75 75
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectDatetime.tsx:22
76
-	__( 'Select Datetime', 'event_espresso' ),
76
+	__('Select Datetime', 'event_espresso'),
77 77
 
78 78
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectEvent.tsx:22
79 79
 	// Reference: domains/core/admin/blocks/src/event/controls/SelectEvent.tsx:22
80
-	__( 'Select Event', 'event_espresso' ),
80
+	__('Select Event', 'event_espresso'),
81 81
 
82 82
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:11
83
-	__( 'Attendee id', 'event_espresso' ),
83
+	__('Attendee id', 'event_espresso'),
84 84
 
85 85
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:15
86
-	__( 'Last name only', 'event_espresso' ),
86
+	__('Last name only', 'event_espresso'),
87 87
 
88 88
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:19
89
-	__( 'First name only', 'event_espresso' ),
89
+	__('First name only', 'event_espresso'),
90 90
 
91 91
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:23
92
-	__( 'First, then Last name', 'event_espresso' ),
92
+	__('First, then Last name', 'event_espresso'),
93 93
 
94 94
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:27
95
-	__( 'Last, then First name', 'event_espresso' ),
95
+	__('Last, then First name', 'event_espresso'),
96 96
 
97 97
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:41
98
-	__( 'Order Attendees by:', 'event_espresso' ),
98
+	__('Order Attendees by:', 'event_espresso'),
99 99
 
100 100
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectTicket.tsx:22
101
-	__( 'Select Ticket', 'event_espresso' ),
101
+	__('Select Ticket', 'event_espresso'),
102 102
 
103 103
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/index.tsx:21
104
-	__( 'Filter By Settings', 'event_espresso' ),
104
+	__('Filter By Settings', 'event_espresso'),
105 105
 
106 106
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/index.tsx:36
107
-	__( 'Gravatar Setttings', 'event_espresso' ),
107
+	__('Gravatar Setttings', 'event_espresso'),
108 108
 
109 109
 	// Reference: domains/core/admin/blocks/src/event-attendees/controls/index.tsx:39
110
-	__( 'Archive Settings', 'event_espresso' ),
110
+	__('Archive Settings', 'event_espresso'),
111 111
 
112 112
 	// Reference: domains/core/admin/blocks/src/event-attendees/index.tsx:10
113
-	__( 'Event Attendees', 'event_espresso' ),
113
+	__('Event Attendees', 'event_espresso'),
114 114
 
115 115
 	// Reference: domains/core/admin/blocks/src/event-attendees/index.tsx:11
116
-	__( 'Displays a list of people that have registered for the specified event', 'event_espresso' ),
116
+	__('Displays a list of people that have registered for the specified event', 'event_espresso'),
117 117
 
118 118
 	// Reference: domains/core/admin/blocks/src/event-attendees/index.tsx:14
119 119
 	// Reference: domains/core/admin/blocks/src/event/index.tsx:12
120 120
 	// Reference: packages/edtr-services/src/constants.ts:25
121
-	__( 'event', 'event_espresso' ),
121
+	__('event', 'event_espresso'),
122 122
 
123 123
 	// Reference: domains/core/admin/blocks/src/event-attendees/index.tsx:14
124
-	__( 'attendees', 'event_espresso' ),
124
+	__('attendees', 'event_espresso'),
125 125
 
126 126
 	// Reference: domains/core/admin/blocks/src/event-attendees/index.tsx:14
127
-	__( 'list', 'event_espresso' ),
127
+	__('list', 'event_espresso'),
128 128
 
129 129
 	// Reference: domains/core/admin/blocks/src/event/DisplayField.tsx:41
130
-	__( 'An unknown error occurred while fetching event details.', 'event_espresso' ),
130
+	__('An unknown error occurred while fetching event details.', 'event_espresso'),
131 131
 
132 132
 	// Reference: domains/core/admin/blocks/src/event/controls/SelectField.tsx:10
133 133
 	// Reference: domains/core/admin/blocks/src/services/utils.ts:24
134 134
 	// Reference: packages/utils/src/list/index.ts:14
135
-	__( 'Select…', 'event_espresso' ),
135
+	__('Select…', 'event_espresso'),
136 136
 
137 137
 	// Reference: domains/core/admin/blocks/src/event/controls/SelectField.tsx:15
138 138
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:75
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:97
142 142
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:49
143 143
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:40
144
-	__( 'Name', 'event_espresso' ),
144
+	__('Name', 'event_espresso'),
145 145
 
146 146
 	// Reference: domains/core/admin/blocks/src/event/controls/SelectField.tsx:19
147 147
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:80
@@ -149,401 +149,401 @@  discard block
 block discarded – undo
149 149
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:102
150 150
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:55
151 151
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:47
152
-	__( 'Description', 'event_espresso' ),
152
+	__('Description', 'event_espresso'),
153 153
 
154 154
 	// Reference: domains/core/admin/blocks/src/event/controls/SelectField.tsx:23
155
-	__( 'Short description', 'event_espresso' ),
155
+	__('Short description', 'event_espresso'),
156 156
 
157 157
 	// Reference: domains/core/admin/blocks/src/event/controls/SelectField.tsx:35
158
-	__( 'Select Field', 'event_espresso' ),
158
+	__('Select Field', 'event_espresso'),
159 159
 
160 160
 	// Reference: domains/core/admin/blocks/src/event/controls/index.tsx:27
161
-	__( 'Text Color', 'event_espresso' ),
161
+	__('Text Color', 'event_espresso'),
162 162
 
163 163
 	// Reference: domains/core/admin/blocks/src/event/controls/index.tsx:32
164
-	__( 'Background Color', 'event_espresso' ),
164
+	__('Background Color', 'event_espresso'),
165 165
 
166 166
 	// Reference: domains/core/admin/blocks/src/event/controls/index.tsx:41
167 167
 	// Reference: packages/form-builder/src/FormElement/Tabs/FormElementTabs.tsx:22
168 168
 	// Reference: packages/form-builder/src/FormSection/Tabs/FormSectionTabs.tsx:21
169
-	__( 'Settings', 'event_espresso' ),
169
+	__('Settings', 'event_espresso'),
170 170
 
171 171
 	// Reference: domains/core/admin/blocks/src/event/controls/index.tsx:45
172
-	__( 'Typography', 'event_espresso' ),
172
+	__('Typography', 'event_espresso'),
173 173
 
174 174
 	// Reference: domains/core/admin/blocks/src/event/controls/index.tsx:48
175
-	__( 'Color', 'event_espresso' ),
175
+	__('Color', 'event_espresso'),
176 176
 
177 177
 	// Reference: domains/core/admin/blocks/src/event/index.tsx:12
178
-	__( 'field', 'event_espresso' ),
178
+	__('field', 'event_espresso'),
179 179
 
180 180
 	// Reference: domains/core/admin/blocks/src/event/index.tsx:8
181
-	__( 'Event Field', 'event_espresso' ),
181
+	__('Event Field', 'event_espresso'),
182 182
 
183 183
 	// Reference: domains/core/admin/blocks/src/event/index.tsx:9
184
-	__( 'Displays the selected field of an event', 'event_espresso' ),
184
+	__('Displays the selected field of an event', 'event_espresso'),
185 185
 
186 186
 	// Reference: domains/core/admin/blocks/src/services/utils.ts:17
187
-	__( 'Error', 'event_espresso' ),
187
+	__('Error', 'event_espresso'),
188 188
 
189 189
 	// Reference: domains/core/admin/blocks/src/services/utils.ts:9
190
-	__( 'Loading…', 'event_espresso' ),
190
+	__('Loading…', 'event_espresso'),
191 191
 
192 192
 	// Reference: domains/core/admin/eventEditor/src/ui/EventDescription.tsx:33
193
-	__( 'Event Description', 'event_espresso' ),
193
+	__('Event Description', 'event_espresso'),
194 194
 
195 195
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/ActiveStatus.tsx:29
196
-	__( 'Active status', 'event_espresso' ),
196
+	__('Active status', 'event_espresso'),
197 197
 
198 198
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/AltRegPage.tsx:12
199
-	__( 'Alternative Registration Page', 'event_espresso' ),
199
+	__('Alternative Registration Page', 'event_espresso'),
200 200
 
201 201
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/DefaultRegistrationStatus.tsx:26
202
-	__( 'Default Registration Status', 'event_espresso' ),
202
+	__('Default Registration Status', 'event_espresso'),
203 203
 
204 204
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/Donations.tsx:8
205
-	__( 'Donations Enabled', 'event_espresso' ),
205
+	__('Donations Enabled', 'event_espresso'),
206 206
 
207 207
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/Donations.tsx:8
208
-	__( 'Donations Disabled', 'event_espresso' ),
208
+	__('Donations Disabled', 'event_espresso'),
209 209
 
210 210
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/EventManager.tsx:16
211
-	__( 'Event Manager', 'event_espresso' ),
211
+	__('Event Manager', 'event_espresso'),
212 212
 
213 213
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/EventPhoneNumber.tsx:15
214
-	__( 'Event Phone Number', 'event_espresso' ),
214
+	__('Event Phone Number', 'event_espresso'),
215 215
 
216 216
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/MaxRegistrations.tsx:13
217
-	__( 'Max Registrations per Transaction', 'event_espresso' ),
217
+	__('Max Registrations per Transaction', 'event_espresso'),
218 218
 
219 219
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:8
220
-	__( 'Ticket Selector Enabled', 'event_espresso' ),
220
+	__('Ticket Selector Enabled', 'event_espresso'),
221 221
 
222 222
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:8
223
-	__( 'Ticket Selector Disabled', 'event_espresso' ),
223
+	__('Ticket Selector Disabled', 'event_espresso'),
224 224
 
225 225
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/index.tsx:41
226
-	__( 'Event Details', 'event_espresso' ),
226
+	__('Event Details', 'event_espresso'),
227 227
 
228 228
 	// Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/index.tsx:47
229
-	__( 'Registration Options', 'event_espresso' ),
229
+	__('Registration Options', 'event_espresso'),
230 230
 
231 231
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:10
232
-	__( 'primary information about the date', 'event_espresso' ),
232
+	__('primary information about the date', 'event_espresso'),
233 233
 
234 234
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:10
235
-	__( 'Date Details', 'event_espresso' ),
235
+	__('Date Details', 'event_espresso'),
236 236
 
237 237
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11
238 238
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:16
239 239
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:16
240
-	__( 'relations between tickets and dates', 'event_espresso' ),
240
+	__('relations between tickets and dates', 'event_espresso'),
241 241
 
242 242
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11
243
-	__( 'Assign Tickets', 'event_espresso' ),
243
+	__('Assign Tickets', 'event_espresso'),
244 244
 
245 245
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/FooterButtons.tsx:22
246
-	__( 'Save and assign tickets', 'event_espresso' ),
246
+	__('Save and assign tickets', 'event_espresso'),
247 247
 
248 248
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/Modal.tsx:27
249 249
 	/* translators: %s datetime id */
250
-	__( 'Edit datetime %s', 'event_espresso' ),
250
+	__('Edit datetime %s', 'event_espresso'),
251 251
 
252 252
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/Modal.tsx:30
253
-	__( 'New Datetime', 'event_espresso' ),
253
+	__('New Datetime', 'event_espresso'),
254 254
 
255 255
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:110
256 256
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:108
257 257
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:132
258 258
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:108
259
-	__( 'Details', 'event_espresso' ),
259
+	__('Details', 'event_espresso'),
260 260
 
261 261
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:114
262 262
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:112
263 263
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:81
264
-	__( 'Capacity', 'event_espresso' ),
264
+	__('Capacity', 'event_espresso'),
265 265
 
266 266
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:119
267
-	__( 'The maximum number of registrants that can attend the event at this particular date.', 'event_espresso' ),
267
+	__('The maximum number of registrants that can attend the event at this particular date.', 'event_espresso'),
268 268
 
269 269
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:123
270
-	__( 'Set to 0 to close registration or leave blank for no limit.', 'event_espresso' ),
270
+	__('Set to 0 to close registration or leave blank for no limit.', 'event_espresso'),
271 271
 
272 272
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:129
273 273
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:209
274
-	__( 'Trash', 'event_espresso' ),
274
+	__('Trash', 'event_espresso'),
275 275
 
276 276
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:71
277 277
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:45
278 278
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:93
279 279
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:45
280
-	__( 'Basics', 'event_espresso' ),
280
+	__('Basics', 'event_espresso'),
281 281
 
282 282
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:88
283 283
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:63
284 284
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:63
285
-	__( 'Dates', 'event_espresso' ),
285
+	__('Dates', 'event_espresso'),
286 286
 
287 287
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:92
288 288
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:51
289 289
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:114
290
-	__( 'Start Date', 'event_espresso' ),
290
+	__('Start Date', 'event_espresso'),
291 291
 
292 292
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:99
293 293
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:65
294 294
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:121
295
-	__( 'End Date', 'event_espresso' ),
295
+	__('End Date', 'event_espresso'),
296 296
 
297 297
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DateRegistrationsLink.tsx:13
298
-	__( 'view ALL registrations for this date.', 'event_espresso' ),
298
+	__('view ALL registrations for this date.', 'event_espresso'),
299 299
 
300 300
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DateSoldLink.tsx:13
301
-	__( 'view approved registrations for this date.', 'event_espresso' ),
301
+	__('view approved registrations for this date.', 'event_espresso'),
302 302
 
303 303
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:35
304 304
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/TableView.tsx:33
305
-	__( 'Event Dates', 'event_espresso' ),
305
+	__('Event Dates', 'event_espresso'),
306 306
 
307 307
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:38
308
-	__( 'loading event dates…', 'event_espresso' ),
308
+	__('loading event dates…', 'event_espresso'),
309 309
 
310 310
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DatesListButtons.tsx:21
311
-	__( 'Add a date or a ticket in order to use Ticket Assignment Manager', 'event_espresso' ),
311
+	__('Add a date or a ticket in order to use Ticket Assignment Manager', 'event_espresso'),
312 312
 
313 313
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DatesListButtons.tsx:31
314
-	__( 'Ticket Assignments', 'event_espresso' ),
314
+	__('Ticket Assignments', 'event_espresso'),
315 315
 
316 316
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:25
317
-	__( 'Number of related tickets', 'event_espresso' ),
317
+	__('Number of related tickets', 'event_espresso'),
318 318
 
319 319
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:26
320
-	__( 'There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso' ),
320
+	__('There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso'),
321 321
 
322 322
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:34
323
-	__( 'assign tickets', 'event_espresso' ),
323
+	__('assign tickets', 'event_espresso'),
324 324
 
325 325
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:25
326
-	__( 'Permanently delete Datetime?', 'event_espresso' ),
326
+	__('Permanently delete Datetime?', 'event_espresso'),
327 327
 
328 328
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:25
329
-	__( 'Move Datetime to Trash?', 'event_espresso' ),
329
+	__('Move Datetime to Trash?', 'event_espresso'),
330 330
 
331 331
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:27
332
-	__( 'Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso' ),
332
+	__('Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso'),
333 333
 
334 334
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:30
335
-	__( 'Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso' ),
335
+	__('Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso'),
336 336
 
337 337
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:39
338 338
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:44
339
-	__( 'delete permanently', 'event_espresso' ),
339
+	__('delete permanently', 'event_espresso'),
340 340
 
341 341
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:39
342
-	__( 'trash datetime', 'event_espresso' ),
342
+	__('trash datetime', 'event_espresso'),
343 343
 
344 344
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:45
345
-	__( 'event date main menu', 'event_espresso' ),
345
+	__('event date main menu', 'event_espresso'),
346 346
 
347 347
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:59
348
-	__( 'edit datetime', 'event_espresso' ),
348
+	__('edit datetime', 'event_espresso'),
349 349
 
350 350
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:60
351
-	__( 'copy datetime', 'event_espresso' ),
351
+	__('copy datetime', 'event_espresso'),
352 352
 
353 353
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:36
354 354
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:39
355 355
 	// Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:43
356
-	__( 'bulk actions', 'event_espresso' ),
356
+	__('bulk actions', 'event_espresso'),
357 357
 
358 358
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:40
359
-	__( 'edit datetime details', 'event_espresso' ),
359
+	__('edit datetime details', 'event_espresso'),
360 360
 
361 361
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:44
362
-	__( 'delete datetimes', 'event_espresso' ),
362
+	__('delete datetimes', 'event_espresso'),
363 363
 
364 364
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:44
365
-	__( 'trash datetimes', 'event_espresso' ),
365
+	__('trash datetimes', 'event_espresso'),
366 366
 
367 367
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:14
368
-	__( 'Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso' ),
368
+	__('Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso'),
369 369
 
370 370
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:15
371
-	__( 'Are you sure you want to trash these datetimes?', 'event_espresso' ),
371
+	__('Are you sure you want to trash these datetimes?', 'event_espresso'),
372 372
 
373 373
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:16
374
-	__( 'Delete datetimes permanently', 'event_espresso' ),
374
+	__('Delete datetimes permanently', 'event_espresso'),
375 375
 
376 376
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:16
377
-	__( 'Trash datetimes', 'event_espresso' ),
377
+	__('Trash datetimes', 'event_espresso'),
378 378
 
379 379
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:21
380
-	__( 'Bulk edit date details', 'event_espresso' ),
380
+	__('Bulk edit date details', 'event_espresso'),
381 381
 
382 382
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:22
383
-	__( 'any changes will be applied to ALL of the selected dates.', 'event_espresso' ),
383
+	__('any changes will be applied to ALL of the selected dates.', 'event_espresso'),
384 384
 
385 385
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/formValidation.ts:12
386 386
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/formValidation.ts:12
387
-	__( 'Name must be at least three characters', 'event_espresso' ),
387
+	__('Name must be at least three characters', 'event_espresso'),
388 388
 
389 389
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:67
390 390
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:67
391
-	__( 'Shift dates', 'event_espresso' ),
391
+	__('Shift dates', 'event_espresso'),
392 392
 
393 393
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:92
394 394
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:92
395
-	__( 'earlier', 'event_espresso' ),
395
+	__('earlier', 'event_espresso'),
396 396
 
397 397
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:96
398 398
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:96
399
-	__( 'later', 'event_espresso' ),
399
+	__('later', 'event_espresso'),
400 400
 
401 401
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCapacity.tsx:31
402 402
 	/* translators: click to edit capacity<linebreak>(registration limit)… */
403
-	__( 'click to edit capacity%s(registration limit)…', 'event_espresso' ),
403
+	__('click to edit capacity%s(registration limit)…', 'event_espresso'),
404 404
 
405 405
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:31
406 406
 	// Reference: packages/ee-components/src/SimpleTicketCard/SimpleTicketCard.tsx:27
407 407
 	// Reference: packages/ui-components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:34
408
-	__( 'starts', 'event_espresso' ),
408
+	__('starts', 'event_espresso'),
409 409
 
410 410
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:32
411 411
 	// Reference: packages/ee-components/src/SimpleTicketCard/SimpleTicketCard.tsx:34
412 412
 	// Reference: packages/ui-components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:47
413
-	__( 'ends', 'event_espresso' ),
413
+	__('ends', 'event_espresso'),
414 414
 
415 415
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:32
416
-	__( 'started', 'event_espresso' ),
416
+	__('started', 'event_espresso'),
417 417
 
418 418
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:32
419
-	__( 'ended', 'event_espresso' ),
419
+	__('ended', 'event_espresso'),
420 420
 
421 421
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:46
422
-	__( 'Edit Event Date', 'event_espresso' ),
422
+	__('Edit Event Date', 'event_espresso'),
423 423
 
424 424
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:50
425
-	__( 'edit start and end dates', 'event_espresso' ),
425
+	__('edit start and end dates', 'event_espresso'),
426 426
 
427 427
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:16
428 428
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:16
429
-	__( 'sold', 'event_espresso' ),
429
+	__('sold', 'event_espresso'),
430 430
 
431 431
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:21
432
-	__( 'capacity', 'event_espresso' ),
432
+	__('capacity', 'event_espresso'),
433 433
 
434 434
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:27
435 435
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:26
436
-	__( 'reg list', 'event_espresso' ),
436
+	__('reg list', 'event_espresso'),
437 437
 
438 438
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:43
439 439
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:35
440
-	__( 'add description…', 'event_espresso' ),
440
+	__('add description…', 'event_espresso'),
441 441
 
442 442
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:44
443 443
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:36
444
-	__( 'Edit description', 'event_espresso' ),
444
+	__('Edit description', 'event_espresso'),
445 445
 
446 446
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:45
447 447
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:37
448
-	__( 'click to edit description…', 'event_espresso' ),
448
+	__('click to edit description…', 'event_espresso'),
449 449
 
450 450
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:10
451
-	__( 'Move Date to Trash', 'event_espresso' ),
451
+	__('Move Date to Trash', 'event_espresso'),
452 452
 
453 453
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:13
454 454
 	// Reference: packages/constants/src/datetime.ts:6
455
-	__( 'Active', 'event_espresso' ),
455
+	__('Active', 'event_espresso'),
456 456
 
457 457
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:14
458 458
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:13
459
-	__( 'Trashed', 'event_espresso' ),
459
+	__('Trashed', 'event_espresso'),
460 460
 
461 461
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:15
462 462
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:14
463 463
 	// Reference: packages/constants/src/datetime.ts:8
464
-	__( 'Expired', 'event_espresso' ),
464
+	__('Expired', 'event_espresso'),
465 465
 
466 466
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:16
467 467
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:16
468
-	__( 'Sold Out', 'event_espresso' ),
468
+	__('Sold Out', 'event_espresso'),
469 469
 
470 470
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:17
471 471
 	// Reference: packages/constants/src/datetime.ts:12
472
-	__( 'Upcoming', 'event_espresso' ),
472
+	__('Upcoming', 'event_espresso'),
473 473
 
474 474
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:7
475
-	__( 'Edit Event Date Details', 'event_espresso' ),
475
+	__('Edit Event Date Details', 'event_espresso'),
476 476
 
477 477
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:8
478
-	__( 'View Registrations for this Date', 'event_espresso' ),
478
+	__('View Registrations for this Date', 'event_espresso'),
479 479
 
480 480
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:9
481
-	__( 'Manage Ticket Assignments', 'event_espresso' ),
481
+	__('Manage Ticket Assignments', 'event_espresso'),
482 482
 
483 483
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/editable/EditableName.tsx:41
484 484
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/editable/EditableName.tsx:41
485
-	__( 'click to edit title…', 'event_espresso' ),
485
+	__('click to edit title…', 'event_espresso'),
486 486
 
487 487
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/editable/EditableName.tsx:42
488 488
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/editable/EditableName.tsx:42
489
-	__( 'add title…', 'event_espresso' ),
489
+	__('add title…', 'event_espresso'),
490 490
 
491 491
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/ActiveDatesFilters.tsx:17
492 492
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/ActiveTicketsFilters.tsx:17
493
-	__( 'ON', 'event_espresso' ),
493
+	__('ON', 'event_espresso'),
494 494
 
495 495
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:10
496
-	__( 'end dates only', 'event_espresso' ),
496
+	__('end dates only', 'event_espresso'),
497 497
 
498 498
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:11
499
-	__( 'start and end dates', 'event_espresso' ),
499
+	__('start and end dates', 'event_espresso'),
500 500
 
501 501
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:16
502
-	__( 'dates above 90% capacity', 'event_espresso' ),
502
+	__('dates above 90% capacity', 'event_espresso'),
503 503
 
504 504
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:17
505
-	__( 'dates above 75% capacity', 'event_espresso' ),
505
+	__('dates above 75% capacity', 'event_espresso'),
506 506
 
507 507
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:18
508
-	__( 'dates above 50% capacity', 'event_espresso' ),
508
+	__('dates above 50% capacity', 'event_espresso'),
509 509
 
510 510
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:19
511
-	__( 'dates below 50% capacity', 'event_espresso' ),
511
+	__('dates below 50% capacity', 'event_espresso'),
512 512
 
513 513
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:23
514
-	__( 'all dates', 'event_espresso' ),
514
+	__('all dates', 'event_espresso'),
515 515
 
516 516
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:24
517
-	__( 'all active and upcoming', 'event_espresso' ),
517
+	__('all active and upcoming', 'event_espresso'),
518 518
 
519 519
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:25
520
-	__( 'active dates only', 'event_espresso' ),
520
+	__('active dates only', 'event_espresso'),
521 521
 
522 522
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:26
523
-	__( 'upcoming dates only', 'event_espresso' ),
523
+	__('upcoming dates only', 'event_espresso'),
524 524
 
525 525
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:27
526
-	__( 'next active or upcoming only', 'event_espresso' ),
526
+	__('next active or upcoming only', 'event_espresso'),
527 527
 
528 528
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:28
529
-	__( 'sold out dates only', 'event_espresso' ),
529
+	__('sold out dates only', 'event_espresso'),
530 530
 
531 531
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:29
532
-	__( 'recently expired dates', 'event_espresso' ),
532
+	__('recently expired dates', 'event_espresso'),
533 533
 
534 534
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:30
535
-	__( 'all expired dates', 'event_espresso' ),
535
+	__('all expired dates', 'event_espresso'),
536 536
 
537 537
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:31
538
-	__( 'trashed dates only', 'event_espresso' ),
538
+	__('trashed dates only', 'event_espresso'),
539 539
 
540 540
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:35
541 541
 	// Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:9
542 542
 	// Reference: packages/dates/src/components/DateRangePicker/index.tsx:61
543
-	__( 'start date', 'event_espresso' ),
543
+	__('start date', 'event_espresso'),
544 544
 
545 545
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:36
546
-	__( 'name', 'event_espresso' ),
546
+	__('name', 'event_espresso'),
547 547
 
548 548
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:37
549 549
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:31
@@ -551,182 +551,182 @@  discard block
 block discarded – undo
551 551
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/HeaderCell.tsx:27
552 552
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:31
553 553
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:23
554
-	__( 'ID', 'event_espresso' ),
554
+	__('ID', 'event_espresso'),
555 555
 
556 556
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:38
557 557
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:47
558
-	__( 'custom order', 'event_espresso' ),
558
+	__('custom order', 'event_espresso'),
559 559
 
560 560
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:42
561 561
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:51
562
-	__( 'display', 'event_espresso' ),
562
+	__('display', 'event_espresso'),
563 563
 
564 564
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:43
565
-	__( 'recurrence', 'event_espresso' ),
565
+	__('recurrence', 'event_espresso'),
566 566
 
567 567
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:44
568 568
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:53
569
-	__( 'sales', 'event_espresso' ),
569
+	__('sales', 'event_espresso'),
570 570
 
571 571
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:45
572 572
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:55
573
-	__( 'sort by', 'event_espresso' ),
573
+	__('sort by', 'event_espresso'),
574 574
 
575 575
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:46
576 576
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:54
577 577
 	// Reference: packages/ee-components/src/EntityList/EntityListFilterBar.tsx:46
578
-	__( 'search', 'event_espresso' ),
578
+	__('search', 'event_espresso'),
579 579
 
580 580
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:47
581 581
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:56
582
-	__( 'status', 'event_espresso' ),
582
+	__('status', 'event_espresso'),
583 583
 
584 584
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:9
585
-	__( 'start dates only', 'event_espresso' ),
585
+	__('start dates only', 'event_espresso'),
586 586
 
587 587
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:26
588 588
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/NewDateModal.tsx:12
589 589
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/OptionsModalButton.tsx:18
590
-	__( 'Add New Date', 'event_espresso' ),
590
+	__('Add New Date', 'event_espresso'),
591 591
 
592 592
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:26
593
-	__( 'Add Single Date', 'event_espresso' ),
593
+	__('Add Single Date', 'event_espresso'),
594 594
 
595 595
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:44
596
-	__( 'Add a single date that only occurs once', 'event_espresso' ),
596
+	__('Add a single date that only occurs once', 'event_espresso'),
597 597
 
598 598
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:46
599
-	__( 'Single Date', 'event_espresso' ),
599
+	__('Single Date', 'event_espresso'),
600 600
 
601 601
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:106
602
-	__( 'Reg list', 'event_espresso' ),
602
+	__('Reg list', 'event_espresso'),
603 603
 
604 604
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:107
605 605
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:111
606
-	__( 'Regs', 'event_espresso' ),
606
+	__('Regs', 'event_espresso'),
607 607
 
608 608
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:122
609 609
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:126
610 610
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:59
611
-	__( 'Actions', 'event_espresso' ),
611
+	__('Actions', 'event_espresso'),
612 612
 
613 613
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:52
614
-	__( 'Start', 'event_espresso' ),
614
+	__('Start', 'event_espresso'),
615 615
 
616 616
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:66
617
-	__( 'End', 'event_espresso' ),
617
+	__('End', 'event_espresso'),
618 618
 
619 619
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:82
620
-	__( 'Cap', 'event_espresso' ),
620
+	__('Cap', 'event_espresso'),
621 621
 
622 622
 	// Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:94
623 623
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:98
624
-	__( 'Sold', 'event_espresso' ),
624
+	__('Sold', 'event_espresso'),
625 625
 
626 626
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:33
627 627
 	// Reference: packages/form-builder/src/constants.ts:67
628
-	__( 'Text Input', 'event_espresso' ),
628
+	__('Text Input', 'event_espresso'),
629 629
 
630 630
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:34
631 631
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:32
632
-	__( 'Attendee First Name', 'event_espresso' ),
632
+	__('Attendee First Name', 'event_espresso'),
633 633
 
634 634
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:39
635 635
 	/* translators: field name */
636
-	__( 'Registration form must have a field of type "%1$s" which maps to "%2$s"', 'event_espresso' ),
636
+	__('Registration form must have a field of type "%1$s" which maps to "%2$s"', 'event_espresso'),
637 637
 
638 638
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:40
639 639
 	// Reference: packages/form-builder/src/constants.ts:82
640
-	__( 'Email Address', 'event_espresso' ),
640
+	__('Email Address', 'event_espresso'),
641 641
 
642 642
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:41
643 643
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:40
644
-	__( 'Attendee Email Address', 'event_espresso' ),
644
+	__('Attendee Email Address', 'event_espresso'),
645 645
 
646 646
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:49
647
-	__( 'Please add the required fields', 'event_espresso' ),
647
+	__('Please add the required fields', 'event_espresso'),
648 648
 
649 649
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/RegistrationForm.tsx:12
650
-	__( 'Registration Form', 'event_espresso' ),
650
+	__('Registration Form', 'event_espresso'),
651 651
 
652 652
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:13
653
-	__( 'primary registrant', 'event_espresso' ),
653
+	__('primary registrant', 'event_espresso'),
654 654
 
655 655
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:17
656
-	__( 'purchaser', 'event_espresso' ),
656
+	__('purchaser', 'event_espresso'),
657 657
 
658 658
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:21
659
-	__( 'registrants', 'event_espresso' ),
659
+	__('registrants', 'event_espresso'),
660 660
 
661 661
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:36
662
-	__( 'Attendee Last Name', 'event_espresso' ),
662
+	__('Attendee Last Name', 'event_espresso'),
663 663
 
664 664
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:44
665
-	__( 'Attendee Address', 'event_espresso' ),
665
+	__('Attendee Address', 'event_espresso'),
666 666
 
667 667
 	// Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:9
668
-	__( 'all', 'event_espresso' ),
668
+	__('all', 'event_espresso'),
669 669
 
670 670
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:18
671
-	__( 'Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. 
672
-Please correct the assignments for the highlighted cells.', 'event_espresso' ),
671
+	__('Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. 
672
+Please correct the assignments for the highlighted cells.', 'event_espresso'),
673 673
 
674 674
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:22
675
-	__( 'Event Dates must always have at least one Ticket assigned to them but one or more of the Event Dates below does not have any. 
676
-Please correct the assignments for the highlighted cells.', 'event_espresso' ),
675
+	__('Event Dates must always have at least one Ticket assigned to them but one or more of the Event Dates below does not have any. 
676
+Please correct the assignments for the highlighted cells.', 'event_espresso'),
677 677
 
678 678
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:32
679
-	__( 'Please Update Assignments', 'event_espresso' ),
679
+	__('Please Update Assignments', 'event_espresso'),
680 680
 
681 681
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:26
682
-	__( 'There seem to be some dates/tickets which have no tickets/dates assigned. Do you want to fix them now?', 'event_espresso' ),
682
+	__('There seem to be some dates/tickets which have no tickets/dates assigned. Do you want to fix them now?', 'event_espresso'),
683 683
 
684 684
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:29
685 685
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:74
686 686
 	// Reference: packages/ui-components/src/Modal/ModalWithAlert.tsx:21
687
-	__( 'Alert!', 'event_espresso' ),
687
+	__('Alert!', 'event_espresso'),
688 688
 
689 689
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:42
690 690
 	/* translators: 1 entity id, 2 entity name */
691
-	__( 'Ticket Assignment Manager for Datetime: %1$s - %2$s', 'event_espresso' ),
691
+	__('Ticket Assignment Manager for Datetime: %1$s - %2$s', 'event_espresso'),
692 692
 
693 693
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:49
694 694
 	/* translators: 1 entity id, 2 entity name */
695
-	__( 'Ticket Assignment Manager for Ticket: %1$s - %2$s', 'event_espresso' ),
695
+	__('Ticket Assignment Manager for Ticket: %1$s - %2$s', 'event_espresso'),
696 696
 
697 697
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal.tsx:28
698 698
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/Table.tsx:13
699
-	__( 'Ticket Assignment Manager', 'event_espresso' ),
699
+	__('Ticket Assignment Manager', 'event_espresso'),
700 700
 
701 701
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:10
702
-	__( 'existing relation', 'event_espresso' ),
702
+	__('existing relation', 'event_espresso'),
703 703
 
704 704
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:15
705
-	__( 'remove existing relation', 'event_espresso' ),
705
+	__('remove existing relation', 'event_espresso'),
706 706
 
707 707
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:20
708
-	__( 'add new relation', 'event_espresso' ),
708
+	__('add new relation', 'event_espresso'),
709 709
 
710 710
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:25
711
-	__( 'invalid relation', 'event_espresso' ),
711
+	__('invalid relation', 'event_espresso'),
712 712
 
713 713
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:29
714
-	__( 'no relation', 'event_espresso' ),
714
+	__('no relation', 'event_espresso'),
715 715
 
716 716
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/BodyCell.tsx:23
717
-	__( 'assign ticket', 'event_espresso' ),
717
+	__('assign ticket', 'event_espresso'),
718 718
 
719 719
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:15
720
-	__( 'Assignments', 'event_espresso' ),
720
+	__('Assignments', 'event_espresso'),
721 721
 
722 722
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:16
723
-	__( 'Event Dates are listed below', 'event_espresso' ),
723
+	__('Event Dates are listed below', 'event_espresso'),
724 724
 
725 725
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:17
726
-	__( 'Tickets are listed along the top', 'event_espresso' ),
726
+	__('Tickets are listed along the top', 'event_espresso'),
727 727
 
728 728
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:18
729
-	__( 'Click the cell buttons to toggle assigments', 'event_espresso' ),
729
+	__('Click the cell buttons to toggle assigments', 'event_espresso'),
730 730
 
731 731
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/useSubmitButtonProps.ts:29
732 732
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:16
@@ -735,1533 +735,1533 @@  discard block
 block discarded – undo
735 735
 	// Reference: packages/tpc/src/buttons/useSubmitButtonProps.tsx:29
736 736
 	// Reference: packages/ui-components/src/Modal/useSubmitButtonProps.tsx:13
737 737
 	// Reference: packages/ui-components/src/Stepper/buttons/Submit.tsx:7
738
-	__( 'Submit', 'event_espresso' ),
738
+	__('Submit', 'event_espresso'),
739 739
 
740 740
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:20
741
-	__( 'All Dates', 'event_espresso' ),
741
+	__('All Dates', 'event_espresso'),
742 742
 
743 743
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:27
744
-	__( 'dates by month', 'event_espresso' ),
744
+	__('dates by month', 'event_espresso'),
745 745
 
746 746
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowExpiredTicketsControl.tsx:16
747
-	__( 'show expired tickets', 'event_espresso' ),
747
+	__('show expired tickets', 'event_espresso'),
748 748
 
749 749
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedDatesControl.tsx:13
750
-	__( 'show trashed dates', 'event_espresso' ),
750
+	__('show trashed dates', 'event_espresso'),
751 751
 
752 752
 	// Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedTicketsControl.tsx:16
753
-	__( 'show trashed tickets', 'event_espresso' ),
753
+	__('show trashed tickets', 'event_espresso'),
754 754
 
755 755
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/Container.tsx:38
756 756
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actions/Actions.tsx:21
757
-	__( 'Default tickets', 'event_espresso' ),
757
+	__('Default tickets', 'event_espresso'),
758 758
 
759 759
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/ModalBody.tsx:63
760 760
 	// Reference: packages/edtr-services/src/constants.ts:26
761
-	__( 'ticket', 'event_espresso' ),
761
+	__('ticket', 'event_espresso'),
762 762
 
763 763
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:26
764 764
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:33
765
-	__( 'Set ticket prices', 'event_espresso' ),
765
+	__('Set ticket prices', 'event_espresso'),
766 766
 
767 767
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:31
768
-	__( 'Skip prices - Save', 'event_espresso' ),
768
+	__('Skip prices - Save', 'event_espresso'),
769 769
 
770 770
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:37
771 771
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:57
772
-	__( 'Ticket details', 'event_espresso' ),
772
+	__('Ticket details', 'event_espresso'),
773 773
 
774 774
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:38
775
-	__( 'Save', 'event_espresso' ),
775
+	__('Save', 'event_espresso'),
776 776
 
777 777
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/Modal.tsx:22
778 778
 	/* translators: %s ticket id */
779
-	__( 'Edit ticket %s', 'event_espresso' ),
779
+	__('Edit ticket %s', 'event_espresso'),
780 780
 
781 781
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/Modal.tsx:25
782 782
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/Modal.tsx:30
783
-	__( 'New Ticket Details', 'event_espresso' ),
783
+	__('New Ticket Details', 'event_espresso'),
784 784
 
785 785
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:10
786 786
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:10
787
-	__( 'primary information about the ticket', 'event_espresso' ),
787
+	__('primary information about the ticket', 'event_espresso'),
788 788
 
789 789
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:10
790 790
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:10
791
-	__( 'Ticket Details', 'event_espresso' ),
791
+	__('Ticket Details', 'event_espresso'),
792 792
 
793 793
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:12
794 794
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:12
795
-	__( 'apply ticket price modifiers and taxes', 'event_espresso' ),
795
+	__('apply ticket price modifiers and taxes', 'event_espresso'),
796 796
 
797 797
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:14
798 798
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:14
799
-	__( 'Price Calculator', 'event_espresso' ),
799
+	__('Price Calculator', 'event_espresso'),
800 800
 
801 801
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:16
802 802
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:16
803
-	__( 'Assign Dates', 'event_espresso' ),
803
+	__('Assign Dates', 'event_espresso'),
804 804
 
805 805
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:39
806
-	__( 'Skip prices - assign dates', 'event_espresso' ),
806
+	__('Skip prices - assign dates', 'event_espresso'),
807 807
 
808 808
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:50
809
-	__( 'Save and assign dates', 'event_espresso' ),
809
+	__('Save and assign dates', 'event_espresso'),
810 810
 
811 811
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/Modal.tsx:26
812 812
 	/* translators: 1 ticket name, 2 ticket id */
813
-	__( 'Edit ticket "%1$s" - %2$s', 'event_espresso' ),
813
+	__('Edit ticket "%1$s" - %2$s', 'event_espresso'),
814 814
 
815 815
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:110
816
-	__( 'Ticket Sales', 'event_espresso' ),
816
+	__('Ticket Sales', 'event_espresso'),
817 817
 
818 818
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:136
819 819
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:112
820
-	__( 'Quantity For Sale', 'event_espresso' ),
820
+	__('Quantity For Sale', 'event_espresso'),
821 821
 
822 822
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:142
823
-	__( 'The maximum number of this ticket available for sale.', 'event_espresso' ),
823
+	__('The maximum number of this ticket available for sale.', 'event_espresso'),
824 824
 
825 825
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:144
826
-	__( 'Set to 0 to stop sales, or leave blank for no limit.', 'event_espresso' ),
826
+	__('Set to 0 to stop sales, or leave blank for no limit.', 'event_espresso'),
827 827
 
828 828
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:150
829 829
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:121
830
-	__( 'Number of Uses', 'event_espresso' ),
830
+	__('Number of Uses', 'event_espresso'),
831 831
 
832 832
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:156
833
-	__( 'Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.', 'event_espresso' ),
833
+	__('Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.', 'event_espresso'),
834 834
 
835 835
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:160
836
-	__( 'Example: A ticket might have access to 4 different dates, but setting this field to 2 would mean that the ticket could only be used twice. Leave blank for no limit.', 'event_espresso' ),
836
+	__('Example: A ticket might have access to 4 different dates, but setting this field to 2 would mean that the ticket could only be used twice. Leave blank for no limit.', 'event_espresso'),
837 837
 
838 838
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:168
839 839
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:129
840
-	__( 'Minimum Quantity', 'event_espresso' ),
840
+	__('Minimum Quantity', 'event_espresso'),
841 841
 
842 842
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:173
843
-	__( 'The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso' ),
843
+	__('The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso'),
844 844
 
845 845
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:177
846
-	__( 'Leave blank for no minimum.', 'event_espresso' ),
846
+	__('Leave blank for no minimum.', 'event_espresso'),
847 847
 
848 848
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:183
849 849
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:137
850
-	__( 'Maximum Quantity', 'event_espresso' ),
850
+	__('Maximum Quantity', 'event_espresso'),
851 851
 
852 852
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:189
853
-	__( 'The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso' ),
853
+	__('The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso'),
854 854
 
855 855
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:193
856
-	__( 'Leave blank for no maximum.', 'event_espresso' ),
856
+	__('Leave blank for no maximum.', 'event_espresso'),
857 857
 
858 858
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:199
859 859
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:146
860
-	__( 'Required Ticket', 'event_espresso' ),
860
+	__('Required Ticket', 'event_espresso'),
861 861
 
862 862
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:201
863
-	__( 'If enabled, the ticket must be selected and will appear first in frontend ticket lists.', 'event_espresso' ),
863
+	__('If enabled, the ticket must be selected and will appear first in frontend ticket lists.', 'event_espresso'),
864 864
 
865 865
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:215
866
-	__( 'Visibility', 'event_espresso' ),
866
+	__('Visibility', 'event_espresso'),
867 867
 
868 868
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:217
869
-	__( 'Where the ticket can be viewed throughout the UI.', 'event_espresso' ),
869
+	__('Where the ticket can be viewed throughout the UI.', 'event_espresso'),
870 870
 
871 871
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/TicketRegistrationsLink.tsx:13
872
-	__( 'total registrations.', 'event_espresso' ),
872
+	__('total registrations.', 'event_espresso'),
873 873
 
874 874
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/TicketRegistrationsLink.tsx:14
875
-	__( 'view ALL registrations for this ticket.', 'event_espresso' ),
875
+	__('view ALL registrations for this ticket.', 'event_espresso'),
876 876
 
877 877
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/TicketSoldLink.tsx:13
878
-	__( 'view approved registrations for this ticket.', 'event_espresso' ),
878
+	__('view approved registrations for this ticket.', 'event_espresso'),
879 879
 
880 880
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:36
881
-	__( 'Available Tickets', 'event_espresso' ),
881
+	__('Available Tickets', 'event_espresso'),
882 882
 
883 883
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:39
884
-	__( 'loading tickets…', 'event_espresso' ),
884
+	__('loading tickets…', 'event_espresso'),
885 885
 
886 886
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:26
887
-	__( 'Number of related dates', 'event_espresso' ),
887
+	__('Number of related dates', 'event_espresso'),
888 888
 
889 889
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:27
890
-	__( 'There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso' ),
890
+	__('There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso'),
891 891
 
892 892
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:37
893
-	__( 'assign dates', 'event_espresso' ),
893
+	__('assign dates', 'event_espresso'),
894 894
 
895 895
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:18
896
-	__( 'Permanently delete Ticket?', 'event_espresso' ),
896
+	__('Permanently delete Ticket?', 'event_espresso'),
897 897
 
898 898
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:18
899
-	__( 'Move Ticket to Trash?', 'event_espresso' ),
899
+	__('Move Ticket to Trash?', 'event_espresso'),
900 900
 
901 901
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:21
902
-	__( 'Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso' ),
902
+	__('Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso'),
903 903
 
904 904
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:22
905
-	__( 'Are you sure you want to move this ticket to the trash? You can "untrash" this ticket later if you need to.', 'event_espresso' ),
905
+	__('Are you sure you want to move this ticket to the trash? You can "untrash" this ticket later if you need to.', 'event_espresso'),
906 906
 
907 907
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:44
908 908
 	// Reference: packages/ee-components/src/SimpleTicketCard/actions/Trash.tsx:6
909
-	__( 'trash ticket', 'event_espresso' ),
909
+	__('trash ticket', 'event_espresso'),
910 910
 
911 911
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:25
912
-	__( 'ticket main menu', 'event_espresso' ),
912
+	__('ticket main menu', 'event_espresso'),
913 913
 
914 914
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:38
915 915
 	// Reference: packages/ee-components/src/SimpleTicketCard/actions/Edit.tsx:15
916
-	__( 'edit ticket', 'event_espresso' ),
916
+	__('edit ticket', 'event_espresso'),
917 917
 
918 918
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:39
919
-	__( 'copy ticket', 'event_espresso' ),
919
+	__('copy ticket', 'event_espresso'),
920 920
 
921 921
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:43
922
-	__( 'edit ticket details', 'event_espresso' ),
922
+	__('edit ticket details', 'event_espresso'),
923 923
 
924 924
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:47
925
-	__( 'delete tickets', 'event_espresso' ),
925
+	__('delete tickets', 'event_espresso'),
926 926
 
927 927
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:47
928
-	__( 'trash tickets', 'event_espresso' ),
928
+	__('trash tickets', 'event_espresso'),
929 929
 
930 930
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:51
931
-	__( 'edit ticket prices', 'event_espresso' ),
931
+	__('edit ticket prices', 'event_espresso'),
932 932
 
933 933
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:14
934
-	__( 'Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso' ),
934
+	__('Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso'),
935 935
 
936 936
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:15
937
-	__( 'Are you sure you want to trash these tickets?', 'event_espresso' ),
937
+	__('Are you sure you want to trash these tickets?', 'event_espresso'),
938 938
 
939 939
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:16
940
-	__( 'Delete tickets permanently', 'event_espresso' ),
940
+	__('Delete tickets permanently', 'event_espresso'),
941 941
 
942 942
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:16
943
-	__( 'Trash tickets', 'event_espresso' ),
943
+	__('Trash tickets', 'event_espresso'),
944 944
 
945 945
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:21
946
-	__( 'Bulk edit ticket details', 'event_espresso' ),
946
+	__('Bulk edit ticket details', 'event_espresso'),
947 947
 
948 948
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:22
949
-	__( 'any changes will be applied to ALL of the selected tickets.', 'event_espresso' ),
949
+	__('any changes will be applied to ALL of the selected tickets.', 'event_espresso'),
950 950
 
951 951
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/EditPrices.tsx:19
952
-	__( 'Bulk edit ticket prices', 'event_espresso' ),
952
+	__('Bulk edit ticket prices', 'event_espresso'),
953 953
 
954 954
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:20
955
-	__( 'Edit all prices together', 'event_espresso' ),
955
+	__('Edit all prices together', 'event_espresso'),
956 956
 
957 957
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:21
958
-	__( 'Edit all the selected ticket prices dynamically', 'event_espresso' ),
958
+	__('Edit all the selected ticket prices dynamically', 'event_espresso'),
959 959
 
960 960
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:25
961
-	__( 'Edit prices individually', 'event_espresso' ),
961
+	__('Edit prices individually', 'event_espresso'),
962 962
 
963 963
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:26
964
-	__( 'Edit prices for each ticket individually', 'event_espresso' ),
964
+	__('Edit prices for each ticket individually', 'event_espresso'),
965 965
 
966 966
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:14
967 967
 	// Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:34
968 968
 	// Reference: packages/form/src/ResetButton.tsx:18
969 969
 	// Reference: packages/tpc/src/buttons/useResetButtonProps.tsx:12
970
-	__( 'Reset', 'event_espresso' ),
970
+	__('Reset', 'event_espresso'),
971 971
 
972 972
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:15
973 973
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:76
974 974
 	// Reference: packages/ui-components/src/Modal/useCancelButtonProps.tsx:10
975
-	__( 'Cancel', 'event_espresso' ),
975
+	__('Cancel', 'event_espresso'),
976 976
 
977 977
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/editSeparately/TPCInstance.tsx:26
978 978
 	/* translators: %s ticket name */
979
-	__( 'Edit prices for Ticket: %s', 'event_espresso' ),
979
+	__('Edit prices for Ticket: %s', 'event_espresso'),
980 980
 
981 981
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:30
982
-	__( 'sales start', 'event_espresso' ),
982
+	__('sales start', 'event_espresso'),
983 983
 
984 984
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:33
985
-	__( 'sales began', 'event_espresso' ),
985
+	__('sales began', 'event_espresso'),
986 986
 
987 987
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:35
988
-	__( 'sales ended', 'event_espresso' ),
988
+	__('sales ended', 'event_espresso'),
989 989
 
990 990
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:36
991
-	__( 'sales end', 'event_espresso' ),
991
+	__('sales end', 'event_espresso'),
992 992
 
993 993
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:50
994
-	__( 'Edit Ticket Sale Dates', 'event_espresso' ),
994
+	__('Edit Ticket Sale Dates', 'event_espresso'),
995 995
 
996 996
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:54
997
-	__( 'edit ticket sales start and end dates', 'event_espresso' ),
997
+	__('edit ticket sales start and end dates', 'event_espresso'),
998 998
 
999 999
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:21
1000
-	__( 'quantity', 'event_espresso' ),
1000
+	__('quantity', 'event_espresso'),
1001 1001
 
1002 1002
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketQuantity.tsx:28
1003 1003
 	// Reference: packages/edtr-services/src/apollo/mutations/tickets/useUpdateTicketQtyByCapacity.ts:78
1004
-	__( 'Ticket quantity has been adjusted because it cannot be more than the related event date capacity.', 'event_espresso' ),
1004
+	__('Ticket quantity has been adjusted because it cannot be more than the related event date capacity.', 'event_espresso'),
1005 1005
 
1006 1006
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketQuantity.tsx:51
1007
-	__( 'edit quantity of tickets available…', 'event_espresso' ),
1007
+	__('edit quantity of tickets available…', 'event_espresso'),
1008 1008
 
1009 1009
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:10
1010
-	__( 'Move Ticket to Trash', 'event_espresso' ),
1010
+	__('Move Ticket to Trash', 'event_espresso'),
1011 1011
 
1012 1012
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:15
1013 1013
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:52
1014
-	__( 'On Sale', 'event_espresso' ),
1014
+	__('On Sale', 'event_espresso'),
1015 1015
 
1016 1016
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:17
1017
-	__( 'Pending', 'event_espresso' ),
1017
+	__('Pending', 'event_espresso'),
1018 1018
 
1019 1019
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:7
1020
-	__( 'Edit Ticket Details', 'event_espresso' ),
1020
+	__('Edit Ticket Details', 'event_espresso'),
1021 1021
 
1022 1022
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:8
1023
-	__( 'Manage Date Assignments', 'event_espresso' ),
1023
+	__('Manage Date Assignments', 'event_espresso'),
1024 1024
 
1025 1025
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:9
1026 1026
 	// Reference: packages/tpc/src/components/table/Table.tsx:43
1027
-	__( 'Ticket Price Calculator', 'event_espresso' ),
1027
+	__('Ticket Price Calculator', 'event_espresso'),
1028 1028
 
1029 1029
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:39
1030
-	__( 'edit ticket total…', 'event_espresso' ),
1030
+	__('edit ticket total…', 'event_espresso'),
1031 1031
 
1032 1032
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:53
1033
-	__( 'set price…', 'event_espresso' ),
1033
+	__('set price…', 'event_espresso'),
1034 1034
 
1035 1035
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:23
1036
-	__( 'tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso' ),
1036
+	__('tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso'),
1037 1037
 
1038 1038
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:24
1039
-	__( 'tickets list is unlinked and is showing tickets for all event dates', 'event_espresso' ),
1039
+	__('tickets list is unlinked and is showing tickets for all event dates', 'event_espresso'),
1040 1040
 
1041 1041
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:10
1042
-	__( 'ticket sales start and end dates', 'event_espresso' ),
1042
+	__('ticket sales start and end dates', 'event_espresso'),
1043 1043
 
1044 1044
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:15
1045
-	__( 'tickets with 90% or more sold', 'event_espresso' ),
1045
+	__('tickets with 90% or more sold', 'event_espresso'),
1046 1046
 
1047 1047
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:16
1048
-	__( 'tickets with 75% or more sold', 'event_espresso' ),
1048
+	__('tickets with 75% or more sold', 'event_espresso'),
1049 1049
 
1050 1050
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:17
1051
-	__( 'tickets with 50% or more sold', 'event_espresso' ),
1051
+	__('tickets with 50% or more sold', 'event_espresso'),
1052 1052
 
1053 1053
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:19
1054
-	__( 'tickets with less than 50% sold', 'event_espresso' ),
1054
+	__('tickets with less than 50% sold', 'event_espresso'),
1055 1055
 
1056 1056
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:28
1057
-	__( 'all tickets for all dates', 'event_espresso' ),
1057
+	__('all tickets for all dates', 'event_espresso'),
1058 1058
 
1059 1059
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:29
1060
-	__( 'all on sale and sale pending', 'event_espresso' ),
1060
+	__('all on sale and sale pending', 'event_espresso'),
1061 1061
 
1062 1062
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:30
1063
-	__( 'on sale tickets only', 'event_espresso' ),
1063
+	__('on sale tickets only', 'event_espresso'),
1064 1064
 
1065 1065
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:31
1066
-	__( 'sale pending tickets only', 'event_espresso' ),
1066
+	__('sale pending tickets only', 'event_espresso'),
1067 1067
 
1068 1068
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:32
1069
-	__( 'next on sale or sale pending only', 'event_espresso' ),
1069
+	__('next on sale or sale pending only', 'event_espresso'),
1070 1070
 
1071 1071
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:33
1072
-	__( 'sold out tickets only', 'event_espresso' ),
1072
+	__('sold out tickets only', 'event_espresso'),
1073 1073
 
1074 1074
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:34
1075
-	__( 'expired tickets only', 'event_espresso' ),
1075
+	__('expired tickets only', 'event_espresso'),
1076 1076
 
1077 1077
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:35
1078
-	__( 'trashed tickets only', 'event_espresso' ),
1078
+	__('trashed tickets only', 'event_espresso'),
1079 1079
 
1080 1080
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:40
1081
-	__( 'all tickets for above dates', 'event_espresso' ),
1081
+	__('all tickets for above dates', 'event_espresso'),
1082 1082
 
1083 1083
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:44
1084
-	__( 'ticket sale date', 'event_espresso' ),
1084
+	__('ticket sale date', 'event_espresso'),
1085 1085
 
1086 1086
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:45
1087
-	__( 'ticket name', 'event_espresso' ),
1087
+	__('ticket name', 'event_espresso'),
1088 1088
 
1089 1089
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:46
1090
-	__( 'ticket ID', 'event_espresso' ),
1090
+	__('ticket ID', 'event_espresso'),
1091 1091
 
1092 1092
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:52
1093
-	__( 'link', 'event_espresso' ),
1093
+	__('link', 'event_espresso'),
1094 1094
 
1095 1095
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:8
1096
-	__( 'ticket sales start date only', 'event_espresso' ),
1096
+	__('ticket sales start date only', 'event_espresso'),
1097 1097
 
1098 1098
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:9
1099
-	__( 'ticket sales end date only', 'event_espresso' ),
1099
+	__('ticket sales end date only', 'event_espresso'),
1100 1100
 
1101 1101
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:18
1102
-	__( 'Add New Ticket', 'event_espresso' ),
1102
+	__('Add New Ticket', 'event_espresso'),
1103 1103
 
1104 1104
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:32
1105
-	__( 'Add a single ticket and assign the dates to it', 'event_espresso' ),
1105
+	__('Add a single ticket and assign the dates to it', 'event_espresso'),
1106 1106
 
1107 1107
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:34
1108
-	__( 'Single Ticket', 'event_espresso' ),
1108
+	__('Single Ticket', 'event_espresso'),
1109 1109
 
1110 1110
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/TableView.tsx:39
1111
-	__( 'Tickets', 'event_espresso' ),
1111
+	__('Tickets', 'event_espresso'),
1112 1112
 
1113 1113
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:110
1114
-	__( 'Registrations', 'event_espresso' ),
1114
+	__('Registrations', 'event_espresso'),
1115 1115
 
1116 1116
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:51
1117
-	__( 'Goes on Sale', 'event_espresso' ),
1117
+	__('Goes on Sale', 'event_espresso'),
1118 1118
 
1119 1119
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:65
1120
-	__( 'Sale Ends', 'event_espresso' ),
1120
+	__('Sale Ends', 'event_espresso'),
1121 1121
 
1122 1122
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:66
1123
-	__( 'Ends', 'event_espresso' ),
1123
+	__('Ends', 'event_espresso'),
1124 1124
 
1125 1125
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:78
1126
-	__( 'Price', 'event_espresso' ),
1126
+	__('Price', 'event_espresso'),
1127 1127
 
1128 1128
 	// Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:88
1129
-	__( 'Quantity', 'event_espresso' ),
1129
+	__('Quantity', 'event_espresso'),
1130 1130
 
1131 1131
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:105
1132
-	__( 'Select a Venue for the Event', 'event_espresso' ),
1132
+	__('Select a Venue for the Event', 'event_espresso'),
1133 1133
 
1134 1134
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:21
1135
-	__( 'Venue Details', 'event_espresso' ),
1135
+	__('Venue Details', 'event_espresso'),
1136 1136
 
1137 1137
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:38
1138
-	__( 'unlimited space', 'event_espresso' ),
1138
+	__('unlimited space', 'event_espresso'),
1139 1139
 
1140 1140
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:41
1141 1141
 	/* translators: %d venue capacity */
1142
-	__( 'Space for up to %d people', 'event_espresso' ),
1142
+	__('Space for up to %d people', 'event_espresso'),
1143 1143
 
1144 1144
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:60
1145
-	__( 'no image', 'event_espresso' ),
1145
+	__('no image', 'event_espresso'),
1146 1146
 
1147 1147
 	// Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:96
1148
-	__( 'Edit this Venue', 'event_espresso' ),
1148
+	__('Edit this Venue', 'event_espresso'),
1149 1149
 
1150 1150
 	// Reference: domains/core/admin/wpPluginsPage/src/exitSurvey/Popup.tsx:29
1151
-	__( 'Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso' ),
1151
+	__('Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso'),
1152 1152
 
1153 1153
 	// Reference: domains/core/admin/wpPluginsPage/src/exitSurvey/Popup.tsx:40
1154
-	__( 'Skip', 'event_espresso' ),
1154
+	__('Skip', 'event_espresso'),
1155 1155
 
1156 1156
 	// Reference: domains/core/admin/wpPluginsPage/src/exitSurvey/Popup.tsx:42
1157
-	__( 'Sure I\'ll help', 'event_espresso' ),
1157
+	__('Sure I\'ll help', 'event_espresso'),
1158 1158
 
1159 1159
 	// Reference: packages/adapters/src/Pagination/Pagination.tsx:23
1160
-	__( 'pagination', 'event_espresso' ),
1160
+	__('pagination', 'event_espresso'),
1161 1161
 
1162 1162
 	// Reference: packages/adapters/src/TagSelector/TagSelector.tsx:112
1163
-	__( 'toggle menu', 'event_espresso' ),
1163
+	__('toggle menu', 'event_espresso'),
1164 1164
 
1165 1165
 	// Reference: packages/constants/src/datetime.ts:10
1166
-	__( 'Postponed', 'event_espresso' ),
1166
+	__('Postponed', 'event_espresso'),
1167 1167
 
1168 1168
 	// Reference: packages/constants/src/datetime.ts:11
1169
-	__( 'SoldOut', 'event_espresso' ),
1169
+	__('SoldOut', 'event_espresso'),
1170 1170
 
1171 1171
 	// Reference: packages/constants/src/datetime.ts:7
1172 1172
 	// Reference: packages/predicates/src/registration/statusOptions.ts:11
1173
-	__( 'Cancelled', 'event_espresso' ),
1173
+	__('Cancelled', 'event_espresso'),
1174 1174
 
1175 1175
 	// Reference: packages/constants/src/datetime.ts:9
1176
-	__( 'Inactive', 'event_espresso' ),
1176
+	__('Inactive', 'event_espresso'),
1177 1177
 
1178 1178
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:25
1179
-	__( 'error creating %s', 'event_espresso' ),
1179
+	__('error creating %s', 'event_espresso'),
1180 1180
 
1181 1181
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:26
1182
-	__( 'error deleting %s', 'event_espresso' ),
1182
+	__('error deleting %s', 'event_espresso'),
1183 1183
 
1184 1184
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:27
1185
-	__( 'error updating %s', 'event_espresso' ),
1185
+	__('error updating %s', 'event_espresso'),
1186 1186
 
1187 1187
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:28
1188
-	__( 'creating %s', 'event_espresso' ),
1188
+	__('creating %s', 'event_espresso'),
1189 1189
 
1190 1190
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:29
1191
-	__( 'deleting %s', 'event_espresso' ),
1191
+	__('deleting %s', 'event_espresso'),
1192 1192
 
1193 1193
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:30
1194
-	__( 'updating %s', 'event_espresso' ),
1194
+	__('updating %s', 'event_espresso'),
1195 1195
 
1196 1196
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:31
1197
-	__( 'successfully created %s', 'event_espresso' ),
1197
+	__('successfully created %s', 'event_espresso'),
1198 1198
 
1199 1199
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:32
1200
-	__( 'successfully deleted %s', 'event_espresso' ),
1200
+	__('successfully deleted %s', 'event_espresso'),
1201 1201
 
1202 1202
 	// Reference: packages/data/src/mutations/useMutationWithFeedback.ts:33
1203
-	__( 'successfully updated %s', 'event_espresso' ),
1203
+	__('successfully updated %s', 'event_espresso'),
1204 1204
 
1205 1205
 	// Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:13
1206
-	__( 'day in range', 'event_espresso' ),
1206
+	__('day in range', 'event_espresso'),
1207 1207
 
1208 1208
 	// Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:17
1209 1209
 	// Reference: packages/dates/src/components/DateRangePicker/index.tsx:79
1210
-	__( 'end date', 'event_espresso' ),
1210
+	__('end date', 'event_espresso'),
1211 1211
 
1212 1212
 	// Reference: packages/dates/src/components/DateTimePicker.tsx:13
1213 1213
 	// Reference: packages/dates/src/components/TimePicker.tsx:14
1214 1214
 	// Reference: packages/form-builder/src/state/utils.ts:433
1215
-	__( 'time', 'event_espresso' ),
1215
+	__('time', 'event_espresso'),
1216 1216
 
1217 1217
 	// Reference: packages/dates/src/constants.ts:5
1218
-	__( 'End Date & Time must be set later than the Start Date & Time', 'event_espresso' ),
1218
+	__('End Date & Time must be set later than the Start Date & Time', 'event_espresso'),
1219 1219
 
1220 1220
 	// Reference: packages/dates/src/constants.ts:7
1221
-	__( 'Start Date & Time must be set before the End Date & Time', 'event_espresso' ),
1221
+	__('Start Date & Time must be set before the End Date & Time', 'event_espresso'),
1222 1222
 
1223 1223
 	// Reference: packages/dates/src/utils/misc.ts:16
1224
-	__( 'month(s)', 'event_espresso' ),
1224
+	__('month(s)', 'event_espresso'),
1225 1225
 
1226 1226
 	// Reference: packages/dates/src/utils/misc.ts:17
1227
-	__( 'week(s)', 'event_espresso' ),
1227
+	__('week(s)', 'event_espresso'),
1228 1228
 
1229 1229
 	// Reference: packages/dates/src/utils/misc.ts:18
1230
-	__( 'day(s)', 'event_espresso' ),
1230
+	__('day(s)', 'event_espresso'),
1231 1231
 
1232 1232
 	// Reference: packages/dates/src/utils/misc.ts:19
1233
-	__( 'hour(s)', 'event_espresso' ),
1233
+	__('hour(s)', 'event_espresso'),
1234 1234
 
1235 1235
 	// Reference: packages/dates/src/utils/misc.ts:20
1236
-	__( 'minute(s)', 'event_espresso' ),
1236
+	__('minute(s)', 'event_espresso'),
1237 1237
 
1238 1238
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:107
1239
-	__( 'price types initialized', 'event_espresso' ),
1239
+	__('price types initialized', 'event_espresso'),
1240 1240
 
1241 1241
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:117
1242
-	__( 'datetimes initialized', 'event_espresso' ),
1242
+	__('datetimes initialized', 'event_espresso'),
1243 1243
 
1244 1244
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:127
1245
-	__( 'tickets initialized', 'event_espresso' ),
1245
+	__('tickets initialized', 'event_espresso'),
1246 1246
 
1247 1247
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:137
1248
-	__( 'prices initialized', 'event_espresso' ),
1248
+	__('prices initialized', 'event_espresso'),
1249 1249
 
1250 1250
 	// Reference: packages/edtr-services/src/apollo/mutations/useReorderEntities.ts:72
1251
-	__( 'reordering has been applied', 'event_espresso' ),
1251
+	__('reordering has been applied', 'event_espresso'),
1252 1252
 
1253 1253
 	// Reference: packages/edtr-services/src/constants.ts:24
1254
-	__( 'datetime', 'event_espresso' ),
1254
+	__('datetime', 'event_espresso'),
1255 1255
 
1256 1256
 	// Reference: packages/edtr-services/src/constants.ts:27
1257
-	__( 'price', 'event_espresso' ),
1257
+	__('price', 'event_espresso'),
1258 1258
 
1259 1259
 	// Reference: packages/edtr-services/src/constants.ts:28
1260 1260
 	// Reference: packages/tpc/src/inputs/PriceTypeInput.tsx:19
1261
-	__( 'price type', 'event_espresso' ),
1261
+	__('price type', 'event_espresso'),
1262 1262
 
1263 1263
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:38
1264 1264
 	// Reference: packages/ui-components/src/EditDateRangeButton/EditDateRangeButton.tsx:39
1265
-	__( 'End date has been adjusted', 'event_espresso' ),
1265
+	__('End date has been adjusted', 'event_espresso'),
1266 1266
 
1267 1267
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:59
1268
-	__( 'Required', 'event_espresso' ),
1268
+	__('Required', 'event_espresso'),
1269 1269
 
1270 1270
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:64
1271
-	__( 'Start Date is required', 'event_espresso' ),
1271
+	__('Start Date is required', 'event_espresso'),
1272 1272
 
1273 1273
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:68
1274
-	__( 'End Date is required', 'event_espresso' ),
1274
+	__('End Date is required', 'event_espresso'),
1275 1275
 
1276 1276
 	// Reference: packages/ee-components/src/EntityList/EntityList.tsx:31
1277
-	__( 'no results found', 'event_espresso' ),
1277
+	__('no results found', 'event_espresso'),
1278 1278
 
1279 1279
 	// Reference: packages/ee-components/src/EntityList/EntityList.tsx:32
1280
-	__( 'try changing filter settings', 'event_espresso' ),
1280
+	__('try changing filter settings', 'event_espresso'),
1281 1281
 
1282 1282
 	// Reference: packages/ee-components/src/bulkEdit/ActionCheckbox.tsx:38
1283 1283
 	/* translators: %d entity id */
1284
-	__( 'select entity with id %d', 'event_espresso' ),
1284
+	__('select entity with id %d', 'event_espresso'),
1285 1285
 
1286 1286
 	// Reference: packages/ee-components/src/bulkEdit/ActionCheckbox.tsx:41
1287
-	__( 'select all entities', 'event_espresso' ),
1287
+	__('select all entities', 'event_espresso'),
1288 1288
 
1289 1289
 	// Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:20
1290
-	__( 'Note: ', 'event_espresso' ),
1290
+	__('Note: ', 'event_espresso'),
1291 1291
 
1292 1292
 	// Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:20
1293
-	__( 'any changes will be applied to ALL of the selected entities.', 'event_espresso' ),
1293
+	__('any changes will be applied to ALL of the selected entities.', 'event_espresso'),
1294 1294
 
1295 1295
 	// Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:27
1296
-	__( 'Bulk edit details', 'event_espresso' ),
1296
+	__('Bulk edit details', 'event_espresso'),
1297 1297
 
1298 1298
 	// Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:17
1299
-	__( 'Are you sure you want to bulk update the details?', 'event_espresso' ),
1299
+	__('Are you sure you want to bulk update the details?', 'event_espresso'),
1300 1300
 
1301 1301
 	// Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:18
1302
-	__( 'Bulk update details', 'event_espresso' ),
1302
+	__('Bulk update details', 'event_espresso'),
1303 1303
 
1304 1304
 	// Reference: packages/ee-components/src/filterBar/SortByControl/index.tsx:27
1305
-	__( 'reorder dates', 'event_espresso' ),
1305
+	__('reorder dates', 'event_espresso'),
1306 1306
 
1307 1307
 	// Reference: packages/ee-components/src/filterBar/SortByControl/index.tsx:27
1308
-	__( 'reorder tickets', 'event_espresso' ),
1308
+	__('reorder tickets', 'event_espresso'),
1309 1309
 
1310 1310
 	// Reference: packages/form-builder/src/FormElement/FormElementToolbar.tsx:32
1311
-	__( 'delete form element', 'event_espresso' ),
1311
+	__('delete form element', 'event_espresso'),
1312 1312
 
1313 1313
 	// Reference: packages/form-builder/src/FormElement/FormElementToolbar.tsx:49
1314
-	__( 'form element settings', 'event_espresso' ),
1314
+	__('form element settings', 'event_espresso'),
1315 1315
 
1316 1316
 	// Reference: packages/form-builder/src/FormElement/FormElementToolbar.tsx:59
1317
-	__( 'copy form element', 'event_espresso' ),
1317
+	__('copy form element', 'event_espresso'),
1318 1318
 
1319 1319
 	// Reference: packages/form-builder/src/FormElement/FormElementToolbar.tsx:69
1320
-	__( 'click, hold, and drag to reorder form element', 'event_espresso' ),
1320
+	__('click, hold, and drag to reorder form element', 'event_espresso'),
1321 1321
 
1322 1322
 	// Reference: packages/form-builder/src/FormElement/Tabs/FieldOption.tsx:20
1323
-	__( 'remove option', 'event_espresso' ),
1323
+	__('remove option', 'event_espresso'),
1324 1324
 
1325 1325
 	// Reference: packages/form-builder/src/FormElement/Tabs/FieldOption.tsx:42
1326
-	__( 'value', 'event_espresso' ),
1326
+	__('value', 'event_espresso'),
1327 1327
 
1328 1328
 	// Reference: packages/form-builder/src/FormElement/Tabs/FieldOption.tsx:52
1329
-	__( 'label', 'event_espresso' ),
1329
+	__('label', 'event_espresso'),
1330 1330
 
1331 1331
 	// Reference: packages/form-builder/src/FormElement/Tabs/FieldOption.tsx:63
1332
-	__( 'click, hold, and drag to reorder field option', 'event_espresso' ),
1332
+	__('click, hold, and drag to reorder field option', 'event_espresso'),
1333 1333
 
1334 1334
 	// Reference: packages/form-builder/src/FormElement/Tabs/FieldOptions.tsx:61
1335
-	__( 'Options are the choices you give people to select from.', 'event_espresso' ),
1335
+	__('Options are the choices you give people to select from.', 'event_espresso'),
1336 1336
 
1337 1337
 	// Reference: packages/form-builder/src/FormElement/Tabs/FieldOptions.tsx:63
1338
-	__( 'The value is a simple key that will be saved to the database and the label is what is shown to the user.', 'event_espresso' ),
1338
+	__('The value is a simple key that will be saved to the database and the label is what is shown to the user.', 'event_espresso'),
1339 1339
 
1340 1340
 	// Reference: packages/form-builder/src/FormElement/Tabs/FieldOptions.tsx:96
1341
-	__( 'add new option', 'event_espresso' ),
1341
+	__('add new option', 'event_espresso'),
1342 1342
 
1343 1343
 	// Reference: packages/form-builder/src/FormElement/Tabs/FormElementTabs.tsx:26
1344 1344
 	// Reference: packages/form-builder/src/FormSection/Tabs/FormSectionTabs.tsx:25
1345
-	__( 'Styles', 'event_espresso' ),
1345
+	__('Styles', 'event_espresso'),
1346 1346
 
1347 1347
 	// Reference: packages/form-builder/src/FormElement/Tabs/FormElementTabs.tsx:30
1348
-	__( 'Validation', 'event_espresso' ),
1348
+	__('Validation', 'event_espresso'),
1349 1349
 
1350 1350
 	// Reference: packages/form-builder/src/FormElement/Tabs/InputType.tsx:18
1351
-	__( 'Change input type', 'event_espresso' ),
1351
+	__('Change input type', 'event_espresso'),
1352 1352
 
1353 1353
 	// Reference: packages/form-builder/src/FormElement/Tabs/InputType.tsx:19
1354
-	__( 'Some configurations might be lost. Are you sure you want to change the input type?', 'event_espresso' ),
1354
+	__('Some configurations might be lost. Are you sure you want to change the input type?', 'event_espresso'),
1355 1355
 
1356 1356
 	// Reference: packages/form-builder/src/FormElement/Tabs/InputType.tsx:40
1357
-	__( 'type', 'event_espresso' ),
1357
+	__('type', 'event_espresso'),
1358 1358
 
1359 1359
 	// Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:26
1360 1360
 	// Reference: packages/form-builder/src/FormSection/Tabs/Settings.tsx:17
1361
-	__( 'public label', 'event_espresso' ),
1361
+	__('public label', 'event_espresso'),
1362 1362
 
1363 1363
 	// Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:33
1364 1364
 	// Reference: packages/form-builder/src/FormSection/Tabs/Settings.tsx:22
1365
-	__( 'admin label', 'event_espresso' ),
1365
+	__('admin label', 'event_espresso'),
1366 1366
 
1367 1367
 	// Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:40
1368
-	__( 'content', 'event_espresso' ),
1368
+	__('content', 'event_espresso'),
1369 1369
 
1370 1370
 	// Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:48
1371
-	__( 'options', 'event_espresso' ),
1371
+	__('options', 'event_espresso'),
1372 1372
 
1373 1373
 	// Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:51
1374
-	__( 'placeholder', 'event_espresso' ),
1374
+	__('placeholder', 'event_espresso'),
1375 1375
 
1376 1376
 	// Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:57
1377
-	__( 'admin only', 'event_espresso' ),
1377
+	__('admin only', 'event_espresso'),
1378 1378
 
1379 1379
 	// Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:62
1380
-	__( 'help text', 'event_espresso' ),
1380
+	__('help text', 'event_espresso'),
1381 1381
 
1382 1382
 	// Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:71
1383
-	__( 'maps to', 'event_espresso' ),
1383
+	__('maps to', 'event_espresso'),
1384 1384
 
1385 1385
 	// Reference: packages/form-builder/src/FormElement/Tabs/Styles.tsx:15
1386 1386
 	// Reference: packages/form-builder/src/FormSection/Tabs/Styles.tsx:13
1387
-	__( 'css class', 'event_espresso' ),
1387
+	__('css class', 'event_espresso'),
1388 1388
 
1389 1389
 	// Reference: packages/form-builder/src/FormElement/Tabs/Styles.tsx:20
1390
-	__( 'help text css class', 'event_espresso' ),
1390
+	__('help text css class', 'event_espresso'),
1391 1391
 
1392 1392
 	// Reference: packages/form-builder/src/FormElement/Tabs/Styles.tsx:27
1393
-	__( 'size', 'event_espresso' ),
1393
+	__('size', 'event_espresso'),
1394 1394
 
1395 1395
 	// Reference: packages/form-builder/src/FormElement/Tabs/Styles.tsx:35
1396
-	__( 'step', 'event_espresso' ),
1396
+	__('step', 'event_espresso'),
1397 1397
 
1398 1398
 	// Reference: packages/form-builder/src/FormElement/Tabs/Styles.tsx:41
1399
-	__( 'maxlength', 'event_espresso' ),
1399
+	__('maxlength', 'event_espresso'),
1400 1400
 
1401 1401
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:123
1402
-	__( 'min', 'event_espresso' ),
1402
+	__('min', 'event_espresso'),
1403 1403
 
1404 1404
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:128
1405
-	__( 'max', 'event_espresso' ),
1405
+	__('max', 'event_espresso'),
1406 1406
 
1407 1407
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:28
1408
-	__( 'Germany', 'event_espresso' ),
1408
+	__('Germany', 'event_espresso'),
1409 1409
 
1410 1410
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:32
1411
-	__( 'France', 'event_espresso' ),
1411
+	__('France', 'event_espresso'),
1412 1412
 
1413 1413
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:36
1414
-	__( 'United Kingdom', 'event_espresso' ),
1414
+	__('United Kingdom', 'event_espresso'),
1415 1415
 
1416 1416
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:40
1417
-	__( 'United States', 'event_espresso' ),
1417
+	__('United States', 'event_espresso'),
1418 1418
 
1419 1419
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:44
1420
-	__( 'Custom', 'event_espresso' ),
1420
+	__('Custom', 'event_espresso'),
1421 1421
 
1422 1422
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:54
1423
-	__( 'required', 'event_espresso' ),
1423
+	__('required', 'event_espresso'),
1424 1424
 
1425 1425
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:59
1426
-	__( 'required text', 'event_espresso' ),
1426
+	__('required text', 'event_espresso'),
1427 1427
 
1428 1428
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:66
1429
-	__( 'autocomplete', 'event_espresso' ),
1429
+	__('autocomplete', 'event_espresso'),
1430 1430
 
1431 1431
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:74
1432
-	__( 'custom format', 'event_espresso' ),
1432
+	__('custom format', 'event_espresso'),
1433 1433
 
1434 1434
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:75
1435
-	__( 'format', 'event_espresso' ),
1435
+	__('format', 'event_espresso'),
1436 1436
 
1437 1437
 	// Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:83
1438
-	__( 'pattern', 'event_espresso' ),
1438
+	__('pattern', 'event_espresso'),
1439 1439
 
1440 1440
 	// Reference: packages/form-builder/src/FormSection/AddFormElementPopover.tsx:110
1441
-	__( 'add new form element', 'event_espresso' ),
1441
+	__('add new form element', 'event_espresso'),
1442 1442
 
1443 1443
 	// Reference: packages/form-builder/src/FormSection/AddFormElementPopover.tsx:117
1444 1444
 	// Reference: packages/form/src/renderers/RepeatableRenderer.tsx:52
1445
-	__( 'Add', 'event_espresso' ),
1445
+	__('Add', 'event_espresso'),
1446 1446
 
1447 1447
 	// Reference: packages/form-builder/src/FormSection/AddFormElementPopover.tsx:76
1448
-	__( 'Add Form Element', 'event_espresso' ),
1448
+	__('Add Form Element', 'event_espresso'),
1449 1449
 
1450 1450
 	// Reference: packages/form-builder/src/FormSection/AddFormElementPopover.tsx:85
1451
-	__( 'form element order can be changed after adding by using the drag handles in the form element toolbar', 'event_espresso' ),
1451
+	__('form element order can be changed after adding by using the drag handles in the form element toolbar', 'event_espresso'),
1452 1452
 
1453 1453
 	// Reference: packages/form-builder/src/FormSection/AddFormElementPopover.tsx:92
1454
-	__( 'load existing form section', 'event_espresso' ),
1454
+	__('load existing form section', 'event_espresso'),
1455 1455
 
1456 1456
 	// Reference: packages/form-builder/src/FormSection/FormSectionToolbar.tsx:32
1457
-	__( 'delete form section', 'event_espresso' ),
1457
+	__('delete form section', 'event_espresso'),
1458 1458
 
1459 1459
 	// Reference: packages/form-builder/src/FormSection/FormSectionToolbar.tsx:47
1460
-	__( 'form section settings', 'event_espresso' ),
1460
+	__('form section settings', 'event_espresso'),
1461 1461
 
1462 1462
 	// Reference: packages/form-builder/src/FormSection/FormSectionToolbar.tsx:57
1463
-	__( 'copy form section', 'event_espresso' ),
1463
+	__('copy form section', 'event_espresso'),
1464 1464
 
1465 1465
 	// Reference: packages/form-builder/src/FormSection/FormSectionToolbar.tsx:74
1466
-	__( 'click, hold, and drag to reorder form section', 'event_espresso' ),
1466
+	__('click, hold, and drag to reorder form section', 'event_espresso'),
1467 1467
 
1468 1468
 	// Reference: packages/form-builder/src/FormSection/FormSections.tsx:26
1469
-	__( 'Add Form Section', 'event_espresso' ),
1469
+	__('Add Form Section', 'event_espresso'),
1470 1470
 
1471 1471
 	// Reference: packages/form-builder/src/FormSection/SaveSection.tsx:47
1472
-	__( 'save form section for use in other forms', 'event_espresso' ),
1472
+	__('save form section for use in other forms', 'event_espresso'),
1473 1473
 
1474 1474
 	// Reference: packages/form-builder/src/FormSection/SaveSection.tsx:51
1475
-	__( 'save as', 'event_espresso' ),
1475
+	__('save as', 'event_espresso'),
1476 1476
 
1477 1477
 	// Reference: packages/form-builder/src/FormSection/SaveSection.tsx:55
1478
-	__( 'default', 'event_espresso' ),
1478
+	__('default', 'event_espresso'),
1479 1479
 
1480 1480
 	// Reference: packages/form-builder/src/FormSection/SaveSection.tsx:58
1481
-	__( ' a copy of this form section will be automatically added to ALL new events', 'event_espresso' ),
1481
+	__(' a copy of this form section will be automatically added to ALL new events', 'event_espresso'),
1482 1482
 
1483 1483
 	// Reference: packages/form-builder/src/FormSection/SaveSection.tsx:61
1484
-	__( 'shared', 'event_espresso' ),
1484
+	__('shared', 'event_espresso'),
1485 1485
 
1486 1486
 	// Reference: packages/form-builder/src/FormSection/SaveSection.tsx:64
1487
-	__( 'a copy of this form section will be saved for use in other events but not loaded by default', 'event_espresso' ),
1487
+	__('a copy of this form section will be saved for use in other events but not loaded by default', 'event_espresso'),
1488 1488
 
1489 1489
 	// Reference: packages/form-builder/src/FormSection/Tabs/Settings.tsx:27
1490
-	__( 'show label', 'event_espresso' ),
1490
+	__('show label', 'event_espresso'),
1491 1491
 
1492 1492
 	// Reference: packages/form-builder/src/FormSection/Tabs/Settings.tsx:33
1493
-	__( 'applies to', 'event_espresso' ),
1493
+	__('applies to', 'event_espresso'),
1494 1494
 
1495 1495
 	// Reference: packages/form-builder/src/constants.ts:102
1496 1496
 	// Reference: packages/form-builder/src/state/utils.ts:436
1497
-	__( 'URL', 'event_espresso' ),
1497
+	__('URL', 'event_espresso'),
1498 1498
 
1499 1499
 	// Reference: packages/form-builder/src/constants.ts:104
1500
-	__( 'adds a text input for entering a URL address', 'event_espresso' ),
1500
+	__('adds a text input for entering a URL address', 'event_espresso'),
1501 1501
 
1502 1502
 	// Reference: packages/form-builder/src/constants.ts:107
1503
-	__( 'Date', 'event_espresso' ),
1503
+	__('Date', 'event_espresso'),
1504 1504
 
1505 1505
 	// Reference: packages/form-builder/src/constants.ts:109
1506
-	__( 'adds a text input that allows users to enter a date directly via keyboard or a datepicker', 'event_espresso' ),
1506
+	__('adds a text input that allows users to enter a date directly via keyboard or a datepicker', 'event_espresso'),
1507 1507
 
1508 1508
 	// Reference: packages/form-builder/src/constants.ts:112
1509 1509
 	// Reference: packages/form-builder/src/state/utils.ts:369
1510
-	__( 'Local Date', 'event_espresso' ),
1510
+	__('Local Date', 'event_espresso'),
1511 1511
 
1512 1512
 	// Reference: packages/form-builder/src/constants.ts:117
1513
-	__( 'Month', 'event_espresso' ),
1513
+	__('Month', 'event_espresso'),
1514 1514
 
1515 1515
 	// Reference: packages/form-builder/src/constants.ts:119
1516
-	__( 'adds a text input that allows users to enter a month and year directly via keyboard or a datepicker', 'event_espresso' ),
1516
+	__('adds a text input that allows users to enter a month and year directly via keyboard or a datepicker', 'event_espresso'),
1517 1517
 
1518 1518
 	// Reference: packages/form-builder/src/constants.ts:122
1519
-	__( 'Time', 'event_espresso' ),
1519
+	__('Time', 'event_espresso'),
1520 1520
 
1521 1521
 	// Reference: packages/form-builder/src/constants.ts:124
1522
-	__( 'adds a text input that allows users to enter a time directly via keyboard or a timepicker', 'event_espresso' ),
1522
+	__('adds a text input that allows users to enter a time directly via keyboard or a timepicker', 'event_espresso'),
1523 1523
 
1524 1524
 	// Reference: packages/form-builder/src/constants.ts:127
1525
-	__( 'Week', 'event_espresso' ),
1525
+	__('Week', 'event_espresso'),
1526 1526
 
1527 1527
 	// Reference: packages/form-builder/src/constants.ts:129
1528
-	__( 'adds a text input that allows users to enter a week and year directly via keyboard or a datepicker', 'event_espresso' ),
1528
+	__('adds a text input that allows users to enter a week and year directly via keyboard or a datepicker', 'event_espresso'),
1529 1529
 
1530 1530
 	// Reference: packages/form-builder/src/constants.ts:132
1531
-	__( 'Day Selector', 'event_espresso' ),
1531
+	__('Day Selector', 'event_espresso'),
1532 1532
 
1533 1533
 	// Reference: packages/form-builder/src/constants.ts:134
1534
-	__( 'adds a dropdown selector that allows users to select the day of the month (01 to 31)', 'event_espresso' ),
1534
+	__('adds a dropdown selector that allows users to select the day of the month (01 to 31)', 'event_espresso'),
1535 1535
 
1536 1536
 	// Reference: packages/form-builder/src/constants.ts:137
1537
-	__( 'Month Selector', 'event_espresso' ),
1537
+	__('Month Selector', 'event_espresso'),
1538 1538
 
1539 1539
 	// Reference: packages/form-builder/src/constants.ts:139
1540
-	__( 'adds a dropdown selector that allows users to select the month of the year (01 to 12)', 'event_espresso' ),
1540
+	__('adds a dropdown selector that allows users to select the month of the year (01 to 12)', 'event_espresso'),
1541 1541
 
1542 1542
 	// Reference: packages/form-builder/src/constants.ts:142
1543
-	__( 'Year Selector', 'event_espresso' ),
1543
+	__('Year Selector', 'event_espresso'),
1544 1544
 
1545 1545
 	// Reference: packages/form-builder/src/constants.ts:144
1546
-	__( 'adds a dropdown selector that allows users to select the year from a configurable range', 'event_espresso' ),
1546
+	__('adds a dropdown selector that allows users to select the year from a configurable range', 'event_espresso'),
1547 1547
 
1548 1548
 	// Reference: packages/form-builder/src/constants.ts:147
1549
-	__( 'Radio Buttons', 'event_espresso' ),
1549
+	__('Radio Buttons', 'event_espresso'),
1550 1550
 
1551 1551
 	// Reference: packages/form-builder/src/constants.ts:149
1552
-	__( 'adds one or more radio buttons that allow users to only select one option from those provided', 'event_espresso' ),
1552
+	__('adds one or more radio buttons that allow users to only select one option from those provided', 'event_espresso'),
1553 1553
 
1554 1554
 	// Reference: packages/form-builder/src/constants.ts:152
1555 1555
 	// Reference: packages/form-builder/src/state/utils.ts:375
1556
-	__( 'Decimal Number', 'event_espresso' ),
1556
+	__('Decimal Number', 'event_espresso'),
1557 1557
 
1558 1558
 	// Reference: packages/form-builder/src/constants.ts:154
1559
-	__( 'adds a text input that only accepts numbers whose value is a decimal (float)', 'event_espresso' ),
1559
+	__('adds a text input that only accepts numbers whose value is a decimal (float)', 'event_espresso'),
1560 1560
 
1561 1561
 	// Reference: packages/form-builder/src/constants.ts:157
1562 1562
 	// Reference: packages/form-builder/src/state/utils.ts:378
1563
-	__( 'Whole Number', 'event_espresso' ),
1563
+	__('Whole Number', 'event_espresso'),
1564 1564
 
1565 1565
 	// Reference: packages/form-builder/src/constants.ts:159
1566
-	__( 'adds a text input that only accepts numbers whose value is an integer (whole number)', 'event_espresso' ),
1566
+	__('adds a text input that only accepts numbers whose value is an integer (whole number)', 'event_espresso'),
1567 1567
 
1568 1568
 	// Reference: packages/form-builder/src/constants.ts:162
1569
-	__( 'Number Range', 'event_espresso' ),
1569
+	__('Number Range', 'event_espresso'),
1570 1570
 
1571 1571
 	// Reference: packages/form-builder/src/constants.ts:167
1572
-	__( 'Phone Number', 'event_espresso' ),
1572
+	__('Phone Number', 'event_espresso'),
1573 1573
 
1574 1574
 	// Reference: packages/form-builder/src/constants.ts:172
1575
-	__( 'Dropdown', 'event_espresso' ),
1575
+	__('Dropdown', 'event_espresso'),
1576 1576
 
1577 1577
 	// Reference: packages/form-builder/src/constants.ts:174
1578
-	__( 'adds a dropdown selector that accepts a single value', 'event_espresso' ),
1578
+	__('adds a dropdown selector that accepts a single value', 'event_espresso'),
1579 1579
 
1580 1580
 	// Reference: packages/form-builder/src/constants.ts:177
1581
-	__( 'Multi Select', 'event_espresso' ),
1581
+	__('Multi Select', 'event_espresso'),
1582 1582
 
1583 1583
 	// Reference: packages/form-builder/src/constants.ts:179
1584
-	__( 'adds a dropdown selector that accepts multiple values', 'event_espresso' ),
1584
+	__('adds a dropdown selector that accepts multiple values', 'event_espresso'),
1585 1585
 
1586 1586
 	// Reference: packages/form-builder/src/constants.ts:182
1587
-	__( 'Toggle/Switch', 'event_espresso' ),
1587
+	__('Toggle/Switch', 'event_espresso'),
1588 1588
 
1589 1589
 	// Reference: packages/form-builder/src/constants.ts:184
1590
-	__( 'adds a toggle or a switch to accept true or false value', 'event_espresso' ),
1590
+	__('adds a toggle or a switch to accept true or false value', 'event_espresso'),
1591 1591
 
1592 1592
 	// Reference: packages/form-builder/src/constants.ts:187
1593
-	__( 'Multi Checkbox', 'event_espresso' ),
1593
+	__('Multi Checkbox', 'event_espresso'),
1594 1594
 
1595 1595
 	// Reference: packages/form-builder/src/constants.ts:189
1596
-	__( 'adds checkboxes that allow users to select zero or more options from those provided', 'event_espresso' ),
1596
+	__('adds checkboxes that allow users to select zero or more options from those provided', 'event_espresso'),
1597 1597
 
1598 1598
 	// Reference: packages/form-builder/src/constants.ts:192
1599
-	__( 'Country Selector', 'event_espresso' ),
1599
+	__('Country Selector', 'event_espresso'),
1600 1600
 
1601 1601
 	// Reference: packages/form-builder/src/constants.ts:194
1602
-	__( 'adds a dropdown selector populated with names of countries that are enabled for the site', 'event_espresso' ),
1602
+	__('adds a dropdown selector populated with names of countries that are enabled for the site', 'event_espresso'),
1603 1603
 
1604 1604
 	// Reference: packages/form-builder/src/constants.ts:197
1605
-	__( 'State Selector', 'event_espresso' ),
1605
+	__('State Selector', 'event_espresso'),
1606 1606
 
1607 1607
 	// Reference: packages/form-builder/src/constants.ts:202
1608
-	__( 'Button', 'event_espresso' ),
1608
+	__('Button', 'event_espresso'),
1609 1609
 
1610 1610
 	// Reference: packages/form-builder/src/constants.ts:204
1611
-	__( 'adds a button to the form that can be used for triggering fucntionality (requires custom coding)', 'event_espresso' ),
1611
+	__('adds a button to the form that can be used for triggering fucntionality (requires custom coding)', 'event_espresso'),
1612 1612
 
1613 1613
 	// Reference: packages/form-builder/src/constants.ts:207
1614
-	__( 'Reset Button', 'event_espresso' ),
1614
+	__('Reset Button', 'event_espresso'),
1615 1615
 
1616 1616
 	// Reference: packages/form-builder/src/constants.ts:209
1617
-	__( 'adds a button that will reset the form back to its original state.', 'event_espresso' ),
1617
+	__('adds a button that will reset the form back to its original state.', 'event_espresso'),
1618 1618
 
1619 1619
 	// Reference: packages/form-builder/src/constants.ts:55
1620
-	__( 'Form Section', 'event_espresso' ),
1620
+	__('Form Section', 'event_espresso'),
1621 1621
 
1622 1622
 	// Reference: packages/form-builder/src/constants.ts:57
1623
-	__( 'Used for creating logical groupings for questions and form elements. Need to add a heading or description? Use the HTML form element.', 'event_espresso' ),
1623
+	__('Used for creating logical groupings for questions and form elements. Need to add a heading or description? Use the HTML form element.', 'event_espresso'),
1624 1624
 
1625 1625
 	// Reference: packages/form-builder/src/constants.ts:62
1626
-	__( 'HTML Block', 'event_espresso' ),
1626
+	__('HTML Block', 'event_espresso'),
1627 1627
 
1628 1628
 	// Reference: packages/form-builder/src/constants.ts:64
1629
-	__( 'allows you to add HTML like headings or text paragraphs to your form', 'event_espresso' ),
1629
+	__('allows you to add HTML like headings or text paragraphs to your form', 'event_espresso'),
1630 1630
 
1631 1631
 	// Reference: packages/form-builder/src/constants.ts:69
1632
-	__( 'adds a text input that only accepts plain text', 'event_espresso' ),
1632
+	__('adds a text input that only accepts plain text', 'event_espresso'),
1633 1633
 
1634 1634
 	// Reference: packages/form-builder/src/constants.ts:72
1635
-	__( 'Plain Text Area', 'event_espresso' ),
1635
+	__('Plain Text Area', 'event_espresso'),
1636 1636
 
1637 1637
 	// Reference: packages/form-builder/src/constants.ts:74
1638
-	__( 'adds a textarea block that only accepts plain text', 'event_espresso' ),
1638
+	__('adds a textarea block that only accepts plain text', 'event_espresso'),
1639 1639
 
1640 1640
 	// Reference: packages/form-builder/src/constants.ts:77
1641
-	__( 'HTML Text Area', 'event_espresso' ),
1641
+	__('HTML Text Area', 'event_espresso'),
1642 1642
 
1643 1643
 	// Reference: packages/form-builder/src/constants.ts:79
1644
-	__( 'adds a textarea block that accepts text including simple HTML markup', 'event_espresso' ),
1644
+	__('adds a textarea block that accepts text including simple HTML markup', 'event_espresso'),
1645 1645
 
1646 1646
 	// Reference: packages/form-builder/src/constants.ts:84
1647
-	__( 'adds a text input that only accepts a valid email address', 'event_espresso' ),
1647
+	__('adds a text input that only accepts a valid email address', 'event_espresso'),
1648 1648
 
1649 1649
 	// Reference: packages/form-builder/src/constants.ts:87
1650
-	__( 'Email Confirmation', 'event_espresso' ),
1650
+	__('Email Confirmation', 'event_espresso'),
1651 1651
 
1652 1652
 	// Reference: packages/form-builder/src/constants.ts:92
1653
-	__( 'Password', 'event_espresso' ),
1653
+	__('Password', 'event_espresso'),
1654 1654
 
1655 1655
 	// Reference: packages/form-builder/src/constants.ts:94
1656
-	__( 'adds a text input that accepts text but masks what the user enters', 'event_espresso' ),
1656
+	__('adds a text input that accepts text but masks what the user enters', 'event_espresso'),
1657 1657
 
1658 1658
 	// Reference: packages/form-builder/src/constants.ts:97
1659
-	__( 'Password Confirmation', 'event_espresso' ),
1659
+	__('Password Confirmation', 'event_espresso'),
1660 1660
 
1661 1661
 	// Reference: packages/form-builder/src/data/useElementMutator.ts:54
1662
-	__( 'element', 'event_espresso' ),
1662
+	__('element', 'event_espresso'),
1663 1663
 
1664 1664
 	// Reference: packages/form-builder/src/data/useSectionMutator.ts:54
1665
-	__( 'section', 'event_espresso' ),
1665
+	__('section', 'event_espresso'),
1666 1666
 
1667 1667
 	// Reference: packages/form-builder/src/state/utils.ts:360
1668
-	__( 'click', 'event_espresso' ),
1668
+	__('click', 'event_espresso'),
1669 1669
 
1670 1670
 	// Reference: packages/form-builder/src/state/utils.ts:363
1671
-	__( 'checkboxes', 'event_espresso' ),
1671
+	__('checkboxes', 'event_espresso'),
1672 1672
 
1673 1673
 	// Reference: packages/form-builder/src/state/utils.ts:366
1674
-	__( 'date', 'event_espresso' ),
1674
+	__('date', 'event_espresso'),
1675 1675
 
1676 1676
 	// Reference: packages/form-builder/src/state/utils.ts:372
1677
-	__( 'day', 'event_espresso' ),
1677
+	__('day', 'event_espresso'),
1678 1678
 
1679 1679
 	// Reference: packages/form-builder/src/state/utils.ts:381
1680
-	__( 'email address', 'event_espresso' ),
1680
+	__('email address', 'event_espresso'),
1681 1681
 
1682 1682
 	// Reference: packages/form-builder/src/state/utils.ts:384
1683
-	__( 'confirm email address', 'event_espresso' ),
1683
+	__('confirm email address', 'event_espresso'),
1684 1684
 
1685 1685
 	// Reference: packages/form-builder/src/state/utils.ts:388
1686
-	__( 'month', 'event_espresso' ),
1686
+	__('month', 'event_espresso'),
1687 1687
 
1688 1688
 	// Reference: packages/form-builder/src/state/utils.ts:391
1689
-	__( 'password', 'event_espresso' ),
1689
+	__('password', 'event_espresso'),
1690 1690
 
1691 1691
 	// Reference: packages/form-builder/src/state/utils.ts:394
1692
-	__( 'confirm password', 'event_espresso' ),
1692
+	__('confirm password', 'event_espresso'),
1693 1693
 
1694 1694
 	// Reference: packages/form-builder/src/state/utils.ts:397
1695
-	__( 'radio buttons', 'event_espresso' ),
1695
+	__('radio buttons', 'event_espresso'),
1696 1696
 
1697 1697
 	// Reference: packages/form-builder/src/state/utils.ts:400
1698
-	__( 'number range', 'event_espresso' ),
1698
+	__('number range', 'event_espresso'),
1699 1699
 
1700 1700
 	// Reference: packages/form-builder/src/state/utils.ts:403
1701
-	__( 'selection dropdown', 'event_espresso' ),
1701
+	__('selection dropdown', 'event_espresso'),
1702 1702
 
1703 1703
 	// Reference: packages/form-builder/src/state/utils.ts:406
1704
-	__( 'country', 'event_espresso' ),
1704
+	__('country', 'event_espresso'),
1705 1705
 
1706 1706
 	// Reference: packages/form-builder/src/state/utils.ts:409
1707
-	__( 'multi-select dropdown', 'event_espresso' ),
1707
+	__('multi-select dropdown', 'event_espresso'),
1708 1708
 
1709 1709
 	// Reference: packages/form-builder/src/state/utils.ts:412
1710
-	__( 'state/province', 'event_espresso' ),
1710
+	__('state/province', 'event_espresso'),
1711 1711
 
1712 1712
 	// Reference: packages/form-builder/src/state/utils.ts:415
1713
-	__( 'on/off switch', 'event_espresso' ),
1713
+	__('on/off switch', 'event_espresso'),
1714 1714
 
1715 1715
 	// Reference: packages/form-builder/src/state/utils.ts:418
1716
-	__( 'reset', 'event_espresso' ),
1716
+	__('reset', 'event_espresso'),
1717 1717
 
1718 1718
 	// Reference: packages/form-builder/src/state/utils.ts:421
1719
-	__( 'phone number', 'event_espresso' ),
1719
+	__('phone number', 'event_espresso'),
1720 1720
 
1721 1721
 	// Reference: packages/form-builder/src/state/utils.ts:424
1722
-	__( 'text', 'event_espresso' ),
1722
+	__('text', 'event_espresso'),
1723 1723
 
1724 1724
 	// Reference: packages/form-builder/src/state/utils.ts:427
1725
-	__( 'simple textarea', 'event_espresso' ),
1725
+	__('simple textarea', 'event_espresso'),
1726 1726
 
1727 1727
 	// Reference: packages/form-builder/src/state/utils.ts:430
1728
-	__( 'html textarea', 'event_espresso' ),
1728
+	__('html textarea', 'event_espresso'),
1729 1729
 
1730 1730
 	// Reference: packages/form-builder/src/state/utils.ts:439
1731
-	__( 'week', 'event_espresso' ),
1731
+	__('week', 'event_espresso'),
1732 1732
 
1733 1733
 	// Reference: packages/form-builder/src/state/utils.ts:442
1734
-	__( 'year', 'event_espresso' ),
1734
+	__('year', 'event_espresso'),
1735 1735
 
1736 1736
 	// Reference: packages/form/src/adapters/WPMediaImage.tsx:12
1737
-	__( 'Select Image', 'event_espresso' ),
1737
+	__('Select Image', 'event_espresso'),
1738 1738
 
1739 1739
 	// Reference: packages/form/src/adapters/WPMediaImage.tsx:44
1740 1740
 	// Reference: packages/rich-text-editor/src/components/AdvancedTextEditor/toolbarButtons/WPMedia.tsx:11
1741 1741
 	// Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:12
1742 1742
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityTemplate.tsx:32
1743
-	__( 'Select', 'event_espresso' ),
1743
+	__('Select', 'event_espresso'),
1744 1744
 
1745 1745
 	// Reference: packages/form/src/renderers/RepeatableRenderer.tsx:36
1746 1746
 	/* translators: %d the entry number */
1747
-	__( 'Entry %d', 'event_espresso' ),
1747
+	__('Entry %d', 'event_espresso'),
1748 1748
 
1749 1749
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:11
1750 1750
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:17
1751
-	__( 'sold out', 'event_espresso' ),
1751
+	__('sold out', 'event_espresso'),
1752 1752
 
1753 1753
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:14
1754 1754
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:14
1755
-	__( 'expired', 'event_espresso' ),
1755
+	__('expired', 'event_espresso'),
1756 1756
 
1757 1757
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:17
1758
-	__( 'upcoming', 'event_espresso' ),
1758
+	__('upcoming', 'event_espresso'),
1759 1759
 
1760 1760
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:20
1761
-	__( 'active', 'event_espresso' ),
1761
+	__('active', 'event_espresso'),
1762 1762
 
1763 1763
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:23
1764 1764
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:11
1765
-	__( 'trashed', 'event_espresso' ),
1765
+	__('trashed', 'event_espresso'),
1766 1766
 
1767 1767
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:26
1768
-	__( 'cancelled', 'event_espresso' ),
1768
+	__('cancelled', 'event_espresso'),
1769 1769
 
1770 1770
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:29
1771
-	__( 'postponed', 'event_espresso' ),
1771
+	__('postponed', 'event_espresso'),
1772 1772
 
1773 1773
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:33
1774
-	__( 'inactive', 'event_espresso' ),
1774
+	__('inactive', 'event_espresso'),
1775 1775
 
1776 1776
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:20
1777
-	__( 'pending', 'event_espresso' ),
1777
+	__('pending', 'event_espresso'),
1778 1778
 
1779 1779
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:23
1780
-	__( 'on sale', 'event_espresso' ),
1780
+	__('on sale', 'event_espresso'),
1781 1781
 
1782 1782
 	// Reference: packages/predicates/src/registration/statusOptions.ts:16
1783
-	__( 'Declined', 'event_espresso' ),
1783
+	__('Declined', 'event_espresso'),
1784 1784
 
1785 1785
 	// Reference: packages/predicates/src/registration/statusOptions.ts:21
1786
-	__( 'Incomplete', 'event_espresso' ),
1786
+	__('Incomplete', 'event_espresso'),
1787 1787
 
1788 1788
 	// Reference: packages/predicates/src/registration/statusOptions.ts:26
1789
-	__( 'Not Approved', 'event_espresso' ),
1789
+	__('Not Approved', 'event_espresso'),
1790 1790
 
1791 1791
 	// Reference: packages/predicates/src/registration/statusOptions.ts:31
1792
-	__( 'Pending Payment', 'event_espresso' ),
1792
+	__('Pending Payment', 'event_espresso'),
1793 1793
 
1794 1794
 	// Reference: packages/predicates/src/registration/statusOptions.ts:36
1795
-	__( 'Wait List', 'event_espresso' ),
1795
+	__('Wait List', 'event_espresso'),
1796 1796
 
1797 1797
 	// Reference: packages/predicates/src/registration/statusOptions.ts:6
1798
-	__( 'Approved', 'event_espresso' ),
1798
+	__('Approved', 'event_espresso'),
1799 1799
 
1800 1800
 	// Reference: packages/rich-text-editor/src/components/AdvancedTextEditor/toolbarButtons/WPMedia.tsx:9
1801 1801
 	// Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:10
1802
-	__( 'Select media', 'event_espresso' ),
1802
+	__('Select media', 'event_espresso'),
1803 1803
 
1804 1804
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/RichTextEditor.tsx:84
1805
-	__( 'Write something…', 'event_espresso' ),
1805
+	__('Write something…', 'event_espresso'),
1806 1806
 
1807 1807
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/Toolbar.tsx:20
1808
-	__( 'RTE Toolbar', 'event_espresso' ),
1808
+	__('RTE Toolbar', 'event_espresso'),
1809 1809
 
1810 1810
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:11
1811
-	__( 'Normal', 'event_espresso' ),
1811
+	__('Normal', 'event_espresso'),
1812 1812
 
1813 1813
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:12
1814
-	__( 'H1', 'event_espresso' ),
1814
+	__('H1', 'event_espresso'),
1815 1815
 
1816 1816
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:13
1817
-	__( 'H2', 'event_espresso' ),
1817
+	__('H2', 'event_espresso'),
1818 1818
 
1819 1819
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:14
1820
-	__( 'H3', 'event_espresso' ),
1820
+	__('H3', 'event_espresso'),
1821 1821
 
1822 1822
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:15
1823
-	__( 'H4', 'event_espresso' ),
1823
+	__('H4', 'event_espresso'),
1824 1824
 
1825 1825
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:16
1826
-	__( 'H5', 'event_espresso' ),
1826
+	__('H5', 'event_espresso'),
1827 1827
 
1828 1828
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:17
1829
-	__( 'H6', 'event_espresso' ),
1829
+	__('H6', 'event_espresso'),
1830 1830
 
1831 1831
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:18
1832
-	__( 'Block quote', 'event_espresso' ),
1832
+	__('Block quote', 'event_espresso'),
1833 1833
 
1834 1834
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:19
1835
-	__( 'Code', 'event_espresso' ),
1835
+	__('Code', 'event_espresso'),
1836 1836
 
1837 1837
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:36
1838
-	__( 'Set color', 'event_espresso' ),
1838
+	__('Set color', 'event_espresso'),
1839 1839
 
1840 1840
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:45
1841
-	__( 'Text color', 'event_espresso' ),
1841
+	__('Text color', 'event_espresso'),
1842 1842
 
1843 1843
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:47
1844
-	__( 'Background color', 'event_espresso' ),
1844
+	__('Background color', 'event_espresso'),
1845 1845
 
1846 1846
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:39
1847
-	__( 'Add image', 'event_espresso' ),
1847
+	__('Add image', 'event_espresso'),
1848 1848
 
1849 1849
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:51
1850
-	__( 'Image URL', 'event_espresso' ),
1850
+	__('Image URL', 'event_espresso'),
1851 1851
 
1852 1852
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:55
1853
-	__( 'Alt text', 'event_espresso' ),
1853
+	__('Alt text', 'event_espresso'),
1854 1854
 
1855 1855
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:56
1856
-	__( 'Width', 'event_espresso' ),
1856
+	__('Width', 'event_espresso'),
1857 1857
 
1858 1858
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:60
1859
-	__( 'Height', 'event_espresso' ),
1859
+	__('Height', 'event_espresso'),
1860 1860
 
1861 1861
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/link/Component.tsx:54
1862
-	__( 'Edit link', 'event_espresso' ),
1862
+	__('Edit link', 'event_espresso'),
1863 1863
 
1864 1864
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/link/Component.tsx:64
1865
-	__( 'URL title', 'event_espresso' ),
1865
+	__('URL title', 'event_espresso'),
1866 1866
 
1867 1867
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:11
1868
-	__( 'Unordered list', 'event_espresso' ),
1868
+	__('Unordered list', 'event_espresso'),
1869 1869
 
1870 1870
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:12
1871
-	__( 'Ordered list', 'event_espresso' ),
1871
+	__('Ordered list', 'event_espresso'),
1872 1872
 
1873 1873
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:13
1874 1874
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:13
1875
-	__( 'Indent', 'event_espresso' ),
1875
+	__('Indent', 'event_espresso'),
1876 1876
 
1877 1877
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:14
1878 1878
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:14
1879
-	__( 'Outdent', 'event_espresso' ),
1879
+	__('Outdent', 'event_espresso'),
1880 1880
 
1881 1881
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:11
1882
-	__( 'Unordered textalign', 'event_espresso' ),
1882
+	__('Unordered textalign', 'event_espresso'),
1883 1883
 
1884 1884
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:12
1885
-	__( 'Ordered textalign', 'event_espresso' ),
1885
+	__('Ordered textalign', 'event_espresso'),
1886 1886
 
1887 1887
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/render/Image/Toolbar.tsx:32
1888
-	__( 'Image toolbar', 'event_espresso' ),
1888
+	__('Image toolbar', 'event_espresso'),
1889 1889
 
1890 1890
 	// Reference: packages/rich-text-editor/src/components/WithEditMode/WithEditMode.tsx:62
1891 1891
 	// Reference: packages/rich-text-editor/src/rte-old/components/RTEWithEditMode/RTEWithEditMode.tsx:35
1892
-	__( 'Visual editor', 'event_espresso' ),
1892
+	__('Visual editor', 'event_espresso'),
1893 1893
 
1894 1894
 	// Reference: packages/rich-text-editor/src/components/WithEditMode/WithEditMode.tsx:66
1895 1895
 	// Reference: packages/rich-text-editor/src/rte-old/components/RTEWithEditMode/RTEWithEditMode.tsx:39
1896
-	__( 'HTML editor', 'event_espresso' ),
1896
+	__('HTML editor', 'event_espresso'),
1897 1897
 
1898 1898
 	// Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:68
1899
-	__( 'Add Media', 'event_espresso' ),
1899
+	__('Add Media', 'event_espresso'),
1900 1900
 
1901 1901
 	// Reference: packages/tpc/src/buttons/AddPriceModifierButton.tsx:14
1902
-	__( 'add new price modifier after this row', 'event_espresso' ),
1902
+	__('add new price modifier after this row', 'event_espresso'),
1903 1903
 
1904 1904
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:14
1905
-	__( 'Delete all prices', 'event_espresso' ),
1905
+	__('Delete all prices', 'event_espresso'),
1906 1906
 
1907 1907
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:27
1908
-	__( 'Are you sure you want to delete all of this ticket\'s prices and make it free? This action is permanent and can not be undone.', 'event_espresso' ),
1908
+	__('Are you sure you want to delete all of this ticket\'s prices and make it free? This action is permanent and can not be undone.', 'event_espresso'),
1909 1909
 
1910 1910
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:31
1911
-	__( 'Delete all prices?', 'event_espresso' ),
1911
+	__('Delete all prices?', 'event_espresso'),
1912 1912
 
1913 1913
 	// Reference: packages/tpc/src/buttons/DeletePriceModifierButton.tsx:12
1914
-	__( 'delete price modifier', 'event_espresso' ),
1914
+	__('delete price modifier', 'event_espresso'),
1915 1915
 
1916 1916
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:14
1917
-	__( 'Ticket base price is being reverse calculated from bottom to top starting with the ticket total. Entering a new ticket total will reverse calculate the ticket base price after applying all price modifiers in reverse. Click to turn off reverse calculations', 'event_espresso' ),
1917
+	__('Ticket base price is being reverse calculated from bottom to top starting with the ticket total. Entering a new ticket total will reverse calculate the ticket base price after applying all price modifiers in reverse. Click to turn off reverse calculations', 'event_espresso'),
1918 1918
 
1919 1919
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:17
1920
-	__( 'Ticket total is being calculated normally from top to bottom starting from the base price. Entering a new ticket base price will recalculate the ticket total after applying all price modifiers. Click to turn on reverse calculations', 'event_espresso' ),
1920
+	__('Ticket total is being calculated normally from top to bottom starting from the base price. Entering a new ticket base price will recalculate the ticket total after applying all price modifiers. Click to turn on reverse calculations', 'event_espresso'),
1921 1921
 
1922 1922
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:21
1923
-	__( 'Disable reverse calculate', 'event_espresso' ),
1923
+	__('Disable reverse calculate', 'event_espresso'),
1924 1924
 
1925 1925
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:21
1926
-	__( 'Enable reverse calculate', 'event_espresso' ),
1926
+	__('Enable reverse calculate', 'event_espresso'),
1927 1927
 
1928 1928
 	// Reference: packages/tpc/src/buttons/TicketPriceCalculatorButton.tsx:28
1929
-	__( 'ticket price calculator', 'event_espresso' ),
1929
+	__('ticket price calculator', 'event_espresso'),
1930 1930
 
1931 1931
 	// Reference: packages/tpc/src/buttons/taxes/AddDefaultTaxesButton.tsx:9
1932
-	__( 'Add default taxes', 'event_espresso' ),
1932
+	__('Add default taxes', 'event_espresso'),
1933 1933
 
1934 1934
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:10
1935
-	__( 'Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso' ),
1935
+	__('Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso'),
1936 1936
 
1937 1937
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:14
1938
-	__( 'Remove all taxes?', 'event_espresso' ),
1938
+	__('Remove all taxes?', 'event_espresso'),
1939 1939
 
1940 1940
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:7
1941
-	__( 'Remove taxes', 'event_espresso' ),
1941
+	__('Remove taxes', 'event_espresso'),
1942 1942
 
1943 1943
 	// Reference: packages/tpc/src/components/DefaultPricesInfo.tsx:29
1944
-	__( 'Modify default prices.', 'event_espresso' ),
1944
+	__('Modify default prices.', 'event_espresso'),
1945 1945
 
1946 1946
 	// Reference: packages/tpc/src/components/DefaultTaxesInfo.tsx:29
1947
-	__( 'New default taxes are available. Click the - Add default taxes - button to add them now.', 'event_espresso' ),
1947
+	__('New default taxes are available. Click the - Add default taxes - button to add them now.', 'event_espresso'),
1948 1948
 
1949 1949
 	// Reference: packages/tpc/src/components/LockedTicketsBanner.tsx:12
1950
-	__( 'Editing of prices is disabled', 'event_espresso' ),
1950
+	__('Editing of prices is disabled', 'event_espresso'),
1951 1951
 
1952 1952
 	// Reference: packages/tpc/src/components/NoPricesBanner/AddDefaultPricesButton.tsx:9
1953
-	__( 'Add default prices', 'event_espresso' ),
1953
+	__('Add default prices', 'event_espresso'),
1954 1954
 
1955 1955
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:13
1956
-	__( 'This Ticket is Currently Free', 'event_espresso' ),
1956
+	__('This Ticket is Currently Free', 'event_espresso'),
1957 1957
 
1958 1958
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:21
1959 1959
 	/* translators: %s default prices */
1960
-	__( 'Click the button below to load your %s into the calculator.', 'event_espresso' ),
1960
+	__('Click the button below to load your %s into the calculator.', 'event_espresso'),
1961 1961
 
1962 1962
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:22
1963
-	__( 'default prices', 'event_espresso' ),
1963
+	__('default prices', 'event_espresso'),
1964 1964
 
1965 1965
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:29
1966
-	__( 'Additional ticket price modifiers can be added or removed.', 'event_espresso' ),
1966
+	__('Additional ticket price modifiers can be added or removed.', 'event_espresso'),
1967 1967
 
1968 1968
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:32
1969
-	__( 'Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso' ),
1969
+	__('Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso'),
1970 1970
 
1971 1971
 	// Reference: packages/tpc/src/components/TicketPriceCalculatorModal.tsx:32
1972 1972
 	/* translators: %s ticket name */
1973
-	__( 'Price Calculator for Ticket: %s', 'event_espresso' ),
1973
+	__('Price Calculator for Ticket: %s', 'event_espresso'),
1974 1974
 
1975 1975
 	// Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:48
1976
-	__( 'Total', 'event_espresso' ),
1976
+	__('Total', 'event_espresso'),
1977 1977
 
1978 1978
 	// Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:57
1979
-	__( 'ticket total', 'event_espresso' ),
1979
+	__('ticket total', 'event_espresso'),
1980 1980
 
1981 1981
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:29
1982
-	__( 'Order', 'event_espresso' ),
1982
+	__('Order', 'event_espresso'),
1983 1983
 
1984 1984
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:35
1985
-	__( 'Price Type', 'event_espresso' ),
1985
+	__('Price Type', 'event_espresso'),
1986 1986
 
1987 1987
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:41
1988
-	__( 'Label', 'event_espresso' ),
1988
+	__('Label', 'event_espresso'),
1989 1989
 
1990 1990
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:53
1991
-	__( 'Amount', 'event_espresso' ),
1991
+	__('Amount', 'event_espresso'),
1992 1992
 
1993 1993
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:22
1994
-	__( 'Copy ticket', 'event_espresso' ),
1994
+	__('Copy ticket', 'event_espresso'),
1995 1995
 
1996 1996
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:26
1997
-	__( 'Copy and archive this ticket', 'event_espresso' ),
1997
+	__('Copy and archive this ticket', 'event_espresso'),
1998 1998
 
1999 1999
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:29
2000
-	__( 'OK', 'event_espresso' ),
2000
+	__('OK', 'event_espresso'),
2001 2001
 
2002 2002
 	// Reference: packages/tpc/src/inputs/PriceAmountInput.tsx:32
2003
-	__( 'amount', 'event_espresso' ),
2003
+	__('amount', 'event_espresso'),
2004 2004
 
2005 2005
 	// Reference: packages/tpc/src/inputs/PriceAmountInput.tsx:44
2006
-	__( 'amount…', 'event_espresso' ),
2006
+	__('amount…', 'event_espresso'),
2007 2007
 
2008 2008
 	// Reference: packages/tpc/src/inputs/PriceDescriptionInput.tsx:14
2009
-	__( 'description…', 'event_espresso' ),
2009
+	__('description…', 'event_espresso'),
2010 2010
 
2011 2011
 	// Reference: packages/tpc/src/inputs/PriceDescriptionInput.tsx:9
2012
-	__( 'price description', 'event_espresso' ),
2012
+	__('price description', 'event_espresso'),
2013 2013
 
2014 2014
 	// Reference: packages/tpc/src/inputs/PriceIdInput.tsx:5
2015
-	__( 'price id', 'event_espresso' ),
2015
+	__('price id', 'event_espresso'),
2016 2016
 
2017 2017
 	// Reference: packages/tpc/src/inputs/PriceNameInput.tsx:13
2018
-	__( 'label…', 'event_espresso' ),
2018
+	__('label…', 'event_espresso'),
2019 2019
 
2020 2020
 	// Reference: packages/tpc/src/inputs/PriceNameInput.tsx:8
2021
-	__( 'price name', 'event_espresso' ),
2021
+	__('price name', 'event_espresso'),
2022 2022
 
2023 2023
 	// Reference: packages/tpc/src/inputs/PriceOrderInput.tsx:14
2024
-	__( 'price order', 'event_espresso' ),
2024
+	__('price order', 'event_espresso'),
2025 2025
 
2026 2026
 	// Reference: packages/tpc/src/utils/constants.ts:8
2027
-	__( 'Ticket price modifications are blocked for Tickets that have already been sold to registrants, because doing so would negatively affect internal accounting for the event. If you still need to modify ticket prices, then create a copy of those tickets, edit the prices for the new tickets, and then trash the old tickets.', 'event_espresso' ),
2027
+	__('Ticket price modifications are blocked for Tickets that have already been sold to registrants, because doing so would negatively affect internal accounting for the event. If you still need to modify ticket prices, then create a copy of those tickets, edit the prices for the new tickets, and then trash the old tickets.', 'event_espresso'),
2028 2028
 
2029 2029
 	// Reference: packages/ui-components/src/ActiveFilters/ActiveFilters.tsx:8
2030
-	__( 'active filters:', 'event_espresso' ),
2030
+	__('active filters:', 'event_espresso'),
2031 2031
 
2032 2032
 	// Reference: packages/ui-components/src/ActiveFilters/FilterTag/index.tsx:15
2033 2033
 	/* translators: %s filter name */
2034
-	__( 'remove filter - %s', 'event_espresso' ),
2034
+	__('remove filter - %s', 'event_espresso'),
2035 2035
 
2036 2036
 	// Reference: packages/ui-components/src/Address/Address.tsx:72
2037
-	__( 'Address:', 'event_espresso' ),
2037
+	__('Address:', 'event_espresso'),
2038 2038
 
2039 2039
 	// Reference: packages/ui-components/src/Address/Address.tsx:80
2040
-	__( 'City:', 'event_espresso' ),
2040
+	__('City:', 'event_espresso'),
2041 2041
 
2042 2042
 	// Reference: packages/ui-components/src/Address/Address.tsx:86
2043
-	__( 'State:', 'event_espresso' ),
2043
+	__('State:', 'event_espresso'),
2044 2044
 
2045 2045
 	// Reference: packages/ui-components/src/Address/Address.tsx:92
2046
-	__( 'Country:', 'event_espresso' ),
2046
+	__('Country:', 'event_espresso'),
2047 2047
 
2048 2048
 	// Reference: packages/ui-components/src/Address/Address.tsx:98
2049
-	__( 'Zip:', 'event_espresso' ),
2049
+	__('Zip:', 'event_espresso'),
2050 2050
 
2051 2051
 	// Reference: packages/ui-components/src/CalendarDateRange/CalendarDateRange.tsx:37
2052
-	__( 'to', 'event_espresso' ),
2052
+	__('to', 'event_espresso'),
2053 2053
 
2054 2054
 	// Reference: packages/ui-components/src/CalendarPageDate/CalendarPageDate.tsx:54
2055
-	__( 'TO', 'event_espresso' ),
2055
+	__('TO', 'event_espresso'),
2056 2056
 
2057 2057
 	// Reference: packages/ui-components/src/ColorPicker/ColorPicker.tsx:60
2058
-	__( 'Custom color', 'event_espresso' ),
2058
+	__('Custom color', 'event_espresso'),
2059 2059
 
2060 2060
 	// Reference: packages/ui-components/src/ColorPicker/Swatch.tsx:23
2061 2061
 	/* translators: color name */
2062
-	__( 'Color: %s', 'event_espresso' ),
2062
+	__('Color: %s', 'event_espresso'),
2063 2063
 
2064 2064
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:13
2065
-	__( 'Cyan bluish gray', 'event_espresso' ),
2065
+	__('Cyan bluish gray', 'event_espresso'),
2066 2066
 
2067 2067
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:17
2068
-	__( 'White', 'event_espresso' ),
2068
+	__('White', 'event_espresso'),
2069 2069
 
2070 2070
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:21
2071
-	__( 'Pale pink', 'event_espresso' ),
2071
+	__('Pale pink', 'event_espresso'),
2072 2072
 
2073 2073
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:25
2074
-	__( 'Vivid red', 'event_espresso' ),
2074
+	__('Vivid red', 'event_espresso'),
2075 2075
 
2076 2076
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:29
2077
-	__( 'Luminous vivid orange', 'event_espresso' ),
2077
+	__('Luminous vivid orange', 'event_espresso'),
2078 2078
 
2079 2079
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:33
2080
-	__( 'Luminous vivid amber', 'event_espresso' ),
2080
+	__('Luminous vivid amber', 'event_espresso'),
2081 2081
 
2082 2082
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:37
2083
-	__( 'Light green cyan', 'event_espresso' ),
2083
+	__('Light green cyan', 'event_espresso'),
2084 2084
 
2085 2085
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:41
2086
-	__( 'Vivid green cyan', 'event_espresso' ),
2086
+	__('Vivid green cyan', 'event_espresso'),
2087 2087
 
2088 2088
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:45
2089
-	__( 'Pale cyan blue', 'event_espresso' ),
2089
+	__('Pale cyan blue', 'event_espresso'),
2090 2090
 
2091 2091
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:49
2092
-	__( 'Vivid cyan blue', 'event_espresso' ),
2092
+	__('Vivid cyan blue', 'event_espresso'),
2093 2093
 
2094 2094
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:53
2095
-	__( 'Vivid purple', 'event_espresso' ),
2095
+	__('Vivid purple', 'event_espresso'),
2096 2096
 
2097 2097
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:9
2098
-	__( 'Black', 'event_espresso' ),
2098
+	__('Black', 'event_espresso'),
2099 2099
 
2100 2100
 	// Reference: packages/ui-components/src/Confirm/ConfirmClose.tsx:7
2101 2101
 	// Reference: packages/ui-components/src/Modal/ModalWithAlert.tsx:22
2102
-	__( 'Are you sure you want to close this?', 'event_espresso' ),
2102
+	__('Are you sure you want to close this?', 'event_espresso'),
2103 2103
 
2104 2104
 	// Reference: packages/ui-components/src/Confirm/ConfirmDelete.tsx:7
2105
-	__( 'Are you sure you want to delete this?', 'event_espresso' ),
2105
+	__('Are you sure you want to delete this?', 'event_espresso'),
2106 2106
 
2107 2107
 	// Reference: packages/ui-components/src/Confirm/useConfirmWithButton.tsx:10
2108
-	__( 'Please confirm this action.', 'event_espresso' ),
2108
+	__('Please confirm this action.', 'event_espresso'),
2109 2109
 
2110 2110
 	// Reference: packages/ui-components/src/Confirm/useConfirmationDialog.tsx:32
2111
-	__( 'No', 'event_espresso' ),
2111
+	__('No', 'event_espresso'),
2112 2112
 
2113 2113
 	// Reference: packages/ui-components/src/Confirm/useConfirmationDialog.tsx:33
2114
-	__( 'Yes', 'event_espresso' ),
2114
+	__('Yes', 'event_espresso'),
2115 2115
 
2116 2116
 	// Reference: packages/ui-components/src/CurrencyDisplay/CurrencyDisplay.tsx:34
2117
-	__( 'free', 'event_espresso' ),
2117
+	__('free', 'event_espresso'),
2118 2118
 
2119 2119
 	// Reference: packages/ui-components/src/DateTimeRangePicker/DateTimeRangePicker.tsx:117
2120 2120
 	// Reference: packages/ui-components/src/Popover/PopoverForm/PopoverForm.tsx:44
2121
-	__( 'save', 'event_espresso' ),
2121
+	__('save', 'event_espresso'),
2122 2122
 
2123 2123
 	// Reference: packages/ui-components/src/DebugInfo/DebugInfo.tsx:36
2124
-	__( 'Hide Debug Info', 'event_espresso' ),
2124
+	__('Hide Debug Info', 'event_espresso'),
2125 2125
 
2126 2126
 	// Reference: packages/ui-components/src/DebugInfo/DebugInfo.tsx:36
2127
-	__( 'Show Debug Info', 'event_espresso' ),
2127
+	__('Show Debug Info', 'event_espresso'),
2128 2128
 
2129 2129
 	// Reference: packages/ui-components/src/EditDateRangeButton/EditDateRangeButton.tsx:49
2130
-	__( 'Edit Start and End Dates and Times', 'event_espresso' ),
2130
+	__('Edit Start and End Dates and Times', 'event_espresso'),
2131 2131
 
2132 2132
 	// Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Copy.tsx:8
2133
-	__( 'copy', 'event_espresso' ),
2133
+	__('copy', 'event_espresso'),
2134 2134
 
2135 2135
 	// Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Edit.tsx:8
2136
-	__( 'edit', 'event_espresso' ),
2136
+	__('edit', 'event_espresso'),
2137 2137
 
2138 2138
 	// Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Trash.tsx:8
2139
-	__( 'trash', 'event_espresso' ),
2139
+	__('trash', 'event_espresso'),
2140 2140
 
2141 2141
 	// Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Untrash.tsx:8
2142
-	__( 'untrash', 'event_espresso' ),
2142
+	__('untrash', 'event_espresso'),
2143 2143
 
2144 2144
 	// Reference: packages/ui-components/src/EntityList/RegistrationsLink/index.tsx:12
2145
-	__( 'click to open the registrations admin page in a new tab or window', 'event_espresso' ),
2145
+	__('click to open the registrations admin page in a new tab or window', 'event_espresso'),
2146 2146
 
2147 2147
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/CardViewFilterButton.tsx:22
2148
-	__( 'card view', 'event_espresso' ),
2148
+	__('card view', 'event_espresso'),
2149 2149
 
2150 2150
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/TableViewFilterButton.tsx:21
2151
-	__( 'table view', 'event_espresso' ),
2151
+	__('table view', 'event_espresso'),
2152 2152
 
2153 2153
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleBulkActionsButton.tsx:8
2154
-	__( 'hide bulk actions', 'event_espresso' ),
2154
+	__('hide bulk actions', 'event_espresso'),
2155 2155
 
2156 2156
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleBulkActionsButton.tsx:8
2157
-	__( 'show bulk actions', 'event_espresso' ),
2157
+	__('show bulk actions', 'event_espresso'),
2158 2158
 
2159 2159
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:9
2160
-	__( 'hide filters', 'event_espresso' ),
2160
+	__('hide filters', 'event_espresso'),
2161 2161
 
2162 2162
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:9
2163
-	__( 'show filters', 'event_espresso' ),
2163
+	__('show filters', 'event_espresso'),
2164 2164
 
2165 2165
 	// Reference: packages/ui-components/src/Legend/ToggleLegendButton.tsx:26
2166
-	__( 'hide legend', 'event_espresso' ),
2166
+	__('hide legend', 'event_espresso'),
2167 2167
 
2168 2168
 	// Reference: packages/ui-components/src/Legend/ToggleLegendButton.tsx:26
2169
-	__( 'show legend', 'event_espresso' ),
2169
+	__('show legend', 'event_espresso'),
2170 2170
 
2171 2171
 	// Reference: packages/ui-components/src/LoadingNotice/LoadingNotice.tsx:11
2172
-	__( 'loading…', 'event_espresso' ),
2172
+	__('loading…', 'event_espresso'),
2173 2173
 
2174 2174
 	// Reference: packages/ui-components/src/Modal/Modal.tsx:58
2175
-	__( 'close modal', 'event_espresso' ),
2175
+	__('close modal', 'event_espresso'),
2176 2176
 
2177 2177
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:10
2178
-	__( 'jump to previous', 'event_espresso' ),
2178
+	__('jump to previous', 'event_espresso'),
2179 2179
 
2180 2180
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:11
2181
-	__( 'jump to next', 'event_espresso' ),
2181
+	__('jump to next', 'event_espresso'),
2182 2182
 
2183 2183
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:12
2184
-	__( 'page', 'event_espresso' ),
2184
+	__('page', 'event_espresso'),
2185 2185
 
2186 2186
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:8
2187
-	__( 'previous', 'event_espresso' ),
2187
+	__('previous', 'event_espresso'),
2188 2188
 
2189 2189
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:9
2190
-	__( 'next', 'event_espresso' ),
2190
+	__('next', 'event_espresso'),
2191 2191
 
2192 2192
 	// Reference: packages/ui-components/src/Pagination/PerPage.tsx:37
2193
-	__( 'items per page', 'event_espresso' ),
2193
+	__('items per page', 'event_espresso'),
2194 2194
 
2195 2195
 	// Reference: packages/ui-components/src/Pagination/constants.ts:10
2196 2196
 	/* translators: %s is per page value */
2197
-	__( '%s / page', 'event_espresso' ),
2197
+	__('%s / page', 'event_espresso'),
2198 2198
 
2199 2199
 	// Reference: packages/ui-components/src/Pagination/constants.ts:13
2200
-	__( 'Next Page', 'event_espresso' ),
2200
+	__('Next Page', 'event_espresso'),
2201 2201
 
2202 2202
 	// Reference: packages/ui-components/src/Pagination/constants.ts:14
2203
-	__( 'Previous Page', 'event_espresso' ),
2203
+	__('Previous Page', 'event_espresso'),
2204 2204
 
2205 2205
 	// Reference: packages/ui-components/src/PercentSign/index.tsx:10
2206
-	__( '%', 'event_espresso' ),
2206
+	__('%', 'event_espresso'),
2207 2207
 
2208 2208
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:31
2209 2209
 	/* translators: entity type to select */
2210
-	__( 'Select an existing %s to use as a template.', 'event_espresso' ),
2210
+	__('Select an existing %s to use as a template.', 'event_espresso'),
2211 2211
 
2212 2212
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:38
2213
-	__( 'or', 'event_espresso' ),
2213
+	__('or', 'event_espresso'),
2214 2214
 
2215 2215
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:43
2216 2216
 	/* translators: entity type to add */
2217
-	__( 'Add a new %s and insert details manually', 'event_espresso' ),
2217
+	__('Add a new %s and insert details manually', 'event_espresso'),
2218 2218
 
2219 2219
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:48
2220
-	__( 'Add New', 'event_espresso' ),
2220
+	__('Add New', 'event_espresso'),
2221 2221
 
2222 2222
 	// Reference: packages/ui-components/src/Stepper/buttons/Next.tsx:8
2223
-	__( 'Next', 'event_espresso' ),
2223
+	__('Next', 'event_espresso'),
2224 2224
 
2225 2225
 	// Reference: packages/ui-components/src/Stepper/buttons/Previous.tsx:8
2226
-	__( 'Previous', 'event_espresso' ),
2226
+	__('Previous', 'event_espresso'),
2227 2227
 
2228 2228
 	// Reference: packages/ui-components/src/Steps/Steps.tsx:31
2229
-	__( 'Steps', 'event_espresso' ),
2229
+	__('Steps', 'event_espresso'),
2230 2230
 
2231 2231
 	// Reference: packages/ui-components/src/TabbableText/index.tsx:21
2232
-	__( 'click to edit…', 'event_espresso' ),
2232
+	__('click to edit…', 'event_espresso'),
2233 2233
 
2234 2234
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:14
2235
-	__( 'The Website\'s Time Zone', 'event_espresso' ),
2235
+	__('The Website\'s Time Zone', 'event_espresso'),
2236 2236
 
2237 2237
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:19
2238
-	__( 'UTC (Greenwich Mean Time)', 'event_espresso' ),
2238
+	__('UTC (Greenwich Mean Time)', 'event_espresso'),
2239 2239
 
2240 2240
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:9
2241
-	__( 'Your Local Time Zone', 'event_espresso' ),
2241
+	__('Your Local Time Zone', 'event_espresso'),
2242 2242
 
2243 2243
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:27
2244
-	__( 'click for timezone information', 'event_espresso' ),
2244
+	__('click for timezone information', 'event_espresso'),
2245 2245
 
2246 2246
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:32
2247
-	__( 'This Date Converted To:', 'event_espresso' ),
2247
+	__('This Date Converted To:', 'event_espresso'),
2248 2248
 
2249 2249
 	// Reference: packages/ui-components/src/VenueSelector/VenueSelector.tsx:120
2250
-	__( 'Add New Venue', 'event_espresso' ),
2250
+	__('Add New Venue', 'event_espresso'),
2251 2251
 
2252 2252
 	// Reference: packages/ui-components/src/VenueSelector/VenueSelector.tsx:36
2253
-	__( '~ no venue ~', 'event_espresso' ),
2253
+	__('~ no venue ~', 'event_espresso'),
2254 2254
 
2255 2255
 	// Reference: packages/ui-components/src/VenueSelector/VenueSelector.tsx:43
2256
-	__( 'assign venue…', 'event_espresso' ),
2256
+	__('assign venue…', 'event_espresso'),
2257 2257
 
2258 2258
 	// Reference: packages/ui-components/src/VenueSelector/VenueSelector.tsx:44
2259
-	__( 'click to select a venue…', 'event_espresso' ),
2259
+	__('click to select a venue…', 'event_espresso'),
2260 2260
 
2261 2261
 	// Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:51
2262
-	__( 'select all', 'event_espresso' ),
2262
+	__('select all', 'event_espresso'),
2263 2263
 
2264 2264
 	// Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:54
2265
-	__( 'apply', 'event_espresso' )
2265
+	__('apply', 'event_espresso')
2266 2266
 );
2267 2267
 /* THIS IS THE END OF THE GENERATED FILE */
Please login to merge, or discard this patch.