@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @return EED_Events_Archive |
39 | 39 | */ |
40 | 40 | public static function instance() { |
41 | - return parent::get_instance( __CLASS__ ); |
|
41 | + return parent::get_instance(__CLASS__); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | * @return void |
51 | 51 | */ |
52 | 52 | public static function set_hooks() { |
53 | - EE_Config::register_route( EE_Registry::instance()->CFG->core->event_cpt_slug, 'Events_Archive', 'run' ); |
|
54 | - EE_Config::register_route( 'event_list', 'Events_Archive', 'event_list' ); |
|
55 | - add_action( 'wp_loaded', array( 'EED_Events_Archive', 'set_definitions' ), 2 ); |
|
53 | + EE_Config::register_route(EE_Registry::instance()->CFG->core->event_cpt_slug, 'Events_Archive', 'run'); |
|
54 | + EE_Config::register_route('event_list', 'Events_Archive', 'event_list'); |
|
55 | + add_action('wp_loaded', array('EED_Events_Archive', 'set_definitions'), 2); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * @return void |
63 | 63 | */ |
64 | 64 | public static function set_hooks_admin() { |
65 | - add_action( 'wp_loaded', array( 'EED_Events_Archive', 'set_definitions' ), 2 ); |
|
65 | + add_action('wp_loaded', array('EED_Events_Archive', 'set_definitions'), 2); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | * @return void |
76 | 76 | */ |
77 | 77 | public static function set_definitions() { |
78 | - define( 'EVENTS_ARCHIVE_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
79 | - define( 'EVENTS_ARCHIVE_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS ); |
|
78 | + define('EVENTS_ARCHIVE_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
79 | + define('EVENTS_ARCHIVE_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @return \EE_Events_Archive_Config |
88 | 88 | */ |
89 | - protected function set_config(){ |
|
90 | - $this->set_config_section( 'template_settings' ); |
|
91 | - $this->set_config_class( 'EE_Events_Archive_Config' ); |
|
92 | - $this->set_config_name( 'EED_Events_Archive' ); |
|
89 | + protected function set_config() { |
|
90 | + $this->set_config_section('template_settings'); |
|
91 | + $this->set_config_class('EE_Events_Archive_Config'); |
|
92 | + $this->set_config_name('EED_Events_Archive'); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | |
@@ -101,35 +101,35 @@ discard block |
||
101 | 101 | * @param \EE_Events_Archive_Config $config |
102 | 102 | * @return \EE_Template_Part_Manager |
103 | 103 | */ |
104 | - public function initialize_template_parts( EE_Events_Archive_Config $config = null ) { |
|
104 | + public function initialize_template_parts(EE_Events_Archive_Config $config = null) { |
|
105 | 105 | $config = $config instanceof EE_Events_Archive_Config ? $config : $this->config(); |
106 | 106 | EEH_Autoloader::instance()->register_template_part_autoloaders(); |
107 | 107 | $template_parts = new EE_Template_Part_Manager(); |
108 | 108 | $template_parts->add_template_part( |
109 | 109 | 'tickets', |
110 | - __( 'Ticket Selector', 'event_espresso' ), |
|
110 | + __('Ticket Selector', 'event_espresso'), |
|
111 | 111 | 'content-espresso_events-tickets.php', |
112 | 112 | $config->display_order_tickets |
113 | 113 | ); |
114 | 114 | $template_parts->add_template_part( |
115 | 115 | 'datetimes', |
116 | - __( 'Dates and Times', 'event_espresso' ), |
|
116 | + __('Dates and Times', 'event_espresso'), |
|
117 | 117 | 'content-espresso_events-datetimes.php', |
118 | 118 | $config->display_order_datetimes |
119 | 119 | ); |
120 | 120 | $template_parts->add_template_part( |
121 | 121 | 'event', |
122 | - __( 'Event Description', 'event_espresso' ), |
|
122 | + __('Event Description', 'event_espresso'), |
|
123 | 123 | 'content-espresso_events-details.php', |
124 | 124 | $config->display_order_event |
125 | 125 | ); |
126 | 126 | $template_parts->add_template_part( |
127 | 127 | 'venue', |
128 | - __( 'Venue Information', 'event_espresso' ), |
|
128 | + __('Venue Information', 'event_espresso'), |
|
129 | 129 | 'content-espresso_events-venues.php', |
130 | 130 | $config->display_order_venue |
131 | 131 | ); |
132 | - do_action( 'AHEE__EED_Event_Archive__initialize_template_parts', $template_parts ); |
|
132 | + do_action('AHEE__EED_Event_Archive__initialize_template_parts', $template_parts); |
|
133 | 133 | return $template_parts; |
134 | 134 | } |
135 | 135 | |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | * @param WP $WP |
143 | 143 | * @return void |
144 | 144 | */ |
145 | - public function run( $WP ) { |
|
146 | - do_action( 'AHEE__EED_Events_Archive__before_run' ); |
|
145 | + public function run($WP) { |
|
146 | + do_action('AHEE__EED_Events_Archive__before_run'); |
|
147 | 147 | // ensure valid EE_Events_Archive_Config() object exists |
148 | 148 | $this->set_config(); |
149 | 149 | /** @type EE_Events_Archive_Config $config */ |
@@ -151,19 +151,19 @@ discard block |
||
151 | 151 | // load other required components |
152 | 152 | $this->load_event_list_assets(); |
153 | 153 | // filter the WP posts_join, posts_where, and posts_orderby SQL clauses |
154 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
154 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
155 | 155 | //add query filters |
156 | 156 | EEH_Event_Query::add_query_filters(); |
157 | 157 | // set params that will get used by the filters |
158 | 158 | EEH_Event_Query::set_query_params( |
159 | - '', // month |
|
160 | - '', // category |
|
161 | - $config->display_expired_events, // show_expired |
|
162 | - 'start_date', // orderby |
|
159 | + '', // month |
|
160 | + '', // category |
|
161 | + $config->display_expired_events, // show_expired |
|
162 | + 'start_date', // orderby |
|
163 | 163 | 'ASC' // sort |
164 | 164 | ); |
165 | 165 | // check what template is loaded |
166 | - add_filter( 'template_include', array( $this, 'template_include' ), 999, 1 ); |
|
166 | + add_filter('template_include', array($this, 'template_include'), 999, 1); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | |
@@ -195,30 +195,30 @@ discard block |
||
195 | 195 | * @param string $template |
196 | 196 | * @return string |
197 | 197 | */ |
198 | - public function template_include( $template = '' ) { |
|
198 | + public function template_include($template = '') { |
|
199 | 199 | // don't add content filter for dedicated EE child themes or private posts |
200 | - EE_Registry::instance()->load_helper( 'Template' ); |
|
201 | - if ( ! EEH_Template::is_espresso_theme() ) { |
|
200 | + EE_Registry::instance()->load_helper('Template'); |
|
201 | + if ( ! EEH_Template::is_espresso_theme()) { |
|
202 | 202 | /** @type EE_Events_Archive_Config $config */ |
203 | 203 | $config = $this->config(); |
204 | 204 | // add status banner ? |
205 | - if ( $config->display_status_banner ) { |
|
206 | - add_filter( 'the_title', array( 'EED_Events_Archive', 'the_title' ), 100, 2 ); |
|
205 | + if ($config->display_status_banner) { |
|
206 | + add_filter('the_title', array('EED_Events_Archive', 'the_title'), 100, 2); |
|
207 | 207 | } |
208 | 208 | // if NOT a custom template |
209 | - if ( EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_events.php' ) { |
|
209 | + if (EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_events.php') { |
|
210 | 210 | // don't display entry meta because the existing theme will take care of that |
211 | - add_filter( 'FHEE__EED_Events_Archive__template_include__events_list_active', '__return_true' ); |
|
211 | + add_filter('FHEE__EED_Events_Archive__template_include__events_list_active', '__return_true'); |
|
212 | 212 | // load functions.php file for the theme (loaded by WP if using child theme) |
213 | 213 | EEH_Template::load_espresso_theme_functions(); |
214 | 214 | // because we don't know if the theme is using the_excerpt() |
215 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
215 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
216 | 216 | // or the_content |
217 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
217 | + add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
218 | 218 | // and just in case they are running get_the_excerpt() which DESTROYS things |
219 | - add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 ); |
|
219 | + add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); |
|
220 | 220 | // don't display entry meta because the existing theme will take care of that |
221 | - add_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' ); |
|
221 | + add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false'); |
|
222 | 222 | } |
223 | 223 | } |
224 | 224 | return $template; |
@@ -233,14 +233,14 @@ discard block |
||
233 | 233 | * @param string $excerpt |
234 | 234 | * @return string |
235 | 235 | */ |
236 | - public static function get_the_excerpt( $excerpt = '' ) { |
|
237 | - if ( post_password_required() ) { |
|
236 | + public static function get_the_excerpt($excerpt = '') { |
|
237 | + if (post_password_required()) { |
|
238 | 238 | return $excerpt; |
239 | 239 | } |
240 | - if ( apply_filters( 'FHEE__EED_Events_Archive__get_the_excerpt__theme_uses_get_the_excerpt', false ) ) { |
|
241 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
242 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
243 | - $excerpt = EED_Events_Archive::event_details( $excerpt ); |
|
240 | + if (apply_filters('FHEE__EED_Events_Archive__get_the_excerpt__theme_uses_get_the_excerpt', false)) { |
|
241 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
242 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
243 | + $excerpt = EED_Events_Archive::event_details($excerpt); |
|
244 | 244 | } |
245 | 245 | return $excerpt; |
246 | 246 | } |
@@ -255,10 +255,10 @@ discard block |
||
255 | 255 | * @param string $id |
256 | 256 | * @return string |
257 | 257 | */ |
258 | - public static function the_title( $title = '', $id = '' ) { |
|
258 | + public static function the_title($title = '', $id = '') { |
|
259 | 259 | global $post; |
260 | - if ( $post instanceof WP_Post ) { |
|
261 | - return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID ) . $title : $title; |
|
260 | + if ($post instanceof WP_Post) { |
|
261 | + return in_the_loop() && $post->ID == $id ? espresso_event_status_banner($post->ID).$title : $title; |
|
262 | 262 | } |
263 | 263 | return $title; |
264 | 264 | } |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | * @param string $content |
273 | 273 | * @return string |
274 | 274 | */ |
275 | - public static function event_details( $content ) { |
|
275 | + public static function event_details($content) { |
|
276 | 276 | global $post; |
277 | 277 | static $current_post_ID = 0; |
278 | 278 | if ( |
@@ -280,8 +280,8 @@ discard block |
||
280 | 280 | $post->post_type == 'espresso_events' && |
281 | 281 | ! post_password_required() && |
282 | 282 | ( |
283 | - apply_filters( 'FHEE__EES_Espresso_Events__process_shortcode__true', false ) |
|
284 | - || ! apply_filters( 'FHEE__content_espresso_events__template_loaded', false ) |
|
283 | + apply_filters('FHEE__EES_Espresso_Events__process_shortcode__true', false) |
|
284 | + || ! apply_filters('FHEE__content_espresso_events__template_loaded', false) |
|
285 | 285 | ) |
286 | 286 | ) { |
287 | 287 | // Set current post ID to prevent showing content twice, but only if headers have definitely been sent. |
@@ -290,8 +290,8 @@ discard block |
||
290 | 290 | // We want to allow those plugins to still do their thing and have access to our content, but depending on |
291 | 291 | // how your event content is being displayed (shortcode, CPT route, etc), this filter can get applied twice, |
292 | 292 | // so the following allows this filter to be applied multiple times, but only once for real |
293 | - $current_post_ID = did_action( 'loop_start' ) ? $post->ID : 0; |
|
294 | - if ( EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->use_sortable_display_order ) { |
|
293 | + $current_post_ID = did_action('loop_start') ? $post->ID : 0; |
|
294 | + if (EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->use_sortable_display_order) { |
|
295 | 295 | $content = \EED_Events_Archive::use_sortable_display_order(); |
296 | 296 | } else { |
297 | 297 | $content = \EED_Events_Archive::use_filterable_display_order(); |
@@ -310,20 +310,20 @@ discard block |
||
310 | 310 | */ |
311 | 311 | protected static function use_sortable_display_order() { |
312 | 312 | // no further password checks required atm |
313 | - add_filter( 'FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true' ); |
|
313 | + add_filter('FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true'); |
|
314 | 314 | // we need to first remove this callback from being applied to the_content() or the_excerpt() (otherwise it will recurse and blow up the interweb) |
315 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
316 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
317 | - remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 ); |
|
315 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
316 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
317 | + remove_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1); |
|
318 | 318 | // now add additional content depending on whether event is using the_excerpt() or the_content() |
319 | 319 | EED_Events_Archive::instance()->template_parts = EED_Events_Archive::instance()->initialize_template_parts(); |
320 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
321 | - $content = EED_Events_Archive::instance()->template_parts->apply_template_part_filters( $content ); |
|
320 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
321 | + $content = EED_Events_Archive::instance()->template_parts->apply_template_part_filters($content); |
|
322 | 322 | // re-add our main filters (or else the next event won't have them) |
323 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
324 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
325 | - add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 ); |
|
326 | - remove_filter( 'FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true' ); |
|
323 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
324 | + add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
325 | + add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); |
|
326 | + remove_filter('FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true'); |
|
327 | 327 | return $content; |
328 | 328 | } |
329 | 329 | |
@@ -338,22 +338,22 @@ discard block |
||
338 | 338 | protected static function use_filterable_display_order() { |
339 | 339 | // we need to first remove this callback from being applied to the_content() |
340 | 340 | // (otherwise it will recurse and blow up the interweb) |
341 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
342 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
343 | - remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 ); |
|
341 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
342 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
343 | + remove_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1); |
|
344 | 344 | //now add additional content depending on whether event is using the_excerpt() or the_content() |
345 | 345 | EED_Events_Archive::_add_additional_excerpt_filters(); |
346 | 346 | EED_Events_Archive::_add_additional_content_filters(); |
347 | - do_action( 'AHEE__EED_Events_Archive__use_filterable_display_order__after_add_filters' ); |
|
347 | + do_action('AHEE__EED_Events_Archive__use_filterable_display_order__after_add_filters'); |
|
348 | 348 | // now load our template |
349 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
349 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
350 | 350 | // re-add our main filters (or else the next event won't have them) |
351 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
352 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
353 | - add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 ); |
|
351 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
352 | + add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
353 | + add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); |
|
354 | 354 | // but remove the other filters so that they don't get applied to the next post |
355 | 355 | EED_Events_Archive::_remove_additional_events_archive_filters(); |
356 | - do_action( 'AHEE__EED_Events_Archive__use_filterable_display_order__after_remove_filters' ); |
|
356 | + do_action('AHEE__EED_Events_Archive__use_filterable_display_order__after_remove_filters'); |
|
357 | 357 | // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
358 | 358 | //return ! empty( $template ) ? $template : $content; |
359 | 359 | return $content; |
@@ -368,11 +368,11 @@ discard block |
||
368 | 368 | * @param string $content |
369 | 369 | * @return string |
370 | 370 | */ |
371 | - public static function event_datetimes( $content ) { |
|
372 | - if ( post_password_required() ) { |
|
371 | + public static function event_datetimes($content) { |
|
372 | + if (post_password_required()) { |
|
373 | 373 | return $content; |
374 | 374 | } |
375 | - return EEH_Template::locate_template( 'content-espresso_events-datetimes.php' ) . $content; |
|
375 | + return EEH_Template::locate_template('content-espresso_events-datetimes.php').$content; |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | /** |
@@ -382,11 +382,11 @@ discard block |
||
382 | 382 | * @param string $content |
383 | 383 | * @return string |
384 | 384 | */ |
385 | - public static function event_tickets( $content ) { |
|
386 | - if ( post_password_required() ) { |
|
385 | + public static function event_tickets($content) { |
|
386 | + if (post_password_required()) { |
|
387 | 387 | return $content; |
388 | 388 | } |
389 | - return EEH_Template::locate_template( 'content-espresso_events-tickets.php' ) . $content; |
|
389 | + return EEH_Template::locate_template('content-espresso_events-tickets.php').$content; |
|
390 | 390 | } |
391 | 391 | |
392 | 392 | |
@@ -398,8 +398,8 @@ discard block |
||
398 | 398 | * @param string $content |
399 | 399 | * @return string |
400 | 400 | */ |
401 | - public static function event_venue( $content ) { |
|
402 | - return EED_Events_Archive::event_venues( $content ); |
|
401 | + public static function event_venue($content) { |
|
402 | + return EED_Events_Archive::event_venues($content); |
|
403 | 403 | } |
404 | 404 | |
405 | 405 | /** |
@@ -409,11 +409,11 @@ discard block |
||
409 | 409 | * @param string $content |
410 | 410 | * @return string |
411 | 411 | */ |
412 | - public static function event_venues( $content ) { |
|
413 | - if ( post_password_required() ) { |
|
412 | + public static function event_venues($content) { |
|
413 | + if (post_password_required()) { |
|
414 | 414 | return $content; |
415 | 415 | } |
416 | - return $content . EEH_Template::locate_template( 'content-espresso_events-venues.php' ); |
|
416 | + return $content.EEH_Template::locate_template('content-espresso_events-venues.php'); |
|
417 | 417 | } |
418 | 418 | |
419 | 419 | |
@@ -425,9 +425,9 @@ discard block |
||
425 | 425 | * @return void |
426 | 426 | */ |
427 | 427 | private static function _add_additional_excerpt_filters() { |
428 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110, 1 ); |
|
429 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120, 1 ); |
|
430 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130, 1 ); |
|
428 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110, 1); |
|
429 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120, 1); |
|
430 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130, 1); |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | |
@@ -439,9 +439,9 @@ discard block |
||
439 | 439 | * @return void |
440 | 440 | */ |
441 | 441 | private static function _add_additional_content_filters() { |
442 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110, 1 ); |
|
443 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120, 1 ); |
|
444 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130, 1 ); |
|
442 | + add_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110, 1); |
|
443 | + add_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120, 1); |
|
444 | + add_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130, 1); |
|
445 | 445 | } |
446 | 446 | |
447 | 447 | |
@@ -453,12 +453,12 @@ discard block |
||
453 | 453 | * @return void |
454 | 454 | */ |
455 | 455 | private static function _remove_additional_events_archive_filters() { |
456 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
457 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
458 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
459 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
460 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
461 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
456 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
457 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120); |
|
458 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130); |
|
459 | + remove_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
460 | + remove_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120); |
|
461 | + remove_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130); |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | |
@@ -471,17 +471,17 @@ discard block |
||
471 | 471 | */ |
472 | 472 | public static function remove_all_events_archive_filters() { |
473 | 473 | //remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 ); |
474 | - remove_filter( 'the_title', array( 'EED_Events_Archive', 'the_title' ), 100 ); |
|
475 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
476 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
477 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
478 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
479 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
480 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
481 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
482 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
474 | + remove_filter('the_title', array('EED_Events_Archive', 'the_title'), 100); |
|
475 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
476 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
477 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120); |
|
478 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130); |
|
479 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
480 | + remove_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
481 | + remove_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120); |
|
482 | + remove_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130); |
|
483 | 483 | // don't display entry meta because the existing theme will take care of that |
484 | - remove_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' ); |
|
484 | + remove_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false'); |
|
485 | 485 | } |
486 | 486 | |
487 | 487 | |
@@ -496,15 +496,15 @@ discard block |
||
496 | 496 | * @return void |
497 | 497 | */ |
498 | 498 | public function load_event_list_assets() { |
499 | - do_action( 'AHEE__EED_Events_Archive__before_load_assets' ); |
|
500 | - add_filter( 'FHEE_load_EE_Session', '__return_true' ); |
|
501 | - add_filter( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' ); |
|
502 | - add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 ); |
|
503 | - if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) { |
|
504 | - EE_Registry::instance()->load_helper( 'Maps' ); |
|
505 | - add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 ); |
|
499 | + do_action('AHEE__EED_Events_Archive__before_load_assets'); |
|
500 | + add_filter('FHEE_load_EE_Session', '__return_true'); |
|
501 | + add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true'); |
|
502 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
503 | + if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
504 | + EE_Registry::instance()->load_helper('Maps'); |
|
505 | + add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
506 | 506 | } |
507 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
507 | + EE_Registry::instance()->load_helper('Event_View'); |
|
508 | 508 | } |
509 | 509 | |
510 | 510 | |
@@ -520,14 +520,14 @@ discard block |
||
520 | 520 | */ |
521 | 521 | public function wp_enqueue_scripts() { |
522 | 522 | // get some style |
523 | - if ( apply_filters( 'FHEE_enable_default_espresso_css', FALSE ) ) { |
|
523 | + if (apply_filters('FHEE_enable_default_espresso_css', FALSE)) { |
|
524 | 524 | // first check uploads folder |
525 | - EE_Registry::instance()->load_helper( 'File' ); |
|
526 | - if ( EEH_File::is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) { |
|
527 | - wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' )); |
|
525 | + EE_Registry::instance()->load_helper('File'); |
|
526 | + if (EEH_File::is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) { |
|
527 | + wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
528 | 528 | } else { |
529 | 529 | } |
530 | - wp_enqueue_style( $this->theme ); |
|
530 | + wp_enqueue_style($this->theme); |
|
531 | 531 | |
532 | 532 | } |
533 | 533 | } |
@@ -545,8 +545,8 @@ discard block |
||
545 | 545 | */ |
546 | 546 | public static function template_settings_form() { |
547 | 547 | $template_settings = EE_Registry::instance()->CFG->template_settings; |
548 | - $template_settings->EED_Events_Archive = isset( $template_settings->EED_Events_Archive ) ? $template_settings->EED_Events_Archive : new EE_Events_Archive_Config(); |
|
549 | - $template_settings->EED_Events_Archive = apply_filters( 'FHEE__EED_Events_Archive__template_settings_form__event_list_config', $template_settings->EED_Events_Archive ); |
|
548 | + $template_settings->EED_Events_Archive = isset($template_settings->EED_Events_Archive) ? $template_settings->EED_Events_Archive : new EE_Events_Archive_Config(); |
|
549 | + $template_settings->EED_Events_Archive = apply_filters('FHEE__EED_Events_Archive__template_settings_form__event_list_config', $template_settings->EED_Events_Archive); |
|
550 | 550 | $events_archive_settings = array( |
551 | 551 | 'display_status_banner' => 0, |
552 | 552 | 'display_description' => 1, |
@@ -555,8 +555,8 @@ discard block |
||
555 | 555 | 'display_venue' => 0, |
556 | 556 | 'display_expired_events' => 0 |
557 | 557 | ); |
558 | - $events_archive_settings = array_merge( $events_archive_settings, (array)$template_settings->EED_Events_Archive ); |
|
559 | - EEH_Template::display_template( EVENTS_ARCHIVE_TEMPLATES_PATH . 'admin-event-list-settings.template.php', $events_archive_settings ); |
|
558 | + $events_archive_settings = array_merge($events_archive_settings, (array) $template_settings->EED_Events_Archive); |
|
559 | + EEH_Template::display_template(EVENTS_ARCHIVE_TEMPLATES_PATH.'admin-event-list-settings.template.php', $events_archive_settings); |
|
560 | 560 | } |
561 | 561 | |
562 | 562 | |
@@ -572,16 +572,16 @@ discard block |
||
572 | 572 | * @param EE_Request_Handler $REQ |
573 | 573 | * @return EE_Template_Config |
574 | 574 | */ |
575 | - public static function update_template_settings( $CFG, $REQ ) { |
|
575 | + public static function update_template_settings($CFG, $REQ) { |
|
576 | 576 | $CFG->EED_Events_Archive = new EE_Events_Archive_Config(); |
577 | 577 | // unless we are resetting the config... |
578 | - if ( ! isset( $REQ['EED_Events_Archive_reset_event_list_settings'] ) || absint( $REQ['EED_Events_Archive_reset_event_list_settings'] ) !== 1 ) { |
|
579 | - $CFG->EED_Events_Archive->display_status_banner = isset( $REQ['EED_Events_Archive_display_status_banner'] ) ? absint( $REQ['EED_Events_Archive_display_status_banner'] ) : 0; |
|
580 | - $CFG->EED_Events_Archive->display_description = isset( $REQ['EED_Events_Archive_display_description'] ) ? absint( $REQ['EED_Events_Archive_display_description'] ) : 1; |
|
581 | - $CFG->EED_Events_Archive->display_ticket_selector = isset( $REQ['EED_Events_Archive_display_ticket_selector'] ) ? absint( $REQ['EED_Events_Archive_display_ticket_selector'] ) : 0; |
|
582 | - $CFG->EED_Events_Archive->display_datetimes = isset( $REQ['EED_Events_Archive_display_datetimes'] ) ? absint( $REQ['EED_Events_Archive_display_datetimes'] ) : 1; |
|
583 | - $CFG->EED_Events_Archive->display_venue = isset( $REQ['EED_Events_Archive_display_venue'] ) ? absint( $REQ['EED_Events_Archive_display_venue'] ) : 0; |
|
584 | - $CFG->EED_Events_Archive->display_expired_events = isset( $REQ['EED_Events_Archive_display_expired_events'] ) ? absint( $REQ['EED_Events_Archive_display_expired_events'] ) : 0; } |
|
578 | + if ( ! isset($REQ['EED_Events_Archive_reset_event_list_settings']) || absint($REQ['EED_Events_Archive_reset_event_list_settings']) !== 1) { |
|
579 | + $CFG->EED_Events_Archive->display_status_banner = isset($REQ['EED_Events_Archive_display_status_banner']) ? absint($REQ['EED_Events_Archive_display_status_banner']) : 0; |
|
580 | + $CFG->EED_Events_Archive->display_description = isset($REQ['EED_Events_Archive_display_description']) ? absint($REQ['EED_Events_Archive_display_description']) : 1; |
|
581 | + $CFG->EED_Events_Archive->display_ticket_selector = isset($REQ['EED_Events_Archive_display_ticket_selector']) ? absint($REQ['EED_Events_Archive_display_ticket_selector']) : 0; |
|
582 | + $CFG->EED_Events_Archive->display_datetimes = isset($REQ['EED_Events_Archive_display_datetimes']) ? absint($REQ['EED_Events_Archive_display_datetimes']) : 1; |
|
583 | + $CFG->EED_Events_Archive->display_venue = isset($REQ['EED_Events_Archive_display_venue']) ? absint($REQ['EED_Events_Archive_display_venue']) : 0; |
|
584 | + $CFG->EED_Events_Archive->display_expired_events = isset($REQ['EED_Events_Archive_display_expired_events']) ? absint($REQ['EED_Events_Archive_display_expired_events']) : 0; } |
|
585 | 585 | return $CFG; |
586 | 586 | } |
587 | 587 | |
@@ -594,10 +594,10 @@ discard block |
||
594 | 594 | * @param string $extra_class |
595 | 595 | * @return string |
596 | 596 | */ |
597 | - public static function event_list_css( $extra_class = '' ) { |
|
598 | - $event_list_css = ! empty( $extra_class ) ? array( $extra_class ) : array(); |
|
597 | + public static function event_list_css($extra_class = '') { |
|
598 | + $event_list_css = ! empty($extra_class) ? array($extra_class) : array(); |
|
599 | 599 | $event_list_css[] = 'espresso-event-list-event'; |
600 | - return implode( ' ', $event_list_css ); |
|
600 | + return implode(' ', $event_list_css); |
|
601 | 601 | } |
602 | 602 | |
603 | 603 | |
@@ -624,9 +624,9 @@ discard block |
||
624 | 624 | * @param $value |
625 | 625 | * @return bool |
626 | 626 | */ |
627 | - public static function display_description( $value ) { |
|
627 | + public static function display_description($value) { |
|
628 | 628 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
629 | - $display_description= isset( $config->display_description ) ? $config->display_description : 1; |
|
629 | + $display_description = isset($config->display_description) ? $config->display_description : 1; |
|
630 | 630 | return $display_description === $value ? TRUE : FALSE; |
631 | 631 | } |
632 | 632 | |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | */ |
640 | 640 | public static function display_ticket_selector() { |
641 | 641 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
642 | - return isset( $config->display_ticket_selector ) && $config->display_ticket_selector ? TRUE : FALSE; |
|
642 | + return isset($config->display_ticket_selector) && $config->display_ticket_selector ? TRUE : FALSE; |
|
643 | 643 | } |
644 | 644 | |
645 | 645 | |
@@ -651,9 +651,9 @@ discard block |
||
651 | 651 | * @return bool |
652 | 652 | */ |
653 | 653 | public static function display_venue() { |
654 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
654 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
655 | 655 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
656 | - return isset( $config->display_venue ) && $config->display_venue && EEH_Venue_View::venue_name() ? TRUE : FALSE; |
|
656 | + return isset($config->display_venue) && $config->display_venue && EEH_Venue_View::venue_name() ? TRUE : FALSE; |
|
657 | 657 | } |
658 | 658 | |
659 | 659 | |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | */ |
666 | 666 | public static function display_datetimes() { |
667 | 667 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
668 | - return isset( $config->display_datetimes ) && $config->display_datetimes ? TRUE : FALSE; |
|
668 | + return isset($config->display_datetimes) && $config->display_datetimes ? TRUE : FALSE; |
|
669 | 669 | } |
670 | 670 | |
671 | 671 | |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | * @return string |
681 | 681 | */ |
682 | 682 | public static function event_list_title() { |
683 | - return apply_filters( 'FHEE__archive_espresso_events_template__upcoming_events_h1', __( 'Upcoming Events', 'event_espresso' )); |
|
683 | + return apply_filters('FHEE__archive_espresso_events_template__upcoming_events_h1', __('Upcoming Events', 'event_espresso')); |
|
684 | 684 | } |
685 | 685 | |
686 | 686 | |
@@ -689,11 +689,11 @@ discard block |
||
689 | 689 | /** |
690 | 690 | * @since 4.4.0 |
691 | 691 | */ |
692 | - public static function _doing_it_wrong_notice( $function = '' ) { |
|
692 | + public static function _doing_it_wrong_notice($function = '') { |
|
693 | 693 | EE_Error::doing_it_wrong( |
694 | 694 | __FUNCTION__, |
695 | 695 | sprintf( |
696 | - __( 'EED_Events_Archive::%1$s was moved to EEH_Event_Query::%1$s:%2$sPlease update your existing code because the method it calls will be removed in version %3$s', 'event_espresso' ), |
|
696 | + __('EED_Events_Archive::%1$s was moved to EEH_Event_Query::%1$s:%2$sPlease update your existing code because the method it calls will be removed in version %3$s', 'event_espresso'), |
|
697 | 697 | $function, |
698 | 698 | '<br />', |
699 | 699 | '4.6.0' |
@@ -709,107 +709,107 @@ discard block |
||
709 | 709 | * @since 4.4.0 |
710 | 710 | */ |
711 | 711 | public function get_post_data() { |
712 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
712 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
713 | 713 | EEH_Event_Query::set_query_params(); |
714 | 714 | } |
715 | 715 | /** |
716 | 716 | * @deprecated |
717 | 717 | * @since 4.4.0 |
718 | 718 | */ |
719 | - public function posts_fields( $SQL, WP_Query $wp_query ) { |
|
720 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
721 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
722 | - return EEH_Event_Query::posts_fields( $SQL, $wp_query ); |
|
719 | + public function posts_fields($SQL, WP_Query $wp_query) { |
|
720 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
721 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
722 | + return EEH_Event_Query::posts_fields($SQL, $wp_query); |
|
723 | 723 | } |
724 | 724 | /** |
725 | 725 | * @deprecated |
726 | 726 | * @since 4.4.0 |
727 | 727 | */ |
728 | - public static function posts_fields_sql_for_orderby( $orderby_params = array() ) { |
|
729 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
730 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
731 | - return EEH_Event_Query::posts_fields_sql_for_orderby( $orderby_params ); |
|
728 | + public static function posts_fields_sql_for_orderby($orderby_params = array()) { |
|
729 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
730 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
731 | + return EEH_Event_Query::posts_fields_sql_for_orderby($orderby_params); |
|
732 | 732 | } |
733 | 733 | /** |
734 | 734 | * @deprecated |
735 | 735 | * @since 4.4.0 |
736 | 736 | */ |
737 | - public function posts_join( $SQL, WP_Query $wp_query ) { |
|
738 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
739 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
740 | - return EEH_Event_Query::posts_join( $SQL, $wp_query ); |
|
737 | + public function posts_join($SQL, WP_Query $wp_query) { |
|
738 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
739 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
740 | + return EEH_Event_Query::posts_join($SQL, $wp_query); |
|
741 | 741 | } |
742 | 742 | /** |
743 | 743 | * @deprecated |
744 | 744 | * @since 4.4.0 |
745 | 745 | */ |
746 | - public static function posts_join_sql_for_terms( $join_terms = NULL ) { |
|
747 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
748 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
749 | - return EEH_Event_Query::posts_join_sql_for_terms( $join_terms ); |
|
746 | + public static function posts_join_sql_for_terms($join_terms = NULL) { |
|
747 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
748 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
749 | + return EEH_Event_Query::posts_join_sql_for_terms($join_terms); |
|
750 | 750 | } |
751 | 751 | /** |
752 | 752 | * @deprecated |
753 | 753 | * @since 4.4.0 |
754 | 754 | */ |
755 | - public static function posts_join_for_orderby( $orderby_params = array() ) { |
|
756 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
757 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
758 | - return EEH_Event_Query::posts_join_for_orderby( $orderby_params ); |
|
755 | + public static function posts_join_for_orderby($orderby_params = array()) { |
|
756 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
757 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
758 | + return EEH_Event_Query::posts_join_for_orderby($orderby_params); |
|
759 | 759 | } |
760 | 760 | /** |
761 | 761 | * @deprecated |
762 | 762 | * @since 4.4.0 |
763 | 763 | */ |
764 | - public function posts_where( $SQL, WP_Query $wp_query ) { |
|
765 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
766 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
767 | - return EEH_Event_Query::posts_where( $SQL, $wp_query ); |
|
764 | + public function posts_where($SQL, WP_Query $wp_query) { |
|
765 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
766 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
767 | + return EEH_Event_Query::posts_where($SQL, $wp_query); |
|
768 | 768 | } |
769 | 769 | /** |
770 | 770 | * @deprecated |
771 | 771 | * @since 4.4.0 |
772 | 772 | */ |
773 | - public static function posts_where_sql_for_show_expired( $show_expired = FALSE ) { |
|
774 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
775 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
776 | - return EEH_Event_Query::posts_where_sql_for_show_expired( $show_expired ); |
|
773 | + public static function posts_where_sql_for_show_expired($show_expired = FALSE) { |
|
774 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
775 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
776 | + return EEH_Event_Query::posts_where_sql_for_show_expired($show_expired); |
|
777 | 777 | } |
778 | 778 | /** |
779 | 779 | * @deprecated |
780 | 780 | * @since 4.4.0 |
781 | 781 | */ |
782 | - public static function posts_where_sql_for_event_category_slug( $event_category_slug = NULL ) { |
|
783 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
784 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
785 | - return EEH_Event_Query::posts_where_sql_for_event_category_slug( $event_category_slug ); |
|
782 | + public static function posts_where_sql_for_event_category_slug($event_category_slug = NULL) { |
|
783 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
784 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
785 | + return EEH_Event_Query::posts_where_sql_for_event_category_slug($event_category_slug); |
|
786 | 786 | } |
787 | 787 | /** |
788 | 788 | * @deprecated |
789 | 789 | * @since 4.4.0 |
790 | 790 | */ |
791 | - public static function posts_where_sql_for_event_list_month( $month = NULL ) { |
|
792 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
793 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
794 | - return EEH_Event_Query::posts_where_sql_for_event_list_month( $month ); |
|
791 | + public static function posts_where_sql_for_event_list_month($month = NULL) { |
|
792 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
793 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
794 | + return EEH_Event_Query::posts_where_sql_for_event_list_month($month); |
|
795 | 795 | } |
796 | 796 | /** |
797 | 797 | * @deprecated |
798 | 798 | * @since 4.4.0 |
799 | 799 | */ |
800 | - public function posts_orderby( $SQL, WP_Query $wp_query ) { |
|
801 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
802 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
803 | - return EEH_Event_Query::posts_orderby( $SQL, $wp_query ); |
|
800 | + public function posts_orderby($SQL, WP_Query $wp_query) { |
|
801 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
802 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
803 | + return EEH_Event_Query::posts_orderby($SQL, $wp_query); |
|
804 | 804 | } |
805 | 805 | /** |
806 | 806 | * @deprecated |
807 | 807 | * @since 4.4.0 |
808 | 808 | */ |
809 | - public static function posts_orderby_sql( $orderby_params = array(), $sort = 'ASC' ) { |
|
810 | - EE_Registry::instance()->load_helper( 'Event_Query' ); |
|
811 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
812 | - return EEH_Event_Query::posts_orderby_sql( $orderby_params, $sort ); |
|
809 | + public static function posts_orderby_sql($orderby_params = array(), $sort = 'ASC') { |
|
810 | + EE_Registry::instance()->load_helper('Event_Query'); |
|
811 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
812 | + return EEH_Event_Query::posts_orderby_sql($orderby_params, $sort); |
|
813 | 813 | } |
814 | 814 | |
815 | 815 | |
@@ -840,8 +840,8 @@ discard block |
||
840 | 840 | * @param string $extra_class |
841 | 841 | * @return string |
842 | 842 | */ |
843 | -function espresso_event_list_css( $extra_class = '' ) { |
|
844 | - return EED_Events_Archive::event_list_css( $extra_class ); |
|
843 | +function espresso_event_list_css($extra_class = '') { |
|
844 | + return EED_Events_Archive::event_list_css($extra_class); |
|
845 | 845 | } |
846 | 846 | |
847 | 847 | /** |
@@ -855,14 +855,14 @@ discard block |
||
855 | 855 | * @return bool |
856 | 856 | */ |
857 | 857 | function espresso_display_full_description_in_event_list() { |
858 | - return EED_Events_Archive::display_description( 2 ); |
|
858 | + return EED_Events_Archive::display_description(2); |
|
859 | 859 | } |
860 | 860 | |
861 | 861 | /** |
862 | 862 | * @return bool |
863 | 863 | */ |
864 | 864 | function espresso_display_excerpt_in_event_list() { |
865 | - return EED_Events_Archive::display_description( 1 ); |
|
865 | + return EED_Events_Archive::display_description(1); |
|
866 | 866 | } |
867 | 867 | |
868 | 868 | /** |
@@ -3,30 +3,30 @@ |
||
3 | 3 | global $post; |
4 | 4 | ?> |
5 | 5 | <div class="event-content"> |
6 | -<?php if ( apply_filters( 'FHEE__content_espresso_events_details_template__display_entry_meta', TRUE )): ?> |
|
6 | +<?php if (apply_filters('FHEE__content_espresso_events_details_template__display_entry_meta', TRUE)): ?> |
|
7 | 7 | <div class="entry-meta"> |
8 | - <span class="tags-links"><?php espresso_event_categories( $post->ID, TRUE, TRUE ); ?></span> |
|
8 | + <span class="tags-links"><?php espresso_event_categories($post->ID, TRUE, TRUE); ?></span> |
|
9 | 9 | <?php |
10 | - if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) : |
|
10 | + if ( ! post_password_required() && (comments_open() || get_comments_number())) : |
|
11 | 11 | ?> |
12 | - <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'event_espresso' ), __( '1 Comment', 'event_espresso' ), __( '% Comments', 'event_espresso' ) ); ?></span> |
|
12 | + <span class="comments-link"><?php comments_popup_link(__('Leave a comment', 'event_espresso'), __('1 Comment', 'event_espresso'), __('% Comments', 'event_espresso')); ?></span> |
|
13 | 13 | <?php |
14 | 14 | endif; |
15 | - edit_post_link( __( 'Edit', 'event_espresso' ), '<span class="edit-link">', '</span>' ); |
|
15 | + edit_post_link(__('Edit', 'event_espresso'), '<span class="edit-link">', '</span>'); |
|
16 | 16 | ?> |
17 | 17 | </div> |
18 | 18 | <?php endif; |
19 | - $event_phone = espresso_event_phone( $post->ID, FALSE ); |
|
20 | - if ( $event_phone != '' ) : ?> |
|
19 | + $event_phone = espresso_event_phone($post->ID, FALSE); |
|
20 | + if ($event_phone != '') : ?> |
|
21 | 21 | <p> |
22 | - <span class="small-text"><strong><?php _e( 'Event Phone:', 'event_espresso' ); ?> </strong></span> <?php echo $event_phone; ?> |
|
22 | + <span class="small-text"><strong><?php _e('Event Phone:', 'event_espresso'); ?> </strong></span> <?php echo $event_phone; ?> |
|
23 | 23 | </p> |
24 | -<?php endif; ?> |
|
24 | +<?php endif; ?> |
|
25 | 25 | <?php |
26 | - if ( apply_filters( 'FHEE__content_espresso_events_details_template__display_the_content', true ) ) { |
|
27 | - do_action( 'AHEE_event_details_before_the_content', $post ); |
|
28 | - apply_filters( 'FHEE__content_espresso_events_details_template__the_content', espresso_event_content_or_excerpt() ); |
|
29 | - do_action( 'AHEE_event_details_after_the_content', $post ); |
|
26 | + if (apply_filters('FHEE__content_espresso_events_details_template__display_the_content', true)) { |
|
27 | + do_action('AHEE_event_details_before_the_content', $post); |
|
28 | + apply_filters('FHEE__content_espresso_events_details_template__the_content', espresso_event_content_or_excerpt()); |
|
29 | + do_action('AHEE_event_details_after_the_content', $post); |
|
30 | 30 | } |
31 | 31 | ?> |
32 | 32 | </div> |
@@ -21,22 +21,22 @@ discard block |
||
21 | 21 | * and/or use any of the template tags functions found in: |
22 | 22 | * \wp-content\plugins\event-espresso-core\public\template_tags.php |
23 | 23 | ************************** IMPORTANT **************************/ |
24 | -add_filter( 'FHEE__content_espresso_events__template_loaded', '__return_false' ); |
|
24 | +add_filter('FHEE__content_espresso_events__template_loaded', '__return_false'); |
|
25 | 25 | |
26 | 26 | //echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>'; |
27 | 27 | |
28 | 28 | global $post; |
29 | -$event_class = has_excerpt( $post->ID ) ? ' has-excerpt' : ''; |
|
30 | -$event_class = apply_filters( 'FHEE__content_espresso_events__event_class', $event_class ); |
|
29 | +$event_class = has_excerpt($post->ID) ? ' has-excerpt' : ''; |
|
30 | +$event_class = apply_filters('FHEE__content_espresso_events__event_class', $event_class); |
|
31 | 31 | ?> |
32 | -<?php do_action( 'AHEE_event_details_before_post', $post ); ?> |
|
33 | -<article id="post-<?php the_ID(); ?>" <?php post_class( $event_class ); ?>> |
|
32 | +<?php do_action('AHEE_event_details_before_post', $post); ?> |
|
33 | +<article id="post-<?php the_ID(); ?>" <?php post_class($event_class); ?>> |
|
34 | 34 | |
35 | -<?php if ( is_single() ) : ?> |
|
35 | +<?php if (is_single()) : ?> |
|
36 | 36 | |
37 | - <div id="espresso-event-header-dv-<?php echo $post->ID;?>" class="espresso-event-header-dv"> |
|
38 | - <?php espresso_get_template_part( 'content', 'espresso_events-thumbnail' ); ?> |
|
39 | - <?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?> |
|
37 | + <div id="espresso-event-header-dv-<?php echo $post->ID; ?>" class="espresso-event-header-dv"> |
|
38 | + <?php espresso_get_template_part('content', 'espresso_events-thumbnail'); ?> |
|
39 | + <?php espresso_get_template_part('content', 'espresso_events-header'); ?> |
|
40 | 40 | </div> |
41 | 41 | |
42 | 42 | <div class="espresso-event-wrapper-dv"> |
@@ -46,16 +46,16 @@ discard block |
||
46 | 46 | <?php //espresso_get_template_part( 'content', 'espresso_events-details' ); ?> |
47 | 47 | <?php //espresso_get_template_part( 'content', 'espresso_events-venues' ); ?> |
48 | 48 | <footer class="event-meta"> |
49 | - <?php do_action( 'AHEE_event_details_footer_top', $post ); ?> |
|
50 | - <?php do_action( 'AHEE_event_details_footer_bottom', $post ); ?> |
|
49 | + <?php do_action('AHEE_event_details_footer_top', $post); ?> |
|
50 | + <?php do_action('AHEE_event_details_footer_bottom', $post); ?> |
|
51 | 51 | </footer> |
52 | 52 | </div> |
53 | 53 | |
54 | -<?php elseif ( is_archive() ) : ?> |
|
54 | +<?php elseif (is_archive()) : ?> |
|
55 | 55 | |
56 | - <div id="espresso-event-list-header-dv-<?php echo $post->ID;?>" class="espresso-event-header-dv"> |
|
57 | - <?php espresso_get_template_part( 'content', 'espresso_events-thumbnail' ); ?> |
|
58 | - <?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?> |
|
56 | + <div id="espresso-event-list-header-dv-<?php echo $post->ID; ?>" class="espresso-event-header-dv"> |
|
57 | + <?php espresso_get_template_part('content', 'espresso_events-thumbnail'); ?> |
|
58 | + <?php espresso_get_template_part('content', 'espresso_events-header'); ?> |
|
59 | 59 | </div> |
60 | 60 | |
61 | 61 | <div class="espresso-event-list-wrapper-dv"> |
@@ -70,5 +70,5 @@ discard block |
||
70 | 70 | |
71 | 71 | </article> |
72 | 72 | <!-- #post --> |
73 | -<?php do_action( 'AHEE_event_details_after_post', $post ); |
|
73 | +<?php do_action('AHEE_event_details_after_post', $post); |
|
74 | 74 |
@@ -1,54 +1,54 @@ |
||
1 | 1 | <?php |
2 | 2 | //echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>'; |
3 | -if (( is_single() && espresso_display_venue_in_event_details() ) || ( is_archive() && espresso_display_venue_in_event_list() ) ) : |
|
3 | +if ((is_single() && espresso_display_venue_in_event_details()) || (is_archive() && espresso_display_venue_in_event_list())) : |
|
4 | 4 | global $post; |
5 | - do_action( 'AHEE_event_details_before_venue_details', $post ); |
|
6 | - $venue_name = espresso_venue_name( 0, 'details', FALSE ); |
|
7 | - if ( empty( $venue_name ) && espresso_is_venue_private() ) { |
|
8 | - do_action( 'AHEE_event_details_after_venue_details', $post ); |
|
5 | + do_action('AHEE_event_details_before_venue_details', $post); |
|
6 | + $venue_name = espresso_venue_name(0, 'details', FALSE); |
|
7 | + if (empty($venue_name) && espresso_is_venue_private()) { |
|
8 | + do_action('AHEE_event_details_after_venue_details', $post); |
|
9 | 9 | return ''; |
10 | 10 | } |
11 | 11 | ?> |
12 | 12 | |
13 | 13 | <div class="espresso-venue-dv<?php echo espresso_is_venue_private() ? ' espresso-private-venue-dv' : ''; ?>"> |
14 | 14 | <h3 class="event-venues-h3 ee-event-h3"> |
15 | - <?php _e( 'Location', 'event_espresso' ); ?> |
|
15 | + <?php _e('Location', 'event_espresso'); ?> |
|
16 | 16 | </h3> |
17 | - <h4><strong><?php _e( 'Venue:', 'event_espresso' ); ?></strong> <strong> <?php echo $venue_name; ?></strong></h4> |
|
17 | + <h4><strong><?php _e('Venue:', 'event_espresso'); ?></strong> <strong> <?php echo $venue_name; ?></strong></h4> |
|
18 | 18 | <p><span class="smaller-text tags-links"><?php echo espresso_venue_categories(); ?></span></p> |
19 | -<?php if ( $venue_phone = espresso_venue_phone( $post->ID, FALSE )) : ?> |
|
19 | +<?php if ($venue_phone = espresso_venue_phone($post->ID, FALSE)) : ?> |
|
20 | 20 | <p> |
21 | - <span class="small-text"><strong><?php _e( 'Venue Phone:', 'event_espresso' ); ?></strong></span> <?php echo $venue_phone; ?> |
|
21 | + <span class="small-text"><strong><?php _e('Venue Phone:', 'event_espresso'); ?></strong></span> <?php echo $venue_phone; ?> |
|
22 | 22 | </p> |
23 | -<?php endif; ?> |
|
24 | -<?php if ( espresso_venue_has_address( $post->ID )) : ?> |
|
25 | - <strong><span class="dashicons dashicons-location-alt"></span><?php _e( 'Address:', 'event_espresso' ); ?></strong> |
|
26 | - <?php espresso_venue_address( 'inline' ); ?> |
|
27 | - <?php espresso_venue_gmap( $post->ID ); ?> |
|
23 | +<?php endif; ?> |
|
24 | +<?php if (espresso_venue_has_address($post->ID)) : ?> |
|
25 | + <strong><span class="dashicons dashicons-location-alt"></span><?php _e('Address:', 'event_espresso'); ?></strong> |
|
26 | + <?php espresso_venue_address('inline'); ?> |
|
27 | + <?php espresso_venue_gmap($post->ID); ?> |
|
28 | 28 | <div class="clear"><br/></div> |
29 | -<?php endif; ?> |
|
29 | +<?php endif; ?> |
|
30 | 30 | |
31 | - <?php $VNU_ID = espresso_venue_id( $post->ID ); ?> |
|
32 | - <?php if ( is_single() ) : ?> |
|
33 | - <?php $venue_description = espresso_venue_description( $VNU_ID, FALSE ); ?> |
|
34 | - <?php if ( $venue_description ) : ?> |
|
31 | + <?php $VNU_ID = espresso_venue_id($post->ID); ?> |
|
32 | + <?php if (is_single()) : ?> |
|
33 | + <?php $venue_description = espresso_venue_description($VNU_ID, FALSE); ?> |
|
34 | + <?php if ($venue_description) : ?> |
|
35 | 35 | <p> |
36 | - <strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/> |
|
37 | - <?php echo do_shortcode( $venue_description ); ?> |
|
36 | + <strong><?php _e('Description:', 'event_espresso'); ?></strong><br/> |
|
37 | + <?php echo do_shortcode($venue_description); ?> |
|
38 | 38 | </p> |
39 | - <?php endif; ?> |
|
39 | + <?php endif; ?> |
|
40 | 40 | <?php else : ?> |
41 | - <?php $venue_excerpt = espresso_venue_excerpt( $VNU_ID, FALSE ); ?> |
|
42 | - <?php if ( $venue_excerpt ) : ?> |
|
41 | + <?php $venue_excerpt = espresso_venue_excerpt($VNU_ID, FALSE); ?> |
|
42 | + <?php if ($venue_excerpt) : ?> |
|
43 | 43 | <p> |
44 | - <strong><?php _e( 'Description:', 'event_espresso' ); ?></strong><br/> |
|
44 | + <strong><?php _e('Description:', 'event_espresso'); ?></strong><br/> |
|
45 | 45 | <?php echo $venue_excerpt; ?> |
46 | 46 | </p> |
47 | - <?php endif; ?> |
|
48 | - <?php endif; ?> |
|
47 | + <?php endif; ?> |
|
48 | + <?php endif; ?> |
|
49 | 49 | </div> |
50 | 50 | <!-- .espresso-venue-dv --> |
51 | 51 | <?php |
52 | -do_action( 'AHEE_event_details_after_venue_details', $post ); |
|
52 | +do_action('AHEE_event_details_after_venue_details', $post); |
|
53 | 53 | endif; |
54 | 54 | ?> |
@@ -18,52 +18,52 @@ |
||
18 | 18 | * and/or use any of the template tags functions found in: |
19 | 19 | * \wp-content\plugins\event-espresso-core\public\template_tags.php |
20 | 20 | ************************** IMPORTANT **************************/ |
21 | -add_filter( 'FHEE__content_espresso_events__template_loaded', '__return_true' ); |
|
21 | +add_filter('FHEE__content_espresso_events__template_loaded', '__return_true'); |
|
22 | 22 | |
23 | 23 | //echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>'; |
24 | 24 | |
25 | 25 | global $post; |
26 | -$event_class = has_excerpt( $post->ID ) ? ' has-excerpt' : ''; |
|
27 | -$event_class = apply_filters( 'FHEE__content_espresso_events__event_class', $event_class ); |
|
26 | +$event_class = has_excerpt($post->ID) ? ' has-excerpt' : ''; |
|
27 | +$event_class = apply_filters('FHEE__content_espresso_events__event_class', $event_class); |
|
28 | 28 | ?> |
29 | -<?php do_action( 'AHEE_event_details_before_post', $post ); ?> |
|
30 | -<article id="post-<?php the_ID(); ?>" <?php post_class( $event_class ); ?>> |
|
29 | +<?php do_action('AHEE_event_details_before_post', $post); ?> |
|
30 | +<article id="post-<?php the_ID(); ?>" <?php post_class($event_class); ?>> |
|
31 | 31 | |
32 | -<?php if ( is_single() ) : ?> |
|
32 | +<?php if (is_single()) : ?> |
|
33 | 33 | |
34 | - <div id="espresso-event-header-dv-<?php echo $post->ID;?>" class="espresso-event-header-dv"> |
|
35 | - <?php espresso_get_template_part( 'content', 'espresso_events-thumbnail' ); ?> |
|
36 | - <?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?> |
|
34 | + <div id="espresso-event-header-dv-<?php echo $post->ID; ?>" class="espresso-event-header-dv"> |
|
35 | + <?php espresso_get_template_part('content', 'espresso_events-thumbnail'); ?> |
|
36 | + <?php espresso_get_template_part('content', 'espresso_events-header'); ?> |
|
37 | 37 | </div> |
38 | 38 | |
39 | 39 | <div class="espresso-event-wrapper-dv"> |
40 | - <?php espresso_get_template_part( 'content', 'espresso_events-tickets' ); ?> |
|
41 | - <?php espresso_get_template_part( 'content', 'espresso_events-datetimes' ); ?> |
|
42 | - <?php espresso_get_template_part( 'content', 'espresso_events-details' ); ?> |
|
43 | - <?php espresso_get_template_part( 'content', 'espresso_events-venues' ); ?> |
|
40 | + <?php espresso_get_template_part('content', 'espresso_events-tickets'); ?> |
|
41 | + <?php espresso_get_template_part('content', 'espresso_events-datetimes'); ?> |
|
42 | + <?php espresso_get_template_part('content', 'espresso_events-details'); ?> |
|
43 | + <?php espresso_get_template_part('content', 'espresso_events-venues'); ?> |
|
44 | 44 | <footer class="event-meta"> |
45 | - <?php do_action( 'AHEE_event_details_footer_top', $post ); ?> |
|
46 | - <?php do_action( 'AHEE_event_details_footer_bottom', $post ); ?> |
|
45 | + <?php do_action('AHEE_event_details_footer_top', $post); ?> |
|
46 | + <?php do_action('AHEE_event_details_footer_bottom', $post); ?> |
|
47 | 47 | </footer> |
48 | 48 | </div> |
49 | 49 | |
50 | -<?php elseif ( is_archive() ) : ?> |
|
50 | +<?php elseif (is_archive()) : ?> |
|
51 | 51 | |
52 | - <div id="espresso-event-list-header-dv-<?php echo $post->ID;?>" class="espresso-event-header-dv"> |
|
53 | - <?php espresso_get_template_part( 'content', 'espresso_events-thumbnail' ); ?> |
|
54 | - <?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?> |
|
52 | + <div id="espresso-event-list-header-dv-<?php echo $post->ID; ?>" class="espresso-event-header-dv"> |
|
53 | + <?php espresso_get_template_part('content', 'espresso_events-thumbnail'); ?> |
|
54 | + <?php espresso_get_template_part('content', 'espresso_events-header'); ?> |
|
55 | 55 | </div> |
56 | 56 | |
57 | 57 | <div class="espresso-event-list-wrapper-dv"> |
58 | - <?php espresso_get_template_part( 'content', 'espresso_events-tickets' ); ?> |
|
59 | - <?php espresso_get_template_part( 'content', 'espresso_events-datetimes' ); ?> |
|
60 | - <?php espresso_get_template_part( 'content', 'espresso_events-details' ); ?> |
|
61 | - <?php espresso_get_template_part( 'content', 'espresso_events-venues' ); ?> |
|
58 | + <?php espresso_get_template_part('content', 'espresso_events-tickets'); ?> |
|
59 | + <?php espresso_get_template_part('content', 'espresso_events-datetimes'); ?> |
|
60 | + <?php espresso_get_template_part('content', 'espresso_events-details'); ?> |
|
61 | + <?php espresso_get_template_part('content', 'espresso_events-venues'); ?> |
|
62 | 62 | </div> |
63 | 63 | |
64 | 64 | <?php endif; ?> |
65 | 65 | |
66 | 66 | </article> |
67 | 67 | <!-- #post --> |
68 | -<?php do_action( 'AHEE_event_details_after_post', $post ); |
|
68 | +<?php do_action('AHEE_event_details_after_post', $post); |
|
69 | 69 |
@@ -11,22 +11,22 @@ discard block |
||
11 | 11 | * @ version 4+ |
12 | 12 | */ |
13 | 13 | |
14 | - if ( have_posts() ) : ?> |
|
14 | + if (have_posts()) : ?> |
|
15 | 15 | |
16 | 16 | <header class="page-header"> |
17 | 17 | <h1 class="page-title"> |
18 | 18 | <?php |
19 | - if ( is_day() ) : |
|
20 | - printf( __( 'Today\'s Events: %s', 'event_espresso' ), get_the_date() ); |
|
19 | + if (is_day()) : |
|
20 | + printf(__('Today\'s Events: %s', 'event_espresso'), get_the_date()); |
|
21 | 21 | |
22 | - elseif ( is_month() ) : |
|
23 | - printf( __( 'Events This Month: %s', 'event_espresso' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'event_espresso' ) ) ); |
|
22 | + elseif (is_month()) : |
|
23 | + printf(__('Events This Month: %s', 'event_espresso'), get_the_date(_x('F Y', 'monthly archives date format', 'event_espresso'))); |
|
24 | 24 | |
25 | - elseif ( is_year() ) : |
|
26 | - printf( __( 'Events This Year: %s', 'event_espresso' ), get_the_date( _x( 'Y', 'yearly archives date format', 'event_espresso' ) ) ); |
|
25 | + elseif (is_year()) : |
|
26 | + printf(__('Events This Year: %s', 'event_espresso'), get_the_date(_x('Y', 'yearly archives date format', 'event_espresso'))); |
|
27 | 27 | |
28 | 28 | else : |
29 | - echo apply_filters( 'FHEE__archive_espresso_events_template__upcoming_events_h1', __( 'Upcoming Events', 'event_espresso' )); |
|
29 | + echo apply_filters('FHEE__archive_espresso_events_template__upcoming_events_h1', __('Upcoming Events', 'event_espresso')); |
|
30 | 30 | |
31 | 31 | endif; |
32 | 32 | ?> |
@@ -36,20 +36,20 @@ discard block |
||
36 | 36 | |
37 | 37 | <?php |
38 | 38 | // allow other stuff |
39 | - do_action( 'AHEE__archive_espresso_events_template__before_loop' ); |
|
39 | + do_action('AHEE__archive_espresso_events_template__before_loop'); |
|
40 | 40 | // Start the Loop. |
41 | - while ( have_posts() ) : the_post(); |
|
41 | + while (have_posts()) : the_post(); |
|
42 | 42 | // Include the post TYPE-specific template for the content. |
43 | - espresso_get_template_part( 'content', 'espresso_events-shortcode' ); |
|
43 | + espresso_get_template_part('content', 'espresso_events-shortcode'); |
|
44 | 44 | endwhile; |
45 | 45 | // Previous/next page navigation. |
46 | 46 | espresso_pagination(); |
47 | 47 | // allow moar other stuff |
48 | - do_action( 'AHEE__archive_espresso_events_template__after_loop' ); |
|
48 | + do_action('AHEE__archive_espresso_events_template__after_loop'); |
|
49 | 49 | |
50 | 50 | else : |
51 | 51 | // If no content, include the "No posts found" template. |
52 | - espresso_get_template_part( 'content', 'none' ); |
|
52 | + espresso_get_template_part('content', 'none'); |
|
53 | 53 | |
54 | 54 | endif; |
55 | 55 |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This template will display The Loop that displays your events |
|
4 | - * DO NOT COPY THIS TEMPLATE TO YOUR THEMES FOLDER |
|
5 | - * |
|
6 | - * @ package Event Espresso |
|
7 | - * @ author Seth Shoultes |
|
8 | - * @ copyright (c) 2008-2013 Event Espresso All Rights Reserved. |
|
9 | - * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
10 | - * @ link http://www.eventespresso.com |
|
11 | - * @ version 4+ |
|
12 | - */ |
|
3 | + * This template will display The Loop that displays your events |
|
4 | + * DO NOT COPY THIS TEMPLATE TO YOUR THEMES FOLDER |
|
5 | + * |
|
6 | + * @ package Event Espresso |
|
7 | + * @ author Seth Shoultes |
|
8 | + * @ copyright (c) 2008-2013 Event Espresso All Rights Reserved. |
|
9 | + * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
10 | + * @ link http://www.eventespresso.com |
|
11 | + * @ version 4+ |
|
12 | + */ |
|
13 | 13 | |
14 | 14 | if ( have_posts() ) : ?> |
15 | 15 |
@@ -27,18 +27,18 @@ discard block |
||
27 | 27 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
28 | 28 | */ |
29 | 29 | /** |
30 | - * Event Espresso |
|
31 | - * |
|
32 | - * Event Registration and Management Plugin for WordPress |
|
33 | - * |
|
34 | - * @package Event Espresso |
|
35 | - * @author Seth Shoultes |
|
36 | - * @copyright (c) 2008-2014 Event Espresso All Rights Reserved. |
|
37 | - * @license {@link http://eventespresso.com/support/terms-conditions/} * see Plugin Licensing * |
|
38 | - * @link {@link http://www.eventespresso.com} |
|
39 | - * @since 4.0 |
|
40 | - * |
|
41 | - */ |
|
30 | + * Event Espresso |
|
31 | + * |
|
32 | + * Event Registration and Management Plugin for WordPress |
|
33 | + * |
|
34 | + * @package Event Espresso |
|
35 | + * @author Seth Shoultes |
|
36 | + * @copyright (c) 2008-2014 Event Espresso All Rights Reserved. |
|
37 | + * @license {@link http://eventespresso.com/support/terms-conditions/} * see Plugin Licensing * |
|
38 | + * @link {@link http://www.eventespresso.com} |
|
39 | + * @since 4.0 |
|
40 | + * |
|
41 | + */ |
|
42 | 42 | |
43 | 43 | if ( function_exists( 'espresso_version' ) ) { |
44 | 44 | |
@@ -235,13 +235,13 @@ discard block |
||
235 | 235 | |
236 | 236 | if ( ! function_exists( 'espresso_deactivate_plugin' ) ) { |
237 | 237 | /** |
238 | - * deactivate_plugin |
|
239 | - * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
240 | - * |
|
241 | - * @access public |
|
242 | - * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
243 | - * @return void |
|
244 | - */ |
|
238 | + * deactivate_plugin |
|
239 | + * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
240 | + * |
|
241 | + * @access public |
|
242 | + * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
243 | + * @return void |
|
244 | + */ |
|
245 | 245 | function espresso_deactivate_plugin( $plugin_basename = '' ) { |
246 | 246 | if ( ! function_exists( 'deactivate_plugins' ) ) { |
247 | 247 | require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'ABSPATH' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('ABSPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /* |
5 | 5 | Plugin Name: Event Espresso |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * |
41 | 41 | */ |
42 | 42 | |
43 | -if ( function_exists( 'espresso_version' ) ) { |
|
43 | +if (function_exists('espresso_version')) { |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * espresso_duplicate_plugin_error |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | function espresso_duplicate_plugin_error() { |
50 | 50 | ?> |
51 | 51 | <div class="error"> |
52 | - <p><?php _e( 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', 'event_espresso' ); ?></p> |
|
52 | + <p><?php _e('Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', 'event_espresso'); ?></p> |
|
53 | 53 | </div> |
54 | 54 | <?php |
55 | - espresso_deactivate_plugin( plugin_basename( __FILE__ ) ); |
|
55 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
56 | 56 | } |
57 | - add_action( 'admin_notices', 'espresso_duplicate_plugin_error', 1 ); |
|
57 | + add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
58 | 58 | |
59 | 59 | } else { |
60 | 60 | |
@@ -69,98 +69,98 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | // define versions |
72 | - define( 'EVENT_ESPRESSO_VERSION', espresso_version() ); |
|
73 | - define( 'EE_MIN_WP_VER_REQUIRED', '4.0' ); |
|
74 | - define( 'EE_MIN_WP_VER_RECOMMENDED', '4.1' ); |
|
75 | - define( 'EE_MIN_PHP_VER_REQUIRED', '5.3.0' ); |
|
76 | - define( 'EE_MIN_PHP_VER_RECOMMENDED', '5.4.44' ); |
|
77 | - define( 'EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - ' . EVENT_ESPRESSO_VERSION ); |
|
78 | - define( 'EVENT_ESPRESSO_MAIN_FILE', __FILE__ ); |
|
72 | + define('EVENT_ESPRESSO_VERSION', espresso_version()); |
|
73 | + define('EE_MIN_WP_VER_REQUIRED', '4.0'); |
|
74 | + define('EE_MIN_WP_VER_RECOMMENDED', '4.1'); |
|
75 | + define('EE_MIN_PHP_VER_REQUIRED', '5.3.0'); |
|
76 | + define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44'); |
|
77 | + define('EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - '.EVENT_ESPRESSO_VERSION); |
|
78 | + define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
79 | 79 | //used to be DIRECTORY_SEPARATOR, but that caused issues on windows |
80 | - if ( ! defined( 'DS' ) ) { |
|
81 | - define( 'DS', '/' ); |
|
80 | + if ( ! defined('DS')) { |
|
81 | + define('DS', '/'); |
|
82 | 82 | } |
83 | - if ( ! defined( 'PS' ) ) { |
|
84 | - define( 'PS', PATH_SEPARATOR ); |
|
83 | + if ( ! defined('PS')) { |
|
84 | + define('PS', PATH_SEPARATOR); |
|
85 | 85 | } |
86 | - if ( ! defined( 'SP' ) ) { |
|
87 | - define( 'SP', ' ' ); |
|
86 | + if ( ! defined('SP')) { |
|
87 | + define('SP', ' '); |
|
88 | 88 | } |
89 | - if ( ! defined( 'EENL' ) ) { |
|
90 | - define( 'EENL', "\n" ); |
|
89 | + if ( ! defined('EENL')) { |
|
90 | + define('EENL', "\n"); |
|
91 | 91 | } |
92 | - define( 'EE_SUPPORT_EMAIL', '[email protected]' ); |
|
92 | + define('EE_SUPPORT_EMAIL', '[email protected]'); |
|
93 | 93 | // define the plugin directory and URL |
94 | - define( 'EE_PLUGIN_BASENAME', plugin_basename( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
95 | - define( 'EE_PLUGIN_DIR_PATH', plugin_dir_path( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
96 | - define( 'EE_PLUGIN_DIR_URL', plugin_dir_url( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
94 | + define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE)); |
|
95 | + define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE)); |
|
96 | + define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE)); |
|
97 | 97 | // main root folder paths |
98 | - define( 'EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS ); |
|
99 | - define( 'EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS ); |
|
100 | - define( 'EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS ); |
|
101 | - define( 'EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS ); |
|
102 | - define( 'EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS ); |
|
103 | - define( 'EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS ); |
|
104 | - define( 'EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS ); |
|
105 | - define( 'EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS ); |
|
98 | + define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH.'admin_pages'.DS); |
|
99 | + define('EE_CORE', EE_PLUGIN_DIR_PATH.'core'.DS); |
|
100 | + define('EE_MODULES', EE_PLUGIN_DIR_PATH.'modules'.DS); |
|
101 | + define('EE_PUBLIC', EE_PLUGIN_DIR_PATH.'public'.DS); |
|
102 | + define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH.'shortcodes'.DS); |
|
103 | + define('EE_WIDGETS', EE_PLUGIN_DIR_PATH.'widgets'.DS); |
|
104 | + define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH.'payment_methods'.DS); |
|
105 | + define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH.'caffeinated'.DS); |
|
106 | 106 | // core system paths |
107 | - define( 'EE_ADMIN', EE_CORE . 'admin' . DS ); |
|
108 | - define( 'EE_CPTS', EE_CORE . 'CPTs' . DS ); |
|
109 | - define( 'EE_CLASSES', EE_CORE . 'db_classes' . DS ); |
|
110 | - define( 'EE_INTERFACES', EE_CORE . 'interfaces' . DS ); |
|
111 | - define( 'EE_BUSINESS', EE_CORE . 'business' . DS ); |
|
112 | - define( 'EE_MODELS', EE_CORE . 'db_models' . DS ); |
|
113 | - define( 'EE_HELPERS', EE_CORE . 'helpers' . DS ); |
|
114 | - define( 'EE_LIBRARIES', EE_CORE . 'libraries' . DS ); |
|
115 | - define( 'EE_TEMPLATES', EE_CORE . 'templates' . DS ); |
|
116 | - define( 'EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS ); |
|
117 | - define( 'EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS ); |
|
118 | - define( 'EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS ); |
|
107 | + define('EE_ADMIN', EE_CORE.'admin'.DS); |
|
108 | + define('EE_CPTS', EE_CORE.'CPTs'.DS); |
|
109 | + define('EE_CLASSES', EE_CORE.'db_classes'.DS); |
|
110 | + define('EE_INTERFACES', EE_CORE.'interfaces'.DS); |
|
111 | + define('EE_BUSINESS', EE_CORE.'business'.DS); |
|
112 | + define('EE_MODELS', EE_CORE.'db_models'.DS); |
|
113 | + define('EE_HELPERS', EE_CORE.'helpers'.DS); |
|
114 | + define('EE_LIBRARIES', EE_CORE.'libraries'.DS); |
|
115 | + define('EE_TEMPLATES', EE_CORE.'templates'.DS); |
|
116 | + define('EE_THIRD_PARTY', EE_CORE.'third_party_libs'.DS); |
|
117 | + define('EE_GLOBAL_ASSETS', EE_TEMPLATES.'global_assets'.DS); |
|
118 | + define('EE_FORM_SECTIONS', EE_LIBRARIES.'form_sections'.DS); |
|
119 | 119 | // gateways |
120 | - define( 'EE_GATEWAYS', EE_MODULES . 'gateways' . DS ); |
|
121 | - define( 'EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS ); |
|
120 | + define('EE_GATEWAYS', EE_MODULES.'gateways'.DS); |
|
121 | + define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL.'modules'.DS.'gateways'.DS); |
|
122 | 122 | // asset URL paths |
123 | - define( 'EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS ); |
|
124 | - define( 'EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS ); |
|
125 | - define( 'EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS ); |
|
126 | - define( 'EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS ); |
|
127 | - define( 'EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/' ); |
|
128 | - define( 'EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/' ); |
|
123 | + define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL.'core'.DS.'templates'.DS); |
|
124 | + define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL.'global_assets'.DS); |
|
125 | + define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL.'images'.DS); |
|
126 | + define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL.'core'.DS.'third_party_libs'.DS); |
|
127 | + define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL.'core/helpers/assets/'); |
|
128 | + define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL.'core/libraries/'); |
|
129 | 129 | // define upload paths |
130 | 130 | $uploads = wp_upload_dir(); |
131 | 131 | // define the uploads directory and URL |
132 | - define( 'EVENT_ESPRESSO_UPLOAD_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS ); |
|
133 | - define( 'EVENT_ESPRESSO_UPLOAD_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS ); |
|
132 | + define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'].DS.'espresso'.DS); |
|
133 | + define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'].DS.'espresso'.DS); |
|
134 | 134 | // define the templates directory and URL |
135 | - define( 'EVENT_ESPRESSO_TEMPLATE_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS . 'templates' . DS ); |
|
136 | - define( 'EVENT_ESPRESSO_TEMPLATE_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS . 'templates' . DS ); |
|
135 | + define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'].DS.'espresso'.DS.'templates'.DS); |
|
136 | + define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'].DS.'espresso'.DS.'templates'.DS); |
|
137 | 137 | // define the gateway directory and URL |
138 | - define( 'EVENT_ESPRESSO_GATEWAY_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS . 'gateways' . DS ); |
|
139 | - define( 'EVENT_ESPRESSO_GATEWAY_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS . 'gateways' . DS ); |
|
138 | + define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'].DS.'espresso'.DS.'gateways'.DS); |
|
139 | + define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'].DS.'espresso'.DS.'gateways'.DS); |
|
140 | 140 | // languages folder/path |
141 | - define( 'EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS ); |
|
142 | - define( 'EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS ); |
|
141 | + define('EE_LANGUAGES_SAFE_LOC', '..'.DS.'uploads'.DS.'espresso'.DS.'languages'.DS); |
|
142 | + define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'languages'.DS); |
|
143 | 143 | //check for dompdf fonts in uploads |
144 | - if ( file_exists( EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ) ) { |
|
145 | - define( 'DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ); |
|
144 | + if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS)) { |
|
145 | + define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS); |
|
146 | 146 | } |
147 | 147 | //ajax constants |
148 | - define( 'EE_FRONT_AJAX', isset( $_REQUEST[ 'ee_front_ajax' ] ) || isset( $_REQUEST[ 'data' ][ 'ee_front_ajax' ] ) ? true : false ); |
|
149 | - define( 'EE_ADMIN_AJAX', isset( $_REQUEST[ 'ee_admin_ajax' ] ) || isset( $_REQUEST[ 'data' ][ 'ee_admin_ajax' ] ) ? true : false ); |
|
148 | + define('EE_FRONT_AJAX', isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false); |
|
149 | + define('EE_ADMIN_AJAX', isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false); |
|
150 | 150 | //just a handy constant occasionally needed for finding values representing infinity in the DB |
151 | 151 | //you're better to use this than its straight value (currently -1) in case you ever |
152 | 152 | //want to change its default value! or find when -1 means infinity |
153 | - define( 'EE_INF_IN_DB', -1 ); |
|
154 | - define( 'EE_INF', INF > (float)PHP_INT_MAX ? INF : PHP_INT_MAX ); |
|
153 | + define('EE_INF_IN_DB', -1); |
|
154 | + define('EE_INF', INF > (float) PHP_INT_MAX ? INF : PHP_INT_MAX); |
|
155 | 155 | |
156 | 156 | /** |
157 | 157 | * espresso_plugin_activation |
158 | 158 | * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
159 | 159 | */ |
160 | 160 | function espresso_plugin_activation() { |
161 | - update_option( 'ee_espresso_activation', true ); |
|
161 | + update_option('ee_espresso_activation', true); |
|
162 | 162 | } |
163 | - register_activation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation' ); |
|
163 | + register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
164 | 164 | |
165 | 165 | |
166 | 166 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | // } |
175 | 175 | // |
176 | 176 | } |
177 | - register_deactivation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation' ); |
|
177 | + register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation'); |
|
178 | 178 | |
179 | 179 | |
180 | 180 | |
@@ -184,15 +184,15 @@ discard block |
||
184 | 184 | */ |
185 | 185 | function espresso_load_error_handling() { |
186 | 186 | // load debugging tools |
187 | - if ( WP_DEBUG === true && is_readable( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ) ) { |
|
188 | - require_once( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ); |
|
187 | + if (WP_DEBUG === true && is_readable(EE_HELPERS.'EEH_Debug_Tools.helper.php')) { |
|
188 | + require_once(EE_HELPERS.'EEH_Debug_Tools.helper.php'); |
|
189 | 189 | EEH_Debug_Tools::instance(); |
190 | 190 | } |
191 | 191 | // load error handling |
192 | - if ( is_readable( EE_CORE . 'EE_Error.core.php' ) ) { |
|
193 | - require_once( EE_CORE . 'EE_Error.core.php' ); |
|
192 | + if (is_readable(EE_CORE.'EE_Error.core.php')) { |
|
193 | + require_once(EE_CORE.'EE_Error.core.php'); |
|
194 | 194 | } else { |
195 | - wp_die( __( 'The EE_Error core class could not be loaded.', 'event_espresso' ) ); |
|
195 | + wp_die(__('The EE_Error core class could not be loaded.', 'event_espresso')); |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 | |
@@ -206,25 +206,25 @@ discard block |
||
206 | 206 | * @param string $full_path_to_file |
207 | 207 | * @throws EE_Error |
208 | 208 | */ |
209 | - function espresso_load_required( $classname, $full_path_to_file ) { |
|
209 | + function espresso_load_required($classname, $full_path_to_file) { |
|
210 | 210 | static $error_handling_loaded = false; |
211 | - if ( ! $error_handling_loaded ) { |
|
211 | + if ( ! $error_handling_loaded) { |
|
212 | 212 | espresso_load_error_handling(); |
213 | 213 | $error_handling_loaded = true; |
214 | 214 | } |
215 | - if ( is_readable( $full_path_to_file ) ) { |
|
216 | - require_once( $full_path_to_file ); |
|
215 | + if (is_readable($full_path_to_file)) { |
|
216 | + require_once($full_path_to_file); |
|
217 | 217 | } else { |
218 | - throw new EE_Error ( sprintf( |
|
219 | - __( 'The %s class file could not be located or is not readable due to file permissions.', 'event_espresso' ), |
|
218 | + throw new EE_Error(sprintf( |
|
219 | + __('The %s class file could not be located or is not readable due to file permissions.', 'event_espresso'), |
|
220 | 220 | $classname |
221 | - ) ); |
|
221 | + )); |
|
222 | 222 | } |
223 | 223 | } |
224 | 224 | |
225 | - espresso_load_required( 'EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' ); |
|
226 | - espresso_load_required( 'EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' ); |
|
227 | - espresso_load_required( 'EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php' ); |
|
225 | + espresso_load_required('EEH_Base', EE_CORE.'helpers'.DS.'EEH_Base.helper.php'); |
|
226 | + espresso_load_required('EEH_File', EE_CORE.'helpers'.DS.'EEH_File.helper.php'); |
|
227 | + espresso_load_required('EE_Bootstrap', EE_CORE.'EE_Bootstrap.core.php'); |
|
228 | 228 | new EE_Bootstrap(); |
229 | 229 | |
230 | 230 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | |
234 | 234 | |
235 | 235 | |
236 | -if ( ! function_exists( 'espresso_deactivate_plugin' ) ) { |
|
236 | +if ( ! function_exists('espresso_deactivate_plugin')) { |
|
237 | 237 | /** |
238 | 238 | * deactivate_plugin |
239 | 239 | * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
@@ -242,13 +242,13 @@ discard block |
||
242 | 242 | * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
243 | 243 | * @return void |
244 | 244 | */ |
245 | - function espresso_deactivate_plugin( $plugin_basename = '' ) { |
|
246 | - if ( ! function_exists( 'deactivate_plugins' ) ) { |
|
247 | - require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
|
245 | + function espresso_deactivate_plugin($plugin_basename = '') { |
|
246 | + if ( ! function_exists('deactivate_plugins')) { |
|
247 | + require_once(ABSPATH.'wp-admin/includes/plugin.php'); |
|
248 | 248 | } |
249 | - unset( $_GET[ 'activate' ] ); |
|
250 | - unset( $_REQUEST[ 'activate' ] ); |
|
251 | - deactivate_plugins( $plugin_basename ); |
|
249 | + unset($_GET['activate']); |
|
250 | + unset($_REQUEST['activate']); |
|
251 | + deactivate_plugins($plugin_basename); |
|
252 | 252 | } |
253 | 253 | } |
254 | 254 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @return EEG_Paypal_Standard |
64 | 64 | */ |
65 | 65 | public function __construct() { |
66 | - $this->set_uses_separate_IPN_request( true ) ; |
|
66 | + $this->set_uses_separate_IPN_request(true); |
|
67 | 67 | parent::__construct(); |
68 | 68 | } |
69 | 69 | |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | * Also sets the gateway url class variable based on whether debug mode is enabled or not |
74 | 74 | * @param array $settings_array |
75 | 75 | */ |
76 | - public function set_settings($settings_array){ |
|
76 | + public function set_settings($settings_array) { |
|
77 | 77 | parent::set_settings($settings_array); |
78 | - if($this->_debug_mode){ |
|
78 | + if ($this->_debug_mode) { |
|
79 | 79 | $this->_gateway_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; |
80 | - }else{ |
|
80 | + } else { |
|
81 | 81 | $this->_gateway_url = 'https://www.paypal.com/cgi-bin/webscr'; |
82 | 82 | } |
83 | 83 | } |
@@ -92,47 +92,47 @@ discard block |
||
92 | 92 | * @param string $cancel_url URL to send the user to after a cancelled payment attempt on teh payment provider's website |
93 | 93 | * @return EEI_Payment |
94 | 94 | */ |
95 | - public function set_redirection_info( $payment, $billing_info = array(), $return_url = NULL, $notify_url = NULL, $cancel_url = NULL ){ |
|
95 | + public function set_redirection_info($payment, $billing_info = array(), $return_url = NULL, $notify_url = NULL, $cancel_url = NULL) { |
|
96 | 96 | $redirect_args = array(); |
97 | 97 | $transaction = $payment->transaction(); |
98 | 98 | $primary_registrant = $transaction->primary_registration(); |
99 | 99 | $item_num = 1; |
100 | 100 | $total_line_item = $transaction->total_line_item(); |
101 | - if( $this->_can_easily_itemize_transaction_for( $payment ) ){ |
|
101 | + if ($this->_can_easily_itemize_transaction_for($payment)) { |
|
102 | 102 | //this payment is for the entire transaction, |
103 | 103 | //so let's show all the line items |
104 | - foreach($total_line_item->get_items() as $line_item){ |
|
105 | - if ( $line_item instanceof EE_Line_Item ) { |
|
104 | + foreach ($total_line_item->get_items() as $line_item) { |
|
105 | + if ($line_item instanceof EE_Line_Item) { |
|
106 | 106 | //if this is a re-attempt at paying, don't re-add PayPal's shipping |
107 | - if ( $line_item->code() == 'paypal_shipping' ) { |
|
107 | + if ($line_item->code() == 'paypal_shipping') { |
|
108 | 108 | continue; |
109 | 109 | } |
110 | - $redirect_args[ 'item_name_' . $item_num ] = substr( |
|
111 | - sprintf( __( '%1$s for %2$s', 'event_espresso' ), $line_item->name(), $line_item->ticket_event_name() ), 0, 127 ); |
|
112 | - $redirect_args[ 'amount_' . $item_num ] = $line_item->unit_price(); |
|
113 | - $redirect_args[ 'quantity_' . $item_num ] = $line_item->quantity(); |
|
114 | - if ( ! $line_item->is_taxable() ) { |
|
115 | - $redirect_args[ 'tax_' . $item_num ] = 0; |
|
110 | + $redirect_args['item_name_'.$item_num] = substr( |
|
111 | + sprintf(__('%1$s for %2$s', 'event_espresso'), $line_item->name(), $line_item->ticket_event_name()), 0, 127 ); |
|
112 | + $redirect_args['amount_'.$item_num] = $line_item->unit_price(); |
|
113 | + $redirect_args['quantity_'.$item_num] = $line_item->quantity(); |
|
114 | + if ( ! $line_item->is_taxable()) { |
|
115 | + $redirect_args['tax_'.$item_num] = 0; |
|
116 | 116 | } |
117 | 117 | //if we're not letting PayPal calculate shipping, tell them its 0 |
118 | - if ( ! $this->_paypal_shipping ) { |
|
119 | - $redirect_args[ 'shipping_' . $item_num ] = '0'; |
|
120 | - $redirect_args[ 'shipping2_' . $item_num ] = '0'; |
|
118 | + if ( ! $this->_paypal_shipping) { |
|
119 | + $redirect_args['shipping_'.$item_num] = '0'; |
|
120 | + $redirect_args['shipping2_'.$item_num] = '0'; |
|
121 | 121 | } |
122 | 122 | $item_num++; |
123 | 123 | } |
124 | 124 | } |
125 | 125 | //add our taxes to the order if we're NOT using PayPal's |
126 | - if( ! $this->_paypal_taxes ){ |
|
126 | + if ( ! $this->_paypal_taxes) { |
|
127 | 127 | $redirect_args['tax_cart'] = $total_line_item->get_total_tax(); |
128 | 128 | } |
129 | - }else{ |
|
129 | + } else { |
|
130 | 130 | //this is a partial payment, so we can't really show all the line items |
131 | - $redirect_args['item_name_' . $item_num] = substr( sprintf(__('Payment of %1$s for %2$s', "event_espresso"),$payment->amount(), $primary_registrant->reg_code()), 0, 127 ); |
|
132 | - $redirect_args['amount_' . $item_num] = $payment->amount(); |
|
131 | + $redirect_args['item_name_'.$item_num] = substr(sprintf(__('Payment of %1$s for %2$s', "event_espresso"), $payment->amount(), $primary_registrant->reg_code()), 0, 127); |
|
132 | + $redirect_args['amount_'.$item_num] = $payment->amount(); |
|
133 | 133 | //if we aren't allowing PayPal to calculate shipping, set it to 0 |
134 | - $redirect_args['shipping_' . $item_num ] = '0'; |
|
135 | - $redirect_args['shipping2_' . $item_num ] = '0'; |
|
134 | + $redirect_args['shipping_'.$item_num] = '0'; |
|
135 | + $redirect_args['shipping2_'.$item_num] = '0'; |
|
136 | 136 | //PayPal can't calculate taxes because we don't know what parts of it are taxable |
137 | 137 | $redirect_args['tax_cart'] = '0'; |
138 | 138 | |
@@ -141,16 +141,16 @@ discard block |
||
141 | 141 | |
142 | 142 | |
143 | 143 | } |
144 | - if($this->_debug_mode){ |
|
145 | - $redirect_args['item_name_' . $item_num] = 'DEBUG INFO (this item only added in sandbox mode'; |
|
146 | - $redirect_args['amount_' . $item_num] = 0; |
|
144 | + if ($this->_debug_mode) { |
|
145 | + $redirect_args['item_name_'.$item_num] = 'DEBUG INFO (this item only added in sandbox mode'; |
|
146 | + $redirect_args['amount_'.$item_num] = 0; |
|
147 | 147 | $redirect_args['on0_'.$item_num] = 'NOTIFY URL'; |
148 | - $redirect_args['os0_' . $item_num] = $notify_url; |
|
148 | + $redirect_args['os0_'.$item_num] = $notify_url; |
|
149 | 149 | $redirect_args['on1_'.$item_num] = 'RETURN URL'; |
150 | - $redirect_args['os1_' . $item_num] = $return_url; |
|
150 | + $redirect_args['os1_'.$item_num] = $return_url; |
|
151 | 151 | // $redirect_args['option_index_' . $item_num] = 1; // <-- dunno if this is needed ? |
152 | - $redirect_args['shipping_' . $item_num ] = '0'; |
|
153 | - $redirect_args['shipping2_' . $item_num ] = '0'; |
|
152 | + $redirect_args['shipping_'.$item_num] = '0'; |
|
153 | + $redirect_args['shipping2_'.$item_num] = '0'; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | $redirect_args['business'] = $this->_paypal_id; |
@@ -160,14 +160,14 @@ discard block |
||
160 | 160 | $redirect_args['cmd'] = '_cart'; |
161 | 161 | $redirect_args['upload'] = 1; |
162 | 162 | $redirect_args['currency_code'] = $payment->currency_code(); |
163 | - $redirect_args['rm'] = 2;//makes the user return with method=POST |
|
164 | - if($this->_image_url){ |
|
163 | + $redirect_args['rm'] = 2; //makes the user return with method=POST |
|
164 | + if ($this->_image_url) { |
|
165 | 165 | $redirect_args['image_url'] = $this->_image_url; |
166 | 166 | } |
167 | 167 | $redirect_args['no_shipping'] = $this->_shipping_details; |
168 | - $redirect_args['bn'] = 'EventEspresso_SP';//EE will blow up if you change this |
|
168 | + $redirect_args['bn'] = 'EventEspresso_SP'; //EE will blow up if you change this |
|
169 | 169 | |
170 | - $redirect_args = apply_filters( "FHEE__EEG_Paypal_Standard__set_redirection_info__arguments", $redirect_args ); |
|
170 | + $redirect_args = apply_filters("FHEE__EEG_Paypal_Standard__set_redirection_info__arguments", $redirect_args); |
|
171 | 171 | |
172 | 172 | $payment->set_redirect_url($this->_gateway_url); |
173 | 173 | $payment->set_redirect_args($redirect_args); |
@@ -185,55 +185,55 @@ discard block |
||
185 | 185 | * @return \EEI_Payment updated |
186 | 186 | * @throws \EE_Error |
187 | 187 | */ |
188 | - public function handle_payment_update( $update_info, $transaction ){ |
|
188 | + public function handle_payment_update($update_info, $transaction) { |
|
189 | 189 | //verify there's payment data that's been sent |
190 | - if ( empty( $update_info[ 'payment_status' ] ) || empty( $update_info[ 'txn_id' ] ) ) { |
|
190 | + if (empty($update_info['payment_status']) || empty($update_info['txn_id'])) { |
|
191 | 191 | // waaaait... is this a PDT request? (see https://developer.paypal.com/docs/classic/products/payment-data-transfer/) |
192 | 192 | // indicated by the "tx" argument? If so, we don't need it. We'll just use the IPN data when it comes |
193 | - if ( isset( $update_info[ 'tx' ] ) ) { |
|
193 | + if (isset($update_info['tx'])) { |
|
194 | 194 | return $transaction->last_payment(); |
195 | 195 | } else { |
196 | 196 | return null; |
197 | 197 | } |
198 | 198 | } |
199 | - $payment = $this->_pay_model->get_payment_by_txn_id_chq_nmbr( $update_info[ 'txn_id' ] ); |
|
200 | - if ( ! $payment instanceof EEI_Payment ) { |
|
199 | + $payment = $this->_pay_model->get_payment_by_txn_id_chq_nmbr($update_info['txn_id']); |
|
200 | + if ( ! $payment instanceof EEI_Payment) { |
|
201 | 201 | $payment = $transaction->last_payment(); |
202 | 202 | } |
203 | 203 | // ok, then validate the IPN. Even if we've already processed this payment, |
204 | 204 | // let PayPal know we don't want to hear from them anymore! |
205 | - if ( ! $this->validate_ipn( $update_info, $payment ) ) { |
|
205 | + if ( ! $this->validate_ipn($update_info, $payment)) { |
|
206 | 206 | return $payment; |
207 | 207 | } |
208 | 208 | //ok, well let's process this payment then! |
209 | - switch ( $update_info[ 'payment_status' ] ) { |
|
209 | + switch ($update_info['payment_status']) { |
|
210 | 210 | |
211 | 211 | case 'Completed' : |
212 | 212 | $status = $this->_pay_model->approved_status(); |
213 | - $gateway_response = __( 'The payment is approved.', 'event_espresso' ); |
|
213 | + $gateway_response = __('The payment is approved.', 'event_espresso'); |
|
214 | 214 | break; |
215 | 215 | |
216 | 216 | case 'Pending' : |
217 | 217 | $status = $this->_pay_model->pending_status(); |
218 | - $gateway_response = __( 'The payment is in progress. Another message will be sent when payment is approved.', 'event_espresso' ); |
|
218 | + $gateway_response = __('The payment is in progress. Another message will be sent when payment is approved.', 'event_espresso'); |
|
219 | 219 | break; |
220 | 220 | |
221 | 221 | case 'Denied' : |
222 | 222 | $status = $this->_pay_model->declined_status(); |
223 | - $gateway_response = __( 'The payment has been declined.', 'event_espresso' ); |
|
223 | + $gateway_response = __('The payment has been declined.', 'event_espresso'); |
|
224 | 224 | break; |
225 | 225 | |
226 | 226 | case 'Expired' : |
227 | 227 | case 'Failed' : |
228 | 228 | $status = $this->_pay_model->failed_status(); |
229 | - $gateway_response = __( 'The payment failed for technical reasons or expired.', 'event_espresso' ); |
|
229 | + $gateway_response = __('The payment failed for technical reasons or expired.', 'event_espresso'); |
|
230 | 230 | break; |
231 | 231 | |
232 | 232 | case 'Refunded' : |
233 | 233 | case 'Partially_Refunded' : |
234 | 234 | // even though it's a refund, we consider the payment as approved, it just has a negative value |
235 | 235 | $status = $this->_pay_model->approved_status(); |
236 | - $gateway_response = __( 'The payment has been refunded. Please update registrations accordingly.', 'event_espresso' ); |
|
236 | + $gateway_response = __('The payment has been refunded. Please update registrations accordingly.', 'event_espresso'); |
|
237 | 237 | break; |
238 | 238 | |
239 | 239 | case 'Voided' : |
@@ -241,25 +241,25 @@ discard block |
||
241 | 241 | case 'Canceled_Reversal' : |
242 | 242 | default : |
243 | 243 | $status = $this->_pay_model->cancelled_status(); |
244 | - $gateway_response = __( 'The payment was cancelled, reversed, or voided. Please update registrations accordingly.', 'event_espresso' ); |
|
244 | + $gateway_response = __('The payment was cancelled, reversed, or voided. Please update registrations accordingly.', 'event_espresso'); |
|
245 | 245 | break; |
246 | 246 | |
247 | 247 | } |
248 | 248 | |
249 | 249 | //check if we've already processed this payment |
250 | - if ( $payment instanceof EEI_Payment ) { |
|
250 | + if ($payment instanceof EEI_Payment) { |
|
251 | 251 | //payment exists. if this has the exact same status and amount, don't bother updating. just return |
252 | - if ( $payment->status() == $status && $payment->amount() == $update_info[ 'mc_gross' ] ) { |
|
252 | + if ($payment->status() == $status && $payment->amount() == $update_info['mc_gross']) { |
|
253 | 253 | // DUPLICATED IPN! dont bother updating transaction foo!; |
254 | - $message_log = sprintf( __( 'It appears we have received a duplicate IPN from PayPal for payment %d', 'event_espresso' ), $payment->ID() ); |
|
254 | + $message_log = sprintf(__('It appears we have received a duplicate IPN from PayPal for payment %d', 'event_espresso'), $payment->ID()); |
|
255 | 255 | } else { |
256 | 256 | // new payment yippee !!! |
257 | - $payment->set_status( $status ); |
|
258 | - $payment->set_amount( floatval( $update_info[ 'mc_gross' ] ) ); |
|
259 | - $payment->set_gateway_response( $gateway_response ); |
|
260 | - $payment->set_details( $update_info ); |
|
261 | - $payment->set_txn_id_chq_nmbr( $update_info[ 'txn_id' ] ); |
|
262 | - $message_log = sprintf( __( 'Updated payment either from IPN or as part of POST from PayPal', 'event_espresso' ) ); |
|
257 | + $payment->set_status($status); |
|
258 | + $payment->set_amount(floatval($update_info['mc_gross'])); |
|
259 | + $payment->set_gateway_response($gateway_response); |
|
260 | + $payment->set_details($update_info); |
|
261 | + $payment->set_txn_id_chq_nmbr($update_info['txn_id']); |
|
262 | + $message_log = sprintf(__('Updated payment either from IPN or as part of POST from PayPal', 'event_espresso')); |
|
263 | 263 | } |
264 | 264 | $this->log( |
265 | 265 | array( |
@@ -271,11 +271,11 @@ discard block |
||
271 | 271 | $payment |
272 | 272 | ); |
273 | 273 | } |
274 | - do_action( 'FHEE__EEG_Paypal_Standard__handle_payment_update__payment_processed', $payment, $this ); |
|
274 | + do_action('FHEE__EEG_Paypal_Standard__handle_payment_update__payment_processed', $payment, $this); |
|
275 | 275 | // kill request here if this is a refund |
276 | - if ( $update_info[ 'payment_status' ] == 'Refunded' || $update_info[ 'payment_status' ] == 'Partially_Refunded' ) { |
|
277 | - if ( apply_filters( 'FHEE__EEG_Paypal_Standard__handle_payment_update__kill_refund_request', true ) ) { |
|
278 | - status_header( 200 ); |
|
276 | + if ($update_info['payment_status'] == 'Refunded' || $update_info['payment_status'] == 'Partially_Refunded') { |
|
277 | + if (apply_filters('FHEE__EEG_Paypal_Standard__handle_payment_update__kill_refund_request', true)) { |
|
278 | + status_header(200); |
|
279 | 279 | exit(); |
280 | 280 | } |
281 | 281 | } |
@@ -291,9 +291,9 @@ discard block |
||
291 | 291 | * @param EE_Payment|EEI_Payment $payment |
292 | 292 | * @return boolean |
293 | 293 | */ |
294 | - public function validate_ipn( $update_info, $payment ) { |
|
294 | + public function validate_ipn($update_info, $payment) { |
|
295 | 295 | //allow us to skip validating IPNs with PayPal (useful for testing) |
296 | - if ( apply_filters( 'FHEE__EEG_Paypal_Standard__validate_ipn__skip', false ) ) { |
|
296 | + if (apply_filters('FHEE__EEG_Paypal_Standard__validate_ipn__skip', false)) { |
|
297 | 297 | return true; |
298 | 298 | } |
299 | 299 | //...otherwise, we actually don't care what the $update_info is, we need to look |
@@ -301,22 +301,22 @@ discard block |
||
301 | 301 | // Reading POSTed data directly from $_POST causes serialization issues with array data in the POST. |
302 | 302 | // Instead, read raw POST data from the input stream. |
303 | 303 | // @see https://gist.github.com/xcommerce-gists/3440401 |
304 | - $raw_post_data = file_get_contents( 'php://input' ); |
|
305 | - $raw_post_array = explode( '&', $raw_post_data ); |
|
304 | + $raw_post_data = file_get_contents('php://input'); |
|
305 | + $raw_post_array = explode('&', $raw_post_data); |
|
306 | 306 | $update_info = array(); |
307 | - foreach ( $raw_post_array as $keyval ) { |
|
308 | - $keyval = explode( '=', $keyval ); |
|
309 | - if ( count( $keyval ) == 2 ) |
|
310 | - $update_info[ $keyval[ 0 ] ] = urldecode( $keyval[ 1 ] ); |
|
307 | + foreach ($raw_post_array as $keyval) { |
|
308 | + $keyval = explode('=', $keyval); |
|
309 | + if (count($keyval) == 2) |
|
310 | + $update_info[$keyval[0]] = urldecode($keyval[1]); |
|
311 | 311 | } |
312 | 312 | // read the IPN message sent from PayPal and prepend 'cmd=_notify-validate' |
313 | 313 | $req = 'cmd=_notify-validate'; |
314 | - $get_magic_quotes_exists = function_exists( 'get_magic_quotes_gpc' ) ? true : false; |
|
315 | - foreach ( $update_info as $key => $value ) { |
|
316 | - if ( $get_magic_quotes_exists && get_magic_quotes_gpc() == 1 ) { |
|
317 | - $value = urlencode( stripslashes( $value ) ); |
|
314 | + $get_magic_quotes_exists = function_exists('get_magic_quotes_gpc') ? true : false; |
|
315 | + foreach ($update_info as $key => $value) { |
|
316 | + if ($get_magic_quotes_exists && get_magic_quotes_gpc() == 1) { |
|
317 | + $value = urlencode(stripslashes($value)); |
|
318 | 318 | } else { |
319 | - $value = urlencode( $value ); |
|
319 | + $value = urlencode($value); |
|
320 | 320 | } |
321 | 321 | $req .= "&$key=$value"; |
322 | 322 | } |
@@ -326,21 +326,21 @@ discard block |
||
326 | 326 | array( |
327 | 327 | 'body' => $req, |
328 | 328 | 'sslverify' => false, |
329 | - 'timeout' => 60 , |
|
329 | + 'timeout' => 60, |
|
330 | 330 | // make sure to set a site specific unique "user-agent" string since the WordPres default gets declined by PayPal |
331 | 331 | // plz see: https://github.com/websharks/s2member/issues/610 |
332 | - 'user-agent' => 'Event Espresso v' . EVENT_ESPRESSO_VERSION . '; ' . home_url(), |
|
332 | + 'user-agent' => 'Event Espresso v'.EVENT_ESPRESSO_VERSION.'; '.home_url(), |
|
333 | 333 | ) |
334 | 334 | ); |
335 | 335 | // then check the response |
336 | - if ( ! is_wp_error( $response ) && array_key_exists( 'body', $response ) && strcmp( $response[ 'body' ], "VERIFIED" ) == 0 ) { |
|
336 | + if ( ! is_wp_error($response) && array_key_exists('body', $response) && strcmp($response['body'], "VERIFIED") == 0) { |
|
337 | 337 | return true; |
338 | 338 | } else { |
339 | 339 | // huh, something's wack... the IPN didn't validate. We must have replied to the IPN incorrectly, |
340 | 340 | // or their API must have changed: http://www.paypalobjects.com/en_US/ebook/PP_OrderManagement_IntegrationGuide/ipn.html |
341 | - $payment->set_gateway_response( sprintf( __( "IPN Validation failed! Paypal responded with '%s'", "event_espresso" ), $response[ 'body' ] ) ); |
|
342 | - $payment->set_details( array( 'REQUEST' => $update_info, 'VALIDATION_RESPONSE' => $response ) ); |
|
343 | - $payment->set_status( EEM_Payment::status_id_failed ); |
|
341 | + $payment->set_gateway_response(sprintf(__("IPN Validation failed! Paypal responded with '%s'", "event_espresso"), $response['body'])); |
|
342 | + $payment->set_details(array('REQUEST' => $update_info, 'VALIDATION_RESPONSE' => $response)); |
|
343 | + $payment->set_status(EEM_Payment::status_id_failed); |
|
344 | 344 | // log the results |
345 | 345 | $this->log( |
346 | 346 | array( |
@@ -362,9 +362,9 @@ discard block |
||
362 | 362 | */ |
363 | 363 | protected function _process_response_url() { |
364 | 364 | EE_Registry::instance()->load_helper('URL'); |
365 | - if ( isset( $_SERVER[ 'HTTP_HOST' ], $_SERVER[ 'REQUEST_URI' ] ) ) { |
|
365 | + if (isset($_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI'])) { |
|
366 | 366 | $url = is_ssl() ? 'https://' : 'http://'; |
367 | - $url .= EEH_URL::filter_input_server_url( 'HTTP_HOST' ); |
|
367 | + $url .= EEH_URL::filter_input_server_url('HTTP_HOST'); |
|
368 | 368 | $url .= EEH_URL::filter_input_server_url(); |
369 | 369 | } else { |
370 | 370 | $url = 'unknown'; |
@@ -380,19 +380,19 @@ discard block |
||
380 | 380 | * like the taxes or shipping |
381 | 381 | * @param EEI_Payment $payment |
382 | 382 | */ |
383 | - public function update_txn_based_on_payment( $payment ) { |
|
383 | + public function update_txn_based_on_payment($payment) { |
|
384 | 384 | $update_info = $payment->details(); |
385 | 385 | $redirect_args = $payment->redirect_args(); |
386 | 386 | $transaction = $payment->transaction(); |
387 | - if( ! $transaction ){ |
|
388 | - $this->log( __( 'Payment with ID %d has no related transaction, and so update_txn_based_on_payment couldn\'t be executed properly', 'event_espresso' ), $payment ); |
|
387 | + if ( ! $transaction) { |
|
388 | + $this->log(__('Payment with ID %d has no related transaction, and so update_txn_based_on_payment couldn\'t be executed properly', 'event_espresso'), $payment); |
|
389 | 389 | return; |
390 | 390 | } |
391 | - if( ! is_array( $update_info ) || ! isset( $update_info[ 'mc_shipping' ] ) || ! isset( $update_info[ 'tax' ] ) ) { |
|
391 | + if ( ! is_array($update_info) || ! isset($update_info['mc_shipping']) || ! isset($update_info['tax'])) { |
|
392 | 392 | $this->log( |
393 | 393 | array( |
394 | 394 | 'url' => $this->_process_response_url(), |
395 | - 'message' => __( 'Could not update transaction based on payment because the payment details have not yet been put on the payment. This normally happens during the IPN or returning from PayPal', 'event_espresso' ), |
|
395 | + 'message' => __('Could not update transaction based on payment because the payment details have not yet been put on the payment. This normally happens during the IPN or returning from PayPal', 'event_espresso'), |
|
396 | 396 | 'payment' => $payment->model_field_array() |
397 | 397 | ), |
398 | 398 | $payment |
@@ -408,24 +408,24 @@ discard block |
||
408 | 408 | $grand_total_needs_resaving = FALSE; |
409 | 409 | |
410 | 410 | //might PayPal have added shipping? |
411 | - if( $this->_paypal_shipping && floatval( $update_info[ 'mc_shipping' ] ) != 0 ){ |
|
412 | - $this->_line_item->add_unrelated_item( $transaction->total_line_item(), __('Shipping', 'event_espresso'), floatval( $update_info[ 'mc_shipping' ] ), __('Shipping charges calculated by Paypal', 'event_espresso'), 1, FALSE, 'paypal_shipping' ); |
|
411 | + if ($this->_paypal_shipping && floatval($update_info['mc_shipping']) != 0) { |
|
412 | + $this->_line_item->add_unrelated_item($transaction->total_line_item(), __('Shipping', 'event_espresso'), floatval($update_info['mc_shipping']), __('Shipping charges calculated by Paypal', 'event_espresso'), 1, FALSE, 'paypal_shipping'); |
|
413 | 413 | $grand_total_needs_resaving = TRUE; |
414 | 414 | |
415 | 415 | } |
416 | 416 | //might PayPal have changed the taxes? |
417 | - if( $this->_paypal_taxes && floatval( $update_info[ 'tax' ] ) != $redirect_args[ 'tax_cart' ] ){ |
|
418 | - $this->_line_item->set_total_tax_to( $transaction->total_line_item(), floatval( $update_info['tax'] ), __( 'Taxes', 'event_espresso' ), __( 'Calculated by Paypal', 'event_espresso' ) ); |
|
417 | + if ($this->_paypal_taxes && floatval($update_info['tax']) != $redirect_args['tax_cart']) { |
|
418 | + $this->_line_item->set_total_tax_to($transaction->total_line_item(), floatval($update_info['tax']), __('Taxes', 'event_espresso'), __('Calculated by Paypal', 'event_espresso')); |
|
419 | 419 | $grand_total_needs_resaving = TRUE; |
420 | 420 | } |
421 | 421 | |
422 | - if( $grand_total_needs_resaving ){ |
|
423 | - $transaction->total_line_item()->save_this_and_descendants_to_txn( $transaction->ID() ); |
|
422 | + if ($grand_total_needs_resaving) { |
|
423 | + $transaction->total_line_item()->save_this_and_descendants_to_txn($transaction->ID()); |
|
424 | 424 | } |
425 | 425 | $this->log( |
426 | 426 | array( |
427 | 427 | 'url' => $this->_process_response_url(), |
428 | - 'message' => __( 'Updated transaction related to payment', 'event_espresso' ), |
|
428 | + 'message' => __('Updated transaction related to payment', 'event_espresso'), |
|
429 | 429 | 'transaction (updated)' => $transaction->model_field_array(), |
430 | 430 | 'payment (updated)' => $payment->model_field_array(), |
431 | 431 | 'use_paypal_shipping' => $this->_paypal_shipping, |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | * @param bool $routing |
43 | 43 | * @return Registrations_Admin_Page |
44 | 44 | */ |
45 | - public function __construct( $routing = TRUE ) { |
|
46 | - parent::__construct( $routing ); |
|
45 | + public function __construct($routing = TRUE) { |
|
46 | + parent::__construct($routing); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
@@ -75,16 +75,16 @@ discard block |
||
75 | 75 | 'trash' => 'post.php' |
76 | 76 | ); |
77 | 77 | |
78 | - add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10 ); |
|
78 | + add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10); |
|
79 | 79 | //add filters so that the comment urls don't take users to a confusing 404 page |
80 | - add_filter('get_comment_link', array( $this, 'clear_comment_link' ), 10, 3 ); |
|
80 | + add_filter('get_comment_link', array($this, 'clear_comment_link'), 10, 3); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
84 | - public function clear_comment_link( $link, $comment, $args ) { |
|
84 | + public function clear_comment_link($link, $comment, $args) { |
|
85 | 85 | //gotta make sure this only happens on this route |
86 | - $post_type = get_post_type( $comment->comment_post_ID); |
|
87 | - if ( $post_type == 'espresso_attendees' ) |
|
86 | + $post_type = get_post_type($comment->comment_post_ID); |
|
87 | + if ($post_type == 'espresso_attendees') |
|
88 | 88 | return '#commentsdiv'; |
89 | 89 | return $link; |
90 | 90 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | protected function _ajax_hooks() { |
94 | 94 | //todo: all hooks for registrations ajax goes in here |
95 | - add_action( 'wp_ajax_toggle_checkin_status', array( $this, 'toggle_checkin_status' )); |
|
95 | + add_action('wp_ajax_toggle_checkin_status', array($this, 'toggle_checkin_status')); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | 'add-attendee' => __('Add Contact', 'event_espresso'), |
108 | 108 | 'edit' => __('Edit Contact', 'event_espresso'), |
109 | 109 | 'report'=> __("Event Registrations CSV Report", "event_espresso"), |
110 | - 'report_all' => __( 'All Registrations CSV Report', 'event_espresso' ), |
|
111 | - 'contact_list_report' => __( 'Contact List Report', 'event_espresso' ), |
|
110 | + 'report_all' => __('All Registrations CSV Report', 'event_espresso'), |
|
111 | + 'contact_list_report' => __('Contact List Report', 'event_espresso'), |
|
112 | 112 | 'contact_list_export'=> __("Export Data", "event_espresso"), |
113 | 113 | ), |
114 | 114 | 'publishbox' => array( |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | |
137 | 137 | $this->_get_registration_status_array(); |
138 | 138 | |
139 | - $reg_id = ! empty( $this->_req_data['_REG_ID'] ) && ! is_array( $this->_req_data['_REG_ID'] ) ? $this->_req_data['_REG_ID'] : 0; |
|
140 | - $att_id = ! empty( $this->_req_data[ 'ATT_ID' ] ) && ! is_array( $this->_req_data['ATT_ID'] ) ? $this->_req_data['ATT_ID'] : 0; |
|
141 | - $att_id = ! empty( $this->_req_data['post'] ) && ! is_array( $this->_req_data['post'] ) ? $this->_req_data['post'] : $att_id; |
|
139 | + $reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0; |
|
140 | + $att_id = ! empty($this->_req_data['ATT_ID']) && ! is_array($this->_req_data['ATT_ID']) ? $this->_req_data['ATT_ID'] : 0; |
|
141 | + $att_id = ! empty($this->_req_data['post']) && ! is_array($this->_req_data['post']) ? $this->_req_data['post'] : $att_id; |
|
142 | 142 | |
143 | 143 | $this->_page_routes = array( |
144 | 144 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | 'edit_registration' => array( |
157 | 157 | 'func' => '_registration_details', |
158 | - 'args' => array( 'edit' ), |
|
158 | + 'args' => array('edit'), |
|
159 | 159 | 'noheader' => TRUE, |
160 | 160 | 'capability' => 'ee_edit_registration', |
161 | 161 | 'obj_id' => $reg_id |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | 'restore_registrations' => array( |
172 | 172 | 'func' => '_trash_or_restore_registrations', |
173 | - 'args' => array( 'trash' => FALSE ), |
|
173 | + 'args' => array('trash' => FALSE), |
|
174 | 174 | 'noheader' => TRUE, |
175 | 175 | 'capability' => 'ee_delete_registrations' |
176 | 176 | ), |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | 'filename' => 'registrations_overview_other' |
405 | 405 | ) |
406 | 406 | ), |
407 | - 'help_tour' => array( 'Registration_Overview_Help_Tour' ), |
|
407 | + 'help_tour' => array('Registration_Overview_Help_Tour'), |
|
408 | 408 | 'qtips' => array('Registration_List_Table_Tips'), |
409 | 409 | 'list_table' => 'EE_Registrations_List_Table', |
410 | 410 | 'require_nonce' => FALSE |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | 'nav' => array( |
415 | 415 | 'label' => __('REG Details', 'event_espresso'), |
416 | 416 | 'order' => 15, |
417 | - 'url' => isset($this->_req_data['_REG_ID']) ? add_query_arg(array('_REG_ID' => $this->_req_data['_REG_ID'] ), $this->_current_page_view_url ) : $this->_admin_base_url, |
|
417 | + 'url' => isset($this->_req_data['_REG_ID']) ? add_query_arg(array('_REG_ID' => $this->_req_data['_REG_ID']), $this->_current_page_view_url) : $this->_admin_base_url, |
|
418 | 418 | 'persistent' => FALSE |
419 | 419 | ), |
420 | 420 | 'help_tabs' => array( |
@@ -435,8 +435,8 @@ discard block |
||
435 | 435 | 'filename' => 'registrations_details_registrant_details' |
436 | 436 | ) |
437 | 437 | ), |
438 | - 'help_tour' => array( 'Registration_Details_Help_Tour' ), |
|
439 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_registration_details_metaboxes' ) ), |
|
438 | + 'help_tour' => array('Registration_Details_Help_Tour'), |
|
439 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_registration_details_metaboxes')), |
|
440 | 440 | 'require_nonce' => FALSE |
441 | 441 | ), |
442 | 442 | |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | 'order' => 15, |
461 | 461 | 'persistent' => FALSE |
462 | 462 | ), |
463 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes' ) ), |
|
463 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes')), |
|
464 | 464 | 'require_nonce' => FALSE |
465 | 465 | ), |
466 | 466 | |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | 'label' => __('Edit Contact', 'event_espresso'), |
470 | 470 | 'order' => 15, |
471 | 471 | 'persistent' => FALSE, |
472 | - 'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID'] ), $this->_current_page_view_url ) : $this->_admin_base_url |
|
472 | + 'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID']), $this->_current_page_view_url) : $this->_admin_base_url |
|
473 | 473 | ), |
474 | 474 | 'metaboxes' => array('attendee_editor_metaboxes'), |
475 | 475 | 'require_nonce' => FALSE |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | 'filename' => 'registrations_contact_list_other' |
500 | 500 | ) |
501 | 501 | ), |
502 | - 'help_tour' => array( 'Contact_List_Help_Tour' ), |
|
502 | + 'help_tour' => array('Contact_List_Help_Tour'), |
|
503 | 503 | 'metaboxes' => array(), |
504 | 504 | 'require_nonce' => FALSE |
505 | 505 | ), |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | protected function _add_screen_options() {} |
519 | 519 | protected function _add_feature_pointers() {} |
520 | 520 | public function admin_init() { |
521 | - EE_Registry::$i18n_js_strings[ 'update_att_qstns' ] = __( 'click "Update Registration Questions" to save your changes', 'event_espresso' ); |
|
521 | + EE_Registry::$i18n_js_strings['update_att_qstns'] = __('click "Update Registration Questions" to save your changes', 'event_espresso'); |
|
522 | 522 | } |
523 | 523 | public function admin_notices() {} |
524 | 524 | public function admin_footer_scripts() {} |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | * @return void |
537 | 537 | */ |
538 | 538 | private function _get_registration_status_array() { |
539 | - self::$_reg_status = EEM_Registration::reg_status_array( array(), TRUE); |
|
539 | + self::$_reg_status = EEM_Registration::reg_status_array(array(), TRUE); |
|
540 | 540 | } |
541 | 541 | |
542 | 542 | |
@@ -559,11 +559,11 @@ discard block |
||
559 | 559 | public function load_scripts_styles() { |
560 | 560 | //style |
561 | 561 | //wp_register_style('espresso_attendees', ATT_ASSETS_URL . 'espresso_attendees_admin.css', array(), EVENT_ESPRESSO_VERSION ); |
562 | - wp_register_style('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION ); |
|
562 | + wp_register_style('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION); |
|
563 | 563 | wp_enqueue_style('espresso_reg'); |
564 | 564 | |
565 | 565 | //script |
566 | - wp_register_script('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE); |
|
566 | + wp_register_script('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE); |
|
567 | 567 | wp_enqueue_script('espresso_reg'); |
568 | 568 | } |
569 | 569 | |
@@ -572,9 +572,9 @@ discard block |
||
572 | 572 | public function load_scripts_styles_edit_attendee() { |
573 | 573 | //stuff to only show up on our attendee edit details page. |
574 | 574 | $attendee_details_translations = array( |
575 | - 'att_publish_text' => sprintf( __('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created') ) |
|
575 | + 'att_publish_text' => sprintf(__('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created')) |
|
576 | 576 | ); |
577 | - wp_localize_script( 'espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations ); |
|
577 | + wp_localize_script('espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations); |
|
578 | 578 | wp_enqueue_script('jquery-validate'); |
579 | 579 | } |
580 | 580 | |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | |
593 | 593 | public function load_scripts_styles_contact_list() { |
594 | 594 | wp_deregister_style('espresso_reg'); |
595 | - wp_register_style('espresso_att', REG_ASSETS_URL . 'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION ); |
|
595 | + wp_register_style('espresso_att', REG_ASSETS_URL.'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION); |
|
596 | 596 | wp_enqueue_style('espresso_att'); |
597 | 597 | } |
598 | 598 | |
@@ -601,9 +601,9 @@ discard block |
||
601 | 601 | |
602 | 602 | |
603 | 603 | public function load_scripts_styles_new_registration() { |
604 | - wp_register_script( 'ee-spco-for-admin', REG_ASSETS_URL . 'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE ); |
|
604 | + wp_register_script('ee-spco-for-admin', REG_ASSETS_URL.'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE); |
|
605 | 605 | wp_enqueue_script('ee-spco-for-admin'); |
606 | - add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' ); |
|
606 | + add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true'); |
|
607 | 607 | EE_Form_Section_Proper::wp_enqueue_scripts(); |
608 | 608 | EED_Ticket_Selector::load_tckt_slctr_assets(); |
609 | 609 | EE_Datepicker_Input::enqueue_styles_and_scripts(); |
@@ -642,23 +642,23 @@ discard block |
||
642 | 642 | |
643 | 643 | /** setup reg status bulk actions **/ |
644 | 644 | $def_reg_status_actions['approve_registration'] = __('Approve Registrations', 'event_espresso'); |
645 | - if ( in_array( $match_array['approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
645 | + if (in_array($match_array['approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
646 | 646 | $def_reg_status_actions['approve_and_notify_registration'] = __('Approve and Notify Registrations', 'event_espresso'); |
647 | 647 | } |
648 | 648 | $def_reg_status_actions['decline_registration'] = __('Decline Registrations', 'event_espresso'); |
649 | - if ( in_array( $match_array['decline_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
649 | + if (in_array($match_array['decline_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
650 | 650 | $def_reg_status_actions['decline_and_notify_registration'] = __('Decline and Notify Registrations', 'event_espresso'); |
651 | 651 | } |
652 | 652 | $def_reg_status_actions['pending_registration'] = __('Set Registrations to Pending Payment', 'event_espresso'); |
653 | - if ( in_array( $match_array['pending_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
653 | + if (in_array($match_array['pending_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
654 | 654 | $def_reg_status_actions['pending_and_notify_registration'] = __('Set Registrations to Pending Payment and Notify', 'event_espresso'); |
655 | 655 | } |
656 | 656 | $def_reg_status_actions['no_approve_registration'] = __('Set Registrations to Not Approved', 'event_espresso'); |
657 | - if ( in_array( $match_array['no_approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
657 | + if (in_array($match_array['no_approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
658 | 658 | $def_reg_status_actions['no_approve_and_notify_registration'] = __('Set Registrations to Not Approved and Notify', 'event_espresso'); |
659 | 659 | } |
660 | 660 | $def_reg_status_actions['cancel_registration'] = __('Cancel Registrations', 'event_espresso'); |
661 | - if ( in_array( $match_array['cancel_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
661 | + if (in_array($match_array['cancel_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
662 | 662 | $def_reg_status_actions['cancel_and_notify_registration'] = __('Cancel Registrations and Notify', 'event_espresso'); |
663 | 663 | } |
664 | 664 | |
@@ -667,29 +667,29 @@ discard block |
||
667 | 667 | 'slug' => 'all', |
668 | 668 | 'label' => __('View All Registrations', 'event_espresso'), |
669 | 669 | 'count' => 0, |
670 | - 'bulk_action' => array_merge( $def_reg_status_actions, array( |
|
670 | + 'bulk_action' => array_merge($def_reg_status_actions, array( |
|
671 | 671 | 'trash_registrations' => __('Trash Registrations', 'event_espresso') |
672 | - ) ) |
|
672 | + )) |
|
673 | 673 | ), |
674 | 674 | 'month' => array( |
675 | 675 | 'slug' => 'month', |
676 | 676 | 'label' => __('This Month', 'event_espresso'), |
677 | 677 | 'count' => 0, |
678 | - 'bulk_action' => array_merge( $def_reg_status_actions, array( |
|
678 | + 'bulk_action' => array_merge($def_reg_status_actions, array( |
|
679 | 679 | 'trash_registrations' => __('Trash Registrations', 'event_espresso') |
680 | 680 | )) |
681 | 681 | ), |
682 | 682 | 'today' => array( |
683 | 683 | 'slug' => 'today', |
684 | - 'label' => sprintf( __('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp' ) ) ), |
|
684 | + 'label' => sprintf(__('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp'))), |
|
685 | 685 | 'count' => 0, |
686 | - 'bulk_action' => array_merge( $def_reg_status_actions, array( |
|
686 | + 'bulk_action' => array_merge($def_reg_status_actions, array( |
|
687 | 687 | 'trash_registrations' => __('Trash Registrations', 'event_espresso') |
688 | 688 | )) |
689 | 689 | ) |
690 | 690 | ); |
691 | 691 | |
692 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registrations', 'espresso_registrations_delete_registration' ) ) { |
|
692 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registrations', 'espresso_registrations_delete_registration')) { |
|
693 | 693 | $this->_views['incomplete'] = array( |
694 | 694 | 'slug' => 'incomplete', |
695 | 695 | 'label' => __('Incomplete', 'event_espresso'), |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | ) |
726 | 726 | ); |
727 | 727 | |
728 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_trash_attendees' ) ) { |
|
728 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_trash_attendees')) { |
|
729 | 729 | $this->_views['trash'] = array( |
730 | 730 | 'slug' => 'trash', |
731 | 731 | 'label' => __('Trash', 'event_espresso'), |
@@ -764,42 +764,42 @@ discard block |
||
764 | 764 | 'desc' => __('View Transaction Invoice', 'event_espresso') |
765 | 765 | ), |
766 | 766 | ); |
767 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) { |
|
767 | + if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) { |
|
768 | 768 | $fc_items['resend_registration'] = array( |
769 | 769 | 'class' => 'dashicons dashicons-email-alt', |
770 | 770 | 'desc' => __('Resend Registration Details', 'event_espresso') |
771 | 771 | ); |
772 | 772 | } else { |
773 | - $fc_items['blank'] = array( 'class' => 'blank', 'desc' => '' ); |
|
773 | + $fc_items['blank'] = array('class' => 'blank', 'desc' => ''); |
|
774 | 774 | } |
775 | 775 | |
776 | 776 | $sc_items = array( |
777 | 777 | 'approved_status' => array( |
778 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved, |
|
779 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) |
|
778 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_approved, |
|
779 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence') |
|
780 | 780 | ), |
781 | 781 | 'pending_status' => array( |
782 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment, |
|
783 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ) |
|
782 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_pending_payment, |
|
783 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence') |
|
784 | 784 | ), |
785 | 785 | 'incomplete_status' => array( |
786 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_incomplete, |
|
787 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_incomplete, FALSE, 'sentence' ) |
|
786 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_incomplete, |
|
787 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_incomplete, FALSE, 'sentence') |
|
788 | 788 | ), |
789 | 789 | 'not_approved' => array( |
790 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved, |
|
791 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ) |
|
790 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_not_approved, |
|
791 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence') |
|
792 | 792 | ), |
793 | 793 | 'declined_status' => array( |
794 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined, |
|
795 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' ) |
|
794 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_declined, |
|
795 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence') |
|
796 | 796 | ), |
797 | 797 | 'cancelled_status' => array( |
798 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled, |
|
799 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' ) |
|
798 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_cancelled, |
|
799 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence') |
|
800 | 800 | ) |
801 | 801 | ); |
802 | - return array_merge( $fc_items, $sc_items ); |
|
802 | + return array_merge($fc_items, $sc_items); |
|
803 | 803 | } |
804 | 804 | |
805 | 805 | |
@@ -812,15 +812,15 @@ discard block |
||
812 | 812 | |
813 | 813 | |
814 | 814 | protected function _registrations_overview_list_table() { |
815 | - $EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
816 | - if ( $EVT_ID ) { |
|
817 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_registrations', 'espresso_registrations_new_registration', $EVT_ID ) ) { |
|
818 | - $this->_admin_page_title .= $this->get_action_link_or_button( 'new_registration', 'add-registrant', array( 'event_id' => $EVT_ID ), 'add-new-h2' ); |
|
815 | + $EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE; |
|
816 | + if ($EVT_ID) { |
|
817 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_registrations', 'espresso_registrations_new_registration', $EVT_ID)) { |
|
818 | + $this->_admin_page_title .= $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $EVT_ID), 'add-new-h2'); |
|
819 | 819 | } |
820 | - $event = EEM_Event::instance()->get_one_by_ID( $EVT_ID ); |
|
821 | - $this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf( __('%s Viewing registrations for the event: %s%s', 'event_espresso'), '<h2>', '<a href="' . EE_Admin_Page::add_query_args_and_nonce( array('action' => 'edit', 'post' => $event->ID() ), EVENTS_ADMIN_URL ) . '">' . $event->get('EVT_name') . '</a>', '</h2>' ) : ''; |
|
820 | + $event = EEM_Event::instance()->get_one_by_ID($EVT_ID); |
|
821 | + $this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf(__('%s Viewing registrations for the event: %s%s', 'event_espresso'), '<h2>', '<a href="'.EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $event->ID()), EVENTS_ADMIN_URL).'">'.$event->get('EVT_name').'</a>', '</h2>') : ''; |
|
822 | 822 | } |
823 | - $this->_template_args['after_list_table'] = $this->_display_legend( $this->_registration_legend_items() ); |
|
823 | + $this->_template_args['after_list_table'] = $this->_display_legend($this->_registration_legend_items()); |
|
824 | 824 | $this->display_admin_list_table_page_with_no_sidebar(); |
825 | 825 | } |
826 | 826 | |
@@ -835,19 +835,19 @@ discard block |
||
835 | 835 | */ |
836 | 836 | private function _set_registration_object() { |
837 | 837 | //get out if we've already set the object |
838 | - if ( is_object( $this->_registration )) { |
|
838 | + if (is_object($this->_registration)) { |
|
839 | 839 | return TRUE; |
840 | 840 | } |
841 | 841 | |
842 | 842 | $REG = EEM_Registration::instance(); |
843 | 843 | |
844 | - $REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE; |
|
844 | + $REG_ID = ( ! empty($this->_req_data['_REG_ID'])) ? absint($this->_req_data['_REG_ID']) : FALSE; |
|
845 | 845 | |
846 | - if ( $this->_registration = $REG->get_one_by_ID( $REG_ID )) |
|
846 | + if ($this->_registration = $REG->get_one_by_ID($REG_ID)) |
|
847 | 847 | return TRUE; |
848 | 848 | else { |
849 | - $error_msg = sprintf( __('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID ); |
|
850 | - EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
849 | + $error_msg = sprintf(__('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID); |
|
850 | + EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__); |
|
851 | 851 | $this->_registration = NULL; |
852 | 852 | return FALSE; |
853 | 853 | } |
@@ -866,25 +866,25 @@ discard block |
||
866 | 866 | * @internal param bool $all whether to ignore all query params and just return ALL registrations (or count if count is set) |
867 | 867 | * @return mixed (int|array) int = count || array of registration objects |
868 | 868 | */ |
869 | - public function get_registrations( $per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE ) { |
|
870 | - |
|
871 | - $EVT_ID = ! empty( $this->_req_data['event_id'] ) && $this->_req_data['event_id'] > 0 ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
872 | - $CAT_ID = ! empty( $this->_req_data['EVT_CAT'] ) && (int) $this->_req_data['EVT_CAT'] > 0? absint( $this->_req_data['EVT_CAT'] ) : FALSE; |
|
873 | - $reg_status = ! empty( $this->_req_data['_reg_status'] ) ? sanitize_text_field( $this->_req_data['_reg_status'] ) : FALSE; |
|
874 | - $month_range = ! empty( $this->_req_data['month_range'] ) ? sanitize_text_field( $this->_req_data['month_range'] ) : FALSE;//should be like 2013-april |
|
875 | - $today_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'today' ? TRUE : FALSE; |
|
876 | - $this_month_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'month' ? TRUE : FALSE; |
|
869 | + public function get_registrations($per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE) { |
|
870 | + |
|
871 | + $EVT_ID = ! empty($this->_req_data['event_id']) && $this->_req_data['event_id'] > 0 ? absint($this->_req_data['event_id']) : FALSE; |
|
872 | + $CAT_ID = ! empty($this->_req_data['EVT_CAT']) && (int) $this->_req_data['EVT_CAT'] > 0 ? absint($this->_req_data['EVT_CAT']) : FALSE; |
|
873 | + $reg_status = ! empty($this->_req_data['_reg_status']) ? sanitize_text_field($this->_req_data['_reg_status']) : FALSE; |
|
874 | + $month_range = ! empty($this->_req_data['month_range']) ? sanitize_text_field($this->_req_data['month_range']) : FALSE; //should be like 2013-april |
|
875 | + $today_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'today' ? TRUE : FALSE; |
|
876 | + $this_month_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'month' ? TRUE : FALSE; |
|
877 | 877 | $start_date = FALSE; |
878 | 878 | $end_date = FALSE; |
879 | 879 | $_where = array(); |
880 | - $trash = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'trash' ? TRUE : FALSE; |
|
881 | - $incomplete = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'incomplete' ? TRUE : FALSE; |
|
880 | + $trash = ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'trash' ? TRUE : FALSE; |
|
881 | + $incomplete = ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'incomplete' ? TRUE : FALSE; |
|
882 | 882 | |
883 | 883 | //set orderby |
884 | 884 | $this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : ''; |
885 | 885 | |
886 | 886 | |
887 | - switch ( $this->_req_data['orderby'] ) { |
|
887 | + switch ($this->_req_data['orderby']) { |
|
888 | 888 | case '_REG_ID': |
889 | 889 | $orderby = 'REG_ID'; |
890 | 890 | break; |
@@ -904,26 +904,26 @@ discard block |
||
904 | 904 | $orderby = 'REG_date'; |
905 | 905 | } |
906 | 906 | |
907 | - $sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC'; |
|
908 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
909 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
907 | + $sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC'; |
|
908 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
909 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
910 | 910 | |
911 | 911 | |
912 | - $offset = ($current_page-1)*$per_page; |
|
913 | - $limit = $count ? NULL : array( $offset, $per_page ); |
|
912 | + $offset = ($current_page - 1) * $per_page; |
|
913 | + $limit = $count ? NULL : array($offset, $per_page); |
|
914 | 914 | |
915 | - if($EVT_ID){ |
|
916 | - $_where['EVT_ID']=$EVT_ID; |
|
915 | + if ($EVT_ID) { |
|
916 | + $_where['EVT_ID'] = $EVT_ID; |
|
917 | 917 | } |
918 | - if($CAT_ID){ |
|
918 | + if ($CAT_ID) { |
|
919 | 919 | $_where['Event.Term_Taxonomy.term_id'] = $CAT_ID; |
920 | 920 | } |
921 | - if ( $incomplete ) { |
|
921 | + if ($incomplete) { |
|
922 | 922 | $_where['STS_ID'] = EEM_Registration::status_id_incomplete; |
923 | 923 | } else if ( ! $trash) { |
924 | - $_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete ); |
|
924 | + $_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete); |
|
925 | 925 | } |
926 | - if($reg_status){ |
|
926 | + if ($reg_status) { |
|
927 | 927 | $_where['STS_ID'] = $reg_status; |
928 | 928 | } |
929 | 929 | |
@@ -935,105 +935,105 @@ discard block |
||
935 | 935 | $time_start = ' 00:00:00'; |
936 | 936 | $time_end = ' 23:59:59'; |
937 | 937 | |
938 | - if($today_a || $today ){ |
|
938 | + if ($today_a || $today) { |
|
939 | 939 | $curdate = date('Y-m-d', current_time('timestamp')); |
940 | - $_where['REG_date']= array('BETWEEN', |
|
940 | + $_where['REG_date'] = array('BETWEEN', |
|
941 | 941 | array( |
942 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_start, 'Y-m-d H:i:s' ), |
|
943 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_end, 'Y-m-d H:i:s' ), |
|
942 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_start, 'Y-m-d H:i:s'), |
|
943 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_end, 'Y-m-d H:i:s'), |
|
944 | 944 | )); |
945 | - }elseif($this_month_a || $this_month){ |
|
945 | + }elseif ($this_month_a || $this_month) { |
|
946 | 946 | $this_month_r = date('m', current_time('timestamp')); |
947 | - $days_this_month = date( 't', current_time('timestamp') ); |
|
948 | - $_where['REG_date']= array('BETWEEN', |
|
947 | + $days_this_month = date('t', current_time('timestamp')); |
|
948 | + $_where['REG_date'] = array('BETWEEN', |
|
949 | 949 | array( |
950 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, 'Y-m-d H:i:s' ), |
|
951 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end, 'Y-m-d H:i:s' ) |
|
950 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-01'.' '.$time_start, 'Y-m-d H:i:s'), |
|
951 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-'.$days_this_month.' '.$time_end, 'Y-m-d H:i:s') |
|
952 | 952 | )); |
953 | - }elseif($month_range){ |
|
953 | + }elseif ($month_range) { |
|
954 | 954 | $pieces = explode(' ', $this->_req_data['month_range'], 3); |
955 | - $month_r = !empty($pieces[0]) ? date('m', strtotime($pieces[0])) : ''; |
|
956 | - $year_r = !empty($pieces[1]) ? $pieces[1] : ''; |
|
957 | - $days_in_month = date('t', strtotime($year_r . '-' . $month_r . '-' . '01') ); |
|
958 | - $_where['REG_date']= array('BETWEEN', |
|
959 | - array( EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-' . $days_in_month . ' 23:59:59', 'Y-m-d H:i:s' ) ) ); |
|
960 | - }elseif($start_date && $end_date){ |
|
955 | + $month_r = ! empty($pieces[0]) ? date('m', strtotime($pieces[0])) : ''; |
|
956 | + $year_r = ! empty($pieces[1]) ? $pieces[1] : ''; |
|
957 | + $days_in_month = date('t', strtotime($year_r.'-'.$month_r.'-'.'01')); |
|
958 | + $_where['REG_date'] = array('BETWEEN', |
|
959 | + array(EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-'.$days_in_month.' 23:59:59', 'Y-m-d H:i:s'))); |
|
960 | + }elseif ($start_date && $end_date) { |
|
961 | 961 | throw new EE_Error("not yet supported"); |
962 | - }elseif($start_date){ |
|
962 | + }elseif ($start_date) { |
|
963 | 963 | throw new EE_Error("not yet supported"); |
964 | - }elseif($end_date){ |
|
964 | + }elseif ($end_date) { |
|
965 | 965 | throw new EE_Error("not yet supported"); |
966 | 966 | } |
967 | 967 | |
968 | - if ( ! empty( $this->_req_data['s'] ) ) { |
|
969 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
968 | + if ( ! empty($this->_req_data['s'])) { |
|
969 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
970 | 970 | $_where['OR'] = array( |
971 | - 'Event.EVT_name' => array( 'LIKE', $sstr), |
|
972 | - 'Event.EVT_desc' => array( 'LIKE', $sstr ), |
|
973 | - 'Event.EVT_short_desc' => array( 'LIKE' , $sstr ), |
|
974 | - 'Attendee.ATT_full_name' => array( 'LIKE', $sstr ), |
|
975 | - 'Attendee.ATT_fname' => array( 'LIKE', $sstr ), |
|
976 | - 'Attendee.ATT_lname' => array( 'LIKE', $sstr ), |
|
977 | - 'Attendee.ATT_short_bio' => array( 'LIKE', $sstr ), |
|
978 | - 'Attendee.ATT_email' => array('LIKE', $sstr ), |
|
979 | - 'Attendee.ATT_address' => array( 'LIKE', $sstr ), |
|
980 | - 'Attendee.ATT_address2' => array( 'LIKE', $sstr ), |
|
981 | - 'Attendee.ATT_city' => array( 'LIKE', $sstr ), |
|
982 | - 'REG_final_price' => array( 'LIKE', $sstr ), |
|
983 | - 'REG_code' => array( 'LIKE', $sstr ), |
|
984 | - 'REG_count' => array( 'LIKE' , $sstr ), |
|
985 | - 'REG_group_size' => array( 'LIKE' , $sstr ), |
|
986 | - 'Ticket.TKT_name' => array( 'LIKE', $sstr ), |
|
987 | - 'Ticket.TKT_description' => array( 'LIKE', $sstr ), |
|
988 | - 'Transaction.Payment.PAY_txn_id_chq_nmbr' => array( 'LIKE', $sstr ) |
|
971 | + 'Event.EVT_name' => array('LIKE', $sstr), |
|
972 | + 'Event.EVT_desc' => array('LIKE', $sstr), |
|
973 | + 'Event.EVT_short_desc' => array('LIKE', $sstr), |
|
974 | + 'Attendee.ATT_full_name' => array('LIKE', $sstr), |
|
975 | + 'Attendee.ATT_fname' => array('LIKE', $sstr), |
|
976 | + 'Attendee.ATT_lname' => array('LIKE', $sstr), |
|
977 | + 'Attendee.ATT_short_bio' => array('LIKE', $sstr), |
|
978 | + 'Attendee.ATT_email' => array('LIKE', $sstr), |
|
979 | + 'Attendee.ATT_address' => array('LIKE', $sstr), |
|
980 | + 'Attendee.ATT_address2' => array('LIKE', $sstr), |
|
981 | + 'Attendee.ATT_city' => array('LIKE', $sstr), |
|
982 | + 'REG_final_price' => array('LIKE', $sstr), |
|
983 | + 'REG_code' => array('LIKE', $sstr), |
|
984 | + 'REG_count' => array('LIKE', $sstr), |
|
985 | + 'REG_group_size' => array('LIKE', $sstr), |
|
986 | + 'Ticket.TKT_name' => array('LIKE', $sstr), |
|
987 | + 'Ticket.TKT_description' => array('LIKE', $sstr), |
|
988 | + 'Transaction.Payment.PAY_txn_id_chq_nmbr' => array('LIKE', $sstr) |
|
989 | 989 | ); |
990 | 990 | } |
991 | 991 | |
992 | 992 | //capability checks |
993 | - if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations' ) ) { |
|
993 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations')) { |
|
994 | 994 | $_where['AND'] = array( |
995 | 995 | 'Event.EVT_wp_user' => get_current_user_id() |
996 | 996 | ); |
997 | 997 | } |
998 | 998 | |
999 | 999 | |
1000 | - if( $count ){ |
|
1001 | - if ( $trash ) { |
|
1002 | - return EEM_Registration::instance()->count_deleted( array( $_where )); |
|
1003 | - } else if ( $incomplete ) { |
|
1004 | - return EEM_Registration::instance()->count( array( $_where )); |
|
1000 | + if ($count) { |
|
1001 | + if ($trash) { |
|
1002 | + return EEM_Registration::instance()->count_deleted(array($_where)); |
|
1003 | + } else if ($incomplete) { |
|
1004 | + return EEM_Registration::instance()->count(array($_where)); |
|
1005 | 1005 | } else { |
1006 | - return EEM_Registration::instance()->count( array( $_where, 'default_where_conditions' => 'this_model_only' )); |
|
1006 | + return EEM_Registration::instance()->count(array($_where, 'default_where_conditions' => 'this_model_only')); |
|
1007 | 1007 | } |
1008 | 1008 | } else { |
1009 | 1009 | //make sure we remove default where conditions cause all registrations matching query are returned |
1010 | - $query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'default_where_conditions' => 'this_model_only' ); |
|
1011 | - if ( $per_page !== -1 ) { |
|
1010 | + $query_params = array($_where, 'order_by' => array($orderby => $sort), 'default_where_conditions' => 'this_model_only'); |
|
1011 | + if ($per_page !== -1) { |
|
1012 | 1012 | $query_params['limit'] = $limit; |
1013 | 1013 | } |
1014 | - $registrations = $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params); |
|
1014 | + $registrations = $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params); |
|
1015 | 1015 | |
1016 | 1016 | |
1017 | - if ( $EVT_ID && isset( $registrations[0] ) && $registrations[0] instanceof EE_Registration && $registrations[0]->event_obj()) { |
|
1017 | + if ($EVT_ID && isset($registrations[0]) && $registrations[0] instanceof EE_Registration && $registrations[0]->event_obj()) { |
|
1018 | 1018 | $first_registration = $registrations[0]; |
1019 | 1019 | //EEH_Debug_Tools::printr( $registrations[0], '$registrations <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
1020 | 1020 | $event_name = $first_registration->event_obj()->name(); |
1021 | - $event_date = $first_registration->date_obj()->start_date_and_time('l F j, Y,', 'g:i:s a');// isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y, g:i:s a', $registrations[0]->DTT_EVT_start ) : ''; |
|
1021 | + $event_date = $first_registration->date_obj()->start_date_and_time('l F j, Y,', 'g:i:s a'); // isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y, g:i:s a', $registrations[0]->DTT_EVT_start ) : ''; |
|
1022 | 1022 | // edit event link |
1023 | - if ( $event_name != '' ) { |
|
1024 | - $edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit_event', 'EVT_ID'=>$EVT_ID ), EVENTS_ADMIN_URL ); |
|
1025 | - $edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $event_name . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>'; |
|
1026 | - $event_name .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ; |
|
1023 | + if ($event_name != '') { |
|
1024 | + $edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit_event', 'EVT_ID'=>$EVT_ID), EVENTS_ADMIN_URL); |
|
1025 | + $edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$event_name.'">'.__('Edit Event', 'event_espresso').'</a>'; |
|
1026 | + $event_name .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>'; |
|
1027 | 1027 | } |
1028 | 1028 | |
1029 | - $back_2_reg_url = self::add_query_args_and_nonce( array( 'action'=>'default' ), REG_ADMIN_URL ); |
|
1030 | - $back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="' . esc_attr__( 'click to return to viewing all registrations ', 'event_espresso' ) . '">« ' . __( 'Back to All Registrations', 'event_espresso' ) . '</a>'; |
|
1029 | + $back_2_reg_url = self::add_query_args_and_nonce(array('action'=>'default'), REG_ADMIN_URL); |
|
1030 | + $back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="'.esc_attr__('click to return to viewing all registrations ', 'event_espresso').'">« '.__('Back to All Registrations', 'event_espresso').'</a>'; |
|
1031 | 1031 | |
1032 | 1032 | $this->_template_args['before_admin_page_content'] = ' |
1033 | 1033 | <div id="admin-page-header"> |
1034 | - <h1><span class="small-text not-bold">'.__( 'Event: ', 'event_espresso' ).'</span>'. $event_name .'</h1> |
|
1035 | - <h3><span class="small-text not-bold">'.__( 'Date: ', 'event_espresso' ). '</span>'. $event_date .'</h3> |
|
1036 | - <span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk . '</span> |
|
1034 | + <h1><span class="small-text not-bold">'.__('Event: ', 'event_espresso').'</span>'.$event_name.'</h1> |
|
1035 | + <h3><span class="small-text not-bold">'.__('Date: ', 'event_espresso').'</span>'.$event_date.'</h3> |
|
1036 | + <span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk.'</span> |
|
1037 | 1037 | </div> |
1038 | 1038 | '; |
1039 | 1039 | |
@@ -1071,7 +1071,7 @@ discard block |
||
1071 | 1071 | |
1072 | 1072 | $this->_set_registration_object(); |
1073 | 1073 | |
1074 | - if ( is_object( $this->_registration )) { |
|
1074 | + if (is_object($this->_registration)) { |
|
1075 | 1075 | $transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance(); |
1076 | 1076 | $this->_session = $transaction->session_data(); |
1077 | 1077 | |
@@ -1079,10 +1079,10 @@ discard block |
||
1079 | 1079 | |
1080 | 1080 | |
1081 | 1081 | $this->_template_args['reg_nmbr']['value'] = $this->_registration->ID(); |
1082 | - $this->_template_args['reg_nmbr']['label'] = __( 'Registration Number', 'event_espresso' ); |
|
1082 | + $this->_template_args['reg_nmbr']['label'] = __('Registration Number', 'event_espresso'); |
|
1083 | 1083 | |
1084 | - $this->_template_args['reg_datetime']['value'] = $this->_registration->pretty_date('l F j, Y','g:i:s a') ; |
|
1085 | - $this->_template_args['reg_datetime']['label'] = __( 'Date', 'event_espresso' ); |
|
1084 | + $this->_template_args['reg_datetime']['value'] = $this->_registration->pretty_date('l F j, Y', 'g:i:s a'); |
|
1085 | + $this->_template_args['reg_datetime']['label'] = __('Date', 'event_espresso'); |
|
1086 | 1086 | |
1087 | 1087 | $this->_template_args['grand_total'] = $transaction->total(); |
1088 | 1088 | |
@@ -1090,19 +1090,19 @@ discard block |
||
1090 | 1090 | // link back to overview |
1091 | 1091 | $this->_template_args['reg_overview_url'] = REG_ADMIN_URL; |
1092 | 1092 | $this->_template_args['registration'] = $this->_registration; |
1093 | - $this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'event_id' => $event_id ), REG_ADMIN_URL ); |
|
1094 | - $this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions' ), admin_url( 'admin.php' ) ); |
|
1095 | - $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id ), admin_url( 'admin.php' ) ); |
|
1093 | + $this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $event_id), REG_ADMIN_URL); |
|
1094 | + $this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions'), admin_url('admin.php')); |
|
1095 | + $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id), admin_url('admin.php')); |
|
1096 | 1096 | |
1097 | 1097 | //next and previous links |
1098 | - $next_reg = $this->_registration->next(null, array(), 'REG_ID' ); |
|
1099 | - $this->_template_args['next_registration'] = $next_reg ? $this->_next_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-right ee-icon-size-22' ) : ''; |
|
1100 | - $previous_reg = $this->_registration->previous( null, array(), 'REG_ID' ); |
|
1101 | - $this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-left ee-icon-size-22' ) : ''; |
|
1098 | + $next_reg = $this->_registration->next(null, array(), 'REG_ID'); |
|
1099 | + $this->_template_args['next_registration'] = $next_reg ? $this->_next_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-right ee-icon-size-22') : ''; |
|
1100 | + $previous_reg = $this->_registration->previous(null, array(), 'REG_ID'); |
|
1101 | + $this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-left ee-icon-size-22') : ''; |
|
1102 | 1102 | |
1103 | 1103 | // grab header |
1104 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_header.template.php'; |
|
1105 | - $this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1104 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_header.template.php'; |
|
1105 | + $this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1106 | 1106 | |
1107 | 1107 | } else { |
1108 | 1108 | |
@@ -1123,14 +1123,14 @@ discard block |
||
1123 | 1123 | protected function _registration_details_metaboxes() { |
1124 | 1124 | $this->_set_registration_object(); |
1125 | 1125 | $attendee = $this->_registration instanceof EE_Registration ? $this->_registration->attendee() : null; |
1126 | - add_meta_box( 'edit-reg-status-mbox', __( 'Registration Status', 'event_espresso' ), array( $this, 'set_reg_status_buttons_metabox' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1127 | - add_meta_box( 'edit-reg-details-mbox', __( 'Registration Details', 'event_espresso' ), array( $this, '_reg_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1128 | - if ( $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox' ) ) { |
|
1129 | - add_meta_box( 'edit-reg-questions-mbox', __( 'Registration Form Answers', 'event_espresso' ), array( $this, '_reg_questions_meta_box' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1126 | + add_meta_box('edit-reg-status-mbox', __('Registration Status', 'event_espresso'), array($this, 'set_reg_status_buttons_metabox'), $this->wp_page_slug, 'normal', 'high'); |
|
1127 | + add_meta_box('edit-reg-details-mbox', __('Registration Details', 'event_espresso'), array($this, '_reg_details_meta_box'), $this->wp_page_slug, 'normal', 'high'); |
|
1128 | + if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox')) { |
|
1129 | + add_meta_box('edit-reg-questions-mbox', __('Registration Form Answers', 'event_espresso'), array($this, '_reg_questions_meta_box'), $this->wp_page_slug, 'normal', 'high'); |
|
1130 | 1130 | } |
1131 | - add_meta_box( 'edit-reg-registrant-mbox', __( 'Contact Details', 'event_espresso' ), array( $this, '_reg_registrant_side_meta_box' ), $this->wp_page_slug, 'side', 'high' ); |
|
1132 | - if ( $this->_registration->group_size() > 1 ) { |
|
1133 | - add_meta_box( 'edit-reg-attendees-mbox', __( 'Other Registrations in this Transaction', 'event_espresso' ), array( $this, '_reg_attendees_meta_box' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1131 | + add_meta_box('edit-reg-registrant-mbox', __('Contact Details', 'event_espresso'), array($this, '_reg_registrant_side_meta_box'), $this->wp_page_slug, 'side', 'high'); |
|
1132 | + if ($this->_registration->group_size() > 1) { |
|
1133 | + add_meta_box('edit-reg-attendees-mbox', __('Other Registrations in this Transaction', 'event_espresso'), array($this, '_reg_attendees_meta_box'), $this->wp_page_slug, 'normal', 'high'); |
|
1134 | 1134 | } |
1135 | 1135 | } |
1136 | 1136 | |
@@ -1151,23 +1151,23 @@ discard block |
||
1151 | 1151 | |
1152 | 1152 | //let's get an array of all possible buttons that we can just reference |
1153 | 1153 | $status_buttons = $this->_get_reg_status_buttons(); |
1154 | - $template_args[ 'reg_status_value' ] = $this->_registration->pretty_status(); |
|
1155 | - $template_args[ 'reg_status_class' ] = 'status-' . $this->_registration->status_ID(); |
|
1154 | + $template_args['reg_status_value'] = $this->_registration->pretty_status(); |
|
1155 | + $template_args['reg_status_class'] = 'status-'.$this->_registration->status_ID(); |
|
1156 | 1156 | $template_args['attendee'] = $this->_registration->attendee(); |
1157 | - $template = REG_TEMPLATE_PATH . 'reg_status_change_buttons.template.php'; |
|
1158 | - if ( $this->_set_registration_object() ) { |
|
1157 | + $template = REG_TEMPLATE_PATH.'reg_status_change_buttons.template.php'; |
|
1158 | + if ($this->_set_registration_object()) { |
|
1159 | 1159 | $current_status = $this->_registration->status_ID(); |
1160 | - unset( $status_buttons[$current_status] ); |
|
1161 | - if ( $current_status != EEM_Registration::status_id_pending_payment && $is_complete ) { |
|
1162 | - unset( $status_buttons[EEM_Registration::status_id_pending_payment] ); |
|
1160 | + unset($status_buttons[$current_status]); |
|
1161 | + if ($current_status != EEM_Registration::status_id_pending_payment && $is_complete) { |
|
1162 | + unset($status_buttons[EEM_Registration::status_id_pending_payment]); |
|
1163 | 1163 | } |
1164 | - $template_args['status_buttons'] = implode( "\n", $status_buttons ); |
|
1164 | + $template_args['status_buttons'] = implode("\n", $status_buttons); |
|
1165 | 1165 | } |
1166 | 1166 | $template_args['form_url'] = REG_ADMIN_URL; |
1167 | 1167 | $template_args['REG_ID'] = $this->_registration->ID(); |
1168 | - $template_args['nonce'] = wp_nonce_field( 'change_reg_status_nonce', 'change_reg_status_nonce', FALSE, FALSE ); |
|
1168 | + $template_args['nonce'] = wp_nonce_field('change_reg_status_nonce', 'change_reg_status_nonce', FALSE, FALSE); |
|
1169 | 1169 | |
1170 | - EEH_Template::display_template( $template, $template_args ); |
|
1170 | + EEH_Template::display_template($template, $template_args); |
|
1171 | 1171 | |
1172 | 1172 | } |
1173 | 1173 | |
@@ -1181,11 +1181,11 @@ discard block |
||
1181 | 1181 | private function _get_reg_status_buttons() { |
1182 | 1182 | |
1183 | 1183 | $buttons = array( |
1184 | - EEM_Registration::status_id_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_approved . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) . '">', |
|
1185 | - EEM_Registration::status_id_pending_payment => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_pending_payment . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ) . '">', |
|
1186 | - EEM_Registration::status_id_not_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_not_approved . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ) . '">', |
|
1187 | - EEM_Registration::status_id_declined => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_declined . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' ) . '">', |
|
1188 | - EEM_Registration::status_id_cancelled =>'<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_cancelled . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' ) . '">', |
|
1184 | + EEM_Registration::status_id_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_approved.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence').'">', |
|
1185 | + EEM_Registration::status_id_pending_payment => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_pending_payment.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence').'">', |
|
1186 | + EEM_Registration::status_id_not_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_not_approved.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence').'">', |
|
1187 | + EEM_Registration::status_id_declined => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_declined.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence').'">', |
|
1188 | + EEM_Registration::status_id_cancelled =>'<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_cancelled.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence').'">', |
|
1189 | 1189 | ); |
1190 | 1190 | return $buttons; |
1191 | 1191 | } |
@@ -1199,13 +1199,13 @@ discard block |
||
1199 | 1199 | * |
1200 | 1200 | * @return array (array with reg_id(s) updated and whether update was successful. |
1201 | 1201 | */ |
1202 | - protected function _set_registration_status_from_request( $status = false, $notify = false ) { |
|
1203 | - $REG_ID = isset( $this->_req_data['_REG_ID'] ) ? (array) $this->_req_data['_REG_ID'] : array(); |
|
1202 | + protected function _set_registration_status_from_request($status = false, $notify = false) { |
|
1203 | + $REG_ID = isset($this->_req_data['_REG_ID']) ? (array) $this->_req_data['_REG_ID'] : array(); |
|
1204 | 1204 | |
1205 | - $success = $this->_set_registration_status( $REG_ID, $status ); |
|
1205 | + $success = $this->_set_registration_status($REG_ID, $status); |
|
1206 | 1206 | |
1207 | 1207 | //notify? |
1208 | - if ( $success && $notify && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) { |
|
1208 | + if ($success && $notify && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) { |
|
1209 | 1209 | $this->_process_resend_registration(); |
1210 | 1210 | } |
1211 | 1211 | |
@@ -1223,19 +1223,19 @@ discard block |
||
1223 | 1223 | * @param bool $status |
1224 | 1224 | * @return array (an array with 'success' key representing whether status change was successful, and 'REG_ID' as the array of updated registrations). |
1225 | 1225 | */ |
1226 | - protected function _set_registration_status( $REG_ID, $status = false ) { |
|
1226 | + protected function _set_registration_status($REG_ID, $status = false) { |
|
1227 | 1227 | $success = true; |
1228 | 1228 | // set default status if none is passed |
1229 | 1229 | $status = $status ? $status : EEM_Registration::status_id_pending_payment; |
1230 | 1230 | |
1231 | 1231 | //typecast and sanitize reg_id |
1232 | - $reg_ids = array_filter( (array) $REG_ID, 'absint' ); |
|
1232 | + $reg_ids = array_filter((array) $REG_ID, 'absint'); |
|
1233 | 1233 | |
1234 | 1234 | //loop through REG_ID's and change status |
1235 | - foreach ( $reg_ids as $r_id ) { |
|
1236 | - $registration = EEM_Registration::instance()->get_one_by_ID( $r_id ); |
|
1237 | - if ( $registration instanceof EE_Registration ) { |
|
1238 | - $registration->set_status( $status ); |
|
1235 | + foreach ($reg_ids as $r_id) { |
|
1236 | + $registration = EEM_Registration::instance()->get_one_by_ID($r_id); |
|
1237 | + if ($registration instanceof EE_Registration) { |
|
1238 | + $registration->set_status($status); |
|
1239 | 1239 | $result = $registration->save(); |
1240 | 1240 | |
1241 | 1241 | //verifying explicit fails because update *may* just return 0 for 0 rows affected |
@@ -1247,7 +1247,7 @@ discard block |
||
1247 | 1247 | $this->_req_data['_REG_ID'] = $reg_ids; |
1248 | 1248 | |
1249 | 1249 | //return $success and processed registrations |
1250 | - return array( 'REG_ID' => $reg_ids, 'success' => $success ); |
|
1250 | + return array('REG_ID' => $reg_ids, 'success' => $success); |
|
1251 | 1251 | } |
1252 | 1252 | |
1253 | 1253 | |
@@ -1259,37 +1259,37 @@ discard block |
||
1259 | 1259 | * @param bool $notify indicates whether the _set_registration_status_from_request does notifications or not. |
1260 | 1260 | * @return void |
1261 | 1261 | */ |
1262 | - protected function _reg_status_change_return( $STS_ID, $notify = false ) { |
|
1262 | + protected function _reg_status_change_return($STS_ID, $notify = false) { |
|
1263 | 1263 | |
1264 | - $result = ! empty( $STS_ID ) ? $this->_set_registration_status_from_request( $STS_ID, $notify ) : array( 'success' => false ); |
|
1264 | + $result = ! empty($STS_ID) ? $this->_set_registration_status_from_request($STS_ID, $notify) : array('success' => false); |
|
1265 | 1265 | |
1266 | 1266 | |
1267 | - $success = isset( $result['success'] ) && $result['success']; |
|
1267 | + $success = isset($result['success']) && $result['success']; |
|
1268 | 1268 | |
1269 | 1269 | //setup success message |
1270 | - if ( $success ) { |
|
1271 | - $msg = is_array( $result['REG_ID'] ) && count( $result['REG_ID'] ) > 1 ? sprintf( __('Registration status has been set to %s', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower' ) ) : sprintf( __('Registrations have been set to %s.', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower' ) ) ; |
|
1272 | - EE_Error::add_success( $msg ); |
|
1270 | + if ($success) { |
|
1271 | + $msg = is_array($result['REG_ID']) && count($result['REG_ID']) > 1 ? sprintf(__('Registration status has been set to %s', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower')) : sprintf(__('Registrations have been set to %s.', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower')); |
|
1272 | + EE_Error::add_success($msg); |
|
1273 | 1273 | } else { |
1274 | - EE_Error::add_error( __('Something went wrong, and the status was not changed', 'event_espresso' ), __FILE__, __LINE__, __FUNCTION__ ); |
|
1274 | + EE_Error::add_error(__('Something went wrong, and the status was not changed', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__); |
|
1275 | 1275 | } |
1276 | 1276 | |
1277 | - $route = isset( $this->_req_data['return'] ) && $this->_req_data['return'] == 'view_registration' ? array( 'action' => 'view_registration', '_REG_ID' => $result['REG_ID'][0] ) : array( 'action' => 'default' ); |
|
1277 | + $route = isset($this->_req_data['return']) && $this->_req_data['return'] == 'view_registration' ? array('action' => 'view_registration', '_REG_ID' => $result['REG_ID'][0]) : array('action' => 'default'); |
|
1278 | 1278 | //unset nonces |
1279 | - foreach ( $this->_req_data as $ref => $value ) { |
|
1280 | - if ( strpos( $ref, 'nonce' ) !== false ) { |
|
1281 | - unset( $this->_req_data[$ref] ); |
|
1279 | + foreach ($this->_req_data as $ref => $value) { |
|
1280 | + if (strpos($ref, 'nonce') !== false) { |
|
1281 | + unset($this->_req_data[$ref]); |
|
1282 | 1282 | continue; |
1283 | 1283 | } |
1284 | 1284 | |
1285 | - $value = is_array( $value ) ? array_map( 'urlencode', $value ) : urlencode( $value ); |
|
1285 | + $value = is_array($value) ? array_map('urlencode', $value) : urlencode($value); |
|
1286 | 1286 | $this->_req_data[$ref] = $value; |
1287 | 1287 | } |
1288 | 1288 | |
1289 | 1289 | //merge request vars so that the reloaded list table contains any existing filter query params |
1290 | - $route = array_merge( $this->_req_data, $route ); |
|
1290 | + $route = array_merge($this->_req_data, $route); |
|
1291 | 1291 | |
1292 | - $this->_redirect_after_action( $success, '', '', $route, true ); |
|
1292 | + $this->_redirect_after_action($success, '', '', $route, true); |
|
1293 | 1293 | |
1294 | 1294 | } |
1295 | 1295 | |
@@ -1302,29 +1302,29 @@ discard block |
||
1302 | 1302 | protected function _change_reg_status() { |
1303 | 1303 | $this->_req_data['return'] = 'view_registration'; |
1304 | 1304 | //set notify based on whether the send notifications toggle is set or not |
1305 | - $notify = ! empty( $this->_req_data['txn_reg_status_change']['send_notifications'] ); |
|
1306 | - $this->_req_data[ '_reg_status_id' ] = isset( $this->_req_data[ '_reg_status_id' ] ) ? $this->_req_data[ '_reg_status_id' ] : ''; |
|
1305 | + $notify = ! empty($this->_req_data['txn_reg_status_change']['send_notifications']); |
|
1306 | + $this->_req_data['_reg_status_id'] = isset($this->_req_data['_reg_status_id']) ? $this->_req_data['_reg_status_id'] : ''; |
|
1307 | 1307 | |
1308 | - switch ( $this->_req_data['_reg_status_id'] ) { |
|
1309 | - case EEH_Template::pretty_status( EEM_Registration::status_id_approved, false, 'sentence' ) : |
|
1310 | - $this->approve_registration( $notify ); |
|
1308 | + switch ($this->_req_data['_reg_status_id']) { |
|
1309 | + case EEH_Template::pretty_status(EEM_Registration::status_id_approved, false, 'sentence') : |
|
1310 | + $this->approve_registration($notify); |
|
1311 | 1311 | break; |
1312 | - case EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, false, 'sentence' ) : |
|
1313 | - $this->pending_registration( $notify ); |
|
1312 | + case EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, false, 'sentence') : |
|
1313 | + $this->pending_registration($notify); |
|
1314 | 1314 | break; |
1315 | - case EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, false, 'sentence' ) : |
|
1316 | - $this->not_approve_registration( $notify ); |
|
1315 | + case EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, false, 'sentence') : |
|
1316 | + $this->not_approve_registration($notify); |
|
1317 | 1317 | break; |
1318 | - case EEH_Template::pretty_status( EEM_Registration::status_id_declined, false, 'sentence' ) : |
|
1319 | - $this->decline_registration( $notify ); |
|
1318 | + case EEH_Template::pretty_status(EEM_Registration::status_id_declined, false, 'sentence') : |
|
1319 | + $this->decline_registration($notify); |
|
1320 | 1320 | break; |
1321 | - case EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, false, 'sentence' ) : |
|
1322 | - $this->cancel_registration( $notify ); |
|
1321 | + case EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, false, 'sentence') : |
|
1322 | + $this->cancel_registration($notify); |
|
1323 | 1323 | break; |
1324 | 1324 | default : |
1325 | 1325 | $result['success'] = false; |
1326 | - unset( $this->_req_data['return'] ); |
|
1327 | - $this->_reg_status_change_return( '', false ); |
|
1326 | + unset($this->_req_data['return']); |
|
1327 | + $this->_reg_status_change_return('', false); |
|
1328 | 1328 | break; |
1329 | 1329 | } |
1330 | 1330 | } |
@@ -1337,8 +1337,8 @@ discard block |
||
1337 | 1337 | * @param bool $notify whether or not to notify the registrant about their approval. |
1338 | 1338 | * @return void |
1339 | 1339 | */ |
1340 | - protected function approve_registration( $notify = false ) { |
|
1341 | - $this->_reg_status_change_return( EEM_Registration::status_id_approved, $notify ); |
|
1340 | + protected function approve_registration($notify = false) { |
|
1341 | + $this->_reg_status_change_return(EEM_Registration::status_id_approved, $notify); |
|
1342 | 1342 | } |
1343 | 1343 | |
1344 | 1344 | |
@@ -1350,8 +1350,8 @@ discard block |
||
1350 | 1350 | * @param bool $notify whether or not to notify the registrant about their approval. |
1351 | 1351 | * @return void |
1352 | 1352 | */ |
1353 | - protected function decline_registration( $notify = false ) { |
|
1354 | - $this->_reg_status_change_return( EEM_Registration::status_id_declined, $notify ); |
|
1353 | + protected function decline_registration($notify = false) { |
|
1354 | + $this->_reg_status_change_return(EEM_Registration::status_id_declined, $notify); |
|
1355 | 1355 | } |
1356 | 1356 | |
1357 | 1357 | |
@@ -1363,8 +1363,8 @@ discard block |
||
1363 | 1363 | * @param bool $notify whether or not to notify the registrant about their approval. |
1364 | 1364 | * @return void |
1365 | 1365 | */ |
1366 | - protected function cancel_registration( $notify = false ) { |
|
1367 | - $this->_reg_status_change_return( EEM_Registration::status_id_cancelled, $notify ); |
|
1366 | + protected function cancel_registration($notify = false) { |
|
1367 | + $this->_reg_status_change_return(EEM_Registration::status_id_cancelled, $notify); |
|
1368 | 1368 | } |
1369 | 1369 | |
1370 | 1370 | |
@@ -1377,8 +1377,8 @@ discard block |
||
1377 | 1377 | * @param bool $notify whether or not to notify the registrant about their approval. |
1378 | 1378 | * @return void |
1379 | 1379 | */ |
1380 | - protected function not_approve_registration( $notify = false ) { |
|
1381 | - $this->_reg_status_change_return( EEM_Registration::status_id_not_approved, $notify ); |
|
1380 | + protected function not_approve_registration($notify = false) { |
|
1381 | + $this->_reg_status_change_return(EEM_Registration::status_id_not_approved, $notify); |
|
1382 | 1382 | } |
1383 | 1383 | |
1384 | 1384 | |
@@ -1389,8 +1389,8 @@ discard block |
||
1389 | 1389 | * @param bool $notify whether or not to notify the registrant about their approval. |
1390 | 1390 | * @return void |
1391 | 1391 | */ |
1392 | - protected function pending_registration( $notify = false ) { |
|
1393 | - $this->_reg_status_change_return( EEM_Registration::status_id_pending_payment, $notify ); |
|
1392 | + protected function pending_registration($notify = false) { |
|
1393 | + $this->_reg_status_change_return(EEM_Registration::status_id_pending_payment, $notify); |
|
1394 | 1394 | } |
1395 | 1395 | |
1396 | 1396 | |
@@ -1404,75 +1404,75 @@ discard block |
||
1404 | 1404 | public function _reg_details_meta_box() { |
1405 | 1405 | EEH_Autoloader::register_line_item_display_autoloaders(); |
1406 | 1406 | EEH_Autoloader::register_line_item_filter_autoloaders(); |
1407 | - EE_Registry::instance()->load_Helper( 'Line_Item' ); |
|
1407 | + EE_Registry::instance()->load_Helper('Line_Item'); |
|
1408 | 1408 | $transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance(); |
1409 | 1409 | $this->_session = $transaction->session_data(); |
1410 | 1410 | |
1411 | 1411 | $filters = new EE_Line_Item_Filter_Collection(); |
1412 | - $filters->add( new EE_Single_Registration_Line_Item_Filter( $this->_registration ) ); |
|
1413 | - $filters->add( new EE_Non_Zero_Line_Item_Filter() ); |
|
1414 | - $line_item_filter_processor = new EE_Line_Item_Filter_Processor( $filters, $transaction->total_line_item() ); |
|
1412 | + $filters->add(new EE_Single_Registration_Line_Item_Filter($this->_registration)); |
|
1413 | + $filters->add(new EE_Non_Zero_Line_Item_Filter()); |
|
1414 | + $line_item_filter_processor = new EE_Line_Item_Filter_Processor($filters, $transaction->total_line_item()); |
|
1415 | 1415 | $filtered_line_item_tree = $line_item_filter_processor->process(); |
1416 | 1416 | |
1417 | 1417 | $this->_template_args['REG_ID'] = $this->_registration->ID(); |
1418 | - $line_item_display = new EE_Line_Item_Display( 'reg_admin_table', 'EE_Admin_Table_Registration_Line_Item_Display_Strategy' ); |
|
1419 | - $this->_template_args['line_item_table'] = $line_item_display->display_line_item( $filtered_line_item_tree, array( 'EE_Registration' => $this->_registration ) ); |
|
1418 | + $line_item_display = new EE_Line_Item_Display('reg_admin_table', 'EE_Admin_Table_Registration_Line_Item_Display_Strategy'); |
|
1419 | + $this->_template_args['line_item_table'] = $line_item_display->display_line_item($filtered_line_item_tree, array('EE_Registration' => $this->_registration)); |
|
1420 | 1420 | |
1421 | 1421 | |
1422 | 1422 | $attendee = $this->_registration->attendee(); |
1423 | 1423 | |
1424 | 1424 | |
1425 | - $this->_template_args['view_transaction_button'] = EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction' ) ?EEH_Template::get_button_or_link( EE_Admin_Page::add_query_args_and_nonce( array('action'=> 'view_transaction', 'TXN_ID' => $transaction->ID() ), TXN_ADMIN_URL ), __(' View Transaction'), 'button secondary-button right', 'dashicons dashicons-cart' ) : ''; |
|
1426 | - $this->_template_args['resend_registration_button'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ?EEH_Template::get_button_or_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'resend_registration', '_REG_ID'=>$this->_registration->ID(), 'redirect_to' => 'view_registration' ), REG_ADMIN_URL ), __(' Resend Registration'), 'button secondary-button right', 'dashicons dashicons-email-alt' ) : ''; |
|
1425 | + $this->_template_args['view_transaction_button'] = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action'=> 'view_transaction', 'TXN_ID' => $transaction->ID()), TXN_ADMIN_URL), __(' View Transaction'), 'button secondary-button right', 'dashicons dashicons-cart') : ''; |
|
1426 | + $this->_template_args['resend_registration_button'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration') ? EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action'=>'resend_registration', '_REG_ID'=>$this->_registration->ID(), 'redirect_to' => 'view_registration'), REG_ADMIN_URL), __(' Resend Registration'), 'button secondary-button right', 'dashicons dashicons-email-alt') : ''; |
|
1427 | 1427 | |
1428 | 1428 | |
1429 | 1429 | $this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign; |
1430 | - $payment = $transaction->get_first_related( 'Payment' ); |
|
1430 | + $payment = $transaction->get_first_related('Payment'); |
|
1431 | 1431 | $payment = ! $payment instanceof EE_Payment ? EE_Payment::new_instance() : $payment; |
1432 | - $payment_method = $payment->get_first_related( 'Payment_Method' ); |
|
1432 | + $payment_method = $payment->get_first_related('Payment_Method'); |
|
1433 | 1433 | $payment_method = ! $payment_method instanceof EE_Payment_Method ? EE_Payment_Method::new_instance() : $payment_method; |
1434 | - $reg_status_class = 'status-' . $this->_registration->status_ID(); |
|
1434 | + $reg_status_class = 'status-'.$this->_registration->status_ID(); |
|
1435 | 1435 | $reg_details = array( |
1436 | 1436 | 'payment_method' => $payment_method->name(), |
1437 | 1437 | 'response_msg' => $payment->gateway_response(), |
1438 | - 'registration_id' => $this->_registration->get( 'REG_code' ), |
|
1438 | + 'registration_id' => $this->_registration->get('REG_code'), |
|
1439 | 1439 | 'registration_session' => $this->_registration->session_ID(), |
1440 | - 'ip_address' => isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '', |
|
1441 | - 'user_agent' => isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '', |
|
1440 | + 'ip_address' => isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '', |
|
1441 | + 'user_agent' => isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '', |
|
1442 | 1442 | ); |
1443 | 1443 | |
1444 | 1444 | |
1445 | - if ( isset( $reg_details['registration_id'] )) { |
|
1445 | + if (isset($reg_details['registration_id'])) { |
|
1446 | 1446 | $this->_template_args['reg_details']['registration_id']['value'] = $reg_details['registration_id']; |
1447 | - $this->_template_args['reg_details']['registration_id']['label'] = __( 'Registration ID', 'event_espresso' ); |
|
1447 | + $this->_template_args['reg_details']['registration_id']['label'] = __('Registration ID', 'event_espresso'); |
|
1448 | 1448 | $this->_template_args['reg_details']['registration_id']['class'] = 'regular-text'; |
1449 | 1449 | } |
1450 | 1450 | |
1451 | - if ( isset( $reg_details['payment_method'] ) ) { |
|
1451 | + if (isset($reg_details['payment_method'])) { |
|
1452 | 1452 | $this->_template_args['reg_details']['payment_method']['value'] = $reg_details['payment_method']; |
1453 | - $this->_template_args['reg_details']['payment_method']['label'] = __( 'Most Recent Payment Method', 'event_espresso' ); |
|
1453 | + $this->_template_args['reg_details']['payment_method']['label'] = __('Most Recent Payment Method', 'event_espresso'); |
|
1454 | 1454 | $this->_template_args['reg_details']['payment_method']['class'] = 'regular-text'; |
1455 | 1455 | $this->_template_args['reg_details']['response_msg']['value'] = $reg_details['response_msg']; |
1456 | - $this->_template_args['reg_details']['response_msg']['label'] = __( 'Payment method response', 'event_espresso' ); |
|
1456 | + $this->_template_args['reg_details']['response_msg']['label'] = __('Payment method response', 'event_espresso'); |
|
1457 | 1457 | $this->_template_args['reg_details']['response_msg']['class'] = 'regular-text'; |
1458 | 1458 | } |
1459 | 1459 | |
1460 | 1460 | $this->_template_args['reg_details']['registration_session']['value'] = $reg_details['registration_session']; |
1461 | - $this->_template_args['reg_details']['registration_session']['label'] = __( 'Registration Session', 'event_espresso' ); |
|
1461 | + $this->_template_args['reg_details']['registration_session']['label'] = __('Registration Session', 'event_espresso'); |
|
1462 | 1462 | $this->_template_args['reg_details']['registration_session']['class'] = 'regular-text'; |
1463 | 1463 | |
1464 | 1464 | $this->_template_args['reg_details']['ip_address']['value'] = $reg_details['ip_address']; |
1465 | - $this->_template_args['reg_details']['ip_address']['label'] = __( 'Registration placed from IP', 'event_espresso' ); |
|
1465 | + $this->_template_args['reg_details']['ip_address']['label'] = __('Registration placed from IP', 'event_espresso'); |
|
1466 | 1466 | $this->_template_args['reg_details']['ip_address']['class'] = 'regular-text'; |
1467 | 1467 | |
1468 | 1468 | $this->_template_args['reg_details']['user_agent']['value'] = $reg_details['user_agent']; |
1469 | - $this->_template_args['reg_details']['user_agent']['label'] = __( 'Registrant User Agent', 'event_espresso' ); |
|
1469 | + $this->_template_args['reg_details']['user_agent']['label'] = __('Registrant User Agent', 'event_espresso'); |
|
1470 | 1470 | $this->_template_args['reg_details']['user_agent']['class'] = 'large-text'; |
1471 | 1471 | |
1472 | - $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'event_id' => $this->_registration->event_ID()), REG_ADMIN_URL ); |
|
1472 | + $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $this->_registration->event_ID()), REG_ADMIN_URL); |
|
1473 | 1473 | |
1474 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_details.template.php'; |
|
1475 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1474 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_details.template.php'; |
|
1475 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1476 | 1476 | |
1477 | 1477 | } |
1478 | 1478 | |
@@ -1488,23 +1488,23 @@ discard block |
||
1488 | 1488 | */ |
1489 | 1489 | public function _reg_questions_meta_box() { |
1490 | 1490 | |
1491 | - add_filter( 'FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', array( $this, 'form_before_question_group' ), 10, 1 ); |
|
1492 | - add_filter( 'FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', array( $this, 'form_after_question_group' ), 10, 1 ); |
|
1493 | - add_filter( 'FHEE__EEH_Form_Fields__label_html', array( $this, 'form_form_field_label_wrap' ), 10, 1 ); |
|
1494 | - add_filter( 'FHEE__EEH_Form_Fields__input_html', array( $this, 'form_form_field_input__wrap' ), 10, 1 ); |
|
1491 | + add_filter('FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', array($this, 'form_before_question_group'), 10, 1); |
|
1492 | + add_filter('FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', array($this, 'form_after_question_group'), 10, 1); |
|
1493 | + add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'form_form_field_label_wrap'), 10, 1); |
|
1494 | + add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'form_form_field_input__wrap'), 10, 1); |
|
1495 | 1495 | |
1496 | - $question_groups = EEM_Event::instance()->assemble_array_of_groups_questions_and_options( $this->_registration, $this->_registration->get('EVT_ID') ); |
|
1496 | + $question_groups = EEM_Event::instance()->assemble_array_of_groups_questions_and_options($this->_registration, $this->_registration->get('EVT_ID')); |
|
1497 | 1497 | |
1498 | 1498 | //EEH_Debug_Tools::printr( $question_groups, '$question_groups <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
1499 | 1499 | |
1500 | - EE_Registry::instance()->load_helper( 'Form_Fields' ); |
|
1501 | - $this->_template_args['att_questions'] = EEH_Form_Fields::generate_question_groups_html( $question_groups ); |
|
1500 | + EE_Registry::instance()->load_helper('Form_Fields'); |
|
1501 | + $this->_template_args['att_questions'] = EEH_Form_Fields::generate_question_groups_html($question_groups); |
|
1502 | 1502 | |
1503 | 1503 | $this->_template_args['reg_questions_form_action'] = 'update_attendee_registration_form'; |
1504 | 1504 | $this->_template_args['REG_ID'] = $this->_registration->ID(); |
1505 | 1505 | |
1506 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_questions.template.php'; |
|
1507 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1506 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_questions.template.php'; |
|
1507 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1508 | 1508 | |
1509 | 1509 | } |
1510 | 1510 | |
@@ -1519,7 +1519,7 @@ discard block |
||
1519 | 1519 | * @param string $output |
1520 | 1520 | * @return string |
1521 | 1521 | */ |
1522 | - public function form_before_question_group( $output ) { |
|
1522 | + public function form_before_question_group($output) { |
|
1523 | 1523 | return ' |
1524 | 1524 | <table class="form-table ee-width-100"> |
1525 | 1525 | <tbody> |
@@ -1536,13 +1536,13 @@ discard block |
||
1536 | 1536 | * @param string $output |
1537 | 1537 | * @return string |
1538 | 1538 | */ |
1539 | - public function form_after_question_group( $output ) { |
|
1539 | + public function form_after_question_group($output) { |
|
1540 | 1540 | return ' |
1541 | 1541 | <tr class="hide-if-no-js"> |
1542 | 1542 | <th> </th> |
1543 | 1543 | <td class="reg-admin-edit-attendee-question-td"> |
1544 | - <a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__( 'click to edit question', 'event_espresso' ) . '"> |
|
1545 | - <span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __( 'edit the above question group', 'event_espresso' ) . '</span> |
|
1544 | + <a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__('click to edit question', 'event_espresso').'"> |
|
1545 | + <span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __('edit the above question group', 'event_espresso').'</span> |
|
1546 | 1546 | <div class="dashicons dashicons-edit"></div> |
1547 | 1547 | </a> |
1548 | 1548 | </td> |
@@ -1562,11 +1562,11 @@ discard block |
||
1562 | 1562 | * @param string $label |
1563 | 1563 | * @return string |
1564 | 1564 | */ |
1565 | - public function form_form_field_label_wrap( $label ) { |
|
1565 | + public function form_form_field_label_wrap($label) { |
|
1566 | 1566 | return ' |
1567 | 1567 | <tr> |
1568 | 1568 | <th> |
1569 | - ' . $label . ' |
|
1569 | + ' . $label.' |
|
1570 | 1570 | </th>'; |
1571 | 1571 | } |
1572 | 1572 | |
@@ -1580,10 +1580,10 @@ discard block |
||
1580 | 1580 | * @param string $label |
1581 | 1581 | * @return string |
1582 | 1582 | */ |
1583 | - public function form_form_field_input__wrap( $input ) { |
|
1583 | + public function form_form_field_input__wrap($input) { |
|
1584 | 1584 | return ' |
1585 | 1585 | <td class="reg-admin-attendee-questions-input-td disabled-input"> |
1586 | - ' . $input . ' |
|
1586 | + ' . $input.' |
|
1587 | 1587 | </td> |
1588 | 1588 | </tr>'; |
1589 | 1589 | } |
@@ -1597,13 +1597,13 @@ discard block |
||
1597 | 1597 | * @return void |
1598 | 1598 | */ |
1599 | 1599 | protected function _update_attendee_registration_form() { |
1600 | - $qstns = isset( $this->_req_data['qstn'] ) ? $this->_req_data['qstn'] : FALSE; |
|
1601 | - $REG_ID = isset( $this->_req_data['_REG_ID'] ) ? absint( $this->_req_data['_REG_ID'] ) : FALSE; |
|
1602 | - $qstns = apply_filters( 'FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns', $qstns ); |
|
1603 | - $success = $this->_save_attendee_registration_form( $REG_ID, $qstns ); |
|
1600 | + $qstns = isset($this->_req_data['qstn']) ? $this->_req_data['qstn'] : FALSE; |
|
1601 | + $REG_ID = isset($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : FALSE; |
|
1602 | + $qstns = apply_filters('FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns', $qstns); |
|
1603 | + $success = $this->_save_attendee_registration_form($REG_ID, $qstns); |
|
1604 | 1604 | $what = __('Registration Form', 'event_espresso'); |
1605 | - $route = $REG_ID ? array( 'action' => 'view_registration', '_REG_ID' => $REG_ID ) : array( 'action' => 'default' ); |
|
1606 | - $this->_redirect_after_action( $success, $what, __('updated', 'event_espresso'), $route ); |
|
1605 | + $route = $REG_ID ? array('action' => 'view_registration', '_REG_ID' => $REG_ID) : array('action' => 'default'); |
|
1606 | + $this->_redirect_after_action($success, $what, __('updated', 'event_espresso'), $route); |
|
1607 | 1607 | |
1608 | 1608 | } |
1609 | 1609 | |
@@ -1616,26 +1616,26 @@ discard block |
||
1616 | 1616 | * @param bool $qstns |
1617 | 1617 | * @return bool |
1618 | 1618 | */ |
1619 | - private function _save_attendee_registration_form( $REG_ID = FALSE, $qstns = FALSE ) { |
|
1619 | + private function _save_attendee_registration_form($REG_ID = FALSE, $qstns = FALSE) { |
|
1620 | 1620 | |
1621 | - if ( ! $REG_ID || ! $qstns ) { |
|
1622 | - EE_Error::add_error( __('An error occurred. No registration ID and/or registration questions were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
1621 | + if ( ! $REG_ID || ! $qstns) { |
|
1622 | + EE_Error::add_error(__('An error occurred. No registration ID and/or registration questions were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1623 | 1623 | } |
1624 | 1624 | $success = TRUE; |
1625 | 1625 | |
1626 | 1626 | // allow others to get in on this awesome fun :D |
1627 | - do_action( 'AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save', $REG_ID, $qstns ); |
|
1627 | + do_action('AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save', $REG_ID, $qstns); |
|
1628 | 1628 | // loop thru questions... FINALLY!!! |
1629 | 1629 | |
1630 | - foreach ( $qstns as $QST_ID => $qstn ) { |
|
1630 | + foreach ($qstns as $QST_ID => $qstn) { |
|
1631 | 1631 | //if $qstn isn't an array then it doesn't already have an answer, so let's create the answer |
1632 | - if ( !is_array($qstn) ) { |
|
1633 | - $success = $this->_save_new_answer( $REG_ID, $QST_ID, $qstn); |
|
1632 | + if ( ! is_array($qstn)) { |
|
1633 | + $success = $this->_save_new_answer($REG_ID, $QST_ID, $qstn); |
|
1634 | 1634 | continue; |
1635 | 1635 | } |
1636 | 1636 | |
1637 | 1637 | |
1638 | - foreach ( $qstn as $ANS_ID => $ANS_value ) { |
|
1638 | + foreach ($qstn as $ANS_ID => $ANS_value) { |
|
1639 | 1639 | //get answer |
1640 | 1640 | $query_params = array( |
1641 | 1641 | 0 => array( |
@@ -1646,8 +1646,8 @@ discard block |
||
1646 | 1646 | ); |
1647 | 1647 | $answer = EEM_Answer::instance()->get_one($query_params); |
1648 | 1648 | //this MAY be an array but NOT have an answer because its multi select. If so then we need to create the answer |
1649 | - if ( ! $answer instanceof EE_Answer ) { |
|
1650 | - $success = $this->_save_new_answer( $REG_ID, $QST_ID, $qstn); |
|
1649 | + if ( ! $answer instanceof EE_Answer) { |
|
1650 | + $success = $this->_save_new_answer($REG_ID, $QST_ID, $qstn); |
|
1651 | 1651 | continue 2; |
1652 | 1652 | } |
1653 | 1653 | |
@@ -1661,7 +1661,7 @@ discard block |
||
1661 | 1661 | |
1662 | 1662 | |
1663 | 1663 | //TODO: try changing this to use the model directly... not indirectly through creating a default object... |
1664 | - private function _save_new_answer( $REG_ID, $QST_ID, $ans ) { |
|
1664 | + private function _save_new_answer($REG_ID, $QST_ID, $ans) { |
|
1665 | 1665 | $set_values = array( |
1666 | 1666 | 'QST_ID' => $QST_ID, |
1667 | 1667 | 'REG_ID' => $REG_ID, |
@@ -1688,30 +1688,30 @@ discard block |
||
1688 | 1688 | $registrations = $REG->get_all(array( |
1689 | 1689 | array( |
1690 | 1690 | 'TXN_ID'=>$this->_registration->transaction_ID(), |
1691 | - 'REG_ID'=>array('!=',$this->_registration->ID()) |
|
1691 | + 'REG_ID'=>array('!=', $this->_registration->ID()) |
|
1692 | 1692 | ), |
1693 | 1693 | 'force_join'=>array('Attendee'))); |
1694 | 1694 | |
1695 | 1695 | $this->_template_args['attendees'] = array(); |
1696 | 1696 | $this->_template_args['attendee_notice'] = ''; |
1697 | 1697 | EE_Registry::instance()->load_helper('Array'); |
1698 | - if ( empty( $registrations) || ( is_array($registrations) && ! EEH_Array::get_one_item_from_array($registrations) ) ) { |
|
1699 | - EE_Error::add_error( __('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
1698 | + if (empty($registrations) || (is_array($registrations) && ! EEH_Array::get_one_item_from_array($registrations))) { |
|
1699 | + EE_Error::add_error(__('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1700 | 1700 | $this->_template_args['attendee_notice'] = EE_Error::get_notices(); |
1701 | 1701 | } else { |
1702 | 1702 | |
1703 | 1703 | $att_nmbr = 1; |
1704 | - foreach ( $registrations as $registration ) { |
|
1704 | + foreach ($registrations as $registration) { |
|
1705 | 1705 | /* @var $registration EE_Registration */ |
1706 | 1706 | $attendee = $registration->attendee() ? $registration->attendee() : EEM_Attendee::instance()->create_default_object(); |
1707 | - $this->_template_args['attendees'][ $att_nmbr ]['fname'] = $attendee->fname();//( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : ''; |
|
1708 | - $this->_template_args['attendees'][ $att_nmbr ]['lname'] = $attendee->lname();//( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : ''; |
|
1709 | - $this->_template_args['attendees'][ $att_nmbr ]['email'] = $attendee->email();//( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : ''; |
|
1710 | - $this->_template_args['attendees'][ $att_nmbr ]['final_price'] = $registration->final_price();//( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : ''; |
|
1707 | + $this->_template_args['attendees'][$att_nmbr]['fname'] = $attendee->fname(); //( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : ''; |
|
1708 | + $this->_template_args['attendees'][$att_nmbr]['lname'] = $attendee->lname(); //( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : ''; |
|
1709 | + $this->_template_args['attendees'][$att_nmbr]['email'] = $attendee->email(); //( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : ''; |
|
1710 | + $this->_template_args['attendees'][$att_nmbr]['final_price'] = $registration->final_price(); //( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : ''; |
|
1711 | 1711 | |
1712 | - $this->_template_args['attendees'][ $att_nmbr ]['address'] = implode( ', ', $attendee->full_address_as_array() ); |
|
1712 | + $this->_template_args['attendees'][$att_nmbr]['address'] = implode(', ', $attendee->full_address_as_array()); |
|
1713 | 1713 | |
1714 | - $this->_template_args['attendees'][ $att_nmbr ]['att_link'] = self::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL ); |
|
1714 | + $this->_template_args['attendees'][$att_nmbr]['att_link'] = self::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL); |
|
1715 | 1715 | |
1716 | 1716 | $att_nmbr++; |
1717 | 1717 | } |
@@ -1723,8 +1723,8 @@ discard block |
||
1723 | 1723 | |
1724 | 1724 | // $this->_template_args['registration_form_url'] = add_query_arg( array( 'action' => 'edit_registration', 'process' => 'attendees' ), REG_ADMIN_URL ); |
1725 | 1725 | } |
1726 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_attendees.template.php'; |
|
1727 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1726 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_attendees.template.php'; |
|
1727 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1728 | 1728 | |
1729 | 1729 | } |
1730 | 1730 | |
@@ -1745,11 +1745,11 @@ discard block |
||
1745 | 1745 | $attendee = $att_check instanceof EE_Attendee ? $att_check : EEM_Attendee::instance()->create_default_object(); |
1746 | 1746 | |
1747 | 1747 | //now let's determine if this is not the primary registration. If it isn't then we set the primary_registration object for reference BUT ONLY if the Attendee object loaded is not the same as the primary registration object (that way we know if we need to show cereate button or not) |
1748 | - if ( ! $this->_registration->is_primary_registrant() ) { |
|
1748 | + if ( ! $this->_registration->is_primary_registrant()) { |
|
1749 | 1749 | $primary_registration = $this->_registration->get_primary_registration(); |
1750 | 1750 | $primary_attendee = $primary_registration->attendee(); |
1751 | 1751 | |
1752 | - if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID() ) { |
|
1752 | + if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID()) { |
|
1753 | 1753 | //in here? This means the displayed registration is not the primary registrant but ALREADY HAS its own custom attendee object so let's not worry about the primary reg. |
1754 | 1754 | $primary_registration = NULL; |
1755 | 1755 | } |
@@ -1758,28 +1758,28 @@ discard block |
||
1758 | 1758 | } |
1759 | 1759 | |
1760 | 1760 | $this->_template_args['ATT_ID'] = $attendee->ID(); |
1761 | - $this->_template_args['fname'] = $attendee->fname();//$this->_registration->ATT_fname; |
|
1762 | - $this->_template_args['lname'] = $attendee->lname();//$this->_registration->ATT_lname; |
|
1763 | - $this->_template_args['email'] = $attendee->email();//$this->_registration->ATT_email; |
|
1761 | + $this->_template_args['fname'] = $attendee->fname(); //$this->_registration->ATT_fname; |
|
1762 | + $this->_template_args['lname'] = $attendee->lname(); //$this->_registration->ATT_lname; |
|
1763 | + $this->_template_args['email'] = $attendee->email(); //$this->_registration->ATT_email; |
|
1764 | 1764 | $this->_template_args['phone'] = $attendee->phone(); |
1765 | 1765 | |
1766 | - EE_Registry::instance()->load_helper( 'Formatter' ); |
|
1767 | - $this->_template_args[ 'formatted_address' ] = EEH_Address::format( $attendee ); |
|
1766 | + EE_Registry::instance()->load_helper('Formatter'); |
|
1767 | + $this->_template_args['formatted_address'] = EEH_Address::format($attendee); |
|
1768 | 1768 | |
1769 | 1769 | |
1770 | 1770 | //edit link |
1771 | - $this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL ); |
|
1772 | - $this->_template_args['att_edit_label'] = __('View/Edit Contact' ); |
|
1771 | + $this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL); |
|
1772 | + $this->_template_args['att_edit_label'] = __('View/Edit Contact'); |
|
1773 | 1773 | |
1774 | 1774 | //create link |
1775 | - $this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'duplicate_attendee', '_REG_ID' => $this->_registration->ID() ), REG_ADMIN_URL ): ''; |
|
1775 | + $this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'duplicate_attendee', '_REG_ID' => $this->_registration->ID()), REG_ADMIN_URL) : ''; |
|
1776 | 1776 | $this->_template_args['create_label'] = __('Create Contact', 'event_espresso'); |
1777 | 1777 | |
1778 | 1778 | $this->_template_args['att_check'] = $att_check; |
1779 | 1779 | |
1780 | 1780 | |
1781 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_side_meta_box_registrant.template.php'; |
|
1782 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1781 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_side_meta_box_registrant.template.php'; |
|
1782 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1783 | 1783 | } |
1784 | 1784 | |
1785 | 1785 | |
@@ -1792,7 +1792,7 @@ discard block |
||
1792 | 1792 | * @access protected |
1793 | 1793 | * @return void |
1794 | 1794 | */ |
1795 | - protected function _trash_or_restore_registrations( $trash = TRUE ) { |
|
1795 | + protected function _trash_or_restore_registrations($trash = TRUE) { |
|
1796 | 1796 | $REGM = EEM_Registration::instance(); |
1797 | 1797 | |
1798 | 1798 | $success = 1; |
@@ -1802,26 +1802,26 @@ discard block |
||
1802 | 1802 | $dtts = array(); |
1803 | 1803 | |
1804 | 1804 | //if empty _REG_ID then get out because there's nothing to do |
1805 | - if ( empty( $this->_req_data['_REG_ID'] ) ) { |
|
1805 | + if (empty($this->_req_data['_REG_ID'])) { |
|
1806 | 1806 | $msg = $trash ? __('In order to trash registrations you must select which ones you wish to trash by clicking the checkboxes.', 'event_espresso') : __('In order to restore registrations you must select which ones you wish to restore by clicking the checkboxes.', 'event_espresso'); |
1807 | - EE_Error::add_error( $msg, __FILE__, __LINE__, __FUNCTION__ ); |
|
1808 | - $this->_redirect_after_action(FALSE, '', '', array(), TRUE ); |
|
1807 | + EE_Error::add_error($msg, __FILE__, __LINE__, __FUNCTION__); |
|
1808 | + $this->_redirect_after_action(FALSE, '', '', array(), TRUE); |
|
1809 | 1809 | } |
1810 | 1810 | |
1811 | 1811 | //Checkboxes |
1812 | - if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) { |
|
1812 | + if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) { |
|
1813 | 1813 | // if array has more than one element than success message should be plural |
1814 | - $success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1; |
|
1814 | + $success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1; |
|
1815 | 1815 | // cycle thru checkboxes |
1816 | - while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) { |
|
1816 | + while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) { |
|
1817 | 1817 | |
1818 | 1818 | $REG = $REGM->get_one_by_ID($REG_ID); |
1819 | 1819 | $payment_count = $REG->get_first_related('Transaction')->count_related('Payment'); |
1820 | - if ( $payment_count > 0 ) { |
|
1821 | - $name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __( 'Unknown Attendee', 'event_espresso' ); |
|
1820 | + if ($payment_count > 0) { |
|
1821 | + $name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __('Unknown Attendee', 'event_espresso'); |
|
1822 | 1822 | $error = 1; |
1823 | 1823 | $success = 0; |
1824 | - EE_Error::add_error( sprintf( __('The registration for %s could not be trashed because it has payments attached to the related transaction. If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name ), __FILE__, __FUNCTION__, __LINE__ ); |
|
1824 | + EE_Error::add_error(sprintf(__('The registration for %s could not be trashed because it has payments attached to the related transaction. If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name), __FILE__, __FUNCTION__, __LINE__); |
|
1825 | 1825 | continue; //can't trash this registration because it has payments. |
1826 | 1826 | } |
1827 | 1827 | $ticket = $REG->get_first_related('Ticket'); |
@@ -1830,7 +1830,7 @@ discard block |
||
1830 | 1830 | $dtts = array_merge($dtts, $dtt); |
1831 | 1831 | |
1832 | 1832 | $updated = $trash ? $REG->delete() : $REG->restore(); |
1833 | - if ( !$updated ) { |
|
1833 | + if ( ! $updated) { |
|
1834 | 1834 | $success = 0; |
1835 | 1835 | } else { |
1836 | 1836 | $success = 2; |
@@ -1845,7 +1845,7 @@ discard block |
||
1845 | 1845 | $tickets[$ticket->ID()] = $ticket; |
1846 | 1846 | $dtts = $ticket->get_many_related('Datetime'); |
1847 | 1847 | $updated = $trash ? $REG->delete() : $REG->restore(); |
1848 | - if ( ! $updated ) { |
|
1848 | + if ( ! $updated) { |
|
1849 | 1849 | $success = 0; |
1850 | 1850 | } |
1851 | 1851 | |
@@ -1855,10 +1855,10 @@ discard block |
||
1855 | 1855 | EEM_Ticket::instance()->update_tickets_sold($tickets); |
1856 | 1856 | EEM_Datetime::instance()->update_sold($dtts); |
1857 | 1857 | |
1858 | - $what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' ); |
|
1859 | - $action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' ); |
|
1858 | + $what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso'); |
|
1859 | + $action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso'); |
|
1860 | 1860 | $overwrite_msgs = $error ? TRUE : FALSE; |
1861 | - $this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), $overwrite_msgs ); |
|
1861 | + $this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), $overwrite_msgs); |
|
1862 | 1862 | } |
1863 | 1863 | |
1864 | 1864 | |
@@ -1882,16 +1882,16 @@ discard block |
||
1882 | 1882 | $success = 1; |
1883 | 1883 | |
1884 | 1884 | //Checkboxes |
1885 | - if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) { |
|
1885 | + if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) { |
|
1886 | 1886 | // if array has more than one element than success message should be plural |
1887 | - $success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1; |
|
1887 | + $success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1; |
|
1888 | 1888 | // cycle thru checkboxes |
1889 | - while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) { |
|
1889 | + while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) { |
|
1890 | 1890 | $REG = $REG_MDL->get_one_by_ID($REG_ID); |
1891 | - if ( ! $REG instanceof EE_Registration ) |
|
1891 | + if ( ! $REG instanceof EE_Registration) |
|
1892 | 1892 | continue; |
1893 | 1893 | $deleted = $this->_delete_registration($REG); |
1894 | - if ( !$deleted ) { |
|
1894 | + if ( ! $deleted) { |
|
1895 | 1895 | $success = 0; |
1896 | 1896 | } |
1897 | 1897 | } |
@@ -1901,15 +1901,15 @@ discard block |
||
1901 | 1901 | $REG_ID = $this->_req_data['_REG_ID']; |
1902 | 1902 | $REG = $REG_MDL->get_one_by_ID($REG_ID); |
1903 | 1903 | $deleted = $this->_delete_registration($REG); |
1904 | - if ( ! $deleted ) { |
|
1904 | + if ( ! $deleted) { |
|
1905 | 1905 | $success = 0; |
1906 | 1906 | } |
1907 | 1907 | |
1908 | 1908 | } |
1909 | 1909 | |
1910 | - $what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' ); |
|
1911 | - $action_desc = __( 'permanently deleted.', 'event_espresso' ); |
|
1912 | - $this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), TRUE ); |
|
1910 | + $what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso'); |
|
1911 | + $action_desc = __('permanently deleted.', 'event_espresso'); |
|
1912 | + $this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), TRUE); |
|
1913 | 1913 | } |
1914 | 1914 | |
1915 | 1915 | |
@@ -1921,31 +1921,31 @@ discard block |
||
1921 | 1921 | * @param EE_Registration $REG registration to be deleted permenantly |
1922 | 1922 | * @return boolean true = successful deletion, false = fail. |
1923 | 1923 | */ |
1924 | - protected function _delete_registration( EE_Registration $REG ) { |
|
1924 | + protected function _delete_registration(EE_Registration $REG) { |
|
1925 | 1925 | //first we start with the transaction... ultimately, we WILL not delete permanently if there are any related registrations on the transaction that are NOT trashed. |
1926 | 1926 | $TXN = $REG->get_first_related('Transaction'); |
1927 | 1927 | $REGS = $TXN->get_many_related('Registration'); |
1928 | 1928 | |
1929 | 1929 | $all_trashed = TRUE; |
1930 | - foreach ( $REGS as $registration ) { |
|
1931 | - if ( ! $registration->get('REG_deleted') ) |
|
1930 | + foreach ($REGS as $registration) { |
|
1931 | + if ( ! $registration->get('REG_deleted')) |
|
1932 | 1932 | $all_trashed = FALSE; |
1933 | 1933 | } |
1934 | 1934 | |
1935 | - if ( ! $all_trashed ) { |
|
1936 | - EE_Error::add_error( __('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well. These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
1935 | + if ( ! $all_trashed) { |
|
1936 | + EE_Error::add_error(__('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well. These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1937 | 1937 | return false; |
1938 | 1938 | } |
1939 | 1939 | |
1940 | 1940 | //k made it here so that means we can delete all the related transactions and their answers (but let's do them separately from THIS one). |
1941 | - foreach ( $REGS as $registration ) { |
|
1941 | + foreach ($REGS as $registration) { |
|
1942 | 1942 | |
1943 | 1943 | //delete related answers |
1944 | 1944 | $registration->delete_related_permanently('Answer'); |
1945 | 1945 | |
1946 | 1946 | //remove relationship to EE_Attendee (but we ALWAYS leave the contact record intact) |
1947 | 1947 | $attendee = $registration->get_first_related('Attendee'); |
1948 | - if ( $attendee instanceof EE_Attendee ) { |
|
1948 | + if ($attendee instanceof EE_Attendee) { |
|
1949 | 1949 | $registration->_remove_relation_to($attendee, 'Attendee'); |
1950 | 1950 | } |
1951 | 1951 | |
@@ -1955,7 +1955,7 @@ discard block |
||
1955 | 1955 | //now delete permanently the checkins related to this registration. |
1956 | 1956 | $registration->delete_related_permanently('Checkin'); |
1957 | 1957 | |
1958 | - if ( $registration->ID() === $REG->ID() ) |
|
1958 | + if ($registration->ID() === $REG->ID()) |
|
1959 | 1959 | continue; //we don't want to delete permanently the existing registration just yet. |
1960 | 1960 | |
1961 | 1961 | //remove relation to transaction for these registrations if NOT the existing registrations |
@@ -1988,34 +1988,34 @@ discard block |
||
1988 | 1988 | * @return void |
1989 | 1989 | */ |
1990 | 1990 | public function new_registration() { |
1991 | - if ( ! $this->_set_reg_event() ) { |
|
1992 | - throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso') ); |
|
1991 | + if ( ! $this->_set_reg_event()) { |
|
1992 | + throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso')); |
|
1993 | 1993 | } |
1994 | - EE_Registry::instance()->REQ->set_espresso_page( TRUE ); |
|
1994 | + EE_Registry::instance()->REQ->set_espresso_page(TRUE); |
|
1995 | 1995 | |
1996 | 1996 | // gotta start with a clean slate if we're not coming here via ajax |
1997 | - if ( ! defined('DOING_AJAX' ) && ( ! isset( $this->_req_data['processing_registration'] ) || isset( $this->_req_data['step_error'] ))) { |
|
1998 | - EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ ); |
|
1997 | + if ( ! defined('DOING_AJAX') && ( ! isset($this->_req_data['processing_registration']) || isset($this->_req_data['step_error']))) { |
|
1998 | + EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
1999 | 1999 | } |
2000 | 2000 | |
2001 | - $this->_template_args['event_name'] = '' ; |
|
2001 | + $this->_template_args['event_name'] = ''; |
|
2002 | 2002 | // event name |
2003 | - if ( $this->_reg_event ) { |
|
2003 | + if ($this->_reg_event) { |
|
2004 | 2004 | $this->_template_args['event_name'] = $this->_reg_event->name(); |
2005 | - $edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$this->_reg_event->ID() ), EVENTS_ADMIN_URL ); |
|
2006 | - $edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $this->_reg_event->name() . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>'; |
|
2007 | - $this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ; |
|
2005 | + $edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$this->_reg_event->ID()), EVENTS_ADMIN_URL); |
|
2006 | + $edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$this->_reg_event->name().'">'.__('Edit Event', 'event_espresso').'</a>'; |
|
2007 | + $this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>'; |
|
2008 | 2008 | } |
2009 | 2009 | |
2010 | 2010 | $this->_template_args['step_content'] = $this->_get_registration_step_content(); |
2011 | 2011 | |
2012 | - if ( defined('DOING_AJAX' ) ) |
|
2012 | + if (defined('DOING_AJAX')) |
|
2013 | 2013 | $this->_return_json(); |
2014 | 2014 | |
2015 | 2015 | |
2016 | 2016 | // grab header |
2017 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee.template.php'; |
|
2018 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
2017 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_register_new_attendee.template.php'; |
|
2018 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
2019 | 2019 | |
2020 | 2020 | //$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE ); |
2021 | 2021 | // the details template wrapper |
@@ -2033,7 +2033,7 @@ discard block |
||
2033 | 2033 | */ |
2034 | 2034 | protected function _get_registration_step_content() { |
2035 | 2035 | |
2036 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee_step_content.template.php'; |
|
2036 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_register_new_attendee_step_content.template.php'; |
|
2037 | 2037 | $template_args = array( |
2038 | 2038 | 'title' => '', |
2039 | 2039 | 'content' => '', |
@@ -2054,11 +2054,11 @@ discard block |
||
2054 | 2054 | |
2055 | 2055 | //if the cart is empty then we know we're at step one so we'll display ticket selector |
2056 | 2056 | $cart = EE_Registry::instance()->SSN->get_session_data('cart'); |
2057 | - $step = empty( $cart ) ? 'ticket' : 'questions'; |
|
2058 | - switch ( $step ) { |
|
2057 | + $step = empty($cart) ? 'ticket' : 'questions'; |
|
2058 | + switch ($step) { |
|
2059 | 2059 | case 'ticket' : |
2060 | 2060 | $template_args['title'] = __('Step One: Select the Ticket for this registration', 'event_espresso'); |
2061 | - $template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector( $this->_reg_event ); |
|
2061 | + $template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector($this->_reg_event); |
|
2062 | 2062 | $template_args['step_button_text'] = __('Add Tickets and Continue to Registrant Details', 'event_espresso'); |
2063 | 2063 | $template_args['show_notification_toggle'] = FALSE; |
2064 | 2064 | break; |
@@ -2071,9 +2071,9 @@ discard block |
||
2071 | 2071 | break; |
2072 | 2072 | } |
2073 | 2073 | |
2074 | - $this->_set_add_edit_form_tags( 'process_reg_step', $hidden_fields ); //we come back to the process_registration_step route. |
|
2074 | + $this->_set_add_edit_form_tags('process_reg_step', $hidden_fields); //we come back to the process_registration_step route. |
|
2075 | 2075 | |
2076 | - return EEH_Template::display_template( $template_path, $template_args, TRUE ); |
|
2076 | + return EEH_Template::display_template($template_path, $template_args, TRUE); |
|
2077 | 2077 | } |
2078 | 2078 | |
2079 | 2079 | |
@@ -2087,11 +2087,11 @@ discard block |
||
2087 | 2087 | * @return boolean |
2088 | 2088 | */ |
2089 | 2089 | private function _set_reg_event() { |
2090 | - if ( is_object( $this->_reg_event )) { |
|
2090 | + if (is_object($this->_reg_event)) { |
|
2091 | 2091 | return TRUE; |
2092 | 2092 | } |
2093 | - $EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
2094 | - if ( ! $EVT_ID ) { |
|
2093 | + $EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE; |
|
2094 | + if ( ! $EVT_ID) { |
|
2095 | 2095 | return FALSE; |
2096 | 2096 | } |
2097 | 2097 | |
@@ -2112,62 +2112,62 @@ discard block |
||
2112 | 2112 | public function process_reg_step() { |
2113 | 2113 | |
2114 | 2114 | $this->_set_reg_event(); |
2115 | - EE_Registry::instance()->REQ->set_espresso_page( TRUE ); |
|
2115 | + EE_Registry::instance()->REQ->set_espresso_page(TRUE); |
|
2116 | 2116 | |
2117 | 2117 | //what step are we on? |
2118 | - $cart = EE_Registry::instance()->SSN->get_session_data( 'cart' ); |
|
2119 | - $step = empty( $cart ) ? 'ticket' : 'questions'; |
|
2118 | + $cart = EE_Registry::instance()->SSN->get_session_data('cart'); |
|
2119 | + $step = empty($cart) ? 'ticket' : 'questions'; |
|
2120 | 2120 | |
2121 | 2121 | //if doing ajax then we need to verify the nonce |
2122 | - if ( 'DOING_AJAX' ) { |
|
2123 | - $nonce = isset( $this->_req_data[$this->_req_nonce] ) ? sanitize_text_field( $this->_req_data[$this->_req_nonce] ) : ''; |
|
2124 | - $this->_verify_nonce( $nonce, $this->_req_nonce ); |
|
2122 | + if ('DOING_AJAX') { |
|
2123 | + $nonce = isset($this->_req_data[$this->_req_nonce]) ? sanitize_text_field($this->_req_data[$this->_req_nonce]) : ''; |
|
2124 | + $this->_verify_nonce($nonce, $this->_req_nonce); |
|
2125 | 2125 | } |
2126 | 2126 | |
2127 | - switch ( $step ) { |
|
2127 | + switch ($step) { |
|
2128 | 2128 | case 'ticket' : |
2129 | 2129 | //process ticket selection |
2130 | 2130 | $success = EED_Ticket_Selector::instance()->process_ticket_selections(); |
2131 | - if ( $success ) { |
|
2132 | - EE_Error::add_success( __('Tickets Selected. Now complete the registration.'), 'event_espresso'); |
|
2131 | + if ($success) { |
|
2132 | + EE_Error::add_success(__('Tickets Selected. Now complete the registration.'), 'event_espresso'); |
|
2133 | 2133 | } else { |
2134 | 2134 | $query_args['step_error'] = $this->_req_data['step_error'] = TRUE; |
2135 | 2135 | } |
2136 | - if ( defined('DOING_AJAX') ) { |
|
2136 | + if (defined('DOING_AJAX')) { |
|
2137 | 2137 | $this->new_registration(); //display next step |
2138 | 2138 | } else { |
2139 | 2139 | $query_args['action'] = 'new_registration'; |
2140 | 2140 | $query_args['processing_registration'] = true; |
2141 | 2141 | $query_args['event_id'] = $this->_reg_event->ID(); |
2142 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
2142 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
2143 | 2143 | } |
2144 | 2144 | break; |
2145 | 2145 | case 'questions' : |
2146 | - if( ! isset( $this->_req_data[ 'txn_reg_status_change' ], $this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ] ) ) { |
|
2147 | - add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15 ); |
|
2146 | + if ( ! isset($this->_req_data['txn_reg_status_change'], $this->_req_data['txn_reg_status_change']['send_notifications'])) { |
|
2147 | + add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15); |
|
2148 | 2148 | } |
2149 | 2149 | //process registration |
2150 | 2150 | $transaction = EED_Single_Page_Checkout::instance()->process_registration_from_admin(); |
2151 | - if ( ! $transaction instanceof EE_Transaction ) { |
|
2151 | + if ( ! $transaction instanceof EE_Transaction) { |
|
2152 | 2152 | $query_args = array( |
2153 | 2153 | 'action' => 'new_registration', |
2154 | 2154 | 'processing_registration' => true, |
2155 | 2155 | 'event_id' => $this->_reg_event->ID() |
2156 | 2156 | ); |
2157 | 2157 | |
2158 | - if ( defined('DOING_AJAX' )) { |
|
2158 | + if (defined('DOING_AJAX')) { |
|
2159 | 2159 | //display registration form again because there are errors (maybe validation?) |
2160 | 2160 | $this->new_registration(); |
2161 | 2161 | return; |
2162 | 2162 | } else { |
2163 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
2163 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
2164 | 2164 | return; |
2165 | 2165 | } |
2166 | 2166 | } |
2167 | 2167 | /** @type EE_Transaction_Payments $transaction_payments */ |
2168 | - $transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' ); |
|
2168 | + $transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments'); |
|
2169 | 2169 | // maybe update status, and make sure to save transaction if not done already |
2170 | - if ( ! $transaction_payments->update_transaction_status_based_on_total_paid( $transaction )) { |
|
2170 | + if ( ! $transaction_payments->update_transaction_status_based_on_total_paid($transaction)) { |
|
2171 | 2171 | $transaction->save(); |
2172 | 2172 | } |
2173 | 2173 | $query_args = array( |
@@ -2175,8 +2175,8 @@ discard block |
||
2175 | 2175 | 'TXN_ID' => $transaction->ID(), |
2176 | 2176 | 'page' => 'espresso_transactions' |
2177 | 2177 | ); |
2178 | - EE_Error::add_success( __('Registration Created. Please review the transaction and add any payments as necessary', 'event_espresso') ); |
|
2179 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
2178 | + EE_Error::add_success(__('Registration Created. Please review the transaction and add any payments as necessary', 'event_espresso')); |
|
2179 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
2180 | 2180 | break; |
2181 | 2181 | } |
2182 | 2182 | |
@@ -2196,7 +2196,7 @@ discard block |
||
2196 | 2196 | * @return void |
2197 | 2197 | */ |
2198 | 2198 | protected function _attendee_contact_list_table() { |
2199 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
2199 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
2200 | 2200 | $this->_search_btn_label = __('Contacts', 'event_espresso'); |
2201 | 2201 | $this->display_admin_list_table_page_with_no_sidebar(); |
2202 | 2202 | } |
@@ -2211,10 +2211,10 @@ discard block |
||
2211 | 2211 | * @access public |
2212 | 2212 | * @return array |
2213 | 2213 | */ |
2214 | - public function get_attendees( $per_page, $count = FALSE, $trash = FALSE ) { |
|
2214 | + public function get_attendees($per_page, $count = FALSE, $trash = FALSE) { |
|
2215 | 2215 | |
2216 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
2217 | - require_once( REG_ADMIN . 'EE_Attendee_Contact_List_Table.class.php' ); |
|
2216 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
2217 | + require_once(REG_ADMIN.'EE_Attendee_Contact_List_Table.class.php'); |
|
2218 | 2218 | $ATT_MDL = EEM_Attendee::instance(); |
2219 | 2219 | |
2220 | 2220 | $this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : ''; |
@@ -2242,47 +2242,47 @@ discard block |
||
2242 | 2242 | $orderby = 'ATT_lname'; |
2243 | 2243 | } |
2244 | 2244 | |
2245 | - $sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC'; |
|
2245 | + $sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC'; |
|
2246 | 2246 | |
2247 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
2248 | - $per_page = isset( $per_page ) && !empty( $per_page ) ? $per_page : 10; |
|
2249 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
2247 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
2248 | + $per_page = isset($per_page) && ! empty($per_page) ? $per_page : 10; |
|
2249 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
2250 | 2250 | |
2251 | 2251 | $_where = array(); |
2252 | 2252 | |
2253 | - if ( isset( $this->_req_data['s'] ) ) { |
|
2254 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
2253 | + if (isset($this->_req_data['s'])) { |
|
2254 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
2255 | 2255 | $_where['OR'] = array( |
2256 | - 'Registration.Event.EVT_name' => array( 'LIKE', $sstr), |
|
2257 | - 'Registration.Event.EVT_desc' => array( 'LIKE', $sstr ), |
|
2258 | - 'Registration.Event.EVT_short_desc' => array( 'LIKE' , $sstr ), |
|
2259 | - 'ATT_fname' => array( 'LIKE', $sstr ), |
|
2260 | - 'ATT_lname' => array( 'LIKE', $sstr ), |
|
2261 | - 'ATT_short_bio' => array( 'LIKE', $sstr ), |
|
2262 | - 'ATT_email' => array('LIKE', $sstr ), |
|
2263 | - 'ATT_address' => array( 'LIKE', $sstr ), |
|
2264 | - 'ATT_address2' => array( 'LIKE', $sstr ), |
|
2265 | - 'ATT_city' => array( 'LIKE', $sstr ), |
|
2266 | - 'Country.CNT_name' => array( 'LIKE', $sstr ), |
|
2267 | - 'State.STA_name' => array('LIKE', $sstr ), |
|
2268 | - 'ATT_phone' => array( 'LIKE', $sstr ), |
|
2269 | - 'Registration.REG_final_price' => array( 'LIKE', $sstr ), |
|
2270 | - 'Registration.REG_code' => array( 'LIKE', $sstr ), |
|
2271 | - 'Registration.REG_count' => array( 'LIKE' , $sstr ), |
|
2272 | - 'Registration.REG_group_size' => array( 'LIKE' , $sstr ) |
|
2256 | + 'Registration.Event.EVT_name' => array('LIKE', $sstr), |
|
2257 | + 'Registration.Event.EVT_desc' => array('LIKE', $sstr), |
|
2258 | + 'Registration.Event.EVT_short_desc' => array('LIKE', $sstr), |
|
2259 | + 'ATT_fname' => array('LIKE', $sstr), |
|
2260 | + 'ATT_lname' => array('LIKE', $sstr), |
|
2261 | + 'ATT_short_bio' => array('LIKE', $sstr), |
|
2262 | + 'ATT_email' => array('LIKE', $sstr), |
|
2263 | + 'ATT_address' => array('LIKE', $sstr), |
|
2264 | + 'ATT_address2' => array('LIKE', $sstr), |
|
2265 | + 'ATT_city' => array('LIKE', $sstr), |
|
2266 | + 'Country.CNT_name' => array('LIKE', $sstr), |
|
2267 | + 'State.STA_name' => array('LIKE', $sstr), |
|
2268 | + 'ATT_phone' => array('LIKE', $sstr), |
|
2269 | + 'Registration.REG_final_price' => array('LIKE', $sstr), |
|
2270 | + 'Registration.REG_code' => array('LIKE', $sstr), |
|
2271 | + 'Registration.REG_count' => array('LIKE', $sstr), |
|
2272 | + 'Registration.REG_group_size' => array('LIKE', $sstr) |
|
2273 | 2273 | ); |
2274 | 2274 | } |
2275 | 2275 | |
2276 | 2276 | |
2277 | - $offset = ($current_page-1)*$per_page; |
|
2278 | - $limit = $count ? NULL : array( $offset, $per_page ); |
|
2277 | + $offset = ($current_page - 1) * $per_page; |
|
2278 | + $limit = $count ? NULL : array($offset, $per_page); |
|
2279 | 2279 | |
2280 | - if ( $trash ) { |
|
2281 | - $_where['status'] = array( '!=', 'publish' ); |
|
2282 | - $all_attendees = $count ? $ATT_MDL->count( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit)): $ATT_MDL->get_all( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit)); |
|
2280 | + if ($trash) { |
|
2281 | + $_where['status'] = array('!=', 'publish'); |
|
2282 | + $all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)); |
|
2283 | 2283 | } else { |
2284 | - $_where['status'] = array( 'IN', array( 'publish' ) ); |
|
2285 | - $all_attendees = $count ? $ATT_MDL->count( array($_where, 'order_by'=>array($orderby=>$sort),'limit'=>$limit)) : $ATT_MDL->get_all( array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit) ); |
|
2284 | + $_where['status'] = array('IN', array('publish')); |
|
2285 | + $all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)); |
|
2286 | 2286 | } |
2287 | 2287 | |
2288 | 2288 | return $all_attendees; |
@@ -2299,10 +2299,10 @@ discard block |
||
2299 | 2299 | */ |
2300 | 2300 | protected function _resend_registration() { |
2301 | 2301 | $this->_process_resend_registration(); |
2302 | - $query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID'] ) : array( |
|
2302 | + $query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID']) : array( |
|
2303 | 2303 | 'action' => 'default' |
2304 | 2304 | ); |
2305 | - $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE ); |
|
2305 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
2306 | 2306 | } |
2307 | 2307 | |
2308 | 2308 | |
@@ -2310,17 +2310,17 @@ discard block |
||
2310 | 2310 | |
2311 | 2311 | |
2312 | 2312 | |
2313 | - public function _registrations_report(){ |
|
2314 | - EE_Registry::instance()->load_helper( 'File' ); |
|
2313 | + public function _registrations_report() { |
|
2314 | + EE_Registry::instance()->load_helper('File'); |
|
2315 | 2315 | $new_request_args = array( |
2316 | 2316 | 'export' => 'report', |
2317 | 2317 | 'action' => 'registrations_report_for_event', |
2318 | - 'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL, |
|
2318 | + 'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL, |
|
2319 | 2319 | ); |
2320 | 2320 | $this->_req_data = array_merge($this->_req_data, $new_request_args); |
2321 | 2321 | |
2322 | - if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) { |
|
2323 | - require_once(EE_CLASSES . 'EE_Export.class.php'); |
|
2322 | + if (is_readable(EE_CLASSES.'EE_Export.class.php')) { |
|
2323 | + require_once(EE_CLASSES.'EE_Export.class.php'); |
|
2324 | 2324 | $EE_Export = EE_Export::instance($this->_req_data); |
2325 | 2325 | $EE_Export->export(); |
2326 | 2326 | } |
@@ -2328,19 +2328,19 @@ discard block |
||
2328 | 2328 | |
2329 | 2329 | |
2330 | 2330 | |
2331 | - public function _contact_list_export(){ |
|
2332 | - EE_Registry::instance()->load_helper( 'File' ); |
|
2333 | - if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) { |
|
2334 | - require_once(EE_CLASSES . 'EE_Export.class.php'); |
|
2331 | + public function _contact_list_export() { |
|
2332 | + EE_Registry::instance()->load_helper('File'); |
|
2333 | + if (is_readable(EE_CLASSES.'EE_Export.class.php')) { |
|
2334 | + require_once(EE_CLASSES.'EE_Export.class.php'); |
|
2335 | 2335 | $EE_Export = EE_Export::instance($this->_req_data); |
2336 | 2336 | $EE_Export->export_attendees(); |
2337 | 2337 | } |
2338 | 2338 | } |
2339 | 2339 | |
2340 | - public function _contact_list_report(){ |
|
2341 | - EE_Registry::instance()->load_helper( 'File' ); |
|
2342 | - if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) { |
|
2343 | - require_once(EE_CLASSES . 'EE_Export.class.php'); |
|
2340 | + public function _contact_list_report() { |
|
2341 | + EE_Registry::instance()->load_helper('File'); |
|
2342 | + if (is_readable(EE_CLASSES.'EE_Export.class.php')) { |
|
2343 | + require_once(EE_CLASSES.'EE_Export.class.php'); |
|
2344 | 2344 | $EE_Export = EE_Export::instance($this->_req_data); |
2345 | 2345 | $EE_Export->report_attendees(); |
2346 | 2346 | } |
@@ -2359,73 +2359,73 @@ discard block |
||
2359 | 2359 | * @return void |
2360 | 2360 | */ |
2361 | 2361 | protected function _duplicate_attendee() { |
2362 | - $action = !empty( $this->_req_data['return'] ) ? $this->_req_data['return'] : 'default'; |
|
2362 | + $action = ! empty($this->_req_data['return']) ? $this->_req_data['return'] : 'default'; |
|
2363 | 2363 | //verify we have necessary info |
2364 | - if ( empty($this->_req_data['_REG_ID'] ) ) { |
|
2365 | - EE_Error::add_error( __('Unable to create the contact for the registration because the required paramaters are not present (_REG_ID )', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__ ); |
|
2366 | - $query_args = array( 'action' => $action ); |
|
2364 | + if (empty($this->_req_data['_REG_ID'])) { |
|
2365 | + EE_Error::add_error(__('Unable to create the contact for the registration because the required paramaters are not present (_REG_ID )', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__); |
|
2366 | + $query_args = array('action' => $action); |
|
2367 | 2367 | $this->_redirect_after_action('', '', '', $query_args, TRUE); |
2368 | 2368 | } |
2369 | 2369 | |
2370 | 2370 | //okay necessary deets present... let's dupe the incoming attendee and attach to incoming registration. |
2371 | - $registration = EEM_Registration::instance()->get_one_by_ID( $this->_req_data['_REG_ID'] ); |
|
2371 | + $registration = EEM_Registration::instance()->get_one_by_ID($this->_req_data['_REG_ID']); |
|
2372 | 2372 | $attendee = $registration->attendee(); |
2373 | 2373 | |
2374 | 2374 | //remove relation of existing attendee on registration |
2375 | - $registration->_remove_relation_to($attendee, 'Attendee' ); |
|
2375 | + $registration->_remove_relation_to($attendee, 'Attendee'); |
|
2376 | 2376 | //new attendee |
2377 | 2377 | $new_attendee = clone $attendee; |
2378 | - $new_attendee->set( 'ATT_ID', 0 ); |
|
2378 | + $new_attendee->set('ATT_ID', 0); |
|
2379 | 2379 | $new_attendee->save(); |
2380 | 2380 | |
2381 | 2381 | //add new attendee to reg |
2382 | - $registration->_add_relation_to( $new_attendee, 'Attendee'); |
|
2382 | + $registration->_add_relation_to($new_attendee, 'Attendee'); |
|
2383 | 2383 | |
2384 | - EE_Error::add_success( __('New Contact record created. Now make any edits you wish to make for this contact.', 'event_espresso') ); |
|
2384 | + EE_Error::add_success(__('New Contact record created. Now make any edits you wish to make for this contact.', 'event_espresso')); |
|
2385 | 2385 | |
2386 | 2386 | //redirect to edit page for attendee |
2387 | - $query_args = array( 'post' => $new_attendee->ID(), 'action' => 'edit_attendee' ); |
|
2387 | + $query_args = array('post' => $new_attendee->ID(), 'action' => 'edit_attendee'); |
|
2388 | 2388 | |
2389 | - $this->_redirect_after_action( '', '', '', $query_args, TRUE ); |
|
2389 | + $this->_redirect_after_action('', '', '', $query_args, TRUE); |
|
2390 | 2390 | } |
2391 | 2391 | |
2392 | 2392 | |
2393 | 2393 | //related to cpt routes |
2394 | 2394 | protected function _insert_update_cpt_item($post_id, $post) { |
2395 | 2395 | $success = true; |
2396 | - $attendee = EEM_Attendee::instance()->get_one_by_ID( $post_id ); |
|
2396 | + $attendee = EEM_Attendee::instance()->get_one_by_ID($post_id); |
|
2397 | 2397 | //for attendee updates |
2398 | - if ( $post->post_type = 'espresso_attendees' && !empty( $attendee ) ) { |
|
2398 | + if ($post->post_type = 'espresso_attendees' && ! empty($attendee)) { |
|
2399 | 2399 | //note we should only be UPDATING attendees at this point. |
2400 | 2400 | $updated_fields = array( |
2401 | 2401 | 'ATT_fname' => $this->_req_data['ATT_fname'], |
2402 | 2402 | 'ATT_lname' => $this->_req_data['ATT_lname'], |
2403 | - 'ATT_full_name'=> $this->_req_data['ATT_fname'] . ' ' . $this->_req_data['ATT_lname'], |
|
2403 | + 'ATT_full_name'=> $this->_req_data['ATT_fname'].' '.$this->_req_data['ATT_lname'], |
|
2404 | 2404 | 'ATT_address' => isset($this->_req_data['ATT_address']) ? $this->_req_data['ATT_address'] : '', |
2405 | 2405 | 'ATT_address2' => isset($this->_req_data['ATT_address2']) ? $this->_req_data['ATT_address2'] : '', |
2406 | - 'ATT_city' => isset( $this->_req_data['ATT_city'] ) ? $this->_req_data['ATT_city'] : '', |
|
2407 | - 'STA_ID' => isset( $this->_req_data['STA_ID'] ) ? $this->_req_data['STA_ID'] : '', |
|
2408 | - 'CNT_ISO' => isset( $this->_req_data['CNT_ISO'] ) ? $this->_req_data['CNT_ISO'] : '', |
|
2409 | - 'ATT_zip' => isset( $this->_req_data['ATT_zip'] ) ? $this->_req_data['ATT_zip'] : '', |
|
2410 | - 'ATT_email' => isset( $this->_req_data['ATT_email'] ) ? $this->_req_data['ATT_email'] : '', |
|
2411 | - 'ATT_phone' => isset( $this->_req_data['ATT_phone'] ) ? $this->_req_data['ATT_phone'] : '' |
|
2406 | + 'ATT_city' => isset($this->_req_data['ATT_city']) ? $this->_req_data['ATT_city'] : '', |
|
2407 | + 'STA_ID' => isset($this->_req_data['STA_ID']) ? $this->_req_data['STA_ID'] : '', |
|
2408 | + 'CNT_ISO' => isset($this->_req_data['CNT_ISO']) ? $this->_req_data['CNT_ISO'] : '', |
|
2409 | + 'ATT_zip' => isset($this->_req_data['ATT_zip']) ? $this->_req_data['ATT_zip'] : '', |
|
2410 | + 'ATT_email' => isset($this->_req_data['ATT_email']) ? $this->_req_data['ATT_email'] : '', |
|
2411 | + 'ATT_phone' => isset($this->_req_data['ATT_phone']) ? $this->_req_data['ATT_phone'] : '' |
|
2412 | 2412 | ); |
2413 | - foreach ( $updated_fields as $field => $value ) { |
|
2413 | + foreach ($updated_fields as $field => $value) { |
|
2414 | 2414 | $attendee->set($field, $value); |
2415 | 2415 | } |
2416 | 2416 | |
2417 | 2417 | $success = $attendee->save(); |
2418 | 2418 | |
2419 | - $attendee_update_callbacks = apply_filters( 'FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array() ); |
|
2420 | - foreach ( $attendee_update_callbacks as $a_callback ) { |
|
2421 | - if ( FALSE === call_user_func_array( $a_callback, array($attendee, $this->_req_data ) ) ) { |
|
2422 | - throw new EE_Error( sprintf( __('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback. Please check the spelling.', 'event_espresso'), $a_callback ) ); |
|
2419 | + $attendee_update_callbacks = apply_filters('FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array()); |
|
2420 | + foreach ($attendee_update_callbacks as $a_callback) { |
|
2421 | + if (FALSE === call_user_func_array($a_callback, array($attendee, $this->_req_data))) { |
|
2422 | + throw new EE_Error(sprintf(__('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback. Please check the spelling.', 'event_espresso'), $a_callback)); |
|
2423 | 2423 | } |
2424 | 2424 | } |
2425 | 2425 | } |
2426 | 2426 | |
2427 | - if ( $success === FALSE ) |
|
2428 | - EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
2427 | + if ($success === FALSE) |
|
2428 | + EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
2429 | 2429 | |
2430 | 2430 | } |
2431 | 2431 | |
@@ -2445,17 +2445,17 @@ discard block |
||
2445 | 2445 | remove_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core'); |
2446 | 2446 | remove_meta_box('commentstatusdiv', $this->_cpt_routes[$this->_req_action], 'normal', 'core'); |
2447 | 2447 | |
2448 | - if ( post_type_supports( 'espresso_attendees', 'excerpt') ) { |
|
2449 | - add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal' ); |
|
2448 | + if (post_type_supports('espresso_attendees', 'excerpt')) { |
|
2449 | + add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal'); |
|
2450 | 2450 | } |
2451 | 2451 | |
2452 | - if ( post_type_supports( 'espresso_attendees', 'comments') ) { |
|
2452 | + if (post_type_supports('espresso_attendees', 'comments')) { |
|
2453 | 2453 | add_meta_box('commentsdiv', __('Notes on the Contact', 'event_espresso'), 'post_comment_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core'); |
2454 | 2454 | } |
2455 | 2455 | |
2456 | - add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array( $this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core' ); |
|
2457 | - add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core' ); |
|
2458 | - add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array( $this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high'); |
|
2456 | + add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array($this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core'); |
|
2457 | + add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core'); |
|
2458 | + add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array($this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high'); |
|
2459 | 2459 | } |
2460 | 2460 | |
2461 | 2461 | |
@@ -2464,10 +2464,10 @@ discard block |
||
2464 | 2464 | * @param WP_Post $post wp post object |
2465 | 2465 | * @return string attendee contact info ( and form ) |
2466 | 2466 | */ |
2467 | - public function attendee_contact_info( $post ) { |
|
2467 | + public function attendee_contact_info($post) { |
|
2468 | 2468 | //get attendee object ( should already have it ) |
2469 | 2469 | $this->_template_args['attendee'] = $this->_cpt_model_obj; |
2470 | - $template = REG_TEMPLATE_PATH . 'attendee_contact_info_metabox_content.template.php'; |
|
2470 | + $template = REG_TEMPLATE_PATH.'attendee_contact_info_metabox_content.template.php'; |
|
2471 | 2471 | EEH_Template::display_template($template, $this->_template_args); |
2472 | 2472 | } |
2473 | 2473 | |
@@ -2483,12 +2483,12 @@ discard block |
||
2483 | 2483 | $this->_template_args['attendee'] = $this->_cpt_model_obj; |
2484 | 2484 | $this->_template_args['state_html'] = EEH_Form_Fields::generate_form_input( |
2485 | 2485 | new EE_Question_Form_Input( |
2486 | - EE_Question::new_instance( array( |
|
2486 | + EE_Question::new_instance(array( |
|
2487 | 2487 | 'QST_ID' => 0, |
2488 | 2488 | 'QST_display_text' => __('State/Province', 'event_espresso'), |
2489 | 2489 | 'QST_system' => 'admin-state' |
2490 | 2490 | )), |
2491 | - EE_Answer::new_instance( array( |
|
2491 | + EE_Answer::new_instance(array( |
|
2492 | 2492 | 'ANS_ID' => 0, |
2493 | 2493 | 'ANS_value' => $this->_cpt_model_obj->state_ID() |
2494 | 2494 | )), |
@@ -2501,12 +2501,12 @@ discard block |
||
2501 | 2501 | )); |
2502 | 2502 | $this->_template_args['country_html'] = EEH_Form_Fields::generate_form_input( |
2503 | 2503 | new EE_Question_Form_Input( |
2504 | - EE_Question::new_instance( array( |
|
2504 | + EE_Question::new_instance(array( |
|
2505 | 2505 | 'QST_ID' => 0, |
2506 | 2506 | 'QST_display_text' => __('Country', 'event_espresso'), |
2507 | 2507 | 'QST_system' => 'admin-country' |
2508 | 2508 | )), |
2509 | - EE_Answer::new_instance( array( |
|
2509 | + EE_Answer::new_instance(array( |
|
2510 | 2510 | 'ANS_ID' => 0, |
2511 | 2511 | 'ANS_value' => $this->_cpt_model_obj->country_ID() |
2512 | 2512 | )), |
@@ -2517,8 +2517,8 @@ discard block |
||
2517 | 2517 | 'append_qstn_id' => FALSE |
2518 | 2518 | ) |
2519 | 2519 | )); |
2520 | - $template = REG_TEMPLATE_PATH . 'attendee_address_details_metabox_content.template.php'; |
|
2521 | - EEH_Template::display_template($template, $this->_template_args ); |
|
2520 | + $template = REG_TEMPLATE_PATH.'attendee_address_details_metabox_content.template.php'; |
|
2521 | + EEH_Template::display_template($template, $this->_template_args); |
|
2522 | 2522 | |
2523 | 2523 | } |
2524 | 2524 | |
@@ -2528,11 +2528,11 @@ discard block |
||
2528 | 2528 | * @access protected |
2529 | 2529 | * @return void |
2530 | 2530 | */ |
2531 | - public function attendee_registrations_meta_box( $post ) { |
|
2531 | + public function attendee_registrations_meta_box($post) { |
|
2532 | 2532 | |
2533 | 2533 | $this->_template_args['attendee'] = $this->_cpt_model_obj; |
2534 | 2534 | $this->_template_args['registrations'] = $this->_cpt_model_obj->get_many_related('Registration'); |
2535 | - $template = REG_TEMPLATE_PATH . 'attendee_registrations_main_meta_box.template.php'; |
|
2535 | + $template = REG_TEMPLATE_PATH.'attendee_registrations_main_meta_box.template.php'; |
|
2536 | 2536 | EEH_Template::display_template($template, $this->_template_args); |
2537 | 2537 | |
2538 | 2538 | } |
@@ -2546,8 +2546,8 @@ discard block |
||
2546 | 2546 | * @return string html for new form. |
2547 | 2547 | */ |
2548 | 2548 | public function after_title_form_fields($post) { |
2549 | - if ( $post->post_type == 'espresso_attendees' ) { |
|
2550 | - $template = REG_TEMPLATE_PATH . 'attendee_details_after_title_form_fields.template.php'; |
|
2549 | + if ($post->post_type == 'espresso_attendees') { |
|
2550 | + $template = REG_TEMPLATE_PATH.'attendee_details_after_title_form_fields.template.php'; |
|
2551 | 2551 | $template_args['attendee'] = $this->_cpt_model_obj; |
2552 | 2552 | EEH_Template::display_template($template, $template_args); |
2553 | 2553 | } |
@@ -2564,21 +2564,21 @@ discard block |
||
2564 | 2564 | * @access protected |
2565 | 2565 | * @return void |
2566 | 2566 | */ |
2567 | - protected function _trash_or_restore_attendees( $trash = TRUE ) { |
|
2567 | + protected function _trash_or_restore_attendees($trash = TRUE) { |
|
2568 | 2568 | |
2569 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
2569 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
2570 | 2570 | |
2571 | 2571 | $ATT_MDL = EEM_Attendee::instance(); |
2572 | 2572 | |
2573 | 2573 | $success = 1; |
2574 | 2574 | //Checkboxes |
2575 | - if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
2575 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
2576 | 2576 | // if array has more than one element than success message should be plural |
2577 | - $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
2577 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
2578 | 2578 | // cycle thru checkboxes |
2579 | - while (list( $ATT_ID, $value ) = each($this->_req_data['checkbox'])) { |
|
2580 | - $updated = $trash ? $ATT_MDL->update_by_ID(array( 'status' => 'trash' ), $ATT_ID) : $ATT_MDL->update_by_ID( array('status' => 'publish' ), $ATT_ID); |
|
2581 | - if ( !$updated ) { |
|
2579 | + while (list($ATT_ID, $value) = each($this->_req_data['checkbox'])) { |
|
2580 | + $updated = $trash ? $ATT_MDL->update_by_ID(array('status' => 'trash'), $ATT_ID) : $ATT_MDL->update_by_ID(array('status' => 'publish'), $ATT_ID); |
|
2581 | + if ( ! $updated) { |
|
2582 | 2582 | $success = 0; |
2583 | 2583 | } |
2584 | 2584 | } |
@@ -2587,18 +2587,18 @@ discard block |
||
2587 | 2587 | // grab single id and delete |
2588 | 2588 | $ATT_ID = absint($this->_req_data['ATT_ID']); |
2589 | 2589 | //get attendee |
2590 | - $att = $ATT_MDL->get_one_by_ID( $ATT_ID ); |
|
2590 | + $att = $ATT_MDL->get_one_by_ID($ATT_ID); |
|
2591 | 2591 | $updated = $trash ? $att->set_status('trash') : $att->set_status('publish'); |
2592 | 2592 | $updated = $att->save(); |
2593 | - if ( ! $updated ) { |
|
2593 | + if ( ! $updated) { |
|
2594 | 2594 | $success = 0; |
2595 | 2595 | } |
2596 | 2596 | |
2597 | 2597 | } |
2598 | 2598 | |
2599 | - $what = $success > 1 ? __( 'Contacts', 'event_espresso' ) : __( 'Contact', 'event_espresso' ); |
|
2600 | - $action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' ); |
|
2601 | - $this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'contact_list' ) ); |
|
2599 | + $what = $success > 1 ? __('Contacts', 'event_espresso') : __('Contact', 'event_espresso'); |
|
2600 | + $action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso'); |
|
2601 | + $this->_redirect_after_action($success, $what, $action_desc, array('action' => 'contact_list')); |
|
2602 | 2602 | |
2603 | 2603 | } |
2604 | 2604 |