Completed
Branch barista (792d41)
by
unknown
27:04 queued 17:30
created
languages/event_espresso-translations-js.php 1 patch
Spacing   +425 added lines, -425 removed lines patch added patch discarded remove patch
@@ -2,235 +2,235 @@  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/components/src/Pagination/constants.ts:6
5
-	__( '2', 'event_espresso' ),
5
+	__('2', 'event_espresso'),
6 6
 
7 7
 	// Reference: packages/components/src/Pagination/constants.ts:7
8
-	__( '6', 'event_espresso' ),
8
+	__('6', 'event_espresso'),
9 9
 
10 10
 	// Reference: packages/components/src/Pagination/constants.ts:8
11
-	__( '12', 'event_espresso' ),
11
+	__('12', 'event_espresso'),
12 12
 
13 13
 	// Reference: packages/components/src/Pagination/constants.ts:9
14
-	__( '24', 'event_espresso' ),
14
+	__('24', 'event_espresso'),
15 15
 
16 16
 	// Reference: packages/components/src/Pagination/constants.ts:10
17
-	__( '48', 'event_espresso' ),
17
+	__('48', 'event_espresso'),
18 18
 
19 19
 	// Reference: domains/blocks/src/components/AvatarImage.tsx:27
20
-	__( 'contact avatar', 'event_espresso' ),
20
+	__('contact avatar', 'event_espresso'),
21 21
 
22 22
 	// Reference: domains/blocks/src/components/OrderByControl.tsx:13
23
-	__( 'Order by', 'event_espresso' ),
23
+	__('Order by', 'event_espresso'),
24 24
 
25 25
 	// Reference: domains/blocks/src/components/RegStatusControl.tsx:18
26 26
 	// Reference: domains/blocks/src/event-attendees/controls/SelectStatus.tsx:12
27
-	__( 'Select Registration Status', 'event_espresso' ),
27
+	__('Select Registration Status', 'event_espresso'),
28 28
 
29 29
 	// Reference: domains/blocks/src/components/SortOrderControl.tsx:15
30
-	__( 'Ascending', 'event_espresso' ),
30
+	__('Ascending', 'event_espresso'),
31 31
 
32 32
 	// Reference: domains/blocks/src/components/SortOrderControl.tsx:19
33
-	__( 'Descending', 'event_espresso' ),
33
+	__('Descending', 'event_espresso'),
34 34
 
35 35
 	// Reference: domains/blocks/src/components/SortOrderControl.tsx:25
36
-	__( 'Sort order:', 'event_espresso' ),
36
+	__('Sort order:', 'event_espresso'),
37 37
 
38 38
 	// Reference: domains/blocks/src/event-attendees/AttendeesDisplay.tsx:40
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/blocks/src/event-attendees/AttendeesDisplay.tsx:46
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/blocks/src/event-attendees/AttendeesDisplay.tsx:52
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/blocks/src/event-attendees/controls/ArchiveSettings.tsx:11
48
-	__( 'Display on Archives', 'event_espresso' ),
48
+	__('Display on Archives', 'event_espresso'),
49 49
 
50 50
 	// Reference: domains/blocks/src/event-attendees/controls/ArchiveSettings.tsx:16
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/blocks/src/event-attendees/controls/ArchiveSettings.tsx:17
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/blocks/src/event-attendees/controls/AttendeeLimit.tsx:28
57
-	__( 'Number of Attendees to Display:', 'event_espresso' ),
57
+	__('Number of Attendees to Display:', 'event_espresso'),
58 58
 
59 59
 	// Reference: domains/blocks/src/event-attendees/controls/AttendeeLimit.tsx:33
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/blocks/src/event-attendees/controls/GravatarSettings.tsx:26
64
-	__( 'Display Gravatar', 'event_espresso' ),
64
+	__('Display Gravatar', 'event_espresso'),
65 65
 
66 66
 	// Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:31
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/blocks/src/event-attendees/controls/GravatarSettings.tsx:32
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/blocks/src/event-attendees/controls/GravatarSettings.tsx:37
73
-	__( 'Size of Gravatar', 'event_espresso' ),
73
+	__('Size of Gravatar', 'event_espresso'),
74 74
 
75 75
 	// Reference: domains/blocks/src/event-attendees/controls/SelectDatetime.tsx:21
76
-	__( 'Select Datetime', 'event_espresso' ),
76
+	__('Select Datetime', 'event_espresso'),
77 77
 
78 78
 	// Reference: domains/blocks/src/event-attendees/controls/SelectEvent.tsx:21
79
-	__( 'Select Event', 'event_espresso' ),
79
+	__('Select Event', 'event_espresso'),
80 80
 
81 81
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:10
82
-	__( 'Attendee id', 'event_espresso' ),
82
+	__('Attendee id', 'event_espresso'),
83 83
 
84 84
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:14
85
-	__( 'Last name only', 'event_espresso' ),
85
+	__('Last name only', 'event_espresso'),
86 86
 
87 87
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:18
88
-	__( 'First name only', 'event_espresso' ),
88
+	__('First name only', 'event_espresso'),
89 89
 
90 90
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:22
91
-	__( 'First, then Last name', 'event_espresso' ),
91
+	__('First, then Last name', 'event_espresso'),
92 92
 
93 93
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:26
94
-	__( 'Last, then First name', 'event_espresso' ),
94
+	__('Last, then First name', 'event_espresso'),
95 95
 
96 96
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:40
97
-	__( 'Order Attendees by:', 'event_espresso' ),
97
+	__('Order Attendees by:', 'event_espresso'),
98 98
 
99 99
 	// Reference: domains/blocks/src/event-attendees/controls/SelectTicket.tsx:21
100
-	__( 'Select Ticket', 'event_espresso' ),
100
+	__('Select Ticket', 'event_espresso'),
101 101
 
102 102
 	// Reference: domains/blocks/src/event-attendees/controls/index.tsx:22
103
-	__( 'Filter By Settings', 'event_espresso' ),
103
+	__('Filter By Settings', 'event_espresso'),
104 104
 
105 105
 	// Reference: domains/blocks/src/event-attendees/controls/index.tsx:37
106
-	__( 'Gravatar Setttings', 'event_espresso' ),
106
+	__('Gravatar Setttings', 'event_espresso'),
107 107
 
108 108
 	// Reference: domains/blocks/src/event-attendees/controls/index.tsx:40
109
-	__( 'Archive Settings', 'event_espresso' ),
109
+	__('Archive Settings', 'event_espresso'),
110 110
 
111 111
 	// Reference: domains/blocks/src/event-attendees/index.tsx:10
112
-	__( 'Event Attendees', 'event_espresso' ),
112
+	__('Event Attendees', 'event_espresso'),
113 113
 
114 114
 	// Reference: domains/blocks/src/event-attendees/index.tsx:11
115
-	__( 'Displays a list of people that have registered for the specified event', 'event_espresso' ),
115
+	__('Displays a list of people that have registered for the specified event', 'event_espresso'),
116 116
 
117 117
 	// Reference: domains/blocks/src/event-attendees/index.tsx:14
118
-	__( 'event', 'event_espresso' ),
118
+	__('event', 'event_espresso'),
119 119
 
120 120
 	// Reference: domains/blocks/src/event-attendees/index.tsx:14
121
-	__( 'attendees', 'event_espresso' ),
121
+	__('attendees', 'event_espresso'),
122 122
 
123 123
 	// Reference: domains/blocks/src/event-attendees/index.tsx:14
124
-	__( 'list', 'event_espresso' ),
124
+	__('list', 'event_espresso'),
125 125
 
126 126
 	// Reference: domains/blocks/src/services/utils.ts:11
127
-	__( 'Loading…', 'event_espresso' ),
127
+	__('Loading…', 'event_espresso'),
128 128
 
129 129
 	// Reference: domains/blocks/src/services/utils.ts:19
130 130
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:32
131
-	__( 'Error', 'event_espresso' ),
131
+	__('Error', 'event_espresso'),
132 132
 
133 133
 	// Reference: domains/blocks/src/services/utils.ts:26
134
-	__( 'Select…', 'event_espresso' ),
134
+	__('Select…', 'event_espresso'),
135 135
 
136 136
 	// Reference: domains/eventEditor/src/ui/EventDescription.tsx:18
137
-	__( 'Event Description', 'event_espresso' ),
137
+	__('Event Description', 'event_espresso'),
138 138
 
139 139
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/ActiveStatus.tsx:23
140
-	__( 'Active status', 'event_espresso' ),
140
+	__('Active status', 'event_espresso'),
141 141
 
142 142
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/AltRegPage.tsx:25
143
-	__( 'Alternative Registration Page', 'event_espresso' ),
143
+	__('Alternative Registration Page', 'event_espresso'),
144 144
 
145 145
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/DefaultRegistrationStatus.tsx:24
146
-	__( 'Default Registration Status', 'event_espresso' ),
146
+	__('Default Registration Status', 'event_espresso'),
147 147
 
148 148
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/Donations.tsx:10
149
-	__( 'Donations Enabled', 'event_espresso' ),
149
+	__('Donations Enabled', 'event_espresso'),
150 150
 
151 151
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/Donations.tsx:10
152
-	__( 'Donations Disabled', 'event_espresso' ),
152
+	__('Donations Disabled', 'event_espresso'),
153 153
 
154 154
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/EventManager.tsx:24
155
-	__( 'Event Manager', 'event_espresso' ),
155
+	__('Event Manager', 'event_espresso'),
156 156
 
157 157
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/EventPhoneNumber.tsx:14
158
-	__( 'Event Phone Number', 'event_espresso' ),
158
+	__('Event Phone Number', 'event_espresso'),
159 159
 
160 160
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/MaxRegistrations.tsx:19
161
-	__( 'Maximum Number of Registrations Allowed per Transaction', 'event_espresso' ),
161
+	__('Maximum Number of Registrations Allowed per Transaction', 'event_espresso'),
162 162
 
163 163
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:11
164
-	__( 'Ticket Selector Enabled', 'event_espresso' ),
164
+	__('Ticket Selector Enabled', 'event_espresso'),
165 165
 
166 166
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:11
167
-	__( 'Ticket Selector Disabled', 'event_espresso' ),
167
+	__('Ticket Selector Disabled', 'event_espresso'),
168 168
 
169 169
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/index.tsx:44
170
-	__( 'Registration Options', 'event_espresso' ),
170
+	__('Registration Options', 'event_espresso'),
171 171
 
172 172
 	// Reference: domains/eventEditor/src/ui/datetimes/DateRegistrationsLink.tsx:17
173
-	__( 'view ALL registrations for this date.', 'event_espresso' ),
173
+	__('view ALL registrations for this date.', 'event_espresso'),
174 174
 
175 175
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/formValidation.ts:14
176 176
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/formValidation.ts:14
177
-	__( 'Name is required', 'event_espresso' ),
177
+	__('Name is required', 'event_espresso'),
178 178
 
179 179
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/formValidation.ts:15
180 180
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/formValidation.ts:12
181 181
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/formValidation.ts:15
182 182
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/formValidation.ts:12
183
-	__( 'Name must be at least three characters', 'event_espresso' ),
183
+	__('Name must be at least three characters', 'event_espresso'),
184 184
 
185 185
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/Container.tsx:22
186 186
 	/* translators: %s datetime id */
187
-	__( 'Edit datetime %s', 'event_espresso' ),
187
+	__('Edit datetime %s', 'event_espresso'),
188 188
 
189 189
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/Container.tsx:25
190
-	__( 'New Datetime', 'event_espresso' ),
190
+	__('New Datetime', 'event_espresso'),
191 191
 
192 192
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/ContentBody.tsx:41
193
-	__( 'Save and assign tickets', 'event_espresso' ),
193
+	__('Save and assign tickets', 'event_espresso'),
194 194
 
195 195
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11
196
-	__( 'primary information about the date', 'event_espresso' ),
196
+	__('primary information about the date', 'event_espresso'),
197 197
 
198 198
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11
199
-	__( 'Date Details', 'event_espresso' ),
199
+	__('Date Details', 'event_espresso'),
200 200
 
201 201
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:12
202 202
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:17
203
-	__( 'relations between tickets and dates', 'event_espresso' ),
203
+	__('relations between tickets and dates', 'event_espresso'),
204 204
 
205 205
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:12
206
-	__( 'Assign Tickets', 'event_espresso' ),
206
+	__('Assign Tickets', 'event_espresso'),
207 207
 
208 208
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:108
209 209
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:108
210 210
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:117
211 211
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:108
212
-	__( 'Details', 'event_espresso' ),
212
+	__('Details', 'event_espresso'),
213 213
 
214 214
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:112
215 215
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:112
216 216
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:75
217
-	__( 'Capacity', 'event_espresso' ),
217
+	__('Capacity', 'event_espresso'),
218 218
 
219 219
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:117
220
-	__( 'The maximum number of registrants that can attend the event at this particular date.', 'event_espresso' ),
220
+	__('The maximum number of registrants that can attend the event at this particular date.', 'event_espresso'),
221 221
 
222 222
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:121
223
-	__( 'Set to 0 to close registration or leave blank for no limit.', 'event_espresso' ),
223
+	__('Set to 0 to close registration or leave blank for no limit.', 'event_espresso'),
224 224
 
225 225
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:126
226 226
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:196
227
-	__( 'Trash', 'event_espresso' ),
227
+	__('Trash', 'event_espresso'),
228 228
 
229 229
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:70
230 230
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:45
231 231
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:79
232 232
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:45
233
-	__( 'Basics', 'event_espresso' ),
233
+	__('Basics', 'event_espresso'),
234 234
 
235 235
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:74
236 236
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:49
@@ -238,237 +238,237 @@  discard block
 block discarded – undo
238 238
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:83
239 239
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:49
240 240
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:42
241
-	__( 'Name', 'event_espresso' ),
241
+	__('Name', 'event_espresso'),
242 242
 
243 243
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:81
244 244
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:55
245 245
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:90
246 246
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:55
247 247
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:41
248
-	__( 'Description', 'event_espresso' ),
248
+	__('Description', 'event_espresso'),
249 249
 
250 250
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:89
251 251
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:63
252 252
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:63
253
-	__( 'Dates', 'event_espresso' ),
253
+	__('Dates', 'event_espresso'),
254 254
 
255 255
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:93
256 256
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:52
257 257
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:102
258
-	__( 'Start Date', 'event_espresso' ),
258
+	__('Start Date', 'event_espresso'),
259 259
 
260 260
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:99
261 261
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:63
262 262
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:108
263
-	__( 'End Date', 'event_espresso' ),
263
+	__('End Date', 'event_espresso'),
264 264
 
265 265
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:34
266 266
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/TableView.tsx:42
267
-	__( 'Event Dates', 'event_espresso' ),
267
+	__('Event Dates', 'event_espresso'),
268 268
 
269 269
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:37
270
-	__( 'loading event dates…', 'event_espresso' ),
270
+	__('loading event dates…', 'event_espresso'),
271 271
 
272 272
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesListButtons.tsx:22
273
-	__( 'Ticket Assignments', 'event_espresso' ),
273
+	__('Ticket Assignments', 'event_espresso'),
274 274
 
275 275
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:27
276
-	__( 'Number of related tickets', 'event_espresso' ),
276
+	__('Number of related tickets', 'event_espresso'),
277 277
 
278 278
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:28
279
-	__( 'There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso' ),
279
+	__('There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso'),
280 280
 
281 281
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:42
282
-	__( 'assign tickets', 'event_espresso' ),
282
+	__('assign tickets', 'event_espresso'),
283 283
 
284 284
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:19
285
-	__( 'Permanently delete Datetime?', 'event_espresso' ),
285
+	__('Permanently delete Datetime?', 'event_espresso'),
286 286
 
287 287
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:19
288
-	__( 'Move Datetime to Trash?', 'event_espresso' ),
288
+	__('Move Datetime to Trash?', 'event_espresso'),
289 289
 
290 290
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:21
291
-	__( 'Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso' ),
291
+	__('Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso'),
292 292
 
293 293
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:24
294
-	__( 'Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso' ),
294
+	__('Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso'),
295 295
 
296 296
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:34
297
-	__( 'event date main menu', 'event_espresso' ),
297
+	__('event date main menu', 'event_espresso'),
298 298
 
299 299
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:38
300 300
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:37
301
-	__( 'delete permanently', 'event_espresso' ),
301
+	__('delete permanently', 'event_espresso'),
302 302
 
303 303
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:38
304
-	__( 'trash datetime', 'event_espresso' ),
304
+	__('trash datetime', 'event_espresso'),
305 305
 
306 306
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:49
307
-	__( 'edit datetime', 'event_espresso' ),
307
+	__('edit datetime', 'event_espresso'),
308 308
 
309 309
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:50
310
-	__( 'copy datetime', 'event_espresso' ),
310
+	__('copy datetime', 'event_espresso'),
311 311
 
312 312
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:30
313
-	__( 'edit datetime details', 'event_espresso' ),
313
+	__('edit datetime details', 'event_espresso'),
314 314
 
315 315
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:34
316
-	__( 'delete datetimes', 'event_espresso' ),
316
+	__('delete datetimes', 'event_espresso'),
317 317
 
318 318
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:34
319
-	__( 'trash datetimes', 'event_espresso' ),
319
+	__('trash datetimes', 'event_espresso'),
320 320
 
321 321
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:13
322
-	__( 'Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso' ),
322
+	__('Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso'),
323 323
 
324 324
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:14
325
-	__( 'Are you sure you want to trash these datetimes?', 'event_espresso' ),
325
+	__('Are you sure you want to trash these datetimes?', 'event_espresso'),
326 326
 
327 327
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:15
328
-	__( 'Delete datetimes permanently', 'event_espresso' ),
328
+	__('Delete datetimes permanently', 'event_espresso'),
329 329
 
330 330
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:15
331
-	__( 'Trash datetimes', 'event_espresso' ),
331
+	__('Trash datetimes', 'event_espresso'),
332 332
 
333 333
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:22
334
-	__( 'Bulk edit date details', 'event_espresso' ),
334
+	__('Bulk edit date details', 'event_espresso'),
335 335
 
336 336
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:23
337
-	__( 'any changes will be applied to ALL of the selected dates.', 'event_espresso' ),
337
+	__('any changes will be applied to ALL of the selected dates.', 'event_espresso'),
338 338
 
339 339
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:67
340 340
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:67
341
-	__( 'Shift dates', 'event_espresso' ),
341
+	__('Shift dates', 'event_espresso'),
342 342
 
343 343
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:92
344 344
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:92
345
-	__( 'earlier', 'event_espresso' ),
345
+	__('earlier', 'event_espresso'),
346 346
 
347 347
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:96
348 348
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:96
349
-	__( 'later', 'event_espresso' ),
349
+	__('later', 'event_espresso'),
350 350
 
351 351
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCapacity.tsx:35
352
-	__( 'edit capacity (registration limit)…', 'event_espresso' ),
352
+	__('edit capacity (registration limit)…', 'event_espresso'),
353 353
 
354 354
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:37
355
-	__( 'Edit Event Date', 'event_espresso' ),
355
+	__('Edit Event Date', 'event_espresso'),
356 356
 
357 357
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:40
358
-	__( 'edit start and end dates', 'event_espresso' ),
358
+	__('edit start and end dates', 'event_espresso'),
359 359
 
360 360
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:14
361 361
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:14
362
-	__( 'sold', 'event_espresso' ),
362
+	__('sold', 'event_espresso'),
363 363
 
364 364
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:27
365
-	__( 'capacity', 'event_espresso' ),
365
+	__('capacity', 'event_espresso'),
366 366
 
367 367
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:33
368 368
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:32
369
-	__( 'reg list', 'event_espresso' ),
369
+	__('reg list', 'event_espresso'),
370 370
 
371 371
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:42
372 372
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:40
373
-	__( 'Edit description', 'event_espresso' ),
373
+	__('Edit description', 'event_espresso'),
374 374
 
375 375
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:43
376 376
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:41
377
-	__( 'edit description…', 'event_espresso' ),
377
+	__('edit description…', 'event_espresso'),
378 378
 
379 379
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:10
380
-	__( 'Move Date to Trash', 'event_espresso' ),
380
+	__('Move Date to Trash', 'event_espresso'),
381 381
 
382 382
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:13
383 383
 	// Reference: packages/constants/src/datetimeStatus.ts:4
384
-	__( 'Active', 'event_espresso' ),
384
+	__('Active', 'event_espresso'),
385 385
 
386 386
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:14
387 387
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:13
388
-	__( 'Trashed', 'event_espresso' ),
388
+	__('Trashed', 'event_espresso'),
389 389
 
390 390
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:15
391 391
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:14
392 392
 	// Reference: packages/constants/src/datetimeStatus.ts:6
393
-	__( 'Expired', 'event_espresso' ),
393
+	__('Expired', 'event_espresso'),
394 394
 
395 395
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:16
396 396
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:16
397
-	__( 'Sold Out', 'event_espresso' ),
397
+	__('Sold Out', 'event_espresso'),
398 398
 
399 399
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:17
400 400
 	// Reference: packages/constants/src/datetimeStatus.ts:10
401
-	__( 'Upcoming', 'event_espresso' ),
401
+	__('Upcoming', 'event_espresso'),
402 402
 
403 403
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:7
404
-	__( 'Edit Event Date Details', 'event_espresso' ),
404
+	__('Edit Event Date Details', 'event_espresso'),
405 405
 
406 406
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:8
407
-	__( 'View Registrations for this Date', 'event_espresso' ),
407
+	__('View Registrations for this Date', 'event_espresso'),
408 408
 
409 409
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:9
410
-	__( 'Manage Ticket Assignments', 'event_espresso' ),
410
+	__('Manage Ticket Assignments', 'event_espresso'),
411 411
 
412 412
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/editable/EditableName.tsx:17
413 413
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditableName.tsx:27
414
-	__( 'edit title…', 'event_espresso' ),
414
+	__('edit title…', 'event_espresso'),
415 415
 
416 416
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/ActiveDatesFilters.tsx:25
417 417
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/ActiveTicketsFilters.tsx:25
418
-	__( 'ON', 'event_espresso' ),
418
+	__('ON', 'event_espresso'),
419 419
 
420 420
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:10
421
-	__( 'end dates only', 'event_espresso' ),
421
+	__('end dates only', 'event_espresso'),
422 422
 
423 423
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:11
424
-	__( 'start and end dates', 'event_espresso' ),
424
+	__('start and end dates', 'event_espresso'),
425 425
 
426 426
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:16
427
-	__( 'dates above 90% capacity', 'event_espresso' ),
427
+	__('dates above 90% capacity', 'event_espresso'),
428 428
 
429 429
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:17
430
-	__( 'dates above 75% capacity', 'event_espresso' ),
430
+	__('dates above 75% capacity', 'event_espresso'),
431 431
 
432 432
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:18
433
-	__( 'dates above 50% capacity', 'event_espresso' ),
433
+	__('dates above 50% capacity', 'event_espresso'),
434 434
 
435 435
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:19
436
-	__( 'dates below 50% capacity', 'event_espresso' ),
436
+	__('dates below 50% capacity', 'event_espresso'),
437 437
 
438 438
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:23
439
-	__( 'all dates', 'event_espresso' ),
439
+	__('all dates', 'event_espresso'),
440 440
 
441 441
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:24
442
-	__( 'all active and upcoming', 'event_espresso' ),
442
+	__('all active and upcoming', 'event_espresso'),
443 443
 
444 444
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:25
445
-	__( 'active dates only', 'event_espresso' ),
445
+	__('active dates only', 'event_espresso'),
446 446
 
447 447
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:26
448
-	__( 'upcoming dates only', 'event_espresso' ),
448
+	__('upcoming dates only', 'event_espresso'),
449 449
 
450 450
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:27
451
-	__( 'next active or upcoming only', 'event_espresso' ),
451
+	__('next active or upcoming only', 'event_espresso'),
452 452
 
453 453
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:28
454
-	__( 'sold out dates only', 'event_espresso' ),
454
+	__('sold out dates only', 'event_espresso'),
455 455
 
456 456
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:29
457
-	__( 'recently expired dates', 'event_espresso' ),
457
+	__('recently expired dates', 'event_espresso'),
458 458
 
459 459
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:30
460
-	__( 'all expired dates', 'event_espresso' ),
460
+	__('all expired dates', 'event_espresso'),
461 461
 
462 462
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:31
463
-	__( 'trashed dates only', 'event_espresso' ),
463
+	__('trashed dates only', 'event_espresso'),
464 464
 
465 465
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:35
466 466
 	// Reference: packages/dates/src/DateRangePicker/DateRangePickerLegend.tsx:10
467 467
 	// Reference: packages/dates/src/DateRangePicker/index.tsx:42
468
-	__( 'start date', 'event_espresso' ),
468
+	__('start date', 'event_espresso'),
469 469
 
470 470
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:36
471
-	__( 'name', 'event_espresso' ),
471
+	__('name', 'event_espresso'),
472 472
 
473 473
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:37
474 474
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:38
@@ -476,103 +476,103 @@  discard block
 block discarded – undo
476 476
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/HeaderCell.tsx:20
477 477
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:36
478 478
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:23
479
-	__( 'ID', 'event_espresso' ),
479
+	__('ID', 'event_espresso'),
480 480
 
481 481
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:38
482 482
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:47
483
-	__( 'custom order', 'event_espresso' ),
483
+	__('custom order', 'event_espresso'),
484 484
 
485 485
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:42
486 486
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:52
487
-	__( 'display', 'event_espresso' ),
487
+	__('display', 'event_espresso'),
488 488
 
489 489
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:43
490
-	__( 'recurrence', 'event_espresso' ),
490
+	__('recurrence', 'event_espresso'),
491 491
 
492 492
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:44
493 493
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:54
494
-	__( 'sales', 'event_espresso' ),
494
+	__('sales', 'event_espresso'),
495 495
 
496 496
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:45
497 497
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:56
498
-	__( 'sort by', 'event_espresso' ),
498
+	__('sort by', 'event_espresso'),
499 499
 
500 500
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:46
501 501
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:55
502 502
 	// Reference: packages/components/src/EntityList/filterBar/EntityListFilterBar.tsx:62
503
-	__( 'search', 'event_espresso' ),
503
+	__('search', 'event_espresso'),
504 504
 
505 505
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:47
506 506
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:57
507
-	__( 'status', 'event_espresso' ),
507
+	__('status', 'event_espresso'),
508 508
 
509 509
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:9
510
-	__( 'start dates only', 'event_espresso' ),
510
+	__('start dates only', 'event_espresso'),
511 511
 
512 512
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:20
513 513
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/NewDateModal.tsx:15
514 514
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/OptionsModalButton.tsx:11
515
-	__( 'Add New Date', 'event_espresso' ),
515
+	__('Add New Date', 'event_espresso'),
516 516
 
517 517
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:20
518
-	__( 'Add Single Date', 'event_espresso' ),
518
+	__('Add Single Date', 'event_espresso'),
519 519
 
520 520
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:34
521
-	__( 'Add a single date that only occurs once', 'event_espresso' ),
521
+	__('Add a single date that only occurs once', 'event_espresso'),
522 522
 
523 523
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:36
524
-	__( 'Single Date', 'event_espresso' ),
524
+	__('Single Date', 'event_espresso'),
525 525
 
526 526
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:105
527 527
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:103
528 528
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:53
529
-	__( 'Actions', 'event_espresso' ),
529
+	__('Actions', 'event_espresso'),
530 530
 
531 531
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:53
532
-	__( 'Start', 'event_espresso' ),
532
+	__('Start', 'event_espresso'),
533 533
 
534 534
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:64
535
-	__( 'End', 'event_espresso' ),
535
+	__('End', 'event_espresso'),
536 536
 
537 537
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:76
538
-	__( 'Cap', 'event_espresso' ),
538
+	__('Cap', 'event_espresso'),
539 539
 
540 540
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:84
541 541
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:85
542
-	__( 'Sold', 'event_espresso' ),
542
+	__('Sold', 'event_espresso'),
543 543
 
544 544
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:93
545
-	__( 'Reg list', 'event_espresso' ),
545
+	__('Reg list', 'event_espresso'),
546 546
 
547 547
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:94
548 548
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:95
549
-	__( 'Regs', 'event_espresso' ),
549
+	__('Regs', 'event_espresso'),
550 550
 
551 551
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:18
552
-	__( 'Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. Please correct the assignments for the highlighted cells.', 'event_espresso' ),
552
+	__('Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. Please correct the assignments for the highlighted cells.', 'event_espresso'),
553 553
 
554 554
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:22
555
-	__( '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. Please correct the assignments for the highlighted cells.', 'event_espresso' ),
555
+	__('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. Please correct the assignments for the highlighted cells.', 'event_espresso'),
556 556
 
557 557
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:25
558
-	__( 'There seem to be some dates/tickets which have no tickets/dates assigned. Do you want to fix them now?', 'event_espresso' ),
558
+	__('There seem to be some dates/tickets which have no tickets/dates assigned. Do you want to fix them now?', 'event_espresso'),
559 559
 
560 560
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:28
561 561
 	// Reference: packages/components/src/Modal/ModalWithAlert.tsx:23
562
-	__( 'Alert!', 'event_espresso' ),
562
+	__('Alert!', 'event_espresso'),
563 563
 
564 564
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:41
565 565
 	/* translators: 1 entity id, 2 entity name */
566
-	__( 'Ticket Assignment Manager for Datetime: %1$s - %2$s', 'event_espresso' ),
566
+	__('Ticket Assignment Manager for Datetime: %1$s - %2$s', 'event_espresso'),
567 567
 
568 568
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:48
569 569
 	/* translators: 1 entity id, 2 entity name */
570
-	__( 'Ticket Assignment Manager for Ticket: %1$s - %2$s', 'event_espresso' ),
570
+	__('Ticket Assignment Manager for Ticket: %1$s - %2$s', 'event_espresso'),
571 571
 
572 572
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal/buttons/useCancelButtonProps.tsx:18
573 573
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:16
574 574
 	// Reference: packages/components/src/Modal/useCancelButtonProps.tsx:10
575
-	__( 'Cancel', 'event_espresso' ),
575
+	__('Cancel', 'event_espresso'),
576 576
 
577 577
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal/buttons/useSubmitButtonProps.tsx:25
578 578
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:17
@@ -581,808 +581,808 @@  discard block
 block discarded – undo
581 581
 	// Reference: packages/components/src/bulkEdit/details/Submit.tsx:38
582 582
 	// Reference: packages/form/src/Submit.tsx:26
583 583
 	// Reference: packages/tpc/src/buttons/useSubmitButtonProps.tsx:25
584
-	__( 'Submit', 'event_espresso' ),
584
+	__('Submit', 'event_espresso'),
585 585
 
586 586
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal/config.ts:10
587
-	__( 'existing relation', 'event_espresso' ),
587
+	__('existing relation', 'event_espresso'),
588 588
 
589 589
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal/config.ts:15
590
-	__( 'remove existing relation', 'event_espresso' ),
590
+	__('remove existing relation', 'event_espresso'),
591 591
 
592 592
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal/config.ts:20
593
-	__( 'add new relation', 'event_espresso' ),
593
+	__('add new relation', 'event_espresso'),
594 594
 
595 595
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal/config.ts:25
596
-	__( 'invalid relation', 'event_espresso' ),
596
+	__('invalid relation', 'event_espresso'),
597 597
 
598 598
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal/config.ts:29
599
-	__( 'no relation', 'event_espresso' ),
599
+	__('no relation', 'event_espresso'),
600 600
 
601 601
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal/index.tsx:30
602 602
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/Table.tsx:14
603
-	__( 'Ticket Assignment Manager', 'event_espresso' ),
603
+	__('Ticket Assignment Manager', 'event_espresso'),
604 604
 
605 605
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/BodyCell.tsx:24
606
-	__( 'assign ticket', 'event_espresso' ),
606
+	__('assign ticket', 'event_espresso'),
607 607
 
608 608
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:19
609
-	__( 'All Dates', 'event_espresso' ),
609
+	__('All Dates', 'event_espresso'),
610 610
 
611 611
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:26
612
-	__( 'dates by month', 'event_espresso' ),
612
+	__('dates by month', 'event_espresso'),
613 613
 
614 614
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowExpiredTicketsControl.tsx:16
615
-	__( 'show expired tickets', 'event_espresso' ),
615
+	__('show expired tickets', 'event_espresso'),
616 616
 
617 617
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedDatesControl.tsx:10
618
-	__( 'show trashed dates', 'event_espresso' ),
618
+	__('show trashed dates', 'event_espresso'),
619 619
 
620 620
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedTicketsControl.tsx:16
621
-	__( 'show trashed tickets', 'event_espresso' ),
621
+	__('show trashed tickets', 'event_espresso'),
622 622
 
623 623
 	// Reference: domains/eventEditor/src/ui/tickets/TicketRegistrationsLink.tsx:17
624
-	__( 'total registrations.', 'event_espresso' ),
624
+	__('total registrations.', 'event_espresso'),
625 625
 
626 626
 	// Reference: domains/eventEditor/src/ui/tickets/TicketRegistrationsLink.tsx:18
627
-	__( 'view ALL registrations for this ticket.', 'event_espresso' ),
627
+	__('view ALL registrations for this ticket.', 'event_espresso'),
628 628
 
629 629
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/Container.tsx:21
630 630
 	/* translators: %s ticket id */
631
-	__( 'Edit ticket %s', 'event_espresso' ),
631
+	__('Edit ticket %s', 'event_espresso'),
632 632
 
633 633
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/Container.tsx:24
634
-	__( 'New Ticket Details', 'event_espresso' ),
634
+	__('New Ticket Details', 'event_espresso'),
635 635
 
636 636
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/ContentBody.tsx:47
637
-	__( 'Set ticket prices', 'event_espresso' ),
637
+	__('Set ticket prices', 'event_espresso'),
638 638
 
639 639
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/ContentBody.tsx:54
640
-	__( 'Skip prices - assign dates', 'event_espresso' ),
640
+	__('Skip prices - assign dates', 'event_espresso'),
641 641
 
642 642
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/ContentBody.tsx:70
643
-	__( 'Save and assign dates', 'event_espresso' ),
643
+	__('Save and assign dates', 'event_espresso'),
644 644
 
645 645
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/ContentBody.tsx:83
646
-	__( 'Ticket details', 'event_espresso' ),
646
+	__('Ticket details', 'event_espresso'),
647 647
 
648 648
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:11
649
-	__( 'primary information about the ticket', 'event_espresso' ),
649
+	__('primary information about the ticket', 'event_espresso'),
650 650
 
651 651
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:11
652
-	__( 'Ticket Details', 'event_espresso' ),
652
+	__('Ticket Details', 'event_espresso'),
653 653
 
654 654
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:13
655
-	__( 'apply ticket price modifiers and taxes', 'event_espresso' ),
655
+	__('apply ticket price modifiers and taxes', 'event_espresso'),
656 656
 
657 657
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:15
658
-	__( 'Price Calculator', 'event_espresso' ),
658
+	__('Price Calculator', 'event_espresso'),
659 659
 
660 660
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:17
661
-	__( 'Assign Dates', 'event_espresso' ),
661
+	__('Assign Dates', 'event_espresso'),
662 662
 
663 663
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:121
664 664
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:112
665
-	__( 'Quantity For Sale', 'event_espresso' ),
665
+	__('Quantity For Sale', 'event_espresso'),
666 666
 
667 667
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:127
668
-	__( 'The maximum number of this ticket available for sale.', 'event_espresso' ),
668
+	__('The maximum number of this ticket available for sale.', 'event_espresso'),
669 669
 
670 670
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:129
671
-	__( 'Set to 0 to stop sales, or leave blank for no limit.', 'event_espresso' ),
671
+	__('Set to 0 to stop sales, or leave blank for no limit.', 'event_espresso'),
672 672
 
673 673
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:134
674 674
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:121
675
-	__( 'Number of Uses', 'event_espresso' ),
675
+	__('Number of Uses', 'event_espresso'),
676 676
 
677 677
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:140
678
-	__( 'Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.', 'event_espresso' ),
678
+	__('Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.', 'event_espresso'),
679 679
 
680 680
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:144
681
-	__( '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' ),
681
+	__('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'),
682 682
 
683 683
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:151
684 684
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:129
685
-	__( 'Minimum Quantity', 'event_espresso' ),
685
+	__('Minimum Quantity', 'event_espresso'),
686 686
 
687 687
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:156
688
-	__( 'The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso' ),
688
+	__('The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso'),
689 689
 
690 690
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:160
691
-	__( 'Leave blank for no minimum.', 'event_espresso' ),
691
+	__('Leave blank for no minimum.', 'event_espresso'),
692 692
 
693 693
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:165
694 694
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:137
695
-	__( 'Maximum Quantity', 'event_espresso' ),
695
+	__('Maximum Quantity', 'event_espresso'),
696 696
 
697 697
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:171
698
-	__( 'The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso' ),
698
+	__('The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso'),
699 699
 
700 700
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:175
701
-	__( 'Leave blank for no maximum.', 'event_espresso' ),
701
+	__('Leave blank for no maximum.', 'event_espresso'),
702 702
 
703 703
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:180
704 704
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:146
705
-	__( 'Required Ticket', 'event_espresso' ),
705
+	__('Required Ticket', 'event_espresso'),
706 706
 
707 707
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:182
708
-	__( 'If enabled, the ticket must be selected and will appear first in frontend ticket lists.', 'event_espresso' ),
708
+	__('If enabled, the ticket must be selected and will appear first in frontend ticket lists.', 'event_espresso'),
709 709
 
710 710
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:189
711
-	__( 'Default Ticket', 'event_espresso' ),
711
+	__('Default Ticket', 'event_espresso'),
712 712
 
713 713
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:191
714
-	__( 'If enabled, the ticket will appear on all new events.', 'event_espresso' ),
714
+	__('If enabled, the ticket will appear on all new events.', 'event_espresso'),
715 715
 
716 716
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:98
717
-	__( 'Ticket Sales', 'event_espresso' ),
717
+	__('Ticket Sales', 'event_espresso'),
718 718
 
719 719
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:35
720
-	__( 'Available Tickets', 'event_espresso' ),
720
+	__('Available Tickets', 'event_espresso'),
721 721
 
722 722
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:38
723
-	__( 'loading tickets…', 'event_espresso' ),
723
+	__('loading tickets…', 'event_espresso'),
724 724
 
725 725
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:27
726
-	__( 'Number of related dates', 'event_espresso' ),
726
+	__('Number of related dates', 'event_espresso'),
727 727
 
728 728
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:28
729
-	__( 'There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso' ),
729
+	__('There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso'),
730 730
 
731 731
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:44
732
-	__( 'assign dates', 'event_espresso' ),
732
+	__('assign dates', 'event_espresso'),
733 733
 
734 734
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:19
735
-	__( 'Permanently delete Ticket?', 'event_espresso' ),
735
+	__('Permanently delete Ticket?', 'event_espresso'),
736 736
 
737 737
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:19
738
-	__( 'Move Ticket to Trash?', 'event_espresso' ),
738
+	__('Move Ticket to Trash?', 'event_espresso'),
739 739
 
740 740
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:21
741
-	__( 'Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso' ),
741
+	__('Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso'),
742 742
 
743 743
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:22
744
-	__( 'Are you sure you want to move this ticket to the trash? You can "untrash" this ticket later if you need to.', 'event_espresso' ),
744
+	__('Are you sure you want to move this ticket to the trash? You can "untrash" this ticket later if you need to.', 'event_espresso'),
745 745
 
746 746
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:33
747
-	__( 'ticket main menu', 'event_espresso' ),
747
+	__('ticket main menu', 'event_espresso'),
748 748
 
749 749
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:37
750
-	__( 'trash ticket', 'event_espresso' ),
750
+	__('trash ticket', 'event_espresso'),
751 751
 
752 752
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:48
753
-	__( 'edit ticket', 'event_espresso' ),
753
+	__('edit ticket', 'event_espresso'),
754 754
 
755 755
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:49
756
-	__( 'copy ticket', 'event_espresso' ),
756
+	__('copy ticket', 'event_espresso'),
757 757
 
758 758
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:39
759 759
 	// Reference: packages/components/src/bulkEdit/BulkActions.tsx:44
760
-	__( 'bulk actions', 'event_espresso' ),
760
+	__('bulk actions', 'event_espresso'),
761 761
 
762 762
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:43
763
-	__( 'edit ticket details', 'event_espresso' ),
763
+	__('edit ticket details', 'event_espresso'),
764 764
 
765 765
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:47
766
-	__( 'delete tickets', 'event_espresso' ),
766
+	__('delete tickets', 'event_espresso'),
767 767
 
768 768
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:47
769
-	__( 'trash tickets', 'event_espresso' ),
769
+	__('trash tickets', 'event_espresso'),
770 770
 
771 771
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:51
772
-	__( 'edit ticket prices', 'event_espresso' ),
772
+	__('edit ticket prices', 'event_espresso'),
773 773
 
774 774
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:13
775
-	__( 'Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso' ),
775
+	__('Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso'),
776 776
 
777 777
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:14
778
-	__( 'Are you sure you want to trash these tickets?', 'event_espresso' ),
778
+	__('Are you sure you want to trash these tickets?', 'event_espresso'),
779 779
 
780 780
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:15
781
-	__( 'Delete tickets permanently', 'event_espresso' ),
781
+	__('Delete tickets permanently', 'event_espresso'),
782 782
 
783 783
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:15
784
-	__( 'Trash tickets', 'event_espresso' ),
784
+	__('Trash tickets', 'event_espresso'),
785 785
 
786 786
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:22
787
-	__( 'Bulk edit ticket details', 'event_espresso' ),
787
+	__('Bulk edit ticket details', 'event_espresso'),
788 788
 
789 789
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:23
790
-	__( 'any changes will be applied to ALL of the selected tickets.', 'event_espresso' ),
790
+	__('any changes will be applied to ALL of the selected tickets.', 'event_espresso'),
791 791
 
792 792
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/EditPrices.tsx:18
793
-	__( 'Bulk edit ticket prices', 'event_espresso' ),
793
+	__('Bulk edit ticket prices', 'event_espresso'),
794 794
 
795 795
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:19
796
-	__( 'Edit all prices together', 'event_espresso' ),
796
+	__('Edit all prices together', 'event_espresso'),
797 797
 
798 798
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:20
799
-	__( 'Edit all the selected ticket prices dynamically', 'event_espresso' ),
799
+	__('Edit all the selected ticket prices dynamically', 'event_espresso'),
800 800
 
801 801
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:24
802
-	__( 'Edit prices individually', 'event_espresso' ),
802
+	__('Edit prices individually', 'event_espresso'),
803 803
 
804 804
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:25
805
-	__( 'Edit prices for each ticket individually', 'event_espresso' ),
805
+	__('Edit prices for each ticket individually', 'event_espresso'),
806 806
 
807 807
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:15
808 808
 	// Reference: packages/components/src/bulkEdit/details/Submit.tsx:45
809 809
 	// Reference: packages/form/src/ResetButton.tsx:17
810 810
 	// Reference: packages/tpc/src/buttons/useResetButtonProps.tsx:12
811
-	__( 'Reset', 'event_espresso' ),
811
+	__('Reset', 'event_espresso'),
812 812
 
813 813
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/editSeparately/TPCInstance.tsx:25
814 814
 	/* translators: %s ticket name */
815
-	__( 'Edit prices for Ticket: %s', 'event_espresso' ),
815
+	__('Edit prices for Ticket: %s', 'event_espresso'),
816 816
 
817 817
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:36
818
-	__( 'Edit Ticket Sale Dates', 'event_espresso' ),
818
+	__('Edit Ticket Sale Dates', 'event_espresso'),
819 819
 
820 820
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:38
821
-	__( 'edit ticket sales start and end dates', 'event_espresso' ),
821
+	__('edit ticket sales start and end dates', 'event_espresso'),
822 822
 
823 823
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:27
824
-	__( 'quantity', 'event_espresso' ),
824
+	__('quantity', 'event_espresso'),
825 825
 
826 826
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketQuantity.tsx:26
827
-	__( 'edit quantity of tickets available…', 'event_espresso' ),
827
+	__('edit quantity of tickets available…', 'event_espresso'),
828 828
 
829 829
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:10
830
-	__( 'Move Ticket to Trash', 'event_espresso' ),
830
+	__('Move Ticket to Trash', 'event_espresso'),
831 831
 
832 832
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:15
833 833
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:51
834
-	__( 'On Sale', 'event_espresso' ),
834
+	__('On Sale', 'event_espresso'),
835 835
 
836 836
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:17
837
-	__( 'Pending', 'event_espresso' ),
837
+	__('Pending', 'event_espresso'),
838 838
 
839 839
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:7
840
-	__( 'Edit Ticket Details', 'event_espresso' ),
840
+	__('Edit Ticket Details', 'event_espresso'),
841 841
 
842 842
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:8
843
-	__( 'Manage Date Assignments', 'event_espresso' ),
843
+	__('Manage Date Assignments', 'event_espresso'),
844 844
 
845 845
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:9
846 846
 	// Reference: packages/tpc/src/components/table/Table.tsx:43
847
-	__( 'Ticket Price Calculator', 'event_espresso' ),
847
+	__('Ticket Price Calculator', 'event_espresso'),
848 848
 
849 849
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:32
850
-	__( 'edit ticket total…', 'event_espresso' ),
850
+	__('edit ticket total…', 'event_espresso'),
851 851
 
852 852
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:42
853
-	__( 'set price…', 'event_espresso' ),
853
+	__('set price…', 'event_espresso'),
854 854
 
855 855
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:24
856
-	__( 'tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso' ),
856
+	__('tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso'),
857 857
 
858 858
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:25
859
-	__( 'tickets list is unlinked and is showing tickets for all event dates', 'event_espresso' ),
859
+	__('tickets list is unlinked and is showing tickets for all event dates', 'event_espresso'),
860 860
 
861 861
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:10
862
-	__( 'ticket sales start and end dates', 'event_espresso' ),
862
+	__('ticket sales start and end dates', 'event_espresso'),
863 863
 
864 864
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:15
865
-	__( 'tickets with 90% or more sold', 'event_espresso' ),
865
+	__('tickets with 90% or more sold', 'event_espresso'),
866 866
 
867 867
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:16
868
-	__( 'tickets with 75% or more sold', 'event_espresso' ),
868
+	__('tickets with 75% or more sold', 'event_espresso'),
869 869
 
870 870
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:17
871
-	__( 'tickets with 50% or more sold', 'event_espresso' ),
871
+	__('tickets with 50% or more sold', 'event_espresso'),
872 872
 
873 873
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:19
874
-	__( 'tickets with less than 50% sold', 'event_espresso' ),
874
+	__('tickets with less than 50% sold', 'event_espresso'),
875 875
 
876 876
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:28
877
-	__( 'all tickets for all dates', 'event_espresso' ),
877
+	__('all tickets for all dates', 'event_espresso'),
878 878
 
879 879
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:29
880
-	__( 'all on sale and sale pending', 'event_espresso' ),
880
+	__('all on sale and sale pending', 'event_espresso'),
881 881
 
882 882
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:30
883
-	__( 'on sale tickets only', 'event_espresso' ),
883
+	__('on sale tickets only', 'event_espresso'),
884 884
 
885 885
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:31
886
-	__( 'sale pending tickets only', 'event_espresso' ),
886
+	__('sale pending tickets only', 'event_espresso'),
887 887
 
888 888
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:32
889
-	__( 'next on sale or sale pending only', 'event_espresso' ),
889
+	__('next on sale or sale pending only', 'event_espresso'),
890 890
 
891 891
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:33
892
-	__( 'sold out tickets only', 'event_espresso' ),
892
+	__('sold out tickets only', 'event_espresso'),
893 893
 
894 894
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:34
895
-	__( 'expired tickets only', 'event_espresso' ),
895
+	__('expired tickets only', 'event_espresso'),
896 896
 
897 897
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:35
898
-	__( 'trashed tickets only', 'event_espresso' ),
898
+	__('trashed tickets only', 'event_espresso'),
899 899
 
900 900
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:40
901
-	__( 'all tickets for above dates', 'event_espresso' ),
901
+	__('all tickets for above dates', 'event_espresso'),
902 902
 
903 903
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:44
904
-	__( 'ticket sale date', 'event_espresso' ),
904
+	__('ticket sale date', 'event_espresso'),
905 905
 
906 906
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:45
907
-	__( 'ticket name', 'event_espresso' ),
907
+	__('ticket name', 'event_espresso'),
908 908
 
909 909
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:46
910
-	__( 'ticket ID', 'event_espresso' ),
910
+	__('ticket ID', 'event_espresso'),
911 911
 
912 912
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:53
913
-	__( 'link', 'event_espresso' ),
913
+	__('link', 'event_espresso'),
914 914
 
915 915
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:8
916
-	__( 'ticket sales start date only', 'event_espresso' ),
916
+	__('ticket sales start date only', 'event_espresso'),
917 917
 
918 918
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:9
919
-	__( 'ticket sales end date only', 'event_espresso' ),
919
+	__('ticket sales end date only', 'event_espresso'),
920 920
 
921 921
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:19
922
-	__( 'Add New Ticket', 'event_espresso' ),
922
+	__('Add New Ticket', 'event_espresso'),
923 923
 
924 924
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:31
925
-	__( 'Single Ticket', 'event_espresso' ),
925
+	__('Single Ticket', 'event_espresso'),
926 926
 
927 927
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:33
928
-	__( 'Add a single ticket and assign the dates to it', 'event_espresso' ),
928
+	__('Add a single ticket and assign the dates to it', 'event_espresso'),
929 929
 
930 930
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/TableView.tsx:40
931
-	__( 'Tickets', 'event_espresso' ),
931
+	__('Tickets', 'event_espresso'),
932 932
 
933 933
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:50
934
-	__( 'Goes on Sale', 'event_espresso' ),
934
+	__('Goes on Sale', 'event_espresso'),
935 935
 
936 936
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:61
937
-	__( 'Sale Ends', 'event_espresso' ),
937
+	__('Sale Ends', 'event_espresso'),
938 938
 
939 939
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:62
940
-	__( 'Ends', 'event_espresso' ),
940
+	__('Ends', 'event_espresso'),
941 941
 
942 942
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:71
943
-	__( 'Price', 'event_espresso' ),
943
+	__('Price', 'event_espresso'),
944 944
 
945 945
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:78
946
-	__( 'Quantity', 'event_espresso' ),
946
+	__('Quantity', 'event_espresso'),
947 947
 
948 948
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:94
949
-	__( 'Registrations', 'event_espresso' ),
949
+	__('Registrations', 'event_espresso'),
950 950
 
951 951
 	// Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:28
952
-	__( 'Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso' ),
952
+	__('Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso'),
953 953
 
954 954
 	// Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:39
955
-	__( 'Skip', 'event_espresso' ),
955
+	__('Skip', 'event_espresso'),
956 956
 
957 957
 	// Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:41
958
-	__( 'Sure I\'ll help', 'event_espresso' ),
958
+	__('Sure I\'ll help', 'event_espresso'),
959 959
 
960 960
 	// Reference: packages/adapters/src/Pagination/Pagination.tsx:24
961
-	__( 'pagination', 'event_espresso' ),
961
+	__('pagination', 'event_espresso'),
962 962
 
963 963
 	// Reference: packages/components/src/ActiveFilters/ActiveFilters.tsx:9
964
-	__( 'active filters:', 'event_espresso' ),
964
+	__('active filters:', 'event_espresso'),
965 965
 
966 966
 	// Reference: packages/components/src/ActiveFilters/FilterTag.tsx:11
967 967
 	/* translators: %s filter name */
968
-	__( 'remove filter - %s', 'event_espresso' ),
968
+	__('remove filter - %s', 'event_espresso'),
969 969
 
970 970
 	// Reference: packages/components/src/CalendarDateRange/CalendarDateRange.tsx:39
971
-	__( 'to', 'event_espresso' ),
971
+	__('to', 'event_espresso'),
972 972
 
973 973
 	// Reference: packages/components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:33
974
-	__( 'starts', 'event_espresso' ),
974
+	__('starts', 'event_espresso'),
975 975
 
976 976
 	// Reference: packages/components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:45
977
-	__( 'ends', 'event_espresso' ),
977
+	__('ends', 'event_espresso'),
978 978
 
979 979
 	// Reference: packages/components/src/CalendarPageDate/CalendarPageDate.tsx:57
980
-	__( 'TO', 'event_espresso' ),
980
+	__('TO', 'event_espresso'),
981 981
 
982 982
 	// Reference: packages/components/src/Confirm/ConfirmClose.tsx:8
983 983
 	// Reference: packages/components/src/Modal/ModalWithAlert.tsx:24
984
-	__( 'Are you sure you want to close this?', 'event_espresso' ),
984
+	__('Are you sure you want to close this?', 'event_espresso'),
985 985
 
986 986
 	// Reference: packages/components/src/Confirm/ConfirmDelete.tsx:8
987
-	__( 'Are you sure you want to delete this?', 'event_espresso' ),
987
+	__('Are you sure you want to delete this?', 'event_espresso'),
988 988
 
989 989
 	// Reference: packages/components/src/Confirm/useConfirmWithButton.tsx:11
990
-	__( 'Please confirm this action.', 'event_espresso' ),
990
+	__('Please confirm this action.', 'event_espresso'),
991 991
 
992 992
 	// Reference: packages/components/src/Confirm/useConfirmationDialog.tsx:32
993
-	__( 'No', 'event_espresso' ),
993
+	__('No', 'event_espresso'),
994 994
 
995 995
 	// Reference: packages/components/src/Confirm/useConfirmationDialog.tsx:33
996
-	__( 'Yes', 'event_espresso' ),
996
+	__('Yes', 'event_espresso'),
997 997
 
998 998
 	// Reference: packages/components/src/CurrencyDisplay/index.tsx:19
999
-	__( 'free', 'event_espresso' ),
999
+	__('free', 'event_espresso'),
1000 1000
 
1001 1001
 	// Reference: packages/components/src/DateTimeRangePicker/index.tsx:74
1002 1002
 	// Reference: packages/components/src/Popover/PopoverForm/PopoverForm.tsx:42
1003
-	__( 'save', 'event_espresso' ),
1003
+	__('save', 'event_espresso'),
1004 1004
 
1005 1005
 	// Reference: packages/components/src/DebugInfo/DebugInfo.tsx:38
1006
-	__( 'Hide Debug Info', 'event_espresso' ),
1006
+	__('Hide Debug Info', 'event_espresso'),
1007 1007
 
1008 1008
 	// Reference: packages/components/src/DebugInfo/DebugInfo.tsx:38
1009
-	__( 'Show Debug Info', 'event_espresso' ),
1009
+	__('Show Debug Info', 'event_espresso'),
1010 1010
 
1011 1011
 	// Reference: packages/components/src/EditDateRangeButton/index.tsx:41
1012
-	__( 'Edit Start and End Dates and Times', 'event_espresso' ),
1012
+	__('Edit Start and End Dates and Times', 'event_espresso'),
1013 1013
 
1014 1014
 	// Reference: packages/components/src/EntityActionsMenu/entityMenuItems/Copy.tsx:9
1015
-	__( 'copy', 'event_espresso' ),
1015
+	__('copy', 'event_espresso'),
1016 1016
 
1017 1017
 	// Reference: packages/components/src/EntityActionsMenu/entityMenuItems/Edit.tsx:9
1018
-	__( 'edit', 'event_espresso' ),
1018
+	__('edit', 'event_espresso'),
1019 1019
 
1020 1020
 	// Reference: packages/components/src/EntityActionsMenu/entityMenuItems/Trash.tsx:9
1021
-	__( 'trash', 'event_espresso' ),
1021
+	__('trash', 'event_espresso'),
1022 1022
 
1023 1023
 	// Reference: packages/components/src/EntityDetailsPanel/EntityDetailsPanelSold.tsx:36
1024
-	__( 'view approved registrations for this date.', 'event_espresso' ),
1024
+	__('view approved registrations for this date.', 'event_espresso'),
1025 1025
 
1026 1026
 	// Reference: packages/components/src/EntityDetailsPanel/EntityDetailsPanelSold.tsx:37
1027
-	__( 'view approved registrations for this ticket.', 'event_espresso' ),
1027
+	__('view approved registrations for this ticket.', 'event_espresso'),
1028 1028
 
1029 1029
 	// Reference: packages/components/src/EntityList/EntityList.tsx:36
1030
-	__( 'no results found', 'event_espresso' ),
1030
+	__('no results found', 'event_espresso'),
1031 1031
 
1032 1032
 	// Reference: packages/components/src/EntityList/EntityList.tsx:37
1033
-	__( 'try changing filter settings', 'event_espresso' ),
1033
+	__('try changing filter settings', 'event_espresso'),
1034 1034
 
1035 1035
 	// Reference: packages/components/src/EntityList/filterBar/buttons/CardViewFilterButton.tsx:22
1036
-	__( 'card view', 'event_espresso' ),
1036
+	__('card view', 'event_espresso'),
1037 1037
 
1038 1038
 	// Reference: packages/components/src/EntityList/filterBar/buttons/TableViewFilterButton.tsx:22
1039
-	__( 'table view', 'event_espresso' ),
1039
+	__('table view', 'event_espresso'),
1040 1040
 
1041 1041
 	// Reference: packages/components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:11
1042
-	__( 'hide filters', 'event_espresso' ),
1042
+	__('hide filters', 'event_espresso'),
1043 1043
 
1044 1044
 	// Reference: packages/components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:11
1045
-	__( 'show filters', 'event_espresso' ),
1045
+	__('show filters', 'event_espresso'),
1046 1046
 
1047 1047
 	// Reference: packages/components/src/EntityList/filterBar/buttons/ToggleSortingButton.tsx:28
1048
-	__( 'disable sorting', 'event_espresso' ),
1048
+	__('disable sorting', 'event_espresso'),
1049 1049
 
1050 1050
 	// Reference: packages/components/src/EntityList/filterBar/buttons/ToggleSortingButton.tsx:28
1051
-	__( 'enable sorting', 'event_espresso' ),
1051
+	__('enable sorting', 'event_espresso'),
1052 1052
 
1053 1053
 	// Reference: packages/components/src/Legend/ToggleLegendButton.tsx:27
1054
-	__( 'hide legend', 'event_espresso' ),
1054
+	__('hide legend', 'event_espresso'),
1055 1055
 
1056 1056
 	// Reference: packages/components/src/Legend/ToggleLegendButton.tsx:27
1057
-	__( 'show legend', 'event_espresso' ),
1057
+	__('show legend', 'event_espresso'),
1058 1058
 
1059 1059
 	// Reference: packages/components/src/LoadingNotice/LoadingNotice.tsx:12
1060
-	__( 'loading…', 'event_espresso' ),
1060
+	__('loading…', 'event_espresso'),
1061 1061
 
1062 1062
 	// Reference: packages/components/src/Modal/Modal.tsx:59
1063
-	__( 'close modal', 'event_espresso' ),
1063
+	__('close modal', 'event_espresso'),
1064 1064
 
1065 1065
 	// Reference: packages/components/src/Pagination/ItemRender.tsx:10
1066
-	__( 'next', 'event_espresso' ),
1066
+	__('next', 'event_espresso'),
1067 1067
 
1068 1068
 	// Reference: packages/components/src/Pagination/ItemRender.tsx:11
1069
-	__( 'jump to previous', 'event_espresso' ),
1069
+	__('jump to previous', 'event_espresso'),
1070 1070
 
1071 1071
 	// Reference: packages/components/src/Pagination/ItemRender.tsx:12
1072
-	__( 'jump to next', 'event_espresso' ),
1072
+	__('jump to next', 'event_espresso'),
1073 1073
 
1074 1074
 	// Reference: packages/components/src/Pagination/ItemRender.tsx:13
1075
-	__( 'page', 'event_espresso' ),
1075
+	__('page', 'event_espresso'),
1076 1076
 
1077 1077
 	// Reference: packages/components/src/Pagination/ItemRender.tsx:9
1078
-	__( 'previous', 'event_espresso' ),
1078
+	__('previous', 'event_espresso'),
1079 1079
 
1080 1080
 	// Reference: packages/components/src/Pagination/PerPage.tsx:37
1081
-	__( 'items per page', 'event_espresso' ),
1081
+	__('items per page', 'event_espresso'),
1082 1082
 
1083 1083
 	// Reference: packages/components/src/Pagination/constants.ts:10
1084 1084
 	/* translators: %s is per page value */
1085
-	__( '%s / page', 'event_espresso' ),
1085
+	__('%s / page', 'event_espresso'),
1086 1086
 
1087 1087
 	// Reference: packages/components/src/Pagination/constants.ts:13
1088
-	__( 'Next Page', 'event_espresso' ),
1088
+	__('Next Page', 'event_espresso'),
1089 1089
 
1090 1090
 	// Reference: packages/components/src/Pagination/constants.ts:14
1091
-	__( 'Previous Page', 'event_espresso' ),
1091
+	__('Previous Page', 'event_espresso'),
1092 1092
 
1093 1093
 	// Reference: packages/components/src/PercentSign/index.tsx:11
1094
-	__( '%', 'event_espresso' ),
1094
+	__('%', 'event_espresso'),
1095 1095
 
1096 1096
 	// Reference: packages/components/src/Stepper/buttons/Next.tsx:12
1097
-	__( 'Next', 'event_espresso' ),
1097
+	__('Next', 'event_espresso'),
1098 1098
 
1099 1099
 	// Reference: packages/components/src/Stepper/buttons/Previous.tsx:12
1100
-	__( 'Previous', 'event_espresso' ),
1100
+	__('Previous', 'event_espresso'),
1101 1101
 
1102 1102
 	// Reference: packages/components/src/Steps/Steps.tsx:30
1103
-	__( 'Steps', 'event_espresso' ),
1103
+	__('Steps', 'event_espresso'),
1104 1104
 
1105 1105
 	// Reference: packages/components/src/TabbableText/index.tsx:19
1106
-	__( 'Click to edit…', 'event_espresso' ),
1106
+	__('Click to edit…', 'event_espresso'),
1107 1107
 
1108 1108
 	// Reference: packages/components/src/TimezoneTimeInfo/Content.tsx:16
1109
-	__( 'Your Local Time Zone', 'event_espresso' ),
1109
+	__('Your Local Time Zone', 'event_espresso'),
1110 1110
 
1111 1111
 	// Reference: packages/components/src/TimezoneTimeInfo/Content.tsx:21
1112
-	__( 'The Website\'s Time Zone', 'event_espresso' ),
1112
+	__('The Website\'s Time Zone', 'event_espresso'),
1113 1113
 
1114 1114
 	// Reference: packages/components/src/TimezoneTimeInfo/Content.tsx:26
1115
-	__( 'UTC (Greenwich Mean Time)', 'event_espresso' ),
1115
+	__('UTC (Greenwich Mean Time)', 'event_espresso'),
1116 1116
 
1117 1117
 	// Reference: packages/components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:22
1118
-	__( 'This Date Converted To:', 'event_espresso' ),
1118
+	__('This Date Converted To:', 'event_espresso'),
1119 1119
 
1120 1120
 	// Reference: packages/components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:23
1121
-	__( 'click for timezone information', 'event_espresso' ),
1121
+	__('click for timezone information', 'event_espresso'),
1122 1122
 
1123 1123
 	// Reference: packages/components/src/bulkEdit/ActionCheckbox.tsx:38
1124 1124
 	/* translators: %d entity id */
1125
-	__( 'select entity with id %d', 'event_espresso' ),
1125
+	__('select entity with id %d', 'event_espresso'),
1126 1126
 
1127 1127
 	// Reference: packages/components/src/bulkEdit/ActionCheckbox.tsx:41
1128
-	__( 'select all entities', 'event_espresso' ),
1128
+	__('select all entities', 'event_espresso'),
1129 1129
 
1130 1130
 	// Reference: packages/components/src/bulkEdit/BulkActions.tsx:52
1131
-	__( 'select all', 'event_espresso' ),
1131
+	__('select all', 'event_espresso'),
1132 1132
 
1133 1133
 	// Reference: packages/components/src/bulkEdit/BulkActions.tsx:54
1134
-	__( 'apply', 'event_espresso' ),
1134
+	__('apply', 'event_espresso'),
1135 1135
 
1136 1136
 	// Reference: packages/components/src/bulkEdit/details/BulkEditDetailsProps.tsx:20
1137
-	__( 'Note: ', 'event_espresso' ),
1137
+	__('Note: ', 'event_espresso'),
1138 1138
 
1139 1139
 	// Reference: packages/components/src/bulkEdit/details/BulkEditDetailsProps.tsx:20
1140
-	__( 'any changes will be applied to ALL of the selected entities.', 'event_espresso' ),
1140
+	__('any changes will be applied to ALL of the selected entities.', 'event_espresso'),
1141 1141
 
1142 1142
 	// Reference: packages/components/src/bulkEdit/details/BulkEditDetailsProps.tsx:26
1143
-	__( 'Bulk edit details', 'event_espresso' ),
1143
+	__('Bulk edit details', 'event_espresso'),
1144 1144
 
1145 1145
 	// Reference: packages/components/src/bulkEdit/details/Submit.tsx:28
1146
-	__( 'Are you sure you want to bulk update the details?', 'event_espresso' ),
1146
+	__('Are you sure you want to bulk update the details?', 'event_espresso'),
1147 1147
 
1148 1148
 	// Reference: packages/components/src/bulkEdit/details/Submit.tsx:29
1149
-	__( 'Bulk update details', 'event_espresso' ),
1149
+	__('Bulk update details', 'event_espresso'),
1150 1150
 
1151 1151
 	// Reference: packages/constants/src/datetimeStatus.ts:5
1152 1152
 	// Reference: packages/predicates/src/registration/statusOptions.ts:10
1153
-	__( 'Cancelled', 'event_espresso' ),
1153
+	__('Cancelled', 'event_espresso'),
1154 1154
 
1155 1155
 	// Reference: packages/constants/src/datetimeStatus.ts:7
1156
-	__( 'Inactive', 'event_espresso' ),
1156
+	__('Inactive', 'event_espresso'),
1157 1157
 
1158 1158
 	// Reference: packages/constants/src/datetimeStatus.ts:8
1159
-	__( 'Postponed', 'event_espresso' ),
1159
+	__('Postponed', 'event_espresso'),
1160 1160
 
1161 1161
 	// Reference: packages/constants/src/datetimeStatus.ts:9
1162
-	__( 'SoldOut', 'event_espresso' ),
1162
+	__('SoldOut', 'event_espresso'),
1163 1163
 
1164 1164
 	// Reference: packages/dates/src/DateRangePicker/DateRangePickerLegend.tsx:14
1165
-	__( 'day in range', 'event_espresso' ),
1165
+	__('day in range', 'event_espresso'),
1166 1166
 
1167 1167
 	// Reference: packages/dates/src/DateRangePicker/DateRangePickerLegend.tsx:18
1168 1168
 	// Reference: packages/dates/src/DateRangePicker/index.tsx:60
1169
-	__( 'end date', 'event_espresso' ),
1169
+	__('end date', 'event_espresso'),
1170 1170
 
1171 1171
 	// Reference: packages/dates/src/DateTimePicker.tsx:13
1172 1172
 	// Reference: packages/dates/src/TimePicker.tsx:14
1173
-	__( 'time', 'event_espresso' ),
1173
+	__('time', 'event_espresso'),
1174 1174
 
1175 1175
 	// Reference: packages/dates/src/constants.ts:5
1176
-	__( 'End Date & Time must be set later than the Start Date & Time', 'event_espresso' ),
1176
+	__('End Date & Time must be set later than the Start Date & Time', 'event_espresso'),
1177 1177
 
1178 1178
 	// Reference: packages/dates/src/constants.ts:7
1179
-	__( 'Start Date & Time must be set before the End Date & Time', 'event_espresso' ),
1179
+	__('Start Date & Time must be set before the End Date & Time', 'event_espresso'),
1180 1180
 
1181 1181
 	// Reference: packages/dates/src/utils/misc.ts:14
1182
-	__( 'month(s)', 'event_espresso' ),
1182
+	__('month(s)', 'event_espresso'),
1183 1183
 
1184 1184
 	// Reference: packages/dates/src/utils/misc.ts:15
1185
-	__( 'week(s)', 'event_espresso' ),
1185
+	__('week(s)', 'event_espresso'),
1186 1186
 
1187 1187
 	// Reference: packages/dates/src/utils/misc.ts:16
1188
-	__( 'day(s)', 'event_espresso' ),
1188
+	__('day(s)', 'event_espresso'),
1189 1189
 
1190 1190
 	// Reference: packages/dates/src/utils/misc.ts:17
1191
-	__( 'hour(s)', 'event_espresso' ),
1191
+	__('hour(s)', 'event_espresso'),
1192 1192
 
1193 1193
 	// Reference: packages/dates/src/utils/misc.ts:18
1194
-	__( 'minute(s)', 'event_espresso' ),
1194
+	__('minute(s)', 'event_espresso'),
1195 1195
 
1196 1196
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:104
1197
-	__( 'price types initialized', 'event_espresso' ),
1197
+	__('price types initialized', 'event_espresso'),
1198 1198
 
1199 1199
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:114
1200
-	__( 'datetimes initialized', 'event_espresso' ),
1200
+	__('datetimes initialized', 'event_espresso'),
1201 1201
 
1202 1202
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:124
1203
-	__( 'tickets initialized', 'event_espresso' ),
1203
+	__('tickets initialized', 'event_espresso'),
1204 1204
 
1205 1205
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:134
1206
-	__( 'prices initialized', 'event_espresso' ),
1206
+	__('prices initialized', 'event_espresso'),
1207 1207
 
1208 1208
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:22
1209
-	__( 'End date has been set one hour after start date', 'event_espresso' ),
1209
+	__('End date has been set one hour after start date', 'event_espresso'),
1210 1210
 
1211 1211
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:35
1212
-	__( 'Start date has been set one hour before end date', 'event_espresso' ),
1212
+	__('Start date has been set one hour before end date', 'event_espresso'),
1213 1213
 
1214 1214
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:47
1215
-	__( 'Required', 'event_espresso' ),
1215
+	__('Required', 'event_espresso'),
1216 1216
 
1217 1217
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:52
1218
-	__( 'Start Date is required', 'event_espresso' ),
1218
+	__('Start Date is required', 'event_espresso'),
1219 1219
 
1220 1220
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:56
1221
-	__( 'End Date is required', 'event_espresso' ),
1221
+	__('End Date is required', 'event_espresso'),
1222 1222
 
1223 1223
 	// Reference: packages/form/src/renderers/RepeatableRenderer.tsx:35
1224 1224
 	/* translators: %d the entry number */
1225
-	__( 'Entry %d', 'event_espresso' ),
1225
+	__('Entry %d', 'event_espresso'),
1226 1226
 
1227 1227
 	// Reference: packages/form/src/renderers/RepeatableRenderer.tsx:51
1228
-	__( 'Add', 'event_espresso' ),
1228
+	__('Add', 'event_espresso'),
1229 1229
 
1230 1230
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:11
1231 1231
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:17
1232
-	__( 'sold out', 'event_espresso' ),
1232
+	__('sold out', 'event_espresso'),
1233 1233
 
1234 1234
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:14
1235 1235
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:14
1236
-	__( 'expired', 'event_espresso' ),
1236
+	__('expired', 'event_espresso'),
1237 1237
 
1238 1238
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:17
1239
-	__( 'upcoming', 'event_espresso' ),
1239
+	__('upcoming', 'event_espresso'),
1240 1240
 
1241 1241
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:20
1242
-	__( 'active', 'event_espresso' ),
1242
+	__('active', 'event_espresso'),
1243 1243
 
1244 1244
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:23
1245 1245
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:11
1246
-	__( 'trashed', 'event_espresso' ),
1246
+	__('trashed', 'event_espresso'),
1247 1247
 
1248 1248
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:26
1249
-	__( 'cancelled', 'event_espresso' ),
1249
+	__('cancelled', 'event_espresso'),
1250 1250
 
1251 1251
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:29
1252
-	__( 'postponed', 'event_espresso' ),
1252
+	__('postponed', 'event_espresso'),
1253 1253
 
1254 1254
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:33
1255
-	__( 'inactive', 'event_espresso' ),
1255
+	__('inactive', 'event_espresso'),
1256 1256
 
1257 1257
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:20
1258
-	__( 'pending', 'event_espresso' ),
1258
+	__('pending', 'event_espresso'),
1259 1259
 
1260 1260
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:23
1261
-	__( 'on sale', 'event_espresso' ),
1261
+	__('on sale', 'event_espresso'),
1262 1262
 
1263 1263
 	// Reference: packages/predicates/src/registration/statusOptions.ts:14
1264
-	__( 'Declined', 'event_espresso' ),
1264
+	__('Declined', 'event_espresso'),
1265 1265
 
1266 1266
 	// Reference: packages/predicates/src/registration/statusOptions.ts:18
1267
-	__( 'Incomplete', 'event_espresso' ),
1267
+	__('Incomplete', 'event_espresso'),
1268 1268
 
1269 1269
 	// Reference: packages/predicates/src/registration/statusOptions.ts:22
1270
-	__( 'Not Approved', 'event_espresso' ),
1270
+	__('Not Approved', 'event_espresso'),
1271 1271
 
1272 1272
 	// Reference: packages/predicates/src/registration/statusOptions.ts:26
1273
-	__( 'Pending Payment', 'event_espresso' ),
1273
+	__('Pending Payment', 'event_espresso'),
1274 1274
 
1275 1275
 	// Reference: packages/predicates/src/registration/statusOptions.ts:30
1276
-	__( 'Wait List', 'event_espresso' ),
1276
+	__('Wait List', 'event_espresso'),
1277 1277
 
1278 1278
 	// Reference: packages/predicates/src/registration/statusOptions.ts:6
1279
-	__( 'Approved', 'event_espresso' ),
1279
+	__('Approved', 'event_espresso'),
1280 1280
 
1281 1281
 	// Reference: packages/tpc/src/buttons/AddPriceModifierButton.tsx:15
1282
-	__( 'add new price modifier after this row', 'event_espresso' ),
1282
+	__('add new price modifier after this row', 'event_espresso'),
1283 1283
 
1284 1284
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:13
1285
-	__( 'Delete all prices', 'event_espresso' ),
1285
+	__('Delete all prices', 'event_espresso'),
1286 1286
 
1287 1287
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:26
1288
-	__( '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' ),
1288
+	__('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'),
1289 1289
 
1290 1290
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:30
1291
-	__( 'Delete all prices?', 'event_espresso' ),
1291
+	__('Delete all prices?', 'event_espresso'),
1292 1292
 
1293 1293
 	// Reference: packages/tpc/src/buttons/DeletePriceModifierButton.tsx:12
1294
-	__( 'delete price modifier', 'event_espresso' ),
1294
+	__('delete price modifier', 'event_espresso'),
1295 1295
 
1296 1296
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:15
1297
-	__( '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' ),
1297
+	__('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'),
1298 1298
 
1299 1299
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:18
1300
-	__( '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' ),
1300
+	__('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'),
1301 1301
 
1302 1302
 	// Reference: packages/tpc/src/buttons/TicketPriceCalculatorButton.tsx:29
1303
-	__( 'ticket price calculator', 'event_espresso' ),
1303
+	__('ticket price calculator', 'event_espresso'),
1304 1304
 
1305 1305
 	// Reference: packages/tpc/src/buttons/taxes/AddDefaultTaxesButton.tsx:10
1306
-	__( 'Add default taxes', 'event_espresso' ),
1306
+	__('Add default taxes', 'event_espresso'),
1307 1307
 
1308 1308
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:11
1309
-	__( 'Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso' ),
1309
+	__('Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso'),
1310 1310
 
1311 1311
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:15
1312
-	__( 'Remove all taxes?', 'event_espresso' ),
1312
+	__('Remove all taxes?', 'event_espresso'),
1313 1313
 
1314 1314
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:8
1315
-	__( 'Remove taxes', 'event_espresso' ),
1315
+	__('Remove taxes', 'event_espresso'),
1316 1316
 
1317 1317
 	// Reference: packages/tpc/src/components/DefaultPricesInfo.tsx:28
1318
-	__( 'Modify default prices.', 'event_espresso' ),
1318
+	__('Modify default prices.', 'event_espresso'),
1319 1319
 
1320 1320
 	// Reference: packages/tpc/src/components/DefaultTaxesInfo.tsx:28
1321
-	__( 'New default taxes are available. Click the - Add default taxes - button to add them now.', 'event_espresso' ),
1321
+	__('New default taxes are available. Click the - Add default taxes - button to add them now.', 'event_espresso'),
1322 1322
 
1323 1323
 	// Reference: packages/tpc/src/components/NoPricesBanner/AddDefaultPricesButton.tsx:10
1324
-	__( 'Add default prices', 'event_espresso' ),
1324
+	__('Add default prices', 'event_espresso'),
1325 1325
 
1326 1326
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:14
1327
-	__( 'This Ticket is Currently Free', 'event_espresso' ),
1327
+	__('This Ticket is Currently Free', 'event_espresso'),
1328 1328
 
1329 1329
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:22
1330 1330
 	/* translators: %s default prices */
1331
-	__( 'Click the button below to load your %s into the calculator.', 'event_espresso' ),
1331
+	__('Click the button below to load your %s into the calculator.', 'event_espresso'),
1332 1332
 
1333 1333
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:23
1334
-	__( 'default prices', 'event_espresso' ),
1334
+	__('default prices', 'event_espresso'),
1335 1335
 
1336 1336
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:30
1337
-	__( 'Additional ticket price modifiers can be added or removed.', 'event_espresso' ),
1337
+	__('Additional ticket price modifiers can be added or removed.', 'event_espresso'),
1338 1338
 
1339 1339
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:33
1340
-	__( 'Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso' ),
1340
+	__('Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso'),
1341 1341
 
1342 1342
 	// Reference: packages/tpc/src/components/TicketPriceCalculatorModal.tsx:31
1343 1343
 	/* translators: %s ticket name */
1344
-	__( 'Price Calculator for Ticket: %s', 'event_espresso' ),
1344
+	__('Price Calculator for Ticket: %s', 'event_espresso'),
1345 1345
 
1346 1346
 	// Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:41
1347
-	__( 'Total', 'event_espresso' ),
1347
+	__('Total', 'event_espresso'),
1348 1348
 
1349 1349
 	// Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:50
1350
-	__( 'ticket total', 'event_espresso' ),
1350
+	__('ticket total', 'event_espresso'),
1351 1351
 
1352 1352
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:29
1353
-	__( 'Price Type', 'event_espresso' ),
1353
+	__('Price Type', 'event_espresso'),
1354 1354
 
1355 1355
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:35
1356
-	__( 'Label', 'event_espresso' ),
1356
+	__('Label', 'event_espresso'),
1357 1357
 
1358 1358
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:47
1359
-	__( 'Amount', 'event_espresso' ),
1359
+	__('Amount', 'event_espresso'),
1360 1360
 
1361 1361
 	// Reference: packages/tpc/src/inputs/PriceAmountInput.tsx:31
1362
-	__( 'amount', 'event_espresso' ),
1362
+	__('amount', 'event_espresso'),
1363 1363
 
1364 1364
 	// Reference: packages/tpc/src/inputs/PriceAmountInput.tsx:42
1365
-	__( 'amount…', 'event_espresso' ),
1365
+	__('amount…', 'event_espresso'),
1366 1366
 
1367 1367
 	// Reference: packages/tpc/src/inputs/PriceDescriptionInput.tsx:10
1368
-	__( 'price description', 'event_espresso' ),
1368
+	__('price description', 'event_espresso'),
1369 1369
 
1370 1370
 	// Reference: packages/tpc/src/inputs/PriceDescriptionInput.tsx:15
1371
-	__( 'description…', 'event_espresso' ),
1371
+	__('description…', 'event_espresso'),
1372 1372
 
1373 1373
 	// Reference: packages/tpc/src/inputs/PriceIdInput.tsx:9
1374
-	__( 'price id', 'event_espresso' ),
1374
+	__('price id', 'event_espresso'),
1375 1375
 
1376 1376
 	// Reference: packages/tpc/src/inputs/PriceNameInput.tsx:10
1377
-	__( 'price name', 'event_espresso' ),
1377
+	__('price name', 'event_espresso'),
1378 1378
 
1379 1379
 	// Reference: packages/tpc/src/inputs/PriceNameInput.tsx:15
1380
-	__( 'label…', 'event_espresso' ),
1380
+	__('label…', 'event_espresso'),
1381 1381
 
1382 1382
 	// Reference: packages/tpc/src/inputs/PriceTypeInput.tsx:16
1383
-	__( 'price type', 'event_espresso' ),
1383
+	__('price type', 'event_espresso'),
1384 1384
 
1385 1385
 	// Reference: packages/tpc/src/utils/constants.ts:13
1386
-	__( '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 archive the old tickets.', 'event_espresso' )
1386
+	__('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 archive the old tickets.', 'event_espresso')
1387 1387
 );
1388 1388
 /* THIS IS THE END OF THE GENERATED FILE */
Please login to merge, or discard this patch.
modules/ticket_selector/TicketSelectorRowStandard.php 1 patch
Indentation   +352 added lines, -352 removed lines patch added patch discarded remove patch
@@ -17,356 +17,356 @@
 block discarded – undo
17 17
 class TicketSelectorRowStandard extends TicketSelectorRow
18 18
 {
19 19
 
20
-    /**
21
-     * @var TicketDetails $ticket_details
22
-     */
23
-    protected $ticket_details;
24
-
25
-    /**
26
-     * @var \EE_Ticket_Selector_Config $template_settings
27
-     */
28
-    protected $template_settings;
29
-
30
-    /**
31
-     * @var EE_Tax_Config $tax_settings
32
-     */
33
-    protected $tax_settings;
34
-
35
-    /**
36
-     * @var boolean $prices_displayed_including_taxes
37
-     */
38
-    protected $prices_displayed_including_taxes;
39
-
40
-    /**
41
-     * @var int $row
42
-     */
43
-    protected $row;
44
-
45
-    /**
46
-     * @var int $cols
47
-     */
48
-    protected $cols;
49
-
50
-    /**
51
-     * @var boolean $hidden_input_qty
52
-     */
53
-    protected $hidden_input_qty;
54
-
55
-    /**
56
-     * @var string $ticket_datetime_classes
57
-     */
58
-    protected $ticket_datetime_classes;
59
-
60
-
61
-    /**
62
-     * TicketDetails constructor.
63
-     *
64
-     * @param TicketDetails $ticket_details
65
-     * @param EE_Tax_Config $tax_settings
66
-     * @param int           $total_tickets
67
-     * @param int           $max_attendees
68
-     * @param int           $row
69
-     * @param int           $cols
70
-     * @param boolean       $required_ticket_sold_out
71
-     * @param string        $event_status
72
-     * @param string        $ticket_datetime_classes
73
-     * @throws EE_Error
74
-     * @throws UnexpectedEntityException
75
-     */
76
-    public function __construct(
77
-        TicketDetails $ticket_details,
78
-        EE_Tax_Config $tax_settings,
79
-        $total_tickets,
80
-        $max_attendees,
81
-        $row,
82
-        $cols,
83
-        $required_ticket_sold_out,
84
-        $event_status,
85
-        $ticket_datetime_classes
86
-    ) {
87
-        $this->ticket_details = $ticket_details;
88
-        $this->template_settings = $ticket_details->getTemplateSettings();
89
-        $this->tax_settings = $tax_settings;
90
-        $this->row = $row;
91
-        $this->cols = $cols;
92
-        $this->ticket_datetime_classes = $ticket_datetime_classes;
93
-        parent::__construct(
94
-            $ticket_details->getTicket(),
95
-            $max_attendees,
96
-            $ticket_details->getDateFormat(),
97
-            $event_status,
98
-            $required_ticket_sold_out,
99
-            $total_tickets
100
-        );
101
-    }
102
-
103
-
104
-    /**
105
-     * other ticket rows will need to know if a required ticket is sold out,
106
-     * so that they are not offered for sale
107
-     *
108
-     * @return boolean
109
-     */
110
-    public function getRequiredTicketSoldOut()
111
-    {
112
-        return $this->required_ticket_sold_out;
113
-    }
114
-
115
-
116
-    /**
117
-     * @return int
118
-     */
119
-    public function getCols()
120
-    {
121
-        return $this->cols;
122
-    }
123
-
124
-
125
-    /**
126
-     * getHtml
127
-     *
128
-     * @return string
129
-     * @throws EE_Error
130
-     */
131
-    public function getHtml()
132
-    {
133
-        $this->min = 0;
134
-        $this->max = $this->ticket->max();
135
-        $remaining = $this->ticket->remaining();
136
-        $this->setTicketMinAndMax($remaining);
137
-        // set flag if ticket is required (flag is set to start date so that future tickets are not blocked)
138
-        $this->required_ticket_sold_out = $this->ticket->required() && ! $remaining
139
-            ? $this->ticket->start_date()
140
-            : $this->required_ticket_sold_out;
141
-        $this->setTicketPriceDetails();
142
-        $this->setTicketStatusClasses($remaining);
143
-        $filtered_row_html = $this->getFilteredRowHtml();
144
-        if ($filtered_row_html !== false) {
145
-            return $filtered_row_html;
146
-        }
147
-        $ticket_selector_row_html = EEH_HTML::tr(
148
-            '',
149
-            '',
150
-            "tckt-slctr-tbl-tr ee-hidden-ticket-tr {$this->status_class}{$this->ticket_datetime_classes} "
151
-            . espresso_get_object_css_class($this->ticket)
152
-        );
153
-        $filtered_row_content = $this->getFilteredRowContents();
154
-        if ($filtered_row_content !== false && $this->max_attendees === 1) {
155
-            return $ticket_selector_row_html
156
-                   . $filtered_row_content
157
-                   . $this->ticketQtyAndIdHiddenInputs()
158
-                   . EEH_HTML::trx();
159
-        }
160
-        if ($filtered_row_content !== false) {
161
-            return $ticket_selector_row_html
162
-                   . $filtered_row_content
163
-                   . EEH_HTML::trx();
164
-        }
165
-        $this->hidden_input_qty = $this->max_attendees > 1;
166
-
167
-        $ticket_selector_row_html .= $this->ticketNameTableCell();
168
-        $ticket_selector_row_html .= $this->ticketPriceTableCell();
169
-        $ticket_selector_row_html .= EEH_HTML::td(
170
-            '',
171
-            '',
172
-            'tckt-slctr-tbl-td-qty cntr',
173
-            '',
174
-            'headers="quantity-' . $this->EVT_ID . '"'
175
-        );
176
-        $this->setTicketStatusDisplay($remaining);
177
-        if (empty($this->ticket_status_display)) {
178
-            if ($this->max_attendees === 1) {
179
-                // only ONE attendee is allowed to register at a time
180
-                $ticket_selector_row_html .= $this->onlyOneAttendeeCanRegister();
181
-            } elseif ($this->max > 0) {
182
-                $ticket_selector_row_html .= $this->ticketQuantitySelector();
183
-            }
184
-        }
185
-        $ticket_selector_row_html .= $this->ticket_status_display;
186
-        $ticket_selector_row_html .= $this->ticketQtyAndIdHiddenInputs();
187
-        $ticket_selector_row_html .= $this->ticket_details->display(
188
-            $this->ticket_price,
189
-            $remaining,
190
-            $this->cols
191
-        );
192
-        $ticket_selector_row_html .= EEH_HTML::tdx();
193
-        $ticket_selector_row_html .= EEH_HTML::trx();
194
-
195
-
196
-        $this->row++;
197
-        return $ticket_selector_row_html;
198
-    }
199
-
200
-
201
-    /**
202
-     * getTicketPriceDetails
203
-     *
204
-     * @return void
205
-     * @throws EE_Error
206
-     */
207
-    protected function setTicketPriceDetails()
208
-    {
209
-        $this->ticket_price = $this->tax_settings->prices_displayed_including_taxes
210
-            ? $this->ticket->get_ticket_total_with_taxes()
211
-            : $this->ticket->get_ticket_subtotal();
212
-        $this->ticket_bundle = false;
213
-        $ticket_min = $this->ticket->min();
214
-        // for ticket bundles, set min and max qty the same
215
-        if ($ticket_min !== 0 && $ticket_min === $this->ticket->max()) {
216
-            $this->ticket_price *= $ticket_min;
217
-            $this->ticket_bundle = true;
218
-        }
219
-        $this->ticket_price = apply_filters(
220
-            'FHEE__ticket_selector_chart_template__ticket_price',
221
-            $this->ticket_price,
222
-            $this->ticket
223
-        );
224
-    }
225
-
226
-
227
-    /**
228
-     * ticketNameTableCell
229
-     *
230
-     * @return string
231
-     * @throws EE_Error
232
-     */
233
-    protected function ticketNameTableCell()
234
-    {
235
-        $html = EEH_HTML::td(
236
-            '',
237
-            '',
238
-            'tckt-slctr-tbl-td-name',
239
-            '',
240
-            'headers="details-' . $this->EVT_ID . '"'
241
-        );
242
-        $html .= EEH_HTML::strong($this->ticket->get_pretty('TKT_name'));
243
-        $html .= $this->ticket_details->getShowHideLinks();
244
-        if ($this->ticket->required()) {
245
-            $html .= EEH_HTML::p(
246
-                apply_filters(
247
-                    'FHEE__ticket_selector_chart_template__ticket_required_message',
248
-                    esc_html__('This ticket is required and must be purchased.', 'event_espresso')
249
-                ),
250
-                '',
251
-                'ticket-required-pg'
252
-            );
253
-        }
254
-        $html .= EEH_HTML::tdx();
255
-        return $html;
256
-    }
257
-
258
-
259
-    /**
260
-     * ticketPriceTableCell
261
-     *
262
-     * @return string
263
-     * @throws EE_Error
264
-     */
265
-    protected function ticketPriceTableCell()
266
-    {
267
-        $html = '';
268
-        if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) {
269
-            $html .= EEH_HTML::td(
270
-                '',
271
-                '',
272
-                'tckt-slctr-tbl-td-price jst-rght',
273
-                '',
274
-                'headers="price-' . $this->EVT_ID . '"'
275
-            );
276
-            $html .= \EEH_Template::format_currency($this->ticket_price);
277
-            $html .= $this->ticket->taxable()
278
-                ? EEH_HTML::span('*', '', 'taxable-tickets-asterisk grey-text')
279
-                : '';
280
-            $html .= ' ';
281
-            // phpcs:disable WordPress.WP.I18n.NoEmptyStrings
282
-            $html .= EEH_HTML::span(
283
-                $this->ticket_bundle
284
-                    ? apply_filters(
285
-                        'FHEE__ticket_selector_chart_template__per_ticket_bundle_text',
286
-                        __(' / bundle', 'event_espresso')
287
-                    )
288
-                    : apply_filters(
289
-                        'FHEE__ticket_selector_chart_template__per_ticket_text',
290
-                        __('', 'event_espresso')
291
-                    ),
292
-                '',
293
-                'smaller-text no-bold'
294
-            );
295
-            $html .= ' ';
296
-            $html .= EEH_HTML::tdx();
297
-            $this->cols++;
298
-        }
299
-        return $html;
300
-    }
301
-
302
-
303
-    /**
304
-     * onlyOneAttendeeCanRegister
305
-     *
306
-     * @return string
307
-     */
308
-    protected function onlyOneAttendeeCanRegister()
309
-    {
310
-        // display submit button since we have tickets available
311
-        add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
312
-        $this->hidden_input_qty = false;
313
-        $id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
314
-        $html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
315
-        $html .= esc_html__('Select this ticket', 'event_espresso') . '</label>';
316
-        $html .= '<input type="radio" name="tkt-slctr-qty-' . $this->EVT_ID . '"';
317
-        $html .= ' id="' . $id . '"';
318
-        $html .= ' class="ticket-selector-tbl-qty-slct" value="' . $this->row . '-1"';
319
-        $html .= $this->total_tickets === 1 ? ' checked="checked"' : '';
320
-        $html .= ' title=""/>';
321
-        return $html;
322
-    }
323
-
324
-
325
-    /**
326
-     * ticketQuantitySelector
327
-     *
328
-     * @return string
329
-     * @throws EE_Error
330
-     */
331
-    protected function ticketQuantitySelector()
332
-    {
333
-        // display submit button since we have tickets available
334
-        add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
335
-        $this->hidden_input_qty = false;
336
-        $id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
337
-        $html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
338
-        $html .= esc_html__('Quantity', 'event_espresso') . '</label>';
339
-        $html .= '<select name="tkt-slctr-qty-' . $this->EVT_ID . '[]"';
340
-        $html .= ' id="' . $id . '"';
341
-        $html .= ' class="ticket-selector-tbl-qty-slct">';
342
-        // this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased
343
-        if ($this->min !== 0 && ! $this->ticket->required()) {
344
-            $html .= '<option value="0">&nbsp;0&nbsp;</option>';
345
-        }
346
-        // offer ticket quantities from the min to the max
347
-        for ($i = $this->min; $i <= $this->max; $i++) {
348
-            $html .= '<option value="' . $i . '">&nbsp;' . $i . '&nbsp;</option>';
349
-        }
350
-        $html .= '</select>';
351
-        return $html;
352
-    }
353
-
354
-
355
-    /**
356
-     * getHiddenInputs
357
-     *
358
-     * @return string
359
-     * @throws EE_Error
360
-     */
361
-    protected function ticketQtyAndIdHiddenInputs()
362
-    {
363
-        $html = '';
364
-        // depending on group reg we need to change the format for qty
365
-        if ($this->hidden_input_qty) {
366
-            $html .= '<input type="hidden" name="tkt-slctr-qty-' . $this->EVT_ID . '[]" value="0"/>';
367
-        }
368
-        $html .= '<input type="hidden" name="tkt-slctr-ticket-id-' . $this->EVT_ID . '[]"';
369
-        $html .= ' value="' . $this->ticket->ID() . '"/>';
370
-        return $html;
371
-    }
20
+	/**
21
+	 * @var TicketDetails $ticket_details
22
+	 */
23
+	protected $ticket_details;
24
+
25
+	/**
26
+	 * @var \EE_Ticket_Selector_Config $template_settings
27
+	 */
28
+	protected $template_settings;
29
+
30
+	/**
31
+	 * @var EE_Tax_Config $tax_settings
32
+	 */
33
+	protected $tax_settings;
34
+
35
+	/**
36
+	 * @var boolean $prices_displayed_including_taxes
37
+	 */
38
+	protected $prices_displayed_including_taxes;
39
+
40
+	/**
41
+	 * @var int $row
42
+	 */
43
+	protected $row;
44
+
45
+	/**
46
+	 * @var int $cols
47
+	 */
48
+	protected $cols;
49
+
50
+	/**
51
+	 * @var boolean $hidden_input_qty
52
+	 */
53
+	protected $hidden_input_qty;
54
+
55
+	/**
56
+	 * @var string $ticket_datetime_classes
57
+	 */
58
+	protected $ticket_datetime_classes;
59
+
60
+
61
+	/**
62
+	 * TicketDetails constructor.
63
+	 *
64
+	 * @param TicketDetails $ticket_details
65
+	 * @param EE_Tax_Config $tax_settings
66
+	 * @param int           $total_tickets
67
+	 * @param int           $max_attendees
68
+	 * @param int           $row
69
+	 * @param int           $cols
70
+	 * @param boolean       $required_ticket_sold_out
71
+	 * @param string        $event_status
72
+	 * @param string        $ticket_datetime_classes
73
+	 * @throws EE_Error
74
+	 * @throws UnexpectedEntityException
75
+	 */
76
+	public function __construct(
77
+		TicketDetails $ticket_details,
78
+		EE_Tax_Config $tax_settings,
79
+		$total_tickets,
80
+		$max_attendees,
81
+		$row,
82
+		$cols,
83
+		$required_ticket_sold_out,
84
+		$event_status,
85
+		$ticket_datetime_classes
86
+	) {
87
+		$this->ticket_details = $ticket_details;
88
+		$this->template_settings = $ticket_details->getTemplateSettings();
89
+		$this->tax_settings = $tax_settings;
90
+		$this->row = $row;
91
+		$this->cols = $cols;
92
+		$this->ticket_datetime_classes = $ticket_datetime_classes;
93
+		parent::__construct(
94
+			$ticket_details->getTicket(),
95
+			$max_attendees,
96
+			$ticket_details->getDateFormat(),
97
+			$event_status,
98
+			$required_ticket_sold_out,
99
+			$total_tickets
100
+		);
101
+	}
102
+
103
+
104
+	/**
105
+	 * other ticket rows will need to know if a required ticket is sold out,
106
+	 * so that they are not offered for sale
107
+	 *
108
+	 * @return boolean
109
+	 */
110
+	public function getRequiredTicketSoldOut()
111
+	{
112
+		return $this->required_ticket_sold_out;
113
+	}
114
+
115
+
116
+	/**
117
+	 * @return int
118
+	 */
119
+	public function getCols()
120
+	{
121
+		return $this->cols;
122
+	}
123
+
124
+
125
+	/**
126
+	 * getHtml
127
+	 *
128
+	 * @return string
129
+	 * @throws EE_Error
130
+	 */
131
+	public function getHtml()
132
+	{
133
+		$this->min = 0;
134
+		$this->max = $this->ticket->max();
135
+		$remaining = $this->ticket->remaining();
136
+		$this->setTicketMinAndMax($remaining);
137
+		// set flag if ticket is required (flag is set to start date so that future tickets are not blocked)
138
+		$this->required_ticket_sold_out = $this->ticket->required() && ! $remaining
139
+			? $this->ticket->start_date()
140
+			: $this->required_ticket_sold_out;
141
+		$this->setTicketPriceDetails();
142
+		$this->setTicketStatusClasses($remaining);
143
+		$filtered_row_html = $this->getFilteredRowHtml();
144
+		if ($filtered_row_html !== false) {
145
+			return $filtered_row_html;
146
+		}
147
+		$ticket_selector_row_html = EEH_HTML::tr(
148
+			'',
149
+			'',
150
+			"tckt-slctr-tbl-tr ee-hidden-ticket-tr {$this->status_class}{$this->ticket_datetime_classes} "
151
+			. espresso_get_object_css_class($this->ticket)
152
+		);
153
+		$filtered_row_content = $this->getFilteredRowContents();
154
+		if ($filtered_row_content !== false && $this->max_attendees === 1) {
155
+			return $ticket_selector_row_html
156
+				   . $filtered_row_content
157
+				   . $this->ticketQtyAndIdHiddenInputs()
158
+				   . EEH_HTML::trx();
159
+		}
160
+		if ($filtered_row_content !== false) {
161
+			return $ticket_selector_row_html
162
+				   . $filtered_row_content
163
+				   . EEH_HTML::trx();
164
+		}
165
+		$this->hidden_input_qty = $this->max_attendees > 1;
166
+
167
+		$ticket_selector_row_html .= $this->ticketNameTableCell();
168
+		$ticket_selector_row_html .= $this->ticketPriceTableCell();
169
+		$ticket_selector_row_html .= EEH_HTML::td(
170
+			'',
171
+			'',
172
+			'tckt-slctr-tbl-td-qty cntr',
173
+			'',
174
+			'headers="quantity-' . $this->EVT_ID . '"'
175
+		);
176
+		$this->setTicketStatusDisplay($remaining);
177
+		if (empty($this->ticket_status_display)) {
178
+			if ($this->max_attendees === 1) {
179
+				// only ONE attendee is allowed to register at a time
180
+				$ticket_selector_row_html .= $this->onlyOneAttendeeCanRegister();
181
+			} elseif ($this->max > 0) {
182
+				$ticket_selector_row_html .= $this->ticketQuantitySelector();
183
+			}
184
+		}
185
+		$ticket_selector_row_html .= $this->ticket_status_display;
186
+		$ticket_selector_row_html .= $this->ticketQtyAndIdHiddenInputs();
187
+		$ticket_selector_row_html .= $this->ticket_details->display(
188
+			$this->ticket_price,
189
+			$remaining,
190
+			$this->cols
191
+		);
192
+		$ticket_selector_row_html .= EEH_HTML::tdx();
193
+		$ticket_selector_row_html .= EEH_HTML::trx();
194
+
195
+
196
+		$this->row++;
197
+		return $ticket_selector_row_html;
198
+	}
199
+
200
+
201
+	/**
202
+	 * getTicketPriceDetails
203
+	 *
204
+	 * @return void
205
+	 * @throws EE_Error
206
+	 */
207
+	protected function setTicketPriceDetails()
208
+	{
209
+		$this->ticket_price = $this->tax_settings->prices_displayed_including_taxes
210
+			? $this->ticket->get_ticket_total_with_taxes()
211
+			: $this->ticket->get_ticket_subtotal();
212
+		$this->ticket_bundle = false;
213
+		$ticket_min = $this->ticket->min();
214
+		// for ticket bundles, set min and max qty the same
215
+		if ($ticket_min !== 0 && $ticket_min === $this->ticket->max()) {
216
+			$this->ticket_price *= $ticket_min;
217
+			$this->ticket_bundle = true;
218
+		}
219
+		$this->ticket_price = apply_filters(
220
+			'FHEE__ticket_selector_chart_template__ticket_price',
221
+			$this->ticket_price,
222
+			$this->ticket
223
+		);
224
+	}
225
+
226
+
227
+	/**
228
+	 * ticketNameTableCell
229
+	 *
230
+	 * @return string
231
+	 * @throws EE_Error
232
+	 */
233
+	protected function ticketNameTableCell()
234
+	{
235
+		$html = EEH_HTML::td(
236
+			'',
237
+			'',
238
+			'tckt-slctr-tbl-td-name',
239
+			'',
240
+			'headers="details-' . $this->EVT_ID . '"'
241
+		);
242
+		$html .= EEH_HTML::strong($this->ticket->get_pretty('TKT_name'));
243
+		$html .= $this->ticket_details->getShowHideLinks();
244
+		if ($this->ticket->required()) {
245
+			$html .= EEH_HTML::p(
246
+				apply_filters(
247
+					'FHEE__ticket_selector_chart_template__ticket_required_message',
248
+					esc_html__('This ticket is required and must be purchased.', 'event_espresso')
249
+				),
250
+				'',
251
+				'ticket-required-pg'
252
+			);
253
+		}
254
+		$html .= EEH_HTML::tdx();
255
+		return $html;
256
+	}
257
+
258
+
259
+	/**
260
+	 * ticketPriceTableCell
261
+	 *
262
+	 * @return string
263
+	 * @throws EE_Error
264
+	 */
265
+	protected function ticketPriceTableCell()
266
+	{
267
+		$html = '';
268
+		if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) {
269
+			$html .= EEH_HTML::td(
270
+				'',
271
+				'',
272
+				'tckt-slctr-tbl-td-price jst-rght',
273
+				'',
274
+				'headers="price-' . $this->EVT_ID . '"'
275
+			);
276
+			$html .= \EEH_Template::format_currency($this->ticket_price);
277
+			$html .= $this->ticket->taxable()
278
+				? EEH_HTML::span('*', '', 'taxable-tickets-asterisk grey-text')
279
+				: '';
280
+			$html .= '&nbsp;';
281
+			// phpcs:disable WordPress.WP.I18n.NoEmptyStrings
282
+			$html .= EEH_HTML::span(
283
+				$this->ticket_bundle
284
+					? apply_filters(
285
+						'FHEE__ticket_selector_chart_template__per_ticket_bundle_text',
286
+						__(' / bundle', 'event_espresso')
287
+					)
288
+					: apply_filters(
289
+						'FHEE__ticket_selector_chart_template__per_ticket_text',
290
+						__('', 'event_espresso')
291
+					),
292
+				'',
293
+				'smaller-text no-bold'
294
+			);
295
+			$html .= '&nbsp;';
296
+			$html .= EEH_HTML::tdx();
297
+			$this->cols++;
298
+		}
299
+		return $html;
300
+	}
301
+
302
+
303
+	/**
304
+	 * onlyOneAttendeeCanRegister
305
+	 *
306
+	 * @return string
307
+	 */
308
+	protected function onlyOneAttendeeCanRegister()
309
+	{
310
+		// display submit button since we have tickets available
311
+		add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
312
+		$this->hidden_input_qty = false;
313
+		$id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
314
+		$html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
315
+		$html .= esc_html__('Select this ticket', 'event_espresso') . '</label>';
316
+		$html .= '<input type="radio" name="tkt-slctr-qty-' . $this->EVT_ID . '"';
317
+		$html .= ' id="' . $id . '"';
318
+		$html .= ' class="ticket-selector-tbl-qty-slct" value="' . $this->row . '-1"';
319
+		$html .= $this->total_tickets === 1 ? ' checked="checked"' : '';
320
+		$html .= ' title=""/>';
321
+		return $html;
322
+	}
323
+
324
+
325
+	/**
326
+	 * ticketQuantitySelector
327
+	 *
328
+	 * @return string
329
+	 * @throws EE_Error
330
+	 */
331
+	protected function ticketQuantitySelector()
332
+	{
333
+		// display submit button since we have tickets available
334
+		add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
335
+		$this->hidden_input_qty = false;
336
+		$id = 'ticket-selector-tbl-qty-slct-' . $this->EVT_ID . '-' . $this->row;
337
+		$html = '<label class="ee-a11y-screen-reader-text" for="' . $id . '">';
338
+		$html .= esc_html__('Quantity', 'event_espresso') . '</label>';
339
+		$html .= '<select name="tkt-slctr-qty-' . $this->EVT_ID . '[]"';
340
+		$html .= ' id="' . $id . '"';
341
+		$html .= ' class="ticket-selector-tbl-qty-slct">';
342
+		// this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased
343
+		if ($this->min !== 0 && ! $this->ticket->required()) {
344
+			$html .= '<option value="0">&nbsp;0&nbsp;</option>';
345
+		}
346
+		// offer ticket quantities from the min to the max
347
+		for ($i = $this->min; $i <= $this->max; $i++) {
348
+			$html .= '<option value="' . $i . '">&nbsp;' . $i . '&nbsp;</option>';
349
+		}
350
+		$html .= '</select>';
351
+		return $html;
352
+	}
353
+
354
+
355
+	/**
356
+	 * getHiddenInputs
357
+	 *
358
+	 * @return string
359
+	 * @throws EE_Error
360
+	 */
361
+	protected function ticketQtyAndIdHiddenInputs()
362
+	{
363
+		$html = '';
364
+		// depending on group reg we need to change the format for qty
365
+		if ($this->hidden_input_qty) {
366
+			$html .= '<input type="hidden" name="tkt-slctr-qty-' . $this->EVT_ID . '[]" value="0"/>';
367
+		}
368
+		$html .= '<input type="hidden" name="tkt-slctr-ticket-id-' . $this->EVT_ID . '[]"';
369
+		$html .= ' value="' . $this->ticket->ID() . '"/>';
370
+		return $html;
371
+	}
372 372
 }
Please login to merge, or discard this patch.
admin_pages/events/Events_Admin_Page.core.php 2 patches
Indentation   +2887 added lines, -2887 removed lines patch added patch discarded remove patch
@@ -16,2891 +16,2891 @@
 block discarded – undo
16 16
 class Events_Admin_Page extends EE_Admin_Page_CPT
17 17
 {
18 18
 
19
-    /**
20
-     * This will hold the event object for event_details screen.
21
-     *
22
-     * @access protected
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
-     * Initialize page props for this admin page group.
52
-     */
53
-    protected function _init_page_props()
54
-    {
55
-        $this->page_slug = EVENTS_PG_SLUG;
56
-        $this->page_label = EVENTS_LABEL;
57
-        $this->_admin_base_url = EVENTS_ADMIN_URL;
58
-        $this->_admin_base_path = EVENTS_ADMIN;
59
-        $this->_cpt_model_names = [
60
-            'create_new' => 'EEM_Event',
61
-            'edit'       => 'EEM_Event',
62
-        ];
63
-        $this->_cpt_edit_routes = [
64
-            'espresso_events' => 'edit',
65
-        ];
66
-        add_action(
67
-            'AHEE__EE_Admin_Page_CPT__set_model_object__after_set_object',
68
-            [$this, 'verify_event_edit'],
69
-            10,
70
-            2
71
-        );
72
-    }
73
-
74
-
75
-    /**
76
-     * Sets the ajax hooks used for this admin page group.
77
-     */
78
-    protected function _ajax_hooks()
79
-    {
80
-        add_action('wp_ajax_ee_save_timezone_setting', [$this, 'save_timezonestring_setting']);
81
-    }
82
-
83
-
84
-    /**
85
-     * Sets the page properties for this admin page group.
86
-     */
87
-    protected function _define_page_props()
88
-    {
89
-        $this->_admin_page_title = EVENTS_LABEL;
90
-        $this->_labels = [
91
-            'buttons'      => [
92
-                'add'             => esc_html__('Add New Event', 'event_espresso'),
93
-                'edit'            => esc_html__('Edit Event', 'event_espresso'),
94
-                'delete'          => esc_html__('Delete Event', 'event_espresso'),
95
-                'add_category'    => esc_html__('Add New Category', 'event_espresso'),
96
-                'edit_category'   => esc_html__('Edit Category', 'event_espresso'),
97
-                'delete_category' => esc_html__('Delete Category', 'event_espresso'),
98
-            ],
99
-            'editor_title' => [
100
-                'espresso_events' => esc_html__('Enter event title here', 'event_espresso'),
101
-            ],
102
-            'publishbox'   => [
103
-                'create_new'        => esc_html__('Save New Event', 'event_espresso'),
104
-                'edit'              => esc_html__('Update Event', 'event_espresso'),
105
-                'add_category'      => esc_html__('Save New Category', 'event_espresso'),
106
-                'edit_category'     => esc_html__('Update Category', 'event_espresso'),
107
-                'template_settings' => esc_html__('Update Settings', 'event_espresso'),
108
-            ],
109
-        ];
110
-    }
111
-
112
-
113
-    /**
114
-     * Sets the page routes property for this admin page group.
115
-     */
116
-    protected function _set_page_routes()
117
-    {
118
-        // load formatter helper
119
-        // load field generator helper
120
-        // is there a evt_id in the request?
121
-        $evt_id = ! empty($this->_req_data['EVT_ID']) && ! is_array($this->_req_data['EVT_ID'])
122
-            ? $this->_req_data['EVT_ID']
123
-            : 0;
124
-        $evt_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $evt_id;
125
-        $this->_page_routes = [
126
-            'default'                       => [
127
-                'func'       => '_events_overview_list_table',
128
-                'capability' => 'ee_read_events',
129
-            ],
130
-            'create_new'                    => [
131
-                'func'       => '_create_new_cpt_item',
132
-                'capability' => 'ee_edit_events',
133
-            ],
134
-            'edit'                          => [
135
-                'func'       => '_edit_cpt_item',
136
-                'capability' => 'ee_edit_event',
137
-                'obj_id'     => $evt_id,
138
-            ],
139
-            'copy_event'                    => [
140
-                'func'       => '_copy_events',
141
-                'capability' => 'ee_edit_event',
142
-                'obj_id'     => $evt_id,
143
-                'noheader'   => true,
144
-            ],
145
-            'trash_event'                   => [
146
-                'func'       => '_trash_or_restore_event',
147
-                'args'       => ['event_status' => 'trash'],
148
-                'capability' => 'ee_delete_event',
149
-                'obj_id'     => $evt_id,
150
-                'noheader'   => true,
151
-            ],
152
-            'trash_events'                  => [
153
-                'func'       => '_trash_or_restore_events',
154
-                'args'       => ['event_status' => 'trash'],
155
-                'capability' => 'ee_delete_events',
156
-                'noheader'   => true,
157
-            ],
158
-            'restore_event'                 => [
159
-                'func'       => '_trash_or_restore_event',
160
-                'args'       => ['event_status' => 'draft'],
161
-                'capability' => 'ee_delete_event',
162
-                'obj_id'     => $evt_id,
163
-                'noheader'   => true,
164
-            ],
165
-            'restore_events'                => [
166
-                'func'       => '_trash_or_restore_events',
167
-                'args'       => ['event_status' => 'draft'],
168
-                'capability' => 'ee_delete_events',
169
-                'noheader'   => true,
170
-            ],
171
-            'delete_event'                  => [
172
-                'func'       => '_delete_event',
173
-                'capability' => 'ee_delete_event',
174
-                'obj_id'     => $evt_id,
175
-                'noheader'   => true,
176
-            ],
177
-            'delete_events'                 => [
178
-                'func'       => '_delete_events',
179
-                'capability' => 'ee_delete_events',
180
-                'noheader'   => true,
181
-            ],
182
-            'view_report'                   => [
183
-                'func'       => '_view_report',
184
-                'capability' => 'ee_edit_events',
185
-            ],
186
-            'default_event_settings'        => [
187
-                'func'       => '_default_event_settings',
188
-                'capability' => 'manage_options',
189
-            ],
190
-            'update_default_event_settings' => [
191
-                'func'       => '_update_default_event_settings',
192
-                'capability' => 'manage_options',
193
-                'noheader'   => true,
194
-            ],
195
-            'template_settings'             => [
196
-                'func'       => '_template_settings',
197
-                'capability' => 'manage_options',
198
-            ],
199
-            // event category tab related
200
-            'add_category'                  => [
201
-                'func'       => '_category_details',
202
-                'capability' => 'ee_edit_event_category',
203
-                'args'       => ['add'],
204
-            ],
205
-            'edit_category'                 => [
206
-                'func'       => '_category_details',
207
-                'capability' => 'ee_edit_event_category',
208
-                'args'       => ['edit'],
209
-            ],
210
-            'delete_categories'             => [
211
-                'func'       => '_delete_categories',
212
-                'capability' => 'ee_delete_event_category',
213
-                'noheader'   => true,
214
-            ],
215
-            'delete_category'               => [
216
-                'func'       => '_delete_categories',
217
-                'capability' => 'ee_delete_event_category',
218
-                'noheader'   => true,
219
-            ],
220
-            'insert_category'               => [
221
-                'func'       => '_insert_or_update_category',
222
-                'args'       => ['new_category' => true],
223
-                'capability' => 'ee_edit_event_category',
224
-                'noheader'   => true,
225
-            ],
226
-            'update_category'               => [
227
-                'func'       => '_insert_or_update_category',
228
-                'args'       => ['new_category' => false],
229
-                'capability' => 'ee_edit_event_category',
230
-                'noheader'   => true,
231
-            ],
232
-            'category_list'                 => [
233
-                'func'       => '_category_list_table',
234
-                'capability' => 'ee_manage_event_categories',
235
-            ],
236
-        ];
237
-    }
238
-
239
-
240
-    /**
241
-     * Set the _page_config property for this admin page group.
242
-     */
243
-    protected function _set_page_config()
244
-    {
245
-        $this->_page_config = [
246
-            'default'                => [
247
-                'nav'           => [
248
-                    'label' => esc_html__('Overview', 'event_espresso'),
249
-                    'order' => 10,
250
-                ],
251
-                'list_table'    => 'Events_Admin_List_Table',
252
-                'help_tabs'     => [
253
-                    'events_overview_help_tab'                       => [
254
-                        'title'    => esc_html__('Events Overview', 'event_espresso'),
255
-                        'filename' => 'events_overview',
256
-                    ],
257
-                    'events_overview_table_column_headings_help_tab' => [
258
-                        'title'    => esc_html__('Events Overview Table Column Headings', 'event_espresso'),
259
-                        'filename' => 'events_overview_table_column_headings',
260
-                    ],
261
-                    'events_overview_filters_help_tab'               => [
262
-                        'title'    => esc_html__('Events Overview Filters', 'event_espresso'),
263
-                        'filename' => 'events_overview_filters',
264
-                    ],
265
-                    'events_overview_view_help_tab'                  => [
266
-                        'title'    => esc_html__('Events Overview Views', 'event_espresso'),
267
-                        'filename' => 'events_overview_views',
268
-                    ],
269
-                    'events_overview_other_help_tab'                 => [
270
-                        'title'    => esc_html__('Events Overview Other', 'event_espresso'),
271
-                        'filename' => 'events_overview_other',
272
-                    ],
273
-                ],
274
-                'help_tour'     => [
275
-                    'Event_Overview_Help_Tour',
276
-                    // 'New_Features_Test_Help_Tour' for testing multiple help tour
277
-                ],
278
-                'require_nonce' => false,
279
-                'qtips'         => ['EE_Event_List_Table_Tips'],
280
-            ],
281
-            'create_new'             => [
282
-                'nav'           => [
283
-                    'label'      => esc_html__('Add Event', 'event_espresso'),
284
-                    'order'      => 5,
285
-                    'persistent' => false,
286
-                ],
287
-                'metaboxes'     => ['_register_event_editor_meta_boxes'],
288
-                'help_tabs'     => [
289
-                    'event_editor_help_tab'                            => [
290
-                        'title'    => esc_html__('Event Editor', 'event_espresso'),
291
-                        'filename' => 'event_editor',
292
-                    ],
293
-                    'event_editor_title_richtexteditor_help_tab'       => [
294
-                        'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
295
-                        'filename' => 'event_editor_title_richtexteditor',
296
-                    ],
297
-                    'event_editor_venue_details_help_tab'              => [
298
-                        'title'    => esc_html__('Event Venue Details', 'event_espresso'),
299
-                        'filename' => 'event_editor_venue_details',
300
-                    ],
301
-                    'event_editor_event_datetimes_help_tab'            => [
302
-                        'title'    => esc_html__('Event Datetimes', 'event_espresso'),
303
-                        'filename' => 'event_editor_event_datetimes',
304
-                    ],
305
-                    'event_editor_event_tickets_help_tab'              => [
306
-                        'title'    => esc_html__('Event Tickets', 'event_espresso'),
307
-                        'filename' => 'event_editor_event_tickets',
308
-                    ],
309
-                    'event_editor_event_registration_options_help_tab' => [
310
-                        'title'    => esc_html__('Event Registration Options', 'event_espresso'),
311
-                        'filename' => 'event_editor_event_registration_options',
312
-                    ],
313
-                    'event_editor_tags_categories_help_tab'            => [
314
-                        'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
315
-                        'filename' => 'event_editor_tags_categories',
316
-                    ],
317
-                    'event_editor_questions_registrants_help_tab'      => [
318
-                        'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
319
-                        'filename' => 'event_editor_questions_registrants',
320
-                    ],
321
-                    'event_editor_save_new_event_help_tab'             => [
322
-                        'title'    => esc_html__('Save New Event', 'event_espresso'),
323
-                        'filename' => 'event_editor_save_new_event',
324
-                    ],
325
-                    'event_editor_other_help_tab'                      => [
326
-                        'title'    => esc_html__('Event Other', 'event_espresso'),
327
-                        'filename' => 'event_editor_other',
328
-                    ],
329
-                ],
330
-                'help_tour'     => [
331
-                    'Event_Editor_Help_Tour',
332
-                ],
333
-                'require_nonce' => false,
334
-            ],
335
-            'edit'                   => [
336
-                'nav'           => [
337
-                    'label'      => esc_html__('Edit Event', 'event_espresso'),
338
-                    'order'      => 5,
339
-                    'persistent' => false,
340
-                    'url'        => isset($this->_req_data['post'])
341
-                        ? EE_Admin_Page::add_query_args_and_nonce(
342
-                            ['post' => $this->_req_data['post'], 'action' => 'edit'],
343
-                            $this->_current_page_view_url
344
-                        )
345
-                        : $this->_admin_base_url,
346
-                ],
347
-                'metaboxes'     => ['_register_event_editor_meta_boxes'],
348
-                'help_tabs'     => [
349
-                    'event_editor_help_tab'                            => [
350
-                        'title'    => esc_html__('Event Editor', 'event_espresso'),
351
-                        'filename' => 'event_editor',
352
-                    ],
353
-                    'event_editor_title_richtexteditor_help_tab'       => [
354
-                        'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
355
-                        'filename' => 'event_editor_title_richtexteditor',
356
-                    ],
357
-                    'event_editor_venue_details_help_tab'              => [
358
-                        'title'    => esc_html__('Event Venue Details', 'event_espresso'),
359
-                        'filename' => 'event_editor_venue_details',
360
-                    ],
361
-                    'event_editor_event_datetimes_help_tab'            => [
362
-                        'title'    => esc_html__('Event Datetimes', 'event_espresso'),
363
-                        'filename' => 'event_editor_event_datetimes',
364
-                    ],
365
-                    'event_editor_event_tickets_help_tab'              => [
366
-                        'title'    => esc_html__('Event Tickets', 'event_espresso'),
367
-                        'filename' => 'event_editor_event_tickets',
368
-                    ],
369
-                    'event_editor_event_registration_options_help_tab' => [
370
-                        'title'    => esc_html__('Event Registration Options', 'event_espresso'),
371
-                        'filename' => 'event_editor_event_registration_options',
372
-                    ],
373
-                    'event_editor_tags_categories_help_tab'            => [
374
-                        'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
375
-                        'filename' => 'event_editor_tags_categories',
376
-                    ],
377
-                    'event_editor_questions_registrants_help_tab'      => [
378
-                        'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
379
-                        'filename' => 'event_editor_questions_registrants',
380
-                    ],
381
-                    'event_editor_save_new_event_help_tab'             => [
382
-                        'title'    => esc_html__('Save New Event', 'event_espresso'),
383
-                        'filename' => 'event_editor_save_new_event',
384
-                    ],
385
-                    'event_editor_other_help_tab'                      => [
386
-                        'title'    => esc_html__('Event Other', 'event_espresso'),
387
-                        'filename' => 'event_editor_other',
388
-                    ],
389
-                ],
390
-                'require_nonce' => false,
391
-            ],
392
-            'default_event_settings' => [
393
-                'nav'           => [
394
-                    'label' => esc_html__('Default Settings', 'event_espresso'),
395
-                    'order' => 40,
396
-                ],
397
-                'metaboxes'     => array_merge($this->_default_espresso_metaboxes, ['_publish_post_box']),
398
-                'labels'        => [
399
-                    'publishbox' => esc_html__('Update Settings', 'event_espresso'),
400
-                ],
401
-                'help_tabs'     => [
402
-                    'default_settings_help_tab'        => [
403
-                        'title'    => esc_html__('Default Event Settings', 'event_espresso'),
404
-                        'filename' => 'events_default_settings',
405
-                    ],
406
-                    'default_settings_status_help_tab' => [
407
-                        'title'    => esc_html__('Default Registration Status', 'event_espresso'),
408
-                        'filename' => 'events_default_settings_status',
409
-                    ],
410
-                    'default_maximum_tickets_help_tab' => [
411
-                        'title'    => esc_html__('Default Maximum Tickets Per Order', 'event_espresso'),
412
-                        'filename' => 'events_default_settings_max_tickets',
413
-                    ],
414
-                ],
415
-                'help_tour'     => ['Event_Default_Settings_Help_Tour'],
416
-                'require_nonce' => false,
417
-            ],
418
-            // template settings
419
-            'template_settings'      => [
420
-                'nav'           => [
421
-                    'label' => esc_html__('Templates', 'event_espresso'),
422
-                    'order' => 30,
423
-                ],
424
-                'metaboxes'     => $this->_default_espresso_metaboxes,
425
-                'help_tabs'     => [
426
-                    'general_settings_templates_help_tab' => [
427
-                        'title'    => esc_html__('Templates', 'event_espresso'),
428
-                        'filename' => 'general_settings_templates',
429
-                    ],
430
-                ],
431
-                'help_tour'     => ['Templates_Help_Tour'],
432
-                'require_nonce' => false,
433
-            ],
434
-            // event category stuff
435
-            'add_category'           => [
436
-                'nav'           => [
437
-                    'label'      => esc_html__('Add Category', 'event_espresso'),
438
-                    'order'      => 15,
439
-                    'persistent' => false,
440
-                ],
441
-                'help_tabs'     => [
442
-                    'add_category_help_tab' => [
443
-                        'title'    => esc_html__('Add New Event Category', 'event_espresso'),
444
-                        'filename' => 'events_add_category',
445
-                    ],
446
-                ],
447
-                'help_tour'     => ['Event_Add_Category_Help_Tour'],
448
-                'metaboxes'     => ['_publish_post_box'],
449
-                'require_nonce' => false,
450
-            ],
451
-            'edit_category'          => [
452
-                'nav'           => [
453
-                    'label'      => esc_html__('Edit Category', 'event_espresso'),
454
-                    'order'      => 15,
455
-                    'persistent' => false,
456
-                    'url'        => isset($this->_req_data['EVT_CAT_ID'])
457
-                        ? add_query_arg(
458
-                            ['EVT_CAT_ID' => $this->_req_data['EVT_CAT_ID']],
459
-                            $this->_current_page_view_url
460
-                        )
461
-                        : $this->_admin_base_url,
462
-                ],
463
-                'help_tabs'     => [
464
-                    'edit_category_help_tab' => [
465
-                        'title'    => esc_html__('Edit Event Category', 'event_espresso'),
466
-                        'filename' => 'events_edit_category',
467
-                    ],
468
-                ],
469
-                /*'help_tour' => array('Event_Edit_Category_Help_Tour'),*/
470
-                'metaboxes'     => ['_publish_post_box'],
471
-                'require_nonce' => false,
472
-            ],
473
-            'category_list'          => [
474
-                'nav'           => [
475
-                    'label' => esc_html__('Categories', 'event_espresso'),
476
-                    'order' => 20,
477
-                ],
478
-                'list_table'    => 'Event_Categories_Admin_List_Table',
479
-                'help_tabs'     => [
480
-                    'events_categories_help_tab'                       => [
481
-                        'title'    => esc_html__('Event Categories', 'event_espresso'),
482
-                        'filename' => 'events_categories',
483
-                    ],
484
-                    'events_categories_table_column_headings_help_tab' => [
485
-                        'title'    => esc_html__('Event Categories Table Column Headings', 'event_espresso'),
486
-                        'filename' => 'events_categories_table_column_headings',
487
-                    ],
488
-                    'events_categories_view_help_tab'                  => [
489
-                        'title'    => esc_html__('Event Categories Views', 'event_espresso'),
490
-                        'filename' => 'events_categories_views',
491
-                    ],
492
-                    'events_categories_other_help_tab'                 => [
493
-                        'title'    => esc_html__('Event Categories Other', 'event_espresso'),
494
-                        'filename' => 'events_categories_other',
495
-                    ],
496
-                ],
497
-                'help_tour'     => [
498
-                    'Event_Categories_Help_Tour',
499
-                ],
500
-                'metaboxes'     => $this->_default_espresso_metaboxes,
501
-                'require_nonce' => false,
502
-            ],
503
-        ];
504
-        // only load EE_Event_Editor_Decaf_Tips if domain is not caffeinated
505
-        $domain = $this->loader->getShared('EventEspresso\core\domain\Domain');
506
-        if (! $domain->isCaffeinated()) {
507
-            $this->_page_config['create_new']['qtips'] = ['EE_Event_Editor_Decaf_Tips'];
508
-            $this->_page_config['edit']['qtips'] = ['EE_Event_Editor_Decaf_Tips'];
509
-        }
510
-    }
511
-
512
-
513
-    /**
514
-     * Used to register any global screen options if necessary for every route in this admin page group.
515
-     */
516
-    protected function _add_screen_options()
517
-    {
518
-    }
519
-
520
-
521
-    /**
522
-     * Implementing the screen options for the 'default' route.
523
-     *
524
-     * @throws InvalidArgumentException
525
-     * @throws InvalidDataTypeException
526
-     * @throws InvalidInterfaceException
527
-     */
528
-    protected function _add_screen_options_default()
529
-    {
530
-        $this->_per_page_screen_option();
531
-    }
532
-
533
-
534
-    /**
535
-     * Implementing screen options for the category list route.
536
-     *
537
-     * @throws InvalidArgumentException
538
-     * @throws InvalidDataTypeException
539
-     * @throws InvalidInterfaceException
540
-     */
541
-    protected function _add_screen_options_category_list()
542
-    {
543
-        $page_title = $this->_admin_page_title;
544
-        $this->_admin_page_title = esc_html__('Categories', 'event_espresso');
545
-        $this->_per_page_screen_option();
546
-        $this->_admin_page_title = $page_title;
547
-    }
548
-
549
-
550
-    /**
551
-     * Used to register any global feature pointers for the admin page group.
552
-     */
553
-    protected function _add_feature_pointers()
554
-    {
555
-    }
556
-
557
-
558
-    /**
559
-     * Registers and enqueues any global scripts and styles for the entire admin page group.
560
-     */
561
-    public function load_scripts_styles()
562
-    {
563
-        wp_register_style(
564
-            'events-admin-css',
565
-            EVENTS_ASSETS_URL . 'events-admin-page.css',
566
-            [],
567
-            EVENT_ESPRESSO_VERSION
568
-        );
569
-        wp_register_style(
570
-            'ee-cat-admin',
571
-            EVENTS_ASSETS_URL . 'ee-cat-admin.css',
572
-            [],
573
-            EVENT_ESPRESSO_VERSION
574
-        );
575
-        wp_enqueue_style('events-admin-css');
576
-        wp_enqueue_style('ee-cat-admin');
577
-        // scripts
578
-        wp_register_script(
579
-            'event_editor_js',
580
-            EVENTS_ASSETS_URL . 'event_editor.js',
581
-            ['ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon'],
582
-            EVENT_ESPRESSO_VERSION,
583
-            true
584
-        );
585
-    }
586
-
587
-
588
-    /**
589
-     * Enqueuing scripts and styles specific to this view
590
-     */
591
-    public function load_scripts_styles_create_new()
592
-    {
593
-        $this->load_scripts_styles_edit();
594
-    }
595
-
596
-
597
-    /**
598
-     * Enqueuing scripts and styles specific to this view
599
-     */
600
-    public function load_scripts_styles_edit()
601
-    {
602
-        // styles
603
-        wp_enqueue_style('espresso-ui-theme');
604
-        wp_register_style(
605
-            'event-editor-css',
606
-            EVENTS_ASSETS_URL . 'event-editor.css',
607
-            ['ee-admin-css'],
608
-            EVENT_ESPRESSO_VERSION
609
-        );
610
-        wp_enqueue_style('event-editor-css');
611
-        // scripts
612
-        if (! $this->admin_config->useAdvancedEditor()) {
613
-            wp_register_script(
614
-                'event-datetime-metabox',
615
-                EVENTS_ASSETS_URL . 'event-datetime-metabox.js',
616
-                ['event_editor_js', 'ee-datepicker'],
617
-                EVENT_ESPRESSO_VERSION
618
-            );
619
-            wp_enqueue_script('event-datetime-metabox');
620
-        }
621
-    }
622
-
623
-
624
-    /**
625
-     * Populating the _views property for the category list table view.
626
-     */
627
-    protected function _set_list_table_views_category_list()
628
-    {
629
-        $this->_views = [
630
-            'all' => [
631
-                'slug'        => 'all',
632
-                'label'       => esc_html__('All', 'event_espresso'),
633
-                'count'       => 0,
634
-                'bulk_action' => [
635
-                    'delete_categories' => esc_html__('Delete Permanently', 'event_espresso'),
636
-                ],
637
-            ],
638
-        ];
639
-    }
640
-
641
-
642
-    /**
643
-     * For adding anything that fires on the admin_init hook for any route within this admin page group.
644
-     */
645
-    public function admin_init()
646
-    {
647
-        EE_Registry::$i18n_js_strings['image_confirm'] = esc_html__(
648
-            'Do you really want to delete this image? Please remember to update your event to complete the removal.',
649
-            'event_espresso'
650
-        );
651
-    }
652
-
653
-
654
-    /**
655
-     * For adding anything that should be triggered on the admin_notices hook for any route within this admin page
656
-     * group.
657
-     */
658
-    public function admin_notices()
659
-    {
660
-    }
661
-
662
-
663
-    /**
664
-     * For adding anything that should be triggered on the `admin_print_footer_scripts` hook for any route within
665
-     * this admin page group.
666
-     */
667
-    public function admin_footer_scripts()
668
-    {
669
-    }
670
-
671
-
672
-    /**
673
-     * Call this function to verify if an event is public and has tickets for sale.  If it does, then we need to show a
674
-     * warning (via EE_Error::add_error());
675
-     *
676
-     * @param EE_Event $event Event object
677
-     * @param string   $req_type
678
-     * @return void
679
-     * @throws EE_Error
680
-     * @access public
681
-     */
682
-    public function verify_event_edit($event = null, $req_type = '')
683
-    {
684
-        // don't need to do this when processing
685
-        if (! empty($req_type)) {
686
-            return;
687
-        }
688
-        // no event?
689
-        if (! $event instanceof EE_Event) {
690
-            $event = $this->_cpt_model_obj;
691
-        }
692
-        // STILL no event?
693
-        if (! $event instanceof EE_Event) {
694
-            return;
695
-        }
696
-        $orig_status = $event->status();
697
-        // first check if event is active.
698
-        if ($orig_status === EEM_Event::cancelled
699
-            || $orig_status === EEM_Event::postponed
700
-            || $event->is_expired()
701
-            || $event->is_inactive()
702
-        ) {
703
-            return;
704
-        }
705
-        // made it here so it IS active... next check that any of the tickets are sold.
706
-        if ($event->is_sold_out(true)) {
707
-            if ($orig_status !== EEM_Event::sold_out && $event->status() !== $orig_status) {
708
-                EE_Error::add_attention(
709
-                    sprintf(
710
-                        esc_html__(
711
-                            '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.',
712
-                            'event_espresso'
713
-                        ),
714
-                        EEH_Template::pretty_status(EEM_Event::sold_out, false, 'sentence')
715
-                    )
716
-                );
717
-            }
718
-            return;
719
-        }
720
-        if ($orig_status === EEM_Event::sold_out) {
721
-            EE_Error::add_attention(
722
-                sprintf(
723
-                    esc_html__(
724
-                        '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.',
725
-                        'event_espresso'
726
-                    ),
727
-                    EEH_Template::pretty_status($event->status(), false, 'sentence')
728
-                )
729
-            );
730
-        }
731
-        // now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
732
-        if (! $event->tickets_on_sale()) {
733
-            return;
734
-        }
735
-        // made it here so show warning
736
-        $this->_edit_event_warning();
737
-    }
738
-
739
-
740
-    /**
741
-     * This is the text used for when an event is being edited that is public and has tickets for sale.
742
-     * When needed, hook this into a EE_Error::add_error() notice.
743
-     *
744
-     * @access protected
745
-     * @return void
746
-     */
747
-    protected function _edit_event_warning()
748
-    {
749
-        // we don't want to add warnings during these requests
750
-        if (isset($this->_req_data['action']) && $this->_req_data['action'] === 'editpost') {
751
-            return;
752
-        }
753
-        EE_Error::add_attention(
754
-            sprintf(
755
-                esc_html__(
756
-                    'Your event is open for registration. Making changes may disrupt any transactions in progress. %sLearn more%s',
757
-                    'event_espresso'
758
-                ),
759
-                '<a class="espresso-help-tab-lnk">',
760
-                '</a>'
761
-            )
762
-        );
763
-    }
764
-
765
-
766
-    /**
767
-     * When a user is creating a new event, notify them if they haven't set their timezone.
768
-     * Otherwise, do the normal logic
769
-     *
770
-     * @return string
771
-     * @throws EE_Error
772
-     * @throws InvalidArgumentException
773
-     * @throws InvalidDataTypeException
774
-     * @throws InvalidInterfaceException
775
-     */
776
-    protected function _create_new_cpt_item()
777
-    {
778
-        $has_timezone_string = get_option('timezone_string');
779
-        // only nag them about setting their timezone if it's their first event, and they haven't already done it
780
-        if (! $has_timezone_string && ! EEM_Event::instance()->exists([])) {
781
-            EE_Error::add_attention(
782
-                sprintf(
783
-                    __(
784
-                        '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',
785
-                        'event_espresso'
786
-                    ),
787
-                    '<br>',
788
-                    '<select id="timezone_string" name="timezone_string" aria-describedby="timezone-description">'
789
-                    . EEH_DTT_Helper::wp_timezone_choice('', EEH_DTT_Helper::get_user_locale())
790
-                    . '</select>',
791
-                    '<button class="button button-secondary timezone-submit">',
792
-                    '</button><span class="spinner"></span>'
793
-                ),
794
-                __FILE__,
795
-                __FUNCTION__,
796
-                __LINE__
797
-            );
798
-        }
799
-        parent::_create_new_cpt_item();
800
-    }
801
-
802
-
803
-    /**
804
-     * Sets the _views property for the default route in this admin page group.
805
-     */
806
-    protected function _set_list_table_views_default()
807
-    {
808
-        $this->_views = [
809
-            'all'   => [
810
-                'slug'        => 'all',
811
-                'label'       => esc_html__('View All Events', 'event_espresso'),
812
-                'count'       => 0,
813
-                'bulk_action' => [
814
-                    'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
815
-                ],
816
-            ],
817
-            'draft' => [
818
-                'slug'        => 'draft',
819
-                'label'       => esc_html__('Draft', 'event_espresso'),
820
-                'count'       => 0,
821
-                'bulk_action' => [
822
-                    'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
823
-                ],
824
-            ],
825
-        ];
826
-        if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
827
-            $this->_views['trash'] = [
828
-                'slug'        => 'trash',
829
-                'label'       => esc_html__('Trash', 'event_espresso'),
830
-                'count'       => 0,
831
-                'bulk_action' => [
832
-                    'restore_events' => esc_html__('Restore From Trash', 'event_espresso'),
833
-                    'delete_events'  => esc_html__('Delete Permanently', 'event_espresso'),
834
-                ],
835
-            ];
836
-        }
837
-    }
838
-
839
-
840
-    /**
841
-     * Provides the legend item array for the default list table view.
842
-     *
843
-     * @return array
844
-     */
845
-    protected function _event_legend_items()
846
-    {
847
-        $items = [
848
-            'view_details'   => [
849
-                'class' => 'dashicons dashicons-search',
850
-                'desc'  => esc_html__('View Event', 'event_espresso'),
851
-            ],
852
-            'edit_event'     => [
853
-                'class' => 'ee-icon ee-icon-calendar-edit',
854
-                'desc'  => esc_html__('Edit Event Details', 'event_espresso'),
855
-            ],
856
-            'view_attendees' => [
857
-                'class' => 'dashicons dashicons-groups',
858
-                'desc'  => esc_html__('View Registrations for Event', 'event_espresso'),
859
-            ],
860
-        ];
861
-        $items = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items);
862
-        $statuses = [
863
-            'sold_out_status'  => [
864
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out,
865
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::sold_out, false, 'sentence'),
866
-            ],
867
-            'active_status'    => [
868
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active,
869
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::active, false, 'sentence'),
870
-            ],
871
-            'upcoming_status'  => [
872
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming,
873
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::upcoming, false, 'sentence'),
874
-            ],
875
-            'postponed_status' => [
876
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed,
877
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::postponed, false, 'sentence'),
878
-            ],
879
-            'cancelled_status' => [
880
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled,
881
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::cancelled, false, 'sentence'),
882
-            ],
883
-            'expired_status'   => [
884
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired,
885
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::expired, false, 'sentence'),
886
-            ],
887
-            'inactive_status'  => [
888
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive,
889
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::inactive, false, 'sentence'),
890
-            ],
891
-        ];
892
-        $statuses = apply_filters('FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses);
893
-        return array_merge($items, $statuses);
894
-    }
895
-
896
-
897
-    /**
898
-     * @return EEM_Event
899
-     * @throws EE_Error
900
-     * @throws InvalidArgumentException
901
-     * @throws InvalidDataTypeException
902
-     * @throws InvalidInterfaceException
903
-     * @throws ReflectionException
904
-     */
905
-    private function _event_model()
906
-    {
907
-        if (! $this->_event_model instanceof EEM_Event) {
908
-            $this->_event_model = EE_Registry::instance()->load_model('Event');
909
-        }
910
-        return $this->_event_model;
911
-    }
912
-
913
-
914
-    /**
915
-     * Adds extra buttons to the WP CPT permalink field row.
916
-     * Method is called from parent and is hooked into the wp 'get_sample_permalink_html' filter.
917
-     *
918
-     * @param string $return    the current html
919
-     * @param int    $id        the post id for the page
920
-     * @param string $new_title What the title is
921
-     * @param string $new_slug  what the slug is
922
-     * @return string            The new html string for the permalink area
923
-     */
924
-    public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug)
925
-    {
926
-        // make sure this is only when editing
927
-        if (! empty($id)) {
928
-            $post = get_post($id);
929
-            $return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'
930
-                       . esc_html__('Shortcode', 'event_espresso')
931
-                       . '</a> ';
932
-            $return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id='
933
-                       . $post->ID
934
-                       . ']">';
935
-        }
936
-        return $return;
937
-    }
938
-
939
-
940
-    /**
941
-     * _events_overview_list_table
942
-     * This contains the logic for showing the events_overview list
943
-     *
944
-     * @access protected
945
-     * @return void
946
-     * @throws DomainException
947
-     * @throws EE_Error
948
-     * @throws InvalidArgumentException
949
-     * @throws InvalidDataTypeException
950
-     * @throws InvalidInterfaceException
951
-     */
952
-    protected function _events_overview_list_table()
953
-    {
954
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
955
-        $this->_template_args['after_list_table'] = ! empty($this->_template_args['after_list_table'])
956
-            ? (array) $this->_template_args['after_list_table']
957
-            : [];
958
-        $this->_template_args['after_list_table']['view_event_list_button'] = EEH_HTML::br()
959
-                                                                              . EEH_Template::get_button_or_link(
960
-                                                                                  get_post_type_archive_link('espresso_events'),
961
-                                                                                  esc_html__('View Event Archive Page', 'event_espresso'),
962
-                                                                                  'button'
963
-                                                                              );
964
-        $this->_template_args['after_list_table']['legend'] = $this->_display_legend($this->_event_legend_items());
965
-        $this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
966
-            'create_new',
967
-            'add',
968
-            [],
969
-            'add-new-h2'
970
-        );
971
-        $this->display_admin_list_table_page_with_no_sidebar();
972
-    }
973
-
974
-
975
-    /**
976
-     * this allows for extra misc actions in the default WP publish box
977
-     *
978
-     * @return void
979
-     * @throws DomainException
980
-     * @throws EE_Error
981
-     * @throws InvalidArgumentException
982
-     * @throws InvalidDataTypeException
983
-     * @throws InvalidInterfaceException
984
-     * @throws ReflectionException
985
-     */
986
-    public function extra_misc_actions_publish_box()
987
-    {
988
-        $this->_generate_publish_box_extra_content();
989
-    }
990
-
991
-
992
-    /**
993
-     * This is hooked into the WordPress do_action('save_post') hook and runs after the custom post type has been
994
-     * saved.
995
-     * Typically you would use this to save any additional data.
996
-     * Keep in mind also that "save_post" runs on EVERY post update to the database.
997
-     * ALSO very important.  When a post transitions from scheduled to published,
998
-     * the save_post action is fired but you will NOT have any _POST data containing any extra info you may have from
999
-     * other meta saves. So MAKE sure that you handle this accordingly.
1000
-     *
1001
-     * @access protected
1002
-     * @abstract
1003
-     * @param string $post_id The ID of the cpt that was saved (so you can link relationally)
1004
-     * @param object $post    The post object of the cpt that was saved.
1005
-     * @return void
1006
-     * @throws EE_Error
1007
-     * @throws InvalidArgumentException
1008
-     * @throws InvalidDataTypeException
1009
-     * @throws InvalidInterfaceException
1010
-     * @throws ReflectionException
1011
-     */
1012
-    protected function _insert_update_cpt_item($post_id, $post)
1013
-    {
1014
-        if ($post instanceof WP_Post && $post->post_type !== 'espresso_events') {
1015
-            // get out we're not processing an event save.
1016
-            return;
1017
-        }
1018
-        $event_values = [
1019
-            'EVT_member_only'     => ! empty($this->_req_data['member_only']) ? 1 : 0,
1020
-            'EVT_allow_overflow'  => ! empty($this->_req_data['EVT_allow_overflow']) ? 1 : 0,
1021
-            'EVT_timezone_string' => ! empty($this->_req_data['timezone_string'])
1022
-                ? sanitize_text_field($this->_req_data['timezone_string'])
1023
-                : null,
1024
-        ];
1025
-        /** @var FeatureFlags $flags */
1026
-        $flags = $this->loader->getShared('EventEspresso\core\domain\services\capabilities\FeatureFlags');
1027
-        // check if the new EDTR reg options meta box is being used, and if so, don't run updates for legacy version
1028
-        if (! $this->admin_config->useAdvancedEditor() || ! $flags->featureAllowed('use_reg_options_meta_box')) {
1029
-            $event_values['EVT_display_ticket_selector'] =
1030
-                ! empty($this->_req_data['display_ticket_selector'])
1031
-                    ? 1
1032
-                    : 0;
1033
-            $event_values['EVT_additional_limit'] = min(
1034
-                apply_filters('FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255),
1035
-                ! empty($this->_req_data['additional_limit'])
1036
-                    ? absint($this->_req_data['additional_limit'])
1037
-                    : null
1038
-            );
1039
-            $event_values['EVT_default_registration_status'] =
1040
-                ! empty($this->_req_data['EVT_default_registration_status'])
1041
-                    ? sanitize_text_field($this->_req_data['EVT_default_registration_status'])
1042
-                    : EE_Registry::instance()->CFG->registration->default_STS_ID;
1043
-            $event_values['EVT_external_URL'] = ! empty($this->_req_data['externalURL'])
1044
-                ? esc_url_raw($this->_req_data['externalURL'])
1045
-                : null;
1046
-            $event_values['EVT_phone'] = ! empty($this->_req_data['event_phone'])
1047
-                ? sanitize_text_field($this->_req_data['event_phone'])
1048
-                : null;
1049
-        }
1050
-        // update event
1051
-        $success = $this->_event_model()->update_by_ID($event_values, $post_id);
1052
-        // get event_object for other metaboxes... though it would seem to make sense to just use $this->_event_model()->get_one_by_ID( $post_id ).. i have to setup where conditions to override the filters in the model that filter out autodraft and inherit statuses so we GET the inherit id!
1053
-        $get_one_where = [
1054
-            $this->_event_model()->primary_key_name() => $post_id,
1055
-            'OR'                                      => [
1056
-                'status'   => $post->post_status,
1057
-                // if trying to "Publish" a sold out event, it's status will get switched back to "sold_out" in the db,
1058
-                // but the returned object here has a status of "publish", so use the original post status as well
1059
-                'status*1' => $this->_req_data['original_post_status'],
1060
-            ],
1061
-        ];
1062
-        $event = $this->_event_model()->get_one([$get_one_where]);
1063
-        // the following are default callbacks for event attachment updates that can be overridden by caffeinated functionality and/or addons.
1064
-        $event_update_callbacks = apply_filters(
1065
-            'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks',
1066
-            [
1067
-                [$this, '_default_venue_update'],
1068
-                [$this, '_default_tickets_update'],
1069
-            ]
1070
-        );
1071
-        $att_success = true;
1072
-        foreach ($event_update_callbacks as $e_callback) {
1073
-            $_success = is_callable($e_callback)
1074
-                ? $e_callback($event, $this->_req_data)
1075
-                : false;
1076
-            // if ANY of these updates fail then we want the appropriate global error message
1077
-            $att_success = ! $att_success ? $att_success : $_success;
1078
-        }
1079
-        // any errors?
1080
-        if ($success && false === $att_success) {
1081
-            EE_Error::add_error(
1082
-                esc_html__(
1083
-                    'Event Details saved successfully but something went wrong with saving attachments.',
1084
-                    'event_espresso'
1085
-                ),
1086
-                __FILE__,
1087
-                __FUNCTION__,
1088
-                __LINE__
1089
-            );
1090
-        } elseif ($success === false) {
1091
-            EE_Error::add_error(
1092
-                esc_html__('Event Details did not save successfully.', 'event_espresso'),
1093
-                __FILE__,
1094
-                __FUNCTION__,
1095
-                __LINE__
1096
-            );
1097
-        }
1098
-    }
1099
-
1100
-
1101
-    /**
1102
-     * @param int $post_id
1103
-     * @param int $revision_id
1104
-     * @throws EE_Error
1105
-     * @throws InvalidArgumentException
1106
-     * @throws InvalidDataTypeException
1107
-     * @throws InvalidInterfaceException
1108
-     * @throws ReflectionException
1109
-     * @see parent::restore_item()
1110
-     */
1111
-    protected function _restore_cpt_item($post_id, $revision_id)
1112
-    {
1113
-        // copy existing event meta to new post
1114
-        $post_evt = $this->_event_model()->get_one_by_ID($post_id);
1115
-        if ($post_evt instanceof EE_Event) {
1116
-            // meta revision restore
1117
-            $post_evt->restore_revision($revision_id);
1118
-            // related objs restore
1119
-            $post_evt->restore_revision($revision_id, ['Venue', 'Datetime', 'Price']);
1120
-        }
1121
-    }
1122
-
1123
-
1124
-    /**
1125
-     * Attach the venue to the Event
1126
-     *
1127
-     * @param EE_Event $evtobj Event Object to add the venue to
1128
-     * @param array    $data   The request data from the form
1129
-     * @return bool           Success or fail.
1130
-     * @throws EE_Error
1131
-     * @throws InvalidArgumentException
1132
-     * @throws InvalidDataTypeException
1133
-     * @throws InvalidInterfaceException
1134
-     * @throws ReflectionException
1135
-     */
1136
-    protected function _default_venue_update(EE_Event $evtobj, $data)
1137
-    {
1138
-        require_once(EE_MODELS . 'EEM_Venue.model.php');
1139
-        $venue_model = EE_Registry::instance()->load_model('Venue');
1140
-        $rows_affected = null;
1141
-        $venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : null;
1142
-        // very important.  If we don't have a venue name...
1143
-        // then we'll get out because not necessary to create empty venue
1144
-        if (empty($data['venue_title'])) {
1145
-            return false;
1146
-        }
1147
-        $venue_array = [
1148
-            'VNU_wp_user'         => $evtobj->get('EVT_wp_user'),
1149
-            'VNU_name'            => ! empty($data['venue_title']) ? $data['venue_title'] : null,
1150
-            'VNU_desc'            => ! empty($data['venue_description']) ? $data['venue_description'] : null,
1151
-            'VNU_identifier'      => ! empty($data['venue_identifier']) ? $data['venue_identifier'] : null,
1152
-            'VNU_short_desc'      => ! empty($data['venue_short_description']) ? $data['venue_short_description']
1153
-                : null,
1154
-            'VNU_address'         => ! empty($data['address']) ? $data['address'] : null,
1155
-            'VNU_address2'        => ! empty($data['address2']) ? $data['address2'] : null,
1156
-            'VNU_city'            => ! empty($data['city']) ? $data['city'] : null,
1157
-            'STA_ID'              => ! empty($data['state']) ? $data['state'] : null,
1158
-            'CNT_ISO'             => ! empty($data['countries']) ? $data['countries'] : null,
1159
-            'VNU_zip'             => ! empty($data['zip']) ? $data['zip'] : null,
1160
-            'VNU_phone'           => ! empty($data['venue_phone']) ? $data['venue_phone'] : null,
1161
-            'VNU_capacity'        => ! empty($data['venue_capacity']) ? $data['venue_capacity'] : null,
1162
-            'VNU_url'             => ! empty($data['venue_url']) ? $data['venue_url'] : null,
1163
-            'VNU_virtual_phone'   => ! empty($data['virtual_phone']) ? $data['virtual_phone'] : null,
1164
-            'VNU_virtual_url'     => ! empty($data['virtual_url']) ? $data['virtual_url'] : null,
1165
-            'VNU_enable_for_gmap' => isset($data['enable_for_gmap']) ? 1 : 0,
1166
-            'status'              => 'publish',
1167
-        ];
1168
-        // if we've got the venue_id then we're just updating the existing venue so let's do that and then get out.
1169
-        if (! empty($venue_id)) {
1170
-            $update_where = [$venue_model->primary_key_name() => $venue_id];
1171
-            $rows_affected = $venue_model->update($venue_array, [$update_where]);
1172
-            // we've gotta make sure that the venue is always attached to a revision.. add_relation_to should take care of making sure that the relation is already present.
1173
-            $evtobj->_add_relation_to($venue_id, 'Venue');
1174
-            return $rows_affected > 0;
1175
-        }
1176
-        // we insert the venue
1177
-        $venue_id = $venue_model->insert($venue_array);
1178
-        $evtobj->_add_relation_to($venue_id, 'Venue');
1179
-        return ! empty($venue_id) ? true : false;
1180
-        // when we have the ancestor come in it's already been handled by the revision save.
1181
-    }
1182
-
1183
-
1184
-    /**
1185
-     * Handles saving everything related to Tickets (datetimes, tickets, prices)
1186
-     *
1187
-     * @param EE_Event $evtobj The Event object we're attaching data to
1188
-     * @param array    $data   The request data from the form
1189
-     * @return array
1190
-     * @throws EE_Error
1191
-     * @throws InvalidArgumentException
1192
-     * @throws InvalidDataTypeException
1193
-     * @throws InvalidInterfaceException
1194
-     * @throws ReflectionException
1195
-     * @throws Exception
1196
-     */
1197
-    protected function _default_tickets_update(EE_Event $evtobj, $data)
1198
-    {
1199
-        if ($this->admin_config->useAdvancedEditor()) {
1200
-            return [];
1201
-        }
1202
-        $success = true;
1203
-        $saved_dtt = null;
1204
-        $saved_tickets = [];
1205
-        $incoming_date_formats = ['Y-m-d', 'h:i a'];
1206
-        foreach ($data['edit_event_datetimes'] as $row => $dtt) {
1207
-            // trim all values to ensure any excess whitespace is removed.
1208
-            $dtt = array_map('trim', $dtt);
1209
-            $dtt['DTT_EVT_end'] = isset($dtt['DTT_EVT_end']) && ! empty($dtt['DTT_EVT_end']) ? $dtt['DTT_EVT_end']
1210
-                : $dtt['DTT_EVT_start'];
1211
-            $datetime_values = [
1212
-                'DTT_ID'        => ! empty($dtt['DTT_ID']) ? $dtt['DTT_ID'] : null,
1213
-                'DTT_EVT_start' => $dtt['DTT_EVT_start'],
1214
-                'DTT_EVT_end'   => $dtt['DTT_EVT_end'],
1215
-                'DTT_reg_limit' => empty($dtt['DTT_reg_limit']) ? EE_INF : $dtt['DTT_reg_limit'],
1216
-                'DTT_order'     => $row,
1217
-            ];
1218
-            // if we have an id then let's get existing object first and then set the new values.  Otherwise we instantiate a new object for save.
1219
-            if (! empty($dtt['DTT_ID'])) {
1220
-                $DTM = EE_Registry::instance()
1221
-                                  ->load_model('Datetime', [$evtobj->get_timezone()])
1222
-                                  ->get_one_by_ID($dtt['DTT_ID']);
1223
-                $DTM->set_date_format($incoming_date_formats[0]);
1224
-                $DTM->set_time_format($incoming_date_formats[1]);
1225
-                foreach ($datetime_values as $field => $value) {
1226
-                    $DTM->set($field, $value);
1227
-                }
1228
-                // make sure the $dtt_id here is saved just in case after the add_relation_to() the autosave replaces it.  We need to do this so we dont' TRASH the parent DTT.
1229
-                $saved_dtts[ $DTM->ID() ] = $DTM;
1230
-            } else {
1231
-                $DTM = EE_Registry::instance()->load_class(
1232
-                    'Datetime',
1233
-                    [$datetime_values, $evtobj->get_timezone(), $incoming_date_formats],
1234
-                    false,
1235
-                    false
1236
-                );
1237
-                foreach ($datetime_values as $field => $value) {
1238
-                    $DTM->set($field, $value);
1239
-                }
1240
-            }
1241
-            $DTM->save();
1242
-            $DTT = $evtobj->_add_relation_to($DTM, 'Datetime');
1243
-            // load DTT helper
1244
-            // before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
1245
-            if ($DTT->get_raw('DTT_EVT_start') > $DTT->get_raw('DTT_EVT_end')) {
1246
-                $DTT->set('DTT_EVT_end', $DTT->get('DTT_EVT_start'));
1247
-                $DTT = EEH_DTT_Helper::date_time_add($DTT, 'DTT_EVT_end', 'days');
1248
-                $DTT->save();
1249
-            }
1250
-            // now we got to make sure we add the new DTT_ID to the $saved_dtts array  because it is possible there was a new one created for the autosave.
1251
-            $saved_dtt = $DTT;
1252
-            $success = ! $success ? $success : $DTT;
1253
-            // if ANY of these updates fail then we want the appropriate global error message.
1254
-            // //todo this is actually sucky we need a better error message but this is what it is for now.
1255
-        }
1256
-        // no dtts get deleted so we don't do any of that logic here.
1257
-        // update tickets next
1258
-        $old_tickets = isset($data['ticket_IDs']) ? explode(',', $data['ticket_IDs']) : [];
1259
-        foreach ($data['edit_tickets'] as $row => $tkt) {
1260
-            $incoming_date_formats = ['Y-m-d', 'h:i a'];
1261
-            $update_prices = false;
1262
-            $ticket_price = isset($data['edit_prices'][ $row ][1]['PRC_amount'])
1263
-                ? $data['edit_prices'][ $row ][1]['PRC_amount'] : 0;
1264
-            // trim inputs to ensure any excess whitespace is removed.
1265
-            $tkt = array_map('trim', $tkt);
1266
-            if (empty($tkt['TKT_start_date'])) {
1267
-                // let's use now in the set timezone.
1268
-                $now = new DateTime('now', new DateTimeZone($evtobj->get_timezone()));
1269
-                $tkt['TKT_start_date'] = $now->format($incoming_date_formats[0] . ' ' . $incoming_date_formats[1]);
1270
-            }
1271
-            if (empty($tkt['TKT_end_date'])) {
1272
-                // use the start date of the first datetime
1273
-                $dtt = $evtobj->first_datetime();
1274
-                $tkt['TKT_end_date'] = $dtt->start_date_and_time(
1275
-                    $incoming_date_formats[0],
1276
-                    $incoming_date_formats[1]
1277
-                );
1278
-            }
1279
-            $TKT_values = [
1280
-                'TKT_ID'          => ! empty($tkt['TKT_ID']) ? $tkt['TKT_ID'] : null,
1281
-                'TTM_ID'          => ! empty($tkt['TTM_ID']) ? $tkt['TTM_ID'] : 0,
1282
-                'TKT_name'        => ! empty($tkt['TKT_name']) ? $tkt['TKT_name'] : '',
1283
-                'TKT_description' => ! empty($tkt['TKT_description']) ? $tkt['TKT_description'] : '',
1284
-                'TKT_start_date'  => $tkt['TKT_start_date'],
1285
-                'TKT_end_date'    => $tkt['TKT_end_date'],
1286
-                'TKT_qty'         => ! isset($tkt['TKT_qty']) || $tkt['TKT_qty'] === '' ? EE_INF : $tkt['TKT_qty'],
1287
-                'TKT_uses'        => ! isset($tkt['TKT_uses']) || $tkt['TKT_uses'] === '' ? EE_INF : $tkt['TKT_uses'],
1288
-                'TKT_min'         => empty($tkt['TKT_min']) ? 0 : $tkt['TKT_min'],
1289
-                'TKT_max'         => empty($tkt['TKT_max']) ? EE_INF : $tkt['TKT_max'],
1290
-                'TKT_row'         => $row,
1291
-                'TKT_order'       => isset($tkt['TKT_order']) ? $tkt['TKT_order'] : $row,
1292
-                'TKT_price'       => $ticket_price,
1293
-            ];
1294
-            // if this is a default TKT, then we need to set the TKT_ID to 0 and update accordingly, which means in turn that the prices will become new prices as well.
1295
-            if (isset($tkt['TKT_is_default']) && $tkt['TKT_is_default']) {
1296
-                $TKT_values['TKT_ID'] = 0;
1297
-                $TKT_values['TKT_is_default'] = 0;
1298
-                $TKT_values['TKT_price'] = $ticket_price;
1299
-                $update_prices = true;
1300
-            }
1301
-            // if we have a TKT_ID then we need to get that existing TKT_obj and update it
1302
-            // we actually do our saves a head of doing any add_relations to because its entirely possible that this ticket didn't removed or added to any datetime in the session but DID have it's items modified.
1303
-            // keep in mind that if the TKT has been sold (and we have changed pricing information), then we won't be updating the tkt but instead a new tkt will be created and the old one archived.
1304
-            if (! empty($tkt['TKT_ID'])) {
1305
-                $TKT = EE_Registry::instance()
1306
-                                  ->load_model('Ticket', [$evtobj->get_timezone()])
1307
-                                  ->get_one_by_ID($tkt['TKT_ID']);
1308
-                if ($TKT instanceof EE_Ticket) {
1309
-                    $ticket_sold = $TKT->count_related(
1310
-                        'Registration',
1311
-                        [
1312
-                                [
1313
-                                    'STS_ID' => [
1314
-                                        'NOT IN',
1315
-                                        [EEM_Registration::status_id_incomplete],
1316
-                                    ],
1317
-                                ],
1318
-                            ]
1319
-                    ) > 0;
1320
-                    // let's just check the total price for the existing ticket and determine if it matches the new
1321
-                    // total price.  if they are different then we create a new ticket (if tickets sold)
1322
-                    // if they aren't different then we go ahead and modify existing ticket.
1323
-                    $create_new_TKT = $ticket_sold && ! $TKT->deleted()
1324
-                                      && EEH_Money::compare_floats(
1325
-                                          $ticket_price,
1326
-                                          $TKT->get('TKT_price'),
1327
-                                          '!=='
1328
-                                      );
1329
-                    $TKT->set_date_format($incoming_date_formats[0]);
1330
-                    $TKT->set_time_format($incoming_date_formats[1]);
1331
-                    // set new values
1332
-                    foreach ($TKT_values as $field => $value) {
1333
-                        if ($field === 'TKT_qty') {
1334
-                            $TKT->set_qty($value);
1335
-                        } else {
1336
-                            $TKT->set($field, $value);
1337
-                        }
1338
-                    }
1339
-                    // if $create_new_TKT is false then we can safely update the existing ticket.  Otherwise we have to create a new ticket.
1340
-                    if ($create_new_TKT) {
1341
-                        // archive the old ticket first
1342
-                        $TKT->set('TKT_deleted', 1);
1343
-                        $TKT->save();
1344
-                        // make sure this ticket is still recorded in our saved_tkts so we don't run it through the regular trash routine.
1345
-                        $saved_tickets[ $TKT->ID() ] = $TKT;
1346
-                        // create new ticket that's a copy of the existing except a new id of course (and not archived) AND has the new TKT_price associated with it.
1347
-                        $TKT = clone $TKT;
1348
-                        $TKT->set('TKT_ID', 0);
1349
-                        $TKT->set('TKT_deleted', 0);
1350
-                        $TKT->set('TKT_price', $ticket_price);
1351
-                        $TKT->set('TKT_sold', 0);
1352
-                        // now we need to make sure that $new prices are created as well and attached to new ticket.
1353
-                        $update_prices = true;
1354
-                    }
1355
-                    // make sure price is set if it hasn't been already
1356
-                    $TKT->set('TKT_price', $ticket_price);
1357
-                }
1358
-            } else {
1359
-                // no TKT_id so a new TKT
1360
-                $TKT_values['TKT_price'] = $ticket_price;
1361
-                $TKT = EE_Registry::instance()->load_class('Ticket', [$TKT_values], false, false);
1362
-                if ($TKT instanceof EE_Ticket) {
1363
-                    // need to reset values to properly account for the date formats
1364
-                    $TKT->set_date_format($incoming_date_formats[0]);
1365
-                    $TKT->set_time_format($incoming_date_formats[1]);
1366
-                    $TKT->set_timezone($evtobj->get_timezone());
1367
-                    // set new values
1368
-                    foreach ($TKT_values as $field => $value) {
1369
-                        if ($field === 'TKT_qty') {
1370
-                            $TKT->set_qty($value);
1371
-                        } else {
1372
-                            $TKT->set($field, $value);
1373
-                        }
1374
-                    }
1375
-                    $update_prices = true;
1376
-                }
1377
-            }
1378
-            // cap ticket qty by datetime reg limits
1379
-            $TKT->set_qty(min($TKT->qty(), $TKT->qty('reg_limit')));
1380
-            // update ticket.
1381
-            $TKT->save();
1382
-            // before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
1383
-            if ($TKT->get_raw('TKT_start_date') > $TKT->get_raw('TKT_end_date')) {
1384
-                $TKT->set('TKT_end_date', $TKT->get('TKT_start_date'));
1385
-                $TKT = EEH_DTT_Helper::date_time_add($TKT, 'TKT_end_date', 'days');
1386
-                $TKT->save();
1387
-            }
1388
-            // initially let's add the ticket to the dtt
1389
-            $saved_dtt->_add_relation_to($TKT, 'Ticket');
1390
-            $saved_tickets[ $TKT->ID() ] = $TKT;
1391
-            // add prices to ticket
1392
-            $this->_add_prices_to_ticket($data['edit_prices'][ $row ], $TKT, $update_prices);
1393
-        }
1394
-        // however now we need to handle permanently deleting tickets via the ui.  Keep in mind that the ui does not allow deleting/archiving tickets that have ticket sold.  However, it does allow for deleting tickets that have no tickets sold, in which case we want to get rid of permanently because there is no need to save in db.
1395
-        $old_tickets = isset($old_tickets[0]) && $old_tickets[0] === '' ? [] : $old_tickets;
1396
-        $tickets_removed = array_diff($old_tickets, array_keys($saved_tickets));
1397
-        foreach ($tickets_removed as $id) {
1398
-            $id = absint($id);
1399
-            // get the ticket for this id
1400
-            $tkt_to_remove = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($id);
1401
-            // need to get all the related datetimes on this ticket and remove from every single one of them (remember this process can ONLY kick off if there are NO tkts_sold)
1402
-            $dtts = $tkt_to_remove->get_many_related('Datetime');
1403
-            foreach ($dtts as $dtt) {
1404
-                $tkt_to_remove->_remove_relation_to($dtt, 'Datetime');
1405
-            }
1406
-            // need to do the same for prices (except these prices can also be deleted because again, tickets can only be trashed if they don't have any TKTs sold (otherwise they are just archived))
1407
-            $tkt_to_remove->delete_related_permanently('Price');
1408
-            // finally let's delete this ticket (which should not be blocked at this point b/c we've removed all our relationships)
1409
-            $tkt_to_remove->delete_permanently();
1410
-        }
1411
-        return [$saved_dtt, $saved_tickets];
1412
-    }
1413
-
1414
-
1415
-    /**
1416
-     * This attaches a list of given prices to a ticket.
1417
-     * Note we dont' have to worry about ever removing relationships (or archiving prices) because if there is a change
1418
-     * in price information on a ticket, a new ticket is created anyways so the archived ticket will retain the old
1419
-     * price info and prices are automatically "archived" via the ticket.
1420
-     *
1421
-     * @access  private
1422
-     * @param array     $prices     Array of prices from the form.
1423
-     * @param EE_Ticket $ticket     EE_Ticket object that prices are being attached to.
1424
-     * @param bool      $new_prices Whether attach existing incoming prices or create new ones.
1425
-     * @return  void
1426
-     * @throws EE_Error
1427
-     * @throws InvalidArgumentException
1428
-     * @throws InvalidDataTypeException
1429
-     * @throws InvalidInterfaceException
1430
-     * @throws ReflectionException
1431
-     */
1432
-    private function _add_prices_to_ticket($prices, EE_Ticket $ticket, $new_prices = false)
1433
-    {
1434
-        foreach ($prices as $row => $prc) {
1435
-            $PRC_values = [
1436
-                'PRC_ID'         => ! empty($prc['PRC_ID']) ? $prc['PRC_ID'] : null,
1437
-                'PRT_ID'         => ! empty($prc['PRT_ID']) ? $prc['PRT_ID'] : null,
1438
-                'PRC_amount'     => ! empty($prc['PRC_amount']) ? $prc['PRC_amount'] : 0,
1439
-                'PRC_name'       => ! empty($prc['PRC_name']) ? $prc['PRC_name'] : '',
1440
-                'PRC_desc'       => ! empty($prc['PRC_desc']) ? $prc['PRC_desc'] : '',
1441
-                'PRC_is_default' => 0, // make sure prices are NOT set as default from this context
1442
-                'PRC_order'      => $row,
1443
-            ];
1444
-            if ($new_prices || empty($PRC_values['PRC_ID'])) {
1445
-                $PRC_values['PRC_ID'] = 0;
1446
-                $PRC = EE_Registry::instance()->load_class('Price', [$PRC_values], false, false);
1447
-            } else {
1448
-                $PRC = EE_Registry::instance()->load_model('Price')->get_one_by_ID($prc['PRC_ID']);
1449
-                // update this price with new values
1450
-                foreach ($PRC_values as $field => $newprc) {
1451
-                    $PRC->set($field, $newprc);
1452
-                }
1453
-                $PRC->save();
1454
-            }
1455
-            $ticket->_add_relation_to($PRC, 'Price');
1456
-        }
1457
-    }
1458
-
1459
-
1460
-    /**
1461
-     * Add in our autosave ajax handlers
1462
-     *
1463
-     */
1464
-    protected function _ee_autosave_create_new()
1465
-    {
1466
-    }
1467
-
1468
-
1469
-    /**
1470
-     * More autosave handlers.
1471
-     */
1472
-    protected function _ee_autosave_edit()
1473
-    {
1474
-    }
1475
-
1476
-
1477
-    /**
1478
-     *    _generate_publish_box_extra_content
1479
-     *
1480
-     * @throws DomainException
1481
-     * @throws EE_Error
1482
-     * @throws InvalidArgumentException
1483
-     * @throws InvalidDataTypeException
1484
-     * @throws InvalidInterfaceException
1485
-     * @throws ReflectionException
1486
-     */
1487
-    private function _generate_publish_box_extra_content()
1488
-    {
1489
-        // load formatter helper
1490
-        // args for getting related registrations
1491
-        $approved_query_args = [
1492
-            [
1493
-                'REG_deleted' => 0,
1494
-                'STS_ID'      => EEM_Registration::status_id_approved,
1495
-            ],
1496
-        ];
1497
-        $not_approved_query_args = [
1498
-            [
1499
-                'REG_deleted' => 0,
1500
-                'STS_ID'      => EEM_Registration::status_id_not_approved,
1501
-            ],
1502
-        ];
1503
-        $pending_payment_query_args = [
1504
-            [
1505
-                'REG_deleted' => 0,
1506
-                'STS_ID'      => EEM_Registration::status_id_pending_payment,
1507
-            ],
1508
-        ];
1509
-        // publish box
1510
-        $publish_box_extra_args = [
1511
-            'view_approved_reg_url'        => add_query_arg(
1512
-                [
1513
-                    'action'      => 'default',
1514
-                    'event_id'    => $this->_cpt_model_obj->ID(),
1515
-                    '_reg_status' => EEM_Registration::status_id_approved,
1516
-                ],
1517
-                REG_ADMIN_URL
1518
-            ),
1519
-            'view_not_approved_reg_url'    => add_query_arg(
1520
-                [
1521
-                    'action'      => 'default',
1522
-                    'event_id'    => $this->_cpt_model_obj->ID(),
1523
-                    '_reg_status' => EEM_Registration::status_id_not_approved,
1524
-                ],
1525
-                REG_ADMIN_URL
1526
-            ),
1527
-            'view_pending_payment_reg_url' => add_query_arg(
1528
-                [
1529
-                    'action'      => 'default',
1530
-                    'event_id'    => $this->_cpt_model_obj->ID(),
1531
-                    '_reg_status' => EEM_Registration::status_id_pending_payment,
1532
-                ],
1533
-                REG_ADMIN_URL
1534
-            ),
1535
-            'approved_regs'                => $this->_cpt_model_obj->count_related(
1536
-                'Registration',
1537
-                $approved_query_args
1538
-            ),
1539
-            'not_approved_regs'            => $this->_cpt_model_obj->count_related(
1540
-                'Registration',
1541
-                $not_approved_query_args
1542
-            ),
1543
-            'pending_payment_regs'         => $this->_cpt_model_obj->count_related(
1544
-                'Registration',
1545
-                $pending_payment_query_args
1546
-            ),
1547
-            'misc_pub_section_class'       => apply_filters(
1548
-                'FHEE_Events_Admin_Page___generate_publish_box_extra_content__misc_pub_section_class',
1549
-                'misc-pub-section'
1550
-            ),
1551
-        ];
1552
-        ob_start();
1553
-        do_action(
1554
-            'AHEE__Events_Admin_Page___generate_publish_box_extra_content__event_editor_overview_add',
1555
-            $this->_cpt_model_obj
1556
-        );
1557
-        $publish_box_extra_args['event_editor_overview_add'] = ob_get_clean();
1558
-        // load template
1559
-        EEH_Template::display_template(
1560
-            EVENTS_TEMPLATE_PATH . 'event_publish_box_extras.template.php',
1561
-            $publish_box_extra_args
1562
-        );
1563
-    }
1564
-
1565
-
1566
-    /**
1567
-     * @return EE_Event
1568
-     */
1569
-    public function get_event_object()
1570
-    {
1571
-        return $this->_cpt_model_obj;
1572
-    }
1573
-
1574
-
1575
-
1576
-
1577
-    /** METABOXES * */
1578
-    /**
1579
-     * _register_event_editor_meta_boxes
1580
-     * add all metaboxes related to the event_editor
1581
-     *
1582
-     * @return void
1583
-     * @throws EE_Error
1584
-     * @throws InvalidArgumentException
1585
-     * @throws InvalidDataTypeException
1586
-     * @throws InvalidInterfaceException
1587
-     * @throws ReflectionException
1588
-     */
1589
-    protected function _register_event_editor_meta_boxes()
1590
-    {
1591
-        $this->verify_cpt_object();
1592
-        $use_advanced_editor = $this->admin_config->useAdvancedEditor();
1593
-        /** @var FeatureFlags $flags */
1594
-        $flags = $this->loader->getShared('EventEspresso\core\domain\services\capabilities\FeatureFlags');
1595
-        // check if the new EDTR reg options meta box is being used, and if so, don't load the legacy version
1596
-        if (! $use_advanced_editor || ! $flags->featureAllowed('use_reg_options_meta_box')) {
1597
-            add_meta_box(
1598
-                'espresso_event_editor_event_options',
1599
-                esc_html__('Event Registration Options', 'event_espresso'),
1600
-                [$this, 'registration_options_meta_box'],
1601
-                $this->page_slug,
1602
-                'side'
1603
-            );
1604
-        }
1605
-        if (! $use_advanced_editor) {
1606
-            add_meta_box(
1607
-                'espresso_event_editor_tickets',
1608
-                esc_html__('Event Datetime & Ticket', 'event_espresso'),
1609
-                [$this, 'ticket_metabox'],
1610
-                $this->page_slug,
1611
-                'normal',
1612
-                'high'
1613
-            );
1614
-        } else {
1615
-            if ($flags->featureAllowed('use_reg_options_meta_box')) {
1616
-                add_action(
1617
-                    'add_meta_boxes_espresso_events',
1618
-                    function () {
1619
-                        global $current_screen;
1620
-                        remove_meta_box('authordiv', $current_screen, 'normal');
1621
-                    },
1622
-                    99
1623
-                );
1624
-            }
1625
-        }
1626
-        // NOTE: if you're looking for other metaboxes in here,
1627
-        // where a metabox has a related management page in the admin
1628
-        // you will find it setup in the related management page's "_Hooks" file.
1629
-        // i.e. messages metabox is found in "espresso_events_Messages_Hooks.class.php".
1630
-    }
1631
-
1632
-
1633
-    /**
1634
-     * @throws DomainException
1635
-     * @throws EE_Error
1636
-     * @throws InvalidArgumentException
1637
-     * @throws InvalidDataTypeException
1638
-     * @throws InvalidInterfaceException
1639
-     * @throws ReflectionException
1640
-     */
1641
-    public function ticket_metabox()
1642
-    {
1643
-        $existing_datetime_ids = $existing_ticket_ids = [];
1644
-        // defaults for template args
1645
-        $template_args = [
1646
-            'existing_datetime_ids'    => '',
1647
-            'event_datetime_help_link' => '',
1648
-            'ticket_options_help_link' => '',
1649
-            'time'                     => null,
1650
-            'ticket_rows'              => '',
1651
-            'existing_ticket_ids'      => '',
1652
-            'total_ticket_rows'        => 1,
1653
-            'ticket_js_structure'      => '',
1654
-            'trash_icon'               => 'ee-lock-icon',
1655
-            'disabled'                 => '',
1656
-        ];
1657
-        $event_id = is_object($this->_cpt_model_obj) ? $this->_cpt_model_obj->ID() : null;
1658
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1659
-        /**
1660
-         * 1. Start with retrieving Datetimes
1661
-         * 2. Fore each datetime get related tickets
1662
-         * 3. For each ticket get related prices
1663
-         */
1664
-        $times = EE_Registry::instance()->load_model('Datetime')->get_all_event_dates($event_id);
1665
-        /** @type EE_Datetime $first_datetime */
1666
-        $first_datetime = reset($times);
1667
-        // do we get related tickets?
1668
-        if ($first_datetime instanceof EE_Datetime
1669
-            && $first_datetime->ID() !== 0
1670
-        ) {
1671
-            $existing_datetime_ids[] = $first_datetime->get('DTT_ID');
1672
-            $template_args['time'] = $first_datetime;
1673
-            $related_tickets = $first_datetime->tickets(
1674
-                [
1675
-                    ['OR' => ['TKT_deleted' => 1, 'TKT_deleted*' => 0]],
1676
-                    'default_where_conditions' => 'none',
1677
-                ]
1678
-            );
1679
-            if (! empty($related_tickets)) {
1680
-                $template_args['total_ticket_rows'] = count($related_tickets);
1681
-                $row = 0;
1682
-                foreach ($related_tickets as $ticket) {
1683
-                    $existing_ticket_ids[] = $ticket->get('TKT_ID');
1684
-                    $template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, false, $row);
1685
-                    $row++;
1686
-                }
1687
-            } else {
1688
-                $template_args['total_ticket_rows'] = 1;
1689
-                /** @type EE_Ticket $ticket */
1690
-                $ticket = EE_Registry::instance()->load_model('Ticket')->create_default_object();
1691
-                $template_args['ticket_rows'] .= $this->_get_ticket_row($ticket);
1692
-            }
1693
-        } else {
1694
-            $template_args['time'] = $times[0];
1695
-            /** @type EE_Ticket $ticket */
1696
-            $ticket = EE_Registry::instance()->load_model('Ticket')->get_all_default_tickets();
1697
-            $template_args['ticket_rows'] .= $this->_get_ticket_row($ticket[1]);
1698
-            // NOTE: we're just sending the first default row
1699
-            // (decaf can't manage default tickets so this should be sufficient);
1700
-        }
1701
-        $template_args['event_datetime_help_link'] = $this->_get_help_tab_link(
1702
-            'event_editor_event_datetimes_help_tab'
1703
-        );
1704
-        $template_args['ticket_options_help_link'] = $this->_get_help_tab_link('ticket_options_info');
1705
-        $template_args['existing_datetime_ids'] = implode(',', $existing_datetime_ids);
1706
-        $template_args['existing_ticket_ids'] = implode(',', $existing_ticket_ids);
1707
-        $template_args['ticket_js_structure'] = $this->_get_ticket_row(
1708
-            EE_Registry::instance()->load_model('Ticket')->create_default_object(),
1709
-            true
1710
-        );
1711
-        $template = apply_filters(
1712
-            'FHEE__Events_Admin_Page__ticket_metabox__template',
1713
-            EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php'
1714
-        );
1715
-        EEH_Template::display_template($template, $template_args);
1716
-    }
1717
-
1718
-
1719
-    /**
1720
-     * Setup an individual ticket form for the decaf event editor page
1721
-     *
1722
-     * @access private
1723
-     * @param EE_Ticket $ticket   the ticket object
1724
-     * @param boolean   $skeleton whether we're generating a skeleton for js manipulation
1725
-     * @param int       $row
1726
-     * @return string generated html for the ticket row.
1727
-     * @throws DomainException
1728
-     * @throws EE_Error
1729
-     * @throws InvalidArgumentException
1730
-     * @throws InvalidDataTypeException
1731
-     * @throws InvalidInterfaceException
1732
-     * @throws ReflectionException
1733
-     */
1734
-    private function _get_ticket_row($ticket, $skeleton = false, $row = 0)
1735
-    {
1736
-        $template_args = [
1737
-            'tkt_status_class'    => ' tkt-status-' . $ticket->ticket_status(),
1738
-            'tkt_archive_class'   => $ticket->ticket_status() === EE_Ticket::archived && ! $skeleton ? ' tkt-archived'
1739
-                : '',
1740
-            'ticketrow'           => $skeleton ? 'TICKETNUM' : $row,
1741
-            'TKT_ID'              => $ticket->get('TKT_ID'),
1742
-            'TKT_name'            => $ticket->get('TKT_name'),
1743
-            'TKT_start_date'      => $skeleton ? '' : $ticket->get_date('TKT_start_date', 'Y-m-d h:i a'),
1744
-            'TKT_end_date'        => $skeleton ? '' : $ticket->get_date('TKT_end_date', 'Y-m-d h:i a'),
1745
-            'TKT_is_default'      => $ticket->get('TKT_is_default'),
1746
-            'TKT_qty'             => $ticket->get_pretty('TKT_qty', 'input'),
1747
-            'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1748
-            'TKT_sold'            => $skeleton ? 0 : $ticket->get('TKT_sold'),
1749
-            'trash_icon'          => ($skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')))
1750
-                                     && (! empty($ticket) && $ticket->get('TKT_sold') === 0)
1751
-                ? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1752
-            'disabled'            => $skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')) ? ''
1753
-                : ' disabled=disabled',
1754
-        ];
1755
-        $price = $ticket->ID() !== 0
1756
-            ? $ticket->get_first_related('Price', ['default_where_conditions' => 'none'])
1757
-            : EE_Registry::instance()->load_model('Price')->create_default_object();
1758
-        $price_args = [
1759
-            'price_currency_symbol' => EE_Registry::instance()->CFG->currency->sign,
1760
-            'PRC_amount'            => $price->get('PRC_amount'),
1761
-            'PRT_ID'                => $price->get('PRT_ID'),
1762
-            'PRC_ID'                => $price->get('PRC_ID'),
1763
-            'PRC_is_default'        => $price->get('PRC_is_default'),
1764
-        ];
1765
-        // make sure we have default start and end dates if skeleton
1766
-        // handle rows that should NOT be empty
1767
-        if (empty($template_args['TKT_start_date'])) {
1768
-            // if empty then the start date will be now.
1769
-            $template_args['TKT_start_date'] = date('Y-m-d h:i a', current_time('timestamp'));
1770
-        }
1771
-        if (empty($template_args['TKT_end_date'])) {
1772
-            // get the earliest datetime (if present);
1773
-            $earliest_dtt = $this->_cpt_model_obj->ID() > 0
1774
-                ? $this->_cpt_model_obj->get_first_related(
1775
-                    'Datetime',
1776
-                    ['order_by' => ['DTT_EVT_start' => 'ASC']]
1777
-                )
1778
-                : null;
1779
-            if (! empty($earliest_dtt)) {
1780
-                $template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1781
-            } else {
1782
-                $template_args['TKT_end_date'] = date(
1783
-                    'Y-m-d h:i a',
1784
-                    mktime(0, 0, 0, date('m'), date('d') + 7, date('Y'))
1785
-                );
1786
-            }
1787
-        }
1788
-        $template_args = array_merge($template_args, $price_args);
1789
-        $template = apply_filters(
1790
-            'FHEE__Events_Admin_Page__get_ticket_row__template',
1791
-            EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_ticket_row.template.php',
1792
-            $ticket
1793
-        );
1794
-        return EEH_Template::display_template($template, $template_args, true);
1795
-    }
1796
-
1797
-
1798
-    /**
1799
-     * @throws DomainException
1800
-     * @throws EE_Error
1801
-     */
1802
-    public function registration_options_meta_box()
1803
-    {
1804
-        $yes_no_values = [
1805
-            ['id' => true, 'text' => esc_html__('Yes', 'event_espresso')],
1806
-            ['id' => false, 'text' => esc_html__('No', 'event_espresso')],
1807
-        ];
1808
-        $default_reg_status_values = EEM_Registration::reg_status_array(
1809
-            [
1810
-                EEM_Registration::status_id_cancelled,
1811
-                EEM_Registration::status_id_declined,
1812
-                EEM_Registration::status_id_incomplete,
1813
-            ],
1814
-            true
1815
-        );
1816
-        // $template_args['is_active_select'] = EEH_Form_Fields::select_input('is_active', $yes_no_values, $this->_cpt_model_obj->is_active());
1817
-        $template_args['_event'] = $this->_cpt_model_obj;
1818
-        $template_args['active_status'] = $this->_cpt_model_obj->pretty_active_status(false);
1819
-        $template_args['additional_limit'] = $this->_cpt_model_obj->additional_limit();
1820
-        $template_args['default_registration_status'] = EEH_Form_Fields::select_input(
1821
-            'default_reg_status',
1822
-            $default_reg_status_values,
1823
-            $this->_cpt_model_obj->default_registration_status()
1824
-        );
1825
-        $template_args['display_description'] = EEH_Form_Fields::select_input(
1826
-            'display_desc',
1827
-            $yes_no_values,
1828
-            $this->_cpt_model_obj->display_description()
1829
-        );
1830
-        $template_args['display_ticket_selector'] = EEH_Form_Fields::select_input(
1831
-            'display_ticket_selector',
1832
-            $yes_no_values,
1833
-            $this->_cpt_model_obj->display_ticket_selector(),
1834
-            '',
1835
-            '',
1836
-            false
1837
-        );
1838
-        $template_args['additional_registration_options'] = apply_filters(
1839
-            'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options',
1840
-            '',
1841
-            $template_args,
1842
-            $yes_no_values,
1843
-            $default_reg_status_values
1844
-        );
1845
-        EEH_Template::display_template(
1846
-            EVENTS_TEMPLATE_PATH . 'event_registration_options.template.php',
1847
-            $template_args
1848
-        );
1849
-    }
1850
-
1851
-
1852
-    /**
1853
-     * _get_events()
1854
-     * This method simply returns all the events (for the given _view and paging)
1855
-     *
1856
-     * @access public
1857
-     * @param int  $per_page     count of items per page (20 default);
1858
-     * @param int  $current_page what is the current page being viewed.
1859
-     * @param bool $count        if TRUE then we just return a count of ALL events matching the given _view.
1860
-     *                           If FALSE then we return an array of event objects
1861
-     *                           that match the given _view and paging parameters.
1862
-     * @return array an array of event objects.
1863
-     * @throws EE_Error
1864
-     * @throws InvalidArgumentException
1865
-     * @throws InvalidDataTypeException
1866
-     * @throws InvalidInterfaceException
1867
-     * @throws ReflectionException
1868
-     * @throws Exception
1869
-     * @throws Exception
1870
-     * @throws Exception
1871
-     */
1872
-    public function get_events($per_page = 10, $current_page = 1, $count = false)
1873
-    {
1874
-        $EEME = $this->_event_model();
1875
-        $offset = ($current_page - 1) * $per_page;
1876
-        $limit = $count ? null : $offset . ',' . $per_page;
1877
-        $orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'EVT_ID';
1878
-        $order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
1879
-        if (isset($this->_req_data['month_range'])) {
1880
-            $pieces = explode(' ', $this->_req_data['month_range'], 3);
1881
-            // simulate the FIRST day of the month, that fixes issues for months like February
1882
-            // where PHP doesn't know what to assume for date.
1883
-            // @see https://events.codebasehq.com/projects/event-espresso/tickets/10437
1884
-            $month_r = ! empty($pieces[0]) ? date('m', EEH_DTT_Helper::first_of_month_timestamp($pieces[0])) : '';
1885
-            $year_r = ! empty($pieces[1]) ? $pieces[1] : '';
1886
-        }
1887
-        $where = [];
1888
-        $status = isset($this->_req_data['status']) ? $this->_req_data['status'] : null;
1889
-        // determine what post_status our condition will have for the query.
1890
-        switch ($status) {
1891
-            case 'month':
1892
-            case 'today':
1893
-            case null:
1894
-            case 'all':
1895
-                break;
1896
-            case 'draft':
1897
-                $where['status'] = ['IN', ['draft', 'auto-draft']];
1898
-                break;
1899
-            default:
1900
-                $where['status'] = $status;
1901
-        }
1902
-        // categories?
1903
-        $category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0
1904
-            ? $this->_req_data['EVT_CAT'] : null;
1905
-        if (! empty($category)) {
1906
-            $where['Term_Taxonomy.taxonomy'] = EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY;
1907
-            $where['Term_Taxonomy.term_id'] = $category;
1908
-        }
1909
-        // date where conditions
1910
-        $start_formats = EEM_Datetime::instance()->get_formats_for('DTT_EVT_start');
1911
-        if (isset($this->_req_data['month_range']) && $this->_req_data['month_range'] !== '') {
1912
-            $DateTime = new DateTime(
1913
-                $year_r . '-' . $month_r . '-01 00:00:00',
1914
-                new DateTimeZone('UTC')
1915
-            );
1916
-            $start = $DateTime->getTimestamp();
1917
-            // set the datetime to be the end of the month
1918
-            $DateTime->setDate(
1919
-                $year_r,
1920
-                $month_r,
1921
-                $DateTime->format('t')
1922
-            )->setTime(23, 59, 59);
1923
-            $end = $DateTime->getTimestamp();
1924
-            $where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1925
-        } elseif (isset($this->_req_data['status']) && $this->_req_data['status'] === 'today') {
1926
-            $DateTime = new DateTime('now', new DateTimeZone(EEM_Event::instance()->get_timezone()));
1927
-            $start = $DateTime->setTime(0, 0, 0)->format(implode(' ', $start_formats));
1928
-            $end = $DateTime->setTime(23, 59, 59)->format(implode(' ', $start_formats));
1929
-            $where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1930
-        } elseif (isset($this->_req_data['status']) && $this->_req_data['status'] === 'month') {
1931
-            $now = date('Y-m-01');
1932
-            $DateTime = new DateTime($now, new DateTimeZone(EEM_Event::instance()->get_timezone()));
1933
-            $start = $DateTime->setTime(0, 0, 0)->format(implode(' ', $start_formats));
1934
-            $end = $DateTime->setDate(date('Y'), date('m'), $DateTime->format('t'))
1935
-                            ->setTime(23, 59, 59)
1936
-                            ->format(implode(' ', $start_formats));
1937
-            $where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1938
-        }
1939
-        if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1940
-            $where['EVT_wp_user'] = get_current_user_id();
1941
-        } elseif (! isset($where['status'])
1942
-                  && ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')
1943
-        ) {
1944
-            $where['OR'] = [
1945
-                'status*restrict_private' => ['!=', 'private'],
1946
-                'AND'                     => [
1947
-                    'status*inclusive' => ['=', 'private'],
1948
-                    'EVT_wp_user'      => get_current_user_id(),
1949
-                ],
1950
-            ];
1951
-        }
1952
-
1953
-        if (isset($this->_req_data['EVT_wp_user'])
1954
-            && (int) $this->_req_data['EVT_wp_user'] !== (int) get_current_user_id()
1955
-            && EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')
1956
-        ) {
1957
-            $where['EVT_wp_user'] = $this->_req_data['EVT_wp_user'];
1958
-        }
1959
-        // search query handling
1960
-        if (isset($this->_req_data['s'])) {
1961
-            $search_string = '%' . $this->_req_data['s'] . '%';
1962
-            $where['OR'] = [
1963
-                'EVT_name'       => ['LIKE', $search_string],
1964
-                'EVT_desc'       => ['LIKE', $search_string],
1965
-                'EVT_short_desc' => ['LIKE', $search_string],
1966
-            ];
1967
-        }
1968
-        // filter events by venue.
1969
-        if (isset($this->_req_data['venue']) && ! empty($this->_req_data['venue'])) {
1970
-            $where['Venue.VNU_ID'] = absint($this->_req_data['venue']);
1971
-        }
1972
-        $where = apply_filters('FHEE__Events_Admin_Page__get_events__where', $where, $this->_req_data);
1973
-        $query_params = apply_filters(
1974
-            'FHEE__Events_Admin_Page__get_events__query_params',
1975
-            [
1976
-                $where,
1977
-                'limit'    => $limit,
1978
-                'order_by' => $orderby,
1979
-                'order'    => $order,
1980
-                'group_by' => 'EVT_ID',
1981
-            ],
1982
-            $this->_req_data
1983
-        );
1984
-
1985
-        // let's first check if we have special requests coming in.
1986
-        if (isset($this->_req_data['active_status'])) {
1987
-            switch ($this->_req_data['active_status']) {
1988
-                case 'upcoming':
1989
-                    return $EEME->get_upcoming_events($query_params, $count);
1990
-                    break;
1991
-                case 'expired':
1992
-                    return $EEME->get_expired_events($query_params, $count);
1993
-                    break;
1994
-                case 'active':
1995
-                    return $EEME->get_active_events($query_params, $count);
1996
-                    break;
1997
-                case 'inactive':
1998
-                    return $EEME->get_inactive_events($query_params, $count);
1999
-                    break;
2000
-            }
2001
-        }
2002
-
2003
-        $events = $count ? $EEME->count([$where], 'EVT_ID', true) : $EEME->get_all($query_params);
2004
-        return $events;
2005
-    }
2006
-
2007
-
2008
-    /**
2009
-     * handling for WordPress CPT actions (trash, restore, delete)
2010
-     *
2011
-     * @param string $post_id
2012
-     * @throws EE_Error
2013
-     * @throws InvalidArgumentException
2014
-     * @throws InvalidDataTypeException
2015
-     * @throws InvalidInterfaceException
2016
-     * @throws ReflectionException
2017
-     */
2018
-    public function trash_cpt_item($post_id)
2019
-    {
2020
-        $this->_req_data['EVT_ID'] = $post_id;
2021
-        $this->_trash_or_restore_event('trash', false);
2022
-    }
2023
-
2024
-
2025
-    /**
2026
-     * @param string $post_id
2027
-     * @throws EE_Error
2028
-     * @throws InvalidArgumentException
2029
-     * @throws InvalidDataTypeException
2030
-     * @throws InvalidInterfaceException
2031
-     * @throws ReflectionException
2032
-     */
2033
-    public function restore_cpt_item($post_id)
2034
-    {
2035
-        $this->_req_data['EVT_ID'] = $post_id;
2036
-        $this->_trash_or_restore_event('draft', false);
2037
-    }
2038
-
2039
-
2040
-    /**
2041
-     * @param string $post_id
2042
-     * @throws EE_Error
2043
-     * @throws InvalidArgumentException
2044
-     * @throws InvalidDataTypeException
2045
-     * @throws InvalidInterfaceException
2046
-     * @throws ReflectionException
2047
-     */
2048
-    public function delete_cpt_item($post_id)
2049
-    {
2050
-        $this->_req_data['EVT_ID'] = $post_id;
2051
-        $this->_delete_event(false);
2052
-    }
2053
-
2054
-
2055
-    /**
2056
-     * _trash_or_restore_event
2057
-     *
2058
-     * @access protected
2059
-     * @param string $event_status
2060
-     * @param bool   $redirect_after
2061
-     * @throws EE_Error
2062
-     * @throws InvalidArgumentException
2063
-     * @throws InvalidDataTypeException
2064
-     * @throws InvalidInterfaceException
2065
-     * @throws ReflectionException
2066
-     */
2067
-    protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = true)
2068
-    {
2069
-        // determine the event id and set to array.
2070
-        $EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : false;
2071
-        // loop thru events
2072
-        if ($EVT_ID) {
2073
-            // clean status
2074
-            $event_status = sanitize_key($event_status);
2075
-            // grab status
2076
-            if (! empty($event_status)) {
2077
-                $success = $this->_change_event_status($EVT_ID, $event_status);
2078
-            } else {
2079
-                $success = false;
2080
-                $msg = esc_html__(
2081
-                    'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
2082
-                    'event_espresso'
2083
-                );
2084
-                EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2085
-            }
2086
-        } else {
2087
-            $success = false;
2088
-            $msg = esc_html__(
2089
-                'An error occurred. The event could not be moved to the trash because a valid event ID was not not supplied.',
2090
-                'event_espresso'
2091
-            );
2092
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2093
-        }
2094
-        $action = $event_status === 'trash' ? 'moved to the trash' : 'restored from the trash';
2095
-        if ($redirect_after) {
2096
-            $this->_redirect_after_action($success, 'Event', $action, ['action' => 'default']);
2097
-        }
2098
-    }
2099
-
2100
-
2101
-    /**
2102
-     * _trash_or_restore_events
2103
-     *
2104
-     * @access protected
2105
-     * @param string $event_status
2106
-     * @return void
2107
-     * @throws EE_Error
2108
-     * @throws InvalidArgumentException
2109
-     * @throws InvalidDataTypeException
2110
-     * @throws InvalidInterfaceException
2111
-     * @throws ReflectionException
2112
-     */
2113
-    protected function _trash_or_restore_events($event_status = 'trash')
2114
-    {
2115
-        // clean status
2116
-        $event_status = sanitize_key($event_status);
2117
-        // grab status
2118
-        if (! empty($event_status)) {
2119
-            $success = true;
2120
-            // determine the event id and set to array.
2121
-            $EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : [];
2122
-            // loop thru events
2123
-            foreach ($EVT_IDs as $EVT_ID) {
2124
-                if ($EVT_ID = absint($EVT_ID)) {
2125
-                    $results = $this->_change_event_status($EVT_ID, $event_status);
2126
-                    $success = $results !== false ? $success : false;
2127
-                } else {
2128
-                    $msg = sprintf(
2129
-                        esc_html__(
2130
-                            'An error occurred. Event #%d could not be moved to the trash because a valid event ID was not not supplied.',
2131
-                            'event_espresso'
2132
-                        ),
2133
-                        $EVT_ID
2134
-                    );
2135
-                    EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2136
-                    $success = false;
2137
-                }
2138
-            }
2139
-        } else {
2140
-            $success = false;
2141
-            $msg = esc_html__(
2142
-                'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
2143
-                'event_espresso'
2144
-            );
2145
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2146
-        }
2147
-        // in order to force a pluralized result message we need to send back a success status greater than 1
2148
-        $success = $success ? 2 : false;
2149
-        $action = $event_status === 'trash' ? 'moved to the trash' : 'restored from the trash';
2150
-        $this->_redirect_after_action($success, 'Events', $action, ['action' => 'default']);
2151
-    }
2152
-
2153
-
2154
-    /**
2155
-     * _trash_or_restore_events
2156
-     *
2157
-     * @access  private
2158
-     * @param int    $EVT_ID
2159
-     * @param string $event_status
2160
-     * @return bool
2161
-     * @throws EE_Error
2162
-     * @throws InvalidArgumentException
2163
-     * @throws InvalidDataTypeException
2164
-     * @throws InvalidInterfaceException
2165
-     * @throws ReflectionException
2166
-     */
2167
-    private function _change_event_status($EVT_ID = 0, $event_status = '')
2168
-    {
2169
-        // grab event id
2170
-        if (! $EVT_ID) {
2171
-            $msg = esc_html__(
2172
-                'An error occurred. No Event ID or an invalid Event ID was received.',
2173
-                'event_espresso'
2174
-            );
2175
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2176
-            return false;
2177
-        }
2178
-        $this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2179
-        // clean status
2180
-        $event_status = sanitize_key($event_status);
2181
-        // grab status
2182
-        if (empty($event_status)) {
2183
-            $msg = esc_html__(
2184
-                'An error occurred. No Event Status or an invalid Event Status was received.',
2185
-                'event_espresso'
2186
-            );
2187
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2188
-            return false;
2189
-        }
2190
-        // was event trashed or restored ?
2191
-        switch ($event_status) {
2192
-            case 'draft':
2193
-                $action = 'restored from the trash';
2194
-                $hook = 'AHEE_event_restored_from_trash';
2195
-                break;
2196
-            case 'trash':
2197
-                $action = 'moved to the trash';
2198
-                $hook = 'AHEE_event_moved_to_trash';
2199
-                break;
2200
-            default:
2201
-                $action = 'updated';
2202
-                $hook = false;
2203
-        }
2204
-        // use class to change status
2205
-        $this->_cpt_model_obj->set_status($event_status);
2206
-        $success = $this->_cpt_model_obj->save();
2207
-        if ($success === false) {
2208
-            $msg = sprintf(esc_html__('An error occurred. The event could not be %s.', 'event_espresso'), $action);
2209
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2210
-            return false;
2211
-        }
2212
-        if ($hook) {
2213
-            do_action($hook);
2214
-        }
2215
-        return true;
2216
-    }
2217
-
2218
-
2219
-    /**
2220
-     * _delete_event
2221
-     *
2222
-     * @access protected
2223
-     * @param bool $redirect_after
2224
-     * @throws EE_Error
2225
-     * @throws InvalidArgumentException
2226
-     * @throws InvalidDataTypeException
2227
-     * @throws InvalidInterfaceException
2228
-     * @throws ReflectionException
2229
-     */
2230
-    protected function _delete_event($redirect_after = true)
2231
-    {
2232
-        // determine the event id and set to array.
2233
-        $EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : null;
2234
-        $EVT_ID = isset($this->_req_data['post']) ? absint($this->_req_data['post']) : $EVT_ID;
2235
-        // loop thru events
2236
-        if ($EVT_ID) {
2237
-            $success = $this->_permanently_delete_event($EVT_ID);
2238
-            // get list of events with no prices
2239
-            $espresso_no_ticket_prices = get_option('ee_no_ticket_prices', []);
2240
-            // remove this event from the list of events with no prices
2241
-            if (isset($espresso_no_ticket_prices[ $EVT_ID ])) {
2242
-                unset($espresso_no_ticket_prices[ $EVT_ID ]);
2243
-            }
2244
-            update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2245
-        } else {
2246
-            $success = false;
2247
-            $msg = esc_html__(
2248
-                'An error occurred. An event could not be deleted because a valid event ID was not not supplied.',
2249
-                'event_espresso'
2250
-            );
2251
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2252
-        }
2253
-        if ($redirect_after) {
2254
-            $this->_redirect_after_action(
2255
-                $success,
2256
-                'Event',
2257
-                'deleted',
2258
-                ['action' => 'default', 'status' => 'trash']
2259
-            );
2260
-        }
2261
-    }
2262
-
2263
-
2264
-    /**
2265
-     * _delete_events
2266
-     *
2267
-     * @access protected
2268
-     * @return void
2269
-     * @throws EE_Error
2270
-     * @throws InvalidArgumentException
2271
-     * @throws InvalidDataTypeException
2272
-     * @throws InvalidInterfaceException
2273
-     * @throws ReflectionException
2274
-     */
2275
-    protected function _delete_events()
2276
-    {
2277
-        $success = true;
2278
-        // get list of events with no prices
2279
-        $espresso_no_ticket_prices = get_option('ee_no_ticket_prices', []);
2280
-        // determine the event id and set to array.
2281
-        $EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : [];
2282
-        // loop thru events
2283
-        foreach ($EVT_IDs as $EVT_ID) {
2284
-            $EVT_ID = absint($EVT_ID);
2285
-            if ($EVT_ID) {
2286
-                $results = $this->_permanently_delete_event($EVT_ID);
2287
-                $success = $results !== false ? $success : false;
2288
-                // remove this event from the list of events with no prices
2289
-                unset($espresso_no_ticket_prices[ $EVT_ID ]);
2290
-            } else {
2291
-                $success = false;
2292
-                $msg = esc_html__(
2293
-                    'An error occurred. An event could not be deleted because a valid event ID was not not supplied.',
2294
-                    'event_espresso'
2295
-                );
2296
-                EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2297
-            }
2298
-        }
2299
-        update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2300
-        // in order to force a pluralized result message we need to send back a success status greater than 1
2301
-        $success = $success ? 2 : false;
2302
-        $this->_redirect_after_action($success, 'Events', 'deleted', ['action' => 'default']);
2303
-    }
2304
-
2305
-
2306
-    /**
2307
-     * _permanently_delete_event
2308
-     *
2309
-     * @access  private
2310
-     * @param int $EVT_ID
2311
-     * @return bool
2312
-     * @throws EE_Error
2313
-     * @throws InvalidArgumentException
2314
-     * @throws InvalidDataTypeException
2315
-     * @throws InvalidInterfaceException
2316
-     * @throws ReflectionException
2317
-     */
2318
-    private function _permanently_delete_event($EVT_ID = 0)
2319
-    {
2320
-        // grab event id
2321
-        if (! $EVT_ID) {
2322
-            $msg = esc_html__(
2323
-                'An error occurred. No Event ID or an invalid Event ID was received.',
2324
-                'event_espresso'
2325
-            );
2326
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2327
-            return false;
2328
-        }
2329
-        if (! $this->_cpt_model_obj instanceof EE_Event
2330
-            || $this->_cpt_model_obj->ID() !== $EVT_ID
2331
-        ) {
2332
-            $this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2333
-        }
2334
-        if (! $this->_cpt_model_obj instanceof EE_Event) {
2335
-            return false;
2336
-        }
2337
-        // need to delete related tickets and prices first.
2338
-        $datetimes = $this->_cpt_model_obj->get_many_related('Datetime');
2339
-        foreach ($datetimes as $datetime) {
2340
-            $this->_cpt_model_obj->_remove_relation_to($datetime, 'Datetime');
2341
-            $tickets = $datetime->get_many_related('Ticket');
2342
-            foreach ($tickets as $ticket) {
2343
-                $ticket->_remove_relation_to($datetime, 'Datetime');
2344
-                $ticket->delete_related_permanently('Price');
2345
-                $ticket->delete_permanently();
2346
-            }
2347
-            $datetime->delete();
2348
-        }
2349
-        // what about related venues or terms?
2350
-        $venues = $this->_cpt_model_obj->get_many_related('Venue');
2351
-        foreach ($venues as $venue) {
2352
-            $this->_cpt_model_obj->_remove_relation_to($venue, 'Venue');
2353
-        }
2354
-        // any attached question groups?
2355
-        $question_groups = $this->_cpt_model_obj->get_many_related('Question_Group');
2356
-        if (! empty($question_groups)) {
2357
-            foreach ($question_groups as $question_group) {
2358
-                $this->_cpt_model_obj->_remove_relation_to($question_group, 'Question_Group');
2359
-            }
2360
-        }
2361
-        // Message Template Groups
2362
-        $this->_cpt_model_obj->_remove_relations('Message_Template_Group');
2363
-        /** @type EE_Term_Taxonomy[] $term_taxonomies */
2364
-        $term_taxonomies = $this->_cpt_model_obj->term_taxonomies();
2365
-        foreach ($term_taxonomies as $term_taxonomy) {
2366
-            $this->_cpt_model_obj->remove_relation_to_term_taxonomy($term_taxonomy);
2367
-        }
2368
-        $success = $this->_cpt_model_obj->delete_permanently();
2369
-        // did it all go as planned ?
2370
-        if ($success) {
2371
-            $msg = sprintf(esc_html__('Event ID # %d has been deleted.', 'event_espresso'), $EVT_ID);
2372
-            EE_Error::add_success($msg);
2373
-        } else {
2374
-            $msg = sprintf(
2375
-                esc_html__('An error occurred. Event ID # %d could not be deleted.', 'event_espresso'),
2376
-                $EVT_ID
2377
-            );
2378
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2379
-            return false;
2380
-        }
2381
-        do_action('AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted', $EVT_ID);
2382
-        return true;
2383
-    }
2384
-
2385
-
2386
-    /**
2387
-     * get total number of events
2388
-     *
2389
-     * @access public
2390
-     * @return int
2391
-     * @throws EE_Error
2392
-     * @throws InvalidArgumentException
2393
-     * @throws InvalidDataTypeException
2394
-     * @throws InvalidInterfaceException
2395
-     */
2396
-    public function total_events()
2397
-    {
2398
-        $count = EEM_Event::instance()->count(['caps' => 'read_admin'], 'EVT_ID', true);
2399
-        return $count;
2400
-    }
2401
-
2402
-
2403
-    /**
2404
-     * get total number of draft events
2405
-     *
2406
-     * @access public
2407
-     * @return int
2408
-     * @throws EE_Error
2409
-     * @throws InvalidArgumentException
2410
-     * @throws InvalidDataTypeException
2411
-     * @throws InvalidInterfaceException
2412
-     */
2413
-    public function total_events_draft()
2414
-    {
2415
-        $where = [
2416
-            'status' => ['IN', ['draft', 'auto-draft']],
2417
-        ];
2418
-        $count = EEM_Event::instance()->count([$where, 'caps' => 'read_admin'], 'EVT_ID', true);
2419
-        return $count;
2420
-    }
2421
-
2422
-
2423
-    /**
2424
-     * get total number of trashed events
2425
-     *
2426
-     * @access public
2427
-     * @return int
2428
-     * @throws EE_Error
2429
-     * @throws InvalidArgumentException
2430
-     * @throws InvalidDataTypeException
2431
-     * @throws InvalidInterfaceException
2432
-     */
2433
-    public function total_trashed_events()
2434
-    {
2435
-        $where = [
2436
-            'status' => 'trash',
2437
-        ];
2438
-        $count = EEM_Event::instance()->count([$where, 'caps' => 'read_admin'], 'EVT_ID', true);
2439
-        return $count;
2440
-    }
2441
-
2442
-
2443
-    /**
2444
-     *    _default_event_settings
2445
-     *    This generates the Default Settings Tab
2446
-     *
2447
-     * @return void
2448
-     * @throws DomainException
2449
-     * @throws EE_Error
2450
-     * @throws InvalidArgumentException
2451
-     * @throws InvalidDataTypeException
2452
-     * @throws InvalidInterfaceException
2453
-     */
2454
-    protected function _default_event_settings()
2455
-    {
2456
-        $this->_set_add_edit_form_tags('update_default_event_settings');
2457
-        $this->_set_publish_post_box_vars(null, false, false, null, false);
2458
-        $this->_template_args['admin_page_content'] = $this->_default_event_settings_form()->get_html();
2459
-        $this->display_admin_page_with_sidebar();
2460
-    }
2461
-
2462
-
2463
-    /**
2464
-     * Return the form for event settings.
2465
-     *
2466
-     * @return EE_Form_Section_Proper
2467
-     * @throws EE_Error
2468
-     */
2469
-    protected function _default_event_settings_form()
2470
-    {
2471
-        $registration_config = EE_Registry::instance()->CFG->registration;
2472
-        $registration_stati_for_selection = EEM_Registration::reg_status_array(
2473
-        // exclude
2474
-            [
2475
-                EEM_Registration::status_id_cancelled,
2476
-                EEM_Registration::status_id_declined,
2477
-                EEM_Registration::status_id_incomplete,
2478
-                EEM_Registration::status_id_wait_list,
2479
-            ],
2480
-            true
2481
-        );
2482
-        return new EE_Form_Section_Proper(
2483
-            [
2484
-                'name'            => 'update_default_event_settings',
2485
-                'html_id'         => 'update_default_event_settings',
2486
-                'html_class'      => 'form-table',
2487
-                'layout_strategy' => new EE_Admin_Two_Column_Layout(),
2488
-                'subsections'     => apply_filters(
2489
-                    'FHEE__Events_Admin_Page___default_event_settings_form__form_subsections',
2490
-                    [
2491
-                        'default_reg_status'  => new EE_Select_Input(
2492
-                            $registration_stati_for_selection,
2493
-                            [
2494
-                                'default'         => isset($registration_config->default_STS_ID)
2495
-                                                     && array_key_exists(
2496
-                                                         $registration_config->default_STS_ID,
2497
-                                                         $registration_stati_for_selection
2498
-                                                     )
2499
-                                    ? sanitize_text_field($registration_config->default_STS_ID)
2500
-                                    : EEM_Registration::status_id_pending_payment,
2501
-                                'html_label_text' => esc_html__('Default Registration Status', 'event_espresso')
2502
-                                                     . EEH_Template::get_help_tab_link(
2503
-                                                         'default_settings_status_help_tab'
2504
-                                                     ),
2505
-                                'html_help_text'  => esc_html__(
2506
-                                    '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.',
2507
-                                    'event_espresso'
2508
-                                ),
2509
-                            ]
2510
-                        ),
2511
-                        'default_max_tickets' => new EE_Integer_Input(
2512
-                            [
2513
-                                'default'         => isset($registration_config->default_maximum_number_of_tickets)
2514
-                                    ? $registration_config->default_maximum_number_of_tickets
2515
-                                    : EEM_Event::get_default_additional_limit(),
2516
-                                'html_label_text' => esc_html__(
2517
-                                    'Default Maximum Tickets Allowed Per Order:',
2518
-                                    'event_espresso'
2519
-                                )
2520
-                                                     . EEH_Template::get_help_tab_link(
2521
-                                                         'default_maximum_tickets_help_tab"'
2522
-                                                     ),
2523
-                                'html_help_text'  => esc_html__(
2524
-                                    'This setting allows you to indicate what will be the default for the maximum number of tickets per order when creating new events.',
2525
-                                    'event_espresso'
2526
-                                ),
2527
-                            ]
2528
-                        ),
2529
-                    ]
2530
-                ),
2531
-            ]
2532
-        );
2533
-    }
2534
-
2535
-
2536
-    /**
2537
-     * @return void
2538
-     * @throws EE_Error
2539
-     * @throws InvalidArgumentException
2540
-     * @throws InvalidDataTypeException
2541
-     * @throws InvalidInterfaceException
2542
-     */
2543
-    protected function _update_default_event_settings()
2544
-    {
2545
-        $form = $this->_default_event_settings_form();
2546
-        if ($form->was_submitted()) {
2547
-            $form->receive_form_submission();
2548
-            if ($form->is_valid()) {
2549
-                $registration_config = EE_Registry::instance()->CFG->registration;
2550
-                $valid_data = $form->valid_data();
2551
-                if (isset($valid_data['default_reg_status'])) {
2552
-                    $registration_config->default_STS_ID = $valid_data['default_reg_status'];
2553
-                }
2554
-                if (isset($valid_data['default_max_tickets'])) {
2555
-                    $registration_config->default_maximum_number_of_tickets = $valid_data['default_max_tickets'];
2556
-                }
2557
-                do_action(
2558
-                    'AHEE__Events_Admin_Page___update_default_event_settings',
2559
-                    $valid_data,
2560
-                    EE_Registry::instance()->CFG,
2561
-                    $this
2562
-                );
2563
-                // update because data was valid!
2564
-                EE_Registry::instance()->CFG->update_espresso_config();
2565
-                EE_Error::overwrite_success();
2566
-                EE_Error::add_success(
2567
-                    __('Default Event Settings were updated', 'event_espresso')
2568
-                );
2569
-            }
2570
-        }
2571
-        $this->_redirect_after_action(0, '', '', ['action' => 'default_event_settings'], true);
2572
-    }
2573
-
2574
-
2575
-    /*************        Templates        *************/
2576
-    protected function _template_settings()
2577
-    {
2578
-        $this->_admin_page_title = esc_html__('Template Settings (Preview)', 'event_espresso');
2579
-        $this->_template_args['preview_img'] = '<img src="'
2580
-                                               . EVENTS_ASSETS_URL
2581
-                                               . '/images/'
2582
-                                               . 'caffeinated_template_features.jpg" alt="'
2583
-                                               . esc_attr__('Template Settings Preview screenshot', 'event_espresso')
2584
-                                               . '" />';
2585
-        $this->_template_args['preview_text'] = '<strong>'
2586
-                                                . esc_html__(
2587
-                                                    '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.',
2588
-                                                    'event_espresso'
2589
-                                                ) . '</strong>';
2590
-        $this->display_admin_caf_preview_page('template_settings_tab');
2591
-    }
2592
-
2593
-
2594
-    /** Event Category Stuff **/
2595
-    /**
2596
-     * set the _category property with the category object for the loaded page.
2597
-     *
2598
-     * @access private
2599
-     * @return void
2600
-     */
2601
-    private function _set_category_object()
2602
-    {
2603
-        if (isset($this->_category->id) && ! empty($this->_category->id)) {
2604
-            return;
2605
-        } //already have the category object so get out.
2606
-        // set default category object
2607
-        $this->_set_empty_category_object();
2608
-        // only set if we've got an id
2609
-        if (! isset($this->_req_data['EVT_CAT_ID'])) {
2610
-            return;
2611
-        }
2612
-        $category_id = absint($this->_req_data['EVT_CAT_ID']);
2613
-        $term = get_term($category_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2614
-        if (! empty($term)) {
2615
-            $this->_category->category_name = $term->name;
2616
-            $this->_category->category_identifier = $term->slug;
2617
-            $this->_category->category_desc = $term->description;
2618
-            $this->_category->id = $term->term_id;
2619
-            $this->_category->parent = $term->parent;
2620
-        }
2621
-    }
2622
-
2623
-
2624
-    /**
2625
-     * Clears out category properties.
2626
-     */
2627
-    private function _set_empty_category_object()
2628
-    {
2629
-        $this->_category = new stdClass();
2630
-        $this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc = '';
2631
-        $this->_category->id = $this->_category->parent = 0;
2632
-    }
2633
-
2634
-
2635
-    /**
2636
-     * @throws DomainException
2637
-     * @throws EE_Error
2638
-     * @throws InvalidArgumentException
2639
-     * @throws InvalidDataTypeException
2640
-     * @throws InvalidInterfaceException
2641
-     */
2642
-    protected function _category_list_table()
2643
-    {
2644
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2645
-        $this->_search_btn_label = esc_html__('Categories', 'event_espresso');
2646
-        $this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
2647
-            'add_category',
2648
-            'add_category',
2649
-            [],
2650
-            'add-new-h2'
2651
-        );
2652
-        $this->display_admin_list_table_page_with_sidebar();
2653
-    }
2654
-
2655
-
2656
-    /**
2657
-     * Output category details view.
2658
-     *
2659
-     * @param string $view
2660
-     * @throws DomainException
2661
-     * @throws EE_Error
2662
-     * @throws InvalidArgumentException
2663
-     * @throws InvalidDataTypeException
2664
-     * @throws InvalidInterfaceException
2665
-     */
2666
-    protected function _category_details($view)
2667
-    {
2668
-        // load formatter helper
2669
-        // load field generator helper
2670
-        $route = $view === 'edit' ? 'update_category' : 'insert_category';
2671
-        $this->_set_add_edit_form_tags($route);
2672
-        $this->_set_category_object();
2673
-        $id = ! empty($this->_category->id) ? $this->_category->id : '';
2674
-        $delete_action = 'delete_category';
2675
-        // custom redirect
2676
-        $redirect = EE_Admin_Page::add_query_args_and_nonce(
2677
-            ['action' => 'category_list'],
2678
-            $this->_admin_base_url
2679
-        );
2680
-        $this->_set_publish_post_box_vars('EVT_CAT_ID', $id, $delete_action, $redirect);
2681
-        // take care of contents
2682
-        $this->_template_args['admin_page_content'] = $this->_category_details_content();
2683
-        $this->display_admin_page_with_sidebar();
2684
-    }
2685
-
2686
-
2687
-    /**
2688
-     * Output category details content.
2689
-     *
2690
-     * @throws DomainException
2691
-     */
2692
-    protected function _category_details_content()
2693
-    {
2694
-        $editor_args['category_desc'] = [
2695
-            'type'          => 'wp_editor',
2696
-            'value'         => EEH_Formatter::admin_format_content($this->_category->category_desc),
2697
-            'class'         => 'my_editor_custom',
2698
-            'wpeditor_args' => ['media_buttons' => false],
2699
-        ];
2700
-        $_wp_editor = $this->_generate_admin_form_fields($editor_args, 'array');
2701
-        $all_terms = get_terms(
2702
-            [EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY],
2703
-            ['hide_empty' => 0, 'exclude' => [$this->_category->id]]
2704
-        );
2705
-        // setup category select for term parents.
2706
-        $category_select_values[] = [
2707
-            'text' => esc_html__('No Parent', 'event_espresso'),
2708
-            'id'   => 0,
2709
-        ];
2710
-        foreach ($all_terms as $term) {
2711
-            $category_select_values[] = [
2712
-                'text' => $term->name,
2713
-                'id'   => $term->term_id,
2714
-            ];
2715
-        }
2716
-        $category_select = EEH_Form_Fields::select_input(
2717
-            'category_parent',
2718
-            $category_select_values,
2719
-            $this->_category->parent
2720
-        );
2721
-        $template_args = [
2722
-            'category'                 => $this->_category,
2723
-            'category_select'          => $category_select,
2724
-            'unique_id_info_help_link' => $this->_get_help_tab_link('unique_id_info'),
2725
-            'category_desc_editor'     => $_wp_editor['category_desc']['field'],
2726
-            'disable'                  => '',
2727
-            'disabled_message'         => false,
2728
-        ];
2729
-        $template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
2730
-        return EEH_Template::display_template($template, $template_args, true);
2731
-    }
2732
-
2733
-
2734
-    /**
2735
-     * Handles deleting categories.
2736
-     */
2737
-    protected function _delete_categories()
2738
-    {
2739
-        $cat_ids = isset($this->_req_data['EVT_CAT_ID']) ? (array) $this->_req_data['EVT_CAT_ID']
2740
-            : (array) $this->_req_data['category_id'];
2741
-        foreach ($cat_ids as $cat_id) {
2742
-            $this->_delete_category($cat_id);
2743
-        }
2744
-        // doesn't matter what page we're coming from... we're going to the same place after delete.
2745
-        $query_args = [
2746
-            'action' => 'category_list',
2747
-        ];
2748
-        $this->_redirect_after_action(0, '', '', $query_args);
2749
-    }
2750
-
2751
-
2752
-    /**
2753
-     * Handles deleting specific category.
2754
-     *
2755
-     * @param int $cat_id
2756
-     */
2757
-    protected function _delete_category($cat_id)
2758
-    {
2759
-        $cat_id = absint($cat_id);
2760
-        wp_delete_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2761
-    }
2762
-
2763
-
2764
-    /**
2765
-     * Handles triggering the update or insertion of a new category.
2766
-     *
2767
-     * @param bool $new_category true means we're triggering the insert of a new category.
2768
-     * @throws EE_Error
2769
-     * @throws InvalidArgumentException
2770
-     * @throws InvalidDataTypeException
2771
-     * @throws InvalidInterfaceException
2772
-     */
2773
-    protected function _insert_or_update_category($new_category)
2774
-    {
2775
-        $cat_id = $new_category ? $this->_insert_category() : $this->_insert_category(true);
2776
-        $success = 0; // we already have a success message so lets not send another.
2777
-        if ($cat_id) {
2778
-            $query_args = [
2779
-                'action'     => 'edit_category',
2780
-                'EVT_CAT_ID' => $cat_id,
2781
-            ];
2782
-        } else {
2783
-            $query_args = ['action' => 'add_category'];
2784
-        }
2785
-        $this->_redirect_after_action($success, '', '', $query_args, true);
2786
-    }
2787
-
2788
-
2789
-    /**
2790
-     * Inserts or updates category
2791
-     *
2792
-     * @param bool $update (true indicates we're updating a category).
2793
-     * @return bool|mixed|string
2794
-     */
2795
-    private function _insert_category($update = false)
2796
-    {
2797
-        $cat_id = $update ? $this->_req_data['EVT_CAT_ID'] : '';
2798
-        $category_name = isset($this->_req_data['category_name']) ? $this->_req_data['category_name'] : '';
2799
-        $category_desc = isset($this->_req_data['category_desc']) ? $this->_req_data['category_desc'] : '';
2800
-        $category_parent = isset($this->_req_data['category_parent']) ? $this->_req_data['category_parent'] : 0;
2801
-        if (empty($category_name)) {
2802
-            $msg = esc_html__('You must add a name for the category.', 'event_espresso');
2803
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2804
-            return false;
2805
-        }
2806
-        $term_args = [
2807
-            'name'        => $category_name,
2808
-            'description' => $category_desc,
2809
-            'parent'      => $category_parent,
2810
-        ];
2811
-        // was the category_identifier input disabled?
2812
-        if (isset($this->_req_data['category_identifier'])) {
2813
-            $term_args['slug'] = $this->_req_data['category_identifier'];
2814
-        }
2815
-        $insert_ids = $update
2816
-            ? wp_update_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args)
2817
-            : wp_insert_term($category_name, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args);
2818
-        if (! is_array($insert_ids)) {
2819
-            $msg = esc_html__(
2820
-                'An error occurred and the category has not been saved to the database.',
2821
-                'event_espresso'
2822
-            );
2823
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2824
-        } else {
2825
-            $cat_id = $insert_ids['term_id'];
2826
-            $msg = sprintf(esc_html__('The category %s was successfully saved', 'event_espresso'), $category_name);
2827
-            EE_Error::add_success($msg);
2828
-        }
2829
-        return $cat_id;
2830
-    }
2831
-
2832
-
2833
-    /**
2834
-     * Gets categories or count of categories matching the arguments in the request.
2835
-     *
2836
-     * @param int  $per_page
2837
-     * @param int  $current_page
2838
-     * @param bool $count
2839
-     * @return EE_Base_Class[]|EE_Term_Taxonomy[]|int
2840
-     * @throws EE_Error
2841
-     * @throws InvalidArgumentException
2842
-     * @throws InvalidDataTypeException
2843
-     * @throws InvalidInterfaceException
2844
-     */
2845
-    public function get_categories($per_page = 10, $current_page = 1, $count = false)
2846
-    {
2847
-        // testing term stuff
2848
-        $orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'Term.term_id';
2849
-        $order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
2850
-        $limit = ($current_page - 1) * $per_page;
2851
-        $where = ['taxonomy' => EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY];
2852
-        if (isset($this->_req_data['s'])) {
2853
-            $sstr = '%' . $this->_req_data['s'] . '%';
2854
-            $where['OR'] = [
2855
-                'Term.name'   => ['LIKE', $sstr],
2856
-                'description' => ['LIKE', $sstr],
2857
-            ];
2858
-        }
2859
-        $query_params = [
2860
-            $where,
2861
-            'order_by'   => [$orderby => $order],
2862
-            'limit'      => $limit . ',' . $per_page,
2863
-            'force_join' => ['Term'],
2864
-        ];
2865
-        $categories = $count
2866
-            ? EEM_Term_Taxonomy::instance()->count($query_params, 'term_id')
2867
-            : EEM_Term_Taxonomy::instance()->get_all($query_params);
2868
-        return $categories;
2869
-    }
2870
-
2871
-    /* end category stuff */
2872
-    /**************/
2873
-
2874
-
2875
-    /**
2876
-     * Callback for the `ee_save_timezone_setting` ajax action.
2877
-     *
2878
-     * @throws EE_Error
2879
-     * @throws InvalidArgumentException
2880
-     * @throws InvalidDataTypeException
2881
-     * @throws InvalidInterfaceException
2882
-     */
2883
-    public function save_timezonestring_setting()
2884
-    {
2885
-        $timezone_string = isset($this->_req_data['timezone_selected'])
2886
-            ? $this->_req_data['timezone_selected']
2887
-            : '';
2888
-        if (empty($timezone_string) || ! EEH_DTT_Helper::validate_timezone($timezone_string, false)) {
2889
-            EE_Error::add_error(
2890
-                esc_html__('An invalid timezone string submitted.', 'event_espresso'),
2891
-                __FILE__,
2892
-                __FUNCTION__,
2893
-                __LINE__
2894
-            );
2895
-            $this->_template_args['error'] = true;
2896
-            $this->_return_json();
2897
-        }
2898
-
2899
-        update_option('timezone_string', $timezone_string);
2900
-        EE_Error::add_success(
2901
-            esc_html__('Your timezone string was updated.', 'event_espresso')
2902
-        );
2903
-        $this->_template_args['success'] = true;
2904
-        $this->_return_json(true, ['action' => 'create_new']);
2905
-    }
19
+	/**
20
+	 * This will hold the event object for event_details screen.
21
+	 *
22
+	 * @access protected
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
+	 * Initialize page props for this admin page group.
52
+	 */
53
+	protected function _init_page_props()
54
+	{
55
+		$this->page_slug = EVENTS_PG_SLUG;
56
+		$this->page_label = EVENTS_LABEL;
57
+		$this->_admin_base_url = EVENTS_ADMIN_URL;
58
+		$this->_admin_base_path = EVENTS_ADMIN;
59
+		$this->_cpt_model_names = [
60
+			'create_new' => 'EEM_Event',
61
+			'edit'       => 'EEM_Event',
62
+		];
63
+		$this->_cpt_edit_routes = [
64
+			'espresso_events' => 'edit',
65
+		];
66
+		add_action(
67
+			'AHEE__EE_Admin_Page_CPT__set_model_object__after_set_object',
68
+			[$this, 'verify_event_edit'],
69
+			10,
70
+			2
71
+		);
72
+	}
73
+
74
+
75
+	/**
76
+	 * Sets the ajax hooks used for this admin page group.
77
+	 */
78
+	protected function _ajax_hooks()
79
+	{
80
+		add_action('wp_ajax_ee_save_timezone_setting', [$this, 'save_timezonestring_setting']);
81
+	}
82
+
83
+
84
+	/**
85
+	 * Sets the page properties for this admin page group.
86
+	 */
87
+	protected function _define_page_props()
88
+	{
89
+		$this->_admin_page_title = EVENTS_LABEL;
90
+		$this->_labels = [
91
+			'buttons'      => [
92
+				'add'             => esc_html__('Add New Event', 'event_espresso'),
93
+				'edit'            => esc_html__('Edit Event', 'event_espresso'),
94
+				'delete'          => esc_html__('Delete Event', 'event_espresso'),
95
+				'add_category'    => esc_html__('Add New Category', 'event_espresso'),
96
+				'edit_category'   => esc_html__('Edit Category', 'event_espresso'),
97
+				'delete_category' => esc_html__('Delete Category', 'event_espresso'),
98
+			],
99
+			'editor_title' => [
100
+				'espresso_events' => esc_html__('Enter event title here', 'event_espresso'),
101
+			],
102
+			'publishbox'   => [
103
+				'create_new'        => esc_html__('Save New Event', 'event_espresso'),
104
+				'edit'              => esc_html__('Update Event', 'event_espresso'),
105
+				'add_category'      => esc_html__('Save New Category', 'event_espresso'),
106
+				'edit_category'     => esc_html__('Update Category', 'event_espresso'),
107
+				'template_settings' => esc_html__('Update Settings', 'event_espresso'),
108
+			],
109
+		];
110
+	}
111
+
112
+
113
+	/**
114
+	 * Sets the page routes property for this admin page group.
115
+	 */
116
+	protected function _set_page_routes()
117
+	{
118
+		// load formatter helper
119
+		// load field generator helper
120
+		// is there a evt_id in the request?
121
+		$evt_id = ! empty($this->_req_data['EVT_ID']) && ! is_array($this->_req_data['EVT_ID'])
122
+			? $this->_req_data['EVT_ID']
123
+			: 0;
124
+		$evt_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $evt_id;
125
+		$this->_page_routes = [
126
+			'default'                       => [
127
+				'func'       => '_events_overview_list_table',
128
+				'capability' => 'ee_read_events',
129
+			],
130
+			'create_new'                    => [
131
+				'func'       => '_create_new_cpt_item',
132
+				'capability' => 'ee_edit_events',
133
+			],
134
+			'edit'                          => [
135
+				'func'       => '_edit_cpt_item',
136
+				'capability' => 'ee_edit_event',
137
+				'obj_id'     => $evt_id,
138
+			],
139
+			'copy_event'                    => [
140
+				'func'       => '_copy_events',
141
+				'capability' => 'ee_edit_event',
142
+				'obj_id'     => $evt_id,
143
+				'noheader'   => true,
144
+			],
145
+			'trash_event'                   => [
146
+				'func'       => '_trash_or_restore_event',
147
+				'args'       => ['event_status' => 'trash'],
148
+				'capability' => 'ee_delete_event',
149
+				'obj_id'     => $evt_id,
150
+				'noheader'   => true,
151
+			],
152
+			'trash_events'                  => [
153
+				'func'       => '_trash_or_restore_events',
154
+				'args'       => ['event_status' => 'trash'],
155
+				'capability' => 'ee_delete_events',
156
+				'noheader'   => true,
157
+			],
158
+			'restore_event'                 => [
159
+				'func'       => '_trash_or_restore_event',
160
+				'args'       => ['event_status' => 'draft'],
161
+				'capability' => 'ee_delete_event',
162
+				'obj_id'     => $evt_id,
163
+				'noheader'   => true,
164
+			],
165
+			'restore_events'                => [
166
+				'func'       => '_trash_or_restore_events',
167
+				'args'       => ['event_status' => 'draft'],
168
+				'capability' => 'ee_delete_events',
169
+				'noheader'   => true,
170
+			],
171
+			'delete_event'                  => [
172
+				'func'       => '_delete_event',
173
+				'capability' => 'ee_delete_event',
174
+				'obj_id'     => $evt_id,
175
+				'noheader'   => true,
176
+			],
177
+			'delete_events'                 => [
178
+				'func'       => '_delete_events',
179
+				'capability' => 'ee_delete_events',
180
+				'noheader'   => true,
181
+			],
182
+			'view_report'                   => [
183
+				'func'       => '_view_report',
184
+				'capability' => 'ee_edit_events',
185
+			],
186
+			'default_event_settings'        => [
187
+				'func'       => '_default_event_settings',
188
+				'capability' => 'manage_options',
189
+			],
190
+			'update_default_event_settings' => [
191
+				'func'       => '_update_default_event_settings',
192
+				'capability' => 'manage_options',
193
+				'noheader'   => true,
194
+			],
195
+			'template_settings'             => [
196
+				'func'       => '_template_settings',
197
+				'capability' => 'manage_options',
198
+			],
199
+			// event category tab related
200
+			'add_category'                  => [
201
+				'func'       => '_category_details',
202
+				'capability' => 'ee_edit_event_category',
203
+				'args'       => ['add'],
204
+			],
205
+			'edit_category'                 => [
206
+				'func'       => '_category_details',
207
+				'capability' => 'ee_edit_event_category',
208
+				'args'       => ['edit'],
209
+			],
210
+			'delete_categories'             => [
211
+				'func'       => '_delete_categories',
212
+				'capability' => 'ee_delete_event_category',
213
+				'noheader'   => true,
214
+			],
215
+			'delete_category'               => [
216
+				'func'       => '_delete_categories',
217
+				'capability' => 'ee_delete_event_category',
218
+				'noheader'   => true,
219
+			],
220
+			'insert_category'               => [
221
+				'func'       => '_insert_or_update_category',
222
+				'args'       => ['new_category' => true],
223
+				'capability' => 'ee_edit_event_category',
224
+				'noheader'   => true,
225
+			],
226
+			'update_category'               => [
227
+				'func'       => '_insert_or_update_category',
228
+				'args'       => ['new_category' => false],
229
+				'capability' => 'ee_edit_event_category',
230
+				'noheader'   => true,
231
+			],
232
+			'category_list'                 => [
233
+				'func'       => '_category_list_table',
234
+				'capability' => 'ee_manage_event_categories',
235
+			],
236
+		];
237
+	}
238
+
239
+
240
+	/**
241
+	 * Set the _page_config property for this admin page group.
242
+	 */
243
+	protected function _set_page_config()
244
+	{
245
+		$this->_page_config = [
246
+			'default'                => [
247
+				'nav'           => [
248
+					'label' => esc_html__('Overview', 'event_espresso'),
249
+					'order' => 10,
250
+				],
251
+				'list_table'    => 'Events_Admin_List_Table',
252
+				'help_tabs'     => [
253
+					'events_overview_help_tab'                       => [
254
+						'title'    => esc_html__('Events Overview', 'event_espresso'),
255
+						'filename' => 'events_overview',
256
+					],
257
+					'events_overview_table_column_headings_help_tab' => [
258
+						'title'    => esc_html__('Events Overview Table Column Headings', 'event_espresso'),
259
+						'filename' => 'events_overview_table_column_headings',
260
+					],
261
+					'events_overview_filters_help_tab'               => [
262
+						'title'    => esc_html__('Events Overview Filters', 'event_espresso'),
263
+						'filename' => 'events_overview_filters',
264
+					],
265
+					'events_overview_view_help_tab'                  => [
266
+						'title'    => esc_html__('Events Overview Views', 'event_espresso'),
267
+						'filename' => 'events_overview_views',
268
+					],
269
+					'events_overview_other_help_tab'                 => [
270
+						'title'    => esc_html__('Events Overview Other', 'event_espresso'),
271
+						'filename' => 'events_overview_other',
272
+					],
273
+				],
274
+				'help_tour'     => [
275
+					'Event_Overview_Help_Tour',
276
+					// 'New_Features_Test_Help_Tour' for testing multiple help tour
277
+				],
278
+				'require_nonce' => false,
279
+				'qtips'         => ['EE_Event_List_Table_Tips'],
280
+			],
281
+			'create_new'             => [
282
+				'nav'           => [
283
+					'label'      => esc_html__('Add Event', 'event_espresso'),
284
+					'order'      => 5,
285
+					'persistent' => false,
286
+				],
287
+				'metaboxes'     => ['_register_event_editor_meta_boxes'],
288
+				'help_tabs'     => [
289
+					'event_editor_help_tab'                            => [
290
+						'title'    => esc_html__('Event Editor', 'event_espresso'),
291
+						'filename' => 'event_editor',
292
+					],
293
+					'event_editor_title_richtexteditor_help_tab'       => [
294
+						'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
295
+						'filename' => 'event_editor_title_richtexteditor',
296
+					],
297
+					'event_editor_venue_details_help_tab'              => [
298
+						'title'    => esc_html__('Event Venue Details', 'event_espresso'),
299
+						'filename' => 'event_editor_venue_details',
300
+					],
301
+					'event_editor_event_datetimes_help_tab'            => [
302
+						'title'    => esc_html__('Event Datetimes', 'event_espresso'),
303
+						'filename' => 'event_editor_event_datetimes',
304
+					],
305
+					'event_editor_event_tickets_help_tab'              => [
306
+						'title'    => esc_html__('Event Tickets', 'event_espresso'),
307
+						'filename' => 'event_editor_event_tickets',
308
+					],
309
+					'event_editor_event_registration_options_help_tab' => [
310
+						'title'    => esc_html__('Event Registration Options', 'event_espresso'),
311
+						'filename' => 'event_editor_event_registration_options',
312
+					],
313
+					'event_editor_tags_categories_help_tab'            => [
314
+						'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
315
+						'filename' => 'event_editor_tags_categories',
316
+					],
317
+					'event_editor_questions_registrants_help_tab'      => [
318
+						'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
319
+						'filename' => 'event_editor_questions_registrants',
320
+					],
321
+					'event_editor_save_new_event_help_tab'             => [
322
+						'title'    => esc_html__('Save New Event', 'event_espresso'),
323
+						'filename' => 'event_editor_save_new_event',
324
+					],
325
+					'event_editor_other_help_tab'                      => [
326
+						'title'    => esc_html__('Event Other', 'event_espresso'),
327
+						'filename' => 'event_editor_other',
328
+					],
329
+				],
330
+				'help_tour'     => [
331
+					'Event_Editor_Help_Tour',
332
+				],
333
+				'require_nonce' => false,
334
+			],
335
+			'edit'                   => [
336
+				'nav'           => [
337
+					'label'      => esc_html__('Edit Event', 'event_espresso'),
338
+					'order'      => 5,
339
+					'persistent' => false,
340
+					'url'        => isset($this->_req_data['post'])
341
+						? EE_Admin_Page::add_query_args_and_nonce(
342
+							['post' => $this->_req_data['post'], 'action' => 'edit'],
343
+							$this->_current_page_view_url
344
+						)
345
+						: $this->_admin_base_url,
346
+				],
347
+				'metaboxes'     => ['_register_event_editor_meta_boxes'],
348
+				'help_tabs'     => [
349
+					'event_editor_help_tab'                            => [
350
+						'title'    => esc_html__('Event Editor', 'event_espresso'),
351
+						'filename' => 'event_editor',
352
+					],
353
+					'event_editor_title_richtexteditor_help_tab'       => [
354
+						'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
355
+						'filename' => 'event_editor_title_richtexteditor',
356
+					],
357
+					'event_editor_venue_details_help_tab'              => [
358
+						'title'    => esc_html__('Event Venue Details', 'event_espresso'),
359
+						'filename' => 'event_editor_venue_details',
360
+					],
361
+					'event_editor_event_datetimes_help_tab'            => [
362
+						'title'    => esc_html__('Event Datetimes', 'event_espresso'),
363
+						'filename' => 'event_editor_event_datetimes',
364
+					],
365
+					'event_editor_event_tickets_help_tab'              => [
366
+						'title'    => esc_html__('Event Tickets', 'event_espresso'),
367
+						'filename' => 'event_editor_event_tickets',
368
+					],
369
+					'event_editor_event_registration_options_help_tab' => [
370
+						'title'    => esc_html__('Event Registration Options', 'event_espresso'),
371
+						'filename' => 'event_editor_event_registration_options',
372
+					],
373
+					'event_editor_tags_categories_help_tab'            => [
374
+						'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
375
+						'filename' => 'event_editor_tags_categories',
376
+					],
377
+					'event_editor_questions_registrants_help_tab'      => [
378
+						'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
379
+						'filename' => 'event_editor_questions_registrants',
380
+					],
381
+					'event_editor_save_new_event_help_tab'             => [
382
+						'title'    => esc_html__('Save New Event', 'event_espresso'),
383
+						'filename' => 'event_editor_save_new_event',
384
+					],
385
+					'event_editor_other_help_tab'                      => [
386
+						'title'    => esc_html__('Event Other', 'event_espresso'),
387
+						'filename' => 'event_editor_other',
388
+					],
389
+				],
390
+				'require_nonce' => false,
391
+			],
392
+			'default_event_settings' => [
393
+				'nav'           => [
394
+					'label' => esc_html__('Default Settings', 'event_espresso'),
395
+					'order' => 40,
396
+				],
397
+				'metaboxes'     => array_merge($this->_default_espresso_metaboxes, ['_publish_post_box']),
398
+				'labels'        => [
399
+					'publishbox' => esc_html__('Update Settings', 'event_espresso'),
400
+				],
401
+				'help_tabs'     => [
402
+					'default_settings_help_tab'        => [
403
+						'title'    => esc_html__('Default Event Settings', 'event_espresso'),
404
+						'filename' => 'events_default_settings',
405
+					],
406
+					'default_settings_status_help_tab' => [
407
+						'title'    => esc_html__('Default Registration Status', 'event_espresso'),
408
+						'filename' => 'events_default_settings_status',
409
+					],
410
+					'default_maximum_tickets_help_tab' => [
411
+						'title'    => esc_html__('Default Maximum Tickets Per Order', 'event_espresso'),
412
+						'filename' => 'events_default_settings_max_tickets',
413
+					],
414
+				],
415
+				'help_tour'     => ['Event_Default_Settings_Help_Tour'],
416
+				'require_nonce' => false,
417
+			],
418
+			// template settings
419
+			'template_settings'      => [
420
+				'nav'           => [
421
+					'label' => esc_html__('Templates', 'event_espresso'),
422
+					'order' => 30,
423
+				],
424
+				'metaboxes'     => $this->_default_espresso_metaboxes,
425
+				'help_tabs'     => [
426
+					'general_settings_templates_help_tab' => [
427
+						'title'    => esc_html__('Templates', 'event_espresso'),
428
+						'filename' => 'general_settings_templates',
429
+					],
430
+				],
431
+				'help_tour'     => ['Templates_Help_Tour'],
432
+				'require_nonce' => false,
433
+			],
434
+			// event category stuff
435
+			'add_category'           => [
436
+				'nav'           => [
437
+					'label'      => esc_html__('Add Category', 'event_espresso'),
438
+					'order'      => 15,
439
+					'persistent' => false,
440
+				],
441
+				'help_tabs'     => [
442
+					'add_category_help_tab' => [
443
+						'title'    => esc_html__('Add New Event Category', 'event_espresso'),
444
+						'filename' => 'events_add_category',
445
+					],
446
+				],
447
+				'help_tour'     => ['Event_Add_Category_Help_Tour'],
448
+				'metaboxes'     => ['_publish_post_box'],
449
+				'require_nonce' => false,
450
+			],
451
+			'edit_category'          => [
452
+				'nav'           => [
453
+					'label'      => esc_html__('Edit Category', 'event_espresso'),
454
+					'order'      => 15,
455
+					'persistent' => false,
456
+					'url'        => isset($this->_req_data['EVT_CAT_ID'])
457
+						? add_query_arg(
458
+							['EVT_CAT_ID' => $this->_req_data['EVT_CAT_ID']],
459
+							$this->_current_page_view_url
460
+						)
461
+						: $this->_admin_base_url,
462
+				],
463
+				'help_tabs'     => [
464
+					'edit_category_help_tab' => [
465
+						'title'    => esc_html__('Edit Event Category', 'event_espresso'),
466
+						'filename' => 'events_edit_category',
467
+					],
468
+				],
469
+				/*'help_tour' => array('Event_Edit_Category_Help_Tour'),*/
470
+				'metaboxes'     => ['_publish_post_box'],
471
+				'require_nonce' => false,
472
+			],
473
+			'category_list'          => [
474
+				'nav'           => [
475
+					'label' => esc_html__('Categories', 'event_espresso'),
476
+					'order' => 20,
477
+				],
478
+				'list_table'    => 'Event_Categories_Admin_List_Table',
479
+				'help_tabs'     => [
480
+					'events_categories_help_tab'                       => [
481
+						'title'    => esc_html__('Event Categories', 'event_espresso'),
482
+						'filename' => 'events_categories',
483
+					],
484
+					'events_categories_table_column_headings_help_tab' => [
485
+						'title'    => esc_html__('Event Categories Table Column Headings', 'event_espresso'),
486
+						'filename' => 'events_categories_table_column_headings',
487
+					],
488
+					'events_categories_view_help_tab'                  => [
489
+						'title'    => esc_html__('Event Categories Views', 'event_espresso'),
490
+						'filename' => 'events_categories_views',
491
+					],
492
+					'events_categories_other_help_tab'                 => [
493
+						'title'    => esc_html__('Event Categories Other', 'event_espresso'),
494
+						'filename' => 'events_categories_other',
495
+					],
496
+				],
497
+				'help_tour'     => [
498
+					'Event_Categories_Help_Tour',
499
+				],
500
+				'metaboxes'     => $this->_default_espresso_metaboxes,
501
+				'require_nonce' => false,
502
+			],
503
+		];
504
+		// only load EE_Event_Editor_Decaf_Tips if domain is not caffeinated
505
+		$domain = $this->loader->getShared('EventEspresso\core\domain\Domain');
506
+		if (! $domain->isCaffeinated()) {
507
+			$this->_page_config['create_new']['qtips'] = ['EE_Event_Editor_Decaf_Tips'];
508
+			$this->_page_config['edit']['qtips'] = ['EE_Event_Editor_Decaf_Tips'];
509
+		}
510
+	}
511
+
512
+
513
+	/**
514
+	 * Used to register any global screen options if necessary for every route in this admin page group.
515
+	 */
516
+	protected function _add_screen_options()
517
+	{
518
+	}
519
+
520
+
521
+	/**
522
+	 * Implementing the screen options for the 'default' route.
523
+	 *
524
+	 * @throws InvalidArgumentException
525
+	 * @throws InvalidDataTypeException
526
+	 * @throws InvalidInterfaceException
527
+	 */
528
+	protected function _add_screen_options_default()
529
+	{
530
+		$this->_per_page_screen_option();
531
+	}
532
+
533
+
534
+	/**
535
+	 * Implementing screen options for the category list route.
536
+	 *
537
+	 * @throws InvalidArgumentException
538
+	 * @throws InvalidDataTypeException
539
+	 * @throws InvalidInterfaceException
540
+	 */
541
+	protected function _add_screen_options_category_list()
542
+	{
543
+		$page_title = $this->_admin_page_title;
544
+		$this->_admin_page_title = esc_html__('Categories', 'event_espresso');
545
+		$this->_per_page_screen_option();
546
+		$this->_admin_page_title = $page_title;
547
+	}
548
+
549
+
550
+	/**
551
+	 * Used to register any global feature pointers for the admin page group.
552
+	 */
553
+	protected function _add_feature_pointers()
554
+	{
555
+	}
556
+
557
+
558
+	/**
559
+	 * Registers and enqueues any global scripts and styles for the entire admin page group.
560
+	 */
561
+	public function load_scripts_styles()
562
+	{
563
+		wp_register_style(
564
+			'events-admin-css',
565
+			EVENTS_ASSETS_URL . 'events-admin-page.css',
566
+			[],
567
+			EVENT_ESPRESSO_VERSION
568
+		);
569
+		wp_register_style(
570
+			'ee-cat-admin',
571
+			EVENTS_ASSETS_URL . 'ee-cat-admin.css',
572
+			[],
573
+			EVENT_ESPRESSO_VERSION
574
+		);
575
+		wp_enqueue_style('events-admin-css');
576
+		wp_enqueue_style('ee-cat-admin');
577
+		// scripts
578
+		wp_register_script(
579
+			'event_editor_js',
580
+			EVENTS_ASSETS_URL . 'event_editor.js',
581
+			['ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon'],
582
+			EVENT_ESPRESSO_VERSION,
583
+			true
584
+		);
585
+	}
586
+
587
+
588
+	/**
589
+	 * Enqueuing scripts and styles specific to this view
590
+	 */
591
+	public function load_scripts_styles_create_new()
592
+	{
593
+		$this->load_scripts_styles_edit();
594
+	}
595
+
596
+
597
+	/**
598
+	 * Enqueuing scripts and styles specific to this view
599
+	 */
600
+	public function load_scripts_styles_edit()
601
+	{
602
+		// styles
603
+		wp_enqueue_style('espresso-ui-theme');
604
+		wp_register_style(
605
+			'event-editor-css',
606
+			EVENTS_ASSETS_URL . 'event-editor.css',
607
+			['ee-admin-css'],
608
+			EVENT_ESPRESSO_VERSION
609
+		);
610
+		wp_enqueue_style('event-editor-css');
611
+		// scripts
612
+		if (! $this->admin_config->useAdvancedEditor()) {
613
+			wp_register_script(
614
+				'event-datetime-metabox',
615
+				EVENTS_ASSETS_URL . 'event-datetime-metabox.js',
616
+				['event_editor_js', 'ee-datepicker'],
617
+				EVENT_ESPRESSO_VERSION
618
+			);
619
+			wp_enqueue_script('event-datetime-metabox');
620
+		}
621
+	}
622
+
623
+
624
+	/**
625
+	 * Populating the _views property for the category list table view.
626
+	 */
627
+	protected function _set_list_table_views_category_list()
628
+	{
629
+		$this->_views = [
630
+			'all' => [
631
+				'slug'        => 'all',
632
+				'label'       => esc_html__('All', 'event_espresso'),
633
+				'count'       => 0,
634
+				'bulk_action' => [
635
+					'delete_categories' => esc_html__('Delete Permanently', 'event_espresso'),
636
+				],
637
+			],
638
+		];
639
+	}
640
+
641
+
642
+	/**
643
+	 * For adding anything that fires on the admin_init hook for any route within this admin page group.
644
+	 */
645
+	public function admin_init()
646
+	{
647
+		EE_Registry::$i18n_js_strings['image_confirm'] = esc_html__(
648
+			'Do you really want to delete this image? Please remember to update your event to complete the removal.',
649
+			'event_espresso'
650
+		);
651
+	}
652
+
653
+
654
+	/**
655
+	 * For adding anything that should be triggered on the admin_notices hook for any route within this admin page
656
+	 * group.
657
+	 */
658
+	public function admin_notices()
659
+	{
660
+	}
661
+
662
+
663
+	/**
664
+	 * For adding anything that should be triggered on the `admin_print_footer_scripts` hook for any route within
665
+	 * this admin page group.
666
+	 */
667
+	public function admin_footer_scripts()
668
+	{
669
+	}
670
+
671
+
672
+	/**
673
+	 * Call this function to verify if an event is public and has tickets for sale.  If it does, then we need to show a
674
+	 * warning (via EE_Error::add_error());
675
+	 *
676
+	 * @param EE_Event $event Event object
677
+	 * @param string   $req_type
678
+	 * @return void
679
+	 * @throws EE_Error
680
+	 * @access public
681
+	 */
682
+	public function verify_event_edit($event = null, $req_type = '')
683
+	{
684
+		// don't need to do this when processing
685
+		if (! empty($req_type)) {
686
+			return;
687
+		}
688
+		// no event?
689
+		if (! $event instanceof EE_Event) {
690
+			$event = $this->_cpt_model_obj;
691
+		}
692
+		// STILL no event?
693
+		if (! $event instanceof EE_Event) {
694
+			return;
695
+		}
696
+		$orig_status = $event->status();
697
+		// first check if event is active.
698
+		if ($orig_status === EEM_Event::cancelled
699
+			|| $orig_status === EEM_Event::postponed
700
+			|| $event->is_expired()
701
+			|| $event->is_inactive()
702
+		) {
703
+			return;
704
+		}
705
+		// made it here so it IS active... next check that any of the tickets are sold.
706
+		if ($event->is_sold_out(true)) {
707
+			if ($orig_status !== EEM_Event::sold_out && $event->status() !== $orig_status) {
708
+				EE_Error::add_attention(
709
+					sprintf(
710
+						esc_html__(
711
+							'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.',
712
+							'event_espresso'
713
+						),
714
+						EEH_Template::pretty_status(EEM_Event::sold_out, false, 'sentence')
715
+					)
716
+				);
717
+			}
718
+			return;
719
+		}
720
+		if ($orig_status === EEM_Event::sold_out) {
721
+			EE_Error::add_attention(
722
+				sprintf(
723
+					esc_html__(
724
+						'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.',
725
+						'event_espresso'
726
+					),
727
+					EEH_Template::pretty_status($event->status(), false, 'sentence')
728
+				)
729
+			);
730
+		}
731
+		// now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
732
+		if (! $event->tickets_on_sale()) {
733
+			return;
734
+		}
735
+		// made it here so show warning
736
+		$this->_edit_event_warning();
737
+	}
738
+
739
+
740
+	/**
741
+	 * This is the text used for when an event is being edited that is public and has tickets for sale.
742
+	 * When needed, hook this into a EE_Error::add_error() notice.
743
+	 *
744
+	 * @access protected
745
+	 * @return void
746
+	 */
747
+	protected function _edit_event_warning()
748
+	{
749
+		// we don't want to add warnings during these requests
750
+		if (isset($this->_req_data['action']) && $this->_req_data['action'] === 'editpost') {
751
+			return;
752
+		}
753
+		EE_Error::add_attention(
754
+			sprintf(
755
+				esc_html__(
756
+					'Your event is open for registration. Making changes may disrupt any transactions in progress. %sLearn more%s',
757
+					'event_espresso'
758
+				),
759
+				'<a class="espresso-help-tab-lnk">',
760
+				'</a>'
761
+			)
762
+		);
763
+	}
764
+
765
+
766
+	/**
767
+	 * When a user is creating a new event, notify them if they haven't set their timezone.
768
+	 * Otherwise, do the normal logic
769
+	 *
770
+	 * @return string
771
+	 * @throws EE_Error
772
+	 * @throws InvalidArgumentException
773
+	 * @throws InvalidDataTypeException
774
+	 * @throws InvalidInterfaceException
775
+	 */
776
+	protected function _create_new_cpt_item()
777
+	{
778
+		$has_timezone_string = get_option('timezone_string');
779
+		// only nag them about setting their timezone if it's their first event, and they haven't already done it
780
+		if (! $has_timezone_string && ! EEM_Event::instance()->exists([])) {
781
+			EE_Error::add_attention(
782
+				sprintf(
783
+					__(
784
+						'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',
785
+						'event_espresso'
786
+					),
787
+					'<br>',
788
+					'<select id="timezone_string" name="timezone_string" aria-describedby="timezone-description">'
789
+					. EEH_DTT_Helper::wp_timezone_choice('', EEH_DTT_Helper::get_user_locale())
790
+					. '</select>',
791
+					'<button class="button button-secondary timezone-submit">',
792
+					'</button><span class="spinner"></span>'
793
+				),
794
+				__FILE__,
795
+				__FUNCTION__,
796
+				__LINE__
797
+			);
798
+		}
799
+		parent::_create_new_cpt_item();
800
+	}
801
+
802
+
803
+	/**
804
+	 * Sets the _views property for the default route in this admin page group.
805
+	 */
806
+	protected function _set_list_table_views_default()
807
+	{
808
+		$this->_views = [
809
+			'all'   => [
810
+				'slug'        => 'all',
811
+				'label'       => esc_html__('View All Events', 'event_espresso'),
812
+				'count'       => 0,
813
+				'bulk_action' => [
814
+					'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
815
+				],
816
+			],
817
+			'draft' => [
818
+				'slug'        => 'draft',
819
+				'label'       => esc_html__('Draft', 'event_espresso'),
820
+				'count'       => 0,
821
+				'bulk_action' => [
822
+					'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
823
+				],
824
+			],
825
+		];
826
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
827
+			$this->_views['trash'] = [
828
+				'slug'        => 'trash',
829
+				'label'       => esc_html__('Trash', 'event_espresso'),
830
+				'count'       => 0,
831
+				'bulk_action' => [
832
+					'restore_events' => esc_html__('Restore From Trash', 'event_espresso'),
833
+					'delete_events'  => esc_html__('Delete Permanently', 'event_espresso'),
834
+				],
835
+			];
836
+		}
837
+	}
838
+
839
+
840
+	/**
841
+	 * Provides the legend item array for the default list table view.
842
+	 *
843
+	 * @return array
844
+	 */
845
+	protected function _event_legend_items()
846
+	{
847
+		$items = [
848
+			'view_details'   => [
849
+				'class' => 'dashicons dashicons-search',
850
+				'desc'  => esc_html__('View Event', 'event_espresso'),
851
+			],
852
+			'edit_event'     => [
853
+				'class' => 'ee-icon ee-icon-calendar-edit',
854
+				'desc'  => esc_html__('Edit Event Details', 'event_espresso'),
855
+			],
856
+			'view_attendees' => [
857
+				'class' => 'dashicons dashicons-groups',
858
+				'desc'  => esc_html__('View Registrations for Event', 'event_espresso'),
859
+			],
860
+		];
861
+		$items = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items);
862
+		$statuses = [
863
+			'sold_out_status'  => [
864
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out,
865
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::sold_out, false, 'sentence'),
866
+			],
867
+			'active_status'    => [
868
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active,
869
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::active, false, 'sentence'),
870
+			],
871
+			'upcoming_status'  => [
872
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming,
873
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::upcoming, false, 'sentence'),
874
+			],
875
+			'postponed_status' => [
876
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed,
877
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::postponed, false, 'sentence'),
878
+			],
879
+			'cancelled_status' => [
880
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled,
881
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::cancelled, false, 'sentence'),
882
+			],
883
+			'expired_status'   => [
884
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired,
885
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::expired, false, 'sentence'),
886
+			],
887
+			'inactive_status'  => [
888
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive,
889
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::inactive, false, 'sentence'),
890
+			],
891
+		];
892
+		$statuses = apply_filters('FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses);
893
+		return array_merge($items, $statuses);
894
+	}
895
+
896
+
897
+	/**
898
+	 * @return EEM_Event
899
+	 * @throws EE_Error
900
+	 * @throws InvalidArgumentException
901
+	 * @throws InvalidDataTypeException
902
+	 * @throws InvalidInterfaceException
903
+	 * @throws ReflectionException
904
+	 */
905
+	private function _event_model()
906
+	{
907
+		if (! $this->_event_model instanceof EEM_Event) {
908
+			$this->_event_model = EE_Registry::instance()->load_model('Event');
909
+		}
910
+		return $this->_event_model;
911
+	}
912
+
913
+
914
+	/**
915
+	 * Adds extra buttons to the WP CPT permalink field row.
916
+	 * Method is called from parent and is hooked into the wp 'get_sample_permalink_html' filter.
917
+	 *
918
+	 * @param string $return    the current html
919
+	 * @param int    $id        the post id for the page
920
+	 * @param string $new_title What the title is
921
+	 * @param string $new_slug  what the slug is
922
+	 * @return string            The new html string for the permalink area
923
+	 */
924
+	public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug)
925
+	{
926
+		// make sure this is only when editing
927
+		if (! empty($id)) {
928
+			$post = get_post($id);
929
+			$return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'
930
+					   . esc_html__('Shortcode', 'event_espresso')
931
+					   . '</a> ';
932
+			$return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id='
933
+					   . $post->ID
934
+					   . ']">';
935
+		}
936
+		return $return;
937
+	}
938
+
939
+
940
+	/**
941
+	 * _events_overview_list_table
942
+	 * This contains the logic for showing the events_overview list
943
+	 *
944
+	 * @access protected
945
+	 * @return void
946
+	 * @throws DomainException
947
+	 * @throws EE_Error
948
+	 * @throws InvalidArgumentException
949
+	 * @throws InvalidDataTypeException
950
+	 * @throws InvalidInterfaceException
951
+	 */
952
+	protected function _events_overview_list_table()
953
+	{
954
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
955
+		$this->_template_args['after_list_table'] = ! empty($this->_template_args['after_list_table'])
956
+			? (array) $this->_template_args['after_list_table']
957
+			: [];
958
+		$this->_template_args['after_list_table']['view_event_list_button'] = EEH_HTML::br()
959
+																			  . EEH_Template::get_button_or_link(
960
+																				  get_post_type_archive_link('espresso_events'),
961
+																				  esc_html__('View Event Archive Page', 'event_espresso'),
962
+																				  'button'
963
+																			  );
964
+		$this->_template_args['after_list_table']['legend'] = $this->_display_legend($this->_event_legend_items());
965
+		$this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
966
+			'create_new',
967
+			'add',
968
+			[],
969
+			'add-new-h2'
970
+		);
971
+		$this->display_admin_list_table_page_with_no_sidebar();
972
+	}
973
+
974
+
975
+	/**
976
+	 * this allows for extra misc actions in the default WP publish box
977
+	 *
978
+	 * @return void
979
+	 * @throws DomainException
980
+	 * @throws EE_Error
981
+	 * @throws InvalidArgumentException
982
+	 * @throws InvalidDataTypeException
983
+	 * @throws InvalidInterfaceException
984
+	 * @throws ReflectionException
985
+	 */
986
+	public function extra_misc_actions_publish_box()
987
+	{
988
+		$this->_generate_publish_box_extra_content();
989
+	}
990
+
991
+
992
+	/**
993
+	 * This is hooked into the WordPress do_action('save_post') hook and runs after the custom post type has been
994
+	 * saved.
995
+	 * Typically you would use this to save any additional data.
996
+	 * Keep in mind also that "save_post" runs on EVERY post update to the database.
997
+	 * ALSO very important.  When a post transitions from scheduled to published,
998
+	 * the save_post action is fired but you will NOT have any _POST data containing any extra info you may have from
999
+	 * other meta saves. So MAKE sure that you handle this accordingly.
1000
+	 *
1001
+	 * @access protected
1002
+	 * @abstract
1003
+	 * @param string $post_id The ID of the cpt that was saved (so you can link relationally)
1004
+	 * @param object $post    The post object of the cpt that was saved.
1005
+	 * @return void
1006
+	 * @throws EE_Error
1007
+	 * @throws InvalidArgumentException
1008
+	 * @throws InvalidDataTypeException
1009
+	 * @throws InvalidInterfaceException
1010
+	 * @throws ReflectionException
1011
+	 */
1012
+	protected function _insert_update_cpt_item($post_id, $post)
1013
+	{
1014
+		if ($post instanceof WP_Post && $post->post_type !== 'espresso_events') {
1015
+			// get out we're not processing an event save.
1016
+			return;
1017
+		}
1018
+		$event_values = [
1019
+			'EVT_member_only'     => ! empty($this->_req_data['member_only']) ? 1 : 0,
1020
+			'EVT_allow_overflow'  => ! empty($this->_req_data['EVT_allow_overflow']) ? 1 : 0,
1021
+			'EVT_timezone_string' => ! empty($this->_req_data['timezone_string'])
1022
+				? sanitize_text_field($this->_req_data['timezone_string'])
1023
+				: null,
1024
+		];
1025
+		/** @var FeatureFlags $flags */
1026
+		$flags = $this->loader->getShared('EventEspresso\core\domain\services\capabilities\FeatureFlags');
1027
+		// check if the new EDTR reg options meta box is being used, and if so, don't run updates for legacy version
1028
+		if (! $this->admin_config->useAdvancedEditor() || ! $flags->featureAllowed('use_reg_options_meta_box')) {
1029
+			$event_values['EVT_display_ticket_selector'] =
1030
+				! empty($this->_req_data['display_ticket_selector'])
1031
+					? 1
1032
+					: 0;
1033
+			$event_values['EVT_additional_limit'] = min(
1034
+				apply_filters('FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255),
1035
+				! empty($this->_req_data['additional_limit'])
1036
+					? absint($this->_req_data['additional_limit'])
1037
+					: null
1038
+			);
1039
+			$event_values['EVT_default_registration_status'] =
1040
+				! empty($this->_req_data['EVT_default_registration_status'])
1041
+					? sanitize_text_field($this->_req_data['EVT_default_registration_status'])
1042
+					: EE_Registry::instance()->CFG->registration->default_STS_ID;
1043
+			$event_values['EVT_external_URL'] = ! empty($this->_req_data['externalURL'])
1044
+				? esc_url_raw($this->_req_data['externalURL'])
1045
+				: null;
1046
+			$event_values['EVT_phone'] = ! empty($this->_req_data['event_phone'])
1047
+				? sanitize_text_field($this->_req_data['event_phone'])
1048
+				: null;
1049
+		}
1050
+		// update event
1051
+		$success = $this->_event_model()->update_by_ID($event_values, $post_id);
1052
+		// get event_object for other metaboxes... though it would seem to make sense to just use $this->_event_model()->get_one_by_ID( $post_id ).. i have to setup where conditions to override the filters in the model that filter out autodraft and inherit statuses so we GET the inherit id!
1053
+		$get_one_where = [
1054
+			$this->_event_model()->primary_key_name() => $post_id,
1055
+			'OR'                                      => [
1056
+				'status'   => $post->post_status,
1057
+				// if trying to "Publish" a sold out event, it's status will get switched back to "sold_out" in the db,
1058
+				// but the returned object here has a status of "publish", so use the original post status as well
1059
+				'status*1' => $this->_req_data['original_post_status'],
1060
+			],
1061
+		];
1062
+		$event = $this->_event_model()->get_one([$get_one_where]);
1063
+		// the following are default callbacks for event attachment updates that can be overridden by caffeinated functionality and/or addons.
1064
+		$event_update_callbacks = apply_filters(
1065
+			'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks',
1066
+			[
1067
+				[$this, '_default_venue_update'],
1068
+				[$this, '_default_tickets_update'],
1069
+			]
1070
+		);
1071
+		$att_success = true;
1072
+		foreach ($event_update_callbacks as $e_callback) {
1073
+			$_success = is_callable($e_callback)
1074
+				? $e_callback($event, $this->_req_data)
1075
+				: false;
1076
+			// if ANY of these updates fail then we want the appropriate global error message
1077
+			$att_success = ! $att_success ? $att_success : $_success;
1078
+		}
1079
+		// any errors?
1080
+		if ($success && false === $att_success) {
1081
+			EE_Error::add_error(
1082
+				esc_html__(
1083
+					'Event Details saved successfully but something went wrong with saving attachments.',
1084
+					'event_espresso'
1085
+				),
1086
+				__FILE__,
1087
+				__FUNCTION__,
1088
+				__LINE__
1089
+			);
1090
+		} elseif ($success === false) {
1091
+			EE_Error::add_error(
1092
+				esc_html__('Event Details did not save successfully.', 'event_espresso'),
1093
+				__FILE__,
1094
+				__FUNCTION__,
1095
+				__LINE__
1096
+			);
1097
+		}
1098
+	}
1099
+
1100
+
1101
+	/**
1102
+	 * @param int $post_id
1103
+	 * @param int $revision_id
1104
+	 * @throws EE_Error
1105
+	 * @throws InvalidArgumentException
1106
+	 * @throws InvalidDataTypeException
1107
+	 * @throws InvalidInterfaceException
1108
+	 * @throws ReflectionException
1109
+	 * @see parent::restore_item()
1110
+	 */
1111
+	protected function _restore_cpt_item($post_id, $revision_id)
1112
+	{
1113
+		// copy existing event meta to new post
1114
+		$post_evt = $this->_event_model()->get_one_by_ID($post_id);
1115
+		if ($post_evt instanceof EE_Event) {
1116
+			// meta revision restore
1117
+			$post_evt->restore_revision($revision_id);
1118
+			// related objs restore
1119
+			$post_evt->restore_revision($revision_id, ['Venue', 'Datetime', 'Price']);
1120
+		}
1121
+	}
1122
+
1123
+
1124
+	/**
1125
+	 * Attach the venue to the Event
1126
+	 *
1127
+	 * @param EE_Event $evtobj Event Object to add the venue to
1128
+	 * @param array    $data   The request data from the form
1129
+	 * @return bool           Success or fail.
1130
+	 * @throws EE_Error
1131
+	 * @throws InvalidArgumentException
1132
+	 * @throws InvalidDataTypeException
1133
+	 * @throws InvalidInterfaceException
1134
+	 * @throws ReflectionException
1135
+	 */
1136
+	protected function _default_venue_update(EE_Event $evtobj, $data)
1137
+	{
1138
+		require_once(EE_MODELS . 'EEM_Venue.model.php');
1139
+		$venue_model = EE_Registry::instance()->load_model('Venue');
1140
+		$rows_affected = null;
1141
+		$venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : null;
1142
+		// very important.  If we don't have a venue name...
1143
+		// then we'll get out because not necessary to create empty venue
1144
+		if (empty($data['venue_title'])) {
1145
+			return false;
1146
+		}
1147
+		$venue_array = [
1148
+			'VNU_wp_user'         => $evtobj->get('EVT_wp_user'),
1149
+			'VNU_name'            => ! empty($data['venue_title']) ? $data['venue_title'] : null,
1150
+			'VNU_desc'            => ! empty($data['venue_description']) ? $data['venue_description'] : null,
1151
+			'VNU_identifier'      => ! empty($data['venue_identifier']) ? $data['venue_identifier'] : null,
1152
+			'VNU_short_desc'      => ! empty($data['venue_short_description']) ? $data['venue_short_description']
1153
+				: null,
1154
+			'VNU_address'         => ! empty($data['address']) ? $data['address'] : null,
1155
+			'VNU_address2'        => ! empty($data['address2']) ? $data['address2'] : null,
1156
+			'VNU_city'            => ! empty($data['city']) ? $data['city'] : null,
1157
+			'STA_ID'              => ! empty($data['state']) ? $data['state'] : null,
1158
+			'CNT_ISO'             => ! empty($data['countries']) ? $data['countries'] : null,
1159
+			'VNU_zip'             => ! empty($data['zip']) ? $data['zip'] : null,
1160
+			'VNU_phone'           => ! empty($data['venue_phone']) ? $data['venue_phone'] : null,
1161
+			'VNU_capacity'        => ! empty($data['venue_capacity']) ? $data['venue_capacity'] : null,
1162
+			'VNU_url'             => ! empty($data['venue_url']) ? $data['venue_url'] : null,
1163
+			'VNU_virtual_phone'   => ! empty($data['virtual_phone']) ? $data['virtual_phone'] : null,
1164
+			'VNU_virtual_url'     => ! empty($data['virtual_url']) ? $data['virtual_url'] : null,
1165
+			'VNU_enable_for_gmap' => isset($data['enable_for_gmap']) ? 1 : 0,
1166
+			'status'              => 'publish',
1167
+		];
1168
+		// if we've got the venue_id then we're just updating the existing venue so let's do that and then get out.
1169
+		if (! empty($venue_id)) {
1170
+			$update_where = [$venue_model->primary_key_name() => $venue_id];
1171
+			$rows_affected = $venue_model->update($venue_array, [$update_where]);
1172
+			// we've gotta make sure that the venue is always attached to a revision.. add_relation_to should take care of making sure that the relation is already present.
1173
+			$evtobj->_add_relation_to($venue_id, 'Venue');
1174
+			return $rows_affected > 0;
1175
+		}
1176
+		// we insert the venue
1177
+		$venue_id = $venue_model->insert($venue_array);
1178
+		$evtobj->_add_relation_to($venue_id, 'Venue');
1179
+		return ! empty($venue_id) ? true : false;
1180
+		// when we have the ancestor come in it's already been handled by the revision save.
1181
+	}
1182
+
1183
+
1184
+	/**
1185
+	 * Handles saving everything related to Tickets (datetimes, tickets, prices)
1186
+	 *
1187
+	 * @param EE_Event $evtobj The Event object we're attaching data to
1188
+	 * @param array    $data   The request data from the form
1189
+	 * @return array
1190
+	 * @throws EE_Error
1191
+	 * @throws InvalidArgumentException
1192
+	 * @throws InvalidDataTypeException
1193
+	 * @throws InvalidInterfaceException
1194
+	 * @throws ReflectionException
1195
+	 * @throws Exception
1196
+	 */
1197
+	protected function _default_tickets_update(EE_Event $evtobj, $data)
1198
+	{
1199
+		if ($this->admin_config->useAdvancedEditor()) {
1200
+			return [];
1201
+		}
1202
+		$success = true;
1203
+		$saved_dtt = null;
1204
+		$saved_tickets = [];
1205
+		$incoming_date_formats = ['Y-m-d', 'h:i a'];
1206
+		foreach ($data['edit_event_datetimes'] as $row => $dtt) {
1207
+			// trim all values to ensure any excess whitespace is removed.
1208
+			$dtt = array_map('trim', $dtt);
1209
+			$dtt['DTT_EVT_end'] = isset($dtt['DTT_EVT_end']) && ! empty($dtt['DTT_EVT_end']) ? $dtt['DTT_EVT_end']
1210
+				: $dtt['DTT_EVT_start'];
1211
+			$datetime_values = [
1212
+				'DTT_ID'        => ! empty($dtt['DTT_ID']) ? $dtt['DTT_ID'] : null,
1213
+				'DTT_EVT_start' => $dtt['DTT_EVT_start'],
1214
+				'DTT_EVT_end'   => $dtt['DTT_EVT_end'],
1215
+				'DTT_reg_limit' => empty($dtt['DTT_reg_limit']) ? EE_INF : $dtt['DTT_reg_limit'],
1216
+				'DTT_order'     => $row,
1217
+			];
1218
+			// if we have an id then let's get existing object first and then set the new values.  Otherwise we instantiate a new object for save.
1219
+			if (! empty($dtt['DTT_ID'])) {
1220
+				$DTM = EE_Registry::instance()
1221
+								  ->load_model('Datetime', [$evtobj->get_timezone()])
1222
+								  ->get_one_by_ID($dtt['DTT_ID']);
1223
+				$DTM->set_date_format($incoming_date_formats[0]);
1224
+				$DTM->set_time_format($incoming_date_formats[1]);
1225
+				foreach ($datetime_values as $field => $value) {
1226
+					$DTM->set($field, $value);
1227
+				}
1228
+				// make sure the $dtt_id here is saved just in case after the add_relation_to() the autosave replaces it.  We need to do this so we dont' TRASH the parent DTT.
1229
+				$saved_dtts[ $DTM->ID() ] = $DTM;
1230
+			} else {
1231
+				$DTM = EE_Registry::instance()->load_class(
1232
+					'Datetime',
1233
+					[$datetime_values, $evtobj->get_timezone(), $incoming_date_formats],
1234
+					false,
1235
+					false
1236
+				);
1237
+				foreach ($datetime_values as $field => $value) {
1238
+					$DTM->set($field, $value);
1239
+				}
1240
+			}
1241
+			$DTM->save();
1242
+			$DTT = $evtobj->_add_relation_to($DTM, 'Datetime');
1243
+			// load DTT helper
1244
+			// before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
1245
+			if ($DTT->get_raw('DTT_EVT_start') > $DTT->get_raw('DTT_EVT_end')) {
1246
+				$DTT->set('DTT_EVT_end', $DTT->get('DTT_EVT_start'));
1247
+				$DTT = EEH_DTT_Helper::date_time_add($DTT, 'DTT_EVT_end', 'days');
1248
+				$DTT->save();
1249
+			}
1250
+			// now we got to make sure we add the new DTT_ID to the $saved_dtts array  because it is possible there was a new one created for the autosave.
1251
+			$saved_dtt = $DTT;
1252
+			$success = ! $success ? $success : $DTT;
1253
+			// if ANY of these updates fail then we want the appropriate global error message.
1254
+			// //todo this is actually sucky we need a better error message but this is what it is for now.
1255
+		}
1256
+		// no dtts get deleted so we don't do any of that logic here.
1257
+		// update tickets next
1258
+		$old_tickets = isset($data['ticket_IDs']) ? explode(',', $data['ticket_IDs']) : [];
1259
+		foreach ($data['edit_tickets'] as $row => $tkt) {
1260
+			$incoming_date_formats = ['Y-m-d', 'h:i a'];
1261
+			$update_prices = false;
1262
+			$ticket_price = isset($data['edit_prices'][ $row ][1]['PRC_amount'])
1263
+				? $data['edit_prices'][ $row ][1]['PRC_amount'] : 0;
1264
+			// trim inputs to ensure any excess whitespace is removed.
1265
+			$tkt = array_map('trim', $tkt);
1266
+			if (empty($tkt['TKT_start_date'])) {
1267
+				// let's use now in the set timezone.
1268
+				$now = new DateTime('now', new DateTimeZone($evtobj->get_timezone()));
1269
+				$tkt['TKT_start_date'] = $now->format($incoming_date_formats[0] . ' ' . $incoming_date_formats[1]);
1270
+			}
1271
+			if (empty($tkt['TKT_end_date'])) {
1272
+				// use the start date of the first datetime
1273
+				$dtt = $evtobj->first_datetime();
1274
+				$tkt['TKT_end_date'] = $dtt->start_date_and_time(
1275
+					$incoming_date_formats[0],
1276
+					$incoming_date_formats[1]
1277
+				);
1278
+			}
1279
+			$TKT_values = [
1280
+				'TKT_ID'          => ! empty($tkt['TKT_ID']) ? $tkt['TKT_ID'] : null,
1281
+				'TTM_ID'          => ! empty($tkt['TTM_ID']) ? $tkt['TTM_ID'] : 0,
1282
+				'TKT_name'        => ! empty($tkt['TKT_name']) ? $tkt['TKT_name'] : '',
1283
+				'TKT_description' => ! empty($tkt['TKT_description']) ? $tkt['TKT_description'] : '',
1284
+				'TKT_start_date'  => $tkt['TKT_start_date'],
1285
+				'TKT_end_date'    => $tkt['TKT_end_date'],
1286
+				'TKT_qty'         => ! isset($tkt['TKT_qty']) || $tkt['TKT_qty'] === '' ? EE_INF : $tkt['TKT_qty'],
1287
+				'TKT_uses'        => ! isset($tkt['TKT_uses']) || $tkt['TKT_uses'] === '' ? EE_INF : $tkt['TKT_uses'],
1288
+				'TKT_min'         => empty($tkt['TKT_min']) ? 0 : $tkt['TKT_min'],
1289
+				'TKT_max'         => empty($tkt['TKT_max']) ? EE_INF : $tkt['TKT_max'],
1290
+				'TKT_row'         => $row,
1291
+				'TKT_order'       => isset($tkt['TKT_order']) ? $tkt['TKT_order'] : $row,
1292
+				'TKT_price'       => $ticket_price,
1293
+			];
1294
+			// if this is a default TKT, then we need to set the TKT_ID to 0 and update accordingly, which means in turn that the prices will become new prices as well.
1295
+			if (isset($tkt['TKT_is_default']) && $tkt['TKT_is_default']) {
1296
+				$TKT_values['TKT_ID'] = 0;
1297
+				$TKT_values['TKT_is_default'] = 0;
1298
+				$TKT_values['TKT_price'] = $ticket_price;
1299
+				$update_prices = true;
1300
+			}
1301
+			// if we have a TKT_ID then we need to get that existing TKT_obj and update it
1302
+			// we actually do our saves a head of doing any add_relations to because its entirely possible that this ticket didn't removed or added to any datetime in the session but DID have it's items modified.
1303
+			// keep in mind that if the TKT has been sold (and we have changed pricing information), then we won't be updating the tkt but instead a new tkt will be created and the old one archived.
1304
+			if (! empty($tkt['TKT_ID'])) {
1305
+				$TKT = EE_Registry::instance()
1306
+								  ->load_model('Ticket', [$evtobj->get_timezone()])
1307
+								  ->get_one_by_ID($tkt['TKT_ID']);
1308
+				if ($TKT instanceof EE_Ticket) {
1309
+					$ticket_sold = $TKT->count_related(
1310
+						'Registration',
1311
+						[
1312
+								[
1313
+									'STS_ID' => [
1314
+										'NOT IN',
1315
+										[EEM_Registration::status_id_incomplete],
1316
+									],
1317
+								],
1318
+							]
1319
+					) > 0;
1320
+					// let's just check the total price for the existing ticket and determine if it matches the new
1321
+					// total price.  if they are different then we create a new ticket (if tickets sold)
1322
+					// if they aren't different then we go ahead and modify existing ticket.
1323
+					$create_new_TKT = $ticket_sold && ! $TKT->deleted()
1324
+									  && EEH_Money::compare_floats(
1325
+										  $ticket_price,
1326
+										  $TKT->get('TKT_price'),
1327
+										  '!=='
1328
+									  );
1329
+					$TKT->set_date_format($incoming_date_formats[0]);
1330
+					$TKT->set_time_format($incoming_date_formats[1]);
1331
+					// set new values
1332
+					foreach ($TKT_values as $field => $value) {
1333
+						if ($field === 'TKT_qty') {
1334
+							$TKT->set_qty($value);
1335
+						} else {
1336
+							$TKT->set($field, $value);
1337
+						}
1338
+					}
1339
+					// if $create_new_TKT is false then we can safely update the existing ticket.  Otherwise we have to create a new ticket.
1340
+					if ($create_new_TKT) {
1341
+						// archive the old ticket first
1342
+						$TKT->set('TKT_deleted', 1);
1343
+						$TKT->save();
1344
+						// make sure this ticket is still recorded in our saved_tkts so we don't run it through the regular trash routine.
1345
+						$saved_tickets[ $TKT->ID() ] = $TKT;
1346
+						// create new ticket that's a copy of the existing except a new id of course (and not archived) AND has the new TKT_price associated with it.
1347
+						$TKT = clone $TKT;
1348
+						$TKT->set('TKT_ID', 0);
1349
+						$TKT->set('TKT_deleted', 0);
1350
+						$TKT->set('TKT_price', $ticket_price);
1351
+						$TKT->set('TKT_sold', 0);
1352
+						// now we need to make sure that $new prices are created as well and attached to new ticket.
1353
+						$update_prices = true;
1354
+					}
1355
+					// make sure price is set if it hasn't been already
1356
+					$TKT->set('TKT_price', $ticket_price);
1357
+				}
1358
+			} else {
1359
+				// no TKT_id so a new TKT
1360
+				$TKT_values['TKT_price'] = $ticket_price;
1361
+				$TKT = EE_Registry::instance()->load_class('Ticket', [$TKT_values], false, false);
1362
+				if ($TKT instanceof EE_Ticket) {
1363
+					// need to reset values to properly account for the date formats
1364
+					$TKT->set_date_format($incoming_date_formats[0]);
1365
+					$TKT->set_time_format($incoming_date_formats[1]);
1366
+					$TKT->set_timezone($evtobj->get_timezone());
1367
+					// set new values
1368
+					foreach ($TKT_values as $field => $value) {
1369
+						if ($field === 'TKT_qty') {
1370
+							$TKT->set_qty($value);
1371
+						} else {
1372
+							$TKT->set($field, $value);
1373
+						}
1374
+					}
1375
+					$update_prices = true;
1376
+				}
1377
+			}
1378
+			// cap ticket qty by datetime reg limits
1379
+			$TKT->set_qty(min($TKT->qty(), $TKT->qty('reg_limit')));
1380
+			// update ticket.
1381
+			$TKT->save();
1382
+			// before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
1383
+			if ($TKT->get_raw('TKT_start_date') > $TKT->get_raw('TKT_end_date')) {
1384
+				$TKT->set('TKT_end_date', $TKT->get('TKT_start_date'));
1385
+				$TKT = EEH_DTT_Helper::date_time_add($TKT, 'TKT_end_date', 'days');
1386
+				$TKT->save();
1387
+			}
1388
+			// initially let's add the ticket to the dtt
1389
+			$saved_dtt->_add_relation_to($TKT, 'Ticket');
1390
+			$saved_tickets[ $TKT->ID() ] = $TKT;
1391
+			// add prices to ticket
1392
+			$this->_add_prices_to_ticket($data['edit_prices'][ $row ], $TKT, $update_prices);
1393
+		}
1394
+		// however now we need to handle permanently deleting tickets via the ui.  Keep in mind that the ui does not allow deleting/archiving tickets that have ticket sold.  However, it does allow for deleting tickets that have no tickets sold, in which case we want to get rid of permanently because there is no need to save in db.
1395
+		$old_tickets = isset($old_tickets[0]) && $old_tickets[0] === '' ? [] : $old_tickets;
1396
+		$tickets_removed = array_diff($old_tickets, array_keys($saved_tickets));
1397
+		foreach ($tickets_removed as $id) {
1398
+			$id = absint($id);
1399
+			// get the ticket for this id
1400
+			$tkt_to_remove = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($id);
1401
+			// need to get all the related datetimes on this ticket and remove from every single one of them (remember this process can ONLY kick off if there are NO tkts_sold)
1402
+			$dtts = $tkt_to_remove->get_many_related('Datetime');
1403
+			foreach ($dtts as $dtt) {
1404
+				$tkt_to_remove->_remove_relation_to($dtt, 'Datetime');
1405
+			}
1406
+			// need to do the same for prices (except these prices can also be deleted because again, tickets can only be trashed if they don't have any TKTs sold (otherwise they are just archived))
1407
+			$tkt_to_remove->delete_related_permanently('Price');
1408
+			// finally let's delete this ticket (which should not be blocked at this point b/c we've removed all our relationships)
1409
+			$tkt_to_remove->delete_permanently();
1410
+		}
1411
+		return [$saved_dtt, $saved_tickets];
1412
+	}
1413
+
1414
+
1415
+	/**
1416
+	 * This attaches a list of given prices to a ticket.
1417
+	 * Note we dont' have to worry about ever removing relationships (or archiving prices) because if there is a change
1418
+	 * in price information on a ticket, a new ticket is created anyways so the archived ticket will retain the old
1419
+	 * price info and prices are automatically "archived" via the ticket.
1420
+	 *
1421
+	 * @access  private
1422
+	 * @param array     $prices     Array of prices from the form.
1423
+	 * @param EE_Ticket $ticket     EE_Ticket object that prices are being attached to.
1424
+	 * @param bool      $new_prices Whether attach existing incoming prices or create new ones.
1425
+	 * @return  void
1426
+	 * @throws EE_Error
1427
+	 * @throws InvalidArgumentException
1428
+	 * @throws InvalidDataTypeException
1429
+	 * @throws InvalidInterfaceException
1430
+	 * @throws ReflectionException
1431
+	 */
1432
+	private function _add_prices_to_ticket($prices, EE_Ticket $ticket, $new_prices = false)
1433
+	{
1434
+		foreach ($prices as $row => $prc) {
1435
+			$PRC_values = [
1436
+				'PRC_ID'         => ! empty($prc['PRC_ID']) ? $prc['PRC_ID'] : null,
1437
+				'PRT_ID'         => ! empty($prc['PRT_ID']) ? $prc['PRT_ID'] : null,
1438
+				'PRC_amount'     => ! empty($prc['PRC_amount']) ? $prc['PRC_amount'] : 0,
1439
+				'PRC_name'       => ! empty($prc['PRC_name']) ? $prc['PRC_name'] : '',
1440
+				'PRC_desc'       => ! empty($prc['PRC_desc']) ? $prc['PRC_desc'] : '',
1441
+				'PRC_is_default' => 0, // make sure prices are NOT set as default from this context
1442
+				'PRC_order'      => $row,
1443
+			];
1444
+			if ($new_prices || empty($PRC_values['PRC_ID'])) {
1445
+				$PRC_values['PRC_ID'] = 0;
1446
+				$PRC = EE_Registry::instance()->load_class('Price', [$PRC_values], false, false);
1447
+			} else {
1448
+				$PRC = EE_Registry::instance()->load_model('Price')->get_one_by_ID($prc['PRC_ID']);
1449
+				// update this price with new values
1450
+				foreach ($PRC_values as $field => $newprc) {
1451
+					$PRC->set($field, $newprc);
1452
+				}
1453
+				$PRC->save();
1454
+			}
1455
+			$ticket->_add_relation_to($PRC, 'Price');
1456
+		}
1457
+	}
1458
+
1459
+
1460
+	/**
1461
+	 * Add in our autosave ajax handlers
1462
+	 *
1463
+	 */
1464
+	protected function _ee_autosave_create_new()
1465
+	{
1466
+	}
1467
+
1468
+
1469
+	/**
1470
+	 * More autosave handlers.
1471
+	 */
1472
+	protected function _ee_autosave_edit()
1473
+	{
1474
+	}
1475
+
1476
+
1477
+	/**
1478
+	 *    _generate_publish_box_extra_content
1479
+	 *
1480
+	 * @throws DomainException
1481
+	 * @throws EE_Error
1482
+	 * @throws InvalidArgumentException
1483
+	 * @throws InvalidDataTypeException
1484
+	 * @throws InvalidInterfaceException
1485
+	 * @throws ReflectionException
1486
+	 */
1487
+	private function _generate_publish_box_extra_content()
1488
+	{
1489
+		// load formatter helper
1490
+		// args for getting related registrations
1491
+		$approved_query_args = [
1492
+			[
1493
+				'REG_deleted' => 0,
1494
+				'STS_ID'      => EEM_Registration::status_id_approved,
1495
+			],
1496
+		];
1497
+		$not_approved_query_args = [
1498
+			[
1499
+				'REG_deleted' => 0,
1500
+				'STS_ID'      => EEM_Registration::status_id_not_approved,
1501
+			],
1502
+		];
1503
+		$pending_payment_query_args = [
1504
+			[
1505
+				'REG_deleted' => 0,
1506
+				'STS_ID'      => EEM_Registration::status_id_pending_payment,
1507
+			],
1508
+		];
1509
+		// publish box
1510
+		$publish_box_extra_args = [
1511
+			'view_approved_reg_url'        => add_query_arg(
1512
+				[
1513
+					'action'      => 'default',
1514
+					'event_id'    => $this->_cpt_model_obj->ID(),
1515
+					'_reg_status' => EEM_Registration::status_id_approved,
1516
+				],
1517
+				REG_ADMIN_URL
1518
+			),
1519
+			'view_not_approved_reg_url'    => add_query_arg(
1520
+				[
1521
+					'action'      => 'default',
1522
+					'event_id'    => $this->_cpt_model_obj->ID(),
1523
+					'_reg_status' => EEM_Registration::status_id_not_approved,
1524
+				],
1525
+				REG_ADMIN_URL
1526
+			),
1527
+			'view_pending_payment_reg_url' => add_query_arg(
1528
+				[
1529
+					'action'      => 'default',
1530
+					'event_id'    => $this->_cpt_model_obj->ID(),
1531
+					'_reg_status' => EEM_Registration::status_id_pending_payment,
1532
+				],
1533
+				REG_ADMIN_URL
1534
+			),
1535
+			'approved_regs'                => $this->_cpt_model_obj->count_related(
1536
+				'Registration',
1537
+				$approved_query_args
1538
+			),
1539
+			'not_approved_regs'            => $this->_cpt_model_obj->count_related(
1540
+				'Registration',
1541
+				$not_approved_query_args
1542
+			),
1543
+			'pending_payment_regs'         => $this->_cpt_model_obj->count_related(
1544
+				'Registration',
1545
+				$pending_payment_query_args
1546
+			),
1547
+			'misc_pub_section_class'       => apply_filters(
1548
+				'FHEE_Events_Admin_Page___generate_publish_box_extra_content__misc_pub_section_class',
1549
+				'misc-pub-section'
1550
+			),
1551
+		];
1552
+		ob_start();
1553
+		do_action(
1554
+			'AHEE__Events_Admin_Page___generate_publish_box_extra_content__event_editor_overview_add',
1555
+			$this->_cpt_model_obj
1556
+		);
1557
+		$publish_box_extra_args['event_editor_overview_add'] = ob_get_clean();
1558
+		// load template
1559
+		EEH_Template::display_template(
1560
+			EVENTS_TEMPLATE_PATH . 'event_publish_box_extras.template.php',
1561
+			$publish_box_extra_args
1562
+		);
1563
+	}
1564
+
1565
+
1566
+	/**
1567
+	 * @return EE_Event
1568
+	 */
1569
+	public function get_event_object()
1570
+	{
1571
+		return $this->_cpt_model_obj;
1572
+	}
1573
+
1574
+
1575
+
1576
+
1577
+	/** METABOXES * */
1578
+	/**
1579
+	 * _register_event_editor_meta_boxes
1580
+	 * add all metaboxes related to the event_editor
1581
+	 *
1582
+	 * @return void
1583
+	 * @throws EE_Error
1584
+	 * @throws InvalidArgumentException
1585
+	 * @throws InvalidDataTypeException
1586
+	 * @throws InvalidInterfaceException
1587
+	 * @throws ReflectionException
1588
+	 */
1589
+	protected function _register_event_editor_meta_boxes()
1590
+	{
1591
+		$this->verify_cpt_object();
1592
+		$use_advanced_editor = $this->admin_config->useAdvancedEditor();
1593
+		/** @var FeatureFlags $flags */
1594
+		$flags = $this->loader->getShared('EventEspresso\core\domain\services\capabilities\FeatureFlags');
1595
+		// check if the new EDTR reg options meta box is being used, and if so, don't load the legacy version
1596
+		if (! $use_advanced_editor || ! $flags->featureAllowed('use_reg_options_meta_box')) {
1597
+			add_meta_box(
1598
+				'espresso_event_editor_event_options',
1599
+				esc_html__('Event Registration Options', 'event_espresso'),
1600
+				[$this, 'registration_options_meta_box'],
1601
+				$this->page_slug,
1602
+				'side'
1603
+			);
1604
+		}
1605
+		if (! $use_advanced_editor) {
1606
+			add_meta_box(
1607
+				'espresso_event_editor_tickets',
1608
+				esc_html__('Event Datetime & Ticket', 'event_espresso'),
1609
+				[$this, 'ticket_metabox'],
1610
+				$this->page_slug,
1611
+				'normal',
1612
+				'high'
1613
+			);
1614
+		} else {
1615
+			if ($flags->featureAllowed('use_reg_options_meta_box')) {
1616
+				add_action(
1617
+					'add_meta_boxes_espresso_events',
1618
+					function () {
1619
+						global $current_screen;
1620
+						remove_meta_box('authordiv', $current_screen, 'normal');
1621
+					},
1622
+					99
1623
+				);
1624
+			}
1625
+		}
1626
+		// NOTE: if you're looking for other metaboxes in here,
1627
+		// where a metabox has a related management page in the admin
1628
+		// you will find it setup in the related management page's "_Hooks" file.
1629
+		// i.e. messages metabox is found in "espresso_events_Messages_Hooks.class.php".
1630
+	}
1631
+
1632
+
1633
+	/**
1634
+	 * @throws DomainException
1635
+	 * @throws EE_Error
1636
+	 * @throws InvalidArgumentException
1637
+	 * @throws InvalidDataTypeException
1638
+	 * @throws InvalidInterfaceException
1639
+	 * @throws ReflectionException
1640
+	 */
1641
+	public function ticket_metabox()
1642
+	{
1643
+		$existing_datetime_ids = $existing_ticket_ids = [];
1644
+		// defaults for template args
1645
+		$template_args = [
1646
+			'existing_datetime_ids'    => '',
1647
+			'event_datetime_help_link' => '',
1648
+			'ticket_options_help_link' => '',
1649
+			'time'                     => null,
1650
+			'ticket_rows'              => '',
1651
+			'existing_ticket_ids'      => '',
1652
+			'total_ticket_rows'        => 1,
1653
+			'ticket_js_structure'      => '',
1654
+			'trash_icon'               => 'ee-lock-icon',
1655
+			'disabled'                 => '',
1656
+		];
1657
+		$event_id = is_object($this->_cpt_model_obj) ? $this->_cpt_model_obj->ID() : null;
1658
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1659
+		/**
1660
+		 * 1. Start with retrieving Datetimes
1661
+		 * 2. Fore each datetime get related tickets
1662
+		 * 3. For each ticket get related prices
1663
+		 */
1664
+		$times = EE_Registry::instance()->load_model('Datetime')->get_all_event_dates($event_id);
1665
+		/** @type EE_Datetime $first_datetime */
1666
+		$first_datetime = reset($times);
1667
+		// do we get related tickets?
1668
+		if ($first_datetime instanceof EE_Datetime
1669
+			&& $first_datetime->ID() !== 0
1670
+		) {
1671
+			$existing_datetime_ids[] = $first_datetime->get('DTT_ID');
1672
+			$template_args['time'] = $first_datetime;
1673
+			$related_tickets = $first_datetime->tickets(
1674
+				[
1675
+					['OR' => ['TKT_deleted' => 1, 'TKT_deleted*' => 0]],
1676
+					'default_where_conditions' => 'none',
1677
+				]
1678
+			);
1679
+			if (! empty($related_tickets)) {
1680
+				$template_args['total_ticket_rows'] = count($related_tickets);
1681
+				$row = 0;
1682
+				foreach ($related_tickets as $ticket) {
1683
+					$existing_ticket_ids[] = $ticket->get('TKT_ID');
1684
+					$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, false, $row);
1685
+					$row++;
1686
+				}
1687
+			} else {
1688
+				$template_args['total_ticket_rows'] = 1;
1689
+				/** @type EE_Ticket $ticket */
1690
+				$ticket = EE_Registry::instance()->load_model('Ticket')->create_default_object();
1691
+				$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket);
1692
+			}
1693
+		} else {
1694
+			$template_args['time'] = $times[0];
1695
+			/** @type EE_Ticket $ticket */
1696
+			$ticket = EE_Registry::instance()->load_model('Ticket')->get_all_default_tickets();
1697
+			$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket[1]);
1698
+			// NOTE: we're just sending the first default row
1699
+			// (decaf can't manage default tickets so this should be sufficient);
1700
+		}
1701
+		$template_args['event_datetime_help_link'] = $this->_get_help_tab_link(
1702
+			'event_editor_event_datetimes_help_tab'
1703
+		);
1704
+		$template_args['ticket_options_help_link'] = $this->_get_help_tab_link('ticket_options_info');
1705
+		$template_args['existing_datetime_ids'] = implode(',', $existing_datetime_ids);
1706
+		$template_args['existing_ticket_ids'] = implode(',', $existing_ticket_ids);
1707
+		$template_args['ticket_js_structure'] = $this->_get_ticket_row(
1708
+			EE_Registry::instance()->load_model('Ticket')->create_default_object(),
1709
+			true
1710
+		);
1711
+		$template = apply_filters(
1712
+			'FHEE__Events_Admin_Page__ticket_metabox__template',
1713
+			EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php'
1714
+		);
1715
+		EEH_Template::display_template($template, $template_args);
1716
+	}
1717
+
1718
+
1719
+	/**
1720
+	 * Setup an individual ticket form for the decaf event editor page
1721
+	 *
1722
+	 * @access private
1723
+	 * @param EE_Ticket $ticket   the ticket object
1724
+	 * @param boolean   $skeleton whether we're generating a skeleton for js manipulation
1725
+	 * @param int       $row
1726
+	 * @return string generated html for the ticket row.
1727
+	 * @throws DomainException
1728
+	 * @throws EE_Error
1729
+	 * @throws InvalidArgumentException
1730
+	 * @throws InvalidDataTypeException
1731
+	 * @throws InvalidInterfaceException
1732
+	 * @throws ReflectionException
1733
+	 */
1734
+	private function _get_ticket_row($ticket, $skeleton = false, $row = 0)
1735
+	{
1736
+		$template_args = [
1737
+			'tkt_status_class'    => ' tkt-status-' . $ticket->ticket_status(),
1738
+			'tkt_archive_class'   => $ticket->ticket_status() === EE_Ticket::archived && ! $skeleton ? ' tkt-archived'
1739
+				: '',
1740
+			'ticketrow'           => $skeleton ? 'TICKETNUM' : $row,
1741
+			'TKT_ID'              => $ticket->get('TKT_ID'),
1742
+			'TKT_name'            => $ticket->get('TKT_name'),
1743
+			'TKT_start_date'      => $skeleton ? '' : $ticket->get_date('TKT_start_date', 'Y-m-d h:i a'),
1744
+			'TKT_end_date'        => $skeleton ? '' : $ticket->get_date('TKT_end_date', 'Y-m-d h:i a'),
1745
+			'TKT_is_default'      => $ticket->get('TKT_is_default'),
1746
+			'TKT_qty'             => $ticket->get_pretty('TKT_qty', 'input'),
1747
+			'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1748
+			'TKT_sold'            => $skeleton ? 0 : $ticket->get('TKT_sold'),
1749
+			'trash_icon'          => ($skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')))
1750
+									 && (! empty($ticket) && $ticket->get('TKT_sold') === 0)
1751
+				? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1752
+			'disabled'            => $skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')) ? ''
1753
+				: ' disabled=disabled',
1754
+		];
1755
+		$price = $ticket->ID() !== 0
1756
+			? $ticket->get_first_related('Price', ['default_where_conditions' => 'none'])
1757
+			: EE_Registry::instance()->load_model('Price')->create_default_object();
1758
+		$price_args = [
1759
+			'price_currency_symbol' => EE_Registry::instance()->CFG->currency->sign,
1760
+			'PRC_amount'            => $price->get('PRC_amount'),
1761
+			'PRT_ID'                => $price->get('PRT_ID'),
1762
+			'PRC_ID'                => $price->get('PRC_ID'),
1763
+			'PRC_is_default'        => $price->get('PRC_is_default'),
1764
+		];
1765
+		// make sure we have default start and end dates if skeleton
1766
+		// handle rows that should NOT be empty
1767
+		if (empty($template_args['TKT_start_date'])) {
1768
+			// if empty then the start date will be now.
1769
+			$template_args['TKT_start_date'] = date('Y-m-d h:i a', current_time('timestamp'));
1770
+		}
1771
+		if (empty($template_args['TKT_end_date'])) {
1772
+			// get the earliest datetime (if present);
1773
+			$earliest_dtt = $this->_cpt_model_obj->ID() > 0
1774
+				? $this->_cpt_model_obj->get_first_related(
1775
+					'Datetime',
1776
+					['order_by' => ['DTT_EVT_start' => 'ASC']]
1777
+				)
1778
+				: null;
1779
+			if (! empty($earliest_dtt)) {
1780
+				$template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1781
+			} else {
1782
+				$template_args['TKT_end_date'] = date(
1783
+					'Y-m-d h:i a',
1784
+					mktime(0, 0, 0, date('m'), date('d') + 7, date('Y'))
1785
+				);
1786
+			}
1787
+		}
1788
+		$template_args = array_merge($template_args, $price_args);
1789
+		$template = apply_filters(
1790
+			'FHEE__Events_Admin_Page__get_ticket_row__template',
1791
+			EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_ticket_row.template.php',
1792
+			$ticket
1793
+		);
1794
+		return EEH_Template::display_template($template, $template_args, true);
1795
+	}
1796
+
1797
+
1798
+	/**
1799
+	 * @throws DomainException
1800
+	 * @throws EE_Error
1801
+	 */
1802
+	public function registration_options_meta_box()
1803
+	{
1804
+		$yes_no_values = [
1805
+			['id' => true, 'text' => esc_html__('Yes', 'event_espresso')],
1806
+			['id' => false, 'text' => esc_html__('No', 'event_espresso')],
1807
+		];
1808
+		$default_reg_status_values = EEM_Registration::reg_status_array(
1809
+			[
1810
+				EEM_Registration::status_id_cancelled,
1811
+				EEM_Registration::status_id_declined,
1812
+				EEM_Registration::status_id_incomplete,
1813
+			],
1814
+			true
1815
+		);
1816
+		// $template_args['is_active_select'] = EEH_Form_Fields::select_input('is_active', $yes_no_values, $this->_cpt_model_obj->is_active());
1817
+		$template_args['_event'] = $this->_cpt_model_obj;
1818
+		$template_args['active_status'] = $this->_cpt_model_obj->pretty_active_status(false);
1819
+		$template_args['additional_limit'] = $this->_cpt_model_obj->additional_limit();
1820
+		$template_args['default_registration_status'] = EEH_Form_Fields::select_input(
1821
+			'default_reg_status',
1822
+			$default_reg_status_values,
1823
+			$this->_cpt_model_obj->default_registration_status()
1824
+		);
1825
+		$template_args['display_description'] = EEH_Form_Fields::select_input(
1826
+			'display_desc',
1827
+			$yes_no_values,
1828
+			$this->_cpt_model_obj->display_description()
1829
+		);
1830
+		$template_args['display_ticket_selector'] = EEH_Form_Fields::select_input(
1831
+			'display_ticket_selector',
1832
+			$yes_no_values,
1833
+			$this->_cpt_model_obj->display_ticket_selector(),
1834
+			'',
1835
+			'',
1836
+			false
1837
+		);
1838
+		$template_args['additional_registration_options'] = apply_filters(
1839
+			'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options',
1840
+			'',
1841
+			$template_args,
1842
+			$yes_no_values,
1843
+			$default_reg_status_values
1844
+		);
1845
+		EEH_Template::display_template(
1846
+			EVENTS_TEMPLATE_PATH . 'event_registration_options.template.php',
1847
+			$template_args
1848
+		);
1849
+	}
1850
+
1851
+
1852
+	/**
1853
+	 * _get_events()
1854
+	 * This method simply returns all the events (for the given _view and paging)
1855
+	 *
1856
+	 * @access public
1857
+	 * @param int  $per_page     count of items per page (20 default);
1858
+	 * @param int  $current_page what is the current page being viewed.
1859
+	 * @param bool $count        if TRUE then we just return a count of ALL events matching the given _view.
1860
+	 *                           If FALSE then we return an array of event objects
1861
+	 *                           that match the given _view and paging parameters.
1862
+	 * @return array an array of event objects.
1863
+	 * @throws EE_Error
1864
+	 * @throws InvalidArgumentException
1865
+	 * @throws InvalidDataTypeException
1866
+	 * @throws InvalidInterfaceException
1867
+	 * @throws ReflectionException
1868
+	 * @throws Exception
1869
+	 * @throws Exception
1870
+	 * @throws Exception
1871
+	 */
1872
+	public function get_events($per_page = 10, $current_page = 1, $count = false)
1873
+	{
1874
+		$EEME = $this->_event_model();
1875
+		$offset = ($current_page - 1) * $per_page;
1876
+		$limit = $count ? null : $offset . ',' . $per_page;
1877
+		$orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'EVT_ID';
1878
+		$order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
1879
+		if (isset($this->_req_data['month_range'])) {
1880
+			$pieces = explode(' ', $this->_req_data['month_range'], 3);
1881
+			// simulate the FIRST day of the month, that fixes issues for months like February
1882
+			// where PHP doesn't know what to assume for date.
1883
+			// @see https://events.codebasehq.com/projects/event-espresso/tickets/10437
1884
+			$month_r = ! empty($pieces[0]) ? date('m', EEH_DTT_Helper::first_of_month_timestamp($pieces[0])) : '';
1885
+			$year_r = ! empty($pieces[1]) ? $pieces[1] : '';
1886
+		}
1887
+		$where = [];
1888
+		$status = isset($this->_req_data['status']) ? $this->_req_data['status'] : null;
1889
+		// determine what post_status our condition will have for the query.
1890
+		switch ($status) {
1891
+			case 'month':
1892
+			case 'today':
1893
+			case null:
1894
+			case 'all':
1895
+				break;
1896
+			case 'draft':
1897
+				$where['status'] = ['IN', ['draft', 'auto-draft']];
1898
+				break;
1899
+			default:
1900
+				$where['status'] = $status;
1901
+		}
1902
+		// categories?
1903
+		$category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0
1904
+			? $this->_req_data['EVT_CAT'] : null;
1905
+		if (! empty($category)) {
1906
+			$where['Term_Taxonomy.taxonomy'] = EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY;
1907
+			$where['Term_Taxonomy.term_id'] = $category;
1908
+		}
1909
+		// date where conditions
1910
+		$start_formats = EEM_Datetime::instance()->get_formats_for('DTT_EVT_start');
1911
+		if (isset($this->_req_data['month_range']) && $this->_req_data['month_range'] !== '') {
1912
+			$DateTime = new DateTime(
1913
+				$year_r . '-' . $month_r . '-01 00:00:00',
1914
+				new DateTimeZone('UTC')
1915
+			);
1916
+			$start = $DateTime->getTimestamp();
1917
+			// set the datetime to be the end of the month
1918
+			$DateTime->setDate(
1919
+				$year_r,
1920
+				$month_r,
1921
+				$DateTime->format('t')
1922
+			)->setTime(23, 59, 59);
1923
+			$end = $DateTime->getTimestamp();
1924
+			$where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1925
+		} elseif (isset($this->_req_data['status']) && $this->_req_data['status'] === 'today') {
1926
+			$DateTime = new DateTime('now', new DateTimeZone(EEM_Event::instance()->get_timezone()));
1927
+			$start = $DateTime->setTime(0, 0, 0)->format(implode(' ', $start_formats));
1928
+			$end = $DateTime->setTime(23, 59, 59)->format(implode(' ', $start_formats));
1929
+			$where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1930
+		} elseif (isset($this->_req_data['status']) && $this->_req_data['status'] === 'month') {
1931
+			$now = date('Y-m-01');
1932
+			$DateTime = new DateTime($now, new DateTimeZone(EEM_Event::instance()->get_timezone()));
1933
+			$start = $DateTime->setTime(0, 0, 0)->format(implode(' ', $start_formats));
1934
+			$end = $DateTime->setDate(date('Y'), date('m'), $DateTime->format('t'))
1935
+							->setTime(23, 59, 59)
1936
+							->format(implode(' ', $start_formats));
1937
+			$where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1938
+		}
1939
+		if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1940
+			$where['EVT_wp_user'] = get_current_user_id();
1941
+		} elseif (! isset($where['status'])
1942
+				  && ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')
1943
+		) {
1944
+			$where['OR'] = [
1945
+				'status*restrict_private' => ['!=', 'private'],
1946
+				'AND'                     => [
1947
+					'status*inclusive' => ['=', 'private'],
1948
+					'EVT_wp_user'      => get_current_user_id(),
1949
+				],
1950
+			];
1951
+		}
1952
+
1953
+		if (isset($this->_req_data['EVT_wp_user'])
1954
+			&& (int) $this->_req_data['EVT_wp_user'] !== (int) get_current_user_id()
1955
+			&& EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')
1956
+		) {
1957
+			$where['EVT_wp_user'] = $this->_req_data['EVT_wp_user'];
1958
+		}
1959
+		// search query handling
1960
+		if (isset($this->_req_data['s'])) {
1961
+			$search_string = '%' . $this->_req_data['s'] . '%';
1962
+			$where['OR'] = [
1963
+				'EVT_name'       => ['LIKE', $search_string],
1964
+				'EVT_desc'       => ['LIKE', $search_string],
1965
+				'EVT_short_desc' => ['LIKE', $search_string],
1966
+			];
1967
+		}
1968
+		// filter events by venue.
1969
+		if (isset($this->_req_data['venue']) && ! empty($this->_req_data['venue'])) {
1970
+			$where['Venue.VNU_ID'] = absint($this->_req_data['venue']);
1971
+		}
1972
+		$where = apply_filters('FHEE__Events_Admin_Page__get_events__where', $where, $this->_req_data);
1973
+		$query_params = apply_filters(
1974
+			'FHEE__Events_Admin_Page__get_events__query_params',
1975
+			[
1976
+				$where,
1977
+				'limit'    => $limit,
1978
+				'order_by' => $orderby,
1979
+				'order'    => $order,
1980
+				'group_by' => 'EVT_ID',
1981
+			],
1982
+			$this->_req_data
1983
+		);
1984
+
1985
+		// let's first check if we have special requests coming in.
1986
+		if (isset($this->_req_data['active_status'])) {
1987
+			switch ($this->_req_data['active_status']) {
1988
+				case 'upcoming':
1989
+					return $EEME->get_upcoming_events($query_params, $count);
1990
+					break;
1991
+				case 'expired':
1992
+					return $EEME->get_expired_events($query_params, $count);
1993
+					break;
1994
+				case 'active':
1995
+					return $EEME->get_active_events($query_params, $count);
1996
+					break;
1997
+				case 'inactive':
1998
+					return $EEME->get_inactive_events($query_params, $count);
1999
+					break;
2000
+			}
2001
+		}
2002
+
2003
+		$events = $count ? $EEME->count([$where], 'EVT_ID', true) : $EEME->get_all($query_params);
2004
+		return $events;
2005
+	}
2006
+
2007
+
2008
+	/**
2009
+	 * handling for WordPress CPT actions (trash, restore, delete)
2010
+	 *
2011
+	 * @param string $post_id
2012
+	 * @throws EE_Error
2013
+	 * @throws InvalidArgumentException
2014
+	 * @throws InvalidDataTypeException
2015
+	 * @throws InvalidInterfaceException
2016
+	 * @throws ReflectionException
2017
+	 */
2018
+	public function trash_cpt_item($post_id)
2019
+	{
2020
+		$this->_req_data['EVT_ID'] = $post_id;
2021
+		$this->_trash_or_restore_event('trash', false);
2022
+	}
2023
+
2024
+
2025
+	/**
2026
+	 * @param string $post_id
2027
+	 * @throws EE_Error
2028
+	 * @throws InvalidArgumentException
2029
+	 * @throws InvalidDataTypeException
2030
+	 * @throws InvalidInterfaceException
2031
+	 * @throws ReflectionException
2032
+	 */
2033
+	public function restore_cpt_item($post_id)
2034
+	{
2035
+		$this->_req_data['EVT_ID'] = $post_id;
2036
+		$this->_trash_or_restore_event('draft', false);
2037
+	}
2038
+
2039
+
2040
+	/**
2041
+	 * @param string $post_id
2042
+	 * @throws EE_Error
2043
+	 * @throws InvalidArgumentException
2044
+	 * @throws InvalidDataTypeException
2045
+	 * @throws InvalidInterfaceException
2046
+	 * @throws ReflectionException
2047
+	 */
2048
+	public function delete_cpt_item($post_id)
2049
+	{
2050
+		$this->_req_data['EVT_ID'] = $post_id;
2051
+		$this->_delete_event(false);
2052
+	}
2053
+
2054
+
2055
+	/**
2056
+	 * _trash_or_restore_event
2057
+	 *
2058
+	 * @access protected
2059
+	 * @param string $event_status
2060
+	 * @param bool   $redirect_after
2061
+	 * @throws EE_Error
2062
+	 * @throws InvalidArgumentException
2063
+	 * @throws InvalidDataTypeException
2064
+	 * @throws InvalidInterfaceException
2065
+	 * @throws ReflectionException
2066
+	 */
2067
+	protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = true)
2068
+	{
2069
+		// determine the event id and set to array.
2070
+		$EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : false;
2071
+		// loop thru events
2072
+		if ($EVT_ID) {
2073
+			// clean status
2074
+			$event_status = sanitize_key($event_status);
2075
+			// grab status
2076
+			if (! empty($event_status)) {
2077
+				$success = $this->_change_event_status($EVT_ID, $event_status);
2078
+			} else {
2079
+				$success = false;
2080
+				$msg = esc_html__(
2081
+					'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
2082
+					'event_espresso'
2083
+				);
2084
+				EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2085
+			}
2086
+		} else {
2087
+			$success = false;
2088
+			$msg = esc_html__(
2089
+				'An error occurred. The event could not be moved to the trash because a valid event ID was not not supplied.',
2090
+				'event_espresso'
2091
+			);
2092
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2093
+		}
2094
+		$action = $event_status === 'trash' ? 'moved to the trash' : 'restored from the trash';
2095
+		if ($redirect_after) {
2096
+			$this->_redirect_after_action($success, 'Event', $action, ['action' => 'default']);
2097
+		}
2098
+	}
2099
+
2100
+
2101
+	/**
2102
+	 * _trash_or_restore_events
2103
+	 *
2104
+	 * @access protected
2105
+	 * @param string $event_status
2106
+	 * @return void
2107
+	 * @throws EE_Error
2108
+	 * @throws InvalidArgumentException
2109
+	 * @throws InvalidDataTypeException
2110
+	 * @throws InvalidInterfaceException
2111
+	 * @throws ReflectionException
2112
+	 */
2113
+	protected function _trash_or_restore_events($event_status = 'trash')
2114
+	{
2115
+		// clean status
2116
+		$event_status = sanitize_key($event_status);
2117
+		// grab status
2118
+		if (! empty($event_status)) {
2119
+			$success = true;
2120
+			// determine the event id and set to array.
2121
+			$EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : [];
2122
+			// loop thru events
2123
+			foreach ($EVT_IDs as $EVT_ID) {
2124
+				if ($EVT_ID = absint($EVT_ID)) {
2125
+					$results = $this->_change_event_status($EVT_ID, $event_status);
2126
+					$success = $results !== false ? $success : false;
2127
+				} else {
2128
+					$msg = sprintf(
2129
+						esc_html__(
2130
+							'An error occurred. Event #%d could not be moved to the trash because a valid event ID was not not supplied.',
2131
+							'event_espresso'
2132
+						),
2133
+						$EVT_ID
2134
+					);
2135
+					EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2136
+					$success = false;
2137
+				}
2138
+			}
2139
+		} else {
2140
+			$success = false;
2141
+			$msg = esc_html__(
2142
+				'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
2143
+				'event_espresso'
2144
+			);
2145
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2146
+		}
2147
+		// in order to force a pluralized result message we need to send back a success status greater than 1
2148
+		$success = $success ? 2 : false;
2149
+		$action = $event_status === 'trash' ? 'moved to the trash' : 'restored from the trash';
2150
+		$this->_redirect_after_action($success, 'Events', $action, ['action' => 'default']);
2151
+	}
2152
+
2153
+
2154
+	/**
2155
+	 * _trash_or_restore_events
2156
+	 *
2157
+	 * @access  private
2158
+	 * @param int    $EVT_ID
2159
+	 * @param string $event_status
2160
+	 * @return bool
2161
+	 * @throws EE_Error
2162
+	 * @throws InvalidArgumentException
2163
+	 * @throws InvalidDataTypeException
2164
+	 * @throws InvalidInterfaceException
2165
+	 * @throws ReflectionException
2166
+	 */
2167
+	private function _change_event_status($EVT_ID = 0, $event_status = '')
2168
+	{
2169
+		// grab event id
2170
+		if (! $EVT_ID) {
2171
+			$msg = esc_html__(
2172
+				'An error occurred. No Event ID or an invalid Event ID was received.',
2173
+				'event_espresso'
2174
+			);
2175
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2176
+			return false;
2177
+		}
2178
+		$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2179
+		// clean status
2180
+		$event_status = sanitize_key($event_status);
2181
+		// grab status
2182
+		if (empty($event_status)) {
2183
+			$msg = esc_html__(
2184
+				'An error occurred. No Event Status or an invalid Event Status was received.',
2185
+				'event_espresso'
2186
+			);
2187
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2188
+			return false;
2189
+		}
2190
+		// was event trashed or restored ?
2191
+		switch ($event_status) {
2192
+			case 'draft':
2193
+				$action = 'restored from the trash';
2194
+				$hook = 'AHEE_event_restored_from_trash';
2195
+				break;
2196
+			case 'trash':
2197
+				$action = 'moved to the trash';
2198
+				$hook = 'AHEE_event_moved_to_trash';
2199
+				break;
2200
+			default:
2201
+				$action = 'updated';
2202
+				$hook = false;
2203
+		}
2204
+		// use class to change status
2205
+		$this->_cpt_model_obj->set_status($event_status);
2206
+		$success = $this->_cpt_model_obj->save();
2207
+		if ($success === false) {
2208
+			$msg = sprintf(esc_html__('An error occurred. The event could not be %s.', 'event_espresso'), $action);
2209
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2210
+			return false;
2211
+		}
2212
+		if ($hook) {
2213
+			do_action($hook);
2214
+		}
2215
+		return true;
2216
+	}
2217
+
2218
+
2219
+	/**
2220
+	 * _delete_event
2221
+	 *
2222
+	 * @access protected
2223
+	 * @param bool $redirect_after
2224
+	 * @throws EE_Error
2225
+	 * @throws InvalidArgumentException
2226
+	 * @throws InvalidDataTypeException
2227
+	 * @throws InvalidInterfaceException
2228
+	 * @throws ReflectionException
2229
+	 */
2230
+	protected function _delete_event($redirect_after = true)
2231
+	{
2232
+		// determine the event id and set to array.
2233
+		$EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : null;
2234
+		$EVT_ID = isset($this->_req_data['post']) ? absint($this->_req_data['post']) : $EVT_ID;
2235
+		// loop thru events
2236
+		if ($EVT_ID) {
2237
+			$success = $this->_permanently_delete_event($EVT_ID);
2238
+			// get list of events with no prices
2239
+			$espresso_no_ticket_prices = get_option('ee_no_ticket_prices', []);
2240
+			// remove this event from the list of events with no prices
2241
+			if (isset($espresso_no_ticket_prices[ $EVT_ID ])) {
2242
+				unset($espresso_no_ticket_prices[ $EVT_ID ]);
2243
+			}
2244
+			update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2245
+		} else {
2246
+			$success = false;
2247
+			$msg = esc_html__(
2248
+				'An error occurred. An event could not be deleted because a valid event ID was not not supplied.',
2249
+				'event_espresso'
2250
+			);
2251
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2252
+		}
2253
+		if ($redirect_after) {
2254
+			$this->_redirect_after_action(
2255
+				$success,
2256
+				'Event',
2257
+				'deleted',
2258
+				['action' => 'default', 'status' => 'trash']
2259
+			);
2260
+		}
2261
+	}
2262
+
2263
+
2264
+	/**
2265
+	 * _delete_events
2266
+	 *
2267
+	 * @access protected
2268
+	 * @return void
2269
+	 * @throws EE_Error
2270
+	 * @throws InvalidArgumentException
2271
+	 * @throws InvalidDataTypeException
2272
+	 * @throws InvalidInterfaceException
2273
+	 * @throws ReflectionException
2274
+	 */
2275
+	protected function _delete_events()
2276
+	{
2277
+		$success = true;
2278
+		// get list of events with no prices
2279
+		$espresso_no_ticket_prices = get_option('ee_no_ticket_prices', []);
2280
+		// determine the event id and set to array.
2281
+		$EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : [];
2282
+		// loop thru events
2283
+		foreach ($EVT_IDs as $EVT_ID) {
2284
+			$EVT_ID = absint($EVT_ID);
2285
+			if ($EVT_ID) {
2286
+				$results = $this->_permanently_delete_event($EVT_ID);
2287
+				$success = $results !== false ? $success : false;
2288
+				// remove this event from the list of events with no prices
2289
+				unset($espresso_no_ticket_prices[ $EVT_ID ]);
2290
+			} else {
2291
+				$success = false;
2292
+				$msg = esc_html__(
2293
+					'An error occurred. An event could not be deleted because a valid event ID was not not supplied.',
2294
+					'event_espresso'
2295
+				);
2296
+				EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2297
+			}
2298
+		}
2299
+		update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2300
+		// in order to force a pluralized result message we need to send back a success status greater than 1
2301
+		$success = $success ? 2 : false;
2302
+		$this->_redirect_after_action($success, 'Events', 'deleted', ['action' => 'default']);
2303
+	}
2304
+
2305
+
2306
+	/**
2307
+	 * _permanently_delete_event
2308
+	 *
2309
+	 * @access  private
2310
+	 * @param int $EVT_ID
2311
+	 * @return bool
2312
+	 * @throws EE_Error
2313
+	 * @throws InvalidArgumentException
2314
+	 * @throws InvalidDataTypeException
2315
+	 * @throws InvalidInterfaceException
2316
+	 * @throws ReflectionException
2317
+	 */
2318
+	private function _permanently_delete_event($EVT_ID = 0)
2319
+	{
2320
+		// grab event id
2321
+		if (! $EVT_ID) {
2322
+			$msg = esc_html__(
2323
+				'An error occurred. No Event ID or an invalid Event ID was received.',
2324
+				'event_espresso'
2325
+			);
2326
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2327
+			return false;
2328
+		}
2329
+		if (! $this->_cpt_model_obj instanceof EE_Event
2330
+			|| $this->_cpt_model_obj->ID() !== $EVT_ID
2331
+		) {
2332
+			$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2333
+		}
2334
+		if (! $this->_cpt_model_obj instanceof EE_Event) {
2335
+			return false;
2336
+		}
2337
+		// need to delete related tickets and prices first.
2338
+		$datetimes = $this->_cpt_model_obj->get_many_related('Datetime');
2339
+		foreach ($datetimes as $datetime) {
2340
+			$this->_cpt_model_obj->_remove_relation_to($datetime, 'Datetime');
2341
+			$tickets = $datetime->get_many_related('Ticket');
2342
+			foreach ($tickets as $ticket) {
2343
+				$ticket->_remove_relation_to($datetime, 'Datetime');
2344
+				$ticket->delete_related_permanently('Price');
2345
+				$ticket->delete_permanently();
2346
+			}
2347
+			$datetime->delete();
2348
+		}
2349
+		// what about related venues or terms?
2350
+		$venues = $this->_cpt_model_obj->get_many_related('Venue');
2351
+		foreach ($venues as $venue) {
2352
+			$this->_cpt_model_obj->_remove_relation_to($venue, 'Venue');
2353
+		}
2354
+		// any attached question groups?
2355
+		$question_groups = $this->_cpt_model_obj->get_many_related('Question_Group');
2356
+		if (! empty($question_groups)) {
2357
+			foreach ($question_groups as $question_group) {
2358
+				$this->_cpt_model_obj->_remove_relation_to($question_group, 'Question_Group');
2359
+			}
2360
+		}
2361
+		// Message Template Groups
2362
+		$this->_cpt_model_obj->_remove_relations('Message_Template_Group');
2363
+		/** @type EE_Term_Taxonomy[] $term_taxonomies */
2364
+		$term_taxonomies = $this->_cpt_model_obj->term_taxonomies();
2365
+		foreach ($term_taxonomies as $term_taxonomy) {
2366
+			$this->_cpt_model_obj->remove_relation_to_term_taxonomy($term_taxonomy);
2367
+		}
2368
+		$success = $this->_cpt_model_obj->delete_permanently();
2369
+		// did it all go as planned ?
2370
+		if ($success) {
2371
+			$msg = sprintf(esc_html__('Event ID # %d has been deleted.', 'event_espresso'), $EVT_ID);
2372
+			EE_Error::add_success($msg);
2373
+		} else {
2374
+			$msg = sprintf(
2375
+				esc_html__('An error occurred. Event ID # %d could not be deleted.', 'event_espresso'),
2376
+				$EVT_ID
2377
+			);
2378
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2379
+			return false;
2380
+		}
2381
+		do_action('AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted', $EVT_ID);
2382
+		return true;
2383
+	}
2384
+
2385
+
2386
+	/**
2387
+	 * get total number of events
2388
+	 *
2389
+	 * @access public
2390
+	 * @return int
2391
+	 * @throws EE_Error
2392
+	 * @throws InvalidArgumentException
2393
+	 * @throws InvalidDataTypeException
2394
+	 * @throws InvalidInterfaceException
2395
+	 */
2396
+	public function total_events()
2397
+	{
2398
+		$count = EEM_Event::instance()->count(['caps' => 'read_admin'], 'EVT_ID', true);
2399
+		return $count;
2400
+	}
2401
+
2402
+
2403
+	/**
2404
+	 * get total number of draft events
2405
+	 *
2406
+	 * @access public
2407
+	 * @return int
2408
+	 * @throws EE_Error
2409
+	 * @throws InvalidArgumentException
2410
+	 * @throws InvalidDataTypeException
2411
+	 * @throws InvalidInterfaceException
2412
+	 */
2413
+	public function total_events_draft()
2414
+	{
2415
+		$where = [
2416
+			'status' => ['IN', ['draft', 'auto-draft']],
2417
+		];
2418
+		$count = EEM_Event::instance()->count([$where, 'caps' => 'read_admin'], 'EVT_ID', true);
2419
+		return $count;
2420
+	}
2421
+
2422
+
2423
+	/**
2424
+	 * get total number of trashed events
2425
+	 *
2426
+	 * @access public
2427
+	 * @return int
2428
+	 * @throws EE_Error
2429
+	 * @throws InvalidArgumentException
2430
+	 * @throws InvalidDataTypeException
2431
+	 * @throws InvalidInterfaceException
2432
+	 */
2433
+	public function total_trashed_events()
2434
+	{
2435
+		$where = [
2436
+			'status' => 'trash',
2437
+		];
2438
+		$count = EEM_Event::instance()->count([$where, 'caps' => 'read_admin'], 'EVT_ID', true);
2439
+		return $count;
2440
+	}
2441
+
2442
+
2443
+	/**
2444
+	 *    _default_event_settings
2445
+	 *    This generates the Default Settings Tab
2446
+	 *
2447
+	 * @return void
2448
+	 * @throws DomainException
2449
+	 * @throws EE_Error
2450
+	 * @throws InvalidArgumentException
2451
+	 * @throws InvalidDataTypeException
2452
+	 * @throws InvalidInterfaceException
2453
+	 */
2454
+	protected function _default_event_settings()
2455
+	{
2456
+		$this->_set_add_edit_form_tags('update_default_event_settings');
2457
+		$this->_set_publish_post_box_vars(null, false, false, null, false);
2458
+		$this->_template_args['admin_page_content'] = $this->_default_event_settings_form()->get_html();
2459
+		$this->display_admin_page_with_sidebar();
2460
+	}
2461
+
2462
+
2463
+	/**
2464
+	 * Return the form for event settings.
2465
+	 *
2466
+	 * @return EE_Form_Section_Proper
2467
+	 * @throws EE_Error
2468
+	 */
2469
+	protected function _default_event_settings_form()
2470
+	{
2471
+		$registration_config = EE_Registry::instance()->CFG->registration;
2472
+		$registration_stati_for_selection = EEM_Registration::reg_status_array(
2473
+		// exclude
2474
+			[
2475
+				EEM_Registration::status_id_cancelled,
2476
+				EEM_Registration::status_id_declined,
2477
+				EEM_Registration::status_id_incomplete,
2478
+				EEM_Registration::status_id_wait_list,
2479
+			],
2480
+			true
2481
+		);
2482
+		return new EE_Form_Section_Proper(
2483
+			[
2484
+				'name'            => 'update_default_event_settings',
2485
+				'html_id'         => 'update_default_event_settings',
2486
+				'html_class'      => 'form-table',
2487
+				'layout_strategy' => new EE_Admin_Two_Column_Layout(),
2488
+				'subsections'     => apply_filters(
2489
+					'FHEE__Events_Admin_Page___default_event_settings_form__form_subsections',
2490
+					[
2491
+						'default_reg_status'  => new EE_Select_Input(
2492
+							$registration_stati_for_selection,
2493
+							[
2494
+								'default'         => isset($registration_config->default_STS_ID)
2495
+													 && array_key_exists(
2496
+														 $registration_config->default_STS_ID,
2497
+														 $registration_stati_for_selection
2498
+													 )
2499
+									? sanitize_text_field($registration_config->default_STS_ID)
2500
+									: EEM_Registration::status_id_pending_payment,
2501
+								'html_label_text' => esc_html__('Default Registration Status', 'event_espresso')
2502
+													 . EEH_Template::get_help_tab_link(
2503
+														 'default_settings_status_help_tab'
2504
+													 ),
2505
+								'html_help_text'  => esc_html__(
2506
+									'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.',
2507
+									'event_espresso'
2508
+								),
2509
+							]
2510
+						),
2511
+						'default_max_tickets' => new EE_Integer_Input(
2512
+							[
2513
+								'default'         => isset($registration_config->default_maximum_number_of_tickets)
2514
+									? $registration_config->default_maximum_number_of_tickets
2515
+									: EEM_Event::get_default_additional_limit(),
2516
+								'html_label_text' => esc_html__(
2517
+									'Default Maximum Tickets Allowed Per Order:',
2518
+									'event_espresso'
2519
+								)
2520
+													 . EEH_Template::get_help_tab_link(
2521
+														 'default_maximum_tickets_help_tab"'
2522
+													 ),
2523
+								'html_help_text'  => esc_html__(
2524
+									'This setting allows you to indicate what will be the default for the maximum number of tickets per order when creating new events.',
2525
+									'event_espresso'
2526
+								),
2527
+							]
2528
+						),
2529
+					]
2530
+				),
2531
+			]
2532
+		);
2533
+	}
2534
+
2535
+
2536
+	/**
2537
+	 * @return void
2538
+	 * @throws EE_Error
2539
+	 * @throws InvalidArgumentException
2540
+	 * @throws InvalidDataTypeException
2541
+	 * @throws InvalidInterfaceException
2542
+	 */
2543
+	protected function _update_default_event_settings()
2544
+	{
2545
+		$form = $this->_default_event_settings_form();
2546
+		if ($form->was_submitted()) {
2547
+			$form->receive_form_submission();
2548
+			if ($form->is_valid()) {
2549
+				$registration_config = EE_Registry::instance()->CFG->registration;
2550
+				$valid_data = $form->valid_data();
2551
+				if (isset($valid_data['default_reg_status'])) {
2552
+					$registration_config->default_STS_ID = $valid_data['default_reg_status'];
2553
+				}
2554
+				if (isset($valid_data['default_max_tickets'])) {
2555
+					$registration_config->default_maximum_number_of_tickets = $valid_data['default_max_tickets'];
2556
+				}
2557
+				do_action(
2558
+					'AHEE__Events_Admin_Page___update_default_event_settings',
2559
+					$valid_data,
2560
+					EE_Registry::instance()->CFG,
2561
+					$this
2562
+				);
2563
+				// update because data was valid!
2564
+				EE_Registry::instance()->CFG->update_espresso_config();
2565
+				EE_Error::overwrite_success();
2566
+				EE_Error::add_success(
2567
+					__('Default Event Settings were updated', 'event_espresso')
2568
+				);
2569
+			}
2570
+		}
2571
+		$this->_redirect_after_action(0, '', '', ['action' => 'default_event_settings'], true);
2572
+	}
2573
+
2574
+
2575
+	/*************        Templates        *************/
2576
+	protected function _template_settings()
2577
+	{
2578
+		$this->_admin_page_title = esc_html__('Template Settings (Preview)', 'event_espresso');
2579
+		$this->_template_args['preview_img'] = '<img src="'
2580
+											   . EVENTS_ASSETS_URL
2581
+											   . '/images/'
2582
+											   . 'caffeinated_template_features.jpg" alt="'
2583
+											   . esc_attr__('Template Settings Preview screenshot', 'event_espresso')
2584
+											   . '" />';
2585
+		$this->_template_args['preview_text'] = '<strong>'
2586
+												. esc_html__(
2587
+													'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.',
2588
+													'event_espresso'
2589
+												) . '</strong>';
2590
+		$this->display_admin_caf_preview_page('template_settings_tab');
2591
+	}
2592
+
2593
+
2594
+	/** Event Category Stuff **/
2595
+	/**
2596
+	 * set the _category property with the category object for the loaded page.
2597
+	 *
2598
+	 * @access private
2599
+	 * @return void
2600
+	 */
2601
+	private function _set_category_object()
2602
+	{
2603
+		if (isset($this->_category->id) && ! empty($this->_category->id)) {
2604
+			return;
2605
+		} //already have the category object so get out.
2606
+		// set default category object
2607
+		$this->_set_empty_category_object();
2608
+		// only set if we've got an id
2609
+		if (! isset($this->_req_data['EVT_CAT_ID'])) {
2610
+			return;
2611
+		}
2612
+		$category_id = absint($this->_req_data['EVT_CAT_ID']);
2613
+		$term = get_term($category_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2614
+		if (! empty($term)) {
2615
+			$this->_category->category_name = $term->name;
2616
+			$this->_category->category_identifier = $term->slug;
2617
+			$this->_category->category_desc = $term->description;
2618
+			$this->_category->id = $term->term_id;
2619
+			$this->_category->parent = $term->parent;
2620
+		}
2621
+	}
2622
+
2623
+
2624
+	/**
2625
+	 * Clears out category properties.
2626
+	 */
2627
+	private function _set_empty_category_object()
2628
+	{
2629
+		$this->_category = new stdClass();
2630
+		$this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc = '';
2631
+		$this->_category->id = $this->_category->parent = 0;
2632
+	}
2633
+
2634
+
2635
+	/**
2636
+	 * @throws DomainException
2637
+	 * @throws EE_Error
2638
+	 * @throws InvalidArgumentException
2639
+	 * @throws InvalidDataTypeException
2640
+	 * @throws InvalidInterfaceException
2641
+	 */
2642
+	protected function _category_list_table()
2643
+	{
2644
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2645
+		$this->_search_btn_label = esc_html__('Categories', 'event_espresso');
2646
+		$this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
2647
+			'add_category',
2648
+			'add_category',
2649
+			[],
2650
+			'add-new-h2'
2651
+		);
2652
+		$this->display_admin_list_table_page_with_sidebar();
2653
+	}
2654
+
2655
+
2656
+	/**
2657
+	 * Output category details view.
2658
+	 *
2659
+	 * @param string $view
2660
+	 * @throws DomainException
2661
+	 * @throws EE_Error
2662
+	 * @throws InvalidArgumentException
2663
+	 * @throws InvalidDataTypeException
2664
+	 * @throws InvalidInterfaceException
2665
+	 */
2666
+	protected function _category_details($view)
2667
+	{
2668
+		// load formatter helper
2669
+		// load field generator helper
2670
+		$route = $view === 'edit' ? 'update_category' : 'insert_category';
2671
+		$this->_set_add_edit_form_tags($route);
2672
+		$this->_set_category_object();
2673
+		$id = ! empty($this->_category->id) ? $this->_category->id : '';
2674
+		$delete_action = 'delete_category';
2675
+		// custom redirect
2676
+		$redirect = EE_Admin_Page::add_query_args_and_nonce(
2677
+			['action' => 'category_list'],
2678
+			$this->_admin_base_url
2679
+		);
2680
+		$this->_set_publish_post_box_vars('EVT_CAT_ID', $id, $delete_action, $redirect);
2681
+		// take care of contents
2682
+		$this->_template_args['admin_page_content'] = $this->_category_details_content();
2683
+		$this->display_admin_page_with_sidebar();
2684
+	}
2685
+
2686
+
2687
+	/**
2688
+	 * Output category details content.
2689
+	 *
2690
+	 * @throws DomainException
2691
+	 */
2692
+	protected function _category_details_content()
2693
+	{
2694
+		$editor_args['category_desc'] = [
2695
+			'type'          => 'wp_editor',
2696
+			'value'         => EEH_Formatter::admin_format_content($this->_category->category_desc),
2697
+			'class'         => 'my_editor_custom',
2698
+			'wpeditor_args' => ['media_buttons' => false],
2699
+		];
2700
+		$_wp_editor = $this->_generate_admin_form_fields($editor_args, 'array');
2701
+		$all_terms = get_terms(
2702
+			[EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY],
2703
+			['hide_empty' => 0, 'exclude' => [$this->_category->id]]
2704
+		);
2705
+		// setup category select for term parents.
2706
+		$category_select_values[] = [
2707
+			'text' => esc_html__('No Parent', 'event_espresso'),
2708
+			'id'   => 0,
2709
+		];
2710
+		foreach ($all_terms as $term) {
2711
+			$category_select_values[] = [
2712
+				'text' => $term->name,
2713
+				'id'   => $term->term_id,
2714
+			];
2715
+		}
2716
+		$category_select = EEH_Form_Fields::select_input(
2717
+			'category_parent',
2718
+			$category_select_values,
2719
+			$this->_category->parent
2720
+		);
2721
+		$template_args = [
2722
+			'category'                 => $this->_category,
2723
+			'category_select'          => $category_select,
2724
+			'unique_id_info_help_link' => $this->_get_help_tab_link('unique_id_info'),
2725
+			'category_desc_editor'     => $_wp_editor['category_desc']['field'],
2726
+			'disable'                  => '',
2727
+			'disabled_message'         => false,
2728
+		];
2729
+		$template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
2730
+		return EEH_Template::display_template($template, $template_args, true);
2731
+	}
2732
+
2733
+
2734
+	/**
2735
+	 * Handles deleting categories.
2736
+	 */
2737
+	protected function _delete_categories()
2738
+	{
2739
+		$cat_ids = isset($this->_req_data['EVT_CAT_ID']) ? (array) $this->_req_data['EVT_CAT_ID']
2740
+			: (array) $this->_req_data['category_id'];
2741
+		foreach ($cat_ids as $cat_id) {
2742
+			$this->_delete_category($cat_id);
2743
+		}
2744
+		// doesn't matter what page we're coming from... we're going to the same place after delete.
2745
+		$query_args = [
2746
+			'action' => 'category_list',
2747
+		];
2748
+		$this->_redirect_after_action(0, '', '', $query_args);
2749
+	}
2750
+
2751
+
2752
+	/**
2753
+	 * Handles deleting specific category.
2754
+	 *
2755
+	 * @param int $cat_id
2756
+	 */
2757
+	protected function _delete_category($cat_id)
2758
+	{
2759
+		$cat_id = absint($cat_id);
2760
+		wp_delete_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2761
+	}
2762
+
2763
+
2764
+	/**
2765
+	 * Handles triggering the update or insertion of a new category.
2766
+	 *
2767
+	 * @param bool $new_category true means we're triggering the insert of a new category.
2768
+	 * @throws EE_Error
2769
+	 * @throws InvalidArgumentException
2770
+	 * @throws InvalidDataTypeException
2771
+	 * @throws InvalidInterfaceException
2772
+	 */
2773
+	protected function _insert_or_update_category($new_category)
2774
+	{
2775
+		$cat_id = $new_category ? $this->_insert_category() : $this->_insert_category(true);
2776
+		$success = 0; // we already have a success message so lets not send another.
2777
+		if ($cat_id) {
2778
+			$query_args = [
2779
+				'action'     => 'edit_category',
2780
+				'EVT_CAT_ID' => $cat_id,
2781
+			];
2782
+		} else {
2783
+			$query_args = ['action' => 'add_category'];
2784
+		}
2785
+		$this->_redirect_after_action($success, '', '', $query_args, true);
2786
+	}
2787
+
2788
+
2789
+	/**
2790
+	 * Inserts or updates category
2791
+	 *
2792
+	 * @param bool $update (true indicates we're updating a category).
2793
+	 * @return bool|mixed|string
2794
+	 */
2795
+	private function _insert_category($update = false)
2796
+	{
2797
+		$cat_id = $update ? $this->_req_data['EVT_CAT_ID'] : '';
2798
+		$category_name = isset($this->_req_data['category_name']) ? $this->_req_data['category_name'] : '';
2799
+		$category_desc = isset($this->_req_data['category_desc']) ? $this->_req_data['category_desc'] : '';
2800
+		$category_parent = isset($this->_req_data['category_parent']) ? $this->_req_data['category_parent'] : 0;
2801
+		if (empty($category_name)) {
2802
+			$msg = esc_html__('You must add a name for the category.', 'event_espresso');
2803
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2804
+			return false;
2805
+		}
2806
+		$term_args = [
2807
+			'name'        => $category_name,
2808
+			'description' => $category_desc,
2809
+			'parent'      => $category_parent,
2810
+		];
2811
+		// was the category_identifier input disabled?
2812
+		if (isset($this->_req_data['category_identifier'])) {
2813
+			$term_args['slug'] = $this->_req_data['category_identifier'];
2814
+		}
2815
+		$insert_ids = $update
2816
+			? wp_update_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args)
2817
+			: wp_insert_term($category_name, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args);
2818
+		if (! is_array($insert_ids)) {
2819
+			$msg = esc_html__(
2820
+				'An error occurred and the category has not been saved to the database.',
2821
+				'event_espresso'
2822
+			);
2823
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2824
+		} else {
2825
+			$cat_id = $insert_ids['term_id'];
2826
+			$msg = sprintf(esc_html__('The category %s was successfully saved', 'event_espresso'), $category_name);
2827
+			EE_Error::add_success($msg);
2828
+		}
2829
+		return $cat_id;
2830
+	}
2831
+
2832
+
2833
+	/**
2834
+	 * Gets categories or count of categories matching the arguments in the request.
2835
+	 *
2836
+	 * @param int  $per_page
2837
+	 * @param int  $current_page
2838
+	 * @param bool $count
2839
+	 * @return EE_Base_Class[]|EE_Term_Taxonomy[]|int
2840
+	 * @throws EE_Error
2841
+	 * @throws InvalidArgumentException
2842
+	 * @throws InvalidDataTypeException
2843
+	 * @throws InvalidInterfaceException
2844
+	 */
2845
+	public function get_categories($per_page = 10, $current_page = 1, $count = false)
2846
+	{
2847
+		// testing term stuff
2848
+		$orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'Term.term_id';
2849
+		$order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
2850
+		$limit = ($current_page - 1) * $per_page;
2851
+		$where = ['taxonomy' => EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY];
2852
+		if (isset($this->_req_data['s'])) {
2853
+			$sstr = '%' . $this->_req_data['s'] . '%';
2854
+			$where['OR'] = [
2855
+				'Term.name'   => ['LIKE', $sstr],
2856
+				'description' => ['LIKE', $sstr],
2857
+			];
2858
+		}
2859
+		$query_params = [
2860
+			$where,
2861
+			'order_by'   => [$orderby => $order],
2862
+			'limit'      => $limit . ',' . $per_page,
2863
+			'force_join' => ['Term'],
2864
+		];
2865
+		$categories = $count
2866
+			? EEM_Term_Taxonomy::instance()->count($query_params, 'term_id')
2867
+			: EEM_Term_Taxonomy::instance()->get_all($query_params);
2868
+		return $categories;
2869
+	}
2870
+
2871
+	/* end category stuff */
2872
+	/**************/
2873
+
2874
+
2875
+	/**
2876
+	 * Callback for the `ee_save_timezone_setting` ajax action.
2877
+	 *
2878
+	 * @throws EE_Error
2879
+	 * @throws InvalidArgumentException
2880
+	 * @throws InvalidDataTypeException
2881
+	 * @throws InvalidInterfaceException
2882
+	 */
2883
+	public function save_timezonestring_setting()
2884
+	{
2885
+		$timezone_string = isset($this->_req_data['timezone_selected'])
2886
+			? $this->_req_data['timezone_selected']
2887
+			: '';
2888
+		if (empty($timezone_string) || ! EEH_DTT_Helper::validate_timezone($timezone_string, false)) {
2889
+			EE_Error::add_error(
2890
+				esc_html__('An invalid timezone string submitted.', 'event_espresso'),
2891
+				__FILE__,
2892
+				__FUNCTION__,
2893
+				__LINE__
2894
+			);
2895
+			$this->_template_args['error'] = true;
2896
+			$this->_return_json();
2897
+		}
2898
+
2899
+		update_option('timezone_string', $timezone_string);
2900
+		EE_Error::add_success(
2901
+			esc_html__('Your timezone string was updated.', 'event_espresso')
2902
+		);
2903
+		$this->_template_args['success'] = true;
2904
+		$this->_return_json(true, ['action' => 'create_new']);
2905
+	}
2906 2906
 }
Please login to merge, or discard this patch.
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
         ];
504 504
         // only load EE_Event_Editor_Decaf_Tips if domain is not caffeinated
505 505
         $domain = $this->loader->getShared('EventEspresso\core\domain\Domain');
506
-        if (! $domain->isCaffeinated()) {
506
+        if ( ! $domain->isCaffeinated()) {
507 507
             $this->_page_config['create_new']['qtips'] = ['EE_Event_Editor_Decaf_Tips'];
508 508
             $this->_page_config['edit']['qtips'] = ['EE_Event_Editor_Decaf_Tips'];
509 509
         }
@@ -562,13 +562,13 @@  discard block
 block discarded – undo
562 562
     {
563 563
         wp_register_style(
564 564
             'events-admin-css',
565
-            EVENTS_ASSETS_URL . 'events-admin-page.css',
565
+            EVENTS_ASSETS_URL.'events-admin-page.css',
566 566
             [],
567 567
             EVENT_ESPRESSO_VERSION
568 568
         );
569 569
         wp_register_style(
570 570
             'ee-cat-admin',
571
-            EVENTS_ASSETS_URL . 'ee-cat-admin.css',
571
+            EVENTS_ASSETS_URL.'ee-cat-admin.css',
572 572
             [],
573 573
             EVENT_ESPRESSO_VERSION
574 574
         );
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
         // scripts
578 578
         wp_register_script(
579 579
             'event_editor_js',
580
-            EVENTS_ASSETS_URL . 'event_editor.js',
580
+            EVENTS_ASSETS_URL.'event_editor.js',
581 581
             ['ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon'],
582 582
             EVENT_ESPRESSO_VERSION,
583 583
             true
@@ -603,16 +603,16 @@  discard block
 block discarded – undo
603 603
         wp_enqueue_style('espresso-ui-theme');
604 604
         wp_register_style(
605 605
             'event-editor-css',
606
-            EVENTS_ASSETS_URL . 'event-editor.css',
606
+            EVENTS_ASSETS_URL.'event-editor.css',
607 607
             ['ee-admin-css'],
608 608
             EVENT_ESPRESSO_VERSION
609 609
         );
610 610
         wp_enqueue_style('event-editor-css');
611 611
         // scripts
612
-        if (! $this->admin_config->useAdvancedEditor()) {
612
+        if ( ! $this->admin_config->useAdvancedEditor()) {
613 613
             wp_register_script(
614 614
                 'event-datetime-metabox',
615
-                EVENTS_ASSETS_URL . 'event-datetime-metabox.js',
615
+                EVENTS_ASSETS_URL.'event-datetime-metabox.js',
616 616
                 ['event_editor_js', 'ee-datepicker'],
617 617
                 EVENT_ESPRESSO_VERSION
618 618
             );
@@ -682,15 +682,15 @@  discard block
 block discarded – undo
682 682
     public function verify_event_edit($event = null, $req_type = '')
683 683
     {
684 684
         // don't need to do this when processing
685
-        if (! empty($req_type)) {
685
+        if ( ! empty($req_type)) {
686 686
             return;
687 687
         }
688 688
         // no event?
689
-        if (! $event instanceof EE_Event) {
689
+        if ( ! $event instanceof EE_Event) {
690 690
             $event = $this->_cpt_model_obj;
691 691
         }
692 692
         // STILL no event?
693
-        if (! $event instanceof EE_Event) {
693
+        if ( ! $event instanceof EE_Event) {
694 694
             return;
695 695
         }
696 696
         $orig_status = $event->status();
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
             );
730 730
         }
731 731
         // now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
732
-        if (! $event->tickets_on_sale()) {
732
+        if ( ! $event->tickets_on_sale()) {
733 733
             return;
734 734
         }
735 735
         // made it here so show warning
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
     {
778 778
         $has_timezone_string = get_option('timezone_string');
779 779
         // only nag them about setting their timezone if it's their first event, and they haven't already done it
780
-        if (! $has_timezone_string && ! EEM_Event::instance()->exists([])) {
780
+        if ( ! $has_timezone_string && ! EEM_Event::instance()->exists([])) {
781 781
             EE_Error::add_attention(
782 782
                 sprintf(
783 783
                     __(
@@ -861,31 +861,31 @@  discard block
 block discarded – undo
861 861
         $items = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items);
862 862
         $statuses = [
863 863
             'sold_out_status'  => [
864
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out,
864
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::sold_out,
865 865
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::sold_out, false, 'sentence'),
866 866
             ],
867 867
             'active_status'    => [
868
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active,
868
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::active,
869 869
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::active, false, 'sentence'),
870 870
             ],
871 871
             'upcoming_status'  => [
872
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming,
872
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::upcoming,
873 873
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::upcoming, false, 'sentence'),
874 874
             ],
875 875
             'postponed_status' => [
876
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed,
876
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::postponed,
877 877
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::postponed, false, 'sentence'),
878 878
             ],
879 879
             'cancelled_status' => [
880
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled,
880
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::cancelled,
881 881
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::cancelled, false, 'sentence'),
882 882
             ],
883 883
             'expired_status'   => [
884
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired,
884
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::expired,
885 885
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::expired, false, 'sentence'),
886 886
             ],
887 887
             'inactive_status'  => [
888
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive,
888
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::inactive,
889 889
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::inactive, false, 'sentence'),
890 890
             ],
891 891
         ];
@@ -904,7 +904,7 @@  discard block
 block discarded – undo
904 904
      */
905 905
     private function _event_model()
906 906
     {
907
-        if (! $this->_event_model instanceof EEM_Event) {
907
+        if ( ! $this->_event_model instanceof EEM_Event) {
908 908
             $this->_event_model = EE_Registry::instance()->load_model('Event');
909 909
         }
910 910
         return $this->_event_model;
@@ -924,7 +924,7 @@  discard block
 block discarded – undo
924 924
     public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug)
925 925
     {
926 926
         // make sure this is only when editing
927
-        if (! empty($id)) {
927
+        if ( ! empty($id)) {
928 928
             $post = get_post($id);
929 929
             $return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'
930 930
                        . esc_html__('Shortcode', 'event_espresso')
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
                                                                                   'button'
963 963
                                                                               );
964 964
         $this->_template_args['after_list_table']['legend'] = $this->_display_legend($this->_event_legend_items());
965
-        $this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
965
+        $this->_admin_page_title .= ' '.$this->get_action_link_or_button(
966 966
             'create_new',
967 967
             'add',
968 968
             [],
@@ -1025,7 +1025,7 @@  discard block
 block discarded – undo
1025 1025
         /** @var FeatureFlags $flags */
1026 1026
         $flags = $this->loader->getShared('EventEspresso\core\domain\services\capabilities\FeatureFlags');
1027 1027
         // check if the new EDTR reg options meta box is being used, and if so, don't run updates for legacy version
1028
-        if (! $this->admin_config->useAdvancedEditor() || ! $flags->featureAllowed('use_reg_options_meta_box')) {
1028
+        if ( ! $this->admin_config->useAdvancedEditor() || ! $flags->featureAllowed('use_reg_options_meta_box')) {
1029 1029
             $event_values['EVT_display_ticket_selector'] =
1030 1030
                 ! empty($this->_req_data['display_ticket_selector'])
1031 1031
                     ? 1
@@ -1135,7 +1135,7 @@  discard block
 block discarded – undo
1135 1135
      */
1136 1136
     protected function _default_venue_update(EE_Event $evtobj, $data)
1137 1137
     {
1138
-        require_once(EE_MODELS . 'EEM_Venue.model.php');
1138
+        require_once(EE_MODELS.'EEM_Venue.model.php');
1139 1139
         $venue_model = EE_Registry::instance()->load_model('Venue');
1140 1140
         $rows_affected = null;
1141 1141
         $venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : null;
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
             'status'              => 'publish',
1167 1167
         ];
1168 1168
         // if we've got the venue_id then we're just updating the existing venue so let's do that and then get out.
1169
-        if (! empty($venue_id)) {
1169
+        if ( ! empty($venue_id)) {
1170 1170
             $update_where = [$venue_model->primary_key_name() => $venue_id];
1171 1171
             $rows_affected = $venue_model->update($venue_array, [$update_where]);
1172 1172
             // we've gotta make sure that the venue is always attached to a revision.. add_relation_to should take care of making sure that the relation is already present.
@@ -1216,7 +1216,7 @@  discard block
 block discarded – undo
1216 1216
                 'DTT_order'     => $row,
1217 1217
             ];
1218 1218
             // if we have an id then let's get existing object first and then set the new values.  Otherwise we instantiate a new object for save.
1219
-            if (! empty($dtt['DTT_ID'])) {
1219
+            if ( ! empty($dtt['DTT_ID'])) {
1220 1220
                 $DTM = EE_Registry::instance()
1221 1221
                                   ->load_model('Datetime', [$evtobj->get_timezone()])
1222 1222
                                   ->get_one_by_ID($dtt['DTT_ID']);
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
                     $DTM->set($field, $value);
1227 1227
                 }
1228 1228
                 // make sure the $dtt_id here is saved just in case after the add_relation_to() the autosave replaces it.  We need to do this so we dont' TRASH the parent DTT.
1229
-                $saved_dtts[ $DTM->ID() ] = $DTM;
1229
+                $saved_dtts[$DTM->ID()] = $DTM;
1230 1230
             } else {
1231 1231
                 $DTM = EE_Registry::instance()->load_class(
1232 1232
                     'Datetime',
@@ -1259,14 +1259,14 @@  discard block
 block discarded – undo
1259 1259
         foreach ($data['edit_tickets'] as $row => $tkt) {
1260 1260
             $incoming_date_formats = ['Y-m-d', 'h:i a'];
1261 1261
             $update_prices = false;
1262
-            $ticket_price = isset($data['edit_prices'][ $row ][1]['PRC_amount'])
1263
-                ? $data['edit_prices'][ $row ][1]['PRC_amount'] : 0;
1262
+            $ticket_price = isset($data['edit_prices'][$row][1]['PRC_amount'])
1263
+                ? $data['edit_prices'][$row][1]['PRC_amount'] : 0;
1264 1264
             // trim inputs to ensure any excess whitespace is removed.
1265 1265
             $tkt = array_map('trim', $tkt);
1266 1266
             if (empty($tkt['TKT_start_date'])) {
1267 1267
                 // let's use now in the set timezone.
1268 1268
                 $now = new DateTime('now', new DateTimeZone($evtobj->get_timezone()));
1269
-                $tkt['TKT_start_date'] = $now->format($incoming_date_formats[0] . ' ' . $incoming_date_formats[1]);
1269
+                $tkt['TKT_start_date'] = $now->format($incoming_date_formats[0].' '.$incoming_date_formats[1]);
1270 1270
             }
1271 1271
             if (empty($tkt['TKT_end_date'])) {
1272 1272
                 // use the start date of the first datetime
@@ -1301,7 +1301,7 @@  discard block
 block discarded – undo
1301 1301
             // if we have a TKT_ID then we need to get that existing TKT_obj and update it
1302 1302
             // we actually do our saves a head of doing any add_relations to because its entirely possible that this ticket didn't removed or added to any datetime in the session but DID have it's items modified.
1303 1303
             // keep in mind that if the TKT has been sold (and we have changed pricing information), then we won't be updating the tkt but instead a new tkt will be created and the old one archived.
1304
-            if (! empty($tkt['TKT_ID'])) {
1304
+            if ( ! empty($tkt['TKT_ID'])) {
1305 1305
                 $TKT = EE_Registry::instance()
1306 1306
                                   ->load_model('Ticket', [$evtobj->get_timezone()])
1307 1307
                                   ->get_one_by_ID($tkt['TKT_ID']);
@@ -1342,7 +1342,7 @@  discard block
 block discarded – undo
1342 1342
                         $TKT->set('TKT_deleted', 1);
1343 1343
                         $TKT->save();
1344 1344
                         // make sure this ticket is still recorded in our saved_tkts so we don't run it through the regular trash routine.
1345
-                        $saved_tickets[ $TKT->ID() ] = $TKT;
1345
+                        $saved_tickets[$TKT->ID()] = $TKT;
1346 1346
                         // create new ticket that's a copy of the existing except a new id of course (and not archived) AND has the new TKT_price associated with it.
1347 1347
                         $TKT = clone $TKT;
1348 1348
                         $TKT->set('TKT_ID', 0);
@@ -1387,9 +1387,9 @@  discard block
 block discarded – undo
1387 1387
             }
1388 1388
             // initially let's add the ticket to the dtt
1389 1389
             $saved_dtt->_add_relation_to($TKT, 'Ticket');
1390
-            $saved_tickets[ $TKT->ID() ] = $TKT;
1390
+            $saved_tickets[$TKT->ID()] = $TKT;
1391 1391
             // add prices to ticket
1392
-            $this->_add_prices_to_ticket($data['edit_prices'][ $row ], $TKT, $update_prices);
1392
+            $this->_add_prices_to_ticket($data['edit_prices'][$row], $TKT, $update_prices);
1393 1393
         }
1394 1394
         // however now we need to handle permanently deleting tickets via the ui.  Keep in mind that the ui does not allow deleting/archiving tickets that have ticket sold.  However, it does allow for deleting tickets that have no tickets sold, in which case we want to get rid of permanently because there is no need to save in db.
1395 1395
         $old_tickets = isset($old_tickets[0]) && $old_tickets[0] === '' ? [] : $old_tickets;
@@ -1557,7 +1557,7 @@  discard block
 block discarded – undo
1557 1557
         $publish_box_extra_args['event_editor_overview_add'] = ob_get_clean();
1558 1558
         // load template
1559 1559
         EEH_Template::display_template(
1560
-            EVENTS_TEMPLATE_PATH . 'event_publish_box_extras.template.php',
1560
+            EVENTS_TEMPLATE_PATH.'event_publish_box_extras.template.php',
1561 1561
             $publish_box_extra_args
1562 1562
         );
1563 1563
     }
@@ -1593,7 +1593,7 @@  discard block
 block discarded – undo
1593 1593
         /** @var FeatureFlags $flags */
1594 1594
         $flags = $this->loader->getShared('EventEspresso\core\domain\services\capabilities\FeatureFlags');
1595 1595
         // check if the new EDTR reg options meta box is being used, and if so, don't load the legacy version
1596
-        if (! $use_advanced_editor || ! $flags->featureAllowed('use_reg_options_meta_box')) {
1596
+        if ( ! $use_advanced_editor || ! $flags->featureAllowed('use_reg_options_meta_box')) {
1597 1597
             add_meta_box(
1598 1598
                 'espresso_event_editor_event_options',
1599 1599
                 esc_html__('Event Registration Options', 'event_espresso'),
@@ -1602,7 +1602,7 @@  discard block
 block discarded – undo
1602 1602
                 'side'
1603 1603
             );
1604 1604
         }
1605
-        if (! $use_advanced_editor) {
1605
+        if ( ! $use_advanced_editor) {
1606 1606
             add_meta_box(
1607 1607
                 'espresso_event_editor_tickets',
1608 1608
                 esc_html__('Event Datetime & Ticket', 'event_espresso'),
@@ -1615,7 +1615,7 @@  discard block
 block discarded – undo
1615 1615
             if ($flags->featureAllowed('use_reg_options_meta_box')) {
1616 1616
                 add_action(
1617 1617
                     'add_meta_boxes_espresso_events',
1618
-                    function () {
1618
+                    function() {
1619 1619
                         global $current_screen;
1620 1620
                         remove_meta_box('authordiv', $current_screen, 'normal');
1621 1621
                     },
@@ -1676,7 +1676,7 @@  discard block
 block discarded – undo
1676 1676
                     'default_where_conditions' => 'none',
1677 1677
                 ]
1678 1678
             );
1679
-            if (! empty($related_tickets)) {
1679
+            if ( ! empty($related_tickets)) {
1680 1680
                 $template_args['total_ticket_rows'] = count($related_tickets);
1681 1681
                 $row = 0;
1682 1682
                 foreach ($related_tickets as $ticket) {
@@ -1710,7 +1710,7 @@  discard block
 block discarded – undo
1710 1710
         );
1711 1711
         $template = apply_filters(
1712 1712
             'FHEE__Events_Admin_Page__ticket_metabox__template',
1713
-            EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php'
1713
+            EVENTS_TEMPLATE_PATH.'event_tickets_metabox_main.template.php'
1714 1714
         );
1715 1715
         EEH_Template::display_template($template, $template_args);
1716 1716
     }
@@ -1734,7 +1734,7 @@  discard block
 block discarded – undo
1734 1734
     private function _get_ticket_row($ticket, $skeleton = false, $row = 0)
1735 1735
     {
1736 1736
         $template_args = [
1737
-            'tkt_status_class'    => ' tkt-status-' . $ticket->ticket_status(),
1737
+            'tkt_status_class'    => ' tkt-status-'.$ticket->ticket_status(),
1738 1738
             'tkt_archive_class'   => $ticket->ticket_status() === EE_Ticket::archived && ! $skeleton ? ' tkt-archived'
1739 1739
                 : '',
1740 1740
             'ticketrow'           => $skeleton ? 'TICKETNUM' : $row,
@@ -1746,10 +1746,10 @@  discard block
 block discarded – undo
1746 1746
             'TKT_qty'             => $ticket->get_pretty('TKT_qty', 'input'),
1747 1747
             'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1748 1748
             'TKT_sold'            => $skeleton ? 0 : $ticket->get('TKT_sold'),
1749
-            'trash_icon'          => ($skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')))
1750
-                                     && (! empty($ticket) && $ticket->get('TKT_sold') === 0)
1749
+            'trash_icon'          => ($skeleton || ( ! empty($ticket) && ! $ticket->get('TKT_deleted')))
1750
+                                     && ( ! empty($ticket) && $ticket->get('TKT_sold') === 0)
1751 1751
                 ? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1752
-            'disabled'            => $skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')) ? ''
1752
+            'disabled'            => $skeleton || ( ! empty($ticket) && ! $ticket->get('TKT_deleted')) ? ''
1753 1753
                 : ' disabled=disabled',
1754 1754
         ];
1755 1755
         $price = $ticket->ID() !== 0
@@ -1776,7 +1776,7 @@  discard block
 block discarded – undo
1776 1776
                     ['order_by' => ['DTT_EVT_start' => 'ASC']]
1777 1777
                 )
1778 1778
                 : null;
1779
-            if (! empty($earliest_dtt)) {
1779
+            if ( ! empty($earliest_dtt)) {
1780 1780
                 $template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1781 1781
             } else {
1782 1782
                 $template_args['TKT_end_date'] = date(
@@ -1788,7 +1788,7 @@  discard block
 block discarded – undo
1788 1788
         $template_args = array_merge($template_args, $price_args);
1789 1789
         $template = apply_filters(
1790 1790
             'FHEE__Events_Admin_Page__get_ticket_row__template',
1791
-            EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_ticket_row.template.php',
1791
+            EVENTS_TEMPLATE_PATH.'event_tickets_metabox_ticket_row.template.php',
1792 1792
             $ticket
1793 1793
         );
1794 1794
         return EEH_Template::display_template($template, $template_args, true);
@@ -1843,7 +1843,7 @@  discard block
 block discarded – undo
1843 1843
             $default_reg_status_values
1844 1844
         );
1845 1845
         EEH_Template::display_template(
1846
-            EVENTS_TEMPLATE_PATH . 'event_registration_options.template.php',
1846
+            EVENTS_TEMPLATE_PATH.'event_registration_options.template.php',
1847 1847
             $template_args
1848 1848
         );
1849 1849
     }
@@ -1873,7 +1873,7 @@  discard block
 block discarded – undo
1873 1873
     {
1874 1874
         $EEME = $this->_event_model();
1875 1875
         $offset = ($current_page - 1) * $per_page;
1876
-        $limit = $count ? null : $offset . ',' . $per_page;
1876
+        $limit = $count ? null : $offset.','.$per_page;
1877 1877
         $orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'EVT_ID';
1878 1878
         $order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
1879 1879
         if (isset($this->_req_data['month_range'])) {
@@ -1902,7 +1902,7 @@  discard block
 block discarded – undo
1902 1902
         // categories?
1903 1903
         $category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0
1904 1904
             ? $this->_req_data['EVT_CAT'] : null;
1905
-        if (! empty($category)) {
1905
+        if ( ! empty($category)) {
1906 1906
             $where['Term_Taxonomy.taxonomy'] = EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY;
1907 1907
             $where['Term_Taxonomy.term_id'] = $category;
1908 1908
         }
@@ -1910,7 +1910,7 @@  discard block
 block discarded – undo
1910 1910
         $start_formats = EEM_Datetime::instance()->get_formats_for('DTT_EVT_start');
1911 1911
         if (isset($this->_req_data['month_range']) && $this->_req_data['month_range'] !== '') {
1912 1912
             $DateTime = new DateTime(
1913
-                $year_r . '-' . $month_r . '-01 00:00:00',
1913
+                $year_r.'-'.$month_r.'-01 00:00:00',
1914 1914
                 new DateTimeZone('UTC')
1915 1915
             );
1916 1916
             $start = $DateTime->getTimestamp();
@@ -1936,9 +1936,9 @@  discard block
 block discarded – undo
1936 1936
                             ->format(implode(' ', $start_formats));
1937 1937
             $where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1938 1938
         }
1939
-        if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1939
+        if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1940 1940
             $where['EVT_wp_user'] = get_current_user_id();
1941
-        } elseif (! isset($where['status'])
1941
+        } elseif ( ! isset($where['status'])
1942 1942
                   && ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')
1943 1943
         ) {
1944 1944
             $where['OR'] = [
@@ -1958,7 +1958,7 @@  discard block
 block discarded – undo
1958 1958
         }
1959 1959
         // search query handling
1960 1960
         if (isset($this->_req_data['s'])) {
1961
-            $search_string = '%' . $this->_req_data['s'] . '%';
1961
+            $search_string = '%'.$this->_req_data['s'].'%';
1962 1962
             $where['OR'] = [
1963 1963
                 'EVT_name'       => ['LIKE', $search_string],
1964 1964
                 'EVT_desc'       => ['LIKE', $search_string],
@@ -2073,7 +2073,7 @@  discard block
 block discarded – undo
2073 2073
             // clean status
2074 2074
             $event_status = sanitize_key($event_status);
2075 2075
             // grab status
2076
-            if (! empty($event_status)) {
2076
+            if ( ! empty($event_status)) {
2077 2077
                 $success = $this->_change_event_status($EVT_ID, $event_status);
2078 2078
             } else {
2079 2079
                 $success = false;
@@ -2115,7 +2115,7 @@  discard block
 block discarded – undo
2115 2115
         // clean status
2116 2116
         $event_status = sanitize_key($event_status);
2117 2117
         // grab status
2118
-        if (! empty($event_status)) {
2118
+        if ( ! empty($event_status)) {
2119 2119
             $success = true;
2120 2120
             // determine the event id and set to array.
2121 2121
             $EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : [];
@@ -2167,7 +2167,7 @@  discard block
 block discarded – undo
2167 2167
     private function _change_event_status($EVT_ID = 0, $event_status = '')
2168 2168
     {
2169 2169
         // grab event id
2170
-        if (! $EVT_ID) {
2170
+        if ( ! $EVT_ID) {
2171 2171
             $msg = esc_html__(
2172 2172
                 'An error occurred. No Event ID or an invalid Event ID was received.',
2173 2173
                 'event_espresso'
@@ -2238,8 +2238,8 @@  discard block
 block discarded – undo
2238 2238
             // get list of events with no prices
2239 2239
             $espresso_no_ticket_prices = get_option('ee_no_ticket_prices', []);
2240 2240
             // remove this event from the list of events with no prices
2241
-            if (isset($espresso_no_ticket_prices[ $EVT_ID ])) {
2242
-                unset($espresso_no_ticket_prices[ $EVT_ID ]);
2241
+            if (isset($espresso_no_ticket_prices[$EVT_ID])) {
2242
+                unset($espresso_no_ticket_prices[$EVT_ID]);
2243 2243
             }
2244 2244
             update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2245 2245
         } else {
@@ -2286,7 +2286,7 @@  discard block
 block discarded – undo
2286 2286
                 $results = $this->_permanently_delete_event($EVT_ID);
2287 2287
                 $success = $results !== false ? $success : false;
2288 2288
                 // remove this event from the list of events with no prices
2289
-                unset($espresso_no_ticket_prices[ $EVT_ID ]);
2289
+                unset($espresso_no_ticket_prices[$EVT_ID]);
2290 2290
             } else {
2291 2291
                 $success = false;
2292 2292
                 $msg = esc_html__(
@@ -2318,7 +2318,7 @@  discard block
 block discarded – undo
2318 2318
     private function _permanently_delete_event($EVT_ID = 0)
2319 2319
     {
2320 2320
         // grab event id
2321
-        if (! $EVT_ID) {
2321
+        if ( ! $EVT_ID) {
2322 2322
             $msg = esc_html__(
2323 2323
                 'An error occurred. No Event ID or an invalid Event ID was received.',
2324 2324
                 'event_espresso'
@@ -2326,12 +2326,12 @@  discard block
 block discarded – undo
2326 2326
             EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2327 2327
             return false;
2328 2328
         }
2329
-        if (! $this->_cpt_model_obj instanceof EE_Event
2329
+        if ( ! $this->_cpt_model_obj instanceof EE_Event
2330 2330
             || $this->_cpt_model_obj->ID() !== $EVT_ID
2331 2331
         ) {
2332 2332
             $this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2333 2333
         }
2334
-        if (! $this->_cpt_model_obj instanceof EE_Event) {
2334
+        if ( ! $this->_cpt_model_obj instanceof EE_Event) {
2335 2335
             return false;
2336 2336
         }
2337 2337
         // need to delete related tickets and prices first.
@@ -2353,7 +2353,7 @@  discard block
 block discarded – undo
2353 2353
         }
2354 2354
         // any attached question groups?
2355 2355
         $question_groups = $this->_cpt_model_obj->get_many_related('Question_Group');
2356
-        if (! empty($question_groups)) {
2356
+        if ( ! empty($question_groups)) {
2357 2357
             foreach ($question_groups as $question_group) {
2358 2358
                 $this->_cpt_model_obj->_remove_relation_to($question_group, 'Question_Group');
2359 2359
             }
@@ -2586,7 +2586,7 @@  discard block
 block discarded – undo
2586 2586
                                                 . esc_html__(
2587 2587
                                                     '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.',
2588 2588
                                                     'event_espresso'
2589
-                                                ) . '</strong>';
2589
+                                                ).'</strong>';
2590 2590
         $this->display_admin_caf_preview_page('template_settings_tab');
2591 2591
     }
2592 2592
 
@@ -2606,12 +2606,12 @@  discard block
 block discarded – undo
2606 2606
         // set default category object
2607 2607
         $this->_set_empty_category_object();
2608 2608
         // only set if we've got an id
2609
-        if (! isset($this->_req_data['EVT_CAT_ID'])) {
2609
+        if ( ! isset($this->_req_data['EVT_CAT_ID'])) {
2610 2610
             return;
2611 2611
         }
2612 2612
         $category_id = absint($this->_req_data['EVT_CAT_ID']);
2613 2613
         $term = get_term($category_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2614
-        if (! empty($term)) {
2614
+        if ( ! empty($term)) {
2615 2615
             $this->_category->category_name = $term->name;
2616 2616
             $this->_category->category_identifier = $term->slug;
2617 2617
             $this->_category->category_desc = $term->description;
@@ -2643,7 +2643,7 @@  discard block
 block discarded – undo
2643 2643
     {
2644 2644
         do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2645 2645
         $this->_search_btn_label = esc_html__('Categories', 'event_espresso');
2646
-        $this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
2646
+        $this->_admin_page_title .= ' '.$this->get_action_link_or_button(
2647 2647
             'add_category',
2648 2648
             'add_category',
2649 2649
             [],
@@ -2726,7 +2726,7 @@  discard block
 block discarded – undo
2726 2726
             'disable'                  => '',
2727 2727
             'disabled_message'         => false,
2728 2728
         ];
2729
-        $template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
2729
+        $template = EVENTS_TEMPLATE_PATH.'event_category_details.template.php';
2730 2730
         return EEH_Template::display_template($template, $template_args, true);
2731 2731
     }
2732 2732
 
@@ -2815,7 +2815,7 @@  discard block
 block discarded – undo
2815 2815
         $insert_ids = $update
2816 2816
             ? wp_update_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args)
2817 2817
             : wp_insert_term($category_name, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args);
2818
-        if (! is_array($insert_ids)) {
2818
+        if ( ! is_array($insert_ids)) {
2819 2819
             $msg = esc_html__(
2820 2820
                 'An error occurred and the category has not been saved to the database.',
2821 2821
                 'event_espresso'
@@ -2850,7 +2850,7 @@  discard block
 block discarded – undo
2850 2850
         $limit = ($current_page - 1) * $per_page;
2851 2851
         $where = ['taxonomy' => EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY];
2852 2852
         if (isset($this->_req_data['s'])) {
2853
-            $sstr = '%' . $this->_req_data['s'] . '%';
2853
+            $sstr = '%'.$this->_req_data['s'].'%';
2854 2854
             $where['OR'] = [
2855 2855
                 'Term.name'   => ['LIKE', $sstr],
2856 2856
                 'description' => ['LIKE', $sstr],
@@ -2859,7 +2859,7 @@  discard block
 block discarded – undo
2859 2859
         $query_params = [
2860 2860
             $where,
2861 2861
             'order_by'   => [$orderby => $order],
2862
-            'limit'      => $limit . ',' . $per_page,
2862
+            'limit'      => $limit.','.$per_page,
2863 2863
             'force_join' => ['Term'],
2864 2864
         ];
2865 2865
         $categories = $count
Please login to merge, or discard this patch.