@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | |
5 | 5 | |
@@ -38,32 +38,32 @@ discard block |
||
38 | 38 | public static function set_hooks() { |
39 | 39 | add_filter( |
40 | 40 | 'FHEE__SPCO__EE_Line_Item_Filter_Collection', |
41 | - array( 'EE_SPCO_Reg_Step_Payment_Options', 'add_spco_line_item_filters' ) |
|
41 | + array('EE_SPCO_Reg_Step_Payment_Options', 'add_spco_line_item_filters') |
|
42 | 42 | ); |
43 | 43 | add_action( |
44 | 44 | 'wp_ajax_switch_spco_billing_form', |
45 | - array( 'EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form' ) |
|
45 | + array('EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form') |
|
46 | 46 | ); |
47 | 47 | add_action( |
48 | 48 | 'wp_ajax_nopriv_switch_spco_billing_form', |
49 | - array( 'EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form' ) |
|
49 | + array('EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form') |
|
50 | 50 | ); |
51 | - add_action( 'wp_ajax_save_payer_details', array( 'EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details' ) ); |
|
51 | + add_action('wp_ajax_save_payer_details', array('EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details')); |
|
52 | 52 | add_action( |
53 | 53 | 'wp_ajax_nopriv_save_payer_details', |
54 | - array( 'EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details' ) |
|
54 | + array('EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details') |
|
55 | 55 | ); |
56 | 56 | add_action( |
57 | 57 | 'wp_ajax_get_transaction_details_for_gateways', |
58 | - array( 'EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details' ) |
|
58 | + array('EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details') |
|
59 | 59 | ); |
60 | 60 | add_action( |
61 | 61 | 'wp_ajax_nopriv_get_transaction_details_for_gateways', |
62 | - array( 'EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details' ) |
|
62 | + array('EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details') |
|
63 | 63 | ); |
64 | 64 | add_filter( |
65 | 65 | 'FHEE__EED_Recaptcha___bypass_recaptcha__bypass_request_params_array', |
66 | - array( 'EE_SPCO_Reg_Step_Payment_Options', 'bypass_recaptcha_for_load_payment_method' ), |
|
66 | + array('EE_SPCO_Reg_Step_Payment_Options', 'bypass_recaptcha_for_load_payment_method'), |
|
67 | 67 | 10, |
68 | 68 | 1 |
69 | 69 | ); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @throws \EE_Error |
78 | 78 | */ |
79 | 79 | public static function switch_spco_billing_form() { |
80 | - EED_Single_Page_Checkout::process_ajax_request( 'switch_payment_method' ); |
|
80 | + EED_Single_Page_Checkout::process_ajax_request('switch_payment_method'); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @throws \EE_Error |
89 | 89 | */ |
90 | 90 | public static function save_payer_details() { |
91 | - EED_Single_Page_Checkout::process_ajax_request( 'save_payer_details_via_ajax' ); |
|
91 | + EED_Single_Page_Checkout::process_ajax_request('save_payer_details_via_ajax'); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @throws \EE_Error |
100 | 100 | */ |
101 | 101 | public static function get_transaction_details() { |
102 | - EED_Single_Page_Checkout::process_ajax_request( 'get_transaction_details_for_gateways' ); |
|
102 | + EED_Single_Page_Checkout::process_ajax_request('get_transaction_details_for_gateways'); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | |
@@ -126,10 +126,10 @@ discard block |
||
126 | 126 | * @access public |
127 | 127 | * @param EE_Checkout $checkout |
128 | 128 | */ |
129 | - public function __construct( EE_Checkout $checkout ) { |
|
129 | + public function __construct(EE_Checkout $checkout) { |
|
130 | 130 | $this->_slug = 'payment_options'; |
131 | - $this->_name = __( 'Payment Options', 'event_espresso' ); |
|
132 | - $this->_template = SPCO_REG_STEPS_PATH . $this->_slug . DS . 'payment_options_main.template.php'; |
|
131 | + $this->_name = __('Payment Options', 'event_espresso'); |
|
132 | + $this->_template = SPCO_REG_STEPS_PATH.$this->_slug.DS.'payment_options_main.template.php'; |
|
133 | 133 | $this->checkout = $checkout; |
134 | 134 | $this->_reset_success_message(); |
135 | 135 | $this->set_instructions( |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | /** |
155 | 155 | * @param null $line_item_display |
156 | 156 | */ |
157 | - public function set_line_item_display( $line_item_display ) { |
|
157 | + public function set_line_item_display($line_item_display) { |
|
158 | 158 | $this->line_item_display = $line_item_display; |
159 | 159 | } |
160 | 160 | |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | /** |
173 | 173 | * @param boolean $handle_IPN_in_this_request |
174 | 174 | */ |
175 | - public function set_handle_IPN_in_this_request( $handle_IPN_in_this_request ) { |
|
176 | - $this->handle_IPN_in_this_request = filter_var( $handle_IPN_in_this_request, FILTER_VALIDATE_BOOLEAN ); |
|
175 | + public function set_handle_IPN_in_this_request($handle_IPN_in_this_request) { |
|
176 | + $this->handle_IPN_in_this_request = filter_var($handle_IPN_in_this_request, FILTER_VALIDATE_BOOLEAN); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | |
@@ -208,14 +208,14 @@ discard block |
||
208 | 208 | public function enqueue_styles_and_scripts() { |
209 | 209 | $transaction = $this->checkout->transaction; |
210 | 210 | //if the transaction isn't set or nothing is owed on it, don't enqueue any JS |
211 | - if( ! $transaction instanceof EE_Transaction || EEH_Money::compare_floats( $transaction->remaining(), 0 ) ) { |
|
211 | + if ( ! $transaction instanceof EE_Transaction || EEH_Money::compare_floats($transaction->remaining(), 0)) { |
|
212 | 212 | return; |
213 | 213 | } |
214 | - foreach( EEM_Payment_Method::instance()->get_all_for_transaction( $transaction, EEM_Payment_Method::scope_cart ) as $payment_method ) { |
|
214 | + foreach (EEM_Payment_Method::instance()->get_all_for_transaction($transaction, EEM_Payment_Method::scope_cart) as $payment_method) { |
|
215 | 215 | $type_obj = $payment_method->type_obj(); |
216 | - if( $type_obj instanceof EE_PMT_Base ) { |
|
217 | - $billing_form = $type_obj->generate_new_billing_form( $transaction ); |
|
218 | - if( $billing_form instanceof EE_Form_Section_Proper ) { |
|
216 | + if ($type_obj instanceof EE_PMT_Base) { |
|
217 | + $billing_form = $type_obj->generate_new_billing_form($transaction); |
|
218 | + if ($billing_form instanceof EE_Form_Section_Proper) { |
|
219 | 219 | $billing_form->enqueue_js(); |
220 | 220 | } |
221 | 221 | } |
@@ -240,20 +240,20 @@ discard block |
||
240 | 240 | // $ 0.00 transactions (no payment required) |
241 | 241 | ! $this->checkout->payment_required() |
242 | 242 | // but do NOT remove if current action being called belongs to this reg step |
243 | - && ! is_callable( array( $this, $this->checkout->action ) ) |
|
243 | + && ! is_callable(array($this, $this->checkout->action)) |
|
244 | 244 | && ! $this->completed() |
245 | 245 | ) { |
246 | 246 | // and if so, then we no longer need the Payment Options step |
247 | - if ( $this->is_current_step() ) { |
|
247 | + if ($this->is_current_step()) { |
|
248 | 248 | $this->checkout->generate_reg_form = false; |
249 | 249 | } |
250 | - $this->checkout->remove_reg_step( $this->_slug ); |
|
250 | + $this->checkout->remove_reg_step($this->_slug); |
|
251 | 251 | // DEBUG LOG |
252 | 252 | //$this->checkout->log( __CLASS__, __FUNCTION__, __LINE__ ); |
253 | 253 | return false; |
254 | 254 | } |
255 | 255 | // load EEM_Payment_Method |
256 | - EE_Registry::instance()->load_model( 'Payment_Method' ); |
|
256 | + EE_Registry::instance()->load_model('Payment_Method'); |
|
257 | 257 | // get all active payment methods |
258 | 258 | $this->checkout->available_payment_methods = EEM_Payment_Method::instance()->get_all_for_transaction( |
259 | 259 | $this->checkout->transaction, |
@@ -280,15 +280,15 @@ discard block |
||
280 | 280 | $insufficient_spaces_available = array(); |
281 | 281 | $reg_count = 0; |
282 | 282 | // loop thru registrations to gather info |
283 | - $registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ); |
|
283 | + $registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params); |
|
284 | 284 | $ejected_registrations = EE_SPCO_Reg_Step_Payment_Options::find_registrations_that_lost_their_space( |
285 | 285 | $registrations, |
286 | 286 | $this->checkout->revisit |
287 | 287 | ); |
288 | - foreach ( $registrations as $REG_ID => $registration ) { |
|
288 | + foreach ($registrations as $REG_ID => $registration) { |
|
289 | 289 | // has this registration lost it's space ? |
290 | - if ( isset( $ejected_registrations[ $REG_ID ] ) ) { |
|
291 | - $insufficient_spaces_available[ $registration->event()->ID() ] = $registration->event(); |
|
290 | + if (isset($ejected_registrations[$REG_ID])) { |
|
291 | + $insufficient_spaces_available[$registration->event()->ID()] = $registration->event(); |
|
292 | 292 | continue; |
293 | 293 | } |
294 | 294 | /** @var $registration EE_Registration */ |
@@ -300,9 +300,9 @@ discard block |
||
300 | 300 | && $registration->status_ID() === EEM_Registration::status_id_approved |
301 | 301 | ) |
302 | 302 | ) { |
303 | - if ( $registration->event()->is_sold_out() || $registration->event()->is_sold_out( true ) ) { |
|
303 | + if ($registration->event()->is_sold_out() || $registration->event()->is_sold_out(true)) { |
|
304 | 304 | // add event to list of events that are sold out |
305 | - $sold_out_events[ $registration->event()->ID() ] = $registration->event(); |
|
305 | + $sold_out_events[$registration->event()->ID()] = $registration->event(); |
|
306 | 306 | do_action( |
307 | 307 | 'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__sold_out_event', |
308 | 308 | $registration->event(), |
@@ -311,9 +311,9 @@ discard block |
||
311 | 311 | continue; |
312 | 312 | } |
313 | 313 | // event requires admin approval |
314 | - if ( $registration->status_ID() === EEM_Registration::status_id_not_approved ) { |
|
314 | + if ($registration->status_ID() === EEM_Registration::status_id_not_approved) { |
|
315 | 315 | // add event to list of events with pre-approval reg status |
316 | - $registrations_requiring_pre_approval[ $REG_ID ] = $registration; |
|
316 | + $registrations_requiring_pre_approval[$REG_ID] = $registration; |
|
317 | 317 | do_action( |
318 | 318 | 'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__event_requires_pre_approval', |
319 | 319 | $registration->event(), |
@@ -322,8 +322,8 @@ discard block |
||
322 | 322 | } |
323 | 323 | } |
324 | 324 | // are they allowed to pay now and is there monies owing? |
325 | - if ( $registration->owes_monies_and_can_pay() ) { |
|
326 | - $registrations_requiring_payment[ $REG_ID ] = $registration; |
|
325 | + if ($registration->owes_monies_and_can_pay()) { |
|
326 | + $registrations_requiring_payment[$REG_ID] = $registration; |
|
327 | 327 | do_action( |
328 | 328 | 'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__event_requires_payment', |
329 | 329 | $registration->event(), |
@@ -334,29 +334,29 @@ discard block |
||
334 | 334 | && $registration->status_ID() !== EEM_Registration::status_id_not_approved |
335 | 335 | && $registration->ticket()->is_free() |
336 | 336 | ) { |
337 | - $registrations_for_free_events[ $registration->event()->ID() ] = $registration; |
|
337 | + $registrations_for_free_events[$registration->event()->ID()] = $registration; |
|
338 | 338 | } |
339 | 339 | } |
340 | 340 | $subsections = array(); |
341 | 341 | // now decide which template to load |
342 | - if ( ! empty( $sold_out_events ) ) { |
|
343 | - $subsections['sold_out_events'] = $this->_sold_out_events( $sold_out_events ); |
|
342 | + if ( ! empty($sold_out_events)) { |
|
343 | + $subsections['sold_out_events'] = $this->_sold_out_events($sold_out_events); |
|
344 | 344 | } |
345 | - if ( ! empty( $insufficient_spaces_available ) ) { |
|
345 | + if ( ! empty($insufficient_spaces_available)) { |
|
346 | 346 | $subsections['insufficient_space'] = $this->_insufficient_spaces_available( |
347 | 347 | $insufficient_spaces_available |
348 | 348 | ); |
349 | 349 | } |
350 | - if ( ! empty( $registrations_requiring_pre_approval ) ) { |
|
350 | + if ( ! empty($registrations_requiring_pre_approval)) { |
|
351 | 351 | $subsections['registrations_requiring_pre_approval'] = $this->_registrations_requiring_pre_approval( |
352 | 352 | $registrations_requiring_pre_approval |
353 | 353 | ); |
354 | 354 | } |
355 | - if ( ! empty( $registrations_for_free_events ) ) { |
|
356 | - $subsections['no_payment_required'] = $this->_no_payment_required( $registrations_for_free_events ); |
|
355 | + if ( ! empty($registrations_for_free_events)) { |
|
356 | + $subsections['no_payment_required'] = $this->_no_payment_required($registrations_for_free_events); |
|
357 | 357 | } |
358 | - if ( ! empty( $registrations_requiring_payment ) ) { |
|
359 | - if ( $this->checkout->amount_owing > 0 ) { |
|
358 | + if ( ! empty($registrations_requiring_payment)) { |
|
359 | + if ($this->checkout->amount_owing > 0) { |
|
360 | 360 | // autoload Line_Item_Display classes |
361 | 361 | EEH_Autoloader::register_line_item_filter_autoloaders(); |
362 | 362 | $line_item_filter_processor = new EE_Line_Item_Filter_Processor( |
@@ -369,15 +369,15 @@ discard block |
||
369 | 369 | /** @var EE_Line_Item $filtered_line_item_tree */ |
370 | 370 | $filtered_line_item_tree = $line_item_filter_processor->process(); |
371 | 371 | EEH_Autoloader::register_line_item_display_autoloaders(); |
372 | - $this->set_line_item_display( new EE_Line_Item_Display( 'spco' ) ); |
|
372 | + $this->set_line_item_display(new EE_Line_Item_Display('spco')); |
|
373 | 373 | $subsections['payment_options'] = $this->_display_payment_options( |
374 | 374 | $this->line_item_display->display_line_item( |
375 | 375 | $filtered_line_item_tree, |
376 | - array( 'registrations' => $registrations ) |
|
376 | + array('registrations' => $registrations) |
|
377 | 377 | ) |
378 | 378 | ); |
379 | 379 | $this->checkout->amount_owing = $filtered_line_item_tree->total(); |
380 | - $this->_apply_registration_payments_to_amount_owing( $registrations ); |
|
380 | + $this->_apply_registration_payments_to_amount_owing($registrations); |
|
381 | 381 | } |
382 | 382 | } else { |
383 | 383 | $this->_hide_reg_step_submit_button_if_revisit(); |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | * @return \EE_Line_Item_Filter_Collection |
409 | 409 | * @throws \EE_Error |
410 | 410 | */ |
411 | - public static function add_spco_line_item_filters( EE_Line_Item_Filter_Collection $line_item_filter_collection ) { |
|
411 | + public static function add_spco_line_item_filters(EE_Line_Item_Filter_Collection $line_item_filter_collection) { |
|
412 | 412 | $line_item_filter_collection->add( |
413 | 413 | new EE_Billable_Line_Item_Filter( |
414 | 414 | EE_SPCO_Reg_Step_Payment_Options::remove_ejected_registrations( |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | ) |
419 | 419 | ) |
420 | 420 | ); |
421 | - $line_item_filter_collection->add( new EE_Non_Zero_Line_Item_Filter() ); |
|
421 | + $line_item_filter_collection->add(new EE_Non_Zero_Line_Item_Filter()); |
|
422 | 422 | return $line_item_filter_collection; |
423 | 423 | } |
424 | 424 | |
@@ -434,15 +434,15 @@ discard block |
||
434 | 434 | * @return \EE_Registration[] |
435 | 435 | * @throws \EE_Error |
436 | 436 | */ |
437 | - public static function remove_ejected_registrations( array $registrations ) { |
|
437 | + public static function remove_ejected_registrations(array $registrations) { |
|
438 | 438 | $ejected_registrations = EE_SPCO_Reg_Step_Payment_Options::find_registrations_that_lost_their_space( |
439 | 439 | $registrations, |
440 | 440 | EE_Registry::instance()->SSN->checkout()->revisit |
441 | 441 | ); |
442 | - foreach ( $registrations as $REG_ID => $registration ) { |
|
442 | + foreach ($registrations as $REG_ID => $registration) { |
|
443 | 443 | // has this registration lost it's space ? |
444 | - if ( isset( $ejected_registrations[ $REG_ID ] ) ) { |
|
445 | - unset( $registrations[ $REG_ID ] ); |
|
444 | + if (isset($ejected_registrations[$REG_ID])) { |
|
445 | + unset($registrations[$REG_ID]); |
|
446 | 446 | continue; |
447 | 447 | } |
448 | 448 | } |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | * @return array |
466 | 466 | * @throws \EE_Error |
467 | 467 | */ |
468 | - public static function find_registrations_that_lost_their_space( array $registrations, $revisit = false ) { |
|
468 | + public static function find_registrations_that_lost_their_space(array $registrations, $revisit = false) { |
|
469 | 469 | // registrations per event |
470 | 470 | $event_reg_count = array(); |
471 | 471 | // spaces left per event |
@@ -474,8 +474,8 @@ discard block |
||
474 | 474 | $tickets_remaining = array(); |
475 | 475 | // registrations that have lost their space |
476 | 476 | $ejected_registrations = array(); |
477 | - foreach ( $registrations as $REG_ID => $registration ) { |
|
478 | - if ( $registration->status_ID() === EEM_Registration::status_id_approved ) { |
|
477 | + foreach ($registrations as $REG_ID => $registration) { |
|
478 | + if ($registration->status_ID() === EEM_Registration::status_id_approved) { |
|
479 | 479 | continue; |
480 | 480 | } |
481 | 481 | $EVT_ID = $registration->event_ID(); |
@@ -496,13 +496,13 @@ discard block |
||
496 | 496 | $revisit |
497 | 497 | && ( |
498 | 498 | $tickets_remaining[$ticket->ID()] === 0 |
499 | - || $event_reg_count[ $EVT_ID ] > $event_spaces_remaining[ $EVT_ID ] |
|
499 | + || $event_reg_count[$EVT_ID] > $event_spaces_remaining[$EVT_ID] |
|
500 | 500 | ) |
501 | 501 | ) { |
502 | - $ejected_registrations[ $REG_ID ] = $registration->event(); |
|
503 | - if ( $registration->status_ID() !== EEM_Registration::status_id_wait_list ) { |
|
502 | + $ejected_registrations[$REG_ID] = $registration->event(); |
|
503 | + if ($registration->status_ID() !== EEM_Registration::status_id_wait_list) { |
|
504 | 504 | /** @type EE_Registration_Processor $registration_processor */ |
505 | - $registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' ); |
|
505 | + $registration_processor = EE_Registry::instance()->load_class('Registration_Processor'); |
|
506 | 506 | // at this point, we should have enough details about the registrant to consider the registration NOT incomplete |
507 | 507 | $registration_processor->manually_update_registration_status( |
508 | 508 | $registration, |
@@ -537,8 +537,8 @@ discard block |
||
537 | 537 | * @return void |
538 | 538 | */ |
539 | 539 | protected function _hide_reg_step_submit_button_if_revisit() { |
540 | - if ( $this->checkout->revisit ) { |
|
541 | - add_filter( 'FHEE__EE_SPCO_Reg_Step__reg_step_submit_button__sbmt_btn_html', '__return_empty_string' ); |
|
540 | + if ($this->checkout->revisit) { |
|
541 | + add_filter('FHEE__EE_SPCO_Reg_Step__reg_step_submit_button__sbmt_btn_html', '__return_empty_string'); |
|
542 | 542 | } |
543 | 543 | } |
544 | 544 | |
@@ -552,13 +552,13 @@ discard block |
||
552 | 552 | * @return \EE_Form_Section_Proper |
553 | 553 | * @throws \EE_Error |
554 | 554 | */ |
555 | - private function _sold_out_events( $sold_out_events_array = array() ) { |
|
555 | + private function _sold_out_events($sold_out_events_array = array()) { |
|
556 | 556 | // set some defaults |
557 | 557 | $this->checkout->selected_method_of_payment = 'events_sold_out'; |
558 | 558 | $sold_out_events = ''; |
559 | - foreach ( $sold_out_events_array as $sold_out_event ) { |
|
559 | + foreach ($sold_out_events_array as $sold_out_event) { |
|
560 | 560 | $sold_out_events .= EEH_HTML::li( |
561 | - EEH_HTML::span( ' ' .$sold_out_event->name(), '', 'dashicons dashicons-marker ee-icon-size-16 pink-text' ) |
|
561 | + EEH_HTML::span(' '.$sold_out_event->name(), '', 'dashicons dashicons-marker ee-icon-size-16 pink-text') |
|
562 | 562 | ); |
563 | 563 | } |
564 | 564 | return new EE_Form_Section_Proper( |
@@ -605,14 +605,14 @@ discard block |
||
605 | 605 | * @return \EE_Form_Section_Proper |
606 | 606 | * @throws \EE_Error |
607 | 607 | */ |
608 | - private function _insufficient_spaces_available( $insufficient_spaces_events_array = array() ) { |
|
608 | + private function _insufficient_spaces_available($insufficient_spaces_events_array = array()) { |
|
609 | 609 | // set some defaults |
610 | 610 | $this->checkout->selected_method_of_payment = 'invoice'; |
611 | 611 | $insufficient_space_events = ''; |
612 | - foreach ( $insufficient_spaces_events_array as $event ) { |
|
613 | - if ( $event instanceof EE_Event ) { |
|
612 | + foreach ($insufficient_spaces_events_array as $event) { |
|
613 | + if ($event instanceof EE_Event) { |
|
614 | 614 | $insufficient_space_events .= EEH_HTML::li( |
615 | - EEH_HTML::span( ' ' . $event->name(), '', 'dashicons dashicons-marker ee-icon-size-16 pink-text' ) |
|
615 | + EEH_HTML::span(' '.$event->name(), '', 'dashicons dashicons-marker ee-icon-size-16 pink-text') |
|
616 | 616 | ); |
617 | 617 | } |
618 | 618 | } |
@@ -656,17 +656,17 @@ discard block |
||
656 | 656 | * @return \EE_Form_Section_Proper |
657 | 657 | * @throws \EE_Error |
658 | 658 | */ |
659 | - private function _registrations_requiring_pre_approval( $registrations_requiring_pre_approval = array() ) { |
|
659 | + private function _registrations_requiring_pre_approval($registrations_requiring_pre_approval = array()) { |
|
660 | 660 | $events_requiring_pre_approval = ''; |
661 | - foreach ( $registrations_requiring_pre_approval as $registration ) { |
|
662 | - if ( $registration instanceof EE_Registration && $registration->event() instanceof EE_Event ) { |
|
663 | - $events_requiring_pre_approval[ $registration->event()->ID() ] = EEH_HTML::li( |
|
661 | + foreach ($registrations_requiring_pre_approval as $registration) { |
|
662 | + if ($registration instanceof EE_Registration && $registration->event() instanceof EE_Event) { |
|
663 | + $events_requiring_pre_approval[$registration->event()->ID()] = EEH_HTML::li( |
|
664 | 664 | EEH_HTML::span( |
665 | 665 | '', |
666 | 666 | '', |
667 | 667 | 'dashicons dashicons-marker ee-icon-size-16 orange-text' |
668 | 668 | ) |
669 | - . EEH_HTML::span( $registration->event()->name(), '', 'orange-text' ) |
|
669 | + . EEH_HTML::span($registration->event()->name(), '', 'orange-text') |
|
670 | 670 | ); |
671 | 671 | } |
672 | 672 | } |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | 'template_args' => apply_filters( |
686 | 686 | 'FHEE__EE_SPCO_Reg_Step_Payment_Options___sold_out_events__template_args', |
687 | 687 | array( |
688 | - 'events_requiring_pre_approval' => implode( '', $events_requiring_pre_approval ), |
|
688 | + 'events_requiring_pre_approval' => implode('', $events_requiring_pre_approval), |
|
689 | 689 | 'events_requiring_pre_approval_msg' => apply_filters( |
690 | 690 | 'FHEE__EE_SPCO_Reg_Step_Payment_Options___events_requiring_pre_approval__events_requiring_pre_approval_msg', |
691 | 691 | __( |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | * @return \EE_Form_Section_Proper |
711 | 711 | * @throws \EE_Error |
712 | 712 | */ |
713 | - private function _no_payment_required( $registrations_for_free_events = array() ) { |
|
713 | + private function _no_payment_required($registrations_for_free_events = array()) { |
|
714 | 714 | // set some defaults |
715 | 715 | $this->checkout->selected_method_of_payment = 'no_payment_required'; |
716 | 716 | // generate no_payment_required form |
@@ -734,7 +734,7 @@ discard block |
||
734 | 734 | 'ticket_count' => array(), |
735 | 735 | 'registrations_for_free_events' => $registrations_for_free_events, |
736 | 736 | 'no_payment_required_msg' => EEH_HTML::p( |
737 | - __( 'This is a free event, so no billing will occur.', 'event_espresso' ) |
|
737 | + __('This is a free event, so no billing will occur.', 'event_espresso') |
|
738 | 738 | ) |
739 | 739 | ) |
740 | 740 | ), |
@@ -753,7 +753,7 @@ discard block |
||
753 | 753 | * @return \EE_Form_Section_Proper |
754 | 754 | * @throws \EE_Error |
755 | 755 | */ |
756 | - private function _display_payment_options( $transaction_details = '' ) { |
|
756 | + private function _display_payment_options($transaction_details = '') { |
|
757 | 757 | // has method_of_payment been set by no-js user? |
758 | 758 | $this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(); |
759 | 759 | // build payment options form |
@@ -765,18 +765,18 @@ discard block |
||
765 | 765 | 'before_payment_options' => apply_filters( |
766 | 766 | 'FHEE__EE_SPCO_Reg_Step_Payment_Options___display_payment_options__before_payment_options', |
767 | 767 | new EE_Form_Section_Proper( |
768 | - array( 'layout_strategy' => new EE_Div_Per_Section_Layout() ) |
|
768 | + array('layout_strategy' => new EE_Div_Per_Section_Layout()) |
|
769 | 769 | ) |
770 | 770 | ), |
771 | 771 | 'payment_options' => $this->_setup_payment_options(), |
772 | 772 | 'after_payment_options' => apply_filters( |
773 | 773 | 'FHEE__EE_SPCO_Reg_Step_Payment_Options___display_payment_options__after_payment_options', |
774 | 774 | new EE_Form_Section_Proper( |
775 | - array( 'layout_strategy' => new EE_Div_Per_Section_Layout() ) |
|
775 | + array('layout_strategy' => new EE_Div_Per_Section_Layout()) |
|
776 | 776 | ) |
777 | 777 | ), |
778 | 778 | 'default_hidden_inputs' => $this->reg_step_hidden_inputs(), |
779 | - 'extra_hidden_inputs' => $this->_extra_hidden_inputs( false ) |
|
779 | + 'extra_hidden_inputs' => $this->_extra_hidden_inputs(false) |
|
780 | 780 | ), |
781 | 781 | 'layout_strategy' => new EE_Template_Layout( |
782 | 782 | array( |
@@ -805,10 +805,10 @@ discard block |
||
805 | 805 | * @return \EE_Form_Section_Proper |
806 | 806 | * @throws \EE_Error |
807 | 807 | */ |
808 | - private function _extra_hidden_inputs( $no_payment_required = true ) { |
|
808 | + private function _extra_hidden_inputs($no_payment_required = true) { |
|
809 | 809 | return new EE_Form_Section_Proper( |
810 | 810 | array( |
811 | - 'html_id' => 'ee-' . $this->slug() . '-extra-hidden-inputs', |
|
811 | + 'html_id' => 'ee-'.$this->slug().'-extra-hidden-inputs', |
|
812 | 812 | 'layout_strategy' => new EE_Div_Per_Section_Layout(), |
813 | 813 | 'subsections' => array( |
814 | 814 | 'spco_no_payment_required' => new EE_Hidden_Input( |
@@ -840,16 +840,16 @@ discard block |
||
840 | 840 | * @access protected |
841 | 841 | * @param array $registrations |
842 | 842 | */ |
843 | - protected function _apply_registration_payments_to_amount_owing( array $registrations ) { |
|
843 | + protected function _apply_registration_payments_to_amount_owing(array $registrations) { |
|
844 | 844 | $payments = array(); |
845 | - foreach ( $registrations as $registration ) { |
|
846 | - if ( $registration instanceof EE_Registration && $registration->owes_monies_and_can_pay() ) { |
|
845 | + foreach ($registrations as $registration) { |
|
846 | + if ($registration instanceof EE_Registration && $registration->owes_monies_and_can_pay()) { |
|
847 | 847 | $payments += $registration->registration_payments(); |
848 | 848 | } |
849 | 849 | } |
850 | - if ( ! empty( $payments ) ) { |
|
851 | - foreach ( $payments as $payment ) { |
|
852 | - if ( $payment instanceof EE_Registration_Payment ) { |
|
850 | + if ( ! empty($payments)) { |
|
851 | + foreach ($payments as $payment) { |
|
852 | + if ($payment instanceof EE_Registration_Payment) { |
|
853 | 853 | $this->checkout->amount_owing -= $payment->amount(); |
854 | 854 | } |
855 | 855 | } |
@@ -865,11 +865,11 @@ discard block |
||
865 | 865 | * @param bool $force_reset |
866 | 866 | * @return void |
867 | 867 | */ |
868 | - private function _reset_selected_method_of_payment( $force_reset = false ) { |
|
868 | + private function _reset_selected_method_of_payment($force_reset = false) { |
|
869 | 869 | $reset_payment_method = $force_reset |
870 | 870 | ? true |
871 | - : sanitize_text_field( EE_Registry::instance()->REQ->get( 'reset_payment_method', false ) ); |
|
872 | - if ( $reset_payment_method ) { |
|
871 | + : sanitize_text_field(EE_Registry::instance()->REQ->get('reset_payment_method', false)); |
|
872 | + if ($reset_payment_method) { |
|
873 | 873 | $this->checkout->selected_method_of_payment = null; |
874 | 874 | $this->checkout->payment_method = null; |
875 | 875 | $this->checkout->billing_form = null; |
@@ -888,12 +888,12 @@ discard block |
||
888 | 888 | * @param string $selected_method_of_payment |
889 | 889 | * @return void |
890 | 890 | */ |
891 | - private function _save_selected_method_of_payment( $selected_method_of_payment = '' ) { |
|
892 | - $selected_method_of_payment = ! empty( $selected_method_of_payment ) |
|
891 | + private function _save_selected_method_of_payment($selected_method_of_payment = '') { |
|
892 | + $selected_method_of_payment = ! empty($selected_method_of_payment) |
|
893 | 893 | ? $selected_method_of_payment |
894 | 894 | : $this->checkout->selected_method_of_payment; |
895 | 895 | EE_Registry::instance()->SSN->set_session_data( |
896 | - array( 'selected_method_of_payment' => $selected_method_of_payment ) |
|
896 | + array('selected_method_of_payment' => $selected_method_of_payment) |
|
897 | 897 | ); |
898 | 898 | } |
899 | 899 | |
@@ -909,19 +909,19 @@ discard block |
||
909 | 909 | // load payment method classes |
910 | 910 | $this->checkout->available_payment_methods = $this->_get_available_payment_methods(); |
911 | 911 | // switch up header depending on number of available payment methods |
912 | - $payment_method_header = count( $this->checkout->available_payment_methods ) > 1 |
|
912 | + $payment_method_header = count($this->checkout->available_payment_methods) > 1 |
|
913 | 913 | ? apply_filters( |
914 | 914 | 'FHEE__registration_page_payment_options__method_of_payment_hdr', |
915 | - __( 'Please Select Your Method of Payment', 'event_espresso' ) |
|
915 | + __('Please Select Your Method of Payment', 'event_espresso') |
|
916 | 916 | ) |
917 | 917 | : apply_filters( |
918 | 918 | 'FHEE__registration_page_payment_options__method_of_payment_hdr', |
919 | - __( 'Method of Payment', 'event_espresso' ) |
|
919 | + __('Method of Payment', 'event_espresso') |
|
920 | 920 | ); |
921 | 921 | $available_payment_methods = array( |
922 | 922 | // display the "Payment Method" header |
923 | 923 | 'payment_method_header' => new EE_Form_Section_HTML( |
924 | - EEH_HTML::h4( $payment_method_header, 'method-of-payment-hdr' ) |
|
924 | + EEH_HTML::h4($payment_method_header, 'method-of-payment-hdr') |
|
925 | 925 | ) |
926 | 926 | ); |
927 | 927 | // the list of actual payment methods ( invoice, paypal, etc ) in a ( slug => HTML ) format |
@@ -930,32 +930,32 @@ discard block |
||
930 | 930 | // additional instructions to be displayed and hidden below payment methods (adding a clearing div to start) |
931 | 931 | $payment_methods_billing_info = array( |
932 | 932 | new EE_Form_Section_HTML( |
933 | - EEH_HTML::div( '<br />', '', '', 'clear:both;' ) |
|
933 | + EEH_HTML::div('<br />', '', '', 'clear:both;') |
|
934 | 934 | ) |
935 | 935 | ); |
936 | 936 | // loop through payment methods |
937 | - foreach ( $this->checkout->available_payment_methods as $payment_method ) { |
|
938 | - if ( $payment_method instanceof EE_Payment_Method ) { |
|
937 | + foreach ($this->checkout->available_payment_methods as $payment_method) { |
|
938 | + if ($payment_method instanceof EE_Payment_Method) { |
|
939 | 939 | $payment_method_button = EEH_HTML::img( |
940 | 940 | $payment_method->button_url(), |
941 | 941 | $payment_method->name(), |
942 | - 'spco-payment-method-' . $payment_method->slug() . '-btn-img', |
|
942 | + 'spco-payment-method-'.$payment_method->slug().'-btn-img', |
|
943 | 943 | 'spco-payment-method-btn-img' |
944 | 944 | ); |
945 | 945 | // check if any payment methods are set as default |
946 | 946 | // if payment method is already selected OR nothing is selected and this payment method should be open_by_default |
947 | 947 | if ( |
948 | - ( $this->checkout->selected_method_of_payment === $payment_method->slug() ) |
|
949 | - || ( ! $this->checkout->selected_method_of_payment && $payment_method->open_by_default() ) |
|
948 | + ($this->checkout->selected_method_of_payment === $payment_method->slug()) |
|
949 | + || ( ! $this->checkout->selected_method_of_payment && $payment_method->open_by_default()) |
|
950 | 950 | ) { |
951 | 951 | $this->checkout->selected_method_of_payment = $payment_method->slug(); |
952 | 952 | $this->_save_selected_method_of_payment(); |
953 | - $default_payment_method_option[ $payment_method->slug() ] = $payment_method_button; |
|
953 | + $default_payment_method_option[$payment_method->slug()] = $payment_method_button; |
|
954 | 954 | } else { |
955 | - $available_payment_method_options[ $payment_method->slug() ] = $payment_method_button; |
|
955 | + $available_payment_method_options[$payment_method->slug()] = $payment_method_button; |
|
956 | 956 | } |
957 | - $payment_methods_billing_info[ $payment_method->slug() |
|
958 | - . '-info' ] = $this->_payment_method_billing_info( |
|
957 | + $payment_methods_billing_info[$payment_method->slug() |
|
958 | + . '-info'] = $this->_payment_method_billing_info( |
|
959 | 959 | $payment_method |
960 | 960 | ); |
961 | 961 | } |
@@ -985,12 +985,12 @@ discard block |
||
985 | 985 | * @return EE_Payment_Method[] |
986 | 986 | */ |
987 | 987 | protected function _get_available_payment_methods() { |
988 | - if ( ! empty( $this->checkout->available_payment_methods ) ) { |
|
988 | + if ( ! empty($this->checkout->available_payment_methods)) { |
|
989 | 989 | return $this->checkout->available_payment_methods; |
990 | 990 | } |
991 | 991 | $available_payment_methods = array(); |
992 | 992 | // load EEM_Payment_Method |
993 | - EE_Registry::instance()->load_model( 'Payment_Method' ); |
|
993 | + EE_Registry::instance()->load_model('Payment_Method'); |
|
994 | 994 | /** @type EEM_Payment_Method $EEM_Payment_Method */ |
995 | 995 | $EEM_Payment_Method = EE_Registry::instance()->LIB->EEM_Payment_Method; |
996 | 996 | // get all active payment methods |
@@ -998,9 +998,9 @@ discard block |
||
998 | 998 | $this->checkout->transaction, |
999 | 999 | EEM_Payment_Method::scope_cart |
1000 | 1000 | ); |
1001 | - foreach ( $payment_methods as $payment_method ) { |
|
1002 | - if ( $payment_method instanceof EE_Payment_Method ) { |
|
1003 | - $available_payment_methods[ $payment_method->slug() ] = $payment_method; |
|
1001 | + foreach ($payment_methods as $payment_method) { |
|
1002 | + if ($payment_method instanceof EE_Payment_Method) { |
|
1003 | + $available_payment_methods[$payment_method->slug()] = $payment_method; |
|
1004 | 1004 | } |
1005 | 1005 | } |
1006 | 1006 | return $available_payment_methods; |
@@ -1015,14 +1015,14 @@ discard block |
||
1015 | 1015 | * @param array $available_payment_method_options |
1016 | 1016 | * @return \EE_Form_Section_Proper |
1017 | 1017 | */ |
1018 | - private function _available_payment_method_inputs( $available_payment_method_options = array() ) { |
|
1018 | + private function _available_payment_method_inputs($available_payment_method_options = array()) { |
|
1019 | 1019 | // generate inputs |
1020 | 1020 | return new EE_Form_Section_Proper( |
1021 | 1021 | array( |
1022 | 1022 | 'html_id' => 'ee-available-payment-method-inputs', |
1023 | 1023 | 'layout_strategy' => new EE_Div_Per_Section_Layout(), |
1024 | 1024 | 'subsections' => array( |
1025 | - '' => new EE_Radio_Button_Input ( |
|
1025 | + '' => new EE_Radio_Button_Input( |
|
1026 | 1026 | $available_payment_method_options, |
1027 | 1027 | array( |
1028 | 1028 | 'html_name' => 'selected_method_of_payment', |
@@ -1047,28 +1047,28 @@ discard block |
||
1047 | 1047 | * @return \EE_Form_Section_Proper |
1048 | 1048 | * @throws \EE_Error |
1049 | 1049 | */ |
1050 | - private function _payment_method_billing_info( EE_Payment_Method $payment_method ) { |
|
1050 | + private function _payment_method_billing_info(EE_Payment_Method $payment_method) { |
|
1051 | 1051 | $currently_selected = $this->checkout->selected_method_of_payment === $payment_method->slug() |
1052 | 1052 | ? true |
1053 | 1053 | : false; |
1054 | 1054 | // generate the billing form for payment method |
1055 | 1055 | $billing_form = $currently_selected |
1056 | - ? $this->_get_billing_form_for_payment_method( $payment_method ) |
|
1056 | + ? $this->_get_billing_form_for_payment_method($payment_method) |
|
1057 | 1057 | : new EE_Form_Section_HTML(); |
1058 | 1058 | $this->checkout->billing_form = $currently_selected |
1059 | 1059 | ? $billing_form |
1060 | 1060 | : $this->checkout->billing_form; |
1061 | 1061 | // it's all in the details |
1062 | 1062 | $info_html = EEH_HTML::h3( |
1063 | - __( 'Important information regarding your payment', 'event_espresso' ), |
|
1063 | + __('Important information regarding your payment', 'event_espresso'), |
|
1064 | 1064 | '', |
1065 | 1065 | 'spco-payment-method-hdr' |
1066 | 1066 | ); |
1067 | 1067 | // add some info regarding the step, either from what's saved in the admin, |
1068 | 1068 | // or a default string depending on whether the PM has a billing form or not |
1069 | - if ( $payment_method->description() ) { |
|
1069 | + if ($payment_method->description()) { |
|
1070 | 1070 | $payment_method_info = $payment_method->description(); |
1071 | - } elseif ( $billing_form instanceof EE_Billing_Info_Form ) { |
|
1071 | + } elseif ($billing_form instanceof EE_Billing_Info_Form) { |
|
1072 | 1072 | $payment_method_info = sprintf( |
1073 | 1073 | __( |
1074 | 1074 | 'Please provide the following billing information, then click the "%1$s" button below in order to proceed.', |
@@ -1078,7 +1078,7 @@ discard block |
||
1078 | 1078 | ); |
1079 | 1079 | } else { |
1080 | 1080 | $payment_method_info = sprintf( |
1081 | - __( 'Please click the "%1$s" button below in order to proceed.', 'event_espresso' ), |
|
1081 | + __('Please click the "%1$s" button below in order to proceed.', 'event_espresso'), |
|
1082 | 1082 | $this->submit_button_text() |
1083 | 1083 | ); |
1084 | 1084 | } |
@@ -1092,13 +1092,13 @@ discard block |
||
1092 | 1092 | ); |
1093 | 1093 | return new EE_Form_Section_Proper( |
1094 | 1094 | array( |
1095 | - 'html_id' => 'spco-payment-method-info-' . $payment_method->slug(), |
|
1095 | + 'html_id' => 'spco-payment-method-info-'.$payment_method->slug(), |
|
1096 | 1096 | 'html_class' => 'spco-payment-method-info-dv', |
1097 | 1097 | // only display the selected or default PM |
1098 | 1098 | 'html_style' => $currently_selected ? '' : 'display:none;', |
1099 | 1099 | 'layout_strategy' => new EE_Div_Per_Section_Layout(), |
1100 | 1100 | 'subsections' => array( |
1101 | - 'info' => new EE_Form_Section_HTML( $info_html ), |
|
1101 | + 'info' => new EE_Form_Section_HTML($info_html), |
|
1102 | 1102 | 'billing_form' => $currently_selected ? $billing_form : new EE_Form_Section_HTML() |
1103 | 1103 | ) |
1104 | 1104 | ) |
@@ -1116,15 +1116,15 @@ discard block |
||
1116 | 1116 | */ |
1117 | 1117 | public function get_billing_form_html_for_payment_method() { |
1118 | 1118 | // how have they chosen to pay? |
1119 | - $this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( true ); |
|
1119 | + $this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(true); |
|
1120 | 1120 | $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment(); |
1121 | - if ( ! $this->checkout->payment_method instanceof EE_Payment_Method ) { |
|
1121 | + if ( ! $this->checkout->payment_method instanceof EE_Payment_Method) { |
|
1122 | 1122 | return false; |
1123 | 1123 | } |
1124 | - if ( apply_filters( |
|
1124 | + if (apply_filters( |
|
1125 | 1125 | 'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', |
1126 | 1126 | false |
1127 | - ) ) { |
|
1127 | + )) { |
|
1128 | 1128 | EE_Error::add_success( |
1129 | 1129 | apply_filters( |
1130 | 1130 | 'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method', |
@@ -1139,7 +1139,7 @@ discard block |
||
1139 | 1139 | ); |
1140 | 1140 | } |
1141 | 1141 | // now generate billing form for selected method of payment |
1142 | - $payment_method_billing_form = $this->_get_billing_form_for_payment_method( $this->checkout->payment_method ); |
|
1142 | + $payment_method_billing_form = $this->_get_billing_form_for_payment_method($this->checkout->payment_method); |
|
1143 | 1143 | // fill form with attendee info if applicable |
1144 | 1144 | if ( |
1145 | 1145 | $payment_method_billing_form instanceof EE_Billing_Attendee_Info_Form |
@@ -1161,10 +1161,10 @@ discard block |
||
1161 | 1161 | $billing_info = $payment_method_billing_form instanceof EE_Form_Section_Proper |
1162 | 1162 | ? $payment_method_billing_form->get_html() |
1163 | 1163 | : ''; |
1164 | - $this->checkout->json_response->set_return_data( array( 'payment_method_info' => $billing_info ) ); |
|
1164 | + $this->checkout->json_response->set_return_data(array('payment_method_info' => $billing_info)); |
|
1165 | 1165 | // localize validation rules for main form |
1166 | 1166 | $this->checkout->current_step->reg_form->localize_validation_rules(); |
1167 | - $this->checkout->json_response->add_validation_rules( EE_Form_Section_Proper::js_localization() ); |
|
1167 | + $this->checkout->json_response->add_validation_rules(EE_Form_Section_Proper::js_localization()); |
|
1168 | 1168 | return true; |
1169 | 1169 | } |
1170 | 1170 | |
@@ -1178,18 +1178,18 @@ discard block |
||
1178 | 1178 | * @return \EE_Billing_Info_Form|\EE_Form_Section_HTML |
1179 | 1179 | * @throws \EE_Error |
1180 | 1180 | */ |
1181 | - private function _get_billing_form_for_payment_method( EE_Payment_Method $payment_method ) { |
|
1181 | + private function _get_billing_form_for_payment_method(EE_Payment_Method $payment_method) { |
|
1182 | 1182 | $billing_form = $payment_method->type_obj()->billing_form( |
1183 | 1183 | $this->checkout->transaction, |
1184 | - array( 'amount_owing' => $this->checkout->amount_owing ) |
|
1184 | + array('amount_owing' => $this->checkout->amount_owing) |
|
1185 | 1185 | ); |
1186 | - if ( $billing_form instanceof EE_Billing_Info_Form ) { |
|
1186 | + if ($billing_form instanceof EE_Billing_Info_Form) { |
|
1187 | 1187 | if ( |
1188 | 1188 | apply_filters( |
1189 | 1189 | 'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', |
1190 | 1190 | false |
1191 | 1191 | ) |
1192 | - && EE_Registry::instance()->REQ->is_set( 'payment_method' ) |
|
1192 | + && EE_Registry::instance()->REQ->is_set('payment_method') |
|
1193 | 1193 | ) { |
1194 | 1194 | EE_Error::add_success( |
1195 | 1195 | apply_filters( |
@@ -1231,15 +1231,15 @@ discard block |
||
1231 | 1231 | $request_param = 'selected_method_of_payment' |
1232 | 1232 | ) { |
1233 | 1233 | // is selected_method_of_payment set in the request ? |
1234 | - $selected_method_of_payment = EE_Registry::instance()->REQ->get( $request_param, false ); |
|
1235 | - if ( $selected_method_of_payment ) { |
|
1234 | + $selected_method_of_payment = EE_Registry::instance()->REQ->get($request_param, false); |
|
1235 | + if ($selected_method_of_payment) { |
|
1236 | 1236 | // sanitize it |
1237 | - $selected_method_of_payment = is_array( $selected_method_of_payment ) |
|
1238 | - ? array_shift( $selected_method_of_payment ) |
|
1237 | + $selected_method_of_payment = is_array($selected_method_of_payment) |
|
1238 | + ? array_shift($selected_method_of_payment) |
|
1239 | 1239 | : $selected_method_of_payment; |
1240 | - $selected_method_of_payment = sanitize_text_field( $selected_method_of_payment ); |
|
1240 | + $selected_method_of_payment = sanitize_text_field($selected_method_of_payment); |
|
1241 | 1241 | // store it in the session so that it's available for all subsequent requests including AJAX |
1242 | - $this->_save_selected_method_of_payment( $selected_method_of_payment ); |
|
1242 | + $this->_save_selected_method_of_payment($selected_method_of_payment); |
|
1243 | 1243 | } else { |
1244 | 1244 | // or is is set in the session ? |
1245 | 1245 | $selected_method_of_payment = EE_Registry::instance()->SSN->get_session_data( |
@@ -1247,7 +1247,7 @@ discard block |
||
1247 | 1247 | ); |
1248 | 1248 | } |
1249 | 1249 | // do ya really really gotta have it? |
1250 | - if ( empty( $selected_method_of_payment ) && $required ) { |
|
1250 | + if (empty($selected_method_of_payment) && $required) { |
|
1251 | 1251 | EE_Error::add_error( |
1252 | 1252 | sprintf( |
1253 | 1253 | __( |
@@ -1256,7 +1256,7 @@ discard block |
||
1256 | 1256 | ), |
1257 | 1257 | '<br/>', |
1258 | 1258 | '<br/>', |
1259 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
1259 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
1260 | 1260 | ), |
1261 | 1261 | __FILE__, |
1262 | 1262 | __FUNCTION__, |
@@ -1283,13 +1283,13 @@ discard block |
||
1283 | 1283 | * @throws \EE_Error |
1284 | 1284 | */ |
1285 | 1285 | public function switch_payment_method() { |
1286 | - if ( ! $this->_verify_payment_method_is_set() ) { |
|
1286 | + if ( ! $this->_verify_payment_method_is_set()) { |
|
1287 | 1287 | return false; |
1288 | 1288 | } |
1289 | - if ( apply_filters( |
|
1289 | + if (apply_filters( |
|
1290 | 1290 | 'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', |
1291 | 1291 | false |
1292 | - ) ) { |
|
1292 | + )) { |
|
1293 | 1293 | EE_Error::add_success( |
1294 | 1294 | apply_filters( |
1295 | 1295 | 'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method', |
@@ -1304,13 +1304,13 @@ discard block |
||
1304 | 1304 | ); |
1305 | 1305 | } |
1306 | 1306 | // generate billing form for selected method of payment if it hasn't been done already |
1307 | - if ( $this->checkout->payment_method->type_obj()->has_billing_form() ) { |
|
1307 | + if ($this->checkout->payment_method->type_obj()->has_billing_form()) { |
|
1308 | 1308 | $this->checkout->billing_form = $this->_get_billing_form_for_payment_method( |
1309 | 1309 | $this->checkout->payment_method |
1310 | 1310 | ); |
1311 | 1311 | } |
1312 | 1312 | // fill form with attendee info if applicable |
1313 | - if ( $this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form |
|
1313 | + if ($this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form |
|
1314 | 1314 | && $this->checkout->transaction_has_primary_registrant() |
1315 | 1315 | ) { |
1316 | 1316 | $this->checkout->billing_form->populate_from_attendee( |
@@ -1318,7 +1318,7 @@ discard block |
||
1318 | 1318 | ); |
1319 | 1319 | } |
1320 | 1320 | // and debug content |
1321 | - if ( $this->checkout->billing_form instanceof EE_Billing_Info_Form |
|
1321 | + if ($this->checkout->billing_form instanceof EE_Billing_Info_Form |
|
1322 | 1322 | && $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base |
1323 | 1323 | ) { |
1324 | 1324 | $this->checkout->billing_form = $this->checkout->payment_method->type_obj()->apply_billing_form_debug_settings( |
@@ -1326,15 +1326,15 @@ discard block |
||
1326 | 1326 | ); |
1327 | 1327 | } |
1328 | 1328 | // get html and validation rules for form |
1329 | - if ( $this->checkout->billing_form instanceof EE_Form_Section_Proper ) { |
|
1329 | + if ($this->checkout->billing_form instanceof EE_Form_Section_Proper) { |
|
1330 | 1330 | $this->checkout->json_response->set_return_data( |
1331 | - array( 'payment_method_info' => $this->checkout->billing_form->get_html() ) |
|
1331 | + array('payment_method_info' => $this->checkout->billing_form->get_html()) |
|
1332 | 1332 | ); |
1333 | 1333 | // localize validation rules for main form |
1334 | - $this->checkout->billing_form->localize_validation_rules( true ); |
|
1335 | - $this->checkout->json_response->add_validation_rules( EE_Form_Section_Proper::js_localization() ); |
|
1334 | + $this->checkout->billing_form->localize_validation_rules(true); |
|
1335 | + $this->checkout->json_response->add_validation_rules(EE_Form_Section_Proper::js_localization()); |
|
1336 | 1336 | } else { |
1337 | - $this->checkout->json_response->set_return_data( array( 'payment_method_info' => '' ) ); |
|
1337 | + $this->checkout->json_response->set_return_data(array('payment_method_info' => '')); |
|
1338 | 1338 | } |
1339 | 1339 | //prevents advancement to next step |
1340 | 1340 | $this->checkout->continue_reg = false; |
@@ -1351,12 +1351,12 @@ discard block |
||
1351 | 1351 | */ |
1352 | 1352 | protected function _verify_payment_method_is_set() { |
1353 | 1353 | // generate billing form for selected method of payment if it hasn't been done already |
1354 | - if ( empty( $this->checkout->selected_method_of_payment ) ) { |
|
1354 | + if (empty($this->checkout->selected_method_of_payment)) { |
|
1355 | 1355 | // how have they chosen to pay? |
1356 | - $this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( true ); |
|
1356 | + $this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(true); |
|
1357 | 1357 | } |
1358 | 1358 | // verify payment method |
1359 | - if ( ! $this->checkout->payment_method instanceof EE_Payment_Method ) { |
|
1359 | + if ( ! $this->checkout->payment_method instanceof EE_Payment_Method) { |
|
1360 | 1360 | // get payment method for selected method of payment |
1361 | 1361 | $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment(); |
1362 | 1362 | } |
@@ -1375,25 +1375,25 @@ discard block |
||
1375 | 1375 | * @throws \EE_Error |
1376 | 1376 | */ |
1377 | 1377 | public function save_payer_details_via_ajax() { |
1378 | - if ( ! $this->_verify_payment_method_is_set() ) { |
|
1378 | + if ( ! $this->_verify_payment_method_is_set()) { |
|
1379 | 1379 | return; |
1380 | 1380 | } |
1381 | 1381 | // generate billing form for selected method of payment if it hasn't been done already |
1382 | - if ( $this->checkout->payment_method->type_obj()->has_billing_form() ) { |
|
1382 | + if ($this->checkout->payment_method->type_obj()->has_billing_form()) { |
|
1383 | 1383 | $this->checkout->billing_form = $this->_get_billing_form_for_payment_method( |
1384 | 1384 | $this->checkout->payment_method |
1385 | 1385 | ); |
1386 | 1386 | } |
1387 | 1387 | // generate primary attendee from payer info if applicable |
1388 | - if ( ! $this->checkout->transaction_has_primary_registrant() ) { |
|
1388 | + if ( ! $this->checkout->transaction_has_primary_registrant()) { |
|
1389 | 1389 | $attendee = $this->_create_attendee_from_request_data(); |
1390 | - if ( $attendee instanceof EE_Attendee ) { |
|
1391 | - foreach ( $this->checkout->transaction->registrations() as $registration ) { |
|
1392 | - if ( $registration->is_primary_registrant() ) { |
|
1390 | + if ($attendee instanceof EE_Attendee) { |
|
1391 | + foreach ($this->checkout->transaction->registrations() as $registration) { |
|
1392 | + if ($registration->is_primary_registrant()) { |
|
1393 | 1393 | $this->checkout->primary_attendee_obj = $attendee; |
1394 | - $registration->_add_relation_to( $attendee, 'Attendee' ); |
|
1395 | - $registration->set_attendee_id( $attendee->ID() ); |
|
1396 | - $registration->update_cache_after_object_save( 'Attendee', $attendee ); |
|
1394 | + $registration->_add_relation_to($attendee, 'Attendee'); |
|
1395 | + $registration->set_attendee_id($attendee->ID()); |
|
1396 | + $registration->update_cache_after_object_save('Attendee', $attendee); |
|
1397 | 1397 | } |
1398 | 1398 | } |
1399 | 1399 | } |
@@ -1411,50 +1411,50 @@ discard block |
||
1411 | 1411 | */ |
1412 | 1412 | protected function _create_attendee_from_request_data() { |
1413 | 1413 | // get State ID |
1414 | - $STA_ID = ! empty( $_REQUEST['state'] ) ? sanitize_text_field( $_REQUEST['state'] ) : ''; |
|
1415 | - if ( ! empty( $STA_ID ) ) { |
|
1414 | + $STA_ID = ! empty($_REQUEST['state']) ? sanitize_text_field($_REQUEST['state']) : ''; |
|
1415 | + if ( ! empty($STA_ID)) { |
|
1416 | 1416 | // can we get state object from name ? |
1417 | - EE_Registry::instance()->load_model( 'State' ); |
|
1418 | - $state = EEM_State::instance()->get_col( array( array( 'STA_name' => $STA_ID ), 'limit' => 1 ), 'STA_ID' ); |
|
1419 | - $STA_ID = is_array( $state ) && ! empty( $state ) ? reset( $state ) : $STA_ID; |
|
1417 | + EE_Registry::instance()->load_model('State'); |
|
1418 | + $state = EEM_State::instance()->get_col(array(array('STA_name' => $STA_ID), 'limit' => 1), 'STA_ID'); |
|
1419 | + $STA_ID = is_array($state) && ! empty($state) ? reset($state) : $STA_ID; |
|
1420 | 1420 | } |
1421 | 1421 | // get Country ISO |
1422 | - $CNT_ISO = ! empty( $_REQUEST['country'] ) ? sanitize_text_field( $_REQUEST['country'] ) : ''; |
|
1423 | - if ( ! empty( $CNT_ISO ) ) { |
|
1422 | + $CNT_ISO = ! empty($_REQUEST['country']) ? sanitize_text_field($_REQUEST['country']) : ''; |
|
1423 | + if ( ! empty($CNT_ISO)) { |
|
1424 | 1424 | // can we get country object from name ? |
1425 | - EE_Registry::instance()->load_model( 'Country' ); |
|
1425 | + EE_Registry::instance()->load_model('Country'); |
|
1426 | 1426 | $country = EEM_Country::instance()->get_col( |
1427 | - array( array( 'CNT_name' => $CNT_ISO ), 'limit' => 1 ), |
|
1427 | + array(array('CNT_name' => $CNT_ISO), 'limit' => 1), |
|
1428 | 1428 | 'CNT_ISO' |
1429 | 1429 | ); |
1430 | - $CNT_ISO = is_array( $country ) && ! empty( $country ) ? reset( $country ) : $CNT_ISO; |
|
1430 | + $CNT_ISO = is_array($country) && ! empty($country) ? reset($country) : $CNT_ISO; |
|
1431 | 1431 | } |
1432 | 1432 | // grab attendee data |
1433 | 1433 | $attendee_data = array( |
1434 | - 'ATT_fname' => ! empty( $_REQUEST['first_name'] ) ? sanitize_text_field( $_REQUEST['first_name'] ) : '', |
|
1435 | - 'ATT_lname' => ! empty( $_REQUEST['last_name'] ) ? sanitize_text_field( $_REQUEST['last_name'] ) : '', |
|
1436 | - 'ATT_email' => ! empty( $_REQUEST['email'] ) ? sanitize_email( $_REQUEST['email'] ) : '', |
|
1437 | - 'ATT_address' => ! empty( $_REQUEST['address'] ) ? sanitize_text_field( $_REQUEST['address'] ) : '', |
|
1438 | - 'ATT_address2' => ! empty( $_REQUEST['address2'] ) ? sanitize_text_field( $_REQUEST['address2'] ) : '', |
|
1439 | - 'ATT_city' => ! empty( $_REQUEST['city'] ) ? sanitize_text_field( $_REQUEST['city'] ) : '', |
|
1434 | + 'ATT_fname' => ! empty($_REQUEST['first_name']) ? sanitize_text_field($_REQUEST['first_name']) : '', |
|
1435 | + 'ATT_lname' => ! empty($_REQUEST['last_name']) ? sanitize_text_field($_REQUEST['last_name']) : '', |
|
1436 | + 'ATT_email' => ! empty($_REQUEST['email']) ? sanitize_email($_REQUEST['email']) : '', |
|
1437 | + 'ATT_address' => ! empty($_REQUEST['address']) ? sanitize_text_field($_REQUEST['address']) : '', |
|
1438 | + 'ATT_address2' => ! empty($_REQUEST['address2']) ? sanitize_text_field($_REQUEST['address2']) : '', |
|
1439 | + 'ATT_city' => ! empty($_REQUEST['city']) ? sanitize_text_field($_REQUEST['city']) : '', |
|
1440 | 1440 | 'STA_ID' => $STA_ID, |
1441 | 1441 | 'CNT_ISO' => $CNT_ISO, |
1442 | - 'ATT_zip' => ! empty( $_REQUEST['zip'] ) ? sanitize_text_field( $_REQUEST['zip'] ) : '', |
|
1443 | - 'ATT_phone' => ! empty( $_REQUEST['phone'] ) ? sanitize_text_field( $_REQUEST['phone'] ) : '', |
|
1442 | + 'ATT_zip' => ! empty($_REQUEST['zip']) ? sanitize_text_field($_REQUEST['zip']) : '', |
|
1443 | + 'ATT_phone' => ! empty($_REQUEST['phone']) ? sanitize_text_field($_REQUEST['phone']) : '', |
|
1444 | 1444 | ); |
1445 | 1445 | // validate the email address since it is the most important piece of info |
1446 | - if ( empty( $attendee_data['ATT_email'] ) || $attendee_data['ATT_email'] !== $_REQUEST['email'] ) { |
|
1446 | + if (empty($attendee_data['ATT_email']) || $attendee_data['ATT_email'] !== $_REQUEST['email']) { |
|
1447 | 1447 | EE_Error::add_error( |
1448 | - __( 'An invalid email address was submitted.', 'event_espresso' ), |
|
1448 | + __('An invalid email address was submitted.', 'event_espresso'), |
|
1449 | 1449 | __FILE__, |
1450 | 1450 | __FUNCTION__, |
1451 | 1451 | __LINE__ |
1452 | 1452 | ); |
1453 | 1453 | } |
1454 | 1454 | // does this attendee already exist in the db ? we're searching using a combination of first name, last name, AND email address |
1455 | - if ( ! empty( $attendee_data['ATT_fname'] ) |
|
1456 | - && ! empty( $attendee_data['ATT_lname'] ) |
|
1457 | - && ! empty( $attendee_data['ATT_email'] ) |
|
1455 | + if ( ! empty($attendee_data['ATT_fname']) |
|
1456 | + && ! empty($attendee_data['ATT_lname']) |
|
1457 | + && ! empty($attendee_data['ATT_email']) |
|
1458 | 1458 | ) { |
1459 | 1459 | $existing_attendee = EE_Registry::instance()->LIB->EEM_Attendee->find_existing_attendee( |
1460 | 1460 | array( |
@@ -1463,19 +1463,19 @@ discard block |
||
1463 | 1463 | 'ATT_email' => $attendee_data['ATT_email'] |
1464 | 1464 | ) |
1465 | 1465 | ); |
1466 | - if ( $existing_attendee instanceof EE_Attendee ) { |
|
1466 | + if ($existing_attendee instanceof EE_Attendee) { |
|
1467 | 1467 | return $existing_attendee; |
1468 | 1468 | } |
1469 | 1469 | } |
1470 | 1470 | // no existing attendee? kk let's create a new one |
1471 | 1471 | // kinda lame, but we need a first and last name to create an attendee, so use the email address if those don't exist |
1472 | - $attendee_data['ATT_fname'] = ! empty( $attendee_data['ATT_fname'] ) |
|
1472 | + $attendee_data['ATT_fname'] = ! empty($attendee_data['ATT_fname']) |
|
1473 | 1473 | ? $attendee_data['ATT_fname'] |
1474 | 1474 | : $attendee_data['ATT_email']; |
1475 | - $attendee_data['ATT_lname'] = ! empty( $attendee_data['ATT_lname'] ) |
|
1475 | + $attendee_data['ATT_lname'] = ! empty($attendee_data['ATT_lname']) |
|
1476 | 1476 | ? $attendee_data['ATT_lname'] |
1477 | 1477 | : $attendee_data['ATT_email']; |
1478 | - return EE_Attendee::new_instance( $attendee_data ); |
|
1478 | + return EE_Attendee::new_instance($attendee_data); |
|
1479 | 1479 | } |
1480 | 1480 | |
1481 | 1481 | |
@@ -1493,26 +1493,26 @@ discard block |
||
1493 | 1493 | // how have they chosen to pay? |
1494 | 1494 | $this->checkout->selected_method_of_payment = $this->checkout->transaction->is_free() |
1495 | 1495 | ? 'no_payment_required' |
1496 | - : $this->_get_selected_method_of_payment( true ); |
|
1496 | + : $this->_get_selected_method_of_payment(true); |
|
1497 | 1497 | // choose your own adventure based on method_of_payment |
1498 | - switch ( $this->checkout->selected_method_of_payment ) { |
|
1498 | + switch ($this->checkout->selected_method_of_payment) { |
|
1499 | 1499 | |
1500 | 1500 | case 'events_sold_out' : |
1501 | 1501 | $this->checkout->redirect = true; |
1502 | 1502 | $this->checkout->redirect_url = $this->checkout->cancel_page_url; |
1503 | - $this->checkout->json_response->set_redirect_url( $this->checkout->redirect_url ); |
|
1503 | + $this->checkout->json_response->set_redirect_url($this->checkout->redirect_url); |
|
1504 | 1504 | // mark this reg step as completed |
1505 | 1505 | $this->set_completed(); |
1506 | 1506 | return false; |
1507 | 1507 | break; |
1508 | 1508 | |
1509 | 1509 | case 'payments_closed' : |
1510 | - if ( apply_filters( |
|
1510 | + if (apply_filters( |
|
1511 | 1511 | 'FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__payments_closed__display_success', |
1512 | 1512 | false |
1513 | - ) ) { |
|
1513 | + )) { |
|
1514 | 1514 | EE_Error::add_success( |
1515 | - __( 'no payment required at this time.', 'event_espresso' ), |
|
1515 | + __('no payment required at this time.', 'event_espresso'), |
|
1516 | 1516 | __FILE__, |
1517 | 1517 | __FUNCTION__, |
1518 | 1518 | __LINE__ |
@@ -1524,12 +1524,12 @@ discard block |
||
1524 | 1524 | break; |
1525 | 1525 | |
1526 | 1526 | case 'no_payment_required' : |
1527 | - if ( apply_filters( |
|
1527 | + if (apply_filters( |
|
1528 | 1528 | 'FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__no_payment_required__display_success', |
1529 | 1529 | false |
1530 | - ) ) { |
|
1530 | + )) { |
|
1531 | 1531 | EE_Error::add_success( |
1532 | - __( 'no payment required.', 'event_espresso' ), |
|
1532 | + __('no payment required.', 'event_espresso'), |
|
1533 | 1533 | __FILE__, |
1534 | 1534 | __FUNCTION__, |
1535 | 1535 | __LINE__ |
@@ -1549,15 +1549,15 @@ discard block |
||
1549 | 1549 | EE_Registry::instance()->SSN->checkout()->revisit |
1550 | 1550 | ); |
1551 | 1551 | // calculate difference between the two arrays |
1552 | - $registrations = array_diff( $registrations, $ejected_registrations ); |
|
1553 | - if ( empty( $registrations ) ) { |
|
1552 | + $registrations = array_diff($registrations, $ejected_registrations); |
|
1553 | + if (empty($registrations)) { |
|
1554 | 1554 | $this->_redirect_because_event_sold_out(); |
1555 | 1555 | return false; |
1556 | 1556 | } |
1557 | 1557 | $payment_successful = $this->_process_payment(); |
1558 | - if ( $payment_successful ) { |
|
1558 | + if ($payment_successful) { |
|
1559 | 1559 | $this->checkout->continue_reg = true; |
1560 | - $this->_maybe_set_completed( $this->checkout->payment_method ); |
|
1560 | + $this->_maybe_set_completed($this->checkout->payment_method); |
|
1561 | 1561 | } else { |
1562 | 1562 | $this->checkout->continue_reg = false; |
1563 | 1563 | } |
@@ -1578,10 +1578,10 @@ discard block |
||
1578 | 1578 | $this->checkout->continue_reg = false; |
1579 | 1579 | // set redirect URL |
1580 | 1580 | $this->checkout->redirect_url = add_query_arg( |
1581 | - array( 'e_reg_url_link' => $this->checkout->reg_url_link ), |
|
1581 | + array('e_reg_url_link' => $this->checkout->reg_url_link), |
|
1582 | 1582 | $this->checkout->current_step->reg_step_url() |
1583 | 1583 | ); |
1584 | - $this->checkout->json_response->set_redirect_url( $this->checkout->redirect_url ); |
|
1584 | + $this->checkout->json_response->set_redirect_url($this->checkout->redirect_url); |
|
1585 | 1585 | } |
1586 | 1586 | |
1587 | 1587 | |
@@ -1594,8 +1594,8 @@ discard block |
||
1594 | 1594 | * @return void |
1595 | 1595 | * @throws \EE_Error |
1596 | 1596 | */ |
1597 | - protected function _maybe_set_completed( EE_Payment_Method $payment_method ) { |
|
1598 | - switch ( $payment_method->type_obj()->payment_occurs() ) { |
|
1597 | + protected function _maybe_set_completed(EE_Payment_Method $payment_method) { |
|
1598 | + switch ($payment_method->type_obj()->payment_occurs()) { |
|
1599 | 1599 | case EE_PMT_Base::offsite : |
1600 | 1600 | break; |
1601 | 1601 | case EE_PMT_Base::onsite : |
@@ -1618,7 +1618,7 @@ discard block |
||
1618 | 1618 | public function update_reg_step() { |
1619 | 1619 | $success = true; |
1620 | 1620 | // if payment required |
1621 | - if ( $this->checkout->transaction->total() > 0 ) { |
|
1621 | + if ($this->checkout->transaction->total() > 0) { |
|
1622 | 1622 | do_action( |
1623 | 1623 | 'AHEE__EE_Single_Page_Checkout__process_finalize_registration__before_gateway', |
1624 | 1624 | $this->checkout->transaction |
@@ -1626,13 +1626,13 @@ discard block |
||
1626 | 1626 | // attempt payment via payment method |
1627 | 1627 | $success = $this->process_reg_step(); |
1628 | 1628 | } |
1629 | - if ( $success && ! $this->checkout->redirect ) { |
|
1629 | + if ($success && ! $this->checkout->redirect) { |
|
1630 | 1630 | $this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn( |
1631 | 1631 | $this->checkout->transaction->ID() |
1632 | 1632 | ); |
1633 | 1633 | // set return URL |
1634 | 1634 | $this->checkout->redirect_url = add_query_arg( |
1635 | - array( 'e_reg_url_link' => $this->checkout->reg_url_link ), |
|
1635 | + array('e_reg_url_link' => $this->checkout->reg_url_link), |
|
1636 | 1636 | $this->checkout->thank_you_page_url |
1637 | 1637 | ); |
1638 | 1638 | } |
@@ -1652,28 +1652,28 @@ discard block |
||
1652 | 1652 | // clear any previous errors related to not selecting a payment method |
1653 | 1653 | // EE_Error::overwrite_errors(); |
1654 | 1654 | // ya gotta make a choice man |
1655 | - if ( empty( $this->checkout->selected_method_of_payment ) ) { |
|
1655 | + if (empty($this->checkout->selected_method_of_payment)) { |
|
1656 | 1656 | $this->checkout->json_response->set_plz_select_method_of_payment( |
1657 | - __( 'Please select a method of payment before proceeding.', 'event_espresso' ) |
|
1657 | + __('Please select a method of payment before proceeding.', 'event_espresso') |
|
1658 | 1658 | ); |
1659 | 1659 | return false; |
1660 | 1660 | } |
1661 | 1661 | // get EE_Payment_Method object |
1662 | - if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment() ) { |
|
1662 | + if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment()) { |
|
1663 | 1663 | return false; |
1664 | 1664 | } |
1665 | 1665 | // setup billing form |
1666 | - if ( $this->checkout->payment_method->is_on_site() ) { |
|
1666 | + if ($this->checkout->payment_method->is_on_site()) { |
|
1667 | 1667 | $this->checkout->billing_form = $this->_get_billing_form_for_payment_method( |
1668 | 1668 | $this->checkout->payment_method |
1669 | 1669 | ); |
1670 | 1670 | // bad billing form ? |
1671 | - if ( ! $this->_billing_form_is_valid() ) { |
|
1671 | + if ( ! $this->_billing_form_is_valid()) { |
|
1672 | 1672 | return false; |
1673 | 1673 | } |
1674 | 1674 | } |
1675 | 1675 | // ensure primary registrant has been fully processed |
1676 | - if ( ! $this->_setup_primary_registrant_prior_to_payment() ) { |
|
1676 | + if ( ! $this->_setup_primary_registrant_prior_to_payment()) { |
|
1677 | 1677 | return false; |
1678 | 1678 | } |
1679 | 1679 | /** @type EE_Transaction_Processor $transaction_processor */ |
@@ -1681,12 +1681,12 @@ discard block |
||
1681 | 1681 | // in case a registrant leaves to an Off-Site Gateway and never returns, we want to approve any registrations for events with a default reg status of Approved |
1682 | 1682 | //$transaction_processor->toggle_registration_statuses_for_default_approved_events( $this->checkout->transaction, $this->checkout->reg_cache_where_params ); |
1683 | 1683 | // attempt payment |
1684 | - $payment = $this->_attempt_payment( $this->checkout->payment_method ); |
|
1684 | + $payment = $this->_attempt_payment($this->checkout->payment_method); |
|
1685 | 1685 | // process results |
1686 | - $payment = $this->_validate_payment( $payment ); |
|
1687 | - $payment = $this->_post_payment_processing( $payment ); |
|
1686 | + $payment = $this->_validate_payment($payment); |
|
1687 | + $payment = $this->_post_payment_processing($payment); |
|
1688 | 1688 | // verify payment |
1689 | - if ( $payment instanceof EE_Payment ) { |
|
1689 | + if ($payment instanceof EE_Payment) { |
|
1690 | 1690 | // store that for later |
1691 | 1691 | $this->checkout->payment = $payment; |
1692 | 1692 | // we can also consider the TXN to not have been failed, so temporarily upgrade it's status to abandoned |
@@ -1700,7 +1700,7 @@ discard block |
||
1700 | 1700 | } else { |
1701 | 1701 | return false; |
1702 | 1702 | } |
1703 | - } else if ( $payment === true ) { |
|
1703 | + } else if ($payment === true) { |
|
1704 | 1704 | // please note that offline payment methods will NOT make a payment, |
1705 | 1705 | // but instead just mark themselves as the PMD_ID on the transaction, and return true |
1706 | 1706 | $this->checkout->payment = $payment; |
@@ -1725,7 +1725,7 @@ discard block |
||
1725 | 1725 | ); |
1726 | 1726 | $html = $payment_method_billing_info->get_html(); |
1727 | 1727 | $html .= $this->checkout->redirect_form; |
1728 | - EE_Registry::instance()->REQ->add_output( $html ); |
|
1728 | + EE_Registry::instance()->REQ->add_output($html); |
|
1729 | 1729 | return true; |
1730 | 1730 | } |
1731 | 1731 | |
@@ -1739,28 +1739,28 @@ discard block |
||
1739 | 1739 | * @throws \EE_Error |
1740 | 1740 | */ |
1741 | 1741 | private function _billing_form_is_valid() { |
1742 | - if ( ! $this->checkout->payment_method->type_obj()->has_billing_form() ) { |
|
1742 | + if ( ! $this->checkout->payment_method->type_obj()->has_billing_form()) { |
|
1743 | 1743 | return true; |
1744 | 1744 | } |
1745 | - if ( $this->checkout->billing_form instanceof EE_Billing_Info_Form ) { |
|
1746 | - if ( $this->checkout->billing_form->was_submitted() ) { |
|
1745 | + if ($this->checkout->billing_form instanceof EE_Billing_Info_Form) { |
|
1746 | + if ($this->checkout->billing_form->was_submitted()) { |
|
1747 | 1747 | $this->checkout->billing_form->receive_form_submission(); |
1748 | - if ( $this->checkout->billing_form->is_valid() ) { |
|
1748 | + if ($this->checkout->billing_form->is_valid()) { |
|
1749 | 1749 | return true; |
1750 | 1750 | } |
1751 | 1751 | $validation_errors = $this->checkout->billing_form->get_validation_errors_accumulated(); |
1752 | 1752 | $error_strings = array(); |
1753 | - foreach ( $validation_errors as $validation_error ) { |
|
1754 | - if ( $validation_error instanceof EE_Validation_Error ) { |
|
1753 | + foreach ($validation_errors as $validation_error) { |
|
1754 | + if ($validation_error instanceof EE_Validation_Error) { |
|
1755 | 1755 | $form_section = $validation_error->get_form_section(); |
1756 | - if ( $form_section instanceof EE_Form_Input_Base ) { |
|
1756 | + if ($form_section instanceof EE_Form_Input_Base) { |
|
1757 | 1757 | $label = $form_section->html_label_text(); |
1758 | - } elseif ( $form_section instanceof EE_Form_Section_Base ) { |
|
1758 | + } elseif ($form_section instanceof EE_Form_Section_Base) { |
|
1759 | 1759 | $label = $form_section->name(); |
1760 | 1760 | } else { |
1761 | - $label = __( 'Validation Error', 'event_espresso' ); |
|
1761 | + $label = __('Validation Error', 'event_espresso'); |
|
1762 | 1762 | } |
1763 | - $error_strings[] = sprintf( '%1$s: %2$s', $label, $validation_error->getMessage() ); |
|
1763 | + $error_strings[] = sprintf('%1$s: %2$s', $label, $validation_error->getMessage()); |
|
1764 | 1764 | } |
1765 | 1765 | } |
1766 | 1766 | EE_Error::add_error( |
@@ -1770,7 +1770,7 @@ discard block |
||
1770 | 1770 | 'event_espresso' |
1771 | 1771 | ), |
1772 | 1772 | '<br/>', |
1773 | - implode( '<br/>', $error_strings ) |
|
1773 | + implode('<br/>', $error_strings) |
|
1774 | 1774 | ), |
1775 | 1775 | __FILE__, |
1776 | 1776 | __FUNCTION__, |
@@ -1789,7 +1789,7 @@ discard block |
||
1789 | 1789 | } |
1790 | 1790 | } else { |
1791 | 1791 | EE_Error::add_error( |
1792 | - __( 'The submitted billing form is invalid possibly due to a technical reason.', 'event_espresso' ), |
|
1792 | + __('The submitted billing form is invalid possibly due to a technical reason.', 'event_espresso'), |
|
1793 | 1793 | __FILE__, |
1794 | 1794 | __FUNCTION__, |
1795 | 1795 | __LINE__ |
@@ -1828,7 +1828,7 @@ discard block |
||
1828 | 1828 | // save the TXN ( which clears cached copy of primary_registration) |
1829 | 1829 | $this->checkout->transaction->save(); |
1830 | 1830 | // grab TXN ID and save it to the primary_registration |
1831 | - $primary_registration->set_transaction_id( $this->checkout->transaction->ID() ); |
|
1831 | + $primary_registration->set_transaction_id($this->checkout->transaction->ID()); |
|
1832 | 1832 | // save what we have so far |
1833 | 1833 | $primary_registration->save(); |
1834 | 1834 | return true; |
@@ -1846,7 +1846,7 @@ discard block |
||
1846 | 1846 | private function _capture_primary_registration_data_from_billing_form() { |
1847 | 1847 | // convert billing form data into an attendee |
1848 | 1848 | $this->checkout->primary_attendee_obj = $this->checkout->billing_form->create_attendee_from_billing_form_data(); |
1849 | - if ( ! $this->checkout->primary_attendee_obj instanceof EE_Attendee ) { |
|
1849 | + if ( ! $this->checkout->primary_attendee_obj instanceof EE_Attendee) { |
|
1850 | 1850 | EE_Error::add_error( |
1851 | 1851 | sprintf( |
1852 | 1852 | __( |
@@ -1854,7 +1854,7 @@ discard block |
||
1854 | 1854 | 'event_espresso' |
1855 | 1855 | ), |
1856 | 1856 | '<br/>', |
1857 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
1857 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
1858 | 1858 | ), |
1859 | 1859 | __FILE__, |
1860 | 1860 | __FUNCTION__, |
@@ -1863,7 +1863,7 @@ discard block |
||
1863 | 1863 | return false; |
1864 | 1864 | } |
1865 | 1865 | $primary_registration = $this->checkout->transaction->primary_registration(); |
1866 | - if ( ! $primary_registration instanceof EE_Registration ) { |
|
1866 | + if ( ! $primary_registration instanceof EE_Registration) { |
|
1867 | 1867 | EE_Error::add_error( |
1868 | 1868 | sprintf( |
1869 | 1869 | __( |
@@ -1871,7 +1871,7 @@ discard block |
||
1871 | 1871 | 'event_espresso' |
1872 | 1872 | ), |
1873 | 1873 | '<br/>', |
1874 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
1874 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
1875 | 1875 | ), |
1876 | 1876 | __FILE__, |
1877 | 1877 | __FUNCTION__, |
@@ -1879,7 +1879,7 @@ discard block |
||
1879 | 1879 | ); |
1880 | 1880 | return false; |
1881 | 1881 | } |
1882 | - if ( ! $primary_registration->_add_relation_to( $this->checkout->primary_attendee_obj, 'Attendee' ) |
|
1882 | + if ( ! $primary_registration->_add_relation_to($this->checkout->primary_attendee_obj, 'Attendee') |
|
1883 | 1883 | instanceof |
1884 | 1884 | EE_Attendee |
1885 | 1885 | ) { |
@@ -1890,7 +1890,7 @@ discard block |
||
1890 | 1890 | 'event_espresso' |
1891 | 1891 | ), |
1892 | 1892 | '<br/>', |
1893 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
1893 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
1894 | 1894 | ), |
1895 | 1895 | __FILE__, |
1896 | 1896 | __FUNCTION__, |
@@ -1899,9 +1899,9 @@ discard block |
||
1899 | 1899 | return false; |
1900 | 1900 | } |
1901 | 1901 | /** @type EE_Registration_Processor $registration_processor */ |
1902 | - $registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' ); |
|
1902 | + $registration_processor = EE_Registry::instance()->load_class('Registration_Processor'); |
|
1903 | 1903 | // at this point, we should have enough details about the registrant to consider the registration NOT incomplete |
1904 | - $registration_processor->toggle_incomplete_registration_status_to_default( $primary_registration ); |
|
1904 | + $registration_processor->toggle_incomplete_registration_status_to_default($primary_registration); |
|
1905 | 1905 | return true; |
1906 | 1906 | } |
1907 | 1907 | |
@@ -1916,22 +1916,22 @@ discard block |
||
1916 | 1916 | * @throws \EE_Error |
1917 | 1917 | */ |
1918 | 1918 | private function _get_payment_method_for_selected_method_of_payment() { |
1919 | - if ( $this->checkout->selected_method_of_payment === 'events_sold_out' ) { |
|
1919 | + if ($this->checkout->selected_method_of_payment === 'events_sold_out') { |
|
1920 | 1920 | $this->_redirect_because_event_sold_out(); |
1921 | 1921 | return null; |
1922 | 1922 | } |
1923 | 1923 | // get EE_Payment_Method object |
1924 | - if ( isset( $this->checkout->available_payment_methods[ $this->checkout->selected_method_of_payment ] ) ) { |
|
1925 | - $payment_method = $this->checkout->available_payment_methods[ $this->checkout->selected_method_of_payment ]; |
|
1924 | + if (isset($this->checkout->available_payment_methods[$this->checkout->selected_method_of_payment])) { |
|
1925 | + $payment_method = $this->checkout->available_payment_methods[$this->checkout->selected_method_of_payment]; |
|
1926 | 1926 | } else { |
1927 | 1927 | // load EEM_Payment_Method |
1928 | - EE_Registry::instance()->load_model( 'Payment_Method' ); |
|
1928 | + EE_Registry::instance()->load_model('Payment_Method'); |
|
1929 | 1929 | /** @type EEM_Payment_Method $EEM_Payment_Method */ |
1930 | 1930 | $EEM_Payment_Method = EE_Registry::instance()->LIB->EEM_Payment_Method; |
1931 | - $payment_method = $EEM_Payment_Method->get_one_by_slug( $this->checkout->selected_method_of_payment ); |
|
1931 | + $payment_method = $EEM_Payment_Method->get_one_by_slug($this->checkout->selected_method_of_payment); |
|
1932 | 1932 | } |
1933 | 1933 | // verify $payment_method |
1934 | - if ( ! $payment_method instanceof EE_Payment_Method ) { |
|
1934 | + if ( ! $payment_method instanceof EE_Payment_Method) { |
|
1935 | 1935 | // not a payment |
1936 | 1936 | EE_Error::add_error( |
1937 | 1937 | sprintf( |
@@ -1940,7 +1940,7 @@ discard block |
||
1940 | 1940 | 'event_espresso' |
1941 | 1941 | ), |
1942 | 1942 | '<br/>', |
1943 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
1943 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
1944 | 1944 | ), |
1945 | 1945 | __FILE__, |
1946 | 1946 | __FUNCTION__, |
@@ -1949,7 +1949,7 @@ discard block |
||
1949 | 1949 | return null; |
1950 | 1950 | } |
1951 | 1951 | // and verify it has a valid Payment_Method Type object |
1952 | - if ( ! $payment_method->type_obj() instanceof EE_PMT_Base ) { |
|
1952 | + if ( ! $payment_method->type_obj() instanceof EE_PMT_Base) { |
|
1953 | 1953 | // not a payment |
1954 | 1954 | EE_Error::add_error( |
1955 | 1955 | sprintf( |
@@ -1958,7 +1958,7 @@ discard block |
||
1958 | 1958 | 'event_espresso' |
1959 | 1959 | ), |
1960 | 1960 | '<br/>', |
1961 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
1961 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
1962 | 1962 | ), |
1963 | 1963 | __FILE__, |
1964 | 1964 | __FUNCTION__, |
@@ -1979,29 +1979,29 @@ discard block |
||
1979 | 1979 | * @return mixed EE_Payment | boolean |
1980 | 1980 | * @throws \EE_Error |
1981 | 1981 | */ |
1982 | - private function _attempt_payment( EE_Payment_Method $payment_method ) { |
|
1982 | + private function _attempt_payment(EE_Payment_Method $payment_method) { |
|
1983 | 1983 | $payment = null; |
1984 | 1984 | $this->checkout->transaction->save(); |
1985 | - $payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' ); |
|
1986 | - if ( ! $payment_processor instanceof EE_Payment_Processor ) { |
|
1985 | + $payment_processor = EE_Registry::instance()->load_core('Payment_Processor'); |
|
1986 | + if ( ! $payment_processor instanceof EE_Payment_Processor) { |
|
1987 | 1987 | return false; |
1988 | 1988 | } |
1989 | 1989 | try { |
1990 | - $payment_processor->set_revisit( $this->checkout->revisit ); |
|
1990 | + $payment_processor->set_revisit($this->checkout->revisit); |
|
1991 | 1991 | // generate payment object |
1992 | 1992 | $payment = $payment_processor->process_payment( |
1993 | 1993 | $payment_method, |
1994 | 1994 | $this->checkout->transaction, |
1995 | 1995 | $this->checkout->amount_owing, |
1996 | 1996 | $this->checkout->billing_form, |
1997 | - $this->_get_return_url( $payment_method ), |
|
1997 | + $this->_get_return_url($payment_method), |
|
1998 | 1998 | 'CART', |
1999 | 1999 | $this->checkout->admin_request, |
2000 | 2000 | true, |
2001 | 2001 | $this->reg_step_url() |
2002 | 2002 | ); |
2003 | - } catch ( Exception $e ) { |
|
2004 | - $this->_handle_payment_processor_exception( $e ); |
|
2003 | + } catch (Exception $e) { |
|
2004 | + $this->_handle_payment_processor_exception($e); |
|
2005 | 2005 | } |
2006 | 2006 | return $payment; |
2007 | 2007 | } |
@@ -2016,7 +2016,7 @@ discard block |
||
2016 | 2016 | * @return void |
2017 | 2017 | * @throws \EE_Error |
2018 | 2018 | */ |
2019 | - protected function _handle_payment_processor_exception( Exception $e ) { |
|
2019 | + protected function _handle_payment_processor_exception(Exception $e) { |
|
2020 | 2020 | EE_Error::add_error( |
2021 | 2021 | sprintf( |
2022 | 2022 | __( |
@@ -2024,7 +2024,7 @@ discard block |
||
2024 | 2024 | 'event_espresso' |
2025 | 2025 | ), |
2026 | 2026 | '<br/>', |
2027 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ), |
|
2027 | + EE_Registry::instance()->CFG->organization->get_pretty('email'), |
|
2028 | 2028 | $e->getMessage(), |
2029 | 2029 | $e->getFile(), |
2030 | 2030 | $e->getLine() |
@@ -2045,9 +2045,9 @@ discard block |
||
2045 | 2045 | * @return string |
2046 | 2046 | * @throws \EE_Error |
2047 | 2047 | */ |
2048 | - protected function _get_return_url( EE_Payment_Method $payment_method ) { |
|
2048 | + protected function _get_return_url(EE_Payment_Method $payment_method) { |
|
2049 | 2049 | $return_url = ''; |
2050 | - switch ( $payment_method->type_obj()->payment_occurs() ) { |
|
2050 | + switch ($payment_method->type_obj()->payment_occurs()) { |
|
2051 | 2051 | case EE_PMT_Base::offsite : |
2052 | 2052 | $return_url = add_query_arg( |
2053 | 2053 | array( |
@@ -2076,12 +2076,12 @@ discard block |
||
2076 | 2076 | * @return EE_Payment | FALSE |
2077 | 2077 | * @throws \EE_Error |
2078 | 2078 | */ |
2079 | - private function _validate_payment( $payment = null ) { |
|
2080 | - if ( $this->checkout->payment_method->is_off_line() ) { |
|
2079 | + private function _validate_payment($payment = null) { |
|
2080 | + if ($this->checkout->payment_method->is_off_line()) { |
|
2081 | 2081 | return true; |
2082 | 2082 | } |
2083 | 2083 | // verify payment object |
2084 | - if ( ! $payment instanceof EE_Payment ) { |
|
2084 | + if ( ! $payment instanceof EE_Payment) { |
|
2085 | 2085 | // not a payment |
2086 | 2086 | EE_Error::add_error( |
2087 | 2087 | sprintf( |
@@ -2090,7 +2090,7 @@ discard block |
||
2090 | 2090 | 'event_espresso' |
2091 | 2091 | ), |
2092 | 2092 | '<br/>', |
2093 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
2093 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
2094 | 2094 | ), |
2095 | 2095 | __FILE__, |
2096 | 2096 | __FUNCTION__, |
@@ -2111,27 +2111,27 @@ discard block |
||
2111 | 2111 | * @return bool |
2112 | 2112 | * @throws \EE_Error |
2113 | 2113 | */ |
2114 | - private function _post_payment_processing( $payment = null ) { |
|
2114 | + private function _post_payment_processing($payment = null) { |
|
2115 | 2115 | // Off-Line payment? |
2116 | - if ( $payment === true ) { |
|
2116 | + if ($payment === true) { |
|
2117 | 2117 | //$this->_setup_redirect_for_next_step(); |
2118 | 2118 | return true; |
2119 | 2119 | // On-Site payment? |
2120 | - } else if ( $this->checkout->payment_method->is_on_site() ) { |
|
2121 | - if ( ! $this->_process_payment_status( $payment, EE_PMT_Base::onsite ) ) { |
|
2120 | + } else if ($this->checkout->payment_method->is_on_site()) { |
|
2121 | + if ( ! $this->_process_payment_status($payment, EE_PMT_Base::onsite)) { |
|
2122 | 2122 | //$this->_setup_redirect_for_next_step(); |
2123 | 2123 | $this->checkout->continue_reg = false; |
2124 | 2124 | } |
2125 | 2125 | // Off-Site payment? |
2126 | - } else if ( $this->checkout->payment_method->is_off_site() ) { |
|
2126 | + } else if ($this->checkout->payment_method->is_off_site()) { |
|
2127 | 2127 | // if a payment object was made and it specifies a redirect url, then we'll setup that redirect info |
2128 | - if ( $payment instanceof EE_Payment && $payment->redirect_url() ) { |
|
2129 | - do_action( 'AHEE_log', __CLASS__, __FUNCTION__, $payment->redirect_url(), '$payment->redirect_url()' ); |
|
2128 | + if ($payment instanceof EE_Payment && $payment->redirect_url()) { |
|
2129 | + do_action('AHEE_log', __CLASS__, __FUNCTION__, $payment->redirect_url(), '$payment->redirect_url()'); |
|
2130 | 2130 | $this->checkout->redirect = true; |
2131 | 2131 | $this->checkout->redirect_form = $payment->redirect_form(); |
2132 | - $this->checkout->redirect_url = $this->reg_step_url( 'redirect_form' ); |
|
2132 | + $this->checkout->redirect_url = $this->reg_step_url('redirect_form'); |
|
2133 | 2133 | // set JSON response |
2134 | - $this->checkout->json_response->set_redirect_form( $this->checkout->redirect_form ); |
|
2134 | + $this->checkout->json_response->set_redirect_form($this->checkout->redirect_form); |
|
2135 | 2135 | // set cron job for finalizing the TXN |
2136 | 2136 | // in case the user does not return from the off-site gateway |
2137 | 2137 | EE_Cron_Tasks::schedule_finalize_abandoned_transactions_check( |
@@ -2139,7 +2139,7 @@ discard block |
||
2139 | 2139 | $this->checkout->transaction->ID() |
2140 | 2140 | ); |
2141 | 2141 | // and lastly, let's bump the payment status to pending |
2142 | - $payment->set_status( EEM_Payment::status_id_pending ); |
|
2142 | + $payment->set_status(EEM_Payment::status_id_pending); |
|
2143 | 2143 | $payment->save(); |
2144 | 2144 | } else { |
2145 | 2145 | // not a payment |
@@ -2151,7 +2151,7 @@ discard block |
||
2151 | 2151 | 'event_espresso' |
2152 | 2152 | ), |
2153 | 2153 | '<br/>', |
2154 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
2154 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
2155 | 2155 | ), |
2156 | 2156 | __FILE__, |
2157 | 2157 | __FUNCTION__, |
@@ -2189,21 +2189,21 @@ discard block |
||
2189 | 2189 | * @return bool |
2190 | 2190 | * @throws \EE_Error |
2191 | 2191 | */ |
2192 | - private function _process_payment_status( $payment, $payment_occurs = EE_PMT_Base::offline ) { |
|
2192 | + private function _process_payment_status($payment, $payment_occurs = EE_PMT_Base::offline) { |
|
2193 | 2193 | // off-line payment? carry on |
2194 | - if ( $payment_occurs === EE_PMT_Base::offline ) { |
|
2194 | + if ($payment_occurs === EE_PMT_Base::offline) { |
|
2195 | 2195 | return true; |
2196 | 2196 | } |
2197 | 2197 | // verify payment validity |
2198 | - if ( $payment instanceof EE_Payment ) { |
|
2199 | - do_action( 'AHEE_log', __CLASS__, __FUNCTION__, $payment->status(), '$payment->status()' ); |
|
2198 | + if ($payment instanceof EE_Payment) { |
|
2199 | + do_action('AHEE_log', __CLASS__, __FUNCTION__, $payment->status(), '$payment->status()'); |
|
2200 | 2200 | $msg = $payment->gateway_response(); |
2201 | 2201 | // check results |
2202 | - switch ( $payment->status() ) { |
|
2202 | + switch ($payment->status()) { |
|
2203 | 2203 | // good payment |
2204 | 2204 | case EEM_Payment::status_id_approved : |
2205 | 2205 | EE_Error::add_success( |
2206 | - __( 'Your payment was processed successfully.', 'event_espresso' ), |
|
2206 | + __('Your payment was processed successfully.', 'event_espresso'), |
|
2207 | 2207 | __FILE__, |
2208 | 2208 | __FUNCTION__, |
2209 | 2209 | __LINE__ |
@@ -2212,45 +2212,45 @@ discard block |
||
2212 | 2212 | break; |
2213 | 2213 | // slow payment |
2214 | 2214 | case EEM_Payment::status_id_pending : |
2215 | - if ( empty( $msg ) ) { |
|
2215 | + if (empty($msg)) { |
|
2216 | 2216 | $msg = __( |
2217 | 2217 | 'Your payment appears to have been processed successfully, but the Instant Payment Notification has not yet been received. It should arrive shortly.', |
2218 | 2218 | 'event_espresso' |
2219 | 2219 | ); |
2220 | 2220 | } |
2221 | - EE_Error::add_success( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
2221 | + EE_Error::add_success($msg, __FILE__, __FUNCTION__, __LINE__); |
|
2222 | 2222 | return true; |
2223 | 2223 | break; |
2224 | 2224 | // don't wanna payment |
2225 | 2225 | case EEM_Payment::status_id_cancelled : |
2226 | - if ( empty( $msg ) ) { |
|
2226 | + if (empty($msg)) { |
|
2227 | 2227 | $msg = _n( |
2228 | 2228 | 'Payment cancelled. Please try again.', |
2229 | 2229 | 'Payment cancelled. Please try again or select another method of payment.', |
2230 | - count( $this->checkout->available_payment_methods ), |
|
2230 | + count($this->checkout->available_payment_methods), |
|
2231 | 2231 | 'event_espresso' |
2232 | 2232 | ); |
2233 | 2233 | } |
2234 | - EE_Error::add_attention( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
2234 | + EE_Error::add_attention($msg, __FILE__, __FUNCTION__, __LINE__); |
|
2235 | 2235 | return false; |
2236 | 2236 | break; |
2237 | 2237 | // not enough payment |
2238 | 2238 | case EEM_Payment::status_id_declined : |
2239 | - if ( empty( $msg ) ) { |
|
2239 | + if (empty($msg)) { |
|
2240 | 2240 | $msg = _n( |
2241 | 2241 | 'We\'re sorry but your payment was declined. Please try again.', |
2242 | 2242 | 'We\'re sorry but your payment was declined. Please try again or select another method of payment.', |
2243 | - count( $this->checkout->available_payment_methods ), |
|
2243 | + count($this->checkout->available_payment_methods), |
|
2244 | 2244 | 'event_espresso' |
2245 | 2245 | ); |
2246 | 2246 | } |
2247 | - EE_Error::add_attention( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
2247 | + EE_Error::add_attention($msg, __FILE__, __FUNCTION__, __LINE__); |
|
2248 | 2248 | return false; |
2249 | 2249 | break; |
2250 | 2250 | // bad payment |
2251 | 2251 | case EEM_Payment::status_id_failed : |
2252 | - if ( ! empty( $msg ) ) { |
|
2253 | - EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
2252 | + if ( ! empty($msg)) { |
|
2253 | + EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
2254 | 2254 | return false; |
2255 | 2255 | } |
2256 | 2256 | // default to error below |
@@ -2259,7 +2259,7 @@ discard block |
||
2259 | 2259 | } |
2260 | 2260 | // off-site payment gateway responses are too unreliable, so let's just assume that |
2261 | 2261 | // the payment processing is just running slower than the registrant's request |
2262 | - if ( $payment_occurs === EE_PMT_Base::offsite ) { |
|
2262 | + if ($payment_occurs === EE_PMT_Base::offsite) { |
|
2263 | 2263 | return true; |
2264 | 2264 | } |
2265 | 2265 | EE_Error::add_error( |
@@ -2269,7 +2269,7 @@ discard block |
||
2269 | 2269 | 'event_espresso' |
2270 | 2270 | ), |
2271 | 2271 | '<br/>', |
2272 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
2272 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
2273 | 2273 | ), |
2274 | 2274 | __FILE__, |
2275 | 2275 | __FUNCTION__, |
@@ -2302,13 +2302,13 @@ discard block |
||
2302 | 2302 | public function process_gateway_response() { |
2303 | 2303 | $payment = null; |
2304 | 2304 | // how have they chosen to pay? |
2305 | - $this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( true ); |
|
2305 | + $this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(true); |
|
2306 | 2306 | // get EE_Payment_Method object |
2307 | - if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment() ) { |
|
2307 | + if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment()) { |
|
2308 | 2308 | $this->checkout->continue_reg = false; |
2309 | 2309 | return false; |
2310 | 2310 | } |
2311 | - if ( ! $this->checkout->payment_method->is_off_site() ) { |
|
2311 | + if ( ! $this->checkout->payment_method->is_off_site()) { |
|
2312 | 2312 | return false; |
2313 | 2313 | } |
2314 | 2314 | $this->_validate_offsite_return(); |
@@ -2322,23 +2322,23 @@ discard block |
||
2322 | 2322 | // true |
2323 | 2323 | //); |
2324 | 2324 | // verify TXN |
2325 | - if ( $this->checkout->transaction instanceof EE_Transaction ) { |
|
2325 | + if ($this->checkout->transaction instanceof EE_Transaction) { |
|
2326 | 2326 | $gateway = $this->checkout->payment_method->type_obj()->get_gateway(); |
2327 | - if ( ! $gateway instanceof EE_Offsite_Gateway ) { |
|
2327 | + if ( ! $gateway instanceof EE_Offsite_Gateway) { |
|
2328 | 2328 | $this->checkout->continue_reg = false; |
2329 | 2329 | return false; |
2330 | 2330 | } |
2331 | - $payment = $this->_process_off_site_payment( $gateway ); |
|
2332 | - $payment = $this->_process_cancelled_payments( $payment ); |
|
2333 | - $payment = $this->_validate_payment( $payment ); |
|
2331 | + $payment = $this->_process_off_site_payment($gateway); |
|
2332 | + $payment = $this->_process_cancelled_payments($payment); |
|
2333 | + $payment = $this->_validate_payment($payment); |
|
2334 | 2334 | // if payment was not declined by the payment gateway or cancelled by the registrant |
2335 | - if ( $this->_process_payment_status( $payment, EE_PMT_Base::offsite ) ) { |
|
2335 | + if ($this->_process_payment_status($payment, EE_PMT_Base::offsite)) { |
|
2336 | 2336 | //$this->_setup_redirect_for_next_step(); |
2337 | 2337 | // store that for later |
2338 | 2338 | $this->checkout->payment = $payment; |
2339 | 2339 | // mark this reg step as completed, as long as gateway doesn't use a separate IPN request, |
2340 | 2340 | // because we will complete this step during the IPN processing then |
2341 | - if ( $gateway instanceof EE_Offsite_Gateway && ! $this->handle_IPN_in_this_request() ) { |
|
2341 | + if ($gateway instanceof EE_Offsite_Gateway && ! $this->handle_IPN_in_this_request()) { |
|
2342 | 2342 | $this->set_completed(); |
2343 | 2343 | } |
2344 | 2344 | return true; |
@@ -2362,21 +2362,21 @@ discard block |
||
2362 | 2362 | * @throws \EE_Error |
2363 | 2363 | */ |
2364 | 2364 | private function _validate_offsite_return() { |
2365 | - $TXN_ID = (int)EE_Registry::instance()->REQ->get( 'spco_txn', 0 ); |
|
2366 | - if ( $TXN_ID !== $this->checkout->transaction->ID() ) { |
|
2365 | + $TXN_ID = (int) EE_Registry::instance()->REQ->get('spco_txn', 0); |
|
2366 | + if ($TXN_ID !== $this->checkout->transaction->ID()) { |
|
2367 | 2367 | // Houston... we might have a problem |
2368 | 2368 | $invalid_TXN = false; |
2369 | 2369 | // first gather some info |
2370 | - $valid_TXN = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID ); |
|
2370 | + $valid_TXN = EEM_Transaction::instance()->get_one_by_ID($TXN_ID); |
|
2371 | 2371 | $primary_registrant = $valid_TXN instanceof EE_Transaction |
2372 | 2372 | ? $valid_TXN->primary_registration() |
2373 | 2373 | : null; |
2374 | 2374 | // let's start by retrieving the cart for this TXN |
2375 | - $cart = $this->checkout->get_cart_for_transaction( $this->checkout->transaction ); |
|
2376 | - if ( $cart instanceof EE_Cart ) { |
|
2375 | + $cart = $this->checkout->get_cart_for_transaction($this->checkout->transaction); |
|
2376 | + if ($cart instanceof EE_Cart) { |
|
2377 | 2377 | // verify that the current cart has tickets |
2378 | 2378 | $tickets = $cart->get_tickets(); |
2379 | - if ( empty( $tickets ) ) { |
|
2379 | + if (empty($tickets)) { |
|
2380 | 2380 | $invalid_TXN = true; |
2381 | 2381 | } |
2382 | 2382 | } else { |
@@ -2386,35 +2386,35 @@ discard block |
||
2386 | 2386 | ? $primary_registrant->session_ID() |
2387 | 2387 | : null; |
2388 | 2388 | // validate current Session ID and compare against valid TXN session ID |
2389 | - if ( EE_Session::instance()->id() === null ) { |
|
2389 | + if (EE_Session::instance()->id() === null) { |
|
2390 | 2390 | $invalid_TXN = true; |
2391 | - } else if ( EE_Session::instance()->id() === $valid_TXN_SID ) { |
|
2391 | + } else if (EE_Session::instance()->id() === $valid_TXN_SID) { |
|
2392 | 2392 | // WARNING !!! |
2393 | 2393 | // this could be PayPal sending back duplicate requests (ya they do that) |
2394 | 2394 | // or it **could** mean someone is simply registering AGAIN after having just done so |
2395 | 2395 | // so now we need to determine if this current TXN looks valid or not |
2396 | 2396 | // has this step even been started ? |
2397 | - if ( $this->checkout->transaction->reg_step_completed( $this->slug() === false ) |
|
2397 | + if ($this->checkout->transaction->reg_step_completed($this->slug() === false) |
|
2398 | 2398 | ) { |
2399 | 2399 | // really? you're half way through this reg step, but you never started it ? |
2400 | 2400 | $invalid_TXN = true; |
2401 | 2401 | } |
2402 | 2402 | } |
2403 | - if ( $invalid_TXN ) { |
|
2403 | + if ($invalid_TXN) { |
|
2404 | 2404 | // is the valid TXN completed ? |
2405 | - if ( $valid_TXN instanceof EE_Transaction ) { |
|
2405 | + if ($valid_TXN instanceof EE_Transaction) { |
|
2406 | 2406 | // has this step even been started ? |
2407 | - $reg_step_completed = $valid_TXN->reg_step_completed( $this->slug() ); |
|
2408 | - if ( $reg_step_completed !== false && $reg_step_completed !== true ) { |
|
2407 | + $reg_step_completed = $valid_TXN->reg_step_completed($this->slug()); |
|
2408 | + if ($reg_step_completed !== false && $reg_step_completed !== true) { |
|
2409 | 2409 | // so it **looks** like this is a double request from PayPal |
2410 | 2410 | // so let's try to pick up where we left off |
2411 | 2411 | $this->checkout->transaction = $valid_TXN; |
2412 | - $this->checkout->refresh_all_entities( true ); |
|
2412 | + $this->checkout->refresh_all_entities(true); |
|
2413 | 2413 | return; |
2414 | 2414 | } |
2415 | 2415 | } |
2416 | 2416 | // you appear to be lost? |
2417 | - $this->_redirect_wayward_request( $primary_registrant ); |
|
2417 | + $this->_redirect_wayward_request($primary_registrant); |
|
2418 | 2418 | } |
2419 | 2419 | } |
2420 | 2420 | } |
@@ -2429,14 +2429,14 @@ discard block |
||
2429 | 2429 | * @return bool |
2430 | 2430 | * @throws \EE_Error |
2431 | 2431 | */ |
2432 | - private function _redirect_wayward_request( EE_Registration $primary_registrant ) { |
|
2433 | - if ( ! $primary_registrant instanceof EE_Registration ) { |
|
2432 | + private function _redirect_wayward_request(EE_Registration $primary_registrant) { |
|
2433 | + if ( ! $primary_registrant instanceof EE_Registration) { |
|
2434 | 2434 | // try redirecting based on the current TXN |
2435 | 2435 | $primary_registrant = $this->checkout->transaction instanceof EE_Transaction |
2436 | 2436 | ? $this->checkout->transaction->primary_registration() |
2437 | 2437 | : null; |
2438 | 2438 | } |
2439 | - if ( ! $primary_registrant instanceof EE_Registration ) { |
|
2439 | + if ( ! $primary_registrant instanceof EE_Registration) { |
|
2440 | 2440 | EE_Error::add_error( |
2441 | 2441 | sprintf( |
2442 | 2442 | __( |
@@ -2444,7 +2444,7 @@ discard block |
||
2444 | 2444 | 'event_espresso' |
2445 | 2445 | ), |
2446 | 2446 | '<br/>', |
2447 | - EE_Registry::instance()->CFG->organization->get_pretty( 'email' ) |
|
2447 | + EE_Registry::instance()->CFG->organization->get_pretty('email') |
|
2448 | 2448 | ), |
2449 | 2449 | __FILE__, |
2450 | 2450 | __FUNCTION__, |
@@ -2475,17 +2475,17 @@ discard block |
||
2475 | 2475 | * @return \EE_Payment |
2476 | 2476 | * @throws \EE_Error |
2477 | 2477 | */ |
2478 | - private function _process_off_site_payment( EE_Offsite_Gateway $gateway ) { |
|
2478 | + private function _process_off_site_payment(EE_Offsite_Gateway $gateway) { |
|
2479 | 2479 | try { |
2480 | 2480 | $request_data = \EE_Registry::instance()->REQ->params(); |
2481 | 2481 | // if gateway uses_separate_IPN_request, then we don't have to process the IPN manually |
2482 | 2482 | $this->set_handle_IPN_in_this_request( |
2483 | - $gateway->handle_IPN_in_this_request( $request_data, false ) |
|
2483 | + $gateway->handle_IPN_in_this_request($request_data, false) |
|
2484 | 2484 | ); |
2485 | - if ( $this->handle_IPN_in_this_request() ) { |
|
2485 | + if ($this->handle_IPN_in_this_request()) { |
|
2486 | 2486 | // get payment details and process results |
2487 | 2487 | /** @type EE_Payment_Processor $payment_processor */ |
2488 | - $payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' ); |
|
2488 | + $payment_processor = EE_Registry::instance()->load_core('Payment_Processor'); |
|
2489 | 2489 | $payment = $payment_processor->process_ipn( |
2490 | 2490 | $request_data, |
2491 | 2491 | $this->checkout->transaction, |
@@ -2498,14 +2498,14 @@ discard block |
||
2498 | 2498 | $payment = $this->checkout->transaction->last_payment(); |
2499 | 2499 | //$payment_source = 'last_payment'; |
2500 | 2500 | } |
2501 | - } catch ( Exception $e ) { |
|
2501 | + } catch (Exception $e) { |
|
2502 | 2502 | // let's just eat the exception and try to move on using any previously set payment info |
2503 | 2503 | $payment = $this->checkout->transaction->last_payment(); |
2504 | 2504 | //$payment_source = 'last_payment after Exception'; |
2505 | 2505 | // but if we STILL don't have a payment object |
2506 | - if ( ! $payment instanceof EE_Payment ) { |
|
2506 | + if ( ! $payment instanceof EE_Payment) { |
|
2507 | 2507 | // then we'll object ! ( not object like a thing... but object like what a lawyer says ! ) |
2508 | - $this->_handle_payment_processor_exception( $e ); |
|
2508 | + $this->_handle_payment_processor_exception($e); |
|
2509 | 2509 | } |
2510 | 2510 | } |
2511 | 2511 | // DEBUG LOG |
@@ -2530,13 +2530,13 @@ discard block |
||
2530 | 2530 | * @return EE_Payment | FALSE |
2531 | 2531 | * @throws \EE_Error |
2532 | 2532 | */ |
2533 | - private function _process_cancelled_payments( $payment = null ) { |
|
2533 | + private function _process_cancelled_payments($payment = null) { |
|
2534 | 2534 | if ( |
2535 | 2535 | $payment instanceof EE_Payment |
2536 | - && isset( $_REQUEST['ee_cancel_payment'] ) |
|
2536 | + && isset($_REQUEST['ee_cancel_payment']) |
|
2537 | 2537 | && $payment->status() === EEM_Payment::status_id_failed |
2538 | 2538 | ) { |
2539 | - $payment->set_status( EEM_Payment::status_id_cancelled ); |
|
2539 | + $payment->set_status(EEM_Payment::status_id_cancelled); |
|
2540 | 2540 | } |
2541 | 2541 | return $payment; |
2542 | 2542 | } |
@@ -2553,14 +2553,14 @@ discard block |
||
2553 | 2553 | public function get_transaction_details_for_gateways() { |
2554 | 2554 | $txn_details = array(); |
2555 | 2555 | // ya gotta make a choice man |
2556 | - if ( empty( $this->checkout->selected_method_of_payment ) ) { |
|
2556 | + if (empty($this->checkout->selected_method_of_payment)) { |
|
2557 | 2557 | $txn_details = array( |
2558 | - 'error' => __( 'Please select a method of payment before proceeding.', 'event_espresso' ) |
|
2558 | + 'error' => __('Please select a method of payment before proceeding.', 'event_espresso') |
|
2559 | 2559 | ); |
2560 | 2560 | } |
2561 | 2561 | // get EE_Payment_Method object |
2562 | 2562 | if ( |
2563 | - empty( $txn_details ) |
|
2563 | + empty($txn_details) |
|
2564 | 2564 | && |
2565 | 2565 | ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment() |
2566 | 2566 | ) { |
@@ -2572,8 +2572,8 @@ discard block |
||
2572 | 2572 | ) |
2573 | 2573 | ); |
2574 | 2574 | } |
2575 | - if ( empty( $txn_details ) && $this->checkout->transaction instanceof EE_Transaction ) { |
|
2576 | - $return_url = $this->_get_return_url( $this->checkout->payment_method ); |
|
2575 | + if (empty($txn_details) && $this->checkout->transaction instanceof EE_Transaction) { |
|
2576 | + $return_url = $this->_get_return_url($this->checkout->payment_method); |
|
2577 | 2577 | $txn_details = array( |
2578 | 2578 | 'TXN_ID' => $this->checkout->transaction->ID(), |
2579 | 2579 | 'TXN_timestamp' => $this->checkout->transaction->datetime(), |
@@ -2584,7 +2584,7 @@ discard block |
||
2584 | 2584 | 'PMD_ID' => $this->checkout->transaction->payment_method_ID(), |
2585 | 2585 | 'payment_amount' => $this->checkout->amount_owing, |
2586 | 2586 | 'return_url' => $return_url, |
2587 | - 'cancel_url' => add_query_arg( array( 'ee_cancel_payment' => true ), $return_url ), |
|
2587 | + 'cancel_url' => add_query_arg(array('ee_cancel_payment' => true), $return_url), |
|
2588 | 2588 | 'notify_url' => EE_Config::instance()->core->txn_page_url( |
2589 | 2589 | array( |
2590 | 2590 | 'e_reg_url_link' => $this->checkout->transaction->primary_registration()->reg_url_link(), |
@@ -2593,7 +2593,7 @@ discard block |
||
2593 | 2593 | ) |
2594 | 2594 | ); |
2595 | 2595 | } |
2596 | - echo json_encode( $txn_details ); |
|
2596 | + echo json_encode($txn_details); |
|
2597 | 2597 | exit(); |
2598 | 2598 | } |
2599 | 2599 |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | |
5 | 5 | |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | * @param EE_Checkout $checkout |
23 | 23 | * @return \EE_SPCO_Reg_Step_Finalize_Registration |
24 | 24 | */ |
25 | - public function __construct( EE_Checkout $checkout ) { |
|
25 | + public function __construct(EE_Checkout $checkout) { |
|
26 | 26 | $this->_slug = 'finalize_registration'; |
27 | - $this->_name = __( 'Finalize Registration', 'event_espresso' ); |
|
27 | + $this->_name = __('Finalize Registration', 'event_espresso'); |
|
28 | 28 | $this->_submit_button_text = $this->_name; |
29 | 29 | $this->_template = ''; |
30 | 30 | $this->checkout = $checkout; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function initialize_reg_step() { |
49 | 49 | // there's actually no reg form to process if this is the final step |
50 | - if ( $this->is_current_step() ) { |
|
50 | + if ($this->is_current_step()) { |
|
51 | 51 | $this->checkout->step = $_REQUEST['step'] = $this->slug(); |
52 | 52 | $this->checkout->action = $_REQUEST['action'] = 'process_reg_step'; |
53 | 53 | $this->checkout->generate_reg_form = false; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function process_reg_step() { |
75 | 75 | // ensure all data gets refreshed from the db |
76 | - $this->checkout->refresh_all_entities( true ); |
|
76 | + $this->checkout->refresh_all_entities(true); |
|
77 | 77 | // ensures that all details and statuses for transaction, registration, and payments are updated |
78 | 78 | $txn_update_params = $this->_finalize_transaction(); |
79 | 79 | // DEBUG LOG |
@@ -102,13 +102,13 @@ discard block |
||
102 | 102 | $txn_update_params |
103 | 103 | ); |
104 | 104 | // check if transaction has a primary registrant and that it has a related Attendee object |
105 | - if ( ! $this->_validate_primary_registrant() ) { |
|
105 | + if ( ! $this->_validate_primary_registrant()) { |
|
106 | 106 | return false; |
107 | 107 | } |
108 | 108 | // you don't have to go home but you can't stay here ! |
109 | 109 | $this->checkout->redirect = true; |
110 | 110 | $this->checkout->continue_reg = true; |
111 | - $this->checkout->json_response->set_redirect_url( $this->checkout->redirect_url ); |
|
111 | + $this->checkout->json_response->set_redirect_url($this->checkout->redirect_url); |
|
112 | 112 | if ( |
113 | 113 | ! ( |
114 | 114 | $this->checkout->payment_method instanceof EE_Payment_Method |
@@ -133,24 +133,24 @@ discard block |
||
133 | 133 | */ |
134 | 134 | protected function _finalize_transaction() { |
135 | 135 | /** @type EE_Transaction_Processor $transaction_processor */ |
136 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
136 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
137 | 137 | //set revisit flag in txn processor |
138 | - $transaction_processor->set_revisit( $this->checkout->revisit ); |
|
138 | + $transaction_processor->set_revisit($this->checkout->revisit); |
|
139 | 139 | // at this point we'll consider a TXN to not have been abandoned |
140 | 140 | $this->checkout->transaction->toggle_abandoned_transaction_status(); |
141 | - if ( $this->checkout->cart instanceof EE_Cart ) { |
|
141 | + if ($this->checkout->cart instanceof EE_Cart) { |
|
142 | 142 | // save TXN data to the cart |
143 | 143 | $this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn( |
144 | 144 | $this->checkout->transaction->ID() |
145 | 145 | ); |
146 | 146 | } |
147 | 147 | // maybe update status, but don't save transaction just yet |
148 | - $this->checkout->transaction->update_status_based_on_total_paid( false ); |
|
148 | + $this->checkout->transaction->update_status_based_on_total_paid(false); |
|
149 | 149 | // maybe send messages |
150 | 150 | $this->_trigger_notifications(); |
151 | 151 | // this will result in the base session properties getting saved to the TXN_Session_data field |
152 | 152 | $this->checkout->transaction->set_txn_session_data( |
153 | - EE_Registry::instance()->SSN->get_session_data( null, true ) |
|
153 | + EE_Registry::instance()->SSN->get_session_data(null, true) |
|
154 | 154 | ); |
155 | 155 | // update the TXN if payment conditions have changed |
156 | 156 | return $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment( |
@@ -172,10 +172,10 @@ discard block |
||
172 | 172 | * @throws \EE_Error |
173 | 173 | */ |
174 | 174 | protected function _trigger_notifications() { |
175 | - if ( $this->checkout->payment_method instanceof EE_Payment_Method ) { |
|
176 | - $is_revisit = filter_var( $this->checkout->revisit, FILTER_VALIDATE_BOOLEAN ); |
|
177 | - if ( $this->checkout->payment_method->is_off_site() ) { |
|
178 | - $gateway= $this->checkout->payment_method->type_obj()->get_gateway(); |
|
175 | + if ($this->checkout->payment_method instanceof EE_Payment_Method) { |
|
176 | + $is_revisit = filter_var($this->checkout->revisit, FILTER_VALIDATE_BOOLEAN); |
|
177 | + if ($this->checkout->payment_method->is_off_site()) { |
|
178 | + $gateway = $this->checkout->payment_method->type_obj()->get_gateway(); |
|
179 | 179 | if ( |
180 | 180 | ! $is_revisit |
181 | 181 | && $gateway instanceof EE_Offsite_Gateway |
@@ -185,10 +185,10 @@ discard block |
||
185 | 185 | ) |
186 | 186 | ) { |
187 | 187 | // first time through SPCO and we are processing the payment notification NOW |
188 | - add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 ); |
|
188 | + add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10); |
|
189 | 189 | } else { |
190 | 190 | // do NOT trigger notifications because this is a revisit, OR it was already done during the IPN |
191 | - remove_all_filters( 'FHEE__EED_Messages___maybe_registration__deliver_notifications' ); |
|
191 | + remove_all_filters('FHEE__EED_Messages___maybe_registration__deliver_notifications'); |
|
192 | 192 | add_filter( |
193 | 193 | 'FHEE__EED_Messages___maybe_registration__deliver_notifications', |
194 | 194 | '__return_false', |
@@ -197,12 +197,12 @@ discard block |
||
197 | 197 | } |
198 | 198 | } else if ( |
199 | 199 | // if SPCO revisit and TXN status has changed due to a payment |
200 | - $is_revisit && ( $this->checkout->transaction->txn_status_updated() || $this->checkout->any_reg_status_updated() ) |
|
200 | + $is_revisit && ($this->checkout->transaction->txn_status_updated() || $this->checkout->any_reg_status_updated()) |
|
201 | 201 | ) { |
202 | 202 | // send out notifications |
203 | - add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 ); |
|
204 | - } else if ( ! $is_revisit ) { |
|
205 | - add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 ); |
|
203 | + add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10); |
|
204 | + } else if ( ! $is_revisit) { |
|
205 | + add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10); |
|
206 | 206 | } |
207 | 207 | } |
208 | 208 | } |
@@ -216,9 +216,9 @@ discard block |
||
216 | 216 | * @throws \EE_Error |
217 | 217 | */ |
218 | 218 | protected function _validate_primary_registrant() { |
219 | - if ( ! $this->checkout->transaction_has_primary_registrant() ) { |
|
219 | + if ( ! $this->checkout->transaction_has_primary_registrant()) { |
|
220 | 220 | EE_Error::add_error( |
221 | - __( 'A valid Primary Registration for this Transaction could not be found.', 'event_espresso' ), |
|
221 | + __('A valid Primary Registration for this Transaction could not be found.', 'event_espresso'), |
|
222 | 222 | __FILE__, |
223 | 223 | __FUNCTION__, |
224 | 224 | __LINE__ |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | } |
230 | 230 | // setup URL for redirect |
231 | 231 | $this->checkout->redirect_url = add_query_arg( |
232 | - array( 'e_reg_url_link' => $this->checkout->transaction->primary_registration()->reg_url_link() ), |
|
232 | + array('e_reg_url_link' => $this->checkout->transaction->primary_registration()->reg_url_link()), |
|
233 | 233 | $this->checkout->thank_you_page_url |
234 | 234 | ); |
235 | 235 | return true; |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | */ |
243 | 243 | public function update_reg_step() { |
244 | 244 | EE_Error::doing_it_wrong( |
245 | - __CLASS__ . '::' . __FILE__, |
|
245 | + __CLASS__.'::'.__FILE__, |
|
246 | 246 | __( |
247 | 247 | 'Can not call update_reg_step() on the Finalize Registration reg step.', |
248 | 248 | 'event_espresso' |
@@ -56,26 +56,26 @@ discard block |
||
56 | 56 | * @param bool $routing |
57 | 57 | * @return Registrations_Admin_Page |
58 | 58 | */ |
59 | - public function __construct( $routing = TRUE ) { |
|
60 | - parent::__construct( $routing ); |
|
61 | - add_action( 'wp_loaded', array( $this, 'wp_loaded' )); |
|
59 | + public function __construct($routing = TRUE) { |
|
60 | + parent::__construct($routing); |
|
61 | + add_action('wp_loaded', array($this, 'wp_loaded')); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | |
65 | 65 | |
66 | 66 | public function wp_loaded() { |
67 | 67 | // when adding a new registration... |
68 | - if ( isset( $this->_req_data[ 'action' ] ) && $this->_req_data[ 'action' ] == 'new_registration' ) { |
|
68 | + if (isset($this->_req_data['action']) && $this->_req_data['action'] == 'new_registration') { |
|
69 | 69 | EE_System::do_not_cache(); |
70 | 70 | if ( |
71 | - ! isset( $this->_req_data[ 'processing_registration' ] ) |
|
72 | - || absint( $this->_req_data[ 'processing_registration' ] ) !== 1 |
|
71 | + ! isset($this->_req_data['processing_registration']) |
|
72 | + || absint($this->_req_data['processing_registration']) !== 1 |
|
73 | 73 | ) { |
74 | 74 | // and it's NOT the attendee information reg step |
75 | 75 | // force cookie expiration by setting time to last week |
76 | - setcookie( 'ee_registration_added', 0, time() - WEEK_IN_SECONDS, '/' ); |
|
76 | + setcookie('ee_registration_added', 0, time() - WEEK_IN_SECONDS, '/'); |
|
77 | 77 | // and update the global |
78 | - $_COOKIE[ 'ee_registration_added' ] = 0; |
|
78 | + $_COOKIE['ee_registration_added'] = 0; |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 | } |
@@ -109,16 +109,16 @@ discard block |
||
109 | 109 | 'trash' => 'post.php' |
110 | 110 | ); |
111 | 111 | |
112 | - add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10 ); |
|
112 | + add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10); |
|
113 | 113 | //add filters so that the comment urls don't take users to a confusing 404 page |
114 | - add_filter('get_comment_link', array( $this, 'clear_comment_link' ), 10, 3 ); |
|
114 | + add_filter('get_comment_link', array($this, 'clear_comment_link'), 10, 3); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | |
118 | - public function clear_comment_link( $link, $comment, $args ) { |
|
118 | + public function clear_comment_link($link, $comment, $args) { |
|
119 | 119 | //gotta make sure this only happens on this route |
120 | - $post_type = get_post_type( $comment->comment_post_ID); |
|
121 | - if ( $post_type == 'espresso_attendees' ) |
|
120 | + $post_type = get_post_type($comment->comment_post_ID); |
|
121 | + if ($post_type == 'espresso_attendees') |
|
122 | 122 | return '#commentsdiv'; |
123 | 123 | return $link; |
124 | 124 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | protected function _ajax_hooks() { |
128 | 128 | //todo: all hooks for registrations ajax goes in here |
129 | - add_action( 'wp_ajax_toggle_checkin_status', array( $this, 'toggle_checkin_status' )); |
|
129 | + add_action('wp_ajax_toggle_checkin_status', array($this, 'toggle_checkin_status')); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | |
@@ -141,8 +141,8 @@ discard block |
||
141 | 141 | 'add-attendee' => __('Add Contact', 'event_espresso'), |
142 | 142 | 'edit' => __('Edit Contact', 'event_espresso'), |
143 | 143 | 'report'=> __("Event Registrations CSV Report", "event_espresso"), |
144 | - 'report_all' => __( 'All Registrations CSV Report', 'event_espresso' ), |
|
145 | - 'contact_list_report' => __( 'Contact List Report', 'event_espresso' ), |
|
144 | + 'report_all' => __('All Registrations CSV Report', 'event_espresso'), |
|
145 | + 'contact_list_report' => __('Contact List Report', 'event_espresso'), |
|
146 | 146 | 'contact_list_export'=> __("Export Data", "event_espresso"), |
147 | 147 | ), |
148 | 148 | 'publishbox' => array( |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | |
171 | 171 | $this->_get_registration_status_array(); |
172 | 172 | |
173 | - $reg_id = ! empty( $this->_req_data['_REG_ID'] ) && ! is_array( $this->_req_data['_REG_ID'] ) ? $this->_req_data['_REG_ID'] : 0; |
|
174 | - $att_id = ! empty( $this->_req_data[ 'ATT_ID' ] ) && ! is_array( $this->_req_data['ATT_ID'] ) ? $this->_req_data['ATT_ID'] : 0; |
|
175 | - $att_id = ! empty( $this->_req_data['post'] ) && ! is_array( $this->_req_data['post'] ) ? $this->_req_data['post'] : $att_id; |
|
173 | + $reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0; |
|
174 | + $att_id = ! empty($this->_req_data['ATT_ID']) && ! is_array($this->_req_data['ATT_ID']) ? $this->_req_data['ATT_ID'] : 0; |
|
175 | + $att_id = ! empty($this->_req_data['post']) && ! is_array($this->_req_data['post']) ? $this->_req_data['post'] : $att_id; |
|
176 | 176 | |
177 | 177 | $this->_page_routes = array( |
178 | 178 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | |
206 | 206 | 'restore_registrations' => array( |
207 | 207 | 'func' => '_trash_or_restore_registrations', |
208 | - 'args' => array( 'trash' => FALSE ), |
|
208 | + 'args' => array('trash' => FALSE), |
|
209 | 209 | 'noheader' => TRUE, |
210 | 210 | 'capability' => 'ee_delete_registrations' |
211 | 211 | ), |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | 'filename' => 'registrations_overview_other' |
439 | 439 | ) |
440 | 440 | ), |
441 | - 'help_tour' => array( 'Registration_Overview_Help_Tour' ), |
|
441 | + 'help_tour' => array('Registration_Overview_Help_Tour'), |
|
442 | 442 | 'qtips' => array('Registration_List_Table_Tips'), |
443 | 443 | 'list_table' => 'EE_Registrations_List_Table', |
444 | 444 | 'require_nonce' => FALSE |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | 'order' => 15, |
451 | 451 | 'url' => isset($this->_req_data['_REG_ID']) |
452 | 452 | ? add_query_arg( |
453 | - array('_REG_ID' => $this->_req_data['_REG_ID'] ), |
|
453 | + array('_REG_ID' => $this->_req_data['_REG_ID']), |
|
454 | 454 | $this->_current_page_view_url |
455 | 455 | ) |
456 | 456 | : $this->_admin_base_url, |
@@ -474,8 +474,8 @@ discard block |
||
474 | 474 | 'filename' => 'registrations_details_registrant_details' |
475 | 475 | ) |
476 | 476 | ), |
477 | - 'help_tour' => array( 'Registration_Details_Help_Tour' ), |
|
478 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_registration_details_metaboxes' ) ), |
|
477 | + 'help_tour' => array('Registration_Details_Help_Tour'), |
|
478 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_registration_details_metaboxes')), |
|
479 | 479 | 'require_nonce' => FALSE |
480 | 480 | ), |
481 | 481 | |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | 'order' => 15, |
500 | 500 | 'persistent' => FALSE |
501 | 501 | ), |
502 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes' ) ), |
|
502 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes')), |
|
503 | 503 | 'require_nonce' => FALSE |
504 | 504 | ), |
505 | 505 | |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | 'label' => __('Edit Contact', 'event_espresso'), |
509 | 509 | 'order' => 15, |
510 | 510 | 'persistent' => FALSE, |
511 | - 'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID'] ), $this->_current_page_view_url ) : $this->_admin_base_url |
|
511 | + 'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID']), $this->_current_page_view_url) : $this->_admin_base_url |
|
512 | 512 | ), |
513 | 513 | 'metaboxes' => array('attendee_editor_metaboxes'), |
514 | 514 | 'require_nonce' => FALSE |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | 'filename' => 'registrations_contact_list_other' |
539 | 539 | ) |
540 | 540 | ), |
541 | - 'help_tour' => array( 'Contact_List_Help_Tour' ), |
|
541 | + 'help_tour' => array('Contact_List_Help_Tour'), |
|
542 | 542 | 'metaboxes' => array(), |
543 | 543 | 'require_nonce' => FALSE |
544 | 544 | ), |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | protected function _add_screen_options() {} |
558 | 558 | protected function _add_feature_pointers() {} |
559 | 559 | public function admin_init() { |
560 | - EE_Registry::$i18n_js_strings[ 'update_att_qstns' ] = __( 'click "Update Registration Questions" to save your changes', 'event_espresso' ); |
|
560 | + EE_Registry::$i18n_js_strings['update_att_qstns'] = __('click "Update Registration Questions" to save your changes', 'event_espresso'); |
|
561 | 561 | } |
562 | 562 | public function admin_notices() {} |
563 | 563 | public function admin_footer_scripts() {} |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | * @return void |
576 | 576 | */ |
577 | 577 | private function _get_registration_status_array() { |
578 | - self::$_reg_status = EEM_Registration::reg_status_array( array(), TRUE); |
|
578 | + self::$_reg_status = EEM_Registration::reg_status_array(array(), TRUE); |
|
579 | 579 | } |
580 | 580 | |
581 | 581 | |
@@ -598,11 +598,11 @@ discard block |
||
598 | 598 | public function load_scripts_styles() { |
599 | 599 | //style |
600 | 600 | //wp_register_style('espresso_attendees', ATT_ASSETS_URL . 'espresso_attendees_admin.css', array(), EVENT_ESPRESSO_VERSION ); |
601 | - wp_register_style('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION ); |
|
601 | + wp_register_style('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION); |
|
602 | 602 | wp_enqueue_style('espresso_reg'); |
603 | 603 | |
604 | 604 | //script |
605 | - wp_register_script('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE); |
|
605 | + wp_register_script('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE); |
|
606 | 606 | wp_enqueue_script('espresso_reg'); |
607 | 607 | } |
608 | 608 | |
@@ -611,9 +611,9 @@ discard block |
||
611 | 611 | public function load_scripts_styles_edit_attendee() { |
612 | 612 | //stuff to only show up on our attendee edit details page. |
613 | 613 | $attendee_details_translations = array( |
614 | - 'att_publish_text' => sprintf( __('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created') ) |
|
614 | + 'att_publish_text' => sprintf(__('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created')) |
|
615 | 615 | ); |
616 | - wp_localize_script( 'espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations ); |
|
616 | + wp_localize_script('espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations); |
|
617 | 617 | wp_enqueue_script('jquery-validate'); |
618 | 618 | } |
619 | 619 | |
@@ -622,8 +622,8 @@ discard block |
||
622 | 622 | //styles |
623 | 623 | wp_enqueue_style('espresso-ui-theme'); |
624 | 624 | //scripts |
625 | - $this->_get_reg_custom_questions_form( $this->_registration->ID() ); |
|
626 | - $this->_reg_custom_questions_form->wp_enqueue_scripts( true ); |
|
625 | + $this->_get_reg_custom_questions_form($this->_registration->ID()); |
|
626 | + $this->_reg_custom_questions_form->wp_enqueue_scripts(true); |
|
627 | 627 | } |
628 | 628 | |
629 | 629 | |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | |
634 | 634 | public function load_scripts_styles_contact_list() { |
635 | 635 | wp_deregister_style('espresso_reg'); |
636 | - wp_register_style('espresso_att', REG_ASSETS_URL . 'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION ); |
|
636 | + wp_register_style('espresso_att', REG_ASSETS_URL.'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION); |
|
637 | 637 | wp_enqueue_style('espresso_att'); |
638 | 638 | } |
639 | 639 | |
@@ -642,9 +642,9 @@ discard block |
||
642 | 642 | |
643 | 643 | |
644 | 644 | public function load_scripts_styles_new_registration() { |
645 | - wp_register_script( 'ee-spco-for-admin', REG_ASSETS_URL . 'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE ); |
|
645 | + wp_register_script('ee-spco-for-admin', REG_ASSETS_URL.'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE); |
|
646 | 646 | wp_enqueue_script('ee-spco-for-admin'); |
647 | - add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' ); |
|
647 | + add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true'); |
|
648 | 648 | EE_Form_Section_Proper::wp_enqueue_scripts(); |
649 | 649 | EED_Ticket_Selector::load_tckt_slctr_assets(); |
650 | 650 | EE_Datepicker_Input::enqueue_styles_and_scripts(); |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | //for notification related bulk actions we need to make sure only active messengers have an option. |
672 | 672 | EED_Messages::set_autoloaders(); |
673 | 673 | /** @type EE_Message_Resource_Manager $message_resource_manager */ |
674 | - $message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' ); |
|
674 | + $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
675 | 675 | $active_mts = $message_resource_manager->list_of_active_message_types(); |
676 | 676 | //key= bulk_action_slug, value= message type. |
677 | 677 | $match_array = array( |
@@ -684,23 +684,23 @@ discard block |
||
684 | 684 | |
685 | 685 | /** setup reg status bulk actions **/ |
686 | 686 | $def_reg_status_actions['approve_registration'] = __('Approve Registrations', 'event_espresso'); |
687 | - if ( in_array( $match_array['approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
687 | + if (in_array($match_array['approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
688 | 688 | $def_reg_status_actions['approve_and_notify_registration'] = __('Approve and Notify Registrations', 'event_espresso'); |
689 | 689 | } |
690 | 690 | $def_reg_status_actions['decline_registration'] = __('Decline Registrations', 'event_espresso'); |
691 | - if ( in_array( $match_array['decline_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
691 | + if (in_array($match_array['decline_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
692 | 692 | $def_reg_status_actions['decline_and_notify_registration'] = __('Decline and Notify Registrations', 'event_espresso'); |
693 | 693 | } |
694 | 694 | $def_reg_status_actions['pending_registration'] = __('Set Registrations to Pending Payment', 'event_espresso'); |
695 | - if ( in_array( $match_array['pending_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
695 | + if (in_array($match_array['pending_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
696 | 696 | $def_reg_status_actions['pending_and_notify_registration'] = __('Set Registrations to Pending Payment and Notify', 'event_espresso'); |
697 | 697 | } |
698 | 698 | $def_reg_status_actions['no_approve_registration'] = __('Set Registrations to Not Approved', 'event_espresso'); |
699 | - if ( in_array( $match_array['no_approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
699 | + if (in_array($match_array['no_approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
700 | 700 | $def_reg_status_actions['no_approve_and_notify_registration'] = __('Set Registrations to Not Approved and Notify', 'event_espresso'); |
701 | 701 | } |
702 | 702 | $def_reg_status_actions['cancel_registration'] = __('Cancel Registrations', 'event_espresso'); |
703 | - if ( in_array( $match_array['cancel_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
703 | + if (in_array($match_array['cancel_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
704 | 704 | $def_reg_status_actions['cancel_and_notify_registration'] = __('Cancel Registrations and Notify', 'event_espresso'); |
705 | 705 | } |
706 | 706 | |
@@ -709,29 +709,29 @@ discard block |
||
709 | 709 | 'slug' => 'all', |
710 | 710 | 'label' => __('View All Registrations', 'event_espresso'), |
711 | 711 | 'count' => 0, |
712 | - 'bulk_action' => array_merge( $def_reg_status_actions, array( |
|
712 | + 'bulk_action' => array_merge($def_reg_status_actions, array( |
|
713 | 713 | 'trash_registrations' => __('Trash Registrations', 'event_espresso') |
714 | - ) ) |
|
714 | + )) |
|
715 | 715 | ), |
716 | 716 | 'month' => array( |
717 | 717 | 'slug' => 'month', |
718 | 718 | 'label' => __('This Month', 'event_espresso'), |
719 | 719 | 'count' => 0, |
720 | - 'bulk_action' => array_merge( $def_reg_status_actions, array( |
|
720 | + 'bulk_action' => array_merge($def_reg_status_actions, array( |
|
721 | 721 | 'trash_registrations' => __('Trash Registrations', 'event_espresso') |
722 | 722 | )) |
723 | 723 | ), |
724 | 724 | 'today' => array( |
725 | 725 | 'slug' => 'today', |
726 | - 'label' => sprintf( __('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp' ) ) ), |
|
726 | + 'label' => sprintf(__('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp'))), |
|
727 | 727 | 'count' => 0, |
728 | - 'bulk_action' => array_merge( $def_reg_status_actions, array( |
|
728 | + 'bulk_action' => array_merge($def_reg_status_actions, array( |
|
729 | 729 | 'trash_registrations' => __('Trash Registrations', 'event_espresso') |
730 | 730 | )) |
731 | 731 | ) |
732 | 732 | ); |
733 | 733 | |
734 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registrations', 'espresso_registrations_delete_registration' ) ) { |
|
734 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registrations', 'espresso_registrations_delete_registration')) { |
|
735 | 735 | $this->_views['incomplete'] = array( |
736 | 736 | 'slug' => 'incomplete', |
737 | 737 | 'label' => __('Incomplete', 'event_espresso'), |
@@ -767,7 +767,7 @@ discard block |
||
767 | 767 | ) |
768 | 768 | ); |
769 | 769 | |
770 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_trash_attendees' ) ) { |
|
770 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_trash_attendees')) { |
|
771 | 771 | $this->_views['trash'] = array( |
772 | 772 | 'slug' => 'trash', |
773 | 773 | 'label' => __('Trash', 'event_espresso'), |
@@ -806,18 +806,18 @@ discard block |
||
806 | 806 | 'desc' => __('View Transaction Invoice', 'event_espresso') |
807 | 807 | ), |
808 | 808 | ); |
809 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) { |
|
809 | + if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) { |
|
810 | 810 | $fc_items['resend_registration'] = array( |
811 | 811 | 'class' => 'dashicons dashicons-email-alt', |
812 | 812 | 'desc' => __('Resend Registration Details', 'event_espresso') |
813 | 813 | ); |
814 | 814 | } else { |
815 | - $fc_items['blank'] = array( 'class' => 'blank', 'desc' => '' ); |
|
815 | + $fc_items['blank'] = array('class' => 'blank', 'desc' => ''); |
|
816 | 816 | } |
817 | 817 | |
818 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) { |
|
819 | - $related_for_icon = EEH_MSG_Template::get_message_action_icon( 'see_notifications_for' ); |
|
820 | - if ( isset( $related_for_icon['css_class']) && isset( $related_for_icon['label'] ) ) { |
|
818 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) { |
|
819 | + $related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for'); |
|
820 | + if (isset($related_for_icon['css_class']) && isset($related_for_icon['label'])) { |
|
821 | 821 | $fc_items['view_related_messages'] = array( |
822 | 822 | 'class' => $related_for_icon['css_class'], |
823 | 823 | 'desc' => $related_for_icon['label'], |
@@ -827,35 +827,35 @@ discard block |
||
827 | 827 | |
828 | 828 | $sc_items = array( |
829 | 829 | 'approved_status' => array( |
830 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved, |
|
831 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) |
|
830 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_approved, |
|
831 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence') |
|
832 | 832 | ), |
833 | 833 | 'pending_status' => array( |
834 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment, |
|
835 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ) |
|
834 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_pending_payment, |
|
835 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence') |
|
836 | 836 | ), |
837 | 837 | 'wait_list' => array( |
838 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_wait_list, |
|
839 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_wait_list, false, 'sentence' ) |
|
838 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_wait_list, |
|
839 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_wait_list, false, 'sentence') |
|
840 | 840 | ), |
841 | 841 | 'incomplete_status' => array( |
842 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_incomplete, |
|
843 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_incomplete, FALSE, 'sentence' ) |
|
842 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_incomplete, |
|
843 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_incomplete, FALSE, 'sentence') |
|
844 | 844 | ), |
845 | 845 | 'not_approved' => array( |
846 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved, |
|
847 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ) |
|
846 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_not_approved, |
|
847 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence') |
|
848 | 848 | ), |
849 | 849 | 'declined_status' => array( |
850 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined, |
|
851 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' ) |
|
850 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_declined, |
|
851 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence') |
|
852 | 852 | ), |
853 | 853 | 'cancelled_status' => array( |
854 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled, |
|
855 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' ) |
|
854 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_cancelled, |
|
855 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence') |
|
856 | 856 | ) |
857 | 857 | ); |
858 | - return array_merge( $fc_items, $sc_items ); |
|
858 | + return array_merge($fc_items, $sc_items); |
|
859 | 859 | } |
860 | 860 | |
861 | 861 | |
@@ -869,45 +869,45 @@ discard block |
||
869 | 869 | */ |
870 | 870 | protected function _registrations_overview_list_table() { |
871 | 871 | $this->_template_args['admin_page_header'] = ''; |
872 | - $EVT_ID = ! empty( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : 0; |
|
873 | - if ( $EVT_ID ) { |
|
874 | - if ( EE_Registry::instance()->CAP->current_user_can( |
|
872 | + $EVT_ID = ! empty($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : 0; |
|
873 | + if ($EVT_ID) { |
|
874 | + if (EE_Registry::instance()->CAP->current_user_can( |
|
875 | 875 | 'ee_edit_registrations', |
876 | 876 | 'espresso_registrations_new_registration', |
877 | 877 | $EVT_ID |
878 | 878 | ) |
879 | 879 | ) { |
880 | - $this->_admin_page_title .= ' ' . $this->get_action_link_or_button( |
|
880 | + $this->_admin_page_title .= ' '.$this->get_action_link_or_button( |
|
881 | 881 | 'new_registration', |
882 | 882 | 'add-registrant', |
883 | - array( 'event_id' => $EVT_ID ), |
|
883 | + array('event_id' => $EVT_ID), |
|
884 | 884 | 'add-new-h2' |
885 | 885 | ); |
886 | 886 | } |
887 | - $event = EEM_Event::instance()->get_one_by_ID( $EVT_ID ); |
|
888 | - if ( $event instanceof EE_Event ) { |
|
887 | + $event = EEM_Event::instance()->get_one_by_ID($EVT_ID); |
|
888 | + if ($event instanceof EE_Event) { |
|
889 | 889 | $this->_template_args['admin_page_header'] = sprintf( |
890 | - __( '%s Viewing registrations for the event: %s%s', 'event_espresso' ), |
|
890 | + __('%s Viewing registrations for the event: %s%s', 'event_espresso'), |
|
891 | 891 | '<h3 style="line-height:1.5em;">', |
892 | - '<br /><a href="' . EE_Admin_Page::add_query_args_and_nonce( |
|
893 | - array( 'action' => 'edit', 'post' => $event->ID() ), |
|
892 | + '<br /><a href="'.EE_Admin_Page::add_query_args_and_nonce( |
|
893 | + array('action' => 'edit', 'post' => $event->ID()), |
|
894 | 894 | EVENTS_ADMIN_URL |
895 | - ) . '"> ' . $event->get( 'EVT_name' ) . ' </a> ', |
|
895 | + ).'"> '.$event->get('EVT_name').' </a> ', |
|
896 | 896 | '</h3>' |
897 | 897 | ); |
898 | 898 | } |
899 | - $DTT_ID = ! empty( $this->_req_data['datetime_id'] ) ? absint( $this->_req_data['datetime_id'] ) : 0; |
|
900 | - $datetime = EEM_Datetime::instance()->get_one_by_ID( $DTT_ID ); |
|
901 | - if ( $datetime instanceof EE_Datetime && $this->_template_args['admin_page_header'] !== '' ) { |
|
902 | - $this->_template_args['admin_page_header'] = substr( $this->_template_args['admin_page_header'], 0, -5 ); |
|
899 | + $DTT_ID = ! empty($this->_req_data['datetime_id']) ? absint($this->_req_data['datetime_id']) : 0; |
|
900 | + $datetime = EEM_Datetime::instance()->get_one_by_ID($DTT_ID); |
|
901 | + if ($datetime instanceof EE_Datetime && $this->_template_args['admin_page_header'] !== '') { |
|
902 | + $this->_template_args['admin_page_header'] = substr($this->_template_args['admin_page_header'], 0, -5); |
|
903 | 903 | $this->_template_args['admin_page_header'] .= ' <span class="drk-grey-text">'; |
904 | 904 | $this->_template_args['admin_page_header'] .= '<span class="dashicons dashicons-calendar"></span>'; |
905 | 905 | $this->_template_args['admin_page_header'] .= $datetime->name(); |
906 | - $this->_template_args['admin_page_header'] .= ' ( ' . $datetime->start_date() . ' )'; |
|
906 | + $this->_template_args['admin_page_header'] .= ' ( '.$datetime->start_date().' )'; |
|
907 | 907 | $this->_template_args['admin_page_header'] .= '</span></h3>'; |
908 | 908 | } |
909 | 909 | } |
910 | - $this->_template_args['after_list_table'] = $this->_display_legend( $this->_registration_legend_items() ); |
|
910 | + $this->_template_args['after_list_table'] = $this->_display_legend($this->_registration_legend_items()); |
|
911 | 911 | $this->display_admin_list_table_page_with_no_sidebar(); |
912 | 912 | } |
913 | 913 | |
@@ -922,19 +922,19 @@ discard block |
||
922 | 922 | */ |
923 | 923 | private function _set_registration_object() { |
924 | 924 | //get out if we've already set the object |
925 | - if ( is_object( $this->_registration )) { |
|
925 | + if (is_object($this->_registration)) { |
|
926 | 926 | return TRUE; |
927 | 927 | } |
928 | 928 | |
929 | 929 | $REG = EEM_Registration::instance(); |
930 | 930 | |
931 | - $REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE; |
|
931 | + $REG_ID = ( ! empty($this->_req_data['_REG_ID'])) ? absint($this->_req_data['_REG_ID']) : FALSE; |
|
932 | 932 | |
933 | - if ( $this->_registration = $REG->get_one_by_ID( $REG_ID )) |
|
933 | + if ($this->_registration = $REG->get_one_by_ID($REG_ID)) |
|
934 | 934 | return TRUE; |
935 | 935 | else { |
936 | - $error_msg = sprintf( __('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID ); |
|
937 | - EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
936 | + $error_msg = sprintf(__('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID); |
|
937 | + EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__); |
|
938 | 938 | $this->_registration = NULL; |
939 | 939 | return FALSE; |
940 | 940 | } |
@@ -952,25 +952,25 @@ discard block |
||
952 | 952 | * @throws \EE_Error |
953 | 953 | * @return mixed (int|array) int = count || array of registration objects |
954 | 954 | */ |
955 | - public function get_registrations( $per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE ) { |
|
956 | - $EVT_ID = ! empty( $this->_req_data['event_id'] ) && $this->_req_data['event_id'] > 0 ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
957 | - $CAT_ID = ! empty( $this->_req_data['EVT_CAT'] ) && (int) $this->_req_data['EVT_CAT'] > 0? absint( $this->_req_data['EVT_CAT'] ) : FALSE; |
|
958 | - $DTT_ID = isset( $this->_req_data['datetime_id'] ) ? absint( $this->_req_data['datetime_id'] ) : null; |
|
959 | - $reg_status = ! empty( $this->_req_data['_reg_status'] ) ? sanitize_text_field( $this->_req_data['_reg_status'] ) : FALSE; |
|
960 | - $month_range = ! empty( $this->_req_data['month_range'] ) ? sanitize_text_field( $this->_req_data['month_range'] ) : FALSE;//should be like 2013-april |
|
961 | - $today_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'today' ? TRUE : FALSE; |
|
962 | - $this_month_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'month' ? TRUE : FALSE; |
|
955 | + public function get_registrations($per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE) { |
|
956 | + $EVT_ID = ! empty($this->_req_data['event_id']) && $this->_req_data['event_id'] > 0 ? absint($this->_req_data['event_id']) : FALSE; |
|
957 | + $CAT_ID = ! empty($this->_req_data['EVT_CAT']) && (int) $this->_req_data['EVT_CAT'] > 0 ? absint($this->_req_data['EVT_CAT']) : FALSE; |
|
958 | + $DTT_ID = isset($this->_req_data['datetime_id']) ? absint($this->_req_data['datetime_id']) : null; |
|
959 | + $reg_status = ! empty($this->_req_data['_reg_status']) ? sanitize_text_field($this->_req_data['_reg_status']) : FALSE; |
|
960 | + $month_range = ! empty($this->_req_data['month_range']) ? sanitize_text_field($this->_req_data['month_range']) : FALSE; //should be like 2013-april |
|
961 | + $today_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'today' ? TRUE : FALSE; |
|
962 | + $this_month_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'month' ? TRUE : FALSE; |
|
963 | 963 | $start_date = FALSE; |
964 | 964 | $end_date = FALSE; |
965 | 965 | $_where = array(); |
966 | - $trash = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'trash' ? TRUE : FALSE; |
|
967 | - $incomplete = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'incomplete' ? TRUE : FALSE; |
|
966 | + $trash = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'trash' ? TRUE : FALSE; |
|
967 | + $incomplete = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'incomplete' ? TRUE : FALSE; |
|
968 | 968 | |
969 | 969 | //set orderby |
970 | 970 | $this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : ''; |
971 | 971 | |
972 | 972 | |
973 | - switch ( $this->_req_data['orderby'] ) { |
|
973 | + switch ($this->_req_data['orderby']) { |
|
974 | 974 | case '_REG_ID': |
975 | 975 | $orderby = 'REG_ID'; |
976 | 976 | break; |
@@ -990,30 +990,30 @@ discard block |
||
990 | 990 | $orderby = 'REG_date'; |
991 | 991 | } |
992 | 992 | |
993 | - $sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC'; |
|
994 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
995 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
993 | + $sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC'; |
|
994 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
995 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
996 | 996 | |
997 | 997 | |
998 | - $offset = ($current_page-1)*$per_page; |
|
999 | - $limit = $count ? NULL : array( $offset, $per_page ); |
|
998 | + $offset = ($current_page - 1) * $per_page; |
|
999 | + $limit = $count ? NULL : array($offset, $per_page); |
|
1000 | 1000 | |
1001 | - if($EVT_ID){ |
|
1002 | - $_where['EVT_ID']=$EVT_ID; |
|
1001 | + if ($EVT_ID) { |
|
1002 | + $_where['EVT_ID'] = $EVT_ID; |
|
1003 | 1003 | } |
1004 | - if($CAT_ID){ |
|
1004 | + if ($CAT_ID) { |
|
1005 | 1005 | $_where['Event.Term_Taxonomy.term_id'] = $CAT_ID; |
1006 | 1006 | } |
1007 | 1007 | //if DTT is included we filter by that datetime. |
1008 | - if ( $DTT_ID ) { |
|
1008 | + if ($DTT_ID) { |
|
1009 | 1009 | $_where['Ticket.Datetime.DTT_ID'] = $DTT_ID; |
1010 | 1010 | } |
1011 | - if ( $incomplete ) { |
|
1011 | + if ($incomplete) { |
|
1012 | 1012 | $_where['STS_ID'] = EEM_Registration::status_id_incomplete; |
1013 | 1013 | } else if ( ! $trash) { |
1014 | - $_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete ); |
|
1014 | + $_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete); |
|
1015 | 1015 | } |
1016 | - if($reg_status){ |
|
1016 | + if ($reg_status) { |
|
1017 | 1017 | $_where['STS_ID'] = $reg_status; |
1018 | 1018 | } |
1019 | 1019 | |
@@ -1025,103 +1025,103 @@ discard block |
||
1025 | 1025 | $time_start = ' 00:00:00'; |
1026 | 1026 | $time_end = ' 23:59:59'; |
1027 | 1027 | |
1028 | - if($today_a || $today ){ |
|
1028 | + if ($today_a || $today) { |
|
1029 | 1029 | $curdate = date('Y-m-d', current_time('timestamp')); |
1030 | - $_where['REG_date']= array('BETWEEN', |
|
1030 | + $_where['REG_date'] = array('BETWEEN', |
|
1031 | 1031 | array( |
1032 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_start, 'Y-m-d H:i:s' ), |
|
1033 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_end, 'Y-m-d H:i:s' ), |
|
1032 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_start, 'Y-m-d H:i:s'), |
|
1033 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_end, 'Y-m-d H:i:s'), |
|
1034 | 1034 | )); |
1035 | - }elseif($this_month_a || $this_month){ |
|
1035 | + }elseif ($this_month_a || $this_month) { |
|
1036 | 1036 | $this_month_r = date('m', current_time('timestamp')); |
1037 | - $days_this_month = date( 't', current_time('timestamp') ); |
|
1038 | - $_where['REG_date']= array('BETWEEN', |
|
1037 | + $days_this_month = date('t', current_time('timestamp')); |
|
1038 | + $_where['REG_date'] = array('BETWEEN', |
|
1039 | 1039 | array( |
1040 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, 'Y-m-d H:i:s' ), |
|
1041 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end, 'Y-m-d H:i:s' ) |
|
1040 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-01'.' '.$time_start, 'Y-m-d H:i:s'), |
|
1041 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-'.$days_this_month.' '.$time_end, 'Y-m-d H:i:s') |
|
1042 | 1042 | )); |
1043 | - }elseif($month_range){ |
|
1043 | + }elseif ($month_range) { |
|
1044 | 1044 | $pieces = explode(' ', $this->_req_data['month_range'], 3); |
1045 | - $month_r = !empty($pieces[0]) ? date('m', strtotime( $month_range ) ) : ''; |
|
1046 | - $year_r = !empty($pieces[1]) ? $pieces[1] : ''; |
|
1047 | - $days_in_month = date('t', strtotime($year_r . '-' . $month_r . '-' . '01') ); |
|
1048 | - $_where['REG_date']= array('BETWEEN', |
|
1049 | - array( EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-' . $days_in_month . ' 23:59:59', 'Y-m-d H:i:s' ) ) ); |
|
1050 | - }elseif($start_date && $end_date){ |
|
1045 | + $month_r = ! empty($pieces[0]) ? date('m', strtotime($month_range)) : ''; |
|
1046 | + $year_r = ! empty($pieces[1]) ? $pieces[1] : ''; |
|
1047 | + $days_in_month = date('t', strtotime($year_r.'-'.$month_r.'-'.'01')); |
|
1048 | + $_where['REG_date'] = array('BETWEEN', |
|
1049 | + array(EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-'.$days_in_month.' 23:59:59', 'Y-m-d H:i:s'))); |
|
1050 | + }elseif ($start_date && $end_date) { |
|
1051 | 1051 | throw new EE_Error("not yet supported"); |
1052 | - }elseif($start_date){ |
|
1052 | + }elseif ($start_date) { |
|
1053 | 1053 | throw new EE_Error("not yet supported"); |
1054 | - }elseif($end_date){ |
|
1054 | + }elseif ($end_date) { |
|
1055 | 1055 | throw new EE_Error("not yet supported"); |
1056 | 1056 | } |
1057 | 1057 | |
1058 | - if ( ! empty( $this->_req_data['s'] ) ) { |
|
1059 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
1058 | + if ( ! empty($this->_req_data['s'])) { |
|
1059 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
1060 | 1060 | $_where['OR'] = array( |
1061 | - 'Event.EVT_name' => array( 'LIKE', $sstr), |
|
1062 | - 'Event.EVT_desc' => array( 'LIKE', $sstr ), |
|
1063 | - 'Event.EVT_short_desc' => array( 'LIKE' , $sstr ), |
|
1064 | - 'Attendee.ATT_full_name' => array( 'LIKE', $sstr ), |
|
1065 | - 'Attendee.ATT_fname' => array( 'LIKE', $sstr ), |
|
1066 | - 'Attendee.ATT_lname' => array( 'LIKE', $sstr ), |
|
1067 | - 'Attendee.ATT_short_bio' => array( 'LIKE', $sstr ), |
|
1068 | - 'Attendee.ATT_email' => array('LIKE', $sstr ), |
|
1069 | - 'Attendee.ATT_address' => array( 'LIKE', $sstr ), |
|
1070 | - 'Attendee.ATT_address2' => array( 'LIKE', $sstr ), |
|
1071 | - 'Attendee.ATT_city' => array( 'LIKE', $sstr ), |
|
1072 | - 'REG_final_price' => array( 'LIKE', $sstr ), |
|
1073 | - 'REG_code' => array( 'LIKE', $sstr ), |
|
1074 | - 'REG_count' => array( 'LIKE' , $sstr ), |
|
1075 | - 'REG_group_size' => array( 'LIKE' , $sstr ), |
|
1076 | - 'Ticket.TKT_name' => array( 'LIKE', $sstr ), |
|
1077 | - 'Ticket.TKT_description' => array( 'LIKE', $sstr ), |
|
1078 | - 'Transaction.Payment.PAY_txn_id_chq_nmbr' => array( 'LIKE', $sstr ) |
|
1061 | + 'Event.EVT_name' => array('LIKE', $sstr), |
|
1062 | + 'Event.EVT_desc' => array('LIKE', $sstr), |
|
1063 | + 'Event.EVT_short_desc' => array('LIKE', $sstr), |
|
1064 | + 'Attendee.ATT_full_name' => array('LIKE', $sstr), |
|
1065 | + 'Attendee.ATT_fname' => array('LIKE', $sstr), |
|
1066 | + 'Attendee.ATT_lname' => array('LIKE', $sstr), |
|
1067 | + 'Attendee.ATT_short_bio' => array('LIKE', $sstr), |
|
1068 | + 'Attendee.ATT_email' => array('LIKE', $sstr), |
|
1069 | + 'Attendee.ATT_address' => array('LIKE', $sstr), |
|
1070 | + 'Attendee.ATT_address2' => array('LIKE', $sstr), |
|
1071 | + 'Attendee.ATT_city' => array('LIKE', $sstr), |
|
1072 | + 'REG_final_price' => array('LIKE', $sstr), |
|
1073 | + 'REG_code' => array('LIKE', $sstr), |
|
1074 | + 'REG_count' => array('LIKE', $sstr), |
|
1075 | + 'REG_group_size' => array('LIKE', $sstr), |
|
1076 | + 'Ticket.TKT_name' => array('LIKE', $sstr), |
|
1077 | + 'Ticket.TKT_description' => array('LIKE', $sstr), |
|
1078 | + 'Transaction.Payment.PAY_txn_id_chq_nmbr' => array('LIKE', $sstr) |
|
1079 | 1079 | ); |
1080 | 1080 | } |
1081 | 1081 | |
1082 | 1082 | //capability checks |
1083 | - if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations' ) ) { |
|
1083 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations')) { |
|
1084 | 1084 | $_where['AND'] = array( |
1085 | 1085 | 'Event.EVT_wp_user' => get_current_user_id() |
1086 | 1086 | ); |
1087 | 1087 | } |
1088 | 1088 | |
1089 | - if( $count ){ |
|
1090 | - if ( $trash ) { |
|
1091 | - return EEM_Registration::instance()->count_deleted( array( $_where )); |
|
1092 | - } else if ( $incomplete ) { |
|
1093 | - return EEM_Registration::instance()->count( array( $_where )); |
|
1089 | + if ($count) { |
|
1090 | + if ($trash) { |
|
1091 | + return EEM_Registration::instance()->count_deleted(array($_where)); |
|
1092 | + } else if ($incomplete) { |
|
1093 | + return EEM_Registration::instance()->count(array($_where)); |
|
1094 | 1094 | } else { |
1095 | - return EEM_Registration::instance()->count( array( $_where, 'default_where_conditions' => 'this_model_only' )); |
|
1095 | + return EEM_Registration::instance()->count(array($_where, 'default_where_conditions' => 'this_model_only')); |
|
1096 | 1096 | } |
1097 | 1097 | } else { |
1098 | 1098 | //make sure we remove default where conditions cause all registrations matching query are returned |
1099 | - $query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'default_where_conditions' => 'this_model_only' ); |
|
1100 | - if ( $per_page !== -1 ) { |
|
1099 | + $query_params = array($_where, 'order_by' => array($orderby => $sort), 'default_where_conditions' => 'this_model_only'); |
|
1100 | + if ($per_page !== -1) { |
|
1101 | 1101 | $query_params['limit'] = $limit; |
1102 | 1102 | } |
1103 | - $registrations = $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params); |
|
1103 | + $registrations = $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params); |
|
1104 | 1104 | |
1105 | - if ( $EVT_ID && isset( $registrations[0] ) && $registrations[0] instanceof EE_Registration && $registrations[0]->event_obj()) { |
|
1105 | + if ($EVT_ID && isset($registrations[0]) && $registrations[0] instanceof EE_Registration && $registrations[0]->event_obj()) { |
|
1106 | 1106 | $first_registration = $registrations[0]; |
1107 | 1107 | //EEH_Debug_Tools::printr( $registrations[0], '$registrations <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
1108 | 1108 | $event_name = $first_registration->event_obj()->name(); |
1109 | - $event_date = $first_registration->date_obj()->start_date_and_time('l F j, Y,', 'g:i:s a');// isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y, g:i:s a', $registrations[0]->DTT_EVT_start ) : ''; |
|
1109 | + $event_date = $first_registration->date_obj()->start_date_and_time('l F j, Y,', 'g:i:s a'); // isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y, g:i:s a', $registrations[0]->DTT_EVT_start ) : ''; |
|
1110 | 1110 | // edit event link |
1111 | - if ( $event_name != '' ) { |
|
1112 | - $edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit_event', 'EVT_ID'=>$EVT_ID ), EVENTS_ADMIN_URL ); |
|
1113 | - $edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $event_name . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>'; |
|
1114 | - $event_name .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ; |
|
1111 | + if ($event_name != '') { |
|
1112 | + $edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit_event', 'EVT_ID'=>$EVT_ID), EVENTS_ADMIN_URL); |
|
1113 | + $edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$event_name.'">'.__('Edit Event', 'event_espresso').'</a>'; |
|
1114 | + $event_name .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>'; |
|
1115 | 1115 | } |
1116 | 1116 | |
1117 | - $back_2_reg_url = self::add_query_args_and_nonce( array( 'action'=>'default' ), REG_ADMIN_URL ); |
|
1118 | - $back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="' . esc_attr__( 'click to return to viewing all registrations ', 'event_espresso' ) . '">« ' . __( 'Back to All Registrations', 'event_espresso' ) . '</a>'; |
|
1117 | + $back_2_reg_url = self::add_query_args_and_nonce(array('action'=>'default'), REG_ADMIN_URL); |
|
1118 | + $back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="'.esc_attr__('click to return to viewing all registrations ', 'event_espresso').'">« '.__('Back to All Registrations', 'event_espresso').'</a>'; |
|
1119 | 1119 | |
1120 | 1120 | $this->_template_args['before_admin_page_content'] = ' |
1121 | 1121 | <div id="admin-page-header"> |
1122 | - <h1><span class="small-text not-bold">'.__( 'Event: ', 'event_espresso' ).'</span>'. $event_name .'</h1> |
|
1123 | - <h3><span class="small-text not-bold">'.__( 'Date: ', 'event_espresso' ). '</span>'. $event_date .'</h3> |
|
1124 | - <span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk . '</span> |
|
1122 | + <h1><span class="small-text not-bold">'.__('Event: ', 'event_espresso').'</span>'.$event_name.'</h1> |
|
1123 | + <h3><span class="small-text not-bold">'.__('Date: ', 'event_espresso').'</span>'.$event_date.'</h3> |
|
1124 | + <span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk.'</span> |
|
1125 | 1125 | </div> |
1126 | 1126 | '; |
1127 | 1127 | |
@@ -1159,7 +1159,7 @@ discard block |
||
1159 | 1159 | |
1160 | 1160 | $this->_set_registration_object(); |
1161 | 1161 | |
1162 | - if ( is_object( $this->_registration )) { |
|
1162 | + if (is_object($this->_registration)) { |
|
1163 | 1163 | $transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance(); |
1164 | 1164 | $this->_session = $transaction->session_data(); |
1165 | 1165 | |
@@ -1167,10 +1167,10 @@ discard block |
||
1167 | 1167 | |
1168 | 1168 | |
1169 | 1169 | $this->_template_args['reg_nmbr']['value'] = $this->_registration->ID(); |
1170 | - $this->_template_args['reg_nmbr']['label'] = __( 'Registration Number', 'event_espresso' ); |
|
1170 | + $this->_template_args['reg_nmbr']['label'] = __('Registration Number', 'event_espresso'); |
|
1171 | 1171 | |
1172 | - $this->_template_args['reg_datetime']['value'] = $this->_registration->get_i18n_datetime( 'REG_date' ); |
|
1173 | - $this->_template_args['reg_datetime']['label'] = __( 'Date', 'event_espresso' ); |
|
1172 | + $this->_template_args['reg_datetime']['value'] = $this->_registration->get_i18n_datetime('REG_date'); |
|
1173 | + $this->_template_args['reg_datetime']['label'] = __('Date', 'event_espresso'); |
|
1174 | 1174 | |
1175 | 1175 | $this->_template_args['grand_total'] = $transaction->total(); |
1176 | 1176 | |
@@ -1178,19 +1178,19 @@ discard block |
||
1178 | 1178 | // link back to overview |
1179 | 1179 | $this->_template_args['reg_overview_url'] = REG_ADMIN_URL; |
1180 | 1180 | $this->_template_args['registration'] = $this->_registration; |
1181 | - $this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'event_id' => $event_id ), REG_ADMIN_URL ); |
|
1182 | - $this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions' ), admin_url( 'admin.php' ) ); |
|
1183 | - $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id ), admin_url( 'admin.php' ) ); |
|
1181 | + $this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $event_id), REG_ADMIN_URL); |
|
1182 | + $this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions'), admin_url('admin.php')); |
|
1183 | + $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id), admin_url('admin.php')); |
|
1184 | 1184 | |
1185 | 1185 | //next and previous links |
1186 | - $next_reg = $this->_registration->next(null, array(), 'REG_ID' ); |
|
1187 | - $this->_template_args['next_registration'] = $next_reg ? $this->_next_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-right ee-icon-size-22' ) : ''; |
|
1188 | - $previous_reg = $this->_registration->previous( null, array(), 'REG_ID' ); |
|
1189 | - $this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-left ee-icon-size-22' ) : ''; |
|
1186 | + $next_reg = $this->_registration->next(null, array(), 'REG_ID'); |
|
1187 | + $this->_template_args['next_registration'] = $next_reg ? $this->_next_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-right ee-icon-size-22') : ''; |
|
1188 | + $previous_reg = $this->_registration->previous(null, array(), 'REG_ID'); |
|
1189 | + $this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-left ee-icon-size-22') : ''; |
|
1190 | 1190 | |
1191 | 1191 | // grab header |
1192 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_header.template.php'; |
|
1193 | - $this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1192 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_header.template.php'; |
|
1193 | + $this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1194 | 1194 | |
1195 | 1195 | } else { |
1196 | 1196 | |
@@ -1209,17 +1209,17 @@ discard block |
||
1209 | 1209 | |
1210 | 1210 | |
1211 | 1211 | protected function _registration_details_metaboxes() { |
1212 | - do_action( 'AHEE__Registrations_Admin_Page___registration_details_metabox__start', $this ); |
|
1212 | + do_action('AHEE__Registrations_Admin_Page___registration_details_metabox__start', $this); |
|
1213 | 1213 | $this->_set_registration_object(); |
1214 | 1214 | $attendee = $this->_registration instanceof EE_Registration ? $this->_registration->attendee() : null; |
1215 | - add_meta_box( 'edit-reg-status-mbox', __( 'Registration Status', 'event_espresso' ), array( $this, 'set_reg_status_buttons_metabox' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1216 | - add_meta_box( 'edit-reg-details-mbox', __( 'Registration Details', 'event_espresso' ), array( $this, '_reg_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1217 | - if ( $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox' ) ) { |
|
1218 | - add_meta_box( 'edit-reg-questions-mbox', __( 'Registration Form Answers', 'event_espresso' ), array( $this, '_reg_questions_meta_box' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1215 | + add_meta_box('edit-reg-status-mbox', __('Registration Status', 'event_espresso'), array($this, 'set_reg_status_buttons_metabox'), $this->wp_page_slug, 'normal', 'high'); |
|
1216 | + add_meta_box('edit-reg-details-mbox', __('Registration Details', 'event_espresso'), array($this, '_reg_details_meta_box'), $this->wp_page_slug, 'normal', 'high'); |
|
1217 | + if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox')) { |
|
1218 | + add_meta_box('edit-reg-questions-mbox', __('Registration Form Answers', 'event_espresso'), array($this, '_reg_questions_meta_box'), $this->wp_page_slug, 'normal', 'high'); |
|
1219 | 1219 | } |
1220 | - add_meta_box( 'edit-reg-registrant-mbox', __( 'Contact Details', 'event_espresso' ), array( $this, '_reg_registrant_side_meta_box' ), $this->wp_page_slug, 'side', 'high' ); |
|
1221 | - if ( $this->_registration->group_size() > 1 ) { |
|
1222 | - add_meta_box( 'edit-reg-attendees-mbox', __( 'Other Registrations in this Transaction', 'event_espresso' ), array( $this, '_reg_attendees_meta_box' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1220 | + add_meta_box('edit-reg-registrant-mbox', __('Contact Details', 'event_espresso'), array($this, '_reg_registrant_side_meta_box'), $this->wp_page_slug, 'side', 'high'); |
|
1221 | + if ($this->_registration->group_size() > 1) { |
|
1222 | + add_meta_box('edit-reg-attendees-mbox', __('Other Registrations in this Transaction', 'event_espresso'), array($this, '_reg_attendees_meta_box'), $this->wp_page_slug, 'normal', 'high'); |
|
1223 | 1223 | } |
1224 | 1224 | } |
1225 | 1225 | |
@@ -1261,25 +1261,25 @@ discard block |
||
1261 | 1261 | 'html_id' => 'reg-status-change-form', |
1262 | 1262 | 'layout_strategy' => new EE_Admin_Two_Column_Layout(), |
1263 | 1263 | 'subsections' => array( |
1264 | - 'return' => new EE_Hidden_Input( array( |
|
1264 | + 'return' => new EE_Hidden_Input(array( |
|
1265 | 1265 | 'name' => 'return', |
1266 | 1266 | 'default' => 'view_registration' |
1267 | - ) ), |
|
1268 | - 'REG_ID' => new EE_Hidden_Input( array( |
|
1267 | + )), |
|
1268 | + 'REG_ID' => new EE_Hidden_Input(array( |
|
1269 | 1269 | 'name' => 'REG_ID', |
1270 | 1270 | 'default' => $this->_registration->ID() |
1271 | - ) ), |
|
1271 | + )), |
|
1272 | 1272 | 'current_status' => new EE_Form_Section_HTML( |
1273 | 1273 | EEH_HTML::tr( |
1274 | 1274 | EEH_HTML::th( |
1275 | 1275 | EEH_HTML::label( |
1276 | - EEH_HTML::strong( __( 'Current Registration Status', 'event_espresso' ) ) |
|
1276 | + EEH_HTML::strong(__('Current Registration Status', 'event_espresso')) |
|
1277 | 1277 | ) |
1278 | - ) . |
|
1278 | + ). |
|
1279 | 1279 | EEH_HTML::td( |
1280 | 1280 | EEH_HTML::strong( |
1281 | 1281 | $this->_registration->pretty_status(), |
1282 | - '', 'status-' . $this->_registration->status_ID(), 'line-height: 1em; font-size: 1.5em; font-weight: bold;' |
|
1282 | + '', 'status-'.$this->_registration->status_ID(), 'line-height: 1em; font-size: 1.5em; font-weight: bold;' |
|
1283 | 1283 | ) |
1284 | 1284 | ) |
1285 | 1285 | ) |
@@ -1287,22 +1287,22 @@ discard block |
||
1287 | 1287 | 'reg_status' => new EE_Select_Input( |
1288 | 1288 | $this->_get_reg_statuses(), |
1289 | 1289 | array( |
1290 | - 'html_label_text' => __( 'Change Registration Status to', 'event_espresso' ), |
|
1290 | + 'html_label_text' => __('Change Registration Status to', 'event_espresso'), |
|
1291 | 1291 | 'default' => $this->_registration->status_ID(), |
1292 | 1292 | ) |
1293 | 1293 | ), |
1294 | 1294 | 'send_notifications' => new EE_Yes_No_Input( |
1295 | 1295 | array( |
1296 | - 'html_label_text' => __( 'Send Related Messages', 'event_espresso' ), |
|
1296 | + 'html_label_text' => __('Send Related Messages', 'event_espresso'), |
|
1297 | 1297 | 'default' => false, |
1298 | - 'html_help_text' => __( 'If set to "Yes", then the related messages will be sent to the registrant.', 'event_espresso' ), |
|
1298 | + 'html_help_text' => __('If set to "Yes", then the related messages will be sent to the registrant.', 'event_espresso'), |
|
1299 | 1299 | ) |
1300 | 1300 | ), |
1301 | - 'submit' => new EE_Submit_Input( array( |
|
1301 | + 'submit' => new EE_Submit_Input(array( |
|
1302 | 1302 | 'html_class' => 'button-primary', |
1303 | 1303 | 'html_label_text' => ' ', |
1304 | - 'default' => __( 'Update Registration Status', 'event_espresso' ) |
|
1305 | - ) ), |
|
1304 | + 'default' => __('Update Registration Status', 'event_espresso') |
|
1305 | + )), |
|
1306 | 1306 | ), |
1307 | 1307 | ) |
1308 | 1308 | ); |
@@ -1315,7 +1315,7 @@ discard block |
||
1315 | 1315 | * Returns an array of all the buttons for the various statuses and switch status actions |
1316 | 1316 | * @return string |
1317 | 1317 | */ |
1318 | - protected function _get_current_reg_status_help_text( $STS_ID = '' ) { |
|
1318 | + protected function _get_current_reg_status_help_text($STS_ID = '') { |
|
1319 | 1319 | //$reg_status_help_text = array( |
1320 | 1320 | // 'RAP' => __( 'XXXXXXXXXXX', 'event_espresso' ), |
1321 | 1321 | // 'RAP' => __( 'XXXXXXXXXXX', 'event_espresso' ), |
@@ -1348,14 +1348,14 @@ discard block |
||
1348 | 1348 | */ |
1349 | 1349 | protected function _get_reg_statuses() { |
1350 | 1350 | $reg_status_array = EEM_Registration::instance()->reg_status_array(); |
1351 | - unset ( $reg_status_array[ EEM_Registration::status_id_incomplete ] ); |
|
1351 | + unset ($reg_status_array[EEM_Registration::status_id_incomplete]); |
|
1352 | 1352 | // get current reg status |
1353 | 1353 | $current_status = $this->_registration->status_ID(); |
1354 | 1354 | // is registration for free event? This will determine whether to display the pending payment option |
1355 | - if ( $current_status != EEM_Registration::status_id_pending_payment && $this->_registration->transaction()->is_free() ) { |
|
1356 | - unset( $reg_status_array[ EEM_Registration::status_id_pending_payment ] ); |
|
1355 | + if ($current_status != EEM_Registration::status_id_pending_payment && $this->_registration->transaction()->is_free()) { |
|
1356 | + unset($reg_status_array[EEM_Registration::status_id_pending_payment]); |
|
1357 | 1357 | } |
1358 | - return EEM_Status::instance()->localized_status( $reg_status_array, false, 'sentence' ); |
|
1358 | + return EEM_Status::instance()->localized_status($reg_status_array, false, 'sentence'); |
|
1359 | 1359 | } |
1360 | 1360 | |
1361 | 1361 | |
@@ -1368,15 +1368,15 @@ discard block |
||
1368 | 1368 | * |
1369 | 1369 | * @return array (array with reg_id(s) updated and whether update was successful. |
1370 | 1370 | */ |
1371 | - protected function _set_registration_status_from_request( $status = false, $notify = false ) { |
|
1372 | - if ( isset( $this->_req_data[ 'reg_status_change_form' ] ) ) { |
|
1373 | - $REG_IDs = isset( $this->_req_data[ 'reg_status_change_form' ][ 'REG_ID' ] ) |
|
1374 | - ? (array)$this->_req_data[ 'reg_status_change_form' ][ 'REG_ID' ] |
|
1371 | + protected function _set_registration_status_from_request($status = false, $notify = false) { |
|
1372 | + if (isset($this->_req_data['reg_status_change_form'])) { |
|
1373 | + $REG_IDs = isset($this->_req_data['reg_status_change_form']['REG_ID']) |
|
1374 | + ? (array) $this->_req_data['reg_status_change_form']['REG_ID'] |
|
1375 | 1375 | : array(); |
1376 | 1376 | } else { |
1377 | - $REG_IDs = isset( $this->_req_data[ '_REG_ID' ] ) ? (array)$this->_req_data[ '_REG_ID' ] : array(); |
|
1377 | + $REG_IDs = isset($this->_req_data['_REG_ID']) ? (array) $this->_req_data['_REG_ID'] : array(); |
|
1378 | 1378 | } |
1379 | - $success = $this->_set_registration_status( $REG_IDs, $status ); |
|
1379 | + $success = $this->_set_registration_status($REG_IDs, $status); |
|
1380 | 1380 | //notify? |
1381 | 1381 | if ( |
1382 | 1382 | $success |
@@ -1403,21 +1403,21 @@ discard block |
||
1403 | 1403 | * @param bool $status |
1404 | 1404 | * @return array (an array with 'success' key representing whether status change was successful, and 'REG_ID' as the array of updated registrations). |
1405 | 1405 | */ |
1406 | - protected function _set_registration_status( $REG_IDs = array(), $status = false ) { |
|
1406 | + protected function _set_registration_status($REG_IDs = array(), $status = false) { |
|
1407 | 1407 | $success = false; |
1408 | 1408 | // typecast $REG_IDs |
1409 | - $REG_IDs = (array)$REG_IDs; |
|
1410 | - if ( ! empty( $REG_IDs ) ) { |
|
1409 | + $REG_IDs = (array) $REG_IDs; |
|
1410 | + if ( ! empty($REG_IDs)) { |
|
1411 | 1411 | $success = true; |
1412 | 1412 | // set default status if none is passed |
1413 | 1413 | $status = $status ? $status : EEM_Registration::status_id_pending_payment; |
1414 | 1414 | // sanitize $REG_IDs |
1415 | - $REG_IDs = array_filter( $REG_IDs, 'absint' ); |
|
1415 | + $REG_IDs = array_filter($REG_IDs, 'absint'); |
|
1416 | 1416 | //loop through REG_ID's and change status |
1417 | - foreach ( $REG_IDs as $REG_ID ) { |
|
1418 | - $registration = EEM_Registration::instance()->get_one_by_ID( $REG_ID ); |
|
1419 | - if ( $registration instanceof EE_Registration ) { |
|
1420 | - $registration->set_status( $status ); |
|
1417 | + foreach ($REG_IDs as $REG_ID) { |
|
1418 | + $registration = EEM_Registration::instance()->get_one_by_ID($REG_ID); |
|
1419 | + if ($registration instanceof EE_Registration) { |
|
1420 | + $registration->set_status($status); |
|
1421 | 1421 | $result = $registration->save(); |
1422 | 1422 | // verifying explicit fails because update *may* just return 0 for 0 rows affected |
1423 | 1423 | $success = $result !== false ? $success : false; |
@@ -1427,7 +1427,7 @@ discard block |
||
1427 | 1427 | //reset _req_data['_REG_ID'] for any potential future messages notifications |
1428 | 1428 | $this->_req_data['_REG_ID'] = $REG_IDs; |
1429 | 1429 | //return $success and processed registrations |
1430 | - return array( 'REG_ID' => $REG_IDs, 'success' => $success ); |
|
1430 | + return array('REG_ID' => $REG_IDs, 'success' => $success); |
|
1431 | 1431 | } |
1432 | 1432 | |
1433 | 1433 | |
@@ -1439,49 +1439,49 @@ discard block |
||
1439 | 1439 | * @param bool $notify indicates whether the _set_registration_status_from_request does notifications or not. |
1440 | 1440 | * @return void |
1441 | 1441 | */ |
1442 | - protected function _reg_status_change_return( $STS_ID, $notify = false ) { |
|
1443 | - $result = ! empty( $STS_ID ) |
|
1444 | - ? $this->_set_registration_status_from_request( $STS_ID, $notify ) |
|
1445 | - : array( 'success' => false ); |
|
1446 | - $success = isset( $result['success'] ) && $result['success']; |
|
1442 | + protected function _reg_status_change_return($STS_ID, $notify = false) { |
|
1443 | + $result = ! empty($STS_ID) |
|
1444 | + ? $this->_set_registration_status_from_request($STS_ID, $notify) |
|
1445 | + : array('success' => false); |
|
1446 | + $success = isset($result['success']) && $result['success']; |
|
1447 | 1447 | //setup success message |
1448 | - if ( $success ) { |
|
1449 | - if ( is_array( $result[ 'REG_ID' ] ) && count( $result[ 'REG_ID' ] ) === 1 ) { |
|
1448 | + if ($success) { |
|
1449 | + if (is_array($result['REG_ID']) && count($result['REG_ID']) === 1) { |
|
1450 | 1450 | $msg = sprintf( |
1451 | - __( 'Registration status has been set to %s', 'event_espresso' ), |
|
1452 | - EEH_Template::pretty_status( $STS_ID, false, 'lower' ) |
|
1451 | + __('Registration status has been set to %s', 'event_espresso'), |
|
1452 | + EEH_Template::pretty_status($STS_ID, false, 'lower') |
|
1453 | 1453 | ); |
1454 | 1454 | } else { |
1455 | 1455 | $msg = sprintf( |
1456 | - __( 'Registrations have been set to %s.', 'event_espresso' ), |
|
1457 | - EEH_Template::pretty_status( $STS_ID, false, 'lower' ) |
|
1456 | + __('Registrations have been set to %s.', 'event_espresso'), |
|
1457 | + EEH_Template::pretty_status($STS_ID, false, 'lower') |
|
1458 | 1458 | ); |
1459 | 1459 | } |
1460 | - EE_Error::add_success( $msg ); |
|
1460 | + EE_Error::add_success($msg); |
|
1461 | 1461 | } else { |
1462 | 1462 | EE_Error::add_error( |
1463 | - __( 'Something went wrong, and the status was not changed', 'event_espresso' ), |
|
1463 | + __('Something went wrong, and the status was not changed', 'event_espresso'), |
|
1464 | 1464 | __FILE__, __LINE__, __FUNCTION__ |
1465 | 1465 | ); |
1466 | 1466 | } |
1467 | - if ( isset( $this->_req_data[ 'return' ] ) && $this->_req_data[ 'return' ] == 'view_registration' ) { |
|
1468 | - $route = array( 'action' => 'view_registration', '_REG_ID' => reset( $result[ 'REG_ID' ] ) ); |
|
1467 | + if (isset($this->_req_data['return']) && $this->_req_data['return'] == 'view_registration') { |
|
1468 | + $route = array('action' => 'view_registration', '_REG_ID' => reset($result['REG_ID'])); |
|
1469 | 1469 | } else { |
1470 | - $route = array( 'action' => 'default' ); |
|
1470 | + $route = array('action' => 'default'); |
|
1471 | 1471 | } |
1472 | 1472 | //unset nonces |
1473 | - foreach ( $this->_req_data as $ref => $value ) { |
|
1474 | - if ( strpos( $ref, 'nonce' ) !== false ) { |
|
1475 | - unset( $this->_req_data[$ref] ); |
|
1473 | + foreach ($this->_req_data as $ref => $value) { |
|
1474 | + if (strpos($ref, 'nonce') !== false) { |
|
1475 | + unset($this->_req_data[$ref]); |
|
1476 | 1476 | continue; |
1477 | 1477 | } |
1478 | 1478 | |
1479 | - $value = is_array( $value ) ? array_map( 'urlencode', $value ) : urlencode( $value ); |
|
1479 | + $value = is_array($value) ? array_map('urlencode', $value) : urlencode($value); |
|
1480 | 1480 | $this->_req_data[$ref] = $value; |
1481 | 1481 | } |
1482 | 1482 | //merge request vars so that the reloaded list table contains any existing filter query params |
1483 | - $route = array_merge( $this->_req_data, $route ); |
|
1484 | - $this->_redirect_after_action( $success, '', '', $route, true ); |
|
1483 | + $route = array_merge($this->_req_data, $route); |
|
1484 | + $this->_redirect_after_action($success, '', '', $route, true); |
|
1485 | 1485 | } |
1486 | 1486 | |
1487 | 1487 | |
@@ -1492,51 +1492,51 @@ discard block |
||
1492 | 1492 | protected function _change_reg_status() { |
1493 | 1493 | $this->_req_data['return'] = 'view_registration'; |
1494 | 1494 | //set notify based on whether the send notifications toggle is set or not |
1495 | - $notify = ! empty( $this->_req_data['reg_status_change_form']['send_notifications'] ); |
|
1495 | + $notify = ! empty($this->_req_data['reg_status_change_form']['send_notifications']); |
|
1496 | 1496 | //$notify = ! empty( $this->_req_data['txn_reg_status_change']['send_notifications'] ); |
1497 | - $this->_req_data[ 'reg_status_change_form' ][ 'reg_status' ] = isset( |
|
1498 | - $this->_req_data[ 'reg_status_change_form' ][ 'reg_status' ] |
|
1497 | + $this->_req_data['reg_status_change_form']['reg_status'] = isset( |
|
1498 | + $this->_req_data['reg_status_change_form']['reg_status'] |
|
1499 | 1499 | ) |
1500 | - ? $this->_req_data[ 'reg_status_change_form' ][ 'reg_status' ] |
|
1500 | + ? $this->_req_data['reg_status_change_form']['reg_status'] |
|
1501 | 1501 | : ''; |
1502 | 1502 | |
1503 | - switch ( $this->_req_data[ 'reg_status_change_form' ]['reg_status'] ) { |
|
1503 | + switch ($this->_req_data['reg_status_change_form']['reg_status']) { |
|
1504 | 1504 | |
1505 | 1505 | case EEM_Registration::status_id_approved : |
1506 | - case EEH_Template::pretty_status( EEM_Registration::status_id_approved, false, 'sentence' ) : |
|
1507 | - $this->approve_registration( $notify ); |
|
1506 | + case EEH_Template::pretty_status(EEM_Registration::status_id_approved, false, 'sentence') : |
|
1507 | + $this->approve_registration($notify); |
|
1508 | 1508 | break; |
1509 | 1509 | |
1510 | 1510 | case EEM_Registration::status_id_pending_payment : |
1511 | - case EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, false, 'sentence' ) : |
|
1512 | - $this->pending_registration( $notify ); |
|
1511 | + case EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, false, 'sentence') : |
|
1512 | + $this->pending_registration($notify); |
|
1513 | 1513 | break; |
1514 | 1514 | |
1515 | 1515 | case EEM_Registration::status_id_not_approved : |
1516 | - case EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, false, 'sentence' ) : |
|
1517 | - $this->not_approve_registration( $notify ); |
|
1516 | + case EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, false, 'sentence') : |
|
1517 | + $this->not_approve_registration($notify); |
|
1518 | 1518 | break; |
1519 | 1519 | |
1520 | 1520 | case EEM_Registration::status_id_declined : |
1521 | - case EEH_Template::pretty_status( EEM_Registration::status_id_declined, false, 'sentence' ) : |
|
1522 | - $this->decline_registration( $notify ); |
|
1521 | + case EEH_Template::pretty_status(EEM_Registration::status_id_declined, false, 'sentence') : |
|
1522 | + $this->decline_registration($notify); |
|
1523 | 1523 | break; |
1524 | 1524 | |
1525 | 1525 | case EEM_Registration::status_id_cancelled : |
1526 | - case EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, false, 'sentence' ) : |
|
1527 | - $this->cancel_registration( $notify ); |
|
1526 | + case EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, false, 'sentence') : |
|
1527 | + $this->cancel_registration($notify); |
|
1528 | 1528 | break; |
1529 | 1529 | |
1530 | 1530 | case EEM_Registration::status_id_wait_list : |
1531 | - case EEH_Template::pretty_status( EEM_Registration::status_id_wait_list, false, 'sentence' ) : |
|
1532 | - $this->waitlist_registration( $notify ); |
|
1531 | + case EEH_Template::pretty_status(EEM_Registration::status_id_wait_list, false, 'sentence') : |
|
1532 | + $this->waitlist_registration($notify); |
|
1533 | 1533 | break; |
1534 | 1534 | |
1535 | 1535 | case EEM_Registration::status_id_incomplete : |
1536 | 1536 | default : |
1537 | 1537 | $result['success'] = false; |
1538 | - unset( $this->_req_data['return'] ); |
|
1539 | - $this->_reg_status_change_return( '', false ); |
|
1538 | + unset($this->_req_data['return']); |
|
1539 | + $this->_reg_status_change_return('', false); |
|
1540 | 1540 | break; |
1541 | 1541 | } |
1542 | 1542 | } |
@@ -1550,8 +1550,8 @@ discard block |
||
1550 | 1550 | * @param bool $notify whether or not to notify the registrant about their approval. |
1551 | 1551 | * @return void |
1552 | 1552 | */ |
1553 | - protected function approve_registration( $notify = false ) { |
|
1554 | - $this->_reg_status_change_return( EEM_Registration::status_id_approved, $notify ); |
|
1553 | + protected function approve_registration($notify = false) { |
|
1554 | + $this->_reg_status_change_return(EEM_Registration::status_id_approved, $notify); |
|
1555 | 1555 | } |
1556 | 1556 | |
1557 | 1557 | |
@@ -1563,8 +1563,8 @@ discard block |
||
1563 | 1563 | * @param bool $notify whether or not to notify the registrant about their status change. |
1564 | 1564 | * @return void |
1565 | 1565 | */ |
1566 | - protected function decline_registration( $notify = false ) { |
|
1567 | - $this->_reg_status_change_return( EEM_Registration::status_id_declined, $notify ); |
|
1566 | + protected function decline_registration($notify = false) { |
|
1567 | + $this->_reg_status_change_return(EEM_Registration::status_id_declined, $notify); |
|
1568 | 1568 | } |
1569 | 1569 | |
1570 | 1570 | |
@@ -1576,8 +1576,8 @@ discard block |
||
1576 | 1576 | * @param bool $notify whether or not to notify the registrant about their status change. |
1577 | 1577 | * @return void |
1578 | 1578 | */ |
1579 | - protected function cancel_registration( $notify = false ) { |
|
1580 | - $this->_reg_status_change_return( EEM_Registration::status_id_cancelled, $notify ); |
|
1579 | + protected function cancel_registration($notify = false) { |
|
1580 | + $this->_reg_status_change_return(EEM_Registration::status_id_cancelled, $notify); |
|
1581 | 1581 | } |
1582 | 1582 | |
1583 | 1583 | |
@@ -1589,8 +1589,8 @@ discard block |
||
1589 | 1589 | * @param bool $notify whether or not to notify the registrant about their status change. |
1590 | 1590 | * @return void |
1591 | 1591 | */ |
1592 | - protected function not_approve_registration( $notify = false ) { |
|
1593 | - $this->_reg_status_change_return( EEM_Registration::status_id_not_approved, $notify ); |
|
1592 | + protected function not_approve_registration($notify = false) { |
|
1593 | + $this->_reg_status_change_return(EEM_Registration::status_id_not_approved, $notify); |
|
1594 | 1594 | } |
1595 | 1595 | |
1596 | 1596 | |
@@ -1602,8 +1602,8 @@ discard block |
||
1602 | 1602 | * @param bool $notify whether or not to notify the registrant about their status change. |
1603 | 1603 | * @return void |
1604 | 1604 | */ |
1605 | - protected function pending_registration( $notify = false ) { |
|
1606 | - $this->_reg_status_change_return( EEM_Registration::status_id_pending_payment, $notify ); |
|
1605 | + protected function pending_registration($notify = false) { |
|
1606 | + $this->_reg_status_change_return(EEM_Registration::status_id_pending_payment, $notify); |
|
1607 | 1607 | } |
1608 | 1608 | |
1609 | 1609 | |
@@ -1615,8 +1615,8 @@ discard block |
||
1615 | 1615 | * @param bool $notify whether or not to notify the registrant about their status change. |
1616 | 1616 | * @return void |
1617 | 1617 | */ |
1618 | - protected function waitlist_registration( $notify = false ) { |
|
1619 | - $this->_reg_status_change_return( EEM_Registration::status_id_wait_list, $notify ); |
|
1618 | + protected function waitlist_registration($notify = false) { |
|
1619 | + $this->_reg_status_change_return(EEM_Registration::status_id_wait_list, $notify); |
|
1620 | 1620 | } |
1621 | 1621 | |
1622 | 1622 | |
@@ -1630,14 +1630,14 @@ discard block |
||
1630 | 1630 | public function _reg_details_meta_box() { |
1631 | 1631 | EEH_Autoloader::register_line_item_display_autoloaders(); |
1632 | 1632 | EEH_Autoloader::register_line_item_filter_autoloaders(); |
1633 | - EE_Registry::instance()->load_helper( 'Line_Item' ); |
|
1633 | + EE_Registry::instance()->load_helper('Line_Item'); |
|
1634 | 1634 | $transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance(); |
1635 | 1635 | $this->_session = $transaction->session_data(); |
1636 | 1636 | |
1637 | 1637 | $filters = new EE_Line_Item_Filter_Collection(); |
1638 | 1638 | //$filters->add( new EE_Non_Zero_Line_Item_Filter() ); |
1639 | - $filters->add( new EE_Single_Registration_Line_Item_Filter( $this->_registration ) ); |
|
1640 | - $line_item_filter_processor = new EE_Line_Item_Filter_Processor( $filters, $transaction->total_line_item() ); |
|
1639 | + $filters->add(new EE_Single_Registration_Line_Item_Filter($this->_registration)); |
|
1640 | + $line_item_filter_processor = new EE_Line_Item_Filter_Processor($filters, $transaction->total_line_item()); |
|
1641 | 1641 | $filtered_line_item_tree = $line_item_filter_processor->process(); |
1642 | 1642 | $line_item_display = new EE_Line_Item_Display( |
1643 | 1643 | 'reg_admin_table', |
@@ -1645,7 +1645,7 @@ discard block |
||
1645 | 1645 | ); |
1646 | 1646 | $this->_template_args['line_item_table'] = $line_item_display->display_line_item( |
1647 | 1647 | $filtered_line_item_tree, |
1648 | - array( 'EE_Registration' => $this->_registration ) |
|
1648 | + array('EE_Registration' => $this->_registration) |
|
1649 | 1649 | ); |
1650 | 1650 | $attendee = $this->_registration->attendee(); |
1651 | 1651 | |
@@ -1655,7 +1655,7 @@ discard block |
||
1655 | 1655 | 'espresso_transactions_view_transaction' |
1656 | 1656 | ) |
1657 | 1657 | ) { |
1658 | - $this->_template_args[ 'view_transaction_button' ] = EEH_Template::get_button_or_link( |
|
1658 | + $this->_template_args['view_transaction_button'] = EEH_Template::get_button_or_link( |
|
1659 | 1659 | EE_Admin_Page::add_query_args_and_nonce( |
1660 | 1660 | array( |
1661 | 1661 | 'action' => 'view_transaction', |
@@ -1663,12 +1663,12 @@ discard block |
||
1663 | 1663 | ), |
1664 | 1664 | TXN_ADMIN_URL |
1665 | 1665 | ), |
1666 | - esc_html__( ' View Transaction' ), |
|
1666 | + esc_html__(' View Transaction'), |
|
1667 | 1667 | 'button secondary-button right', |
1668 | 1668 | 'dashicons dashicons-cart' |
1669 | 1669 | ); |
1670 | 1670 | } else { |
1671 | - $this->_template_args[ 'view_transaction_button' ] = ''; |
|
1671 | + $this->_template_args['view_transaction_button'] = ''; |
|
1672 | 1672 | } |
1673 | 1673 | |
1674 | 1674 | if ( |
@@ -1678,7 +1678,7 @@ discard block |
||
1678 | 1678 | 'espresso_registrations_resend_registration' |
1679 | 1679 | ) |
1680 | 1680 | ) { |
1681 | - $this->_template_args[ 'resend_registration_button' ] = EEH_Template::get_button_or_link( |
|
1681 | + $this->_template_args['resend_registration_button'] = EEH_Template::get_button_or_link( |
|
1682 | 1682 | EE_Admin_Page::add_query_args_and_nonce( |
1683 | 1683 | array( |
1684 | 1684 | 'action' => 'resend_registration', |
@@ -1687,55 +1687,55 @@ discard block |
||
1687 | 1687 | ), |
1688 | 1688 | REG_ADMIN_URL |
1689 | 1689 | ), |
1690 | - esc_html__( ' Resend Registration' ), |
|
1690 | + esc_html__(' Resend Registration'), |
|
1691 | 1691 | 'button secondary-button right', |
1692 | 1692 | 'dashicons dashicons-email-alt' |
1693 | 1693 | ); |
1694 | 1694 | } else { |
1695 | - $this->_template_args[ 'resend_registration_button' ] = ''; |
|
1695 | + $this->_template_args['resend_registration_button'] = ''; |
|
1696 | 1696 | } |
1697 | 1697 | |
1698 | 1698 | $this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign; |
1699 | - $payment = $transaction->get_first_related( 'Payment' ); |
|
1699 | + $payment = $transaction->get_first_related('Payment'); |
|
1700 | 1700 | $payment = ! $payment instanceof EE_Payment ? EE_Payment::new_instance() : $payment; |
1701 | - $payment_method = $payment->get_first_related( 'Payment_Method' ); |
|
1701 | + $payment_method = $payment->get_first_related('Payment_Method'); |
|
1702 | 1702 | $payment_method = ! $payment_method instanceof EE_Payment_Method ? EE_Payment_Method::new_instance() : $payment_method; |
1703 | 1703 | |
1704 | 1704 | $reg_details = array( |
1705 | 1705 | 'payment_method' => $payment_method->name(), |
1706 | 1706 | 'response_msg' => $payment->gateway_response(), |
1707 | - 'registration_id' => $this->_registration->get( 'REG_code' ), |
|
1707 | + 'registration_id' => $this->_registration->get('REG_code'), |
|
1708 | 1708 | 'registration_session' => $this->_registration->session_ID(), |
1709 | - 'ip_address' => isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '', |
|
1710 | - 'user_agent' => isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '', |
|
1709 | + 'ip_address' => isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '', |
|
1710 | + 'user_agent' => isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '', |
|
1711 | 1711 | ); |
1712 | 1712 | |
1713 | 1713 | |
1714 | - if ( isset( $reg_details['registration_id'] )) { |
|
1714 | + if (isset($reg_details['registration_id'])) { |
|
1715 | 1715 | $this->_template_args['reg_details']['registration_id']['value'] = $reg_details['registration_id']; |
1716 | - $this->_template_args['reg_details']['registration_id']['label'] = __( 'Registration ID', 'event_espresso' ); |
|
1716 | + $this->_template_args['reg_details']['registration_id']['label'] = __('Registration ID', 'event_espresso'); |
|
1717 | 1717 | $this->_template_args['reg_details']['registration_id']['class'] = 'regular-text'; |
1718 | 1718 | } |
1719 | 1719 | |
1720 | - if ( isset( $reg_details['payment_method'] ) ) { |
|
1720 | + if (isset($reg_details['payment_method'])) { |
|
1721 | 1721 | $this->_template_args['reg_details']['payment_method']['value'] = $reg_details['payment_method']; |
1722 | - $this->_template_args['reg_details']['payment_method']['label'] = __( 'Most Recent Payment Method', 'event_espresso' ); |
|
1722 | + $this->_template_args['reg_details']['payment_method']['label'] = __('Most Recent Payment Method', 'event_espresso'); |
|
1723 | 1723 | $this->_template_args['reg_details']['payment_method']['class'] = 'regular-text'; |
1724 | 1724 | $this->_template_args['reg_details']['response_msg']['value'] = $reg_details['response_msg']; |
1725 | - $this->_template_args['reg_details']['response_msg']['label'] = __( 'Payment method response', 'event_espresso' ); |
|
1725 | + $this->_template_args['reg_details']['response_msg']['label'] = __('Payment method response', 'event_espresso'); |
|
1726 | 1726 | $this->_template_args['reg_details']['response_msg']['class'] = 'regular-text'; |
1727 | 1727 | } |
1728 | 1728 | |
1729 | 1729 | $this->_template_args['reg_details']['registration_session']['value'] = $reg_details['registration_session']; |
1730 | - $this->_template_args['reg_details']['registration_session']['label'] = __( 'Registration Session', 'event_espresso' ); |
|
1730 | + $this->_template_args['reg_details']['registration_session']['label'] = __('Registration Session', 'event_espresso'); |
|
1731 | 1731 | $this->_template_args['reg_details']['registration_session']['class'] = 'regular-text'; |
1732 | 1732 | |
1733 | 1733 | $this->_template_args['reg_details']['ip_address']['value'] = $reg_details['ip_address']; |
1734 | - $this->_template_args['reg_details']['ip_address']['label'] = __( 'Registration placed from IP', 'event_espresso' ); |
|
1734 | + $this->_template_args['reg_details']['ip_address']['label'] = __('Registration placed from IP', 'event_espresso'); |
|
1735 | 1735 | $this->_template_args['reg_details']['ip_address']['class'] = 'regular-text'; |
1736 | 1736 | |
1737 | 1737 | $this->_template_args['reg_details']['user_agent']['value'] = $reg_details['user_agent']; |
1738 | - $this->_template_args['reg_details']['user_agent']['label'] = __( 'Registrant User Agent', 'event_espresso' ); |
|
1738 | + $this->_template_args['reg_details']['user_agent']['label'] = __('Registrant User Agent', 'event_espresso'); |
|
1739 | 1739 | $this->_template_args['reg_details']['user_agent']['class'] = 'large-text'; |
1740 | 1740 | |
1741 | 1741 | $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( |
@@ -1748,8 +1748,8 @@ discard block |
||
1748 | 1748 | $this->_template_args['REG_ID'] = $this->_registration->ID(); |
1749 | 1749 | $this->_template_args['event_id'] = $this->_registration->event_ID(); |
1750 | 1750 | |
1751 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_details.template.php'; |
|
1752 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1751 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_details.template.php'; |
|
1752 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1753 | 1753 | |
1754 | 1754 | } |
1755 | 1755 | |
@@ -1763,14 +1763,14 @@ discard block |
||
1763 | 1763 | */ |
1764 | 1764 | public function _reg_questions_meta_box() { |
1765 | 1765 | //allow someone to override this method entirely |
1766 | - if( apply_filters( 'FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration ) ) { |
|
1767 | - $form = $this->_get_reg_custom_questions_form( $this->_registration->ID() ); |
|
1768 | - $this->_template_args[ 'att_questions' ] = count( $form->subforms() ) > 0 ? $form->get_html_and_js() : ''; |
|
1766 | + if (apply_filters('FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration)) { |
|
1767 | + $form = $this->_get_reg_custom_questions_form($this->_registration->ID()); |
|
1768 | + $this->_template_args['att_questions'] = count($form->subforms()) > 0 ? $form->get_html_and_js() : ''; |
|
1769 | 1769 | $this->_template_args['reg_questions_form_action'] = 'edit_registration'; |
1770 | 1770 | $this->_template_args['REG_ID'] = $this->_registration->ID(); |
1771 | 1771 | |
1772 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_questions.template.php'; |
|
1773 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1772 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_questions.template.php'; |
|
1773 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1774 | 1774 | } |
1775 | 1775 | } |
1776 | 1776 | |
@@ -1784,12 +1784,12 @@ discard block |
||
1784 | 1784 | * @param string $output |
1785 | 1785 | * @return string |
1786 | 1786 | */ |
1787 | - public function form_before_question_group( $output ) { |
|
1787 | + public function form_before_question_group($output) { |
|
1788 | 1788 | EE_Error::doing_it_wrong( |
1789 | - __CLASS__ . '::' . __FUNCTION__, |
|
1790 | - __( 'This method would have been protected but was used on a filter callback' |
|
1789 | + __CLASS__.'::'.__FUNCTION__, |
|
1790 | + __('This method would have been protected but was used on a filter callback' |
|
1791 | 1791 | . 'so needed to be public. Please discontinue usage as it will be removed soon.', |
1792 | - 'event_espresso' ), |
|
1792 | + 'event_espresso'), |
|
1793 | 1793 | '4.8.32.rc.000' |
1794 | 1794 | ); |
1795 | 1795 | return ' |
@@ -1808,20 +1808,20 @@ discard block |
||
1808 | 1808 | * @param string $output |
1809 | 1809 | * @return string |
1810 | 1810 | */ |
1811 | - public function form_after_question_group( $output ) { |
|
1811 | + public function form_after_question_group($output) { |
|
1812 | 1812 | EE_Error::doing_it_wrong( |
1813 | - __CLASS__ . '::' . __FUNCTION__, |
|
1814 | - __( 'This method would have been protected but was used on a filter callback' |
|
1813 | + __CLASS__.'::'.__FUNCTION__, |
|
1814 | + __('This method would have been protected but was used on a filter callback' |
|
1815 | 1815 | . 'so needed to be public. Please discontinue usage as it will be removed soon.', |
1816 | - 'event_espresso' ), |
|
1816 | + 'event_espresso'), |
|
1817 | 1817 | '4.8.32.rc.000' |
1818 | 1818 | ); |
1819 | 1819 | return ' |
1820 | 1820 | <tr class="hide-if-no-js"> |
1821 | 1821 | <th> </th> |
1822 | 1822 | <td class="reg-admin-edit-attendee-question-td"> |
1823 | - <a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__( 'click to edit question', 'event_espresso' ) . '"> |
|
1824 | - <span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __( 'edit the above question group', 'event_espresso' ) . '</span> |
|
1823 | + <a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__('click to edit question', 'event_espresso').'"> |
|
1824 | + <span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __('edit the above question group', 'event_espresso').'</span> |
|
1825 | 1825 | <div class="dashicons dashicons-edit"></div> |
1826 | 1826 | </a> |
1827 | 1827 | </td> |
@@ -1841,18 +1841,18 @@ discard block |
||
1841 | 1841 | * @param string $label |
1842 | 1842 | * @return string |
1843 | 1843 | */ |
1844 | - public function form_form_field_label_wrap( $label ) { |
|
1844 | + public function form_form_field_label_wrap($label) { |
|
1845 | 1845 | EE_Error::doing_it_wrong( |
1846 | - __CLASS__ . '::' . __FUNCTION__, |
|
1847 | - __( 'This method would have been protected but was used on a filter callback' |
|
1846 | + __CLASS__.'::'.__FUNCTION__, |
|
1847 | + __('This method would have been protected but was used on a filter callback' |
|
1848 | 1848 | . 'so needed to be public. Please discontinue usage as it will be removed soon.', |
1849 | - 'event_espresso' ), |
|
1849 | + 'event_espresso'), |
|
1850 | 1850 | '4.8.32.rc.000' |
1851 | 1851 | ); |
1852 | 1852 | return ' |
1853 | 1853 | <tr> |
1854 | 1854 | <th> |
1855 | - ' . $label . ' |
|
1855 | + ' . $label.' |
|
1856 | 1856 | </th>'; |
1857 | 1857 | } |
1858 | 1858 | |
@@ -1866,17 +1866,17 @@ discard block |
||
1866 | 1866 | * @param string $input |
1867 | 1867 | * @return string |
1868 | 1868 | */ |
1869 | - public function form_form_field_input__wrap( $input ) { |
|
1869 | + public function form_form_field_input__wrap($input) { |
|
1870 | 1870 | EE_Error::doing_it_wrong( |
1871 | - __CLASS__ . '::' . __FUNCTION__, |
|
1872 | - __( 'This method would have been protected but was used on a filter callback' |
|
1871 | + __CLASS__.'::'.__FUNCTION__, |
|
1872 | + __('This method would have been protected but was used on a filter callback' |
|
1873 | 1873 | . 'so needed to be public. Please discontinue usage as it will be removed soon.', |
1874 | - 'event_espresso' ), |
|
1874 | + 'event_espresso'), |
|
1875 | 1875 | '4.8.32.rc.000' |
1876 | 1876 | ); |
1877 | 1877 | return ' |
1878 | 1878 | <td class="reg-admin-attendee-questions-input-td disabled-input"> |
1879 | - ' . $input . ' |
|
1879 | + ' . $input.' |
|
1880 | 1880 | </td> |
1881 | 1881 | </tr>'; |
1882 | 1882 | } |
@@ -1890,14 +1890,14 @@ discard block |
||
1890 | 1890 | * @return void |
1891 | 1891 | */ |
1892 | 1892 | protected function _update_attendee_registration_form() { |
1893 | - do_action( 'AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', $this ); |
|
1894 | - if( $_SERVER['REQUEST_METHOD'] == 'POST'){ |
|
1895 | - $REG_ID = isset( $this->_req_data['_REG_ID'] ) ? absint( $this->_req_data['_REG_ID'] ) : FALSE; |
|
1896 | - $success = $this->_save_reg_custom_questions_form( $REG_ID ); |
|
1897 | - if( $success ) { |
|
1893 | + do_action('AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', $this); |
|
1894 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
1895 | + $REG_ID = isset($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : FALSE; |
|
1896 | + $success = $this->_save_reg_custom_questions_form($REG_ID); |
|
1897 | + if ($success) { |
|
1898 | 1898 | $what = __('Registration Form', 'event_espresso'); |
1899 | - $route = $REG_ID ? array( 'action' => 'view_registration', '_REG_ID' => $REG_ID ) : array( 'action' => 'default' ); |
|
1900 | - $this->_redirect_after_action( $success, $what, __('updated', 'event_espresso'), $route ); |
|
1899 | + $route = $REG_ID ? array('action' => 'view_registration', '_REG_ID' => $REG_ID) : array('action' => 'default'); |
|
1900 | + $this->_redirect_after_action($success, $what, __('updated', 'event_espresso'), $route); |
|
1901 | 1901 | } |
1902 | 1902 | } |
1903 | 1903 | } |
@@ -1908,11 +1908,11 @@ discard block |
||
1908 | 1908 | * @param int $REG_ID |
1909 | 1909 | * @return EE_Registration_Custom_Questions_Form |
1910 | 1910 | */ |
1911 | - protected function _get_reg_custom_questions_form( $REG_ID ) { |
|
1912 | - if( ! $this->_reg_custom_questions_form ) { |
|
1913 | - require_once( REG_ADMIN . 'form_sections' . DS . 'EE_Registration_Custom_Questions_Form.form.php' ); |
|
1914 | - $this->_reg_custom_questions_form = new EE_Registration_Custom_Questions_Form( EEM_Registration::instance()->get_one_by_ID( $REG_ID ) ); |
|
1915 | - $this->_reg_custom_questions_form->_construct_finalize( null, null ); |
|
1911 | + protected function _get_reg_custom_questions_form($REG_ID) { |
|
1912 | + if ( ! $this->_reg_custom_questions_form) { |
|
1913 | + require_once(REG_ADMIN.'form_sections'.DS.'EE_Registration_Custom_Questions_Form.form.php'); |
|
1914 | + $this->_reg_custom_questions_form = new EE_Registration_Custom_Questions_Form(EEM_Registration::instance()->get_one_by_ID($REG_ID)); |
|
1915 | + $this->_reg_custom_questions_form->_construct_finalize(null, null); |
|
1916 | 1916 | } |
1917 | 1917 | return $this->_reg_custom_questions_form; |
1918 | 1918 | } |
@@ -1925,17 +1925,17 @@ discard block |
||
1925 | 1925 | * @param bool $REG_ID |
1926 | 1926 | * @return bool |
1927 | 1927 | */ |
1928 | - private function _save_reg_custom_questions_form( $REG_ID = FALSE ) { |
|
1928 | + private function _save_reg_custom_questions_form($REG_ID = FALSE) { |
|
1929 | 1929 | |
1930 | 1930 | if ( ! $REG_ID) { |
1931 | - EE_Error::add_error( __('An error occurred. No registration ID was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
1931 | + EE_Error::add_error(__('An error occurred. No registration ID was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1932 | 1932 | } |
1933 | - $form = $this->_get_reg_custom_questions_form( $REG_ID ); |
|
1934 | - $form->receive_form_submission( $this->_req_data ); |
|
1933 | + $form = $this->_get_reg_custom_questions_form($REG_ID); |
|
1934 | + $form->receive_form_submission($this->_req_data); |
|
1935 | 1935 | $success = false; |
1936 | - if( $form->is_valid() ) { |
|
1937 | - foreach( $form->subforms() as $question_group_id => $question_group_form ) { |
|
1938 | - foreach( $question_group_form->inputs() as $question_id => $input ) { |
|
1936 | + if ($form->is_valid()) { |
|
1937 | + foreach ($form->subforms() as $question_group_id => $question_group_form) { |
|
1938 | + foreach ($question_group_form->inputs() as $question_id => $input) { |
|
1939 | 1939 | $where_conditions = array( |
1940 | 1940 | 'QST_ID' => $question_id, |
1941 | 1941 | 'REG_ID' => $REG_ID |
@@ -1943,19 +1943,19 @@ discard block |
||
1943 | 1943 | $possibly_new_values = array( |
1944 | 1944 | 'ANS_value' => $input->normalized_value() |
1945 | 1945 | ); |
1946 | - $answer = EEM_Answer::instance()->get_one( array( $where_conditions ) ); |
|
1947 | - if( $answer instanceof EE_Answer ) { |
|
1948 | - $success = $answer->save( $possibly_new_values ); |
|
1946 | + $answer = EEM_Answer::instance()->get_one(array($where_conditions)); |
|
1947 | + if ($answer instanceof EE_Answer) { |
|
1948 | + $success = $answer->save($possibly_new_values); |
|
1949 | 1949 | } else { |
1950 | 1950 | //insert it then |
1951 | - $cols_n_vals = array_merge( $where_conditions, $possibly_new_values ); |
|
1952 | - $answer = EE_Answer::new_instance( $cols_n_vals ); |
|
1951 | + $cols_n_vals = array_merge($where_conditions, $possibly_new_values); |
|
1952 | + $answer = EE_Answer::new_instance($cols_n_vals); |
|
1953 | 1953 | $success = $answer->save(); |
1954 | 1954 | } |
1955 | 1955 | } |
1956 | 1956 | } |
1957 | 1957 | } else { |
1958 | - EE_Error::add_error( $form->get_validation_error_string(), __FILE__, __FUNCTION__, __LINE__ ); |
|
1958 | + EE_Error::add_error($form->get_validation_error_string(), __FILE__, __FUNCTION__, __LINE__); |
|
1959 | 1959 | } |
1960 | 1960 | return $success; |
1961 | 1961 | } |
@@ -1973,31 +1973,31 @@ discard block |
||
1973 | 1973 | $registrations = $REG->get_all(array( |
1974 | 1974 | array( |
1975 | 1975 | 'TXN_ID'=>$this->_registration->transaction_ID(), |
1976 | - 'REG_ID'=>array('!=',$this->_registration->ID()) |
|
1976 | + 'REG_ID'=>array('!=', $this->_registration->ID()) |
|
1977 | 1977 | ), |
1978 | 1978 | 'force_join'=>array('Attendee'))); |
1979 | 1979 | |
1980 | 1980 | $this->_template_args['attendees'] = array(); |
1981 | 1981 | $this->_template_args['attendee_notice'] = ''; |
1982 | - if ( empty( $registrations) || ( is_array($registrations) && ! EEH_Array::get_one_item_from_array($registrations) ) ) { |
|
1983 | - EE_Error::add_error( __('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
1982 | + if (empty($registrations) || (is_array($registrations) && ! EEH_Array::get_one_item_from_array($registrations))) { |
|
1983 | + EE_Error::add_error(__('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1984 | 1984 | $this->_template_args['attendee_notice'] = EE_Error::get_notices(); |
1985 | 1985 | } else { |
1986 | 1986 | |
1987 | 1987 | $att_nmbr = 1; |
1988 | - foreach ( $registrations as $registration ) { |
|
1988 | + foreach ($registrations as $registration) { |
|
1989 | 1989 | /* @var $registration EE_Registration */ |
1990 | 1990 | $attendee = $registration->attendee() ? $registration->attendee() : EEM_Attendee::instance()->create_default_object(); |
1991 | - $this->_template_args['attendees'][ $att_nmbr ]['STS_ID'] = $registration->status_ID(); |
|
1992 | - $this->_template_args['attendees'][ $att_nmbr ]['fname'] = $attendee->fname();//( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : ''; |
|
1993 | - $this->_template_args['attendees'][ $att_nmbr ]['lname'] = $attendee->lname();//( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : ''; |
|
1994 | - $this->_template_args['attendees'][ $att_nmbr ]['email'] = $attendee->email();//( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : ''; |
|
1995 | - $this->_template_args['attendees'][ $att_nmbr ]['final_price'] = $registration->final_price();//( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : ''; |
|
1991 | + $this->_template_args['attendees'][$att_nmbr]['STS_ID'] = $registration->status_ID(); |
|
1992 | + $this->_template_args['attendees'][$att_nmbr]['fname'] = $attendee->fname(); //( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : ''; |
|
1993 | + $this->_template_args['attendees'][$att_nmbr]['lname'] = $attendee->lname(); //( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : ''; |
|
1994 | + $this->_template_args['attendees'][$att_nmbr]['email'] = $attendee->email(); //( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : ''; |
|
1995 | + $this->_template_args['attendees'][$att_nmbr]['final_price'] = $registration->final_price(); //( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : ''; |
|
1996 | 1996 | |
1997 | - $this->_template_args['attendees'][ $att_nmbr ]['address'] = implode( ', ', $attendee->full_address_as_array() ); |
|
1997 | + $this->_template_args['attendees'][$att_nmbr]['address'] = implode(', ', $attendee->full_address_as_array()); |
|
1998 | 1998 | |
1999 | - $this->_template_args['attendees'][ $att_nmbr ]['att_link'] = self::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL ); |
|
2000 | - $this->_template_args['attendees'][ $att_nmbr ]['event_name'] = $registration->event_obj()->name(); |
|
1999 | + $this->_template_args['attendees'][$att_nmbr]['att_link'] = self::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL); |
|
2000 | + $this->_template_args['attendees'][$att_nmbr]['event_name'] = $registration->event_obj()->name(); |
|
2001 | 2001 | |
2002 | 2002 | $att_nmbr++; |
2003 | 2003 | } |
@@ -2007,8 +2007,8 @@ discard block |
||
2007 | 2007 | |
2008 | 2008 | // $this->_template_args['registration_form_url'] = add_query_arg( array( 'action' => 'edit_registration', 'process' => 'attendees' ), REG_ADMIN_URL ); |
2009 | 2009 | } |
2010 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_attendees.template.php'; |
|
2011 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
2010 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_attendees.template.php'; |
|
2011 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
2012 | 2012 | |
2013 | 2013 | } |
2014 | 2014 | |
@@ -2029,14 +2029,14 @@ discard block |
||
2029 | 2029 | $attendee = $att_check instanceof EE_Attendee ? $att_check : EEM_Attendee::instance()->create_default_object(); |
2030 | 2030 | |
2031 | 2031 | //now let's determine if this is not the primary registration. If it isn't then we set the primary_registration object for reference BUT ONLY if the Attendee object loaded is not the same as the primary registration object (that way we know if we need to show create button or not) |
2032 | - if ( ! $this->_registration->is_primary_registrant() ) { |
|
2032 | + if ( ! $this->_registration->is_primary_registrant()) { |
|
2033 | 2033 | |
2034 | 2034 | $primary_registration = $this->_registration->get_primary_registration(); |
2035 | 2035 | $primary_attendee = $primary_registration instanceof EE_Registration |
2036 | 2036 | ? $primary_registration->attendee() |
2037 | 2037 | : null; |
2038 | 2038 | |
2039 | - if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID() ) { |
|
2039 | + if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID()) { |
|
2040 | 2040 | //in here? This means the displayed registration is not the primary registrant but ALREADY HAS its own custom attendee object so let's not worry about the primary reg. |
2041 | 2041 | $primary_registration = NULL; |
2042 | 2042 | } |
@@ -2045,27 +2045,27 @@ discard block |
||
2045 | 2045 | } |
2046 | 2046 | |
2047 | 2047 | $this->_template_args['ATT_ID'] = $attendee->ID(); |
2048 | - $this->_template_args['fname'] = $attendee->fname();//$this->_registration->ATT_fname; |
|
2049 | - $this->_template_args['lname'] = $attendee->lname();//$this->_registration->ATT_lname; |
|
2050 | - $this->_template_args['email'] = $attendee->email();//$this->_registration->ATT_email; |
|
2048 | + $this->_template_args['fname'] = $attendee->fname(); //$this->_registration->ATT_fname; |
|
2049 | + $this->_template_args['lname'] = $attendee->lname(); //$this->_registration->ATT_lname; |
|
2050 | + $this->_template_args['email'] = $attendee->email(); //$this->_registration->ATT_email; |
|
2051 | 2051 | $this->_template_args['phone'] = $attendee->phone(); |
2052 | 2052 | |
2053 | - $this->_template_args[ 'formatted_address' ] = EEH_Address::format( $attendee ); |
|
2053 | + $this->_template_args['formatted_address'] = EEH_Address::format($attendee); |
|
2054 | 2054 | |
2055 | 2055 | |
2056 | 2056 | //edit link |
2057 | - $this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL ); |
|
2057 | + $this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL); |
|
2058 | 2058 | $this->_template_args['att_edit_label'] = __('View/Edit Contact', 'event_espresso'); |
2059 | 2059 | |
2060 | 2060 | //create link |
2061 | - $this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'duplicate_attendee', '_REG_ID' => $this->_registration->ID() ), REG_ADMIN_URL ): ''; |
|
2061 | + $this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'duplicate_attendee', '_REG_ID' => $this->_registration->ID()), REG_ADMIN_URL) : ''; |
|
2062 | 2062 | $this->_template_args['create_label'] = __('Create Contact', 'event_espresso'); |
2063 | 2063 | |
2064 | 2064 | $this->_template_args['att_check'] = $att_check; |
2065 | 2065 | |
2066 | 2066 | |
2067 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_side_meta_box_registrant.template.php'; |
|
2068 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
2067 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_side_meta_box_registrant.template.php'; |
|
2068 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
2069 | 2069 | } |
2070 | 2070 | |
2071 | 2071 | |
@@ -2078,7 +2078,7 @@ discard block |
||
2078 | 2078 | * @access protected |
2079 | 2079 | * @return void |
2080 | 2080 | */ |
2081 | - protected function _trash_or_restore_registrations( $trash = TRUE ) { |
|
2081 | + protected function _trash_or_restore_registrations($trash = TRUE) { |
|
2082 | 2082 | $REGM = EEM_Registration::instance(); |
2083 | 2083 | |
2084 | 2084 | $success = 1; |
@@ -2088,26 +2088,26 @@ discard block |
||
2088 | 2088 | $dtts = array(); |
2089 | 2089 | |
2090 | 2090 | //if empty _REG_ID then get out because there's nothing to do |
2091 | - if ( empty( $this->_req_data['_REG_ID'] ) ) { |
|
2091 | + if (empty($this->_req_data['_REG_ID'])) { |
|
2092 | 2092 | $msg = $trash ? __('In order to trash registrations you must select which ones you wish to trash by clicking the checkboxes.', 'event_espresso') : __('In order to restore registrations you must select which ones you wish to restore by clicking the checkboxes.', 'event_espresso'); |
2093 | - EE_Error::add_error( $msg, __FILE__, __LINE__, __FUNCTION__ ); |
|
2094 | - $this->_redirect_after_action(FALSE, '', '', array(), TRUE ); |
|
2093 | + EE_Error::add_error($msg, __FILE__, __LINE__, __FUNCTION__); |
|
2094 | + $this->_redirect_after_action(FALSE, '', '', array(), TRUE); |
|
2095 | 2095 | } |
2096 | 2096 | |
2097 | 2097 | //Checkboxes |
2098 | - if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) { |
|
2098 | + if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) { |
|
2099 | 2099 | // if array has more than one element than success message should be plural |
2100 | - $success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1; |
|
2100 | + $success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1; |
|
2101 | 2101 | // cycle thru checkboxes |
2102 | - while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) { |
|
2102 | + while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) { |
|
2103 | 2103 | /** @var EE_Registration $REG */ |
2104 | - $REG = $REGM->get_one_by_ID( $REG_ID); |
|
2104 | + $REG = $REGM->get_one_by_ID($REG_ID); |
|
2105 | 2105 | $payment_count = $REG->get_first_related('Transaction')->count_related('Payment'); |
2106 | - if ( $payment_count > 0 ) { |
|
2107 | - $name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __( 'Unknown Attendee', 'event_espresso' ); |
|
2106 | + if ($payment_count > 0) { |
|
2107 | + $name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __('Unknown Attendee', 'event_espresso'); |
|
2108 | 2108 | $error = 1; |
2109 | 2109 | $success = 0; |
2110 | - EE_Error::add_error( sprintf( __('The registration for %s could not be trashed because it has payments attached to the related transaction. If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name ), __FILE__, __FUNCTION__, __LINE__ ); |
|
2110 | + EE_Error::add_error(sprintf(__('The registration for %s could not be trashed because it has payments attached to the related transaction. If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name), __FILE__, __FUNCTION__, __LINE__); |
|
2111 | 2111 | continue; //can't trash this registration because it has payments. |
2112 | 2112 | } |
2113 | 2113 | $ticket = $REG->get_first_related('Ticket'); |
@@ -2116,7 +2116,7 @@ discard block |
||
2116 | 2116 | $dtts = array_merge($dtts, $dtt); |
2117 | 2117 | |
2118 | 2118 | $updated = $trash ? $REG->delete() : $REG->restore(); |
2119 | - if ( !$updated ) { |
|
2119 | + if ( ! $updated) { |
|
2120 | 2120 | $success = 0; |
2121 | 2121 | } else { |
2122 | 2122 | $success = 2; |
@@ -2131,7 +2131,7 @@ discard block |
||
2131 | 2131 | $tickets[$ticket->ID()] = $ticket; |
2132 | 2132 | $dtts = $ticket->get_many_related('Datetime'); |
2133 | 2133 | $updated = $trash ? $REG->delete() : $REG->restore(); |
2134 | - if ( ! $updated ) { |
|
2134 | + if ( ! $updated) { |
|
2135 | 2135 | $success = 0; |
2136 | 2136 | } |
2137 | 2137 | |
@@ -2141,10 +2141,10 @@ discard block |
||
2141 | 2141 | EEM_Ticket::instance()->update_tickets_sold($tickets); |
2142 | 2142 | EEM_Datetime::instance()->update_sold($dtts); |
2143 | 2143 | |
2144 | - $what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' ); |
|
2145 | - $action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' ); |
|
2144 | + $what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso'); |
|
2145 | + $action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso'); |
|
2146 | 2146 | $overwrite_msgs = $error ? TRUE : FALSE; |
2147 | - $this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), $overwrite_msgs ); |
|
2147 | + $this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), $overwrite_msgs); |
|
2148 | 2148 | } |
2149 | 2149 | |
2150 | 2150 | |
@@ -2168,16 +2168,16 @@ discard block |
||
2168 | 2168 | $success = 1; |
2169 | 2169 | |
2170 | 2170 | //Checkboxes |
2171 | - if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) { |
|
2171 | + if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) { |
|
2172 | 2172 | // if array has more than one element than success message should be plural |
2173 | - $success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1; |
|
2173 | + $success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1; |
|
2174 | 2174 | // cycle thru checkboxes |
2175 | - while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) { |
|
2175 | + while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) { |
|
2176 | 2176 | $REG = $REG_MDL->get_one_by_ID($REG_ID); |
2177 | - if ( ! $REG instanceof EE_Registration ) |
|
2177 | + if ( ! $REG instanceof EE_Registration) |
|
2178 | 2178 | continue; |
2179 | 2179 | $deleted = $this->_delete_registration($REG); |
2180 | - if ( !$deleted ) { |
|
2180 | + if ( ! $deleted) { |
|
2181 | 2181 | $success = 0; |
2182 | 2182 | } |
2183 | 2183 | } |
@@ -2187,15 +2187,15 @@ discard block |
||
2187 | 2187 | $REG_ID = $this->_req_data['_REG_ID']; |
2188 | 2188 | $REG = $REG_MDL->get_one_by_ID($REG_ID); |
2189 | 2189 | $deleted = $this->_delete_registration($REG); |
2190 | - if ( ! $deleted ) { |
|
2190 | + if ( ! $deleted) { |
|
2191 | 2191 | $success = 0; |
2192 | 2192 | } |
2193 | 2193 | |
2194 | 2194 | } |
2195 | 2195 | |
2196 | - $what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' ); |
|
2197 | - $action_desc = __( 'permanently deleted.', 'event_espresso' ); |
|
2198 | - $this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), TRUE ); |
|
2196 | + $what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso'); |
|
2197 | + $action_desc = __('permanently deleted.', 'event_espresso'); |
|
2198 | + $this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), TRUE); |
|
2199 | 2199 | } |
2200 | 2200 | |
2201 | 2201 | |
@@ -2207,31 +2207,31 @@ discard block |
||
2207 | 2207 | * @param EE_Registration $REG registration to be deleted permenantly |
2208 | 2208 | * @return boolean true = successful deletion, false = fail. |
2209 | 2209 | */ |
2210 | - protected function _delete_registration( EE_Registration $REG ) { |
|
2210 | + protected function _delete_registration(EE_Registration $REG) { |
|
2211 | 2211 | //first we start with the transaction... ultimately, we WILL not delete permanently if there are any related registrations on the transaction that are NOT trashed. |
2212 | 2212 | $TXN = $REG->get_first_related('Transaction'); |
2213 | 2213 | $REGS = $TXN->get_many_related('Registration'); |
2214 | 2214 | |
2215 | 2215 | $all_trashed = TRUE; |
2216 | - foreach ( $REGS as $registration ) { |
|
2217 | - if ( ! $registration->get('REG_deleted') ) |
|
2216 | + foreach ($REGS as $registration) { |
|
2217 | + if ( ! $registration->get('REG_deleted')) |
|
2218 | 2218 | $all_trashed = FALSE; |
2219 | 2219 | } |
2220 | 2220 | |
2221 | - if ( ! $all_trashed ) { |
|
2222 | - EE_Error::add_error( __('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well. These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
2221 | + if ( ! $all_trashed) { |
|
2222 | + EE_Error::add_error(__('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well. These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
2223 | 2223 | return false; |
2224 | 2224 | } |
2225 | 2225 | |
2226 | 2226 | //k made it here so that means we can delete all the related transactions and their answers (but let's do them separately from THIS one). |
2227 | - foreach ( $REGS as $registration ) { |
|
2227 | + foreach ($REGS as $registration) { |
|
2228 | 2228 | |
2229 | 2229 | //delete related answers |
2230 | 2230 | $registration->delete_related_permanently('Answer'); |
2231 | 2231 | |
2232 | 2232 | //remove relationship to EE_Attendee (but we ALWAYS leave the contact record intact) |
2233 | 2233 | $attendee = $registration->get_first_related('Attendee'); |
2234 | - if ( $attendee instanceof EE_Attendee ) { |
|
2234 | + if ($attendee instanceof EE_Attendee) { |
|
2235 | 2235 | $registration->_remove_relation_to($attendee, 'Attendee'); |
2236 | 2236 | } |
2237 | 2237 | |
@@ -2241,7 +2241,7 @@ discard block |
||
2241 | 2241 | //now delete permanently the checkins related to this registration. |
2242 | 2242 | $registration->delete_related_permanently('Checkin'); |
2243 | 2243 | |
2244 | - if ( $registration->ID() === $REG->ID() ) |
|
2244 | + if ($registration->ID() === $REG->ID()) |
|
2245 | 2245 | continue; //we don't want to delete permanently the existing registration just yet. |
2246 | 2246 | |
2247 | 2247 | //remove relation to transaction for these registrations if NOT the existing registrations |
@@ -2278,35 +2278,35 @@ discard block |
||
2278 | 2278 | * @return void |
2279 | 2279 | */ |
2280 | 2280 | public function new_registration() { |
2281 | - if ( ! $this->_set_reg_event() ) { |
|
2282 | - throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso') ); |
|
2281 | + if ( ! $this->_set_reg_event()) { |
|
2282 | + throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso')); |
|
2283 | 2283 | } |
2284 | - EE_Registry::instance()->REQ->set_espresso_page( TRUE ); |
|
2284 | + EE_Registry::instance()->REQ->set_espresso_page(TRUE); |
|
2285 | 2285 | // gotta start with a clean slate if we're not coming here via ajax |
2286 | 2286 | if ( |
2287 | - ! defined('DOING_AJAX' ) |
|
2288 | - && ( ! isset( $this->_req_data['processing_registration'] ) || isset( $this->_req_data['step_error'] ) ) |
|
2287 | + ! defined('DOING_AJAX') |
|
2288 | + && ( ! isset($this->_req_data['processing_registration']) || isset($this->_req_data['step_error'])) |
|
2289 | 2289 | ) { |
2290 | - EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ ); |
|
2290 | + EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
2291 | 2291 | } |
2292 | 2292 | |
2293 | - $this->_template_args['event_name'] = '' ; |
|
2293 | + $this->_template_args['event_name'] = ''; |
|
2294 | 2294 | // event name |
2295 | - if ( $this->_reg_event ) { |
|
2295 | + if ($this->_reg_event) { |
|
2296 | 2296 | $this->_template_args['event_name'] = $this->_reg_event->name(); |
2297 | - $edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$this->_reg_event->ID() ), EVENTS_ADMIN_URL ); |
|
2298 | - $edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $this->_reg_event->name() . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>'; |
|
2299 | - $this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ; |
|
2297 | + $edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$this->_reg_event->ID()), EVENTS_ADMIN_URL); |
|
2298 | + $edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$this->_reg_event->name().'">'.__('Edit Event', 'event_espresso').'</a>'; |
|
2299 | + $this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>'; |
|
2300 | 2300 | } |
2301 | 2301 | |
2302 | 2302 | $this->_template_args['step_content'] = $this->_get_registration_step_content(); |
2303 | 2303 | |
2304 | - if ( defined('DOING_AJAX' ) ) { |
|
2304 | + if (defined('DOING_AJAX')) { |
|
2305 | 2305 | $this->_return_json(); |
2306 | 2306 | } |
2307 | 2307 | // grab header |
2308 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee.template.php'; |
|
2309 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
2308 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_register_new_attendee.template.php'; |
|
2309 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
2310 | 2310 | |
2311 | 2311 | //$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE ); |
2312 | 2312 | // the details template wrapper |
@@ -2323,7 +2323,7 @@ discard block |
||
2323 | 2323 | * @return string html |
2324 | 2324 | */ |
2325 | 2325 | protected function _get_registration_step_content() { |
2326 | - if ( isset( $_COOKIE[ 'ee_registration_added' ] ) && $_COOKIE[ 'ee_registration_added' ] ) { |
|
2326 | + if (isset($_COOKIE['ee_registration_added']) && $_COOKIE['ee_registration_added']) { |
|
2327 | 2327 | $warning_msg = sprintf( |
2328 | 2328 | __( |
2329 | 2329 | '%2$sWARNING!!!%3$s%1$sPlease do not use the back button to return to this page for the purpose of adding another registration.%1$sThis can result in lost and/or corrupted data.%1$sIf you wish to add another registration, then please click the%1$s%7$s"Add Another New Registration to Event"%8$s button%1$son the Transaction details page, after you are redirected.%1$s%1$s%4$s redirecting in %5$s seconds %6$s', |
@@ -2339,7 +2339,7 @@ discard block |
||
2339 | 2339 | '</b>' |
2340 | 2340 | ); |
2341 | 2341 | return ' |
2342 | - <div id="ee-add-reg-back-button-dv"><p>' . $warning_msg . '</p></div> |
|
2342 | + <div id="ee-add-reg-back-button-dv"><p>' . $warning_msg.'</p></div> |
|
2343 | 2343 | <script > |
2344 | 2344 | // WHOAH !!! it appears that someone is using the back button from the Transaction admin page |
2345 | 2345 | // after just adding a new registration... we gotta try to put a stop to that !!! |
@@ -2374,16 +2374,16 @@ discard block |
||
2374 | 2374 | $cart = EE_Registry::instance()->SSN->cart(); |
2375 | 2375 | $step = ! $cart instanceof EE_Cart ? 'ticket' : 'questions'; |
2376 | 2376 | |
2377 | - switch ( $step ) { |
|
2377 | + switch ($step) { |
|
2378 | 2378 | case 'ticket' : |
2379 | 2379 | $hidden_fields['processing_registration']['value'] = 1; |
2380 | 2380 | $template_args['title'] = __('Step One: Select the Ticket for this registration', 'event_espresso'); |
2381 | - $template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector( $this->_reg_event ); |
|
2381 | + $template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector($this->_reg_event); |
|
2382 | 2382 | $template_args['step_button_text'] = __('Add Tickets and Continue to Registrant Details', 'event_espresso'); |
2383 | 2383 | $template_args['show_notification_toggle'] = FALSE; |
2384 | 2384 | break; |
2385 | 2385 | case 'questions' : |
2386 | - $hidden_fields[ 'processing_registration' ][ 'value' ] = 2; |
|
2386 | + $hidden_fields['processing_registration']['value'] = 2; |
|
2387 | 2387 | $template_args['title'] = __('Step Two: Add Registrant Details for this Registration', 'event_espresso'); |
2388 | 2388 | //in theory we should be able to run EED_SPCO at this point because the cart should have been setup properly by the first process_reg_step run. |
2389 | 2389 | $template_args['content'] = EED_Single_Page_Checkout::registration_checkout_for_admin(); |
@@ -2392,10 +2392,10 @@ discard block |
||
2392 | 2392 | break; |
2393 | 2393 | } |
2394 | 2394 | |
2395 | - $this->_set_add_edit_form_tags( 'process_reg_step', $hidden_fields ); //we come back to the process_registration_step route. |
|
2395 | + $this->_set_add_edit_form_tags('process_reg_step', $hidden_fields); //we come back to the process_registration_step route. |
|
2396 | 2396 | |
2397 | 2397 | return EEH_Template::display_template( |
2398 | - REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee_step_content.template.php', $template_args, TRUE |
|
2398 | + REG_TEMPLATE_PATH.'reg_admin_register_new_attendee_step_content.template.php', $template_args, TRUE |
|
2399 | 2399 | ); |
2400 | 2400 | } |
2401 | 2401 | |
@@ -2410,11 +2410,11 @@ discard block |
||
2410 | 2410 | * @return boolean |
2411 | 2411 | */ |
2412 | 2412 | private function _set_reg_event() { |
2413 | - if ( is_object( $this->_reg_event )) { |
|
2413 | + if (is_object($this->_reg_event)) { |
|
2414 | 2414 | return TRUE; |
2415 | 2415 | } |
2416 | - $EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
2417 | - if ( ! $EVT_ID ) { |
|
2416 | + $EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE; |
|
2417 | + if ( ! $EVT_ID) { |
|
2418 | 2418 | return FALSE; |
2419 | 2419 | } |
2420 | 2420 | |
@@ -2435,80 +2435,80 @@ discard block |
||
2435 | 2435 | public function process_reg_step() { |
2436 | 2436 | EE_System::do_not_cache(); |
2437 | 2437 | $this->_set_reg_event(); |
2438 | - EE_Registry::instance()->REQ->set_espresso_page( TRUE ); |
|
2438 | + EE_Registry::instance()->REQ->set_espresso_page(TRUE); |
|
2439 | 2439 | |
2440 | 2440 | //what step are we on? |
2441 | 2441 | $cart = EE_Registry::instance()->SSN->cart(); |
2442 | 2442 | $step = ! $cart instanceof EE_Cart ? 'ticket' : 'questions'; |
2443 | 2443 | |
2444 | 2444 | //if doing ajax then we need to verify the nonce |
2445 | - if ( defined( 'DOING_AJAX' ) ) { |
|
2446 | - $nonce = isset( $this->_req_data[$this->_req_nonce] ) ? sanitize_text_field( $this->_req_data[$this->_req_nonce] ) : ''; |
|
2447 | - $this->_verify_nonce( $nonce, $this->_req_nonce ); |
|
2445 | + if (defined('DOING_AJAX')) { |
|
2446 | + $nonce = isset($this->_req_data[$this->_req_nonce]) ? sanitize_text_field($this->_req_data[$this->_req_nonce]) : ''; |
|
2447 | + $this->_verify_nonce($nonce, $this->_req_nonce); |
|
2448 | 2448 | } |
2449 | 2449 | |
2450 | - switch ( $step ) { |
|
2450 | + switch ($step) { |
|
2451 | 2451 | |
2452 | 2452 | case 'ticket' : |
2453 | 2453 | //process ticket selection |
2454 | 2454 | $success = EED_Ticket_Selector::instance()->process_ticket_selections(); |
2455 | - if ( $success ) { |
|
2456 | - EE_Error::add_success( esc_html__( 'Tickets Selected. Now complete the registration.', 'event_espresso' ) ); |
|
2455 | + if ($success) { |
|
2456 | + EE_Error::add_success(esc_html__('Tickets Selected. Now complete the registration.', 'event_espresso')); |
|
2457 | 2457 | } else { |
2458 | 2458 | $query_args['step_error'] = $this->_req_data['step_error'] = TRUE; |
2459 | 2459 | } |
2460 | - if ( defined('DOING_AJAX') ) { |
|
2460 | + if (defined('DOING_AJAX')) { |
|
2461 | 2461 | $this->new_registration(); //display next step |
2462 | 2462 | } else { |
2463 | 2463 | $query_args['action'] = 'new_registration'; |
2464 | 2464 | $query_args['processing_registration'] = 1; |
2465 | 2465 | $query_args['event_id'] = $this->_reg_event->ID(); |
2466 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
2466 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
2467 | 2467 | } |
2468 | 2468 | break; |
2469 | 2469 | |
2470 | 2470 | case 'questions' : |
2471 | - if( ! isset( $this->_req_data[ 'txn_reg_status_change' ], $this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ] ) ) { |
|
2472 | - add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15 ); |
|
2471 | + if ( ! isset($this->_req_data['txn_reg_status_change'], $this->_req_data['txn_reg_status_change']['send_notifications'])) { |
|
2472 | + add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15); |
|
2473 | 2473 | } |
2474 | 2474 | //process registration |
2475 | 2475 | $transaction = EED_Single_Page_Checkout::instance()->process_registration_from_admin(); |
2476 | - if ( $cart instanceof EE_Cart ) { |
|
2476 | + if ($cart instanceof EE_Cart) { |
|
2477 | 2477 | $grand_total = $cart->get_cart_grand_total(); |
2478 | - if ( $grand_total instanceof EE_Line_Item ) { |
|
2478 | + if ($grand_total instanceof EE_Line_Item) { |
|
2479 | 2479 | $grand_total->save_this_and_descendants_to_txn(); |
2480 | 2480 | } |
2481 | 2481 | } |
2482 | - if ( ! $transaction instanceof EE_Transaction ) { |
|
2482 | + if ( ! $transaction instanceof EE_Transaction) { |
|
2483 | 2483 | $query_args = array( |
2484 | 2484 | 'action' => 'new_registration', |
2485 | 2485 | 'processing_registration' => 2, |
2486 | 2486 | 'event_id' => $this->_reg_event->ID() |
2487 | 2487 | ); |
2488 | 2488 | |
2489 | - if ( defined('DOING_AJAX' )) { |
|
2489 | + if (defined('DOING_AJAX')) { |
|
2490 | 2490 | //display registration form again because there are errors (maybe validation?) |
2491 | 2491 | $this->new_registration(); |
2492 | 2492 | return; |
2493 | 2493 | } else { |
2494 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
2494 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
2495 | 2495 | return; |
2496 | 2496 | } |
2497 | 2497 | } |
2498 | 2498 | // maybe update status, and make sure to save transaction if not done already |
2499 | - if ( ! $transaction->update_status_based_on_total_paid() ) { |
|
2499 | + if ( ! $transaction->update_status_based_on_total_paid()) { |
|
2500 | 2500 | $transaction->save(); |
2501 | 2501 | } |
2502 | - EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ ); |
|
2502 | + EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
2503 | 2503 | $this->_req_data = array(); |
2504 | 2504 | $query_args = array( |
2505 | 2505 | 'action' => 'redirect_to_txn', |
2506 | 2506 | 'TXN_ID' => $transaction->ID(), |
2507 | 2507 | 'EVT_ID' => $this->_reg_event->ID(), |
2508 | - 'event_name' => urlencode( $this->_reg_event->name() ), |
|
2508 | + 'event_name' => urlencode($this->_reg_event->name()), |
|
2509 | 2509 | 'redirect_from' => 'new_registration' |
2510 | 2510 | ); |
2511 | - $this->_redirect_after_action( false, '', '', $query_args, true ); |
|
2511 | + $this->_redirect_after_action(false, '', '', $query_args, true); |
|
2512 | 2512 | break; |
2513 | 2513 | } |
2514 | 2514 | |
@@ -2525,21 +2525,21 @@ discard block |
||
2525 | 2525 | */ |
2526 | 2526 | public function redirect_to_txn() { |
2527 | 2527 | EE_System::do_not_cache(); |
2528 | - EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ ); |
|
2528 | + EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
2529 | 2529 | $query_args = array( |
2530 | 2530 | 'action' => 'view_transaction', |
2531 | - 'TXN_ID' => isset( $this->_req_data['TXN_ID'] ) ? absint( $this->_req_data[ 'TXN_ID' ] ) : 0, |
|
2531 | + 'TXN_ID' => isset($this->_req_data['TXN_ID']) ? absint($this->_req_data['TXN_ID']) : 0, |
|
2532 | 2532 | 'page' => 'espresso_transactions' |
2533 | 2533 | ); |
2534 | - if ( isset( $this->_req_data[ 'EVT_ID' ], $this->_req_data[ 'redirect_from' ] ) ) { |
|
2535 | - $query_args['EVT_ID'] = $this->_req_data[ 'EVT_ID' ]; |
|
2536 | - $query_args['event_name'] = urlencode( $this->_req_data[ 'event_name' ] ); |
|
2537 | - $query_args['redirect_from'] = $this->_req_data[ 'redirect_from' ]; |
|
2534 | + if (isset($this->_req_data['EVT_ID'], $this->_req_data['redirect_from'])) { |
|
2535 | + $query_args['EVT_ID'] = $this->_req_data['EVT_ID']; |
|
2536 | + $query_args['event_name'] = urlencode($this->_req_data['event_name']); |
|
2537 | + $query_args['redirect_from'] = $this->_req_data['redirect_from']; |
|
2538 | 2538 | } |
2539 | 2539 | EE_Error::add_success( |
2540 | - __( 'Registration Created. Please review the transaction and add any payments as necessary', 'event_espresso' ) |
|
2540 | + __('Registration Created. Please review the transaction and add any payments as necessary', 'event_espresso') |
|
2541 | 2541 | ); |
2542 | - $this->_redirect_after_action( false, '', '', $query_args, true ); |
|
2542 | + $this->_redirect_after_action(false, '', '', $query_args, true); |
|
2543 | 2543 | } |
2544 | 2544 | |
2545 | 2545 | |
@@ -2550,7 +2550,7 @@ discard block |
||
2550 | 2550 | * @return void |
2551 | 2551 | */ |
2552 | 2552 | protected function _attendee_contact_list_table() { |
2553 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
2553 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
2554 | 2554 | $this->_search_btn_label = __('Contacts', 'event_espresso'); |
2555 | 2555 | $this->display_admin_list_table_page_with_no_sidebar(); |
2556 | 2556 | } |
@@ -2565,10 +2565,10 @@ discard block |
||
2565 | 2565 | * @access public |
2566 | 2566 | * @return array |
2567 | 2567 | */ |
2568 | - public function get_attendees( $per_page, $count = FALSE, $trash = FALSE ) { |
|
2568 | + public function get_attendees($per_page, $count = FALSE, $trash = FALSE) { |
|
2569 | 2569 | |
2570 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
2571 | - require_once( REG_ADMIN . 'EE_Attendee_Contact_List_Table.class.php' ); |
|
2570 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
2571 | + require_once(REG_ADMIN.'EE_Attendee_Contact_List_Table.class.php'); |
|
2572 | 2572 | $ATT_MDL = EEM_Attendee::instance(); |
2573 | 2573 | |
2574 | 2574 | $this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : ''; |
@@ -2596,47 +2596,47 @@ discard block |
||
2596 | 2596 | $orderby = 'ATT_lname'; |
2597 | 2597 | } |
2598 | 2598 | |
2599 | - $sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC'; |
|
2599 | + $sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC'; |
|
2600 | 2600 | |
2601 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
2602 | - $per_page = isset( $per_page ) && !empty( $per_page ) ? $per_page : 10; |
|
2603 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
2601 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
2602 | + $per_page = isset($per_page) && ! empty($per_page) ? $per_page : 10; |
|
2603 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
2604 | 2604 | |
2605 | 2605 | $_where = array(); |
2606 | 2606 | |
2607 | - if ( ! empty( $this->_req_data['s'] ) ) { |
|
2608 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
2607 | + if ( ! empty($this->_req_data['s'])) { |
|
2608 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
2609 | 2609 | $_where['OR'] = array( |
2610 | - 'Registration.Event.EVT_name' => array( 'LIKE', $sstr), |
|
2611 | - 'Registration.Event.EVT_desc' => array( 'LIKE', $sstr ), |
|
2612 | - 'Registration.Event.EVT_short_desc' => array( 'LIKE' , $sstr ), |
|
2613 | - 'ATT_fname' => array( 'LIKE', $sstr ), |
|
2614 | - 'ATT_lname' => array( 'LIKE', $sstr ), |
|
2615 | - 'ATT_short_bio' => array( 'LIKE', $sstr ), |
|
2616 | - 'ATT_email' => array('LIKE', $sstr ), |
|
2617 | - 'ATT_address' => array( 'LIKE', $sstr ), |
|
2618 | - 'ATT_address2' => array( 'LIKE', $sstr ), |
|
2619 | - 'ATT_city' => array( 'LIKE', $sstr ), |
|
2620 | - 'Country.CNT_name' => array( 'LIKE', $sstr ), |
|
2621 | - 'State.STA_name' => array('LIKE', $sstr ), |
|
2622 | - 'ATT_phone' => array( 'LIKE', $sstr ), |
|
2623 | - 'Registration.REG_final_price' => array( 'LIKE', $sstr ), |
|
2624 | - 'Registration.REG_code' => array( 'LIKE', $sstr ), |
|
2625 | - 'Registration.REG_count' => array( 'LIKE' , $sstr ), |
|
2626 | - 'Registration.REG_group_size' => array( 'LIKE' , $sstr ) |
|
2610 | + 'Registration.Event.EVT_name' => array('LIKE', $sstr), |
|
2611 | + 'Registration.Event.EVT_desc' => array('LIKE', $sstr), |
|
2612 | + 'Registration.Event.EVT_short_desc' => array('LIKE', $sstr), |
|
2613 | + 'ATT_fname' => array('LIKE', $sstr), |
|
2614 | + 'ATT_lname' => array('LIKE', $sstr), |
|
2615 | + 'ATT_short_bio' => array('LIKE', $sstr), |
|
2616 | + 'ATT_email' => array('LIKE', $sstr), |
|
2617 | + 'ATT_address' => array('LIKE', $sstr), |
|
2618 | + 'ATT_address2' => array('LIKE', $sstr), |
|
2619 | + 'ATT_city' => array('LIKE', $sstr), |
|
2620 | + 'Country.CNT_name' => array('LIKE', $sstr), |
|
2621 | + 'State.STA_name' => array('LIKE', $sstr), |
|
2622 | + 'ATT_phone' => array('LIKE', $sstr), |
|
2623 | + 'Registration.REG_final_price' => array('LIKE', $sstr), |
|
2624 | + 'Registration.REG_code' => array('LIKE', $sstr), |
|
2625 | + 'Registration.REG_count' => array('LIKE', $sstr), |
|
2626 | + 'Registration.REG_group_size' => array('LIKE', $sstr) |
|
2627 | 2627 | ); |
2628 | 2628 | } |
2629 | 2629 | |
2630 | 2630 | |
2631 | - $offset = ($current_page-1)*$per_page; |
|
2632 | - $limit = $count ? NULL : array( $offset, $per_page ); |
|
2631 | + $offset = ($current_page - 1) * $per_page; |
|
2632 | + $limit = $count ? NULL : array($offset, $per_page); |
|
2633 | 2633 | |
2634 | - if ( $trash ) { |
|
2635 | - $_where['status'] = array( '!=', 'publish' ); |
|
2636 | - $all_attendees = $count ? $ATT_MDL->count( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit), 'ATT_ID', true ): $ATT_MDL->get_all( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit)); |
|
2634 | + if ($trash) { |
|
2635 | + $_where['status'] = array('!=', 'publish'); |
|
2636 | + $all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit), 'ATT_ID', true) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)); |
|
2637 | 2637 | } else { |
2638 | - $_where['status'] = array( 'IN', array( 'publish' ) ); |
|
2639 | - $all_attendees = $count ? $ATT_MDL->count( array($_where, 'order_by'=>array($orderby=>$sort),'limit'=>$limit ), 'ATT_ID' , true ) : $ATT_MDL->get_all( array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit) ); |
|
2638 | + $_where['status'] = array('IN', array('publish')); |
|
2639 | + $all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit), 'ATT_ID', true) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)); |
|
2640 | 2640 | } |
2641 | 2641 | |
2642 | 2642 | return $all_attendees; |
@@ -2653,10 +2653,10 @@ discard block |
||
2653 | 2653 | */ |
2654 | 2654 | protected function _resend_registration() { |
2655 | 2655 | $this->_process_resend_registration(); |
2656 | - $query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID'] ) : array( |
|
2656 | + $query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID']) : array( |
|
2657 | 2657 | 'action' => 'default' |
2658 | 2658 | ); |
2659 | - $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE ); |
|
2659 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
2660 | 2660 | } |
2661 | 2661 | |
2662 | 2662 | |
@@ -2664,26 +2664,26 @@ discard block |
||
2664 | 2664 | |
2665 | 2665 | |
2666 | 2666 | |
2667 | - public function _registrations_report(){ |
|
2668 | - if( ! defined( 'EE_USE_OLD_CSV_REPORT_CLASS' ) ) { |
|
2669 | - wp_redirect( EE_Admin_Page::add_query_args_and_nonce( |
|
2667 | + public function _registrations_report() { |
|
2668 | + if ( ! defined('EE_USE_OLD_CSV_REPORT_CLASS')) { |
|
2669 | + wp_redirect(EE_Admin_Page::add_query_args_and_nonce( |
|
2670 | 2670 | array( |
2671 | 2671 | 'page' => 'espresso_batch', |
2672 | 2672 | 'batch' => 'file', |
2673 | - 'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL, |
|
2674 | - 'job_handler' => urlencode( 'EventEspressoBatchRequest\JobHandlers\RegistrationsReport' ), |
|
2675 | - 'return_url' => urlencode( $this->_req_data[ 'return_url' ] ), |
|
2676 | - )) ); |
|
2673 | + 'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL, |
|
2674 | + 'job_handler' => urlencode('EventEspressoBatchRequest\JobHandlers\RegistrationsReport'), |
|
2675 | + 'return_url' => urlencode($this->_req_data['return_url']), |
|
2676 | + ))); |
|
2677 | 2677 | } else { |
2678 | 2678 | $new_request_args = array( |
2679 | 2679 | 'export' => 'report', |
2680 | 2680 | 'action' => 'registrations_report_for_event', |
2681 | - 'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL, |
|
2681 | + 'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL, |
|
2682 | 2682 | ); |
2683 | 2683 | $this->_req_data = array_merge($this->_req_data, $new_request_args); |
2684 | 2684 | |
2685 | - if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) { |
|
2686 | - require_once(EE_CLASSES . 'EE_Export.class.php'); |
|
2685 | + if (is_readable(EE_CLASSES.'EE_Export.class.php')) { |
|
2686 | + require_once(EE_CLASSES.'EE_Export.class.php'); |
|
2687 | 2687 | $EE_Export = EE_Export::instance($this->_req_data); |
2688 | 2688 | $EE_Export->export(); |
2689 | 2689 | } |
@@ -2692,26 +2692,26 @@ discard block |
||
2692 | 2692 | |
2693 | 2693 | |
2694 | 2694 | |
2695 | - public function _contact_list_export(){ |
|
2696 | - if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) { |
|
2697 | - require_once(EE_CLASSES . 'EE_Export.class.php'); |
|
2695 | + public function _contact_list_export() { |
|
2696 | + if (is_readable(EE_CLASSES.'EE_Export.class.php')) { |
|
2697 | + require_once(EE_CLASSES.'EE_Export.class.php'); |
|
2698 | 2698 | $EE_Export = EE_Export::instance($this->_req_data); |
2699 | 2699 | $EE_Export->export_attendees(); |
2700 | 2700 | } |
2701 | 2701 | } |
2702 | 2702 | |
2703 | - public function _contact_list_report(){ |
|
2704 | - if( ! defined( 'EE_USE_OLD_CSV_REPORT_CLASS' ) ) { |
|
2705 | - wp_redirect( EE_Admin_Page::add_query_args_and_nonce( |
|
2703 | + public function _contact_list_report() { |
|
2704 | + if ( ! defined('EE_USE_OLD_CSV_REPORT_CLASS')) { |
|
2705 | + wp_redirect(EE_Admin_Page::add_query_args_and_nonce( |
|
2706 | 2706 | array( |
2707 | 2707 | 'page' => 'espresso_batch', |
2708 | 2708 | 'batch' => 'file', |
2709 | - 'job_handler' => urlencode( 'EventEspressoBatchRequest\JobHandlers\AttendeesReport' ), |
|
2710 | - 'return_url' => urlencode( $this->_req_data[ 'return_url' ] ), |
|
2711 | - )) ); |
|
2709 | + 'job_handler' => urlencode('EventEspressoBatchRequest\JobHandlers\AttendeesReport'), |
|
2710 | + 'return_url' => urlencode($this->_req_data['return_url']), |
|
2711 | + ))); |
|
2712 | 2712 | } else { |
2713 | - if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) { |
|
2714 | - require_once(EE_CLASSES . 'EE_Export.class.php'); |
|
2713 | + if (is_readable(EE_CLASSES.'EE_Export.class.php')) { |
|
2714 | + require_once(EE_CLASSES.'EE_Export.class.php'); |
|
2715 | 2715 | $EE_Export = EE_Export::instance($this->_req_data); |
2716 | 2716 | $EE_Export->report_attendees(); |
2717 | 2717 | } |
@@ -2730,73 +2730,73 @@ discard block |
||
2730 | 2730 | * @return void |
2731 | 2731 | */ |
2732 | 2732 | protected function _duplicate_attendee() { |
2733 | - $action = !empty( $this->_req_data['return'] ) ? $this->_req_data['return'] : 'default'; |
|
2733 | + $action = ! empty($this->_req_data['return']) ? $this->_req_data['return'] : 'default'; |
|
2734 | 2734 | //verify we have necessary info |
2735 | - if ( empty($this->_req_data['_REG_ID'] ) ) { |
|
2736 | - EE_Error::add_error( __('Unable to create the contact for the registration because the required parameters are not present (_REG_ID )', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__ ); |
|
2737 | - $query_args = array( 'action' => $action ); |
|
2735 | + if (empty($this->_req_data['_REG_ID'])) { |
|
2736 | + EE_Error::add_error(__('Unable to create the contact for the registration because the required parameters are not present (_REG_ID )', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__); |
|
2737 | + $query_args = array('action' => $action); |
|
2738 | 2738 | $this->_redirect_after_action('', '', '', $query_args, TRUE); |
2739 | 2739 | } |
2740 | 2740 | |
2741 | 2741 | //okay necessary deets present... let's dupe the incoming attendee and attach to incoming registration. |
2742 | - $registration = EEM_Registration::instance()->get_one_by_ID( $this->_req_data['_REG_ID'] ); |
|
2742 | + $registration = EEM_Registration::instance()->get_one_by_ID($this->_req_data['_REG_ID']); |
|
2743 | 2743 | $attendee = $registration->attendee(); |
2744 | 2744 | |
2745 | 2745 | //remove relation of existing attendee on registration |
2746 | - $registration->_remove_relation_to($attendee, 'Attendee' ); |
|
2746 | + $registration->_remove_relation_to($attendee, 'Attendee'); |
|
2747 | 2747 | //new attendee |
2748 | 2748 | $new_attendee = clone $attendee; |
2749 | - $new_attendee->set( 'ATT_ID', 0 ); |
|
2749 | + $new_attendee->set('ATT_ID', 0); |
|
2750 | 2750 | $new_attendee->save(); |
2751 | 2751 | |
2752 | 2752 | //add new attendee to reg |
2753 | - $registration->_add_relation_to( $new_attendee, 'Attendee'); |
|
2753 | + $registration->_add_relation_to($new_attendee, 'Attendee'); |
|
2754 | 2754 | |
2755 | - EE_Error::add_success( __('New Contact record created. Now make any edits you wish to make for this contact.', 'event_espresso') ); |
|
2755 | + EE_Error::add_success(__('New Contact record created. Now make any edits you wish to make for this contact.', 'event_espresso')); |
|
2756 | 2756 | |
2757 | 2757 | //redirect to edit page for attendee |
2758 | - $query_args = array( 'post' => $new_attendee->ID(), 'action' => 'edit_attendee' ); |
|
2758 | + $query_args = array('post' => $new_attendee->ID(), 'action' => 'edit_attendee'); |
|
2759 | 2759 | |
2760 | - $this->_redirect_after_action( '', '', '', $query_args, TRUE ); |
|
2760 | + $this->_redirect_after_action('', '', '', $query_args, TRUE); |
|
2761 | 2761 | } |
2762 | 2762 | |
2763 | 2763 | |
2764 | 2764 | //related to cpt routes |
2765 | 2765 | protected function _insert_update_cpt_item($post_id, $post) { |
2766 | 2766 | $success = true; |
2767 | - $attendee = EEM_Attendee::instance()->get_one_by_ID( $post_id ); |
|
2767 | + $attendee = EEM_Attendee::instance()->get_one_by_ID($post_id); |
|
2768 | 2768 | //for attendee updates |
2769 | - if ( $post->post_type = 'espresso_attendees' && !empty( $attendee ) ) { |
|
2769 | + if ($post->post_type = 'espresso_attendees' && ! empty($attendee)) { |
|
2770 | 2770 | //note we should only be UPDATING attendees at this point. |
2771 | 2771 | $updated_fields = array( |
2772 | 2772 | 'ATT_fname' => $this->_req_data['ATT_fname'], |
2773 | 2773 | 'ATT_lname' => $this->_req_data['ATT_lname'], |
2774 | - 'ATT_full_name'=> $this->_req_data['ATT_fname'] . ' ' . $this->_req_data['ATT_lname'], |
|
2774 | + 'ATT_full_name'=> $this->_req_data['ATT_fname'].' '.$this->_req_data['ATT_lname'], |
|
2775 | 2775 | 'ATT_address' => isset($this->_req_data['ATT_address']) ? $this->_req_data['ATT_address'] : '', |
2776 | 2776 | 'ATT_address2' => isset($this->_req_data['ATT_address2']) ? $this->_req_data['ATT_address2'] : '', |
2777 | - 'ATT_city' => isset( $this->_req_data['ATT_city'] ) ? $this->_req_data['ATT_city'] : '', |
|
2778 | - 'STA_ID' => isset( $this->_req_data['STA_ID'] ) ? $this->_req_data['STA_ID'] : '', |
|
2779 | - 'CNT_ISO' => isset( $this->_req_data['CNT_ISO'] ) ? $this->_req_data['CNT_ISO'] : '', |
|
2780 | - 'ATT_zip' => isset( $this->_req_data['ATT_zip'] ) ? $this->_req_data['ATT_zip'] : '', |
|
2781 | - 'ATT_email' => isset( $this->_req_data['ATT_email'] ) ? $this->_req_data['ATT_email'] : '', |
|
2782 | - 'ATT_phone' => isset( $this->_req_data['ATT_phone'] ) ? $this->_req_data['ATT_phone'] : '' |
|
2777 | + 'ATT_city' => isset($this->_req_data['ATT_city']) ? $this->_req_data['ATT_city'] : '', |
|
2778 | + 'STA_ID' => isset($this->_req_data['STA_ID']) ? $this->_req_data['STA_ID'] : '', |
|
2779 | + 'CNT_ISO' => isset($this->_req_data['CNT_ISO']) ? $this->_req_data['CNT_ISO'] : '', |
|
2780 | + 'ATT_zip' => isset($this->_req_data['ATT_zip']) ? $this->_req_data['ATT_zip'] : '', |
|
2781 | + 'ATT_email' => isset($this->_req_data['ATT_email']) ? $this->_req_data['ATT_email'] : '', |
|
2782 | + 'ATT_phone' => isset($this->_req_data['ATT_phone']) ? $this->_req_data['ATT_phone'] : '' |
|
2783 | 2783 | ); |
2784 | - foreach ( $updated_fields as $field => $value ) { |
|
2784 | + foreach ($updated_fields as $field => $value) { |
|
2785 | 2785 | $attendee->set($field, $value); |
2786 | 2786 | } |
2787 | 2787 | |
2788 | 2788 | $success = $attendee->save(); |
2789 | 2789 | |
2790 | - $attendee_update_callbacks = apply_filters( 'FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array() ); |
|
2791 | - foreach ( $attendee_update_callbacks as $a_callback ) { |
|
2792 | - if ( FALSE === call_user_func_array( $a_callback, array($attendee, $this->_req_data ) ) ) { |
|
2793 | - throw new EE_Error( sprintf( __('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback. Please check the spelling.', 'event_espresso'), $a_callback ) ); |
|
2790 | + $attendee_update_callbacks = apply_filters('FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array()); |
|
2791 | + foreach ($attendee_update_callbacks as $a_callback) { |
|
2792 | + if (FALSE === call_user_func_array($a_callback, array($attendee, $this->_req_data))) { |
|
2793 | + throw new EE_Error(sprintf(__('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback. Please check the spelling.', 'event_espresso'), $a_callback)); |
|
2794 | 2794 | } |
2795 | 2795 | } |
2796 | 2796 | } |
2797 | 2797 | |
2798 | - if ( $success === FALSE ) |
|
2799 | - EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
2798 | + if ($success === FALSE) |
|
2799 | + EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
2800 | 2800 | |
2801 | 2801 | } |
2802 | 2802 | |
@@ -2816,17 +2816,17 @@ discard block |
||
2816 | 2816 | remove_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core'); |
2817 | 2817 | remove_meta_box('commentstatusdiv', $this->_cpt_routes[$this->_req_action], 'normal', 'core'); |
2818 | 2818 | |
2819 | - if ( post_type_supports( 'espresso_attendees', 'excerpt') ) { |
|
2820 | - add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal' ); |
|
2819 | + if (post_type_supports('espresso_attendees', 'excerpt')) { |
|
2820 | + add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal'); |
|
2821 | 2821 | } |
2822 | 2822 | |
2823 | - if ( post_type_supports( 'espresso_attendees', 'comments') ) { |
|
2823 | + if (post_type_supports('espresso_attendees', 'comments')) { |
|
2824 | 2824 | add_meta_box('commentsdiv', __('Notes on the Contact', 'event_espresso'), 'post_comment_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core'); |
2825 | 2825 | } |
2826 | 2826 | |
2827 | - add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array( $this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core' ); |
|
2828 | - add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core' ); |
|
2829 | - add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array( $this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high'); |
|
2827 | + add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array($this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core'); |
|
2828 | + add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core'); |
|
2829 | + add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array($this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high'); |
|
2830 | 2830 | } |
2831 | 2831 | |
2832 | 2832 | |
@@ -2835,10 +2835,10 @@ discard block |
||
2835 | 2835 | * @param WP_Post $post wp post object |
2836 | 2836 | * @return string attendee contact info ( and form ) |
2837 | 2837 | */ |
2838 | - public function attendee_contact_info( $post ) { |
|
2838 | + public function attendee_contact_info($post) { |
|
2839 | 2839 | //get attendee object ( should already have it ) |
2840 | 2840 | $this->_template_args['attendee'] = $this->_cpt_model_obj; |
2841 | - $template = REG_TEMPLATE_PATH . 'attendee_contact_info_metabox_content.template.php'; |
|
2841 | + $template = REG_TEMPLATE_PATH.'attendee_contact_info_metabox_content.template.php'; |
|
2842 | 2842 | EEH_Template::display_template($template, $this->_template_args); |
2843 | 2843 | } |
2844 | 2844 | |
@@ -2854,12 +2854,12 @@ discard block |
||
2854 | 2854 | $this->_template_args['attendee'] = $this->_cpt_model_obj; |
2855 | 2855 | $this->_template_args['state_html'] = EEH_Form_Fields::generate_form_input( |
2856 | 2856 | new EE_Question_Form_Input( |
2857 | - EE_Question::new_instance( array( |
|
2857 | + EE_Question::new_instance(array( |
|
2858 | 2858 | 'QST_ID' => 0, |
2859 | 2859 | 'QST_display_text' => __('State/Province', 'event_espresso'), |
2860 | 2860 | 'QST_system' => 'admin-state' |
2861 | 2861 | )), |
2862 | - EE_Answer::new_instance( array( |
|
2862 | + EE_Answer::new_instance(array( |
|
2863 | 2863 | 'ANS_ID' => 0, |
2864 | 2864 | 'ANS_value' => $this->_cpt_model_obj->state_ID() |
2865 | 2865 | )), |
@@ -2872,12 +2872,12 @@ discard block |
||
2872 | 2872 | )); |
2873 | 2873 | $this->_template_args['country_html'] = EEH_Form_Fields::generate_form_input( |
2874 | 2874 | new EE_Question_Form_Input( |
2875 | - EE_Question::new_instance( array( |
|
2875 | + EE_Question::new_instance(array( |
|
2876 | 2876 | 'QST_ID' => 0, |
2877 | 2877 | 'QST_display_text' => __('Country', 'event_espresso'), |
2878 | 2878 | 'QST_system' => 'admin-country' |
2879 | 2879 | )), |
2880 | - EE_Answer::new_instance( array( |
|
2880 | + EE_Answer::new_instance(array( |
|
2881 | 2881 | 'ANS_ID' => 0, |
2882 | 2882 | 'ANS_value' => $this->_cpt_model_obj->country_ID() |
2883 | 2883 | )), |
@@ -2888,8 +2888,8 @@ discard block |
||
2888 | 2888 | 'append_qstn_id' => FALSE |
2889 | 2889 | ) |
2890 | 2890 | )); |
2891 | - $template = REG_TEMPLATE_PATH . 'attendee_address_details_metabox_content.template.php'; |
|
2892 | - EEH_Template::display_template($template, $this->_template_args ); |
|
2891 | + $template = REG_TEMPLATE_PATH.'attendee_address_details_metabox_content.template.php'; |
|
2892 | + EEH_Template::display_template($template, $this->_template_args); |
|
2893 | 2893 | |
2894 | 2894 | } |
2895 | 2895 | |
@@ -2899,11 +2899,11 @@ discard block |
||
2899 | 2899 | * @access protected |
2900 | 2900 | * @return void |
2901 | 2901 | */ |
2902 | - public function attendee_registrations_meta_box( $post ) { |
|
2902 | + public function attendee_registrations_meta_box($post) { |
|
2903 | 2903 | |
2904 | 2904 | $this->_template_args['attendee'] = $this->_cpt_model_obj; |
2905 | 2905 | $this->_template_args['registrations'] = $this->_cpt_model_obj->get_many_related('Registration'); |
2906 | - $template = REG_TEMPLATE_PATH . 'attendee_registrations_main_meta_box.template.php'; |
|
2906 | + $template = REG_TEMPLATE_PATH.'attendee_registrations_main_meta_box.template.php'; |
|
2907 | 2907 | EEH_Template::display_template($template, $this->_template_args); |
2908 | 2908 | |
2909 | 2909 | } |
@@ -2917,8 +2917,8 @@ discard block |
||
2917 | 2917 | * @return string html for new form. |
2918 | 2918 | */ |
2919 | 2919 | public function after_title_form_fields($post) { |
2920 | - if ( $post->post_type == 'espresso_attendees' ) { |
|
2921 | - $template = REG_TEMPLATE_PATH . 'attendee_details_after_title_form_fields.template.php'; |
|
2920 | + if ($post->post_type == 'espresso_attendees') { |
|
2921 | + $template = REG_TEMPLATE_PATH.'attendee_details_after_title_form_fields.template.php'; |
|
2922 | 2922 | $template_args['attendee'] = $this->_cpt_model_obj; |
2923 | 2923 | EEH_Template::display_template($template, $template_args); |
2924 | 2924 | } |
@@ -2935,21 +2935,21 @@ discard block |
||
2935 | 2935 | * @access protected |
2936 | 2936 | * @return void |
2937 | 2937 | */ |
2938 | - protected function _trash_or_restore_attendees( $trash = TRUE ) { |
|
2938 | + protected function _trash_or_restore_attendees($trash = TRUE) { |
|
2939 | 2939 | |
2940 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
2940 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
2941 | 2941 | |
2942 | 2942 | $ATT_MDL = EEM_Attendee::instance(); |
2943 | 2943 | |
2944 | 2944 | $success = 1; |
2945 | 2945 | //Checkboxes |
2946 | - if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
2946 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
2947 | 2947 | // if array has more than one element than success message should be plural |
2948 | - $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
2948 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
2949 | 2949 | // cycle thru checkboxes |
2950 | - while (list( $ATT_ID, $value ) = each($this->_req_data['checkbox'])) { |
|
2951 | - $updated = $trash ? $ATT_MDL->update_by_ID(array( 'status' => 'trash' ), $ATT_ID) : $ATT_MDL->update_by_ID( array('status' => 'publish' ), $ATT_ID); |
|
2952 | - if ( !$updated ) { |
|
2950 | + while (list($ATT_ID, $value) = each($this->_req_data['checkbox'])) { |
|
2951 | + $updated = $trash ? $ATT_MDL->update_by_ID(array('status' => 'trash'), $ATT_ID) : $ATT_MDL->update_by_ID(array('status' => 'publish'), $ATT_ID); |
|
2952 | + if ( ! $updated) { |
|
2953 | 2953 | $success = 0; |
2954 | 2954 | } |
2955 | 2955 | } |
@@ -2958,18 +2958,18 @@ discard block |
||
2958 | 2958 | // grab single id and delete |
2959 | 2959 | $ATT_ID = absint($this->_req_data['ATT_ID']); |
2960 | 2960 | //get attendee |
2961 | - $att = $ATT_MDL->get_one_by_ID( $ATT_ID ); |
|
2961 | + $att = $ATT_MDL->get_one_by_ID($ATT_ID); |
|
2962 | 2962 | $updated = $trash ? $att->set_status('trash') : $att->set_status('publish'); |
2963 | 2963 | $updated = $att->save(); |
2964 | - if ( ! $updated ) { |
|
2964 | + if ( ! $updated) { |
|
2965 | 2965 | $success = 0; |
2966 | 2966 | } |
2967 | 2967 | |
2968 | 2968 | } |
2969 | 2969 | |
2970 | - $what = $success > 1 ? __( 'Contacts', 'event_espresso' ) : __( 'Contact', 'event_espresso' ); |
|
2971 | - $action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' ); |
|
2972 | - $this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'contact_list' ) ); |
|
2970 | + $what = $success > 1 ? __('Contacts', 'event_espresso') : __('Contact', 'event_espresso'); |
|
2971 | + $action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso'); |
|
2972 | + $this->_redirect_after_action($success, $what, $action_desc, array('action' => 'contact_list')); |
|
2973 | 2973 | |
2974 | 2974 | } |
2975 | 2975 |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'ABSPATH' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('ABSPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /* |
5 | 5 | Plugin Name: Event Espresso |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * |
43 | 43 | */ |
44 | 44 | |
45 | -if ( function_exists( 'espresso_version' ) ) { |
|
45 | +if (function_exists('espresso_version')) { |
|
46 | 46 | |
47 | 47 | /** |
48 | 48 | * espresso_duplicate_plugin_error |
@@ -51,12 +51,12 @@ discard block |
||
51 | 51 | function espresso_duplicate_plugin_error() { |
52 | 52 | ?> |
53 | 53 | <div class="error"> |
54 | - <p><?php _e( 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', 'event_espresso' ); ?></p> |
|
54 | + <p><?php _e('Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', 'event_espresso'); ?></p> |
|
55 | 55 | </div> |
56 | 56 | <?php |
57 | - espresso_deactivate_plugin( plugin_basename( __FILE__ ) ); |
|
57 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
58 | 58 | } |
59 | - add_action( 'admin_notices', 'espresso_duplicate_plugin_error', 1 ); |
|
59 | + add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
60 | 60 | |
61 | 61 | } else { |
62 | 62 | |
@@ -67,103 +67,103 @@ discard block |
||
67 | 67 | * @return string |
68 | 68 | */ |
69 | 69 | function espresso_version() { |
70 | - return apply_filters( 'FHEE__espresso__espresso_version', '4.9.13.rc.001' ); |
|
70 | + return apply_filters('FHEE__espresso__espresso_version', '4.9.13.rc.001'); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | // define versions |
74 | - define( 'EVENT_ESPRESSO_VERSION', espresso_version() ); |
|
75 | - define( 'EE_MIN_WP_VER_REQUIRED', '4.1' ); |
|
76 | - define( 'EE_MIN_WP_VER_RECOMMENDED', '4.4.2' ); |
|
77 | - define( 'EE_MIN_PHP_VER_REQUIRED', '5.3.0' ); |
|
78 | - define( 'EE_MIN_PHP_VER_RECOMMENDED', '5.4.44' ); |
|
79 | - define( 'EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - ' . EVENT_ESPRESSO_VERSION ); |
|
80 | - define( 'EVENT_ESPRESSO_MAIN_FILE', __FILE__ ); |
|
74 | + define('EVENT_ESPRESSO_VERSION', espresso_version()); |
|
75 | + define('EE_MIN_WP_VER_REQUIRED', '4.1'); |
|
76 | + define('EE_MIN_WP_VER_RECOMMENDED', '4.4.2'); |
|
77 | + define('EE_MIN_PHP_VER_REQUIRED', '5.3.0'); |
|
78 | + define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.44'); |
|
79 | + define('EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - '.EVENT_ESPRESSO_VERSION); |
|
80 | + define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
81 | 81 | //used to be DIRECTORY_SEPARATOR, but that caused issues on windows |
82 | - if ( ! defined( 'DS' ) ) { |
|
83 | - define( 'DS', '/' ); |
|
82 | + if ( ! defined('DS')) { |
|
83 | + define('DS', '/'); |
|
84 | 84 | } |
85 | - if ( ! defined( 'PS' ) ) { |
|
86 | - define( 'PS', PATH_SEPARATOR ); |
|
85 | + if ( ! defined('PS')) { |
|
86 | + define('PS', PATH_SEPARATOR); |
|
87 | 87 | } |
88 | - if ( ! defined( 'SP' ) ) { |
|
89 | - define( 'SP', ' ' ); |
|
88 | + if ( ! defined('SP')) { |
|
89 | + define('SP', ' '); |
|
90 | 90 | } |
91 | - if ( ! defined( 'EENL' ) ) { |
|
92 | - define( 'EENL', "\n" ); |
|
91 | + if ( ! defined('EENL')) { |
|
92 | + define('EENL', "\n"); |
|
93 | 93 | } |
94 | - define( 'EE_SUPPORT_EMAIL', '[email protected]' ); |
|
94 | + define('EE_SUPPORT_EMAIL', '[email protected]'); |
|
95 | 95 | // define the plugin directory and URL |
96 | - define( 'EE_PLUGIN_BASENAME', plugin_basename( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
97 | - define( 'EE_PLUGIN_DIR_PATH', plugin_dir_path( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
98 | - define( 'EE_PLUGIN_DIR_URL', plugin_dir_url( EVENT_ESPRESSO_MAIN_FILE ) ); |
|
96 | + define('EE_PLUGIN_BASENAME', plugin_basename(EVENT_ESPRESSO_MAIN_FILE)); |
|
97 | + define('EE_PLUGIN_DIR_PATH', plugin_dir_path(EVENT_ESPRESSO_MAIN_FILE)); |
|
98 | + define('EE_PLUGIN_DIR_URL', plugin_dir_url(EVENT_ESPRESSO_MAIN_FILE)); |
|
99 | 99 | // main root folder paths |
100 | - define( 'EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH . 'admin_pages' . DS ); |
|
101 | - define( 'EE_CORE', EE_PLUGIN_DIR_PATH . 'core' . DS ); |
|
102 | - define( 'EE_MODULES', EE_PLUGIN_DIR_PATH . 'modules' . DS ); |
|
103 | - define( 'EE_PUBLIC', EE_PLUGIN_DIR_PATH . 'public' . DS ); |
|
104 | - define( 'EE_SHORTCODES', EE_PLUGIN_DIR_PATH . 'shortcodes' . DS ); |
|
105 | - define( 'EE_WIDGETS', EE_PLUGIN_DIR_PATH . 'widgets' . DS ); |
|
106 | - define( 'EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH . 'payment_methods' . DS ); |
|
107 | - define( 'EE_CAFF_PATH', EE_PLUGIN_DIR_PATH . 'caffeinated' . DS ); |
|
100 | + define('EE_ADMIN_PAGES', EE_PLUGIN_DIR_PATH.'admin_pages'.DS); |
|
101 | + define('EE_CORE', EE_PLUGIN_DIR_PATH.'core'.DS); |
|
102 | + define('EE_MODULES', EE_PLUGIN_DIR_PATH.'modules'.DS); |
|
103 | + define('EE_PUBLIC', EE_PLUGIN_DIR_PATH.'public'.DS); |
|
104 | + define('EE_SHORTCODES', EE_PLUGIN_DIR_PATH.'shortcodes'.DS); |
|
105 | + define('EE_WIDGETS', EE_PLUGIN_DIR_PATH.'widgets'.DS); |
|
106 | + define('EE_PAYMENT_METHODS', EE_PLUGIN_DIR_PATH.'payment_methods'.DS); |
|
107 | + define('EE_CAFF_PATH', EE_PLUGIN_DIR_PATH.'caffeinated'.DS); |
|
108 | 108 | // core system paths |
109 | - define( 'EE_ADMIN', EE_CORE . 'admin' . DS ); |
|
110 | - define( 'EE_CPTS', EE_CORE . 'CPTs' . DS ); |
|
111 | - define( 'EE_CLASSES', EE_CORE . 'db_classes' . DS ); |
|
112 | - define( 'EE_INTERFACES', EE_CORE . 'interfaces' . DS ); |
|
113 | - define( 'EE_BUSINESS', EE_CORE . 'business' . DS ); |
|
114 | - define( 'EE_MODELS', EE_CORE . 'db_models' . DS ); |
|
115 | - define( 'EE_HELPERS', EE_CORE . 'helpers' . DS ); |
|
116 | - define( 'EE_LIBRARIES', EE_CORE . 'libraries' . DS ); |
|
117 | - define( 'EE_TEMPLATES', EE_CORE . 'templates' . DS ); |
|
118 | - define( 'EE_THIRD_PARTY', EE_CORE . 'third_party_libs' . DS ); |
|
119 | - define( 'EE_GLOBAL_ASSETS', EE_TEMPLATES . 'global_assets' . DS ); |
|
120 | - define( 'EE_FORM_SECTIONS', EE_LIBRARIES . 'form_sections' . DS ); |
|
109 | + define('EE_ADMIN', EE_CORE.'admin'.DS); |
|
110 | + define('EE_CPTS', EE_CORE.'CPTs'.DS); |
|
111 | + define('EE_CLASSES', EE_CORE.'db_classes'.DS); |
|
112 | + define('EE_INTERFACES', EE_CORE.'interfaces'.DS); |
|
113 | + define('EE_BUSINESS', EE_CORE.'business'.DS); |
|
114 | + define('EE_MODELS', EE_CORE.'db_models'.DS); |
|
115 | + define('EE_HELPERS', EE_CORE.'helpers'.DS); |
|
116 | + define('EE_LIBRARIES', EE_CORE.'libraries'.DS); |
|
117 | + define('EE_TEMPLATES', EE_CORE.'templates'.DS); |
|
118 | + define('EE_THIRD_PARTY', EE_CORE.'third_party_libs'.DS); |
|
119 | + define('EE_GLOBAL_ASSETS', EE_TEMPLATES.'global_assets'.DS); |
|
120 | + define('EE_FORM_SECTIONS', EE_LIBRARIES.'form_sections'.DS); |
|
121 | 121 | // gateways |
122 | - define( 'EE_GATEWAYS', EE_MODULES . 'gateways' . DS ); |
|
123 | - define( 'EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL . 'modules' . DS . 'gateways' . DS ); |
|
122 | + define('EE_GATEWAYS', EE_MODULES.'gateways'.DS); |
|
123 | + define('EE_GATEWAYS_URL', EE_PLUGIN_DIR_URL.'modules'.DS.'gateways'.DS); |
|
124 | 124 | // asset URL paths |
125 | - define( 'EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'templates' . DS ); |
|
126 | - define( 'EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL . 'global_assets' . DS ); |
|
127 | - define( 'EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL . 'images' . DS ); |
|
128 | - define( 'EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL . 'core' . DS . 'third_party_libs' . DS ); |
|
129 | - define( 'EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL . 'core/helpers/assets/' ); |
|
130 | - define( 'EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL . 'core/libraries/' ); |
|
125 | + define('EE_TEMPLATES_URL', EE_PLUGIN_DIR_URL.'core'.DS.'templates'.DS); |
|
126 | + define('EE_GLOBAL_ASSETS_URL', EE_TEMPLATES_URL.'global_assets'.DS); |
|
127 | + define('EE_IMAGES_URL', EE_GLOBAL_ASSETS_URL.'images'.DS); |
|
128 | + define('EE_THIRD_PARTY_URL', EE_PLUGIN_DIR_URL.'core'.DS.'third_party_libs'.DS); |
|
129 | + define('EE_HELPERS_ASSETS', EE_PLUGIN_DIR_URL.'core/helpers/assets/'); |
|
130 | + define('EE_LIBRARIES_URL', EE_PLUGIN_DIR_URL.'core/libraries/'); |
|
131 | 131 | // define upload paths |
132 | 132 | $uploads = wp_upload_dir(); |
133 | 133 | // define the uploads directory and URL |
134 | - define( 'EVENT_ESPRESSO_UPLOAD_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS ); |
|
135 | - define( 'EVENT_ESPRESSO_UPLOAD_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS ); |
|
134 | + define('EVENT_ESPRESSO_UPLOAD_DIR', $uploads['basedir'].DS.'espresso'.DS); |
|
135 | + define('EVENT_ESPRESSO_UPLOAD_URL', $uploads['baseurl'].DS.'espresso'.DS); |
|
136 | 136 | // define the templates directory and URL |
137 | - define( 'EVENT_ESPRESSO_TEMPLATE_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS . 'templates' . DS ); |
|
138 | - define( 'EVENT_ESPRESSO_TEMPLATE_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS . 'templates' . DS ); |
|
137 | + define('EVENT_ESPRESSO_TEMPLATE_DIR', $uploads['basedir'].DS.'espresso'.DS.'templates'.DS); |
|
138 | + define('EVENT_ESPRESSO_TEMPLATE_URL', $uploads['baseurl'].DS.'espresso'.DS.'templates'.DS); |
|
139 | 139 | // define the gateway directory and URL |
140 | - define( 'EVENT_ESPRESSO_GATEWAY_DIR', $uploads[ 'basedir' ] . DS . 'espresso' . DS . 'gateways' . DS ); |
|
141 | - define( 'EVENT_ESPRESSO_GATEWAY_URL', $uploads[ 'baseurl' ] . DS . 'espresso' . DS . 'gateways' . DS ); |
|
140 | + define('EVENT_ESPRESSO_GATEWAY_DIR', $uploads['basedir'].DS.'espresso'.DS.'gateways'.DS); |
|
141 | + define('EVENT_ESPRESSO_GATEWAY_URL', $uploads['baseurl'].DS.'espresso'.DS.'gateways'.DS); |
|
142 | 142 | // languages folder/path |
143 | - define( 'EE_LANGUAGES_SAFE_LOC', '..' . DS . 'uploads' . DS . 'espresso' . DS . 'languages' . DS ); |
|
144 | - define( 'EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'languages' . DS ); |
|
143 | + define('EE_LANGUAGES_SAFE_LOC', '..'.DS.'uploads'.DS.'espresso'.DS.'languages'.DS); |
|
144 | + define('EE_LANGUAGES_SAFE_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'languages'.DS); |
|
145 | 145 | //check for dompdf fonts in uploads |
146 | - if ( file_exists( EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ) ) { |
|
147 | - define( 'DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR . 'fonts' . DS ); |
|
146 | + if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS)) { |
|
147 | + define('DOMPDF_FONT_DIR', EVENT_ESPRESSO_UPLOAD_DIR.'fonts'.DS); |
|
148 | 148 | } |
149 | 149 | //ajax constants |
150 | - define( 'EE_FRONT_AJAX', isset( $_REQUEST[ 'ee_front_ajax' ] ) || isset( $_REQUEST[ 'data' ][ 'ee_front_ajax' ] ) ? true : false ); |
|
151 | - define( 'EE_ADMIN_AJAX', isset( $_REQUEST[ 'ee_admin_ajax' ] ) || isset( $_REQUEST[ 'data' ][ 'ee_admin_ajax' ] ) ? true : false ); |
|
150 | + define('EE_FRONT_AJAX', isset($_REQUEST['ee_front_ajax']) || isset($_REQUEST['data']['ee_front_ajax']) ? true : false); |
|
151 | + define('EE_ADMIN_AJAX', isset($_REQUEST['ee_admin_ajax']) || isset($_REQUEST['data']['ee_admin_ajax']) ? true : false); |
|
152 | 152 | //just a handy constant occasionally needed for finding values representing infinity in the DB |
153 | 153 | //you're better to use this than its straight value (currently -1) in case you ever |
154 | 154 | //want to change its default value! or find when -1 means infinity |
155 | - define( 'EE_INF_IN_DB', -1 ); |
|
156 | - define( 'EE_INF', INF > (float)PHP_INT_MAX ? INF : PHP_INT_MAX ); |
|
157 | - define( 'EE_DEBUG', false ); |
|
155 | + define('EE_INF_IN_DB', -1); |
|
156 | + define('EE_INF', INF > (float) PHP_INT_MAX ? INF : PHP_INT_MAX); |
|
157 | + define('EE_DEBUG', false); |
|
158 | 158 | |
159 | 159 | /** |
160 | 160 | * espresso_plugin_activation |
161 | 161 | * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
162 | 162 | */ |
163 | 163 | function espresso_plugin_activation() { |
164 | - update_option( 'ee_espresso_activation', true ); |
|
164 | + update_option('ee_espresso_activation', true); |
|
165 | 165 | } |
166 | - register_activation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation' ); |
|
166 | + register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
167 | 167 | |
168 | 168 | |
169 | 169 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | // } |
178 | 178 | // |
179 | 179 | } |
180 | - register_deactivation_hook( EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation' ); |
|
180 | + register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation'); |
|
181 | 181 | |
182 | 182 | |
183 | 183 | |
@@ -187,15 +187,15 @@ discard block |
||
187 | 187 | */ |
188 | 188 | function espresso_load_error_handling() { |
189 | 189 | // load debugging tools |
190 | - if ( WP_DEBUG === true && is_readable( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ) ) { |
|
191 | - require_once( EE_HELPERS . 'EEH_Debug_Tools.helper.php' ); |
|
190 | + if (WP_DEBUG === true && is_readable(EE_HELPERS.'EEH_Debug_Tools.helper.php')) { |
|
191 | + require_once(EE_HELPERS.'EEH_Debug_Tools.helper.php'); |
|
192 | 192 | EEH_Debug_Tools::instance(); |
193 | 193 | } |
194 | 194 | // load error handling |
195 | - if ( is_readable( EE_CORE . 'EE_Error.core.php' ) ) { |
|
196 | - require_once( EE_CORE . 'EE_Error.core.php' ); |
|
195 | + if (is_readable(EE_CORE.'EE_Error.core.php')) { |
|
196 | + require_once(EE_CORE.'EE_Error.core.php'); |
|
197 | 197 | } else { |
198 | - wp_die( __( 'The EE_Error core class could not be loaded.', 'event_espresso' ) ); |
|
198 | + wp_die(__('The EE_Error core class could not be loaded.', 'event_espresso')); |
|
199 | 199 | } |
200 | 200 | } |
201 | 201 | |
@@ -209,25 +209,25 @@ discard block |
||
209 | 209 | * @param string $full_path_to_file |
210 | 210 | * @throws EE_Error |
211 | 211 | */ |
212 | - function espresso_load_required( $classname, $full_path_to_file ) { |
|
212 | + function espresso_load_required($classname, $full_path_to_file) { |
|
213 | 213 | static $error_handling_loaded = false; |
214 | - if ( ! $error_handling_loaded ) { |
|
214 | + if ( ! $error_handling_loaded) { |
|
215 | 215 | espresso_load_error_handling(); |
216 | 216 | $error_handling_loaded = true; |
217 | 217 | } |
218 | - if ( is_readable( $full_path_to_file ) ) { |
|
219 | - require_once( $full_path_to_file ); |
|
218 | + if (is_readable($full_path_to_file)) { |
|
219 | + require_once($full_path_to_file); |
|
220 | 220 | } else { |
221 | - throw new EE_Error ( sprintf( |
|
222 | - __( 'The %s class file could not be located or is not readable due to file permissions.', 'event_espresso' ), |
|
221 | + throw new EE_Error(sprintf( |
|
222 | + __('The %s class file could not be located or is not readable due to file permissions.', 'event_espresso'), |
|
223 | 223 | $classname |
224 | - ) ); |
|
224 | + )); |
|
225 | 225 | } |
226 | 226 | } |
227 | 227 | |
228 | - espresso_load_required( 'EEH_Base', EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' ); |
|
229 | - espresso_load_required( 'EEH_File', EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' ); |
|
230 | - espresso_load_required( 'EE_Bootstrap', EE_CORE . 'EE_Bootstrap.core.php' ); |
|
228 | + espresso_load_required('EEH_Base', EE_CORE.'helpers'.DS.'EEH_Base.helper.php'); |
|
229 | + espresso_load_required('EEH_File', EE_CORE.'helpers'.DS.'EEH_File.helper.php'); |
|
230 | + espresso_load_required('EE_Bootstrap', EE_CORE.'EE_Bootstrap.core.php'); |
|
231 | 231 | new EE_Bootstrap(); |
232 | 232 | |
233 | 233 | |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | |
237 | 237 | |
238 | 238 | |
239 | -if ( ! function_exists( 'espresso_deactivate_plugin' ) ) { |
|
239 | +if ( ! function_exists('espresso_deactivate_plugin')) { |
|
240 | 240 | /** |
241 | 241 | * deactivate_plugin |
242 | 242 | * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
@@ -245,11 +245,11 @@ discard block |
||
245 | 245 | * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
246 | 246 | * @return void |
247 | 247 | */ |
248 | - function espresso_deactivate_plugin( $plugin_basename = '' ) { |
|
249 | - if ( ! function_exists( 'deactivate_plugins' ) ) { |
|
250 | - require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
|
248 | + function espresso_deactivate_plugin($plugin_basename = '') { |
|
249 | + if ( ! function_exists('deactivate_plugins')) { |
|
250 | + require_once(ABSPATH.'wp-admin/includes/plugin.php'); |
|
251 | 251 | } |
252 | - unset( $_GET[ 'activate' ], $_REQUEST[ 'activate' ] ); |
|
253 | - deactivate_plugins( $plugin_basename ); |
|
252 | + unset($_GET['activate'], $_REQUEST['activate']); |
|
253 | + deactivate_plugins($plugin_basename); |
|
254 | 254 | } |
255 | 255 | } |