@@ -5,9 +5,9 @@ |
||
5 | 5 | ?> |
6 | 6 | <header class="event-header"> |
7 | 7 | <?php echo "<{$tag} id=\"event-details-{$tag}-{$post->ID}\" class=\"entry-title\">"; ?> |
8 | - <a class="ee-event-header-lnk" href="<?php the_permalink(); ?>"<?php echo \EED_Events_Archive::link_target();?>> |
|
8 | + <a class="ee-event-header-lnk" href="<?php the_permalink(); ?>"<?php echo \EED_Events_Archive::link_target(); ?>> |
|
9 | 9 | <?php the_title(); ?> |
10 | 10 | </a> |
11 | 11 | <?php echo "</{$tag}"; ?> |
12 | - <?php if ( ! is_archive() && has_excerpt( $post->ID )): the_excerpt(); endif;?> |
|
12 | + <?php if ( ! is_archive() && has_excerpt($post->ID)): the_excerpt(); endif; ?> |
|
13 | 13 | </header> |
@@ -37,19 +37,19 @@ discard block |
||
37 | 37 | */ |
38 | 38 | protected static $using_get_the_excerpt = false; |
39 | 39 | |
40 | - /** |
|
41 | - * Used to flag when the event list is being called from an external iframe. |
|
42 | - * |
|
43 | - * @var bool $iframe |
|
44 | - */ |
|
45 | - protected static $iframe = false; |
|
46 | - |
|
47 | - /** |
|
40 | + /** |
|
41 | + * Used to flag when the event list is being called from an external iframe. |
|
42 | + * |
|
43 | + * @var bool $iframe |
|
44 | + */ |
|
45 | + protected static $iframe = false; |
|
46 | + |
|
47 | + /** |
|
48 | 48 | * @var \EventEspresso\core\libraries\iframe_display\EventListIframeEmbedButton $_iframe_embed_button |
49 | 49 | */ |
50 | 50 | private static $_iframe_embed_button; |
51 | 51 | |
52 | - /** |
|
52 | + /** |
|
53 | 53 | * @type EE_Template_Part_Manager $template_parts |
54 | 54 | */ |
55 | 55 | protected $template_parts; |
@@ -233,26 +233,26 @@ discard block |
||
233 | 233 | |
234 | 234 | |
235 | 235 | |
236 | - /** |
|
237 | - * @access public |
|
238 | - * @return void |
|
239 | - * @throws \EE_Error |
|
240 | - * @throws \DomainException |
|
241 | - */ |
|
236 | + /** |
|
237 | + * @access public |
|
238 | + * @return void |
|
239 | + * @throws \EE_Error |
|
240 | + * @throws \DomainException |
|
241 | + */ |
|
242 | 242 | public function event_list_iframe() { |
243 | - \EED_Events_Archive::$iframe = true; |
|
243 | + \EED_Events_Archive::$iframe = true; |
|
244 | 244 | $event_list_iframe = new EventsArchiveIframe( $this ); |
245 | 245 | $event_list_iframe->display(); |
246 | 246 | } |
247 | 247 | |
248 | 248 | |
249 | 249 | |
250 | - /** |
|
251 | - * @access public |
|
252 | - * @return string |
|
253 | - */ |
|
250 | + /** |
|
251 | + * @access public |
|
252 | + * @return string |
|
253 | + */ |
|
254 | 254 | public static function link_target() { |
255 | - return \EED_Events_Archive::$iframe ? ' target="_blank"' : ''; |
|
255 | + return \EED_Events_Archive::$iframe ? ' target="_blank"' : ''; |
|
256 | 256 | } |
257 | 257 | |
258 | 258 |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | use EventEspresso\core\libraries\iframe_display\EventListIframeEmbedButton; |
4 | 4 | use EventEspresso\modules\events_archive\EventsArchiveIframe; |
5 | 5 | |
6 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
6 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
7 | 7 | /** |
8 | 8 | * Event Espresso |
9 | 9 | * |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @return EED_Events_Archive |
61 | 61 | */ |
62 | 62 | public static function instance() { |
63 | - return parent::get_instance( __CLASS__ ); |
|
63 | + return parent::get_instance(__CLASS__); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | |
@@ -72,10 +72,10 @@ discard block |
||
72 | 72 | * @return void |
73 | 73 | */ |
74 | 74 | public static function set_hooks() { |
75 | - EE_Config::register_route( EE_Registry::instance()->CFG->core->event_cpt_slug, 'Events_Archive', 'run' ); |
|
76 | - EE_Config::register_route( 'event_list', 'Events_Archive', 'event_list' ); |
|
77 | - EE_Config::register_route( 'iframe', 'Events_Archive', 'event_list_iframe', 'event_list' ); |
|
78 | - add_action( 'wp_loaded', array( 'EED_Events_Archive', 'set_definitions' ), 2 ); |
|
75 | + EE_Config::register_route(EE_Registry::instance()->CFG->core->event_cpt_slug, 'Events_Archive', 'run'); |
|
76 | + EE_Config::register_route('event_list', 'Events_Archive', 'event_list'); |
|
77 | + EE_Config::register_route('iframe', 'Events_Archive', 'event_list_iframe', 'event_list'); |
|
78 | + add_action('wp_loaded', array('EED_Events_Archive', 'set_definitions'), 2); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | * @return void |
86 | 86 | */ |
87 | 87 | public static function set_hooks_admin() { |
88 | - add_action( 'wp_loaded', array( 'EED_Events_Archive', 'set_definitions' ), 2 ); |
|
88 | + add_action('wp_loaded', array('EED_Events_Archive', 'set_definitions'), 2); |
|
89 | 89 | // hook into the end of the \EE_Admin_Page::_load_page_dependencies() |
90 | 90 | // to load assets for "espresso_events" page on the "default" route (action) |
91 | 91 | add_action( |
92 | 92 | 'FHEE__EE_Admin_Page___load_page_dependencies__after_load__espresso_events__default', |
93 | - array( 'EED_Events_Archive', 'event_list_iframe_embed_button' ), |
|
93 | + array('EED_Events_Archive', 'event_list_iframe_embed_button'), |
|
94 | 94 | 10 |
95 | 95 | ); |
96 | 96 | } |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | * @return void |
106 | 106 | */ |
107 | 107 | public static function set_definitions() { |
108 | - define( 'EVENTS_ARCHIVE_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
109 | - define( 'EVENTS_ARCHIVE_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS ); |
|
108 | + define('EVENTS_ARCHIVE_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
109 | + define('EVENTS_ARCHIVE_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | |
@@ -114,10 +114,10 @@ discard block |
||
114 | 114 | /** |
115 | 115 | * set up EE_Events_Archive_Config |
116 | 116 | */ |
117 | - protected function set_config(){ |
|
118 | - $this->set_config_section( 'template_settings' ); |
|
119 | - $this->set_config_class( 'EE_Events_Archive_Config' ); |
|
120 | - $this->set_config_name( 'EED_Events_Archive' ); |
|
117 | + protected function set_config() { |
|
118 | + $this->set_config_section('template_settings'); |
|
119 | + $this->set_config_class('EE_Events_Archive_Config'); |
|
120 | + $this->set_config_name('EED_Events_Archive'); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @return EventListIframeEmbedButton |
127 | 127 | */ |
128 | 128 | public static function get_iframe_embed_button() { |
129 | - if ( ! self::$_iframe_embed_button instanceof EventListIframeEmbedButton ) { |
|
129 | + if ( ! self::$_iframe_embed_button instanceof EventListIframeEmbedButton) { |
|
130 | 130 | self::$_iframe_embed_button = new EventListIframeEmbedButton(); |
131 | 131 | } |
132 | 132 | return self::$_iframe_embed_button; |
@@ -152,35 +152,35 @@ discard block |
||
152 | 152 | * @param \EE_Events_Archive_Config $config |
153 | 153 | * @return \EE_Template_Part_Manager |
154 | 154 | */ |
155 | - public function initialize_template_parts( EE_Events_Archive_Config $config = null ) { |
|
155 | + public function initialize_template_parts(EE_Events_Archive_Config $config = null) { |
|
156 | 156 | $config = $config instanceof EE_Events_Archive_Config ? $config : $this->config(); |
157 | 157 | EEH_Autoloader::instance()->register_template_part_autoloaders(); |
158 | 158 | $template_parts = new EE_Template_Part_Manager(); |
159 | 159 | $template_parts->add_template_part( |
160 | 160 | 'tickets', |
161 | - __( 'Ticket Selector', 'event_espresso' ), |
|
161 | + __('Ticket Selector', 'event_espresso'), |
|
162 | 162 | 'content-espresso_events-tickets.php', |
163 | 163 | $config->display_order_tickets |
164 | 164 | ); |
165 | 165 | $template_parts->add_template_part( |
166 | 166 | 'datetimes', |
167 | - __( 'Dates and Times', 'event_espresso' ), |
|
167 | + __('Dates and Times', 'event_espresso'), |
|
168 | 168 | 'content-espresso_events-datetimes.php', |
169 | 169 | $config->display_order_datetimes |
170 | 170 | ); |
171 | 171 | $template_parts->add_template_part( |
172 | 172 | 'event', |
173 | - __( 'Event Description', 'event_espresso' ), |
|
173 | + __('Event Description', 'event_espresso'), |
|
174 | 174 | 'content-espresso_events-details.php', |
175 | 175 | $config->display_order_event |
176 | 176 | ); |
177 | 177 | $template_parts->add_template_part( |
178 | 178 | 'venue', |
179 | - __( 'Venue Information', 'event_espresso' ), |
|
179 | + __('Venue Information', 'event_espresso'), |
|
180 | 180 | 'content-espresso_events-venues.php', |
181 | 181 | $config->display_order_venue |
182 | 182 | ); |
183 | - do_action( 'AHEE__EED_Event_Archive__initialize_template_parts', $template_parts ); |
|
183 | + do_action('AHEE__EED_Event_Archive__initialize_template_parts', $template_parts); |
|
184 | 184 | return $template_parts; |
185 | 185 | } |
186 | 186 | |
@@ -193,8 +193,8 @@ discard block |
||
193 | 193 | * @param WP $WP |
194 | 194 | * @return void |
195 | 195 | */ |
196 | - public function run( $WP ) { |
|
197 | - do_action( 'AHEE__EED_Events_Archive__before_run' ); |
|
196 | + public function run($WP) { |
|
197 | + do_action('AHEE__EED_Events_Archive__before_run'); |
|
198 | 198 | // ensure valid EE_Events_Archive_Config() object exists |
199 | 199 | $this->set_config(); |
200 | 200 | /** @type EE_Events_Archive_Config $config */ |
@@ -206,14 +206,14 @@ discard block |
||
206 | 206 | EEH_Event_Query::add_query_filters(); |
207 | 207 | // set params that will get used by the filters |
208 | 208 | EEH_Event_Query::set_query_params( |
209 | - '', // month |
|
210 | - '', // category |
|
211 | - $config->display_expired_events, // show_expired |
|
212 | - 'start_date', // orderby |
|
209 | + '', // month |
|
210 | + '', // category |
|
211 | + $config->display_expired_events, // show_expired |
|
212 | + 'start_date', // orderby |
|
213 | 213 | 'ASC' // sort |
214 | 214 | ); |
215 | 215 | // check what template is loaded |
216 | - add_filter( 'template_include', array( $this, 'template_include' ), 999, 1 ); |
|
216 | + add_filter('template_include', array($this, 'template_include'), 999, 1); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | */ |
242 | 242 | public function event_list_iframe() { |
243 | 243 | \EED_Events_Archive::$iframe = true; |
244 | - $event_list_iframe = new EventsArchiveIframe( $this ); |
|
244 | + $event_list_iframe = new EventsArchiveIframe($this); |
|
245 | 245 | $event_list_iframe->display(); |
246 | 246 | } |
247 | 247 | |
@@ -269,32 +269,32 @@ discard block |
||
269 | 269 | * @param string $template |
270 | 270 | * @return string |
271 | 271 | */ |
272 | - public function template_include( $template = '' ) { |
|
272 | + public function template_include($template = '') { |
|
273 | 273 | // don't add content filter for dedicated EE child themes or private posts |
274 | - if ( ! EEH_Template::is_espresso_theme() ) { |
|
274 | + if ( ! EEH_Template::is_espresso_theme()) { |
|
275 | 275 | /** @type EE_Events_Archive_Config $config */ |
276 | 276 | $config = $this->config(); |
277 | 277 | // add status banner ? |
278 | - if ( $config->display_status_banner ) { |
|
279 | - add_filter( 'the_title', array( 'EED_Events_Archive', 'the_title' ), 100, 2 ); |
|
278 | + if ($config->display_status_banner) { |
|
279 | + add_filter('the_title', array('EED_Events_Archive', 'the_title'), 100, 2); |
|
280 | 280 | } |
281 | 281 | // if NOT a custom template |
282 | 282 | if ( |
283 | - EE_Registry::instance()->load_core( 'Front_Controller', array(), false, true )->get_selected_template() != 'archive-espresso_events.php' |
|
284 | - || apply_filters( 'FHEE__EED_Event_Archive__template_include__allow_custom_selected_template', FALSE ) |
|
283 | + EE_Registry::instance()->load_core('Front_Controller', array(), false, true)->get_selected_template() != 'archive-espresso_events.php' |
|
284 | + || apply_filters('FHEE__EED_Event_Archive__template_include__allow_custom_selected_template', FALSE) |
|
285 | 285 | ) { |
286 | 286 | // don't display entry meta because the existing theme will take care of that |
287 | - add_filter( 'FHEE__EED_Events_Archive__template_include__events_list_active', '__return_true' ); |
|
287 | + add_filter('FHEE__EED_Events_Archive__template_include__events_list_active', '__return_true'); |
|
288 | 288 | // load functions.php file for the theme (loaded by WP if using child theme) |
289 | 289 | EEH_Template::load_espresso_theme_functions(); |
290 | 290 | // because we don't know if the theme is using the_excerpt() |
291 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
291 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
292 | 292 | // or the_content |
293 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
293 | + add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
294 | 294 | // and just in case they are running get_the_excerpt() which DESTROYS things |
295 | - add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 ); |
|
295 | + add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); |
|
296 | 296 | // don't display entry meta because the existing theme will take care of that |
297 | - add_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' ); |
|
297 | + add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false'); |
|
298 | 298 | } |
299 | 299 | } |
300 | 300 | return $template; |
@@ -309,17 +309,17 @@ discard block |
||
309 | 309 | * @param string $excerpt |
310 | 310 | * @return string |
311 | 311 | */ |
312 | - public static function get_the_excerpt( $excerpt = '' ) { |
|
313 | - if ( post_password_required() ) { |
|
312 | + public static function get_the_excerpt($excerpt = '') { |
|
313 | + if (post_password_required()) { |
|
314 | 314 | return $excerpt; |
315 | 315 | } |
316 | - if ( apply_filters( 'FHEE__EED_Events_Archive__get_the_excerpt__theme_uses_get_the_excerpt', false ) ) { |
|
317 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
318 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
319 | - $excerpt = EED_Events_Archive::event_details( $excerpt ); |
|
316 | + if (apply_filters('FHEE__EED_Events_Archive__get_the_excerpt__theme_uses_get_the_excerpt', false)) { |
|
317 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
318 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
319 | + $excerpt = EED_Events_Archive::event_details($excerpt); |
|
320 | 320 | } else { |
321 | 321 | EED_Events_Archive::$using_get_the_excerpt = true; |
322 | - add_filter( 'wp_trim_excerpt', array( 'EED_Events_Archive', 'end_get_the_excerpt' ), 999, 1 ); |
|
322 | + add_filter('wp_trim_excerpt', array('EED_Events_Archive', 'end_get_the_excerpt'), 999, 1); |
|
323 | 323 | } |
324 | 324 | return $excerpt; |
325 | 325 | } |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * @param string $text |
334 | 334 | * @return string |
335 | 335 | */ |
336 | - public static function end_get_the_excerpt( $text = '' ) { |
|
336 | + public static function end_get_the_excerpt($text = '') { |
|
337 | 337 | EED_Events_Archive::$using_get_the_excerpt = false; |
338 | 338 | return $text; |
339 | 339 | } |
@@ -348,10 +348,10 @@ discard block |
||
348 | 348 | * @param string $id |
349 | 349 | * @return string |
350 | 350 | */ |
351 | - public static function the_title( $title = '', $id = '' ) { |
|
351 | + public static function the_title($title = '', $id = '') { |
|
352 | 352 | global $post; |
353 | - if ( $post instanceof WP_Post ) { |
|
354 | - return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID ) . $title : $title; |
|
353 | + if ($post instanceof WP_Post) { |
|
354 | + return in_the_loop() && $post->ID == $id ? espresso_event_status_banner($post->ID).$title : $title; |
|
355 | 355 | } |
356 | 356 | return $title; |
357 | 357 | } |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | * @param string $content |
366 | 366 | * @return string |
367 | 367 | */ |
368 | - public static function event_details( $content ) { |
|
368 | + public static function event_details($content) { |
|
369 | 369 | global $post; |
370 | 370 | static $current_post_ID = 0; |
371 | 371 | if ( |
@@ -374,8 +374,8 @@ discard block |
||
374 | 374 | && ! EED_Events_Archive::$using_get_the_excerpt |
375 | 375 | && ! post_password_required() |
376 | 376 | && ( |
377 | - apply_filters( 'FHEE__EES_Espresso_Events__process_shortcode__true', false ) |
|
378 | - || ! apply_filters( 'FHEE__content_espresso_events__template_loaded', false ) |
|
377 | + apply_filters('FHEE__EES_Espresso_Events__process_shortcode__true', false) |
|
378 | + || ! apply_filters('FHEE__content_espresso_events__template_loaded', false) |
|
379 | 379 | ) |
380 | 380 | ) { |
381 | 381 | // Set current post ID to prevent showing content twice, but only if headers have definitely been sent. |
@@ -384,8 +384,8 @@ discard block |
||
384 | 384 | // We want to allow those plugins to still do their thing and have access to our content, but depending on |
385 | 385 | // how your event content is being displayed (shortcode, CPT route, etc), this filter can get applied twice, |
386 | 386 | // so the following allows this filter to be applied multiple times, but only once for real |
387 | - $current_post_ID = did_action( 'loop_start' ) ? $post->ID : 0; |
|
388 | - if ( EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->use_sortable_display_order ) { |
|
387 | + $current_post_ID = did_action('loop_start') ? $post->ID : 0; |
|
388 | + if (EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->use_sortable_display_order) { |
|
389 | 389 | $content = \EED_Events_Archive::use_sortable_display_order(); |
390 | 390 | } else { |
391 | 391 | $content = \EED_Events_Archive::use_filterable_display_order(); |
@@ -404,20 +404,20 @@ discard block |
||
404 | 404 | */ |
405 | 405 | protected static function use_sortable_display_order() { |
406 | 406 | // no further password checks required atm |
407 | - add_filter( 'FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true' ); |
|
407 | + add_filter('FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true'); |
|
408 | 408 | // 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) |
409 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
410 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
411 | - remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 ); |
|
409 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
410 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
411 | + remove_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1); |
|
412 | 412 | // now add additional content depending on whether event is using the_excerpt() or the_content() |
413 | 413 | EED_Events_Archive::instance()->template_parts = EED_Events_Archive::instance()->initialize_template_parts(); |
414 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
415 | - $content = EED_Events_Archive::instance()->template_parts->apply_template_part_filters( $content ); |
|
414 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
415 | + $content = EED_Events_Archive::instance()->template_parts->apply_template_part_filters($content); |
|
416 | 416 | // re-add our main filters (or else the next event won't have them) |
417 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
418 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
419 | - add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 ); |
|
420 | - remove_filter( 'FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true' ); |
|
417 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
418 | + add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
419 | + add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); |
|
420 | + remove_filter('FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true'); |
|
421 | 421 | return $content; |
422 | 422 | } |
423 | 423 | |
@@ -432,22 +432,22 @@ discard block |
||
432 | 432 | protected static function use_filterable_display_order() { |
433 | 433 | // we need to first remove this callback from being applied to the_content() |
434 | 434 | // (otherwise it will recurse and blow up the interweb) |
435 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
436 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
437 | - remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 ); |
|
435 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
436 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
437 | + remove_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1); |
|
438 | 438 | //now add additional content depending on whether event is using the_excerpt() or the_content() |
439 | 439 | EED_Events_Archive::_add_additional_excerpt_filters(); |
440 | 440 | EED_Events_Archive::_add_additional_content_filters(); |
441 | - do_action( 'AHEE__EED_Events_Archive__use_filterable_display_order__after_add_filters' ); |
|
441 | + do_action('AHEE__EED_Events_Archive__use_filterable_display_order__after_add_filters'); |
|
442 | 442 | // now load our template |
443 | - $content = EEH_Template::locate_template( 'content-espresso_events-details.php' ); |
|
443 | + $content = EEH_Template::locate_template('content-espresso_events-details.php'); |
|
444 | 444 | // re-add our main filters (or else the next event won't have them) |
445 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
446 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 ); |
|
447 | - add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 ); |
|
445 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
446 | + add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1); |
|
447 | + add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1); |
|
448 | 448 | // but remove the other filters so that they don't get applied to the next post |
449 | 449 | EED_Events_Archive::_remove_additional_events_archive_filters(); |
450 | - do_action( 'AHEE__EED_Events_Archive__use_filterable_display_order__after_remove_filters' ); |
|
450 | + do_action('AHEE__EED_Events_Archive__use_filterable_display_order__after_remove_filters'); |
|
451 | 451 | // we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt) |
452 | 452 | //return ! empty( $template ) ? $template : $content; |
453 | 453 | return $content; |
@@ -462,11 +462,11 @@ discard block |
||
462 | 462 | * @param string $content |
463 | 463 | * @return string |
464 | 464 | */ |
465 | - public static function event_datetimes( $content ) { |
|
466 | - if ( post_password_required() ) { |
|
465 | + public static function event_datetimes($content) { |
|
466 | + if (post_password_required()) { |
|
467 | 467 | return $content; |
468 | 468 | } |
469 | - return EEH_Template::locate_template( 'content-espresso_events-datetimes.php' ) . $content; |
|
469 | + return EEH_Template::locate_template('content-espresso_events-datetimes.php').$content; |
|
470 | 470 | } |
471 | 471 | |
472 | 472 | /** |
@@ -476,11 +476,11 @@ discard block |
||
476 | 476 | * @param string $content |
477 | 477 | * @return string |
478 | 478 | */ |
479 | - public static function event_tickets( $content ) { |
|
480 | - if ( post_password_required() ) { |
|
479 | + public static function event_tickets($content) { |
|
480 | + if (post_password_required()) { |
|
481 | 481 | return $content; |
482 | 482 | } |
483 | - return EEH_Template::locate_template( 'content-espresso_events-tickets.php' ) . $content; |
|
483 | + return EEH_Template::locate_template('content-espresso_events-tickets.php').$content; |
|
484 | 484 | } |
485 | 485 | |
486 | 486 | |
@@ -492,8 +492,8 @@ discard block |
||
492 | 492 | * @param string $content |
493 | 493 | * @return string |
494 | 494 | */ |
495 | - public static function event_venue( $content ) { |
|
496 | - return EED_Events_Archive::event_venues( $content ); |
|
495 | + public static function event_venue($content) { |
|
496 | + return EED_Events_Archive::event_venues($content); |
|
497 | 497 | } |
498 | 498 | |
499 | 499 | /** |
@@ -503,11 +503,11 @@ discard block |
||
503 | 503 | * @param string $content |
504 | 504 | * @return string |
505 | 505 | */ |
506 | - public static function event_venues( $content ) { |
|
507 | - if ( post_password_required() ) { |
|
506 | + public static function event_venues($content) { |
|
507 | + if (post_password_required()) { |
|
508 | 508 | return $content; |
509 | 509 | } |
510 | - return $content . EEH_Template::locate_template( 'content-espresso_events-venues.php' ); |
|
510 | + return $content.EEH_Template::locate_template('content-espresso_events-venues.php'); |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | |
@@ -519,9 +519,9 @@ discard block |
||
519 | 519 | * @return void |
520 | 520 | */ |
521 | 521 | private static function _add_additional_excerpt_filters() { |
522 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110, 1 ); |
|
523 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120, 1 ); |
|
524 | - add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130, 1 ); |
|
522 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110, 1); |
|
523 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120, 1); |
|
524 | + add_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130, 1); |
|
525 | 525 | } |
526 | 526 | |
527 | 527 | |
@@ -533,9 +533,9 @@ discard block |
||
533 | 533 | * @return void |
534 | 534 | */ |
535 | 535 | private static function _add_additional_content_filters() { |
536 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110, 1 ); |
|
537 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120, 1 ); |
|
538 | - add_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130, 1 ); |
|
536 | + add_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110, 1); |
|
537 | + add_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120, 1); |
|
538 | + add_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130, 1); |
|
539 | 539 | } |
540 | 540 | |
541 | 541 | |
@@ -547,12 +547,12 @@ discard block |
||
547 | 547 | * @return void |
548 | 548 | */ |
549 | 549 | private static function _remove_additional_events_archive_filters() { |
550 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
551 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
552 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
553 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
554 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
555 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
550 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
551 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120); |
|
552 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130); |
|
553 | + remove_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
554 | + remove_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120); |
|
555 | + remove_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130); |
|
556 | 556 | } |
557 | 557 | |
558 | 558 | |
@@ -565,17 +565,17 @@ discard block |
||
565 | 565 | */ |
566 | 566 | public static function remove_all_events_archive_filters() { |
567 | 567 | //remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 ); |
568 | - remove_filter( 'the_title', array( 'EED_Events_Archive', 'the_title' ), 100 ); |
|
569 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
570 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
571 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
572 | - remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
573 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 ); |
|
574 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110 ); |
|
575 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120 ); |
|
576 | - remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130 ); |
|
568 | + remove_filter('the_title', array('EED_Events_Archive', 'the_title'), 100); |
|
569 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100); |
|
570 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
571 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120); |
|
572 | + remove_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130); |
|
573 | + remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100); |
|
574 | + remove_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110); |
|
575 | + remove_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120); |
|
576 | + remove_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130); |
|
577 | 577 | // don't display entry meta because the existing theme will take care of that |
578 | - remove_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' ); |
|
578 | + remove_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false'); |
|
579 | 579 | } |
580 | 580 | |
581 | 581 | |
@@ -590,12 +590,12 @@ discard block |
||
590 | 590 | * @return void |
591 | 591 | */ |
592 | 592 | public function load_event_list_assets() { |
593 | - do_action( 'AHEE__EED_Events_Archive__before_load_assets' ); |
|
594 | - add_filter( 'FHEE_load_EE_Session', '__return_true' ); |
|
595 | - add_filter( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' ); |
|
596 | - add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 ); |
|
597 | - if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) { |
|
598 | - add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 ); |
|
593 | + do_action('AHEE__EED_Events_Archive__before_load_assets'); |
|
594 | + add_filter('FHEE_load_EE_Session', '__return_true'); |
|
595 | + add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true'); |
|
596 | + add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10); |
|
597 | + if (EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
598 | + add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11); |
|
599 | 599 | } |
600 | 600 | } |
601 | 601 | |
@@ -612,13 +612,13 @@ discard block |
||
612 | 612 | */ |
613 | 613 | public function wp_enqueue_scripts() { |
614 | 614 | // get some style |
615 | - if ( apply_filters( 'FHEE_enable_default_espresso_css', FALSE ) ) { |
|
615 | + if (apply_filters('FHEE_enable_default_espresso_css', FALSE)) { |
|
616 | 616 | // first check uploads folder |
617 | - if ( EEH_File::is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) { |
|
618 | - wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' )); |
|
617 | + if (EEH_File::is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) { |
|
618 | + wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default')); |
|
619 | 619 | } else { |
620 | 620 | } |
621 | - wp_enqueue_style( $this->theme ); |
|
621 | + wp_enqueue_style($this->theme); |
|
622 | 622 | |
623 | 623 | } |
624 | 624 | } |
@@ -636,8 +636,8 @@ discard block |
||
636 | 636 | */ |
637 | 637 | public static function template_settings_form() { |
638 | 638 | $template_settings = EE_Registry::instance()->CFG->template_settings; |
639 | - $template_settings->EED_Events_Archive = isset( $template_settings->EED_Events_Archive ) ? $template_settings->EED_Events_Archive : new EE_Events_Archive_Config(); |
|
640 | - $template_settings->EED_Events_Archive = apply_filters( 'FHEE__EED_Events_Archive__template_settings_form__event_list_config', $template_settings->EED_Events_Archive ); |
|
639 | + $template_settings->EED_Events_Archive = isset($template_settings->EED_Events_Archive) ? $template_settings->EED_Events_Archive : new EE_Events_Archive_Config(); |
|
640 | + $template_settings->EED_Events_Archive = apply_filters('FHEE__EED_Events_Archive__template_settings_form__event_list_config', $template_settings->EED_Events_Archive); |
|
641 | 641 | $events_archive_settings = array( |
642 | 642 | 'display_status_banner' => 0, |
643 | 643 | 'display_description' => 1, |
@@ -646,8 +646,8 @@ discard block |
||
646 | 646 | 'display_venue' => 0, |
647 | 647 | 'display_expired_events' => 0 |
648 | 648 | ); |
649 | - $events_archive_settings = array_merge( $events_archive_settings, (array)$template_settings->EED_Events_Archive ); |
|
650 | - EEH_Template::display_template( EVENTS_ARCHIVE_TEMPLATES_PATH . 'admin-event-list-settings.template.php', $events_archive_settings ); |
|
649 | + $events_archive_settings = array_merge($events_archive_settings, (array) $template_settings->EED_Events_Archive); |
|
650 | + EEH_Template::display_template(EVENTS_ARCHIVE_TEMPLATES_PATH.'admin-event-list-settings.template.php', $events_archive_settings); |
|
651 | 651 | } |
652 | 652 | |
653 | 653 | |
@@ -663,16 +663,16 @@ discard block |
||
663 | 663 | * @param EE_Request_Handler $REQ |
664 | 664 | * @return EE_Template_Config |
665 | 665 | */ |
666 | - public static function update_template_settings( $CFG, $REQ ) { |
|
666 | + public static function update_template_settings($CFG, $REQ) { |
|
667 | 667 | $CFG->EED_Events_Archive = new EE_Events_Archive_Config(); |
668 | 668 | // unless we are resetting the config... |
669 | - if ( ! isset( $REQ['EED_Events_Archive_reset_event_list_settings'] ) || absint( $REQ['EED_Events_Archive_reset_event_list_settings'] ) !== 1 ) { |
|
670 | - $CFG->EED_Events_Archive->display_status_banner = isset( $REQ['EED_Events_Archive_display_status_banner'] ) ? absint( $REQ['EED_Events_Archive_display_status_banner'] ) : 0; |
|
671 | - $CFG->EED_Events_Archive->display_description = isset( $REQ['EED_Events_Archive_display_description'] ) ? absint( $REQ['EED_Events_Archive_display_description'] ) : 1; |
|
672 | - $CFG->EED_Events_Archive->display_ticket_selector = isset( $REQ['EED_Events_Archive_display_ticket_selector'] ) ? absint( $REQ['EED_Events_Archive_display_ticket_selector'] ) : 0; |
|
673 | - $CFG->EED_Events_Archive->display_datetimes = isset( $REQ['EED_Events_Archive_display_datetimes'] ) ? absint( $REQ['EED_Events_Archive_display_datetimes'] ) : 1; |
|
674 | - $CFG->EED_Events_Archive->display_venue = isset( $REQ['EED_Events_Archive_display_venue'] ) ? absint( $REQ['EED_Events_Archive_display_venue'] ) : 0; |
|
675 | - $CFG->EED_Events_Archive->display_expired_events = isset( $REQ['EED_Events_Archive_display_expired_events'] ) ? absint( $REQ['EED_Events_Archive_display_expired_events'] ) : 0; } |
|
669 | + if ( ! isset($REQ['EED_Events_Archive_reset_event_list_settings']) || absint($REQ['EED_Events_Archive_reset_event_list_settings']) !== 1) { |
|
670 | + $CFG->EED_Events_Archive->display_status_banner = isset($REQ['EED_Events_Archive_display_status_banner']) ? absint($REQ['EED_Events_Archive_display_status_banner']) : 0; |
|
671 | + $CFG->EED_Events_Archive->display_description = isset($REQ['EED_Events_Archive_display_description']) ? absint($REQ['EED_Events_Archive_display_description']) : 1; |
|
672 | + $CFG->EED_Events_Archive->display_ticket_selector = isset($REQ['EED_Events_Archive_display_ticket_selector']) ? absint($REQ['EED_Events_Archive_display_ticket_selector']) : 0; |
|
673 | + $CFG->EED_Events_Archive->display_datetimes = isset($REQ['EED_Events_Archive_display_datetimes']) ? absint($REQ['EED_Events_Archive_display_datetimes']) : 1; |
|
674 | + $CFG->EED_Events_Archive->display_venue = isset($REQ['EED_Events_Archive_display_venue']) ? absint($REQ['EED_Events_Archive_display_venue']) : 0; |
|
675 | + $CFG->EED_Events_Archive->display_expired_events = isset($REQ['EED_Events_Archive_display_expired_events']) ? absint($REQ['EED_Events_Archive_display_expired_events']) : 0; } |
|
676 | 676 | return $CFG; |
677 | 677 | } |
678 | 678 | |
@@ -685,10 +685,10 @@ discard block |
||
685 | 685 | * @param string $extra_class |
686 | 686 | * @return string |
687 | 687 | */ |
688 | - public static function event_list_css( $extra_class = '' ) { |
|
689 | - $event_list_css = ! empty( $extra_class ) ? array( $extra_class ) : array(); |
|
688 | + public static function event_list_css($extra_class = '') { |
|
689 | + $event_list_css = ! empty($extra_class) ? array($extra_class) : array(); |
|
690 | 690 | $event_list_css[] = 'espresso-event-list-event'; |
691 | - return implode( ' ', $event_list_css ); |
|
691 | + return implode(' ', $event_list_css); |
|
692 | 692 | } |
693 | 693 | |
694 | 694 | |
@@ -715,9 +715,9 @@ discard block |
||
715 | 715 | * @param $value |
716 | 716 | * @return bool |
717 | 717 | */ |
718 | - public static function display_description( $value ) { |
|
718 | + public static function display_description($value) { |
|
719 | 719 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
720 | - $display_description= isset( $config->display_description ) ? $config->display_description : 1; |
|
720 | + $display_description = isset($config->display_description) ? $config->display_description : 1; |
|
721 | 721 | return $display_description === $value ? TRUE : FALSE; |
722 | 722 | } |
723 | 723 | |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | */ |
731 | 731 | public static function display_ticket_selector() { |
732 | 732 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
733 | - return isset( $config->display_ticket_selector ) && $config->display_ticket_selector ? TRUE : FALSE; |
|
733 | + return isset($config->display_ticket_selector) && $config->display_ticket_selector ? TRUE : FALSE; |
|
734 | 734 | } |
735 | 735 | |
736 | 736 | |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | */ |
744 | 744 | public static function display_venue() { |
745 | 745 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
746 | - return isset( $config->display_venue ) && $config->display_venue && EEH_Venue_View::venue_name() ? TRUE : FALSE; |
|
746 | + return isset($config->display_venue) && $config->display_venue && EEH_Venue_View::venue_name() ? TRUE : FALSE; |
|
747 | 747 | } |
748 | 748 | |
749 | 749 | |
@@ -755,7 +755,7 @@ discard block |
||
755 | 755 | */ |
756 | 756 | public static function display_datetimes() { |
757 | 757 | $config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive; |
758 | - return isset( $config->display_datetimes ) && $config->display_datetimes ? TRUE : FALSE; |
|
758 | + return isset($config->display_datetimes) && $config->display_datetimes ? TRUE : FALSE; |
|
759 | 759 | } |
760 | 760 | |
761 | 761 | |
@@ -770,7 +770,7 @@ discard block |
||
770 | 770 | * @return string |
771 | 771 | */ |
772 | 772 | public static function event_list_title() { |
773 | - return apply_filters( 'FHEE__archive_espresso_events_template__upcoming_events_h1', __( 'Upcoming Events', 'event_espresso' )); |
|
773 | + return apply_filters('FHEE__archive_espresso_events_template__upcoming_events_h1', __('Upcoming Events', 'event_espresso')); |
|
774 | 774 | } |
775 | 775 | |
776 | 776 | |
@@ -779,11 +779,11 @@ discard block |
||
779 | 779 | /** |
780 | 780 | * @since 4.4.0 |
781 | 781 | */ |
782 | - public static function _doing_it_wrong_notice( $function = '' ) { |
|
782 | + public static function _doing_it_wrong_notice($function = '') { |
|
783 | 783 | EE_Error::doing_it_wrong( |
784 | 784 | __FUNCTION__, |
785 | 785 | sprintf( |
786 | - __( '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' ), |
|
786 | + __('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'), |
|
787 | 787 | $function, |
788 | 788 | '<br />', |
789 | 789 | '4.6.0' |
@@ -805,89 +805,89 @@ discard block |
||
805 | 805 | * @deprecated |
806 | 806 | * @since 4.4.0 |
807 | 807 | */ |
808 | - public function posts_fields( $SQL, WP_Query $wp_query ) { |
|
809 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
810 | - return EEH_Event_Query::posts_fields( $SQL, $wp_query ); |
|
808 | + public function posts_fields($SQL, WP_Query $wp_query) { |
|
809 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
810 | + return EEH_Event_Query::posts_fields($SQL, $wp_query); |
|
811 | 811 | } |
812 | 812 | /** |
813 | 813 | * @deprecated |
814 | 814 | * @since 4.4.0 |
815 | 815 | */ |
816 | - public static function posts_fields_sql_for_orderby( $orderby_params = array() ) { |
|
817 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
818 | - return EEH_Event_Query::posts_fields_sql_for_orderby( $orderby_params ); |
|
816 | + public static function posts_fields_sql_for_orderby($orderby_params = array()) { |
|
817 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
818 | + return EEH_Event_Query::posts_fields_sql_for_orderby($orderby_params); |
|
819 | 819 | } |
820 | 820 | /** |
821 | 821 | * @deprecated |
822 | 822 | * @since 4.4.0 |
823 | 823 | */ |
824 | - public function posts_join( $SQL, WP_Query $wp_query ) { |
|
825 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
826 | - return EEH_Event_Query::posts_join( $SQL, $wp_query ); |
|
824 | + public function posts_join($SQL, WP_Query $wp_query) { |
|
825 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
826 | + return EEH_Event_Query::posts_join($SQL, $wp_query); |
|
827 | 827 | } |
828 | 828 | /** |
829 | 829 | * @deprecated |
830 | 830 | * @since 4.4.0 |
831 | 831 | */ |
832 | - public static function posts_join_sql_for_terms( $join_terms = NULL ) { |
|
833 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
834 | - return EEH_Event_Query::posts_join_sql_for_terms( $join_terms ); |
|
832 | + public static function posts_join_sql_for_terms($join_terms = NULL) { |
|
833 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
834 | + return EEH_Event_Query::posts_join_sql_for_terms($join_terms); |
|
835 | 835 | } |
836 | 836 | /** |
837 | 837 | * @deprecated |
838 | 838 | * @since 4.4.0 |
839 | 839 | */ |
840 | - public static function posts_join_for_orderby( $orderby_params = array() ) { |
|
841 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
842 | - return EEH_Event_Query::posts_join_for_orderby( $orderby_params ); |
|
840 | + public static function posts_join_for_orderby($orderby_params = array()) { |
|
841 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
842 | + return EEH_Event_Query::posts_join_for_orderby($orderby_params); |
|
843 | 843 | } |
844 | 844 | /** |
845 | 845 | * @deprecated |
846 | 846 | * @since 4.4.0 |
847 | 847 | */ |
848 | - public function posts_where( $SQL, WP_Query $wp_query ) { |
|
849 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
850 | - return EEH_Event_Query::posts_where( $SQL, $wp_query ); |
|
848 | + public function posts_where($SQL, WP_Query $wp_query) { |
|
849 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
850 | + return EEH_Event_Query::posts_where($SQL, $wp_query); |
|
851 | 851 | } |
852 | 852 | /** |
853 | 853 | * @deprecated |
854 | 854 | * @since 4.4.0 |
855 | 855 | */ |
856 | - public static function posts_where_sql_for_show_expired( $show_expired = FALSE ) { |
|
857 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
858 | - return EEH_Event_Query::posts_where_sql_for_show_expired( $show_expired ); |
|
856 | + public static function posts_where_sql_for_show_expired($show_expired = FALSE) { |
|
857 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
858 | + return EEH_Event_Query::posts_where_sql_for_show_expired($show_expired); |
|
859 | 859 | } |
860 | 860 | /** |
861 | 861 | * @deprecated |
862 | 862 | * @since 4.4.0 |
863 | 863 | */ |
864 | - public static function posts_where_sql_for_event_category_slug( $event_category_slug = NULL ) { |
|
865 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
866 | - return EEH_Event_Query::posts_where_sql_for_event_category_slug( $event_category_slug ); |
|
864 | + public static function posts_where_sql_for_event_category_slug($event_category_slug = NULL) { |
|
865 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
866 | + return EEH_Event_Query::posts_where_sql_for_event_category_slug($event_category_slug); |
|
867 | 867 | } |
868 | 868 | /** |
869 | 869 | * @deprecated |
870 | 870 | * @since 4.4.0 |
871 | 871 | */ |
872 | - public static function posts_where_sql_for_event_list_month( $month = NULL ) { |
|
873 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
874 | - return EEH_Event_Query::posts_where_sql_for_event_list_month( $month ); |
|
872 | + public static function posts_where_sql_for_event_list_month($month = NULL) { |
|
873 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
874 | + return EEH_Event_Query::posts_where_sql_for_event_list_month($month); |
|
875 | 875 | } |
876 | 876 | /** |
877 | 877 | * @deprecated |
878 | 878 | * @since 4.4.0 |
879 | 879 | */ |
880 | - public function posts_orderby( $SQL, WP_Query $wp_query ) { |
|
881 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
882 | - return EEH_Event_Query::posts_orderby( $SQL, $wp_query ); |
|
880 | + public function posts_orderby($SQL, WP_Query $wp_query) { |
|
881 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
882 | + return EEH_Event_Query::posts_orderby($SQL, $wp_query); |
|
883 | 883 | } |
884 | 884 | /** |
885 | 885 | * @deprecated |
886 | 886 | * @since 4.4.0 |
887 | 887 | */ |
888 | - public static function posts_orderby_sql( $orderby_params = array(), $sort = 'ASC' ) { |
|
889 | - EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ ); |
|
890 | - return EEH_Event_Query::posts_orderby_sql( $orderby_params, $sort ); |
|
888 | + public static function posts_orderby_sql($orderby_params = array(), $sort = 'ASC') { |
|
889 | + EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__); |
|
890 | + return EEH_Event_Query::posts_orderby_sql($orderby_params, $sort); |
|
891 | 891 | } |
892 | 892 | |
893 | 893 | |
@@ -918,8 +918,8 @@ discard block |
||
918 | 918 | * @param string $extra_class |
919 | 919 | * @return string |
920 | 920 | */ |
921 | -function espresso_event_list_css( $extra_class = '' ) { |
|
922 | - return EED_Events_Archive::event_list_css( $extra_class ); |
|
921 | +function espresso_event_list_css($extra_class = '') { |
|
922 | + return EED_Events_Archive::event_list_css($extra_class); |
|
923 | 923 | } |
924 | 924 | |
925 | 925 | /** |
@@ -933,14 +933,14 @@ discard block |
||
933 | 933 | * @return bool |
934 | 934 | */ |
935 | 935 | function espresso_display_full_description_in_event_list() { |
936 | - return EED_Events_Archive::display_description( 2 ); |
|
936 | + return EED_Events_Archive::display_description(2); |
|
937 | 937 | } |
938 | 938 | |
939 | 939 | /** |
940 | 940 | * @return bool |
941 | 941 | */ |
942 | 942 | function espresso_display_excerpt_in_event_list() { |
943 | - return EED_Events_Archive::display_description( 1 ); |
|
943 | + return EED_Events_Archive::display_description(1); |
|
944 | 944 | } |
945 | 945 | |
946 | 946 | /** |
@@ -3,7 +3,9 @@ |
||
3 | 3 | use EventEspresso\core\libraries\iframe_display\EventListIframeEmbedButton; |
4 | 4 | use EventEspresso\modules\events_archive\EventsArchiveIframe; |
5 | 5 | |
6 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
6 | +if ( ! defined( 'EVENT_ESPRESSO_VERSION')) { |
|
7 | + exit('No direct script access allowed'); |
|
8 | +} |
|
7 | 9 | /** |
8 | 10 | * Event Espresso |
9 | 11 | * |
@@ -128,7 +128,8 @@ |
||
128 | 128 | * |
129 | 129 | * @param bool $display true = we'll return a localized string, otherwise we just return the value of the relevant status const |
130 | 130 | * @param bool | null $remaining if it is already known that tickets are available, then simply pass a bool to save further processing |
131 | - * @return mixed status int if the display string isn't requested |
|
131 | + * @param boolean $remaining |
|
132 | + * @return string status int if the display string isn't requested |
|
132 | 133 | * @throws \EE_Error |
133 | 134 | */ |
134 | 135 | public function ticket_status( $display = FALSE, $remaining = null ) { |
@@ -61,15 +61,15 @@ discard block |
||
61 | 61 | |
62 | 62 | |
63 | 63 | |
64 | - /** |
|
65 | - * @param array $props_n_values incoming values |
|
66 | - * @param string $timezone incoming timezone (if not set the timezone set for the website will be |
|
67 | - * used.) |
|
68 | - * @param array $date_formats incoming date_formats in an array where the first value is the |
|
69 | - * date_format and the second value is the time format |
|
70 | - * @return EE_Ticket |
|
71 | - * @throws \EE_Error |
|
72 | - */ |
|
64 | + /** |
|
65 | + * @param array $props_n_values incoming values |
|
66 | + * @param string $timezone incoming timezone (if not set the timezone set for the website will be |
|
67 | + * used.) |
|
68 | + * @param array $date_formats incoming date_formats in an array where the first value is the |
|
69 | + * date_format and the second value is the time format |
|
70 | + * @return EE_Ticket |
|
71 | + * @throws \EE_Error |
|
72 | + */ |
|
73 | 73 | public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
74 | 74 | $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats ); |
75 | 75 | return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats ); |
@@ -77,36 +77,36 @@ discard block |
||
77 | 77 | |
78 | 78 | |
79 | 79 | |
80 | - /** |
|
81 | - * @param array $props_n_values incoming values from the database |
|
82 | - * @param string $timezone incoming timezone as set by the model. If not set the timezone for |
|
83 | - * the website will be used. |
|
84 | - * @return EE_Ticket |
|
85 | - * @throws \EE_Error |
|
86 | - */ |
|
80 | + /** |
|
81 | + * @param array $props_n_values incoming values from the database |
|
82 | + * @param string $timezone incoming timezone as set by the model. If not set the timezone for |
|
83 | + * the website will be used. |
|
84 | + * @return EE_Ticket |
|
85 | + * @throws \EE_Error |
|
86 | + */ |
|
87 | 87 | public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
88 | 88 | return new self( $props_n_values, TRUE, $timezone ); |
89 | 89 | } |
90 | 90 | |
91 | 91 | |
92 | 92 | |
93 | - /** |
|
94 | - * @return bool |
|
95 | - * @throws \EE_Error |
|
96 | - */ |
|
93 | + /** |
|
94 | + * @return bool |
|
95 | + * @throws \EE_Error |
|
96 | + */ |
|
97 | 97 | public function parent() { |
98 | 98 | return $this->get( 'TKT_parent' ); |
99 | 99 | } |
100 | 100 | |
101 | 101 | |
102 | 102 | |
103 | - /** |
|
104 | - * return if a ticket has quantities available for purchase |
|
105 | - * |
|
106 | - * @param int $DTT_ID the primary key for a particular datetime |
|
107 | - * @return boolean |
|
108 | - * @throws \EE_Error |
|
109 | - */ |
|
103 | + /** |
|
104 | + * return if a ticket has quantities available for purchase |
|
105 | + * |
|
106 | + * @param int $DTT_ID the primary key for a particular datetime |
|
107 | + * @return boolean |
|
108 | + * @throws \EE_Error |
|
109 | + */ |
|
110 | 110 | public function available( $DTT_ID = 0 ) { |
111 | 111 | // are we checking availability for a particular datetime ? |
112 | 112 | if ( $DTT_ID ) { |
@@ -123,14 +123,14 @@ discard block |
||
123 | 123 | |
124 | 124 | |
125 | 125 | |
126 | - /** |
|
127 | - * Using the start date and end date this method calculates whether the ticket is On Sale, Pending, or Expired |
|
128 | - * |
|
129 | - * @param bool $display true = we'll return a localized string, otherwise we just return the value of the relevant status const |
|
130 | - * @param bool | null $remaining if it is already known that tickets are available, then simply pass a bool to save further processing |
|
131 | - * @return mixed status int if the display string isn't requested |
|
132 | - * @throws \EE_Error |
|
133 | - */ |
|
126 | + /** |
|
127 | + * Using the start date and end date this method calculates whether the ticket is On Sale, Pending, or Expired |
|
128 | + * |
|
129 | + * @param bool $display true = we'll return a localized string, otherwise we just return the value of the relevant status const |
|
130 | + * @param bool | null $remaining if it is already known that tickets are available, then simply pass a bool to save further processing |
|
131 | + * @return mixed status int if the display string isn't requested |
|
132 | + * @throws \EE_Error |
|
133 | + */ |
|
134 | 134 | public function ticket_status( $display = FALSE, $remaining = null ) { |
135 | 135 | $remaining = is_bool( $remaining ) ? $remaining : $this->is_remaining(); |
136 | 136 | if ( ! $remaining ) { |
@@ -153,14 +153,14 @@ discard block |
||
153 | 153 | |
154 | 154 | |
155 | 155 | |
156 | - /** |
|
157 | - * The purpose of this method is to simply return a boolean for whether there are any tickets remaining for sale considering ALL the factors used for figuring that out. |
|
158 | - * |
|
159 | - * @access public |
|
160 | - * @param int $DTT_ID if an int above 0 is included here then we get a specific dtt. |
|
161 | - * @return boolean true = tickets remaining, false not. |
|
162 | - * @throws \EE_Error |
|
163 | - */ |
|
156 | + /** |
|
157 | + * The purpose of this method is to simply return a boolean for whether there are any tickets remaining for sale considering ALL the factors used for figuring that out. |
|
158 | + * |
|
159 | + * @access public |
|
160 | + * @param int $DTT_ID if an int above 0 is included here then we get a specific dtt. |
|
161 | + * @return boolean true = tickets remaining, false not. |
|
162 | + * @throws \EE_Error |
|
163 | + */ |
|
164 | 164 | public function is_remaining( $DTT_ID = 0 ) { |
165 | 165 | $num_remaining = $this->remaining( $DTT_ID ); |
166 | 166 | if ( $num_remaining === 0 ) { |
@@ -174,76 +174,76 @@ discard block |
||
174 | 174 | |
175 | 175 | |
176 | 176 | |
177 | - /** |
|
178 | - * return the total number of tickets available for purchase |
|
179 | - * |
|
180 | - * @param int $DTT_ID the primary key for a particular datetime. |
|
181 | - * set to 0 for all related datetimes |
|
182 | - * @return int |
|
183 | - * @throws \EE_Error |
|
184 | - */ |
|
177 | + /** |
|
178 | + * return the total number of tickets available for purchase |
|
179 | + * |
|
180 | + * @param int $DTT_ID the primary key for a particular datetime. |
|
181 | + * set to 0 for all related datetimes |
|
182 | + * @return int |
|
183 | + * @throws \EE_Error |
|
184 | + */ |
|
185 | 185 | public function remaining( $DTT_ID = 0 ) { |
186 | 186 | return $this->real_quantity_on_ticket('saleable', $DTT_ID ); |
187 | 187 | } |
188 | 188 | |
189 | 189 | |
190 | 190 | |
191 | - /** |
|
192 | - * Gets min |
|
193 | - * |
|
194 | - * @return int |
|
195 | - * @throws \EE_Error |
|
196 | - */ |
|
191 | + /** |
|
192 | + * Gets min |
|
193 | + * |
|
194 | + * @return int |
|
195 | + * @throws \EE_Error |
|
196 | + */ |
|
197 | 197 | public function min() { |
198 | 198 | return $this->get( 'TKT_min' ); |
199 | 199 | } |
200 | 200 | |
201 | 201 | |
202 | 202 | |
203 | - /** |
|
204 | - * return if a ticket is no longer available cause its available dates have expired. |
|
205 | - * |
|
206 | - * @return boolean |
|
207 | - * @throws \EE_Error |
|
208 | - */ |
|
203 | + /** |
|
204 | + * return if a ticket is no longer available cause its available dates have expired. |
|
205 | + * |
|
206 | + * @return boolean |
|
207 | + * @throws \EE_Error |
|
208 | + */ |
|
209 | 209 | public function is_expired() { |
210 | 210 | return ( $this->get_raw( 'TKT_end_date' ) < time() ); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | |
215 | - /** |
|
216 | - * Return if a ticket is yet to go on sale or not |
|
217 | - * |
|
218 | - * @return boolean |
|
219 | - * @throws \EE_Error |
|
220 | - */ |
|
215 | + /** |
|
216 | + * Return if a ticket is yet to go on sale or not |
|
217 | + * |
|
218 | + * @return boolean |
|
219 | + * @throws \EE_Error |
|
220 | + */ |
|
221 | 221 | public function is_pending() { |
222 | 222 | return ( $this->get_raw( 'TKT_start_date' ) > time() ); |
223 | 223 | } |
224 | 224 | |
225 | 225 | |
226 | 226 | |
227 | - /** |
|
228 | - * Return if a ticket is on sale or not |
|
229 | - * |
|
230 | - * @return boolean |
|
231 | - * @throws \EE_Error |
|
232 | - */ |
|
227 | + /** |
|
228 | + * Return if a ticket is on sale or not |
|
229 | + * |
|
230 | + * @return boolean |
|
231 | + * @throws \EE_Error |
|
232 | + */ |
|
233 | 233 | public function is_on_sale() { |
234 | 234 | return ( $this->get_raw( 'TKT_start_date' ) < time() && $this->get_raw( 'TKT_end_date' ) > time() ); |
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | |
239 | - /** |
|
240 | - * This returns the chronologically last datetime that this ticket is associated with |
|
241 | - * |
|
242 | - * @param string $dt_frmt |
|
243 | - * @param string $conjunction - conjunction junction what's your function ? this string joins the start date with the end date ie: Jan 01 "to" Dec 31 |
|
244 | - * @return string |
|
245 | - * @throws \EE_Error |
|
246 | - */ |
|
239 | + /** |
|
240 | + * This returns the chronologically last datetime that this ticket is associated with |
|
241 | + * |
|
242 | + * @param string $dt_frmt |
|
243 | + * @param string $conjunction - conjunction junction what's your function ? this string joins the start date with the end date ie: Jan 01 "to" Dec 31 |
|
244 | + * @return string |
|
245 | + * @throws \EE_Error |
|
246 | + */ |
|
247 | 247 | public function date_range( $dt_frmt = '', $conjunction = ' - ' ) { |
248 | 248 | $first_date = $this->first_datetime() instanceof EE_Datetime ? $this->first_datetime()->start_date( $dt_frmt ) : ''; |
249 | 249 | $last_date = $this->last_datetime() instanceof EE_Datetime ? $this->last_datetime()->end_date( $dt_frmt ) : ''; |
@@ -253,12 +253,12 @@ discard block |
||
253 | 253 | |
254 | 254 | |
255 | 255 | |
256 | - /** |
|
257 | - * This returns the chronologically first datetime that this ticket is associated with |
|
258 | - * |
|
259 | - * @return EE_Datetime |
|
260 | - * @throws \EE_Error |
|
261 | - */ |
|
256 | + /** |
|
257 | + * This returns the chronologically first datetime that this ticket is associated with |
|
258 | + * |
|
259 | + * @return EE_Datetime |
|
260 | + * @throws \EE_Error |
|
261 | + */ |
|
262 | 262 | public function first_datetime() { |
263 | 263 | $datetimes = $this->datetimes( array( 'limit' => 1 ) ); |
264 | 264 | return reset( $datetimes ); |
@@ -266,14 +266,14 @@ discard block |
||
266 | 266 | |
267 | 267 | |
268 | 268 | |
269 | - /** |
|
270 | - * Gets all the datetimes this ticket can be used for attending. |
|
271 | - * Unless otherwise specified, orders datetimes by start date. |
|
272 | - * |
|
273 | - * @param array $query_params see EEM_Base::get_all() |
|
274 | - * @return EE_Datetime[]|EE_Base_Class[] |
|
275 | - * @throws \EE_Error |
|
276 | - */ |
|
269 | + /** |
|
270 | + * Gets all the datetimes this ticket can be used for attending. |
|
271 | + * Unless otherwise specified, orders datetimes by start date. |
|
272 | + * |
|
273 | + * @param array $query_params see EEM_Base::get_all() |
|
274 | + * @return EE_Datetime[]|EE_Base_Class[] |
|
275 | + * @throws \EE_Error |
|
276 | + */ |
|
277 | 277 | public function datetimes( $query_params = array() ) { |
278 | 278 | if ( ! isset( $query_params[ 'order_by' ] ) ) { |
279 | 279 | $query_params[ 'order_by' ][ 'DTT_order' ] = 'ASC'; |
@@ -283,12 +283,12 @@ discard block |
||
283 | 283 | |
284 | 284 | |
285 | 285 | |
286 | - /** |
|
287 | - * This returns the chronologically last datetime that this ticket is associated with |
|
288 | - * |
|
289 | - * @return EE_Datetime |
|
290 | - * @throws \EE_Error |
|
291 | - */ |
|
286 | + /** |
|
287 | + * This returns the chronologically last datetime that this ticket is associated with |
|
288 | + * |
|
289 | + * @return EE_Datetime |
|
290 | + * @throws \EE_Error |
|
291 | + */ |
|
292 | 292 | public function last_datetime() { |
293 | 293 | $datetimes = $this->datetimes( array( 'limit' => 1, 'order_by' => array( 'DTT_EVT_start' => 'DESC' ) ) ); |
294 | 294 | return end( $datetimes ); |
@@ -296,19 +296,19 @@ discard block |
||
296 | 296 | |
297 | 297 | |
298 | 298 | |
299 | - /** |
|
300 | - * This returns the total tickets sold depending on the given parameters. |
|
301 | - * |
|
302 | - * @param string $what Can be one of two options: 'ticket', 'datetime'. |
|
303 | - * 'ticket' = total ticket sales for all datetimes this ticket is related to |
|
304 | - * 'datetime' = total ticket sales for a specified datetime (required $dtt_id) |
|
305 | - * 'datetime' = total ticket sales in the datetime_ticket table. |
|
306 | - * If $dtt_id is not given then we return an array of sales indexed by datetime. |
|
307 | - * If $dtt_id IS given then we return the tickets sold for that given datetime. |
|
308 | - * @param int $dtt_id [optional] include the dtt_id with $what = 'datetime'. |
|
309 | - * @return mixed (array|int) how many tickets have sold |
|
310 | - * @throws \EE_Error |
|
311 | - */ |
|
299 | + /** |
|
300 | + * This returns the total tickets sold depending on the given parameters. |
|
301 | + * |
|
302 | + * @param string $what Can be one of two options: 'ticket', 'datetime'. |
|
303 | + * 'ticket' = total ticket sales for all datetimes this ticket is related to |
|
304 | + * 'datetime' = total ticket sales for a specified datetime (required $dtt_id) |
|
305 | + * 'datetime' = total ticket sales in the datetime_ticket table. |
|
306 | + * If $dtt_id is not given then we return an array of sales indexed by datetime. |
|
307 | + * If $dtt_id IS given then we return the tickets sold for that given datetime. |
|
308 | + * @param int $dtt_id [optional] include the dtt_id with $what = 'datetime'. |
|
309 | + * @return mixed (array|int) how many tickets have sold |
|
310 | + * @throws \EE_Error |
|
311 | + */ |
|
312 | 312 | public function tickets_sold( $what = 'ticket', $dtt_id = NULL ) { |
313 | 313 | $total = 0; |
314 | 314 | $tickets_sold = $this->_all_tickets_sold(); |
@@ -333,12 +333,12 @@ discard block |
||
333 | 333 | |
334 | 334 | |
335 | 335 | |
336 | - /** |
|
337 | - * This returns an array indexed by datetime_id for tickets sold with this ticket. |
|
338 | - * |
|
339 | - * @return EE_Ticket[] |
|
340 | - * @throws \EE_Error |
|
341 | - */ |
|
336 | + /** |
|
337 | + * This returns an array indexed by datetime_id for tickets sold with this ticket. |
|
338 | + * |
|
339 | + * @return EE_Ticket[] |
|
340 | + * @throws \EE_Error |
|
341 | + */ |
|
342 | 342 | protected function _all_tickets_sold() { |
343 | 343 | $datetimes = $this->get_many_related( 'Datetime' ); |
344 | 344 | $tickets_sold = array(); |
@@ -354,29 +354,29 @@ discard block |
||
354 | 354 | |
355 | 355 | |
356 | 356 | |
357 | - /** |
|
358 | - * This returns the base price object for the ticket. |
|
359 | - * |
|
360 | - * @param bool $return_array whether to return as an array indexed by price id or just the object. |
|
361 | - * @return EE_Price|EE_Base_Class|EE_Price[]|EE_Base_Class[] |
|
362 | - * @throws \EE_Error |
|
363 | - */ |
|
357 | + /** |
|
358 | + * This returns the base price object for the ticket. |
|
359 | + * |
|
360 | + * @param bool $return_array whether to return as an array indexed by price id or just the object. |
|
361 | + * @return EE_Price|EE_Base_Class|EE_Price[]|EE_Base_Class[] |
|
362 | + * @throws \EE_Error |
|
363 | + */ |
|
364 | 364 | public function base_price( $return_array = FALSE ) { |
365 | 365 | $_where = array( 'Price_Type.PBT_ID' => EEM_Price_Type::base_type_base_price ); |
366 | 366 | return $return_array |
367 | - ? $this->get_many_related( 'Price', array( $_where ) ) |
|
368 | - : $this->get_first_related( 'Price', array( $_where ) ); |
|
367 | + ? $this->get_many_related( 'Price', array( $_where ) ) |
|
368 | + : $this->get_first_related( 'Price', array( $_where ) ); |
|
369 | 369 | } |
370 | 370 | |
371 | 371 | |
372 | 372 | |
373 | - /** |
|
374 | - * This returns ONLY the price modifiers for the ticket (i.e. no taxes or base price) |
|
375 | - * |
|
376 | - * @access public |
|
377 | - * @return EE_Price[] |
|
378 | - * @throws \EE_Error |
|
379 | - */ |
|
373 | + /** |
|
374 | + * This returns ONLY the price modifiers for the ticket (i.e. no taxes or base price) |
|
375 | + * |
|
376 | + * @access public |
|
377 | + * @return EE_Price[] |
|
378 | + * @throws \EE_Error |
|
379 | + */ |
|
380 | 380 | public function price_modifiers() { |
381 | 381 | $query_params = array( 0 => array( 'Price_Type.PBT_ID' => array( 'NOT IN', array( EEM_Price_Type::base_type_base_price, EEM_Price_Type::base_type_tax ) ) ) ); |
382 | 382 | return $this->prices( $query_params ); |
@@ -384,132 +384,132 @@ discard block |
||
384 | 384 | |
385 | 385 | |
386 | 386 | |
387 | - /** |
|
388 | - * Gets all the prices that combine to form the final price of this ticket |
|
389 | - * |
|
390 | - * @param array $query_params like EEM_Base::get_all |
|
391 | - * @return EE_Price[]|EE_Base_Class[] |
|
392 | - * @throws \EE_Error |
|
393 | - */ |
|
387 | + /** |
|
388 | + * Gets all the prices that combine to form the final price of this ticket |
|
389 | + * |
|
390 | + * @param array $query_params like EEM_Base::get_all |
|
391 | + * @return EE_Price[]|EE_Base_Class[] |
|
392 | + * @throws \EE_Error |
|
393 | + */ |
|
394 | 394 | public function prices( $query_params = array() ) { |
395 | 395 | return $this->get_many_related( 'Price', $query_params ); |
396 | 396 | } |
397 | 397 | |
398 | 398 | |
399 | 399 | |
400 | - /** |
|
401 | - * Gets all the ticket applicabilities (ie, relations between datetimes and tickets) |
|
402 | - * |
|
403 | - * @param array $query_params see EEM_Base::get_all() |
|
404 | - * @return EE_Datetime_Ticket|EE_Base_Class[] |
|
405 | - * @throws \EE_Error |
|
406 | - */ |
|
400 | + /** |
|
401 | + * Gets all the ticket applicabilities (ie, relations between datetimes and tickets) |
|
402 | + * |
|
403 | + * @param array $query_params see EEM_Base::get_all() |
|
404 | + * @return EE_Datetime_Ticket|EE_Base_Class[] |
|
405 | + * @throws \EE_Error |
|
406 | + */ |
|
407 | 407 | public function datetime_tickets( $query_params = array() ) { |
408 | 408 | return $this->get_many_related( 'Datetime_Ticket', $query_params ); |
409 | 409 | } |
410 | 410 | |
411 | 411 | |
412 | 412 | |
413 | - /** |
|
414 | - * Gets all the datetimes from the db ordered by DTT_order |
|
415 | - * |
|
416 | - * @param boolean $show_expired |
|
417 | - * @param boolean $show_deleted |
|
418 | - * @return EE_Datetime[] |
|
419 | - * @throws \EE_Error |
|
420 | - */ |
|
413 | + /** |
|
414 | + * Gets all the datetimes from the db ordered by DTT_order |
|
415 | + * |
|
416 | + * @param boolean $show_expired |
|
417 | + * @param boolean $show_deleted |
|
418 | + * @return EE_Datetime[] |
|
419 | + * @throws \EE_Error |
|
420 | + */ |
|
421 | 421 | public function datetimes_ordered( $show_expired = TRUE, $show_deleted = FALSE ) { |
422 | 422 | return EEM_Datetime::instance( $this->_timezone )->get_datetimes_for_ticket_ordered_by_DTT_order( $this->ID(), $show_expired, $show_deleted ); |
423 | 423 | } |
424 | 424 | |
425 | 425 | |
426 | 426 | |
427 | - /** |
|
428 | - * Gets ID |
|
429 | - * |
|
430 | - * @return string |
|
431 | - * @throws \EE_Error |
|
432 | - */ |
|
427 | + /** |
|
428 | + * Gets ID |
|
429 | + * |
|
430 | + * @return string |
|
431 | + * @throws \EE_Error |
|
432 | + */ |
|
433 | 433 | public function ID() { |
434 | 434 | return $this->get( 'TKT_ID' ); |
435 | 435 | } |
436 | 436 | |
437 | 437 | |
438 | 438 | |
439 | - /** |
|
440 | - * get the author of the ticket. |
|
441 | - * |
|
442 | - * @since 4.5.0 |
|
443 | - * @return int |
|
444 | - * @throws \EE_Error |
|
445 | - */ |
|
439 | + /** |
|
440 | + * get the author of the ticket. |
|
441 | + * |
|
442 | + * @since 4.5.0 |
|
443 | + * @return int |
|
444 | + * @throws \EE_Error |
|
445 | + */ |
|
446 | 446 | public function wp_user() { |
447 | 447 | return $this->get('TKT_wp_user'); |
448 | 448 | } |
449 | 449 | |
450 | 450 | |
451 | 451 | |
452 | - /** |
|
453 | - * Gets the template for the ticket |
|
454 | - * |
|
455 | - * @return EE_Ticket_Template|EE_Base_Class |
|
456 | - * @throws \EE_Error |
|
457 | - */ |
|
452 | + /** |
|
453 | + * Gets the template for the ticket |
|
454 | + * |
|
455 | + * @return EE_Ticket_Template|EE_Base_Class |
|
456 | + * @throws \EE_Error |
|
457 | + */ |
|
458 | 458 | public function template() { |
459 | 459 | return $this->get_first_related( 'Ticket_Template' ); |
460 | 460 | } |
461 | 461 | |
462 | 462 | |
463 | 463 | |
464 | - /** |
|
465 | - * Simply returns an array of EE_Price objects that are taxes. |
|
466 | - * |
|
467 | - * @return EE_Price[] |
|
468 | - * @throws \EE_Error |
|
469 | - */ |
|
464 | + /** |
|
465 | + * Simply returns an array of EE_Price objects that are taxes. |
|
466 | + * |
|
467 | + * @return EE_Price[] |
|
468 | + * @throws \EE_Error |
|
469 | + */ |
|
470 | 470 | public function get_ticket_taxes_for_admin() { |
471 | 471 | return EE_Taxes::get_taxes_for_admin(); |
472 | 472 | } |
473 | 473 | |
474 | 474 | |
475 | 475 | |
476 | - /** |
|
477 | - * @return float |
|
478 | - * @throws \EE_Error |
|
479 | - */ |
|
476 | + /** |
|
477 | + * @return float |
|
478 | + * @throws \EE_Error |
|
479 | + */ |
|
480 | 480 | public function ticket_price() { |
481 | 481 | return $this->get( 'TKT_price' ); |
482 | 482 | } |
483 | 483 | |
484 | 484 | |
485 | 485 | |
486 | - /** |
|
487 | - * @return mixed |
|
488 | - * @throws \EE_Error |
|
489 | - */ |
|
486 | + /** |
|
487 | + * @return mixed |
|
488 | + * @throws \EE_Error |
|
489 | + */ |
|
490 | 490 | public function pretty_price() { |
491 | 491 | return $this->get_pretty( 'TKT_price' ); |
492 | 492 | } |
493 | 493 | |
494 | 494 | |
495 | 495 | |
496 | - /** |
|
497 | - * @return bool |
|
498 | - * @throws \EE_Error |
|
499 | - */ |
|
496 | + /** |
|
497 | + * @return bool |
|
498 | + * @throws \EE_Error |
|
499 | + */ |
|
500 | 500 | public function is_free() { |
501 | 501 | return $this->get_ticket_total_with_taxes() === 0; |
502 | 502 | } |
503 | 503 | |
504 | 504 | |
505 | 505 | |
506 | - /** |
|
507 | - * get_ticket_total_with_taxes |
|
508 | - * |
|
509 | - * @param bool $no_cache |
|
510 | - * @return float |
|
511 | - * @throws \EE_Error |
|
512 | - */ |
|
506 | + /** |
|
507 | + * get_ticket_total_with_taxes |
|
508 | + * |
|
509 | + * @param bool $no_cache |
|
510 | + * @return float |
|
511 | + * @throws \EE_Error |
|
512 | + */ |
|
513 | 513 | public function get_ticket_total_with_taxes( $no_cache = FALSE ) { |
514 | 514 | if ($this->_ticket_total_with_taxes === null || $no_cache ) { |
515 | 515 | $this->_ticket_total_with_taxes = $this->get_ticket_subtotal() + $this->get_ticket_taxes_total_for_admin(); |
@@ -526,201 +526,201 @@ discard block |
||
526 | 526 | |
527 | 527 | |
528 | 528 | |
529 | - /** |
|
530 | - * @return float |
|
531 | - * @throws \EE_Error |
|
532 | - */ |
|
529 | + /** |
|
530 | + * @return float |
|
531 | + * @throws \EE_Error |
|
532 | + */ |
|
533 | 533 | public function get_ticket_subtotal() { |
534 | 534 | return EE_Taxes::get_subtotal_for_admin( $this ); |
535 | 535 | } |
536 | 536 | |
537 | 537 | |
538 | 538 | |
539 | - /** |
|
540 | - * Returns the total taxes applied to this ticket |
|
541 | - * |
|
542 | - * @return float |
|
543 | - * @throws \EE_Error |
|
544 | - */ |
|
539 | + /** |
|
540 | + * Returns the total taxes applied to this ticket |
|
541 | + * |
|
542 | + * @return float |
|
543 | + * @throws \EE_Error |
|
544 | + */ |
|
545 | 545 | public function get_ticket_taxes_total_for_admin() { |
546 | 546 | return EE_Taxes::get_total_taxes_for_admin( $this ); |
547 | 547 | } |
548 | 548 | |
549 | 549 | |
550 | 550 | |
551 | - /** |
|
552 | - * Sets name |
|
553 | - * |
|
554 | - * @param string $name |
|
555 | - * @throws \EE_Error |
|
556 | - */ |
|
551 | + /** |
|
552 | + * Sets name |
|
553 | + * |
|
554 | + * @param string $name |
|
555 | + * @throws \EE_Error |
|
556 | + */ |
|
557 | 557 | public function set_name( $name ) { |
558 | 558 | $this->set( 'TKT_name', $name ); |
559 | 559 | } |
560 | 560 | |
561 | 561 | |
562 | 562 | |
563 | - /** |
|
564 | - * Gets description |
|
565 | - * |
|
566 | - * @return string |
|
567 | - * @throws \EE_Error |
|
568 | - */ |
|
563 | + /** |
|
564 | + * Gets description |
|
565 | + * |
|
566 | + * @return string |
|
567 | + * @throws \EE_Error |
|
568 | + */ |
|
569 | 569 | public function description() { |
570 | 570 | return $this->get( 'TKT_description' ); |
571 | 571 | } |
572 | 572 | |
573 | 573 | |
574 | 574 | |
575 | - /** |
|
576 | - * Sets description |
|
577 | - * |
|
578 | - * @param string $description |
|
579 | - * @throws \EE_Error |
|
580 | - */ |
|
575 | + /** |
|
576 | + * Sets description |
|
577 | + * |
|
578 | + * @param string $description |
|
579 | + * @throws \EE_Error |
|
580 | + */ |
|
581 | 581 | public function set_description( $description ) { |
582 | 582 | $this->set( 'TKT_description', $description ); |
583 | 583 | } |
584 | 584 | |
585 | 585 | |
586 | 586 | |
587 | - /** |
|
588 | - * Gets start_date |
|
589 | - * |
|
590 | - * @param string $dt_frmt |
|
591 | - * @param string $tm_frmt |
|
592 | - * @return string |
|
593 | - * @throws \EE_Error |
|
594 | - */ |
|
587 | + /** |
|
588 | + * Gets start_date |
|
589 | + * |
|
590 | + * @param string $dt_frmt |
|
591 | + * @param string $tm_frmt |
|
592 | + * @return string |
|
593 | + * @throws \EE_Error |
|
594 | + */ |
|
595 | 595 | public function start_date( $dt_frmt = '', $tm_frmt = '' ) { |
596 | 596 | return $this->_get_datetime( 'TKT_start_date', $dt_frmt, $tm_frmt ); |
597 | 597 | } |
598 | 598 | |
599 | 599 | |
600 | 600 | |
601 | - /** |
|
602 | - * Sets start_date |
|
603 | - * |
|
604 | - * @param string $start_date |
|
605 | - * @return void |
|
606 | - * @throws \EE_Error |
|
607 | - */ |
|
601 | + /** |
|
602 | + * Sets start_date |
|
603 | + * |
|
604 | + * @param string $start_date |
|
605 | + * @return void |
|
606 | + * @throws \EE_Error |
|
607 | + */ |
|
608 | 608 | public function set_start_date( $start_date ) { |
609 | 609 | $this->_set_date_time( 'B', $start_date, 'TKT_start_date' ); |
610 | 610 | } |
611 | 611 | |
612 | 612 | |
613 | 613 | |
614 | - /** |
|
615 | - * Gets end_date |
|
616 | - * |
|
617 | - * @param string $dt_frmt |
|
618 | - * @param string $tm_frmt |
|
619 | - * @return string |
|
620 | - * @throws \EE_Error |
|
621 | - */ |
|
614 | + /** |
|
615 | + * Gets end_date |
|
616 | + * |
|
617 | + * @param string $dt_frmt |
|
618 | + * @param string $tm_frmt |
|
619 | + * @return string |
|
620 | + * @throws \EE_Error |
|
621 | + */ |
|
622 | 622 | public function end_date( $dt_frmt = '', $tm_frmt = '' ) { |
623 | 623 | return $this->_get_datetime( 'TKT_end_date', $dt_frmt, $tm_frmt ); |
624 | 624 | } |
625 | 625 | |
626 | 626 | |
627 | 627 | |
628 | - /** |
|
629 | - * Sets end_date |
|
630 | - * |
|
631 | - * @param string $end_date |
|
632 | - * @return void |
|
633 | - * @throws \EE_Error |
|
634 | - */ |
|
628 | + /** |
|
629 | + * Sets end_date |
|
630 | + * |
|
631 | + * @param string $end_date |
|
632 | + * @return void |
|
633 | + * @throws \EE_Error |
|
634 | + */ |
|
635 | 635 | public function set_end_date( $end_date ) { |
636 | 636 | $this->_set_date_time( 'B', $end_date, 'TKT_end_date' ); |
637 | 637 | } |
638 | 638 | |
639 | 639 | |
640 | 640 | |
641 | - /** |
|
642 | - * Sets sell until time |
|
643 | - * |
|
644 | - * @since 4.5.0 |
|
645 | - * @param string $time a string representation of the sell until time (ex 9am or 7:30pm) |
|
646 | - * @throws \EE_Error |
|
647 | - */ |
|
641 | + /** |
|
642 | + * Sets sell until time |
|
643 | + * |
|
644 | + * @since 4.5.0 |
|
645 | + * @param string $time a string representation of the sell until time (ex 9am or 7:30pm) |
|
646 | + * @throws \EE_Error |
|
647 | + */ |
|
648 | 648 | public function set_end_time( $time ) { |
649 | 649 | $this->_set_time_for( $time, 'TKT_end_date' ); |
650 | 650 | } |
651 | 651 | |
652 | 652 | |
653 | 653 | |
654 | - /** |
|
655 | - * Sets min |
|
656 | - * |
|
657 | - * @param int $min |
|
658 | - * @return void |
|
659 | - * @throws \EE_Error |
|
660 | - */ |
|
654 | + /** |
|
655 | + * Sets min |
|
656 | + * |
|
657 | + * @param int $min |
|
658 | + * @return void |
|
659 | + * @throws \EE_Error |
|
660 | + */ |
|
661 | 661 | public function set_min( $min ) { |
662 | 662 | $this->set( 'TKT_min', $min ); |
663 | 663 | } |
664 | 664 | |
665 | 665 | |
666 | 666 | |
667 | - /** |
|
668 | - * Gets max |
|
669 | - * |
|
670 | - * @return int |
|
671 | - * @throws \EE_Error |
|
672 | - */ |
|
667 | + /** |
|
668 | + * Gets max |
|
669 | + * |
|
670 | + * @return int |
|
671 | + * @throws \EE_Error |
|
672 | + */ |
|
673 | 673 | public function max() { |
674 | 674 | return $this->get( 'TKT_max' ); |
675 | 675 | } |
676 | 676 | |
677 | 677 | |
678 | 678 | |
679 | - /** |
|
680 | - * Sets max |
|
681 | - * |
|
682 | - * @param int $max |
|
683 | - * @return void |
|
684 | - * @throws \EE_Error |
|
685 | - */ |
|
679 | + /** |
|
680 | + * Sets max |
|
681 | + * |
|
682 | + * @param int $max |
|
683 | + * @return void |
|
684 | + * @throws \EE_Error |
|
685 | + */ |
|
686 | 686 | public function set_max( $max ) { |
687 | 687 | $this->set( 'TKT_max', $max ); |
688 | 688 | } |
689 | 689 | |
690 | 690 | |
691 | 691 | |
692 | - /** |
|
693 | - * Sets price |
|
694 | - * |
|
695 | - * @param float $price |
|
696 | - * @return void |
|
697 | - * @throws \EE_Error |
|
698 | - */ |
|
692 | + /** |
|
693 | + * Sets price |
|
694 | + * |
|
695 | + * @param float $price |
|
696 | + * @return void |
|
697 | + * @throws \EE_Error |
|
698 | + */ |
|
699 | 699 | public function set_price( $price ) { |
700 | 700 | $this->set( 'TKT_price', $price ); |
701 | 701 | } |
702 | 702 | |
703 | 703 | |
704 | 704 | |
705 | - /** |
|
706 | - * Gets sold |
|
707 | - * |
|
708 | - * @return int |
|
709 | - * @throws \EE_Error |
|
710 | - */ |
|
705 | + /** |
|
706 | + * Gets sold |
|
707 | + * |
|
708 | + * @return int |
|
709 | + * @throws \EE_Error |
|
710 | + */ |
|
711 | 711 | public function sold() { |
712 | 712 | return $this->get_raw( 'TKT_sold' ); |
713 | 713 | } |
714 | 714 | |
715 | 715 | |
716 | 716 | |
717 | - /** |
|
718 | - * Sets sold |
|
719 | - * |
|
720 | - * @param int $sold |
|
721 | - * @return void |
|
722 | - * @throws \EE_Error |
|
723 | - */ |
|
717 | + /** |
|
718 | + * Sets sold |
|
719 | + * |
|
720 | + * @param int $sold |
|
721 | + * @return void |
|
722 | + * @throws \EE_Error |
|
723 | + */ |
|
724 | 724 | public function set_sold( $sold ) { |
725 | 725 | // sold can not go below zero |
726 | 726 | $sold = max( 0, $sold ); |
@@ -729,13 +729,13 @@ discard block |
||
729 | 729 | |
730 | 730 | |
731 | 731 | |
732 | - /** |
|
733 | - * increments sold by amount passed by $qty |
|
734 | - * |
|
735 | - * @param int $qty |
|
736 | - * @return void |
|
737 | - * @throws \EE_Error |
|
738 | - */ |
|
732 | + /** |
|
733 | + * increments sold by amount passed by $qty |
|
734 | + * |
|
735 | + * @param int $qty |
|
736 | + * @return void |
|
737 | + * @throws \EE_Error |
|
738 | + */ |
|
739 | 739 | public function increase_sold( $qty = 1 ) { |
740 | 740 | $sold = $this->sold() + $qty; |
741 | 741 | // remove ticket reservation, but don't adjust datetime reservations, because that will happen |
@@ -747,13 +747,13 @@ discard block |
||
747 | 747 | |
748 | 748 | |
749 | 749 | |
750 | - /** |
|
751 | - * Increases sold on related datetimes |
|
752 | - * |
|
753 | - * @param int $qty |
|
754 | - * @return void |
|
755 | - * @throws \EE_Error |
|
756 | - */ |
|
750 | + /** |
|
751 | + * Increases sold on related datetimes |
|
752 | + * |
|
753 | + * @param int $qty |
|
754 | + * @return void |
|
755 | + * @throws \EE_Error |
|
756 | + */ |
|
757 | 757 | protected function _increase_sold_for_datetimes( $qty = 1 ) { |
758 | 758 | $datetimes = $this->datetimes(); |
759 | 759 | if ( is_array( $datetimes ) ) { |
@@ -768,13 +768,13 @@ discard block |
||
768 | 768 | |
769 | 769 | |
770 | 770 | |
771 | - /** |
|
772 | - * decrements (subtracts) sold by amount passed by $qty |
|
773 | - * |
|
774 | - * @param int $qty |
|
775 | - * @return void |
|
776 | - * @throws \EE_Error |
|
777 | - */ |
|
771 | + /** |
|
772 | + * decrements (subtracts) sold by amount passed by $qty |
|
773 | + * |
|
774 | + * @param int $qty |
|
775 | + * @return void |
|
776 | + * @throws \EE_Error |
|
777 | + */ |
|
778 | 778 | public function decrease_sold( $qty = 1 ) { |
779 | 779 | $sold = $this->sold() - $qty; |
780 | 780 | $this->_decrease_sold_for_datetimes( $qty ); |
@@ -783,13 +783,13 @@ discard block |
||
783 | 783 | |
784 | 784 | |
785 | 785 | |
786 | - /** |
|
787 | - * Decreases sold on related datetimes |
|
788 | - * |
|
789 | - * @param int $qty |
|
790 | - * @return void |
|
791 | - * @throws \EE_Error |
|
792 | - */ |
|
786 | + /** |
|
787 | + * Decreases sold on related datetimes |
|
788 | + * |
|
789 | + * @param int $qty |
|
790 | + * @return void |
|
791 | + * @throws \EE_Error |
|
792 | + */ |
|
793 | 793 | protected function _decrease_sold_for_datetimes( $qty = 1 ) { |
794 | 794 | $datetimes = $this->datetimes(); |
795 | 795 | if ( is_array( $datetimes ) ) { |
@@ -804,25 +804,25 @@ discard block |
||
804 | 804 | |
805 | 805 | |
806 | 806 | |
807 | - /** |
|
808 | - * Gets qty of reserved tickets |
|
809 | - * |
|
810 | - * @return int |
|
811 | - * @throws \EE_Error |
|
812 | - */ |
|
807 | + /** |
|
808 | + * Gets qty of reserved tickets |
|
809 | + * |
|
810 | + * @return int |
|
811 | + * @throws \EE_Error |
|
812 | + */ |
|
813 | 813 | public function reserved() { |
814 | 814 | return $this->get_raw( 'TKT_reserved' ); |
815 | 815 | } |
816 | 816 | |
817 | 817 | |
818 | 818 | |
819 | - /** |
|
820 | - * Sets reserved |
|
821 | - * |
|
822 | - * @param int $reserved |
|
823 | - * @return void |
|
824 | - * @throws \EE_Error |
|
825 | - */ |
|
819 | + /** |
|
820 | + * Sets reserved |
|
821 | + * |
|
822 | + * @param int $reserved |
|
823 | + * @return void |
|
824 | + * @throws \EE_Error |
|
825 | + */ |
|
826 | 826 | public function set_reserved( $reserved ) { |
827 | 827 | // reserved can not go below zero |
828 | 828 | $reserved = max( 0, (int) $reserved ); |
@@ -831,13 +831,13 @@ discard block |
||
831 | 831 | |
832 | 832 | |
833 | 833 | |
834 | - /** |
|
835 | - * increments reserved by amount passed by $qty |
|
836 | - * |
|
837 | - * @param int $qty |
|
838 | - * @return void |
|
839 | - * @throws \EE_Error |
|
840 | - */ |
|
834 | + /** |
|
835 | + * increments reserved by amount passed by $qty |
|
836 | + * |
|
837 | + * @param int $qty |
|
838 | + * @return void |
|
839 | + * @throws \EE_Error |
|
840 | + */ |
|
841 | 841 | public function increase_reserved( $qty = 1 ) { |
842 | 842 | $qty = absint( $qty ); |
843 | 843 | $reserved = $this->reserved() + $qty; |
@@ -847,13 +847,13 @@ discard block |
||
847 | 847 | |
848 | 848 | |
849 | 849 | |
850 | - /** |
|
851 | - * Increases sold on related datetimes |
|
852 | - * |
|
853 | - * @param int $qty |
|
854 | - * @return void |
|
855 | - * @throws \EE_Error |
|
856 | - */ |
|
850 | + /** |
|
851 | + * Increases sold on related datetimes |
|
852 | + * |
|
853 | + * @param int $qty |
|
854 | + * @return void |
|
855 | + * @throws \EE_Error |
|
856 | + */ |
|
857 | 857 | protected function _increase_reserved_for_datetimes( $qty = 1 ) { |
858 | 858 | $datetimes = $this->datetimes(); |
859 | 859 | if ( is_array( $datetimes ) ) { |
@@ -868,14 +868,14 @@ discard block |
||
868 | 868 | |
869 | 869 | |
870 | 870 | |
871 | - /** |
|
872 | - * decrements (subtracts) reserved by amount passed by $qty |
|
873 | - * |
|
874 | - * @param int $qty |
|
875 | - * @param bool $adjust_datetimes |
|
876 | - * @return void |
|
877 | - * @throws \EE_Error |
|
878 | - */ |
|
871 | + /** |
|
872 | + * decrements (subtracts) reserved by amount passed by $qty |
|
873 | + * |
|
874 | + * @param int $qty |
|
875 | + * @param bool $adjust_datetimes |
|
876 | + * @return void |
|
877 | + * @throws \EE_Error |
|
878 | + */ |
|
879 | 879 | public function decrease_reserved( $qty = 1, $adjust_datetimes = true ) { |
880 | 880 | $reserved = $this->reserved() - absint( $qty ); |
881 | 881 | if ( $adjust_datetimes ) { |
@@ -886,13 +886,13 @@ discard block |
||
886 | 886 | |
887 | 887 | |
888 | 888 | |
889 | - /** |
|
890 | - * Increases sold on related datetimes |
|
891 | - * |
|
892 | - * @param int $qty |
|
893 | - * @return void |
|
894 | - * @throws \EE_Error |
|
895 | - */ |
|
889 | + /** |
|
890 | + * Increases sold on related datetimes |
|
891 | + * |
|
892 | + * @param int $qty |
|
893 | + * @return void |
|
894 | + * @throws \EE_Error |
|
895 | + */ |
|
896 | 896 | protected function _decrease_reserved_for_datetimes( $qty = 1 ) { |
897 | 897 | $datetimes = $this->datetimes(); |
898 | 898 | if ( is_array( $datetimes ) ) { |
@@ -907,18 +907,18 @@ discard block |
||
907 | 907 | |
908 | 908 | |
909 | 909 | |
910 | - /** |
|
911 | - * Gets ticket quantity |
|
912 | - * |
|
913 | - * @param string $context ticket quantity is somewhat subjective depending on the exact information sought |
|
914 | - * therefore $context can be one of three values: '', 'reg_limit', or 'saleable' |
|
915 | - * '' (default) quantity is the actual db value for TKT_qty, unaffected by other objects |
|
916 | - * REG LIMIT: caps qty based on DTT_reg_limit for ALL related datetimes |
|
917 | - * SALEABLE: also considers datetime sold and returns zero if ANY DTT is sold out, and |
|
918 | - * is therefore the truest measure of tickets that can be purchased at the moment |
|
919 | - * @return int |
|
920 | - * @throws \EE_Error |
|
921 | - */ |
|
910 | + /** |
|
911 | + * Gets ticket quantity |
|
912 | + * |
|
913 | + * @param string $context ticket quantity is somewhat subjective depending on the exact information sought |
|
914 | + * therefore $context can be one of three values: '', 'reg_limit', or 'saleable' |
|
915 | + * '' (default) quantity is the actual db value for TKT_qty, unaffected by other objects |
|
916 | + * REG LIMIT: caps qty based on DTT_reg_limit for ALL related datetimes |
|
917 | + * SALEABLE: also considers datetime sold and returns zero if ANY DTT is sold out, and |
|
918 | + * is therefore the truest measure of tickets that can be purchased at the moment |
|
919 | + * @return int |
|
920 | + * @throws \EE_Error |
|
921 | + */ |
|
922 | 922 | public function qty( $context = '' ) { |
923 | 923 | switch ( $context ) { |
924 | 924 | case 'reg_limit' : |
@@ -932,19 +932,19 @@ discard block |
||
932 | 932 | |
933 | 933 | |
934 | 934 | |
935 | - /** |
|
936 | - * Gets ticket quantity |
|
937 | - * |
|
938 | - * @param string $context ticket quantity is somewhat subjective depending on the exact information sought |
|
939 | - * therefore $context can be one of two values: 'reg_limit', or 'saleable' |
|
940 | - * REG LIMIT: caps qty based on DTT_reg_limit for ALL related datetimes |
|
941 | - * SALEABLE: also considers datetime sold and returns zero if ANY DTT is sold out, and |
|
942 | - * is therefore the truest measure of tickets that can be purchased at the moment |
|
943 | - * @param int $DTT_ID the primary key for a particular datetime. |
|
944 | - * set to 0 for all related datetimes |
|
945 | - * @return int |
|
946 | - * @throws \EE_Error |
|
947 | - */ |
|
935 | + /** |
|
936 | + * Gets ticket quantity |
|
937 | + * |
|
938 | + * @param string $context ticket quantity is somewhat subjective depending on the exact information sought |
|
939 | + * therefore $context can be one of two values: 'reg_limit', or 'saleable' |
|
940 | + * REG LIMIT: caps qty based on DTT_reg_limit for ALL related datetimes |
|
941 | + * SALEABLE: also considers datetime sold and returns zero if ANY DTT is sold out, and |
|
942 | + * is therefore the truest measure of tickets that can be purchased at the moment |
|
943 | + * @param int $DTT_ID the primary key for a particular datetime. |
|
944 | + * set to 0 for all related datetimes |
|
945 | + * @return int |
|
946 | + * @throws \EE_Error |
|
947 | + */ |
|
948 | 948 | public function real_quantity_on_ticket( $context = 'reg_limit', $DTT_ID = 0 ) { |
949 | 949 | $raw = $this->get_raw( 'TKT_qty' ); |
950 | 950 | // return immediately if it's zero |
@@ -1027,212 +1027,212 @@ discard block |
||
1027 | 1027 | |
1028 | 1028 | |
1029 | 1029 | |
1030 | - /** |
|
1031 | - * Gets uses |
|
1032 | - * |
|
1033 | - * @return int |
|
1034 | - * @throws \EE_Error |
|
1035 | - */ |
|
1030 | + /** |
|
1031 | + * Gets uses |
|
1032 | + * |
|
1033 | + * @return int |
|
1034 | + * @throws \EE_Error |
|
1035 | + */ |
|
1036 | 1036 | public function uses() { |
1037 | 1037 | return $this->get( 'TKT_uses' ); |
1038 | 1038 | } |
1039 | 1039 | |
1040 | 1040 | |
1041 | 1041 | |
1042 | - /** |
|
1043 | - * Sets uses |
|
1044 | - * |
|
1045 | - * @param int $uses |
|
1046 | - * @return void |
|
1047 | - * @throws \EE_Error |
|
1048 | - */ |
|
1042 | + /** |
|
1043 | + * Sets uses |
|
1044 | + * |
|
1045 | + * @param int $uses |
|
1046 | + * @return void |
|
1047 | + * @throws \EE_Error |
|
1048 | + */ |
|
1049 | 1049 | public function set_uses( $uses ) { |
1050 | 1050 | $this->set( 'TKT_uses', $uses ); |
1051 | 1051 | } |
1052 | 1052 | |
1053 | 1053 | |
1054 | 1054 | |
1055 | - /** |
|
1056 | - * returns whether ticket is required or not. |
|
1057 | - * |
|
1058 | - * @return boolean |
|
1059 | - * @throws \EE_Error |
|
1060 | - */ |
|
1055 | + /** |
|
1056 | + * returns whether ticket is required or not. |
|
1057 | + * |
|
1058 | + * @return boolean |
|
1059 | + * @throws \EE_Error |
|
1060 | + */ |
|
1061 | 1061 | public function required() { |
1062 | 1062 | return $this->get( 'TKT_required' ); |
1063 | 1063 | } |
1064 | 1064 | |
1065 | 1065 | |
1066 | 1066 | |
1067 | - /** |
|
1068 | - * sets the TKT_required property |
|
1069 | - * |
|
1070 | - * @param boolean $required |
|
1071 | - * @return void |
|
1072 | - * @throws \EE_Error |
|
1073 | - */ |
|
1067 | + /** |
|
1068 | + * sets the TKT_required property |
|
1069 | + * |
|
1070 | + * @param boolean $required |
|
1071 | + * @return void |
|
1072 | + * @throws \EE_Error |
|
1073 | + */ |
|
1074 | 1074 | public function set_required( $required ) { |
1075 | 1075 | $this->set( 'TKT_required', $required ); |
1076 | 1076 | } |
1077 | 1077 | |
1078 | 1078 | |
1079 | 1079 | |
1080 | - /** |
|
1081 | - * Gets taxable |
|
1082 | - * |
|
1083 | - * @return boolean |
|
1084 | - * @throws \EE_Error |
|
1085 | - */ |
|
1080 | + /** |
|
1081 | + * Gets taxable |
|
1082 | + * |
|
1083 | + * @return boolean |
|
1084 | + * @throws \EE_Error |
|
1085 | + */ |
|
1086 | 1086 | public function taxable() { |
1087 | 1087 | return $this->get( 'TKT_taxable' ); |
1088 | 1088 | } |
1089 | 1089 | |
1090 | 1090 | |
1091 | 1091 | |
1092 | - /** |
|
1093 | - * Sets taxable |
|
1094 | - * |
|
1095 | - * @param boolean $taxable |
|
1096 | - * @return void |
|
1097 | - * @throws \EE_Error |
|
1098 | - */ |
|
1092 | + /** |
|
1093 | + * Sets taxable |
|
1094 | + * |
|
1095 | + * @param boolean $taxable |
|
1096 | + * @return void |
|
1097 | + * @throws \EE_Error |
|
1098 | + */ |
|
1099 | 1099 | public function set_taxable( $taxable ) { |
1100 | 1100 | $this->set( 'TKT_taxable', $taxable ); |
1101 | 1101 | } |
1102 | 1102 | |
1103 | 1103 | |
1104 | 1104 | |
1105 | - /** |
|
1106 | - * Gets is_default |
|
1107 | - * |
|
1108 | - * @return boolean |
|
1109 | - * @throws \EE_Error |
|
1110 | - */ |
|
1105 | + /** |
|
1106 | + * Gets is_default |
|
1107 | + * |
|
1108 | + * @return boolean |
|
1109 | + * @throws \EE_Error |
|
1110 | + */ |
|
1111 | 1111 | public function is_default() { |
1112 | 1112 | return $this->get( 'TKT_is_default' ); |
1113 | 1113 | } |
1114 | 1114 | |
1115 | 1115 | |
1116 | 1116 | |
1117 | - /** |
|
1118 | - * Sets is_default |
|
1119 | - * |
|
1120 | - * @param boolean $is_default |
|
1121 | - * @return void |
|
1122 | - * @throws \EE_Error |
|
1123 | - */ |
|
1117 | + /** |
|
1118 | + * Sets is_default |
|
1119 | + * |
|
1120 | + * @param boolean $is_default |
|
1121 | + * @return void |
|
1122 | + * @throws \EE_Error |
|
1123 | + */ |
|
1124 | 1124 | public function set_is_default( $is_default ) { |
1125 | 1125 | $this->set( 'TKT_is_default', $is_default ); |
1126 | 1126 | } |
1127 | 1127 | |
1128 | 1128 | |
1129 | 1129 | |
1130 | - /** |
|
1131 | - * Gets order |
|
1132 | - * |
|
1133 | - * @return int |
|
1134 | - * @throws \EE_Error |
|
1135 | - */ |
|
1130 | + /** |
|
1131 | + * Gets order |
|
1132 | + * |
|
1133 | + * @return int |
|
1134 | + * @throws \EE_Error |
|
1135 | + */ |
|
1136 | 1136 | public function order() { |
1137 | 1137 | return $this->get( 'TKT_order' ); |
1138 | 1138 | } |
1139 | 1139 | |
1140 | 1140 | |
1141 | 1141 | |
1142 | - /** |
|
1143 | - * Sets order |
|
1144 | - * |
|
1145 | - * @param int $order |
|
1146 | - * @return void |
|
1147 | - * @throws \EE_Error |
|
1148 | - */ |
|
1142 | + /** |
|
1143 | + * Sets order |
|
1144 | + * |
|
1145 | + * @param int $order |
|
1146 | + * @return void |
|
1147 | + * @throws \EE_Error |
|
1148 | + */ |
|
1149 | 1149 | public function set_order( $order ) { |
1150 | 1150 | $this->set( 'TKT_order', $order ); |
1151 | 1151 | } |
1152 | 1152 | |
1153 | 1153 | |
1154 | 1154 | |
1155 | - /** |
|
1156 | - * Gets row |
|
1157 | - * |
|
1158 | - * @return int |
|
1159 | - * @throws \EE_Error |
|
1160 | - */ |
|
1155 | + /** |
|
1156 | + * Gets row |
|
1157 | + * |
|
1158 | + * @return int |
|
1159 | + * @throws \EE_Error |
|
1160 | + */ |
|
1161 | 1161 | public function row() { |
1162 | 1162 | return $this->get( 'TKT_row' ); |
1163 | 1163 | } |
1164 | 1164 | |
1165 | 1165 | |
1166 | 1166 | |
1167 | - /** |
|
1168 | - * Sets row |
|
1169 | - * |
|
1170 | - * @param int $row |
|
1171 | - * @return void |
|
1172 | - * @throws \EE_Error |
|
1173 | - */ |
|
1167 | + /** |
|
1168 | + * Sets row |
|
1169 | + * |
|
1170 | + * @param int $row |
|
1171 | + * @return void |
|
1172 | + * @throws \EE_Error |
|
1173 | + */ |
|
1174 | 1174 | public function set_row( $row ) { |
1175 | 1175 | $this->set( 'TKT_row', $row ); |
1176 | 1176 | } |
1177 | 1177 | |
1178 | 1178 | |
1179 | 1179 | |
1180 | - /** |
|
1181 | - * Gets deleted |
|
1182 | - * |
|
1183 | - * @return boolean |
|
1184 | - * @throws \EE_Error |
|
1185 | - */ |
|
1180 | + /** |
|
1181 | + * Gets deleted |
|
1182 | + * |
|
1183 | + * @return boolean |
|
1184 | + * @throws \EE_Error |
|
1185 | + */ |
|
1186 | 1186 | public function deleted() { |
1187 | 1187 | return $this->get( 'TKT_deleted' ); |
1188 | 1188 | } |
1189 | 1189 | |
1190 | 1190 | |
1191 | 1191 | |
1192 | - /** |
|
1193 | - * Sets deleted |
|
1194 | - * |
|
1195 | - * @param boolean $deleted |
|
1196 | - * @return void |
|
1197 | - * @throws \EE_Error |
|
1198 | - */ |
|
1192 | + /** |
|
1193 | + * Sets deleted |
|
1194 | + * |
|
1195 | + * @param boolean $deleted |
|
1196 | + * @return void |
|
1197 | + * @throws \EE_Error |
|
1198 | + */ |
|
1199 | 1199 | public function set_deleted( $deleted ) { |
1200 | 1200 | $this->set( 'TKT_deleted', $deleted ); |
1201 | 1201 | } |
1202 | 1202 | |
1203 | 1203 | |
1204 | 1204 | |
1205 | - /** |
|
1206 | - * Gets parent |
|
1207 | - * |
|
1208 | - * @return int |
|
1209 | - * @throws \EE_Error |
|
1210 | - */ |
|
1205 | + /** |
|
1206 | + * Gets parent |
|
1207 | + * |
|
1208 | + * @return int |
|
1209 | + * @throws \EE_Error |
|
1210 | + */ |
|
1211 | 1211 | public function parent_ID() { |
1212 | 1212 | return $this->get( 'TKT_parent' ); |
1213 | 1213 | } |
1214 | 1214 | |
1215 | 1215 | |
1216 | 1216 | |
1217 | - /** |
|
1218 | - * Sets parent |
|
1219 | - * |
|
1220 | - * @param int $parent |
|
1221 | - * @return void |
|
1222 | - * @throws \EE_Error |
|
1223 | - */ |
|
1217 | + /** |
|
1218 | + * Sets parent |
|
1219 | + * |
|
1220 | + * @param int $parent |
|
1221 | + * @return void |
|
1222 | + * @throws \EE_Error |
|
1223 | + */ |
|
1224 | 1224 | public function set_parent_ID( $parent ) { |
1225 | 1225 | $this->set( 'TKT_parent', $parent ); |
1226 | 1226 | } |
1227 | 1227 | |
1228 | 1228 | |
1229 | 1229 | |
1230 | - /** |
|
1231 | - * Gets a string which is handy for showing in gateways etc that describes the ticket. |
|
1232 | - * |
|
1233 | - * @return string |
|
1234 | - * @throws \EE_Error |
|
1235 | - */ |
|
1230 | + /** |
|
1231 | + * Gets a string which is handy for showing in gateways etc that describes the ticket. |
|
1232 | + * |
|
1233 | + * @return string |
|
1234 | + * @throws \EE_Error |
|
1235 | + */ |
|
1236 | 1236 | public function name_and_info() { |
1237 | 1237 | $times = array(); |
1238 | 1238 | foreach ( $this->datetimes() as $datetime ) { |
@@ -1243,50 +1243,50 @@ discard block |
||
1243 | 1243 | |
1244 | 1244 | |
1245 | 1245 | |
1246 | - /** |
|
1247 | - * Gets name |
|
1248 | - * |
|
1249 | - * @return string |
|
1250 | - * @throws \EE_Error |
|
1251 | - */ |
|
1246 | + /** |
|
1247 | + * Gets name |
|
1248 | + * |
|
1249 | + * @return string |
|
1250 | + * @throws \EE_Error |
|
1251 | + */ |
|
1252 | 1252 | public function name() { |
1253 | 1253 | return $this->get( 'TKT_name' ); |
1254 | 1254 | } |
1255 | 1255 | |
1256 | 1256 | |
1257 | 1257 | |
1258 | - /** |
|
1259 | - * Gets price |
|
1260 | - * |
|
1261 | - * @return float |
|
1262 | - * @throws \EE_Error |
|
1263 | - */ |
|
1258 | + /** |
|
1259 | + * Gets price |
|
1260 | + * |
|
1261 | + * @return float |
|
1262 | + * @throws \EE_Error |
|
1263 | + */ |
|
1264 | 1264 | public function price() { |
1265 | 1265 | return $this->get( 'TKT_price' ); |
1266 | 1266 | } |
1267 | 1267 | |
1268 | 1268 | |
1269 | 1269 | |
1270 | - /** |
|
1271 | - * Gets all the registrations for this ticket |
|
1272 | - * |
|
1273 | - * @param array $query_params like EEM_Base::get_all's |
|
1274 | - * @return EE_Registration[]|EE_Base_Class[] |
|
1275 | - * @throws \EE_Error |
|
1276 | - */ |
|
1270 | + /** |
|
1271 | + * Gets all the registrations for this ticket |
|
1272 | + * |
|
1273 | + * @param array $query_params like EEM_Base::get_all's |
|
1274 | + * @return EE_Registration[]|EE_Base_Class[] |
|
1275 | + * @throws \EE_Error |
|
1276 | + */ |
|
1277 | 1277 | public function registrations( $query_params = array() ) { |
1278 | 1278 | return $this->get_many_related( 'Registration', $query_params ); |
1279 | 1279 | } |
1280 | 1280 | |
1281 | 1281 | |
1282 | 1282 | |
1283 | - /** |
|
1284 | - * Updates the TKT_sold attribute (and saves) based on the number of APPROVED registrations for this ticket. |
|
1285 | - * into account |
|
1286 | - * |
|
1287 | - * @return int |
|
1288 | - * @throws \EE_Error |
|
1289 | - */ |
|
1283 | + /** |
|
1284 | + * Updates the TKT_sold attribute (and saves) based on the number of APPROVED registrations for this ticket. |
|
1285 | + * into account |
|
1286 | + * |
|
1287 | + * @return int |
|
1288 | + * @throws \EE_Error |
|
1289 | + */ |
|
1290 | 1290 | public function update_tickets_sold() { |
1291 | 1291 | $count_regs_for_this_ticket = $this->count_registrations( array( array( 'STS_ID' => EEM_Registration::status_id_approved, 'REG_deleted' => 0 ) ) ); |
1292 | 1292 | $this->set_sold( $count_regs_for_this_ticket ); |
@@ -1318,21 +1318,21 @@ discard block |
||
1318 | 1318 | |
1319 | 1319 | |
1320 | 1320 | |
1321 | - /** |
|
1322 | - * Implementation of the EEI_Event_Relation interface method |
|
1323 | - * |
|
1324 | - * @see EEI_Event_Relation for comments |
|
1325 | - * @return EE_Event |
|
1326 | - * @throws \EE_Error |
|
1327 | - * @throws UnexpectedEntityException |
|
1328 | - */ |
|
1321 | + /** |
|
1322 | + * Implementation of the EEI_Event_Relation interface method |
|
1323 | + * |
|
1324 | + * @see EEI_Event_Relation for comments |
|
1325 | + * @return EE_Event |
|
1326 | + * @throws \EE_Error |
|
1327 | + * @throws UnexpectedEntityException |
|
1328 | + */ |
|
1329 | 1329 | public function get_related_event() { |
1330 | 1330 | //get one datetime to use for getting the event |
1331 | 1331 | $datetime = $this->first_datetime(); |
1332 | 1332 | if ( ! $datetime instanceof \EE_Datetime ) { |
1333 | 1333 | throw new UnexpectedEntityException( |
1334 | 1334 | $datetime, |
1335 | - 'EE_Datetime', |
|
1335 | + 'EE_Datetime', |
|
1336 | 1336 | sprintf( |
1337 | 1337 | __( 'The ticket (%s) is not associated with any valid datetimes.', 'event_espresso'), |
1338 | 1338 | $this->name() |
@@ -1343,7 +1343,7 @@ discard block |
||
1343 | 1343 | if ( ! $event instanceof \EE_Event ) { |
1344 | 1344 | throw new UnexpectedEntityException( |
1345 | 1345 | $event, |
1346 | - 'EE_Event', |
|
1346 | + 'EE_Event', |
|
1347 | 1347 | sprintf( |
1348 | 1348 | __( 'The ticket (%s) is not associated with a valid event.', 'event_espresso'), |
1349 | 1349 | $this->name() |
@@ -1355,14 +1355,14 @@ discard block |
||
1355 | 1355 | |
1356 | 1356 | |
1357 | 1357 | |
1358 | - /** |
|
1359 | - * Implementation of the EEI_Event_Relation interface method |
|
1360 | - * |
|
1361 | - * @see EEI_Event_Relation for comments |
|
1362 | - * @return string |
|
1363 | - * @throws UnexpectedEntityException |
|
1364 | - * @throws \EE_Error |
|
1365 | - */ |
|
1358 | + /** |
|
1359 | + * Implementation of the EEI_Event_Relation interface method |
|
1360 | + * |
|
1361 | + * @see EEI_Event_Relation for comments |
|
1362 | + * @return string |
|
1363 | + * @throws UnexpectedEntityException |
|
1364 | + * @throws \EE_Error |
|
1365 | + */ |
|
1366 | 1366 | public function get_event_name() { |
1367 | 1367 | $event = $this->get_related_event(); |
1368 | 1368 | return $event instanceof EE_Event ? $event->name() : ''; |
@@ -1370,14 +1370,14 @@ discard block |
||
1370 | 1370 | |
1371 | 1371 | |
1372 | 1372 | |
1373 | - /** |
|
1374 | - * Implementation of the EEI_Event_Relation interface method |
|
1375 | - * |
|
1376 | - * @see EEI_Event_Relation for comments |
|
1377 | - * @return int |
|
1378 | - * @throws UnexpectedEntityException |
|
1379 | - * @throws \EE_Error |
|
1380 | - */ |
|
1373 | + /** |
|
1374 | + * Implementation of the EEI_Event_Relation interface method |
|
1375 | + * |
|
1376 | + * @see EEI_Event_Relation for comments |
|
1377 | + * @return int |
|
1378 | + * @throws UnexpectedEntityException |
|
1379 | + * @throws \EE_Error |
|
1380 | + */ |
|
1381 | 1381 | public function get_event_ID() { |
1382 | 1382 | $event = $this->get_related_event(); |
1383 | 1383 | return $event instanceof EE_Event ? $event->ID() : 0; |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php use EventEspresso\core\exceptions\UnexpectedEntityException; |
2 | 2 | |
3 | -if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
4 | - exit( 'No direct script access allowed' ); |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
4 | + exit('No direct script access allowed'); |
|
5 | 5 | } |
6 | 6 | /** |
7 | 7 | * Event Espresso |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | * @return EE_Ticket |
71 | 71 | * @throws \EE_Error |
72 | 72 | */ |
73 | - public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
|
74 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats ); |
|
75 | - return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats ); |
|
73 | + public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) { |
|
74 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats); |
|
75 | + return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | * @return EE_Ticket |
85 | 85 | * @throws \EE_Error |
86 | 86 | */ |
87 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
|
88 | - return new self( $props_n_values, TRUE, $timezone ); |
|
87 | + public static function new_instance_from_db($props_n_values = array(), $timezone = null) { |
|
88 | + return new self($props_n_values, TRUE, $timezone); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @throws \EE_Error |
96 | 96 | */ |
97 | 97 | public function parent() { |
98 | - return $this->get( 'TKT_parent' ); |
|
98 | + return $this->get('TKT_parent'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | * @return boolean |
108 | 108 | * @throws \EE_Error |
109 | 109 | */ |
110 | - public function available( $DTT_ID = 0 ) { |
|
110 | + public function available($DTT_ID = 0) { |
|
111 | 111 | // are we checking availability for a particular datetime ? |
112 | - if ( $DTT_ID ) { |
|
112 | + if ($DTT_ID) { |
|
113 | 113 | // get that datetime object |
114 | - $datetime = $this->get_first_related( 'Datetime', array( array( 'DTT_ID' => $DTT_ID ) ) ); |
|
114 | + $datetime = $this->get_first_related('Datetime', array(array('DTT_ID' => $DTT_ID))); |
|
115 | 115 | // if ticket sales for this datetime have exceeded the reg limit... |
116 | - if ( $datetime instanceof EE_Datetime && $datetime->sold_out() ) { |
|
116 | + if ($datetime instanceof EE_Datetime && $datetime->sold_out()) { |
|
117 | 117 | return FALSE; |
118 | 118 | } |
119 | 119 | } |
@@ -131,22 +131,22 @@ discard block |
||
131 | 131 | * @return mixed status int if the display string isn't requested |
132 | 132 | * @throws \EE_Error |
133 | 133 | */ |
134 | - public function ticket_status( $display = FALSE, $remaining = null ) { |
|
135 | - $remaining = is_bool( $remaining ) ? $remaining : $this->is_remaining(); |
|
136 | - if ( ! $remaining ) { |
|
137 | - return $display ? EEH_Template::pretty_status( EE_Ticket::sold_out, FALSE, 'sentence' ) : EE_Ticket::sold_out; |
|
134 | + public function ticket_status($display = FALSE, $remaining = null) { |
|
135 | + $remaining = is_bool($remaining) ? $remaining : $this->is_remaining(); |
|
136 | + if ( ! $remaining) { |
|
137 | + return $display ? EEH_Template::pretty_status(EE_Ticket::sold_out, FALSE, 'sentence') : EE_Ticket::sold_out; |
|
138 | 138 | } |
139 | - if ( $this->get( 'TKT_deleted' ) ) { |
|
140 | - return $display ? EEH_Template::pretty_status( EE_Ticket::archived, FALSE, 'sentence' ) : EE_Ticket::archived; |
|
139 | + if ($this->get('TKT_deleted')) { |
|
140 | + return $display ? EEH_Template::pretty_status(EE_Ticket::archived, FALSE, 'sentence') : EE_Ticket::archived; |
|
141 | 141 | } |
142 | - if ( $this->is_expired() ) { |
|
143 | - return $display ? EEH_Template::pretty_status( EE_Ticket::expired, FALSE, 'sentence' ) : EE_Ticket::expired; |
|
142 | + if ($this->is_expired()) { |
|
143 | + return $display ? EEH_Template::pretty_status(EE_Ticket::expired, FALSE, 'sentence') : EE_Ticket::expired; |
|
144 | 144 | } |
145 | - if ( $this->is_pending() ) { |
|
146 | - return $display ? EEH_Template::pretty_status( EE_Ticket::pending, FALSE, 'sentence' ) : EE_Ticket::pending; |
|
145 | + if ($this->is_pending()) { |
|
146 | + return $display ? EEH_Template::pretty_status(EE_Ticket::pending, FALSE, 'sentence') : EE_Ticket::pending; |
|
147 | 147 | } |
148 | - if ( $this->is_on_sale() ) { |
|
149 | - return $display ? EEH_Template::pretty_status( EE_Ticket::onsale, FALSE, 'sentence' ) : EE_Ticket::onsale; |
|
148 | + if ($this->is_on_sale()) { |
|
149 | + return $display ? EEH_Template::pretty_status(EE_Ticket::onsale, FALSE, 'sentence') : EE_Ticket::onsale; |
|
150 | 150 | } |
151 | 151 | return ''; |
152 | 152 | } |
@@ -161,12 +161,12 @@ discard block |
||
161 | 161 | * @return boolean true = tickets remaining, false not. |
162 | 162 | * @throws \EE_Error |
163 | 163 | */ |
164 | - public function is_remaining( $DTT_ID = 0 ) { |
|
165 | - $num_remaining = $this->remaining( $DTT_ID ); |
|
166 | - if ( $num_remaining === 0 ) { |
|
164 | + public function is_remaining($DTT_ID = 0) { |
|
165 | + $num_remaining = $this->remaining($DTT_ID); |
|
166 | + if ($num_remaining === 0) { |
|
167 | 167 | return FALSE; |
168 | 168 | } |
169 | - if ( $num_remaining > 0 && $num_remaining < $this->min() ) { |
|
169 | + if ($num_remaining > 0 && $num_remaining < $this->min()) { |
|
170 | 170 | return FALSE; |
171 | 171 | } |
172 | 172 | return TRUE; |
@@ -182,8 +182,8 @@ discard block |
||
182 | 182 | * @return int |
183 | 183 | * @throws \EE_Error |
184 | 184 | */ |
185 | - public function remaining( $DTT_ID = 0 ) { |
|
186 | - return $this->real_quantity_on_ticket('saleable', $DTT_ID ); |
|
185 | + public function remaining($DTT_ID = 0) { |
|
186 | + return $this->real_quantity_on_ticket('saleable', $DTT_ID); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * @throws \EE_Error |
196 | 196 | */ |
197 | 197 | public function min() { |
198 | - return $this->get( 'TKT_min' ); |
|
198 | + return $this->get('TKT_min'); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | * @throws \EE_Error |
208 | 208 | */ |
209 | 209 | public function is_expired() { |
210 | - return ( $this->get_raw( 'TKT_end_date' ) < time() ); |
|
210 | + return ($this->get_raw('TKT_end_date') < time()); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | * @throws \EE_Error |
220 | 220 | */ |
221 | 221 | public function is_pending() { |
222 | - return ( $this->get_raw( 'TKT_start_date' ) > time() ); |
|
222 | + return ($this->get_raw('TKT_start_date') > time()); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | * @throws \EE_Error |
232 | 232 | */ |
233 | 233 | public function is_on_sale() { |
234 | - return ( $this->get_raw( 'TKT_start_date' ) < time() && $this->get_raw( 'TKT_end_date' ) > time() ); |
|
234 | + return ($this->get_raw('TKT_start_date') < time() && $this->get_raw('TKT_end_date') > time()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
@@ -244,11 +244,11 @@ discard block |
||
244 | 244 | * @return string |
245 | 245 | * @throws \EE_Error |
246 | 246 | */ |
247 | - public function date_range( $dt_frmt = '', $conjunction = ' - ' ) { |
|
248 | - $first_date = $this->first_datetime() instanceof EE_Datetime ? $this->first_datetime()->start_date( $dt_frmt ) : ''; |
|
249 | - $last_date = $this->last_datetime() instanceof EE_Datetime ? $this->last_datetime()->end_date( $dt_frmt ) : ''; |
|
247 | + public function date_range($dt_frmt = '', $conjunction = ' - ') { |
|
248 | + $first_date = $this->first_datetime() instanceof EE_Datetime ? $this->first_datetime()->start_date($dt_frmt) : ''; |
|
249 | + $last_date = $this->last_datetime() instanceof EE_Datetime ? $this->last_datetime()->end_date($dt_frmt) : ''; |
|
250 | 250 | |
251 | - return $first_date && $last_date ? $first_date . $conjunction . $last_date : ''; |
|
251 | + return $first_date && $last_date ? $first_date.$conjunction.$last_date : ''; |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | |
@@ -260,8 +260,8 @@ discard block |
||
260 | 260 | * @throws \EE_Error |
261 | 261 | */ |
262 | 262 | public function first_datetime() { |
263 | - $datetimes = $this->datetimes( array( 'limit' => 1 ) ); |
|
264 | - return reset( $datetimes ); |
|
263 | + $datetimes = $this->datetimes(array('limit' => 1)); |
|
264 | + return reset($datetimes); |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | |
@@ -274,11 +274,11 @@ discard block |
||
274 | 274 | * @return EE_Datetime[]|EE_Base_Class[] |
275 | 275 | * @throws \EE_Error |
276 | 276 | */ |
277 | - public function datetimes( $query_params = array() ) { |
|
278 | - if ( ! isset( $query_params[ 'order_by' ] ) ) { |
|
279 | - $query_params[ 'order_by' ][ 'DTT_order' ] = 'ASC'; |
|
277 | + public function datetimes($query_params = array()) { |
|
278 | + if ( ! isset($query_params['order_by'])) { |
|
279 | + $query_params['order_by']['DTT_order'] = 'ASC'; |
|
280 | 280 | } |
281 | - return $this->get_many_related( 'Datetime', $query_params ); |
|
281 | + return $this->get_many_related('Datetime', $query_params); |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | |
@@ -290,8 +290,8 @@ discard block |
||
290 | 290 | * @throws \EE_Error |
291 | 291 | */ |
292 | 292 | public function last_datetime() { |
293 | - $datetimes = $this->datetimes( array( 'limit' => 1, 'order_by' => array( 'DTT_EVT_start' => 'DESC' ) ) ); |
|
294 | - return end( $datetimes ); |
|
293 | + $datetimes = $this->datetimes(array('limit' => 1, 'order_by' => array('DTT_EVT_start' => 'DESC'))); |
|
294 | + return end($datetimes); |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | |
@@ -309,22 +309,22 @@ discard block |
||
309 | 309 | * @return mixed (array|int) how many tickets have sold |
310 | 310 | * @throws \EE_Error |
311 | 311 | */ |
312 | - public function tickets_sold( $what = 'ticket', $dtt_id = NULL ) { |
|
312 | + public function tickets_sold($what = 'ticket', $dtt_id = NULL) { |
|
313 | 313 | $total = 0; |
314 | 314 | $tickets_sold = $this->_all_tickets_sold(); |
315 | - switch ( $what ) { |
|
315 | + switch ($what) { |
|
316 | 316 | case 'ticket' : |
317 | - return $tickets_sold[ 'ticket' ]; |
|
317 | + return $tickets_sold['ticket']; |
|
318 | 318 | break; |
319 | 319 | case 'datetime' : |
320 | - if ( empty( $tickets_sold[ 'datetime' ] ) ) { |
|
320 | + if (empty($tickets_sold['datetime'])) { |
|
321 | 321 | return $total; |
322 | 322 | } |
323 | - if ( ! empty( $dtt_id ) && ! isset( $tickets_sold[ 'datetime' ][ $dtt_id ] ) ) { |
|
324 | - EE_Error::add_error( __( 'You\'ve requested the amount of tickets sold for a given ticket and datetime, however there are no records for the datetime id you included. Are you SURE that is a datetime related to this ticket?', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
323 | + if ( ! empty($dtt_id) && ! isset($tickets_sold['datetime'][$dtt_id])) { |
|
324 | + EE_Error::add_error(__('You\'ve requested the amount of tickets sold for a given ticket and datetime, however there are no records for the datetime id you included. Are you SURE that is a datetime related to this ticket?', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
325 | 325 | return $total; |
326 | 326 | } |
327 | - return empty( $dtt_id ) ? $tickets_sold[ 'datetime' ] : $tickets_sold[ 'datetime' ][ $dtt_id ]; |
|
327 | + return empty($dtt_id) ? $tickets_sold['datetime'] : $tickets_sold['datetime'][$dtt_id]; |
|
328 | 328 | break; |
329 | 329 | default: |
330 | 330 | return $total; |
@@ -340,15 +340,15 @@ discard block |
||
340 | 340 | * @throws \EE_Error |
341 | 341 | */ |
342 | 342 | protected function _all_tickets_sold() { |
343 | - $datetimes = $this->get_many_related( 'Datetime' ); |
|
343 | + $datetimes = $this->get_many_related('Datetime'); |
|
344 | 344 | $tickets_sold = array(); |
345 | - if ( ! empty( $datetimes ) ) { |
|
346 | - foreach ( $datetimes as $datetime ) { |
|
347 | - $tickets_sold[ 'datetime' ][ $datetime->ID() ] = $datetime->get( 'DTT_sold' ); |
|
345 | + if ( ! empty($datetimes)) { |
|
346 | + foreach ($datetimes as $datetime) { |
|
347 | + $tickets_sold['datetime'][$datetime->ID()] = $datetime->get('DTT_sold'); |
|
348 | 348 | } |
349 | 349 | } |
350 | 350 | //Tickets sold |
351 | - $tickets_sold[ 'ticket' ] = $this->sold(); |
|
351 | + $tickets_sold['ticket'] = $this->sold(); |
|
352 | 352 | return $tickets_sold; |
353 | 353 | } |
354 | 354 | |
@@ -361,11 +361,11 @@ discard block |
||
361 | 361 | * @return EE_Price|EE_Base_Class|EE_Price[]|EE_Base_Class[] |
362 | 362 | * @throws \EE_Error |
363 | 363 | */ |
364 | - public function base_price( $return_array = FALSE ) { |
|
365 | - $_where = array( 'Price_Type.PBT_ID' => EEM_Price_Type::base_type_base_price ); |
|
364 | + public function base_price($return_array = FALSE) { |
|
365 | + $_where = array('Price_Type.PBT_ID' => EEM_Price_Type::base_type_base_price); |
|
366 | 366 | return $return_array |
367 | - ? $this->get_many_related( 'Price', array( $_where ) ) |
|
368 | - : $this->get_first_related( 'Price', array( $_where ) ); |
|
367 | + ? $this->get_many_related('Price', array($_where)) |
|
368 | + : $this->get_first_related('Price', array($_where)); |
|
369 | 369 | } |
370 | 370 | |
371 | 371 | |
@@ -378,8 +378,8 @@ discard block |
||
378 | 378 | * @throws \EE_Error |
379 | 379 | */ |
380 | 380 | public function price_modifiers() { |
381 | - $query_params = array( 0 => array( 'Price_Type.PBT_ID' => array( 'NOT IN', array( EEM_Price_Type::base_type_base_price, EEM_Price_Type::base_type_tax ) ) ) ); |
|
382 | - return $this->prices( $query_params ); |
|
381 | + $query_params = array(0 => array('Price_Type.PBT_ID' => array('NOT IN', array(EEM_Price_Type::base_type_base_price, EEM_Price_Type::base_type_tax)))); |
|
382 | + return $this->prices($query_params); |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | |
@@ -391,8 +391,8 @@ discard block |
||
391 | 391 | * @return EE_Price[]|EE_Base_Class[] |
392 | 392 | * @throws \EE_Error |
393 | 393 | */ |
394 | - public function prices( $query_params = array() ) { |
|
395 | - return $this->get_many_related( 'Price', $query_params ); |
|
394 | + public function prices($query_params = array()) { |
|
395 | + return $this->get_many_related('Price', $query_params); |
|
396 | 396 | } |
397 | 397 | |
398 | 398 | |
@@ -404,8 +404,8 @@ discard block |
||
404 | 404 | * @return EE_Datetime_Ticket|EE_Base_Class[] |
405 | 405 | * @throws \EE_Error |
406 | 406 | */ |
407 | - public function datetime_tickets( $query_params = array() ) { |
|
408 | - return $this->get_many_related( 'Datetime_Ticket', $query_params ); |
|
407 | + public function datetime_tickets($query_params = array()) { |
|
408 | + return $this->get_many_related('Datetime_Ticket', $query_params); |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | |
@@ -418,8 +418,8 @@ discard block |
||
418 | 418 | * @return EE_Datetime[] |
419 | 419 | * @throws \EE_Error |
420 | 420 | */ |
421 | - public function datetimes_ordered( $show_expired = TRUE, $show_deleted = FALSE ) { |
|
422 | - return EEM_Datetime::instance( $this->_timezone )->get_datetimes_for_ticket_ordered_by_DTT_order( $this->ID(), $show_expired, $show_deleted ); |
|
421 | + public function datetimes_ordered($show_expired = TRUE, $show_deleted = FALSE) { |
|
422 | + return EEM_Datetime::instance($this->_timezone)->get_datetimes_for_ticket_ordered_by_DTT_order($this->ID(), $show_expired, $show_deleted); |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | * @throws \EE_Error |
432 | 432 | */ |
433 | 433 | public function ID() { |
434 | - return $this->get( 'TKT_ID' ); |
|
434 | + return $this->get('TKT_ID'); |
|
435 | 435 | } |
436 | 436 | |
437 | 437 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | * @throws \EE_Error |
457 | 457 | */ |
458 | 458 | public function template() { |
459 | - return $this->get_first_related( 'Ticket_Template' ); |
|
459 | + return $this->get_first_related('Ticket_Template'); |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | * @throws \EE_Error |
479 | 479 | */ |
480 | 480 | public function ticket_price() { |
481 | - return $this->get( 'TKT_price' ); |
|
481 | + return $this->get('TKT_price'); |
|
482 | 482 | } |
483 | 483 | |
484 | 484 | |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | * @throws \EE_Error |
489 | 489 | */ |
490 | 490 | public function pretty_price() { |
491 | - return $this->get_pretty( 'TKT_price' ); |
|
491 | + return $this->get_pretty('TKT_price'); |
|
492 | 492 | } |
493 | 493 | |
494 | 494 | |
@@ -510,8 +510,8 @@ discard block |
||
510 | 510 | * @return float |
511 | 511 | * @throws \EE_Error |
512 | 512 | */ |
513 | - public function get_ticket_total_with_taxes( $no_cache = FALSE ) { |
|
514 | - if ($this->_ticket_total_with_taxes === null || $no_cache ) { |
|
513 | + public function get_ticket_total_with_taxes($no_cache = FALSE) { |
|
514 | + if ($this->_ticket_total_with_taxes === null || $no_cache) { |
|
515 | 515 | $this->_ticket_total_with_taxes = $this->get_ticket_subtotal() + $this->get_ticket_taxes_total_for_admin(); |
516 | 516 | } |
517 | 517 | return (float) $this->_ticket_total_with_taxes; |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | |
521 | 521 | |
522 | 522 | public function ensure_TKT_Price_correct() { |
523 | - $this->set( 'TKT_price', EE_Taxes::get_subtotal_for_admin( $this ) ); |
|
523 | + $this->set('TKT_price', EE_Taxes::get_subtotal_for_admin($this)); |
|
524 | 524 | $this->save(); |
525 | 525 | } |
526 | 526 | |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | * @throws \EE_Error |
532 | 532 | */ |
533 | 533 | public function get_ticket_subtotal() { |
534 | - return EE_Taxes::get_subtotal_for_admin( $this ); |
|
534 | + return EE_Taxes::get_subtotal_for_admin($this); |
|
535 | 535 | } |
536 | 536 | |
537 | 537 | |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | * @throws \EE_Error |
544 | 544 | */ |
545 | 545 | public function get_ticket_taxes_total_for_admin() { |
546 | - return EE_Taxes::get_total_taxes_for_admin( $this ); |
|
546 | + return EE_Taxes::get_total_taxes_for_admin($this); |
|
547 | 547 | } |
548 | 548 | |
549 | 549 | |
@@ -554,8 +554,8 @@ discard block |
||
554 | 554 | * @param string $name |
555 | 555 | * @throws \EE_Error |
556 | 556 | */ |
557 | - public function set_name( $name ) { |
|
558 | - $this->set( 'TKT_name', $name ); |
|
557 | + public function set_name($name) { |
|
558 | + $this->set('TKT_name', $name); |
|
559 | 559 | } |
560 | 560 | |
561 | 561 | |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | * @throws \EE_Error |
568 | 568 | */ |
569 | 569 | public function description() { |
570 | - return $this->get( 'TKT_description' ); |
|
570 | + return $this->get('TKT_description'); |
|
571 | 571 | } |
572 | 572 | |
573 | 573 | |
@@ -578,8 +578,8 @@ discard block |
||
578 | 578 | * @param string $description |
579 | 579 | * @throws \EE_Error |
580 | 580 | */ |
581 | - public function set_description( $description ) { |
|
582 | - $this->set( 'TKT_description', $description ); |
|
581 | + public function set_description($description) { |
|
582 | + $this->set('TKT_description', $description); |
|
583 | 583 | } |
584 | 584 | |
585 | 585 | |
@@ -592,8 +592,8 @@ discard block |
||
592 | 592 | * @return string |
593 | 593 | * @throws \EE_Error |
594 | 594 | */ |
595 | - public function start_date( $dt_frmt = '', $tm_frmt = '' ) { |
|
596 | - return $this->_get_datetime( 'TKT_start_date', $dt_frmt, $tm_frmt ); |
|
595 | + public function start_date($dt_frmt = '', $tm_frmt = '') { |
|
596 | + return $this->_get_datetime('TKT_start_date', $dt_frmt, $tm_frmt); |
|
597 | 597 | } |
598 | 598 | |
599 | 599 | |
@@ -605,8 +605,8 @@ discard block |
||
605 | 605 | * @return void |
606 | 606 | * @throws \EE_Error |
607 | 607 | */ |
608 | - public function set_start_date( $start_date ) { |
|
609 | - $this->_set_date_time( 'B', $start_date, 'TKT_start_date' ); |
|
608 | + public function set_start_date($start_date) { |
|
609 | + $this->_set_date_time('B', $start_date, 'TKT_start_date'); |
|
610 | 610 | } |
611 | 611 | |
612 | 612 | |
@@ -619,8 +619,8 @@ discard block |
||
619 | 619 | * @return string |
620 | 620 | * @throws \EE_Error |
621 | 621 | */ |
622 | - public function end_date( $dt_frmt = '', $tm_frmt = '' ) { |
|
623 | - return $this->_get_datetime( 'TKT_end_date', $dt_frmt, $tm_frmt ); |
|
622 | + public function end_date($dt_frmt = '', $tm_frmt = '') { |
|
623 | + return $this->_get_datetime('TKT_end_date', $dt_frmt, $tm_frmt); |
|
624 | 624 | } |
625 | 625 | |
626 | 626 | |
@@ -632,8 +632,8 @@ discard block |
||
632 | 632 | * @return void |
633 | 633 | * @throws \EE_Error |
634 | 634 | */ |
635 | - public function set_end_date( $end_date ) { |
|
636 | - $this->_set_date_time( 'B', $end_date, 'TKT_end_date' ); |
|
635 | + public function set_end_date($end_date) { |
|
636 | + $this->_set_date_time('B', $end_date, 'TKT_end_date'); |
|
637 | 637 | } |
638 | 638 | |
639 | 639 | |
@@ -645,8 +645,8 @@ discard block |
||
645 | 645 | * @param string $time a string representation of the sell until time (ex 9am or 7:30pm) |
646 | 646 | * @throws \EE_Error |
647 | 647 | */ |
648 | - public function set_end_time( $time ) { |
|
649 | - $this->_set_time_for( $time, 'TKT_end_date' ); |
|
648 | + public function set_end_time($time) { |
|
649 | + $this->_set_time_for($time, 'TKT_end_date'); |
|
650 | 650 | } |
651 | 651 | |
652 | 652 | |
@@ -658,8 +658,8 @@ discard block |
||
658 | 658 | * @return void |
659 | 659 | * @throws \EE_Error |
660 | 660 | */ |
661 | - public function set_min( $min ) { |
|
662 | - $this->set( 'TKT_min', $min ); |
|
661 | + public function set_min($min) { |
|
662 | + $this->set('TKT_min', $min); |
|
663 | 663 | } |
664 | 664 | |
665 | 665 | |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | * @throws \EE_Error |
672 | 672 | */ |
673 | 673 | public function max() { |
674 | - return $this->get( 'TKT_max' ); |
|
674 | + return $this->get('TKT_max'); |
|
675 | 675 | } |
676 | 676 | |
677 | 677 | |
@@ -683,8 +683,8 @@ discard block |
||
683 | 683 | * @return void |
684 | 684 | * @throws \EE_Error |
685 | 685 | */ |
686 | - public function set_max( $max ) { |
|
687 | - $this->set( 'TKT_max', $max ); |
|
686 | + public function set_max($max) { |
|
687 | + $this->set('TKT_max', $max); |
|
688 | 688 | } |
689 | 689 | |
690 | 690 | |
@@ -696,8 +696,8 @@ discard block |
||
696 | 696 | * @return void |
697 | 697 | * @throws \EE_Error |
698 | 698 | */ |
699 | - public function set_price( $price ) { |
|
700 | - $this->set( 'TKT_price', $price ); |
|
699 | + public function set_price($price) { |
|
700 | + $this->set('TKT_price', $price); |
|
701 | 701 | } |
702 | 702 | |
703 | 703 | |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | * @throws \EE_Error |
710 | 710 | */ |
711 | 711 | public function sold() { |
712 | - return $this->get_raw( 'TKT_sold' ); |
|
712 | + return $this->get_raw('TKT_sold'); |
|
713 | 713 | } |
714 | 714 | |
715 | 715 | |
@@ -721,10 +721,10 @@ discard block |
||
721 | 721 | * @return void |
722 | 722 | * @throws \EE_Error |
723 | 723 | */ |
724 | - public function set_sold( $sold ) { |
|
724 | + public function set_sold($sold) { |
|
725 | 725 | // sold can not go below zero |
726 | - $sold = max( 0, $sold ); |
|
727 | - $this->set( 'TKT_sold', $sold ); |
|
726 | + $sold = max(0, $sold); |
|
727 | + $this->set('TKT_sold', $sold); |
|
728 | 728 | } |
729 | 729 | |
730 | 730 | |
@@ -736,13 +736,13 @@ discard block |
||
736 | 736 | * @return void |
737 | 737 | * @throws \EE_Error |
738 | 738 | */ |
739 | - public function increase_sold( $qty = 1 ) { |
|
739 | + public function increase_sold($qty = 1) { |
|
740 | 740 | $sold = $this->sold() + $qty; |
741 | 741 | // remove ticket reservation, but don't adjust datetime reservations, because that will happen |
742 | 742 | // via \EE_Datetime::increase_sold() when \EE_Ticket::_increase_sold_for_datetimes() is called |
743 | - $this->decrease_reserved( $qty, false ); |
|
744 | - $this->_increase_sold_for_datetimes( $qty ); |
|
745 | - $this->set_sold( $sold ); |
|
743 | + $this->decrease_reserved($qty, false); |
|
744 | + $this->_increase_sold_for_datetimes($qty); |
|
745 | + $this->set_sold($sold); |
|
746 | 746 | } |
747 | 747 | |
748 | 748 | |
@@ -754,12 +754,12 @@ discard block |
||
754 | 754 | * @return void |
755 | 755 | * @throws \EE_Error |
756 | 756 | */ |
757 | - protected function _increase_sold_for_datetimes( $qty = 1 ) { |
|
757 | + protected function _increase_sold_for_datetimes($qty = 1) { |
|
758 | 758 | $datetimes = $this->datetimes(); |
759 | - if ( is_array( $datetimes ) ) { |
|
760 | - foreach ( $datetimes as $datetime ) { |
|
761 | - if ( $datetime instanceof EE_Datetime ) { |
|
762 | - $datetime->increase_sold( $qty ); |
|
759 | + if (is_array($datetimes)) { |
|
760 | + foreach ($datetimes as $datetime) { |
|
761 | + if ($datetime instanceof EE_Datetime) { |
|
762 | + $datetime->increase_sold($qty); |
|
763 | 763 | $datetime->save(); |
764 | 764 | } |
765 | 765 | } |
@@ -775,10 +775,10 @@ discard block |
||
775 | 775 | * @return void |
776 | 776 | * @throws \EE_Error |
777 | 777 | */ |
778 | - public function decrease_sold( $qty = 1 ) { |
|
778 | + public function decrease_sold($qty = 1) { |
|
779 | 779 | $sold = $this->sold() - $qty; |
780 | - $this->_decrease_sold_for_datetimes( $qty ); |
|
781 | - $this->set_sold( $sold ); |
|
780 | + $this->_decrease_sold_for_datetimes($qty); |
|
781 | + $this->set_sold($sold); |
|
782 | 782 | } |
783 | 783 | |
784 | 784 | |
@@ -790,12 +790,12 @@ discard block |
||
790 | 790 | * @return void |
791 | 791 | * @throws \EE_Error |
792 | 792 | */ |
793 | - protected function _decrease_sold_for_datetimes( $qty = 1 ) { |
|
793 | + protected function _decrease_sold_for_datetimes($qty = 1) { |
|
794 | 794 | $datetimes = $this->datetimes(); |
795 | - if ( is_array( $datetimes ) ) { |
|
796 | - foreach ( $datetimes as $datetime ) { |
|
797 | - if ( $datetime instanceof EE_Datetime ) { |
|
798 | - $datetime->decrease_sold( $qty ); |
|
795 | + if (is_array($datetimes)) { |
|
796 | + foreach ($datetimes as $datetime) { |
|
797 | + if ($datetime instanceof EE_Datetime) { |
|
798 | + $datetime->decrease_sold($qty); |
|
799 | 799 | $datetime->save(); |
800 | 800 | } |
801 | 801 | } |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | * @throws \EE_Error |
812 | 812 | */ |
813 | 813 | public function reserved() { |
814 | - return $this->get_raw( 'TKT_reserved' ); |
|
814 | + return $this->get_raw('TKT_reserved'); |
|
815 | 815 | } |
816 | 816 | |
817 | 817 | |
@@ -823,10 +823,10 @@ discard block |
||
823 | 823 | * @return void |
824 | 824 | * @throws \EE_Error |
825 | 825 | */ |
826 | - public function set_reserved( $reserved ) { |
|
826 | + public function set_reserved($reserved) { |
|
827 | 827 | // reserved can not go below zero |
828 | - $reserved = max( 0, (int) $reserved ); |
|
829 | - $this->set( 'TKT_reserved', $reserved ); |
|
828 | + $reserved = max(0, (int) $reserved); |
|
829 | + $this->set('TKT_reserved', $reserved); |
|
830 | 830 | } |
831 | 831 | |
832 | 832 | |
@@ -838,11 +838,11 @@ discard block |
||
838 | 838 | * @return void |
839 | 839 | * @throws \EE_Error |
840 | 840 | */ |
841 | - public function increase_reserved( $qty = 1 ) { |
|
842 | - $qty = absint( $qty ); |
|
841 | + public function increase_reserved($qty = 1) { |
|
842 | + $qty = absint($qty); |
|
843 | 843 | $reserved = $this->reserved() + $qty; |
844 | - $this->_increase_reserved_for_datetimes( $qty ); |
|
845 | - $this->set_reserved( $reserved ); |
|
844 | + $this->_increase_reserved_for_datetimes($qty); |
|
845 | + $this->set_reserved($reserved); |
|
846 | 846 | } |
847 | 847 | |
848 | 848 | |
@@ -854,12 +854,12 @@ discard block |
||
854 | 854 | * @return void |
855 | 855 | * @throws \EE_Error |
856 | 856 | */ |
857 | - protected function _increase_reserved_for_datetimes( $qty = 1 ) { |
|
857 | + protected function _increase_reserved_for_datetimes($qty = 1) { |
|
858 | 858 | $datetimes = $this->datetimes(); |
859 | - if ( is_array( $datetimes ) ) { |
|
860 | - foreach ( $datetimes as $datetime ) { |
|
861 | - if ( $datetime instanceof EE_Datetime ) { |
|
862 | - $datetime->increase_reserved( $qty ); |
|
859 | + if (is_array($datetimes)) { |
|
860 | + foreach ($datetimes as $datetime) { |
|
861 | + if ($datetime instanceof EE_Datetime) { |
|
862 | + $datetime->increase_reserved($qty); |
|
863 | 863 | $datetime->save(); |
864 | 864 | } |
865 | 865 | } |
@@ -876,12 +876,12 @@ discard block |
||
876 | 876 | * @return void |
877 | 877 | * @throws \EE_Error |
878 | 878 | */ |
879 | - public function decrease_reserved( $qty = 1, $adjust_datetimes = true ) { |
|
880 | - $reserved = $this->reserved() - absint( $qty ); |
|
881 | - if ( $adjust_datetimes ) { |
|
882 | - $this->_decrease_reserved_for_datetimes( $qty ); |
|
879 | + public function decrease_reserved($qty = 1, $adjust_datetimes = true) { |
|
880 | + $reserved = $this->reserved() - absint($qty); |
|
881 | + if ($adjust_datetimes) { |
|
882 | + $this->_decrease_reserved_for_datetimes($qty); |
|
883 | 883 | } |
884 | - $this->set_reserved( $reserved ); |
|
884 | + $this->set_reserved($reserved); |
|
885 | 885 | } |
886 | 886 | |
887 | 887 | |
@@ -893,12 +893,12 @@ discard block |
||
893 | 893 | * @return void |
894 | 894 | * @throws \EE_Error |
895 | 895 | */ |
896 | - protected function _decrease_reserved_for_datetimes( $qty = 1 ) { |
|
896 | + protected function _decrease_reserved_for_datetimes($qty = 1) { |
|
897 | 897 | $datetimes = $this->datetimes(); |
898 | - if ( is_array( $datetimes ) ) { |
|
899 | - foreach ( $datetimes as $datetime ) { |
|
900 | - if ( $datetime instanceof EE_Datetime ) { |
|
901 | - $datetime->decrease_reserved( $qty ); |
|
898 | + if (is_array($datetimes)) { |
|
899 | + foreach ($datetimes as $datetime) { |
|
900 | + if ($datetime instanceof EE_Datetime) { |
|
901 | + $datetime->decrease_reserved($qty); |
|
902 | 902 | $datetime->save(); |
903 | 903 | } |
904 | 904 | } |
@@ -919,14 +919,14 @@ discard block |
||
919 | 919 | * @return int |
920 | 920 | * @throws \EE_Error |
921 | 921 | */ |
922 | - public function qty( $context = '' ) { |
|
923 | - switch ( $context ) { |
|
922 | + public function qty($context = '') { |
|
923 | + switch ($context) { |
|
924 | 924 | case 'reg_limit' : |
925 | 925 | return $this->real_quantity_on_ticket(); |
926 | 926 | case 'saleable' : |
927 | - return $this->real_quantity_on_ticket( 'saleable' ); |
|
927 | + return $this->real_quantity_on_ticket('saleable'); |
|
928 | 928 | default: |
929 | - return $this->get_raw( 'TKT_qty' ); |
|
929 | + return $this->get_raw('TKT_qty'); |
|
930 | 930 | } |
931 | 931 | } |
932 | 932 | |
@@ -945,15 +945,15 @@ discard block |
||
945 | 945 | * @return int |
946 | 946 | * @throws \EE_Error |
947 | 947 | */ |
948 | - public function real_quantity_on_ticket( $context = 'reg_limit', $DTT_ID = 0 ) { |
|
949 | - $raw = $this->get_raw( 'TKT_qty' ); |
|
948 | + public function real_quantity_on_ticket($context = 'reg_limit', $DTT_ID = 0) { |
|
949 | + $raw = $this->get_raw('TKT_qty'); |
|
950 | 950 | // return immediately if it's zero |
951 | - if ( $raw === 0 ) { |
|
951 | + if ($raw === 0) { |
|
952 | 952 | return $raw; |
953 | 953 | } |
954 | 954 | //echo "\n\n<br />Ticket: " . $this->name() . '<br />'; |
955 | 955 | // ensure qty doesn't exceed raw value for THIS ticket |
956 | - $qty = min( EE_INF, $raw ); |
|
956 | + $qty = min(EE_INF, $raw); |
|
957 | 957 | //echo "\n . qty: " . $qty . '<br />'; |
958 | 958 | // calculate this ticket's total sales and reservations |
959 | 959 | $sold_and_reserved_for_this_ticket = $this->sold() + $this->reserved(); |
@@ -962,23 +962,23 @@ discard block |
||
962 | 962 | //echo "\n . sold_and_reserved_for_this_ticket: " . $sold_and_reserved_for_this_ticket . '<br />'; |
963 | 963 | // first we need to calculate the maximum number of tickets available for the datetime |
964 | 964 | // do we want data for one datetime or all of them ? |
965 | - $query_params = $DTT_ID ? array( array( 'DTT_ID' => $DTT_ID ) ) : array(); |
|
966 | - $datetimes = $this->datetimes( $query_params ); |
|
967 | - if ( is_array( $datetimes ) && ! empty( $datetimes ) ) { |
|
968 | - foreach ( $datetimes as $datetime ) { |
|
969 | - if ( $datetime instanceof EE_Datetime ) { |
|
965 | + $query_params = $DTT_ID ? array(array('DTT_ID' => $DTT_ID)) : array(); |
|
966 | + $datetimes = $this->datetimes($query_params); |
|
967 | + if (is_array($datetimes) && ! empty($datetimes)) { |
|
968 | + foreach ($datetimes as $datetime) { |
|
969 | + if ($datetime instanceof EE_Datetime) { |
|
970 | 970 | $datetime->refresh_from_db(); |
971 | 971 | //echo "\n . . datetime name: " . $datetime->name() . '<br />'; |
972 | 972 | //echo "\n . . datetime ID: " . $datetime->ID() . '<br />'; |
973 | 973 | // initialize with no restrictions for each datetime |
974 | 974 | // but adjust datetime qty based on datetime reg limit |
975 | - $datetime_qty = min( EE_INF, $datetime->reg_limit() ); |
|
975 | + $datetime_qty = min(EE_INF, $datetime->reg_limit()); |
|
976 | 976 | //echo "\n . . . datetime reg_limit: " . $datetime->reg_limit() . '<br />'; |
977 | 977 | //echo "\n . . . datetime_qty: " . $datetime_qty . '<br />'; |
978 | 978 | // if we want the actual saleable amount, then we need to consider OTHER ticket sales |
979 | 979 | // and reservations for this datetime, that do NOT include sales and reservations |
980 | 980 | // for this ticket (so we add $this->sold() and $this->reserved() back in) |
981 | - if ( $context === 'saleable' ) { |
|
981 | + if ($context === 'saleable') { |
|
982 | 982 | $datetime_qty = max( |
983 | 983 | $datetime_qty - $datetime->sold_and_reserved() + $sold_and_reserved_for_this_ticket, |
984 | 984 | 0 |
@@ -990,16 +990,16 @@ discard block |
||
990 | 990 | $datetime_qty = ! $datetime->sold_out() ? $datetime_qty : 0; |
991 | 991 | //echo "\n . . . datetime_qty: " . $datetime_qty . '<br />'; |
992 | 992 | } |
993 | - $qty = min( $datetime_qty, $qty ); |
|
993 | + $qty = min($datetime_qty, $qty); |
|
994 | 994 | //echo "\n . . qty: " . $qty . '<br />'; |
995 | 995 | } |
996 | 996 | } |
997 | 997 | } |
998 | 998 | // NOW that we know the maximum number of tickets available for the datetime |
999 | 999 | // we can finally factor in the details for this specific ticket |
1000 | - if ( $qty > 0 && $context === 'saleable' ) { |
|
1000 | + if ($qty > 0 && $context === 'saleable') { |
|
1001 | 1001 | // and subtract the sales for THIS ticket |
1002 | - $qty = max( $qty - $sold_and_reserved_for_this_ticket, 0 ); |
|
1002 | + $qty = max($qty - $sold_and_reserved_for_this_ticket, 0); |
|
1003 | 1003 | //echo "\n . qty: " . $qty . '<br />'; |
1004 | 1004 | } |
1005 | 1005 | //echo "\nFINAL QTY: " . $qty . "<br /><br />"; |
@@ -1015,14 +1015,14 @@ discard block |
||
1015 | 1015 | * @return void |
1016 | 1016 | * @throws \EE_Error |
1017 | 1017 | */ |
1018 | - public function set_qty( $qty ) { |
|
1018 | + public function set_qty($qty) { |
|
1019 | 1019 | $datetimes = $this->datetimes(); |
1020 | - foreach ( $datetimes as $datetime ) { |
|
1021 | - if ( $datetime instanceof EE_Datetime ) { |
|
1022 | - $qty = min( $qty, $datetime->reg_limit() ); |
|
1020 | + foreach ($datetimes as $datetime) { |
|
1021 | + if ($datetime instanceof EE_Datetime) { |
|
1022 | + $qty = min($qty, $datetime->reg_limit()); |
|
1023 | 1023 | } |
1024 | 1024 | } |
1025 | - $this->set( 'TKT_qty', $qty ); |
|
1025 | + $this->set('TKT_qty', $qty); |
|
1026 | 1026 | } |
1027 | 1027 | |
1028 | 1028 | |
@@ -1034,7 +1034,7 @@ discard block |
||
1034 | 1034 | * @throws \EE_Error |
1035 | 1035 | */ |
1036 | 1036 | public function uses() { |
1037 | - return $this->get( 'TKT_uses' ); |
|
1037 | + return $this->get('TKT_uses'); |
|
1038 | 1038 | } |
1039 | 1039 | |
1040 | 1040 | |
@@ -1046,8 +1046,8 @@ discard block |
||
1046 | 1046 | * @return void |
1047 | 1047 | * @throws \EE_Error |
1048 | 1048 | */ |
1049 | - public function set_uses( $uses ) { |
|
1050 | - $this->set( 'TKT_uses', $uses ); |
|
1049 | + public function set_uses($uses) { |
|
1050 | + $this->set('TKT_uses', $uses); |
|
1051 | 1051 | } |
1052 | 1052 | |
1053 | 1053 | |
@@ -1059,7 +1059,7 @@ discard block |
||
1059 | 1059 | * @throws \EE_Error |
1060 | 1060 | */ |
1061 | 1061 | public function required() { |
1062 | - return $this->get( 'TKT_required' ); |
|
1062 | + return $this->get('TKT_required'); |
|
1063 | 1063 | } |
1064 | 1064 | |
1065 | 1065 | |
@@ -1071,8 +1071,8 @@ discard block |
||
1071 | 1071 | * @return void |
1072 | 1072 | * @throws \EE_Error |
1073 | 1073 | */ |
1074 | - public function set_required( $required ) { |
|
1075 | - $this->set( 'TKT_required', $required ); |
|
1074 | + public function set_required($required) { |
|
1075 | + $this->set('TKT_required', $required); |
|
1076 | 1076 | } |
1077 | 1077 | |
1078 | 1078 | |
@@ -1084,7 +1084,7 @@ discard block |
||
1084 | 1084 | * @throws \EE_Error |
1085 | 1085 | */ |
1086 | 1086 | public function taxable() { |
1087 | - return $this->get( 'TKT_taxable' ); |
|
1087 | + return $this->get('TKT_taxable'); |
|
1088 | 1088 | } |
1089 | 1089 | |
1090 | 1090 | |
@@ -1096,8 +1096,8 @@ discard block |
||
1096 | 1096 | * @return void |
1097 | 1097 | * @throws \EE_Error |
1098 | 1098 | */ |
1099 | - public function set_taxable( $taxable ) { |
|
1100 | - $this->set( 'TKT_taxable', $taxable ); |
|
1099 | + public function set_taxable($taxable) { |
|
1100 | + $this->set('TKT_taxable', $taxable); |
|
1101 | 1101 | } |
1102 | 1102 | |
1103 | 1103 | |
@@ -1109,7 +1109,7 @@ discard block |
||
1109 | 1109 | * @throws \EE_Error |
1110 | 1110 | */ |
1111 | 1111 | public function is_default() { |
1112 | - return $this->get( 'TKT_is_default' ); |
|
1112 | + return $this->get('TKT_is_default'); |
|
1113 | 1113 | } |
1114 | 1114 | |
1115 | 1115 | |
@@ -1121,8 +1121,8 @@ discard block |
||
1121 | 1121 | * @return void |
1122 | 1122 | * @throws \EE_Error |
1123 | 1123 | */ |
1124 | - public function set_is_default( $is_default ) { |
|
1125 | - $this->set( 'TKT_is_default', $is_default ); |
|
1124 | + public function set_is_default($is_default) { |
|
1125 | + $this->set('TKT_is_default', $is_default); |
|
1126 | 1126 | } |
1127 | 1127 | |
1128 | 1128 | |
@@ -1134,7 +1134,7 @@ discard block |
||
1134 | 1134 | * @throws \EE_Error |
1135 | 1135 | */ |
1136 | 1136 | public function order() { |
1137 | - return $this->get( 'TKT_order' ); |
|
1137 | + return $this->get('TKT_order'); |
|
1138 | 1138 | } |
1139 | 1139 | |
1140 | 1140 | |
@@ -1146,8 +1146,8 @@ discard block |
||
1146 | 1146 | * @return void |
1147 | 1147 | * @throws \EE_Error |
1148 | 1148 | */ |
1149 | - public function set_order( $order ) { |
|
1150 | - $this->set( 'TKT_order', $order ); |
|
1149 | + public function set_order($order) { |
|
1150 | + $this->set('TKT_order', $order); |
|
1151 | 1151 | } |
1152 | 1152 | |
1153 | 1153 | |
@@ -1159,7 +1159,7 @@ discard block |
||
1159 | 1159 | * @throws \EE_Error |
1160 | 1160 | */ |
1161 | 1161 | public function row() { |
1162 | - return $this->get( 'TKT_row' ); |
|
1162 | + return $this->get('TKT_row'); |
|
1163 | 1163 | } |
1164 | 1164 | |
1165 | 1165 | |
@@ -1171,8 +1171,8 @@ discard block |
||
1171 | 1171 | * @return void |
1172 | 1172 | * @throws \EE_Error |
1173 | 1173 | */ |
1174 | - public function set_row( $row ) { |
|
1175 | - $this->set( 'TKT_row', $row ); |
|
1174 | + public function set_row($row) { |
|
1175 | + $this->set('TKT_row', $row); |
|
1176 | 1176 | } |
1177 | 1177 | |
1178 | 1178 | |
@@ -1184,7 +1184,7 @@ discard block |
||
1184 | 1184 | * @throws \EE_Error |
1185 | 1185 | */ |
1186 | 1186 | public function deleted() { |
1187 | - return $this->get( 'TKT_deleted' ); |
|
1187 | + return $this->get('TKT_deleted'); |
|
1188 | 1188 | } |
1189 | 1189 | |
1190 | 1190 | |
@@ -1196,8 +1196,8 @@ discard block |
||
1196 | 1196 | * @return void |
1197 | 1197 | * @throws \EE_Error |
1198 | 1198 | */ |
1199 | - public function set_deleted( $deleted ) { |
|
1200 | - $this->set( 'TKT_deleted', $deleted ); |
|
1199 | + public function set_deleted($deleted) { |
|
1200 | + $this->set('TKT_deleted', $deleted); |
|
1201 | 1201 | } |
1202 | 1202 | |
1203 | 1203 | |
@@ -1209,7 +1209,7 @@ discard block |
||
1209 | 1209 | * @throws \EE_Error |
1210 | 1210 | */ |
1211 | 1211 | public function parent_ID() { |
1212 | - return $this->get( 'TKT_parent' ); |
|
1212 | + return $this->get('TKT_parent'); |
|
1213 | 1213 | } |
1214 | 1214 | |
1215 | 1215 | |
@@ -1221,8 +1221,8 @@ discard block |
||
1221 | 1221 | * @return void |
1222 | 1222 | * @throws \EE_Error |
1223 | 1223 | */ |
1224 | - public function set_parent_ID( $parent ) { |
|
1225 | - $this->set( 'TKT_parent', $parent ); |
|
1224 | + public function set_parent_ID($parent) { |
|
1225 | + $this->set('TKT_parent', $parent); |
|
1226 | 1226 | } |
1227 | 1227 | |
1228 | 1228 | |
@@ -1235,10 +1235,10 @@ discard block |
||
1235 | 1235 | */ |
1236 | 1236 | public function name_and_info() { |
1237 | 1237 | $times = array(); |
1238 | - foreach ( $this->datetimes() as $datetime ) { |
|
1238 | + foreach ($this->datetimes() as $datetime) { |
|
1239 | 1239 | $times[] = $datetime->start_date_and_time(); |
1240 | 1240 | } |
1241 | - return $this->name() . ' @ ' . implode( ', ', $times ) . ' for ' . $this->pretty_price(); |
|
1241 | + return $this->name().' @ '.implode(', ', $times).' for '.$this->pretty_price(); |
|
1242 | 1242 | } |
1243 | 1243 | |
1244 | 1244 | |
@@ -1250,7 +1250,7 @@ discard block |
||
1250 | 1250 | * @throws \EE_Error |
1251 | 1251 | */ |
1252 | 1252 | public function name() { |
1253 | - return $this->get( 'TKT_name' ); |
|
1253 | + return $this->get('TKT_name'); |
|
1254 | 1254 | } |
1255 | 1255 | |
1256 | 1256 | |
@@ -1262,7 +1262,7 @@ discard block |
||
1262 | 1262 | * @throws \EE_Error |
1263 | 1263 | */ |
1264 | 1264 | public function price() { |
1265 | - return $this->get( 'TKT_price' ); |
|
1265 | + return $this->get('TKT_price'); |
|
1266 | 1266 | } |
1267 | 1267 | |
1268 | 1268 | |
@@ -1274,8 +1274,8 @@ discard block |
||
1274 | 1274 | * @return EE_Registration[]|EE_Base_Class[] |
1275 | 1275 | * @throws \EE_Error |
1276 | 1276 | */ |
1277 | - public function registrations( $query_params = array() ) { |
|
1278 | - return $this->get_many_related( 'Registration', $query_params ); |
|
1277 | + public function registrations($query_params = array()) { |
|
1278 | + return $this->get_many_related('Registration', $query_params); |
|
1279 | 1279 | } |
1280 | 1280 | |
1281 | 1281 | |
@@ -1288,8 +1288,8 @@ discard block |
||
1288 | 1288 | * @throws \EE_Error |
1289 | 1289 | */ |
1290 | 1290 | public function update_tickets_sold() { |
1291 | - $count_regs_for_this_ticket = $this->count_registrations( array( array( 'STS_ID' => EEM_Registration::status_id_approved, 'REG_deleted' => 0 ) ) ); |
|
1292 | - $this->set_sold( $count_regs_for_this_ticket ); |
|
1291 | + $count_regs_for_this_ticket = $this->count_registrations(array(array('STS_ID' => EEM_Registration::status_id_approved, 'REG_deleted' => 0))); |
|
1292 | + $this->set_sold($count_regs_for_this_ticket); |
|
1293 | 1293 | $this->save(); |
1294 | 1294 | return $count_regs_for_this_ticket; |
1295 | 1295 | } |
@@ -1301,7 +1301,7 @@ discard block |
||
1301 | 1301 | * @param array $query_params like EEM_Base::get_all's |
1302 | 1302 | * @return int |
1303 | 1303 | */ |
1304 | - public function count_registrations( $query_params = array() ) { |
|
1304 | + public function count_registrations($query_params = array()) { |
|
1305 | 1305 | return $this->count_related('Registration', $query_params); |
1306 | 1306 | } |
1307 | 1307 | |
@@ -1329,23 +1329,23 @@ discard block |
||
1329 | 1329 | public function get_related_event() { |
1330 | 1330 | //get one datetime to use for getting the event |
1331 | 1331 | $datetime = $this->first_datetime(); |
1332 | - if ( ! $datetime instanceof \EE_Datetime ) { |
|
1332 | + if ( ! $datetime instanceof \EE_Datetime) { |
|
1333 | 1333 | throw new UnexpectedEntityException( |
1334 | 1334 | $datetime, |
1335 | 1335 | 'EE_Datetime', |
1336 | 1336 | sprintf( |
1337 | - __( 'The ticket (%s) is not associated with any valid datetimes.', 'event_espresso'), |
|
1337 | + __('The ticket (%s) is not associated with any valid datetimes.', 'event_espresso'), |
|
1338 | 1338 | $this->name() |
1339 | 1339 | ) |
1340 | 1340 | ); |
1341 | 1341 | } |
1342 | 1342 | $event = $datetime->event(); |
1343 | - if ( ! $event instanceof \EE_Event ) { |
|
1343 | + if ( ! $event instanceof \EE_Event) { |
|
1344 | 1344 | throw new UnexpectedEntityException( |
1345 | 1345 | $event, |
1346 | 1346 | 'EE_Event', |
1347 | 1347 | sprintf( |
1348 | - __( 'The ticket (%s) is not associated with a valid event.', 'event_espresso'), |
|
1348 | + __('The ticket (%s) is not associated with a valid event.', 'event_espresso'), |
|
1349 | 1349 | $this->name() |
1350 | 1350 | ) |
1351 | 1351 | ); |
@@ -17,118 +17,118 @@ |
||
17 | 17 | class TicketSelectorStandard extends TicketSelector |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * @var string $date_format |
|
22 | - */ |
|
23 | - protected $date_format; |
|
24 | - |
|
25 | - /** |
|
26 | - * @var string $time_format |
|
27 | - */ |
|
28 | - protected $time_format; |
|
29 | - |
|
30 | - /** |
|
31 | - * @var \EE_Ticket_Selector_Config $ticket_selector_config |
|
32 | - */ |
|
33 | - protected $ticket_selector_config; |
|
34 | - |
|
35 | - /** |
|
36 | - * @var \EE_Tax_Config $tax_config |
|
37 | - */ |
|
38 | - protected $tax_config; |
|
39 | - |
|
40 | - |
|
41 | - |
|
42 | - /** |
|
43 | - * TicketSelectorSimple constructor. |
|
44 | - * |
|
45 | - * @param \EE_Event $event |
|
46 | - * @param \EE_Ticket[] $tickets |
|
47 | - * @param int $max_attendees |
|
48 | - * @param array $template_args |
|
49 | - * @param string $date_format |
|
50 | - * @param string $time_format |
|
51 | - * @param \EE_Ticket_Selector_Config $ticket_selector_config |
|
52 | - * @param \EE_Tax_Config $tax_config |
|
53 | - */ |
|
54 | - public function __construct( |
|
55 | - \EE_Event $event, |
|
56 | - array $tickets, |
|
57 | - $max_attendees, |
|
58 | - array $template_args, |
|
59 | - $date_format = 'Y-m-d', |
|
60 | - $time_format = 'g:i a', |
|
61 | - \EE_Ticket_Selector_Config $ticket_selector_config = null, |
|
62 | - \EE_Tax_Config $tax_config = null |
|
63 | - ) { |
|
64 | - $this->date_format = $date_format; |
|
65 | - $this->time_format = $time_format; |
|
66 | - // get EE_Ticket_Selector_Config and TicketDetails |
|
67 | - $this->ticket_selector_config = isset (\EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector) |
|
68 | - ? \EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector |
|
69 | - : new \EE_Ticket_Selector_Config(); |
|
70 | - // $template_settings->setDatetimeSelectorThreshold(2); |
|
71 | - // \EEH_Debug_Tools::printr($template_settings->getShowDatetimeSelector(), 'getShowDatetimeSelector', __FILE__, __LINE__); |
|
72 | - // \EEH_Debug_Tools::printr($template_settings->getDatetimeSelectorThreshold(), 'getDatetimeSelectorThreshold', __FILE__, __LINE__); |
|
73 | - $this->tax_config = isset (\EE_Registry::instance()->CFG->tax_settings) |
|
74 | - ? \EE_Registry::instance()->CFG->tax_settings |
|
75 | - : new \EE_Tax_Config(); |
|
76 | - parent::__construct($event, $tickets, $max_attendees, $template_args); |
|
77 | - } |
|
78 | - |
|
79 | - |
|
80 | - |
|
81 | - /** |
|
82 | - * sets any and all template args that are required for this Ticket Selector |
|
83 | - * |
|
84 | - * @return void |
|
85 | - * @throws \EE_Error |
|
86 | - */ |
|
87 | - protected function addTemplateArgs() |
|
88 | - { |
|
89 | - $row = 1; |
|
90 | - $ticket_row_html = ''; |
|
91 | - $required_ticket_sold_out = false; |
|
92 | - // flag to indicate that at least one taxable ticket has been encountered |
|
93 | - $taxable_tickets = false; |
|
94 | - $datetime_selector = new DatetimeSelector( |
|
95 | - $this->event, |
|
96 | - $this->tickets, |
|
97 | - $this->ticket_selector_config, |
|
98 | - $this->date_format, |
|
99 | - $this->time_format |
|
100 | - ); |
|
101 | - // loop through tickets |
|
102 | - foreach ($this->tickets as $TKT_ID => $ticket) { |
|
103 | - if ($ticket instanceof \EE_Ticket) { |
|
104 | - $cols = 2; |
|
105 | - $taxable_tickets = $ticket->taxable() ? true : $taxable_tickets; |
|
106 | - $ticket_selector_row = new TicketSelectorRowStandard( |
|
107 | - $ticket, |
|
108 | - new TicketDetails($ticket, $this->ticket_selector_config, $this->template_args), |
|
109 | - $this->ticket_selector_config, |
|
110 | - $this->tax_config, |
|
111 | - $this->max_attendees, |
|
112 | - $row, |
|
113 | - $cols, |
|
114 | - $required_ticket_sold_out, |
|
115 | - $this->template_args['event_status'], |
|
116 | - $this->template_args['date_format'], |
|
117 | - $datetime_selector->getTicketDatetimeClasses($ticket) |
|
118 | - ); |
|
119 | - $ticket_row_html .= $ticket_selector_row->getHtml(); |
|
120 | - $required_ticket_sold_out = $ticket_selector_row->getRequiredTicketSoldOut(); |
|
121 | - $row++; |
|
122 | - } |
|
123 | - } |
|
124 | - $this->template_args['row'] = $row; |
|
125 | - $this->template_args['ticket_row_html'] = $ticket_row_html; |
|
126 | - $this->template_args['taxable_tickets'] = $taxable_tickets; |
|
127 | - $this->template_args['datetime_selector'] = $datetime_selector->getDatetimeSelector(); |
|
128 | - $this->template_args['prices_displayed_including_taxes'] = $this->tax_config->prices_displayed_including_taxes; |
|
129 | - $this->template_args['template_path'] = TICKET_SELECTOR_TEMPLATES_PATH . 'standard_ticket_selector.template.php'; |
|
130 | - remove_all_filters('FHEE__EE_Ticket_Selector__hide_ticket_selector'); |
|
131 | - } |
|
20 | + /** |
|
21 | + * @var string $date_format |
|
22 | + */ |
|
23 | + protected $date_format; |
|
24 | + |
|
25 | + /** |
|
26 | + * @var string $time_format |
|
27 | + */ |
|
28 | + protected $time_format; |
|
29 | + |
|
30 | + /** |
|
31 | + * @var \EE_Ticket_Selector_Config $ticket_selector_config |
|
32 | + */ |
|
33 | + protected $ticket_selector_config; |
|
34 | + |
|
35 | + /** |
|
36 | + * @var \EE_Tax_Config $tax_config |
|
37 | + */ |
|
38 | + protected $tax_config; |
|
39 | + |
|
40 | + |
|
41 | + |
|
42 | + /** |
|
43 | + * TicketSelectorSimple constructor. |
|
44 | + * |
|
45 | + * @param \EE_Event $event |
|
46 | + * @param \EE_Ticket[] $tickets |
|
47 | + * @param int $max_attendees |
|
48 | + * @param array $template_args |
|
49 | + * @param string $date_format |
|
50 | + * @param string $time_format |
|
51 | + * @param \EE_Ticket_Selector_Config $ticket_selector_config |
|
52 | + * @param \EE_Tax_Config $tax_config |
|
53 | + */ |
|
54 | + public function __construct( |
|
55 | + \EE_Event $event, |
|
56 | + array $tickets, |
|
57 | + $max_attendees, |
|
58 | + array $template_args, |
|
59 | + $date_format = 'Y-m-d', |
|
60 | + $time_format = 'g:i a', |
|
61 | + \EE_Ticket_Selector_Config $ticket_selector_config = null, |
|
62 | + \EE_Tax_Config $tax_config = null |
|
63 | + ) { |
|
64 | + $this->date_format = $date_format; |
|
65 | + $this->time_format = $time_format; |
|
66 | + // get EE_Ticket_Selector_Config and TicketDetails |
|
67 | + $this->ticket_selector_config = isset (\EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector) |
|
68 | + ? \EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector |
|
69 | + : new \EE_Ticket_Selector_Config(); |
|
70 | + // $template_settings->setDatetimeSelectorThreshold(2); |
|
71 | + // \EEH_Debug_Tools::printr($template_settings->getShowDatetimeSelector(), 'getShowDatetimeSelector', __FILE__, __LINE__); |
|
72 | + // \EEH_Debug_Tools::printr($template_settings->getDatetimeSelectorThreshold(), 'getDatetimeSelectorThreshold', __FILE__, __LINE__); |
|
73 | + $this->tax_config = isset (\EE_Registry::instance()->CFG->tax_settings) |
|
74 | + ? \EE_Registry::instance()->CFG->tax_settings |
|
75 | + : new \EE_Tax_Config(); |
|
76 | + parent::__construct($event, $tickets, $max_attendees, $template_args); |
|
77 | + } |
|
78 | + |
|
79 | + |
|
80 | + |
|
81 | + /** |
|
82 | + * sets any and all template args that are required for this Ticket Selector |
|
83 | + * |
|
84 | + * @return void |
|
85 | + * @throws \EE_Error |
|
86 | + */ |
|
87 | + protected function addTemplateArgs() |
|
88 | + { |
|
89 | + $row = 1; |
|
90 | + $ticket_row_html = ''; |
|
91 | + $required_ticket_sold_out = false; |
|
92 | + // flag to indicate that at least one taxable ticket has been encountered |
|
93 | + $taxable_tickets = false; |
|
94 | + $datetime_selector = new DatetimeSelector( |
|
95 | + $this->event, |
|
96 | + $this->tickets, |
|
97 | + $this->ticket_selector_config, |
|
98 | + $this->date_format, |
|
99 | + $this->time_format |
|
100 | + ); |
|
101 | + // loop through tickets |
|
102 | + foreach ($this->tickets as $TKT_ID => $ticket) { |
|
103 | + if ($ticket instanceof \EE_Ticket) { |
|
104 | + $cols = 2; |
|
105 | + $taxable_tickets = $ticket->taxable() ? true : $taxable_tickets; |
|
106 | + $ticket_selector_row = new TicketSelectorRowStandard( |
|
107 | + $ticket, |
|
108 | + new TicketDetails($ticket, $this->ticket_selector_config, $this->template_args), |
|
109 | + $this->ticket_selector_config, |
|
110 | + $this->tax_config, |
|
111 | + $this->max_attendees, |
|
112 | + $row, |
|
113 | + $cols, |
|
114 | + $required_ticket_sold_out, |
|
115 | + $this->template_args['event_status'], |
|
116 | + $this->template_args['date_format'], |
|
117 | + $datetime_selector->getTicketDatetimeClasses($ticket) |
|
118 | + ); |
|
119 | + $ticket_row_html .= $ticket_selector_row->getHtml(); |
|
120 | + $required_ticket_sold_out = $ticket_selector_row->getRequiredTicketSoldOut(); |
|
121 | + $row++; |
|
122 | + } |
|
123 | + } |
|
124 | + $this->template_args['row'] = $row; |
|
125 | + $this->template_args['ticket_row_html'] = $ticket_row_html; |
|
126 | + $this->template_args['taxable_tickets'] = $taxable_tickets; |
|
127 | + $this->template_args['datetime_selector'] = $datetime_selector->getDatetimeSelector(); |
|
128 | + $this->template_args['prices_displayed_including_taxes'] = $this->tax_config->prices_displayed_including_taxes; |
|
129 | + $this->template_args['template_path'] = TICKET_SELECTOR_TEMPLATES_PATH . 'standard_ticket_selector.template.php'; |
|
130 | + remove_all_filters('FHEE__EE_Ticket_Selector__hide_ticket_selector'); |
|
131 | + } |
|
132 | 132 | |
133 | 133 | |
134 | 134 |
@@ -126,7 +126,7 @@ |
||
126 | 126 | $this->template_args['taxable_tickets'] = $taxable_tickets; |
127 | 127 | $this->template_args['datetime_selector'] = $datetime_selector->getDatetimeSelector(); |
128 | 128 | $this->template_args['prices_displayed_including_taxes'] = $this->tax_config->prices_displayed_including_taxes; |
129 | - $this->template_args['template_path'] = TICKET_SELECTOR_TEMPLATES_PATH . 'standard_ticket_selector.template.php'; |
|
129 | + $this->template_args['template_path'] = TICKET_SELECTOR_TEMPLATES_PATH.'standard_ticket_selector.template.php'; |
|
130 | 130 | remove_all_filters('FHEE__EE_Ticket_Selector__hide_ticket_selector'); |
131 | 131 | } |
132 | 132 |
@@ -16,175 +16,175 @@ |
||
16 | 16 | class DatetimeSelector |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * @var \EE_Event $event |
|
21 | - */ |
|
22 | - protected $event; |
|
23 | - |
|
24 | - /** |
|
25 | - * @var \EE_Ticket[] $tickets |
|
26 | - */ |
|
27 | - protected $tickets; |
|
28 | - |
|
29 | - /** |
|
30 | - * @var \EE_Datetime[] $datetimes |
|
31 | - */ |
|
32 | - protected $datetimes; |
|
33 | - |
|
34 | - /** |
|
35 | - * @var \EE_Datetime[] $unique_dates |
|
36 | - */ |
|
37 | - protected $unique_dates; |
|
38 | - |
|
39 | - /** |
|
40 | - * @var \EE_Ticket_Selector_Config $template_settings |
|
41 | - */ |
|
42 | - protected $template_settings; |
|
43 | - |
|
44 | - /** |
|
45 | - * @var boolean $active |
|
46 | - */ |
|
47 | - protected $active = false; |
|
48 | - |
|
49 | - |
|
50 | - |
|
51 | - /** |
|
52 | - * DatetimeSelector constructor. |
|
53 | - * |
|
54 | - * @param \EE_Event $event |
|
55 | - * @param \EE_Ticket[] $tickets |
|
56 | - * @param \EE_Ticket_Selector_Config $template_settings |
|
57 | - * @param string $date_format |
|
58 | - * @param string $time_format |
|
59 | - * @throws \EE_Error |
|
60 | - */ |
|
61 | - public function __construct( |
|
62 | - \EE_Event $event, |
|
63 | - array $tickets, |
|
64 | - \EE_Ticket_Selector_Config $template_settings, |
|
65 | - $date_format = 'Y-m-d', |
|
66 | - $time_format = 'g:i a' |
|
67 | - ) { |
|
68 | - $this->event = $event; |
|
69 | - $this->tickets = $tickets; |
|
70 | - $this->template_settings = $template_settings; |
|
71 | - $this->datetimes = $this->getAllDatetimesForAllTicket($tickets); |
|
72 | - $this->unique_dates = $this->getUniqueDatetimeOptions($date_format, $time_format); |
|
73 | - $this->active = $this->template_settings->showDatetimeSelector($this->unique_dates); |
|
74 | - } |
|
75 | - |
|
76 | - |
|
77 | - |
|
78 | - /** |
|
79 | - * @param \EE_Ticket[] $tickets |
|
80 | - * @return array |
|
81 | - * @throws \EE_Error |
|
82 | - */ |
|
83 | - protected function getAllDatetimesForAllTicket($tickets = array()) |
|
84 | - { |
|
85 | - $datetimes = array(); |
|
86 | - foreach ($tickets as $ticket) { |
|
87 | - $datetimes = $this->getTicketDatetimes($ticket, $datetimes); |
|
88 | - } |
|
89 | - return $datetimes; |
|
90 | - } |
|
91 | - |
|
92 | - |
|
93 | - |
|
94 | - /** |
|
95 | - * @param \EE_Ticket $ticket |
|
96 | - * @param \EE_Datetime[] $datetimes |
|
97 | - * @return \EE_Datetime[] |
|
98 | - * @throws \EE_Error |
|
99 | - */ |
|
100 | - protected function getTicketDatetimes(\EE_Ticket $ticket, $datetimes = array()) |
|
101 | - { |
|
102 | - $ticket_datetimes = $ticket->datetimes( |
|
103 | - array( |
|
104 | - 'order_by' => array( |
|
105 | - 'DTT_order' => 'ASC', |
|
106 | - 'DTT_EVT_start' => 'ASC' |
|
107 | - ), |
|
108 | - 'default_where_conditions' => 'none', |
|
109 | - ) |
|
110 | - ); |
|
111 | - foreach ($ticket_datetimes as $ticket_datetime) { |
|
112 | - if ( ! $ticket_datetime instanceof \EE_Datetime) { |
|
113 | - continue; |
|
114 | - } |
|
115 | - $datetimes[ $ticket_datetime->ID() ] = $ticket_datetime; |
|
116 | - } |
|
117 | - return $datetimes; |
|
118 | - } |
|
119 | - |
|
120 | - |
|
121 | - |
|
122 | - /** |
|
123 | - * @param \EE_Ticket $ticket |
|
124 | - * @return string |
|
125 | - * @throws \EE_Error |
|
126 | - */ |
|
127 | - public function getTicketDatetimeClasses( \EE_Ticket $ticket ) { |
|
128 | - if ( ! $this->active) { |
|
129 | - return ''; |
|
130 | - } |
|
131 | - $ticket_datetimes = $this->getTicketDatetimes($ticket); |
|
132 | - $classes = ''; |
|
133 | - foreach ($this->datetimes as $datetime) { |
|
134 | - if ( ! $datetime instanceof \EE_Datetime || ! in_array($datetime, $ticket_datetimes, true)) { |
|
135 | - continue; |
|
136 | - } |
|
137 | - $classes .= ' ee-ticket-datetimes-' . $datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_'); |
|
138 | - } |
|
139 | - return $classes; |
|
140 | - } |
|
141 | - |
|
142 | - |
|
143 | - |
|
144 | - /** |
|
145 | - * @param string $date_format |
|
146 | - * @param string $time_format |
|
147 | - * @return array |
|
148 | - * @throws \EE_Error |
|
149 | - */ |
|
150 | - public function getUniqueDatetimeOptions($date_format = 'Y-m-d', $time_format = 'g:i a') { |
|
151 | - $datetime_options = array(); |
|
152 | - foreach ($this->datetimes as $datetime) { |
|
153 | - if ( ! $datetime instanceof \EE_Datetime) { |
|
154 | - continue; |
|
155 | - } |
|
156 | - $datetime_options[$datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_')] = |
|
157 | - $datetime->date_and_time_range($date_format, $time_format, ' - '); |
|
158 | - } |
|
159 | - return $datetime_options; |
|
160 | - } |
|
161 | - |
|
162 | - |
|
163 | - |
|
164 | - /** |
|
165 | - * @return string |
|
166 | - * @throws \EE_Error |
|
167 | - */ |
|
168 | - public function getDatetimeSelector() { |
|
169 | - if ( ! $this->active) { |
|
170 | - return ''; |
|
171 | - } |
|
172 | - $dropdown_selector = new \EE_Checkbox_Dropdown_Selector_Input( |
|
173 | - $this->unique_dates, |
|
174 | - array( |
|
175 | - 'html_id' => 'datetime-selector-' . $this->event->ID(), |
|
176 | - 'html_name' => 'datetime_selector_' . $this->event->ID(), |
|
177 | - 'html_class' => 'datetime-selector', |
|
178 | - 'select_button_text' => '<span class="dashicons dashicons-calendar-alt"></span> ' |
|
179 | - . esc_html__('Filter by Date', 'event_espresso'), |
|
180 | - 'other_html_attributes' => ' data-tkt_slctr_evt="' . $this->event->ID() . '"', |
|
181 | - ) |
|
182 | - ); |
|
183 | - return \EEH_HTML::div( |
|
184 | - $dropdown_selector->get_html_for_input(), |
|
185 | - '', 'datetime_selector-dv' |
|
186 | - ); |
|
187 | - } |
|
19 | + /** |
|
20 | + * @var \EE_Event $event |
|
21 | + */ |
|
22 | + protected $event; |
|
23 | + |
|
24 | + /** |
|
25 | + * @var \EE_Ticket[] $tickets |
|
26 | + */ |
|
27 | + protected $tickets; |
|
28 | + |
|
29 | + /** |
|
30 | + * @var \EE_Datetime[] $datetimes |
|
31 | + */ |
|
32 | + protected $datetimes; |
|
33 | + |
|
34 | + /** |
|
35 | + * @var \EE_Datetime[] $unique_dates |
|
36 | + */ |
|
37 | + protected $unique_dates; |
|
38 | + |
|
39 | + /** |
|
40 | + * @var \EE_Ticket_Selector_Config $template_settings |
|
41 | + */ |
|
42 | + protected $template_settings; |
|
43 | + |
|
44 | + /** |
|
45 | + * @var boolean $active |
|
46 | + */ |
|
47 | + protected $active = false; |
|
48 | + |
|
49 | + |
|
50 | + |
|
51 | + /** |
|
52 | + * DatetimeSelector constructor. |
|
53 | + * |
|
54 | + * @param \EE_Event $event |
|
55 | + * @param \EE_Ticket[] $tickets |
|
56 | + * @param \EE_Ticket_Selector_Config $template_settings |
|
57 | + * @param string $date_format |
|
58 | + * @param string $time_format |
|
59 | + * @throws \EE_Error |
|
60 | + */ |
|
61 | + public function __construct( |
|
62 | + \EE_Event $event, |
|
63 | + array $tickets, |
|
64 | + \EE_Ticket_Selector_Config $template_settings, |
|
65 | + $date_format = 'Y-m-d', |
|
66 | + $time_format = 'g:i a' |
|
67 | + ) { |
|
68 | + $this->event = $event; |
|
69 | + $this->tickets = $tickets; |
|
70 | + $this->template_settings = $template_settings; |
|
71 | + $this->datetimes = $this->getAllDatetimesForAllTicket($tickets); |
|
72 | + $this->unique_dates = $this->getUniqueDatetimeOptions($date_format, $time_format); |
|
73 | + $this->active = $this->template_settings->showDatetimeSelector($this->unique_dates); |
|
74 | + } |
|
75 | + |
|
76 | + |
|
77 | + |
|
78 | + /** |
|
79 | + * @param \EE_Ticket[] $tickets |
|
80 | + * @return array |
|
81 | + * @throws \EE_Error |
|
82 | + */ |
|
83 | + protected function getAllDatetimesForAllTicket($tickets = array()) |
|
84 | + { |
|
85 | + $datetimes = array(); |
|
86 | + foreach ($tickets as $ticket) { |
|
87 | + $datetimes = $this->getTicketDatetimes($ticket, $datetimes); |
|
88 | + } |
|
89 | + return $datetimes; |
|
90 | + } |
|
91 | + |
|
92 | + |
|
93 | + |
|
94 | + /** |
|
95 | + * @param \EE_Ticket $ticket |
|
96 | + * @param \EE_Datetime[] $datetimes |
|
97 | + * @return \EE_Datetime[] |
|
98 | + * @throws \EE_Error |
|
99 | + */ |
|
100 | + protected function getTicketDatetimes(\EE_Ticket $ticket, $datetimes = array()) |
|
101 | + { |
|
102 | + $ticket_datetimes = $ticket->datetimes( |
|
103 | + array( |
|
104 | + 'order_by' => array( |
|
105 | + 'DTT_order' => 'ASC', |
|
106 | + 'DTT_EVT_start' => 'ASC' |
|
107 | + ), |
|
108 | + 'default_where_conditions' => 'none', |
|
109 | + ) |
|
110 | + ); |
|
111 | + foreach ($ticket_datetimes as $ticket_datetime) { |
|
112 | + if ( ! $ticket_datetime instanceof \EE_Datetime) { |
|
113 | + continue; |
|
114 | + } |
|
115 | + $datetimes[ $ticket_datetime->ID() ] = $ticket_datetime; |
|
116 | + } |
|
117 | + return $datetimes; |
|
118 | + } |
|
119 | + |
|
120 | + |
|
121 | + |
|
122 | + /** |
|
123 | + * @param \EE_Ticket $ticket |
|
124 | + * @return string |
|
125 | + * @throws \EE_Error |
|
126 | + */ |
|
127 | + public function getTicketDatetimeClasses( \EE_Ticket $ticket ) { |
|
128 | + if ( ! $this->active) { |
|
129 | + return ''; |
|
130 | + } |
|
131 | + $ticket_datetimes = $this->getTicketDatetimes($ticket); |
|
132 | + $classes = ''; |
|
133 | + foreach ($this->datetimes as $datetime) { |
|
134 | + if ( ! $datetime instanceof \EE_Datetime || ! in_array($datetime, $ticket_datetimes, true)) { |
|
135 | + continue; |
|
136 | + } |
|
137 | + $classes .= ' ee-ticket-datetimes-' . $datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_'); |
|
138 | + } |
|
139 | + return $classes; |
|
140 | + } |
|
141 | + |
|
142 | + |
|
143 | + |
|
144 | + /** |
|
145 | + * @param string $date_format |
|
146 | + * @param string $time_format |
|
147 | + * @return array |
|
148 | + * @throws \EE_Error |
|
149 | + */ |
|
150 | + public function getUniqueDatetimeOptions($date_format = 'Y-m-d', $time_format = 'g:i a') { |
|
151 | + $datetime_options = array(); |
|
152 | + foreach ($this->datetimes as $datetime) { |
|
153 | + if ( ! $datetime instanceof \EE_Datetime) { |
|
154 | + continue; |
|
155 | + } |
|
156 | + $datetime_options[$datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_')] = |
|
157 | + $datetime->date_and_time_range($date_format, $time_format, ' - '); |
|
158 | + } |
|
159 | + return $datetime_options; |
|
160 | + } |
|
161 | + |
|
162 | + |
|
163 | + |
|
164 | + /** |
|
165 | + * @return string |
|
166 | + * @throws \EE_Error |
|
167 | + */ |
|
168 | + public function getDatetimeSelector() { |
|
169 | + if ( ! $this->active) { |
|
170 | + return ''; |
|
171 | + } |
|
172 | + $dropdown_selector = new \EE_Checkbox_Dropdown_Selector_Input( |
|
173 | + $this->unique_dates, |
|
174 | + array( |
|
175 | + 'html_id' => 'datetime-selector-' . $this->event->ID(), |
|
176 | + 'html_name' => 'datetime_selector_' . $this->event->ID(), |
|
177 | + 'html_class' => 'datetime-selector', |
|
178 | + 'select_button_text' => '<span class="dashicons dashicons-calendar-alt"></span> ' |
|
179 | + . esc_html__('Filter by Date', 'event_espresso'), |
|
180 | + 'other_html_attributes' => ' data-tkt_slctr_evt="' . $this->event->ID() . '"', |
|
181 | + ) |
|
182 | + ); |
|
183 | + return \EEH_HTML::div( |
|
184 | + $dropdown_selector->get_html_for_input(), |
|
185 | + '', 'datetime_selector-dv' |
|
186 | + ); |
|
187 | + } |
|
188 | 188 | |
189 | 189 | |
190 | 190 |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | if ( ! $ticket_datetime instanceof \EE_Datetime) { |
113 | 113 | continue; |
114 | 114 | } |
115 | - $datetimes[ $ticket_datetime->ID() ] = $ticket_datetime; |
|
115 | + $datetimes[$ticket_datetime->ID()] = $ticket_datetime; |
|
116 | 116 | } |
117 | 117 | return $datetimes; |
118 | 118 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * @return string |
125 | 125 | * @throws \EE_Error |
126 | 126 | */ |
127 | - public function getTicketDatetimeClasses( \EE_Ticket $ticket ) { |
|
127 | + public function getTicketDatetimeClasses(\EE_Ticket $ticket) { |
|
128 | 128 | if ( ! $this->active) { |
129 | 129 | return ''; |
130 | 130 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | if ( ! $datetime instanceof \EE_Datetime || ! in_array($datetime, $ticket_datetimes, true)) { |
135 | 135 | continue; |
136 | 136 | } |
137 | - $classes .= ' ee-ticket-datetimes-' . $datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_'); |
|
137 | + $classes .= ' ee-ticket-datetimes-'.$datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_'); |
|
138 | 138 | } |
139 | 139 | return $classes; |
140 | 140 | } |
@@ -172,12 +172,12 @@ discard block |
||
172 | 172 | $dropdown_selector = new \EE_Checkbox_Dropdown_Selector_Input( |
173 | 173 | $this->unique_dates, |
174 | 174 | array( |
175 | - 'html_id' => 'datetime-selector-' . $this->event->ID(), |
|
176 | - 'html_name' => 'datetime_selector_' . $this->event->ID(), |
|
175 | + 'html_id' => 'datetime-selector-'.$this->event->ID(), |
|
176 | + 'html_name' => 'datetime_selector_'.$this->event->ID(), |
|
177 | 177 | 'html_class' => 'datetime-selector', |
178 | 178 | 'select_button_text' => '<span class="dashicons dashicons-calendar-alt"></span> ' |
179 | 179 | . esc_html__('Filter by Date', 'event_espresso'), |
180 | - 'other_html_attributes' => ' data-tkt_slctr_evt="' . $this->event->ID() . '"', |
|
180 | + 'other_html_attributes' => ' data-tkt_slctr_evt="'.$this->event->ID().'"', |
|
181 | 181 | ) |
182 | 182 | ); |
183 | 183 | return \EEH_HTML::div( |
@@ -16,196 +16,196 @@ |
||
16 | 16 | abstract class TicketSelectorRow |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * @var \EE_Ticket $ticket |
|
21 | - */ |
|
22 | - protected $ticket; |
|
23 | - |
|
24 | - /** |
|
25 | - * @var int $max_atndz |
|
26 | - */ |
|
27 | - protected $max_atndz; |
|
28 | - |
|
29 | - /** |
|
30 | - * @var string $date_format |
|
31 | - */ |
|
32 | - protected $date_format; |
|
33 | - |
|
34 | - /** |
|
35 | - * @var int $EVT_ID |
|
36 | - */ |
|
37 | - protected $EVT_ID; |
|
38 | - |
|
39 | - /** |
|
40 | - * @var string $ticket_status_display |
|
41 | - */ |
|
42 | - protected $ticket_status_display; |
|
43 | - |
|
44 | - |
|
45 | - |
|
46 | - /** |
|
47 | - * TicketDetails constructor. |
|
48 | - * |
|
49 | - * @param \EE_Ticket $ticket |
|
50 | - * @param int $max_atndz |
|
51 | - * @param string $date_format |
|
52 | - */ |
|
53 | - public function __construct( |
|
54 | - \EE_Ticket $ticket, |
|
55 | - $max_atndz, |
|
56 | - $date_format |
|
57 | - ) { |
|
58 | - $this->ticket = $ticket; |
|
59 | - $this->max_atndz = $max_atndz; |
|
60 | - $this->date_format = $date_format; |
|
61 | - $this->EVT_ID = $this->ticket->get_event_ID(); |
|
62 | - } |
|
63 | - |
|
64 | - |
|
65 | - |
|
66 | - /** |
|
67 | - * @return string |
|
68 | - */ |
|
69 | - public function getTicketStatusDisplay() |
|
70 | - { |
|
71 | - return $this->ticket_status_display; |
|
72 | - } |
|
73 | - |
|
74 | - |
|
75 | - |
|
76 | - /** |
|
77 | - * setTicketStatusDisplay |
|
78 | - * |
|
79 | - * @param string $tkt_status |
|
80 | - * @param string $ticket_status |
|
81 | - * @param int $remaining |
|
82 | - * @throws \EE_Error |
|
83 | - */ |
|
84 | - protected function setTicketStatusDisplay($tkt_status, $ticket_status, $remaining) { |
|
85 | - $this->ticket_status_display = ''; |
|
86 | - // now depending on the ticket and other circumstances... |
|
87 | - if ($this->max_atndz === 0) { |
|
88 | - // registration is CLOSED because admin set max attendees to ZERO |
|
89 | - $this->ticket_status_display = $this->registrationClosed(); |
|
90 | - } else if ($tkt_status === \EE_Ticket::sold_out || $remaining === 0) { |
|
91 | - // SOLD OUT - no tickets remaining |
|
92 | - $this->ticket_status_display = $this->ticketsSoldOut(); |
|
93 | - } else if ($tkt_status === \EE_Ticket::expired || $tkt_status === \EE_Ticket::archived) { |
|
94 | - // expired or archived ticket |
|
95 | - $this->ticket_status_display = $ticket_status; |
|
96 | - } else if ($tkt_status === \EE_Ticket::pending) { |
|
97 | - // ticket not on sale yet |
|
98 | - $this->ticket_status_display = $this->ticketsSalesPending(); |
|
99 | - } else if ($this->ticket->min() > $remaining) { |
|
100 | - // min qty purchasable is less than tickets available |
|
101 | - $this->ticket_status_display = $this->notEnoughTicketsAvailable(); |
|
102 | - } |
|
103 | - } |
|
104 | - |
|
105 | - |
|
106 | - |
|
107 | - /** |
|
108 | - * registrationClosed |
|
109 | - */ |
|
110 | - protected function registrationClosed() |
|
111 | - { |
|
112 | - return \EEH_HTML::span( |
|
113 | - apply_filters( |
|
114 | - 'FHEE__ticket_selector_chart_template__ticket_closed_msg', |
|
115 | - __('Closed', 'event_espresso') |
|
116 | - ), |
|
117 | - '', 'sold-out' |
|
118 | - ); |
|
119 | - } |
|
120 | - |
|
121 | - |
|
122 | - |
|
123 | - /** |
|
124 | - * ticketsSoldOut |
|
125 | - */ |
|
126 | - protected function ticketsSoldOut() |
|
127 | - { |
|
128 | - return \EEH_HTML::span( |
|
129 | - apply_filters( |
|
130 | - 'FHEE__ticket_selector_chart_template__ticket_sold_out_msg', |
|
131 | - __('Sold Out', 'event_espresso') |
|
132 | - ), |
|
133 | - '', 'sold-out' |
|
134 | - ); |
|
135 | - } |
|
136 | - |
|
137 | - |
|
138 | - |
|
139 | - /** |
|
140 | - * ticketsSalesPending |
|
141 | - * |
|
142 | - * @throws \EE_Error |
|
143 | - */ |
|
144 | - protected function ticketsSalesPending() |
|
145 | - { |
|
146 | - return \EEH_HTML::span( |
|
147 | - \EEH_HTML::span( |
|
148 | - apply_filters( |
|
149 | - 'FHEE__ticket_selector_chart_template__ticket_goes_on_sale_msg', |
|
150 | - __('Goes On Sale', 'event_espresso') |
|
151 | - ), |
|
152 | - '', 'ticket-pending' |
|
153 | - ) |
|
154 | - . \EEH_HTML::br() |
|
155 | - . \EEH_HTML::span( |
|
156 | - $this->ticket->get_i18n_datetime( |
|
157 | - 'TKT_start_date', |
|
158 | - apply_filters( |
|
159 | - 'FHEE__EED_Ticket_Selector__display_goes_on_sale__date_format', |
|
160 | - $this->date_format |
|
161 | - ) |
|
162 | - ), |
|
163 | - '', 'small-text' |
|
164 | - ), |
|
165 | - '', 'ticket-pending-pg' |
|
166 | - ); |
|
167 | - } |
|
168 | - |
|
169 | - |
|
170 | - |
|
171 | - /** |
|
172 | - * notEnoughTicketsAvailable |
|
173 | - */ |
|
174 | - protected function notEnoughTicketsAvailable() |
|
175 | - { |
|
176 | - return \EEH_HTML::div( |
|
177 | - \EEH_HTML::span( |
|
178 | - apply_filters( |
|
179 | - 'FHEE__ticket_selector_chart_template__ticket_not_available_msg', |
|
180 | - __('Not Available', 'event_espresso') |
|
181 | - ), |
|
182 | - '', 'archived-ticket small-text' |
|
183 | - ) |
|
184 | - . \EEH_HTML::br(), |
|
185 | - '', 'archived-ticket-pg' |
|
186 | - ); |
|
187 | - } |
|
188 | - |
|
189 | - |
|
190 | - |
|
191 | - /** |
|
192 | - * getHiddenInputs |
|
193 | - * |
|
194 | - * @param string $anchor_id |
|
195 | - * @param int $row |
|
196 | - * @param int $max_atndz |
|
197 | - * @return string |
|
198 | - */ |
|
199 | - protected function getHiddenInputs($anchor_id, $row, $max_atndz) |
|
200 | - { |
|
201 | - $html = '<input type="hidden" name="noheader" value="true"/>'; |
|
202 | - $html .= '<input type="hidden" name="tkt-slctr-return-url-' . $this->EVT_ID . '"'; |
|
203 | - $html .= ' value="' . \EEH_URL::current_url() . $anchor_id . '"/>'; |
|
204 | - $html .= '<input type="hidden" name="tkt-slctr-rows-' . $this->EVT_ID . '" value="' . $row - 1 . '"/>'; |
|
205 | - $html .= '<input type="hidden" name="tkt-slctr-max-atndz-' . $this->EVT_ID . '" value="' . $max_atndz . '"/>'; |
|
206 | - $html .= '<input type="hidden" name="tkt-slctr-event-id" value="' . $this->EVT_ID . '"/>'; |
|
207 | - return $html; |
|
208 | - } |
|
19 | + /** |
|
20 | + * @var \EE_Ticket $ticket |
|
21 | + */ |
|
22 | + protected $ticket; |
|
23 | + |
|
24 | + /** |
|
25 | + * @var int $max_atndz |
|
26 | + */ |
|
27 | + protected $max_atndz; |
|
28 | + |
|
29 | + /** |
|
30 | + * @var string $date_format |
|
31 | + */ |
|
32 | + protected $date_format; |
|
33 | + |
|
34 | + /** |
|
35 | + * @var int $EVT_ID |
|
36 | + */ |
|
37 | + protected $EVT_ID; |
|
38 | + |
|
39 | + /** |
|
40 | + * @var string $ticket_status_display |
|
41 | + */ |
|
42 | + protected $ticket_status_display; |
|
43 | + |
|
44 | + |
|
45 | + |
|
46 | + /** |
|
47 | + * TicketDetails constructor. |
|
48 | + * |
|
49 | + * @param \EE_Ticket $ticket |
|
50 | + * @param int $max_atndz |
|
51 | + * @param string $date_format |
|
52 | + */ |
|
53 | + public function __construct( |
|
54 | + \EE_Ticket $ticket, |
|
55 | + $max_atndz, |
|
56 | + $date_format |
|
57 | + ) { |
|
58 | + $this->ticket = $ticket; |
|
59 | + $this->max_atndz = $max_atndz; |
|
60 | + $this->date_format = $date_format; |
|
61 | + $this->EVT_ID = $this->ticket->get_event_ID(); |
|
62 | + } |
|
63 | + |
|
64 | + |
|
65 | + |
|
66 | + /** |
|
67 | + * @return string |
|
68 | + */ |
|
69 | + public function getTicketStatusDisplay() |
|
70 | + { |
|
71 | + return $this->ticket_status_display; |
|
72 | + } |
|
73 | + |
|
74 | + |
|
75 | + |
|
76 | + /** |
|
77 | + * setTicketStatusDisplay |
|
78 | + * |
|
79 | + * @param string $tkt_status |
|
80 | + * @param string $ticket_status |
|
81 | + * @param int $remaining |
|
82 | + * @throws \EE_Error |
|
83 | + */ |
|
84 | + protected function setTicketStatusDisplay($tkt_status, $ticket_status, $remaining) { |
|
85 | + $this->ticket_status_display = ''; |
|
86 | + // now depending on the ticket and other circumstances... |
|
87 | + if ($this->max_atndz === 0) { |
|
88 | + // registration is CLOSED because admin set max attendees to ZERO |
|
89 | + $this->ticket_status_display = $this->registrationClosed(); |
|
90 | + } else if ($tkt_status === \EE_Ticket::sold_out || $remaining === 0) { |
|
91 | + // SOLD OUT - no tickets remaining |
|
92 | + $this->ticket_status_display = $this->ticketsSoldOut(); |
|
93 | + } else if ($tkt_status === \EE_Ticket::expired || $tkt_status === \EE_Ticket::archived) { |
|
94 | + // expired or archived ticket |
|
95 | + $this->ticket_status_display = $ticket_status; |
|
96 | + } else if ($tkt_status === \EE_Ticket::pending) { |
|
97 | + // ticket not on sale yet |
|
98 | + $this->ticket_status_display = $this->ticketsSalesPending(); |
|
99 | + } else if ($this->ticket->min() > $remaining) { |
|
100 | + // min qty purchasable is less than tickets available |
|
101 | + $this->ticket_status_display = $this->notEnoughTicketsAvailable(); |
|
102 | + } |
|
103 | + } |
|
104 | + |
|
105 | + |
|
106 | + |
|
107 | + /** |
|
108 | + * registrationClosed |
|
109 | + */ |
|
110 | + protected function registrationClosed() |
|
111 | + { |
|
112 | + return \EEH_HTML::span( |
|
113 | + apply_filters( |
|
114 | + 'FHEE__ticket_selector_chart_template__ticket_closed_msg', |
|
115 | + __('Closed', 'event_espresso') |
|
116 | + ), |
|
117 | + '', 'sold-out' |
|
118 | + ); |
|
119 | + } |
|
120 | + |
|
121 | + |
|
122 | + |
|
123 | + /** |
|
124 | + * ticketsSoldOut |
|
125 | + */ |
|
126 | + protected function ticketsSoldOut() |
|
127 | + { |
|
128 | + return \EEH_HTML::span( |
|
129 | + apply_filters( |
|
130 | + 'FHEE__ticket_selector_chart_template__ticket_sold_out_msg', |
|
131 | + __('Sold Out', 'event_espresso') |
|
132 | + ), |
|
133 | + '', 'sold-out' |
|
134 | + ); |
|
135 | + } |
|
136 | + |
|
137 | + |
|
138 | + |
|
139 | + /** |
|
140 | + * ticketsSalesPending |
|
141 | + * |
|
142 | + * @throws \EE_Error |
|
143 | + */ |
|
144 | + protected function ticketsSalesPending() |
|
145 | + { |
|
146 | + return \EEH_HTML::span( |
|
147 | + \EEH_HTML::span( |
|
148 | + apply_filters( |
|
149 | + 'FHEE__ticket_selector_chart_template__ticket_goes_on_sale_msg', |
|
150 | + __('Goes On Sale', 'event_espresso') |
|
151 | + ), |
|
152 | + '', 'ticket-pending' |
|
153 | + ) |
|
154 | + . \EEH_HTML::br() |
|
155 | + . \EEH_HTML::span( |
|
156 | + $this->ticket->get_i18n_datetime( |
|
157 | + 'TKT_start_date', |
|
158 | + apply_filters( |
|
159 | + 'FHEE__EED_Ticket_Selector__display_goes_on_sale__date_format', |
|
160 | + $this->date_format |
|
161 | + ) |
|
162 | + ), |
|
163 | + '', 'small-text' |
|
164 | + ), |
|
165 | + '', 'ticket-pending-pg' |
|
166 | + ); |
|
167 | + } |
|
168 | + |
|
169 | + |
|
170 | + |
|
171 | + /** |
|
172 | + * notEnoughTicketsAvailable |
|
173 | + */ |
|
174 | + protected function notEnoughTicketsAvailable() |
|
175 | + { |
|
176 | + return \EEH_HTML::div( |
|
177 | + \EEH_HTML::span( |
|
178 | + apply_filters( |
|
179 | + 'FHEE__ticket_selector_chart_template__ticket_not_available_msg', |
|
180 | + __('Not Available', 'event_espresso') |
|
181 | + ), |
|
182 | + '', 'archived-ticket small-text' |
|
183 | + ) |
|
184 | + . \EEH_HTML::br(), |
|
185 | + '', 'archived-ticket-pg' |
|
186 | + ); |
|
187 | + } |
|
188 | + |
|
189 | + |
|
190 | + |
|
191 | + /** |
|
192 | + * getHiddenInputs |
|
193 | + * |
|
194 | + * @param string $anchor_id |
|
195 | + * @param int $row |
|
196 | + * @param int $max_atndz |
|
197 | + * @return string |
|
198 | + */ |
|
199 | + protected function getHiddenInputs($anchor_id, $row, $max_atndz) |
|
200 | + { |
|
201 | + $html = '<input type="hidden" name="noheader" value="true"/>'; |
|
202 | + $html .= '<input type="hidden" name="tkt-slctr-return-url-' . $this->EVT_ID . '"'; |
|
203 | + $html .= ' value="' . \EEH_URL::current_url() . $anchor_id . '"/>'; |
|
204 | + $html .= '<input type="hidden" name="tkt-slctr-rows-' . $this->EVT_ID . '" value="' . $row - 1 . '"/>'; |
|
205 | + $html .= '<input type="hidden" name="tkt-slctr-max-atndz-' . $this->EVT_ID . '" value="' . $max_atndz . '"/>'; |
|
206 | + $html .= '<input type="hidden" name="tkt-slctr-event-id" value="' . $this->EVT_ID . '"/>'; |
|
207 | + return $html; |
|
208 | + } |
|
209 | 209 | |
210 | 210 | |
211 | 211 |
@@ -199,11 +199,11 @@ |
||
199 | 199 | protected function getHiddenInputs($anchor_id, $row, $max_atndz) |
200 | 200 | { |
201 | 201 | $html = '<input type="hidden" name="noheader" value="true"/>'; |
202 | - $html .= '<input type="hidden" name="tkt-slctr-return-url-' . $this->EVT_ID . '"'; |
|
203 | - $html .= ' value="' . \EEH_URL::current_url() . $anchor_id . '"/>'; |
|
204 | - $html .= '<input type="hidden" name="tkt-slctr-rows-' . $this->EVT_ID . '" value="' . $row - 1 . '"/>'; |
|
205 | - $html .= '<input type="hidden" name="tkt-slctr-max-atndz-' . $this->EVT_ID . '" value="' . $max_atndz . '"/>'; |
|
206 | - $html .= '<input type="hidden" name="tkt-slctr-event-id" value="' . $this->EVT_ID . '"/>'; |
|
202 | + $html .= '<input type="hidden" name="tkt-slctr-return-url-'.$this->EVT_ID.'"'; |
|
203 | + $html .= ' value="'.\EEH_URL::current_url().$anchor_id.'"/>'; |
|
204 | + $html .= '<input type="hidden" name="tkt-slctr-rows-'.$this->EVT_ID.'" value="'.$row - 1.'"/>'; |
|
205 | + $html .= '<input type="hidden" name="tkt-slctr-max-atndz-'.$this->EVT_ID.'" value="'.$max_atndz.'"/>'; |
|
206 | + $html .= '<input type="hidden" name="tkt-slctr-event-id" value="'.$this->EVT_ID.'"/>'; |
|
207 | 207 | return $html; |
208 | 208 | } |
209 | 209 |
@@ -28,12 +28,12 @@ discard block |
||
28 | 28 | <tr> |
29 | 29 | <th scope="col" class="ee-ticket-selector-ticket-details-th"> |
30 | 30 | <?php |
31 | - echo apply_filters( |
|
32 | - 'FHEE__ticket_selector_chart_template__table_header_available_tickets', |
|
33 | - esc_html(''), |
|
34 | - $EVT_ID |
|
35 | - ); |
|
36 | - ?> |
|
31 | + echo apply_filters( |
|
32 | + 'FHEE__ticket_selector_chart_template__table_header_available_tickets', |
|
33 | + esc_html(''), |
|
34 | + $EVT_ID |
|
35 | + ); |
|
36 | + ?> |
|
37 | 37 | </th> |
38 | 38 | <?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE ) ) { ?> |
39 | 39 | <th scope="col" class="ee-ticket-selector-ticket-price-th cntr"> |
@@ -47,28 +47,28 @@ discard block |
||
47 | 47 | * @param int $EVT_ID The Event ID |
48 | 48 | */ |
49 | 49 | echo apply_filters( |
50 | - 'FHEE__ticket_selector_chart_template__table_header_price', |
|
51 | - esc_html__( 'Price', 'event_espresso' ), |
|
52 | - $EVT_ID |
|
53 | - ); |
|
50 | + 'FHEE__ticket_selector_chart_template__table_header_price', |
|
51 | + esc_html__( 'Price', 'event_espresso' ), |
|
52 | + $EVT_ID |
|
53 | + ); |
|
54 | 54 | ?> |
55 | 55 | </th> |
56 | 56 | <?php } ?> |
57 | 57 | <th scope="col" class="ee-ticket-selector-ticket-qty-th cntr"> |
58 | 58 | <?php |
59 | 59 | /** |
60 | - * Filters the text printed for the header of the quantity column in the ticket selector table |
|
61 | - * |
|
62 | - * @since 4.7.2 |
|
63 | - * |
|
64 | - * @param string 'Qty' The translatable text to display in the table header for the Quantity of tickets |
|
65 | - * @param int $EVT_ID The Event ID |
|
66 | - */ |
|
60 | + * Filters the text printed for the header of the quantity column in the ticket selector table |
|
61 | + * |
|
62 | + * @since 4.7.2 |
|
63 | + * |
|
64 | + * @param string 'Qty' The translatable text to display in the table header for the Quantity of tickets |
|
65 | + * @param int $EVT_ID The Event ID |
|
66 | + */ |
|
67 | 67 | echo apply_filters( |
68 | - 'FHEE__ticket_selector_chart_template__table_header_qty', |
|
69 | - esc_html__( 'Qty', 'event_espresso' ), |
|
70 | - $EVT_ID |
|
71 | - ); |
|
68 | + 'FHEE__ticket_selector_chart_template__table_header_qty', |
|
69 | + esc_html__( 'Qty', 'event_espresso' ), |
|
70 | + $EVT_ID |
|
71 | + ); |
|
72 | 72 | ?> |
73 | 73 | </th> |
74 | 74 | </tr> |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | if ( $max_atndz > 0 ) { |
99 | 99 | echo apply_filters( |
100 | 100 | 'FHEE__ticket_selector_chart_template__maximum_tickets_purchased_footnote', |
101 | - esc_html('') |
|
101 | + esc_html('') |
|
102 | 102 | ); |
103 | 103 | } |
104 | 104 | if ( ! apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false ) ) { |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | ?> |
21 | 21 | <div id="tkt-slctr-tbl-wrap-dv-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl-wrap-dv"> |
22 | 22 | |
23 | - <?php do_action( 'AHEE__ticket_selector_chart__template__before_ticket_selector', $event ); ?> |
|
23 | + <?php do_action('AHEE__ticket_selector_chart__template__before_ticket_selector', $event); ?> |
|
24 | 24 | <?php echo $datetime_selector; ?> |
25 | 25 | |
26 | 26 | <table id="tkt-slctr-tbl-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl"> |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | ); |
36 | 36 | ?> |
37 | 37 | </th> |
38 | - <?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE ) ) { ?> |
|
38 | + <?php if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?> |
|
39 | 39 | <th scope="col" class="ee-ticket-selector-ticket-price-th cntr"> |
40 | 40 | <?php |
41 | 41 | /** |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | echo apply_filters( |
50 | 50 | 'FHEE__ticket_selector_chart_template__table_header_price', |
51 | - esc_html__( 'Price', 'event_espresso' ), |
|
51 | + esc_html__('Price', 'event_espresso'), |
|
52 | 52 | $EVT_ID |
53 | 53 | ); |
54 | 54 | ?> |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | echo apply_filters( |
68 | 68 | 'FHEE__ticket_selector_chart_template__table_header_qty', |
69 | - esc_html__( 'Qty', 'event_espresso' ), |
|
69 | + esc_html__('Qty', 'event_espresso'), |
|
70 | 70 | $EVT_ID |
71 | 71 | ); |
72 | 72 | ?> |
@@ -74,34 +74,34 @@ discard block |
||
74 | 74 | </tr> |
75 | 75 | </thead> |
76 | 76 | <tbody> |
77 | - <?php echo $ticket_row_html;?> |
|
77 | + <?php echo $ticket_row_html; ?> |
|
78 | 78 | </tbody> |
79 | 79 | </table> |
80 | 80 | <?php |
81 | - if ( $taxable_tickets && apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', true ) ) { |
|
82 | - if ( $prices_displayed_including_taxes ) { |
|
83 | - $ticket_price_includes_taxes = esc_html__( '* price includes taxes', 'event_espresso' ); |
|
81 | + if ($taxable_tickets && apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) { |
|
82 | + if ($prices_displayed_including_taxes) { |
|
83 | + $ticket_price_includes_taxes = esc_html__('* price includes taxes', 'event_espresso'); |
|
84 | 84 | } else { |
85 | - $ticket_price_includes_taxes = esc_html__( '* price does not include taxes', 'event_espresso' ); |
|
85 | + $ticket_price_includes_taxes = esc_html__('* price does not include taxes', 'event_espresso'); |
|
86 | 86 | } |
87 | - echo '<p class="small-text lt-grey-text" style="text-align:right; margin: -1em 0 1em;">' . $ticket_price_includes_taxes . '</p>'; |
|
87 | + echo '<p class="small-text lt-grey-text" style="text-align:right; margin: -1em 0 1em;">'.$ticket_price_includes_taxes.'</p>'; |
|
88 | 88 | } |
89 | 89 | ?> |
90 | 90 | |
91 | 91 | <input type="hidden" name="noheader" value="true" /> |
92 | - <input type="hidden" name="tkt-slctr-return-url-<?php echo $EVT_ID ?>" value="<?php echo EEH_URL::current_url() . $anchor_id; ?>" /> |
|
92 | + <input type="hidden" name="tkt-slctr-return-url-<?php echo $EVT_ID ?>" value="<?php echo EEH_URL::current_url().$anchor_id; ?>" /> |
|
93 | 93 | <input type="hidden" name="tkt-slctr-rows-<?php echo $EVT_ID; ?>" value="<?php echo $row - 1; ?>" /> |
94 | 94 | <input type="hidden" name="tkt-slctr-max-atndz-<?php echo $EVT_ID; ?>" value="<?php echo $max_atndz; ?>" /> |
95 | 95 | <input type="hidden" name="tkt-slctr-event-id" value="<?php echo $EVT_ID; ?>" /> |
96 | 96 | |
97 | 97 | <?php |
98 | -if ( $max_atndz > 0 ) { |
|
98 | +if ($max_atndz > 0) { |
|
99 | 99 | echo apply_filters( |
100 | 100 | 'FHEE__ticket_selector_chart_template__maximum_tickets_purchased_footnote', |
101 | 101 | esc_html('') |
102 | 102 | ); |
103 | 103 | } |
104 | -if ( ! apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false ) ) { |
|
105 | - add_filter( 'FHEE__EE_Ticket_Selector__no_ticket_selector_submit', '__return_true' ); |
|
104 | +if ( ! apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false)) { |
|
105 | + add_filter('FHEE__EE_Ticket_Selector__no_ticket_selector_submit', '__return_true'); |
|
106 | 106 | } |
107 | -do_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event ); |
|
108 | 107 | \ No newline at end of file |
108 | +do_action('AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event); |
|
109 | 109 | \ No newline at end of file |
@@ -22,38 +22,38 @@ discard block |
||
22 | 22 | <p><?php echo $ticket->description(); ?></p> |
23 | 23 | |
24 | 24 | <?php |
25 | - do_action( |
|
26 | - 'AHEE__ticket_selector_chart_template__ticket_details__after_description', |
|
27 | - $ticket, |
|
28 | - $ticket_price, |
|
29 | - $display_ticket_price |
|
30 | - ); |
|
31 | - ?> |
|
25 | + do_action( |
|
26 | + 'AHEE__ticket_selector_chart_template__ticket_details__after_description', |
|
27 | + $ticket, |
|
28 | + $ticket_price, |
|
29 | + $display_ticket_price |
|
30 | + ); |
|
31 | + ?> |
|
32 | 32 | |
33 | 33 | <section class="tckt-slctr-tkt-sale-dates-sctn"> |
34 | 34 | <h5><?php echo apply_filters( |
35 | - 'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading', |
|
36 | - esc_html__( 'Sale Dates', 'event_espresso' ) |
|
37 | - ); ?> |
|
35 | + 'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading', |
|
36 | + esc_html__( 'Sale Dates', 'event_espresso' ) |
|
37 | + ); ?> |
|
38 | 38 | </h5> |
39 | 39 | <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( |
40 | - 'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message', |
|
41 | - esc_html__( 'The dates when this option is available for purchase.', 'event_espresso' ) |
|
42 | - ); ?></span> |
|
40 | + 'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message', |
|
41 | + esc_html__( 'The dates when this option is available for purchase.', 'event_espresso' ) |
|
42 | + ); ?></span> |
|
43 | 43 | <br/> |
44 | 44 | <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( |
45 | - 'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale', |
|
46 | - esc_html__( 'Goes On Sale:', 'event_espresso' ) |
|
47 | - ); ?></span> |
|
45 | + 'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale', |
|
46 | + esc_html__( 'Goes On Sale:', 'event_espresso' ) |
|
47 | + ); ?></span> |
|
48 | 48 | <span class="dashicons dashicons-calendar"></span> |
49 | 49 | <?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format) . ' '; ?> |
50 | 50 | <span class="dashicons dashicons-clock"></span> |
51 | 51 | <?php echo $ticket->get_i18n_datetime('TKT_start_date',$time_format); ?> |
52 | 52 | <br/> |
53 | 53 | <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( |
54 | - 'FHEE__ticket_selector_chart_template__ticket_details_sales_end', |
|
55 | - esc_html__( 'Sales End:', 'event_espresso' ) |
|
56 | - ); ?></span> |
|
54 | + 'FHEE__ticket_selector_chart_template__ticket_details_sales_end', |
|
55 | + esc_html__( 'Sales End:', 'event_espresso' ) |
|
56 | + ); ?></span> |
|
57 | 57 | <span class="dashicons dashicons-calendar"></span> |
58 | 58 | <?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format) . ' '; ?> |
59 | 59 | <span class="dashicons dashicons-clock"></span> |
@@ -67,34 +67,34 @@ discard block |
||
67 | 67 | <?php if ( $ticket->min() && $ticket->max() ) { ?> |
68 | 68 | <section class="tckt-slctr-tkt-quantities-sctn"> |
69 | 69 | <h5><?php echo apply_filters( |
70 | - 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading', |
|
71 | - esc_html__( 'Purchasable Quantities', 'event_espresso' ) |
|
72 | - ); ?></h5> |
|
70 | + 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading', |
|
71 | + esc_html__( 'Purchasable Quantities', 'event_espresso' ) |
|
72 | + ); ?></h5> |
|
73 | 73 | <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( |
74 | - 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message', |
|
75 | - esc_html__( |
|
76 | - 'The number of tickets that can be purchased per transaction (if available).', |
|
77 | - 'event_espresso' |
|
78 | - ) |
|
79 | - ); ?></span><br/> |
|
74 | + 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message', |
|
75 | + esc_html__( |
|
76 | + 'The number of tickets that can be purchased per transaction (if available).', |
|
77 | + 'event_espresso' |
|
78 | + ) |
|
79 | + ); ?></span><br/> |
|
80 | 80 | <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( |
81 | - 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty', |
|
82 | - esc_html__( 'Minimum Qty:', 'event_espresso' ) |
|
83 | - ); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?> |
|
81 | + 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty', |
|
82 | + esc_html__( 'Minimum Qty:', 'event_espresso' ) |
|
83 | + ); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?> |
|
84 | 84 | <?php if ( $ticket->min() > $remaining ) { ?> <span |
85 | 85 | class="important-notice small-text"><?php echo apply_filters( |
86 | - 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message', |
|
87 | - esc_html__( |
|
88 | - 'The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining', |
|
89 | - 'event_espresso' |
|
90 | - ) |
|
91 | - ); ?></span><?php } ?><br/> |
|
86 | + 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message', |
|
87 | + esc_html__( |
|
88 | + 'The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining', |
|
89 | + 'event_espresso' |
|
90 | + ) |
|
91 | + ); ?></span><?php } ?><br/> |
|
92 | 92 | <?php //$max = min( $max, $max_atndz );?> |
93 | 93 | <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( |
94 | - 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty', |
|
95 | - esc_html__( 'Maximum Qty:', 'event_espresso' ) |
|
96 | - ); ?></span><?php echo $ticket->max() === EE_INF ? esc_html__( 'no limit', 'event_espresso' ) |
|
97 | - : max( $ticket->max(), 1 ); ?><br/> |
|
94 | + 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty', |
|
95 | + esc_html__( 'Maximum Qty:', 'event_espresso' ) |
|
96 | + ); ?></span><?php echo $ticket->max() === EE_INF ? esc_html__( 'no limit', 'event_espresso' ) |
|
97 | + : max( $ticket->max(), 1 ); ?><br/> |
|
98 | 98 | </section> |
99 | 99 | <br/> |
100 | 100 | <?php } ?> |
@@ -102,43 +102,43 @@ discard block |
||
102 | 102 | <?php if ( ( ! defined( 'EE_DECAF' ) || EE_DECAF !== true ) && $ticket->uses() !== EE_INF ) { ?> |
103 | 103 | <section class="tckt-slctr-tkt-uses-sctn"> |
104 | 104 | <h5><?php echo apply_filters( |
105 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading', |
|
106 | - esc_html__( 'Event Date Ticket Uses', 'event_espresso' ) |
|
107 | - ); ?></h5> |
|
105 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading', |
|
106 | + esc_html__( 'Event Date Ticket Uses', 'event_espresso' ) |
|
107 | + ); ?></h5> |
|
108 | 108 | <span class="drk-grey-text small-text no-bold"> - <?php |
109 | - echo apply_filters( |
|
110 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_message', |
|
111 | - sprintf( |
|
112 | - esc_html__( |
|
113 | - 'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s', |
|
114 | - 'event_espresso' |
|
115 | - ), |
|
116 | - '<br/>', |
|
117 | - '<strong>', |
|
118 | - '</strong>' |
|
119 | - ) |
|
120 | - ); |
|
121 | - ?></span><br/> |
|
109 | + echo apply_filters( |
|
110 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_message', |
|
111 | + sprintf( |
|
112 | + esc_html__( |
|
113 | + 'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s', |
|
114 | + 'event_espresso' |
|
115 | + ), |
|
116 | + '<br/>', |
|
117 | + '<strong>', |
|
118 | + '</strong>' |
|
119 | + ) |
|
120 | + ); |
|
121 | + ?></span><br/> |
|
122 | 122 | <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( |
123 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes', |
|
124 | - esc_html__( '# Datetimes:', 'event_espresso' ) |
|
125 | - ); ?></span><?php echo $ticket->uses(); ?><br/> |
|
123 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes', |
|
124 | + esc_html__( '# Datetimes:', 'event_espresso' ) |
|
125 | + ); ?></span><?php echo $ticket->uses(); ?><br/> |
|
126 | 126 | </section> |
127 | 127 | <?php } ?> |
128 | 128 | |
129 | 129 | <?php |
130 | - $datetimes = $ticket->datetimes_ordered( $event_is_expired, false ); |
|
131 | - $chart_column_width = $show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width'; |
|
132 | - if ( ! empty( $datetimes ) ) { ?> |
|
130 | + $datetimes = $ticket->datetimes_ordered( $event_is_expired, false ); |
|
131 | + $chart_column_width = $show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width'; |
|
132 | + if ( ! empty( $datetimes ) ) { ?> |
|
133 | 133 | <section class="tckt-slctr-tkt-datetimes-sctn"> |
134 | 134 | <h5><?php echo apply_filters( |
135 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading', |
|
136 | - esc_html__( 'Access', 'event_espresso' ) |
|
137 | - ); ?></h5> |
|
135 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading', |
|
136 | + esc_html__( 'Access', 'event_espresso' ) |
|
137 | + ); ?></h5> |
|
138 | 138 | <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( |
139 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_message', |
|
140 | - esc_html__( 'This option allows access to the following dates and times.', 'event_espresso' ) |
|
141 | - ); ?></span> |
|
139 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_message', |
|
140 | + esc_html__( 'This option allows access to the following dates and times.', 'event_espresso' ) |
|
141 | + ); ?></span> |
|
142 | 142 | <div class="tckt-slctr-tkt-details-tbl-wrap-dv"> |
143 | 143 | <table class="tckt-slctr-tkt-details-tbl"> |
144 | 144 | <thead> |
@@ -146,9 +146,9 @@ discard block |
||
146 | 146 | <th class="tckt-slctr-tkt-details-date-th"> |
147 | 147 | <span class="dashicons dashicons-calendar"></span><span |
148 | 148 | class="small-text"><?php echo apply_filters( |
149 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', |
|
150 | - esc_html__( 'Date ', 'event_espresso' ) |
|
151 | - ); ?></span> |
|
149 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', |
|
150 | + esc_html__( 'Date ', 'event_espresso' ) |
|
151 | + ); ?></span> |
|
152 | 152 | </th> |
153 | 153 | <th class="tckt-slctr-tkt-details-time-th <?php echo $chart_column_width; ?>"> |
154 | 154 | <span class="dashicons dashicons-clock"></span><span |
@@ -157,98 +157,98 @@ discard block |
||
157 | 157 | <?php if ( $show_ticket_sale_columns ) : ?> |
158 | 158 | <th class="tckt-slctr-tkt-details-this-ticket-sold-th ee-fourth-width cntr"> |
159 | 159 | <span class="smaller-text"><?php echo apply_filters( |
160 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', |
|
161 | - sprintf( esc_html__( 'Sold', 'event_espresso' ), '<br/>' ) |
|
162 | - ); ?></span> |
|
160 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', |
|
161 | + sprintf( esc_html__( 'Sold', 'event_espresso' ), '<br/>' ) |
|
162 | + ); ?></span> |
|
163 | 163 | </th> |
164 | 164 | <th class="tckt-slctr-tkt-details-this-ticket-left-th ee-fourth-width cntr"> |
165 | 165 | <span class="smaller-text"><?php echo apply_filters( |
166 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', |
|
167 | - sprintf( esc_html__( 'Remaining', 'event_espresso' ), '<br/>' ) |
|
168 | - ); ?></span> |
|
166 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', |
|
167 | + sprintf( esc_html__( 'Remaining', 'event_espresso' ), '<br/>' ) |
|
168 | + ); ?></span> |
|
169 | 169 | </th> |
170 | 170 | <th |
171 | 171 | class="tckt-slctr-tkt-details-total-tickets-sold-th ee-fourth-width cntr"> |
172 | 172 | <span class="smaller-text"><?php echo apply_filters( |
173 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', |
|
174 | - sprintf( esc_html__( 'Total%sSold', 'event_espresso' ), '<br/>' ) |
|
175 | - ); ?></span> |
|
173 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', |
|
174 | + sprintf( esc_html__( 'Total%sSold', 'event_espresso' ), '<br/>' ) |
|
175 | + ); ?></span> |
|
176 | 176 | </th> |
177 | 177 | <th |
178 | 178 | class="tckt-slctr-tkt-details-total-tickets-left-th ee-fourth-width cntr"> |
179 | 179 | <span class="smaller-text"><?php echo apply_filters( |
180 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', |
|
181 | - sprintf( esc_html__( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' ) |
|
182 | - ); ?></span> |
|
180 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', |
|
181 | + sprintf( esc_html__( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' ) |
|
182 | + ); ?></span> |
|
183 | 183 | </th> |
184 | 184 | <?php endif; //end $show_ticket_sale_columns conditional ?> |
185 | 185 | </tr> |
186 | 186 | </thead> |
187 | 187 | <tbody> |
188 | 188 | <?php |
189 | - foreach ( $datetimes as $datetime ) { |
|
190 | - if ( $datetime instanceof EE_Datetime ) { |
|
191 | - ?> |
|
189 | + foreach ( $datetimes as $datetime ) { |
|
190 | + if ( $datetime instanceof EE_Datetime ) { |
|
191 | + ?> |
|
192 | 192 | |
193 | 193 | <tr> |
194 | 194 | <td data-th="<?php echo apply_filters( |
195 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', |
|
196 | - esc_html__( 'Event Date ', 'event_espresso' ) |
|
197 | - ); ?>" class="small-text"> |
|
195 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', |
|
196 | + esc_html__( 'Event Date ', 'event_espresso' ) |
|
197 | + ); ?>" class="small-text"> |
|
198 | 198 | <?php $datetime_name = $datetime->name(); ?> |
199 | 199 | <?php echo ! empty( $datetime_name ) ? '<b>' |
200 | - . $datetime_name |
|
201 | - . '</b><br/>' : ''; ?> |
|
200 | + . $datetime_name |
|
201 | + . '</b><br/>' : ''; ?> |
|
202 | 202 | <?php echo $datetime->date_range( |
203 | - $date_format, |
|
204 | - esc_html__( ' to ', 'event_espresso' ) |
|
205 | - ); ?> |
|
203 | + $date_format, |
|
204 | + esc_html__( ' to ', 'event_espresso' ) |
|
205 | + ); ?> |
|
206 | 206 | </td> |
207 | 207 | <td data-th="<?php esc_html_e( 'Time ', 'event_espresso' ); ?>" |
208 | 208 | class="cntr small-text"> |
209 | 209 | <?php echo $datetime->time_range( |
210 | - $time_format, |
|
211 | - esc_html__( ' to ', 'event_espresso' ) |
|
212 | - ); ?> |
|
210 | + $time_format, |
|
211 | + esc_html__( ' to ', 'event_espresso' ) |
|
212 | + ); ?> |
|
213 | 213 | </td> |
214 | 214 | <?php if ( $show_ticket_sale_columns ) : ?> |
215 | 215 | <td data-th="<?php echo apply_filters( |
216 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', |
|
217 | - esc_html__( 'Sold', 'event_espresso' ) |
|
218 | - ); ?>" class="cntr small-text"> |
|
216 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', |
|
217 | + esc_html__( 'Sold', 'event_espresso' ) |
|
218 | + ); ?>" class="cntr small-text"> |
|
219 | 219 | <?php echo $ticket->sold(); ?> |
220 | 220 | </td> |
221 | 221 | <td data-th="<?php echo apply_filters( |
222 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', |
|
223 | - esc_html__( 'Remaining', 'event_espresso' ) |
|
224 | - ); ?>" class="cntr small-text"> |
|
222 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', |
|
223 | + esc_html__( 'Remaining', 'event_espresso' ) |
|
224 | + ); ?>" class="cntr small-text"> |
|
225 | 225 | <?php echo $remaining === EE_INF |
226 | - ? '<span class="smaller-text">' . esc_html__( |
|
227 | - 'unlimited ', |
|
228 | - 'event_espresso' |
|
229 | - ) . '</span>' : $remaining; ?> |
|
226 | + ? '<span class="smaller-text">' . esc_html__( |
|
227 | + 'unlimited ', |
|
228 | + 'event_espresso' |
|
229 | + ) . '</span>' : $remaining; ?> |
|
230 | 230 | </td> |
231 | 231 | <td data-th="<?php echo apply_filters( |
232 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', |
|
233 | - esc_html__( 'Total Sold', 'event_espresso' ) |
|
234 | - ); ?>" class="cntr small-text"> |
|
232 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', |
|
233 | + esc_html__( 'Total Sold', 'event_espresso' ) |
|
234 | + ); ?>" class="cntr small-text"> |
|
235 | 235 | <?php echo $datetime->sold(); ?> |
236 | 236 | </td> |
237 | 237 | <?php $tkts_left = $datetime->sold_out() |
238 | - ? '<span class="sold-out smaller-text">' . esc_html__( |
|
239 | - 'Sold Out', |
|
240 | - 'event_espresso' |
|
241 | - ) . '</span>' : $datetime->spaces_remaining(); ?> |
|
238 | + ? '<span class="sold-out smaller-text">' . esc_html__( |
|
239 | + 'Sold Out', |
|
240 | + 'event_espresso' |
|
241 | + ) . '</span>' : $datetime->spaces_remaining(); ?> |
|
242 | 242 | <td data-th="<?php echo apply_filters( |
243 | - 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', |
|
244 | - esc_html__( 'Total Spaces Left', 'event_espresso' ) |
|
245 | - ); ?>" class="cntr small-text"> |
|
243 | + 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', |
|
244 | + esc_html__( 'Total Spaces Left', 'event_espresso' ) |
|
245 | + ); ?>" class="cntr small-text"> |
|
246 | 246 | <?php echo $tkts_left === EE_INF ? '<span class="smaller-text">' |
247 | - . esc_html__( |
|
248 | - 'unlimited ', |
|
249 | - 'event_espresso' |
|
250 | - ) |
|
251 | - . '</span>' : $tkts_left; ?> |
|
247 | + . esc_html__( |
|
248 | + 'unlimited ', |
|
249 | + 'event_espresso' |
|
250 | + ) |
|
251 | + . '</span>' : $tkts_left; ?> |
|
252 | 252 | </td> |
253 | 253 | <?php endif; //end $show_ticket_sale_columns conditional ?> |
254 | 254 | </tr> |
@@ -12,13 +12,13 @@ discard block |
||
12 | 12 | /** @var string $price_breakdown_heading */ |
13 | 13 | /** @var \EventEspresso\modules\ticket_selector\TicketDetails $ticket_details */ |
14 | 14 | ?> |
15 | -<?php if ( $show_ticket_details ) : ?> |
|
15 | +<?php if ($show_ticket_details) : ?> |
|
16 | 16 | <tr class="tckt-slctr-tkt-details-tr <?php echo $ticket_details_row_class; ?>"> |
17 | 17 | <td class="tckt-slctr-tkt-details-td" colspan="<?php echo $cols; ?>"> |
18 | 18 | <div id="<?php echo $ticket_details_css_id; ?>-dv" class="tckt-slctr-tkt-details-dv" style="display: none;"> |
19 | 19 | |
20 | 20 | <section class="tckt-slctr-tkt-details-sctn"> |
21 | - <h3><?php echo esc_html__( 'Details', 'event_espresso' ); ?></h3> |
|
21 | + <h3><?php echo esc_html__('Details', 'event_espresso'); ?></h3> |
|
22 | 22 | <p><?php echo $ticket->description(); ?></p> |
23 | 23 | |
24 | 24 | <?php |
@@ -33,42 +33,42 @@ discard block |
||
33 | 33 | <section class="tckt-slctr-tkt-sale-dates-sctn"> |
34 | 34 | <h5><?php echo apply_filters( |
35 | 35 | 'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading', |
36 | - esc_html__( 'Sale Dates', 'event_espresso' ) |
|
36 | + esc_html__('Sale Dates', 'event_espresso') |
|
37 | 37 | ); ?> |
38 | 38 | </h5> |
39 | 39 | <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( |
40 | 40 | 'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message', |
41 | - esc_html__( 'The dates when this option is available for purchase.', 'event_espresso' ) |
|
41 | + esc_html__('The dates when this option is available for purchase.', 'event_espresso') |
|
42 | 42 | ); ?></span> |
43 | 43 | <br/> |
44 | 44 | <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( |
45 | 45 | 'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale', |
46 | - esc_html__( 'Goes On Sale:', 'event_espresso' ) |
|
46 | + esc_html__('Goes On Sale:', 'event_espresso') |
|
47 | 47 | ); ?></span> |
48 | 48 | <span class="dashicons dashicons-calendar"></span> |
49 | - <?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format) . ' '; ?> |
|
49 | + <?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format).' '; ?> |
|
50 | 50 | <span class="dashicons dashicons-clock"></span> |
51 | - <?php echo $ticket->get_i18n_datetime('TKT_start_date',$time_format); ?> |
|
51 | + <?php echo $ticket->get_i18n_datetime('TKT_start_date', $time_format); ?> |
|
52 | 52 | <br/> |
53 | 53 | <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( |
54 | 54 | 'FHEE__ticket_selector_chart_template__ticket_details_sales_end', |
55 | - esc_html__( 'Sales End:', 'event_espresso' ) |
|
55 | + esc_html__('Sales End:', 'event_espresso') |
|
56 | 56 | ); ?></span> |
57 | 57 | <span class="dashicons dashicons-calendar"></span> |
58 | - <?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format) . ' '; ?> |
|
58 | + <?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format).' '; ?> |
|
59 | 59 | <span class="dashicons dashicons-clock"></span> |
60 | 60 | <?php echo $ticket->get_i18n_datetime('TKT_end_date', $time_format); ?> |
61 | 61 | <br/> |
62 | 62 | </section> |
63 | 63 | <br/> |
64 | 64 | |
65 | - <?php do_action( 'AHEE__ticket_selector_chart_template__after_ticket_date', $ticket ); ?> |
|
65 | + <?php do_action('AHEE__ticket_selector_chart_template__after_ticket_date', $ticket); ?> |
|
66 | 66 | |
67 | - <?php if ( $ticket->min() && $ticket->max() ) { ?> |
|
67 | + <?php if ($ticket->min() && $ticket->max()) { ?> |
|
68 | 68 | <section class="tckt-slctr-tkt-quantities-sctn"> |
69 | 69 | <h5><?php echo apply_filters( |
70 | 70 | 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading', |
71 | - esc_html__( 'Purchasable Quantities', 'event_espresso' ) |
|
71 | + esc_html__('Purchasable Quantities', 'event_espresso') |
|
72 | 72 | ); ?></h5> |
73 | 73 | <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( |
74 | 74 | 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message', |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | ); ?></span><br/> |
80 | 80 | <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( |
81 | 81 | 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty', |
82 | - esc_html__( 'Minimum Qty:', 'event_espresso' ) |
|
82 | + esc_html__('Minimum Qty:', 'event_espresso') |
|
83 | 83 | ); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?> |
84 | - <?php if ( $ticket->min() > $remaining ) { ?> <span |
|
84 | + <?php if ($ticket->min() > $remaining) { ?> <span |
|
85 | 85 | class="important-notice small-text"><?php echo apply_filters( |
86 | 86 | 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message', |
87 | 87 | esc_html__( |
@@ -92,18 +92,18 @@ discard block |
||
92 | 92 | <?php //$max = min( $max, $max_atndz );?> |
93 | 93 | <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( |
94 | 94 | 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty', |
95 | - esc_html__( 'Maximum Qty:', 'event_espresso' ) |
|
96 | - ); ?></span><?php echo $ticket->max() === EE_INF ? esc_html__( 'no limit', 'event_espresso' ) |
|
97 | - : max( $ticket->max(), 1 ); ?><br/> |
|
95 | + esc_html__('Maximum Qty:', 'event_espresso') |
|
96 | + ); ?></span><?php echo $ticket->max() === EE_INF ? esc_html__('no limit', 'event_espresso') |
|
97 | + : max($ticket->max(), 1); ?><br/> |
|
98 | 98 | </section> |
99 | 99 | <br/> |
100 | 100 | <?php } ?> |
101 | 101 | |
102 | - <?php if ( ( ! defined( 'EE_DECAF' ) || EE_DECAF !== true ) && $ticket->uses() !== EE_INF ) { ?> |
|
102 | + <?php if (( ! defined('EE_DECAF') || EE_DECAF !== true) && $ticket->uses() !== EE_INF) { ?> |
|
103 | 103 | <section class="tckt-slctr-tkt-uses-sctn"> |
104 | 104 | <h5><?php echo apply_filters( |
105 | 105 | 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading', |
106 | - esc_html__( 'Event Date Ticket Uses', 'event_espresso' ) |
|
106 | + esc_html__('Event Date Ticket Uses', 'event_espresso') |
|
107 | 107 | ); ?></h5> |
108 | 108 | <span class="drk-grey-text small-text no-bold"> - <?php |
109 | 109 | echo apply_filters( |
@@ -121,23 +121,23 @@ discard block |
||
121 | 121 | ?></span><br/> |
122 | 122 | <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( |
123 | 123 | 'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes', |
124 | - esc_html__( '# Datetimes:', 'event_espresso' ) |
|
124 | + esc_html__('# Datetimes:', 'event_espresso') |
|
125 | 125 | ); ?></span><?php echo $ticket->uses(); ?><br/> |
126 | 126 | </section> |
127 | 127 | <?php } ?> |
128 | 128 | |
129 | 129 | <?php |
130 | - $datetimes = $ticket->datetimes_ordered( $event_is_expired, false ); |
|
130 | + $datetimes = $ticket->datetimes_ordered($event_is_expired, false); |
|
131 | 131 | $chart_column_width = $show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width'; |
132 | - if ( ! empty( $datetimes ) ) { ?> |
|
132 | + if ( ! empty($datetimes)) { ?> |
|
133 | 133 | <section class="tckt-slctr-tkt-datetimes-sctn"> |
134 | 134 | <h5><?php echo apply_filters( |
135 | 135 | 'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading', |
136 | - esc_html__( 'Access', 'event_espresso' ) |
|
136 | + esc_html__('Access', 'event_espresso') |
|
137 | 137 | ); ?></h5> |
138 | 138 | <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( |
139 | 139 | 'FHEE__ticket_selector_chart_template__ticket_details_event_access_message', |
140 | - esc_html__( 'This option allows access to the following dates and times.', 'event_espresso' ) |
|
140 | + esc_html__('This option allows access to the following dates and times.', 'event_espresso') |
|
141 | 141 | ); ?></span> |
142 | 142 | <div class="tckt-slctr-tkt-details-tbl-wrap-dv"> |
143 | 143 | <table class="tckt-slctr-tkt-details-tbl"> |
@@ -147,38 +147,38 @@ discard block |
||
147 | 147 | <span class="dashicons dashicons-calendar"></span><span |
148 | 148 | class="small-text"><?php echo apply_filters( |
149 | 149 | 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', |
150 | - esc_html__( 'Date ', 'event_espresso' ) |
|
150 | + esc_html__('Date ', 'event_espresso') |
|
151 | 151 | ); ?></span> |
152 | 152 | </th> |
153 | 153 | <th class="tckt-slctr-tkt-details-time-th <?php echo $chart_column_width; ?>"> |
154 | 154 | <span class="dashicons dashicons-clock"></span><span |
155 | - class="small-text"><?php esc_html_e( 'Time ', 'event_espresso' ); ?></span> |
|
155 | + class="small-text"><?php esc_html_e('Time ', 'event_espresso'); ?></span> |
|
156 | 156 | </th> |
157 | - <?php if ( $show_ticket_sale_columns ) : ?> |
|
157 | + <?php if ($show_ticket_sale_columns) : ?> |
|
158 | 158 | <th class="tckt-slctr-tkt-details-this-ticket-sold-th ee-fourth-width cntr"> |
159 | 159 | <span class="smaller-text"><?php echo apply_filters( |
160 | 160 | 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', |
161 | - sprintf( esc_html__( 'Sold', 'event_espresso' ), '<br/>' ) |
|
161 | + sprintf(esc_html__('Sold', 'event_espresso'), '<br/>') |
|
162 | 162 | ); ?></span> |
163 | 163 | </th> |
164 | 164 | <th class="tckt-slctr-tkt-details-this-ticket-left-th ee-fourth-width cntr"> |
165 | 165 | <span class="smaller-text"><?php echo apply_filters( |
166 | 166 | 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', |
167 | - sprintf( esc_html__( 'Remaining', 'event_espresso' ), '<br/>' ) |
|
167 | + sprintf(esc_html__('Remaining', 'event_espresso'), '<br/>') |
|
168 | 168 | ); ?></span> |
169 | 169 | </th> |
170 | 170 | <th |
171 | 171 | class="tckt-slctr-tkt-details-total-tickets-sold-th ee-fourth-width cntr"> |
172 | 172 | <span class="smaller-text"><?php echo apply_filters( |
173 | 173 | 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', |
174 | - sprintf( esc_html__( 'Total%sSold', 'event_espresso' ), '<br/>' ) |
|
174 | + sprintf(esc_html__('Total%sSold', 'event_espresso'), '<br/>') |
|
175 | 175 | ); ?></span> |
176 | 176 | </th> |
177 | 177 | <th |
178 | 178 | class="tckt-slctr-tkt-details-total-tickets-left-th ee-fourth-width cntr"> |
179 | 179 | <span class="smaller-text"><?php echo apply_filters( |
180 | 180 | 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', |
181 | - sprintf( esc_html__( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' ) |
|
181 | + sprintf(esc_html__('Total Spaces%sLeft', 'event_espresso'), '<br/>') |
|
182 | 182 | ); ?></span> |
183 | 183 | </th> |
184 | 184 | <?php endif; //end $show_ticket_sale_columns conditional ?> |
@@ -186,62 +186,62 @@ discard block |
||
186 | 186 | </thead> |
187 | 187 | <tbody> |
188 | 188 | <?php |
189 | - foreach ( $datetimes as $datetime ) { |
|
190 | - if ( $datetime instanceof EE_Datetime ) { |
|
189 | + foreach ($datetimes as $datetime) { |
|
190 | + if ($datetime instanceof EE_Datetime) { |
|
191 | 191 | ?> |
192 | 192 | |
193 | 193 | <tr> |
194 | 194 | <td data-th="<?php echo apply_filters( |
195 | 195 | 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', |
196 | - esc_html__( 'Event Date ', 'event_espresso' ) |
|
196 | + esc_html__('Event Date ', 'event_espresso') |
|
197 | 197 | ); ?>" class="small-text"> |
198 | 198 | <?php $datetime_name = $datetime->name(); ?> |
199 | - <?php echo ! empty( $datetime_name ) ? '<b>' |
|
199 | + <?php echo ! empty($datetime_name) ? '<b>' |
|
200 | 200 | . $datetime_name |
201 | 201 | . '</b><br/>' : ''; ?> |
202 | 202 | <?php echo $datetime->date_range( |
203 | 203 | $date_format, |
204 | - esc_html__( ' to ', 'event_espresso' ) |
|
204 | + esc_html__(' to ', 'event_espresso') |
|
205 | 205 | ); ?> |
206 | 206 | </td> |
207 | - <td data-th="<?php esc_html_e( 'Time ', 'event_espresso' ); ?>" |
|
207 | + <td data-th="<?php esc_html_e('Time ', 'event_espresso'); ?>" |
|
208 | 208 | class="cntr small-text"> |
209 | 209 | <?php echo $datetime->time_range( |
210 | 210 | $time_format, |
211 | - esc_html__( ' to ', 'event_espresso' ) |
|
211 | + esc_html__(' to ', 'event_espresso') |
|
212 | 212 | ); ?> |
213 | 213 | </td> |
214 | - <?php if ( $show_ticket_sale_columns ) : ?> |
|
214 | + <?php if ($show_ticket_sale_columns) : ?> |
|
215 | 215 | <td data-th="<?php echo apply_filters( |
216 | 216 | 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', |
217 | - esc_html__( 'Sold', 'event_espresso' ) |
|
217 | + esc_html__('Sold', 'event_espresso') |
|
218 | 218 | ); ?>" class="cntr small-text"> |
219 | 219 | <?php echo $ticket->sold(); ?> |
220 | 220 | </td> |
221 | 221 | <td data-th="<?php echo apply_filters( |
222 | 222 | 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', |
223 | - esc_html__( 'Remaining', 'event_espresso' ) |
|
223 | + esc_html__('Remaining', 'event_espresso') |
|
224 | 224 | ); ?>" class="cntr small-text"> |
225 | 225 | <?php echo $remaining === EE_INF |
226 | - ? '<span class="smaller-text">' . esc_html__( |
|
226 | + ? '<span class="smaller-text">'.esc_html__( |
|
227 | 227 | 'unlimited ', |
228 | 228 | 'event_espresso' |
229 | - ) . '</span>' : $remaining; ?> |
|
229 | + ).'</span>' : $remaining; ?> |
|
230 | 230 | </td> |
231 | 231 | <td data-th="<?php echo apply_filters( |
232 | 232 | 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', |
233 | - esc_html__( 'Total Sold', 'event_espresso' ) |
|
233 | + esc_html__('Total Sold', 'event_espresso') |
|
234 | 234 | ); ?>" class="cntr small-text"> |
235 | 235 | <?php echo $datetime->sold(); ?> |
236 | 236 | </td> |
237 | 237 | <?php $tkts_left = $datetime->sold_out() |
238 | - ? '<span class="sold-out smaller-text">' . esc_html__( |
|
238 | + ? '<span class="sold-out smaller-text">'.esc_html__( |
|
239 | 239 | 'Sold Out', |
240 | 240 | 'event_espresso' |
241 | - ) . '</span>' : $datetime->spaces_remaining(); ?> |
|
241 | + ).'</span>' : $datetime->spaces_remaining(); ?> |
|
242 | 242 | <td data-th="<?php echo apply_filters( |
243 | 243 | 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', |
244 | - esc_html__( 'Total Spaces Left', 'event_espresso' ) |
|
244 | + esc_html__('Total Spaces Left', 'event_espresso') |
|
245 | 245 | ); ?>" class="cntr small-text"> |
246 | 246 | <?php echo $tkts_left === EE_INF ? '<span class="smaller-text">' |
247 | 247 | . esc_html__( |
@@ -266,4 +266,4 @@ discard block |
||
266 | 266 | </div> |
267 | 267 | </td> |
268 | 268 | </tr> |
269 | -<?php endif; //end template_settings->show_ticket_details check?> |
|
270 | 269 | \ No newline at end of file |
270 | +<?php endif; //end template_settings->show_ticket_details check?> |
|
271 | 271 | \ No newline at end of file |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | if ($display_ticket_price) { ?> |
8 | 8 | <section class="tckt-slctr-tkt-price-sctn"> |
9 | 9 | <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading', |
10 | - esc_html__('Price', 'event_espresso')); ?></h5> |
|
10 | + esc_html__('Price', 'event_espresso')); ?></h5> |
|
11 | 11 | <div class="tckt-slctr-tkt-details-tbl-wrap-dv"> |
12 | 12 | <table class="tckt-slctr-tkt-details-tbl"> |
13 | 13 | <thead> |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | class="jst-rght small-text"><?php echo $ticket->base_price()->pretty_price(); ?></td> |
31 | 31 | </tr> |
32 | 32 | <?php |
33 | - $running_total = $ticket->base_price()->amount(); |
|
34 | - } else { |
|
35 | - $running_total = 0; |
|
36 | - } |
|
37 | - // now add price modifiers |
|
38 | - foreach ($ticket->price_modifiers() as $price_mod) { ?> |
|
33 | + $running_total = $ticket->base_price()->amount(); |
|
34 | + } else { |
|
35 | + $running_total = 0; |
|
36 | + } |
|
37 | + // now add price modifiers |
|
38 | + foreach ($ticket->price_modifiers() as $price_mod) { ?> |
|
39 | 39 | <tr> |
40 | 40 | <td data-th="<?php esc_html_e('Name', 'event_espresso'); ?>" |
41 | 41 | class="jst-rght small-text"><?php echo $price_mod->name(); ?></td> |
@@ -45,16 +45,16 @@ discard block |
||
45 | 45 | % |
46 | 46 | </td> |
47 | 47 | <?php |
48 | - $new_sub_total = $running_total * ($price_mod->amount() / 100); |
|
49 | - $new_sub_total = $price_mod->is_discount() ? $new_sub_total * -1 : $new_sub_total; |
|
50 | - ?> |
|
48 | + $new_sub_total = $running_total * ($price_mod->amount() / 100); |
|
49 | + $new_sub_total = $price_mod->is_discount() ? $new_sub_total * -1 : $new_sub_total; |
|
50 | + ?> |
|
51 | 51 | <?php } else { ?> |
52 | 52 | <?php $new_sub_total = $price_mod->is_discount() ? $price_mod->amount() * -1 |
53 | - : $price_mod->amount(); ?> |
|
53 | + : $price_mod->amount(); ?> |
|
54 | 54 | <td data-th="<?php esc_html_e('Description', 'event_espresso'); ?>" |
55 | 55 | class="small-text"><?php echo $price_mod->desc(); ?></td> |
56 | 56 | <?php $new_sub_total = $price_mod->is_discount() ? $price_mod->amount() * -1 |
57 | - : $price_mod->amount(); ?> |
|
57 | + : $price_mod->amount(); ?> |
|
58 | 58 | <?php } ?> |
59 | 59 | <td data-th="<?php esc_html_e('Amount', 'event_espresso'); ?>" |
60 | 60 | class="jst-rght small-text"><?php echo EEH_Template::format_currency($new_sub_total); ?></td> |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | <?php //$ticket_subtotal =$ticket->get_ticket_subtotal(); ?> |
66 | 66 | <tr> |
67 | 67 | <td colspan="2" class="jst-rght small-text sbttl"><b><?php esc_html_e('subtotal', |
68 | - 'event_espresso'); ?></b></td> |
|
68 | + 'event_espresso'); ?></b></td> |
|
69 | 69 | <td data-th="<?php esc_html_e('subtotal', 'event_espresso'); ?>" class="jst-rght small-text"> |
70 | 70 | <b><?php echo EEH_Template::format_currency($running_total); ?></b></td> |
71 | 71 | </tr> |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | <tr> |
88 | 88 | <td colspan="2" class="jst-rght small-text ttl-lbl-td"> |
89 | 89 | <b><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_total_price', |
90 | - esc_html__('Total', 'event_espresso')); ?></b></td> |
|
90 | + esc_html__('Total', 'event_espresso')); ?></b></td> |
|
91 | 91 | <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_total_price', |
92 | - esc_html__('Total', 'event_espresso')); ?>" class="jst-rght small-text"> |
|
92 | + esc_html__('Total', 'event_espresso')); ?>" class="jst-rght small-text"> |
|
93 | 93 | <b><?php echo EEH_Template::format_currency($running_total); ?></b></td> |
94 | 94 | </tr> |
95 | 95 | </tbody> |