@@ -1,1 +1,1 @@ |
||
1 | -<?php printf( __('PayPal Express (Express Checkout) is an off-site payment method for accepting payments via PayPal and is available to event organizers in many countries. A PayPal premier or business account is needed to accept payments. Need a PayPal account? Call 1-855-456-1338 or %1$sclick here to sign up for a merchant account%2$s.', 'event_espresso'), '<a href="https://eventespresso.com/go/paypalexpress/" target="_blank">','</a>' ); ?> |
|
2 | 1 | \ No newline at end of file |
2 | +<?php printf(__('PayPal Express (Express Checkout) is an off-site payment method for accepting payments via PayPal and is available to event organizers in many countries. A PayPal premier or business account is needed to accept payments. Need a PayPal account? Call 1-855-456-1338 or %1$sclick here to sign up for a merchant account%2$s.', 'event_espresso'), '<a href="https://eventespresso.com/go/paypalexpress/" target="_blank">', '</a>'); ?> |
|
3 | 3 | \ No newline at end of file |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { exit('No direct script access allowed'); } ?> |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } ?> |
|
2 | 2 | |
3 | 3 | <div id="ppexpress-sandbox-panel" class="sandbox-panel"> |
4 | 4 | |
@@ -6,13 +6,13 @@ discard block |
||
6 | 6 | |
7 | 7 | <h4><?php _e('How do I test specific error codes?', 'event_espresso'); ?></h4> |
8 | 8 | <p> |
9 | - <?php _e( 'To trigger an error condition on an amount-related field, |
|
9 | + <?php _e('To trigger an error condition on an amount-related field, |
|
10 | 10 | specify a error code value as a number with two digits to the right of the decimal point. |
11 | 11 | For example, specify a value of 107.55 to trigger the 10755 error.', |
12 | - 'event_espresso');?> |
|
12 | + 'event_espresso'); ?> |
|
13 | 13 | </p> |
14 | 14 | <p> |
15 | - <?php printf( __( 'More details can be found here: %1$s Testing Error Conditions %2$s.', 'event_espresso'), '<a href="https://developer.paypal.com/docs/classic/lifecycle/sb_error-conditions">', '</a>');?> |
|
15 | + <?php printf(__('More details can be found here: %1$s Testing Error Conditions %2$s.', 'event_espresso'), '<a href="https://developer.paypal.com/docs/classic/lifecycle/sb_error-conditions">', '</a>'); ?> |
|
16 | 16 | </p> |
17 | 17 | |
18 | 18 | </div> |
19 | 19 | \ No newline at end of file |
@@ -15,8 +15,8 @@ |
||
15 | 15 | class EE_PMT_Paypal_Express extends EE_PMT_Base { |
16 | 16 | |
17 | 17 | /** |
18 | - * Class constructor. |
|
19 | - */ |
|
18 | + * Class constructor. |
|
19 | + */ |
|
20 | 20 | public function __construct( $pm_instance = NULL ) { |
21 | 21 | require_once( $this->file_folder() . 'EEG_Paypal_Express.gateway.php' ); |
22 | 22 | $this->_gateway = new EEG_Paypal_Express(); |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' )) { exit('NO direct script access allowed'); } |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('NO direct script access allowed'); } |
|
2 | 2 | |
3 | 3 | /** |
4 | 4 | * ---------------------------------------------- |
@@ -17,16 +17,16 @@ discard block |
||
17 | 17 | /** |
18 | 18 | * Class constructor. |
19 | 19 | */ |
20 | - public function __construct( $pm_instance = NULL ) { |
|
21 | - require_once( $this->file_folder() . 'EEG_Paypal_Express.gateway.php' ); |
|
20 | + public function __construct($pm_instance = NULL) { |
|
21 | + require_once($this->file_folder().'EEG_Paypal_Express.gateway.php'); |
|
22 | 22 | $this->_gateway = new EEG_Paypal_Express(); |
23 | 23 | |
24 | - $this->_pretty_name = __( 'PayPal Express', 'event_espresso' ); |
|
25 | - $this->_template_path = $this->file_folder() . 'templates' . DS; |
|
26 | - $this->_default_description = __( 'After clicking \'Finalize Registration\', you will be forwarded to PayPal website to Login and make your payment.', 'event_espresso' ); |
|
27 | - $this->_default_button_url = $this->file_url() . 'lib' . DS . 'paypal-express-checkout-logo.png'; |
|
24 | + $this->_pretty_name = __('PayPal Express', 'event_espresso'); |
|
25 | + $this->_template_path = $this->file_folder().'templates'.DS; |
|
26 | + $this->_default_description = __('After clicking \'Finalize Registration\', you will be forwarded to PayPal website to Login and make your payment.', 'event_espresso'); |
|
27 | + $this->_default_button_url = $this->file_url().'lib'.DS.'paypal-express-checkout-logo.png'; |
|
28 | 28 | |
29 | - parent::__construct( $pm_instance ); |
|
29 | + parent::__construct($pm_instance); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
@@ -58,34 +58,34 @@ discard block |
||
58 | 58 | 'extra_meta_inputs' => array( |
59 | 59 | 'api_username' => new EE_Text_Input( |
60 | 60 | array( |
61 | - 'html_label_text'=> sprintf( __( 'API Username %s', 'event_espresso' ), $this->get_help_tab_link() ), |
|
61 | + 'html_label_text'=> sprintf(__('API Username %s', 'event_espresso'), $this->get_help_tab_link()), |
|
62 | 62 | 'required' => true, |
63 | 63 | ) |
64 | 64 | ), |
65 | 65 | 'api_password' => new EE_Text_Input( |
66 | 66 | array( |
67 | - 'html_label_text' => sprintf( __( 'API Password %s', 'event_espresso' ), $this->get_help_tab_link() ), |
|
67 | + 'html_label_text' => sprintf(__('API Password %s', 'event_espresso'), $this->get_help_tab_link()), |
|
68 | 68 | 'required' => true |
69 | 69 | ) |
70 | 70 | ), |
71 | 71 | 'api_signature' => new EE_Text_Input( |
72 | 72 | array( |
73 | - 'html_label_text' => sprintf( __( 'API Signature %s', 'event_espresso' ), $this->get_help_tab_link() ), |
|
73 | + 'html_label_text' => sprintf(__('API Signature %s', 'event_espresso'), $this->get_help_tab_link()), |
|
74 | 74 | 'required' => true |
75 | 75 | ) |
76 | 76 | ), |
77 | 77 | 'request_shipping_addr' => new EE_Yes_No_Input( |
78 | 78 | array( |
79 | - 'html_label_text' => sprintf( __( 'Request Shipping Address %s', 'event_espresso' ), $this->get_help_tab_link() ), |
|
80 | - 'html_help_text' => __( 'If set to "Yes", then a shipping address will be requested on the PayPal checkout page.', 'event_espresso' ), |
|
79 | + 'html_label_text' => sprintf(__('Request Shipping Address %s', 'event_espresso'), $this->get_help_tab_link()), |
|
80 | + 'html_help_text' => __('If set to "Yes", then a shipping address will be requested on the PayPal checkout page.', 'event_espresso'), |
|
81 | 81 | 'required' => true, |
82 | 82 | 'default' => false, |
83 | 83 | ) |
84 | 84 | ), |
85 | 85 | 'image_url' => new EE_Admin_File_Uploader_Input( |
86 | 86 | array( |
87 | - 'html_label_text' => sprintf( __( 'Image URL %s', 'event_espresso' ), $this->get_help_tab_link() ), |
|
88 | - 'html_help_text' => __( 'Used for your business/personal logo on the PayPal page', 'event_espresso' ), |
|
87 | + 'html_label_text' => sprintf(__('Image URL %s', 'event_espresso'), $this->get_help_tab_link()), |
|
88 | + 'html_help_text' => __('Used for your business/personal logo on the PayPal page', 'event_espresso'), |
|
89 | 89 | 'required' => false |
90 | 90 | ) |
91 | 91 | ), |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | * @param \EE_Transaction $transaction |
103 | 103 | * @return \EE_Billing_Info_Form |
104 | 104 | */ |
105 | - public function generate_new_billing_form( EE_Transaction $transaction = null ) { |
|
106 | - if ( $this->_pm_instance->debug_mode() ) { |
|
105 | + public function generate_new_billing_form(EE_Transaction $transaction = null) { |
|
106 | + if ($this->_pm_instance->debug_mode()) { |
|
107 | 107 | $form = new EE_Billing_Info_Form( |
108 | 108 | $this->_pm_instance, |
109 | 109 | array( |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | array( |
114 | 114 | 'layout_strategy' => new EE_Template_Layout( |
115 | 115 | array( |
116 | - 'layout_template_file' => $this->_template_path . 'paypal_express_debug_info.template.php', |
|
117 | - 'template_args' => array( 'debug_mode' => $this->_pm_instance->debug_mode() ) |
|
116 | + 'layout_template_file' => $this->_template_path.'paypal_express_debug_info.template.php', |
|
117 | + 'template_args' => array('debug_mode' => $this->_pm_instance->debug_mode()) |
|
118 | 118 | ) |
119 | 119 | ) |
120 | 120 | ) |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\exceptions; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -15,5 +15,5 @@ discard block |
||
15 | 15 | * @author Darren Ethier |
16 | 16 | * @since 4.9.11.rc.001 |
17 | 17 | */ |
18 | -class SendMessageException extends \RuntimeException {} |
|
18 | +class SendMessageException extends \RuntimeException {} |
|
19 | 19 | // End of file SendMessageException.php |
20 | 20 | \ No newline at end of file |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | |
277 | 277 | /** |
278 | 278 | * @param $REG_ID |
279 | - * @param $reg_status |
|
279 | + * @param boolean $reg_status |
|
280 | 280 | */ |
281 | 281 | public function set_reg_status_updated( $REG_ID, $reg_status ) { |
282 | 282 | $this->reg_status_updated[ $REG_ID ] = filter_var( $reg_status, FILTER_VALIDATE_BOOLEAN ); |
@@ -1110,6 +1110,7 @@ discard block |
||
1110 | 1110 | * |
1111 | 1111 | * @param string | int $reg_cache_ID |
1112 | 1112 | * @param EE_Registration $registration |
1113 | + * @param integer $reg_cache_ID |
|
1113 | 1114 | * @return void |
1114 | 1115 | * @throws \EE_Error |
1115 | 1116 | */ |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * |
|
4 | - * Class EE_Checkout |
|
5 | - * |
|
6 | - * Description |
|
7 | - * |
|
8 | - * @package Event Espresso |
|
9 | - * @subpackage core |
|
10 | - * @author Brent Christensen |
|
11 | - * @since 4.5.0 |
|
12 | - * |
|
13 | - */ |
|
3 | + * |
|
4 | + * Class EE_Checkout |
|
5 | + * |
|
6 | + * Description |
|
7 | + * |
|
8 | + * @package Event Espresso |
|
9 | + * @subpackage core |
|
10 | + * @author Brent Christensen |
|
11 | + * @since 4.5.0 |
|
12 | + * |
|
13 | + */ |
|
14 | 14 | class EE_Checkout { |
15 | 15 | |
16 | 16 | /** |
@@ -804,10 +804,10 @@ discard block |
||
804 | 804 | */ |
805 | 805 | public function visit_allows_processing_of_this_registration( EE_Registration $registration ) { |
806 | 806 | return ! $this->revisit |
807 | - || $this->primary_revisit |
|
808 | - || ( |
|
809 | - $this->revisit && $this->reg_url_link === $registration->reg_url_link() |
|
810 | - ) |
|
807 | + || $this->primary_revisit |
|
808 | + || ( |
|
809 | + $this->revisit && $this->reg_url_link === $registration->reg_url_link() |
|
810 | + ) |
|
811 | 811 | ? true |
812 | 812 | : false; |
813 | 813 | } |
@@ -1199,16 +1199,16 @@ discard block |
||
1199 | 1199 | * @return array |
1200 | 1200 | * @throws \EE_Error |
1201 | 1201 | */ |
1202 | - public function __sleep() |
|
1203 | - { |
|
1204 | - if ( $this->primary_attendee_obj instanceof EE_Attendee && $this->primary_attendee_obj->ID() ) { |
|
1205 | - $this->primary_attendee_obj = $this->primary_attendee_obj->ID(); |
|
1206 | - } // remove the reg form and the checkout |
|
1207 | - if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) { |
|
1208 | - $this->transaction = $this->transaction->ID(); |
|
1209 | - } // remove the reg form and the checkout |
|
1210 | - return array_diff( array_keys( get_object_vars( $this ) ), array( 'billing_form', 'registration_form' ) ); |
|
1211 | - } |
|
1202 | + public function __sleep() |
|
1203 | + { |
|
1204 | + if ( $this->primary_attendee_obj instanceof EE_Attendee && $this->primary_attendee_obj->ID() ) { |
|
1205 | + $this->primary_attendee_obj = $this->primary_attendee_obj->ID(); |
|
1206 | + } // remove the reg form and the checkout |
|
1207 | + if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) { |
|
1208 | + $this->transaction = $this->transaction->ID(); |
|
1209 | + } // remove the reg form and the checkout |
|
1210 | + return array_diff( array_keys( get_object_vars( $this ) ), array( 'billing_form', 'registration_form' ) ); |
|
1211 | + } |
|
1212 | 1212 | |
1213 | 1213 | |
1214 | 1214 | /** |
@@ -247,9 +247,9 @@ discard block |
||
247 | 247 | $this->reg_page_base_url = EE_Registry::instance()->CFG->core->reg_page_url(); |
248 | 248 | $this->thank_you_page_url = EE_Registry::instance()->CFG->core->thank_you_page_url(); |
249 | 249 | $this->cancel_page_url = EE_Registry::instance()->CFG->core->cancel_page_url(); |
250 | - $this->continue_reg = apply_filters( 'FHEE__EE_Checkout___construct___continue_reg', TRUE ); |
|
250 | + $this->continue_reg = apply_filters('FHEE__EE_Checkout___construct___continue_reg', TRUE); |
|
251 | 251 | $this->admin_request = is_admin() && ! EE_Registry::instance()->REQ->ajax; |
252 | - $this->reg_cache_where_params = array( 'order_by' => array( 'REG_count' => 'ASC' )); |
|
252 | + $this->reg_cache_where_params = array('order_by' => array('REG_count' => 'ASC')); |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | |
@@ -260,8 +260,8 @@ discard block |
||
260 | 260 | * @return boolean |
261 | 261 | */ |
262 | 262 | public function any_reg_status_updated() { |
263 | - foreach ( $this->reg_status_updated as $reg_status ) { |
|
264 | - if ( $reg_status ) { |
|
263 | + foreach ($this->reg_status_updated as $reg_status) { |
|
264 | + if ($reg_status) { |
|
265 | 265 | return true; |
266 | 266 | } |
267 | 267 | } |
@@ -274,8 +274,8 @@ discard block |
||
274 | 274 | * @param $REG_ID |
275 | 275 | * @return boolean |
276 | 276 | */ |
277 | - public function reg_status_updated( $REG_ID ) { |
|
278 | - return isset( $this->reg_status_updated[ $REG_ID ] ) ? $this->reg_status_updated[ $REG_ID ] : false; |
|
277 | + public function reg_status_updated($REG_ID) { |
|
278 | + return isset($this->reg_status_updated[$REG_ID]) ? $this->reg_status_updated[$REG_ID] : false; |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | |
@@ -284,8 +284,8 @@ discard block |
||
284 | 284 | * @param $REG_ID |
285 | 285 | * @param $reg_status |
286 | 286 | */ |
287 | - public function set_reg_status_updated( $REG_ID, $reg_status ) { |
|
288 | - $this->reg_status_updated[ $REG_ID ] = filter_var( $reg_status, FILTER_VALIDATE_BOOLEAN ); |
|
287 | + public function set_reg_status_updated($REG_ID, $reg_status) { |
|
288 | + $this->reg_status_updated[$REG_ID] = filter_var($reg_status, FILTER_VALIDATE_BOOLEAN); |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | * can ONLY be set by the Finalize_Registration reg step |
307 | 307 | */ |
308 | 308 | public function set_exit_spco() { |
309 | - if ( $this->current_step instanceof EE_SPCO_Reg_Step_Finalize_Registration ) { |
|
309 | + if ($this->current_step instanceof EE_SPCO_Reg_Step_Finalize_Registration) { |
|
310 | 310 | $this->exit_spco = true; |
311 | 311 | } |
312 | 312 | } |
@@ -323,12 +323,12 @@ discard block |
||
323 | 323 | */ |
324 | 324 | public function reset_for_current_request() { |
325 | 325 | $this->process_form_submission = FALSE; |
326 | - $this->continue_reg = apply_filters( 'FHEE__EE_Checkout___construct___continue_reg', true ); |
|
326 | + $this->continue_reg = apply_filters('FHEE__EE_Checkout___construct___continue_reg', true); |
|
327 | 327 | $this->admin_request = is_admin() && ! EE_Registry::instance()->REQ->front_ajax; |
328 | 328 | $this->continue_reg = true; |
329 | 329 | $this->redirect = false; |
330 | 330 | // don't reset the cached redirect form if we're about to be asked to display it !!! |
331 | - if ( EE_Registry::instance()->REQ->get( 'action', 'display_spco_reg_step' ) !== 'redirect_form' ) { |
|
331 | + if (EE_Registry::instance()->REQ->get('action', 'display_spco_reg_step') !== 'redirect_form') { |
|
332 | 332 | $this->redirect_form = ''; |
333 | 333 | } |
334 | 334 | $this->redirect_url = ''; |
@@ -345,8 +345,8 @@ discard block |
||
345 | 345 | * @param EE_SPCO_Reg_Step $reg_step_obj |
346 | 346 | * @return void |
347 | 347 | */ |
348 | - public function add_reg_step( EE_SPCO_Reg_Step $reg_step_obj ) { |
|
349 | - $this->reg_steps[ $reg_step_obj->slug() ] = $reg_step_obj; |
|
348 | + public function add_reg_step(EE_SPCO_Reg_Step $reg_step_obj) { |
|
349 | + $this->reg_steps[$reg_step_obj->slug()] = $reg_step_obj; |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | |
@@ -362,22 +362,22 @@ discard block |
||
362 | 362 | * @return void |
363 | 363 | * @throws \EE_Error |
364 | 364 | */ |
365 | - public function skip_reg_step( $reg_step_slug = '' ) { |
|
366 | - $step_to_skip = $this->find_reg_step( $reg_step_slug ); |
|
367 | - if ( $step_to_skip instanceof EE_SPCO_Reg_Step && $step_to_skip->is_current_step() ) { |
|
368 | - $step_to_skip->set_is_current_step( false ); |
|
365 | + public function skip_reg_step($reg_step_slug = '') { |
|
366 | + $step_to_skip = $this->find_reg_step($reg_step_slug); |
|
367 | + if ($step_to_skip instanceof EE_SPCO_Reg_Step && $step_to_skip->is_current_step()) { |
|
368 | + $step_to_skip->set_is_current_step(false); |
|
369 | 369 | $step_to_skip->set_completed(); |
370 | 370 | // advance to the next step |
371 | - $this->set_current_step( $this->next_step->slug() ); |
|
371 | + $this->set_current_step($this->next_step->slug()); |
|
372 | 372 | // also reset the step param in the request in case any other code references that directly |
373 | - EE_Registry::instance()->REQ->set( 'step', $this->current_step->slug() ); |
|
373 | + EE_Registry::instance()->REQ->set('step', $this->current_step->slug()); |
|
374 | 374 | // since we are skipping a step and setting the current step to be what was previously the next step, |
375 | 375 | // we need to check that the next step is now correct, and not still set to the current step. |
376 | - if ( $this->current_step->slug() === $this->next_step->slug() ) { |
|
376 | + if ($this->current_step->slug() === $this->next_step->slug()) { |
|
377 | 377 | // correctly setup the next step |
378 | 378 | $this->set_next_step(); |
379 | 379 | } |
380 | - $this->set_reg_step_initiated( $this->current_step ); |
|
380 | + $this->set_reg_step_initiated($this->current_step); |
|
381 | 381 | } |
382 | 382 | } |
383 | 383 | |
@@ -391,14 +391,14 @@ discard block |
||
391 | 391 | * @param bool $reset whether to reset reg steps after removal |
392 | 392 | * @throws EE_Error |
393 | 393 | */ |
394 | - public function remove_reg_step( $reg_step_slug = '', $reset = true ) { |
|
395 | - unset( $this->reg_steps[ $reg_step_slug ] ); |
|
396 | - if ( $this->transaction instanceof EE_Transaction ) { |
|
394 | + public function remove_reg_step($reg_step_slug = '', $reset = true) { |
|
395 | + unset($this->reg_steps[$reg_step_slug]); |
|
396 | + if ($this->transaction instanceof EE_Transaction) { |
|
397 | 397 | // now remove reg step from TXN and save |
398 | - $this->transaction->remove_reg_step( $reg_step_slug ); |
|
398 | + $this->transaction->remove_reg_step($reg_step_slug); |
|
399 | 399 | $this->transaction->save(); |
400 | 400 | } |
401 | - if ( $reset ) { |
|
401 | + if ($reset) { |
|
402 | 402 | $this->reset_reg_steps(); |
403 | 403 | } |
404 | 404 | } |
@@ -413,9 +413,9 @@ discard block |
||
413 | 413 | * @param int $order |
414 | 414 | * @return void |
415 | 415 | */ |
416 | - public function set_reg_step_order( $reg_step_slug = '', $order = 100 ) { |
|
417 | - if ( isset( $this->reg_steps[ $reg_step_slug ] )) { |
|
418 | - $this->reg_steps[ $reg_step_slug ]->set_order( $order ); |
|
416 | + public function set_reg_step_order($reg_step_slug = '', $order = 100) { |
|
417 | + if (isset($this->reg_steps[$reg_step_slug])) { |
|
418 | + $this->reg_steps[$reg_step_slug]->set_order($order); |
|
419 | 419 | } |
420 | 420 | } |
421 | 421 | |
@@ -428,25 +428,25 @@ discard block |
||
428 | 428 | * @param string $current_step |
429 | 429 | * @return void |
430 | 430 | */ |
431 | - public function set_current_step( $current_step ) { |
|
431 | + public function set_current_step($current_step) { |
|
432 | 432 | // grab what step we're on |
433 | - $this->current_step = isset( $this->reg_steps[ $current_step ] ) ? $this->reg_steps[ $current_step ] : reset( $this->reg_steps ); |
|
433 | + $this->current_step = isset($this->reg_steps[$current_step]) ? $this->reg_steps[$current_step] : reset($this->reg_steps); |
|
434 | 434 | // verify instance |
435 | - if ( $this->current_step instanceof EE_SPCO_Reg_Step ) { |
|
435 | + if ($this->current_step instanceof EE_SPCO_Reg_Step) { |
|
436 | 436 | // we don't want to repeat completed steps if this is the first time through SPCO |
437 | - if ( $this->continue_reg && ! $this->revisit && $this->current_step->completed() ) { |
|
437 | + if ($this->continue_reg && ! $this->revisit && $this->current_step->completed()) { |
|
438 | 438 | // so advance to the next step |
439 | 439 | $this->set_next_step(); |
440 | - if ( $this->next_step instanceof EE_SPCO_Reg_Step ) { |
|
440 | + if ($this->next_step instanceof EE_SPCO_Reg_Step) { |
|
441 | 441 | // and attempt to set it as the current step |
442 | - $this->set_current_step( $this->next_step->slug() ); |
|
442 | + $this->set_current_step($this->next_step->slug()); |
|
443 | 443 | } |
444 | 444 | return; |
445 | 445 | } |
446 | - $this->current_step->set_is_current_step( TRUE ); |
|
446 | + $this->current_step->set_is_current_step(TRUE); |
|
447 | 447 | } else { |
448 | 448 | EE_Error::add_error( |
449 | - __( 'The current step could not be set.', 'event_espresso' ), |
|
449 | + __('The current step could not be set.', 'event_espresso'), |
|
450 | 450 | __FILE__, __FUNCTION__, __LINE__ |
451 | 451 | ); |
452 | 452 | } |
@@ -463,20 +463,20 @@ discard block |
||
463 | 463 | */ |
464 | 464 | public function set_next_step() { |
465 | 465 | // set pointer to start of array |
466 | - reset( $this->reg_steps ); |
|
466 | + reset($this->reg_steps); |
|
467 | 467 | // if there is more than one step |
468 | - if ( count( $this->reg_steps ) > 1 ) { |
|
468 | + if (count($this->reg_steps) > 1) { |
|
469 | 469 | // advance to the current step and set pointer |
470 | - while ( key( $this->reg_steps ) !== $this->current_step->slug() && key( $this->reg_steps ) !== '' ) { |
|
471 | - next( $this->reg_steps ); |
|
470 | + while (key($this->reg_steps) !== $this->current_step->slug() && key($this->reg_steps) !== '') { |
|
471 | + next($this->reg_steps); |
|
472 | 472 | } |
473 | 473 | } |
474 | 474 | // advance one more spot ( if it exists ) |
475 | - $this->next_step = next( $this->reg_steps ); |
|
475 | + $this->next_step = next($this->reg_steps); |
|
476 | 476 | // verify instance |
477 | - $this->next_step = $this->next_step instanceof EE_SPCO_Reg_Step ? $this->next_step : NULL; |
|
477 | + $this->next_step = $this->next_step instanceof EE_SPCO_Reg_Step ? $this->next_step : NULL; |
|
478 | 478 | // then back to current step to reset |
479 | - prev( $this->reg_steps ); |
|
479 | + prev($this->reg_steps); |
|
480 | 480 | } |
481 | 481 | |
482 | 482 | |
@@ -490,8 +490,8 @@ discard block |
||
490 | 490 | * @return EE_SPCO_Reg_Step | null |
491 | 491 | */ |
492 | 492 | public function get_next_reg_step() { |
493 | - $next = next( $this->reg_steps ); |
|
494 | - prev( $this->reg_steps ); |
|
493 | + $next = next($this->reg_steps); |
|
494 | + prev($this->reg_steps); |
|
495 | 495 | return $next instanceof EE_SPCO_Reg_Step ? $next : null; |
496 | 496 | } |
497 | 497 | |
@@ -506,8 +506,8 @@ discard block |
||
506 | 506 | * @return EE_SPCO_Reg_Step | null |
507 | 507 | */ |
508 | 508 | public function get_prev_reg_step() { |
509 | - $prev = prev( $this->reg_steps ); |
|
510 | - next( $this->reg_steps ); |
|
509 | + $prev = prev($this->reg_steps); |
|
510 | + next($this->reg_steps); |
|
511 | 511 | return $prev instanceof EE_SPCO_Reg_Step ? $prev : null; |
512 | 512 | } |
513 | 513 | |
@@ -520,8 +520,8 @@ discard block |
||
520 | 520 | * @return void |
521 | 521 | */ |
522 | 522 | public function sort_reg_steps() { |
523 | - $reg_step_sorting_callback = apply_filters( 'FHEE__EE_Checkout__sort_reg_steps__reg_step_sorting_callback', 'reg_step_sorting_callback' ); |
|
524 | - uasort( $this->reg_steps, array( $this, $reg_step_sorting_callback )); |
|
523 | + $reg_step_sorting_callback = apply_filters('FHEE__EE_Checkout__sort_reg_steps__reg_step_sorting_callback', 'reg_step_sorting_callback'); |
|
524 | + uasort($this->reg_steps, array($this, $reg_step_sorting_callback)); |
|
525 | 525 | } |
526 | 526 | |
527 | 527 | |
@@ -534,19 +534,19 @@ discard block |
||
534 | 534 | * @param string $reg_step_slug |
535 | 535 | * @return EE_SPCO_Reg_Step|null |
536 | 536 | */ |
537 | - public function find_reg_step( $reg_step_slug = '' ) { |
|
538 | - if ( ! empty( $reg_step_slug ) ) { |
|
537 | + public function find_reg_step($reg_step_slug = '') { |
|
538 | + if ( ! empty($reg_step_slug)) { |
|
539 | 539 | // copy reg step array |
540 | 540 | $reg_steps = $this->reg_steps; |
541 | 541 | // set pointer to start of array |
542 | - reset( $reg_steps ); |
|
542 | + reset($reg_steps); |
|
543 | 543 | // if there is more than one step |
544 | - if ( count( $reg_steps ) > 1 ) { |
|
544 | + if (count($reg_steps) > 1) { |
|
545 | 545 | // advance to the current step and set pointer |
546 | - while ( key( $reg_steps ) !== $reg_step_slug && key( $reg_steps ) !== '' ) { |
|
547 | - next( $reg_steps ); |
|
546 | + while (key($reg_steps) !== $reg_step_slug && key($reg_steps) !== '') { |
|
547 | + next($reg_steps); |
|
548 | 548 | } |
549 | - return current( $reg_steps ); |
|
549 | + return current($reg_steps); |
|
550 | 550 | } |
551 | 551 | } |
552 | 552 | return null; |
@@ -562,17 +562,17 @@ discard block |
||
562 | 562 | * @param EE_SPCO_Reg_Step $reg_step_B |
563 | 563 | * @return int |
564 | 564 | */ |
565 | - public function reg_step_sorting_callback( EE_SPCO_Reg_Step $reg_step_A, EE_SPCO_Reg_Step $reg_step_B ) { |
|
565 | + public function reg_step_sorting_callback(EE_SPCO_Reg_Step $reg_step_A, EE_SPCO_Reg_Step $reg_step_B) { |
|
566 | 566 | // send finalize_registration step to the end of the array |
567 | - if ( $reg_step_A->slug() === 'finalize_registration' ) { |
|
567 | + if ($reg_step_A->slug() === 'finalize_registration') { |
|
568 | 568 | return 1; |
569 | - } else if ( $reg_step_B->slug() === 'finalize_registration' ) { |
|
569 | + } else if ($reg_step_B->slug() === 'finalize_registration') { |
|
570 | 570 | return -1; |
571 | 571 | } |
572 | - if ( $reg_step_A->order() === $reg_step_B->order() ) { |
|
572 | + if ($reg_step_A->order() === $reg_step_B->order()) { |
|
573 | 573 | return 0; |
574 | 574 | } |
575 | - return ( $reg_step_A->order() > $reg_step_B->order() ) ? 1 : -1; |
|
575 | + return ($reg_step_A->order() > $reg_step_B->order()) ? 1 : -1; |
|
576 | 576 | } |
577 | 577 | |
578 | 578 | |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | * @param EE_SPCO_Reg_Step $reg_step |
585 | 585 | * @throws \EE_Error |
586 | 586 | */ |
587 | - public function set_reg_step_initiated( EE_SPCO_Reg_Step $reg_step ) { |
|
587 | + public function set_reg_step_initiated(EE_SPCO_Reg_Step $reg_step) { |
|
588 | 588 | // call set_reg_step_initiated ??? |
589 | 589 | if ( |
590 | 590 | // first time visiting SPCO ? |
@@ -597,11 +597,11 @@ discard block |
||
597 | 597 | ) |
598 | 598 | ) { |
599 | 599 | // set the start time for this reg step |
600 | - if ( ! $this->transaction->set_reg_step_initiated( $reg_step->slug() ) ) { |
|
601 | - if ( WP_DEBUG ) { |
|
600 | + if ( ! $this->transaction->set_reg_step_initiated($reg_step->slug())) { |
|
601 | + if (WP_DEBUG) { |
|
602 | 602 | EE_Error::add_error( |
603 | 603 | sprintf( |
604 | - __( 'The "%1$s" registration step was not initialized properly.', 'event_espresso' ), |
|
604 | + __('The "%1$s" registration step was not initialized properly.', 'event_espresso'), |
|
605 | 605 | $reg_step->name() |
606 | 606 | ), |
607 | 607 | __FILE__, __FUNCTION__, __LINE__ |
@@ -620,10 +620,10 @@ discard block |
||
620 | 620 | * @return void |
621 | 621 | */ |
622 | 622 | public function set_reg_step_JSON_info() { |
623 | - EE_Registry::$i18n_js_strings[ 'reg_steps' ] = array(); |
|
623 | + EE_Registry::$i18n_js_strings['reg_steps'] = array(); |
|
624 | 624 | // pass basic reg step data to JS |
625 | - foreach ( $this->reg_steps as $reg_step ) { |
|
626 | - EE_Registry::$i18n_js_strings[ 'reg_steps' ][] = $reg_step->slug(); |
|
625 | + foreach ($this->reg_steps as $reg_step) { |
|
626 | + EE_Registry::$i18n_js_strings['reg_steps'][] = $reg_step->slug(); |
|
627 | 627 | } |
628 | 628 | // reset reg step html |
629 | 629 | // $this->json_response->set_reg_step_html( '' ); |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | */ |
640 | 640 | public function reset_reg_steps() { |
641 | 641 | $this->sort_reg_steps(); |
642 | - $this->set_current_step( EE_Registry::instance()->REQ->get( 'step' )); |
|
642 | + $this->set_current_step(EE_Registry::instance()->REQ->get('step')); |
|
643 | 643 | $this->set_next_step(); |
644 | 644 | // the text that appears on the reg step form submit button |
645 | 645 | $this->current_step->set_submit_button_text(); |
@@ -656,9 +656,9 @@ discard block |
||
656 | 656 | */ |
657 | 657 | public function get_registration_time_limit() { |
658 | 658 | |
659 | - $registration_time_limit = (float)( EE_Registry::instance() ->SSN->expiration() - time() ); |
|
659 | + $registration_time_limit = (float) (EE_Registry::instance() ->SSN->expiration() - time()); |
|
660 | 660 | $time_limit_format = $registration_time_limit > 60 * MINUTE_IN_SECONDS ? 'H:i:s' : 'i:s'; |
661 | - $registration_time_limit = date( $time_limit_format, $registration_time_limit ); |
|
661 | + $registration_time_limit = date($time_limit_format, $registration_time_limit); |
|
662 | 662 | return apply_filters( |
663 | 663 | 'FHEE__EE_Checkout__get_registration_time_limit__registration_time_limit', |
664 | 664 | $registration_time_limit |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | // overpaid TXN |
679 | 679 | // free TXN ( total = 0.00 ) |
680 | 680 | // then payment required is TRUE |
681 | - return ! ( $this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free() ) ? TRUE : FALSE; |
|
681 | + return ! ($this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free()) ? TRUE : FALSE; |
|
682 | 682 | } |
683 | 683 | |
684 | 684 | |
@@ -690,12 +690,12 @@ discard block |
||
690 | 690 | * @param EE_Transaction $transaction |
691 | 691 | * @return EE_Cart |
692 | 692 | */ |
693 | - public function get_cart_for_transaction( $transaction ) { |
|
694 | - $session = EE_Registry::instance()->load_core( 'Session' ); |
|
695 | - $cart = $transaction instanceof EE_Transaction ? EE_Cart::get_cart_from_txn( $transaction, $session ) : null; |
|
693 | + public function get_cart_for_transaction($transaction) { |
|
694 | + $session = EE_Registry::instance()->load_core('Session'); |
|
695 | + $cart = $transaction instanceof EE_Transaction ? EE_Cart::get_cart_from_txn($transaction, $session) : null; |
|
696 | 696 | // verify cart |
697 | - if ( ! $cart instanceof EE_Cart ) { |
|
698 | - $cart = EE_Registry::instance()->load_core( 'Cart' ); |
|
697 | + if ( ! $cart instanceof EE_Cart) { |
|
698 | + $cart = EE_Registry::instance()->load_core('Cart'); |
|
699 | 699 | } |
700 | 700 | |
701 | 701 | return $cart; |
@@ -711,8 +711,8 @@ discard block |
||
711 | 711 | */ |
712 | 712 | public function initialize_txn_reg_steps_array() { |
713 | 713 | $txn_reg_steps_array = array(); |
714 | - foreach ( $this->reg_steps as $reg_step ) { |
|
715 | - $txn_reg_steps_array[ $reg_step->slug() ] = FALSE; |
|
714 | + foreach ($this->reg_steps as $reg_step) { |
|
715 | + $txn_reg_steps_array[$reg_step->slug()] = FALSE; |
|
716 | 716 | } |
717 | 717 | return $txn_reg_steps_array; |
718 | 718 | } |
@@ -728,14 +728,14 @@ discard block |
||
728 | 728 | */ |
729 | 729 | public function update_txn_reg_steps_array() { |
730 | 730 | $updated = false; |
731 | - foreach ( $this->reg_steps as $reg_step ) { |
|
732 | - if ( $reg_step->completed() ) { |
|
733 | - $updated = $this->transaction->set_reg_step_completed( $reg_step->slug() ) |
|
731 | + foreach ($this->reg_steps as $reg_step) { |
|
732 | + if ($reg_step->completed()) { |
|
733 | + $updated = $this->transaction->set_reg_step_completed($reg_step->slug()) |
|
734 | 734 | ? true |
735 | 735 | : $updated; |
736 | 736 | } |
737 | 737 | } |
738 | - if ( $updated ) { |
|
738 | + if ($updated) { |
|
739 | 739 | $this->transaction->save(); |
740 | 740 | } |
741 | 741 | return $updated; |
@@ -751,14 +751,14 @@ discard block |
||
751 | 751 | * @throws \EE_Error |
752 | 752 | */ |
753 | 753 | public function stash_transaction_and_checkout() { |
754 | - if ( ! $this->revisit ) { |
|
754 | + if ( ! $this->revisit) { |
|
755 | 755 | $this->update_txn_reg_steps_array(); |
756 | 756 | } |
757 | 757 | $this->track_transaction_and_registration_status_updates(); |
758 | 758 | // save all data to the db, but suppress errors |
759 | 759 | //$this->save_all_data( FALSE ); |
760 | 760 | // cache the checkout in the session |
761 | - EE_Registry::instance()->SSN->set_checkout( $this ); |
|
761 | + EE_Registry::instance()->SSN->set_checkout($this); |
|
762 | 762 | } |
763 | 763 | |
764 | 764 | |
@@ -773,15 +773,15 @@ discard block |
||
773 | 773 | */ |
774 | 774 | public function track_transaction_and_registration_status_updates() { |
775 | 775 | // verify the transaction |
776 | - if ( $this->transaction instanceof EE_Transaction ) { |
|
776 | + if ($this->transaction instanceof EE_Transaction) { |
|
777 | 777 | // has there been a TXN status change during this checkout? |
778 | 778 | $this->txn_status_updated = $this->transaction->txn_status_updated(); |
779 | 779 | /** @type EE_Registration_Processor $registration_processor */ |
780 | - $registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' ); |
|
780 | + $registration_processor = EE_Registry::instance()->load_class('Registration_Processor'); |
|
781 | 781 | // grab the saved registrations from the transaction |
782 | - foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $registration ) { |
|
783 | - if ( $registration_processor->reg_status_updated( $registration->ID() ) ) { |
|
784 | - $this->set_reg_status_updated( $registration->ID(), true ); |
|
782 | + foreach ($this->transaction->registrations($this->reg_cache_where_params) as $registration) { |
|
783 | + if ($registration_processor->reg_status_updated($registration->ID())) { |
|
784 | + $this->set_reg_status_updated($registration->ID(), true); |
|
785 | 785 | } |
786 | 786 | } |
787 | 787 | } |
@@ -802,7 +802,7 @@ discard block |
||
802 | 802 | * @return bool |
803 | 803 | * @throws \EE_Error |
804 | 804 | */ |
805 | - public function visit_allows_processing_of_this_registration( EE_Registration $registration ) { |
|
805 | + public function visit_allows_processing_of_this_registration(EE_Registration $registration) { |
|
806 | 806 | return ! $this->revisit |
807 | 807 | || $this->primary_revisit |
808 | 808 | || ( |
@@ -835,18 +835,18 @@ discard block |
||
835 | 835 | * @return bool |
836 | 836 | * @throws \EE_Error |
837 | 837 | */ |
838 | - public function save_all_data( $show_errors = TRUE ) { |
|
838 | + public function save_all_data($show_errors = TRUE) { |
|
839 | 839 | // verify the transaction |
840 | - if ( $this->transaction instanceof EE_Transaction ) { |
|
840 | + if ($this->transaction instanceof EE_Transaction) { |
|
841 | 841 | // save to ensure that TXN has ID |
842 | 842 | $this->transaction->save(); |
843 | 843 | // grab the saved registrations from the transaction |
844 | - foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $registration ) { |
|
845 | - $this->_save_registration( $registration, $show_errors ); |
|
844 | + foreach ($this->transaction->registrations($this->reg_cache_where_params) as $registration) { |
|
845 | + $this->_save_registration($registration, $show_errors); |
|
846 | 846 | } |
847 | 847 | } else { |
848 | - if ( $show_errors ) { |
|
849 | - EE_Error::add_error( __( 'A valid Transaction was not found when attempting to save your registration information.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
848 | + if ($show_errors) { |
|
849 | + EE_Error::add_error(__('A valid Transaction was not found when attempting to save your registration information.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
850 | 850 | } |
851 | 851 | return FALSE; |
852 | 852 | } |
@@ -863,32 +863,32 @@ discard block |
||
863 | 863 | * @return void |
864 | 864 | * @throws \EE_Error |
865 | 865 | */ |
866 | - private function _save_registration( $registration, $show_errors = TRUE ) { |
|
866 | + private function _save_registration($registration, $show_errors = TRUE) { |
|
867 | 867 | // verify object |
868 | - if ( $registration instanceof EE_Registration ) { |
|
868 | + if ($registration instanceof EE_Registration) { |
|
869 | 869 | // should this registration be processed during this visit ? |
870 | - if ( $this->visit_allows_processing_of_this_registration( $registration ) ) { |
|
870 | + if ($this->visit_allows_processing_of_this_registration($registration)) { |
|
871 | 871 | //set TXN ID |
872 | - if ( ! $registration->transaction_ID() ) { |
|
873 | - $registration->set_transaction_id( $this->transaction->ID() ); |
|
872 | + if ( ! $registration->transaction_ID()) { |
|
873 | + $registration->set_transaction_id($this->transaction->ID()); |
|
874 | 874 | } |
875 | 875 | // verify and save the attendee |
876 | - $this->_save_registration_attendee( $registration, $show_errors ); |
|
876 | + $this->_save_registration_attendee($registration, $show_errors); |
|
877 | 877 | // save answers to reg form questions |
878 | - $this->_save_registration_answers( $registration, $show_errors ); |
|
878 | + $this->_save_registration_answers($registration, $show_errors); |
|
879 | 879 | // save changes |
880 | 880 | $registration->save(); |
881 | 881 | // update txn cache |
882 | - if ( ! $this->transaction->update_cache_after_object_save( 'Registration', $registration )) { |
|
883 | - if ( $show_errors ) { |
|
884 | - EE_Error::add_error( __( 'The newly saved Registration object could not be cached on the Transaction.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
882 | + if ( ! $this->transaction->update_cache_after_object_save('Registration', $registration)) { |
|
883 | + if ($show_errors) { |
|
884 | + EE_Error::add_error(__('The newly saved Registration object could not be cached on the Transaction.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
885 | 885 | } |
886 | 886 | } |
887 | 887 | } |
888 | 888 | } else { |
889 | - if ( $show_errors ) { |
|
889 | + if ($show_errors) { |
|
890 | 890 | EE_Error::add_error( |
891 | - __( 'An invalid Registration object was discovered when attempting to save your registration information.', 'event_espresso' ), |
|
891 | + __('An invalid Registration object was discovered when attempting to save your registration information.', 'event_espresso'), |
|
892 | 892 | __FILE__, __FUNCTION__, __LINE__ |
893 | 893 | ); |
894 | 894 | } |
@@ -905,25 +905,25 @@ discard block |
||
905 | 905 | * @return void |
906 | 906 | * @throws \EE_Error |
907 | 907 | */ |
908 | - private function _save_registration_attendee( $registration, $show_errors = TRUE ) { |
|
909 | - if ( $registration->attendee() instanceof EE_Attendee ) { |
|
908 | + private function _save_registration_attendee($registration, $show_errors = TRUE) { |
|
909 | + if ($registration->attendee() instanceof EE_Attendee) { |
|
910 | 910 | // save so that ATT has ID |
911 | 911 | $registration->attendee()->save(); |
912 | - if ( ! $registration->update_cache_after_object_save( 'Attendee', $registration->attendee() ) ) { |
|
913 | - if ( $show_errors ) { |
|
912 | + if ( ! $registration->update_cache_after_object_save('Attendee', $registration->attendee())) { |
|
913 | + if ($show_errors) { |
|
914 | 914 | EE_Error::add_error( |
915 | - __( 'The newly saved Attendee object could not be cached on the registration.', 'event_espresso' ), |
|
915 | + __('The newly saved Attendee object could not be cached on the registration.', 'event_espresso'), |
|
916 | 916 | __FILE__, __FUNCTION__, __LINE__ |
917 | 917 | ); |
918 | 918 | } |
919 | 919 | } |
920 | 920 | } else { |
921 | - if ( $show_errors ) { |
|
921 | + if ($show_errors) { |
|
922 | 922 | EE_Error::add_error( |
923 | 923 | sprintf( |
924 | 924 | '%1$s||%1$s $attendee = %2$s', |
925 | - __( 'Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso' ), |
|
926 | - var_export( $registration->attendee(), true ) |
|
925 | + __('Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso'), |
|
926 | + var_export($registration->attendee(), true) |
|
927 | 927 | ), |
928 | 928 | __FILE__, __FUNCTION__, __LINE__ |
929 | 929 | ); |
@@ -941,25 +941,25 @@ discard block |
||
941 | 941 | * @return void |
942 | 942 | * @throws \EE_Error |
943 | 943 | */ |
944 | - private function _save_registration_answers( $registration, $show_errors = TRUE ) { |
|
944 | + private function _save_registration_answers($registration, $show_errors = TRUE) { |
|
945 | 945 | // now save the answers |
946 | - foreach ( $registration->answers() as $cache_key => $answer ) { |
|
946 | + foreach ($registration->answers() as $cache_key => $answer) { |
|
947 | 947 | // verify object |
948 | - if ( $answer instanceof EE_Answer ) { |
|
949 | - $answer->set_registration( $registration->ID() ); |
|
948 | + if ($answer instanceof EE_Answer) { |
|
949 | + $answer->set_registration($registration->ID()); |
|
950 | 950 | $answer->save(); |
951 | - if ( ! $registration->update_cache_after_object_save( 'Answer', $answer, $cache_key )) { |
|
952 | - if ( $show_errors ) { |
|
951 | + if ( ! $registration->update_cache_after_object_save('Answer', $answer, $cache_key)) { |
|
952 | + if ($show_errors) { |
|
953 | 953 | EE_Error::add_error( |
954 | - __( 'The newly saved Answer object could not be cached on the registration.', 'event_espresso' ), |
|
954 | + __('The newly saved Answer object could not be cached on the registration.', 'event_espresso'), |
|
955 | 955 | __FILE__, __FUNCTION__, __LINE__ |
956 | 956 | ); |
957 | 957 | } |
958 | 958 | } |
959 | 959 | } else { |
960 | - if ( $show_errors ) { |
|
960 | + if ($show_errors) { |
|
961 | 961 | EE_Error::add_error( |
962 | - __( 'An invalid Answer object was discovered when attempting to save your registration information.', 'event_espresso' ), |
|
962 | + __('An invalid Answer object was discovered when attempting to save your registration information.', 'event_espresso'), |
|
963 | 963 | __FILE__, __FUNCTION__, __LINE__ |
964 | 964 | ); |
965 | 965 | } |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | * @return bool |
979 | 979 | * @throws \EE_Error |
980 | 980 | */ |
981 | - public function refresh_all_entities( $from_db = false ) { |
|
981 | + public function refresh_all_entities($from_db = false) { |
|
982 | 982 | $from_db = $this->current_step->is_final_step() || $this->action === 'process_gateway_response' |
983 | 983 | ? true |
984 | 984 | : $from_db; |
@@ -1002,11 +1002,11 @@ discard block |
||
1002 | 1002 | */ |
1003 | 1003 | protected function refresh_from_db() { |
1004 | 1004 | // verify the transaction |
1005 | - if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) { |
|
1005 | + if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) { |
|
1006 | 1006 | // pull fresh TXN data from the db |
1007 | - $this->transaction = $this->transaction->get_model()->refresh_entity_map_from_db( $this->transaction->ID() ); |
|
1007 | + $this->transaction = $this->transaction->get_model()->refresh_entity_map_from_db($this->transaction->ID()); |
|
1008 | 1008 | // update EE_Checkout's cached primary_attendee object |
1009 | - $this->primary_attendee_obj = $this->_refresh_primary_attendee_obj_from_db( $this->transaction ); |
|
1009 | + $this->primary_attendee_obj = $this->_refresh_primary_attendee_obj_from_db($this->transaction); |
|
1010 | 1010 | // update EE_Checkout's cached payment object |
1011 | 1011 | $payment = $this->transaction->last_payment(); |
1012 | 1012 | $this->payment = $payment instanceof EE_Payment ? $payment : $this->payment; |
@@ -1014,9 +1014,9 @@ discard block |
||
1014 | 1014 | $payment_method = $this->payment instanceof EE_Payment ? $this->payment->payment_method() : null; |
1015 | 1015 | $this->payment_method = $payment_method instanceof EE_Payment_Method ? $payment_method : $this->payment_method; |
1016 | 1016 | //now refresh the cart, based on the TXN |
1017 | - $this->cart = $this->get_cart_for_transaction( $this->transaction ); |
|
1017 | + $this->cart = $this->get_cart_for_transaction($this->transaction); |
|
1018 | 1018 | } else { |
1019 | - EE_Error::add_error( __( 'A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
1019 | + EE_Error::add_error(__('A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1020 | 1020 | return FALSE; |
1021 | 1021 | } |
1022 | 1022 | return TRUE; |
@@ -1031,21 +1031,21 @@ discard block |
||
1031 | 1031 | * @return EE_Attendee | null |
1032 | 1032 | * @throws \EE_Error |
1033 | 1033 | */ |
1034 | - protected function _refresh_primary_attendee_obj_from_db( EE_Transaction $transaction ) { |
|
1034 | + protected function _refresh_primary_attendee_obj_from_db(EE_Transaction $transaction) { |
|
1035 | 1035 | |
1036 | 1036 | $primary_attendee_obj = null; |
1037 | 1037 | // grab the saved registrations from the transaction |
1038 | - foreach ( $transaction->registrations( $this->reg_cache_where_params, true ) as $registration ) { |
|
1038 | + foreach ($transaction->registrations($this->reg_cache_where_params, true) as $registration) { |
|
1039 | 1039 | // verify object |
1040 | - if ( $registration instanceof EE_Registration ) { |
|
1040 | + if ($registration instanceof EE_Registration) { |
|
1041 | 1041 | $attendee = $registration->attendee(); |
1042 | 1042 | // verify object && maybe cache primary_attendee_obj ? |
1043 | - if ( $attendee instanceof EE_Attendee&& $registration->is_primary_registrant() ) { |
|
1043 | + if ($attendee instanceof EE_Attendee && $registration->is_primary_registrant()) { |
|
1044 | 1044 | $primary_attendee_obj = $attendee; |
1045 | 1045 | } |
1046 | 1046 | } else { |
1047 | 1047 | EE_Error::add_error( |
1048 | - __( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ), |
|
1048 | + __('An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso'), |
|
1049 | 1049 | __FILE__, __FUNCTION__, __LINE__ |
1050 | 1050 | ); |
1051 | 1051 | } |
@@ -1066,43 +1066,43 @@ discard block |
||
1066 | 1066 | */ |
1067 | 1067 | protected function refresh_entity_map() { |
1068 | 1068 | // verify the transaction |
1069 | - if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) { |
|
1069 | + if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) { |
|
1070 | 1070 | // never cache payment info |
1071 | - $this->transaction->clear_cache( 'Payment' ); |
|
1071 | + $this->transaction->clear_cache('Payment'); |
|
1072 | 1072 | // is the Payment Options Reg Step completed ? |
1073 | - if ( $this->transaction->reg_step_completed( 'payment_options' ) ) { |
|
1073 | + if ($this->transaction->reg_step_completed('payment_options')) { |
|
1074 | 1074 | // then check for payments and update TXN accordingly |
1075 | 1075 | /** @type EE_Transaction_Payments $transaction_payments */ |
1076 | - $transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' ); |
|
1077 | - $transaction_payments->calculate_total_payments_and_update_status( $this->transaction ); |
|
1076 | + $transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments'); |
|
1077 | + $transaction_payments->calculate_total_payments_and_update_status($this->transaction); |
|
1078 | 1078 | } |
1079 | 1079 | // grab the saved registrations from the transaction |
1080 | 1080 | foreach ( |
1081 | - $this->transaction->registrations( $this->reg_cache_where_params ) as $reg_cache_ID => $registration |
|
1081 | + $this->transaction->registrations($this->reg_cache_where_params) as $reg_cache_ID => $registration |
|
1082 | 1082 | ) { |
1083 | - $this->_refresh_registration( $reg_cache_ID, $registration ); |
|
1083 | + $this->_refresh_registration($reg_cache_ID, $registration); |
|
1084 | 1084 | } |
1085 | 1085 | // make sure our cached TXN is added to the model entity mapper |
1086 | - $this->transaction = $this->transaction->get_model()->refresh_entity_map_with( $this->transaction->ID(), $this->transaction ); |
|
1086 | + $this->transaction = $this->transaction->get_model()->refresh_entity_map_with($this->transaction->ID(), $this->transaction); |
|
1087 | 1087 | |
1088 | 1088 | } else { |
1089 | - EE_Error::add_error( __( 'A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
1089 | + EE_Error::add_error(__('A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1090 | 1090 | return FALSE; |
1091 | 1091 | } |
1092 | 1092 | // verify and update the cart because inaccurate totals are not so much fun |
1093 | - if ( $this->cart instanceof EE_Cart ) { |
|
1093 | + if ($this->cart instanceof EE_Cart) { |
|
1094 | 1094 | $grand_total = $this->cart->get_grand_total(); |
1095 | - if ( $grand_total instanceof EE_Line_Item && $grand_total->ID() ) { |
|
1095 | + if ($grand_total instanceof EE_Line_Item && $grand_total->ID()) { |
|
1096 | 1096 | $grand_total->recalculate_total_including_taxes(); |
1097 | 1097 | $grand_total = $grand_total->get_model()->refresh_entity_map_with( |
1098 | 1098 | $this->cart->get_grand_total()->ID(), |
1099 | 1099 | $this->cart->get_grand_total() |
1100 | 1100 | ); |
1101 | 1101 | } |
1102 | - if ( $grand_total instanceof EE_Line_Item ) { |
|
1103 | - $this->cart = EE_Cart::instance( $grand_total ); |
|
1102 | + if ($grand_total instanceof EE_Line_Item) { |
|
1103 | + $this->cart = EE_Cart::instance($grand_total); |
|
1104 | 1104 | } else { |
1105 | - EE_Error::add_error( __( 'A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
1105 | + EE_Error::add_error(__('A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1106 | 1106 | return false; |
1107 | 1107 | } |
1108 | 1108 | } |
@@ -1119,19 +1119,19 @@ discard block |
||
1119 | 1119 | * @return void |
1120 | 1120 | * @throws \EE_Error |
1121 | 1121 | */ |
1122 | - protected function _refresh_registration( $reg_cache_ID, $registration ) { |
|
1122 | + protected function _refresh_registration($reg_cache_ID, $registration) { |
|
1123 | 1123 | |
1124 | 1124 | // verify object |
1125 | - if ( $registration instanceof EE_Registration ) { |
|
1125 | + if ($registration instanceof EE_Registration) { |
|
1126 | 1126 | // update the entity mapper attendee |
1127 | - $this->_refresh_registration_attendee( $registration ); |
|
1127 | + $this->_refresh_registration_attendee($registration); |
|
1128 | 1128 | // update the entity mapper answers for reg form questions |
1129 | - $this->_refresh_registration_answers( $registration ); |
|
1129 | + $this->_refresh_registration_answers($registration); |
|
1130 | 1130 | // make sure the cached registration is added to the model entity mapper |
1131 | - $registration->get_model()->refresh_entity_map_with( $reg_cache_ID, $registration ); |
|
1131 | + $registration->get_model()->refresh_entity_map_with($reg_cache_ID, $registration); |
|
1132 | 1132 | } else { |
1133 | 1133 | EE_Error::add_error( |
1134 | - __( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ), |
|
1134 | + __('An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso'), |
|
1135 | 1135 | __FILE__, __FUNCTION__, __LINE__ |
1136 | 1136 | ); |
1137 | 1137 | } |
@@ -1146,15 +1146,15 @@ discard block |
||
1146 | 1146 | * @return void |
1147 | 1147 | * @throws \EE_Error |
1148 | 1148 | */ |
1149 | - protected function _refresh_registration_attendee( $registration ) { |
|
1149 | + protected function _refresh_registration_attendee($registration) { |
|
1150 | 1150 | |
1151 | 1151 | $attendee = $registration->attendee(); |
1152 | 1152 | // verify object |
1153 | - if ( $attendee instanceof EE_Attendee && $attendee->ID() ) { |
|
1153 | + if ($attendee instanceof EE_Attendee && $attendee->ID()) { |
|
1154 | 1154 | // make sure the cached attendee is added to the model entity mapper |
1155 | - $registration->attendee()->get_model()->refresh_entity_map_with( $attendee->ID(), $attendee ); |
|
1155 | + $registration->attendee()->get_model()->refresh_entity_map_with($attendee->ID(), $attendee); |
|
1156 | 1156 | // maybe cache primary_attendee_obj ? |
1157 | - if ( $registration->is_primary_registrant() ) { |
|
1157 | + if ($registration->is_primary_registrant()) { |
|
1158 | 1158 | $this->primary_attendee_obj = $attendee; |
1159 | 1159 | } |
1160 | 1160 | } |
@@ -1169,19 +1169,19 @@ discard block |
||
1169 | 1169 | * @return void |
1170 | 1170 | * @throws \EE_Error |
1171 | 1171 | */ |
1172 | - protected function _refresh_registration_answers( $registration ) { |
|
1172 | + protected function _refresh_registration_answers($registration) { |
|
1173 | 1173 | |
1174 | 1174 | // now update the answers |
1175 | - foreach ( $registration->answers() as $cache_key => $answer ) { |
|
1175 | + foreach ($registration->answers() as $cache_key => $answer) { |
|
1176 | 1176 | // verify object |
1177 | - if ( $answer instanceof EE_Answer ) { |
|
1178 | - if ( $answer->ID() ) { |
|
1177 | + if ($answer instanceof EE_Answer) { |
|
1178 | + if ($answer->ID()) { |
|
1179 | 1179 | // make sure the cached answer is added to the model entity mapper |
1180 | - $answer->get_model()->refresh_entity_map_with( $answer->ID(), $answer ); |
|
1180 | + $answer->get_model()->refresh_entity_map_with($answer->ID(), $answer); |
|
1181 | 1181 | } |
1182 | 1182 | } else { |
1183 | 1183 | EE_Error::add_error( |
1184 | - __( 'An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso' ), |
|
1184 | + __('An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso'), |
|
1185 | 1185 | __FILE__, __FUNCTION__, __LINE__ |
1186 | 1186 | ); |
1187 | 1187 | } |
@@ -1201,13 +1201,13 @@ discard block |
||
1201 | 1201 | */ |
1202 | 1202 | public function __sleep() |
1203 | 1203 | { |
1204 | - if ( $this->primary_attendee_obj instanceof EE_Attendee && $this->primary_attendee_obj->ID() ) { |
|
1204 | + if ($this->primary_attendee_obj instanceof EE_Attendee && $this->primary_attendee_obj->ID()) { |
|
1205 | 1205 | $this->primary_attendee_obj = $this->primary_attendee_obj->ID(); |
1206 | 1206 | } // remove the reg form and the checkout |
1207 | - if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) { |
|
1207 | + if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) { |
|
1208 | 1208 | $this->transaction = $this->transaction->ID(); |
1209 | 1209 | } // remove the reg form and the checkout |
1210 | - return array_diff( array_keys( get_object_vars( $this ) ), array( 'billing_form', 'registration_form' ) ); |
|
1210 | + return array_diff(array_keys(get_object_vars($this)), array('billing_form', 'registration_form')); |
|
1211 | 1211 | } |
1212 | 1212 | |
1213 | 1213 | |
@@ -1217,15 +1217,15 @@ discard block |
||
1217 | 1217 | * this will reinstate the EE_Checkout object on each EE_SPCO_Reg_Step object |
1218 | 1218 | */ |
1219 | 1219 | public function __wakeup() { |
1220 | - if ( ! $this->primary_attendee_obj instanceof EE_Attendee && absint( $this->primary_attendee_obj ) !== 0 ) { |
|
1220 | + if ( ! $this->primary_attendee_obj instanceof EE_Attendee && absint($this->primary_attendee_obj) !== 0) { |
|
1221 | 1221 | // $this->primary_attendee_obj is actually just an ID, so use it to get the object from the db |
1222 | - $this->primary_attendee_obj = EEM_Attendee::instance()->get_one_by_ID( $this->primary_attendee_obj ); |
|
1222 | + $this->primary_attendee_obj = EEM_Attendee::instance()->get_one_by_ID($this->primary_attendee_obj); |
|
1223 | 1223 | } |
1224 | - if ( ! $this->transaction instanceof EE_Transaction && absint( $this->transaction ) !== 0 ) { |
|
1224 | + if ( ! $this->transaction instanceof EE_Transaction && absint($this->transaction) !== 0) { |
|
1225 | 1225 | // $this->transaction is actually just an ID, so use it to get the object from the db |
1226 | - $this->transaction = EEM_Transaction::instance()->get_one_by_ID( $this->transaction ); |
|
1226 | + $this->transaction = EEM_Transaction::instance()->get_one_by_ID($this->transaction); |
|
1227 | 1227 | } |
1228 | - foreach ( $this->reg_steps as $reg_step ) { |
|
1228 | + foreach ($this->reg_steps as $reg_step) { |
|
1229 | 1229 | $reg_step->checkout = $this; |
1230 | 1230 | } |
1231 | 1231 | } |
@@ -1242,12 +1242,12 @@ discard block |
||
1242 | 1242 | * @param bool $display_request |
1243 | 1243 | * @throws \EE_Error |
1244 | 1244 | */ |
1245 | - public function log( $class = '', $func = '', $line = '', $info = array(), $display_request = false ) { |
|
1245 | + public function log($class = '', $func = '', $line = '', $info = array(), $display_request = false) { |
|
1246 | 1246 | $disabled = true; |
1247 | - if ( WP_DEBUG && ! $disabled ) { |
|
1248 | - $debug_data = get_option( 'EE_DEBUG_SPCO_' . EE_Session::instance()->id(), array() ); |
|
1247 | + if (WP_DEBUG && ! $disabled) { |
|
1248 | + $debug_data = get_option('EE_DEBUG_SPCO_'.EE_Session::instance()->id(), array()); |
|
1249 | 1249 | $default_data = array( |
1250 | - $class => $func . '() : ' . $line, |
|
1250 | + $class => $func.'() : '.$line, |
|
1251 | 1251 | 'request->step' => $this->step, |
1252 | 1252 | 'request->action' => $this->action, |
1253 | 1253 | 'current_step->slug' => $this->current_step instanceof EE_SPCO_Reg_Step ? |
@@ -1259,24 +1259,24 @@ discard block |
||
1259 | 1259 | 'reg_url_link' => $this->reg_url_link, |
1260 | 1260 | 'REQ' => $display_request ? $_REQUEST : '', |
1261 | 1261 | ); |
1262 | - if ( $this->transaction instanceof EE_Transaction ) { |
|
1263 | - $default_data[ 'TXN_status' ] = $this->transaction->status_ID(); |
|
1264 | - $default_data[ 'TXN_reg_steps' ] = $this->transaction->reg_steps(); |
|
1265 | - foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $REG_ID => $registration ) { |
|
1266 | - $default_data[ 'registrations' ][ $REG_ID ] = $registration->status_ID(); |
|
1262 | + if ($this->transaction instanceof EE_Transaction) { |
|
1263 | + $default_data['TXN_status'] = $this->transaction->status_ID(); |
|
1264 | + $default_data['TXN_reg_steps'] = $this->transaction->reg_steps(); |
|
1265 | + foreach ($this->transaction->registrations($this->reg_cache_where_params) as $REG_ID => $registration) { |
|
1266 | + $default_data['registrations'][$REG_ID] = $registration->status_ID(); |
|
1267 | 1267 | } |
1268 | - if ( $this->transaction->ID() ) { |
|
1269 | - $TXN_ID = 'EE_Transaction: ' . $this->transaction->ID(); |
|
1268 | + if ($this->transaction->ID()) { |
|
1269 | + $TXN_ID = 'EE_Transaction: '.$this->transaction->ID(); |
|
1270 | 1270 | // don't serialize objects |
1271 | - $info = $this->_strip_objects( $info ); |
|
1272 | - if ( ! isset( $debug_data[ $TXN_ID ] ) ) { |
|
1273 | - $debug_data[ $TXN_ID ] = array(); |
|
1271 | + $info = $this->_strip_objects($info); |
|
1272 | + if ( ! isset($debug_data[$TXN_ID])) { |
|
1273 | + $debug_data[$TXN_ID] = array(); |
|
1274 | 1274 | } |
1275 | - $debug_data[ $TXN_ID ][ microtime() ] = array_merge( |
|
1275 | + $debug_data[$TXN_ID][microtime()] = array_merge( |
|
1276 | 1276 | $default_data, |
1277 | 1277 | $info |
1278 | 1278 | ); |
1279 | - update_option( 'EE_DEBUG_SPCO_' . EE_Session::instance()->id(), $debug_data ); |
|
1279 | + update_option('EE_DEBUG_SPCO_'.EE_Session::instance()->id(), $debug_data); |
|
1280 | 1280 | } |
1281 | 1281 | } |
1282 | 1282 | } |
@@ -1289,23 +1289,23 @@ discard block |
||
1289 | 1289 | * @param array $info |
1290 | 1290 | * @return array |
1291 | 1291 | */ |
1292 | - public function _strip_objects( $info = array() ) { |
|
1293 | - foreach ( (array)$info as $key => $value ) { |
|
1294 | - if ( is_array( $value )) { |
|
1295 | - $info[ $key ] = $this->_strip_objects( $value ); |
|
1296 | - } else if ( is_object( $value ) ) { |
|
1297 | - $object_class = get_class( $value ); |
|
1298 | - $info[ $object_class ] = array(); |
|
1299 | - $info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0; |
|
1300 | - if ( method_exists( $value, 'status' ) ) { |
|
1301 | - $info[ $object_class ][ 'status' ] = $value->status(); |
|
1302 | - } else if ( method_exists( $value, 'status_ID' ) ) { |
|
1303 | - $info[ $object_class ][ 'status' ] = $value->status_ID(); |
|
1292 | + public function _strip_objects($info = array()) { |
|
1293 | + foreach ((array) $info as $key => $value) { |
|
1294 | + if (is_array($value)) { |
|
1295 | + $info[$key] = $this->_strip_objects($value); |
|
1296 | + } else if (is_object($value)) { |
|
1297 | + $object_class = get_class($value); |
|
1298 | + $info[$object_class] = array(); |
|
1299 | + $info[$object_class]['ID'] = method_exists($value, 'ID') ? $value->ID() : 0; |
|
1300 | + if (method_exists($value, 'status')) { |
|
1301 | + $info[$object_class]['status'] = $value->status(); |
|
1302 | + } else if (method_exists($value, 'status_ID')) { |
|
1303 | + $info[$object_class]['status'] = $value->status_ID(); |
|
1304 | 1304 | } |
1305 | - unset( $info[ $key ] ); |
|
1305 | + unset($info[$key]); |
|
1306 | 1306 | } |
1307 | 1307 | } |
1308 | - return (array)$info; |
|
1308 | + return (array) $info; |
|
1309 | 1309 | } |
1310 | 1310 | |
1311 | 1311 |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | use EventEspresso\core\domain\services\ticket\CancelTicketLineItemService; |
5 | 5 | |
6 | 6 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
7 | - exit('No direct script access allowed'); |
|
7 | + exit('No direct script access allowed'); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | |
@@ -21,22 +21,22 @@ discard block |
||
21 | 21 | class CancelRegistrationService |
22 | 22 | { |
23 | 23 | |
24 | - /** |
|
25 | - * @var CancelTicketLineItemService $cancel_ticket_line_item_service |
|
26 | - */ |
|
27 | - private $cancel_ticket_line_item_service; |
|
24 | + /** |
|
25 | + * @var CancelTicketLineItemService $cancel_ticket_line_item_service |
|
26 | + */ |
|
27 | + private $cancel_ticket_line_item_service; |
|
28 | 28 | |
29 | 29 | |
30 | 30 | |
31 | - /** |
|
32 | - * Command constructor |
|
33 | - * |
|
34 | - * @param CancelTicketLineItemService $cancel_ticket_line_item_service |
|
35 | - */ |
|
36 | - public function __construct(CancelTicketLineItemService $cancel_ticket_line_item_service) |
|
37 | - { |
|
38 | - $this->cancel_ticket_line_item_service = $cancel_ticket_line_item_service; |
|
39 | - } |
|
31 | + /** |
|
32 | + * Command constructor |
|
33 | + * |
|
34 | + * @param CancelTicketLineItemService $cancel_ticket_line_item_service |
|
35 | + */ |
|
36 | + public function __construct(CancelTicketLineItemService $cancel_ticket_line_item_service) |
|
37 | + { |
|
38 | + $this->cancel_ticket_line_item_service = $cancel_ticket_line_item_service; |
|
39 | + } |
|
40 | 40 | |
41 | 41 | |
42 | 42 | |
@@ -44,27 +44,27 @@ discard block |
||
44 | 44 | * @param \EE_Registration $registration |
45 | 45 | * @param bool $cancel_ticket_line_item |
46 | 46 | */ |
47 | - public function cancelRegistrationAndTicketLineItem(\EE_Registration $registration, $cancel_ticket_line_item = true) |
|
48 | - { |
|
49 | - // first cancel the original line item for the registration's ticket |
|
50 | - if ( $cancel_ticket_line_item ) { |
|
51 | - $this->cancel_ticket_line_item_service->forRegistration( $registration ); |
|
52 | - } |
|
53 | - $this->cancelRegistrationOnly($registration); |
|
54 | - } |
|
55 | - |
|
56 | - |
|
57 | - |
|
58 | - /** |
|
59 | - * @param \EE_Registration $registration |
|
60 | - * @throws \EE_Error |
|
61 | - */ |
|
62 | - public function cancelRegistrationOnly(\EE_Registration $registration) |
|
63 | - { |
|
64 | - // now cancel the registration itself |
|
65 | - $registration->set_status(\EEM_Registration::status_id_cancelled); |
|
66 | - $registration->save(); |
|
67 | - } |
|
47 | + public function cancelRegistrationAndTicketLineItem(\EE_Registration $registration, $cancel_ticket_line_item = true) |
|
48 | + { |
|
49 | + // first cancel the original line item for the registration's ticket |
|
50 | + if ( $cancel_ticket_line_item ) { |
|
51 | + $this->cancel_ticket_line_item_service->forRegistration( $registration ); |
|
52 | + } |
|
53 | + $this->cancelRegistrationOnly($registration); |
|
54 | + } |
|
55 | + |
|
56 | + |
|
57 | + |
|
58 | + /** |
|
59 | + * @param \EE_Registration $registration |
|
60 | + * @throws \EE_Error |
|
61 | + */ |
|
62 | + public function cancelRegistrationOnly(\EE_Registration $registration) |
|
63 | + { |
|
64 | + // now cancel the registration itself |
|
65 | + $registration->set_status(\EEM_Registration::status_id_cancelled); |
|
66 | + $registration->save(); |
|
67 | + } |
|
68 | 68 | |
69 | 69 | |
70 | 70 |
@@ -47,8 +47,8 @@ |
||
47 | 47 | public function cancelRegistrationAndTicketLineItem(\EE_Registration $registration, $cancel_ticket_line_item = true) |
48 | 48 | { |
49 | 49 | // first cancel the original line item for the registration's ticket |
50 | - if ( $cancel_ticket_line_item ) { |
|
51 | - $this->cancel_ticket_line_item_service->forRegistration( $registration ); |
|
50 | + if ($cancel_ticket_line_item) { |
|
51 | + $this->cancel_ticket_line_item_service->forRegistration($registration); |
|
52 | 52 | } |
53 | 53 | $this->cancelRegistrationOnly($registration); |
54 | 54 | } |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <div style="float:right"> |
2 | - <?php printf( __( 'View %1$sRegistrations%4$s / %2$sTransactions%4$s for this %3$sevent%4$s.', 'event_espresso' ), '<a href="' . $filtered_registrations_link . '">', '<a href="' . $filtered_transactions_link . '">', '<a href="' . $event_link . '">', '</a>' );?> |
|
2 | + <?php printf(__('View %1$sRegistrations%4$s / %2$sTransactions%4$s for this %3$sevent%4$s.', 'event_espresso'), '<a href="'.$filtered_registrations_link.'">', '<a href="'.$filtered_transactions_link.'">', '<a href="'.$event_link.'">', '</a>'); ?> |
|
3 | 3 | </div> |
4 | -<h3 id="reg-admin-reg-details-reg-nmbr-hdr"><?php echo $previous_registration . ' '; echo __( 'Registration # ', 'event_espresso' ) . $reg_nmbr['value']; echo ' ' . $next_registration; ?></h3> |
|
5 | -<h2 id="reg-admin-reg-details-reg-date-hdr"><?php echo $reg_datetime['value'];?></h2> |
|
4 | +<h3 id="reg-admin-reg-details-reg-nmbr-hdr"><?php echo $previous_registration.' '; echo __('Registration # ', 'event_espresso').$reg_nmbr['value']; echo ' '.$next_registration; ?></h3> |
|
5 | +<h2 id="reg-admin-reg-details-reg-date-hdr"><?php echo $reg_datetime['value']; ?></h2> |
|
6 | 6 | |
7 | -<?php if ( $registration->group_size() > 1 ) : ?> |
|
8 | - <a id="scroll-to-other-attendees" class="scroll-to" href="#other-attendees"><?php echo __( 'Scroll to Other Registrations in the Same Transaction', 'event_espresso' );?></a> |
|
7 | +<?php if ($registration->group_size() > 1) : ?> |
|
8 | + <a id="scroll-to-other-attendees" class="scroll-to" href="#other-attendees"><?php echo __('Scroll to Other Registrations in the Same Transaction', 'event_espresso'); ?></a> |
|
9 | 9 | <?php endif; ?> |
10 | 10 | |
11 | -<?php do_action( 'AHEE__reg_status_change_buttons__after_header', $REG_ID ); ?> |
|
11 | +<?php do_action('AHEE__reg_status_change_buttons__after_header', $REG_ID); ?> |
|
12 | 12 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * ------------------------------------------------------------------------ |
23 | 23 | */ |
24 | -require_once ( EE_MODELS . 'EEM_Base.model.php' ); |
|
24 | +require_once (EE_MODELS.'EEM_Base.model.php'); |
|
25 | 25 | |
26 | 26 | class EEM_Term_Taxonomy extends EEM_Base { |
27 | 27 | |
@@ -29,68 +29,68 @@ discard block |
||
29 | 29 | protected static $_instance = NULL; |
30 | 30 | |
31 | 31 | |
32 | - protected function __construct( $timezone = NULL ) { |
|
33 | - $this->singular_item = __('Term Taxonomy','event_espresso'); |
|
34 | - $this->plural_item = __('Term Taxonomy','event_espresso'); |
|
32 | + protected function __construct($timezone = NULL) { |
|
33 | + $this->singular_item = __('Term Taxonomy', 'event_espresso'); |
|
34 | + $this->plural_item = __('Term Taxonomy', 'event_espresso'); |
|
35 | 35 | $this->_tables = array( |
36 | 36 | 'Term_Taxonomy'=> new EE_Primary_Table('term_taxonomy', 'term_taxonomy_id') |
37 | 37 | ); |
38 | 38 | $this->_fields = array( |
39 | 39 | 'Term_Taxonomy'=>array( |
40 | - 'term_taxonomy_id'=> new EE_Primary_Key_Int_Field('term_taxonomy_id', __('Term-Taxonomy ID','event_espresso')), |
|
41 | - 'term_id'=>new EE_Foreign_Key_Int_Field('term_id', __("Term Id", "event_espresso"), false, 0, 'Term'), //EE_Foreign_Key_Int_Field('term_taxonomy_id', __('Term (in context of a taxonomy) ID','event_espresso'), false, 0, 'Term_Taxonomy'), |
|
42 | - 'taxonomy'=>new EE_Plain_Text_Field('taxonomy', __('Taxonomy Name','event_espresso'), false, 'category'), |
|
43 | - 'description'=>new EE_Post_Content_Field('description', __("Description of Term", "event_espresso"), false,''), |
|
44 | - 'parent'=>new EE_Integer_Field('parent', __("Parent Term ID", "event_espresso"), false,0), |
|
40 | + 'term_taxonomy_id'=> new EE_Primary_Key_Int_Field('term_taxonomy_id', __('Term-Taxonomy ID', 'event_espresso')), |
|
41 | + 'term_id'=>new EE_Foreign_Key_Int_Field('term_id', __("Term Id", "event_espresso"), false, 0, 'Term'), //EE_Foreign_Key_Int_Field('term_taxonomy_id', __('Term (in context of a taxonomy) ID','event_espresso'), false, 0, 'Term_Taxonomy'), |
|
42 | + 'taxonomy'=>new EE_Plain_Text_Field('taxonomy', __('Taxonomy Name', 'event_espresso'), false, 'category'), |
|
43 | + 'description'=>new EE_Post_Content_Field('description', __("Description of Term", "event_espresso"), false, ''), |
|
44 | + 'parent'=>new EE_Integer_Field('parent', __("Parent Term ID", "event_espresso"), false, 0), |
|
45 | 45 | 'term_count'=> new EE_Integer_Field('count', __("Count of Objects attached", 'event_espresso'), false, 0) |
46 | 46 | )); |
47 | 47 | $this->_model_relations = array( |
48 | 48 | 'Term_Relationship'=>new EE_Has_Many_Relation(), |
49 | 49 | 'Term'=>new EE_Belongs_To_Relation(), |
50 | 50 | ); |
51 | - $cpt_models = array_keys( EE_Registry::instance()->cpt_models() ); |
|
52 | - foreach( $cpt_models as $model_name ) { |
|
53 | - $this->_model_relations[ $model_name ] = new EE_HABTM_Relation( 'Term_Relationship' ); |
|
51 | + $cpt_models = array_keys(EE_Registry::instance()->cpt_models()); |
|
52 | + foreach ($cpt_models as $model_name) { |
|
53 | + $this->_model_relations[$model_name] = new EE_HABTM_Relation('Term_Relationship'); |
|
54 | 54 | } |
55 | 55 | $this->_indexes = array( |
56 | - 'term_id_taxonomy'=>new EE_Unique_Index(array('term_id','taxonomy')) |
|
56 | + 'term_id_taxonomy'=>new EE_Unique_Index(array('term_id', 'taxonomy')) |
|
57 | 57 | ); |
58 | 58 | $path_to_tax_model = ''; |
59 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public(); |
|
60 | - $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Taxonomy_Protected( $path_to_tax_model ); |
|
61 | - $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = false; |
|
62 | - $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = false; |
|
59 | + $this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public(); |
|
60 | + $this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Taxonomy_Protected($path_to_tax_model); |
|
61 | + $this->_cap_restriction_generators[EEM_Base::caps_edit] = false; |
|
62 | + $this->_cap_restriction_generators[EEM_Base::caps_delete] = false; |
|
63 | 63 | |
64 | 64 | //add cap restrictions for editing relating to the "ee_edit_*" |
65 | - $this->_cap_restrictions[ EEM_Base::caps_edit ]['ee_edit_event_category'] = new EE_Default_Where_Conditions( |
|
65 | + $this->_cap_restrictions[EEM_Base::caps_edit]['ee_edit_event_category'] = new EE_Default_Where_Conditions( |
|
66 | 66 | array( |
67 | - $path_to_tax_model . 'taxonomy*ee_edit_event_category' => array( '!=', 'espresso_event_categories' ) |
|
67 | + $path_to_tax_model.'taxonomy*ee_edit_event_category' => array('!=', 'espresso_event_categories') |
|
68 | 68 | )); |
69 | - $this->_cap_restrictions[ EEM_Base::caps_edit ]['ee_edit_venue_category'] = new EE_Default_Where_Conditions( |
|
69 | + $this->_cap_restrictions[EEM_Base::caps_edit]['ee_edit_venue_category'] = new EE_Default_Where_Conditions( |
|
70 | 70 | array( |
71 | - $path_to_tax_model . 'taxonomy*ee_edit_venue_category' => array( '!=', 'espresso_venue_categories' ) |
|
71 | + $path_to_tax_model.'taxonomy*ee_edit_venue_category' => array('!=', 'espresso_venue_categories') |
|
72 | 72 | )); |
73 | - $this->_cap_restrictions[ EEM_Base::caps_edit ]['ee_edit_event_type'] = new EE_Default_Where_Conditions( |
|
73 | + $this->_cap_restrictions[EEM_Base::caps_edit]['ee_edit_event_type'] = new EE_Default_Where_Conditions( |
|
74 | 74 | array( |
75 | - $path_to_tax_model . 'taxonomy*ee_edit_event_type' => array( '!=', 'espresso_event_type' ) |
|
75 | + $path_to_tax_model.'taxonomy*ee_edit_event_type' => array('!=', 'espresso_event_type') |
|
76 | 76 | )); |
77 | 77 | |
78 | 78 | //add cap restrictions for deleting relating to the "ee_deleting_*" |
79 | - $this->_cap_restrictions[ EEM_Base::caps_delete ]['ee_delete_event_category'] = new EE_Default_Where_Conditions( |
|
79 | + $this->_cap_restrictions[EEM_Base::caps_delete]['ee_delete_event_category'] = new EE_Default_Where_Conditions( |
|
80 | 80 | array( |
81 | - $path_to_tax_model . 'taxonomy*ee_delete_event_category' => array( '!=', 'espresso_event_categories' ) |
|
81 | + $path_to_tax_model.'taxonomy*ee_delete_event_category' => array('!=', 'espresso_event_categories') |
|
82 | 82 | )); |
83 | - $this->_cap_restrictions[ EEM_Base::caps_delete ]['ee_delete_venue_category'] = new EE_Default_Where_Conditions( |
|
83 | + $this->_cap_restrictions[EEM_Base::caps_delete]['ee_delete_venue_category'] = new EE_Default_Where_Conditions( |
|
84 | 84 | array( |
85 | - $path_to_tax_model . 'taxonomy*ee_delete_venue_category' => array( '!=', 'espresso_venue_categories' ) |
|
85 | + $path_to_tax_model.'taxonomy*ee_delete_venue_category' => array('!=', 'espresso_venue_categories') |
|
86 | 86 | )); |
87 | - $this->_cap_restrictions[ EEM_Base::caps_delete ]['ee_delete_event_type'] = new EE_Default_Where_Conditions( |
|
87 | + $this->_cap_restrictions[EEM_Base::caps_delete]['ee_delete_event_type'] = new EE_Default_Where_Conditions( |
|
88 | 88 | array( |
89 | - $path_to_tax_model . 'taxonomy*ee_delete_event_type' => array( '!=', 'espresso_event_type' ) |
|
89 | + $path_to_tax_model.'taxonomy*ee_delete_event_type' => array('!=', 'espresso_event_type') |
|
90 | 90 | )); |
91 | 91 | |
92 | - parent::__construct( $timezone ); |
|
93 | - add_filter( 'FHEE__Read__create_model_query_params', array( 'EEM_Term_Taxonomy', 'rest_api_query_params' ), 10, 3 ); |
|
92 | + parent::__construct($timezone); |
|
93 | + add_filter('FHEE__Read__create_model_query_params', array('EEM_Term_Taxonomy', 'rest_api_query_params'), 10, 3); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -101,11 +101,11 @@ discard block |
||
101 | 101 | * @param EEM_Base $model |
102 | 102 | * @return array |
103 | 103 | */ |
104 | - public static function rest_api_query_params( $model_query_params, $querystring_query_params, $model ) { |
|
105 | - if( $model === EEM_Term_Taxonomy::instance() ) { |
|
106 | - $taxonomies = get_taxonomies( array( 'show_in_rest' => true) ); |
|
107 | - if( ! empty( $taxonomies ) ) { |
|
108 | - $model_query_params[0][ 'taxonomy' ] = array( 'IN', $taxonomies ); |
|
104 | + public static function rest_api_query_params($model_query_params, $querystring_query_params, $model) { |
|
105 | + if ($model === EEM_Term_Taxonomy::instance()) { |
|
106 | + $taxonomies = get_taxonomies(array('show_in_rest' => true)); |
|
107 | + if ( ! empty($taxonomies)) { |
|
108 | + $model_query_params[0]['taxonomy'] = array('IN', $taxonomies); |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | return $model_query_params; |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
3 | - exit( 'No direct script access allowed' ); |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | + exit('No direct script access allowed'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | * |
51 | 51 | * @param EE_Registration[] $registrations |
52 | 52 | */ |
53 | - public function __construct( $registrations ) { |
|
53 | + public function __construct($registrations) { |
|
54 | 54 | $this->_registrations = $registrations; |
55 | - $this->_calculate_registrations_per_line_item_code( $registrations ); |
|
55 | + $this->_calculate_registrations_per_line_item_code($registrations); |
|
56 | 56 | // these reg statuses should NOT increment the line item quantity |
57 | 57 | $this->_closed_reg_statuses = EEM_Registration::closed_reg_statuses(); |
58 | 58 | } |
@@ -65,20 +65,20 @@ discard block |
||
65 | 65 | * @param EE_Registration[] $registrations |
66 | 66 | * @return void |
67 | 67 | */ |
68 | - protected function _calculate_registrations_per_line_item_code( $registrations ) { |
|
69 | - foreach ( $registrations as $registration ) { |
|
68 | + protected function _calculate_registrations_per_line_item_code($registrations) { |
|
69 | + foreach ($registrations as $registration) { |
|
70 | 70 | $line_item_code = EEM_Line_Item::instance()->get_var( |
71 | 71 | EEM_Line_Item::instance()->line_item_for_registration_query_params( |
72 | 72 | $registration, |
73 | - array( 'limit' => 1 ) |
|
73 | + array('limit' => 1) |
|
74 | 74 | ), |
75 | 75 | 'LIN_code' |
76 | 76 | ); |
77 | - if ( $line_item_code ) { |
|
78 | - if ( ! isset( $this->_line_item_registrations[ $line_item_code ] ) ) { |
|
79 | - $this->_line_item_registrations[ $line_item_code ] = array(); |
|
77 | + if ($line_item_code) { |
|
78 | + if ( ! isset($this->_line_item_registrations[$line_item_code])) { |
|
79 | + $this->_line_item_registrations[$line_item_code] = array(); |
|
80 | 80 | } |
81 | - $this->_line_item_registrations[ $line_item_code ][ $registration->ID() ] = $registration; |
|
81 | + $this->_line_item_registrations[$line_item_code][$registration->ID()] = $registration; |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | } |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | * @param EEI_Line_Item $line_item |
93 | 93 | * @return \EEI_Line_Item |
94 | 94 | */ |
95 | - public function process( EEI_Line_Item $line_item ) { |
|
96 | - $this->_adjust_line_item_quantity( $line_item ); |
|
97 | - if ( ! $line_item->children() ) { |
|
95 | + public function process(EEI_Line_Item $line_item) { |
|
96 | + $this->_adjust_line_item_quantity($line_item); |
|
97 | + if ( ! $line_item->children()) { |
|
98 | 98 | return $line_item; |
99 | 99 | } |
100 | 100 | //the original running total (taking ALL tickets into account) |
@@ -103,11 +103,11 @@ discard block |
||
103 | 103 | $running_total_of_children_under_consideration = 0; |
104 | 104 | // let's also track the quantity of tickets that pertain to the registrations |
105 | 105 | $total_child_ticket_quantity = 0; |
106 | - foreach ( $line_item->children() as $child_line_item ) { |
|
106 | + foreach ($line_item->children() as $child_line_item) { |
|
107 | 107 | $original_li_total = $child_line_item->is_percent() |
108 | 108 | ? $running_total_of_children * $child_line_item->percent() / 100 |
109 | 109 | : $child_line_item->unit_price() * $child_line_item->quantity(); |
110 | - $this->process( $child_line_item ); |
|
110 | + $this->process($child_line_item); |
|
111 | 111 | // If this line item is a normal line item that isn't for a ticket, |
112 | 112 | // we want to modify its total (and unit price if not a percentage line item) |
113 | 113 | // so it reflects only that portion of the surcharge/discount shared by these registrations |
@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | $child_line_item->set_total( |
122 | 122 | $running_total_of_children_under_consideration * $percent_of_running_total |
123 | 123 | ); |
124 | - if ( ! $child_line_item->is_percent() ) { |
|
125 | - $child_line_item->set_unit_price( $child_line_item->total() / $child_line_item->quantity() ); |
|
124 | + if ( ! $child_line_item->is_percent()) { |
|
125 | + $child_line_item->set_unit_price($child_line_item->total() / $child_line_item->quantity()); |
|
126 | 126 | } |
127 | 127 | } else if ( |
128 | 128 | $line_item->type() === EEM_Line_Item::type_line_item |
@@ -139,28 +139,28 @@ discard block |
||
139 | 139 | // unless it IS a cancellation and the current registration is cancelled |
140 | 140 | $child_line_item->is_cancelled() |
141 | 141 | && $this->_current_registration instanceof EE_Registration |
142 | - && in_array( $this->_current_registration->status_ID(), $this->_closed_reg_statuses ) |
|
142 | + && in_array($this->_current_registration->status_ID(), $this->_closed_reg_statuses) |
|
143 | 143 | ) |
144 | 144 | ) |
145 | 145 | ) { |
146 | - $child_line_item->set_quantity( $line_item->quantity() ); |
|
147 | - $child_line_item->set_total( $child_line_item->unit_price() * $child_line_item->quantity() ); |
|
146 | + $child_line_item->set_quantity($line_item->quantity()); |
|
147 | + $child_line_item->set_total($child_line_item->unit_price() * $child_line_item->quantity()); |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | $running_total_of_children += $original_li_total; |
151 | 151 | $running_total_of_children_under_consideration += $child_line_item->total(); |
152 | - if ( $child_line_item->OBJ_type() == 'Ticket' ) { |
|
152 | + if ($child_line_item->OBJ_type() == 'Ticket') { |
|
153 | 153 | $total_child_ticket_quantity += $child_line_item->quantity(); |
154 | 154 | } |
155 | 155 | } |
156 | - $line_item->set_total( $running_total_of_children_under_consideration ); |
|
157 | - if ( $line_item->quantity() ) { |
|
158 | - $line_item->set_unit_price( $running_total_of_children_under_consideration / $line_item->quantity() ); |
|
156 | + $line_item->set_total($running_total_of_children_under_consideration); |
|
157 | + if ($line_item->quantity()) { |
|
158 | + $line_item->set_unit_price($running_total_of_children_under_consideration / $line_item->quantity()); |
|
159 | 159 | } else { |
160 | - $line_item->set_unit_price( 0 ); |
|
160 | + $line_item->set_unit_price(0); |
|
161 | 161 | } |
162 | - if ( $line_item->OBJ_type() == 'Event' ) { |
|
163 | - $line_item->set_quantity( $total_child_ticket_quantity ); |
|
162 | + if ($line_item->OBJ_type() == 'Event') { |
|
163 | + $line_item->set_quantity($total_child_ticket_quantity); |
|
164 | 164 | } |
165 | 165 | return $line_item; |
166 | 166 | } |
@@ -174,18 +174,18 @@ discard block |
||
174 | 174 | * @param EEI_Line_Item $line_item |
175 | 175 | * @return EEI_Line_Item |
176 | 176 | */ |
177 | - protected function _adjust_line_item_quantity( EEI_Line_Item $line_item ) { |
|
177 | + protected function _adjust_line_item_quantity(EEI_Line_Item $line_item) { |
|
178 | 178 | // is this a ticket ? |
179 | - if ( $line_item->type() === EEM_Line_Item::type_line_item && $line_item->OBJ_type() == 'Ticket' ) { |
|
179 | + if ($line_item->type() === EEM_Line_Item::type_line_item && $line_item->OBJ_type() == 'Ticket') { |
|
180 | 180 | $this->_current_registration = null; |
181 | 181 | $quantity = 0; |
182 | 182 | // if this ticket is billable at this moment, then we should have a positive quantity |
183 | 183 | if ( |
184 | - isset( $this->_line_item_registrations[ $line_item->code() ] ) |
|
185 | - && is_array( $this->_line_item_registrations[ $line_item->code() ] ) |
|
184 | + isset($this->_line_item_registrations[$line_item->code()]) |
|
185 | + && is_array($this->_line_item_registrations[$line_item->code()]) |
|
186 | 186 | ) { |
187 | 187 | // set quantity based on number of open registrations for this ticket |
188 | - foreach ( $this->_line_item_registrations[ $line_item->code() ] as $registration ) { |
|
188 | + foreach ($this->_line_item_registrations[$line_item->code()] as $registration) { |
|
189 | 189 | if ( |
190 | 190 | $registration instanceof EE_Registration |
191 | 191 | ) { |
@@ -194,8 +194,8 @@ discard block |
||
194 | 194 | } |
195 | 195 | } |
196 | 196 | } |
197 | - $line_item->set_quantity( $quantity ); |
|
198 | - $line_item->set_total( $line_item->unit_price() * $line_item->quantity() ); |
|
197 | + $line_item->set_quantity($quantity); |
|
198 | + $line_item->set_total($line_item->unit_price() * $line_item->quantity()); |
|
199 | 199 | } |
200 | 200 | return $line_item; |
201 | 201 | } |