@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | public function queue_for_generation(EE_Message_To_Generate $message_to_generate, $test_send = false) |
285 | 285 | { |
286 | 286 | if ($message_to_generate->valid()) { |
287 | - if (! $this->_generator->create_and_add_message_to_queue($message_to_generate, $test_send)) { |
|
287 | + if ( ! $this->_generator->create_and_add_message_to_queue($message_to_generate, $test_send)) { |
|
288 | 288 | throw new RuntimeException( |
289 | 289 | esc_html__('Message failed to generate', 'event_espresso') |
290 | 290 | ); |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | protected function _queue_for_generation_loop($messages_to_generate) |
331 | 331 | { |
332 | 332 | // make sure is in an array. |
333 | - if (! is_array($messages_to_generate)) { |
|
333 | + if ( ! is_array($messages_to_generate)) { |
|
334 | 334 | $messages_to_generate = [$messages_to_generate]; |
335 | 335 | } |
336 | 336 | |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | */ |
371 | 371 | public function generate_for_preview(EE_Message_To_Generate $message_to_generate, $test_send = false) |
372 | 372 | { |
373 | - if (! $message_to_generate->valid()) { |
|
373 | + if ( ! $message_to_generate->valid()) { |
|
374 | 374 | EE_Error::add_error( |
375 | 375 | esc_html__('Unable to generate preview because of invalid data', 'event_espresso'), |
376 | 376 | __FILE__, |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | */ |
408 | 408 | public function queue_for_sending(EE_Message_To_Generate $message_to_generate) |
409 | 409 | { |
410 | - if (! $message_to_generate->valid()) { |
|
410 | + if ( ! $message_to_generate->valid()) { |
|
411 | 411 | return false; |
412 | 412 | } |
413 | 413 | $this->_init_queue_and_generator(); |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | */ |
433 | 433 | public function generate_and_send_now(EE_Message_To_Generate $message_to_generate) |
434 | 434 | { |
435 | - if (! $message_to_generate->valid()) { |
|
435 | + if ( ! $message_to_generate->valid()) { |
|
436 | 436 | return null; |
437 | 437 | } |
438 | 438 | // is there supposed to be a sending messenger for this message? |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | |
580 | 580 | foreach ($regIDs as $regID) { |
581 | 581 | $reg = EEM_Registration::instance()->get_one_by_ID($regID); |
582 | - if (! $reg instanceof EE_Registration) { |
|
582 | + if ( ! $reg instanceof EE_Registration) { |
|
583 | 583 | EE_Error::add_error( |
584 | 584 | sprintf( |
585 | 585 | esc_html__( |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | ); |
592 | 592 | return false; |
593 | 593 | } |
594 | - $regs_to_send[ $reg->transaction_ID() ][ $reg->status_ID() ][] = $reg; |
|
594 | + $regs_to_send[$reg->transaction_ID()][$reg->status_ID()][] = $reg; |
|
595 | 595 | } |
596 | 596 | |
597 | 597 | $messages_to_generate = []; |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | foreach ($regs_to_send as $status_group) { |
600 | 600 | foreach ($status_group as $status_id => $registrations) { |
601 | 601 | $message_type = EEH_MSG_Template::convert_reg_status_to_message_type($status_id); |
602 | - if (! $message_type) { |
|
602 | + if ( ! $message_type) { |
|
603 | 603 | continue; |
604 | 604 | } |
605 | 605 | $messages_to_generate = array_merge( |
@@ -14,602 +14,602 @@ |
||
14 | 14 | */ |
15 | 15 | class EE_Messages_Processor |
16 | 16 | { |
17 | - /** |
|
18 | - * @type EE_Message_Resource_Manager $_message_resource_manager |
|
19 | - */ |
|
20 | - protected $_message_resource_manager; |
|
21 | - |
|
22 | - /** |
|
23 | - * @type EE_Messages_Queue |
|
24 | - */ |
|
25 | - protected $_queue; |
|
26 | - |
|
27 | - /** |
|
28 | - * @type EE_Messages_Generator |
|
29 | - */ |
|
30 | - protected $_generator; |
|
31 | - |
|
32 | - |
|
33 | - /** |
|
34 | - * constructor |
|
35 | - * |
|
36 | - * @param EE_Message_Resource_Manager $message_resource_manager |
|
37 | - */ |
|
38 | - public function __construct(EE_Message_Resource_Manager $message_resource_manager) |
|
39 | - { |
|
40 | - $this->_message_resource_manager = $message_resource_manager; |
|
41 | - $this->_init_queue_and_generator(); |
|
42 | - } |
|
43 | - |
|
44 | - |
|
45 | - /** |
|
46 | - * This method sets (or resets) the various properties for use. |
|
47 | - * |
|
48 | - * - $_queue = holds the messages queue |
|
49 | - * - $_generator = holds the messages generator |
|
50 | - */ |
|
51 | - protected function _init_queue_and_generator() |
|
52 | - { |
|
53 | - $this->_generator = EE_Registry::factory('EE_Messages_Generator'); |
|
54 | - $this->_queue = $this->_generator->generation_queue(); |
|
55 | - } |
|
56 | - |
|
57 | - |
|
58 | - /** |
|
59 | - * This returns the current set queue. |
|
60 | - * |
|
61 | - * @return EE_Messages_Queue |
|
62 | - */ |
|
63 | - public function get_queue() |
|
64 | - { |
|
65 | - return $this->_queue; |
|
66 | - } |
|
67 | - |
|
68 | - |
|
69 | - /** |
|
70 | - * This method can be utilized to process messages from a queue and they will be processed immediately on the same |
|
71 | - * request. Please note that this method alone does not bypass the usual "locks" for generation/sending (it assumes |
|
72 | - * client code has already filtered those if necessary). |
|
73 | - * |
|
74 | - * @param EE_Messages_Queue $queue_to_process |
|
75 | - * @return bool true for success false for error. |
|
76 | - * @throws EE_Error |
|
77 | - * @throws ReflectionException |
|
78 | - */ |
|
79 | - public function process_immediately_from_queue(EE_Messages_Queue $queue_to_process) |
|
80 | - { |
|
81 | - $success = false; |
|
82 | - $messages_to_send = []; |
|
83 | - $messages_to_generate = []; |
|
84 | - // loop through and setup the various messages from the queue so we know what is being processed |
|
85 | - $queue_to_process->get_message_repository()->rewind(); |
|
86 | - foreach ($queue_to_process->get_message_repository() as $message) { |
|
87 | - if ($message->STS_ID() === EEM_Message::status_incomplete) { |
|
88 | - $messages_to_generate[] = $message; |
|
89 | - continue; |
|
90 | - } |
|
91 | - |
|
92 | - if (in_array($message->STS_ID(), EEM_Message::instance()->stati_indicating_to_send())) { |
|
93 | - $messages_to_send[] = $message; |
|
94 | - } |
|
95 | - } |
|
96 | - |
|
97 | - // do generation/sends |
|
98 | - if ($messages_to_generate) { |
|
99 | - $success = $this->batch_generate_from_queue($messages_to_generate, true); |
|
100 | - } |
|
101 | - |
|
102 | - if ($messages_to_send) { |
|
103 | - $sent = $this->batch_send_from_queue($messages_to_send, true); |
|
104 | - // if there was messages to generate and it failed, then we override any success value for the sending process |
|
105 | - // otherwise we just use the return from batch send. The intent is that there is a simple response for success/fail. |
|
106 | - // Either everything was successful or we consider it a fail. To be clear, this is a limitation of doing |
|
107 | - // all messages processing on the same request. |
|
108 | - $success = $messages_to_generate && ! $success ? false : $sent; |
|
109 | - } |
|
110 | - return $success; |
|
111 | - } |
|
112 | - |
|
113 | - |
|
114 | - /** |
|
115 | - * Calls the EE_Messages_Queue::get_batch_to_generate() method and sends to EE_Messages_Generator. |
|
116 | - * |
|
117 | - * @param EE_Message[] $messages Array of EE_Message objects (optional) to build the queue with. |
|
118 | - * @param bool $clear_queue Whether to ensure a fresh queue or not. |
|
119 | - * |
|
120 | - * @return bool|EE_Messages_Queue return false if nothing generated. This returns a new EE_Message_Queue with |
|
121 | - * generated messages. |
|
122 | - * @throws EE_Error |
|
123 | - * @throws ReflectionException |
|
124 | - */ |
|
125 | - public function batch_generate_from_queue($messages = [], $clear_queue = false) |
|
126 | - { |
|
127 | - if ($this->_build_queue_for_generation($messages, $clear_queue)) { |
|
128 | - $new_queue = $this->_generator->generate(); |
|
129 | - if ($new_queue instanceof EE_Messages_Queue) { |
|
130 | - // unlock queue |
|
131 | - $this->_queue->unlock_queue(); |
|
132 | - $new_queue->initiate_request_by_priority('send'); |
|
133 | - return $new_queue; |
|
134 | - } |
|
135 | - } |
|
136 | - $this->_queue->unlock_queue(); |
|
137 | - return false; |
|
138 | - } |
|
139 | - |
|
140 | - |
|
141 | - /** |
|
142 | - * This method preps a queue for generation. |
|
143 | - * |
|
144 | - * @param EE_Message[] $messages Array of EE_Message objects to build the queue with |
|
145 | - * |
|
146 | - * @param bool $clear_queue This indicates whether the existing queue should be dumped or not. |
|
147 | - * |
|
148 | - * @return bool true means queue prepped, false means there was a lock so no generation please. |
|
149 | - * @throws EE_Error |
|
150 | - * @throws ReflectionException |
|
151 | - * @since 4.9.0 |
|
152 | - * |
|
153 | - */ |
|
154 | - protected function _build_queue_for_generation($messages = [], $clear_queue = false) |
|
155 | - { |
|
156 | - |
|
157 | - if ($clear_queue) { |
|
158 | - $this->_init_queue_and_generator(); |
|
159 | - } |
|
160 | - |
|
161 | - if ($messages) { |
|
162 | - // if generation is locked then get out now because that means processing is already happening. |
|
163 | - if ($this->_queue->is_locked()) { |
|
164 | - return false; |
|
165 | - } |
|
166 | - |
|
167 | - $this->_queue->lock_queue(); |
|
168 | - $messages = is_array($messages) ? $messages : [$messages]; |
|
169 | - foreach ($messages as $message) { |
|
170 | - if ($message instanceof EE_Message) { |
|
171 | - $data = $message->all_extra_meta_array(); |
|
172 | - $this->_queue->add($message, $data); |
|
173 | - } |
|
174 | - } |
|
175 | - return true; |
|
176 | - } else { |
|
177 | - return $this->_queue->get_batch_to_generate(); |
|
178 | - } |
|
179 | - } |
|
180 | - |
|
181 | - |
|
182 | - /** |
|
183 | - * This method preps a queue for sending. |
|
184 | - * |
|
185 | - * @param EE_Message[] $messages |
|
186 | - * @param bool $clear_queue Used to indicate whether to start with a fresh queue or not. |
|
187 | - * |
|
188 | - * @return bool true means queue prepped, false means there was a lock so no queue prepped. |
|
189 | - */ |
|
190 | - protected function _build_queue_for_sending($messages, $clear_queue = false) |
|
191 | - { |
|
192 | - // if sending is locked then get out now because that means processing is already happening. |
|
193 | - if ($this->_queue->is_locked(EE_Messages_Queue::action_sending)) { |
|
194 | - return false; |
|
195 | - } |
|
196 | - |
|
197 | - $this->_queue->lock_queue(EE_Messages_Queue::action_sending); |
|
198 | - |
|
199 | - if ($clear_queue) { |
|
200 | - $this->_init_queue_and_generator(); |
|
201 | - } |
|
202 | - |
|
203 | - $messages = is_array($messages) ? $messages : [$messages]; |
|
204 | - |
|
205 | - foreach ($messages as $message) { |
|
206 | - $this->_queue->add($message); |
|
207 | - } |
|
208 | - return true; |
|
209 | - } |
|
210 | - |
|
211 | - |
|
212 | - /** |
|
213 | - * Calls the EE_Message_Queue::get_to_send_batch_and_send() method and then immediately just calls |
|
214 | - * EE_Message_Queue::execute() to iterate and send unsent messages. |
|
215 | - * |
|
216 | - * @param EE_Message[] $messages If an array of messages is sent in then use it. |
|
217 | - * |
|
218 | - * @param bool $clear_queue Whether to initialize a new queue or keep the existing one. |
|
219 | - * |
|
220 | - * @return EE_Messages_Queue |
|
221 | - * @throws EE_Error |
|
222 | - * @throws ReflectionException |
|
223 | - */ |
|
224 | - public function batch_send_from_queue($messages = [], $clear_queue = false) |
|
225 | - { |
|
226 | - |
|
227 | - if ($messages && $this->_build_queue_for_sending($messages, $clear_queue)) { |
|
228 | - $this->_queue->execute(); |
|
229 | - $this->_queue->unlock_queue(EE_Messages_Queue::action_sending); |
|
230 | - } else { |
|
231 | - // get messages to send and execute. |
|
232 | - $this->_queue->get_to_send_batch_and_send(); |
|
233 | - } |
|
234 | - // note: callers can use the EE_Messages_Queue::count_STS_in_queue() method to find out if there were any failed |
|
235 | - // messages in the queue and decide how to handle at that point. |
|
236 | - return $this->_queue; |
|
237 | - } |
|
238 | - |
|
239 | - |
|
240 | - /** |
|
241 | - * This immediately generates messages using the given array of EE_Message_To_Generate objects and returns the |
|
242 | - * EE_Message_Queue with the generated messages for the caller to work with. Note, this does NOT save the generated |
|
243 | - * messages in the queue, leaving it up to the caller to do so. |
|
244 | - * |
|
245 | - * @param EE_Message_To_Generate[] $messages_to_generate |
|
246 | - * @return EE_Messages_Queue |
|
247 | - * @throws EE_Error |
|
248 | - * @throws ReflectionException |
|
249 | - */ |
|
250 | - public function generate_and_return($messages_to_generate) |
|
251 | - { |
|
252 | - $this->_init_queue_and_generator(); |
|
253 | - $this->_queue_for_generation_loop($messages_to_generate); |
|
254 | - return $this->_generator->generate(false); |
|
255 | - } |
|
256 | - |
|
257 | - |
|
258 | - /** |
|
259 | - * Executes the generator generate method on the current internal queue, and returns the generated queue. |
|
260 | - * |
|
261 | - * @param bool $persist Indicate whether to instruct the generator to persist the generated queue (true) or not |
|
262 | - * (false). |
|
263 | - * @return EE_Messages_Queue |
|
264 | - * @throws EE_Error |
|
265 | - * @throws ReflectionException |
|
266 | - */ |
|
267 | - public function generate_queue($persist = true) |
|
268 | - { |
|
269 | - return $this->_generator->generate($persist); |
|
270 | - } |
|
271 | - |
|
272 | - |
|
273 | - /** |
|
274 | - * Queue for generation. Note this does NOT persist to the db. Client code should call |
|
275 | - * get_message_repository()->save() if desire to persist. This method is provided to client code to decide what it |
|
276 | - * wants to do with queued messages for generation. |
|
277 | - * |
|
278 | - * @param EE_Message_To_Generate $message_to_generate |
|
279 | - * @param bool $test_send Whether this item is for a test send or not. |
|
280 | - * @return void |
|
281 | - */ |
|
282 | - public function queue_for_generation(EE_Message_To_Generate $message_to_generate, $test_send = false) |
|
283 | - { |
|
284 | - if ($message_to_generate->valid()) { |
|
285 | - if (! $this->_generator->create_and_add_message_to_queue($message_to_generate, $test_send)) { |
|
286 | - throw new RuntimeException( |
|
287 | - esc_html__('Message failed to generate', 'event_espresso') |
|
288 | - ); |
|
289 | - } |
|
290 | - } |
|
291 | - } |
|
292 | - |
|
293 | - |
|
294 | - /** |
|
295 | - * This receives an array of EE_Message_To_Generate objects, converts them to EE_Message adds them to the |
|
296 | - * generation queue and then persists to storage. |
|
297 | - * |
|
298 | - * @param EE_Message_To_Generate[] $messages_to_generate |
|
299 | - */ |
|
300 | - public function batch_queue_for_generation_and_persist($messages_to_generate) |
|
301 | - { |
|
302 | - $this->_init_queue_and_generator(); |
|
303 | - $this->_queue_for_generation_loop($messages_to_generate); |
|
304 | - $this->_queue->save(); |
|
305 | - } |
|
306 | - |
|
307 | - |
|
308 | - /** |
|
309 | - * This receives an array of EE_Message_To_Generate objects, converts them to EE_Message and adds them to the |
|
310 | - * generation queue. Does NOT persist to storage (unless there is an error. Client code can retrieve the generated |
|
311 | - * queue by calling EEM_Messages_Processor::get_queue() |
|
312 | - * |
|
313 | - * @param EE_Message_To_Generate[] $messages_to_generate |
|
314 | - */ |
|
315 | - public function batch_queue_for_generation_no_persist($messages_to_generate) |
|
316 | - { |
|
317 | - $this->_init_queue_and_generator(); |
|
318 | - $this->_queue_for_generation_loop($messages_to_generate); |
|
319 | - } |
|
320 | - |
|
321 | - |
|
322 | - /** |
|
323 | - * Simply loops through the given array of EE_Message_To_Generate objects and adds them to the _queue as EE_Message |
|
324 | - * objects. |
|
325 | - * |
|
326 | - * @param EE_Message_To_Generate[] $messages_to_generate |
|
327 | - */ |
|
328 | - protected function _queue_for_generation_loop($messages_to_generate) |
|
329 | - { |
|
330 | - // make sure is in an array. |
|
331 | - if (! is_array($messages_to_generate)) { |
|
332 | - $messages_to_generate = [$messages_to_generate]; |
|
333 | - } |
|
334 | - |
|
335 | - foreach ($messages_to_generate as $message_to_generate) { |
|
336 | - if ($message_to_generate instanceof EE_Message_To_Generate && $message_to_generate->valid()) { |
|
337 | - $this->queue_for_generation($message_to_generate); |
|
338 | - } |
|
339 | - } |
|
340 | - } |
|
341 | - |
|
342 | - |
|
343 | - /** |
|
344 | - * Receives an array of EE_Message_To_Generate objects and generates the EE_Message objects, then persists (so its |
|
345 | - * queued for sending). |
|
346 | - * |
|
347 | - * @param EE_Message_To_Generate[] |
|
348 | - * @return EE_Messages_Queue |
|
349 | - * @throws EE_Error |
|
350 | - * @throws ReflectionException |
|
351 | - */ |
|
352 | - public function generate_and_queue_for_sending($messages_to_generate) |
|
353 | - { |
|
354 | - $this->_init_queue_and_generator(); |
|
355 | - $this->_queue_for_generation_loop($messages_to_generate); |
|
356 | - return $this->_generator->generate(); |
|
357 | - } |
|
358 | - |
|
359 | - |
|
360 | - /** |
|
361 | - * Generate for preview and execute right away. |
|
362 | - * |
|
363 | - * @param EE_Message_To_Generate $message_to_generate |
|
364 | - * @param bool $test_send Whether this is a test send or not. |
|
365 | - * @return EE_Messages_Queue | bool false if unable to generate otherwise the generated queue. |
|
366 | - * @throws EE_Error |
|
367 | - * @throws ReflectionException |
|
368 | - */ |
|
369 | - public function generate_for_preview(EE_Message_To_Generate $message_to_generate, $test_send = false) |
|
370 | - { |
|
371 | - if (! $message_to_generate->valid()) { |
|
372 | - EE_Error::add_error( |
|
373 | - esc_html__('Unable to generate preview because of invalid data', 'event_espresso'), |
|
374 | - __FILE__, |
|
375 | - __FUNCTION__, |
|
376 | - __LINE__ |
|
377 | - ); |
|
378 | - return false; |
|
379 | - } |
|
380 | - // just make sure preview is set on the $message_to_generate (in case client forgot) |
|
381 | - $message_to_generate->set_preview(true); |
|
382 | - $this->_init_queue_and_generator(); |
|
383 | - $this->queue_for_generation($message_to_generate, $test_send); |
|
384 | - $generated_queue = $this->_generator->generate(false); |
|
385 | - if ($generated_queue->execute(false)) { |
|
386 | - // the first queue item should be the preview |
|
387 | - $generated_queue->get_message_repository()->rewind(); |
|
388 | - if ($generated_queue->get_message_repository()->valid()) { |
|
389 | - return $generated_queue; |
|
390 | - } |
|
391 | - } |
|
392 | - return false; |
|
393 | - } |
|
394 | - |
|
395 | - |
|
396 | - /** |
|
397 | - * This queues for sending. |
|
398 | - * The messenger send now method is also verified to see if sending immediately is requested. |
|
399 | - * otherwise its just saved to the queue. |
|
400 | - * |
|
401 | - * @param EE_Message_To_Generate $message_to_generate |
|
402 | - * @return bool true or false for success. |
|
403 | - * @throws EE_Error |
|
404 | - * @throws ReflectionException |
|
405 | - */ |
|
406 | - public function queue_for_sending(EE_Message_To_Generate $message_to_generate) |
|
407 | - { |
|
408 | - if (! $message_to_generate->valid()) { |
|
409 | - return false; |
|
410 | - } |
|
411 | - $this->_init_queue_and_generator(); |
|
412 | - $message = $message_to_generate->get_EE_Message(); |
|
413 | - $this->_queue->add($message); |
|
414 | - if ($message->send_now()) { |
|
415 | - $this->_queue->execute(false); |
|
416 | - } else { |
|
417 | - $this->_queue->save(); |
|
418 | - } |
|
419 | - return true; |
|
420 | - } |
|
421 | - |
|
422 | - |
|
423 | - /** |
|
424 | - * This generates and sends from the given EE_Message_To_Generate class immediately. |
|
425 | - * |
|
426 | - * @param EE_Message_To_Generate $message_to_generate |
|
427 | - * @return EE_Messages_Queue | null |
|
428 | - * @throws EE_Error |
|
429 | - * @throws ReflectionException |
|
430 | - */ |
|
431 | - public function generate_and_send_now(EE_Message_To_Generate $message_to_generate) |
|
432 | - { |
|
433 | - if (! $message_to_generate->valid()) { |
|
434 | - return null; |
|
435 | - } |
|
436 | - // is there supposed to be a sending messenger for this message? |
|
437 | - if ($message_to_generate instanceof EEI_Has_Sending_Messenger) { |
|
438 | - // make sure it's valid, but if it's not, |
|
439 | - // then set the value of $sending_messenger to an EE_Error object |
|
440 | - // so that downstream code can easily see that things went wrong. |
|
441 | - $sending_messenger = $message_to_generate->sending_messenger() instanceof EE_messenger |
|
442 | - ? $message_to_generate->sending_messenger() |
|
443 | - : new EE_Error( |
|
444 | - esc_html__( |
|
445 | - 'There was a specific sending messenger requested for the send action, but it was either invalid or not active at time of sending.', |
|
446 | - 'event_espresso' |
|
447 | - ) |
|
448 | - ); |
|
449 | - } else { |
|
450 | - $sending_messenger = null; |
|
451 | - } |
|
452 | - |
|
453 | - if ($message_to_generate->get_EE_Message()->STS_ID() === EEM_Message::status_idle) { |
|
454 | - $this->_init_queue_and_generator(); |
|
455 | - $this->_queue->add($message_to_generate->get_EE_Message()); |
|
456 | - $this->_queue->execute(false, $sending_messenger); |
|
457 | - return $this->_queue; |
|
458 | - } elseif ($message_to_generate->get_EE_Message()->STS_ID() === EEM_Message::status_incomplete) { |
|
459 | - $generated_queue = $this->generate_and_return([$message_to_generate]); |
|
460 | - $generated_queue->execute(false, $sending_messenger); |
|
461 | - return $generated_queue; |
|
462 | - } |
|
463 | - return null; |
|
464 | - } |
|
465 | - |
|
466 | - |
|
467 | - /** |
|
468 | - * Creates mtg objects for all active messengers and queues for generation. |
|
469 | - * This method also calls the execute by priority method on the queue which will optionally kick off a new |
|
470 | - * non-blocking request to complete the action if the priority for the message requires immediate action. |
|
471 | - * |
|
472 | - * @param string $message_type |
|
473 | - * @param mixed $data The data being used for generation. |
|
474 | - * @param bool $persist Whether to persist the queued messages to the db or not. |
|
475 | - * @throws EE_Error |
|
476 | - * @throws ReflectionException |
|
477 | - */ |
|
478 | - public function generate_for_all_active_messengers($message_type, $data, $persist = true) |
|
479 | - { |
|
480 | - $messages_to_generate = $this->setup_mtgs_for_all_active_messengers($message_type, $data); |
|
481 | - if ($persist) { |
|
482 | - $this->batch_queue_for_generation_and_persist($messages_to_generate); |
|
483 | - $this->_queue->initiate_request_by_priority(); |
|
484 | - } else { |
|
485 | - $this->batch_queue_for_generation_no_persist($messages_to_generate); |
|
486 | - } |
|
487 | - } |
|
488 | - |
|
489 | - |
|
490 | - /** |
|
491 | - * This simply loops through all active messengers and takes care of setting up the |
|
492 | - * EE_Message_To_Generate objects. |
|
493 | - * |
|
494 | - * @param $message_type |
|
495 | - * @param $data |
|
496 | - * |
|
497 | - * @return EE_Message_To_Generate[] |
|
498 | - */ |
|
499 | - public function setup_mtgs_for_all_active_messengers($message_type, $data) |
|
500 | - { |
|
501 | - $messages_to_generate = []; |
|
502 | - foreach ($this->_message_resource_manager->active_messengers() as $messenger_slug => $messenger_object) { |
|
503 | - $message_to_generate = new EE_Message_To_Generate($messenger_slug, $message_type, $data); |
|
504 | - if ($message_to_generate->valid()) { |
|
505 | - $messages_to_generate[] = $message_to_generate; |
|
506 | - } |
|
507 | - } |
|
508 | - return $messages_to_generate; |
|
509 | - } |
|
510 | - |
|
511 | - |
|
512 | - /** |
|
513 | - * This accepts an array of EE_Message::MSG_ID values |
|
514 | - * and will use that to retrieve the objects from the database and send. |
|
515 | - * |
|
516 | - * @param array $message_ids |
|
517 | - * @throws EE_Error |
|
518 | - * @throws ReflectionException |
|
519 | - */ |
|
520 | - public function setup_messages_from_ids_and_send($message_ids) |
|
521 | - { |
|
522 | - $this->_init_queue_and_generator(); |
|
523 | - $messages = EEM_Message::instance()->get_all( |
|
524 | - [ |
|
525 | - [ |
|
526 | - 'MSG_ID' => ['IN', $message_ids], |
|
527 | - 'STS_ID' => [ |
|
528 | - 'IN', |
|
529 | - array_merge( |
|
530 | - EEM_Message::instance()->stati_indicating_sent(), |
|
531 | - [EEM_Message::status_retry] |
|
532 | - ), |
|
533 | - ], |
|
534 | - ], |
|
535 | - ] |
|
536 | - ); |
|
537 | - // set the Messages to resend. |
|
538 | - foreach ($messages as $message) { |
|
539 | - if ($message instanceof EE_Message) { |
|
540 | - $message->set_STS_ID(EEM_Message::status_resend); |
|
541 | - $this->_queue->add($message); |
|
542 | - } |
|
543 | - } |
|
544 | - |
|
545 | - $this->_queue->initiate_request_by_priority('send'); |
|
546 | - } |
|
547 | - |
|
548 | - |
|
549 | - /** |
|
550 | - * This method checks for registration IDs in the request via the given key and creates the messages to generate |
|
551 | - * objects from them, then returns the array of messages to generate objects. |
|
552 | - * Note, this sets up registrations for the registration family of message types. |
|
553 | - * |
|
554 | - * @param string $registration_ids_key This is used to indicate what represents the registration ids in the request. |
|
555 | - * |
|
556 | - * @return EE_Message_To_Generate[]|bool |
|
557 | - * @throws EE_Error |
|
558 | - */ |
|
559 | - public function setup_messages_to_generate_from_registration_ids_in_request($registration_ids_key = '_REG_ID') |
|
560 | - { |
|
561 | - /** @var RequestInterface $request */ |
|
562 | - $request = LoaderFactory::getLoader()->getShared(RequestInterface::class); |
|
563 | - $regs_to_send = []; |
|
564 | - $regIDs = $request->getRequestParam($registration_ids_key, [], 'int', true); |
|
565 | - if (empty($regIDs)) { |
|
566 | - EE_Error::add_error( |
|
567 | - esc_html__('Something went wrong because we\'re missing the registration ID', 'event_espresso'), |
|
568 | - __FILE__, |
|
569 | - __FUNCTION__, |
|
570 | - __LINE__ |
|
571 | - ); |
|
572 | - return false; |
|
573 | - } |
|
574 | - |
|
575 | - // make sure is an array |
|
576 | - $regIDs = is_array($regIDs) ? $regIDs : [$regIDs]; |
|
577 | - |
|
578 | - foreach ($regIDs as $regID) { |
|
579 | - $reg = EEM_Registration::instance()->get_one_by_ID($regID); |
|
580 | - if (! $reg instanceof EE_Registration) { |
|
581 | - EE_Error::add_error( |
|
582 | - sprintf( |
|
583 | - esc_html__( |
|
584 | - 'Unable to retrieve a registration object for the given reg id (%s)', |
|
585 | - 'event_espresso' |
|
586 | - ), |
|
587 | - $regID |
|
588 | - ) |
|
589 | - ); |
|
590 | - return false; |
|
591 | - } |
|
592 | - $regs_to_send[ $reg->transaction_ID() ][ $reg->status_ID() ][] = $reg; |
|
593 | - } |
|
594 | - |
|
595 | - $messages_to_generate = []; |
|
596 | - |
|
597 | - foreach ($regs_to_send as $status_group) { |
|
598 | - foreach ($status_group as $status_id => $registrations) { |
|
599 | - $message_type = EEH_MSG_Template::convert_reg_status_to_message_type($status_id); |
|
600 | - if (! $message_type) { |
|
601 | - continue; |
|
602 | - } |
|
603 | - $messages_to_generate = array_merge( |
|
604 | - $messages_to_generate, |
|
605 | - $this->setup_mtgs_for_all_active_messengers( |
|
606 | - $message_type, |
|
607 | - [$registrations, $status_id] |
|
608 | - ) |
|
609 | - ); |
|
610 | - } |
|
611 | - } |
|
612 | - |
|
613 | - return $messages_to_generate; |
|
614 | - } |
|
17 | + /** |
|
18 | + * @type EE_Message_Resource_Manager $_message_resource_manager |
|
19 | + */ |
|
20 | + protected $_message_resource_manager; |
|
21 | + |
|
22 | + /** |
|
23 | + * @type EE_Messages_Queue |
|
24 | + */ |
|
25 | + protected $_queue; |
|
26 | + |
|
27 | + /** |
|
28 | + * @type EE_Messages_Generator |
|
29 | + */ |
|
30 | + protected $_generator; |
|
31 | + |
|
32 | + |
|
33 | + /** |
|
34 | + * constructor |
|
35 | + * |
|
36 | + * @param EE_Message_Resource_Manager $message_resource_manager |
|
37 | + */ |
|
38 | + public function __construct(EE_Message_Resource_Manager $message_resource_manager) |
|
39 | + { |
|
40 | + $this->_message_resource_manager = $message_resource_manager; |
|
41 | + $this->_init_queue_and_generator(); |
|
42 | + } |
|
43 | + |
|
44 | + |
|
45 | + /** |
|
46 | + * This method sets (or resets) the various properties for use. |
|
47 | + * |
|
48 | + * - $_queue = holds the messages queue |
|
49 | + * - $_generator = holds the messages generator |
|
50 | + */ |
|
51 | + protected function _init_queue_and_generator() |
|
52 | + { |
|
53 | + $this->_generator = EE_Registry::factory('EE_Messages_Generator'); |
|
54 | + $this->_queue = $this->_generator->generation_queue(); |
|
55 | + } |
|
56 | + |
|
57 | + |
|
58 | + /** |
|
59 | + * This returns the current set queue. |
|
60 | + * |
|
61 | + * @return EE_Messages_Queue |
|
62 | + */ |
|
63 | + public function get_queue() |
|
64 | + { |
|
65 | + return $this->_queue; |
|
66 | + } |
|
67 | + |
|
68 | + |
|
69 | + /** |
|
70 | + * This method can be utilized to process messages from a queue and they will be processed immediately on the same |
|
71 | + * request. Please note that this method alone does not bypass the usual "locks" for generation/sending (it assumes |
|
72 | + * client code has already filtered those if necessary). |
|
73 | + * |
|
74 | + * @param EE_Messages_Queue $queue_to_process |
|
75 | + * @return bool true for success false for error. |
|
76 | + * @throws EE_Error |
|
77 | + * @throws ReflectionException |
|
78 | + */ |
|
79 | + public function process_immediately_from_queue(EE_Messages_Queue $queue_to_process) |
|
80 | + { |
|
81 | + $success = false; |
|
82 | + $messages_to_send = []; |
|
83 | + $messages_to_generate = []; |
|
84 | + // loop through and setup the various messages from the queue so we know what is being processed |
|
85 | + $queue_to_process->get_message_repository()->rewind(); |
|
86 | + foreach ($queue_to_process->get_message_repository() as $message) { |
|
87 | + if ($message->STS_ID() === EEM_Message::status_incomplete) { |
|
88 | + $messages_to_generate[] = $message; |
|
89 | + continue; |
|
90 | + } |
|
91 | + |
|
92 | + if (in_array($message->STS_ID(), EEM_Message::instance()->stati_indicating_to_send())) { |
|
93 | + $messages_to_send[] = $message; |
|
94 | + } |
|
95 | + } |
|
96 | + |
|
97 | + // do generation/sends |
|
98 | + if ($messages_to_generate) { |
|
99 | + $success = $this->batch_generate_from_queue($messages_to_generate, true); |
|
100 | + } |
|
101 | + |
|
102 | + if ($messages_to_send) { |
|
103 | + $sent = $this->batch_send_from_queue($messages_to_send, true); |
|
104 | + // if there was messages to generate and it failed, then we override any success value for the sending process |
|
105 | + // otherwise we just use the return from batch send. The intent is that there is a simple response for success/fail. |
|
106 | + // Either everything was successful or we consider it a fail. To be clear, this is a limitation of doing |
|
107 | + // all messages processing on the same request. |
|
108 | + $success = $messages_to_generate && ! $success ? false : $sent; |
|
109 | + } |
|
110 | + return $success; |
|
111 | + } |
|
112 | + |
|
113 | + |
|
114 | + /** |
|
115 | + * Calls the EE_Messages_Queue::get_batch_to_generate() method and sends to EE_Messages_Generator. |
|
116 | + * |
|
117 | + * @param EE_Message[] $messages Array of EE_Message objects (optional) to build the queue with. |
|
118 | + * @param bool $clear_queue Whether to ensure a fresh queue or not. |
|
119 | + * |
|
120 | + * @return bool|EE_Messages_Queue return false if nothing generated. This returns a new EE_Message_Queue with |
|
121 | + * generated messages. |
|
122 | + * @throws EE_Error |
|
123 | + * @throws ReflectionException |
|
124 | + */ |
|
125 | + public function batch_generate_from_queue($messages = [], $clear_queue = false) |
|
126 | + { |
|
127 | + if ($this->_build_queue_for_generation($messages, $clear_queue)) { |
|
128 | + $new_queue = $this->_generator->generate(); |
|
129 | + if ($new_queue instanceof EE_Messages_Queue) { |
|
130 | + // unlock queue |
|
131 | + $this->_queue->unlock_queue(); |
|
132 | + $new_queue->initiate_request_by_priority('send'); |
|
133 | + return $new_queue; |
|
134 | + } |
|
135 | + } |
|
136 | + $this->_queue->unlock_queue(); |
|
137 | + return false; |
|
138 | + } |
|
139 | + |
|
140 | + |
|
141 | + /** |
|
142 | + * This method preps a queue for generation. |
|
143 | + * |
|
144 | + * @param EE_Message[] $messages Array of EE_Message objects to build the queue with |
|
145 | + * |
|
146 | + * @param bool $clear_queue This indicates whether the existing queue should be dumped or not. |
|
147 | + * |
|
148 | + * @return bool true means queue prepped, false means there was a lock so no generation please. |
|
149 | + * @throws EE_Error |
|
150 | + * @throws ReflectionException |
|
151 | + * @since 4.9.0 |
|
152 | + * |
|
153 | + */ |
|
154 | + protected function _build_queue_for_generation($messages = [], $clear_queue = false) |
|
155 | + { |
|
156 | + |
|
157 | + if ($clear_queue) { |
|
158 | + $this->_init_queue_and_generator(); |
|
159 | + } |
|
160 | + |
|
161 | + if ($messages) { |
|
162 | + // if generation is locked then get out now because that means processing is already happening. |
|
163 | + if ($this->_queue->is_locked()) { |
|
164 | + return false; |
|
165 | + } |
|
166 | + |
|
167 | + $this->_queue->lock_queue(); |
|
168 | + $messages = is_array($messages) ? $messages : [$messages]; |
|
169 | + foreach ($messages as $message) { |
|
170 | + if ($message instanceof EE_Message) { |
|
171 | + $data = $message->all_extra_meta_array(); |
|
172 | + $this->_queue->add($message, $data); |
|
173 | + } |
|
174 | + } |
|
175 | + return true; |
|
176 | + } else { |
|
177 | + return $this->_queue->get_batch_to_generate(); |
|
178 | + } |
|
179 | + } |
|
180 | + |
|
181 | + |
|
182 | + /** |
|
183 | + * This method preps a queue for sending. |
|
184 | + * |
|
185 | + * @param EE_Message[] $messages |
|
186 | + * @param bool $clear_queue Used to indicate whether to start with a fresh queue or not. |
|
187 | + * |
|
188 | + * @return bool true means queue prepped, false means there was a lock so no queue prepped. |
|
189 | + */ |
|
190 | + protected function _build_queue_for_sending($messages, $clear_queue = false) |
|
191 | + { |
|
192 | + // if sending is locked then get out now because that means processing is already happening. |
|
193 | + if ($this->_queue->is_locked(EE_Messages_Queue::action_sending)) { |
|
194 | + return false; |
|
195 | + } |
|
196 | + |
|
197 | + $this->_queue->lock_queue(EE_Messages_Queue::action_sending); |
|
198 | + |
|
199 | + if ($clear_queue) { |
|
200 | + $this->_init_queue_and_generator(); |
|
201 | + } |
|
202 | + |
|
203 | + $messages = is_array($messages) ? $messages : [$messages]; |
|
204 | + |
|
205 | + foreach ($messages as $message) { |
|
206 | + $this->_queue->add($message); |
|
207 | + } |
|
208 | + return true; |
|
209 | + } |
|
210 | + |
|
211 | + |
|
212 | + /** |
|
213 | + * Calls the EE_Message_Queue::get_to_send_batch_and_send() method and then immediately just calls |
|
214 | + * EE_Message_Queue::execute() to iterate and send unsent messages. |
|
215 | + * |
|
216 | + * @param EE_Message[] $messages If an array of messages is sent in then use it. |
|
217 | + * |
|
218 | + * @param bool $clear_queue Whether to initialize a new queue or keep the existing one. |
|
219 | + * |
|
220 | + * @return EE_Messages_Queue |
|
221 | + * @throws EE_Error |
|
222 | + * @throws ReflectionException |
|
223 | + */ |
|
224 | + public function batch_send_from_queue($messages = [], $clear_queue = false) |
|
225 | + { |
|
226 | + |
|
227 | + if ($messages && $this->_build_queue_for_sending($messages, $clear_queue)) { |
|
228 | + $this->_queue->execute(); |
|
229 | + $this->_queue->unlock_queue(EE_Messages_Queue::action_sending); |
|
230 | + } else { |
|
231 | + // get messages to send and execute. |
|
232 | + $this->_queue->get_to_send_batch_and_send(); |
|
233 | + } |
|
234 | + // note: callers can use the EE_Messages_Queue::count_STS_in_queue() method to find out if there were any failed |
|
235 | + // messages in the queue and decide how to handle at that point. |
|
236 | + return $this->_queue; |
|
237 | + } |
|
238 | + |
|
239 | + |
|
240 | + /** |
|
241 | + * This immediately generates messages using the given array of EE_Message_To_Generate objects and returns the |
|
242 | + * EE_Message_Queue with the generated messages for the caller to work with. Note, this does NOT save the generated |
|
243 | + * messages in the queue, leaving it up to the caller to do so. |
|
244 | + * |
|
245 | + * @param EE_Message_To_Generate[] $messages_to_generate |
|
246 | + * @return EE_Messages_Queue |
|
247 | + * @throws EE_Error |
|
248 | + * @throws ReflectionException |
|
249 | + */ |
|
250 | + public function generate_and_return($messages_to_generate) |
|
251 | + { |
|
252 | + $this->_init_queue_and_generator(); |
|
253 | + $this->_queue_for_generation_loop($messages_to_generate); |
|
254 | + return $this->_generator->generate(false); |
|
255 | + } |
|
256 | + |
|
257 | + |
|
258 | + /** |
|
259 | + * Executes the generator generate method on the current internal queue, and returns the generated queue. |
|
260 | + * |
|
261 | + * @param bool $persist Indicate whether to instruct the generator to persist the generated queue (true) or not |
|
262 | + * (false). |
|
263 | + * @return EE_Messages_Queue |
|
264 | + * @throws EE_Error |
|
265 | + * @throws ReflectionException |
|
266 | + */ |
|
267 | + public function generate_queue($persist = true) |
|
268 | + { |
|
269 | + return $this->_generator->generate($persist); |
|
270 | + } |
|
271 | + |
|
272 | + |
|
273 | + /** |
|
274 | + * Queue for generation. Note this does NOT persist to the db. Client code should call |
|
275 | + * get_message_repository()->save() if desire to persist. This method is provided to client code to decide what it |
|
276 | + * wants to do with queued messages for generation. |
|
277 | + * |
|
278 | + * @param EE_Message_To_Generate $message_to_generate |
|
279 | + * @param bool $test_send Whether this item is for a test send or not. |
|
280 | + * @return void |
|
281 | + */ |
|
282 | + public function queue_for_generation(EE_Message_To_Generate $message_to_generate, $test_send = false) |
|
283 | + { |
|
284 | + if ($message_to_generate->valid()) { |
|
285 | + if (! $this->_generator->create_and_add_message_to_queue($message_to_generate, $test_send)) { |
|
286 | + throw new RuntimeException( |
|
287 | + esc_html__('Message failed to generate', 'event_espresso') |
|
288 | + ); |
|
289 | + } |
|
290 | + } |
|
291 | + } |
|
292 | + |
|
293 | + |
|
294 | + /** |
|
295 | + * This receives an array of EE_Message_To_Generate objects, converts them to EE_Message adds them to the |
|
296 | + * generation queue and then persists to storage. |
|
297 | + * |
|
298 | + * @param EE_Message_To_Generate[] $messages_to_generate |
|
299 | + */ |
|
300 | + public function batch_queue_for_generation_and_persist($messages_to_generate) |
|
301 | + { |
|
302 | + $this->_init_queue_and_generator(); |
|
303 | + $this->_queue_for_generation_loop($messages_to_generate); |
|
304 | + $this->_queue->save(); |
|
305 | + } |
|
306 | + |
|
307 | + |
|
308 | + /** |
|
309 | + * This receives an array of EE_Message_To_Generate objects, converts them to EE_Message and adds them to the |
|
310 | + * generation queue. Does NOT persist to storage (unless there is an error. Client code can retrieve the generated |
|
311 | + * queue by calling EEM_Messages_Processor::get_queue() |
|
312 | + * |
|
313 | + * @param EE_Message_To_Generate[] $messages_to_generate |
|
314 | + */ |
|
315 | + public function batch_queue_for_generation_no_persist($messages_to_generate) |
|
316 | + { |
|
317 | + $this->_init_queue_and_generator(); |
|
318 | + $this->_queue_for_generation_loop($messages_to_generate); |
|
319 | + } |
|
320 | + |
|
321 | + |
|
322 | + /** |
|
323 | + * Simply loops through the given array of EE_Message_To_Generate objects and adds them to the _queue as EE_Message |
|
324 | + * objects. |
|
325 | + * |
|
326 | + * @param EE_Message_To_Generate[] $messages_to_generate |
|
327 | + */ |
|
328 | + protected function _queue_for_generation_loop($messages_to_generate) |
|
329 | + { |
|
330 | + // make sure is in an array. |
|
331 | + if (! is_array($messages_to_generate)) { |
|
332 | + $messages_to_generate = [$messages_to_generate]; |
|
333 | + } |
|
334 | + |
|
335 | + foreach ($messages_to_generate as $message_to_generate) { |
|
336 | + if ($message_to_generate instanceof EE_Message_To_Generate && $message_to_generate->valid()) { |
|
337 | + $this->queue_for_generation($message_to_generate); |
|
338 | + } |
|
339 | + } |
|
340 | + } |
|
341 | + |
|
342 | + |
|
343 | + /** |
|
344 | + * Receives an array of EE_Message_To_Generate objects and generates the EE_Message objects, then persists (so its |
|
345 | + * queued for sending). |
|
346 | + * |
|
347 | + * @param EE_Message_To_Generate[] |
|
348 | + * @return EE_Messages_Queue |
|
349 | + * @throws EE_Error |
|
350 | + * @throws ReflectionException |
|
351 | + */ |
|
352 | + public function generate_and_queue_for_sending($messages_to_generate) |
|
353 | + { |
|
354 | + $this->_init_queue_and_generator(); |
|
355 | + $this->_queue_for_generation_loop($messages_to_generate); |
|
356 | + return $this->_generator->generate(); |
|
357 | + } |
|
358 | + |
|
359 | + |
|
360 | + /** |
|
361 | + * Generate for preview and execute right away. |
|
362 | + * |
|
363 | + * @param EE_Message_To_Generate $message_to_generate |
|
364 | + * @param bool $test_send Whether this is a test send or not. |
|
365 | + * @return EE_Messages_Queue | bool false if unable to generate otherwise the generated queue. |
|
366 | + * @throws EE_Error |
|
367 | + * @throws ReflectionException |
|
368 | + */ |
|
369 | + public function generate_for_preview(EE_Message_To_Generate $message_to_generate, $test_send = false) |
|
370 | + { |
|
371 | + if (! $message_to_generate->valid()) { |
|
372 | + EE_Error::add_error( |
|
373 | + esc_html__('Unable to generate preview because of invalid data', 'event_espresso'), |
|
374 | + __FILE__, |
|
375 | + __FUNCTION__, |
|
376 | + __LINE__ |
|
377 | + ); |
|
378 | + return false; |
|
379 | + } |
|
380 | + // just make sure preview is set on the $message_to_generate (in case client forgot) |
|
381 | + $message_to_generate->set_preview(true); |
|
382 | + $this->_init_queue_and_generator(); |
|
383 | + $this->queue_for_generation($message_to_generate, $test_send); |
|
384 | + $generated_queue = $this->_generator->generate(false); |
|
385 | + if ($generated_queue->execute(false)) { |
|
386 | + // the first queue item should be the preview |
|
387 | + $generated_queue->get_message_repository()->rewind(); |
|
388 | + if ($generated_queue->get_message_repository()->valid()) { |
|
389 | + return $generated_queue; |
|
390 | + } |
|
391 | + } |
|
392 | + return false; |
|
393 | + } |
|
394 | + |
|
395 | + |
|
396 | + /** |
|
397 | + * This queues for sending. |
|
398 | + * The messenger send now method is also verified to see if sending immediately is requested. |
|
399 | + * otherwise its just saved to the queue. |
|
400 | + * |
|
401 | + * @param EE_Message_To_Generate $message_to_generate |
|
402 | + * @return bool true or false for success. |
|
403 | + * @throws EE_Error |
|
404 | + * @throws ReflectionException |
|
405 | + */ |
|
406 | + public function queue_for_sending(EE_Message_To_Generate $message_to_generate) |
|
407 | + { |
|
408 | + if (! $message_to_generate->valid()) { |
|
409 | + return false; |
|
410 | + } |
|
411 | + $this->_init_queue_and_generator(); |
|
412 | + $message = $message_to_generate->get_EE_Message(); |
|
413 | + $this->_queue->add($message); |
|
414 | + if ($message->send_now()) { |
|
415 | + $this->_queue->execute(false); |
|
416 | + } else { |
|
417 | + $this->_queue->save(); |
|
418 | + } |
|
419 | + return true; |
|
420 | + } |
|
421 | + |
|
422 | + |
|
423 | + /** |
|
424 | + * This generates and sends from the given EE_Message_To_Generate class immediately. |
|
425 | + * |
|
426 | + * @param EE_Message_To_Generate $message_to_generate |
|
427 | + * @return EE_Messages_Queue | null |
|
428 | + * @throws EE_Error |
|
429 | + * @throws ReflectionException |
|
430 | + */ |
|
431 | + public function generate_and_send_now(EE_Message_To_Generate $message_to_generate) |
|
432 | + { |
|
433 | + if (! $message_to_generate->valid()) { |
|
434 | + return null; |
|
435 | + } |
|
436 | + // is there supposed to be a sending messenger for this message? |
|
437 | + if ($message_to_generate instanceof EEI_Has_Sending_Messenger) { |
|
438 | + // make sure it's valid, but if it's not, |
|
439 | + // then set the value of $sending_messenger to an EE_Error object |
|
440 | + // so that downstream code can easily see that things went wrong. |
|
441 | + $sending_messenger = $message_to_generate->sending_messenger() instanceof EE_messenger |
|
442 | + ? $message_to_generate->sending_messenger() |
|
443 | + : new EE_Error( |
|
444 | + esc_html__( |
|
445 | + 'There was a specific sending messenger requested for the send action, but it was either invalid or not active at time of sending.', |
|
446 | + 'event_espresso' |
|
447 | + ) |
|
448 | + ); |
|
449 | + } else { |
|
450 | + $sending_messenger = null; |
|
451 | + } |
|
452 | + |
|
453 | + if ($message_to_generate->get_EE_Message()->STS_ID() === EEM_Message::status_idle) { |
|
454 | + $this->_init_queue_and_generator(); |
|
455 | + $this->_queue->add($message_to_generate->get_EE_Message()); |
|
456 | + $this->_queue->execute(false, $sending_messenger); |
|
457 | + return $this->_queue; |
|
458 | + } elseif ($message_to_generate->get_EE_Message()->STS_ID() === EEM_Message::status_incomplete) { |
|
459 | + $generated_queue = $this->generate_and_return([$message_to_generate]); |
|
460 | + $generated_queue->execute(false, $sending_messenger); |
|
461 | + return $generated_queue; |
|
462 | + } |
|
463 | + return null; |
|
464 | + } |
|
465 | + |
|
466 | + |
|
467 | + /** |
|
468 | + * Creates mtg objects for all active messengers and queues for generation. |
|
469 | + * This method also calls the execute by priority method on the queue which will optionally kick off a new |
|
470 | + * non-blocking request to complete the action if the priority for the message requires immediate action. |
|
471 | + * |
|
472 | + * @param string $message_type |
|
473 | + * @param mixed $data The data being used for generation. |
|
474 | + * @param bool $persist Whether to persist the queued messages to the db or not. |
|
475 | + * @throws EE_Error |
|
476 | + * @throws ReflectionException |
|
477 | + */ |
|
478 | + public function generate_for_all_active_messengers($message_type, $data, $persist = true) |
|
479 | + { |
|
480 | + $messages_to_generate = $this->setup_mtgs_for_all_active_messengers($message_type, $data); |
|
481 | + if ($persist) { |
|
482 | + $this->batch_queue_for_generation_and_persist($messages_to_generate); |
|
483 | + $this->_queue->initiate_request_by_priority(); |
|
484 | + } else { |
|
485 | + $this->batch_queue_for_generation_no_persist($messages_to_generate); |
|
486 | + } |
|
487 | + } |
|
488 | + |
|
489 | + |
|
490 | + /** |
|
491 | + * This simply loops through all active messengers and takes care of setting up the |
|
492 | + * EE_Message_To_Generate objects. |
|
493 | + * |
|
494 | + * @param $message_type |
|
495 | + * @param $data |
|
496 | + * |
|
497 | + * @return EE_Message_To_Generate[] |
|
498 | + */ |
|
499 | + public function setup_mtgs_for_all_active_messengers($message_type, $data) |
|
500 | + { |
|
501 | + $messages_to_generate = []; |
|
502 | + foreach ($this->_message_resource_manager->active_messengers() as $messenger_slug => $messenger_object) { |
|
503 | + $message_to_generate = new EE_Message_To_Generate($messenger_slug, $message_type, $data); |
|
504 | + if ($message_to_generate->valid()) { |
|
505 | + $messages_to_generate[] = $message_to_generate; |
|
506 | + } |
|
507 | + } |
|
508 | + return $messages_to_generate; |
|
509 | + } |
|
510 | + |
|
511 | + |
|
512 | + /** |
|
513 | + * This accepts an array of EE_Message::MSG_ID values |
|
514 | + * and will use that to retrieve the objects from the database and send. |
|
515 | + * |
|
516 | + * @param array $message_ids |
|
517 | + * @throws EE_Error |
|
518 | + * @throws ReflectionException |
|
519 | + */ |
|
520 | + public function setup_messages_from_ids_and_send($message_ids) |
|
521 | + { |
|
522 | + $this->_init_queue_and_generator(); |
|
523 | + $messages = EEM_Message::instance()->get_all( |
|
524 | + [ |
|
525 | + [ |
|
526 | + 'MSG_ID' => ['IN', $message_ids], |
|
527 | + 'STS_ID' => [ |
|
528 | + 'IN', |
|
529 | + array_merge( |
|
530 | + EEM_Message::instance()->stati_indicating_sent(), |
|
531 | + [EEM_Message::status_retry] |
|
532 | + ), |
|
533 | + ], |
|
534 | + ], |
|
535 | + ] |
|
536 | + ); |
|
537 | + // set the Messages to resend. |
|
538 | + foreach ($messages as $message) { |
|
539 | + if ($message instanceof EE_Message) { |
|
540 | + $message->set_STS_ID(EEM_Message::status_resend); |
|
541 | + $this->_queue->add($message); |
|
542 | + } |
|
543 | + } |
|
544 | + |
|
545 | + $this->_queue->initiate_request_by_priority('send'); |
|
546 | + } |
|
547 | + |
|
548 | + |
|
549 | + /** |
|
550 | + * This method checks for registration IDs in the request via the given key and creates the messages to generate |
|
551 | + * objects from them, then returns the array of messages to generate objects. |
|
552 | + * Note, this sets up registrations for the registration family of message types. |
|
553 | + * |
|
554 | + * @param string $registration_ids_key This is used to indicate what represents the registration ids in the request. |
|
555 | + * |
|
556 | + * @return EE_Message_To_Generate[]|bool |
|
557 | + * @throws EE_Error |
|
558 | + */ |
|
559 | + public function setup_messages_to_generate_from_registration_ids_in_request($registration_ids_key = '_REG_ID') |
|
560 | + { |
|
561 | + /** @var RequestInterface $request */ |
|
562 | + $request = LoaderFactory::getLoader()->getShared(RequestInterface::class); |
|
563 | + $regs_to_send = []; |
|
564 | + $regIDs = $request->getRequestParam($registration_ids_key, [], 'int', true); |
|
565 | + if (empty($regIDs)) { |
|
566 | + EE_Error::add_error( |
|
567 | + esc_html__('Something went wrong because we\'re missing the registration ID', 'event_espresso'), |
|
568 | + __FILE__, |
|
569 | + __FUNCTION__, |
|
570 | + __LINE__ |
|
571 | + ); |
|
572 | + return false; |
|
573 | + } |
|
574 | + |
|
575 | + // make sure is an array |
|
576 | + $regIDs = is_array($regIDs) ? $regIDs : [$regIDs]; |
|
577 | + |
|
578 | + foreach ($regIDs as $regID) { |
|
579 | + $reg = EEM_Registration::instance()->get_one_by_ID($regID); |
|
580 | + if (! $reg instanceof EE_Registration) { |
|
581 | + EE_Error::add_error( |
|
582 | + sprintf( |
|
583 | + esc_html__( |
|
584 | + 'Unable to retrieve a registration object for the given reg id (%s)', |
|
585 | + 'event_espresso' |
|
586 | + ), |
|
587 | + $regID |
|
588 | + ) |
|
589 | + ); |
|
590 | + return false; |
|
591 | + } |
|
592 | + $regs_to_send[ $reg->transaction_ID() ][ $reg->status_ID() ][] = $reg; |
|
593 | + } |
|
594 | + |
|
595 | + $messages_to_generate = []; |
|
596 | + |
|
597 | + foreach ($regs_to_send as $status_group) { |
|
598 | + foreach ($status_group as $status_id => $registrations) { |
|
599 | + $message_type = EEH_MSG_Template::convert_reg_status_to_message_type($status_id); |
|
600 | + if (! $message_type) { |
|
601 | + continue; |
|
602 | + } |
|
603 | + $messages_to_generate = array_merge( |
|
604 | + $messages_to_generate, |
|
605 | + $this->setup_mtgs_for_all_active_messengers( |
|
606 | + $message_type, |
|
607 | + [$registrations, $status_id] |
|
608 | + ) |
|
609 | + ); |
|
610 | + } |
|
611 | + } |
|
612 | + |
|
613 | + return $messages_to_generate; |
|
614 | + } |
|
615 | 615 | } |
@@ -297,8 +297,8 @@ |
||
297 | 297 | */ |
298 | 298 | public static function verify_and_retrieve_class_name_for_data_handler_reference($data_handler_reference) |
299 | 299 | { |
300 | - $class_name = 'EE_Messages_' . $data_handler_reference . '_incoming_data'; |
|
301 | - if (! class_exists($class_name)) { |
|
300 | + $class_name = 'EE_Messages_'.$data_handler_reference.'_incoming_data'; |
|
301 | + if ( ! class_exists($class_name)) { |
|
302 | 302 | EE_Error::add_error( |
303 | 303 | sprintf( |
304 | 304 | esc_html__( |
@@ -11,308 +11,308 @@ |
||
11 | 11 | */ |
12 | 12 | class EE_Message_To_Generate |
13 | 13 | { |
14 | - /** |
|
15 | - * @var string |
|
16 | - */ |
|
17 | - protected $_messenger_name; |
|
18 | - |
|
19 | - /** |
|
20 | - * @var string |
|
21 | - */ |
|
22 | - protected $_message_type_name; |
|
23 | - |
|
24 | - /** |
|
25 | - * @var EE_messenger |
|
26 | - */ |
|
27 | - protected $_messenger; |
|
28 | - |
|
29 | - /** |
|
30 | - * @var EE_message_type |
|
31 | - */ |
|
32 | - protected $_message_type; |
|
33 | - |
|
34 | - /** |
|
35 | - * Identifier for the context the message is to be generated for. |
|
36 | - * |
|
37 | - * @var string |
|
38 | - */ |
|
39 | - protected $_context = ''; |
|
40 | - |
|
41 | - /** |
|
42 | - * Data that will be used to generate message. |
|
43 | - * |
|
44 | - * @var array |
|
45 | - */ |
|
46 | - protected $_data = []; |
|
47 | - |
|
48 | - /** |
|
49 | - * Whether this message is for a preview or not. |
|
50 | - * |
|
51 | - * @var bool |
|
52 | - */ |
|
53 | - protected $_preview = false; |
|
54 | - |
|
55 | - /** |
|
56 | - * @var EE_Message |
|
57 | - */ |
|
58 | - protected $_message; |
|
59 | - |
|
60 | - /** |
|
61 | - * This is set by the constructor to indicate whether the incoming messenger |
|
62 | - * and message type are valid. This can then be checked by callers to determine whether |
|
63 | - * to generate this message or not. |
|
64 | - * |
|
65 | - * @var bool |
|
66 | - */ |
|
67 | - protected $_valid = false; |
|
68 | - |
|
69 | - /** |
|
70 | - * If there are any errors (non exception errors) they get added to this array for callers to decide |
|
71 | - * how to handle. |
|
72 | - * |
|
73 | - * @var array |
|
74 | - */ |
|
75 | - protected $_error_msg = []; |
|
76 | - |
|
77 | - /** |
|
78 | - * Can be accessed via the send_now() method, this is set in the validation |
|
79 | - * routine via the EE_messenger::send_now() method. |
|
80 | - * |
|
81 | - * @var bool |
|
82 | - */ |
|
83 | - protected $_send_now = false; |
|
84 | - |
|
85 | - /** |
|
86 | - * Holds the classname for the data handler used by the current message type. |
|
87 | - * This is set on the first call to the public `get_data_handler_class_name()` method. |
|
88 | - * |
|
89 | - * @var string |
|
90 | - */ |
|
91 | - protected $_data_handler_class_name = ''; |
|
92 | - |
|
93 | - /** |
|
94 | - * one of the message status constants on EEM_Message |
|
95 | - * |
|
96 | - * @var string |
|
97 | - * @since 4.10.29.p |
|
98 | - */ |
|
99 | - protected $_status = ''; |
|
100 | - |
|
101 | - /** |
|
102 | - * use $_status var above |
|
103 | - * |
|
104 | - * @var string |
|
105 | - * @deprecated 4.10.29.p |
|
106 | - */ |
|
107 | - protected $_message_status = ''; |
|
108 | - |
|
109 | - |
|
110 | - /** |
|
111 | - * Constructor |
|
112 | - * |
|
113 | - * @param string $messenger_name Slug representing messenger |
|
114 | - * @param string $message_type_name Slug representing message type. |
|
115 | - * @param mixed $data Data used for generating message. |
|
116 | - * @param string $context Optional context to restrict message generated for. |
|
117 | - * @param bool $preview Whether this is being used to generate a preview or not. |
|
118 | - * @param string $status |
|
119 | - */ |
|
120 | - public function __construct( |
|
121 | - $messenger_name, |
|
122 | - $message_type_name, |
|
123 | - $data = [], |
|
124 | - $context = '', |
|
125 | - $preview = false, |
|
126 | - $status = EEM_Message::status_incomplete |
|
127 | - ) { |
|
128 | - $this->_messenger_name = $messenger_name; |
|
129 | - $this->_message_type_name = $message_type_name; |
|
130 | - $this->_data = is_array($data) ? $data : [$data]; |
|
131 | - $this->_context = $context; |
|
132 | - $this->_preview = $preview; |
|
133 | - $this->_status = $status; |
|
134 | - // attempt to generate message immediately |
|
135 | - $this->_message = $this->_generate_message(); |
|
136 | - } |
|
137 | - |
|
138 | - |
|
139 | - /** |
|
140 | - * @return string |
|
141 | - */ |
|
142 | - public function context() |
|
143 | - { |
|
144 | - return $this->_context; |
|
145 | - } |
|
146 | - |
|
147 | - |
|
148 | - /** |
|
149 | - * @return array |
|
150 | - */ |
|
151 | - public function data() |
|
152 | - { |
|
153 | - return $this->_data; |
|
154 | - } |
|
155 | - |
|
156 | - |
|
157 | - /** |
|
158 | - * @return EE_messenger |
|
159 | - */ |
|
160 | - public function messenger() |
|
161 | - { |
|
162 | - return $this->_messenger; |
|
163 | - } |
|
164 | - |
|
165 | - |
|
166 | - /** |
|
167 | - * @return EE_message_type |
|
168 | - */ |
|
169 | - public function message_type() |
|
170 | - { |
|
171 | - return $this->_message_type; |
|
172 | - } |
|
173 | - |
|
174 | - |
|
175 | - /** |
|
176 | - * @return boolean |
|
177 | - */ |
|
178 | - public function preview() |
|
179 | - { |
|
180 | - return $this->_preview; |
|
181 | - } |
|
182 | - |
|
183 | - |
|
184 | - /** |
|
185 | - * @param boolean $preview |
|
186 | - */ |
|
187 | - public function set_preview($preview) |
|
188 | - { |
|
189 | - $this->_preview = filter_var($preview, FILTER_VALIDATE_BOOLEAN); |
|
190 | - } |
|
191 | - |
|
192 | - |
|
193 | - /** |
|
194 | - * @return bool |
|
195 | - */ |
|
196 | - public function send_now() |
|
197 | - { |
|
198 | - return $this->_send_now; |
|
199 | - } |
|
200 | - |
|
201 | - |
|
202 | - /** |
|
203 | - * Simply returns the state of the $_valid property. |
|
204 | - * |
|
205 | - * @return bool |
|
206 | - */ |
|
207 | - public function valid() |
|
208 | - { |
|
209 | - return $this->_valid; |
|
210 | - } |
|
211 | - |
|
212 | - |
|
213 | - /** |
|
214 | - * generates an EE_Message using the supplied arguments and some defaults |
|
215 | - * |
|
216 | - * @param array $properties |
|
217 | - * @return EE_Message |
|
218 | - */ |
|
219 | - protected function _generate_message($properties = []) |
|
220 | - { |
|
221 | - $message = EE_Message_Factory::create( |
|
222 | - array_merge( |
|
223 | - [ |
|
224 | - 'MSG_messenger' => $this->_messenger_name, |
|
225 | - 'MSG_message_type' => $this->_message_type_name, |
|
226 | - 'MSG_context' => $this->_context, |
|
227 | - 'STS_ID' => $this->_status, |
|
228 | - ], |
|
229 | - $properties |
|
230 | - ) |
|
231 | - ); |
|
232 | - // validate the message, and if it's good, set some properties |
|
233 | - try { |
|
234 | - $message->is_valid_for_sending_or_generation(true); |
|
235 | - $this->_valid = true; |
|
236 | - $this->_messenger = $message->messenger_object(); |
|
237 | - $this->_message_type = $message->message_type_object(); |
|
238 | - $this->_send_now = $message->send_now(); |
|
239 | - } catch (Exception $e) { |
|
240 | - $this->_valid = false; |
|
241 | - $this->_error_msg[] = $e->getMessage(); |
|
242 | - } |
|
243 | - return $message; |
|
244 | - } |
|
245 | - |
|
246 | - |
|
247 | - /** |
|
248 | - * Returns an instantiated EE_Message object from the internal data. |
|
249 | - * |
|
250 | - * @return EE_Message |
|
251 | - */ |
|
252 | - public function get_EE_Message() |
|
253 | - { |
|
254 | - // already set ? |
|
255 | - if ($this->_message instanceof EE_Message) { |
|
256 | - return $this->_message; |
|
257 | - } |
|
258 | - // no? then let's create one |
|
259 | - $this->_message = $this->_generate_message(); |
|
260 | - return $this->_message; |
|
261 | - } |
|
262 | - |
|
263 | - |
|
264 | - /** |
|
265 | - * This returns the data_handler class name for the internal message type set. |
|
266 | - * Note: this also verifies that the data handler class exists. If it doesn't then $_valid is set to false |
|
267 | - * and the data_handler_class name is set to an empty string. |
|
268 | - * |
|
269 | - * @param bool $preview Used to indicate that the preview data handler is to be returned. |
|
270 | - * @return string |
|
271 | - */ |
|
272 | - public function get_data_handler_class_name($preview = false) |
|
273 | - { |
|
274 | - if ($this->_data_handler_class_name === '' && $this->valid()) { |
|
275 | - $ref = $preview ? 'Preview' : $this->_message_type->get_data_handler($this->_data); |
|
276 | - // make sure internal data is updated. |
|
277 | - $this->_data = $this->_message_type->get_data(); |
|
278 | - |
|
279 | - // verify |
|
280 | - $this->_data_handler_class_name = |
|
281 | - EE_Message_To_Generate::verify_and_retrieve_class_name_for_data_handler_reference($ref); |
|
282 | - if ($this->_data_handler_class_name === '') { |
|
283 | - $this->_valid = false; |
|
284 | - } |
|
285 | - } |
|
286 | - return $this->_data_handler_class_name; |
|
287 | - } |
|
288 | - |
|
289 | - |
|
290 | - /** |
|
291 | - * Validates the given string as a reference for an existing, accessible data handler and returns the class name |
|
292 | - * For the handler the reference matches. |
|
293 | - * |
|
294 | - * @param string $data_handler_reference |
|
295 | - * @return string |
|
296 | - */ |
|
297 | - public static function verify_and_retrieve_class_name_for_data_handler_reference($data_handler_reference) |
|
298 | - { |
|
299 | - $class_name = 'EE_Messages_' . $data_handler_reference . '_incoming_data'; |
|
300 | - if (! class_exists($class_name)) { |
|
301 | - EE_Error::add_error( |
|
302 | - sprintf( |
|
303 | - esc_html__( |
|
304 | - 'The included data handler reference (%s) does not match any valid, accessible, "EE_Messages_incoming_data" classes. Looking for %s.', |
|
305 | - 'event_espresso' |
|
306 | - ), |
|
307 | - $data_handler_reference, |
|
308 | - $class_name |
|
309 | - ), |
|
310 | - __FILE__, |
|
311 | - __FUNCTION__, |
|
312 | - __LINE__ |
|
313 | - ); |
|
314 | - $class_name = ''; // clear out class_name so caller knows this isn't valid. |
|
315 | - } |
|
316 | - return $class_name; |
|
317 | - } |
|
14 | + /** |
|
15 | + * @var string |
|
16 | + */ |
|
17 | + protected $_messenger_name; |
|
18 | + |
|
19 | + /** |
|
20 | + * @var string |
|
21 | + */ |
|
22 | + protected $_message_type_name; |
|
23 | + |
|
24 | + /** |
|
25 | + * @var EE_messenger |
|
26 | + */ |
|
27 | + protected $_messenger; |
|
28 | + |
|
29 | + /** |
|
30 | + * @var EE_message_type |
|
31 | + */ |
|
32 | + protected $_message_type; |
|
33 | + |
|
34 | + /** |
|
35 | + * Identifier for the context the message is to be generated for. |
|
36 | + * |
|
37 | + * @var string |
|
38 | + */ |
|
39 | + protected $_context = ''; |
|
40 | + |
|
41 | + /** |
|
42 | + * Data that will be used to generate message. |
|
43 | + * |
|
44 | + * @var array |
|
45 | + */ |
|
46 | + protected $_data = []; |
|
47 | + |
|
48 | + /** |
|
49 | + * Whether this message is for a preview or not. |
|
50 | + * |
|
51 | + * @var bool |
|
52 | + */ |
|
53 | + protected $_preview = false; |
|
54 | + |
|
55 | + /** |
|
56 | + * @var EE_Message |
|
57 | + */ |
|
58 | + protected $_message; |
|
59 | + |
|
60 | + /** |
|
61 | + * This is set by the constructor to indicate whether the incoming messenger |
|
62 | + * and message type are valid. This can then be checked by callers to determine whether |
|
63 | + * to generate this message or not. |
|
64 | + * |
|
65 | + * @var bool |
|
66 | + */ |
|
67 | + protected $_valid = false; |
|
68 | + |
|
69 | + /** |
|
70 | + * If there are any errors (non exception errors) they get added to this array for callers to decide |
|
71 | + * how to handle. |
|
72 | + * |
|
73 | + * @var array |
|
74 | + */ |
|
75 | + protected $_error_msg = []; |
|
76 | + |
|
77 | + /** |
|
78 | + * Can be accessed via the send_now() method, this is set in the validation |
|
79 | + * routine via the EE_messenger::send_now() method. |
|
80 | + * |
|
81 | + * @var bool |
|
82 | + */ |
|
83 | + protected $_send_now = false; |
|
84 | + |
|
85 | + /** |
|
86 | + * Holds the classname for the data handler used by the current message type. |
|
87 | + * This is set on the first call to the public `get_data_handler_class_name()` method. |
|
88 | + * |
|
89 | + * @var string |
|
90 | + */ |
|
91 | + protected $_data_handler_class_name = ''; |
|
92 | + |
|
93 | + /** |
|
94 | + * one of the message status constants on EEM_Message |
|
95 | + * |
|
96 | + * @var string |
|
97 | + * @since 4.10.29.p |
|
98 | + */ |
|
99 | + protected $_status = ''; |
|
100 | + |
|
101 | + /** |
|
102 | + * use $_status var above |
|
103 | + * |
|
104 | + * @var string |
|
105 | + * @deprecated 4.10.29.p |
|
106 | + */ |
|
107 | + protected $_message_status = ''; |
|
108 | + |
|
109 | + |
|
110 | + /** |
|
111 | + * Constructor |
|
112 | + * |
|
113 | + * @param string $messenger_name Slug representing messenger |
|
114 | + * @param string $message_type_name Slug representing message type. |
|
115 | + * @param mixed $data Data used for generating message. |
|
116 | + * @param string $context Optional context to restrict message generated for. |
|
117 | + * @param bool $preview Whether this is being used to generate a preview or not. |
|
118 | + * @param string $status |
|
119 | + */ |
|
120 | + public function __construct( |
|
121 | + $messenger_name, |
|
122 | + $message_type_name, |
|
123 | + $data = [], |
|
124 | + $context = '', |
|
125 | + $preview = false, |
|
126 | + $status = EEM_Message::status_incomplete |
|
127 | + ) { |
|
128 | + $this->_messenger_name = $messenger_name; |
|
129 | + $this->_message_type_name = $message_type_name; |
|
130 | + $this->_data = is_array($data) ? $data : [$data]; |
|
131 | + $this->_context = $context; |
|
132 | + $this->_preview = $preview; |
|
133 | + $this->_status = $status; |
|
134 | + // attempt to generate message immediately |
|
135 | + $this->_message = $this->_generate_message(); |
|
136 | + } |
|
137 | + |
|
138 | + |
|
139 | + /** |
|
140 | + * @return string |
|
141 | + */ |
|
142 | + public function context() |
|
143 | + { |
|
144 | + return $this->_context; |
|
145 | + } |
|
146 | + |
|
147 | + |
|
148 | + /** |
|
149 | + * @return array |
|
150 | + */ |
|
151 | + public function data() |
|
152 | + { |
|
153 | + return $this->_data; |
|
154 | + } |
|
155 | + |
|
156 | + |
|
157 | + /** |
|
158 | + * @return EE_messenger |
|
159 | + */ |
|
160 | + public function messenger() |
|
161 | + { |
|
162 | + return $this->_messenger; |
|
163 | + } |
|
164 | + |
|
165 | + |
|
166 | + /** |
|
167 | + * @return EE_message_type |
|
168 | + */ |
|
169 | + public function message_type() |
|
170 | + { |
|
171 | + return $this->_message_type; |
|
172 | + } |
|
173 | + |
|
174 | + |
|
175 | + /** |
|
176 | + * @return boolean |
|
177 | + */ |
|
178 | + public function preview() |
|
179 | + { |
|
180 | + return $this->_preview; |
|
181 | + } |
|
182 | + |
|
183 | + |
|
184 | + /** |
|
185 | + * @param boolean $preview |
|
186 | + */ |
|
187 | + public function set_preview($preview) |
|
188 | + { |
|
189 | + $this->_preview = filter_var($preview, FILTER_VALIDATE_BOOLEAN); |
|
190 | + } |
|
191 | + |
|
192 | + |
|
193 | + /** |
|
194 | + * @return bool |
|
195 | + */ |
|
196 | + public function send_now() |
|
197 | + { |
|
198 | + return $this->_send_now; |
|
199 | + } |
|
200 | + |
|
201 | + |
|
202 | + /** |
|
203 | + * Simply returns the state of the $_valid property. |
|
204 | + * |
|
205 | + * @return bool |
|
206 | + */ |
|
207 | + public function valid() |
|
208 | + { |
|
209 | + return $this->_valid; |
|
210 | + } |
|
211 | + |
|
212 | + |
|
213 | + /** |
|
214 | + * generates an EE_Message using the supplied arguments and some defaults |
|
215 | + * |
|
216 | + * @param array $properties |
|
217 | + * @return EE_Message |
|
218 | + */ |
|
219 | + protected function _generate_message($properties = []) |
|
220 | + { |
|
221 | + $message = EE_Message_Factory::create( |
|
222 | + array_merge( |
|
223 | + [ |
|
224 | + 'MSG_messenger' => $this->_messenger_name, |
|
225 | + 'MSG_message_type' => $this->_message_type_name, |
|
226 | + 'MSG_context' => $this->_context, |
|
227 | + 'STS_ID' => $this->_status, |
|
228 | + ], |
|
229 | + $properties |
|
230 | + ) |
|
231 | + ); |
|
232 | + // validate the message, and if it's good, set some properties |
|
233 | + try { |
|
234 | + $message->is_valid_for_sending_or_generation(true); |
|
235 | + $this->_valid = true; |
|
236 | + $this->_messenger = $message->messenger_object(); |
|
237 | + $this->_message_type = $message->message_type_object(); |
|
238 | + $this->_send_now = $message->send_now(); |
|
239 | + } catch (Exception $e) { |
|
240 | + $this->_valid = false; |
|
241 | + $this->_error_msg[] = $e->getMessage(); |
|
242 | + } |
|
243 | + return $message; |
|
244 | + } |
|
245 | + |
|
246 | + |
|
247 | + /** |
|
248 | + * Returns an instantiated EE_Message object from the internal data. |
|
249 | + * |
|
250 | + * @return EE_Message |
|
251 | + */ |
|
252 | + public function get_EE_Message() |
|
253 | + { |
|
254 | + // already set ? |
|
255 | + if ($this->_message instanceof EE_Message) { |
|
256 | + return $this->_message; |
|
257 | + } |
|
258 | + // no? then let's create one |
|
259 | + $this->_message = $this->_generate_message(); |
|
260 | + return $this->_message; |
|
261 | + } |
|
262 | + |
|
263 | + |
|
264 | + /** |
|
265 | + * This returns the data_handler class name for the internal message type set. |
|
266 | + * Note: this also verifies that the data handler class exists. If it doesn't then $_valid is set to false |
|
267 | + * and the data_handler_class name is set to an empty string. |
|
268 | + * |
|
269 | + * @param bool $preview Used to indicate that the preview data handler is to be returned. |
|
270 | + * @return string |
|
271 | + */ |
|
272 | + public function get_data_handler_class_name($preview = false) |
|
273 | + { |
|
274 | + if ($this->_data_handler_class_name === '' && $this->valid()) { |
|
275 | + $ref = $preview ? 'Preview' : $this->_message_type->get_data_handler($this->_data); |
|
276 | + // make sure internal data is updated. |
|
277 | + $this->_data = $this->_message_type->get_data(); |
|
278 | + |
|
279 | + // verify |
|
280 | + $this->_data_handler_class_name = |
|
281 | + EE_Message_To_Generate::verify_and_retrieve_class_name_for_data_handler_reference($ref); |
|
282 | + if ($this->_data_handler_class_name === '') { |
|
283 | + $this->_valid = false; |
|
284 | + } |
|
285 | + } |
|
286 | + return $this->_data_handler_class_name; |
|
287 | + } |
|
288 | + |
|
289 | + |
|
290 | + /** |
|
291 | + * Validates the given string as a reference for an existing, accessible data handler and returns the class name |
|
292 | + * For the handler the reference matches. |
|
293 | + * |
|
294 | + * @param string $data_handler_reference |
|
295 | + * @return string |
|
296 | + */ |
|
297 | + public static function verify_and_retrieve_class_name_for_data_handler_reference($data_handler_reference) |
|
298 | + { |
|
299 | + $class_name = 'EE_Messages_' . $data_handler_reference . '_incoming_data'; |
|
300 | + if (! class_exists($class_name)) { |
|
301 | + EE_Error::add_error( |
|
302 | + sprintf( |
|
303 | + esc_html__( |
|
304 | + 'The included data handler reference (%s) does not match any valid, accessible, "EE_Messages_incoming_data" classes. Looking for %s.', |
|
305 | + 'event_espresso' |
|
306 | + ), |
|
307 | + $data_handler_reference, |
|
308 | + $class_name |
|
309 | + ), |
|
310 | + __FILE__, |
|
311 | + __FUNCTION__, |
|
312 | + __LINE__ |
|
313 | + ); |
|
314 | + $class_name = ''; // clear out class_name so caller knows this isn't valid. |
|
315 | + } |
|
316 | + return $class_name; |
|
317 | + } |
|
318 | 318 | } |
@@ -6,15 +6,15 @@ discard block |
||
6 | 6 | </p> |
7 | 7 | <p> |
8 | 8 | <?php |
9 | - printf( |
|
10 | - esc_html__( |
|
11 | - 'See %1$shere%2$s for list of currencies supported by Authorize.net AIM.', |
|
12 | - 'event_espresso' |
|
13 | - ), |
|
14 | - "<a href='https://support.authorize.net/s/article/Which-Currencies-Does-Authorize-Net-Support/' target='_blank' rel='noopener noreferrer'>", |
|
15 | - "</a>" |
|
16 | - ); |
|
17 | - ?> |
|
9 | + printf( |
|
10 | + esc_html__( |
|
11 | + 'See %1$shere%2$s for list of currencies supported by Authorize.net AIM.', |
|
12 | + 'event_espresso' |
|
13 | + ), |
|
14 | + "<a href='https://support.authorize.net/s/article/Which-Currencies-Does-Authorize-Net-Support/' target='_blank' rel='noopener noreferrer'>", |
|
15 | + "</a>" |
|
16 | + ); |
|
17 | + ?> |
|
18 | 18 | </p> |
19 | 19 | <p> |
20 | 20 | <strong><?php esc_html_e('Authorize.net AIM Settings', 'event_espresso'); ?></strong> |
@@ -24,70 +24,70 @@ discard block |
||
24 | 24 | <strong><?php esc_html_e('Authorize.net API Login ID', 'event_espresso'); ?></strong> |
25 | 25 | <br/> |
26 | 26 | <?php |
27 | - printf( |
|
28 | - esc_html__( |
|
29 | - 'Enter your API Login ID for Authorize.net. Learn how to find your %1$sAPI Login%2$s ID.', |
|
30 | - 'event_espresso' |
|
31 | - ), |
|
32 | - '<a href="https://support.authorize.net/authkb/index?page=content&id=A405" target="_blank" rel="noopener noreferrer">', |
|
33 | - '</a>' |
|
34 | - ); |
|
35 | - ?> |
|
27 | + printf( |
|
28 | + esc_html__( |
|
29 | + 'Enter your API Login ID for Authorize.net. Learn how to find your %1$sAPI Login%2$s ID.', |
|
30 | + 'event_espresso' |
|
31 | + ), |
|
32 | + '<a href="https://support.authorize.net/authkb/index?page=content&id=A405" target="_blank" rel="noopener noreferrer">', |
|
33 | + '</a>' |
|
34 | + ); |
|
35 | + ?> |
|
36 | 36 | </li> |
37 | 37 | <li> |
38 | 38 | <strong><?php esc_html_e('Authorize.net Transaction Key', 'event_espresso'); ?></strong> |
39 | 39 | <br/> |
40 | 40 | <?php |
41 | - printf( |
|
42 | - esc_html__( |
|
43 | - 'Enter your Transaction Key for Authorize.net. Learn how to find your %1$sTransaction Key%2$s.', |
|
44 | - 'event_espresso' |
|
45 | - ), |
|
46 | - '<a href="https://support.authorize.net/authkb/index?page=content&id=A405" target="_blank" rel="noopener noreferrer">', |
|
47 | - '</a>' |
|
48 | - ); |
|
49 | - ?> |
|
41 | + printf( |
|
42 | + esc_html__( |
|
43 | + 'Enter your Transaction Key for Authorize.net. Learn how to find your %1$sTransaction Key%2$s.', |
|
44 | + 'event_espresso' |
|
45 | + ), |
|
46 | + '<a href="https://support.authorize.net/authkb/index?page=content&id=A405" target="_blank" rel="noopener noreferrer">', |
|
47 | + '</a>' |
|
48 | + ); |
|
49 | + ?> |
|
50 | 50 | </li> |
51 | 51 | <li> |
52 | 52 | <strong> |
53 | 53 | <?php esc_html_e( |
54 | - 'Is this an account on the Authorize.net development server?', |
|
55 | - 'event_espresso' |
|
56 | - ); ?> |
|
54 | + 'Is this an account on the Authorize.net development server?', |
|
55 | + 'event_espresso' |
|
56 | + ); ?> |
|
57 | 57 | </strong> |
58 | 58 | <br/> |
59 | 59 | <?php esc_html_e( |
60 | - 'Specify whether this is a live/production account or a test account on the Authorize.net development server.', |
|
61 | - 'event_espresso' |
|
62 | - ); ?> |
|
60 | + 'Specify whether this is a live/production account or a test account on the Authorize.net development server.', |
|
61 | + 'event_espresso' |
|
62 | + ); ?> |
|
63 | 63 | </li> |
64 | 64 | <li> |
65 | 65 | <strong><?php esc_html_e('Do you want to submit a test transaction?', 'event_espresso'); ?></strong> |
66 | 66 | <br/> |
67 | 67 | <?php esc_html_e( |
68 | - 'Specify if you want to test the Authorize.net AIM payment gateway by submitting a test transaction. Be sure to turn this setting off when you are done testing.', |
|
69 | - 'event_espresso' |
|
70 | - ); ?> |
|
68 | + 'Specify if you want to test the Authorize.net AIM payment gateway by submitting a test transaction. Be sure to turn this setting off when you are done testing.', |
|
69 | + 'event_espresso' |
|
70 | + ); ?> |
|
71 | 71 | </li> |
72 | 72 | <li> |
73 | 73 | <strong><?php esc_html_e('Excluded and Required Payment Form Fields', 'event_espresso'); ?></strong> |
74 | 74 | <br/> |
75 | 75 | <?php esc_html_e( |
76 | - 'By logging into Authorize.net, you can change which payment fields are required by Authorize.net when processing payments. These settings affect both the Advanced Integration Method (AIM, this) and the Simple Integration Method (SIM, different). The payment method settings "Excluded Payment Form Fields" and "Required Payment Form Fields" allow you to change the billing form in Event Espresso to reflect your payment form settings in Authorize.net.', |
|
77 | - 'event_espresso' |
|
78 | - ); ?> |
|
76 | + 'By logging into Authorize.net, you can change which payment fields are required by Authorize.net when processing payments. These settings affect both the Advanced Integration Method (AIM, this) and the Simple Integration Method (SIM, different). The payment method settings "Excluded Payment Form Fields" and "Required Payment Form Fields" allow you to change the billing form in Event Espresso to reflect your payment form settings in Authorize.net.', |
|
77 | + 'event_espresso' |
|
78 | + ); ?> |
|
79 | 79 | <br> |
80 | 80 | <?php printf( |
81 | - esc_html__( |
|
82 | - 'To change your payment form settings in Authorize.net, %1$slog in to authorize.net%2$s, go to %3$sAccount then Payment Form%2$s, then %4$sForm Fields%2$s. It will look similar to %5$sthis%2$s. If you make a field required in Authorize.net, you should also make it required in Event Espresso. If it isn\'t required in Authorize.net, and you want to simplify the billing form in Event Espresso, you can exclude it from the Event Espresso Form too.', |
|
83 | - 'event_espresso' |
|
84 | - ), |
|
85 | - '<a href="http://authorize.net" target="_blank" rel="noopener noreferrer">', |
|
86 | - '</a>', |
|
87 | - '<a href="https://monosnap.com/file/nebVteOkEXcdDIos88SojStWOifP23" target="_blank" rel="noopener noreferrer">', |
|
88 | - '<a href="https://monosnap.com/file/WyxGJtev87TcDmdGBEZ2oi1xaBIQAm" target="_blank" rel="noopener noreferrer">', |
|
89 | - '<a href="https://monosnap.com/image/DbCJNfEesWXeSNUs1wLIpGYODFw52m" target="_blank" rel="noopener noreferrer">' |
|
90 | - ); ?> |
|
81 | + esc_html__( |
|
82 | + 'To change your payment form settings in Authorize.net, %1$slog in to authorize.net%2$s, go to %3$sAccount then Payment Form%2$s, then %4$sForm Fields%2$s. It will look similar to %5$sthis%2$s. If you make a field required in Authorize.net, you should also make it required in Event Espresso. If it isn\'t required in Authorize.net, and you want to simplify the billing form in Event Espresso, you can exclude it from the Event Espresso Form too.', |
|
83 | + 'event_espresso' |
|
84 | + ), |
|
85 | + '<a href="http://authorize.net" target="_blank" rel="noopener noreferrer">', |
|
86 | + '</a>', |
|
87 | + '<a href="https://monosnap.com/file/nebVteOkEXcdDIos88SojStWOifP23" target="_blank" rel="noopener noreferrer">', |
|
88 | + '<a href="https://monosnap.com/file/WyxGJtev87TcDmdGBEZ2oi1xaBIQAm" target="_blank" rel="noopener noreferrer">', |
|
89 | + '<a href="https://monosnap.com/image/DbCJNfEesWXeSNUs1wLIpGYODFw52m" target="_blank" rel="noopener noreferrer">' |
|
90 | + ); ?> |
|
91 | 91 | </li> |
92 | 92 | <li> |
93 | 93 | <strong><?php esc_html_e('Button Image URL', 'event_espresso'); ?></strong> |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | <li> |
98 | 98 | <strong><?php esc_html_e('Note About Special Characters', 'event_espresso'); ?></strong> |
99 | 99 | <?php esc_html_e( |
100 | - 'If your event name, ticket name or ticket description contain special characters (eg emojis, foreign language characters, or curly quotes) they will be removed when sent to Authorize.net. This is because Authorize.net doesn\'t support them.', |
|
101 | - 'event_espresso' |
|
102 | - ); ?> |
|
100 | + 'If your event name, ticket name or ticket description contain special characters (eg emojis, foreign language characters, or curly quotes) they will be removed when sent to Authorize.net. This is because Authorize.net doesn\'t support them.', |
|
101 | + 'event_espresso' |
|
102 | + ); ?> |
|
103 | 103 | </li> |
104 | 104 | </ul> |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | '', |
176 | 176 | 'tckt-slctr-tbl-td-qty cntr', |
177 | 177 | '', |
178 | - 'headers="quantity-' . $this->EVT_ID . '"' |
|
178 | + 'headers="quantity-'.$this->EVT_ID.'"' |
|
179 | 179 | ); |
180 | 180 | $this->setTicketStatusDisplay($remaining); |
181 | 181 | if (empty($this->ticket_status_display)) { |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | '', |
243 | 243 | 'tckt-slctr-tbl-td-name', |
244 | 244 | '', |
245 | - 'headers="details-' . $this->EVT_ID . '"' |
|
245 | + 'headers="details-'.$this->EVT_ID.'"' |
|
246 | 246 | ); |
247 | 247 | $html .= EEH_HTML::strong($this->ticket->get_pretty('TKT_name')); |
248 | 248 | $html .= $this->ticket_details->getShowHideLinks(); |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | '', |
277 | 277 | 'tckt-slctr-tbl-td-price jst-rght', |
278 | 278 | '', |
279 | - 'headers="price-' . $this->EVT_ID . '"' |
|
279 | + 'headers="price-'.$this->EVT_ID.'"' |
|
280 | 280 | ); |
281 | 281 | $html .= EEH_HTML::span( |
282 | 282 | EEH_Template::format_currency($this->ticket_price), |
@@ -19,390 +19,390 @@ |
||
19 | 19 | */ |
20 | 20 | class TicketSelectorRowStandard extends TicketSelectorRow |
21 | 21 | { |
22 | - /** |
|
23 | - * @var TicketDetails |
|
24 | - */ |
|
25 | - protected $ticket_details; |
|
26 | - |
|
27 | - /** |
|
28 | - * @var EE_Ticket_Selector_Config |
|
29 | - */ |
|
30 | - protected $template_settings; |
|
31 | - |
|
32 | - /** |
|
33 | - * @var EE_Tax_Config |
|
34 | - */ |
|
35 | - protected $tax_settings; |
|
36 | - |
|
37 | - /** |
|
38 | - * @var boolean |
|
39 | - */ |
|
40 | - protected $prices_displayed_including_taxes; |
|
41 | - |
|
42 | - /** |
|
43 | - * @var int |
|
44 | - */ |
|
45 | - protected $row; |
|
46 | - |
|
47 | - /** |
|
48 | - * @var int |
|
49 | - */ |
|
50 | - protected $cols; |
|
51 | - |
|
52 | - /** |
|
53 | - * @var boolean |
|
54 | - */ |
|
55 | - protected $hidden_input_qty = false; |
|
56 | - |
|
57 | - /** |
|
58 | - * @var string |
|
59 | - */ |
|
60 | - protected $ticket_datetime_classes; |
|
61 | - |
|
62 | - private bool $use_new_checkbox_selector; |
|
63 | - |
|
64 | - |
|
65 | - /** |
|
66 | - * TicketDetails constructor. |
|
67 | - * |
|
68 | - * @param TicketDetails $ticket_details |
|
69 | - * @param EE_Tax_Config $tax_settings |
|
70 | - * @param int $total_tickets |
|
71 | - * @param int $max_attendees |
|
72 | - * @param int $row |
|
73 | - * @param int $cols |
|
74 | - * @param boolean $required_ticket_sold_out |
|
75 | - * @param string $event_status |
|
76 | - * @param string $ticket_datetime_classes |
|
77 | - * @param bool $use_new_checkbox_selector |
|
78 | - * @throws EE_Error |
|
79 | - * @throws UnexpectedEntityException |
|
80 | - */ |
|
81 | - public function __construct( |
|
82 | - TicketDetails $ticket_details, |
|
83 | - EE_Tax_Config $tax_settings, |
|
84 | - $total_tickets, |
|
85 | - $max_attendees, |
|
86 | - $row, |
|
87 | - $cols, |
|
88 | - $required_ticket_sold_out, |
|
89 | - $event_status, |
|
90 | - $ticket_datetime_classes, |
|
91 | - bool $use_new_checkbox_selector = false |
|
92 | - ) { |
|
93 | - $this->ticket_details = $ticket_details; |
|
94 | - $this->template_settings = $ticket_details->getTemplateSettings(); |
|
95 | - $this->tax_settings = $tax_settings; |
|
96 | - $this->row = $row; |
|
97 | - $this->cols = $cols; |
|
98 | - $this->ticket_datetime_classes = $ticket_datetime_classes; |
|
99 | - $this->use_new_checkbox_selector = $use_new_checkbox_selector; |
|
100 | - parent::__construct( |
|
101 | - $ticket_details->getTicket(), |
|
102 | - $max_attendees, |
|
103 | - $ticket_details->getDateFormat(), |
|
104 | - $event_status, |
|
105 | - $required_ticket_sold_out, |
|
106 | - $total_tickets |
|
107 | - ); |
|
108 | - } |
|
109 | - |
|
110 | - |
|
111 | - /** |
|
112 | - * other ticket rows will need to know if a required ticket is sold out, |
|
113 | - * so that they are not offered for sale |
|
114 | - * |
|
115 | - * @return boolean |
|
116 | - */ |
|
117 | - public function getRequiredTicketSoldOut() |
|
118 | - { |
|
119 | - return $this->required_ticket_sold_out; |
|
120 | - } |
|
121 | - |
|
122 | - |
|
123 | - /** |
|
124 | - * @return int |
|
125 | - */ |
|
126 | - public function getCols() |
|
127 | - { |
|
128 | - return $this->cols; |
|
129 | - } |
|
130 | - |
|
131 | - |
|
132 | - /** |
|
133 | - * getHtml |
|
134 | - * |
|
135 | - * @return string |
|
136 | - * @throws EE_Error |
|
137 | - * @throws ReflectionException |
|
138 | - */ |
|
139 | - public function getHtml() |
|
140 | - { |
|
141 | - $this->min = 0; |
|
142 | - $this->max = $this->ticket->max(); |
|
143 | - $remaining = $this->ticket->remaining(); |
|
144 | - $this->setTicketMinAndMax($remaining); |
|
145 | - // set flag if ticket is required (flag is set to start date so that future tickets are not blocked) |
|
146 | - $this->required_ticket_sold_out = $this->ticket->required() && ! $remaining |
|
147 | - ? $this->ticket->start_date() |
|
148 | - : $this->required_ticket_sold_out; |
|
149 | - $this->setTicketPriceDetails(); |
|
150 | - $this->setTicketStatusClasses($remaining); |
|
151 | - $filtered_row_html = $this->getFilteredRowHtml(); |
|
152 | - if ($filtered_row_html !== false) { |
|
153 | - return $filtered_row_html; |
|
154 | - } |
|
155 | - $ticket_selector_row_html = EEH_HTML::tr( |
|
156 | - '', |
|
157 | - '', |
|
158 | - "tckt-slctr-tbl-tr {$this->status_class}{$this->ticket_datetime_classes} " |
|
159 | - . espresso_get_object_css_class($this->ticket) |
|
160 | - ); |
|
161 | - $filtered_row_content = $this->getFilteredRowContents(); |
|
162 | - if ($filtered_row_content !== false) { |
|
163 | - if ($this->max_attendees === 1) { |
|
164 | - return $ticket_selector_row_html |
|
165 | - . $filtered_row_content |
|
166 | - . $this->ticketQtyAndIdHiddenInputs() |
|
167 | - . EEH_HTML::trx(); |
|
168 | - } |
|
169 | - return $ticket_selector_row_html |
|
170 | - . $filtered_row_content |
|
171 | - . EEH_HTML::trx(); |
|
172 | - } |
|
173 | - $this->hidden_input_qty = $this->max_attendees > 1; |
|
174 | - |
|
175 | - $ticket_selector_row_html .= $this->ticketNameTableCell(); |
|
176 | - $ticket_selector_row_html .= $this->ticketPriceTableCell(); |
|
177 | - $ticket_selector_row_html .= EEH_HTML::td( |
|
178 | - '', |
|
179 | - '', |
|
180 | - 'tckt-slctr-tbl-td-qty cntr', |
|
181 | - '', |
|
182 | - 'headers="quantity-' . $this->EVT_ID . '"' |
|
183 | - ); |
|
184 | - $this->setTicketStatusDisplay($remaining); |
|
185 | - if (empty($this->ticket_status_display)) { |
|
186 | - $this->hidden_input_qty = false; |
|
187 | - // display submit button since we have tickets available |
|
188 | - add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true'); |
|
189 | - if ($this->max_attendees === 1) { |
|
190 | - // only ONE attendee is allowed to register at a time |
|
191 | - $ticket_selector_row_html .= $this->onlyOneAttendeeCanRegister(); |
|
192 | - } else { |
|
193 | - $ticket_selector_row_html .= $this->max === 1 && $this->use_new_checkbox_selector |
|
194 | - ? $this->ticketCheckboxSelector() |
|
195 | - : $this->ticketQuantitySelector(); |
|
196 | - } |
|
197 | - } |
|
198 | - $ticket_selector_row_html .= $this->ticket_status_display; |
|
199 | - $ticket_selector_row_html .= $this->ticketQtyAndIdHiddenInputs(); |
|
200 | - $ticket_selector_row_html .= $this->ticket_details->display( |
|
201 | - $this->ticket_price, |
|
202 | - $remaining, |
|
203 | - $this->cols |
|
204 | - ); |
|
205 | - $ticket_selector_row_html .= EEH_HTML::tdx(); |
|
206 | - $ticket_selector_row_html .= EEH_HTML::trx(); |
|
207 | - |
|
208 | - |
|
209 | - $this->row++; |
|
210 | - return $ticket_selector_row_html; |
|
211 | - } |
|
212 | - |
|
213 | - |
|
214 | - /** |
|
215 | - * getTicketPriceDetails |
|
216 | - * |
|
217 | - * @return void |
|
218 | - * @throws EE_Error |
|
219 | - * @throws ReflectionException |
|
220 | - */ |
|
221 | - protected function setTicketPriceDetails() |
|
222 | - { |
|
223 | - $this->ticket_price = $this->tax_settings->prices_displayed_including_taxes |
|
224 | - ? $this->ticket->get_ticket_total_with_taxes() |
|
225 | - : $this->ticket->get_ticket_subtotal(); |
|
226 | - $this->ticket_bundle = false; |
|
227 | - $ticket_min = $this->ticket->min(); |
|
228 | - // for ticket bundles, set min and max qty the same |
|
229 | - if ($ticket_min !== 0 && $ticket_min === $this->ticket->max()) { |
|
230 | - $this->ticket_price *= $ticket_min; |
|
231 | - $this->ticket_bundle = true; |
|
232 | - } |
|
233 | - $this->ticket_price = apply_filters( |
|
234 | - 'FHEE__ticket_selector_chart_template__ticket_price', |
|
235 | - $this->ticket_price, |
|
236 | - $this->ticket |
|
237 | - ); |
|
238 | - } |
|
239 | - |
|
240 | - |
|
241 | - /** |
|
242 | - * ticketNameTableCell |
|
243 | - * |
|
244 | - * @return string |
|
245 | - * @throws EE_Error |
|
246 | - * @throws ReflectionException |
|
247 | - */ |
|
248 | - protected function ticketNameTableCell() |
|
249 | - { |
|
250 | - $html = EEH_HTML::td( |
|
251 | - '', |
|
252 | - '', |
|
253 | - 'tckt-slctr-tbl-td-name', |
|
254 | - '', |
|
255 | - 'headers="details-' . $this->EVT_ID . '"' |
|
256 | - ); |
|
257 | - $html .= EEH_HTML::strong($this->ticket->get_pretty('TKT_name')); |
|
258 | - $html .= $this->ticket_details->getShowHideLinks(); |
|
259 | - if ($this->ticket->required()) { |
|
260 | - $html .= EEH_HTML::p( |
|
261 | - apply_filters( |
|
262 | - 'FHEE__ticket_selector_chart_template__ticket_required_message', |
|
263 | - esc_html__('This ticket is required and must be purchased.', 'event_espresso') |
|
264 | - ), |
|
265 | - '', |
|
266 | - 'ticket-required-pg' |
|
267 | - ); |
|
268 | - } |
|
269 | - $html .= EEH_HTML::tdx(); |
|
270 | - return $html; |
|
271 | - } |
|
272 | - |
|
273 | - |
|
274 | - /** |
|
275 | - * ticketPriceTableCell |
|
276 | - * |
|
277 | - * @return string |
|
278 | - * @throws EE_Error |
|
279 | - * @throws ReflectionException |
|
280 | - */ |
|
281 | - protected function ticketPriceTableCell() |
|
282 | - { |
|
283 | - $html = ''; |
|
284 | - if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) { |
|
285 | - $html .= EEH_HTML::td( |
|
286 | - '', |
|
287 | - '', |
|
288 | - 'tckt-slctr-tbl-td-price jst-rght', |
|
289 | - '', |
|
290 | - 'headers="price-' . $this->EVT_ID . '"' |
|
291 | - ); |
|
292 | - $html .= EEH_HTML::span( |
|
293 | - EEH_Template::format_currency($this->ticket_price), |
|
294 | - '', |
|
295 | - 'tckt-price--nowrap' |
|
296 | - ); |
|
297 | - $html .= $this->ticket->taxable() |
|
298 | - ? EEH_HTML::span('*', '', 'taxable-tickets-asterisk grey-text') |
|
299 | - : ''; |
|
300 | - $html .= ' '; |
|
301 | - // phpcs:disable WordPress.WP.I18n.NoEmptyStrings |
|
302 | - $html .= EEH_HTML::span( |
|
303 | - $this->ticket_bundle |
|
304 | - ? apply_filters( |
|
305 | - 'FHEE__ticket_selector_chart_template__per_ticket_bundle_text', |
|
306 | - esc_html__(' / bundle', 'event_espresso') |
|
307 | - ) |
|
308 | - : apply_filters( |
|
309 | - 'FHEE__ticket_selector_chart_template__per_ticket_text', |
|
310 | - esc_html__('', 'event_espresso') |
|
311 | - ), |
|
312 | - '', |
|
313 | - 'smaller-text no-bold' |
|
314 | - ); |
|
315 | - $html .= ' '; |
|
316 | - $html .= EEH_HTML::tdx(); |
|
317 | - $this->cols++; |
|
318 | - } |
|
319 | - return $html; |
|
320 | - } |
|
321 | - |
|
322 | - |
|
323 | - /** |
|
324 | - * @return string |
|
325 | - * @throws EE_Error |
|
326 | - * @throws ReflectionException |
|
327 | - */ |
|
328 | - protected function onlyOneAttendeeCanRegister(): string |
|
329 | - { |
|
330 | - $TKT = $this->ticket->ID(); |
|
331 | - $label = esc_html__('Select this ticket', 'event_espresso'); |
|
332 | - $name = "tkt-slctr-qty-$this->EVT_ID"; |
|
333 | - $class = "ticket-selector-tbl-qty-slct"; |
|
334 | - $id = "$class-$this->EVT_ID-$this->row"; |
|
335 | - $checked = $this->total_tickets === 1 ? ' checked' : ''; |
|
336 | - |
|
337 | - return " |
|
22 | + /** |
|
23 | + * @var TicketDetails |
|
24 | + */ |
|
25 | + protected $ticket_details; |
|
26 | + |
|
27 | + /** |
|
28 | + * @var EE_Ticket_Selector_Config |
|
29 | + */ |
|
30 | + protected $template_settings; |
|
31 | + |
|
32 | + /** |
|
33 | + * @var EE_Tax_Config |
|
34 | + */ |
|
35 | + protected $tax_settings; |
|
36 | + |
|
37 | + /** |
|
38 | + * @var boolean |
|
39 | + */ |
|
40 | + protected $prices_displayed_including_taxes; |
|
41 | + |
|
42 | + /** |
|
43 | + * @var int |
|
44 | + */ |
|
45 | + protected $row; |
|
46 | + |
|
47 | + /** |
|
48 | + * @var int |
|
49 | + */ |
|
50 | + protected $cols; |
|
51 | + |
|
52 | + /** |
|
53 | + * @var boolean |
|
54 | + */ |
|
55 | + protected $hidden_input_qty = false; |
|
56 | + |
|
57 | + /** |
|
58 | + * @var string |
|
59 | + */ |
|
60 | + protected $ticket_datetime_classes; |
|
61 | + |
|
62 | + private bool $use_new_checkbox_selector; |
|
63 | + |
|
64 | + |
|
65 | + /** |
|
66 | + * TicketDetails constructor. |
|
67 | + * |
|
68 | + * @param TicketDetails $ticket_details |
|
69 | + * @param EE_Tax_Config $tax_settings |
|
70 | + * @param int $total_tickets |
|
71 | + * @param int $max_attendees |
|
72 | + * @param int $row |
|
73 | + * @param int $cols |
|
74 | + * @param boolean $required_ticket_sold_out |
|
75 | + * @param string $event_status |
|
76 | + * @param string $ticket_datetime_classes |
|
77 | + * @param bool $use_new_checkbox_selector |
|
78 | + * @throws EE_Error |
|
79 | + * @throws UnexpectedEntityException |
|
80 | + */ |
|
81 | + public function __construct( |
|
82 | + TicketDetails $ticket_details, |
|
83 | + EE_Tax_Config $tax_settings, |
|
84 | + $total_tickets, |
|
85 | + $max_attendees, |
|
86 | + $row, |
|
87 | + $cols, |
|
88 | + $required_ticket_sold_out, |
|
89 | + $event_status, |
|
90 | + $ticket_datetime_classes, |
|
91 | + bool $use_new_checkbox_selector = false |
|
92 | + ) { |
|
93 | + $this->ticket_details = $ticket_details; |
|
94 | + $this->template_settings = $ticket_details->getTemplateSettings(); |
|
95 | + $this->tax_settings = $tax_settings; |
|
96 | + $this->row = $row; |
|
97 | + $this->cols = $cols; |
|
98 | + $this->ticket_datetime_classes = $ticket_datetime_classes; |
|
99 | + $this->use_new_checkbox_selector = $use_new_checkbox_selector; |
|
100 | + parent::__construct( |
|
101 | + $ticket_details->getTicket(), |
|
102 | + $max_attendees, |
|
103 | + $ticket_details->getDateFormat(), |
|
104 | + $event_status, |
|
105 | + $required_ticket_sold_out, |
|
106 | + $total_tickets |
|
107 | + ); |
|
108 | + } |
|
109 | + |
|
110 | + |
|
111 | + /** |
|
112 | + * other ticket rows will need to know if a required ticket is sold out, |
|
113 | + * so that they are not offered for sale |
|
114 | + * |
|
115 | + * @return boolean |
|
116 | + */ |
|
117 | + public function getRequiredTicketSoldOut() |
|
118 | + { |
|
119 | + return $this->required_ticket_sold_out; |
|
120 | + } |
|
121 | + |
|
122 | + |
|
123 | + /** |
|
124 | + * @return int |
|
125 | + */ |
|
126 | + public function getCols() |
|
127 | + { |
|
128 | + return $this->cols; |
|
129 | + } |
|
130 | + |
|
131 | + |
|
132 | + /** |
|
133 | + * getHtml |
|
134 | + * |
|
135 | + * @return string |
|
136 | + * @throws EE_Error |
|
137 | + * @throws ReflectionException |
|
138 | + */ |
|
139 | + public function getHtml() |
|
140 | + { |
|
141 | + $this->min = 0; |
|
142 | + $this->max = $this->ticket->max(); |
|
143 | + $remaining = $this->ticket->remaining(); |
|
144 | + $this->setTicketMinAndMax($remaining); |
|
145 | + // set flag if ticket is required (flag is set to start date so that future tickets are not blocked) |
|
146 | + $this->required_ticket_sold_out = $this->ticket->required() && ! $remaining |
|
147 | + ? $this->ticket->start_date() |
|
148 | + : $this->required_ticket_sold_out; |
|
149 | + $this->setTicketPriceDetails(); |
|
150 | + $this->setTicketStatusClasses($remaining); |
|
151 | + $filtered_row_html = $this->getFilteredRowHtml(); |
|
152 | + if ($filtered_row_html !== false) { |
|
153 | + return $filtered_row_html; |
|
154 | + } |
|
155 | + $ticket_selector_row_html = EEH_HTML::tr( |
|
156 | + '', |
|
157 | + '', |
|
158 | + "tckt-slctr-tbl-tr {$this->status_class}{$this->ticket_datetime_classes} " |
|
159 | + . espresso_get_object_css_class($this->ticket) |
|
160 | + ); |
|
161 | + $filtered_row_content = $this->getFilteredRowContents(); |
|
162 | + if ($filtered_row_content !== false) { |
|
163 | + if ($this->max_attendees === 1) { |
|
164 | + return $ticket_selector_row_html |
|
165 | + . $filtered_row_content |
|
166 | + . $this->ticketQtyAndIdHiddenInputs() |
|
167 | + . EEH_HTML::trx(); |
|
168 | + } |
|
169 | + return $ticket_selector_row_html |
|
170 | + . $filtered_row_content |
|
171 | + . EEH_HTML::trx(); |
|
172 | + } |
|
173 | + $this->hidden_input_qty = $this->max_attendees > 1; |
|
174 | + |
|
175 | + $ticket_selector_row_html .= $this->ticketNameTableCell(); |
|
176 | + $ticket_selector_row_html .= $this->ticketPriceTableCell(); |
|
177 | + $ticket_selector_row_html .= EEH_HTML::td( |
|
178 | + '', |
|
179 | + '', |
|
180 | + 'tckt-slctr-tbl-td-qty cntr', |
|
181 | + '', |
|
182 | + 'headers="quantity-' . $this->EVT_ID . '"' |
|
183 | + ); |
|
184 | + $this->setTicketStatusDisplay($remaining); |
|
185 | + if (empty($this->ticket_status_display)) { |
|
186 | + $this->hidden_input_qty = false; |
|
187 | + // display submit button since we have tickets available |
|
188 | + add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true'); |
|
189 | + if ($this->max_attendees === 1) { |
|
190 | + // only ONE attendee is allowed to register at a time |
|
191 | + $ticket_selector_row_html .= $this->onlyOneAttendeeCanRegister(); |
|
192 | + } else { |
|
193 | + $ticket_selector_row_html .= $this->max === 1 && $this->use_new_checkbox_selector |
|
194 | + ? $this->ticketCheckboxSelector() |
|
195 | + : $this->ticketQuantitySelector(); |
|
196 | + } |
|
197 | + } |
|
198 | + $ticket_selector_row_html .= $this->ticket_status_display; |
|
199 | + $ticket_selector_row_html .= $this->ticketQtyAndIdHiddenInputs(); |
|
200 | + $ticket_selector_row_html .= $this->ticket_details->display( |
|
201 | + $this->ticket_price, |
|
202 | + $remaining, |
|
203 | + $this->cols |
|
204 | + ); |
|
205 | + $ticket_selector_row_html .= EEH_HTML::tdx(); |
|
206 | + $ticket_selector_row_html .= EEH_HTML::trx(); |
|
207 | + |
|
208 | + |
|
209 | + $this->row++; |
|
210 | + return $ticket_selector_row_html; |
|
211 | + } |
|
212 | + |
|
213 | + |
|
214 | + /** |
|
215 | + * getTicketPriceDetails |
|
216 | + * |
|
217 | + * @return void |
|
218 | + * @throws EE_Error |
|
219 | + * @throws ReflectionException |
|
220 | + */ |
|
221 | + protected function setTicketPriceDetails() |
|
222 | + { |
|
223 | + $this->ticket_price = $this->tax_settings->prices_displayed_including_taxes |
|
224 | + ? $this->ticket->get_ticket_total_with_taxes() |
|
225 | + : $this->ticket->get_ticket_subtotal(); |
|
226 | + $this->ticket_bundle = false; |
|
227 | + $ticket_min = $this->ticket->min(); |
|
228 | + // for ticket bundles, set min and max qty the same |
|
229 | + if ($ticket_min !== 0 && $ticket_min === $this->ticket->max()) { |
|
230 | + $this->ticket_price *= $ticket_min; |
|
231 | + $this->ticket_bundle = true; |
|
232 | + } |
|
233 | + $this->ticket_price = apply_filters( |
|
234 | + 'FHEE__ticket_selector_chart_template__ticket_price', |
|
235 | + $this->ticket_price, |
|
236 | + $this->ticket |
|
237 | + ); |
|
238 | + } |
|
239 | + |
|
240 | + |
|
241 | + /** |
|
242 | + * ticketNameTableCell |
|
243 | + * |
|
244 | + * @return string |
|
245 | + * @throws EE_Error |
|
246 | + * @throws ReflectionException |
|
247 | + */ |
|
248 | + protected function ticketNameTableCell() |
|
249 | + { |
|
250 | + $html = EEH_HTML::td( |
|
251 | + '', |
|
252 | + '', |
|
253 | + 'tckt-slctr-tbl-td-name', |
|
254 | + '', |
|
255 | + 'headers="details-' . $this->EVT_ID . '"' |
|
256 | + ); |
|
257 | + $html .= EEH_HTML::strong($this->ticket->get_pretty('TKT_name')); |
|
258 | + $html .= $this->ticket_details->getShowHideLinks(); |
|
259 | + if ($this->ticket->required()) { |
|
260 | + $html .= EEH_HTML::p( |
|
261 | + apply_filters( |
|
262 | + 'FHEE__ticket_selector_chart_template__ticket_required_message', |
|
263 | + esc_html__('This ticket is required and must be purchased.', 'event_espresso') |
|
264 | + ), |
|
265 | + '', |
|
266 | + 'ticket-required-pg' |
|
267 | + ); |
|
268 | + } |
|
269 | + $html .= EEH_HTML::tdx(); |
|
270 | + return $html; |
|
271 | + } |
|
272 | + |
|
273 | + |
|
274 | + /** |
|
275 | + * ticketPriceTableCell |
|
276 | + * |
|
277 | + * @return string |
|
278 | + * @throws EE_Error |
|
279 | + * @throws ReflectionException |
|
280 | + */ |
|
281 | + protected function ticketPriceTableCell() |
|
282 | + { |
|
283 | + $html = ''; |
|
284 | + if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) { |
|
285 | + $html .= EEH_HTML::td( |
|
286 | + '', |
|
287 | + '', |
|
288 | + 'tckt-slctr-tbl-td-price jst-rght', |
|
289 | + '', |
|
290 | + 'headers="price-' . $this->EVT_ID . '"' |
|
291 | + ); |
|
292 | + $html .= EEH_HTML::span( |
|
293 | + EEH_Template::format_currency($this->ticket_price), |
|
294 | + '', |
|
295 | + 'tckt-price--nowrap' |
|
296 | + ); |
|
297 | + $html .= $this->ticket->taxable() |
|
298 | + ? EEH_HTML::span('*', '', 'taxable-tickets-asterisk grey-text') |
|
299 | + : ''; |
|
300 | + $html .= ' '; |
|
301 | + // phpcs:disable WordPress.WP.I18n.NoEmptyStrings |
|
302 | + $html .= EEH_HTML::span( |
|
303 | + $this->ticket_bundle |
|
304 | + ? apply_filters( |
|
305 | + 'FHEE__ticket_selector_chart_template__per_ticket_bundle_text', |
|
306 | + esc_html__(' / bundle', 'event_espresso') |
|
307 | + ) |
|
308 | + : apply_filters( |
|
309 | + 'FHEE__ticket_selector_chart_template__per_ticket_text', |
|
310 | + esc_html__('', 'event_espresso') |
|
311 | + ), |
|
312 | + '', |
|
313 | + 'smaller-text no-bold' |
|
314 | + ); |
|
315 | + $html .= ' '; |
|
316 | + $html .= EEH_HTML::tdx(); |
|
317 | + $this->cols++; |
|
318 | + } |
|
319 | + return $html; |
|
320 | + } |
|
321 | + |
|
322 | + |
|
323 | + /** |
|
324 | + * @return string |
|
325 | + * @throws EE_Error |
|
326 | + * @throws ReflectionException |
|
327 | + */ |
|
328 | + protected function onlyOneAttendeeCanRegister(): string |
|
329 | + { |
|
330 | + $TKT = $this->ticket->ID(); |
|
331 | + $label = esc_html__('Select this ticket', 'event_espresso'); |
|
332 | + $name = "tkt-slctr-qty-$this->EVT_ID"; |
|
333 | + $class = "ticket-selector-tbl-qty-slct"; |
|
334 | + $id = "$class-$this->EVT_ID-$this->row"; |
|
335 | + $checked = $this->total_tickets === 1 ? ' checked' : ''; |
|
336 | + |
|
337 | + return " |
|
338 | 338 | <label class='ee-a11y-screen-reader-text' for='$id' >$label</label> |
339 | 339 | <input type='radio'$checked name='$name' id='$id' class='$class' value='$TKT-1' />"; |
340 | - } |
|
341 | - |
|
342 | - |
|
343 | - /** |
|
344 | - * @return string |
|
345 | - * @throws EE_Error |
|
346 | - * @throws ReflectionException |
|
347 | - */ |
|
348 | - protected function ticketCheckboxSelector(): string |
|
349 | - { |
|
350 | - $TKT = $this->ticket->ID(); |
|
351 | - $label = esc_html__('Select this ticket', 'event_espresso'); |
|
352 | - $name = "tkt-slctr-qty-$this->EVT_ID[$TKT]"; |
|
353 | - $class = 'ticket-selector-tbl-qty-slct'; |
|
354 | - $id = "$class-$this->EVT_ID-$this->row"; |
|
355 | - $title = esc_html__('only one of this ticket can be purchased at a time', 'event_espresso'); |
|
356 | - |
|
357 | - return " |
|
340 | + } |
|
341 | + |
|
342 | + |
|
343 | + /** |
|
344 | + * @return string |
|
345 | + * @throws EE_Error |
|
346 | + * @throws ReflectionException |
|
347 | + */ |
|
348 | + protected function ticketCheckboxSelector(): string |
|
349 | + { |
|
350 | + $TKT = $this->ticket->ID(); |
|
351 | + $label = esc_html__('Select this ticket', 'event_espresso'); |
|
352 | + $name = "tkt-slctr-qty-$this->EVT_ID[$TKT]"; |
|
353 | + $class = 'ticket-selector-tbl-qty-slct'; |
|
354 | + $id = "$class-$this->EVT_ID-$this->row"; |
|
355 | + $title = esc_html__('only one of this ticket can be purchased at a time', 'event_espresso'); |
|
356 | + |
|
357 | + return " |
|
358 | 358 | <label class='ee-a11y-screen-reader-text' for='$id' >$label</label> |
359 | 359 | <input type='checkbox' name='$name' id='$id' class='$class' value='1' title='$title'/>"; |
360 | - } |
|
361 | - |
|
362 | - |
|
363 | - /** |
|
364 | - * @return string |
|
365 | - * @throws EE_Error |
|
366 | - * @throws ReflectionException |
|
367 | - */ |
|
368 | - protected function ticketQuantitySelector(): string |
|
369 | - { |
|
370 | - $TKT = $this->ticket->ID(); |
|
371 | - $label = esc_html__('Quantity', 'event_espresso'); |
|
372 | - $name = "tkt-slctr-qty-$this->EVT_ID[$TKT]"; |
|
373 | - $class = 'ticket-selector-tbl-qty-slct'; |
|
374 | - $id = "$class-{$this->EVT_ID}-{$this->row}"; |
|
375 | - |
|
376 | - $html = "<label class='ee-a11y-screen-reader-text' for='$id' >$label</label>"; |
|
377 | - $html .= "<select name='$name' id='$id' class='$class'>"; |
|
378 | - // this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased |
|
379 | - if ($this->min !== 0 && ! $this->ticket->required()) { |
|
380 | - $html .= "<option value='0'> 0 </option>"; |
|
381 | - } |
|
382 | - // offer ticket quantities from the min to the max |
|
383 | - for ($i = $this->min; $i <= $this->max; $i++) { |
|
384 | - $html .= "<option value='$i'> $i </option>"; |
|
385 | - } |
|
386 | - $html .= "</select>"; |
|
387 | - return $html; |
|
388 | - } |
|
389 | - |
|
390 | - |
|
391 | - /** |
|
392 | - * @return string |
|
393 | - * @throws EE_Error |
|
394 | - * @throws ReflectionException |
|
395 | - */ |
|
396 | - protected function ticketQtyAndIdHiddenInputs(): string |
|
397 | - { |
|
398 | - $html = ''; |
|
399 | - $EVT = $this->EVT_ID; |
|
400 | - $TKT = $this->ticket->ID(); |
|
401 | - // depending on group reg we need to change the format for qty |
|
402 | - if ($this->hidden_input_qty) { |
|
403 | - $html .= "<input type='hidden' name='tkt-slctr-qty-{$EVT}[]' value='0' />"; |
|
404 | - } |
|
405 | - $html .= "<input type='hidden' name='tkt-slctr-ticket-id-{$EVT}[]' value='{$TKT}' />"; |
|
406 | - return $html; |
|
407 | - } |
|
360 | + } |
|
361 | + |
|
362 | + |
|
363 | + /** |
|
364 | + * @return string |
|
365 | + * @throws EE_Error |
|
366 | + * @throws ReflectionException |
|
367 | + */ |
|
368 | + protected function ticketQuantitySelector(): string |
|
369 | + { |
|
370 | + $TKT = $this->ticket->ID(); |
|
371 | + $label = esc_html__('Quantity', 'event_espresso'); |
|
372 | + $name = "tkt-slctr-qty-$this->EVT_ID[$TKT]"; |
|
373 | + $class = 'ticket-selector-tbl-qty-slct'; |
|
374 | + $id = "$class-{$this->EVT_ID}-{$this->row}"; |
|
375 | + |
|
376 | + $html = "<label class='ee-a11y-screen-reader-text' for='$id' >$label</label>"; |
|
377 | + $html .= "<select name='$name' id='$id' class='$class'>"; |
|
378 | + // this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased |
|
379 | + if ($this->min !== 0 && ! $this->ticket->required()) { |
|
380 | + $html .= "<option value='0'> 0 </option>"; |
|
381 | + } |
|
382 | + // offer ticket quantities from the min to the max |
|
383 | + for ($i = $this->min; $i <= $this->max; $i++) { |
|
384 | + $html .= "<option value='$i'> $i </option>"; |
|
385 | + } |
|
386 | + $html .= "</select>"; |
|
387 | + return $html; |
|
388 | + } |
|
389 | + |
|
390 | + |
|
391 | + /** |
|
392 | + * @return string |
|
393 | + * @throws EE_Error |
|
394 | + * @throws ReflectionException |
|
395 | + */ |
|
396 | + protected function ticketQtyAndIdHiddenInputs(): string |
|
397 | + { |
|
398 | + $html = ''; |
|
399 | + $EVT = $this->EVT_ID; |
|
400 | + $TKT = $this->ticket->ID(); |
|
401 | + // depending on group reg we need to change the format for qty |
|
402 | + if ($this->hidden_input_qty) { |
|
403 | + $html .= "<input type='hidden' name='tkt-slctr-qty-{$EVT}[]' value='0' />"; |
|
404 | + } |
|
405 | + $html .= "<input type='hidden' name='tkt-slctr-ticket-id-{$EVT}[]' value='{$TKT}' />"; |
|
406 | + return $html; |
|
407 | + } |
|
408 | 408 | } |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | |
452 | 452 | function espressoUpgradeNow() |
453 | 453 | { |
454 | - if (! defined('EE_CAF_URL')) { |
|
454 | + if ( ! defined('EE_CAF_URL')) { |
|
455 | 455 | return ' |
456 | 456 | <div class="ee-card ee-card__buy-now ee-grid-col-span-3 ee-card--blank"> |
457 | 457 | <a href="https://eventespresso.com/pricing/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=reviews+tab" |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | class="button button--primary button-hero" |
460 | 460 | > |
461 | 461 | <span class="dashicons dashicons-cart"></span> |
462 | - ' . esc_html__('Upgrade Now!', 'event_espresso') . ' |
|
462 | + ' . esc_html__('Upgrade Now!', 'event_espresso').' |
|
463 | 463 | </a> |
464 | 464 | </div>'; |
465 | 465 | } |
@@ -1,19 +1,19 @@ discard block |
||
1 | 1 | <h2 style="text-align: left;"><?php esc_html_e('Who uses Event Espresso?', 'event_espresso'); ?></h2> |
2 | 2 | <p> |
3 | 3 | <?php printf( |
4 | - esc_html__( |
|
5 | - 'Event Espresso is used by over 40,000 event organizers across the world. They host %sconferences%s, %sart classes%s, training courses, concerts, fundraisers, workshops, %sfilm festivals%s, %spaint and wine%s, and more.', |
|
6 | - 'event_espresso' |
|
7 | - ), |
|
8 | - '<a href="https://eventespresso.com/use-cases/conferences/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">', |
|
9 | - '</a>', |
|
10 | - '<a href="https://eventespresso.com/use-cases/art-classes/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">', |
|
11 | - '</a>', |
|
12 | - '<a href="https://eventespresso.com/use-cases/film-festival-ticketing-software/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">', |
|
13 | - '</a>', |
|
14 | - '<a href="https://eventespresso.com/use-cases/paint-wine-party-ticketing-software/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">', |
|
15 | - '</a>' |
|
16 | - ); ?> |
|
4 | + esc_html__( |
|
5 | + 'Event Espresso is used by over 40,000 event organizers across the world. They host %sconferences%s, %sart classes%s, training courses, concerts, fundraisers, workshops, %sfilm festivals%s, %spaint and wine%s, and more.', |
|
6 | + 'event_espresso' |
|
7 | + ), |
|
8 | + '<a href="https://eventespresso.com/use-cases/conferences/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">', |
|
9 | + '</a>', |
|
10 | + '<a href="https://eventespresso.com/use-cases/art-classes/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">', |
|
11 | + '</a>', |
|
12 | + '<a href="https://eventespresso.com/use-cases/film-festival-ticketing-software/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">', |
|
13 | + '</a>', |
|
14 | + '<a href="https://eventespresso.com/use-cases/paint-wine-party-ticketing-software/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">', |
|
15 | + '</a>' |
|
16 | + ); ?> |
|
17 | 17 | </p> |
18 | 18 | |
19 | 19 | <h2 class="about-headline-callout"> |
@@ -451,8 +451,8 @@ discard block |
||
451 | 451 | |
452 | 452 | function espressoUpgradeNow() |
453 | 453 | { |
454 | - if (! defined('EE_CAF_URL')) { |
|
455 | - return ' |
|
454 | + if (! defined('EE_CAF_URL')) { |
|
455 | + return ' |
|
456 | 456 | <div class="ee-card ee-card__buy-now ee-grid-col-span-3 ee-card--blank"> |
457 | 457 | <a href="https://eventespresso.com/pricing/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=reviews+tab" |
458 | 458 | target="_blank" |
@@ -462,13 +462,13 @@ discard block |
||
462 | 462 | ' . esc_html__('Upgrade Now!', 'event_espresso') . ' |
463 | 463 | </a> |
464 | 464 | </div>'; |
465 | - } |
|
465 | + } |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | |
469 | 469 | function espressoFiveStars() |
470 | 470 | { |
471 | - return ' |
|
471 | + return ' |
|
472 | 472 | <div class="wporg-ratings" aria-label="5 out of 5 stars"> |
473 | 473 | <span class="dashicons dashicons-star-filled"></span> |
474 | 474 | <span class="dashicons dashicons-star-filled"></span> |
@@ -3,100 +3,100 @@ |
||
3 | 3 | |
4 | 4 | <h4> |
5 | 5 | <?php |
6 | - esc_html_e( |
|
7 | - 'You may be able to find an answer for your question or concern here:', |
|
8 | - 'event_espresso' |
|
9 | - ); |
|
10 | - ?> |
|
6 | + esc_html_e( |
|
7 | + 'You may be able to find an answer for your question or concern here:', |
|
8 | + 'event_espresso' |
|
9 | + ); |
|
10 | + ?> |
|
11 | 11 | </h4> |
12 | 12 | <ol> |
13 | 13 | <li> |
14 | 14 | <strong><em><?php esc_html_e('A known issue.', 'event_espresso'); ?></em></strong> |
15 | 15 | <?php |
16 | - printf( |
|
17 | - esc_html__( |
|
18 | - 'Some themes and plugins have %1$sknown conflicts%2$s with Event Espresso. (You can also browse the %3$sEvent Espresso support pages%2$s or %4$sEvent Espresso support forums%2$s to see if other members have experienced and solved the problem.)', |
|
19 | - 'event_espresso' |
|
20 | - ), |
|
21 | - '<a href="https://eventespresso.com/wiki/known-third-party-plugin-theme-conflicts/" target="_blank">', |
|
22 | - '</a>', |
|
23 | - '<a href="https://eventespresso.com/support/documentation/versioned-docs/?doc_ver=ee4" target="_blank">', |
|
24 | - '<a href="https://eventespresso.com/support/forums/" target="_blank">' |
|
25 | - ); |
|
26 | - ?> |
|
16 | + printf( |
|
17 | + esc_html__( |
|
18 | + 'Some themes and plugins have %1$sknown conflicts%2$s with Event Espresso. (You can also browse the %3$sEvent Espresso support pages%2$s or %4$sEvent Espresso support forums%2$s to see if other members have experienced and solved the problem.)', |
|
19 | + 'event_espresso' |
|
20 | + ), |
|
21 | + '<a href="https://eventespresso.com/wiki/known-third-party-plugin-theme-conflicts/" target="_blank">', |
|
22 | + '</a>', |
|
23 | + '<a href="https://eventespresso.com/support/documentation/versioned-docs/?doc_ver=ee4" target="_blank">', |
|
24 | + '<a href="https://eventespresso.com/support/forums/" target="_blank">' |
|
25 | + ); |
|
26 | + ?> |
|
27 | 27 | </li> |
28 | 28 | <li> |
29 | 29 | <strong><em><?php esc_html_e('A plugin conflict.', 'event_espresso'); ?></em></strong> |
30 | 30 | <?php esc_html_e( |
31 | - 'You can check to see if there is a plugin conflict by temporarily deactivating all plugins except for Event Espresso. If the problem goes away, then reactivate your plugins one by one until the issue returns. This will help you pinpoint the source of the conflict.', |
|
32 | - 'event_espresso' |
|
33 | - ); ?> |
|
31 | + 'You can check to see if there is a plugin conflict by temporarily deactivating all plugins except for Event Espresso. If the problem goes away, then reactivate your plugins one by one until the issue returns. This will help you pinpoint the source of the conflict.', |
|
32 | + 'event_espresso' |
|
33 | + ); ?> |
|
34 | 34 | </li> |
35 | 35 | <li> |
36 | 36 | <strong><em><?php esc_html_e('A theme conflict.', 'event_espresso'); ?></em></strong> |
37 | 37 | <?php |
38 | - $default_theme = wp_get_theme(WP_DEFAULT_THEME); |
|
38 | + $default_theme = wp_get_theme(WP_DEFAULT_THEME); |
|
39 | 39 | |
40 | - if ($default_theme->exists()) { |
|
41 | - printf( |
|
42 | - esc_html__( |
|
43 | - 'If your problem is not a known issue or caused by a plugin, then try activating %s (the default WordPress theme).', |
|
44 | - 'event_espresso' |
|
45 | - ), |
|
46 | - $default_theme->get('Name') |
|
47 | - ); |
|
48 | - } else { |
|
49 | - esc_html_e( |
|
50 | - 'If your problem is not a known issue or caused by a plugin, then try activating the default WordPress theme.', |
|
51 | - 'event_espresso' |
|
52 | - ); |
|
53 | - } |
|
54 | - ?> |
|
40 | + if ($default_theme->exists()) { |
|
41 | + printf( |
|
42 | + esc_html__( |
|
43 | + 'If your problem is not a known issue or caused by a plugin, then try activating %s (the default WordPress theme).', |
|
44 | + 'event_espresso' |
|
45 | + ), |
|
46 | + $default_theme->get('Name') |
|
47 | + ); |
|
48 | + } else { |
|
49 | + esc_html_e( |
|
50 | + 'If your problem is not a known issue or caused by a plugin, then try activating the default WordPress theme.', |
|
51 | + 'event_espresso' |
|
52 | + ); |
|
53 | + } |
|
54 | + ?> |
|
55 | 55 | <?php |
56 | - esc_html_e( |
|
57 | - 'If this solves the problem for you, then something in your theme is causing this issue. Check to see if an update is available for your WordPress theme or reach out to the theme author.', |
|
58 | - 'event_espresso' |
|
59 | - ); |
|
60 | - ?> |
|
56 | + esc_html_e( |
|
57 | + 'If this solves the problem for you, then something in your theme is causing this issue. Check to see if an update is available for your WordPress theme or reach out to the theme author.', |
|
58 | + 'event_espresso' |
|
59 | + ); |
|
60 | + ?> |
|
61 | 61 | </li> |
62 | 62 | </ol> |
63 | 63 | |
64 | 64 | <p> |
65 | 65 | <?php |
66 | - esc_html_e( |
|
67 | - 'If none of the suggestions above help you find a solution, then feel free to reach out to the support team at Event Espresso.', |
|
68 | - 'event_espresso' |
|
69 | - ); |
|
70 | - ?> |
|
66 | + esc_html_e( |
|
67 | + 'If none of the suggestions above help you find a solution, then feel free to reach out to the support team at Event Espresso.', |
|
68 | + 'event_espresso' |
|
69 | + ); |
|
70 | + ?> |
|
71 | 71 | </p> |
72 | 72 | <p> |
73 | 73 | <?php |
74 | - printf( |
|
75 | - esc_html__( |
|
76 | - 'Login to your account on EventEspresso.com and %1$screate a support post in our member support forums%2$s. Use a %3$sclear and descriptive title%4$s in your support post, %3$sdescribe the issue to the best of your knowledge%4$s, and %3$snever post any sensitive information such as login details%4$s. Be sure to also include %5$simportant information in the section below%2$s about your WordPress site.', |
|
77 | - 'event_espresso' |
|
78 | - ), |
|
79 | - '<a href="https://eventespresso.com/support/forums/" target="_blank">', |
|
80 | - '</a>', |
|
81 | - '<strong>', |
|
82 | - '</strong>', |
|
83 | - '<a href="#espresso_important_information_settings">' |
|
84 | - ); |
|
85 | - ?> |
|
74 | + printf( |
|
75 | + esc_html__( |
|
76 | + 'Login to your account on EventEspresso.com and %1$screate a support post in our member support forums%2$s. Use a %3$sclear and descriptive title%4$s in your support post, %3$sdescribe the issue to the best of your knowledge%4$s, and %3$snever post any sensitive information such as login details%4$s. Be sure to also include %5$simportant information in the section below%2$s about your WordPress site.', |
|
77 | + 'event_espresso' |
|
78 | + ), |
|
79 | + '<a href="https://eventespresso.com/support/forums/" target="_blank">', |
|
80 | + '</a>', |
|
81 | + '<strong>', |
|
82 | + '</strong>', |
|
83 | + '<a href="#espresso_important_information_settings">' |
|
84 | + ); |
|
85 | + ?> |
|
86 | 86 | </p> |
87 | 87 | |
88 | 88 | <h4><?php esc_html_e('Have an emergency?', 'event_espresso'); ?></h4> |
89 | 89 | |
90 | 90 | <p> |
91 | 91 | <?php |
92 | - printf( |
|
93 | - esc_html__( |
|
94 | - 'We offer support tokens to members that need help with a time-sensitive issue. A support token will provide you with up to 30 minutes of one-on-one time with a team member at Event Espresso. If you have an emergency and need help quickly, then please %1$spurchase a support token%2$s.', |
|
95 | - 'event_espresso' |
|
96 | - ), |
|
97 | - '<a href="https://eventespresso.com/product/premium-support-token/?utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=help_support_tab&utm_content=support_token" target="_blank">', |
|
98 | - '</a>' |
|
99 | - ); |
|
100 | - ?> |
|
92 | + printf( |
|
93 | + esc_html__( |
|
94 | + 'We offer support tokens to members that need help with a time-sensitive issue. A support token will provide you with up to 30 minutes of one-on-one time with a team member at Event Espresso. If you have an emergency and need help quickly, then please %1$spurchase a support token%2$s.', |
|
95 | + 'event_espresso' |
|
96 | + ), |
|
97 | + '<a href="https://eventespresso.com/product/premium-support-token/?utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=help_support_tab&utm_content=support_token" target="_blank">', |
|
98 | + '</a>' |
|
99 | + ); |
|
100 | + ?> |
|
101 | 101 | </p> |
102 | 102 | </div> |
@@ -1,19 +1,19 @@ discard block |
||
1 | 1 | <div class="padding"> |
2 | 2 | <p> |
3 | 3 | <?php |
4 | - esc_html_e( |
|
5 | - 'Displays a list of events based on a set of criteria on a WordPress page or post. Unless otherwise specified, events are sorted by start date.', |
|
6 | - 'event_espresso' |
|
7 | - ); |
|
8 | - printf( |
|
9 | - esc_html__( |
|
10 | - 'For a full list of available shortcodes, please view the %sshortcode documentation%s on our website.', |
|
11 | - 'event_espresso' |
|
12 | - ), |
|
13 | - '<a href="https://eventespresso.com/wiki/ee4-shortcodes-template-variables/">', |
|
14 | - '</a>' |
|
15 | - ); |
|
16 | - ?> |
|
4 | + esc_html_e( |
|
5 | + 'Displays a list of events based on a set of criteria on a WordPress page or post. Unless otherwise specified, events are sorted by start date.', |
|
6 | + 'event_espresso' |
|
7 | + ); |
|
8 | + printf( |
|
9 | + esc_html__( |
|
10 | + 'For a full list of available shortcodes, please view the %sshortcode documentation%s on our website.', |
|
11 | + 'event_espresso' |
|
12 | + ), |
|
13 | + '<a href="https://eventespresso.com/wiki/ee4-shortcodes-template-variables/">', |
|
14 | + '</a>' |
|
15 | + ); |
|
16 | + ?> |
|
17 | 17 | </p> |
18 | 18 | <ul> |
19 | 19 | <li> |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | <li> |
37 | 37 | <strong> |
38 | 38 | <?php esc_html_e( |
39 | - 'Limit (paginate) the number of events that are shown in the event list on a page or post', |
|
40 | - 'event_espresso' |
|
41 | - ); ?> |
|
39 | + 'Limit (paginate) the number of events that are shown in the event list on a page or post', |
|
40 | + 'event_espresso' |
|
41 | + ); ?> |
|
42 | 42 | </strong> |
43 | 43 | <br /> |
44 | 44 | [ESPRESSO_EVENTS limit=5] |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | <li> |
82 | 82 | <strong> |
83 | 83 | <?php esc_html_e( |
84 | - 'Order the event list by a specific set of parameters (refer to available options below)', |
|
85 | - 'event_espresso' |
|
86 | - ); ?> |
|
84 | + 'Order the event list by a specific set of parameters (refer to available options below)', |
|
85 | + 'event_espresso' |
|
86 | + ); ?> |
|
87 | 87 | </strong> |
88 | 88 | <br /> |
89 | 89 | [ESPRESSO_EVENTS order_by=start_date,id] |
@@ -91,14 +91,14 @@ discard block |
||
91 | 91 | </ul> |
92 | 92 | <p> |
93 | 93 | <?php |
94 | - printf( |
|
95 | - esc_html__( |
|
96 | - 'These parameters (options) are available for the %s shortcode parameter above. Multiple parameters should be separated by a comma.', |
|
97 | - 'event_espresso' |
|
98 | - ), |
|
99 | - 'order_by' |
|
100 | - ); |
|
101 | - ?> |
|
94 | + printf( |
|
95 | + esc_html__( |
|
96 | + 'These parameters (options) are available for the %s shortcode parameter above. Multiple parameters should be separated by a comma.', |
|
97 | + 'event_espresso' |
|
98 | + ), |
|
99 | + 'order_by' |
|
100 | + ); |
|
101 | + ?> |
|
102 | 102 | </p> |
103 | 103 | <p> |
104 | 104 | id<br /> |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | protected function _installation() |
119 | 119 | { |
120 | - $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_installation.template.php'; |
|
120 | + $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'support_admin_details_installation.template.php'; |
|
121 | 121 | $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
122 | 122 | $template_path, |
123 | 123 | '', |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $this->addMetaBox( |
139 | 139 | "espresso_{$box}_settings", |
140 | 140 | $label, |
141 | - function ($post, $metabox) { |
|
141 | + function($post, $metabox) { |
|
142 | 142 | EEH_Template::display_template( |
143 | 143 | $metabox['args']['template_path'], |
144 | 144 | $metabox['args']['template_args'] |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $box, |
174 | 174 | $label, |
175 | 175 | array( |
176 | - 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
176 | + 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH."support_admin_details_{$box}.template.php", |
|
177 | 177 | 'template_args' => $this->_template_args, |
178 | 178 | ) |
179 | 179 | ); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $box, |
206 | 206 | $label, |
207 | 207 | array( |
208 | - 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
208 | + 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH."support_admin_details_{$box}.template.php", |
|
209 | 209 | 'template_args' => $this->_template_args, |
210 | 210 | ) |
211 | 211 | ); |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | $box, |
234 | 234 | $label, |
235 | 235 | array( |
236 | - 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
236 | + 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH."support_admin_details_{$box}.template.php", |
|
237 | 237 | 'template_args' => $this->_template_args, |
238 | 238 | ) |
239 | 239 | ); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | protected function _developers() |
245 | 245 | { |
246 | 246 | $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
247 | - EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'developers_admin_details.template.php', |
|
247 | + EE_SUPPORT_ADMIN_TEMPLATE_PATH.'developers_admin_details.template.php', |
|
248 | 248 | array(), |
249 | 249 | true |
250 | 250 | ); |
@@ -11,244 +11,244 @@ |
||
11 | 11 | */ |
12 | 12 | class Support_Admin_Page extends EE_Admin_Page |
13 | 13 | { |
14 | - protected function _init_page_props() |
|
15 | - { |
|
16 | - $this->page_slug = EE_SUPPORT_PG_SLUG; |
|
17 | - $this->page_label = esc_html__('Help & Support', 'event_espresso'); |
|
18 | - $this->_admin_base_url = EE_SUPPORT_ADMIN_URL; |
|
19 | - $this->_admin_base_path = EE_SUPPORT_ADMIN; |
|
20 | - } |
|
21 | - |
|
22 | - |
|
23 | - protected function _ajax_hooks() |
|
24 | - { |
|
25 | - } |
|
26 | - |
|
27 | - |
|
28 | - protected function _define_page_props() |
|
29 | - { |
|
30 | - $this->_labels = array(); |
|
31 | - $this->_admin_page_title = $this->page_label; |
|
32 | - } |
|
33 | - |
|
34 | - |
|
35 | - protected function _set_page_routes() |
|
36 | - { |
|
37 | - $this->_page_routes = array( |
|
38 | - 'default' => array( |
|
39 | - 'func' => [$this, '_contact_support'], |
|
40 | - 'capability' => 'ee_read_ee', |
|
41 | - ), |
|
42 | - 'developers' => array( |
|
43 | - 'func' => [$this, '_developers'], |
|
44 | - 'capability' => 'ee_read_ee', |
|
45 | - ), |
|
46 | - 'shortcodes' => array( |
|
47 | - 'func' => [$this, '_shortcodes'], |
|
48 | - 'capability' => 'ee_read_ee', |
|
49 | - ), |
|
50 | - ); |
|
51 | - } |
|
52 | - |
|
53 | - |
|
54 | - protected function _set_page_config() |
|
55 | - { |
|
56 | - $this->_page_config = array( |
|
57 | - 'default' => array( |
|
58 | - 'nav' => array( |
|
59 | - 'label' => esc_html__('Support', 'event_espresso'), |
|
60 | - 'icon' => 'dashicons-sos', |
|
61 | - 'order' => 30, |
|
62 | - ), |
|
63 | - 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_support_boxes')), |
|
64 | - 'require_nonce' => false, |
|
65 | - ), |
|
66 | - 'developers' => array( |
|
67 | - 'nav' => array( |
|
68 | - 'label' => esc_html__('Developers', 'event_espresso'), |
|
69 | - 'icon' => 'dashicons-coffee', |
|
70 | - 'order' => 50, |
|
71 | - ), |
|
72 | - 'metaboxes' => $this->_default_espresso_metaboxes, |
|
73 | - 'require_nonce' => false, |
|
74 | - ), |
|
75 | - 'shortcodes' => array( |
|
76 | - 'nav' => array( |
|
77 | - 'label' => esc_html__('Shortcodes', 'event_espresso'), |
|
78 | - 'icon' => 'dashicons-shortcode', |
|
79 | - 'order' => 60, |
|
80 | - ), |
|
81 | - 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_shortcodes_boxes')), |
|
82 | - 'require_nonce' => false, |
|
83 | - ), |
|
84 | - ); |
|
85 | - } |
|
86 | - |
|
87 | - |
|
88 | - // none of the below group are currently used for Support pages |
|
89 | - protected function _add_screen_options() |
|
90 | - { |
|
91 | - } |
|
92 | - |
|
93 | - |
|
94 | - protected function _add_feature_pointers() |
|
95 | - { |
|
96 | - } |
|
97 | - |
|
98 | - |
|
99 | - public function admin_init() |
|
100 | - { |
|
101 | - } |
|
102 | - |
|
103 | - |
|
104 | - public function admin_notices() |
|
105 | - { |
|
106 | - } |
|
107 | - |
|
108 | - |
|
109 | - public function admin_footer_scripts() |
|
110 | - { |
|
111 | - } |
|
112 | - |
|
113 | - |
|
114 | - public function load_scripts_styles() |
|
115 | - { |
|
116 | - } |
|
117 | - |
|
118 | - |
|
119 | - protected function _installation() |
|
120 | - { |
|
121 | - $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_installation.template.php'; |
|
122 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
|
123 | - $template_path, |
|
124 | - '', |
|
125 | - true |
|
126 | - ); |
|
127 | - $this->display_admin_page_with_sidebar(); |
|
128 | - } |
|
129 | - |
|
130 | - |
|
131 | - protected function _resources() |
|
132 | - { |
|
133 | - $this->display_admin_page_with_sidebar(); |
|
134 | - } |
|
135 | - |
|
136 | - |
|
137 | - protected function _add_settings_metabox($box, $label, array $args) |
|
138 | - { |
|
139 | - $this->addMetaBox( |
|
140 | - "espresso_{$box}_settings", |
|
141 | - $label, |
|
142 | - function ($post, $metabox) { |
|
143 | - EEH_Template::display_template( |
|
144 | - $metabox['args']['template_path'], |
|
145 | - $metabox['args']['template_args'] |
|
146 | - ); |
|
147 | - }, |
|
148 | - $this->_current_screen->id, |
|
149 | - 'normal', |
|
150 | - 'high', |
|
151 | - apply_filters( |
|
152 | - "FHEE__Support_Admin_Page___add_settings_metabox__{$box}_args_array", |
|
153 | - $args |
|
154 | - ) |
|
155 | - ); |
|
156 | - } |
|
157 | - |
|
158 | - |
|
159 | - protected function _resources_boxes() |
|
160 | - { |
|
161 | - $boxes = apply_filters( |
|
162 | - 'FHEE__Support_Admin_Page___resources_boxes__boxes_array', |
|
163 | - array( |
|
164 | - 'favorite_theme_developers' => esc_html__('Favorite Theme Developers', 'event_espresso'), |
|
165 | - 'highly_recommended_themes' => esc_html__('Highly Recommended Themes', 'event_espresso'), |
|
166 | - 'hire_developer' => esc_html__('Hire a Developer', 'event_espresso'), |
|
167 | - 'partners' => esc_html__('Partners', 'event_espresso'), |
|
168 | - 'recommended_plugins' => esc_html__('Recommended Plugins', 'event_espresso'), |
|
169 | - 'other_resources' => esc_html__('Other Resources', 'event_espresso'), |
|
170 | - ) |
|
171 | - ); |
|
172 | - foreach ($boxes as $box => $label) { |
|
173 | - $this->_add_settings_metabox( |
|
174 | - $box, |
|
175 | - $label, |
|
176 | - array( |
|
177 | - 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
178 | - 'template_args' => $this->_template_args, |
|
179 | - ) |
|
180 | - ); |
|
181 | - } |
|
182 | - } |
|
183 | - |
|
184 | - |
|
185 | - protected function _shortcodes() |
|
186 | - { |
|
187 | - $this->display_admin_page_with_sidebar(); |
|
188 | - } |
|
189 | - |
|
190 | - |
|
191 | - protected function _shortcodes_boxes() |
|
192 | - { |
|
193 | - $boxes = apply_filters( |
|
194 | - 'FHEE__Support_Admin_Page___shortcodes_boxes__boxes_array', |
|
195 | - array( |
|
196 | - 'shortcodes_event_listings' => esc_html__('Event Listings', 'event_espresso'), |
|
197 | - 'shortcodes_ticket_selector' => esc_html__('Event Ticket Selector', 'event_espresso'), |
|
198 | - 'shortcodes_category' => esc_html__('Event Categories', 'event_espresso'), |
|
199 | - 'shortcodes_attendee' => esc_html__('Event Attendees', 'event_espresso') |
|
200 | - /*'shortcodes_single_events' => esc_html__('Single Events', 'event_espresso'),*/ |
|
201 | - /*'shortcodes_attendee_listings' => esc_html__('Attendee Listings', 'event_espresso'),*/ |
|
202 | - ) |
|
203 | - ); |
|
204 | - foreach ($boxes as $box => $label) { |
|
205 | - $this->_add_settings_metabox( |
|
206 | - $box, |
|
207 | - $label, |
|
208 | - array( |
|
209 | - 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
210 | - 'template_args' => $this->_template_args, |
|
211 | - ) |
|
212 | - ); |
|
213 | - } |
|
214 | - } |
|
215 | - |
|
216 | - |
|
217 | - protected function _contact_support() |
|
218 | - { |
|
219 | - $this->display_admin_page_with_sidebar(); |
|
220 | - } |
|
221 | - |
|
222 | - |
|
223 | - protected function _support_boxes() |
|
224 | - { |
|
225 | - $boxes = apply_filters( |
|
226 | - 'FHEE__Support_Admin_Page___support_boxes__boxes_array', |
|
227 | - array( |
|
228 | - 'contact_support' => esc_html__('Contact Support', 'event_espresso'), |
|
229 | - 'important_information' => esc_html__('Important Information', 'event_espresso'), |
|
230 | - ) |
|
231 | - ); |
|
232 | - foreach ($boxes as $box => $label) { |
|
233 | - $this->_add_settings_metabox( |
|
234 | - $box, |
|
235 | - $label, |
|
236 | - array( |
|
237 | - 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
238 | - 'template_args' => $this->_template_args, |
|
239 | - ) |
|
240 | - ); |
|
241 | - } |
|
242 | - } |
|
243 | - |
|
244 | - |
|
245 | - protected function _developers() |
|
246 | - { |
|
247 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
|
248 | - EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'developers_admin_details.template.php', |
|
249 | - array(), |
|
250 | - true |
|
251 | - ); |
|
252 | - $this->display_admin_page_with_sidebar(); |
|
253 | - } |
|
14 | + protected function _init_page_props() |
|
15 | + { |
|
16 | + $this->page_slug = EE_SUPPORT_PG_SLUG; |
|
17 | + $this->page_label = esc_html__('Help & Support', 'event_espresso'); |
|
18 | + $this->_admin_base_url = EE_SUPPORT_ADMIN_URL; |
|
19 | + $this->_admin_base_path = EE_SUPPORT_ADMIN; |
|
20 | + } |
|
21 | + |
|
22 | + |
|
23 | + protected function _ajax_hooks() |
|
24 | + { |
|
25 | + } |
|
26 | + |
|
27 | + |
|
28 | + protected function _define_page_props() |
|
29 | + { |
|
30 | + $this->_labels = array(); |
|
31 | + $this->_admin_page_title = $this->page_label; |
|
32 | + } |
|
33 | + |
|
34 | + |
|
35 | + protected function _set_page_routes() |
|
36 | + { |
|
37 | + $this->_page_routes = array( |
|
38 | + 'default' => array( |
|
39 | + 'func' => [$this, '_contact_support'], |
|
40 | + 'capability' => 'ee_read_ee', |
|
41 | + ), |
|
42 | + 'developers' => array( |
|
43 | + 'func' => [$this, '_developers'], |
|
44 | + 'capability' => 'ee_read_ee', |
|
45 | + ), |
|
46 | + 'shortcodes' => array( |
|
47 | + 'func' => [$this, '_shortcodes'], |
|
48 | + 'capability' => 'ee_read_ee', |
|
49 | + ), |
|
50 | + ); |
|
51 | + } |
|
52 | + |
|
53 | + |
|
54 | + protected function _set_page_config() |
|
55 | + { |
|
56 | + $this->_page_config = array( |
|
57 | + 'default' => array( |
|
58 | + 'nav' => array( |
|
59 | + 'label' => esc_html__('Support', 'event_espresso'), |
|
60 | + 'icon' => 'dashicons-sos', |
|
61 | + 'order' => 30, |
|
62 | + ), |
|
63 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_support_boxes')), |
|
64 | + 'require_nonce' => false, |
|
65 | + ), |
|
66 | + 'developers' => array( |
|
67 | + 'nav' => array( |
|
68 | + 'label' => esc_html__('Developers', 'event_espresso'), |
|
69 | + 'icon' => 'dashicons-coffee', |
|
70 | + 'order' => 50, |
|
71 | + ), |
|
72 | + 'metaboxes' => $this->_default_espresso_metaboxes, |
|
73 | + 'require_nonce' => false, |
|
74 | + ), |
|
75 | + 'shortcodes' => array( |
|
76 | + 'nav' => array( |
|
77 | + 'label' => esc_html__('Shortcodes', 'event_espresso'), |
|
78 | + 'icon' => 'dashicons-shortcode', |
|
79 | + 'order' => 60, |
|
80 | + ), |
|
81 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_shortcodes_boxes')), |
|
82 | + 'require_nonce' => false, |
|
83 | + ), |
|
84 | + ); |
|
85 | + } |
|
86 | + |
|
87 | + |
|
88 | + // none of the below group are currently used for Support pages |
|
89 | + protected function _add_screen_options() |
|
90 | + { |
|
91 | + } |
|
92 | + |
|
93 | + |
|
94 | + protected function _add_feature_pointers() |
|
95 | + { |
|
96 | + } |
|
97 | + |
|
98 | + |
|
99 | + public function admin_init() |
|
100 | + { |
|
101 | + } |
|
102 | + |
|
103 | + |
|
104 | + public function admin_notices() |
|
105 | + { |
|
106 | + } |
|
107 | + |
|
108 | + |
|
109 | + public function admin_footer_scripts() |
|
110 | + { |
|
111 | + } |
|
112 | + |
|
113 | + |
|
114 | + public function load_scripts_styles() |
|
115 | + { |
|
116 | + } |
|
117 | + |
|
118 | + |
|
119 | + protected function _installation() |
|
120 | + { |
|
121 | + $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_installation.template.php'; |
|
122 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
|
123 | + $template_path, |
|
124 | + '', |
|
125 | + true |
|
126 | + ); |
|
127 | + $this->display_admin_page_with_sidebar(); |
|
128 | + } |
|
129 | + |
|
130 | + |
|
131 | + protected function _resources() |
|
132 | + { |
|
133 | + $this->display_admin_page_with_sidebar(); |
|
134 | + } |
|
135 | + |
|
136 | + |
|
137 | + protected function _add_settings_metabox($box, $label, array $args) |
|
138 | + { |
|
139 | + $this->addMetaBox( |
|
140 | + "espresso_{$box}_settings", |
|
141 | + $label, |
|
142 | + function ($post, $metabox) { |
|
143 | + EEH_Template::display_template( |
|
144 | + $metabox['args']['template_path'], |
|
145 | + $metabox['args']['template_args'] |
|
146 | + ); |
|
147 | + }, |
|
148 | + $this->_current_screen->id, |
|
149 | + 'normal', |
|
150 | + 'high', |
|
151 | + apply_filters( |
|
152 | + "FHEE__Support_Admin_Page___add_settings_metabox__{$box}_args_array", |
|
153 | + $args |
|
154 | + ) |
|
155 | + ); |
|
156 | + } |
|
157 | + |
|
158 | + |
|
159 | + protected function _resources_boxes() |
|
160 | + { |
|
161 | + $boxes = apply_filters( |
|
162 | + 'FHEE__Support_Admin_Page___resources_boxes__boxes_array', |
|
163 | + array( |
|
164 | + 'favorite_theme_developers' => esc_html__('Favorite Theme Developers', 'event_espresso'), |
|
165 | + 'highly_recommended_themes' => esc_html__('Highly Recommended Themes', 'event_espresso'), |
|
166 | + 'hire_developer' => esc_html__('Hire a Developer', 'event_espresso'), |
|
167 | + 'partners' => esc_html__('Partners', 'event_espresso'), |
|
168 | + 'recommended_plugins' => esc_html__('Recommended Plugins', 'event_espresso'), |
|
169 | + 'other_resources' => esc_html__('Other Resources', 'event_espresso'), |
|
170 | + ) |
|
171 | + ); |
|
172 | + foreach ($boxes as $box => $label) { |
|
173 | + $this->_add_settings_metabox( |
|
174 | + $box, |
|
175 | + $label, |
|
176 | + array( |
|
177 | + 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
178 | + 'template_args' => $this->_template_args, |
|
179 | + ) |
|
180 | + ); |
|
181 | + } |
|
182 | + } |
|
183 | + |
|
184 | + |
|
185 | + protected function _shortcodes() |
|
186 | + { |
|
187 | + $this->display_admin_page_with_sidebar(); |
|
188 | + } |
|
189 | + |
|
190 | + |
|
191 | + protected function _shortcodes_boxes() |
|
192 | + { |
|
193 | + $boxes = apply_filters( |
|
194 | + 'FHEE__Support_Admin_Page___shortcodes_boxes__boxes_array', |
|
195 | + array( |
|
196 | + 'shortcodes_event_listings' => esc_html__('Event Listings', 'event_espresso'), |
|
197 | + 'shortcodes_ticket_selector' => esc_html__('Event Ticket Selector', 'event_espresso'), |
|
198 | + 'shortcodes_category' => esc_html__('Event Categories', 'event_espresso'), |
|
199 | + 'shortcodes_attendee' => esc_html__('Event Attendees', 'event_espresso') |
|
200 | + /*'shortcodes_single_events' => esc_html__('Single Events', 'event_espresso'),*/ |
|
201 | + /*'shortcodes_attendee_listings' => esc_html__('Attendee Listings', 'event_espresso'),*/ |
|
202 | + ) |
|
203 | + ); |
|
204 | + foreach ($boxes as $box => $label) { |
|
205 | + $this->_add_settings_metabox( |
|
206 | + $box, |
|
207 | + $label, |
|
208 | + array( |
|
209 | + 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
210 | + 'template_args' => $this->_template_args, |
|
211 | + ) |
|
212 | + ); |
|
213 | + } |
|
214 | + } |
|
215 | + |
|
216 | + |
|
217 | + protected function _contact_support() |
|
218 | + { |
|
219 | + $this->display_admin_page_with_sidebar(); |
|
220 | + } |
|
221 | + |
|
222 | + |
|
223 | + protected function _support_boxes() |
|
224 | + { |
|
225 | + $boxes = apply_filters( |
|
226 | + 'FHEE__Support_Admin_Page___support_boxes__boxes_array', |
|
227 | + array( |
|
228 | + 'contact_support' => esc_html__('Contact Support', 'event_espresso'), |
|
229 | + 'important_information' => esc_html__('Important Information', 'event_espresso'), |
|
230 | + ) |
|
231 | + ); |
|
232 | + foreach ($boxes as $box => $label) { |
|
233 | + $this->_add_settings_metabox( |
|
234 | + $box, |
|
235 | + $label, |
|
236 | + array( |
|
237 | + 'template_path' => EE_SUPPORT_ADMIN_TEMPLATE_PATH . "support_admin_details_{$box}.template.php", |
|
238 | + 'template_args' => $this->_template_args, |
|
239 | + ) |
|
240 | + ); |
|
241 | + } |
|
242 | + } |
|
243 | + |
|
244 | + |
|
245 | + protected function _developers() |
|
246 | + { |
|
247 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
|
248 | + EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'developers_admin_details.template.php', |
|
249 | + array(), |
|
250 | + true |
|
251 | + ); |
|
252 | + $this->display_admin_page_with_sidebar(); |
|
253 | + } |
|
254 | 254 | } |
@@ -3,9 +3,9 @@ discard block |
||
3 | 3 | </p> |
4 | 4 | <p> |
5 | 5 | <?php esc_html_e( |
6 | - 'Views allow you to restrict what you see in the Transactions Overview table. The following views are available: View All. The number in parentheses next to each view represents the number of transactions that will be displayed with that view.', |
|
7 | - 'event_espresso' |
|
8 | - ); ?> |
|
6 | + 'Views allow you to restrict what you see in the Transactions Overview table. The following views are available: View All. The number in parentheses next to each view represents the number of transactions that will be displayed with that view.', |
|
7 | + 'event_espresso' |
|
8 | + ); ?> |
|
9 | 9 | <br /> |
10 | 10 | </p> |
11 | 11 | <ul> |
@@ -13,31 +13,31 @@ discard block |
||
13 | 13 | <strong><?php esc_html_e('View All Transactions', 'event_espresso'); ?></strong> |
14 | 14 | <br /> |
15 | 15 | <?php printf( |
16 | - esc_html__( |
|
17 | - 'Shows transactions where the registrant has completed the full registration process. Transactions in this view will either have a status of: %1$s%2$s"Incomplete" meaning there are monies owing%3$s%2$s"Complete" meaning there are NO monies owing%3$s%2$s"Overpaid" meaning that monies should be refunded to the registrant.%3$s%4$s', |
|
18 | - 'event_espresso' |
|
19 | - ), |
|
20 | - '<ul>', |
|
21 | - '<li>', |
|
22 | - '</li>', |
|
23 | - '</ul>' |
|
24 | - ); ?> |
|
16 | + esc_html__( |
|
17 | + 'Shows transactions where the registrant has completed the full registration process. Transactions in this view will either have a status of: %1$s%2$s"Incomplete" meaning there are monies owing%3$s%2$s"Complete" meaning there are NO monies owing%3$s%2$s"Overpaid" meaning that monies should be refunded to the registrant.%3$s%4$s', |
|
18 | + 'event_espresso' |
|
19 | + ), |
|
20 | + '<ul>', |
|
21 | + '<li>', |
|
22 | + '</li>', |
|
23 | + '</ul>' |
|
24 | + ); ?> |
|
25 | 25 | </li> |
26 | 26 | <li> |
27 | 27 | <strong><?php esc_html_e('Abandoned Transactions', 'event_espresso'); ?></strong> |
28 | 28 | <br /> |
29 | 29 | <?php esc_html_e( |
30 | - 'Shows transactions that have been abandoned, either due to a technical reason (server or computer crash during registration), or due to an abandoned cart where the registrant chose not to complete the registration process. Please note that Abandoned Transactions were able to capture contact information for at least one registrant. This can be helpful for following up with the contact to determine if they still wish to attend the event or not.', |
|
31 | - 'event_espresso' |
|
32 | - ); ?> |
|
30 | + 'Shows transactions that have been abandoned, either due to a technical reason (server or computer crash during registration), or due to an abandoned cart where the registrant chose not to complete the registration process. Please note that Abandoned Transactions were able to capture contact information for at least one registrant. This can be helpful for following up with the contact to determine if they still wish to attend the event or not.', |
|
31 | + 'event_espresso' |
|
32 | + ); ?> |
|
33 | 33 | </li> |
34 | 34 | <li> |
35 | 35 | <strong><?php esc_html_e('Failed Transactions', 'event_espresso'); ?></strong> |
36 | 36 | <br /> |
37 | 37 | <?php esc_html_e( |
38 | - 'Shows transactions that have failed, either due to a technical reason (server or computer crash during registration), or some other reason that prevented the collection of any useful contact information from any of the registrants. This could mean the registrant abandoned the registration process before submitting any data whatsoever or may even indicate attempts by spam bots to submit the registration form.', |
|
39 | - 'event_espresso' |
|
40 | - ); ?> |
|
38 | + 'Shows transactions that have failed, either due to a technical reason (server or computer crash during registration), or some other reason that prevented the collection of any useful contact information from any of the registrants. This could mean the registrant abandoned the registration process before submitting any data whatsoever or may even indicate attempts by spam bots to submit the registration form.', |
|
39 | + 'event_espresso' |
|
40 | + ); ?> |
|
41 | 41 | </li> |
42 | 42 | </ul> |
43 | 43 | <p> |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | </p> |
59 | 59 | <p> |
60 | 60 | <?php esc_html_e( |
61 | - 'You can perform a search to find specific transactions. The following sources will be searched: Event Name (title), Event Description, First Name, Last Name, Bio, Email, Address, Comments, Notes, Registration Final Price, Registration Code, Registration Group Size, Ticket Name, Ticket Description, Payment Method, Payment Gateway, Transaction Details, and Transaction Session Data. To use the search feature, enter a value into the search box and click on the Search Transactions button.', |
|
62 | - 'event_espresso' |
|
63 | - ); ?> |
|
61 | + 'You can perform a search to find specific transactions. The following sources will be searched: Event Name (title), Event Description, First Name, Last Name, Bio, Email, Address, Comments, Notes, Registration Final Price, Registration Code, Registration Group Size, Ticket Name, Ticket Description, Payment Method, Payment Gateway, Transaction Details, and Transaction Session Data. To use the search feature, enter a value into the search box and click on the Search Transactions button.', |
|
62 | + 'event_espresso' |
|
63 | + ); ?> |
|
64 | 64 | </p> |