@@ -22,60 +22,60 @@ |
||
22 | 22 | <tr> |
23 | 23 | <td class="jst-left"> |
24 | 24 | <?php |
25 | - $EVT_ID = absint($registration->event_ID()); |
|
26 | - $event_url = add_query_arg( |
|
27 | - ['action' => 'edit', 'post' => $EVT_ID], |
|
28 | - admin_url('admin.php?page=espresso_events') |
|
29 | - ); |
|
30 | - echo EE_Registry::instance()->CAP->current_user_can( |
|
31 | - 'ee_edit_event', |
|
32 | - 'espresso_events_edit', |
|
33 | - $EVT_ID |
|
34 | - ) |
|
35 | - ? '<a href="' . esc_url_raw($event_url) . '" aria-label="' |
|
36 | - . esc_attr__('Edit Event', 'event_espresso') . '">' |
|
37 | - . esc_html($registration->event_name()) . '</a>' |
|
38 | - : esc_html($registration->event_name()); |
|
39 | - ?> |
|
25 | + $EVT_ID = absint($registration->event_ID()); |
|
26 | + $event_url = add_query_arg( |
|
27 | + ['action' => 'edit', 'post' => $EVT_ID], |
|
28 | + admin_url('admin.php?page=espresso_events') |
|
29 | + ); |
|
30 | + echo EE_Registry::instance()->CAP->current_user_can( |
|
31 | + 'ee_edit_event', |
|
32 | + 'espresso_events_edit', |
|
33 | + $EVT_ID |
|
34 | + ) |
|
35 | + ? '<a href="' . esc_url_raw($event_url) . '" aria-label="' |
|
36 | + . esc_attr__('Edit Event', 'event_espresso') . '">' |
|
37 | + . esc_html($registration->event_name()) . '</a>' |
|
38 | + : esc_html($registration->event_name()); |
|
39 | + ?> |
|
40 | 40 | </td> |
41 | 41 | <td class="jst-left"> |
42 | 42 | <?php |
43 | - $REG_ID = absint($registration->ID()); |
|
44 | - $reg_url = EE_Admin_Page::add_query_args_and_nonce( |
|
45 | - ['action' => 'view_registration', '_REG_ID' => $REG_ID], |
|
46 | - REG_ADMIN_URL |
|
47 | - ); |
|
48 | - echo EE_Registry::instance()->CAP->current_user_can( |
|
49 | - 'ee_read_registration', |
|
50 | - 'espresso_registrations_view_registration', |
|
51 | - $REG_ID |
|
52 | - ) |
|
53 | - ? '<a href="' . esc_url_raw($reg_url) . '" aria-label="' |
|
54 | - . esc_attr__('View Registration Details', 'event_espresso') . '">' |
|
55 | - . esc_html__('View Registration', 'event_espresso') . '</a>' |
|
56 | - : $REG_ID; |
|
57 | - ?> |
|
43 | + $REG_ID = absint($registration->ID()); |
|
44 | + $reg_url = EE_Admin_Page::add_query_args_and_nonce( |
|
45 | + ['action' => 'view_registration', '_REG_ID' => $REG_ID], |
|
46 | + REG_ADMIN_URL |
|
47 | + ); |
|
48 | + echo EE_Registry::instance()->CAP->current_user_can( |
|
49 | + 'ee_read_registration', |
|
50 | + 'espresso_registrations_view_registration', |
|
51 | + $REG_ID |
|
52 | + ) |
|
53 | + ? '<a href="' . esc_url_raw($reg_url) . '" aria-label="' |
|
54 | + . esc_attr__('View Registration Details', 'event_espresso') . '">' |
|
55 | + . esc_html__('View Registration', 'event_espresso') . '</a>' |
|
56 | + : $REG_ID; |
|
57 | + ?> |
|
58 | 58 | </td> |
59 | 59 | <td class="jst-left"> |
60 | 60 | <?php |
61 | - $TXN_ID = absint($registration->transaction_ID()); |
|
62 | - $txn_url = EE_Admin_Page::add_query_args_and_nonce( |
|
63 | - ['action' => 'view_transaction', 'TXN_ID' => $TXN_ID], |
|
64 | - TXN_ADMIN_URL |
|
65 | - ); |
|
66 | - echo EE_Registry::instance()->CAP->current_user_can( |
|
67 | - 'ee_read_transaction', |
|
68 | - 'espresso_transactions_view_transaction' |
|
69 | - ) |
|
70 | - ? '<a href="' . esc_url_raw($txn_url) . '" aria-label="' |
|
71 | - . esc_attr__('View Transaction Details', 'event_espresso') . '">' |
|
72 | - . sprintf( |
|
73 | - esc_html__('View Transaction %d', 'event_espresso'), |
|
74 | - $TXN_ID |
|
75 | - ) . |
|
76 | - '</a>' |
|
77 | - : $TXN_ID; |
|
78 | - ?> |
|
61 | + $TXN_ID = absint($registration->transaction_ID()); |
|
62 | + $txn_url = EE_Admin_Page::add_query_args_and_nonce( |
|
63 | + ['action' => 'view_transaction', 'TXN_ID' => $TXN_ID], |
|
64 | + TXN_ADMIN_URL |
|
65 | + ); |
|
66 | + echo EE_Registry::instance()->CAP->current_user_can( |
|
67 | + 'ee_read_transaction', |
|
68 | + 'espresso_transactions_view_transaction' |
|
69 | + ) |
|
70 | + ? '<a href="' . esc_url_raw($txn_url) . '" aria-label="' |
|
71 | + . esc_attr__('View Transaction Details', 'event_espresso') . '">' |
|
72 | + . sprintf( |
|
73 | + esc_html__('View Transaction %d', 'event_espresso'), |
|
74 | + $TXN_ID |
|
75 | + ) . |
|
76 | + '</a>' |
|
77 | + : $TXN_ID; |
|
78 | + ?> |
|
79 | 79 | </td> |
80 | 80 | <td class="jst-left"><?php echo esc_html($registration->reg_code()); ?></td> |
81 | 81 | <td class="jst-rght"> |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | 'espresso_events_edit', |
33 | 33 | $EVT_ID |
34 | 34 | ) |
35 | - ? '<a href="' . esc_url_raw($event_url) . '" aria-label="' |
|
36 | - . esc_attr__('Edit Event', 'event_espresso') . '">' |
|
37 | - . esc_html($registration->event_name()) . '</a>' |
|
35 | + ? '<a href="'.esc_url_raw($event_url).'" aria-label="' |
|
36 | + . esc_attr__('Edit Event', 'event_espresso').'">' |
|
37 | + . esc_html($registration->event_name()).'</a>' |
|
38 | 38 | : esc_html($registration->event_name()); |
39 | 39 | ?> |
40 | 40 | </td> |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | 'espresso_registrations_view_registration', |
51 | 51 | $REG_ID |
52 | 52 | ) |
53 | - ? '<a href="' . esc_url_raw($reg_url) . '" aria-label="' |
|
54 | - . esc_attr__('View Registration Details', 'event_espresso') . '">' |
|
55 | - . esc_html__('View Registration', 'event_espresso') . '</a>' |
|
53 | + ? '<a href="'.esc_url_raw($reg_url).'" aria-label="' |
|
54 | + . esc_attr__('View Registration Details', 'event_espresso').'">' |
|
55 | + . esc_html__('View Registration', 'event_espresso').'</a>' |
|
56 | 56 | : $REG_ID; |
57 | 57 | ?> |
58 | 58 | </td> |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | 'ee_read_transaction', |
68 | 68 | 'espresso_transactions_view_transaction' |
69 | 69 | ) |
70 | - ? '<a href="' . esc_url_raw($txn_url) . '" aria-label="' |
|
71 | - . esc_attr__('View Transaction Details', 'event_espresso') . '">' |
|
70 | + ? '<a href="'.esc_url_raw($txn_url).'" aria-label="' |
|
71 | + . esc_attr__('View Transaction Details', 'event_espresso').'">' |
|
72 | 72 | . sprintf( |
73 | 73 | esc_html__('View Transaction %d', 'event_espresso'), |
74 | 74 | $TXN_ID |
75 | - ) . |
|
75 | + ). |
|
76 | 76 | '</a>' |
77 | 77 | : $TXN_ID; |
78 | 78 | ?> |
@@ -11,117 +11,117 @@ discard block |
||
11 | 11 | */ |
12 | 12 | class Payment_Log_Admin_List_Table extends EE_Admin_List_Table |
13 | 13 | { |
14 | - /** |
|
15 | - * @var Payments_Admin_Page $_admin_page |
|
16 | - */ |
|
17 | - protected $_admin_page; |
|
14 | + /** |
|
15 | + * @var Payments_Admin_Page $_admin_page |
|
16 | + */ |
|
17 | + protected $_admin_page; |
|
18 | 18 | |
19 | 19 | |
20 | - /** |
|
21 | - * @param EE_Admin_Page $admin_page |
|
22 | - */ |
|
23 | - public function __construct($admin_page) |
|
24 | - { |
|
25 | - parent::__construct($admin_page); |
|
26 | - } |
|
20 | + /** |
|
21 | + * @param EE_Admin_Page $admin_page |
|
22 | + */ |
|
23 | + public function __construct($admin_page) |
|
24 | + { |
|
25 | + parent::__construct($admin_page); |
|
26 | + } |
|
27 | 27 | |
28 | 28 | |
29 | - /** |
|
30 | - * _setup_data |
|
31 | - * |
|
32 | - * @return void |
|
33 | - */ |
|
34 | - protected function _setup_data() |
|
35 | - { |
|
36 | - $this->_data = $this->_admin_page->get_payment_logs($this->_per_page, $this->_current_page); |
|
37 | - // if (isset($this->_req_data['status']) && $this->_req_data['status'] == 'trash') { |
|
38 | - // $this->_data = $this->_admin_page->get_trashed_questions($this->_per_page, $this->_current_page, false); |
|
39 | - // } else { |
|
40 | - // $this->_data = $this->_admin_page->get_questions($this->_per_page, $this->_current_page, false); |
|
41 | - // } |
|
42 | - $this->_all_data_count = $this->_admin_page->get_payment_logs($this->_per_page, $this->_current_page, true); |
|
43 | - add_action( |
|
44 | - 'AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', |
|
45 | - [$this, 'add_download_logs_checkbox'] |
|
46 | - ); |
|
47 | - } |
|
29 | + /** |
|
30 | + * _setup_data |
|
31 | + * |
|
32 | + * @return void |
|
33 | + */ |
|
34 | + protected function _setup_data() |
|
35 | + { |
|
36 | + $this->_data = $this->_admin_page->get_payment_logs($this->_per_page, $this->_current_page); |
|
37 | + // if (isset($this->_req_data['status']) && $this->_req_data['status'] == 'trash') { |
|
38 | + // $this->_data = $this->_admin_page->get_trashed_questions($this->_per_page, $this->_current_page, false); |
|
39 | + // } else { |
|
40 | + // $this->_data = $this->_admin_page->get_questions($this->_per_page, $this->_current_page, false); |
|
41 | + // } |
|
42 | + $this->_all_data_count = $this->_admin_page->get_payment_logs($this->_per_page, $this->_current_page, true); |
|
43 | + add_action( |
|
44 | + 'AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', |
|
45 | + [$this, 'add_download_logs_checkbox'] |
|
46 | + ); |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | - /** |
|
51 | - * add_download_logs_checkbox |
|
52 | - * adds a checkbox to the bottom of the list table, instead of at the top with the rest of the filters |
|
53 | - * |
|
54 | - * @return void |
|
55 | - */ |
|
56 | - public function add_download_logs_checkbox() |
|
57 | - { |
|
58 | - echo "<input type='submit' class='button-primary' id='download_results' name='download_results' value='" |
|
59 | - . esc_html__('Download Results', 'event_espresso') . "'>"; |
|
60 | - } |
|
50 | + /** |
|
51 | + * add_download_logs_checkbox |
|
52 | + * adds a checkbox to the bottom of the list table, instead of at the top with the rest of the filters |
|
53 | + * |
|
54 | + * @return void |
|
55 | + */ |
|
56 | + public function add_download_logs_checkbox() |
|
57 | + { |
|
58 | + echo "<input type='submit' class='button-primary' id='download_results' name='download_results' value='" |
|
59 | + . esc_html__('Download Results', 'event_espresso') . "'>"; |
|
60 | + } |
|
61 | 61 | |
62 | 62 | |
63 | - /** |
|
64 | - * _set_properties |
|
65 | - * |
|
66 | - * @return void |
|
67 | - */ |
|
68 | - protected function _set_properties() |
|
69 | - { |
|
70 | - $this->_wp_list_args = [ |
|
71 | - 'singular' => esc_html__('payment log', 'event_espresso'), |
|
72 | - 'plural' => esc_html__('payment logs', 'event_espresso'), |
|
73 | - 'ajax' => true, // for now, |
|
74 | - 'screen' => $this->_admin_page->get_current_screen()->id, |
|
75 | - ]; |
|
76 | - $this->_columns = [ |
|
77 | - 'cb' => '<input type="checkbox" />', |
|
78 | - 'id' => esc_html__('ID', 'event_espresso'), |
|
79 | - 'LOG_time' => esc_html__('Time', 'event_espresso'), |
|
80 | - 'PMD_ID' => esc_html__('Payment Method', 'event_espresso'), |
|
81 | - 'TXN_ID' => esc_html__('Transaction ID', 'event_espresso'), |
|
82 | - ]; |
|
83 | - $this->_sortable_columns = [ |
|
84 | - 'LOG_time' => ['LOG_time' => true], |
|
85 | - ]; |
|
86 | - $this->_hidden_columns = []; |
|
87 | - } |
|
63 | + /** |
|
64 | + * _set_properties |
|
65 | + * |
|
66 | + * @return void |
|
67 | + */ |
|
68 | + protected function _set_properties() |
|
69 | + { |
|
70 | + $this->_wp_list_args = [ |
|
71 | + 'singular' => esc_html__('payment log', 'event_espresso'), |
|
72 | + 'plural' => esc_html__('payment logs', 'event_espresso'), |
|
73 | + 'ajax' => true, // for now, |
|
74 | + 'screen' => $this->_admin_page->get_current_screen()->id, |
|
75 | + ]; |
|
76 | + $this->_columns = [ |
|
77 | + 'cb' => '<input type="checkbox" />', |
|
78 | + 'id' => esc_html__('ID', 'event_espresso'), |
|
79 | + 'LOG_time' => esc_html__('Time', 'event_espresso'), |
|
80 | + 'PMD_ID' => esc_html__('Payment Method', 'event_espresso'), |
|
81 | + 'TXN_ID' => esc_html__('Transaction ID', 'event_espresso'), |
|
82 | + ]; |
|
83 | + $this->_sortable_columns = [ |
|
84 | + 'LOG_time' => ['LOG_time' => true], |
|
85 | + ]; |
|
86 | + $this->_hidden_columns = []; |
|
87 | + } |
|
88 | 88 | |
89 | 89 | |
90 | - /** |
|
91 | - * _get_table_filters |
|
92 | - * |
|
93 | - * @return array |
|
94 | - * @throws EE_Error |
|
95 | - * @throws ReflectionException |
|
96 | - */ |
|
97 | - protected function _get_table_filters() |
|
98 | - { |
|
99 | - $filters = []; |
|
100 | - // todo we're currently using old functions here. We need to move things into the Events_Admin_Page() class as methods. |
|
101 | - /** @var EE_Payment_Method[] $payment_methods */ |
|
102 | - $payment_methods = EEM_Payment_Method::instance()->get_all(); |
|
103 | - $payment_method_names = [ |
|
104 | - ['id' => 'all', 'text' => esc_html__("All", 'event_espresso')], |
|
105 | - ['id' => '0', 'text' => esc_html__("Unknown Payment Method", 'event_espresso')], |
|
106 | - ]; |
|
107 | - foreach ($payment_methods as $payment_method) { |
|
108 | - $payment_method_names[] = ['id' => $payment_method->ID(), 'text' => $payment_method->admin_name()]; |
|
109 | - } |
|
110 | - $filters[] = EEH_Form_Fields::select_input( |
|
111 | - '_payment_method', |
|
112 | - $payment_method_names, |
|
113 | - isset($this->_req_data['_payment_method']) |
|
114 | - ? $this->_req_data['_payment_method'] |
|
115 | - : 'all' |
|
116 | - ); |
|
117 | - $start_date = isset($this->_req_data['payment-filter-start-date']) |
|
118 | - ? wp_strip_all_tags($this->_req_data['payment-filter-start-date']) |
|
119 | - : date('m/d/Y', strtotime('-6 months')); |
|
120 | - $end_date = isset($this->_req_data['payment-filter-end-date']) |
|
121 | - ? wp_strip_all_tags($this->_req_data['payment-filter-end-date']) |
|
122 | - : date('m/d/Y'); |
|
123 | - ob_start(); |
|
124 | - ?> |
|
90 | + /** |
|
91 | + * _get_table_filters |
|
92 | + * |
|
93 | + * @return array |
|
94 | + * @throws EE_Error |
|
95 | + * @throws ReflectionException |
|
96 | + */ |
|
97 | + protected function _get_table_filters() |
|
98 | + { |
|
99 | + $filters = []; |
|
100 | + // todo we're currently using old functions here. We need to move things into the Events_Admin_Page() class as methods. |
|
101 | + /** @var EE_Payment_Method[] $payment_methods */ |
|
102 | + $payment_methods = EEM_Payment_Method::instance()->get_all(); |
|
103 | + $payment_method_names = [ |
|
104 | + ['id' => 'all', 'text' => esc_html__("All", 'event_espresso')], |
|
105 | + ['id' => '0', 'text' => esc_html__("Unknown Payment Method", 'event_espresso')], |
|
106 | + ]; |
|
107 | + foreach ($payment_methods as $payment_method) { |
|
108 | + $payment_method_names[] = ['id' => $payment_method->ID(), 'text' => $payment_method->admin_name()]; |
|
109 | + } |
|
110 | + $filters[] = EEH_Form_Fields::select_input( |
|
111 | + '_payment_method', |
|
112 | + $payment_method_names, |
|
113 | + isset($this->_req_data['_payment_method']) |
|
114 | + ? $this->_req_data['_payment_method'] |
|
115 | + : 'all' |
|
116 | + ); |
|
117 | + $start_date = isset($this->_req_data['payment-filter-start-date']) |
|
118 | + ? wp_strip_all_tags($this->_req_data['payment-filter-start-date']) |
|
119 | + : date('m/d/Y', strtotime('-6 months')); |
|
120 | + $end_date = isset($this->_req_data['payment-filter-end-date']) |
|
121 | + ? wp_strip_all_tags($this->_req_data['payment-filter-end-date']) |
|
122 | + : date('m/d/Y'); |
|
123 | + ob_start(); |
|
124 | + ?> |
|
125 | 125 | <label for="payment-filter-start-date"> |
126 | 126 | <?php esc_html_e('Display Transactions from ', 'event_espresso'); ?> |
127 | 127 | </label> |
@@ -143,139 +143,139 @@ discard block |
||
143 | 143 | size="15" |
144 | 144 | /> |
145 | 145 | <?php |
146 | - $filters[] = ob_get_clean(); |
|
147 | - return $filters; |
|
148 | - } |
|
146 | + $filters[] = ob_get_clean(); |
|
147 | + return $filters; |
|
148 | + } |
|
149 | 149 | |
150 | 150 | |
151 | - /** |
|
152 | - * _add_view_counts |
|
153 | - * |
|
154 | - * @return void |
|
155 | - */ |
|
156 | - protected function _add_view_counts() |
|
157 | - { |
|
158 | - $this->_views['all']['count'] = $this->_admin_page->get_payment_logs( |
|
159 | - $this->_per_page, |
|
160 | - $this->_current_page, |
|
161 | - true |
|
162 | - ); |
|
163 | - } |
|
151 | + /** |
|
152 | + * _add_view_counts |
|
153 | + * |
|
154 | + * @return void |
|
155 | + */ |
|
156 | + protected function _add_view_counts() |
|
157 | + { |
|
158 | + $this->_views['all']['count'] = $this->_admin_page->get_payment_logs( |
|
159 | + $this->_per_page, |
|
160 | + $this->_current_page, |
|
161 | + true |
|
162 | + ); |
|
163 | + } |
|
164 | 164 | |
165 | 165 | |
166 | - /** |
|
167 | - * column_cb |
|
168 | - * |
|
169 | - * @param EE_Change_Log $item |
|
170 | - * @return string |
|
171 | - * @throws EE_Error |
|
172 | - * @throws ReflectionException |
|
173 | - */ |
|
174 | - public function column_cb($item) |
|
175 | - { |
|
176 | - return sprintf('<input type="checkbox" class="option_id" name="checkbox[%1$d]" value="%1$d" />', $item->ID()); |
|
177 | - } |
|
166 | + /** |
|
167 | + * column_cb |
|
168 | + * |
|
169 | + * @param EE_Change_Log $item |
|
170 | + * @return string |
|
171 | + * @throws EE_Error |
|
172 | + * @throws ReflectionException |
|
173 | + */ |
|
174 | + public function column_cb($item) |
|
175 | + { |
|
176 | + return sprintf('<input type="checkbox" class="option_id" name="checkbox[%1$d]" value="%1$d" />', $item->ID()); |
|
177 | + } |
|
178 | 178 | |
179 | 179 | |
180 | - /** |
|
181 | - * column_id |
|
182 | - * |
|
183 | - * @param EE_Change_Log $item |
|
184 | - * @return string |
|
185 | - * @throws EE_Error |
|
186 | - * @throws ReflectionException |
|
187 | - */ |
|
188 | - public function column_id(EE_Change_Log $item) |
|
189 | - { |
|
190 | - $ID = absint($item->ID()); |
|
191 | - $details_query_args = [ |
|
192 | - 'action' => 'payment_log_details', |
|
193 | - 'ID' => $ID, |
|
194 | - ]; |
|
195 | - $url = esc_url_raw( |
|
196 | - EE_Admin_Page::add_query_args_and_nonce($details_query_args, EE_PAYMENTS_ADMIN_URL) |
|
197 | - ); |
|
198 | - return "<a href='$url'>{$ID}</a>"; |
|
199 | - } |
|
180 | + /** |
|
181 | + * column_id |
|
182 | + * |
|
183 | + * @param EE_Change_Log $item |
|
184 | + * @return string |
|
185 | + * @throws EE_Error |
|
186 | + * @throws ReflectionException |
|
187 | + */ |
|
188 | + public function column_id(EE_Change_Log $item) |
|
189 | + { |
|
190 | + $ID = absint($item->ID()); |
|
191 | + $details_query_args = [ |
|
192 | + 'action' => 'payment_log_details', |
|
193 | + 'ID' => $ID, |
|
194 | + ]; |
|
195 | + $url = esc_url_raw( |
|
196 | + EE_Admin_Page::add_query_args_and_nonce($details_query_args, EE_PAYMENTS_ADMIN_URL) |
|
197 | + ); |
|
198 | + return "<a href='$url'>{$ID}</a>"; |
|
199 | + } |
|
200 | 200 | |
201 | 201 | |
202 | - /** |
|
203 | - * column_LOG_time |
|
204 | - * |
|
205 | - * @param EE_Change_Log $item |
|
206 | - * @return string |
|
207 | - * @throws EE_Error |
|
208 | - * @throws ReflectionException |
|
209 | - */ |
|
210 | - public function column_LOG_time(EE_Change_Log $item) |
|
211 | - { |
|
212 | - return $item->get_datetime('LOG_time'); |
|
213 | - } |
|
202 | + /** |
|
203 | + * column_LOG_time |
|
204 | + * |
|
205 | + * @param EE_Change_Log $item |
|
206 | + * @return string |
|
207 | + * @throws EE_Error |
|
208 | + * @throws ReflectionException |
|
209 | + */ |
|
210 | + public function column_LOG_time(EE_Change_Log $item) |
|
211 | + { |
|
212 | + return $item->get_datetime('LOG_time'); |
|
213 | + } |
|
214 | 214 | |
215 | 215 | |
216 | - /** |
|
217 | - * column_PMD_ID |
|
218 | - * |
|
219 | - * @param EE_Change_Log $item |
|
220 | - * @return string |
|
221 | - * @throws EE_Error |
|
222 | - */ |
|
223 | - public function column_PMD_ID(EE_Change_Log $item) |
|
224 | - { |
|
225 | - if ($item->object() instanceof EE_Payment_Method) { |
|
226 | - return $item->object()->admin_name(); |
|
227 | - } |
|
228 | - if ( |
|
229 | - $item->object() instanceof EE_Payment |
|
230 | - && $item->object()->payment_method() instanceof EE_Payment_Method |
|
231 | - ) { |
|
232 | - return $item->object()->payment_method()->admin_name(); |
|
233 | - } |
|
234 | - if ($item->object() instanceof EE_Transaction) { |
|
235 | - return esc_html__('Unknown', 'event_espresso'); |
|
236 | - } |
|
237 | - return esc_html__('No longer exists', 'event_espresso'); |
|
238 | - } |
|
216 | + /** |
|
217 | + * column_PMD_ID |
|
218 | + * |
|
219 | + * @param EE_Change_Log $item |
|
220 | + * @return string |
|
221 | + * @throws EE_Error |
|
222 | + */ |
|
223 | + public function column_PMD_ID(EE_Change_Log $item) |
|
224 | + { |
|
225 | + if ($item->object() instanceof EE_Payment_Method) { |
|
226 | + return $item->object()->admin_name(); |
|
227 | + } |
|
228 | + if ( |
|
229 | + $item->object() instanceof EE_Payment |
|
230 | + && $item->object()->payment_method() instanceof EE_Payment_Method |
|
231 | + ) { |
|
232 | + return $item->object()->payment_method()->admin_name(); |
|
233 | + } |
|
234 | + if ($item->object() instanceof EE_Transaction) { |
|
235 | + return esc_html__('Unknown', 'event_espresso'); |
|
236 | + } |
|
237 | + return esc_html__('No longer exists', 'event_espresso'); |
|
238 | + } |
|
239 | 239 | |
240 | 240 | |
241 | - /** |
|
242 | - * column_TXN_ID |
|
243 | - * |
|
244 | - * @param EE_Change_Log $item |
|
245 | - * @return string |
|
246 | - * @throws EE_Error |
|
247 | - * @throws ReflectionException |
|
248 | - */ |
|
249 | - public function column_TXN_ID(EE_Change_Log $item) |
|
250 | - { |
|
251 | - if ($item->object() instanceof EE_Payment) { |
|
252 | - $transaction_id = $item->object()->TXN_ID(); |
|
253 | - } elseif ($item->object() instanceof EE_Transaction) { |
|
254 | - $transaction_id = $item->object()->ID(); |
|
255 | - } else { |
|
256 | - $transaction_id = null; |
|
257 | - } |
|
258 | - if ( |
|
259 | - $transaction_id |
|
260 | - && EE_Registry::instance()->CAP->current_user_can( |
|
261 | - 'ee_read_transaction', |
|
262 | - 'espresso_transactions_view_transaction', |
|
263 | - $transaction_id |
|
264 | - ) |
|
265 | - ) { |
|
266 | - $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( |
|
267 | - ['action' => 'view_transaction', 'TXN_ID' => $transaction_id], |
|
268 | - TXN_ADMIN_URL |
|
269 | - ); |
|
270 | - return '<a href="' . esc_url_raw($view_txn_lnk_url) . '" ' |
|
271 | - . 'aria-label="' . sprintf( |
|
272 | - esc_attr__('click to view transaction #%s', 'event_espresso'), |
|
273 | - $transaction_id |
|
274 | - ) . '">' |
|
275 | - . sprintf(esc_html__('view txn %s', 'event_espresso'), $transaction_id) |
|
276 | - . '</a>'; |
|
277 | - } |
|
278 | - // No transaction id or use can not view the transaction. |
|
279 | - return esc_html__("Unable to find transaction", 'event_espresso'); |
|
280 | - } |
|
241 | + /** |
|
242 | + * column_TXN_ID |
|
243 | + * |
|
244 | + * @param EE_Change_Log $item |
|
245 | + * @return string |
|
246 | + * @throws EE_Error |
|
247 | + * @throws ReflectionException |
|
248 | + */ |
|
249 | + public function column_TXN_ID(EE_Change_Log $item) |
|
250 | + { |
|
251 | + if ($item->object() instanceof EE_Payment) { |
|
252 | + $transaction_id = $item->object()->TXN_ID(); |
|
253 | + } elseif ($item->object() instanceof EE_Transaction) { |
|
254 | + $transaction_id = $item->object()->ID(); |
|
255 | + } else { |
|
256 | + $transaction_id = null; |
|
257 | + } |
|
258 | + if ( |
|
259 | + $transaction_id |
|
260 | + && EE_Registry::instance()->CAP->current_user_can( |
|
261 | + 'ee_read_transaction', |
|
262 | + 'espresso_transactions_view_transaction', |
|
263 | + $transaction_id |
|
264 | + ) |
|
265 | + ) { |
|
266 | + $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( |
|
267 | + ['action' => 'view_transaction', 'TXN_ID' => $transaction_id], |
|
268 | + TXN_ADMIN_URL |
|
269 | + ); |
|
270 | + return '<a href="' . esc_url_raw($view_txn_lnk_url) . '" ' |
|
271 | + . 'aria-label="' . sprintf( |
|
272 | + esc_attr__('click to view transaction #%s', 'event_espresso'), |
|
273 | + $transaction_id |
|
274 | + ) . '">' |
|
275 | + . sprintf(esc_html__('view txn %s', 'event_espresso'), $transaction_id) |
|
276 | + . '</a>'; |
|
277 | + } |
|
278 | + // No transaction id or use can not view the transaction. |
|
279 | + return esc_html__("Unable to find transaction", 'event_espresso'); |
|
280 | + } |
|
281 | 281 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public function add_download_logs_checkbox() |
57 | 57 | { |
58 | 58 | echo "<input type='submit' class='button-primary' id='download_results' name='download_results' value='" |
59 | - . esc_html__('Download Results', 'event_espresso') . "'>"; |
|
59 | + . esc_html__('Download Results', 'event_espresso')."'>"; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
@@ -67,13 +67,13 @@ discard block |
||
67 | 67 | */ |
68 | 68 | protected function _set_properties() |
69 | 69 | { |
70 | - $this->_wp_list_args = [ |
|
70 | + $this->_wp_list_args = [ |
|
71 | 71 | 'singular' => esc_html__('payment log', 'event_espresso'), |
72 | 72 | 'plural' => esc_html__('payment logs', 'event_espresso'), |
73 | 73 | 'ajax' => true, // for now, |
74 | 74 | 'screen' => $this->_admin_page->get_current_screen()->id, |
75 | 75 | ]; |
76 | - $this->_columns = [ |
|
76 | + $this->_columns = [ |
|
77 | 77 | 'cb' => '<input type="checkbox" />', |
78 | 78 | 'id' => esc_html__('ID', 'event_espresso'), |
79 | 79 | 'LOG_time' => esc_html__('Time', 'event_espresso'), |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | foreach ($payment_methods as $payment_method) { |
108 | 108 | $payment_method_names[] = ['id' => $payment_method->ID(), 'text' => $payment_method->admin_name()]; |
109 | 109 | } |
110 | - $filters[] = EEH_Form_Fields::select_input( |
|
110 | + $filters[] = EEH_Form_Fields::select_input( |
|
111 | 111 | '_payment_method', |
112 | 112 | $payment_method_names, |
113 | 113 | isset($this->_req_data['_payment_method']) |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | 'action' => 'payment_log_details', |
193 | 193 | 'ID' => $ID, |
194 | 194 | ]; |
195 | - $url = esc_url_raw( |
|
195 | + $url = esc_url_raw( |
|
196 | 196 | EE_Admin_Page::add_query_args_and_nonce($details_query_args, EE_PAYMENTS_ADMIN_URL) |
197 | 197 | ); |
198 | 198 | return "<a href='$url'>{$ID}</a>"; |
@@ -267,11 +267,11 @@ discard block |
||
267 | 267 | ['action' => 'view_transaction', 'TXN_ID' => $transaction_id], |
268 | 268 | TXN_ADMIN_URL |
269 | 269 | ); |
270 | - return '<a href="' . esc_url_raw($view_txn_lnk_url) . '" ' |
|
271 | - . 'aria-label="' . sprintf( |
|
270 | + return '<a href="'.esc_url_raw($view_txn_lnk_url).'" ' |
|
271 | + . 'aria-label="'.sprintf( |
|
272 | 272 | esc_attr__('click to view transaction #%s', 'event_espresso'), |
273 | 273 | $transaction_id |
274 | - ) . '">' |
|
274 | + ).'">' |
|
275 | 275 | . sprintf(esc_html__('view txn %s', 'event_espresso'), $transaction_id) |
276 | 276 | . '</a>'; |
277 | 277 | } |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <p class="about-description"> |
2 | 2 | <?php esc_html_e( |
3 | - 'Event Espresso is created by an international team of passionate individuals with a drive to empower your events!', |
|
4 | - 'event_espresso' |
|
5 | - ); ?> |
|
3 | + 'Event Espresso is created by an international team of passionate individuals with a drive to empower your events!', |
|
4 | + 'event_espresso' |
|
5 | + ); ?> |
|
6 | 6 | </p> |
7 | 7 | <h3 class="wp-people-group"><?php esc_html_e('Founders', 'event_espresso'); ?></h3> |
8 | 8 | <ul class="wp-people-group" id="ee-people-group-owners"> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | </li> |
48 | 48 | <li class='wp-person' id='ee-person-mwani'> |
49 | 49 | <a href="<?php |
50 | - esp_gravatar_profile('[email protected]'); ?>" target='_blank'> |
|
50 | + esp_gravatar_profile('[email protected]'); ?>" target='_blank'> |
|
51 | 51 | <?php esp_gravatar_image('[email protected]', 'Manzoor Ahmad Wani'); ?> |
52 | 52 | </a> |
53 | 53 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>" target='_blank'> |
@@ -87,15 +87,15 @@ discard block |
||
87 | 87 | <h3 class="wp-people-group"><?php esc_html_e('Contributor Recognition', 'event_espresso'); ?></h3> |
88 | 88 | <p class="description"> |
89 | 89 | <?php |
90 | - printf( |
|
91 | - esc_html__( |
|
92 | - 'For every major release we want to recognize the people who contributed to the release via a GitHub pull request. Want to see your name listed here? %sWhen you submit a pull request that gets included in a major release%s, we\'ll add your name here linked to your GitHub profile.', |
|
93 | - 'event_espresso' |
|
94 | - ), |
|
95 | - '<a href="https://github.com/eventespresso/event-espresso-core" aria-label="Contribute to Event Espresso by making a pull request via GitHub" target="_blank">', |
|
96 | - '</a>' |
|
97 | - ); |
|
98 | - ?> |
|
90 | + printf( |
|
91 | + esc_html__( |
|
92 | + 'For every major release we want to recognize the people who contributed to the release via a GitHub pull request. Want to see your name listed here? %sWhen you submit a pull request that gets included in a major release%s, we\'ll add your name here linked to your GitHub profile.', |
|
93 | + 'event_espresso' |
|
94 | + ), |
|
95 | + '<a href="https://github.com/eventespresso/event-espresso-core" aria-label="Contribute to Event Espresso by making a pull request via GitHub" target="_blank">', |
|
96 | + '</a>' |
|
97 | + ); |
|
98 | + ?> |
|
99 | 99 | </p> |
100 | 100 | <p class="wp-credits-list"> |
101 | 101 | <ul> |
@@ -110,15 +110,15 @@ discard block |
||
110 | 110 | <h3 class="wp-people-group"><?php esc_html_e('External Libraries', 'event_espresso'); ?></h3> |
111 | 111 | <p class="description"> |
112 | 112 | <?php |
113 | - printf( |
|
114 | - esc_html__( |
|
115 | - 'Along with the libraries %sincluded with WordPress%s, Event Espresso utilizes the following third party libraries:', |
|
116 | - 'event_espresso' |
|
117 | - ), |
|
118 | - '<a href="credits.php">', |
|
119 | - '</a>' |
|
120 | - ); |
|
121 | - ?> |
|
113 | + printf( |
|
114 | + esc_html__( |
|
115 | + 'Along with the libraries %sincluded with WordPress%s, Event Espresso utilizes the following third party libraries:', |
|
116 | + 'event_espresso' |
|
117 | + ), |
|
118 | + '<a href="credits.php">', |
|
119 | + '</a>' |
|
120 | + ); |
|
121 | + ?> |
|
122 | 122 | </p> |
123 | 123 | <p class="wp-credits-list"> |
124 | 124 | <a href="https://openexchangerates.github.io/accounting.js/" target='_blank'>accounting.js</a>, |
@@ -135,13 +135,13 @@ discard block |
||
135 | 135 | <?php |
136 | 136 | function esp_gravatar_profile($email) |
137 | 137 | { |
138 | - echo esc_url_raw('https://www.gravatar.com/' . md5($email)); |
|
138 | + echo esc_url_raw('https://www.gravatar.com/' . md5($email)); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | function esp_gravatar_image($email, $name) |
142 | 142 | { |
143 | - $email = md5($email); |
|
144 | - $name = esc_attr($name); |
|
145 | - $url = esc_url_raw("https://0.gravatar.com/avatar/{$email}?s=60"); |
|
146 | - echo "<img src='{$url}' class='gravatar' alt='{$name}'/>"; |
|
143 | + $email = md5($email); |
|
144 | + $name = esc_attr($name); |
|
145 | + $url = esc_url_raw("https://0.gravatar.com/avatar/{$email}?s=60"); |
|
146 | + echo "<img src='{$url}' class='gravatar' alt='{$name}'/>"; |
|
147 | 147 | } |
@@ -36,25 +36,25 @@ discard block |
||
36 | 36 | <td><h3><?php esc_html_e('1', 'event_espresso'); ?></h3></td> |
37 | 37 | <td> |
38 | 38 | <?php echo apply_filters( |
39 | - 'FHEE__ee_migration_page__option_1_main', |
|
40 | - sprintf( |
|
41 | - __( |
|
42 | - '%1$sYes. I have backed up my database%2$s, %3$sunderstand the risks involved%4$s, and am ready to migrate my existing %5$s data to %6$s.', |
|
43 | - "event_espresso" |
|
44 | - ), |
|
45 | - '<strong>', |
|
46 | - '</strong>', |
|
47 | - '<a id="migration-risks" class="" aria-label="' |
|
48 | - . esc_attr__('click for more details', "event_espresso") |
|
49 | - . '">', |
|
50 | - '</a>', |
|
51 | - $current_db_state, |
|
52 | - $next_db_state |
|
53 | - ), |
|
54 | - $current_db_state, |
|
55 | - $next_db_state |
|
56 | - ); |
|
57 | - ?> |
|
39 | + 'FHEE__ee_migration_page__option_1_main', |
|
40 | + sprintf( |
|
41 | + __( |
|
42 | + '%1$sYes. I have backed up my database%2$s, %3$sunderstand the risks involved%4$s, and am ready to migrate my existing %5$s data to %6$s.', |
|
43 | + "event_espresso" |
|
44 | + ), |
|
45 | + '<strong>', |
|
46 | + '</strong>', |
|
47 | + '<a id="migration-risks" class="" aria-label="' |
|
48 | + . esc_attr__('click for more details', "event_espresso") |
|
49 | + . '">', |
|
50 | + '</a>', |
|
51 | + $current_db_state, |
|
52 | + $next_db_state |
|
53 | + ), |
|
54 | + $current_db_state, |
|
55 | + $next_db_state |
|
56 | + ); |
|
57 | + ?> |
|
58 | 58 | <a id="display-migration-details" |
59 | 59 | class="display-the-hidden lt-grey-text smaller-text hide-if-no-js" |
60 | 60 | rel="migration-details" |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | style="display:none;" |
68 | 68 | > |
69 | 69 | <?php printf( |
70 | - esc_html__('hide%1$sdetails%1$s-', 'event_espresso'), |
|
71 | - ' ' |
|
72 | - ); ?> |
|
70 | + esc_html__('hide%1$sdetails%1$s-', 'event_espresso'), |
|
71 | + ' ' |
|
72 | + ); ?> |
|
73 | 73 | </a> |
74 | 74 | </td> |
75 | 75 | <td> |
@@ -77,17 +77,17 @@ discard block |
||
77 | 77 | class="toggle-migration-monitor button-primary" |
78 | 78 | > |
79 | 79 | <?php echo esc_html( |
80 | - apply_filters( |
|
81 | - 'FHEE__ee_migration_page__option_1_button_text', |
|
82 | - sprintf( |
|
83 | - __("Migrate My %s Data to %s", "event_espresso"), |
|
84 | - $current_db_state, |
|
85 | - $next_db_state |
|
86 | - ), |
|
87 | - $current_db_state, |
|
88 | - $next_db_state |
|
89 | - ) |
|
90 | - ); ?> |
|
80 | + apply_filters( |
|
81 | + 'FHEE__ee_migration_page__option_1_button_text', |
|
82 | + sprintf( |
|
83 | + __("Migrate My %s Data to %s", "event_espresso"), |
|
84 | + $current_db_state, |
|
85 | + $next_db_state |
|
86 | + ), |
|
87 | + $current_db_state, |
|
88 | + $next_db_state |
|
89 | + ) |
|
90 | + ); ?> |
|
91 | 91 | </a> |
92 | 92 | </td> |
93 | 93 | </tr> |
@@ -96,34 +96,34 @@ discard block |
||
96 | 96 | <div id="migration-details-dv" style="display: none; padding: 1em;"> |
97 | 97 | <span class="reminder-spn"> |
98 | 98 | <?php printf( |
99 | - esc_html__( |
|
100 | - "%s Important: %s Before migrating, please back up your database and files.", |
|
101 | - "event_espresso" |
|
102 | - ), |
|
103 | - "<b>", |
|
104 | - "</b>" |
|
105 | - ); |
|
99 | + esc_html__( |
|
100 | + "%s Important: %s Before migrating, please back up your database and files.", |
|
101 | + "event_espresso" |
|
102 | + ), |
|
103 | + "<b>", |
|
104 | + "</b>" |
|
105 | + ); |
|
106 | 106 | ?> |
107 | 107 | </span> |
108 | 108 | <p> |
109 | 109 | <?php printf( |
110 | - esc_html__( |
|
111 | - '%1$sNot sure how to backup your existing data?%2$s Here is %3$sWordPress\'s explanation%7$s, and here\'s %6$sour explanation%7$s.%8$sYou can also search the WordPress plugin database for %4$s database backup plugins %7$s,%8$sor have one of our dedicated support technicians help you by purchasing a %5$sPriority Support Token%7$s.', |
|
112 | - "event_espresso" |
|
113 | - ), |
|
114 | - '<b>', |
|
115 | - '</b>', |
|
116 | - "<a href='https://codex.wordpress.org/Backing_Up_Your_Database'>", |
|
117 | - "<a href='" |
|
118 | - . admin_url( |
|
119 | - 'plugin-install.php?tab=search&type=term&s=database+backup&plugin-search-input=Search+Plugins' |
|
120 | - ) |
|
121 | - . "'>", |
|
122 | - "<a href='https://eventespresso.com/product/priority-support-tokens/'>", |
|
123 | - '<a href="https://eventespresso.com/wiki/how-to-back-up-your-site/">', |
|
124 | - "</a>", |
|
125 | - '<br/>' |
|
126 | - ); |
|
110 | + esc_html__( |
|
111 | + '%1$sNot sure how to backup your existing data?%2$s Here is %3$sWordPress\'s explanation%7$s, and here\'s %6$sour explanation%7$s.%8$sYou can also search the WordPress plugin database for %4$s database backup plugins %7$s,%8$sor have one of our dedicated support technicians help you by purchasing a %5$sPriority Support Token%7$s.', |
|
112 | + "event_espresso" |
|
113 | + ), |
|
114 | + '<b>', |
|
115 | + '</b>', |
|
116 | + "<a href='https://codex.wordpress.org/Backing_Up_Your_Database'>", |
|
117 | + "<a href='" |
|
118 | + . admin_url( |
|
119 | + 'plugin-install.php?tab=search&type=term&s=database+backup&plugin-search-input=Search+Plugins' |
|
120 | + ) |
|
121 | + . "'>", |
|
122 | + "<a href='https://eventespresso.com/product/priority-support-tokens/'>", |
|
123 | + '<a href="https://eventespresso.com/wiki/how-to-back-up-your-site/">', |
|
124 | + "</a>", |
|
125 | + '<br/>' |
|
126 | + ); |
|
127 | 127 | ?> |
128 | 128 | </p> |
129 | 129 | <?php do_action('AHEE__ee_migration_page__option_1_extra_details'); ?> |
@@ -136,29 +136,29 @@ discard block |
||
136 | 136 | </td> |
137 | 137 | <td> |
138 | 138 | <?php echo esc_html( |
139 | - apply_filters( |
|
140 | - 'FHEE__ee_migration_page__option_2_main', |
|
141 | - sprintf( |
|
142 | - __( |
|
143 | - 'I do NOT want to migrate my %1$s data to %2$s at this time and just want to use %3$s without migrating data.', |
|
144 | - "event_espresso" |
|
145 | - ), |
|
146 | - $current_db_state, |
|
147 | - $next_db_state, |
|
148 | - $ultimate_db_state |
|
149 | - ), |
|
150 | - $current_db_state, |
|
151 | - $next_db_state, |
|
152 | - $ultimate_db_state |
|
153 | - ) |
|
154 | - ); |
|
155 | - ?> |
|
139 | + apply_filters( |
|
140 | + 'FHEE__ee_migration_page__option_2_main', |
|
141 | + sprintf( |
|
142 | + __( |
|
143 | + 'I do NOT want to migrate my %1$s data to %2$s at this time and just want to use %3$s without migrating data.', |
|
144 | + "event_espresso" |
|
145 | + ), |
|
146 | + $current_db_state, |
|
147 | + $next_db_state, |
|
148 | + $ultimate_db_state |
|
149 | + ), |
|
150 | + $current_db_state, |
|
151 | + $next_db_state, |
|
152 | + $ultimate_db_state |
|
153 | + ) |
|
154 | + ); |
|
155 | + ?> |
|
156 | 156 | <br /> |
157 | 157 | <span class="reminder-spn"> |
158 | 158 | <?php esc_html_e( |
159 | - 'Please Note: In order to avoid errors, any existing Event Espresso data (events, ticket, registrations, etc) in your db will be erased! Regular WP data will NOT be affected.', |
|
160 | - 'event_espresso' |
|
161 | - ); ?> |
|
159 | + 'Please Note: In order to avoid errors, any existing Event Espresso data (events, ticket, registrations, etc) in your db will be erased! Regular WP data will NOT be affected.', |
|
160 | + 'event_espresso' |
|
161 | + ); ?> |
|
162 | 162 | </span> |
163 | 163 | <a id="display-no-migration-details" |
164 | 164 | class="display-the-hidden lt-grey-text smaller-text hide-if-no-js" |
@@ -172,9 +172,9 @@ discard block |
||
172 | 172 | style="display:none;" |
173 | 173 | > |
174 | 174 | <?php printf( |
175 | - esc_html__('hide%1$sdetails%1$s-', 'event_espresso'), |
|
176 | - ' ' |
|
177 | - ); |
|
175 | + esc_html__('hide%1$sdetails%1$s-', 'event_espresso'), |
|
176 | + ' ' |
|
177 | + ); |
|
178 | 178 | ?> |
179 | 179 | </a> |
180 | 180 | </td> |
@@ -184,16 +184,16 @@ discard block |
||
184 | 184 | href="<?php echo esc_url_raw($reset_db_page_link); ?>" |
185 | 185 | > |
186 | 186 | <?php echo esc_html( |
187 | - apply_filters( |
|
188 | - 'FHEE__ee_migration_page__option_2_button_text', |
|
189 | - sprintf( |
|
190 | - __("Just Start %s and Delete Existing Data", "event_espresso"), |
|
191 | - $ultimate_db_state |
|
192 | - ), |
|
193 | - $ultimate_db_state |
|
194 | - ) |
|
195 | - ); |
|
196 | - ?> |
|
187 | + apply_filters( |
|
188 | + 'FHEE__ee_migration_page__option_2_button_text', |
|
189 | + sprintf( |
|
190 | + __("Just Start %s and Delete Existing Data", "event_espresso"), |
|
191 | + $ultimate_db_state |
|
192 | + ), |
|
193 | + $ultimate_db_state |
|
194 | + ) |
|
195 | + ); |
|
196 | + ?> |
|
197 | 197 | </a> |
198 | 198 | </td> |
199 | 199 | </tr> |
@@ -202,18 +202,18 @@ discard block |
||
202 | 202 | <div id="no-migration-details-dv" style="display: none; padding: 1em;"> |
203 | 203 | <p> |
204 | 204 | <?php echo esc_html( |
205 | - apply_filters( |
|
206 | - 'FHEE__ee_migration_page__option_2_details', |
|
207 | - sprintf( |
|
208 | - __( |
|
209 | - "If your existing Event and Registration Data is no longer relevant nor required, you can just start up %s without performing a data migration.", |
|
210 | - "event_espresso" |
|
211 | - ), |
|
212 | - $ultimate_db_state |
|
213 | - ), |
|
214 | - $ultimate_db_state |
|
215 | - ) |
|
216 | - ); ?> |
|
205 | + apply_filters( |
|
206 | + 'FHEE__ee_migration_page__option_2_details', |
|
207 | + sprintf( |
|
208 | + __( |
|
209 | + "If your existing Event and Registration Data is no longer relevant nor required, you can just start up %s without performing a data migration.", |
|
210 | + "event_espresso" |
|
211 | + ), |
|
212 | + $ultimate_db_state |
|
213 | + ), |
|
214 | + $ultimate_db_state |
|
215 | + ) |
|
216 | + ); ?> |
|
217 | 217 | </p> |
218 | 218 | </div> |
219 | 219 | </td> |
@@ -15,123 +15,123 @@ |
||
15 | 15 | */ |
16 | 16 | class Extend_Registration_Form_Questions_Admin_List_Table extends Registration_Form_Questions_Admin_List_Table |
17 | 17 | { |
18 | - public function __construct($admin_page) |
|
19 | - { |
|
20 | - parent::__construct($admin_page); |
|
21 | - } |
|
18 | + public function __construct($admin_page) |
|
19 | + { |
|
20 | + parent::__construct($admin_page); |
|
21 | + } |
|
22 | 22 | |
23 | - public function column_display_text(EE_Question $item) |
|
24 | - { |
|
25 | - $system_question = $item->is_system_question(); |
|
26 | - $actions = array(); |
|
23 | + public function column_display_text(EE_Question $item) |
|
24 | + { |
|
25 | + $system_question = $item->is_system_question(); |
|
26 | + $actions = array(); |
|
27 | 27 | |
28 | - if (! defined('REG_ADMIN_URL')) { |
|
29 | - define('REG_ADMIN_URL', EVENTS_ADMIN_URL); |
|
30 | - } |
|
28 | + if (! defined('REG_ADMIN_URL')) { |
|
29 | + define('REG_ADMIN_URL', EVENTS_ADMIN_URL); |
|
30 | + } |
|
31 | 31 | |
32 | - $edit_query_args = array( |
|
33 | - 'action' => 'edit_question', |
|
34 | - 'QST_ID' => $item->ID(), |
|
35 | - ); |
|
32 | + $edit_query_args = array( |
|
33 | + 'action' => 'edit_question', |
|
34 | + 'QST_ID' => $item->ID(), |
|
35 | + ); |
|
36 | 36 | |
37 | - $trash_query_args = array( |
|
38 | - 'action' => 'trash_question', |
|
39 | - 'QST_ID' => $item->ID(), |
|
40 | - ); |
|
37 | + $trash_query_args = array( |
|
38 | + 'action' => 'trash_question', |
|
39 | + 'QST_ID' => $item->ID(), |
|
40 | + ); |
|
41 | 41 | |
42 | - $restore_query_args = array( |
|
43 | - 'action' => 'restore_question', |
|
44 | - 'QST_ID' => $item->ID(), |
|
45 | - ); |
|
42 | + $restore_query_args = array( |
|
43 | + 'action' => 'restore_question', |
|
44 | + 'QST_ID' => $item->ID(), |
|
45 | + ); |
|
46 | 46 | |
47 | - $delete_query_args = array( |
|
48 | - 'action' => 'delete_questions', |
|
49 | - 'QST_ID' => $item->ID(), |
|
50 | - ); |
|
47 | + $delete_query_args = array( |
|
48 | + 'action' => 'delete_questions', |
|
49 | + 'QST_ID' => $item->ID(), |
|
50 | + ); |
|
51 | 51 | |
52 | - $duplicate_query_args = array( |
|
53 | - 'action' => 'duplicate_question', |
|
54 | - 'QST_ID' => $item->ID(), |
|
55 | - ); |
|
52 | + $duplicate_query_args = array( |
|
53 | + 'action' => 'duplicate_question', |
|
54 | + 'QST_ID' => $item->ID(), |
|
55 | + ); |
|
56 | 56 | |
57 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL); |
|
58 | - $trash_link = EE_Admin_Page::add_query_args_and_nonce($trash_query_args, EE_FORMS_ADMIN_URL); |
|
59 | - $restore_link = EE_Admin_Page::add_query_args_and_nonce($restore_query_args, EE_FORMS_ADMIN_URL); |
|
60 | - $delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_FORMS_ADMIN_URL); |
|
61 | - $duplicate_link = EE_Admin_Page::add_query_args_and_nonce($duplicate_query_args, EE_FORMS_ADMIN_URL); |
|
57 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL); |
|
58 | + $trash_link = EE_Admin_Page::add_query_args_and_nonce($trash_query_args, EE_FORMS_ADMIN_URL); |
|
59 | + $restore_link = EE_Admin_Page::add_query_args_and_nonce($restore_query_args, EE_FORMS_ADMIN_URL); |
|
60 | + $delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_FORMS_ADMIN_URL); |
|
61 | + $duplicate_link = EE_Admin_Page::add_query_args_and_nonce($duplicate_query_args, EE_FORMS_ADMIN_URL); |
|
62 | 62 | |
63 | - if ( |
|
64 | - EE_Registry::instance()->CAP->current_user_can( |
|
65 | - 'ee_edit_question', |
|
66 | - 'espresso_registration_form_edit_question', |
|
67 | - $item->ID() |
|
68 | - ) |
|
69 | - ) { |
|
70 | - $actions = array( |
|
71 | - 'edit' => '<a href="' . $edit_link . '" aria-label="' |
|
72 | - . esc_html__('Edit Question', 'event_espresso') . '">' |
|
73 | - . esc_html__('Edit', 'event_espresso') . '</a>', |
|
74 | - ); |
|
75 | - } |
|
63 | + if ( |
|
64 | + EE_Registry::instance()->CAP->current_user_can( |
|
65 | + 'ee_edit_question', |
|
66 | + 'espresso_registration_form_edit_question', |
|
67 | + $item->ID() |
|
68 | + ) |
|
69 | + ) { |
|
70 | + $actions = array( |
|
71 | + 'edit' => '<a href="' . $edit_link . '" aria-label="' |
|
72 | + . esc_html__('Edit Question', 'event_espresso') . '">' |
|
73 | + . esc_html__('Edit', 'event_espresso') . '</a>', |
|
74 | + ); |
|
75 | + } |
|
76 | 76 | |
77 | - if ( |
|
78 | - ! $system_question |
|
79 | - && $this->_view != 'trash' |
|
80 | - && EE_Registry::instance()->CAP->current_user_can( |
|
81 | - 'ee_delete_question', |
|
82 | - 'espresso_registration_form_trash_question', |
|
83 | - $item->ID() |
|
84 | - ) |
|
85 | - ) { |
|
86 | - $actions['delete'] = '<a href="' . $trash_link . '" aria-label="' |
|
87 | - . esc_html__('Trash Question', 'event_espresso') . '">' |
|
88 | - . esc_html__('Trash', 'event_espresso') . '</a>'; |
|
89 | - } |
|
77 | + if ( |
|
78 | + ! $system_question |
|
79 | + && $this->_view != 'trash' |
|
80 | + && EE_Registry::instance()->CAP->current_user_can( |
|
81 | + 'ee_delete_question', |
|
82 | + 'espresso_registration_form_trash_question', |
|
83 | + $item->ID() |
|
84 | + ) |
|
85 | + ) { |
|
86 | + $actions['delete'] = '<a href="' . $trash_link . '" aria-label="' |
|
87 | + . esc_html__('Trash Question', 'event_espresso') . '">' |
|
88 | + . esc_html__('Trash', 'event_espresso') . '</a>'; |
|
89 | + } |
|
90 | 90 | |
91 | - if ($this->_view == 'trash') { |
|
92 | - if ( |
|
93 | - EE_Registry::instance()->CAP->current_user_can( |
|
94 | - 'ee_delete_question', |
|
95 | - 'espresso_registration_form_restore_question', |
|
96 | - $item->ID() |
|
97 | - ) |
|
98 | - ) { |
|
99 | - $actions['restore'] = '<a href="' . $restore_link . '" aria-label="' |
|
100 | - . esc_html__('Restore Question', 'event_espresso') . '">' |
|
101 | - . esc_html__('Restore', 'event_espresso') . '</a>'; |
|
102 | - } |
|
103 | - if ( |
|
104 | - $item->count_related('Answer') === 0 |
|
105 | - && EE_Registry::instance()->CAP->current_user_can( |
|
106 | - 'ee_delete_question', |
|
107 | - 'espresso_registration_form_delete_questions', |
|
108 | - $item->ID() |
|
109 | - ) |
|
110 | - ) { |
|
111 | - $actions['delete'] = '<a href="' . $delete_link . '" aria-label="' |
|
112 | - . esc_html__('Delete Question Permanently', 'event_espresso') . '">' |
|
113 | - . esc_html__('Delete Permanently', 'event_espresso') . '</a>'; |
|
114 | - } |
|
115 | - } |
|
116 | - if ( |
|
117 | - EE_Registry::instance()->CAP->current_user_can( |
|
118 | - 'ee_edit_questions', |
|
119 | - 'espresso_registration_form_edit_question' |
|
120 | - ) |
|
121 | - ) { |
|
122 | - $actions['duplicate'] = '<a href="' . $duplicate_link . '" aria-label="' |
|
123 | - . esc_html__('Duplicate Question', 'event_espresso') . '">' |
|
124 | - . esc_html__('Duplicate', 'event_espresso') . '</a>'; |
|
125 | - } |
|
91 | + if ($this->_view == 'trash') { |
|
92 | + if ( |
|
93 | + EE_Registry::instance()->CAP->current_user_can( |
|
94 | + 'ee_delete_question', |
|
95 | + 'espresso_registration_form_restore_question', |
|
96 | + $item->ID() |
|
97 | + ) |
|
98 | + ) { |
|
99 | + $actions['restore'] = '<a href="' . $restore_link . '" aria-label="' |
|
100 | + . esc_html__('Restore Question', 'event_espresso') . '">' |
|
101 | + . esc_html__('Restore', 'event_espresso') . '</a>'; |
|
102 | + } |
|
103 | + if ( |
|
104 | + $item->count_related('Answer') === 0 |
|
105 | + && EE_Registry::instance()->CAP->current_user_can( |
|
106 | + 'ee_delete_question', |
|
107 | + 'espresso_registration_form_delete_questions', |
|
108 | + $item->ID() |
|
109 | + ) |
|
110 | + ) { |
|
111 | + $actions['delete'] = '<a href="' . $delete_link . '" aria-label="' |
|
112 | + . esc_html__('Delete Question Permanently', 'event_espresso') . '">' |
|
113 | + . esc_html__('Delete Permanently', 'event_espresso') . '</a>'; |
|
114 | + } |
|
115 | + } |
|
116 | + if ( |
|
117 | + EE_Registry::instance()->CAP->current_user_can( |
|
118 | + 'ee_edit_questions', |
|
119 | + 'espresso_registration_form_edit_question' |
|
120 | + ) |
|
121 | + ) { |
|
122 | + $actions['duplicate'] = '<a href="' . $duplicate_link . '" aria-label="' |
|
123 | + . esc_html__('Duplicate Question', 'event_espresso') . '">' |
|
124 | + . esc_html__('Duplicate', 'event_espresso') . '</a>'; |
|
125 | + } |
|
126 | 126 | |
127 | - $content = EE_Registry::instance()->CAP->current_user_can( |
|
128 | - 'ee_edit_question', |
|
129 | - 'espresso_registration_form_edit_question', |
|
130 | - $item->ID() |
|
131 | - ) |
|
132 | - ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->display_text() . '</a></strong>' |
|
133 | - : $item->display_text(); |
|
134 | - $content .= $this->row_actions($actions); |
|
135 | - return $content; |
|
136 | - } |
|
127 | + $content = EE_Registry::instance()->CAP->current_user_can( |
|
128 | + 'ee_edit_question', |
|
129 | + 'espresso_registration_form_edit_question', |
|
130 | + $item->ID() |
|
131 | + ) |
|
132 | + ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->display_text() . '</a></strong>' |
|
133 | + : $item->display_text(); |
|
134 | + $content .= $this->row_actions($actions); |
|
135 | + return $content; |
|
136 | + } |
|
137 | 137 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $system_question = $item->is_system_question(); |
26 | 26 | $actions = array(); |
27 | 27 | |
28 | - if (! defined('REG_ADMIN_URL')) { |
|
28 | + if ( ! defined('REG_ADMIN_URL')) { |
|
29 | 29 | define('REG_ADMIN_URL', EVENTS_ADMIN_URL); |
30 | 30 | } |
31 | 31 | |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | ) |
69 | 69 | ) { |
70 | 70 | $actions = array( |
71 | - 'edit' => '<a href="' . $edit_link . '" aria-label="' |
|
72 | - . esc_html__('Edit Question', 'event_espresso') . '">' |
|
73 | - . esc_html__('Edit', 'event_espresso') . '</a>', |
|
71 | + 'edit' => '<a href="'.$edit_link.'" aria-label="' |
|
72 | + . esc_html__('Edit Question', 'event_espresso').'">' |
|
73 | + . esc_html__('Edit', 'event_espresso').'</a>', |
|
74 | 74 | ); |
75 | 75 | } |
76 | 76 | |
@@ -83,9 +83,9 @@ discard block |
||
83 | 83 | $item->ID() |
84 | 84 | ) |
85 | 85 | ) { |
86 | - $actions['delete'] = '<a href="' . $trash_link . '" aria-label="' |
|
87 | - . esc_html__('Trash Question', 'event_espresso') . '">' |
|
88 | - . esc_html__('Trash', 'event_espresso') . '</a>'; |
|
86 | + $actions['delete'] = '<a href="'.$trash_link.'" aria-label="' |
|
87 | + . esc_html__('Trash Question', 'event_espresso').'">' |
|
88 | + . esc_html__('Trash', 'event_espresso').'</a>'; |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | if ($this->_view == 'trash') { |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | $item->ID() |
97 | 97 | ) |
98 | 98 | ) { |
99 | - $actions['restore'] = '<a href="' . $restore_link . '" aria-label="' |
|
100 | - . esc_html__('Restore Question', 'event_espresso') . '">' |
|
101 | - . esc_html__('Restore', 'event_espresso') . '</a>'; |
|
99 | + $actions['restore'] = '<a href="'.$restore_link.'" aria-label="' |
|
100 | + . esc_html__('Restore Question', 'event_espresso').'">' |
|
101 | + . esc_html__('Restore', 'event_espresso').'</a>'; |
|
102 | 102 | } |
103 | 103 | if ( |
104 | 104 | $item->count_related('Answer') === 0 |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | $item->ID() |
109 | 109 | ) |
110 | 110 | ) { |
111 | - $actions['delete'] = '<a href="' . $delete_link . '" aria-label="' |
|
112 | - . esc_html__('Delete Question Permanently', 'event_espresso') . '">' |
|
113 | - . esc_html__('Delete Permanently', 'event_espresso') . '</a>'; |
|
111 | + $actions['delete'] = '<a href="'.$delete_link.'" aria-label="' |
|
112 | + . esc_html__('Delete Question Permanently', 'event_espresso').'">' |
|
113 | + . esc_html__('Delete Permanently', 'event_espresso').'</a>'; |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | if ( |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | 'espresso_registration_form_edit_question' |
120 | 120 | ) |
121 | 121 | ) { |
122 | - $actions['duplicate'] = '<a href="' . $duplicate_link . '" aria-label="' |
|
123 | - . esc_html__('Duplicate Question', 'event_espresso') . '">' |
|
124 | - . esc_html__('Duplicate', 'event_espresso') . '</a>'; |
|
122 | + $actions['duplicate'] = '<a href="'.$duplicate_link.'" aria-label="' |
|
123 | + . esc_html__('Duplicate Question', 'event_espresso').'">' |
|
124 | + . esc_html__('Duplicate', 'event_espresso').'</a>'; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | $content = EE_Registry::instance()->CAP->current_user_can( |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | 'espresso_registration_form_edit_question', |
130 | 130 | $item->ID() |
131 | 131 | ) |
132 | - ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->display_text() . '</a></strong>' |
|
132 | + ? '<strong><a class="row-title" href="'.$edit_link.'">'.$item->display_text().'</a></strong>' |
|
133 | 133 | : $item->display_text(); |
134 | 134 | $content .= $this->row_actions($actions); |
135 | 135 | return $content; |
@@ -16,140 +16,140 @@ discard block |
||
16 | 16 | */ |
17 | 17 | class espresso_events_Registration_Form_Hooks_Extend extends espresso_events_Registration_Form_Hooks |
18 | 18 | { |
19 | - /** |
|
20 | - * extending the properties set in espresso_events_Registration_From_Hooks |
|
21 | - * |
|
22 | - * @access protected |
|
23 | - * @return void |
|
24 | - */ |
|
25 | - protected function _extend_properties() |
|
26 | - { |
|
27 | - $this->_metaboxes = array_merge( |
|
28 | - $this->_metaboxes, |
|
29 | - array( |
|
30 | - 1 => array( |
|
31 | - 'page_route' => array('create_new', 'edit'), |
|
32 | - 'func' => 'additional_questions', |
|
33 | - 'label' => esc_html__('Questions for Additional Registrants', 'event_espresso'), |
|
34 | - 'priority' => 'default', |
|
35 | - 'context' => 'side', |
|
36 | - ), |
|
37 | - ) |
|
38 | - ); |
|
39 | - $this->_scripts_styles = array( |
|
40 | - 'registers' => array( |
|
41 | - 'extended-event-editor' => array( |
|
42 | - 'url' => EE_CORE_CAF_ADMIN_EXTEND_URL |
|
43 | - . 'registration_form/assets/event-editor-question-groups.js', |
|
44 | - 'depends' => array('jquery'), |
|
45 | - ), |
|
46 | - ), |
|
47 | - 'enqueues' => array( |
|
48 | - 'extended-event-editor' => array('edit', 'create_new'), |
|
49 | - ), |
|
50 | - ); |
|
51 | - } |
|
52 | - |
|
53 | - |
|
54 | - /** |
|
55 | - * @param Callable[] $callbacks |
|
56 | - * @return array |
|
57 | - */ |
|
58 | - public function modify_callbacks($callbacks) |
|
59 | - { |
|
60 | - $callbacks = parent::modify_callbacks($callbacks); |
|
61 | - $callbacks[] = array($this, 'additional_question_group_update'); |
|
62 | - return $callbacks; |
|
63 | - } |
|
64 | - |
|
65 | - |
|
66 | - /** |
|
67 | - * Call back hooked into revision restores. |
|
68 | - * |
|
69 | - * @param $post_id |
|
70 | - * @param $revision_id |
|
71 | - * @return EE_Base_Class|void |
|
72 | - * @throws EE_Error |
|
73 | - * @throws InvalidArgumentException |
|
74 | - * @throws InvalidDataTypeException |
|
75 | - * @throws InvalidInterfaceException |
|
76 | - * @throws ReflectionException |
|
77 | - */ |
|
78 | - public function restore_revision($post_id, $revision_id) |
|
79 | - { |
|
80 | - $post_evt = parent::restore_revision($post_id, $revision_id); |
|
81 | - |
|
82 | - // restore revision for additional questions |
|
83 | - $post_evt->restore_revision( |
|
84 | - $revision_id, |
|
85 | - ['Question_Group'], |
|
86 | - [ |
|
87 | - 'Question_Group' => ['Event_Question_Group.EQG_additional' => true], |
|
88 | - ] |
|
89 | - ); |
|
90 | - } |
|
91 | - |
|
92 | - |
|
93 | - /** |
|
94 | - * @param $post_id |
|
95 | - * @param $post |
|
96 | - * @throws EE_Error |
|
97 | - * @throws InvalidArgumentException |
|
98 | - * @throws InvalidDataTypeException |
|
99 | - * @throws InvalidInterfaceException |
|
100 | - */ |
|
101 | - public function additional_questions($post_id, $post) |
|
102 | - { |
|
103 | - $this->_event = $this->_adminpage_obj->get_event_object(); |
|
104 | - $event_id = $this->_event->ID(); |
|
105 | - ?> |
|
19 | + /** |
|
20 | + * extending the properties set in espresso_events_Registration_From_Hooks |
|
21 | + * |
|
22 | + * @access protected |
|
23 | + * @return void |
|
24 | + */ |
|
25 | + protected function _extend_properties() |
|
26 | + { |
|
27 | + $this->_metaboxes = array_merge( |
|
28 | + $this->_metaboxes, |
|
29 | + array( |
|
30 | + 1 => array( |
|
31 | + 'page_route' => array('create_new', 'edit'), |
|
32 | + 'func' => 'additional_questions', |
|
33 | + 'label' => esc_html__('Questions for Additional Registrants', 'event_espresso'), |
|
34 | + 'priority' => 'default', |
|
35 | + 'context' => 'side', |
|
36 | + ), |
|
37 | + ) |
|
38 | + ); |
|
39 | + $this->_scripts_styles = array( |
|
40 | + 'registers' => array( |
|
41 | + 'extended-event-editor' => array( |
|
42 | + 'url' => EE_CORE_CAF_ADMIN_EXTEND_URL |
|
43 | + . 'registration_form/assets/event-editor-question-groups.js', |
|
44 | + 'depends' => array('jquery'), |
|
45 | + ), |
|
46 | + ), |
|
47 | + 'enqueues' => array( |
|
48 | + 'extended-event-editor' => array('edit', 'create_new'), |
|
49 | + ), |
|
50 | + ); |
|
51 | + } |
|
52 | + |
|
53 | + |
|
54 | + /** |
|
55 | + * @param Callable[] $callbacks |
|
56 | + * @return array |
|
57 | + */ |
|
58 | + public function modify_callbacks($callbacks) |
|
59 | + { |
|
60 | + $callbacks = parent::modify_callbacks($callbacks); |
|
61 | + $callbacks[] = array($this, 'additional_question_group_update'); |
|
62 | + return $callbacks; |
|
63 | + } |
|
64 | + |
|
65 | + |
|
66 | + /** |
|
67 | + * Call back hooked into revision restores. |
|
68 | + * |
|
69 | + * @param $post_id |
|
70 | + * @param $revision_id |
|
71 | + * @return EE_Base_Class|void |
|
72 | + * @throws EE_Error |
|
73 | + * @throws InvalidArgumentException |
|
74 | + * @throws InvalidDataTypeException |
|
75 | + * @throws InvalidInterfaceException |
|
76 | + * @throws ReflectionException |
|
77 | + */ |
|
78 | + public function restore_revision($post_id, $revision_id) |
|
79 | + { |
|
80 | + $post_evt = parent::restore_revision($post_id, $revision_id); |
|
81 | + |
|
82 | + // restore revision for additional questions |
|
83 | + $post_evt->restore_revision( |
|
84 | + $revision_id, |
|
85 | + ['Question_Group'], |
|
86 | + [ |
|
87 | + 'Question_Group' => ['Event_Question_Group.EQG_additional' => true], |
|
88 | + ] |
|
89 | + ); |
|
90 | + } |
|
91 | + |
|
92 | + |
|
93 | + /** |
|
94 | + * @param $post_id |
|
95 | + * @param $post |
|
96 | + * @throws EE_Error |
|
97 | + * @throws InvalidArgumentException |
|
98 | + * @throws InvalidDataTypeException |
|
99 | + * @throws InvalidInterfaceException |
|
100 | + */ |
|
101 | + public function additional_questions($post_id, $post) |
|
102 | + { |
|
103 | + $this->_event = $this->_adminpage_obj->get_event_object(); |
|
104 | + $event_id = $this->_event->ID(); |
|
105 | + ?> |
|
106 | 106 | <div class="inside"> |
107 | 107 | <p><strong> |
108 | 108 | <?php esc_html_e('Question Groups', 'event_espresso'); ?> |
109 | 109 | </strong><br/> |
110 | 110 | <?php |
111 | - printf( |
|
112 | - esc_html__( |
|
113 | - 'Add a pre-populated %1$sgroup of questions%2$s to your event.', |
|
114 | - 'event_espresso' |
|
115 | - ), |
|
116 | - '<a href="admin.php?page=espresso_registration_form" target="_blank">', |
|
117 | - '</a>' |
|
118 | - ); |
|
119 | - ?> |
|
111 | + printf( |
|
112 | + esc_html__( |
|
113 | + 'Add a pre-populated %1$sgroup of questions%2$s to your event.', |
|
114 | + 'event_espresso' |
|
115 | + ), |
|
116 | + '<a href="admin.php?page=espresso_registration_form" target="_blank">', |
|
117 | + '</a>' |
|
118 | + ); |
|
119 | + ?> |
|
120 | 120 | </p> |
121 | 121 | <?php |
122 | 122 | |
123 | - $qsg_where['QSG_deleted'] = false; |
|
124 | - $query_params = apply_filters( |
|
125 | - 'FHEE__espresso_events_Registration_Form_Hooks_Extend__additional_questions__question_group_query_parameters', |
|
126 | - array($qsg_where, 'order_by' => array('QSG_order' => 'ASC')) |
|
127 | - ); |
|
128 | - $QSGs = EEM_Question_Group::instance()->get_all($query_params); |
|
129 | - $EQGs = ! empty($event_id) |
|
130 | - ? $this->_event->get_many_related( |
|
131 | - 'Question_Group', |
|
132 | - [['Event_Question_Group.EQG_additional' => true]] |
|
133 | - ) |
|
134 | - : []; |
|
135 | - $EQGids = array_keys($EQGs); |
|
136 | - |
|
137 | - if (! empty($QSGs)) { |
|
138 | - $html = count($QSGs) > 10 ? '<div style="height:250px;overflow:auto;">' : ''; |
|
139 | - foreach ($QSGs as $QSG) { |
|
140 | - $checked = in_array($QSG->ID(), $EQGids, true) ? ' checked ' : ''; |
|
141 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce( |
|
142 | - array( |
|
143 | - 'action' => 'edit_question_group', |
|
144 | - 'QSG_ID' => $QSG->ID(), |
|
145 | - ), |
|
146 | - EE_FORMS_ADMIN_URL |
|
147 | - ); |
|
148 | - |
|
149 | - $html .= ' |
|
123 | + $qsg_where['QSG_deleted'] = false; |
|
124 | + $query_params = apply_filters( |
|
125 | + 'FHEE__espresso_events_Registration_Form_Hooks_Extend__additional_questions__question_group_query_parameters', |
|
126 | + array($qsg_where, 'order_by' => array('QSG_order' => 'ASC')) |
|
127 | + ); |
|
128 | + $QSGs = EEM_Question_Group::instance()->get_all($query_params); |
|
129 | + $EQGs = ! empty($event_id) |
|
130 | + ? $this->_event->get_many_related( |
|
131 | + 'Question_Group', |
|
132 | + [['Event_Question_Group.EQG_additional' => true]] |
|
133 | + ) |
|
134 | + : []; |
|
135 | + $EQGids = array_keys($EQGs); |
|
136 | + |
|
137 | + if (! empty($QSGs)) { |
|
138 | + $html = count($QSGs) > 10 ? '<div style="height:250px;overflow:auto;">' : ''; |
|
139 | + foreach ($QSGs as $QSG) { |
|
140 | + $checked = in_array($QSG->ID(), $EQGids, true) ? ' checked ' : ''; |
|
141 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce( |
|
142 | + array( |
|
143 | + 'action' => 'edit_question_group', |
|
144 | + 'QSG_ID' => $QSG->ID(), |
|
145 | + ), |
|
146 | + EE_FORMS_ADMIN_URL |
|
147 | + ); |
|
148 | + |
|
149 | + $html .= ' |
|
150 | 150 | <p id="event-question-group-' . $QSG->ID() . '"> |
151 | 151 | <input value="' . $QSG->ID() . '"' |
152 | - . ' type="checkbox" name="add_attendee_question_groups[' . $QSG->ID() . ']"' . $checked . ' /> |
|
152 | + . ' type="checkbox" name="add_attendee_question_groups[' . $QSG->ID() . ']"' . $checked . ' /> |
|
153 | 153 | <a href="' . $edit_link . '" |
154 | 154 | aria-label="' . sprintf(esc_attr__('Edit %s Group', 'event_espresso'), $QSG->get('QSG_name')) . '" |
155 | 155 | target="_blank" |
@@ -157,67 +157,67 @@ discard block |
||
157 | 157 | ' . $QSG->get('QSG_name') . ' |
158 | 158 | </a> |
159 | 159 | </p>'; |
160 | - if ($QSG->ID() === 2) { |
|
161 | - $html .= ' |
|
160 | + if ($QSG->ID() === 2) { |
|
161 | + $html .= ' |
|
162 | 162 | <p id="question-group-requirements-notice-pg" class="important-notice small-text" style="display: none;"> |
163 | 163 | ' . esc_html__( |
164 | - 'The Personal Information question group is required whenever the Address Information question group is activated.', |
|
165 | - 'event_espresso' |
|
166 | - ) . ' |
|
164 | + 'The Personal Information question group is required whenever the Address Information question group is activated.', |
|
165 | + 'event_espresso' |
|
166 | + ) . ' |
|
167 | 167 | </p>'; |
168 | - } |
|
169 | - } |
|
170 | - $html .= count($QSGs) > 10 ? '</div>' : ''; |
|
171 | - |
|
172 | - echo wp_kses($html, AllowedTags::getWithFormTags()); |
|
173 | - } else { |
|
174 | - esc_html_e( |
|
175 | - 'There seems to be a problem with your questions. Please contact [email protected]', |
|
176 | - 'event_espresso' |
|
177 | - ); |
|
178 | - } |
|
179 | - do_action('AHEE__espresso_events_Registration_Form_Hooks__additional_questions__after_content'); |
|
180 | - ?> |
|
168 | + } |
|
169 | + } |
|
170 | + $html .= count($QSGs) > 10 ? '</div>' : ''; |
|
171 | + |
|
172 | + echo wp_kses($html, AllowedTags::getWithFormTags()); |
|
173 | + } else { |
|
174 | + esc_html_e( |
|
175 | + 'There seems to be a problem with your questions. Please contact [email protected]', |
|
176 | + 'event_espresso' |
|
177 | + ); |
|
178 | + } |
|
179 | + do_action('AHEE__espresso_events_Registration_Form_Hooks__additional_questions__after_content'); |
|
180 | + ?> |
|
181 | 181 | </div> |
182 | 182 | <?php |
183 | - } |
|
184 | - |
|
185 | - |
|
186 | - public function additional_question_group_update($evtobj, $data) |
|
187 | - { |
|
188 | - $question_groups = ! empty($data['add_attendee_question_groups']) |
|
189 | - ? (array) $data['add_attendee_question_groups'] |
|
190 | - : []; |
|
191 | - $added_qgs = array_keys($question_groups); |
|
192 | - $success = []; |
|
193 | - |
|
194 | - // let's get all current question groups associated with this event. |
|
195 | - $current_qgs = $evtobj->get_many_related( |
|
196 | - 'Question_Group', |
|
197 | - [['Event_Question_Group.EQG_additional' => true]] |
|
198 | - ); |
|
199 | - $current_qgs = array_keys($current_qgs); // we just want the ids |
|
200 | - |
|
201 | - // now let's get the groups selected in the editor and update (IF we have data) |
|
202 | - if (! empty($question_groups)) { |
|
203 | - foreach ($question_groups as $qgid) { |
|
204 | - // add to event |
|
205 | - if ($qgid) { |
|
206 | - $qg = $evtobj->add_question_group($qgid, false); |
|
207 | - } |
|
208 | - $success[] = ! empty($qg) ? 1 : 0; |
|
209 | - } |
|
210 | - } |
|
211 | - |
|
212 | - // wait a minute... are there question groups missing in the saved groups that ARE with the current event? |
|
213 | - $removed_qgs = array_diff($current_qgs, $added_qgs); |
|
214 | - |
|
215 | - foreach ($removed_qgs as $qgid) { |
|
216 | - $qg = $evtobj->remove_question_group($qgid, false); |
|
217 | - $success[] = ! empty($qg) ? 1 : 0; |
|
218 | - } |
|
219 | - |
|
220 | - |
|
221 | - return in_array(0, $success, true) ? false : true; |
|
222 | - } |
|
183 | + } |
|
184 | + |
|
185 | + |
|
186 | + public function additional_question_group_update($evtobj, $data) |
|
187 | + { |
|
188 | + $question_groups = ! empty($data['add_attendee_question_groups']) |
|
189 | + ? (array) $data['add_attendee_question_groups'] |
|
190 | + : []; |
|
191 | + $added_qgs = array_keys($question_groups); |
|
192 | + $success = []; |
|
193 | + |
|
194 | + // let's get all current question groups associated with this event. |
|
195 | + $current_qgs = $evtobj->get_many_related( |
|
196 | + 'Question_Group', |
|
197 | + [['Event_Question_Group.EQG_additional' => true]] |
|
198 | + ); |
|
199 | + $current_qgs = array_keys($current_qgs); // we just want the ids |
|
200 | + |
|
201 | + // now let's get the groups selected in the editor and update (IF we have data) |
|
202 | + if (! empty($question_groups)) { |
|
203 | + foreach ($question_groups as $qgid) { |
|
204 | + // add to event |
|
205 | + if ($qgid) { |
|
206 | + $qg = $evtobj->add_question_group($qgid, false); |
|
207 | + } |
|
208 | + $success[] = ! empty($qg) ? 1 : 0; |
|
209 | + } |
|
210 | + } |
|
211 | + |
|
212 | + // wait a minute... are there question groups missing in the saved groups that ARE with the current event? |
|
213 | + $removed_qgs = array_diff($current_qgs, $added_qgs); |
|
214 | + |
|
215 | + foreach ($removed_qgs as $qgid) { |
|
216 | + $qg = $evtobj->remove_question_group($qgid, false); |
|
217 | + $success[] = ! empty($qg) ? 1 : 0; |
|
218 | + } |
|
219 | + |
|
220 | + |
|
221 | + return in_array(0, $success, true) ? false : true; |
|
222 | + } |
|
223 | 223 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | : []; |
135 | 135 | $EQGids = array_keys($EQGs); |
136 | 136 | |
137 | - if (! empty($QSGs)) { |
|
137 | + if ( ! empty($QSGs)) { |
|
138 | 138 | $html = count($QSGs) > 10 ? '<div style="height:250px;overflow:auto;">' : ''; |
139 | 139 | foreach ($QSGs as $QSG) { |
140 | 140 | $checked = in_array($QSG->ID(), $EQGids, true) ? ' checked ' : ''; |
@@ -147,14 +147,14 @@ discard block |
||
147 | 147 | ); |
148 | 148 | |
149 | 149 | $html .= ' |
150 | - <p id="event-question-group-' . $QSG->ID() . '"> |
|
151 | - <input value="' . $QSG->ID() . '"' |
|
152 | - . ' type="checkbox" name="add_attendee_question_groups[' . $QSG->ID() . ']"' . $checked . ' /> |
|
153 | - <a href="' . $edit_link . '" |
|
154 | - aria-label="' . sprintf(esc_attr__('Edit %s Group', 'event_espresso'), $QSG->get('QSG_name')) . '" |
|
150 | + <p id="event-question-group-' . $QSG->ID().'"> |
|
151 | + <input value="' . $QSG->ID().'"' |
|
152 | + . ' type="checkbox" name="add_attendee_question_groups['.$QSG->ID().']"'.$checked.' /> |
|
153 | + <a href="' . $edit_link.'" |
|
154 | + aria-label="' . sprintf(esc_attr__('Edit %s Group', 'event_espresso'), $QSG->get('QSG_name')).'" |
|
155 | 155 | target="_blank" |
156 | 156 | > |
157 | - ' . $QSG->get('QSG_name') . ' |
|
157 | + ' . $QSG->get('QSG_name').' |
|
158 | 158 | </a> |
159 | 159 | </p>'; |
160 | 160 | if ($QSG->ID() === 2) { |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | ' . esc_html__( |
164 | 164 | 'The Personal Information question group is required whenever the Address Information question group is activated.', |
165 | 165 | 'event_espresso' |
166 | - ) . ' |
|
166 | + ).' |
|
167 | 167 | </p>'; |
168 | 168 | } |
169 | 169 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $current_qgs = array_keys($current_qgs); // we just want the ids |
200 | 200 | |
201 | 201 | // now let's get the groups selected in the editor and update (IF we have data) |
202 | - if (! empty($question_groups)) { |
|
202 | + if ( ! empty($question_groups)) { |
|
203 | 203 | foreach ($question_groups as $qgid) { |
204 | 204 | // add to event |
205 | 205 | if ($qgid) { |
@@ -28,241 +28,241 @@ |
||
28 | 28 | */ |
29 | 29 | class Registration_Form_Question_Groups_Admin_List_Table extends EE_Admin_List_Table |
30 | 30 | { |
31 | - public function __construct($admin_page) |
|
32 | - { |
|
33 | - parent::__construct($admin_page); |
|
34 | - } |
|
35 | - |
|
36 | - |
|
37 | - protected function _setup_data() |
|
38 | - { |
|
39 | - $this->_data = $this->_view != 'trash' |
|
40 | - ? $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, false) |
|
41 | - : $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, false); |
|
42 | - $this->_all_data_count = $this->_view != 'trash' |
|
43 | - ? $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, true) |
|
44 | - : $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, true); |
|
45 | - } |
|
46 | - |
|
47 | - |
|
48 | - protected function _set_properties() |
|
49 | - { |
|
50 | - $this->_wp_list_args = array( |
|
51 | - 'singular' => esc_html__('question group', 'event_espresso'), |
|
52 | - 'plural' => esc_html__('question groups', 'event_espresso'), |
|
53 | - 'ajax' => true, // for now, |
|
54 | - 'screen' => $this->_admin_page->get_current_screen()->id, |
|
55 | - ); |
|
56 | - |
|
57 | - $this->_columns = array( |
|
58 | - 'cb' => '<input type="checkbox" />', |
|
59 | - 'id' => esc_html__('ID', 'event_espresso'), |
|
60 | - 'name' => esc_html__('Group Name', 'event_espresso'), |
|
61 | - 'description' => esc_html__('Description', 'event_espresso'), |
|
62 | - 'show_group_name' => esc_html__('Show Name', 'event_espresso'), |
|
63 | - 'show_group_desc' => esc_html__('Show Desc', 'event_espresso'), |
|
64 | - ); |
|
65 | - |
|
66 | - $this->_sortable_columns = array( |
|
67 | - 'id' => array('QSG_ID' => false), |
|
68 | - 'name' => array('QSG_name' => false), |
|
69 | - ); |
|
70 | - |
|
71 | - $this->_hidden_columns = array( |
|
72 | - 'id', |
|
73 | - ); |
|
74 | - |
|
75 | - $this->_ajax_sorting_callback = 'update_question_group_order'; |
|
76 | - } |
|
77 | - |
|
78 | - |
|
79 | - // not needed |
|
80 | - protected function _get_table_filters() |
|
81 | - { |
|
82 | - return array(); |
|
83 | - } |
|
84 | - |
|
85 | - |
|
86 | - protected function _add_view_counts() |
|
87 | - { |
|
88 | - $this->_views['all']['count'] = $this->_admin_page->get_question_groups( |
|
89 | - $this->_per_page, |
|
90 | - $this->_current_page, |
|
91 | - true |
|
92 | - ); |
|
93 | - if ( |
|
94 | - EE_Registry::instance()->CAP->current_user_can( |
|
95 | - 'ee_delete_question_groups', |
|
96 | - 'espresso_registration_form_trash_question_group' |
|
97 | - ) |
|
98 | - ) { |
|
99 | - $this->_views['trash']['count'] = $this->_admin_page->get_trashed_question_groups( |
|
100 | - $this->_per_page, |
|
101 | - $this->_current_page, |
|
102 | - true |
|
103 | - ); |
|
104 | - } |
|
105 | - } |
|
106 | - |
|
107 | - |
|
108 | - public function column_cb($item) |
|
109 | - { |
|
110 | - $system_group = $item->get('QSG_system'); |
|
111 | - $has_questions_with_answers = $item->has_questions_with_answers(); |
|
112 | - $lock_icon = $system_group === 0 && $this->_view == 'trash' && $has_questions_with_answers |
|
113 | - ? 'ee-lock-icon ee-alternate-color' |
|
114 | - : 'ee-lock-icon ee-system-lock'; |
|
115 | - return $system_group > 0 |
|
116 | - || ($system_group === 0 |
|
117 | - && $this->_view == 'trash' |
|
118 | - && $has_questions_with_answers |
|
119 | - ) |
|
120 | - || ! EE_Registry::instance()->CAP->current_user_can( |
|
121 | - 'ee_delete_question_groups', |
|
122 | - 'espresso_registration_form_trash_question_groups', |
|
123 | - $item->ID() |
|
124 | - ) |
|
125 | - ? '<span class="' . $lock_icon . '"></span>' |
|
126 | - . sprintf( |
|
127 | - '<input type="hidden" name="hdnchk[%1$d]" value="%1$d" />', |
|
128 | - $item->ID() |
|
129 | - ) |
|
130 | - : sprintf( |
|
131 | - '<input type="checkbox" id="QSG_ID[%1$d]" name="checkbox[%1$d]" value="%1$d" />', |
|
132 | - $item->ID() |
|
133 | - ); |
|
134 | - } |
|
135 | - |
|
136 | - |
|
137 | - public function column_id(EE_Question_Group $item) |
|
138 | - { |
|
139 | - $content = $item->ID(); |
|
140 | - $content .= ' <span class="show-on-mobile-view-only">' . $item->name() . '</span>'; |
|
141 | - return $content; |
|
142 | - } |
|
143 | - |
|
144 | - |
|
145 | - public function column_name(EE_Question_Group $item) |
|
146 | - { |
|
147 | - $actions = array(); |
|
148 | - |
|
149 | - // return $item->name(); |
|
150 | - if (! defined('REG_ADMIN_URL')) { |
|
151 | - define('REG_ADMIN_URL', EVENTS_ADMIN_URL); |
|
152 | - } |
|
153 | - |
|
154 | - $edit_query_args = array( |
|
155 | - 'action' => 'edit_question_group', |
|
156 | - 'QSG_ID' => $item->ID(), |
|
157 | - ); |
|
158 | - |
|
159 | - $trash_query_args = array( |
|
160 | - 'action' => 'trash_question_group', |
|
161 | - 'QSG_ID' => $item->ID(), |
|
162 | - ); |
|
163 | - |
|
164 | - $restore_query_args = array( |
|
165 | - 'action' => 'restore_question_group', |
|
166 | - 'QSG_ID' => $item->ID(), |
|
167 | - ); |
|
168 | - |
|
169 | - $delete_query_args = array( |
|
170 | - 'action' => 'delete_question_group', |
|
171 | - 'QSG_ID' => $item->ID(), |
|
172 | - ); |
|
173 | - |
|
174 | - |
|
175 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL); |
|
176 | - $trash_link = EE_Admin_Page::add_query_args_and_nonce($trash_query_args, EE_FORMS_ADMIN_URL); |
|
177 | - $restore_link = EE_Admin_Page::add_query_args_and_nonce($restore_query_args, EE_FORMS_ADMIN_URL); |
|
178 | - $delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_FORMS_ADMIN_URL); |
|
179 | - |
|
180 | - if ( |
|
181 | - EE_Registry::instance()->CAP->current_user_can( |
|
182 | - 'ee_edit_question_group', |
|
183 | - 'espresso_registration_form_edit_question_group', |
|
184 | - $item->ID() |
|
185 | - ) |
|
186 | - ) { |
|
187 | - $actions = array( |
|
188 | - 'edit' => '<a href="' . $edit_link . '" aria-label="' |
|
189 | - . esc_attr__('Edit Question Group', 'event_espresso') . '">' |
|
190 | - . esc_html__('Edit', 'event_espresso') . '</a>', |
|
191 | - ); |
|
192 | - } |
|
193 | - if ( |
|
194 | - $item->get('QSG_system') < 1 |
|
195 | - && $this->_view != 'trash' |
|
196 | - && EE_Registry::instance()->CAP->current_user_can( |
|
197 | - 'ee_delete_question_group', |
|
198 | - 'espresso_registration_form_trash_question_group', |
|
199 | - $item->ID() |
|
200 | - ) |
|
201 | - ) { |
|
202 | - $actions['delete'] = '<a href="' . $trash_link . '" aria-label="' |
|
203 | - . esc_attr__('Delete Question Group', 'event_espresso') . '">' |
|
204 | - . esc_html__('Trash', 'event_espresso') . '</a>'; |
|
205 | - } |
|
206 | - |
|
207 | - if ($this->_view == 'trash') { |
|
208 | - if ( |
|
209 | - EE_Registry::instance()->CAP->current_user_can( |
|
210 | - 'ee_delete_question_group', |
|
211 | - 'espresso_registration_form_restore_question_group', |
|
212 | - $item->ID() |
|
213 | - ) |
|
214 | - ) { |
|
215 | - $actions['restore'] = '<a href="' . $restore_link . '" aria-label="' |
|
216 | - . esc_attr__('Restore Question Group', 'event_espresso') . '">' |
|
217 | - . esc_html__('Restore', 'event_espresso') . '</a>'; |
|
218 | - } |
|
219 | - |
|
220 | - if ( |
|
221 | - ! $item->has_questions_with_answers() |
|
222 | - && EE_Registry::instance()->CAP->current_user_can( |
|
223 | - 'ee_delete_question_group', |
|
224 | - 'espresso_registration_form_delete_question_group', |
|
225 | - $item->ID() |
|
226 | - ) |
|
227 | - ) { |
|
228 | - $actions['delete'] = '<a href="' . $delete_link . '" aria-label="' |
|
229 | - . esc_attr__('Delete Question Group Permanently', 'event_espresso') . '">' |
|
230 | - . esc_html__('Delete Permanently', 'event_espresso') . '</a>'; |
|
231 | - } |
|
232 | - } |
|
233 | - |
|
234 | - $content = EE_Registry::instance()->CAP->current_user_can( |
|
235 | - 'ee_edit_question_group', |
|
236 | - 'espresso_registration_form_edit_question_group', |
|
237 | - $item->ID() |
|
238 | - ) |
|
239 | - ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->name() . '</a></strong>' |
|
240 | - : $item->name(); |
|
241 | - $content .= $this->row_actions($actions); |
|
242 | - return $content; |
|
243 | - } |
|
244 | - |
|
245 | - |
|
246 | - public function column_identifier(EE_Question_Group $item) |
|
247 | - { |
|
248 | - return $item->identifier(); |
|
249 | - } |
|
250 | - |
|
251 | - |
|
252 | - public function column_description(EE_Question_Group $item) |
|
253 | - { |
|
254 | - return $item->desc(); |
|
255 | - } |
|
256 | - |
|
257 | - |
|
258 | - public function column_show_group_name(EE_Question_Group $item) |
|
259 | - { |
|
260 | - return $this->_yes_no[ $item->show_group_name() ]; |
|
261 | - } |
|
262 | - |
|
263 | - |
|
264 | - public function column_show_group_desc(EE_Question_Group $item) |
|
265 | - { |
|
266 | - return $this->_yes_no[ $item->show_group_desc() ]; |
|
267 | - } |
|
31 | + public function __construct($admin_page) |
|
32 | + { |
|
33 | + parent::__construct($admin_page); |
|
34 | + } |
|
35 | + |
|
36 | + |
|
37 | + protected function _setup_data() |
|
38 | + { |
|
39 | + $this->_data = $this->_view != 'trash' |
|
40 | + ? $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, false) |
|
41 | + : $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, false); |
|
42 | + $this->_all_data_count = $this->_view != 'trash' |
|
43 | + ? $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, true) |
|
44 | + : $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, true); |
|
45 | + } |
|
46 | + |
|
47 | + |
|
48 | + protected function _set_properties() |
|
49 | + { |
|
50 | + $this->_wp_list_args = array( |
|
51 | + 'singular' => esc_html__('question group', 'event_espresso'), |
|
52 | + 'plural' => esc_html__('question groups', 'event_espresso'), |
|
53 | + 'ajax' => true, // for now, |
|
54 | + 'screen' => $this->_admin_page->get_current_screen()->id, |
|
55 | + ); |
|
56 | + |
|
57 | + $this->_columns = array( |
|
58 | + 'cb' => '<input type="checkbox" />', |
|
59 | + 'id' => esc_html__('ID', 'event_espresso'), |
|
60 | + 'name' => esc_html__('Group Name', 'event_espresso'), |
|
61 | + 'description' => esc_html__('Description', 'event_espresso'), |
|
62 | + 'show_group_name' => esc_html__('Show Name', 'event_espresso'), |
|
63 | + 'show_group_desc' => esc_html__('Show Desc', 'event_espresso'), |
|
64 | + ); |
|
65 | + |
|
66 | + $this->_sortable_columns = array( |
|
67 | + 'id' => array('QSG_ID' => false), |
|
68 | + 'name' => array('QSG_name' => false), |
|
69 | + ); |
|
70 | + |
|
71 | + $this->_hidden_columns = array( |
|
72 | + 'id', |
|
73 | + ); |
|
74 | + |
|
75 | + $this->_ajax_sorting_callback = 'update_question_group_order'; |
|
76 | + } |
|
77 | + |
|
78 | + |
|
79 | + // not needed |
|
80 | + protected function _get_table_filters() |
|
81 | + { |
|
82 | + return array(); |
|
83 | + } |
|
84 | + |
|
85 | + |
|
86 | + protected function _add_view_counts() |
|
87 | + { |
|
88 | + $this->_views['all']['count'] = $this->_admin_page->get_question_groups( |
|
89 | + $this->_per_page, |
|
90 | + $this->_current_page, |
|
91 | + true |
|
92 | + ); |
|
93 | + if ( |
|
94 | + EE_Registry::instance()->CAP->current_user_can( |
|
95 | + 'ee_delete_question_groups', |
|
96 | + 'espresso_registration_form_trash_question_group' |
|
97 | + ) |
|
98 | + ) { |
|
99 | + $this->_views['trash']['count'] = $this->_admin_page->get_trashed_question_groups( |
|
100 | + $this->_per_page, |
|
101 | + $this->_current_page, |
|
102 | + true |
|
103 | + ); |
|
104 | + } |
|
105 | + } |
|
106 | + |
|
107 | + |
|
108 | + public function column_cb($item) |
|
109 | + { |
|
110 | + $system_group = $item->get('QSG_system'); |
|
111 | + $has_questions_with_answers = $item->has_questions_with_answers(); |
|
112 | + $lock_icon = $system_group === 0 && $this->_view == 'trash' && $has_questions_with_answers |
|
113 | + ? 'ee-lock-icon ee-alternate-color' |
|
114 | + : 'ee-lock-icon ee-system-lock'; |
|
115 | + return $system_group > 0 |
|
116 | + || ($system_group === 0 |
|
117 | + && $this->_view == 'trash' |
|
118 | + && $has_questions_with_answers |
|
119 | + ) |
|
120 | + || ! EE_Registry::instance()->CAP->current_user_can( |
|
121 | + 'ee_delete_question_groups', |
|
122 | + 'espresso_registration_form_trash_question_groups', |
|
123 | + $item->ID() |
|
124 | + ) |
|
125 | + ? '<span class="' . $lock_icon . '"></span>' |
|
126 | + . sprintf( |
|
127 | + '<input type="hidden" name="hdnchk[%1$d]" value="%1$d" />', |
|
128 | + $item->ID() |
|
129 | + ) |
|
130 | + : sprintf( |
|
131 | + '<input type="checkbox" id="QSG_ID[%1$d]" name="checkbox[%1$d]" value="%1$d" />', |
|
132 | + $item->ID() |
|
133 | + ); |
|
134 | + } |
|
135 | + |
|
136 | + |
|
137 | + public function column_id(EE_Question_Group $item) |
|
138 | + { |
|
139 | + $content = $item->ID(); |
|
140 | + $content .= ' <span class="show-on-mobile-view-only">' . $item->name() . '</span>'; |
|
141 | + return $content; |
|
142 | + } |
|
143 | + |
|
144 | + |
|
145 | + public function column_name(EE_Question_Group $item) |
|
146 | + { |
|
147 | + $actions = array(); |
|
148 | + |
|
149 | + // return $item->name(); |
|
150 | + if (! defined('REG_ADMIN_URL')) { |
|
151 | + define('REG_ADMIN_URL', EVENTS_ADMIN_URL); |
|
152 | + } |
|
153 | + |
|
154 | + $edit_query_args = array( |
|
155 | + 'action' => 'edit_question_group', |
|
156 | + 'QSG_ID' => $item->ID(), |
|
157 | + ); |
|
158 | + |
|
159 | + $trash_query_args = array( |
|
160 | + 'action' => 'trash_question_group', |
|
161 | + 'QSG_ID' => $item->ID(), |
|
162 | + ); |
|
163 | + |
|
164 | + $restore_query_args = array( |
|
165 | + 'action' => 'restore_question_group', |
|
166 | + 'QSG_ID' => $item->ID(), |
|
167 | + ); |
|
168 | + |
|
169 | + $delete_query_args = array( |
|
170 | + 'action' => 'delete_question_group', |
|
171 | + 'QSG_ID' => $item->ID(), |
|
172 | + ); |
|
173 | + |
|
174 | + |
|
175 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL); |
|
176 | + $trash_link = EE_Admin_Page::add_query_args_and_nonce($trash_query_args, EE_FORMS_ADMIN_URL); |
|
177 | + $restore_link = EE_Admin_Page::add_query_args_and_nonce($restore_query_args, EE_FORMS_ADMIN_URL); |
|
178 | + $delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_FORMS_ADMIN_URL); |
|
179 | + |
|
180 | + if ( |
|
181 | + EE_Registry::instance()->CAP->current_user_can( |
|
182 | + 'ee_edit_question_group', |
|
183 | + 'espresso_registration_form_edit_question_group', |
|
184 | + $item->ID() |
|
185 | + ) |
|
186 | + ) { |
|
187 | + $actions = array( |
|
188 | + 'edit' => '<a href="' . $edit_link . '" aria-label="' |
|
189 | + . esc_attr__('Edit Question Group', 'event_espresso') . '">' |
|
190 | + . esc_html__('Edit', 'event_espresso') . '</a>', |
|
191 | + ); |
|
192 | + } |
|
193 | + if ( |
|
194 | + $item->get('QSG_system') < 1 |
|
195 | + && $this->_view != 'trash' |
|
196 | + && EE_Registry::instance()->CAP->current_user_can( |
|
197 | + 'ee_delete_question_group', |
|
198 | + 'espresso_registration_form_trash_question_group', |
|
199 | + $item->ID() |
|
200 | + ) |
|
201 | + ) { |
|
202 | + $actions['delete'] = '<a href="' . $trash_link . '" aria-label="' |
|
203 | + . esc_attr__('Delete Question Group', 'event_espresso') . '">' |
|
204 | + . esc_html__('Trash', 'event_espresso') . '</a>'; |
|
205 | + } |
|
206 | + |
|
207 | + if ($this->_view == 'trash') { |
|
208 | + if ( |
|
209 | + EE_Registry::instance()->CAP->current_user_can( |
|
210 | + 'ee_delete_question_group', |
|
211 | + 'espresso_registration_form_restore_question_group', |
|
212 | + $item->ID() |
|
213 | + ) |
|
214 | + ) { |
|
215 | + $actions['restore'] = '<a href="' . $restore_link . '" aria-label="' |
|
216 | + . esc_attr__('Restore Question Group', 'event_espresso') . '">' |
|
217 | + . esc_html__('Restore', 'event_espresso') . '</a>'; |
|
218 | + } |
|
219 | + |
|
220 | + if ( |
|
221 | + ! $item->has_questions_with_answers() |
|
222 | + && EE_Registry::instance()->CAP->current_user_can( |
|
223 | + 'ee_delete_question_group', |
|
224 | + 'espresso_registration_form_delete_question_group', |
|
225 | + $item->ID() |
|
226 | + ) |
|
227 | + ) { |
|
228 | + $actions['delete'] = '<a href="' . $delete_link . '" aria-label="' |
|
229 | + . esc_attr__('Delete Question Group Permanently', 'event_espresso') . '">' |
|
230 | + . esc_html__('Delete Permanently', 'event_espresso') . '</a>'; |
|
231 | + } |
|
232 | + } |
|
233 | + |
|
234 | + $content = EE_Registry::instance()->CAP->current_user_can( |
|
235 | + 'ee_edit_question_group', |
|
236 | + 'espresso_registration_form_edit_question_group', |
|
237 | + $item->ID() |
|
238 | + ) |
|
239 | + ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->name() . '</a></strong>' |
|
240 | + : $item->name(); |
|
241 | + $content .= $this->row_actions($actions); |
|
242 | + return $content; |
|
243 | + } |
|
244 | + |
|
245 | + |
|
246 | + public function column_identifier(EE_Question_Group $item) |
|
247 | + { |
|
248 | + return $item->identifier(); |
|
249 | + } |
|
250 | + |
|
251 | + |
|
252 | + public function column_description(EE_Question_Group $item) |
|
253 | + { |
|
254 | + return $item->desc(); |
|
255 | + } |
|
256 | + |
|
257 | + |
|
258 | + public function column_show_group_name(EE_Question_Group $item) |
|
259 | + { |
|
260 | + return $this->_yes_no[ $item->show_group_name() ]; |
|
261 | + } |
|
262 | + |
|
263 | + |
|
264 | + public function column_show_group_desc(EE_Question_Group $item) |
|
265 | + { |
|
266 | + return $this->_yes_no[ $item->show_group_desc() ]; |
|
267 | + } |
|
268 | 268 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | 'espresso_registration_form_trash_question_groups', |
123 | 123 | $item->ID() |
124 | 124 | ) |
125 | - ? '<span class="' . $lock_icon . '"></span>' |
|
125 | + ? '<span class="'.$lock_icon.'"></span>' |
|
126 | 126 | . sprintf( |
127 | 127 | '<input type="hidden" name="hdnchk[%1$d]" value="%1$d" />', |
128 | 128 | $item->ID() |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | public function column_id(EE_Question_Group $item) |
138 | 138 | { |
139 | 139 | $content = $item->ID(); |
140 | - $content .= ' <span class="show-on-mobile-view-only">' . $item->name() . '</span>'; |
|
140 | + $content .= ' <span class="show-on-mobile-view-only">'.$item->name().'</span>'; |
|
141 | 141 | return $content; |
142 | 142 | } |
143 | 143 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $actions = array(); |
148 | 148 | |
149 | 149 | // return $item->name(); |
150 | - if (! defined('REG_ADMIN_URL')) { |
|
150 | + if ( ! defined('REG_ADMIN_URL')) { |
|
151 | 151 | define('REG_ADMIN_URL', EVENTS_ADMIN_URL); |
152 | 152 | } |
153 | 153 | |
@@ -185,9 +185,9 @@ discard block |
||
185 | 185 | ) |
186 | 186 | ) { |
187 | 187 | $actions = array( |
188 | - 'edit' => '<a href="' . $edit_link . '" aria-label="' |
|
189 | - . esc_attr__('Edit Question Group', 'event_espresso') . '">' |
|
190 | - . esc_html__('Edit', 'event_espresso') . '</a>', |
|
188 | + 'edit' => '<a href="'.$edit_link.'" aria-label="' |
|
189 | + . esc_attr__('Edit Question Group', 'event_espresso').'">' |
|
190 | + . esc_html__('Edit', 'event_espresso').'</a>', |
|
191 | 191 | ); |
192 | 192 | } |
193 | 193 | if ( |
@@ -199,9 +199,9 @@ discard block |
||
199 | 199 | $item->ID() |
200 | 200 | ) |
201 | 201 | ) { |
202 | - $actions['delete'] = '<a href="' . $trash_link . '" aria-label="' |
|
203 | - . esc_attr__('Delete Question Group', 'event_espresso') . '">' |
|
204 | - . esc_html__('Trash', 'event_espresso') . '</a>'; |
|
202 | + $actions['delete'] = '<a href="'.$trash_link.'" aria-label="' |
|
203 | + . esc_attr__('Delete Question Group', 'event_espresso').'">' |
|
204 | + . esc_html__('Trash', 'event_espresso').'</a>'; |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | if ($this->_view == 'trash') { |
@@ -212,9 +212,9 @@ discard block |
||
212 | 212 | $item->ID() |
213 | 213 | ) |
214 | 214 | ) { |
215 | - $actions['restore'] = '<a href="' . $restore_link . '" aria-label="' |
|
216 | - . esc_attr__('Restore Question Group', 'event_espresso') . '">' |
|
217 | - . esc_html__('Restore', 'event_espresso') . '</a>'; |
|
215 | + $actions['restore'] = '<a href="'.$restore_link.'" aria-label="' |
|
216 | + . esc_attr__('Restore Question Group', 'event_espresso').'">' |
|
217 | + . esc_html__('Restore', 'event_espresso').'</a>'; |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | if ( |
@@ -225,9 +225,9 @@ discard block |
||
225 | 225 | $item->ID() |
226 | 226 | ) |
227 | 227 | ) { |
228 | - $actions['delete'] = '<a href="' . $delete_link . '" aria-label="' |
|
229 | - . esc_attr__('Delete Question Group Permanently', 'event_espresso') . '">' |
|
230 | - . esc_html__('Delete Permanently', 'event_espresso') . '</a>'; |
|
228 | + $actions['delete'] = '<a href="'.$delete_link.'" aria-label="' |
|
229 | + . esc_attr__('Delete Question Group Permanently', 'event_espresso').'">' |
|
230 | + . esc_html__('Delete Permanently', 'event_espresso').'</a>'; |
|
231 | 231 | } |
232 | 232 | } |
233 | 233 | |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | 'espresso_registration_form_edit_question_group', |
237 | 237 | $item->ID() |
238 | 238 | ) |
239 | - ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->name() . '</a></strong>' |
|
239 | + ? '<strong><a class="row-title" href="'.$edit_link.'">'.$item->name().'</a></strong>' |
|
240 | 240 | : $item->name(); |
241 | 241 | $content .= $this->row_actions($actions); |
242 | 242 | return $content; |
@@ -257,12 +257,12 @@ discard block |
||
257 | 257 | |
258 | 258 | public function column_show_group_name(EE_Question_Group $item) |
259 | 259 | { |
260 | - return $this->_yes_no[ $item->show_group_name() ]; |
|
260 | + return $this->_yes_no[$item->show_group_name()]; |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | |
264 | 264 | public function column_show_group_desc(EE_Question_Group $item) |
265 | 265 | { |
266 | - return $this->_yes_no[ $item->show_group_desc() ]; |
|
266 | + return $this->_yes_no[$item->show_group_desc()]; |
|
267 | 267 | } |
268 | 268 | } |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | /* @var EE_Question[] $all_questions */ |
14 | 14 | assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions)));// list of unused questions |
15 | 15 | foreach ($all_questions as $unused_question) { |
16 | - assert($unused_question); |
|
17 | - assert($unused_question instanceof EE_Question); |
|
16 | + assert($unused_question); |
|
17 | + assert($unused_question instanceof EE_Question); |
|
18 | 18 | } |
19 | 19 | /* @var array $values . Array of arrays, where each sub-array contains 2 keys: 'id' (internal value) and 'name' (label for displaying) */ |
20 | 20 | assert(is_array($values)); |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | <th> |
34 | 34 | <label for="QSG_name"> |
35 | 35 | <?php esc_html_e('Group Name', 'event_espresso'); ?><?php echo EEH_Template::get_help_tab_link( |
36 | - 'group_name_info' |
|
37 | - ); ?> |
|
36 | + 'group_name_info' |
|
37 | + ); ?> |
|
38 | 38 | </label> |
39 | 39 | </th> |
40 | 40 | <td> |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | <th> |
49 | 49 | <label for="QSG_identifier"> |
50 | 50 | <?php esc_html_e('Group Identifier', 'event_espresso'); ?><?php echo EEH_Template::get_help_tab_link( |
51 | - 'group_identifier_info' |
|
52 | - ); ?> |
|
51 | + 'group_identifier_info' |
|
52 | + ); ?> |
|
53 | 53 | </label> |
54 | 54 | </th> |
55 | 55 | <td> |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | <th> |
69 | 69 | <label for="QSG_desc"> |
70 | 70 | <?php esc_html_e('Description', 'event_espresso'); ?><?php echo EEH_Template::get_help_tab_link( |
71 | - 'group_description_info' |
|
72 | - ); ?> |
|
71 | + 'group_description_info' |
|
72 | + ); ?> |
|
73 | 73 | </label> |
74 | 74 | </th> |
75 | 75 | <td> |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | <th> |
83 | 83 | <label for="QSG_order"> |
84 | 84 | <?php esc_html_e('Question Group Order', 'event_espresso'); ?><?php echo EEH_Template::get_help_tab_link( |
85 | - 'group_order_info' |
|
86 | - ); ?> |
|
85 | + 'group_order_info' |
|
86 | + ); ?> |
|
87 | 87 | </label> |
88 | 88 | </th> |
89 | 89 | <td> |
@@ -96,17 +96,17 @@ discard block |
||
96 | 96 | <th> |
97 | 97 | <label> |
98 | 98 | <?php esc_html_e('Show Name', 'event_espresso'); ?><?php echo EEH_Template::get_help_tab_link( |
99 | - 'show_group_name_info' |
|
100 | - ); ?> |
|
99 | + 'show_group_name_info' |
|
100 | + ); ?> |
|
101 | 101 | </label> |
102 | 102 | </th> |
103 | 103 | <td> |
104 | 104 | <label for="QSG_show_group_name"> |
105 | 105 | <?php echo EEH_Form_Fields::select_input( |
106 | - 'QSG_show_group_name', |
|
107 | - $values, |
|
108 | - $question_group->show_group_name() |
|
109 | - ); ?> |
|
106 | + 'QSG_show_group_name', |
|
107 | + $values, |
|
108 | + $question_group->show_group_name() |
|
109 | + ); ?> |
|
110 | 110 | <p class="description"><?php esc_html_e('Show Group Name on Registration Page?', 'event_espresso'); ?></p> |
111 | 111 | </label> |
112 | 112 | </td> |
@@ -116,20 +116,20 @@ discard block |
||
116 | 116 | <th> |
117 | 117 | <label> |
118 | 118 | <?php esc_html_e(' Show Description', 'event_espresso'); ?><?php echo EEH_Template::get_help_tab_link( |
119 | - 'show_group_description_info' |
|
120 | - ); ?> |
|
119 | + 'show_group_description_info' |
|
120 | + ); ?> |
|
121 | 121 | </label> |
122 | 122 | </th> |
123 | 123 | <td> |
124 | 124 | <label for="QSG_show_group_order"> |
125 | 125 | <?php echo EEH_Form_Fields::select_input( |
126 | - 'QSG_show_group_desc', |
|
127 | - $values, |
|
128 | - $question_group->show_group_desc() |
|
129 | - ); ?> |
|
126 | + 'QSG_show_group_desc', |
|
127 | + $values, |
|
128 | + $question_group->show_group_desc() |
|
129 | + ); ?> |
|
130 | 130 | <p class="description"><?php |
131 | - esc_html_e(' Show Group Description on Registration Page?', 'event_espresso'); |
|
132 | - ?></p> |
|
131 | + esc_html_e(' Show Group Description on Registration Page?', 'event_espresso'); |
|
132 | + ?></p> |
|
133 | 133 | </label> |
134 | 134 | <input type="hidden" name="QSG_system" value="<?php echo esc_attr($question_group->system_group()); ?>"> |
135 | 135 | </td> |
@@ -145,85 +145,85 @@ discard block |
||
145 | 145 | <div class="form-table question-group-questions inside"> |
146 | 146 | <div class="padding"> |
147 | 147 | <p><span class="description"><?php |
148 | - esc_html_e( |
|
149 | - 'Select which questions should be shown in this group by checking or unchecking boxes. You can drag and drop questions to reorder them. Your changes will be updated when you save.', |
|
150 | - 'event_espresso' |
|
151 | - ); ?></span></p> |
|
148 | + esc_html_e( |
|
149 | + 'Select which questions should be shown in this group by checking or unchecking boxes. You can drag and drop questions to reorder them. Your changes will be updated when you save.', |
|
150 | + 'event_espresso' |
|
151 | + ); ?></span></p> |
|
152 | 152 | <div> |
153 | 153 | <ul class="question-list-sortable"> |
154 | 154 | <?php |
155 | - $question_order = 0; |
|
156 | - $question_group_questions = $question_group->questions(); |
|
157 | - foreach ($all_questions as $question_ID => $question) { |
|
158 | - if ($question instanceof EE_Question) { |
|
159 | - /*@var $question EE_Question*/ |
|
160 | - $checked = isset($question_group_questions[ $question_ID ]) ? 'checked' : ''; |
|
161 | - // disable questions from the personal information question group |
|
162 | - // is it required in the current question group? if so don't allow admins to remove it |
|
163 | - $disabled = in_array( |
|
164 | - $question->system_ID(), |
|
165 | - EEM_Question::instance()->required_system_questions_in_system_question_group( |
|
166 | - $QSG_system |
|
167 | - ) |
|
168 | - ) ? 'disabled' : ''; |
|
169 | - // limit where system questions can appear |
|
170 | - if ( |
|
171 | - $question->system_ID() && |
|
172 | - ! in_array( |
|
173 | - $question->system_ID(), |
|
174 | - EEM_Question::instance()->allowed_system_questions_in_system_question_group( |
|
175 | - $QSG_system |
|
176 | - ) |
|
177 | - ) |
|
178 | - ) { |
|
179 | - continue; // skip over system question not assigned to this group except for the address system group cause we want the address questions to display even if they aren't selected (but still not show the personal system questions). The third condition checks if we're displaying a non system question group and the question is a system question, then we skip because for non-system question groups we only want to show non-system questions. |
|
180 | - } |
|
181 | - ?> |
|
155 | + $question_order = 0; |
|
156 | + $question_group_questions = $question_group->questions(); |
|
157 | + foreach ($all_questions as $question_ID => $question) { |
|
158 | + if ($question instanceof EE_Question) { |
|
159 | + /*@var $question EE_Question*/ |
|
160 | + $checked = isset($question_group_questions[ $question_ID ]) ? 'checked' : ''; |
|
161 | + // disable questions from the personal information question group |
|
162 | + // is it required in the current question group? if so don't allow admins to remove it |
|
163 | + $disabled = in_array( |
|
164 | + $question->system_ID(), |
|
165 | + EEM_Question::instance()->required_system_questions_in_system_question_group( |
|
166 | + $QSG_system |
|
167 | + ) |
|
168 | + ) ? 'disabled' : ''; |
|
169 | + // limit where system questions can appear |
|
170 | + if ( |
|
171 | + $question->system_ID() && |
|
172 | + ! in_array( |
|
173 | + $question->system_ID(), |
|
174 | + EEM_Question::instance()->allowed_system_questions_in_system_question_group( |
|
175 | + $QSG_system |
|
176 | + ) |
|
177 | + ) |
|
178 | + ) { |
|
179 | + continue; // skip over system question not assigned to this group except for the address system group cause we want the address questions to display even if they aren't selected (but still not show the personal system questions). The third condition checks if we're displaying a non system question group and the question is a system question, then we skip because for non-system question groups we only want to show non-system questions. |
|
180 | + } |
|
181 | + ?> |
|
182 | 182 | <li class="ee-question-sortable"> |
183 | 183 | <label for="question-<?php echo absint($question_ID); ?>"> |
184 | 184 | <input type="checkbox" name="questions[<?php echo absint($question_ID); ?>]" |
185 | 185 | id="question-<?php echo absint($question_ID); ?>" |
186 | 186 | value="<?php echo absint($question_ID); ?>" <?php echo esc_attr($disabled); ?> <?php echo esc_attr($checked); ?>> |
187 | 187 | <span class="question-text"><?php |
188 | - echo trim($question->display_text()) |
|
189 | - . (95 <= strlen(trim($question->display_text())) |
|
190 | - ? "…" |
|
191 | - : ''); |
|
192 | - ?> |
|
188 | + echo trim($question->display_text()) |
|
189 | + . (95 <= strlen(trim($question->display_text())) |
|
190 | + ? "…" |
|
191 | + : ''); |
|
192 | + ?> |
|
193 | 193 | </span> |
194 | 194 | <input class="question-group-QGQ_order" type="hidden" |
195 | 195 | name="question_orders[<?php echo absint($question_ID); ?>]" |
196 | 196 | value="<?php echo esc_attr($question_order); ?>"> |
197 | 197 | </label> |
198 | 198 | <?php |
199 | - if ( |
|
200 | - EE_Registry::instance()->CAP->current_user_can( |
|
201 | - 'ee_edit_question', |
|
202 | - 'espresso_registration_form_edit_question', |
|
203 | - $question->ID() |
|
204 | - ) |
|
205 | - ) { |
|
206 | - $edit_query_args = array( |
|
207 | - 'action' => 'edit_question', |
|
208 | - 'QST_ID' => $question->ID(), |
|
209 | - ); |
|
210 | - $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL); |
|
199 | + if ( |
|
200 | + EE_Registry::instance()->CAP->current_user_can( |
|
201 | + 'ee_edit_question', |
|
202 | + 'espresso_registration_form_edit_question', |
|
203 | + $question->ID() |
|
204 | + ) |
|
205 | + ) { |
|
206 | + $edit_query_args = array( |
|
207 | + 'action' => 'edit_question', |
|
208 | + 'QST_ID' => $question->ID(), |
|
209 | + ); |
|
210 | + $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL); |
|
211 | 211 | |
212 | - echo '<a href="' . $edit_link . '" target="_blank" aria-label="' . |
|
213 | - sprintf( |
|
214 | - esc_attr__('Edit %s', 'event_espresso'), |
|
215 | - $question->admin_label() |
|
216 | - ) |
|
217 | - . '"><span class="dashicons dashicons-edit"></span> |
|
212 | + echo '<a href="' . $edit_link . '" target="_blank" aria-label="' . |
|
213 | + sprintf( |
|
214 | + esc_attr__('Edit %s', 'event_espresso'), |
|
215 | + $question->admin_label() |
|
216 | + ) |
|
217 | + . '"><span class="dashicons dashicons-edit"></span> |
|
218 | 218 | </a>'; |
219 | - } |
|
220 | - ?> |
|
219 | + } |
|
220 | + ?> |
|
221 | 221 | </li> |
222 | 222 | <?php |
223 | - $question_order++; |
|
224 | - } |
|
225 | - } |
|
226 | - ?> |
|
223 | + $question_order++; |
|
224 | + } |
|
225 | + } |
|
226 | + ?> |
|
227 | 227 | </ul> |
228 | 228 | </div> |
229 | 229 | </div> |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | assert($question_group); |
12 | 12 | assert($question_group instanceof EE_Question_Group); |
13 | 13 | /* @var EE_Question[] $all_questions */ |
14 | -assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions)));// list of unused questions |
|
14 | +assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions))); // list of unused questions |
|
15 | 15 | foreach ($all_questions as $unused_question) { |
16 | 16 | assert($unused_question); |
17 | 17 | assert($unused_question instanceof EE_Question); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | <input id="QSG_identifier" name="QSG_identifier<?php echo esc_attr($id); ?>" |
57 | 57 | value="<?php echo esc_attr($question_group->get_f('QSG_identifier')); ?>" type="text" |
58 | 58 | class="regular-text" <?php echo esc_attr($disabled); ?>> |
59 | - <?php if (! empty($QSG_system)) { ?> |
|
59 | + <?php if ( ! empty($QSG_system)) { ?> |
|
60 | 60 | <p><span class="description" style="color:#D54E21;"> |
61 | 61 | <?php esc_html_e('System question group! This field cannot be changed.', 'event_espresso') ?> |
62 | 62 | </span><br/></p> |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | foreach ($all_questions as $question_ID => $question) { |
158 | 158 | if ($question instanceof EE_Question) { |
159 | 159 | /*@var $question EE_Question*/ |
160 | - $checked = isset($question_group_questions[ $question_ID ]) ? 'checked' : ''; |
|
160 | + $checked = isset($question_group_questions[$question_ID]) ? 'checked' : ''; |
|
161 | 161 | // disable questions from the personal information question group |
162 | 162 | // is it required in the current question group? if so don't allow admins to remove it |
163 | 163 | $disabled = in_array( |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | ); |
210 | 210 | $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL); |
211 | 211 | |
212 | - echo '<a href="' . $edit_link . '" target="_blank" aria-label="' . |
|
212 | + echo '<a href="'.$edit_link.'" target="_blank" aria-label="'. |
|
213 | 213 | sprintf( |
214 | 214 | esc_attr__('Edit %s', 'event_espresso'), |
215 | 215 | $question->admin_label() |
@@ -13,189 +13,189 @@ |
||
13 | 13 | */ |
14 | 14 | class EE_Event_Editor_Tips extends EE_Qtip_Config |
15 | 15 | { |
16 | - protected function _set_tips_array() |
|
17 | - { |
|
18 | - $this->_qtipsa = array( |
|
19 | - 0 => array( |
|
20 | - 'content_id' => 'about-taxable-toggle', |
|
21 | - 'target' => '.TKT-taxable-checkbox', |
|
22 | - 'content' => $this->_get_taxable_info_content(), |
|
23 | - 'options' => array( |
|
24 | - 'show_only_once' => true, |
|
25 | - 'content' => array( |
|
26 | - 'title' => esc_html__('Taxable Ticket Toggle', 'event_espresso'), |
|
27 | - 'button' => true, |
|
28 | - ), |
|
29 | - 'show' => array( |
|
30 | - 'event' => 'click', |
|
31 | - ), |
|
32 | - 'hide' => array( |
|
33 | - 'event' => false, |
|
34 | - ), |
|
35 | - 'style' => array( |
|
36 | - 'classes' => '', |
|
37 | - ), |
|
38 | - )// defaults |
|
39 | - ), |
|
40 | - 1 => array( |
|
41 | - 'content_id' => 'ticket-icon-help', |
|
42 | - 'target' => '.ticket-icon', |
|
43 | - 'content' => esc_html__('Assigned Tickets', 'event_espresso'), |
|
44 | - ), |
|
45 | - 2 => array( |
|
46 | - 'content_id' => 'clone-icon-help', |
|
47 | - 'target' => '.clone-icon', |
|
48 | - 'content' => esc_html__('Duplicate this Item', 'event_espresso'), |
|
49 | - ), |
|
50 | - 3 => array( |
|
51 | - 'content_id' => 'trash-datetime-help', |
|
52 | - 'target' => '.datetime-edit-table .trash-icon', |
|
53 | - 'content' => esc_html__('Trash Datetime', 'event_espresso'), |
|
54 | - ), |
|
55 | - 4 => array( |
|
56 | - 'content_id' => 'trash-ticket-help', |
|
57 | - 'target' => '.ticket-row .trash-icon', |
|
58 | - 'content' => esc_html__('Trash Ticket', 'event_espresso'), |
|
59 | - ), |
|
60 | - 5 => array( |
|
61 | - 'content_id' => 'trash-price-modifier-help', |
|
62 | - 'target' => '.ticket-price-rows .trash-icon', |
|
63 | - 'content' => esc_html__('Trash Price Modifier', 'event_espresso'), |
|
64 | - ), |
|
65 | - 6 => array( |
|
66 | - 'content_id' => 'gear-icon-help', |
|
67 | - 'target' => '.gear-icon', |
|
68 | - 'content' => esc_html__('Advanced Settings', 'event_espresso'), |
|
69 | - ), |
|
70 | - 7 => array( |
|
71 | - 'content_id' => 'tkt-status-archived', |
|
72 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::archived, |
|
73 | - 'content' => $this->_ticket_status_legend(EE_Ticket::archived), |
|
74 | - 'options' => array( |
|
75 | - 'position' => array( |
|
76 | - 'target' => 'mouse', |
|
77 | - 'adjust' => array( |
|
78 | - 'mouse' => false, |
|
79 | - ), |
|
80 | - ), |
|
81 | - ), |
|
82 | - ), |
|
83 | - 8 => array( |
|
84 | - 'content_id' => 'tkt-status-expired', |
|
85 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::expired, |
|
86 | - 'content' => $this->_ticket_status_legend(EE_Ticket::expired), |
|
87 | - 'options' => array( |
|
88 | - 'position' => array( |
|
89 | - 'target' => 'mouse', |
|
90 | - 'adjust' => array( |
|
91 | - 'mouse' => false, |
|
92 | - ), |
|
93 | - ), |
|
94 | - ), |
|
95 | - ), |
|
96 | - 9 => array( |
|
97 | - 'content_id' => 'tkt-status-sold_out', |
|
98 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::sold_out, |
|
99 | - 'content' => $this->_ticket_status_legend(EE_Ticket::sold_out), |
|
100 | - 'options' => array( |
|
101 | - 'position' => array( |
|
102 | - 'target' => 'mouse', |
|
103 | - 'adjust' => array( |
|
104 | - 'mouse' => false, |
|
105 | - ), |
|
106 | - ), |
|
107 | - ), |
|
108 | - ), |
|
109 | - 10 => array( |
|
110 | - 'content_id' => 'tkt-status-pending', |
|
111 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::pending, |
|
112 | - 'content' => $this->_ticket_status_legend(EE_Ticket::pending), |
|
113 | - 'options' => array( |
|
114 | - 'position' => array( |
|
115 | - 'target' => 'mouse', |
|
116 | - 'adjust' => array( |
|
117 | - 'mouse' => false, |
|
118 | - ), |
|
119 | - ), |
|
120 | - ), |
|
121 | - ), |
|
122 | - 11 => array( |
|
123 | - 'content_id' => 'tkt-status-onsale', |
|
124 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::onsale, |
|
125 | - 'content' => $this->_ticket_status_legend(EE_Ticket::onsale), |
|
126 | - 'options' => array( |
|
127 | - 'position' => array( |
|
128 | - 'target' => 'mouse', |
|
129 | - 'adjust' => array( |
|
130 | - 'mouse' => false, |
|
131 | - ), |
|
132 | - ), |
|
133 | - ), |
|
134 | - ), |
|
135 | - 12 => array( |
|
136 | - 'content_id' => 'sortable-tkt-drag-handle-tip', |
|
137 | - 'target' => '.ee-ticket-sortable .sortable-drag-handle', |
|
138 | - 'content' => esc_html__('Click and drag-n-drop to reorder tickets.', 'event_espresso'), |
|
139 | - 'options' => array( |
|
140 | - 'position' => array( |
|
141 | - 'adjust' => array( |
|
142 | - 'mouse' => false, |
|
143 | - 'y' => 5, |
|
144 | - ), |
|
145 | - ), |
|
146 | - ), |
|
147 | - ), |
|
148 | - 13 => array( |
|
149 | - 'content_id' => 'sortable-dtt-drag-handle-tip', |
|
150 | - 'target' => '.ee-dtt-sortable .sortable-drag-handle', |
|
151 | - 'content' => esc_html__('Click and drag-n-drop to reorder datetimes.', 'event_espresso'), |
|
152 | - 'options' => array( |
|
153 | - 'position' => array( |
|
154 | - 'adjust' => array( |
|
155 | - 'mouse' => false, |
|
156 | - 'y' => 5, |
|
157 | - ), |
|
158 | - ), |
|
159 | - ), |
|
160 | - ), |
|
161 | - ); |
|
162 | - } |
|
16 | + protected function _set_tips_array() |
|
17 | + { |
|
18 | + $this->_qtipsa = array( |
|
19 | + 0 => array( |
|
20 | + 'content_id' => 'about-taxable-toggle', |
|
21 | + 'target' => '.TKT-taxable-checkbox', |
|
22 | + 'content' => $this->_get_taxable_info_content(), |
|
23 | + 'options' => array( |
|
24 | + 'show_only_once' => true, |
|
25 | + 'content' => array( |
|
26 | + 'title' => esc_html__('Taxable Ticket Toggle', 'event_espresso'), |
|
27 | + 'button' => true, |
|
28 | + ), |
|
29 | + 'show' => array( |
|
30 | + 'event' => 'click', |
|
31 | + ), |
|
32 | + 'hide' => array( |
|
33 | + 'event' => false, |
|
34 | + ), |
|
35 | + 'style' => array( |
|
36 | + 'classes' => '', |
|
37 | + ), |
|
38 | + )// defaults |
|
39 | + ), |
|
40 | + 1 => array( |
|
41 | + 'content_id' => 'ticket-icon-help', |
|
42 | + 'target' => '.ticket-icon', |
|
43 | + 'content' => esc_html__('Assigned Tickets', 'event_espresso'), |
|
44 | + ), |
|
45 | + 2 => array( |
|
46 | + 'content_id' => 'clone-icon-help', |
|
47 | + 'target' => '.clone-icon', |
|
48 | + 'content' => esc_html__('Duplicate this Item', 'event_espresso'), |
|
49 | + ), |
|
50 | + 3 => array( |
|
51 | + 'content_id' => 'trash-datetime-help', |
|
52 | + 'target' => '.datetime-edit-table .trash-icon', |
|
53 | + 'content' => esc_html__('Trash Datetime', 'event_espresso'), |
|
54 | + ), |
|
55 | + 4 => array( |
|
56 | + 'content_id' => 'trash-ticket-help', |
|
57 | + 'target' => '.ticket-row .trash-icon', |
|
58 | + 'content' => esc_html__('Trash Ticket', 'event_espresso'), |
|
59 | + ), |
|
60 | + 5 => array( |
|
61 | + 'content_id' => 'trash-price-modifier-help', |
|
62 | + 'target' => '.ticket-price-rows .trash-icon', |
|
63 | + 'content' => esc_html__('Trash Price Modifier', 'event_espresso'), |
|
64 | + ), |
|
65 | + 6 => array( |
|
66 | + 'content_id' => 'gear-icon-help', |
|
67 | + 'target' => '.gear-icon', |
|
68 | + 'content' => esc_html__('Advanced Settings', 'event_espresso'), |
|
69 | + ), |
|
70 | + 7 => array( |
|
71 | + 'content_id' => 'tkt-status-archived', |
|
72 | + 'target' => '.ticket-row .tkt-status-' . EE_Ticket::archived, |
|
73 | + 'content' => $this->_ticket_status_legend(EE_Ticket::archived), |
|
74 | + 'options' => array( |
|
75 | + 'position' => array( |
|
76 | + 'target' => 'mouse', |
|
77 | + 'adjust' => array( |
|
78 | + 'mouse' => false, |
|
79 | + ), |
|
80 | + ), |
|
81 | + ), |
|
82 | + ), |
|
83 | + 8 => array( |
|
84 | + 'content_id' => 'tkt-status-expired', |
|
85 | + 'target' => '.ticket-row .tkt-status-' . EE_Ticket::expired, |
|
86 | + 'content' => $this->_ticket_status_legend(EE_Ticket::expired), |
|
87 | + 'options' => array( |
|
88 | + 'position' => array( |
|
89 | + 'target' => 'mouse', |
|
90 | + 'adjust' => array( |
|
91 | + 'mouse' => false, |
|
92 | + ), |
|
93 | + ), |
|
94 | + ), |
|
95 | + ), |
|
96 | + 9 => array( |
|
97 | + 'content_id' => 'tkt-status-sold_out', |
|
98 | + 'target' => '.ticket-row .tkt-status-' . EE_Ticket::sold_out, |
|
99 | + 'content' => $this->_ticket_status_legend(EE_Ticket::sold_out), |
|
100 | + 'options' => array( |
|
101 | + 'position' => array( |
|
102 | + 'target' => 'mouse', |
|
103 | + 'adjust' => array( |
|
104 | + 'mouse' => false, |
|
105 | + ), |
|
106 | + ), |
|
107 | + ), |
|
108 | + ), |
|
109 | + 10 => array( |
|
110 | + 'content_id' => 'tkt-status-pending', |
|
111 | + 'target' => '.ticket-row .tkt-status-' . EE_Ticket::pending, |
|
112 | + 'content' => $this->_ticket_status_legend(EE_Ticket::pending), |
|
113 | + 'options' => array( |
|
114 | + 'position' => array( |
|
115 | + 'target' => 'mouse', |
|
116 | + 'adjust' => array( |
|
117 | + 'mouse' => false, |
|
118 | + ), |
|
119 | + ), |
|
120 | + ), |
|
121 | + ), |
|
122 | + 11 => array( |
|
123 | + 'content_id' => 'tkt-status-onsale', |
|
124 | + 'target' => '.ticket-row .tkt-status-' . EE_Ticket::onsale, |
|
125 | + 'content' => $this->_ticket_status_legend(EE_Ticket::onsale), |
|
126 | + 'options' => array( |
|
127 | + 'position' => array( |
|
128 | + 'target' => 'mouse', |
|
129 | + 'adjust' => array( |
|
130 | + 'mouse' => false, |
|
131 | + ), |
|
132 | + ), |
|
133 | + ), |
|
134 | + ), |
|
135 | + 12 => array( |
|
136 | + 'content_id' => 'sortable-tkt-drag-handle-tip', |
|
137 | + 'target' => '.ee-ticket-sortable .sortable-drag-handle', |
|
138 | + 'content' => esc_html__('Click and drag-n-drop to reorder tickets.', 'event_espresso'), |
|
139 | + 'options' => array( |
|
140 | + 'position' => array( |
|
141 | + 'adjust' => array( |
|
142 | + 'mouse' => false, |
|
143 | + 'y' => 5, |
|
144 | + ), |
|
145 | + ), |
|
146 | + ), |
|
147 | + ), |
|
148 | + 13 => array( |
|
149 | + 'content_id' => 'sortable-dtt-drag-handle-tip', |
|
150 | + 'target' => '.ee-dtt-sortable .sortable-drag-handle', |
|
151 | + 'content' => esc_html__('Click and drag-n-drop to reorder datetimes.', 'event_espresso'), |
|
152 | + 'options' => array( |
|
153 | + 'position' => array( |
|
154 | + 'adjust' => array( |
|
155 | + 'mouse' => false, |
|
156 | + 'y' => 5, |
|
157 | + ), |
|
158 | + ), |
|
159 | + ), |
|
160 | + ), |
|
161 | + ); |
|
162 | + } |
|
163 | 163 | |
164 | 164 | |
165 | - private function _get_taxable_info_content() |
|
166 | - { |
|
167 | - $price_admin_link = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default'), PRICING_ADMIN_URL); |
|
168 | - return '<p>' |
|
169 | - . sprintf( |
|
170 | - esc_html__( |
|
171 | - 'Clicking the taxable ticket toggle checkbox has enabled taxes for this ticket. What this means is that when a person purchases this ticket, the tax will be applied to all prices on this ticket. You can edit the existing tax price modifier that was setup in Event Espresso by going to %sDefault Pricing Admin Page%s (labelled "Pricing" in the Event Espresso Menu)', |
|
172 | - 'event_espresso' |
|
173 | - ), |
|
174 | - '<a href="' . $price_admin_link . '" aria-label="' . esc_attr__( |
|
175 | - 'Pricing Admin Page', |
|
176 | - 'event_espresso' |
|
177 | - ) . '">', |
|
178 | - '</a>' |
|
179 | - ) . '</p>'; |
|
180 | - } |
|
165 | + private function _get_taxable_info_content() |
|
166 | + { |
|
167 | + $price_admin_link = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default'), PRICING_ADMIN_URL); |
|
168 | + return '<p>' |
|
169 | + . sprintf( |
|
170 | + esc_html__( |
|
171 | + 'Clicking the taxable ticket toggle checkbox has enabled taxes for this ticket. What this means is that when a person purchases this ticket, the tax will be applied to all prices on this ticket. You can edit the existing tax price modifier that was setup in Event Espresso by going to %sDefault Pricing Admin Page%s (labelled "Pricing" in the Event Espresso Menu)', |
|
172 | + 'event_espresso' |
|
173 | + ), |
|
174 | + '<a href="' . $price_admin_link . '" aria-label="' . esc_attr__( |
|
175 | + 'Pricing Admin Page', |
|
176 | + 'event_espresso' |
|
177 | + ) . '">', |
|
178 | + '</a>' |
|
179 | + ) . '</p>'; |
|
180 | + } |
|
181 | 181 | |
182 | - /** |
|
183 | - * output the relevant ee-status-legend with the designated status highlighted. |
|
184 | - * |
|
185 | - * @param EE_Ticket constant $status What status is set (by class) |
|
186 | - * @return string The status legend with the related status highlighted |
|
187 | - */ |
|
188 | - private function _ticket_status_legend($status) |
|
189 | - { |
|
182 | + /** |
|
183 | + * output the relevant ee-status-legend with the designated status highlighted. |
|
184 | + * |
|
185 | + * @param EE_Ticket constant $status What status is set (by class) |
|
186 | + * @return string The status legend with the related status highlighted |
|
187 | + */ |
|
188 | + private function _ticket_status_legend($status) |
|
189 | + { |
|
190 | 190 | |
191 | - $status_array = array( |
|
192 | - 'archived' => EE_Ticket::archived, |
|
193 | - 'expired' => EE_Ticket::expired, |
|
194 | - 'sold_out' => EE_Ticket::sold_out, |
|
195 | - 'pending' => EE_Ticket::pending, |
|
196 | - 'onsale' => EE_Ticket::onsale, |
|
197 | - ); |
|
191 | + $status_array = array( |
|
192 | + 'archived' => EE_Ticket::archived, |
|
193 | + 'expired' => EE_Ticket::expired, |
|
194 | + 'sold_out' => EE_Ticket::sold_out, |
|
195 | + 'pending' => EE_Ticket::pending, |
|
196 | + 'onsale' => EE_Ticket::onsale, |
|
197 | + ); |
|
198 | 198 | |
199 | - return EEH_Template::status_legend($status_array, $status); |
|
200 | - } |
|
199 | + return EEH_Template::status_legend($status_array, $status); |
|
200 | + } |
|
201 | 201 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | ), |
70 | 70 | 7 => array( |
71 | 71 | 'content_id' => 'tkt-status-archived', |
72 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::archived, |
|
72 | + 'target' => '.ticket-row .tkt-status-'.EE_Ticket::archived, |
|
73 | 73 | 'content' => $this->_ticket_status_legend(EE_Ticket::archived), |
74 | 74 | 'options' => array( |
75 | 75 | 'position' => array( |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | ), |
83 | 83 | 8 => array( |
84 | 84 | 'content_id' => 'tkt-status-expired', |
85 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::expired, |
|
85 | + 'target' => '.ticket-row .tkt-status-'.EE_Ticket::expired, |
|
86 | 86 | 'content' => $this->_ticket_status_legend(EE_Ticket::expired), |
87 | 87 | 'options' => array( |
88 | 88 | 'position' => array( |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | ), |
96 | 96 | 9 => array( |
97 | 97 | 'content_id' => 'tkt-status-sold_out', |
98 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::sold_out, |
|
98 | + 'target' => '.ticket-row .tkt-status-'.EE_Ticket::sold_out, |
|
99 | 99 | 'content' => $this->_ticket_status_legend(EE_Ticket::sold_out), |
100 | 100 | 'options' => array( |
101 | 101 | 'position' => array( |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | ), |
109 | 109 | 10 => array( |
110 | 110 | 'content_id' => 'tkt-status-pending', |
111 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::pending, |
|
111 | + 'target' => '.ticket-row .tkt-status-'.EE_Ticket::pending, |
|
112 | 112 | 'content' => $this->_ticket_status_legend(EE_Ticket::pending), |
113 | 113 | 'options' => array( |
114 | 114 | 'position' => array( |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | ), |
122 | 122 | 11 => array( |
123 | 123 | 'content_id' => 'tkt-status-onsale', |
124 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::onsale, |
|
124 | + 'target' => '.ticket-row .tkt-status-'.EE_Ticket::onsale, |
|
125 | 125 | 'content' => $this->_ticket_status_legend(EE_Ticket::onsale), |
126 | 126 | 'options' => array( |
127 | 127 | 'position' => array( |
@@ -171,12 +171,12 @@ discard block |
||
171 | 171 | 'Clicking the taxable ticket toggle checkbox has enabled taxes for this ticket. What this means is that when a person purchases this ticket, the tax will be applied to all prices on this ticket. You can edit the existing tax price modifier that was setup in Event Espresso by going to %sDefault Pricing Admin Page%s (labelled "Pricing" in the Event Espresso Menu)', |
172 | 172 | 'event_espresso' |
173 | 173 | ), |
174 | - '<a href="' . $price_admin_link . '" aria-label="' . esc_attr__( |
|
174 | + '<a href="'.$price_admin_link.'" aria-label="'.esc_attr__( |
|
175 | 175 | 'Pricing Admin Page', |
176 | 176 | 'event_espresso' |
177 | - ) . '">', |
|
177 | + ).'">', |
|
178 | 178 | '</a>' |
179 | - ) . '</p>'; |
|
179 | + ).'</p>'; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |