@@ -14,69 +14,69 @@ |
||
14 | 14 | */ |
15 | 15 | class RegistrationsCsvReportParams |
16 | 16 | { |
17 | - /** |
|
18 | - * @param string $return_url |
|
19 | - * @param array $request_params |
|
20 | - * @param int $EVT_ID |
|
21 | - * @param int $DTT_ID |
|
22 | - * @return array |
|
23 | - */ |
|
24 | - public static function getRequestParams( |
|
25 | - string $return_url, |
|
26 | - array $request_params = [], |
|
27 | - int $EVT_ID = 0, |
|
28 | - int $DTT_ID = 0 |
|
29 | - ): array { |
|
30 | - if ( |
|
31 | - ! EE_Capabilities::instance()->current_user_can( |
|
32 | - 'ee_read_registrations', |
|
33 | - 'espresso_registrations_registrations_reports', |
|
34 | - $EVT_ID |
|
35 | - ) |
|
36 | - ) { |
|
37 | - return []; |
|
38 | - } |
|
39 | - add_action( |
|
40 | - 'AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', |
|
41 | - [RegistrationsCsvReportParams::class, 'csvReportNotice'] |
|
42 | - ); |
|
17 | + /** |
|
18 | + * @param string $return_url |
|
19 | + * @param array $request_params |
|
20 | + * @param int $EVT_ID |
|
21 | + * @param int $DTT_ID |
|
22 | + * @return array |
|
23 | + */ |
|
24 | + public static function getRequestParams( |
|
25 | + string $return_url, |
|
26 | + array $request_params = [], |
|
27 | + int $EVT_ID = 0, |
|
28 | + int $DTT_ID = 0 |
|
29 | + ): array { |
|
30 | + if ( |
|
31 | + ! EE_Capabilities::instance()->current_user_can( |
|
32 | + 'ee_read_registrations', |
|
33 | + 'espresso_registrations_registrations_reports', |
|
34 | + $EVT_ID |
|
35 | + ) |
|
36 | + ) { |
|
37 | + return []; |
|
38 | + } |
|
39 | + add_action( |
|
40 | + 'AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', |
|
41 | + [RegistrationsCsvReportParams::class, 'csvReportNotice'] |
|
42 | + ); |
|
43 | 43 | |
44 | - $route_details = [ |
|
45 | - 'route' => 'registrations_report', |
|
46 | - 'extra_request' => [ 'return_url' => $return_url ], |
|
47 | - ]; |
|
48 | - if (! empty($EVT_ID)) { |
|
49 | - $route_details['extra_request']['EVT_ID'] = $EVT_ID; |
|
50 | - } |
|
51 | - if ($DTT_ID) { |
|
52 | - $route_details['extra_request']['DTT_ID'] = $DTT_ID; |
|
53 | - } |
|
54 | - if ( |
|
55 | - isset($request_params['month_range']) |
|
56 | - || isset($request_params['EVT_CAT']) |
|
57 | - || isset($request_params['_reg_status']) |
|
58 | - ) { |
|
59 | - $route_details['extra_request']['filters'] = array_diff_key( |
|
60 | - $request_params, |
|
61 | - [ |
|
62 | - 'page' => '', |
|
63 | - 'action' => '', |
|
64 | - 'default_nonce' => '', |
|
65 | - ] |
|
66 | - ); |
|
67 | - } |
|
68 | - return $route_details; |
|
69 | - } |
|
44 | + $route_details = [ |
|
45 | + 'route' => 'registrations_report', |
|
46 | + 'extra_request' => [ 'return_url' => $return_url ], |
|
47 | + ]; |
|
48 | + if (! empty($EVT_ID)) { |
|
49 | + $route_details['extra_request']['EVT_ID'] = $EVT_ID; |
|
50 | + } |
|
51 | + if ($DTT_ID) { |
|
52 | + $route_details['extra_request']['DTT_ID'] = $DTT_ID; |
|
53 | + } |
|
54 | + if ( |
|
55 | + isset($request_params['month_range']) |
|
56 | + || isset($request_params['EVT_CAT']) |
|
57 | + || isset($request_params['_reg_status']) |
|
58 | + ) { |
|
59 | + $route_details['extra_request']['filters'] = array_diff_key( |
|
60 | + $request_params, |
|
61 | + [ |
|
62 | + 'page' => '', |
|
63 | + 'action' => '', |
|
64 | + 'default_nonce' => '', |
|
65 | + ] |
|
66 | + ); |
|
67 | + } |
|
68 | + return $route_details; |
|
69 | + } |
|
70 | 70 | |
71 | 71 | |
72 | - public static function csvReportNotice() |
|
73 | - { |
|
74 | - echo ' |
|
72 | + public static function csvReportNotice() |
|
73 | + { |
|
74 | + echo ' |
|
75 | 75 | <span class="csv-report-notice__wrapper"> |
76 | 76 | <span class="dashicons dashicons-info"></span> |
77 | 77 | <span class="csv-report-notice__text"> |
78 | 78 | ' . esc_html('All Registration CSV Reports are now triggered by the preceding button') . ' |
79 | 79 | </span> |
80 | 80 | </span>'; |
81 | - } |
|
81 | + } |
|
82 | 82 | } |