@@ -33,9 +33,12 @@ discard block |
||
33 | 33 | <input type="text" size="1" class="edit-price-PRC_amount ee-numeric" |
34 | 34 | name="prices_archive[<?php echo $tkt_row; ?>][<?php echo $PRC_order; ?>][PRC_amount]" |
35 | 35 | value="<?php echo $PRC_amount; ?>" disabled> |
36 | - <?php else : ?> |
|
36 | + <?php else { |
|
37 | + : ?> |
|
37 | 38 | <input type="text" size="1" class="edit-price-PRC_amount ee-numeric" |
38 | - name="<?php echo $edit_prices_name; ?>[<?php echo $tkt_row; ?>][<?php echo $PRC_order; ?>][PRC_amount]" |
|
39 | + name="<?php echo $edit_prices_name; |
|
40 | +} |
|
41 | +?>[<?php echo $tkt_row; ?>][<?php echo $PRC_order; ?>][PRC_amount]" |
|
39 | 42 | value="<?php echo $PRC_amount; ?>"> |
40 | 43 | <?php endif; ?> |
41 | 44 | </td> |
@@ -46,8 +49,11 @@ discard block |
||
46 | 49 | <td> |
47 | 50 | <?php if ($disabled) : ?> |
48 | 51 | <span class="ee-lock-icon"></span> |
49 | - <?php else : ?> |
|
50 | - <!-- <span class="gear-icon dashicons dashicons-admin-generic clickable" data-ticket-row="<?php echo $tkt_row; ?>" data-context="price" data-price-row="<?php echo $PRC_order; ?>"></span> --> |
|
52 | + <?php else { |
|
53 | + : ?> |
|
54 | + <!-- <span class="gear-icon dashicons dashicons-admin-generic clickable" data-ticket-row="<?php echo $tkt_row; |
|
55 | +} |
|
56 | +?>" data-context="price" data-price-row="<?php echo $PRC_order; ?>"></span> --> |
|
51 | 57 | <span class="trash-icon dashicons dashicons-post-trash clickable" data-ticket-row="<?php echo $tkt_row; ?>" |
52 | 58 | data-context="price" data-price-row="<?php echo $PRC_order; ?>"<?php echo $show_trash_icon; ?>></span> |
53 | 59 | <button data-ticket-row="<?php echo $tkt_row; ?>" data-price-row="<?php echo $PRC_order; ?>" |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $limit = array($offset, $per_page); |
217 | 217 | |
218 | 218 | if (isset($this->_req_data['s'])) { |
219 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
219 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
220 | 220 | $_where['OR'] = array( |
221 | 221 | 'TKT_name' => array('LIKE', $sstr), |
222 | 222 | 'TKT_description' => array('LIKE', $sstr), |
@@ -245,18 +245,18 @@ discard block |
||
245 | 245 | $TKT = EEM_Ticket::instance(); |
246 | 246 | |
247 | 247 | // checkboxes? |
248 | - if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
248 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
249 | 249 | // if array has more than one element then success message should be plural |
250 | 250 | $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
251 | 251 | |
252 | 252 | // cycle thru the boxes |
253 | 253 | while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) { |
254 | 254 | if ($trash) { |
255 | - if (! $TKT->delete_by_ID($TKT_ID)) { |
|
255 | + if ( ! $TKT->delete_by_ID($TKT_ID)) { |
|
256 | 256 | $success = 0; |
257 | 257 | } |
258 | 258 | } else { |
259 | - if (! $TKT->restore_by_ID($TKT_ID)) { |
|
259 | + if ( ! $TKT->restore_by_ID($TKT_ID)) { |
|
260 | 260 | $success = 0; |
261 | 261 | } |
262 | 262 | } |
@@ -266,11 +266,11 @@ discard block |
||
266 | 266 | $TKT_ID = absint($this->_req_data['TKT_ID']); |
267 | 267 | |
268 | 268 | if ($trash) { |
269 | - if (! $TKT->delete_by_ID($TKT_ID)) { |
|
269 | + if ( ! $TKT->delete_by_ID($TKT_ID)) { |
|
270 | 270 | $success = 0; |
271 | 271 | } |
272 | 272 | } else { |
273 | - if (! $TKT->restore_by_ID($TKT_ID)) { |
|
273 | + if ( ! $TKT->restore_by_ID($TKT_ID)) { |
|
274 | 274 | $success = 0; |
275 | 275 | } |
276 | 276 | } |
@@ -288,21 +288,21 @@ discard block |
||
288 | 288 | $TKT = EEM_Ticket::instance(); |
289 | 289 | |
290 | 290 | // checkboxes? |
291 | - if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
291 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
292 | 292 | // if array has more than one element then success message should be plural |
293 | 293 | $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
294 | 294 | |
295 | 295 | // cycle thru the boxes |
296 | 296 | while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) { |
297 | 297 | // delete |
298 | - if (! $this->_delete_the_ticket($TKT_ID)) { |
|
298 | + if ( ! $this->_delete_the_ticket($TKT_ID)) { |
|
299 | 299 | $success = 0; |
300 | 300 | } |
301 | 301 | } |
302 | 302 | } else { |
303 | 303 | // grab single id and trash |
304 | 304 | $TKT_ID = absint($this->_req_data['TKT_ID']); |
305 | - if (! $this->_delete_the_ticket($TKT_ID)) { |
|
305 | + if ( ! $this->_delete_the_ticket($TKT_ID)) { |
|
306 | 306 | $success = 0; |
307 | 307 | } |
308 | 308 | } |
@@ -13,312 +13,312 @@ |
||
13 | 13 | { |
14 | 14 | |
15 | 15 | |
16 | - protected function _init_page_props() |
|
17 | - { |
|
18 | - $this->page_slug = TICKETS_PG_SLUG; |
|
19 | - $this->page_label = TICKETS_LABEL; |
|
20 | - $this->_admin_base_url = TICKETS_ADMIN_URL; |
|
21 | - $this->_admin_base_path = TICKETS_ADMIN; |
|
22 | - } |
|
23 | - |
|
24 | - |
|
25 | - protected function _ajax_hooks() |
|
26 | - { |
|
27 | - } |
|
28 | - |
|
29 | - |
|
30 | - protected function _define_page_props() |
|
31 | - { |
|
32 | - $this->_admin_page_title = TICKETS_LABEL; |
|
33 | - $this->_labels = array( |
|
34 | - 'buttons' => array( |
|
35 | - 'add' => esc_html__('Add New Default Ticket', 'event_espresso'), |
|
36 | - 'edit' => esc_html__('Edit Default Ticket', 'event_espresso'), |
|
37 | - 'delete' => esc_html__('Delete Default Ticket', 'event_espresso'), |
|
38 | - ), |
|
39 | - ); |
|
40 | - } |
|
41 | - |
|
42 | - |
|
43 | - protected function _set_page_routes() |
|
44 | - { |
|
45 | - |
|
46 | - $tkt_id = ! empty($this->_req_data['TKT_ID']) && ! is_array($this->_req_data['TKT_ID']) |
|
47 | - ? $this->_req_data['TKT_ID'] : 0; |
|
48 | - |
|
49 | - $this->_page_routes = array( |
|
50 | - 'default' => array( |
|
51 | - 'func' => '_tickets_overview_list_table', |
|
52 | - 'capability' => 'ee_read_default_tickets', |
|
53 | - ), |
|
54 | - 'trash_ticket' => array( |
|
55 | - 'func' => '_trash_or_restore_ticket', |
|
56 | - 'noheader' => true, |
|
57 | - 'args' => array('trash' => true), |
|
58 | - 'capability' => 'ee_delete_default_ticket', |
|
59 | - 'obj_id' => $tkt_id, |
|
60 | - ), |
|
61 | - 'trash_tickets' => array( |
|
62 | - 'func' => '_trash_or_restore_ticket', |
|
63 | - 'noheader' => true, |
|
64 | - 'args' => array('trash' => true), |
|
65 | - 'capability' => 'ee_delete_default_tickets', |
|
66 | - ), |
|
67 | - 'restore_ticket' => array( |
|
68 | - 'func' => '_trash_or_restore_ticket', |
|
69 | - 'noheader' => true, |
|
70 | - 'capability' => 'ee_delete_default_ticket', |
|
71 | - 'obj_id' => $tkt_id, |
|
72 | - ), |
|
73 | - 'restore_tickets' => array( |
|
74 | - 'func' => '_trash_or_restore_ticket', |
|
75 | - 'noheader' => true, |
|
76 | - 'capability' => 'ee_delete_default_tickets', |
|
77 | - ), |
|
78 | - 'delete_ticket' => array( |
|
79 | - 'func' => '_delete_ticket', |
|
80 | - 'noheader' => true, |
|
81 | - 'capability' => 'ee_delete_default_ticket', |
|
82 | - 'obj_id' => $tkt_id, |
|
83 | - ), |
|
84 | - 'delete_tickets' => array( |
|
85 | - 'func' => '_delete_ticket', |
|
86 | - 'noheader' => true, |
|
87 | - 'capability' => 'ee_delete_default_tickets', |
|
88 | - ), |
|
89 | - ); |
|
90 | - } |
|
91 | - |
|
92 | - |
|
93 | - protected function _set_page_config() |
|
94 | - { |
|
95 | - $this->_page_config = array( |
|
96 | - 'default' => array( |
|
97 | - 'nav' => array( |
|
98 | - 'label' => esc_html__('Default Tickets', 'event_espresso'), |
|
99 | - 'order' => 10, |
|
100 | - ), |
|
101 | - 'list_table' => 'Tickets_List_Table', |
|
102 | - 'require_nonce' => false, |
|
103 | - ), |
|
104 | - ); |
|
105 | - } |
|
106 | - |
|
107 | - |
|
108 | - protected function _add_screen_options() |
|
109 | - { |
|
110 | - } |
|
111 | - |
|
112 | - protected function _add_screen_options_default() |
|
113 | - { |
|
114 | - $this->_per_page_screen_option(); |
|
115 | - } |
|
116 | - |
|
117 | - |
|
118 | - protected function _add_feature_pointers() |
|
119 | - { |
|
120 | - } |
|
121 | - |
|
122 | - public function load_scripts_styles() |
|
123 | - { |
|
124 | - } |
|
125 | - |
|
126 | - public function load_scripts_styles_default() |
|
127 | - { |
|
128 | - } |
|
129 | - |
|
130 | - public function admin_footer_scripts() |
|
131 | - { |
|
132 | - } |
|
133 | - |
|
134 | - public function admin_init() |
|
135 | - { |
|
136 | - } |
|
137 | - |
|
138 | - public function admin_notices() |
|
139 | - { |
|
140 | - } |
|
141 | - |
|
142 | - |
|
143 | - public function _set_list_table_views_default() |
|
144 | - { |
|
145 | - $this->_views = array( |
|
146 | - 'all' => array( |
|
147 | - 'slug' => 'all', |
|
148 | - 'label' => esc_html__('All', 'event_espresso'), |
|
149 | - 'count' => 0, |
|
150 | - 'bulk_action' => array( |
|
151 | - 'trash_tickets' => esc_html__('Move to Trash', 'event_espresso'), |
|
152 | - ), |
|
153 | - ), |
|
154 | - 'trashed' => array( |
|
155 | - 'slug' => 'trashed', |
|
156 | - 'label' => esc_html__('Trash', 'event_espresso'), |
|
157 | - 'count' => 0, |
|
158 | - 'bulk_action' => array( |
|
159 | - 'restore_tickets' => esc_html__('Restore from Trash', 'event_espresso'), |
|
160 | - 'delete_tickets' => esc_html__('Delete Permanently', 'event_espresso'), |
|
161 | - ), |
|
162 | - ), |
|
163 | - ); |
|
164 | - } |
|
165 | - |
|
166 | - |
|
167 | - public function _tickets_overview_list_table() |
|
168 | - { |
|
169 | - $this->_search_btn_label = esc_html__('Tickets', 'event_espresso'); |
|
170 | - $this->display_admin_list_table_page_with_no_sidebar(); |
|
171 | - } |
|
172 | - |
|
173 | - |
|
174 | - public function get_default_tickets($per_page = 10, $count = false, $trashed = false) |
|
175 | - { |
|
176 | - |
|
177 | - $orderby = empty($this->_req_data['orderby']) ? 'TKT_name' : $this->_req_data['orderby']; |
|
178 | - $order = empty($this->_req_data['order']) ? 'ASC' : $order; |
|
179 | - |
|
180 | - switch ($orderby) { |
|
181 | - case 'TKT_name': |
|
182 | - $orderby = array('TKT_name' => $order); |
|
183 | - break; |
|
184 | - |
|
185 | - case 'TKT_price': |
|
186 | - $orderby = array('TKT_price' => $order); |
|
187 | - break; |
|
188 | - |
|
189 | - case 'TKT_uses': |
|
190 | - $orderby = array('TKT_uses' => $order); |
|
191 | - break; |
|
192 | - |
|
193 | - case 'TKT_min': |
|
194 | - $orderby = array('TKT_min' => $order); |
|
195 | - break; |
|
196 | - |
|
197 | - case 'TKT_max': |
|
198 | - $orderby = array('TKT_max' => $order); |
|
199 | - break; |
|
200 | - |
|
201 | - case 'TKT_qty': |
|
202 | - $orderby = array('TKT_qty' => $order); |
|
203 | - break; |
|
204 | - } |
|
205 | - |
|
206 | - $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) |
|
207 | - ? $this->_req_data['paged'] : 1; |
|
208 | - $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) |
|
209 | - ? $this->_req_data['perpage'] : $per_page; |
|
210 | - |
|
211 | - $_where = array( |
|
212 | - 'TKT_is_default' => 1, |
|
213 | - 'TKT_deleted' => $trashed, |
|
214 | - ); |
|
215 | - |
|
216 | - $offset = ($current_page - 1) * $per_page; |
|
217 | - $limit = array($offset, $per_page); |
|
218 | - |
|
219 | - if (isset($this->_req_data['s'])) { |
|
220 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
221 | - $_where['OR'] = array( |
|
222 | - 'TKT_name' => array('LIKE', $sstr), |
|
223 | - 'TKT_description' => array('LIKE', $sstr), |
|
224 | - ); |
|
225 | - } |
|
226 | - |
|
227 | - $query_params = array( |
|
228 | - $_where, |
|
229 | - 'order_by' => $orderby, |
|
230 | - 'limit' => $limit, |
|
231 | - 'group_by' => 'TKT_ID', |
|
232 | - ); |
|
233 | - |
|
234 | - if ($count) { |
|
235 | - return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where)); |
|
236 | - } else { |
|
237 | - return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params); |
|
238 | - } |
|
239 | - } |
|
240 | - |
|
241 | - |
|
242 | - protected function _trash_or_restore_ticket($trash = false) |
|
243 | - { |
|
244 | - $success = 1; |
|
245 | - |
|
246 | - $TKT = EEM_Ticket::instance(); |
|
247 | - |
|
248 | - // checkboxes? |
|
249 | - if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
250 | - // if array has more than one element then success message should be plural |
|
251 | - $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
252 | - |
|
253 | - // cycle thru the boxes |
|
254 | - while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) { |
|
255 | - if ($trash) { |
|
256 | - if (! $TKT->delete_by_ID($TKT_ID)) { |
|
257 | - $success = 0; |
|
258 | - } |
|
259 | - } else { |
|
260 | - if (! $TKT->restore_by_ID($TKT_ID)) { |
|
261 | - $success = 0; |
|
262 | - } |
|
263 | - } |
|
264 | - } |
|
265 | - } else { |
|
266 | - // grab single id and trash |
|
267 | - $TKT_ID = absint($this->_req_data['TKT_ID']); |
|
268 | - |
|
269 | - if ($trash) { |
|
270 | - if (! $TKT->delete_by_ID($TKT_ID)) { |
|
271 | - $success = 0; |
|
272 | - } |
|
273 | - } else { |
|
274 | - if (! $TKT->restore_by_ID($TKT_ID)) { |
|
275 | - $success = 0; |
|
276 | - } |
|
277 | - } |
|
278 | - } |
|
279 | - |
|
280 | - $action_desc = $trash ? 'moved to the trash' : 'restored'; |
|
281 | - $this->_redirect_after_action($success, 'Tickets', $action_desc, array()); |
|
282 | - } |
|
283 | - |
|
284 | - |
|
285 | - protected function _delete_ticket() |
|
286 | - { |
|
287 | - $success = 1; |
|
288 | - |
|
289 | - $TKT = EEM_Ticket::instance(); |
|
290 | - |
|
291 | - // checkboxes? |
|
292 | - if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
293 | - // if array has more than one element then success message should be plural |
|
294 | - $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
295 | - |
|
296 | - // cycle thru the boxes |
|
297 | - while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) { |
|
298 | - // delete |
|
299 | - if (! $this->_delete_the_ticket($TKT_ID)) { |
|
300 | - $success = 0; |
|
301 | - } |
|
302 | - } |
|
303 | - } else { |
|
304 | - // grab single id and trash |
|
305 | - $TKT_ID = absint($this->_req_data['TKT_ID']); |
|
306 | - if (! $this->_delete_the_ticket($TKT_ID)) { |
|
307 | - $success = 0; |
|
308 | - } |
|
309 | - } |
|
310 | - |
|
311 | - $action_desc = 'deleted'; |
|
312 | - $this->_redirect_after_action($success, 'Tickets', $action_desc, array()); |
|
313 | - } |
|
314 | - |
|
315 | - |
|
316 | - protected function _delete_the_ticket($TKT_ID) |
|
317 | - { |
|
318 | - $tkt = EEM_Ticket::instance()->get_one_by_ID($TKT_ID); |
|
319 | - |
|
320 | - // delete all related prices first |
|
321 | - $tkt->delete_related_permanently('Price'); |
|
322 | - return $tkt->delete_permanently(); |
|
323 | - } |
|
16 | + protected function _init_page_props() |
|
17 | + { |
|
18 | + $this->page_slug = TICKETS_PG_SLUG; |
|
19 | + $this->page_label = TICKETS_LABEL; |
|
20 | + $this->_admin_base_url = TICKETS_ADMIN_URL; |
|
21 | + $this->_admin_base_path = TICKETS_ADMIN; |
|
22 | + } |
|
23 | + |
|
24 | + |
|
25 | + protected function _ajax_hooks() |
|
26 | + { |
|
27 | + } |
|
28 | + |
|
29 | + |
|
30 | + protected function _define_page_props() |
|
31 | + { |
|
32 | + $this->_admin_page_title = TICKETS_LABEL; |
|
33 | + $this->_labels = array( |
|
34 | + 'buttons' => array( |
|
35 | + 'add' => esc_html__('Add New Default Ticket', 'event_espresso'), |
|
36 | + 'edit' => esc_html__('Edit Default Ticket', 'event_espresso'), |
|
37 | + 'delete' => esc_html__('Delete Default Ticket', 'event_espresso'), |
|
38 | + ), |
|
39 | + ); |
|
40 | + } |
|
41 | + |
|
42 | + |
|
43 | + protected function _set_page_routes() |
|
44 | + { |
|
45 | + |
|
46 | + $tkt_id = ! empty($this->_req_data['TKT_ID']) && ! is_array($this->_req_data['TKT_ID']) |
|
47 | + ? $this->_req_data['TKT_ID'] : 0; |
|
48 | + |
|
49 | + $this->_page_routes = array( |
|
50 | + 'default' => array( |
|
51 | + 'func' => '_tickets_overview_list_table', |
|
52 | + 'capability' => 'ee_read_default_tickets', |
|
53 | + ), |
|
54 | + 'trash_ticket' => array( |
|
55 | + 'func' => '_trash_or_restore_ticket', |
|
56 | + 'noheader' => true, |
|
57 | + 'args' => array('trash' => true), |
|
58 | + 'capability' => 'ee_delete_default_ticket', |
|
59 | + 'obj_id' => $tkt_id, |
|
60 | + ), |
|
61 | + 'trash_tickets' => array( |
|
62 | + 'func' => '_trash_or_restore_ticket', |
|
63 | + 'noheader' => true, |
|
64 | + 'args' => array('trash' => true), |
|
65 | + 'capability' => 'ee_delete_default_tickets', |
|
66 | + ), |
|
67 | + 'restore_ticket' => array( |
|
68 | + 'func' => '_trash_or_restore_ticket', |
|
69 | + 'noheader' => true, |
|
70 | + 'capability' => 'ee_delete_default_ticket', |
|
71 | + 'obj_id' => $tkt_id, |
|
72 | + ), |
|
73 | + 'restore_tickets' => array( |
|
74 | + 'func' => '_trash_or_restore_ticket', |
|
75 | + 'noheader' => true, |
|
76 | + 'capability' => 'ee_delete_default_tickets', |
|
77 | + ), |
|
78 | + 'delete_ticket' => array( |
|
79 | + 'func' => '_delete_ticket', |
|
80 | + 'noheader' => true, |
|
81 | + 'capability' => 'ee_delete_default_ticket', |
|
82 | + 'obj_id' => $tkt_id, |
|
83 | + ), |
|
84 | + 'delete_tickets' => array( |
|
85 | + 'func' => '_delete_ticket', |
|
86 | + 'noheader' => true, |
|
87 | + 'capability' => 'ee_delete_default_tickets', |
|
88 | + ), |
|
89 | + ); |
|
90 | + } |
|
91 | + |
|
92 | + |
|
93 | + protected function _set_page_config() |
|
94 | + { |
|
95 | + $this->_page_config = array( |
|
96 | + 'default' => array( |
|
97 | + 'nav' => array( |
|
98 | + 'label' => esc_html__('Default Tickets', 'event_espresso'), |
|
99 | + 'order' => 10, |
|
100 | + ), |
|
101 | + 'list_table' => 'Tickets_List_Table', |
|
102 | + 'require_nonce' => false, |
|
103 | + ), |
|
104 | + ); |
|
105 | + } |
|
106 | + |
|
107 | + |
|
108 | + protected function _add_screen_options() |
|
109 | + { |
|
110 | + } |
|
111 | + |
|
112 | + protected function _add_screen_options_default() |
|
113 | + { |
|
114 | + $this->_per_page_screen_option(); |
|
115 | + } |
|
116 | + |
|
117 | + |
|
118 | + protected function _add_feature_pointers() |
|
119 | + { |
|
120 | + } |
|
121 | + |
|
122 | + public function load_scripts_styles() |
|
123 | + { |
|
124 | + } |
|
125 | + |
|
126 | + public function load_scripts_styles_default() |
|
127 | + { |
|
128 | + } |
|
129 | + |
|
130 | + public function admin_footer_scripts() |
|
131 | + { |
|
132 | + } |
|
133 | + |
|
134 | + public function admin_init() |
|
135 | + { |
|
136 | + } |
|
137 | + |
|
138 | + public function admin_notices() |
|
139 | + { |
|
140 | + } |
|
141 | + |
|
142 | + |
|
143 | + public function _set_list_table_views_default() |
|
144 | + { |
|
145 | + $this->_views = array( |
|
146 | + 'all' => array( |
|
147 | + 'slug' => 'all', |
|
148 | + 'label' => esc_html__('All', 'event_espresso'), |
|
149 | + 'count' => 0, |
|
150 | + 'bulk_action' => array( |
|
151 | + 'trash_tickets' => esc_html__('Move to Trash', 'event_espresso'), |
|
152 | + ), |
|
153 | + ), |
|
154 | + 'trashed' => array( |
|
155 | + 'slug' => 'trashed', |
|
156 | + 'label' => esc_html__('Trash', 'event_espresso'), |
|
157 | + 'count' => 0, |
|
158 | + 'bulk_action' => array( |
|
159 | + 'restore_tickets' => esc_html__('Restore from Trash', 'event_espresso'), |
|
160 | + 'delete_tickets' => esc_html__('Delete Permanently', 'event_espresso'), |
|
161 | + ), |
|
162 | + ), |
|
163 | + ); |
|
164 | + } |
|
165 | + |
|
166 | + |
|
167 | + public function _tickets_overview_list_table() |
|
168 | + { |
|
169 | + $this->_search_btn_label = esc_html__('Tickets', 'event_espresso'); |
|
170 | + $this->display_admin_list_table_page_with_no_sidebar(); |
|
171 | + } |
|
172 | + |
|
173 | + |
|
174 | + public function get_default_tickets($per_page = 10, $count = false, $trashed = false) |
|
175 | + { |
|
176 | + |
|
177 | + $orderby = empty($this->_req_data['orderby']) ? 'TKT_name' : $this->_req_data['orderby']; |
|
178 | + $order = empty($this->_req_data['order']) ? 'ASC' : $order; |
|
179 | + |
|
180 | + switch ($orderby) { |
|
181 | + case 'TKT_name': |
|
182 | + $orderby = array('TKT_name' => $order); |
|
183 | + break; |
|
184 | + |
|
185 | + case 'TKT_price': |
|
186 | + $orderby = array('TKT_price' => $order); |
|
187 | + break; |
|
188 | + |
|
189 | + case 'TKT_uses': |
|
190 | + $orderby = array('TKT_uses' => $order); |
|
191 | + break; |
|
192 | + |
|
193 | + case 'TKT_min': |
|
194 | + $orderby = array('TKT_min' => $order); |
|
195 | + break; |
|
196 | + |
|
197 | + case 'TKT_max': |
|
198 | + $orderby = array('TKT_max' => $order); |
|
199 | + break; |
|
200 | + |
|
201 | + case 'TKT_qty': |
|
202 | + $orderby = array('TKT_qty' => $order); |
|
203 | + break; |
|
204 | + } |
|
205 | + |
|
206 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) |
|
207 | + ? $this->_req_data['paged'] : 1; |
|
208 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) |
|
209 | + ? $this->_req_data['perpage'] : $per_page; |
|
210 | + |
|
211 | + $_where = array( |
|
212 | + 'TKT_is_default' => 1, |
|
213 | + 'TKT_deleted' => $trashed, |
|
214 | + ); |
|
215 | + |
|
216 | + $offset = ($current_page - 1) * $per_page; |
|
217 | + $limit = array($offset, $per_page); |
|
218 | + |
|
219 | + if (isset($this->_req_data['s'])) { |
|
220 | + $sstr = '%' . $this->_req_data['s'] . '%'; |
|
221 | + $_where['OR'] = array( |
|
222 | + 'TKT_name' => array('LIKE', $sstr), |
|
223 | + 'TKT_description' => array('LIKE', $sstr), |
|
224 | + ); |
|
225 | + } |
|
226 | + |
|
227 | + $query_params = array( |
|
228 | + $_where, |
|
229 | + 'order_by' => $orderby, |
|
230 | + 'limit' => $limit, |
|
231 | + 'group_by' => 'TKT_ID', |
|
232 | + ); |
|
233 | + |
|
234 | + if ($count) { |
|
235 | + return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where)); |
|
236 | + } else { |
|
237 | + return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params); |
|
238 | + } |
|
239 | + } |
|
240 | + |
|
241 | + |
|
242 | + protected function _trash_or_restore_ticket($trash = false) |
|
243 | + { |
|
244 | + $success = 1; |
|
245 | + |
|
246 | + $TKT = EEM_Ticket::instance(); |
|
247 | + |
|
248 | + // checkboxes? |
|
249 | + if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
250 | + // if array has more than one element then success message should be plural |
|
251 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
252 | + |
|
253 | + // cycle thru the boxes |
|
254 | + while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) { |
|
255 | + if ($trash) { |
|
256 | + if (! $TKT->delete_by_ID($TKT_ID)) { |
|
257 | + $success = 0; |
|
258 | + } |
|
259 | + } else { |
|
260 | + if (! $TKT->restore_by_ID($TKT_ID)) { |
|
261 | + $success = 0; |
|
262 | + } |
|
263 | + } |
|
264 | + } |
|
265 | + } else { |
|
266 | + // grab single id and trash |
|
267 | + $TKT_ID = absint($this->_req_data['TKT_ID']); |
|
268 | + |
|
269 | + if ($trash) { |
|
270 | + if (! $TKT->delete_by_ID($TKT_ID)) { |
|
271 | + $success = 0; |
|
272 | + } |
|
273 | + } else { |
|
274 | + if (! $TKT->restore_by_ID($TKT_ID)) { |
|
275 | + $success = 0; |
|
276 | + } |
|
277 | + } |
|
278 | + } |
|
279 | + |
|
280 | + $action_desc = $trash ? 'moved to the trash' : 'restored'; |
|
281 | + $this->_redirect_after_action($success, 'Tickets', $action_desc, array()); |
|
282 | + } |
|
283 | + |
|
284 | + |
|
285 | + protected function _delete_ticket() |
|
286 | + { |
|
287 | + $success = 1; |
|
288 | + |
|
289 | + $TKT = EEM_Ticket::instance(); |
|
290 | + |
|
291 | + // checkboxes? |
|
292 | + if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
293 | + // if array has more than one element then success message should be plural |
|
294 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
295 | + |
|
296 | + // cycle thru the boxes |
|
297 | + while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) { |
|
298 | + // delete |
|
299 | + if (! $this->_delete_the_ticket($TKT_ID)) { |
|
300 | + $success = 0; |
|
301 | + } |
|
302 | + } |
|
303 | + } else { |
|
304 | + // grab single id and trash |
|
305 | + $TKT_ID = absint($this->_req_data['TKT_ID']); |
|
306 | + if (! $this->_delete_the_ticket($TKT_ID)) { |
|
307 | + $success = 0; |
|
308 | + } |
|
309 | + } |
|
310 | + |
|
311 | + $action_desc = 'deleted'; |
|
312 | + $this->_redirect_after_action($success, 'Tickets', $action_desc, array()); |
|
313 | + } |
|
314 | + |
|
315 | + |
|
316 | + protected function _delete_the_ticket($TKT_ID) |
|
317 | + { |
|
318 | + $tkt = EEM_Ticket::instance()->get_one_by_ID($TKT_ID); |
|
319 | + |
|
320 | + // delete all related prices first |
|
321 | + $tkt->delete_related_permanently('Price'); |
|
322 | + return $tkt->delete_permanently(); |
|
323 | + } |
|
324 | 324 | } |
@@ -12,71 +12,71 @@ |
||
12 | 12 | class Extend_Support_Admin_Page extends Support_Admin_Page |
13 | 13 | { |
14 | 14 | |
15 | - public function __construct($routing = true) |
|
16 | - { |
|
17 | - parent::__construct($routing); |
|
18 | - define('EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'support/templates/'); |
|
19 | - } |
|
15 | + public function __construct($routing = true) |
|
16 | + { |
|
17 | + parent::__construct($routing); |
|
18 | + define('EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'support/templates/'); |
|
19 | + } |
|
20 | 20 | |
21 | 21 | |
22 | - protected function _extend_page_config() |
|
23 | - { |
|
24 | - $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'support'; |
|
25 | - // new routes and new configs (or overrides ) |
|
26 | - $new_page_routes = array( |
|
27 | - 'faq' => array( |
|
28 | - 'func' => '_faq', |
|
29 | - 'capability' => 'ee_read_ee', |
|
30 | - ), |
|
31 | - ); |
|
32 | - $this->_page_routes = array_merge($this->_page_routes, $new_page_routes); |
|
33 | - $new_page_config = array( |
|
34 | - 'faq' => array( |
|
35 | - 'nav' => array( |
|
36 | - 'label' => esc_html__('FAQ', 'event_espresso'), |
|
37 | - 'order' => 40, |
|
38 | - ), |
|
39 | - 'metaboxes' => array('_espresso_news_post_box', '_espresso_links_post_box'), |
|
40 | - 'require_nonce' => false, |
|
41 | - ), |
|
42 | - ); |
|
43 | - $this->_page_config = array_merge($this->_page_config, $new_page_config); |
|
44 | - $this->_page_config['default']['metaboxes'][] = '_installation_boxes'; |
|
45 | - } |
|
22 | + protected function _extend_page_config() |
|
23 | + { |
|
24 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'support'; |
|
25 | + // new routes and new configs (or overrides ) |
|
26 | + $new_page_routes = array( |
|
27 | + 'faq' => array( |
|
28 | + 'func' => '_faq', |
|
29 | + 'capability' => 'ee_read_ee', |
|
30 | + ), |
|
31 | + ); |
|
32 | + $this->_page_routes = array_merge($this->_page_routes, $new_page_routes); |
|
33 | + $new_page_config = array( |
|
34 | + 'faq' => array( |
|
35 | + 'nav' => array( |
|
36 | + 'label' => esc_html__('FAQ', 'event_espresso'), |
|
37 | + 'order' => 40, |
|
38 | + ), |
|
39 | + 'metaboxes' => array('_espresso_news_post_box', '_espresso_links_post_box'), |
|
40 | + 'require_nonce' => false, |
|
41 | + ), |
|
42 | + ); |
|
43 | + $this->_page_config = array_merge($this->_page_config, $new_page_config); |
|
44 | + $this->_page_config['default']['metaboxes'][] = '_installation_boxes'; |
|
45 | + } |
|
46 | 46 | |
47 | 47 | |
48 | - protected function _faq() |
|
49 | - { |
|
50 | - $template_path = EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH . 'support_admin_details_faq.template.php'; |
|
51 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
|
52 | - $template_path, |
|
53 | - '', |
|
54 | - true |
|
55 | - ); |
|
56 | - $this->display_admin_page_with_sidebar(); |
|
57 | - } |
|
48 | + protected function _faq() |
|
49 | + { |
|
50 | + $template_path = EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH . 'support_admin_details_faq.template.php'; |
|
51 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
|
52 | + $template_path, |
|
53 | + '', |
|
54 | + true |
|
55 | + ); |
|
56 | + $this->display_admin_page_with_sidebar(); |
|
57 | + } |
|
58 | 58 | |
59 | 59 | |
60 | - protected function _installation_boxes() |
|
61 | - { |
|
62 | - $callback_args = array( |
|
63 | - 'template_path' => EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH |
|
64 | - . 'support_admin_details_additional_information.template.php', |
|
65 | - ); |
|
66 | - add_meta_box( |
|
67 | - 'espresso_additional_information_support', |
|
68 | - esc_html__('Additional Information', 'event_espresso'), |
|
69 | - function ($post, $metabox) { |
|
70 | - echo EEH_Template::display_template( |
|
71 | - $metabox['args']['template_path'], |
|
72 | - '', |
|
73 | - true |
|
74 | - ); |
|
75 | - }, |
|
76 | - $this->_current_screen->id, |
|
77 | - 'normal', |
|
78 | - 'high', |
|
79 | - $callback_args |
|
80 | - ); |
|
81 | - } |
|
60 | + protected function _installation_boxes() |
|
61 | + { |
|
62 | + $callback_args = array( |
|
63 | + 'template_path' => EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH |
|
64 | + . 'support_admin_details_additional_information.template.php', |
|
65 | + ); |
|
66 | + add_meta_box( |
|
67 | + 'espresso_additional_information_support', |
|
68 | + esc_html__('Additional Information', 'event_espresso'), |
|
69 | + function ($post, $metabox) { |
|
70 | + echo EEH_Template::display_template( |
|
71 | + $metabox['args']['template_path'], |
|
72 | + '', |
|
73 | + true |
|
74 | + ); |
|
75 | + }, |
|
76 | + $this->_current_screen->id, |
|
77 | + 'normal', |
|
78 | + 'high', |
|
79 | + $callback_args |
|
80 | + ); |
|
81 | + } |
|
82 | 82 | } |
@@ -15,13 +15,13 @@ discard block |
||
15 | 15 | public function __construct($routing = true) |
16 | 16 | { |
17 | 17 | parent::__construct($routing); |
18 | - define('EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'support/templates/'); |
|
18 | + define('EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'support/templates/'); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | |
22 | 22 | protected function _extend_page_config() |
23 | 23 | { |
24 | - $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'support'; |
|
24 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'support'; |
|
25 | 25 | // new routes and new configs (or overrides ) |
26 | 26 | $new_page_routes = array( |
27 | 27 | 'faq' => array( |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | protected function _faq() |
49 | 49 | { |
50 | - $template_path = EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH . 'support_admin_details_faq.template.php'; |
|
50 | + $template_path = EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH.'support_admin_details_faq.template.php'; |
|
51 | 51 | $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
52 | 52 | $template_path, |
53 | 53 | '', |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | add_meta_box( |
67 | 67 | 'espresso_additional_information_support', |
68 | 68 | esc_html__('Additional Information', 'event_espresso'), |
69 | - function ($post, $metabox) { |
|
69 | + function($post, $metabox) { |
|
70 | 70 | echo EEH_Template::display_template( |
71 | 71 | $metabox['args']['template_path'], |
72 | 72 | '', |
@@ -4,14 +4,14 @@ |
||
4 | 4 | <h4><?php esc_html_e('New to Event Espresso?', 'event_espresso'); ?></h4> |
5 | 5 | |
6 | 6 | <p><?php |
7 | - printf( |
|
8 | - esc_html__( |
|
9 | - 'Check out the %1$squick start guide for Event Espresso 4%2$s. It has recommendations, tips, and tutorials so you can get your project started %3$squicker%4$s.', |
|
10 | - 'event_espresso' |
|
11 | - ), |
|
12 | - '<a href="https://eventespresso.com/wiki/welcome-to-event-espresso/#event-espresso-4" target="_blank">', |
|
13 | - '</a>', |
|
14 | - '<em>', |
|
15 | - '</em>' |
|
16 | - ); ?></p> |
|
7 | + printf( |
|
8 | + esc_html__( |
|
9 | + 'Check out the %1$squick start guide for Event Espresso 4%2$s. It has recommendations, tips, and tutorials so you can get your project started %3$squicker%4$s.', |
|
10 | + 'event_espresso' |
|
11 | + ), |
|
12 | + '<a href="https://eventespresso.com/wiki/welcome-to-event-espresso/#event-espresso-4" target="_blank">', |
|
13 | + '</a>', |
|
14 | + '<em>', |
|
15 | + '</em>' |
|
16 | + ); ?></p> |
|
17 | 17 | </div> |
18 | 18 | \ No newline at end of file |
@@ -21,17 +21,17 @@ discard block |
||
21 | 21 | public function __construct($routing = true) |
22 | 22 | { |
23 | 23 | parent::__construct($routing); |
24 | - if (! defined('EE_MSG_CAF_ASSETS_PATH')) { |
|
25 | - define('EE_MSG_CAF_ASSETS_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'messages/assets/'); |
|
26 | - define('EE_MSG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/assets/'); |
|
27 | - define('EE_MSG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'messages/templates/'); |
|
28 | - define('EE_MSG_CAF_TEMPLATE_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/templates/'); |
|
24 | + if ( ! defined('EE_MSG_CAF_ASSETS_PATH')) { |
|
25 | + define('EE_MSG_CAF_ASSETS_PATH', EE_CORE_CAF_ADMIN_EXTEND.'messages/assets/'); |
|
26 | + define('EE_MSG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'messages/assets/'); |
|
27 | + define('EE_MSG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'messages/templates/'); |
|
28 | + define('EE_MSG_CAF_TEMPLATE_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'messages/templates/'); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
32 | 32 | protected function _extend_page_config() |
33 | 33 | { |
34 | - $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'messages'; |
|
34 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'messages'; |
|
35 | 35 | $this->_page_routes['custom_mtps'] = array( |
36 | 36 | 'func' => '_ee_custom_messages_overview_list_table', |
37 | 37 | 'capability' => 'ee_read_messages', |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | { |
77 | 77 | global $admin_page_hooks; |
78 | 78 | |
79 | - if (! empty($admin_page_hooks['espresso_events'])) { |
|
79 | + if ( ! empty($admin_page_hooks['espresso_events'])) { |
|
80 | 80 | // we're on a EE specific page... good stuff! |
81 | 81 | $hook_prefix = $admin_page_hooks['espresso_events']; |
82 | - $filter_ref = $hook_prefix . '_page_' . $this->page_slug; |
|
83 | - add_filter('FHEE_manage_' . $filter_ref . '_columns', array($this, 'add_custom_mtps_columns'), 10, 2); |
|
82 | + $filter_ref = $hook_prefix.'_page_'.$this->page_slug; |
|
83 | + add_filter('FHEE_manage_'.$filter_ref.'_columns', array($this, 'add_custom_mtps_columns'), 10, 2); |
|
84 | 84 | add_action( |
85 | - 'AHEE__EE_Admin_List_Table__column_actions__' . $filter_ref, |
|
85 | + 'AHEE__EE_Admin_List_Table__column_actions__'.$filter_ref, |
|
86 | 86 | array($this, 'custom_mtp_create_button_column'), |
87 | 87 | 10, |
88 | 88 | 2 |
@@ -18,191 +18,191 @@ |
||
18 | 18 | { |
19 | 19 | |
20 | 20 | |
21 | - public function __construct($routing = true) |
|
22 | - { |
|
23 | - parent::__construct($routing); |
|
24 | - if (! defined('EE_MSG_CAF_ASSETS_PATH')) { |
|
25 | - define('EE_MSG_CAF_ASSETS_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'messages/assets/'); |
|
26 | - define('EE_MSG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/assets/'); |
|
27 | - define('EE_MSG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'messages/templates/'); |
|
28 | - define('EE_MSG_CAF_TEMPLATE_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/templates/'); |
|
29 | - } |
|
30 | - } |
|
31 | - |
|
32 | - protected function _extend_page_config() |
|
33 | - { |
|
34 | - $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'messages'; |
|
35 | - $this->_page_routes['custom_mtps'] = array( |
|
36 | - 'func' => '_ee_custom_messages_overview_list_table', |
|
37 | - 'capability' => 'ee_read_messages', |
|
38 | - ); |
|
39 | - $this->_page_config['custom_mtps'] = array( |
|
40 | - 'nav' => array( |
|
41 | - 'label' => esc_html__('Custom Message Templates', 'event_espresso'), |
|
42 | - 'order' => 30, |
|
43 | - ), |
|
44 | - 'list_table' => 'Custom_Messages_Template_List_Table', |
|
45 | - 'help_tabs' => array( |
|
46 | - 'message_overview_message_types_help_tab' => array( |
|
47 | - 'title' => esc_html__('Message Types', 'event_espresso'), |
|
48 | - 'filename' => 'messages_overview_types', |
|
49 | - ), |
|
50 | - 'messages_overview_messengers_help_tab' => array( |
|
51 | - 'title' => esc_html__('Messengers', 'event_espresso'), |
|
52 | - 'filename' => 'messages_overview_messengers', |
|
53 | - ), |
|
54 | - 'messages_overview_other_help_tab' => array( |
|
55 | - 'title' => esc_html__('Messages Other', 'event_espresso'), |
|
56 | - 'filename' => 'messages_overview_other', |
|
57 | - ), |
|
58 | - ), |
|
59 | - 'help_tour' => array(), |
|
60 | - 'require_nonce' => false, |
|
61 | - ); |
|
62 | - |
|
63 | - add_action('current_screen', array($this, 'dynamic_screen_hooks'), 10); |
|
64 | - } |
|
65 | - |
|
66 | - |
|
67 | - /** |
|
68 | - * Callback for current_screen action |
|
69 | - * This is used for any filters and/or actions that require the dynamic screen hook_prefix to be correct. |
|
70 | - * |
|
71 | - * @since 4.5.0 |
|
72 | - * |
|
73 | - * @return void |
|
74 | - */ |
|
75 | - public function dynamic_screen_hooks() |
|
76 | - { |
|
77 | - global $admin_page_hooks; |
|
78 | - |
|
79 | - if (! empty($admin_page_hooks['espresso_events'])) { |
|
80 | - // we're on a EE specific page... good stuff! |
|
81 | - $hook_prefix = $admin_page_hooks['espresso_events']; |
|
82 | - $filter_ref = $hook_prefix . '_page_' . $this->page_slug; |
|
83 | - add_filter('FHEE_manage_' . $filter_ref . '_columns', array($this, 'add_custom_mtps_columns'), 10, 2); |
|
84 | - add_action( |
|
85 | - 'AHEE__EE_Admin_List_Table__column_actions__' . $filter_ref, |
|
86 | - array($this, 'custom_mtp_create_button_column'), |
|
87 | - 10, |
|
88 | - 2 |
|
89 | - ); |
|
90 | - } |
|
91 | - } |
|
92 | - |
|
93 | - |
|
94 | - /** |
|
95 | - * This is the callback for the FHEE__manage_event-espresso_page_espresso_messages_columns to register the |
|
96 | - * caffeinated columns for the global message templates list table. |
|
97 | - * |
|
98 | - * @since 4.3.2 |
|
99 | - * |
|
100 | - * @param array $columns Original defined list of columns |
|
101 | - * @param string $screen_id The unique screen id for the page. |
|
102 | - */ |
|
103 | - public function add_custom_mtps_columns($columns, $screen_id) |
|
104 | - { |
|
105 | - if ($screen_id !== 'espresso_messages_global_mtps') { |
|
106 | - return $columns; |
|
107 | - } |
|
108 | - |
|
109 | - $columns['actions'] = ''; |
|
110 | - return $columns; |
|
111 | - } |
|
112 | - |
|
113 | - |
|
114 | - /** |
|
115 | - * Callback for FHEE__EE_Admin_List_Table__column_actions__event-espresso_page_espresso_messages action that allows |
|
116 | - * for adding the content for the registered "action" column. |
|
117 | - * |
|
118 | - * @since 4.3.2 |
|
119 | - * |
|
120 | - * @param EE_Base_Class |
|
121 | - * @param string $screen_id Unique screen id for the page |
|
122 | - * |
|
123 | - * @return string html content for the page. |
|
124 | - */ |
|
125 | - public function custom_mtp_create_button_column($item, $screen_id) |
|
126 | - { |
|
127 | - if ( |
|
128 | - $screen_id !== 'espresso_messages_global_mtps' || ! EE_Registry::instance()->CAP->current_user_can( |
|
129 | - 'ee_edit_messages', |
|
130 | - 'espresso_messages_add_new_message_template' |
|
131 | - ) |
|
132 | - ) { |
|
133 | - return ''; |
|
134 | - } |
|
135 | - |
|
136 | - // first we consider whether this template has override set. If it does then that means no custom templates can be created from this template as a base. So let's just skip the button creation. |
|
137 | - if ($item->get('MTP_is_override')) { |
|
138 | - return ''; |
|
139 | - } |
|
140 | - |
|
141 | - |
|
142 | - $create_args = array( |
|
143 | - 'GRP_ID' => $item->ID(), |
|
144 | - 'messenger' => $item->messenger(), |
|
145 | - 'message_type' => $item->message_type(), |
|
146 | - 'action' => 'add_new_message_template', |
|
147 | - ); |
|
148 | - $create_link = EE_Admin_Page::add_query_args_and_nonce($create_args, EE_MSG_ADMIN_URL); |
|
149 | - echo sprintf( |
|
150 | - '<a href="%s" class="button button-small">%s</a>', |
|
151 | - $create_link, |
|
152 | - esc_html__('Create Custom', 'event_espresso') |
|
153 | - ); |
|
154 | - } |
|
155 | - |
|
156 | - |
|
157 | - protected function _add_screen_options_custom_mtps() |
|
158 | - { |
|
159 | - $page_title = $this->_admin_page_title; |
|
160 | - $this->_admin_page_title = esc_html__('Custom Message Templates', 'event_espresso'); |
|
161 | - $this->_per_page_screen_option(); |
|
162 | - $this->_admin_page_title = $page_title; |
|
163 | - } |
|
164 | - |
|
165 | - |
|
166 | - /** |
|
167 | - * set views array for Custom Templates list table |
|
168 | - * |
|
169 | - * @access public |
|
170 | - * @return void |
|
171 | - */ |
|
172 | - public function _set_list_table_views_custom_mtps() |
|
173 | - { |
|
174 | - $this->_views = array( |
|
175 | - 'in_use' => array( |
|
176 | - 'slug' => 'in_use', |
|
177 | - 'label' => esc_html__('In Use', 'event_espresso'), |
|
178 | - 'count' => 0, |
|
179 | - 'bulk_action' => array( |
|
180 | - 'trash_message_template' => esc_html__('Move to Trash', 'event_espresso'), |
|
181 | - ), |
|
182 | - ), |
|
183 | - ); |
|
184 | - if ( |
|
185 | - EE_Registry::instance()->CAP->current_user_can( |
|
186 | - 'ee_delete_messages', |
|
187 | - 'espresso_messages_trash_message_template' |
|
188 | - ) |
|
189 | - ) { |
|
190 | - $this->_views['trashed'] = array( |
|
191 | - 'slug' => 'trashed', |
|
192 | - 'label' => esc_html__('Trash', 'event_espresso'), |
|
193 | - 'count' => 0, |
|
194 | - 'bulk_action' => array( |
|
195 | - 'restore_message_template' => esc_html__('Restore From Trash', 'event_espresso'), |
|
196 | - 'delete_message_template' => esc_html__('Delete Permanently', 'event_espresso'), |
|
197 | - ), |
|
198 | - ); |
|
199 | - } |
|
200 | - } |
|
201 | - |
|
202 | - |
|
203 | - protected function _ee_custom_messages_overview_list_table() |
|
204 | - { |
|
205 | - $this->_admin_page_title = esc_html__('Custom Message Templates', 'event_espresso'); |
|
206 | - $this->display_admin_list_table_page_with_no_sidebar(); |
|
207 | - } |
|
21 | + public function __construct($routing = true) |
|
22 | + { |
|
23 | + parent::__construct($routing); |
|
24 | + if (! defined('EE_MSG_CAF_ASSETS_PATH')) { |
|
25 | + define('EE_MSG_CAF_ASSETS_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'messages/assets/'); |
|
26 | + define('EE_MSG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/assets/'); |
|
27 | + define('EE_MSG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'messages/templates/'); |
|
28 | + define('EE_MSG_CAF_TEMPLATE_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/templates/'); |
|
29 | + } |
|
30 | + } |
|
31 | + |
|
32 | + protected function _extend_page_config() |
|
33 | + { |
|
34 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'messages'; |
|
35 | + $this->_page_routes['custom_mtps'] = array( |
|
36 | + 'func' => '_ee_custom_messages_overview_list_table', |
|
37 | + 'capability' => 'ee_read_messages', |
|
38 | + ); |
|
39 | + $this->_page_config['custom_mtps'] = array( |
|
40 | + 'nav' => array( |
|
41 | + 'label' => esc_html__('Custom Message Templates', 'event_espresso'), |
|
42 | + 'order' => 30, |
|
43 | + ), |
|
44 | + 'list_table' => 'Custom_Messages_Template_List_Table', |
|
45 | + 'help_tabs' => array( |
|
46 | + 'message_overview_message_types_help_tab' => array( |
|
47 | + 'title' => esc_html__('Message Types', 'event_espresso'), |
|
48 | + 'filename' => 'messages_overview_types', |
|
49 | + ), |
|
50 | + 'messages_overview_messengers_help_tab' => array( |
|
51 | + 'title' => esc_html__('Messengers', 'event_espresso'), |
|
52 | + 'filename' => 'messages_overview_messengers', |
|
53 | + ), |
|
54 | + 'messages_overview_other_help_tab' => array( |
|
55 | + 'title' => esc_html__('Messages Other', 'event_espresso'), |
|
56 | + 'filename' => 'messages_overview_other', |
|
57 | + ), |
|
58 | + ), |
|
59 | + 'help_tour' => array(), |
|
60 | + 'require_nonce' => false, |
|
61 | + ); |
|
62 | + |
|
63 | + add_action('current_screen', array($this, 'dynamic_screen_hooks'), 10); |
|
64 | + } |
|
65 | + |
|
66 | + |
|
67 | + /** |
|
68 | + * Callback for current_screen action |
|
69 | + * This is used for any filters and/or actions that require the dynamic screen hook_prefix to be correct. |
|
70 | + * |
|
71 | + * @since 4.5.0 |
|
72 | + * |
|
73 | + * @return void |
|
74 | + */ |
|
75 | + public function dynamic_screen_hooks() |
|
76 | + { |
|
77 | + global $admin_page_hooks; |
|
78 | + |
|
79 | + if (! empty($admin_page_hooks['espresso_events'])) { |
|
80 | + // we're on a EE specific page... good stuff! |
|
81 | + $hook_prefix = $admin_page_hooks['espresso_events']; |
|
82 | + $filter_ref = $hook_prefix . '_page_' . $this->page_slug; |
|
83 | + add_filter('FHEE_manage_' . $filter_ref . '_columns', array($this, 'add_custom_mtps_columns'), 10, 2); |
|
84 | + add_action( |
|
85 | + 'AHEE__EE_Admin_List_Table__column_actions__' . $filter_ref, |
|
86 | + array($this, 'custom_mtp_create_button_column'), |
|
87 | + 10, |
|
88 | + 2 |
|
89 | + ); |
|
90 | + } |
|
91 | + } |
|
92 | + |
|
93 | + |
|
94 | + /** |
|
95 | + * This is the callback for the FHEE__manage_event-espresso_page_espresso_messages_columns to register the |
|
96 | + * caffeinated columns for the global message templates list table. |
|
97 | + * |
|
98 | + * @since 4.3.2 |
|
99 | + * |
|
100 | + * @param array $columns Original defined list of columns |
|
101 | + * @param string $screen_id The unique screen id for the page. |
|
102 | + */ |
|
103 | + public function add_custom_mtps_columns($columns, $screen_id) |
|
104 | + { |
|
105 | + if ($screen_id !== 'espresso_messages_global_mtps') { |
|
106 | + return $columns; |
|
107 | + } |
|
108 | + |
|
109 | + $columns['actions'] = ''; |
|
110 | + return $columns; |
|
111 | + } |
|
112 | + |
|
113 | + |
|
114 | + /** |
|
115 | + * Callback for FHEE__EE_Admin_List_Table__column_actions__event-espresso_page_espresso_messages action that allows |
|
116 | + * for adding the content for the registered "action" column. |
|
117 | + * |
|
118 | + * @since 4.3.2 |
|
119 | + * |
|
120 | + * @param EE_Base_Class |
|
121 | + * @param string $screen_id Unique screen id for the page |
|
122 | + * |
|
123 | + * @return string html content for the page. |
|
124 | + */ |
|
125 | + public function custom_mtp_create_button_column($item, $screen_id) |
|
126 | + { |
|
127 | + if ( |
|
128 | + $screen_id !== 'espresso_messages_global_mtps' || ! EE_Registry::instance()->CAP->current_user_can( |
|
129 | + 'ee_edit_messages', |
|
130 | + 'espresso_messages_add_new_message_template' |
|
131 | + ) |
|
132 | + ) { |
|
133 | + return ''; |
|
134 | + } |
|
135 | + |
|
136 | + // first we consider whether this template has override set. If it does then that means no custom templates can be created from this template as a base. So let's just skip the button creation. |
|
137 | + if ($item->get('MTP_is_override')) { |
|
138 | + return ''; |
|
139 | + } |
|
140 | + |
|
141 | + |
|
142 | + $create_args = array( |
|
143 | + 'GRP_ID' => $item->ID(), |
|
144 | + 'messenger' => $item->messenger(), |
|
145 | + 'message_type' => $item->message_type(), |
|
146 | + 'action' => 'add_new_message_template', |
|
147 | + ); |
|
148 | + $create_link = EE_Admin_Page::add_query_args_and_nonce($create_args, EE_MSG_ADMIN_URL); |
|
149 | + echo sprintf( |
|
150 | + '<a href="%s" class="button button-small">%s</a>', |
|
151 | + $create_link, |
|
152 | + esc_html__('Create Custom', 'event_espresso') |
|
153 | + ); |
|
154 | + } |
|
155 | + |
|
156 | + |
|
157 | + protected function _add_screen_options_custom_mtps() |
|
158 | + { |
|
159 | + $page_title = $this->_admin_page_title; |
|
160 | + $this->_admin_page_title = esc_html__('Custom Message Templates', 'event_espresso'); |
|
161 | + $this->_per_page_screen_option(); |
|
162 | + $this->_admin_page_title = $page_title; |
|
163 | + } |
|
164 | + |
|
165 | + |
|
166 | + /** |
|
167 | + * set views array for Custom Templates list table |
|
168 | + * |
|
169 | + * @access public |
|
170 | + * @return void |
|
171 | + */ |
|
172 | + public function _set_list_table_views_custom_mtps() |
|
173 | + { |
|
174 | + $this->_views = array( |
|
175 | + 'in_use' => array( |
|
176 | + 'slug' => 'in_use', |
|
177 | + 'label' => esc_html__('In Use', 'event_espresso'), |
|
178 | + 'count' => 0, |
|
179 | + 'bulk_action' => array( |
|
180 | + 'trash_message_template' => esc_html__('Move to Trash', 'event_espresso'), |
|
181 | + ), |
|
182 | + ), |
|
183 | + ); |
|
184 | + if ( |
|
185 | + EE_Registry::instance()->CAP->current_user_can( |
|
186 | + 'ee_delete_messages', |
|
187 | + 'espresso_messages_trash_message_template' |
|
188 | + ) |
|
189 | + ) { |
|
190 | + $this->_views['trashed'] = array( |
|
191 | + 'slug' => 'trashed', |
|
192 | + 'label' => esc_html__('Trash', 'event_espresso'), |
|
193 | + 'count' => 0, |
|
194 | + 'bulk_action' => array( |
|
195 | + 'restore_message_template' => esc_html__('Restore From Trash', 'event_espresso'), |
|
196 | + 'delete_message_template' => esc_html__('Delete Permanently', 'event_espresso'), |
|
197 | + ), |
|
198 | + ); |
|
199 | + } |
|
200 | + } |
|
201 | + |
|
202 | + |
|
203 | + protected function _ee_custom_messages_overview_list_table() |
|
204 | + { |
|
205 | + $this->_admin_page_title = esc_html__('Custom Message Templates', 'event_espresso'); |
|
206 | + $this->display_admin_list_table_page_with_no_sidebar(); |
|
207 | + } |
|
208 | 208 | } |
@@ -21,14 +21,14 @@ discard block |
||
21 | 21 | public function __construct($routing = true) |
22 | 22 | { |
23 | 23 | parent::__construct($routing); |
24 | - define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'general_settings/templates/'); |
|
24 | + define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'general_settings/templates/'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
28 | 28 | protected function _extend_page_config() |
29 | 29 | { |
30 | 30 | |
31 | - $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'general_settings'; |
|
31 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'general_settings'; |
|
32 | 32 | |
33 | 33 | // filters and action hooks here |
34 | 34 | add_action('AHEE__admin_option_settings__template__before', array($this, 'debug_logging_options'), 9); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $template_args['remote_logging_url'] = isset(EE_Registry::instance()->CFG->admin->remote_logging_url) |
61 | 61 | && ! empty(EE_Registry::instance()->CFG->admin->remote_logging_url) |
62 | 62 | ? stripslashes(EE_Registry::instance()->CFG->admin->remote_logging_url) : ''; |
63 | - $template = GEN_SET_CAF_TEMPLATE_PATH . 'debug_log_settings.template.php'; |
|
63 | + $template = GEN_SET_CAF_TEMPLATE_PATH.'debug_log_settings.template.php'; |
|
64 | 64 | EEH_Template::display_template($template, $template_args); |
65 | 65 | } |
66 | 66 |
@@ -18,68 +18,68 @@ |
||
18 | 18 | { |
19 | 19 | |
20 | 20 | |
21 | - public function __construct($routing = true) |
|
22 | - { |
|
23 | - parent::__construct($routing); |
|
24 | - define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'general_settings/templates/'); |
|
25 | - } |
|
21 | + public function __construct($routing = true) |
|
22 | + { |
|
23 | + parent::__construct($routing); |
|
24 | + define('GEN_SET_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'general_settings/templates/'); |
|
25 | + } |
|
26 | 26 | |
27 | 27 | |
28 | - protected function _extend_page_config() |
|
29 | - { |
|
28 | + protected function _extend_page_config() |
|
29 | + { |
|
30 | 30 | |
31 | - $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'general_settings'; |
|
31 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'general_settings'; |
|
32 | 32 | |
33 | - // filters and action hooks here |
|
34 | - add_action('AHEE__admin_option_settings__template__before', array($this, 'debug_logging_options'), 9); |
|
35 | - add_filter( |
|
36 | - 'FHEE__General_Settings_Admin_Page___update_admin_option_settings__CFG_admin', |
|
37 | - array($this, 'update_debug_logging_options'), |
|
38 | - 10, |
|
39 | - 1 |
|
40 | - ); |
|
41 | - } |
|
33 | + // filters and action hooks here |
|
34 | + add_action('AHEE__admin_option_settings__template__before', array($this, 'debug_logging_options'), 9); |
|
35 | + add_filter( |
|
36 | + 'FHEE__General_Settings_Admin_Page___update_admin_option_settings__CFG_admin', |
|
37 | + array($this, 'update_debug_logging_options'), |
|
38 | + 10, |
|
39 | + 1 |
|
40 | + ); |
|
41 | + } |
|
42 | 42 | |
43 | 43 | |
44 | 44 | |
45 | - /************* Logging Settings *************/ |
|
45 | + /************* Logging Settings *************/ |
|
46 | 46 | |
47 | - /** |
|
48 | - * debug_logging_options |
|
49 | - * |
|
50 | - * @param array $template_args |
|
51 | - * |
|
52 | - * @return void |
|
53 | - */ |
|
54 | - public function debug_logging_options($template_args = array()) |
|
55 | - { |
|
56 | - $template_args['use_remote_logging'] = isset(EE_Registry::instance()->CFG->admin->use_remote_logging) ? absint( |
|
57 | - EE_Registry::instance()->CFG->admin->use_remote_logging |
|
58 | - ) : false; |
|
59 | - $template_args['remote_logging_url'] = isset(EE_Registry::instance()->CFG->admin->remote_logging_url) |
|
60 | - && ! empty(EE_Registry::instance()->CFG->admin->remote_logging_url) |
|
61 | - ? stripslashes(EE_Registry::instance()->CFG->admin->remote_logging_url) : ''; |
|
62 | - $template = GEN_SET_CAF_TEMPLATE_PATH . 'debug_log_settings.template.php'; |
|
63 | - EEH_Template::display_template($template, $template_args); |
|
64 | - } |
|
47 | + /** |
|
48 | + * debug_logging_options |
|
49 | + * |
|
50 | + * @param array $template_args |
|
51 | + * |
|
52 | + * @return void |
|
53 | + */ |
|
54 | + public function debug_logging_options($template_args = array()) |
|
55 | + { |
|
56 | + $template_args['use_remote_logging'] = isset(EE_Registry::instance()->CFG->admin->use_remote_logging) ? absint( |
|
57 | + EE_Registry::instance()->CFG->admin->use_remote_logging |
|
58 | + ) : false; |
|
59 | + $template_args['remote_logging_url'] = isset(EE_Registry::instance()->CFG->admin->remote_logging_url) |
|
60 | + && ! empty(EE_Registry::instance()->CFG->admin->remote_logging_url) |
|
61 | + ? stripslashes(EE_Registry::instance()->CFG->admin->remote_logging_url) : ''; |
|
62 | + $template = GEN_SET_CAF_TEMPLATE_PATH . 'debug_log_settings.template.php'; |
|
63 | + EEH_Template::display_template($template, $template_args); |
|
64 | + } |
|
65 | 65 | |
66 | 66 | |
67 | - /** |
|
68 | - * update_debug_logging_options |
|
69 | - * |
|
70 | - * @param array $admin_options |
|
71 | - * |
|
72 | - * @return array |
|
73 | - */ |
|
74 | - public function update_debug_logging_options($admin_options = array()) |
|
75 | - { |
|
76 | - $admin_options->use_remote_logging = isset($this->_req_data['use_remote_logging']) ? absint( |
|
77 | - $this->_req_data['use_remote_logging'] |
|
78 | - ) : $admin_options->use_remote_logging; |
|
79 | - $admin_options->remote_logging_url = isset($this->_req_data['remote_logging_url']) ? esc_url_raw( |
|
80 | - $this->_req_data['remote_logging_url'] |
|
81 | - ) : $admin_options->remote_logging_url; |
|
67 | + /** |
|
68 | + * update_debug_logging_options |
|
69 | + * |
|
70 | + * @param array $admin_options |
|
71 | + * |
|
72 | + * @return array |
|
73 | + */ |
|
74 | + public function update_debug_logging_options($admin_options = array()) |
|
75 | + { |
|
76 | + $admin_options->use_remote_logging = isset($this->_req_data['use_remote_logging']) ? absint( |
|
77 | + $this->_req_data['use_remote_logging'] |
|
78 | + ) : $admin_options->use_remote_logging; |
|
79 | + $admin_options->remote_logging_url = isset($this->_req_data['remote_logging_url']) ? esc_url_raw( |
|
80 | + $this->_req_data['remote_logging_url'] |
|
81 | + ) : $admin_options->remote_logging_url; |
|
82 | 82 | |
83 | - return $admin_options; |
|
84 | - } |
|
83 | + return $admin_options; |
|
84 | + } |
|
85 | 85 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | ), |
72 | 72 | 7 => array( |
73 | 73 | 'content_id' => 'tkt-status-archived', |
74 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::archived, |
|
74 | + 'target' => '.ticket-row .tkt-status-'.EE_Ticket::archived, |
|
75 | 75 | 'content' => $this->_ticket_status_legend(EE_Ticket::archived), |
76 | 76 | 'options' => array( |
77 | 77 | 'position' => array( |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | ), |
85 | 85 | 8 => array( |
86 | 86 | 'content_id' => 'tkt-status-expired', |
87 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::expired, |
|
87 | + 'target' => '.ticket-row .tkt-status-'.EE_Ticket::expired, |
|
88 | 88 | 'content' => $this->_ticket_status_legend(EE_Ticket::expired), |
89 | 89 | 'options' => array( |
90 | 90 | 'position' => array( |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | ), |
98 | 98 | 9 => array( |
99 | 99 | 'content_id' => 'tkt-status-sold_out', |
100 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::sold_out, |
|
100 | + 'target' => '.ticket-row .tkt-status-'.EE_Ticket::sold_out, |
|
101 | 101 | 'content' => $this->_ticket_status_legend(EE_Ticket::sold_out), |
102 | 102 | 'options' => array( |
103 | 103 | 'position' => array( |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | ), |
111 | 111 | 10 => array( |
112 | 112 | 'content_id' => 'tkt-status-pending', |
113 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::pending, |
|
113 | + 'target' => '.ticket-row .tkt-status-'.EE_Ticket::pending, |
|
114 | 114 | 'content' => $this->_ticket_status_legend(EE_Ticket::pending), |
115 | 115 | 'options' => array( |
116 | 116 | 'position' => array( |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | ), |
124 | 124 | 11 => array( |
125 | 125 | 'content_id' => 'tkt-status-onsale', |
126 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::onsale, |
|
126 | + 'target' => '.ticket-row .tkt-status-'.EE_Ticket::onsale, |
|
127 | 127 | 'content' => $this->_ticket_status_legend(EE_Ticket::onsale), |
128 | 128 | 'options' => array( |
129 | 129 | 'position' => array( |
@@ -173,12 +173,12 @@ discard block |
||
173 | 173 | '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)', |
174 | 174 | 'event_espresso' |
175 | 175 | ), |
176 | - '<a href="' . $price_admin_link . '" title="' . esc_attr__( |
|
176 | + '<a href="'.$price_admin_link.'" title="'.esc_attr__( |
|
177 | 177 | 'Pricing Admin Page', |
178 | 178 | 'event_espresso' |
179 | - ) . '">', |
|
179 | + ).'">', |
|
180 | 180 | '</a>' |
181 | - ) . '</p>'; |
|
181 | + ).'</p>'; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
@@ -15,189 +15,189 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - protected function _set_tips_array() |
|
19 | - { |
|
20 | - $this->_qtipsa = array( |
|
21 | - 0 => array( |
|
22 | - 'content_id' => 'about-taxable-toggle', |
|
23 | - 'target' => '.TKT-taxable-checkbox', |
|
24 | - 'content' => $this->_get_taxable_info_content(), |
|
25 | - 'options' => array( |
|
26 | - 'show_only_once' => true, |
|
27 | - 'content' => array( |
|
28 | - 'title' => esc_html__('Taxable Ticket Toggle', 'event_espresso'), |
|
29 | - 'button' => true, |
|
30 | - ), |
|
31 | - 'show' => array( |
|
32 | - 'event' => 'click', |
|
33 | - ), |
|
34 | - 'hide' => array( |
|
35 | - 'event' => false, |
|
36 | - ), |
|
37 | - 'style' => array( |
|
38 | - 'classes' => '', |
|
39 | - ), |
|
40 | - )// defaults |
|
41 | - ), |
|
42 | - 1 => array( |
|
43 | - 'content_id' => 'ticket-icon-help', |
|
44 | - 'target' => '.ticket-icon', |
|
45 | - 'content' => esc_html__('Assigned Tickets', 'event_espresso'), |
|
46 | - ), |
|
47 | - 2 => array( |
|
48 | - 'content_id' => 'clone-icon-help', |
|
49 | - 'target' => '.clone-icon', |
|
50 | - 'content' => esc_html__('Duplicate this Item', 'event_espresso'), |
|
51 | - ), |
|
52 | - 3 => array( |
|
53 | - 'content_id' => 'trash-datetime-help', |
|
54 | - 'target' => '.datetime-edit-table .trash-icon', |
|
55 | - 'content' => esc_html__('Trash Datetime', 'event_espresso'), |
|
56 | - ), |
|
57 | - 4 => array( |
|
58 | - 'content_id' => 'trash-ticket-help', |
|
59 | - 'target' => '.ticket-row .trash-icon', |
|
60 | - 'content' => esc_html__('Trash Ticket', 'event_espresso'), |
|
61 | - ), |
|
62 | - 5 => array( |
|
63 | - 'content_id' => 'trash-price-modifier-help', |
|
64 | - 'target' => '.ticket-price-rows .trash-icon', |
|
65 | - 'content' => esc_html__('Trash Price Modifier', 'event_espresso'), |
|
66 | - ), |
|
67 | - 6 => array( |
|
68 | - 'content_id' => 'gear-icon-help', |
|
69 | - 'target' => '.gear-icon', |
|
70 | - 'content' => esc_html__('Advanced Settings', 'event_espresso'), |
|
71 | - ), |
|
72 | - 7 => array( |
|
73 | - 'content_id' => 'tkt-status-archived', |
|
74 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::archived, |
|
75 | - 'content' => $this->_ticket_status_legend(EE_Ticket::archived), |
|
76 | - 'options' => array( |
|
77 | - 'position' => array( |
|
78 | - 'target' => 'mouse', |
|
79 | - 'adjust' => array( |
|
80 | - 'mouse' => false, |
|
81 | - ), |
|
82 | - ), |
|
83 | - ), |
|
84 | - ), |
|
85 | - 8 => array( |
|
86 | - 'content_id' => 'tkt-status-expired', |
|
87 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::expired, |
|
88 | - 'content' => $this->_ticket_status_legend(EE_Ticket::expired), |
|
89 | - 'options' => array( |
|
90 | - 'position' => array( |
|
91 | - 'target' => 'mouse', |
|
92 | - 'adjust' => array( |
|
93 | - 'mouse' => false, |
|
94 | - ), |
|
95 | - ), |
|
96 | - ), |
|
97 | - ), |
|
98 | - 9 => array( |
|
99 | - 'content_id' => 'tkt-status-sold_out', |
|
100 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::sold_out, |
|
101 | - 'content' => $this->_ticket_status_legend(EE_Ticket::sold_out), |
|
102 | - 'options' => array( |
|
103 | - 'position' => array( |
|
104 | - 'target' => 'mouse', |
|
105 | - 'adjust' => array( |
|
106 | - 'mouse' => false, |
|
107 | - ), |
|
108 | - ), |
|
109 | - ), |
|
110 | - ), |
|
111 | - 10 => array( |
|
112 | - 'content_id' => 'tkt-status-pending', |
|
113 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::pending, |
|
114 | - 'content' => $this->_ticket_status_legend(EE_Ticket::pending), |
|
115 | - 'options' => array( |
|
116 | - 'position' => array( |
|
117 | - 'target' => 'mouse', |
|
118 | - 'adjust' => array( |
|
119 | - 'mouse' => false, |
|
120 | - ), |
|
121 | - ), |
|
122 | - ), |
|
123 | - ), |
|
124 | - 11 => array( |
|
125 | - 'content_id' => 'tkt-status-onsale', |
|
126 | - 'target' => '.ticket-row .tkt-status-' . EE_Ticket::onsale, |
|
127 | - 'content' => $this->_ticket_status_legend(EE_Ticket::onsale), |
|
128 | - 'options' => array( |
|
129 | - 'position' => array( |
|
130 | - 'target' => 'mouse', |
|
131 | - 'adjust' => array( |
|
132 | - 'mouse' => false, |
|
133 | - ), |
|
134 | - ), |
|
135 | - ), |
|
136 | - ), |
|
137 | - 12 => array( |
|
138 | - 'content_id' => 'sortable-tkt-drag-handle-tip', |
|
139 | - 'target' => '.ee-ticket-sortable .sortable-drag-handle', |
|
140 | - 'content' => esc_html__('Click and drag-n-drop to reorder tickets.', 'event_espresso'), |
|
141 | - 'options' => array( |
|
142 | - 'position' => array( |
|
143 | - 'adjust' => array( |
|
144 | - 'mouse' => false, |
|
145 | - 'y' => 5, |
|
146 | - ), |
|
147 | - ), |
|
148 | - ), |
|
149 | - ), |
|
150 | - 13 => array( |
|
151 | - 'content_id' => 'sortable-dtt-drag-handle-tip', |
|
152 | - 'target' => '.ee-dtt-sortable .sortable-drag-handle', |
|
153 | - 'content' => esc_html__('Click and drag-n-drop to reorder datetimes.', 'event_espresso'), |
|
154 | - 'options' => array( |
|
155 | - 'position' => array( |
|
156 | - 'adjust' => array( |
|
157 | - 'mouse' => false, |
|
158 | - 'y' => 5, |
|
159 | - ), |
|
160 | - ), |
|
161 | - ), |
|
162 | - ), |
|
163 | - ); |
|
164 | - } |
|
18 | + protected function _set_tips_array() |
|
19 | + { |
|
20 | + $this->_qtipsa = array( |
|
21 | + 0 => array( |
|
22 | + 'content_id' => 'about-taxable-toggle', |
|
23 | + 'target' => '.TKT-taxable-checkbox', |
|
24 | + 'content' => $this->_get_taxable_info_content(), |
|
25 | + 'options' => array( |
|
26 | + 'show_only_once' => true, |
|
27 | + 'content' => array( |
|
28 | + 'title' => esc_html__('Taxable Ticket Toggle', 'event_espresso'), |
|
29 | + 'button' => true, |
|
30 | + ), |
|
31 | + 'show' => array( |
|
32 | + 'event' => 'click', |
|
33 | + ), |
|
34 | + 'hide' => array( |
|
35 | + 'event' => false, |
|
36 | + ), |
|
37 | + 'style' => array( |
|
38 | + 'classes' => '', |
|
39 | + ), |
|
40 | + )// defaults |
|
41 | + ), |
|
42 | + 1 => array( |
|
43 | + 'content_id' => 'ticket-icon-help', |
|
44 | + 'target' => '.ticket-icon', |
|
45 | + 'content' => esc_html__('Assigned Tickets', 'event_espresso'), |
|
46 | + ), |
|
47 | + 2 => array( |
|
48 | + 'content_id' => 'clone-icon-help', |
|
49 | + 'target' => '.clone-icon', |
|
50 | + 'content' => esc_html__('Duplicate this Item', 'event_espresso'), |
|
51 | + ), |
|
52 | + 3 => array( |
|
53 | + 'content_id' => 'trash-datetime-help', |
|
54 | + 'target' => '.datetime-edit-table .trash-icon', |
|
55 | + 'content' => esc_html__('Trash Datetime', 'event_espresso'), |
|
56 | + ), |
|
57 | + 4 => array( |
|
58 | + 'content_id' => 'trash-ticket-help', |
|
59 | + 'target' => '.ticket-row .trash-icon', |
|
60 | + 'content' => esc_html__('Trash Ticket', 'event_espresso'), |
|
61 | + ), |
|
62 | + 5 => array( |
|
63 | + 'content_id' => 'trash-price-modifier-help', |
|
64 | + 'target' => '.ticket-price-rows .trash-icon', |
|
65 | + 'content' => esc_html__('Trash Price Modifier', 'event_espresso'), |
|
66 | + ), |
|
67 | + 6 => array( |
|
68 | + 'content_id' => 'gear-icon-help', |
|
69 | + 'target' => '.gear-icon', |
|
70 | + 'content' => esc_html__('Advanced Settings', 'event_espresso'), |
|
71 | + ), |
|
72 | + 7 => array( |
|
73 | + 'content_id' => 'tkt-status-archived', |
|
74 | + 'target' => '.ticket-row .tkt-status-' . EE_Ticket::archived, |
|
75 | + 'content' => $this->_ticket_status_legend(EE_Ticket::archived), |
|
76 | + 'options' => array( |
|
77 | + 'position' => array( |
|
78 | + 'target' => 'mouse', |
|
79 | + 'adjust' => array( |
|
80 | + 'mouse' => false, |
|
81 | + ), |
|
82 | + ), |
|
83 | + ), |
|
84 | + ), |
|
85 | + 8 => array( |
|
86 | + 'content_id' => 'tkt-status-expired', |
|
87 | + 'target' => '.ticket-row .tkt-status-' . EE_Ticket::expired, |
|
88 | + 'content' => $this->_ticket_status_legend(EE_Ticket::expired), |
|
89 | + 'options' => array( |
|
90 | + 'position' => array( |
|
91 | + 'target' => 'mouse', |
|
92 | + 'adjust' => array( |
|
93 | + 'mouse' => false, |
|
94 | + ), |
|
95 | + ), |
|
96 | + ), |
|
97 | + ), |
|
98 | + 9 => array( |
|
99 | + 'content_id' => 'tkt-status-sold_out', |
|
100 | + 'target' => '.ticket-row .tkt-status-' . EE_Ticket::sold_out, |
|
101 | + 'content' => $this->_ticket_status_legend(EE_Ticket::sold_out), |
|
102 | + 'options' => array( |
|
103 | + 'position' => array( |
|
104 | + 'target' => 'mouse', |
|
105 | + 'adjust' => array( |
|
106 | + 'mouse' => false, |
|
107 | + ), |
|
108 | + ), |
|
109 | + ), |
|
110 | + ), |
|
111 | + 10 => array( |
|
112 | + 'content_id' => 'tkt-status-pending', |
|
113 | + 'target' => '.ticket-row .tkt-status-' . EE_Ticket::pending, |
|
114 | + 'content' => $this->_ticket_status_legend(EE_Ticket::pending), |
|
115 | + 'options' => array( |
|
116 | + 'position' => array( |
|
117 | + 'target' => 'mouse', |
|
118 | + 'adjust' => array( |
|
119 | + 'mouse' => false, |
|
120 | + ), |
|
121 | + ), |
|
122 | + ), |
|
123 | + ), |
|
124 | + 11 => array( |
|
125 | + 'content_id' => 'tkt-status-onsale', |
|
126 | + 'target' => '.ticket-row .tkt-status-' . EE_Ticket::onsale, |
|
127 | + 'content' => $this->_ticket_status_legend(EE_Ticket::onsale), |
|
128 | + 'options' => array( |
|
129 | + 'position' => array( |
|
130 | + 'target' => 'mouse', |
|
131 | + 'adjust' => array( |
|
132 | + 'mouse' => false, |
|
133 | + ), |
|
134 | + ), |
|
135 | + ), |
|
136 | + ), |
|
137 | + 12 => array( |
|
138 | + 'content_id' => 'sortable-tkt-drag-handle-tip', |
|
139 | + 'target' => '.ee-ticket-sortable .sortable-drag-handle', |
|
140 | + 'content' => esc_html__('Click and drag-n-drop to reorder tickets.', 'event_espresso'), |
|
141 | + 'options' => array( |
|
142 | + 'position' => array( |
|
143 | + 'adjust' => array( |
|
144 | + 'mouse' => false, |
|
145 | + 'y' => 5, |
|
146 | + ), |
|
147 | + ), |
|
148 | + ), |
|
149 | + ), |
|
150 | + 13 => array( |
|
151 | + 'content_id' => 'sortable-dtt-drag-handle-tip', |
|
152 | + 'target' => '.ee-dtt-sortable .sortable-drag-handle', |
|
153 | + 'content' => esc_html__('Click and drag-n-drop to reorder datetimes.', 'event_espresso'), |
|
154 | + 'options' => array( |
|
155 | + 'position' => array( |
|
156 | + 'adjust' => array( |
|
157 | + 'mouse' => false, |
|
158 | + 'y' => 5, |
|
159 | + ), |
|
160 | + ), |
|
161 | + ), |
|
162 | + ), |
|
163 | + ); |
|
164 | + } |
|
165 | 165 | |
166 | 166 | |
167 | - private function _get_taxable_info_content() |
|
168 | - { |
|
169 | - $price_admin_link = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default'), PRICING_ADMIN_URL); |
|
170 | - return '<p>' |
|
171 | - . sprintf( |
|
172 | - esc_html__( |
|
173 | - '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)', |
|
174 | - 'event_espresso' |
|
175 | - ), |
|
176 | - '<a href="' . $price_admin_link . '" title="' . esc_attr__( |
|
177 | - 'Pricing Admin Page', |
|
178 | - 'event_espresso' |
|
179 | - ) . '">', |
|
180 | - '</a>' |
|
181 | - ) . '</p>'; |
|
182 | - } |
|
167 | + private function _get_taxable_info_content() |
|
168 | + { |
|
169 | + $price_admin_link = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default'), PRICING_ADMIN_URL); |
|
170 | + return '<p>' |
|
171 | + . sprintf( |
|
172 | + esc_html__( |
|
173 | + '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)', |
|
174 | + 'event_espresso' |
|
175 | + ), |
|
176 | + '<a href="' . $price_admin_link . '" title="' . esc_attr__( |
|
177 | + 'Pricing Admin Page', |
|
178 | + 'event_espresso' |
|
179 | + ) . '">', |
|
180 | + '</a>' |
|
181 | + ) . '</p>'; |
|
182 | + } |
|
183 | 183 | |
184 | - /** |
|
185 | - * output the relevant ee-status-legend with the designated status highlighted. |
|
186 | - * |
|
187 | - * @param EE_Ticket constant $status What status is set (by class) |
|
188 | - * @return string The status legend with the related status highlighted |
|
189 | - */ |
|
190 | - private function _ticket_status_legend($status) |
|
191 | - { |
|
184 | + /** |
|
185 | + * output the relevant ee-status-legend with the designated status highlighted. |
|
186 | + * |
|
187 | + * @param EE_Ticket constant $status What status is set (by class) |
|
188 | + * @return string The status legend with the related status highlighted |
|
189 | + */ |
|
190 | + private function _ticket_status_legend($status) |
|
191 | + { |
|
192 | 192 | |
193 | - $status_array = array( |
|
194 | - 'archived' => EE_Ticket::archived, |
|
195 | - 'expired' => EE_Ticket::expired, |
|
196 | - 'sold_out' => EE_Ticket::sold_out, |
|
197 | - 'pending' => EE_Ticket::pending, |
|
198 | - 'onsale' => EE_Ticket::onsale, |
|
199 | - ); |
|
193 | + $status_array = array( |
|
194 | + 'archived' => EE_Ticket::archived, |
|
195 | + 'expired' => EE_Ticket::expired, |
|
196 | + 'sold_out' => EE_Ticket::sold_out, |
|
197 | + 'pending' => EE_Ticket::pending, |
|
198 | + 'onsale' => EE_Ticket::onsale, |
|
199 | + ); |
|
200 | 200 | |
201 | - return EEH_Template::status_legend($status_array, $status); |
|
202 | - } |
|
201 | + return EEH_Template::status_legend($status_array, $status); |
|
202 | + } |
|
203 | 203 | } |
@@ -4,9 +4,9 @@ |
||
4 | 4 | </ul> |
5 | 5 | <div id="espresso_event_type-all" class="tabs-panel"> |
6 | 6 | <?php |
7 | - $name = 'tax_input[espresso_event_type]'; |
|
8 | - echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. |
|
9 | - ?> |
|
7 | + $name = 'tax_input[espresso_event_type]'; |
|
8 | + echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. |
|
9 | + ?> |
|
10 | 10 | <ul id="espresso_event_typechecklist" data-wp-lists="list:espresso_event_type" |
11 | 11 | class="categorychecklist form-no-clear"> |
12 | 12 | <?php echo $radio_list; ?> |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | // required variables for template: |
3 | 3 | assert($question_group instanceof EE_Question_Group); |
4 | -assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions)));// list of unused questions |
|
4 | +assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions))); // list of unused questions |
|
5 | 5 | foreach ($all_questions as $question_option) { |
6 | 6 | assert($question_option); |
7 | 7 | assert($question_option instanceof EE_Question); |
@@ -3,17 +3,17 @@ |
||
3 | 3 | assert($question_group instanceof EE_Question_Group); |
4 | 4 | assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions)));// list of unused questions |
5 | 5 | foreach ($all_questions as $question_option) { |
6 | - assert($question_option); |
|
7 | - assert($question_option instanceof EE_Question); |
|
6 | + assert($question_option); |
|
7 | + assert($question_option instanceof EE_Question); |
|
8 | 8 | } |
9 | 9 | ?> |
10 | 10 | <h4><?php esc_html_e('Check off all questions that you wish to appear in this group.', 'event_espresso'); ?></h4> |
11 | 11 | <ul> |
12 | 12 | <?php |
13 | - foreach ($all_questions as $question_ID => $question) { |
|
14 | - /*@var $question EE_Question*/ |
|
15 | - $checked = array_key_exists($question_ID, $question_group->questions()) ? ' checked="checked"' : ''; |
|
16 | - ?> |
|
13 | + foreach ($all_questions as $question_ID => $question) { |
|
14 | + /*@var $question EE_Question*/ |
|
15 | + $checked = array_key_exists($question_ID, $question_group->questions()) ? ' checked="checked"' : ''; |
|
16 | + ?> |
|
17 | 17 | <li> |
18 | 18 | <label for="question-<?php echo $question_ID ?>"> |
19 | 19 | <input type="checkbox" name="questions[<?php echo $question_ID; ?>]" |