Completed
Branch TASK/remove-mijireh (03faa3)
by
unknown
59:15 queued 50:39
created
templates/txn_admin_details_main_meta_box_txn_details.template.php 2 patches
Indentation   +195 added lines, -195 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
     <a id="display-additional-transaction-session-info" class="display-the-hidden smaller-text"
16 16
        rel="additional-transaction-session-info">
17 17
         <span class="dashicons dashicons-plus-alt"></span><?php esc_html_e(
18
-            'view additional transaction session details',
19
-            'event_espresso'
20
-        ); ?>
18
+			'view additional transaction session details',
19
+			'event_espresso'
20
+		); ?>
21 21
     </a>
22 22
 
23 23
     <div id="additional-transaction-session-info-dv" class="hidden">
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
         <a id="hide-additional-transaction-session-info" class="hide-the-displayed hidden smaller-text"
26 26
            rel="additional-transaction-session-info">
27 27
             <span class="dashicons dashicons-dismiss"></span><?php esc_html_e(
28
-                'hide additional transaction session details',
29
-                'event_espresso'
30
-            ); ?>
28
+				'hide additional transaction session details',
29
+				'event_espresso'
30
+			); ?>
31 31
         </a>
32 32
         <br class="clear"/>
33 33
 
@@ -52,16 +52,16 @@  discard block
 block discarded – undo
52 52
 
53 53
 
54 54
     <?php if ($attendee instanceof EE_Attendee && ($grand_raw_total > 0 || $TXN_status !== EEM_Transaction::complete_status_code || ! empty($payments))) :
55
-        $no_payment_text = $can_edit_payments
56
-            ? esc_html__(
57
-                'No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.',
58
-                'event_espresso'
59
-            )
60
-            : esc_html__(
61
-                'No payments have been applied to this transaction yet.',
62
-                'event_espresso'
63
-            );
64
-        ?>
55
+		$no_payment_text = $can_edit_payments
56
+			? esc_html__(
57
+				'No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.',
58
+				'event_espresso'
59
+			)
60
+			: esc_html__(
61
+				'No payments have been applied to this transaction yet.',
62
+				'event_espresso'
63
+			);
64
+		?>
65 65
 
66 66
         <h3 class="admin-primary-mbox-h4 hdr-has-icon">
67 67
             <span class="ee-icon ee-icon-cash"></span><?php esc_html_e('Payment Details', 'event_espresso'); ?>
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
                 <?php if ($payments) : ?>
89 89
                     <?php $payment_total = 0; ?>
90 90
                     <?php foreach ($payments as $PAY_ID => $payment) :
91
-                        $existing_reg_payment_json = isset($existing_reg_payments[ $PAY_ID ])
92
-                            ? wp_json_encode($existing_reg_payments[ $PAY_ID ])
93
-                            : '{}';
94
-                        ?>
91
+						$existing_reg_payment_json = isset($existing_reg_payments[ $PAY_ID ])
92
+							? wp_json_encode($existing_reg_payments[ $PAY_ID ])
93
+							: '{}';
94
+						?>
95 95
                         <tr id="txn-admin-payment-tr-<?php echo $PAY_ID; ?>">
96 96
                             <td>
97 97
                                 <span id="payment-status-<?php echo $PAY_ID; ?>"
@@ -136,16 +136,16 @@  discard block
 block discarded – undo
136 136
                                 </div>
137 137
                                 <div id="payment-gateway-<?php echo $PAY_ID; ?>">
138 138
                                     <?php echo $payment->payment_method()
139
-                                        ? $payment->payment_method()->admin_name()
140
-                                        : esc_html__(
141
-                                            "Unknown",
142
-                                            'event_espresso'
143
-                                        ); ?>
139
+										? $payment->payment_method()->admin_name()
140
+										: esc_html__(
141
+											"Unknown",
142
+											'event_espresso'
143
+										); ?>
144 144
                                 </div>
145 145
                                 <div id="payment-gateway-id-<?php echo $PAY_ID; ?>"
146 146
                                      class="hidden"><?php echo $payment->payment_method()
147
-                                        ? $payment->payment_method()->ID()
148
-                                        : 0; ?></div>
147
+										? $payment->payment_method()->ID()
148
+										: 0; ?></div>
149 149
                             </td>
150 150
                             <td class=" jst-left">
151 151
                                 <div id="payment-response-<?php echo $PAY_ID; ?>"><?php echo $payment->gateway_response(); ?></div>
@@ -162,29 +162,29 @@  discard block
 block discarded – undo
162 162
                             </td>
163 163
                             <td class=" jst-rght">
164 164
                                 <?php $payment_class = $payment->amount() > 0
165
-                                    ? 'txn-admin-payment-status-' . $payment->STS_ID()
166
-                                    : 'txn-admin-payment-status-PDC'; ?>
165
+									? 'txn-admin-payment-status-' . $payment->STS_ID()
166
+									: 'txn-admin-payment-status-PDC'; ?>
167 167
                                 <span class="<?php echo $payment_class; ?>">
168 168
                                 <div id="payment-amount-<?php echo $PAY_ID; ?>" style="display:inline;">
169 169
                                 <?php echo EEH_Template::format_currency(
170
-                                    $payment->amount(),
171
-                                    false,
172
-                                    false
173
-                                ); ?></div>
170
+									$payment->amount(),
171
+									false,
172
+									false
173
+								); ?></div>
174 174
                             </span>
175 175
                             </td>
176 176
                         </tr>
177 177
                         <?php
178
-                        $payment_total += $payment->STS_ID() == 'PAP' ? $payment->amount() : 0;
179
-                        ?>
178
+						$payment_total += $payment->STS_ID() == 'PAP' ? $payment->amount() : 0;
179
+						?>
180 180
                     <?php endforeach; // $payment?>
181 181
                     <?php
182
-                    $pay_totals_class = $payment_total > $grand_raw_total ? ' important-notice' : '';
183
-                    $overpaid = $payment_total > $grand_raw_total
184
-                        ? '<span id="overpaid">' . esc_html__('This transaction has been overpaid ! ', 'event_espresso')
185
-                          . '</span>'
186
-                        : '';
187
-                    ?>
182
+					$pay_totals_class = $payment_total > $grand_raw_total ? ' important-notice' : '';
183
+					$overpaid = $payment_total > $grand_raw_total
184
+						? '<span id="overpaid">' . esc_html__('This transaction has been overpaid ! ', 'event_espresso')
185
+						  . '</span>'
186
+						: '';
187
+					?>
188 188
                     <tr id="txn-admin-no-payments-tr" class="admin-primary-mbox-total-tr hidden">
189 189
                         <td class=" jst-rght" colspan="10">
190 190
                             <span class="important-notice"><?php echo $no_payment_text; ?></span>
@@ -195,20 +195,20 @@  discard block
 block discarded – undo
195 195
                         <th class=" jst-rght" colspan="9"><span
196 196
                                 id="payments-total-spn">
197 197
                                 <?php echo $overpaid
198
-                                           . sprintf(
199
-                                               esc_html__(
200
-                                                   'Payments Total %s',
201
-                                                   'event_espresso'
202
-                                               ),
203
-                                               '(' . EE_Registry::instance()->CFG->currency->code . ')'
204
-                                           ); ?></span></th>
198
+										   . sprintf(
199
+											   esc_html__(
200
+												   'Payments Total %s',
201
+												   'event_espresso'
202
+											   ),
203
+											   '(' . EE_Registry::instance()->CFG->currency->code . ')'
204
+										   ); ?></span></th>
205 205
                         <th class=" jst-rght"><span
206 206
                                 id="txn-admin-payment-total">
207 207
                                 <?php echo EEH_Template::format_currency(
208
-                                    $payment_total,
209
-                                    false,
210
-                                    false
211
-                                ); ?></span></th>
208
+									$payment_total,
209
+									false,
210
+									false
211
+								); ?></span></th>
212 212
                     </tr>
213 213
                 <?php else : ?>
214 214
                     <tr id="txn-admin-no-payments-tr" class="admin-primary-mbox-total-tr">
@@ -220,13 +220,13 @@  discard block
 block discarded – undo
220 220
                         <th class=" jst-rght" colspan="9"><span
221 221
                                 id="payments-total-spn">
222 222
                                 <?php echo esc_html__(
223
-                                    'Payments Total',
224
-                                    'event_espresso'
225
-                                ); ?></span></th>
223
+									'Payments Total',
224
+									'event_espresso'
225
+								); ?></span></th>
226 226
                         <th class=" jst-rght"><span id="txn-admin-payment-total"></span></th>
227 227
                     </tr>
228 228
                 <?php endif; // $payments
229
-                ?>
229
+				?>
230 230
 
231 231
                 <tr id="txn-admin-payment-empty-row-tr" class="hidden">
232 232
                     <td>
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 
290 290
         <ul id="txn-admin-payment-options-ul">
291 291
             <?php if ($can_edit_payments) :
292
-                ?>
292
+				?>
293 293
                 <li>
294 294
                     <a id="display-txn-admin-apply-payment" class="button-primary no-icon no-hide"
295 295
                        rel="txn-admin-apply-payment"> <!--display-the-hidden -->
@@ -306,20 +306,20 @@  discard block
 block discarded – undo
306 306
                 <li>
307 307
                     <p>
308 308
                         <?php esc_html__(
309
-                            'You do not have access to apply payments or refunds.',
310
-                            'event_espresso'
311
-                        ); ?></p>
309
+							'You do not have access to apply payments or refunds.',
310
+							'event_espresso'
311
+						); ?></p>
312 312
                 </li>
313 313
             <?php endif; ?>
314 314
             <?php
315
-                /**
316
-                 * Allows extend the fields at actions area.
317
-                 */
318
-                do_action(
319
-                    'AHEE__txn_admin_details_main_meta_box_txn_details__after_actions_buttons',
320
-                    $can_edit_payments
321
-                );
322
-            ?>
315
+				/**
316
+				 * Allows extend the fields at actions area.
317
+				 */
318
+				do_action(
319
+					'AHEE__txn_admin_details_main_meta_box_txn_details__after_actions_buttons',
320
+					$can_edit_payments
321
+				);
322
+			?>
323 323
         </ul>
324 324
         <br class="clear"/>
325 325
 
@@ -335,23 +335,23 @@  discard block
 block discarded – undo
335 335
                 style="display:none;">
336 336
                 <div class="ee-icon ee-icon-cash-edit float-left"></div>
337 337
                 <?php
338
-                echo sprintf(
339
-                    __('Edit Payment #%s for Transaction #%s', 'event_espresso'),
340
-                    '<span></span>',
341
-                    $txn_nmbr['value']
342
-                );
343
-                ?>
338
+				echo sprintf(
339
+					__('Edit Payment #%s for Transaction #%s', 'event_espresso'),
340
+					'<span></span>',
341
+					$txn_nmbr['value']
342
+				);
343
+				?>
344 344
             </h2>
345 345
 
346 346
             <h2 id="admin-modal-dialog-edit-refund-h2" class="admin-modal-dialog-h2 hdr-has-icon" style="display:none;">
347 347
                 <div class="ee-icon ee-icon-cash-edit float-left"></div>
348 348
                 <?php
349
-                echo sprintf(
350
-                    __('Edit Refund #%s for Transaction #%s', 'event_espresso'),
351
-                    '<span></span>',
352
-                    $txn_nmbr['value']
353
-                );
354
-                ?>
349
+				echo sprintf(
350
+					__('Edit Refund #%s for Transaction #%s', 'event_espresso'),
351
+					'<span></span>',
352
+					$txn_nmbr['value']
353
+				);
354
+				?>
355 355
             </h2>
356 356
 
357 357
             <h2 id="admin-modal-dialog-apply-refund-h2" class="admin-modal-dialog-h2 hdr-has-icon"
@@ -385,55 +385,55 @@  discard block
 block discarded – undo
385 385
                         <div class="txn-admin-apply-payment-date-dv admin-modal-dialog-row">
386 386
                             <div class="validation-notice-dv">
387 387
                                 <?php esc_html_e(
388
-                                    'The following is  a required field',
389
-                                    'event_espresso'
390
-                                ); ?></div>
388
+									'The following is  a required field',
389
+									'event_espresso'
390
+								); ?></div>
391 391
                             <label for="txn-admin-payment-date-inp" class="">
392 392
                                 <?php esc_html_e(
393
-                                    'Payment Date',
394
-                                    'event_espresso'
395
-                                ); ?></label>
393
+									'Payment Date',
394
+									'event_espresso'
395
+								); ?></label>
396 396
                             <input name="txn_admin_payment[date]" id="txn-admin-payment-date-inp"
397 397
                                    class="txn-admin-apply-payment-inp required" type="text"
398 398
                                    value="<?php echo date('Y-m-d g:i a', current_time('timestamp')); ?>"/>
399 399
                             <p class="description">
400 400
                                 <?php esc_html_e(
401
-                                    'The date the payment was actually made on',
402
-                                    'event_espresso'
403
-                                ); ?></p>
401
+									'The date the payment was actually made on',
402
+									'event_espresso'
403
+								); ?></p>
404 404
                         </div>
405 405
 
406 406
                         <div class="txn-admin-apply-payment-amount-dv admin-modal-dialog-row">
407 407
                             <div class="validation-notice-dv">
408 408
                                 <?php esc_html_e(
409
-                                    'The following is  a required field',
410
-                                    'event_espresso'
411
-                                ); ?></div>
409
+									'The following is  a required field',
410
+									'event_espresso'
411
+								); ?></div>
412 412
                             <label for="txn-admin-payment-amount-inp" class="">
413 413
                                 <?php esc_html_e(
414
-                                    'Amount',
415
-                                    'event_espresso'
416
-                                ); ?></label>
414
+									'Amount',
415
+									'event_espresso'
416
+								); ?></label>
417 417
                             <input name="txn_admin_payment[amount]" id="txn-admin-payment-amount-inp"
418 418
                                    class="txn-admin-apply-payment-inp required" type="text" value=""/>
419 419
                             <p class="description">
420 420
                                 <?php esc_html_e(
421
-                                    'The amount of the payment',
422
-                                    'event_espresso'
423
-                                ); ?></p>
421
+									'The amount of the payment',
422
+									'event_espresso'
423
+								); ?></p>
424 424
                         </div>
425 425
 
426 426
                         <div class="txn-admin-apply-payment-method-dv admin-modal-dialog-row">
427 427
                             <div class="validation-notice-dv">
428 428
                                 <?php esc_html_e(
429
-                                    'The following is  a required field',
430
-                                    'event_espresso'
431
-                                ); ?></div>
429
+									'The following is  a required field',
430
+									'event_espresso'
431
+								); ?></div>
432 432
                             <label for="txn-admin-payment-method-inp" class="">
433 433
                                 <?php esc_html_e(
434
-                                    'Method of Payment',
435
-                                    'event_espresso'
436
-                                ); ?></label>
434
+									'Method of Payment',
435
+									'event_espresso'
436
+								); ?></label>
437 437
                             <select name="txn_admin_payment[PMD_ID]" id="txn-admin-payment-method-slct"
438 438
                                     class="txn-admin-apply-payment-slct required" type="text">
439 439
                                 <?php foreach ($payment_methods as $method) : ?>
@@ -441,39 +441,39 @@  discard block
 block discarded – undo
441 441
                                     <option id="payment-method-opt-<?php echo $method->slug(); ?>"
442 442
                                             value="<?php echo $method->ID(); ?>"<?php echo $selected; ?>>
443 443
                                         <?php echo sanitize_key(
444
-                                            $method->admin_desc()
445
-                                        )
446
-                                            ? substr(
447
-                                                $method->admin_desc(),
448
-                                                0,
449
-                                                128
450
-                                            )
451
-                                            : $method->admin_name(); ?>&nbsp;&nbsp;
444
+											$method->admin_desc()
445
+										)
446
+											? substr(
447
+												$method->admin_desc(),
448
+												0,
449
+												128
450
+											)
451
+											: $method->admin_name(); ?>&nbsp;&nbsp;
452 452
                                     </option>
453 453
                                 <?php endforeach; ?>
454 454
                             </select>
455 455
                             <p class="description">
456 456
                                 <?php esc_html_e(
457
-                                    'Whether the payment was made via PayPal, Credit Card, Cheque, or Cash',
458
-                                    'event_espresso'
459
-                                ); ?></p>
457
+									'Whether the payment was made via PayPal, Credit Card, Cheque, or Cash',
458
+									'event_espresso'
459
+								); ?></p>
460 460
                         </div>
461 461
 
462 462
                         <div class="mop-PP mop-CC mop-CHQ mop">
463 463
                             <div class="txn-admin-apply-payment-gw-txn-id-dv admin-modal-dialog-row">
464 464
                                 <label for="txn-admin-payment-txn-id-inp" class="">
465 465
                                     <?php esc_html_e(
466
-                                        'TXN ID / CHQ #',
467
-                                        'event_espresso'
468
-                                    ); ?></label>
466
+										'TXN ID / CHQ #',
467
+										'event_espresso'
468
+									); ?></label>
469 469
                                 <input name="txn_admin_payment[txn_id_chq_nmbr]"
470 470
                                        id="txn-admin-payment-txn-id-chq-nmbr-inp" class="txn-admin-apply-payment-inp"
471 471
                                        type="text" maxlength="100"/>
472 472
                                 <p class="description">
473 473
                                     <?php esc_html_e(
474
-                                        'The Transaction ID sent back from the payment gateway, or the Cheque #',
475
-                                        'event_espresso'
476
-                                    ); ?></p>
474
+										'The Transaction ID sent back from the payment gateway, or the Cheque #',
475
+										'event_espresso'
476
+									); ?></p>
477 477
                             </div>
478 478
                         </div>
479 479
 
@@ -486,9 +486,9 @@  discard block
 block discarded – undo
486 486
                                        type="text"/>
487 487
                                 <p class="description">
488 488
                                     <?php esc_html_e(
489
-                                        'The gateway response string (optional)',
490
-                                        'event_espresso'
491
-                                    ); ?></p>
489
+										'The gateway response string (optional)',
490
+										'event_espresso'
491
+									); ?></p>
492 492
                             </div>
493 493
                         </div>
494 494
 
@@ -496,9 +496,9 @@  discard block
 block discarded – undo
496 496
                             <div class="txn-admin-apply-payment-status-dv admin-modal-dialog-row">
497 497
                                 <label for="txn-admin-payment-status-inp" class="">
498 498
                                     <?php esc_html_e(
499
-                                        'Payment Status',
500
-                                        'event_espresso'
501
-                                    ); ?></label>
499
+										'Payment Status',
500
+										'event_espresso'
501
+									); ?></label>
502 502
                                 <select name="txn_admin_payment[status]" id="txn-admin-payment-status-slct"
503 503
                                         class="txn-admin-apply-payment-slct" type="text">
504 504
                                     <?php foreach ($payment_status as $STS_ID => $STS_code) : ?>
@@ -511,52 +511,52 @@  discard block
 block discarded – undo
511 511
                                 </select>
512 512
                                 <p class="description">
513 513
                                     <?php esc_html_e(
514
-                                        'Whether the payment was approved, cancelled, declined or failed after submission to the gateway',
515
-                                        'event_espresso'
516
-                                    ); ?></p>
514
+										'Whether the payment was approved, cancelled, declined or failed after submission to the gateway',
515
+										'event_espresso'
516
+									); ?></p>
517 517
                             </div>
518 518
                         </div>
519 519
 
520 520
                         <div class="txn-admin-apply-payment-po-nmbr-dv admin-modal-dialog-row">
521 521
                             <label for="txn-admin-payment-po-nmbr-inp" class="">
522 522
                                 <?php esc_html_e(
523
-                                    'P.O. / S.O. #',
524
-                                    'event_espresso'
525
-                                ); ?></label>
523
+									'P.O. / S.O. #',
524
+									'event_espresso'
525
+								); ?></label>
526 526
                             <input name="txn_admin_payment[po_number]" id="txn-admin-payment-po-nmbr-inp"
527 527
                                    class="txn-admin-apply-payment-inp" type="text" maxlength="100"/>
528 528
                             <p class="description">
529 529
                                 <?php esc_html_e(
530
-                                    'The Purchase or Sales Order Number if any (optional)',
531
-                                    'event_espresso'
532
-                                ); ?></p>
530
+									'The Purchase or Sales Order Number if any (optional)',
531
+									'event_espresso'
532
+								); ?></p>
533 533
                         </div>
534 534
 
535 535
                         <div class="txn-admin-apply-payment-accounting-dv admin-modal-dialog-row">
536 536
                             <label for="txn-admin-payment-accounting-inp"
537 537
                                    class="last">
538 538
                                 <?php esc_html_e(
539
-                                    'Notes / Extra Accounting',
540
-                                    'event_espresso'
541
-                                ); ?></label>
539
+									'Notes / Extra Accounting',
540
+									'event_espresso'
541
+								); ?></label>
542 542
                             <input name="txn_admin_payment[accounting]" id="txn-admin-payment-accounting-inp"
543 543
                                    class="txn-admin-apply-payment-inp" type="text" value="<?php echo $REG_code; ?>"
544 544
                                    maxlength="100"/> <input type="hidden" id="txn-admin-reg-code-inp"
545 545
                                                             value="<?php echo $REG_code; ?>"/>
546 546
                             <p class="description">
547 547
                                 <?php esc_html_e(
548
-                                    'An extra field you may use for accounting purposes or simple notes. Defaults to the primary registrant\'s registration code.',
549
-                                    'event_espresso'
550
-                                ); ?></p>
548
+									'An extra field you may use for accounting purposes or simple notes. Defaults to the primary registrant\'s registration code.',
549
+									'event_espresso'
550
+								); ?></p>
551 551
                         </div>
552 552
 
553 553
                         <div class="txn-admin-apply-payment-registrations-dv admin-modal-dialog-row">
554 554
                             <label for="txn-admin-payment-registrations-inp"
555 555
                                    class="last">
556 556
                                 <?php esc_html_e(
557
-                                    'Registrations to Apply Payment to:',
558
-                                    'event_espresso'
559
-                                ); ?></label>
557
+									'Registrations to Apply Payment to:',
558
+									'event_espresso'
559
+								); ?></label>
560 560
                             <label class="txn-admin-apply-payment-to-registrations-lbl">
561 561
                                 <input type="radio" value="1" id="txn-admin-apply-payment-to-all-registrations-inp"
562 562
                                        name="txn_admin_payment[apply_to_all_registrations]" checked="checked"/>
@@ -574,15 +574,15 @@  discard block
 block discarded – undo
574 574
                             <label for="txn-admin-payment-reg-status-inp"
575 575
                                    class="last">
576 576
                                 <?php esc_html_e(
577
-                                    'Change Registration Status?',
578
-                                    'event_espresso'
579
-                                ); ?></label>
577
+									'Change Registration Status?',
578
+									'event_espresso'
579
+								); ?></label>
580 580
                             <?php echo $status_change_select; ?>
581 581
                             <p class="description">
582 582
                                 <?php esc_html_e(
583
-                                    'If you wish to change the status for the registrations selected above, then select which status from this dropdown.',
584
-                                    'event_espresso'
585
-                                ); ?></p>
583
+									'If you wish to change the status for the registrations selected above, then select which status from this dropdown.',
584
+									'event_espresso'
585
+								); ?></p>
586 586
                             <br/>
587 587
                         </div>
588 588
 
@@ -603,14 +603,14 @@  discard block
 block discarded – undo
603 603
                             <br class="clear-float"/>
604 604
                             <p class="description">
605 605
                                 <?php printf(
606
-                                    esc_html__(
607
-                                        'By default %1$sa payment message is sent to the primary registrant%2$s after submitting this form.%3$sHowever, if you check the "Registration Messages" box, the system will also send any related messages matching the status of the registrations to %1$seach registration for this transaction%2$s.',
608
-                                        'event_espresso'
609
-                                    ),
610
-                                    '<strong>',
611
-                                    '</strong>',
612
-                                    '<br />'
613
-                                ); ?></p>
606
+									esc_html__(
607
+										'By default %1$sa payment message is sent to the primary registrant%2$s after submitting this form.%3$sHowever, if you check the "Registration Messages" box, the system will also send any related messages matching the status of the registrations to %1$seach registration for this transaction%2$s.',
608
+										'event_espresso'
609
+									),
610
+									'<strong>',
611
+									'</strong>',
612
+									'<br />'
613
+								); ?></p>
614 614
                             <label></label>
615 615
                         </div>
616 616
                         <div class="clear"></div>
@@ -651,9 +651,9 @@  discard block
 block discarded – undo
651 651
                     <li>
652 652
                         <span id="ee-ajax-processing-text" style="display:none;">
653 653
                             <?php esc_html_e(
654
-                                'Processing...',
655
-                                'event_espresso'
656
-                            ); ?></span>
654
+								'Processing...',
655
+								'event_espresso'
656
+							); ?></span>
657 657
                     </li>
658 658
                 </ul>
659 659
 
@@ -668,9 +668,9 @@  discard block
 block discarded – undo
668 668
                 style="display:none;">
669 669
                 <span class="ee-icon ee-icon-cash-add"></span>
670 670
                 <?php echo esc_html__(
671
-                    'Delete Payment/Refund for Transaction #',
672
-                    'event_espresso'
673
-                ) . $txn_nmbr['value']; ?>
671
+					'Delete Payment/Refund for Transaction #',
672
+					'event_espresso'
673
+				) . $txn_nmbr['value']; ?>
674 674
             </h2>
675 675
 
676 676
             <form name="txn-admin-delete-payment-frm" id="txn-admin-delete-payment-frm"
@@ -692,19 +692,19 @@  discard block
 block discarded – undo
692 692
                             <label for="delete-txn-admin-payment-reg-status-inp"
693 693
                                    class="last">
694 694
                                 <?php esc_html_e(
695
-                                    'Change Registration Status?',
696
-                                    'event_espresso'
697
-                                ); ?></label>
695
+									'Change Registration Status?',
696
+									'event_espresso'
697
+								); ?></label>
698 698
                             <?php echo $delete_status_change_select; ?>
699 699
                             <p class="description">
700 700
                                 <?php printf(
701
-                                    esc_html__(
702
-                                        'If you wish to change the status of all the registrations associated with this transaction after deleting this payment/refund, then select which status from this dropdown. %sNote: ALL registrations associated with this transaction will be updated to this new status.%s',
703
-                                        'event_espresso'
704
-                                    ),
705
-                                    '<strong>',
706
-                                    '</strong>'
707
-                                ); ?></p>
701
+									esc_html__(
702
+										'If you wish to change the status of all the registrations associated with this transaction after deleting this payment/refund, then select which status from this dropdown. %sNote: ALL registrations associated with this transaction will be updated to this new status.%s',
703
+										'event_espresso'
704
+									),
705
+									'<strong>',
706
+									'</strong>'
707
+								); ?></p>
708 708
                         </div>
709 709
 
710 710
                         <div class="ee-attention txn-admin-apply-payment-accounting-dv admin-modal-dialog-row">
@@ -713,9 +713,9 @@  discard block
 block discarded – undo
713 713
                             <input type="checkbox" value="1" name="delete_txn_reg_status_change[send_notifications]">
714 714
                             <p class="description">
715 715
                                 <?php esc_html_e(
716
-                                    'If you check this box, the system will send any related registration messages matching the status of the registrations to each registration for this transaction. No Payment notifications are sent when deleting a payment.',
717
-                                    'event_espresso'
718
-                                ); ?></p>
716
+									'If you check this box, the system will send any related registration messages matching the status of the registrations to each registration for this transaction. No Payment notifications are sent when deleting a payment.',
717
+									'event_espresso'
718
+								); ?></p>
719 719
                         </div>
720 720
                         <div class="clear"></div>
721 721
 
@@ -747,16 +747,16 @@  discard block
 block discarded – undo
747 747
     <?php endif; // $grand_raw_total > 0?>
748 748
 
749 749
     <?php
750
-    if (WP_DEBUG) {
751
-        $delivered_messages = get_option('EED_Messages__payment', array());
752
-        if (isset($delivered_messages[ $TXN_ID ])) {
753
-            ?>
750
+	if (WP_DEBUG) {
751
+		$delivered_messages = get_option('EED_Messages__payment', array());
752
+		if (isset($delivered_messages[ $TXN_ID ])) {
753
+			?>
754 754
             <h4 class="admin-primary-mbox-h4 hdr-has-icon"><span
755 755
                     class="dashicons dashicons-email-alt"></span>
756 756
                 <?php esc_html_e(
757
-                    'Messages Sent to Primary Registrant',
758
-                    'event_espresso'
759
-                ); ?></h4>
757
+					'Messages Sent to Primary Registrant',
758
+					'event_espresso'
759
+				); ?></h4>
760 760
 
761 761
             <div class="admin-primary-mbox-tbl-wrap">
762 762
                 <table class="admin-primary-mbox-tbl">
@@ -770,26 +770,26 @@  discard block
 block discarded – undo
770 770
                     </thead>
771 771
                     <tbody>
772 772
                     <?php foreach ($delivered_messages[ $TXN_ID ] as $timestamp => $delivered_message) :
773
-                        ?>
773
+						?>
774 774
                         <tr>
775 775
                             <td class="jst-left">
776 776
                                 <?php echo date(
777
-                                    get_option('date_format') . ' ' . get_option('time_format'),
778
-                                    ($timestamp + (get_option('gmt_offset') * HOUR_IN_SECONDS))
779
-                                ); ?></td>
777
+									get_option('date_format') . ' ' . get_option('time_format'),
778
+									($timestamp + (get_option('gmt_offset') * HOUR_IN_SECONDS))
779
+								); ?></td>
780 780
                             <td class="jst-left"><?php echo isset($delivered_message['message_type'])
781
-                                    ? $delivered_message['message_type'] : ''; ?></td>
781
+									? $delivered_message['message_type'] : ''; ?></td>
782 782
                             <td class="jst-left"><?php echo isset($delivered_message['pay_status'])
783
-                                    ? $delivered_message['pay_status'] : ''; ?></td>
783
+									? $delivered_message['pay_status'] : ''; ?></td>
784 784
                             <td class="jst-left"><?php echo isset($delivered_message['txn_status'])
785
-                                    ? $delivered_message['txn_status'] : ''; ?></td>
785
+									? $delivered_message['txn_status'] : ''; ?></td>
786 786
                         </tr>
787 787
                     <?php endforeach; // $delivered_messages?>
788 788
                     </tbody>
789 789
                 </table>
790 790
             </div>
791 791
             <?php
792
-        }
793
-    }
794
-    ?>
792
+		}
793
+	}
794
+	?>
795 795
 </div>
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -210,10 +210,13 @@  discard block
 block discarded – undo
210 210
                                     false
211 211
                                 ); ?></span></th>
212 212
                     </tr>
213
-                <?php else : ?>
213
+                <?php else {
214
+	: ?>
214 215
                     <tr id="txn-admin-no-payments-tr" class="admin-primary-mbox-total-tr">
215 216
                         <td class=" jst-rght" colspan="10">
216
-                            <span class="important-notice"><?php echo $no_payment_text; ?></span>
217
+                            <span class="important-notice"><?php echo $no_payment_text;
218
+}
219
+?></span>
217 220
                         </td>
218 221
                     </tr>
219 222
                     <tr id="txn-admin-payments-total-tr" class="admin-primary-mbox-total-tr hidden">
@@ -302,13 +305,16 @@  discard block
 block discarded – undo
302 305
                         <?php esc_html_e('Apply Refund', 'event_espresso'); ?>
303 306
                     </a>
304 307
                 </li>
305
-            <?php else : ?>
308
+            <?php else {
309
+	: ?>
306 310
                 <li>
307 311
                     <p>
308 312
                         <?php esc_html__(
309 313
                             'You do not have access to apply payments or refunds.',
310 314
                             'event_espresso'
311
-                        ); ?></p>
315
+                        );
316
+}
317
+?></p>
312 318
                 </li>
313 319
             <?php endif; ?>
314 320
             <?php
Please login to merge, or discard this patch.
admin/extend/registrations/EE_Event_Registrations_List_Table.class.php 1 patch
Indentation   +553 added lines, -553 removed lines patch added patch discarded remove patch
@@ -12,562 +12,562 @@
 block discarded – undo
12 12
 class EE_Event_Registrations_List_Table extends EE_Admin_List_Table
13 13
 {
14 14
 
15
-    /**
16
-     * This property will hold the related Datetimes on an event IF the event id is included in the request.
17
-     *
18
-     * @var EE_Datetime[]
19
-     */
20
-    protected $_dtts_for_event = array();
21
-
22
-
23
-    /**
24
-     * The event if one is specified in the request
25
-     *
26
-     * @var EE_Event
27
-     */
28
-    protected $_evt = null;
29
-
30
-
31
-    /**
32
-     * The DTT_ID if the current view has a specified datetime.
33
-     *
34
-     * @var int $_cur_dtt_id
35
-     */
36
-    protected $_cur_dtt_id = 0;
37
-
38
-
39
-    /**
40
-     * EE_Event_Registrations_List_Table constructor.
41
-     *
42
-     * @param \Registrations_Admin_Page $admin_page
43
-     */
44
-    public function __construct($admin_page)
45
-    {
46
-        parent::__construct($admin_page);
47
-        $this->_status = $this->_admin_page->get_registration_status_array();
48
-    }
49
-
50
-
51
-    protected function _setup_data()
52
-    {
53
-        $this->_data = $this->_view !== 'trash' ? $this->_admin_page->get_event_attendees($this->_per_page)
54
-            : $this->_admin_page->get_event_attendees($this->_per_page, false, true);
55
-        $this->_all_data_count = $this->_view !== 'trash' ? $this->_admin_page->get_event_attendees(
56
-            $this->_per_page,
57
-            true
58
-        ) : $this->_admin_page->get_event_attendees($this->_per_page, true, true);
59
-    }
60
-
61
-
62
-    protected function _set_properties()
63
-    {
64
-        $evt_id = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null;
65
-        $this->_wp_list_args = array(
66
-            'singular' => __('registrant', 'event_espresso'),
67
-            'plural'   => __('registrants', 'event_espresso'),
68
-            'ajax'     => true,
69
-            'screen'   => $this->_admin_page->get_current_screen()->id,
70
-        );
71
-        $columns = array();
72
-        // $columns['_Reg_Status'] = '';
73
-        if (! empty($evt_id)) {
74
-            $columns['cb'] = '<input type="checkbox" />'; // Render a checkbox instead of text
75
-            $this->_has_checkbox_column = true;
76
-        }
77
-        $this->_columns = array(
78
-            '_REG_att_checked_in' => '<span class="dashicons dashicons-yes ee-icon-size-18"></span>',
79
-            'ATT_name'            => __('Registrant', 'event_espresso'),
80
-            'ATT_email'           => __('Email Address', 'event_espresso'),
81
-            'Event'               => __('Event', 'event_espresso'),
82
-            'PRC_name'            => __('TKT Option', 'event_espresso'),
83
-            '_REG_final_price'    => __('Price', 'event_espresso'),
84
-            'TXN_paid'            => __('Paid', 'event_espresso'),
85
-            'TXN_total'           => __('Total', 'event_espresso'),
86
-        );
87
-        $this->_columns = array_merge($columns, $this->_columns);
88
-        $this->_primary_column = '_REG_att_checked_in';
89
-        if (! empty($evt_id)
90
-            && EE_Registry::instance()->CAP->current_user_can(
91
-                'ee_read_registrations',
92
-                'espresso_registrations_registrations_reports',
93
-                $evt_id
94
-            )
95
-        ) {
96
-            $this->_bottom_buttons = array(
97
-                'report' => array(
98
-                    'route'         => 'registrations_report',
99
-                    'extra_request' =>
100
-                        array(
101
-                            'EVT_ID'     => $evt_id,
102
-                            'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"),
103
-                        ),
104
-                ),
105
-            );
106
-        }
107
-        $this->_bottom_buttons['report_filtered'] = array(
108
-            'route'         => 'registrations_checkin_report',
109
-            'extra_request' => array(
110
-                'use_filters' => true,
111
-                'filters'     => array_merge(
112
-                    array(
113
-                        'EVT_ID' => $evt_id,
114
-                    ),
115
-                    array_diff_key(
116
-                        $this->_req_data,
117
-                        array_flip(
118
-                            array(
119
-                                'page',
120
-                                'action',
121
-                                'default_nonce',
122
-                            )
123
-                        )
124
-                    )
125
-                ),
126
-                'return_url'  => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"),
127
-            ),
128
-        );
129
-        $this->_sortable_columns = array(
130
-            /**
131
-             * Allows users to change the default sort if they wish.
132
-             * Returning a falsey on this filter will result in the default sort to be by firstname rather than last name.
133
-             *
134
-             * Note: usual naming conventions for filters aren't followed here so that just one filter can be used to
135
-             * change the sorts on any list table involving registration contacts.  If you want to only change the filter
136
-             * for a specific list table you can use the provided reference to this object instance.
137
-             */
138
-            'ATT_name' => array(
139
-                'FHEE__EE_Registrations_List_Table___set_properties__default_sort_by_registration_last_name',
140
-                true,
141
-                $this,
142
-            )
143
-                ? array('ATT_lname' => true)
144
-                : array('ATT_fname' => true),
145
-            'Event'    => array('Event.EVT_name' => false),
146
-        );
147
-        $this->_hidden_columns = array();
148
-        $this->_evt = EEM_Event::instance()->get_one_by_ID($evt_id);
149
-        $this->_dtts_for_event = $this->_evt instanceof EE_Event ? $this->_evt->datetimes_ordered() : array();
150
-    }
151
-
152
-
153
-    /**
154
-     * @param \EE_Registration $item
155
-     * @return string
156
-     */
157
-    protected function _get_row_class($item)
158
-    {
159
-        $class = parent::_get_row_class($item);
160
-        // add status class
161
-        $class .= ' ee-status-strip reg-status-' . $item->status_ID();
162
-        if ($this->_has_checkbox_column) {
163
-            $class .= ' has-checkbox-column';
164
-        }
165
-        return $class;
166
-    }
167
-
168
-
169
-    /**
170
-     * @return array
171
-     * @throws \EE_Error
172
-     */
173
-    protected function _get_table_filters()
174
-    {
175
-        $filters = $where = array();
176
-        $current_EVT_ID = isset($this->_req_data['event_id']) ? (int) $this->_req_data['event_id'] : 0;
177
-        if (empty($this->_dtts_for_event) || count($this->_dtts_for_event) === 1) {
178
-            // this means we don't have an event so let's setup a filter dropdown for all the events to select
179
-            // note possible capability restrictions
180
-            if (! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) {
181
-                $where['status**'] = array('!=', 'private');
182
-            }
183
-            if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
184
-                $where['EVT_wp_user'] = get_current_user_id();
185
-            }
186
-            $events = EEM_Event::instance()->get_all(
187
-                array(
188
-                    $where,
189
-                    'order_by' => array('Datetime.DTT_EVT_start' => 'DESC'),
190
-                )
191
-            );
192
-            $evts[] = array(
193
-                'id'   => 0,
194
-                'text' => __('To toggle Check-in status, select an event', 'event_espresso'),
195
-            );
196
-            $checked = 'checked';
197
-            /** @var EE_Event $evt */
198
-            foreach ($events as $evt) {
199
-                // any registrations for this event?
200
-                if (! $evt->get_count_of_all_registrations()) {
201
-                    continue;
202
-                }
203
-                $evts[] = array(
204
-                    'id'    => $evt->ID(),
205
-                    'text'  => apply_filters(
206
-                        'FHEE__EE_Event_Registrations___get_table_filters__event_name',
207
-                        $evt->get('EVT_name'),
208
-                        $evt
209
-                    ),
210
-                    'class' => $evt->is_expired() ? 'ee-expired-event' : '',
211
-                );
212
-                if ($evt->ID() === $current_EVT_ID && $evt->is_expired()) {
213
-                    $checked = '';
214
-                }
215
-            }
216
-            $event_filter = '<div class="ee-event-filter">';
217
-            $event_filter .= EEH_Form_Fields::select_input('event_id', $evts, $current_EVT_ID);
218
-            $event_filter .= '<span class="ee-event-filter-toggle">';
219
-            $event_filter .= '<input type="checkbox" id="js-ee-hide-expired-events" ' . $checked . '> ';
220
-            $event_filter .= __('Hide Expired Events', 'event_espresso');
221
-            $event_filter .= '</span>';
222
-            $event_filter .= '</div>';
223
-            $filters[] = $event_filter;
224
-        }
225
-        if (! empty($this->_dtts_for_event)) {
226
-            // DTT datetimes filter
227
-            $this->_cur_dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0;
228
-            if (count($this->_dtts_for_event) > 1) {
229
-                $dtts[0] = __('To toggle check-in status, select a datetime.', 'event_espresso');
230
-                foreach ($this->_dtts_for_event as $dtt) {
231
-                    $datetime_string = $dtt->name();
232
-                    $datetime_string = ! empty($datetime_string) ? ' (' . $datetime_string . ')' : '';
233
-                    $datetime_string = $dtt->start_date_and_time() . ' - ' . $dtt->end_date_and_time() . $datetime_string;
234
-                    $dtts[ $dtt->ID() ] = $datetime_string;
235
-                }
236
-                $input = new EE_Select_Input(
237
-                    $dtts,
238
-                    array(
239
-                        'html_name' => 'DTT_ID',
240
-                        'html_id'   => 'DTT_ID',
241
-                        'default'   => $this->_cur_dtt_id,
242
-                    )
243
-                );
244
-                $filters[] = $input->get_html_for_input();
245
-                $filters[] = '<input type="hidden" name="event_id" value="' . $current_EVT_ID . '">';
246
-            }
247
-        }
248
-        return $filters;
249
-    }
250
-
251
-
252
-    protected function _add_view_counts()
253
-    {
254
-        $this->_views['all']['count'] = $this->_get_total_event_attendees();
255
-    }
256
-
257
-
258
-    /**
259
-     * @return int
260
-     * @throws \EE_Error
261
-     */
262
-    protected function _get_total_event_attendees()
263
-    {
264
-        $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : false;
265
-        $DTT_ID = $this->_cur_dtt_id;
266
-        $query_params = array();
267
-        if ($EVT_ID) {
268
-            $query_params[0]['EVT_ID'] = $EVT_ID;
269
-        }
270
-        // if DTT is included we only show for that datetime.  Otherwise we're showing for all datetimes (the event).
271
-        if ($DTT_ID) {
272
-            $query_params[0]['Ticket.Datetime.DTT_ID'] = $DTT_ID;
273
-        }
274
-        $status_ids_array = apply_filters(
275
-            'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array',
276
-            array(EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved)
277
-        );
278
-        $query_params[0]['STS_ID'] = array('IN', $status_ids_array);
279
-        return EEM_Registration::instance()->count($query_params);
280
-    }
281
-
282
-
283
-    /**
284
-     * @param \EE_Registration $item
285
-     * @return string
286
-     */
287
-    public function column__Reg_Status(EE_Registration $item)
288
-    {
289
-        return '<span class="ee-status-strip ee-status-strip-td reg-status-' . $item->status_ID() . '"></span>';
290
-    }
291
-
292
-
293
-    /**
294
-     * @param \EE_Registration $item
295
-     * @return string
296
-     * @throws \EE_Error
297
-     */
298
-    public function column_cb($item)
299
-    {
300
-        return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', $item->ID());
301
-    }
302
-
303
-
304
-    /**
305
-     * column_REG_att_checked_in
306
-     *
307
-     * @param EE_Registration $item
308
-     * @return string
309
-     * @throws EE_Error
310
-     * @throws InvalidArgumentException
311
-     * @throws InvalidDataTypeException
312
-     * @throws InvalidInterfaceException
313
-     */
314
-    public function column__REG_att_checked_in(EE_Registration $item)
315
-    {
316
-        $attendee = $item->attendee();
317
-        $attendee_name = $attendee instanceof EE_Attendee ? $attendee->full_name() : '';
318
-
319
-        if ($this->_cur_dtt_id === 0 && count($this->_dtts_for_event) === 1) {
320
-            $latest_related_datetime = $item->get_latest_related_datetime();
321
-            if ($latest_related_datetime instanceof EE_Datetime) {
322
-                $this->_cur_dtt_id = $latest_related_datetime->ID();
323
-            }
324
-        }
325
-        $checkin_status_dashicon = CheckinStatusDashicon::fromRegistrationAndDatetimeId(
326
-            $item,
327
-            $this->_cur_dtt_id
328
-        );
329
-        $nonce = wp_create_nonce('checkin_nonce');
330
-        $toggle_active = ! empty($this->_cur_dtt_id)
331
-                         && EE_Registry::instance()->CAP->current_user_can(
332
-                             'ee_edit_checkin',
333
-                             'espresso_registrations_toggle_checkin_status',
334
-                             $item->ID()
335
-                         )
336
-            ? ' clickable trigger-checkin'
337
-            : '';
338
-        $mobile_view_content = ' <span class="show-on-mobile-view-only">' . $attendee_name . '</span>';
339
-        return '<span class="' . $checkin_status_dashicon->cssClasses() . $toggle_active . '"'
340
-               . ' data-_regid="' . $item->ID() . '"'
341
-               . ' data-dttid="' . $this->_cur_dtt_id . '"'
342
-               . ' data-nonce="' . $nonce . '">'
343
-               . '</span>'
344
-               . $mobile_view_content;
345
-    }
346
-
347
-
348
-    /**
349
-     * @param \EE_Registration $item
350
-     * @return mixed|string|void
351
-     * @throws \EE_Error
352
-     */
353
-    public function column_ATT_name(EE_Registration $item)
354
-    {
355
-        $attendee = $item->attendee();
356
-        if (! $attendee instanceof EE_Attendee) {
357
-            return __('No contact record for this registration.', 'event_espresso');
358
-        }
359
-        // edit attendee link
360
-        $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(
361
-            array('action' => 'view_registration', '_REG_ID' => $item->ID()),
362
-            REG_ADMIN_URL
363
-        );
364
-        $name_link = EE_Registry::instance()->CAP->current_user_can(
365
-            'ee_edit_contacts',
366
-            'espresso_registrations_edit_attendee'
367
-        )
368
-            ? '<a href="' . $edit_lnk_url . '" title="' . esc_attr__('View Registration Details', 'event_espresso') . '">'
369
-              . $item->attendee()->full_name()
370
-              . '</a>'
371
-            : $item->attendee()->full_name();
372
-        $name_link .= $item->count() === 1
373
-            ? '&nbsp;<sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup>	'
374
-            : '';
375
-        // add group details
376
-        $name_link .= '&nbsp;' . sprintf(__('(%s of %s)', 'event_espresso'), $item->count(), $item->group_size());
377
-        // add regcode
378
-        $link = EE_Admin_Page::add_query_args_and_nonce(
379
-            array('action' => 'view_registration', '_REG_ID' => $item->ID()),
380
-            REG_ADMIN_URL
381
-        );
382
-        $name_link .= '<br>';
383
-        $name_link .= EE_Registry::instance()->instance()->CAP->current_user_can(
384
-            'ee_read_registration',
385
-            'view_registration',
386
-            $item->ID()
387
-        )
388
-            ? '<a href="' . $link . '" title="' . esc_attr__('View Registration Details', 'event_espresso') . '">'
389
-              . $item->reg_code()
390
-              . '</a>'
391
-            : $item->reg_code();
392
-        // status
393
-        $name_link .= '<br><span class="ee-status-text-small">';
394
-        $name_link .= EEH_Template::pretty_status($item->status_ID(), false, 'sentence');
395
-        $name_link .= '</span>';
396
-        $actions = array();
397
-        $DTT_ID = $this->_cur_dtt_id;
398
-        $latest_related_datetime = empty($DTT_ID) && ! empty($this->_req_data['event_id']) && $item instanceof EE_Registration
399
-            ? $item->get_latest_related_datetime()
400
-            : null;
401
-        $DTT_ID = $latest_related_datetime instanceof EE_Datetime
402
-            ? $latest_related_datetime->ID()
403
-            : $DTT_ID;
404
-        if (! empty($DTT_ID)
405
-            && EE_Registry::instance()->CAP->current_user_can(
406
-                'ee_read_checkins',
407
-                'espresso_registrations_registration_checkins'
408
-            )
409
-        ) {
410
-            $checkin_list_url = EE_Admin_Page::add_query_args_and_nonce(
411
-                array('action' => 'registration_checkins', '_REG_ID' => $item->ID(), 'DTT_ID' => $DTT_ID),
412
-                REG_ADMIN_URL
413
-            );
414
-            // get the timestamps for this registration's checkins, related to the selected datetime
415
-            $timestamps = $item->get_many_related('Checkin', array(array('DTT_ID' => $DTT_ID)));
416
-            if (! empty($timestamps)) {
417
-                // get the last timestamp
418
-                $last_timestamp = end($timestamps);
419
-                // checked in or checked out?
420
-                $checkin_status = $last_timestamp->get('CHK_in')
421
-                    ? esc_html__('Checked In', 'event_espresso')
422
-                    : esc_html__('Checked Out', 'event_espresso');
423
-                // get timestamp string
424
-                $timestamp_string = $last_timestamp->get_datetime('CHK_timestamp');
425
-                $actions['checkin'] = '<a href="' . $checkin_list_url . '" title="'
426
-                                      . esc_attr__(
427
-                                          'View this registrant\'s check-ins/checkouts for the datetime',
428
-                                          'event_espresso'
429
-                                      ) . '">' . $checkin_status . ': ' . $timestamp_string . '</a>';
430
-            }
431
-        }
432
-        return (! empty($DTT_ID) && ! empty($timestamps))
433
-            ? sprintf('%1$s %2$s', $name_link, $this->row_actions($actions, true))
434
-            : $name_link;
435
-    }
436
-
437
-
438
-    /**
439
-     * @param \EE_Registration $item
440
-     * @return string
441
-     */
442
-    public function column_ATT_email(EE_Registration $item)
443
-    {
444
-        $attendee = $item->attendee();
445
-        return $attendee instanceof EE_Attendee ? $attendee->email() : '';
446
-    }
447
-
448
-
449
-    /**
450
-     * @param \EE_Registration $item
451
-     * @return bool|string
452
-     * @throws \EE_Error
453
-     */
454
-    public function column_Event(EE_Registration $item)
455
-    {
456
-        try {
457
-            $event = $this->_evt instanceof EE_Event ? $this->_evt : $item->event();
458
-            $chkin_lnk_url = EE_Admin_Page::add_query_args_and_nonce(
459
-                array('action' => 'event_registrations', 'event_id' => $event->ID()),
460
-                REG_ADMIN_URL
461
-            );
462
-            $event_label = EE_Registry::instance()->CAP->current_user_can(
463
-                'ee_read_checkins',
464
-                'espresso_registrations_registration_checkins'
465
-            ) ? '<a href="' . $chkin_lnk_url . '" title="'
466
-                . esc_attr__(
467
-                    'View Checkins for this Event',
468
-                    'event_espresso'
469
-                ) . '">' . $event->name() . '</a>' : $event->name();
470
-        } catch (\EventEspresso\core\exceptions\EntityNotFoundException $e) {
471
-            $event_label = esc_html__('Unknown', 'event_espresso');
472
-        }
473
-        return $event_label;
474
-    }
475
-
476
-
477
-    /**
478
-     * @param \EE_Registration $item
479
-     * @return mixed|string|void
480
-     */
481
-    public function column_PRC_name(EE_Registration $item)
482
-    {
483
-        return $item->ticket() instanceof EE_Ticket ? $item->ticket()->name() : __("Unknown", "event_espresso");
484
-    }
485
-
486
-
487
-    /**
488
-     * column_REG_final_price
489
-     *
490
-     * @param \EE_Registration $item
491
-     * @return string
492
-     */
493
-    public function column__REG_final_price(EE_Registration $item)
494
-    {
495
-        return '<span class="reg-pad-rght">' . ' ' . $item->pretty_final_price() . '</span>';
496
-    }
497
-
498
-
499
-    /**
500
-     * column_TXN_paid
501
-     *
502
-     * @param \EE_Registration $item
503
-     * @return string
504
-     * @throws \EE_Error
505
-     */
506
-    public function column_TXN_paid(EE_Registration $item)
507
-    {
508
-        if ($item->count() === 1) {
509
-            if ($item->transaction()->paid() >= $item->transaction()->total()) {
510
-                return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>';
511
-            } else {
512
-                $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(
513
-                    array('action' => 'view_transaction', 'TXN_ID' => $item->transaction_ID()),
514
-                    TXN_ADMIN_URL
515
-                );
516
-                return EE_Registry::instance()->CAP->current_user_can(
517
-                    'ee_read_transaction',
518
-                    'espresso_transactions_view_transaction'
519
-                ) ? '
15
+	/**
16
+	 * This property will hold the related Datetimes on an event IF the event id is included in the request.
17
+	 *
18
+	 * @var EE_Datetime[]
19
+	 */
20
+	protected $_dtts_for_event = array();
21
+
22
+
23
+	/**
24
+	 * The event if one is specified in the request
25
+	 *
26
+	 * @var EE_Event
27
+	 */
28
+	protected $_evt = null;
29
+
30
+
31
+	/**
32
+	 * The DTT_ID if the current view has a specified datetime.
33
+	 *
34
+	 * @var int $_cur_dtt_id
35
+	 */
36
+	protected $_cur_dtt_id = 0;
37
+
38
+
39
+	/**
40
+	 * EE_Event_Registrations_List_Table constructor.
41
+	 *
42
+	 * @param \Registrations_Admin_Page $admin_page
43
+	 */
44
+	public function __construct($admin_page)
45
+	{
46
+		parent::__construct($admin_page);
47
+		$this->_status = $this->_admin_page->get_registration_status_array();
48
+	}
49
+
50
+
51
+	protected function _setup_data()
52
+	{
53
+		$this->_data = $this->_view !== 'trash' ? $this->_admin_page->get_event_attendees($this->_per_page)
54
+			: $this->_admin_page->get_event_attendees($this->_per_page, false, true);
55
+		$this->_all_data_count = $this->_view !== 'trash' ? $this->_admin_page->get_event_attendees(
56
+			$this->_per_page,
57
+			true
58
+		) : $this->_admin_page->get_event_attendees($this->_per_page, true, true);
59
+	}
60
+
61
+
62
+	protected function _set_properties()
63
+	{
64
+		$evt_id = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null;
65
+		$this->_wp_list_args = array(
66
+			'singular' => __('registrant', 'event_espresso'),
67
+			'plural'   => __('registrants', 'event_espresso'),
68
+			'ajax'     => true,
69
+			'screen'   => $this->_admin_page->get_current_screen()->id,
70
+		);
71
+		$columns = array();
72
+		// $columns['_Reg_Status'] = '';
73
+		if (! empty($evt_id)) {
74
+			$columns['cb'] = '<input type="checkbox" />'; // Render a checkbox instead of text
75
+			$this->_has_checkbox_column = true;
76
+		}
77
+		$this->_columns = array(
78
+			'_REG_att_checked_in' => '<span class="dashicons dashicons-yes ee-icon-size-18"></span>',
79
+			'ATT_name'            => __('Registrant', 'event_espresso'),
80
+			'ATT_email'           => __('Email Address', 'event_espresso'),
81
+			'Event'               => __('Event', 'event_espresso'),
82
+			'PRC_name'            => __('TKT Option', 'event_espresso'),
83
+			'_REG_final_price'    => __('Price', 'event_espresso'),
84
+			'TXN_paid'            => __('Paid', 'event_espresso'),
85
+			'TXN_total'           => __('Total', 'event_espresso'),
86
+		);
87
+		$this->_columns = array_merge($columns, $this->_columns);
88
+		$this->_primary_column = '_REG_att_checked_in';
89
+		if (! empty($evt_id)
90
+			&& EE_Registry::instance()->CAP->current_user_can(
91
+				'ee_read_registrations',
92
+				'espresso_registrations_registrations_reports',
93
+				$evt_id
94
+			)
95
+		) {
96
+			$this->_bottom_buttons = array(
97
+				'report' => array(
98
+					'route'         => 'registrations_report',
99
+					'extra_request' =>
100
+						array(
101
+							'EVT_ID'     => $evt_id,
102
+							'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"),
103
+						),
104
+				),
105
+			);
106
+		}
107
+		$this->_bottom_buttons['report_filtered'] = array(
108
+			'route'         => 'registrations_checkin_report',
109
+			'extra_request' => array(
110
+				'use_filters' => true,
111
+				'filters'     => array_merge(
112
+					array(
113
+						'EVT_ID' => $evt_id,
114
+					),
115
+					array_diff_key(
116
+						$this->_req_data,
117
+						array_flip(
118
+							array(
119
+								'page',
120
+								'action',
121
+								'default_nonce',
122
+							)
123
+						)
124
+					)
125
+				),
126
+				'return_url'  => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"),
127
+			),
128
+		);
129
+		$this->_sortable_columns = array(
130
+			/**
131
+			 * Allows users to change the default sort if they wish.
132
+			 * Returning a falsey on this filter will result in the default sort to be by firstname rather than last name.
133
+			 *
134
+			 * Note: usual naming conventions for filters aren't followed here so that just one filter can be used to
135
+			 * change the sorts on any list table involving registration contacts.  If you want to only change the filter
136
+			 * for a specific list table you can use the provided reference to this object instance.
137
+			 */
138
+			'ATT_name' => array(
139
+				'FHEE__EE_Registrations_List_Table___set_properties__default_sort_by_registration_last_name',
140
+				true,
141
+				$this,
142
+			)
143
+				? array('ATT_lname' => true)
144
+				: array('ATT_fname' => true),
145
+			'Event'    => array('Event.EVT_name' => false),
146
+		);
147
+		$this->_hidden_columns = array();
148
+		$this->_evt = EEM_Event::instance()->get_one_by_ID($evt_id);
149
+		$this->_dtts_for_event = $this->_evt instanceof EE_Event ? $this->_evt->datetimes_ordered() : array();
150
+	}
151
+
152
+
153
+	/**
154
+	 * @param \EE_Registration $item
155
+	 * @return string
156
+	 */
157
+	protected function _get_row_class($item)
158
+	{
159
+		$class = parent::_get_row_class($item);
160
+		// add status class
161
+		$class .= ' ee-status-strip reg-status-' . $item->status_ID();
162
+		if ($this->_has_checkbox_column) {
163
+			$class .= ' has-checkbox-column';
164
+		}
165
+		return $class;
166
+	}
167
+
168
+
169
+	/**
170
+	 * @return array
171
+	 * @throws \EE_Error
172
+	 */
173
+	protected function _get_table_filters()
174
+	{
175
+		$filters = $where = array();
176
+		$current_EVT_ID = isset($this->_req_data['event_id']) ? (int) $this->_req_data['event_id'] : 0;
177
+		if (empty($this->_dtts_for_event) || count($this->_dtts_for_event) === 1) {
178
+			// this means we don't have an event so let's setup a filter dropdown for all the events to select
179
+			// note possible capability restrictions
180
+			if (! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) {
181
+				$where['status**'] = array('!=', 'private');
182
+			}
183
+			if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
184
+				$where['EVT_wp_user'] = get_current_user_id();
185
+			}
186
+			$events = EEM_Event::instance()->get_all(
187
+				array(
188
+					$where,
189
+					'order_by' => array('Datetime.DTT_EVT_start' => 'DESC'),
190
+				)
191
+			);
192
+			$evts[] = array(
193
+				'id'   => 0,
194
+				'text' => __('To toggle Check-in status, select an event', 'event_espresso'),
195
+			);
196
+			$checked = 'checked';
197
+			/** @var EE_Event $evt */
198
+			foreach ($events as $evt) {
199
+				// any registrations for this event?
200
+				if (! $evt->get_count_of_all_registrations()) {
201
+					continue;
202
+				}
203
+				$evts[] = array(
204
+					'id'    => $evt->ID(),
205
+					'text'  => apply_filters(
206
+						'FHEE__EE_Event_Registrations___get_table_filters__event_name',
207
+						$evt->get('EVT_name'),
208
+						$evt
209
+					),
210
+					'class' => $evt->is_expired() ? 'ee-expired-event' : '',
211
+				);
212
+				if ($evt->ID() === $current_EVT_ID && $evt->is_expired()) {
213
+					$checked = '';
214
+				}
215
+			}
216
+			$event_filter = '<div class="ee-event-filter">';
217
+			$event_filter .= EEH_Form_Fields::select_input('event_id', $evts, $current_EVT_ID);
218
+			$event_filter .= '<span class="ee-event-filter-toggle">';
219
+			$event_filter .= '<input type="checkbox" id="js-ee-hide-expired-events" ' . $checked . '> ';
220
+			$event_filter .= __('Hide Expired Events', 'event_espresso');
221
+			$event_filter .= '</span>';
222
+			$event_filter .= '</div>';
223
+			$filters[] = $event_filter;
224
+		}
225
+		if (! empty($this->_dtts_for_event)) {
226
+			// DTT datetimes filter
227
+			$this->_cur_dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0;
228
+			if (count($this->_dtts_for_event) > 1) {
229
+				$dtts[0] = __('To toggle check-in status, select a datetime.', 'event_espresso');
230
+				foreach ($this->_dtts_for_event as $dtt) {
231
+					$datetime_string = $dtt->name();
232
+					$datetime_string = ! empty($datetime_string) ? ' (' . $datetime_string . ')' : '';
233
+					$datetime_string = $dtt->start_date_and_time() . ' - ' . $dtt->end_date_and_time() . $datetime_string;
234
+					$dtts[ $dtt->ID() ] = $datetime_string;
235
+				}
236
+				$input = new EE_Select_Input(
237
+					$dtts,
238
+					array(
239
+						'html_name' => 'DTT_ID',
240
+						'html_id'   => 'DTT_ID',
241
+						'default'   => $this->_cur_dtt_id,
242
+					)
243
+				);
244
+				$filters[] = $input->get_html_for_input();
245
+				$filters[] = '<input type="hidden" name="event_id" value="' . $current_EVT_ID . '">';
246
+			}
247
+		}
248
+		return $filters;
249
+	}
250
+
251
+
252
+	protected function _add_view_counts()
253
+	{
254
+		$this->_views['all']['count'] = $this->_get_total_event_attendees();
255
+	}
256
+
257
+
258
+	/**
259
+	 * @return int
260
+	 * @throws \EE_Error
261
+	 */
262
+	protected function _get_total_event_attendees()
263
+	{
264
+		$EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : false;
265
+		$DTT_ID = $this->_cur_dtt_id;
266
+		$query_params = array();
267
+		if ($EVT_ID) {
268
+			$query_params[0]['EVT_ID'] = $EVT_ID;
269
+		}
270
+		// if DTT is included we only show for that datetime.  Otherwise we're showing for all datetimes (the event).
271
+		if ($DTT_ID) {
272
+			$query_params[0]['Ticket.Datetime.DTT_ID'] = $DTT_ID;
273
+		}
274
+		$status_ids_array = apply_filters(
275
+			'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array',
276
+			array(EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved)
277
+		);
278
+		$query_params[0]['STS_ID'] = array('IN', $status_ids_array);
279
+		return EEM_Registration::instance()->count($query_params);
280
+	}
281
+
282
+
283
+	/**
284
+	 * @param \EE_Registration $item
285
+	 * @return string
286
+	 */
287
+	public function column__Reg_Status(EE_Registration $item)
288
+	{
289
+		return '<span class="ee-status-strip ee-status-strip-td reg-status-' . $item->status_ID() . '"></span>';
290
+	}
291
+
292
+
293
+	/**
294
+	 * @param \EE_Registration $item
295
+	 * @return string
296
+	 * @throws \EE_Error
297
+	 */
298
+	public function column_cb($item)
299
+	{
300
+		return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', $item->ID());
301
+	}
302
+
303
+
304
+	/**
305
+	 * column_REG_att_checked_in
306
+	 *
307
+	 * @param EE_Registration $item
308
+	 * @return string
309
+	 * @throws EE_Error
310
+	 * @throws InvalidArgumentException
311
+	 * @throws InvalidDataTypeException
312
+	 * @throws InvalidInterfaceException
313
+	 */
314
+	public function column__REG_att_checked_in(EE_Registration $item)
315
+	{
316
+		$attendee = $item->attendee();
317
+		$attendee_name = $attendee instanceof EE_Attendee ? $attendee->full_name() : '';
318
+
319
+		if ($this->_cur_dtt_id === 0 && count($this->_dtts_for_event) === 1) {
320
+			$latest_related_datetime = $item->get_latest_related_datetime();
321
+			if ($latest_related_datetime instanceof EE_Datetime) {
322
+				$this->_cur_dtt_id = $latest_related_datetime->ID();
323
+			}
324
+		}
325
+		$checkin_status_dashicon = CheckinStatusDashicon::fromRegistrationAndDatetimeId(
326
+			$item,
327
+			$this->_cur_dtt_id
328
+		);
329
+		$nonce = wp_create_nonce('checkin_nonce');
330
+		$toggle_active = ! empty($this->_cur_dtt_id)
331
+						 && EE_Registry::instance()->CAP->current_user_can(
332
+							 'ee_edit_checkin',
333
+							 'espresso_registrations_toggle_checkin_status',
334
+							 $item->ID()
335
+						 )
336
+			? ' clickable trigger-checkin'
337
+			: '';
338
+		$mobile_view_content = ' <span class="show-on-mobile-view-only">' . $attendee_name . '</span>';
339
+		return '<span class="' . $checkin_status_dashicon->cssClasses() . $toggle_active . '"'
340
+			   . ' data-_regid="' . $item->ID() . '"'
341
+			   . ' data-dttid="' . $this->_cur_dtt_id . '"'
342
+			   . ' data-nonce="' . $nonce . '">'
343
+			   . '</span>'
344
+			   . $mobile_view_content;
345
+	}
346
+
347
+
348
+	/**
349
+	 * @param \EE_Registration $item
350
+	 * @return mixed|string|void
351
+	 * @throws \EE_Error
352
+	 */
353
+	public function column_ATT_name(EE_Registration $item)
354
+	{
355
+		$attendee = $item->attendee();
356
+		if (! $attendee instanceof EE_Attendee) {
357
+			return __('No contact record for this registration.', 'event_espresso');
358
+		}
359
+		// edit attendee link
360
+		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(
361
+			array('action' => 'view_registration', '_REG_ID' => $item->ID()),
362
+			REG_ADMIN_URL
363
+		);
364
+		$name_link = EE_Registry::instance()->CAP->current_user_can(
365
+			'ee_edit_contacts',
366
+			'espresso_registrations_edit_attendee'
367
+		)
368
+			? '<a href="' . $edit_lnk_url . '" title="' . esc_attr__('View Registration Details', 'event_espresso') . '">'
369
+			  . $item->attendee()->full_name()
370
+			  . '</a>'
371
+			: $item->attendee()->full_name();
372
+		$name_link .= $item->count() === 1
373
+			? '&nbsp;<sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup>	'
374
+			: '';
375
+		// add group details
376
+		$name_link .= '&nbsp;' . sprintf(__('(%s of %s)', 'event_espresso'), $item->count(), $item->group_size());
377
+		// add regcode
378
+		$link = EE_Admin_Page::add_query_args_and_nonce(
379
+			array('action' => 'view_registration', '_REG_ID' => $item->ID()),
380
+			REG_ADMIN_URL
381
+		);
382
+		$name_link .= '<br>';
383
+		$name_link .= EE_Registry::instance()->instance()->CAP->current_user_can(
384
+			'ee_read_registration',
385
+			'view_registration',
386
+			$item->ID()
387
+		)
388
+			? '<a href="' . $link . '" title="' . esc_attr__('View Registration Details', 'event_espresso') . '">'
389
+			  . $item->reg_code()
390
+			  . '</a>'
391
+			: $item->reg_code();
392
+		// status
393
+		$name_link .= '<br><span class="ee-status-text-small">';
394
+		$name_link .= EEH_Template::pretty_status($item->status_ID(), false, 'sentence');
395
+		$name_link .= '</span>';
396
+		$actions = array();
397
+		$DTT_ID = $this->_cur_dtt_id;
398
+		$latest_related_datetime = empty($DTT_ID) && ! empty($this->_req_data['event_id']) && $item instanceof EE_Registration
399
+			? $item->get_latest_related_datetime()
400
+			: null;
401
+		$DTT_ID = $latest_related_datetime instanceof EE_Datetime
402
+			? $latest_related_datetime->ID()
403
+			: $DTT_ID;
404
+		if (! empty($DTT_ID)
405
+			&& EE_Registry::instance()->CAP->current_user_can(
406
+				'ee_read_checkins',
407
+				'espresso_registrations_registration_checkins'
408
+			)
409
+		) {
410
+			$checkin_list_url = EE_Admin_Page::add_query_args_and_nonce(
411
+				array('action' => 'registration_checkins', '_REG_ID' => $item->ID(), 'DTT_ID' => $DTT_ID),
412
+				REG_ADMIN_URL
413
+			);
414
+			// get the timestamps for this registration's checkins, related to the selected datetime
415
+			$timestamps = $item->get_many_related('Checkin', array(array('DTT_ID' => $DTT_ID)));
416
+			if (! empty($timestamps)) {
417
+				// get the last timestamp
418
+				$last_timestamp = end($timestamps);
419
+				// checked in or checked out?
420
+				$checkin_status = $last_timestamp->get('CHK_in')
421
+					? esc_html__('Checked In', 'event_espresso')
422
+					: esc_html__('Checked Out', 'event_espresso');
423
+				// get timestamp string
424
+				$timestamp_string = $last_timestamp->get_datetime('CHK_timestamp');
425
+				$actions['checkin'] = '<a href="' . $checkin_list_url . '" title="'
426
+									  . esc_attr__(
427
+										  'View this registrant\'s check-ins/checkouts for the datetime',
428
+										  'event_espresso'
429
+									  ) . '">' . $checkin_status . ': ' . $timestamp_string . '</a>';
430
+			}
431
+		}
432
+		return (! empty($DTT_ID) && ! empty($timestamps))
433
+			? sprintf('%1$s %2$s', $name_link, $this->row_actions($actions, true))
434
+			: $name_link;
435
+	}
436
+
437
+
438
+	/**
439
+	 * @param \EE_Registration $item
440
+	 * @return string
441
+	 */
442
+	public function column_ATT_email(EE_Registration $item)
443
+	{
444
+		$attendee = $item->attendee();
445
+		return $attendee instanceof EE_Attendee ? $attendee->email() : '';
446
+	}
447
+
448
+
449
+	/**
450
+	 * @param \EE_Registration $item
451
+	 * @return bool|string
452
+	 * @throws \EE_Error
453
+	 */
454
+	public function column_Event(EE_Registration $item)
455
+	{
456
+		try {
457
+			$event = $this->_evt instanceof EE_Event ? $this->_evt : $item->event();
458
+			$chkin_lnk_url = EE_Admin_Page::add_query_args_and_nonce(
459
+				array('action' => 'event_registrations', 'event_id' => $event->ID()),
460
+				REG_ADMIN_URL
461
+			);
462
+			$event_label = EE_Registry::instance()->CAP->current_user_can(
463
+				'ee_read_checkins',
464
+				'espresso_registrations_registration_checkins'
465
+			) ? '<a href="' . $chkin_lnk_url . '" title="'
466
+				. esc_attr__(
467
+					'View Checkins for this Event',
468
+					'event_espresso'
469
+				) . '">' . $event->name() . '</a>' : $event->name();
470
+		} catch (\EventEspresso\core\exceptions\EntityNotFoundException $e) {
471
+			$event_label = esc_html__('Unknown', 'event_espresso');
472
+		}
473
+		return $event_label;
474
+	}
475
+
476
+
477
+	/**
478
+	 * @param \EE_Registration $item
479
+	 * @return mixed|string|void
480
+	 */
481
+	public function column_PRC_name(EE_Registration $item)
482
+	{
483
+		return $item->ticket() instanceof EE_Ticket ? $item->ticket()->name() : __("Unknown", "event_espresso");
484
+	}
485
+
486
+
487
+	/**
488
+	 * column_REG_final_price
489
+	 *
490
+	 * @param \EE_Registration $item
491
+	 * @return string
492
+	 */
493
+	public function column__REG_final_price(EE_Registration $item)
494
+	{
495
+		return '<span class="reg-pad-rght">' . ' ' . $item->pretty_final_price() . '</span>';
496
+	}
497
+
498
+
499
+	/**
500
+	 * column_TXN_paid
501
+	 *
502
+	 * @param \EE_Registration $item
503
+	 * @return string
504
+	 * @throws \EE_Error
505
+	 */
506
+	public function column_TXN_paid(EE_Registration $item)
507
+	{
508
+		if ($item->count() === 1) {
509
+			if ($item->transaction()->paid() >= $item->transaction()->total()) {
510
+				return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>';
511
+			} else {
512
+				$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(
513
+					array('action' => 'view_transaction', 'TXN_ID' => $item->transaction_ID()),
514
+					TXN_ADMIN_URL
515
+				);
516
+				return EE_Registry::instance()->CAP->current_user_can(
517
+					'ee_read_transaction',
518
+					'espresso_transactions_view_transaction'
519
+				) ? '
520 520
 				<span class="reg-pad-rght">
521 521
 					<a class="status-'
522
-                    . $item->transaction()->status_ID()
523
-                    . '" href="'
524
-                    . $view_txn_lnk_url
525
-                    . '"  title="'
526
-                    . esc_attr__('View Transaction', 'event_espresso')
527
-                    . '">
522
+					. $item->transaction()->status_ID()
523
+					. '" href="'
524
+					. $view_txn_lnk_url
525
+					. '"  title="'
526
+					. esc_attr__('View Transaction', 'event_espresso')
527
+					. '">
528 528
 						'
529
-                    . $item->transaction()->pretty_paid()
530
-                    . '
529
+					. $item->transaction()->pretty_paid()
530
+					. '
531 531
 					</a>
532 532
 				<span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>';
533
-            }
534
-        } else {
535
-            return '<span class="reg-pad-rght"></span>';
536
-        }
537
-    }
538
-
539
-
540
-    /**
541
-     *        column_TXN_total
542
-     *
543
-     * @param \EE_Registration $item
544
-     * @return string
545
-     * @throws \EE_Error
546
-     */
547
-    public function column_TXN_total(EE_Registration $item)
548
-    {
549
-        $txn = $item->transaction();
550
-        $view_txn_url = add_query_arg(array('action' => 'view_transaction', 'TXN_ID' => $txn->ID()), TXN_ADMIN_URL);
551
-        if ($item->get('REG_count') === 1) {
552
-            $line_total_obj = $txn->total_line_item();
553
-            $txn_total = $line_total_obj instanceof EE_Line_Item
554
-                ? $line_total_obj->get_pretty('LIN_total')
555
-                : __(
556
-                    'View Transaction',
557
-                    'event_espresso'
558
-                );
559
-            return EE_Registry::instance()->CAP->current_user_can(
560
-                'ee_read_transaction',
561
-                'espresso_transactions_view_transaction'
562
-            ) ? '<a href="'
563
-                . $view_txn_url
564
-                . '" title="'
565
-                . esc_attr__('View Transaction', 'event_espresso')
566
-                . '"><span class="reg-pad-rght">'
567
-                . $txn_total
568
-                . '</span></a>' : '<span class="reg-pad-rght">' . $txn_total . '</span>';
569
-        } else {
570
-            return '<span class="reg-pad-rght"></span>';
571
-        }
572
-    }
533
+			}
534
+		} else {
535
+			return '<span class="reg-pad-rght"></span>';
536
+		}
537
+	}
538
+
539
+
540
+	/**
541
+	 *        column_TXN_total
542
+	 *
543
+	 * @param \EE_Registration $item
544
+	 * @return string
545
+	 * @throws \EE_Error
546
+	 */
547
+	public function column_TXN_total(EE_Registration $item)
548
+	{
549
+		$txn = $item->transaction();
550
+		$view_txn_url = add_query_arg(array('action' => 'view_transaction', 'TXN_ID' => $txn->ID()), TXN_ADMIN_URL);
551
+		if ($item->get('REG_count') === 1) {
552
+			$line_total_obj = $txn->total_line_item();
553
+			$txn_total = $line_total_obj instanceof EE_Line_Item
554
+				? $line_total_obj->get_pretty('LIN_total')
555
+				: __(
556
+					'View Transaction',
557
+					'event_espresso'
558
+				);
559
+			return EE_Registry::instance()->CAP->current_user_can(
560
+				'ee_read_transaction',
561
+				'espresso_transactions_view_transaction'
562
+			) ? '<a href="'
563
+				. $view_txn_url
564
+				. '" title="'
565
+				. esc_attr__('View Transaction', 'event_espresso')
566
+				. '"><span class="reg-pad-rght">'
567
+				. $txn_total
568
+				. '</span></a>' : '<span class="reg-pad-rght">' . $txn_total . '</span>';
569
+		} else {
570
+			return '<span class="reg-pad-rght"></span>';
571
+		}
572
+	}
573 573
 }
Please login to merge, or discard this patch.