@@ -6,42 +6,42 @@ |
||
6 | 6 | <li> |
7 | 7 | <strong>[ESPRESSO_EVENT_ATTENDEES]</strong><br> |
8 | 8 | <p class="description"> |
9 | - <?php _e('With no parameters, this shows the attendees for the earliest active event, or if no active event, the earliest upcoming event. If it is used in Event Description, then it will show the attendees for that event.', 'event_espresso' ); ?> |
|
9 | + <?php _e('With no parameters, this shows the attendees for the earliest active event, or if no active event, the earliest upcoming event. If it is used in Event Description, then it will show the attendees for that event.', 'event_espresso'); ?> |
|
10 | 10 | </p> |
11 | 11 | <br> |
12 | 12 | </li> |
13 | 13 | <li> |
14 | 14 | <strong>[ESPRESSO_EVENT_ATTENDEES event_id=30]</strong><br> |
15 | 15 | <p class="description"> |
16 | - <?php _e('Will list the attendees for a specific event.', 'event_espresso' ); ?> |
|
16 | + <?php _e('Will list the attendees for a specific event.', 'event_espresso'); ?> |
|
17 | 17 | </p> |
18 | 18 | <br> |
19 | 19 | </li> |
20 | 20 | <li> |
21 | 21 | <strong>[ESPRESSO_EVENT_ATTENDEES datetime_id=245]</strong><br> |
22 | 22 | <p class="description"> |
23 | - <?php _e('Will list the attendees for a specific datetime.', 'event_espresso' ); ?> |
|
23 | + <?php _e('Will list the attendees for a specific datetime.', 'event_espresso'); ?> |
|
24 | 24 | </p> |
25 | 25 | <br> |
26 | 26 | </li> |
27 | 27 | <li> |
28 | 28 | <strong>[ESPRESSO_EVENT_ATTENDEES ticket_id=34]</strong><br> |
29 | 29 | <p class="description"> |
30 | - <?php _e('Will list the attendees for a specific ticket.', 'event_espresso' ); ?> |
|
30 | + <?php _e('Will list the attendees for a specific ticket.', 'event_espresso'); ?> |
|
31 | 31 | </p> |
32 | 32 | <br> |
33 | 33 | </li> |
34 | 34 | <li> |
35 | 35 | <strong>[ESPRESSO_EVENT_ATTENDEES status=RAP]</strong><br> |
36 | 36 | <p class="description"> |
37 | - <?php _e('You can list attendees that have a specific registration status (use status code) or use "all" to return all attendees regardless of status. Default when you don\'t have this parameter set is to only return attendees attached to approved contacts.', 'event_espresso' ); ?> |
|
37 | + <?php _e('You can list attendees that have a specific registration status (use status code) or use "all" to return all attendees regardless of status. Default when you don\'t have this parameter set is to only return attendees attached to approved contacts.', 'event_espresso'); ?> |
|
38 | 38 | </p> |
39 | 39 | <p> |
40 | 40 | <?php _e('The statuses you can use are:', 'event_espresso'); ?> |
41 | 41 | <br> |
42 | 42 | <?php |
43 | - foreach ( EEM_Registration::reg_status_array( array(), true ) as $status_code => $status_label ) { |
|
44 | - echo '<strong>' . $status_code . ':</strong>' . ' ' . $status_label . '<br>'; |
|
43 | + foreach (EEM_Registration::reg_status_array(array(), true) as $status_code => $status_label) { |
|
44 | + echo '<strong>'.$status_code.':</strong>'.' '.$status_label.'<br>'; |
|
45 | 45 | } |
46 | 46 | ?> |
47 | 47 |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -359,8 +361,10 @@ discard block |
||
359 | 361 | * @return void |
360 | 362 | */ |
361 | 363 | private function _set_transaction_object() { |
362 | - if ( is_object( $this->_transaction) ) |
|
363 | - return; //get out we've already set the object |
|
364 | + if ( is_object( $this->_transaction) ) { |
|
365 | + return; |
|
366 | + } |
|
367 | + //get out we've already set the object |
|
364 | 368 | |
365 | 369 | $TXN = EEM_Transaction::instance(); |
366 | 370 | |
@@ -836,7 +840,7 @@ discard block |
||
836 | 840 | $query_args = array( array( 'OR*payment_method_for_payment' => array( |
837 | 841 | 'PMD_ID' => array( 'IN', $payment_methods_of_payments ), |
838 | 842 | 'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) ) ); |
839 | - }else{ |
|
843 | + } else{ |
|
840 | 844 | $query_args = array( array( 'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) ); |
841 | 845 | } |
842 | 846 | $this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all( $query_args ); |
@@ -1455,7 +1455,7 @@ discard block |
||
1455 | 1455 | * @param EE_Transaction $transaction |
1456 | 1456 | * @param \EE_Payment $payment |
1457 | 1457 | * @param array $REG_IDs |
1458 | - * @return bool |
|
1458 | + * @return boolean|null |
|
1459 | 1459 | */ |
1460 | 1460 | protected function _update_registration_payments( EE_Transaction $transaction, EE_Payment $payment, $REG_IDs = array() ) { |
1461 | 1461 | // we can pass our own custom set of registrations to EE_Payment_Processor::process_registration_payments() |
@@ -1647,6 +1647,7 @@ discard block |
||
1647 | 1647 | * |
1648 | 1648 | * @access protected |
1649 | 1649 | * @param \EE_Payment | null $payment |
1650 | + * @param EE_Payment $payment |
|
1650 | 1651 | */ |
1651 | 1652 | protected function _maybe_send_notifications( $payment = null ) { |
1652 | 1653 | switch ( $payment instanceof EE_Payment ) { |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | |
107 | 107 | /** |
108 | 108 | * grab url requests and route them |
109 | - * @access private |
|
110 | - * @return void |
|
111 | - */ |
|
109 | + * @access private |
|
110 | + * @return void |
|
111 | + */ |
|
112 | 112 | public function _set_page_routes() { |
113 | 113 | |
114 | 114 | $this->_set_transaction_status_array(); |
@@ -263,10 +263,10 @@ discard block |
||
263 | 263 | /** |
264 | 264 | * _set_transaction_status_array |
265 | 265 | * sets list of transaction statuses |
266 | - * |
|
266 | + * |
|
267 | 267 | * @access private |
268 | - * @return void |
|
269 | - */ |
|
268 | + * @return void |
|
269 | + */ |
|
270 | 270 | private function _set_transaction_status_array() { |
271 | 271 | self::$_txn_status = EEM_Transaction::instance()->status_array(TRUE); |
272 | 272 | } |
@@ -288,10 +288,10 @@ discard block |
||
288 | 288 | |
289 | 289 | /** |
290 | 290 | * get list of payment statuses |
291 | - * |
|
291 | + * |
|
292 | 292 | * @access private |
293 | - * @return void |
|
294 | - */ |
|
293 | + * @return void |
|
294 | + */ |
|
295 | 295 | private function _get_payment_status_array() { |
296 | 296 | self::$_pay_status = EEM_Payment::instance()->status_array(TRUE); |
297 | 297 | $this->_template_args['payment_status'] = self::$_pay_status; |
@@ -399,18 +399,18 @@ discard block |
||
399 | 399 | if ( is_object( $this->_transaction) ) |
400 | 400 | return; //get out we've already set the object |
401 | 401 | |
402 | - $TXN = EEM_Transaction::instance(); |
|
402 | + $TXN = EEM_Transaction::instance(); |
|
403 | 403 | |
404 | - $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE; |
|
404 | + $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE; |
|
405 | 405 | |
406 | - //get transaction object |
|
407 | - $this->_transaction = $TXN->get_one_by_ID($TXN_ID); |
|
408 | - $this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL; |
|
406 | + //get transaction object |
|
407 | + $this->_transaction = $TXN->get_one_by_ID($TXN_ID); |
|
408 | + $this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL; |
|
409 | 409 | |
410 | 410 | if ( empty( $this->_transaction ) ) { |
411 | - $error_msg = esc_html__('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID . esc_html__(' could not be retrieved.', 'event_espresso'); |
|
411 | + $error_msg = esc_html__('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID . esc_html__(' could not be retrieved.', 'event_espresso'); |
|
412 | 412 | EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ ); |
413 | - } |
|
413 | + } |
|
414 | 414 | } |
415 | 415 | |
416 | 416 | |
@@ -525,12 +525,12 @@ discard block |
||
525 | 525 | |
526 | 526 | |
527 | 527 | /** |
528 | - * _transaction_details |
|
528 | + * _transaction_details |
|
529 | 529 | * generates HTML for the View Transaction Details Admin page |
530 | - * |
|
530 | + * |
|
531 | 531 | * @access protected |
532 | - * @return void |
|
533 | - */ |
|
532 | + * @return void |
|
533 | + */ |
|
534 | 534 | protected function _transaction_details() { |
535 | 535 | do_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction ); |
536 | 536 | |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | 'button secondary-button right', |
582 | 582 | 'dashicons dashicons-email-alt' |
583 | 583 | ) |
584 | - : ''; |
|
584 | + : ''; |
|
585 | 585 | } else { |
586 | 586 | $this->_template_args['send_payment_reminder_button'] = ''; |
587 | 587 | } |
@@ -735,10 +735,10 @@ discard block |
||
735 | 735 | /** |
736 | 736 | * txn_details_meta_box |
737 | 737 | * generates HTML for the Transaction main meta box |
738 | - * |
|
738 | + * |
|
739 | 739 | * @access public |
740 | - * @return void |
|
741 | - */ |
|
740 | + * @return void |
|
741 | + */ |
|
742 | 742 | public function txn_details_meta_box() { |
743 | 743 | |
744 | 744 | $this->_set_transaction_object(); |
@@ -1078,10 +1078,10 @@ discard block |
||
1078 | 1078 | /** |
1079 | 1079 | * txn_billing_info_side_meta_box |
1080 | 1080 | * generates HTML for the Edit Transaction side meta box |
1081 | - * |
|
1081 | + * |
|
1082 | 1082 | * @access public |
1083 | - * @return void |
|
1084 | - */ |
|
1083 | + * @return void |
|
1084 | + */ |
|
1085 | 1085 | public function txn_billing_info_side_meta_box() { |
1086 | 1086 | |
1087 | 1087 | $this->_template_args['billing_form'] = $this->_transaction->billing_info(); |
@@ -1099,10 +1099,10 @@ discard block |
||
1099 | 1099 | /** |
1100 | 1100 | * apply_payments_or_refunds |
1101 | 1101 | * registers a payment or refund made towards a transaction |
1102 | - * |
|
1102 | + * |
|
1103 | 1103 | * @access public |
1104 | - * @return void |
|
1105 | - */ |
|
1104 | + * @return void |
|
1105 | + */ |
|
1106 | 1106 | public function apply_payments_or_refunds() { |
1107 | 1107 | $json_response_data = array( 'return_data' => FALSE ); |
1108 | 1108 | $valid_data = $this->_validate_payment_request_data(); |
@@ -1256,9 +1256,9 @@ discard block |
||
1256 | 1256 | 'default' => '', |
1257 | 1257 | 'required' => false, |
1258 | 1258 | 'html_label_text' => esc_html__( 'Transaction or Cheque Number', 'event_espresso' ), |
1259 | - 'validation_strategies' => array( |
|
1260 | - new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ), |
|
1261 | - ) |
|
1259 | + 'validation_strategies' => array( |
|
1260 | + new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ), |
|
1261 | + ) |
|
1262 | 1262 | ) |
1263 | 1263 | ), |
1264 | 1264 | 'po_number' => new EE_Text_Input( |
@@ -1266,9 +1266,9 @@ discard block |
||
1266 | 1266 | 'default' => '', |
1267 | 1267 | 'required' => false, |
1268 | 1268 | 'html_label_text' => esc_html__( 'Purchase Order Number', 'event_espresso' ), |
1269 | - 'validation_strategies' => array( |
|
1270 | - new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ), |
|
1271 | - ) |
|
1269 | + 'validation_strategies' => array( |
|
1270 | + new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ), |
|
1271 | + ) |
|
1272 | 1272 | ) |
1273 | 1273 | ), |
1274 | 1274 | 'accounting' => new EE_Text_Input( |
@@ -1276,9 +1276,9 @@ discard block |
||
1276 | 1276 | 'default' => '', |
1277 | 1277 | 'required' => false, |
1278 | 1278 | 'html_label_text' => esc_html__( 'Extra Field for Accounting', 'event_espresso' ), |
1279 | - 'validation_strategies' => array( |
|
1280 | - new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ), |
|
1281 | - ) |
|
1279 | + 'validation_strategies' => array( |
|
1280 | + new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ), |
|
1281 | + ) |
|
1282 | 1282 | ) |
1283 | 1283 | ), |
1284 | 1284 | ) |
@@ -1573,10 +1573,10 @@ discard block |
||
1573 | 1573 | /** |
1574 | 1574 | * delete_payment |
1575 | 1575 | * delete a payment or refund made towards a transaction |
1576 | - * |
|
1576 | + * |
|
1577 | 1577 | * @access public |
1578 | - * @return void |
|
1579 | - */ |
|
1578 | + * @return void |
|
1579 | + */ |
|
1580 | 1580 | public function delete_payment() { |
1581 | 1581 | $json_response_data = array( 'return_data' => FALSE ); |
1582 | 1582 | $PAY_ID = isset( $this->_req_data['delete_txn_admin_payment'], $this->_req_data['delete_txn_admin_payment']['PAY_ID'] ) ? absint( $this->_req_data['delete_txn_admin_payment']['PAY_ID'] ) : 0; |
@@ -1693,12 +1693,12 @@ discard block |
||
1693 | 1693 | /** |
1694 | 1694 | * _send_payment_reminder |
1695 | 1695 | * generates HTML for the View Transaction Details Admin page |
1696 | - * |
|
1696 | + * |
|
1697 | 1697 | * @access protected |
1698 | - * @return void |
|
1699 | - */ |
|
1698 | + * @return void |
|
1699 | + */ |
|
1700 | 1700 | protected function _send_payment_reminder() { |
1701 | - $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE; |
|
1701 | + $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE; |
|
1702 | 1702 | $transaction = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID ); |
1703 | 1703 | $query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID'] ) : array(); |
1704 | 1704 | do_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction ); |
@@ -1720,29 +1720,29 @@ discard block |
||
1720 | 1720 | |
1721 | 1721 | $TXN = EEM_Transaction::instance(); |
1722 | 1722 | |
1723 | - $start_date = isset( $this->_req_data['txn-filter-start-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-start-date'] ) : date( 'm/d/Y', strtotime( '-10 year' )); |
|
1724 | - $end_date = isset( $this->_req_data['txn-filter-end-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-end-date'] ) : date( 'm/d/Y' ); |
|
1723 | + $start_date = isset( $this->_req_data['txn-filter-start-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-start-date'] ) : date( 'm/d/Y', strtotime( '-10 year' )); |
|
1724 | + $end_date = isset( $this->_req_data['txn-filter-end-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-end-date'] ) : date( 'm/d/Y' ); |
|
1725 | 1725 | |
1726 | - //make sure our timestamps start and end right at the boundaries for each day |
|
1727 | - $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00'; |
|
1728 | - $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59'; |
|
1726 | + //make sure our timestamps start and end right at the boundaries for each day |
|
1727 | + $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00'; |
|
1728 | + $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59'; |
|
1729 | 1729 | |
1730 | 1730 | |
1731 | - //convert to timestamps |
|
1732 | - $start_date = strtotime( $start_date ); |
|
1733 | - $end_date = strtotime( $end_date ); |
|
1731 | + //convert to timestamps |
|
1732 | + $start_date = strtotime( $start_date ); |
|
1733 | + $end_date = strtotime( $end_date ); |
|
1734 | 1734 | |
1735 | - //makes sure start date is the lowest value and vice versa |
|
1736 | - $start_date = min( $start_date, $end_date ); |
|
1737 | - $end_date = max( $start_date, $end_date ); |
|
1735 | + //makes sure start date is the lowest value and vice versa |
|
1736 | + $start_date = min( $start_date, $end_date ); |
|
1737 | + $end_date = max( $start_date, $end_date ); |
|
1738 | 1738 | |
1739 | - //convert to correct format for query |
|
1739 | + //convert to correct format for query |
|
1740 | 1740 | $start_date = EEM_Transaction::instance()->convert_datetime_for_query( 'TXN_timestamp', date( 'Y-m-d H:i:s', $start_date ), 'Y-m-d H:i:s' ); |
1741 | 1741 | $end_date = EEM_Transaction::instance()->convert_datetime_for_query( 'TXN_timestamp', date( 'Y-m-d H:i:s', $end_date ), 'Y-m-d H:i:s' ); |
1742 | 1742 | |
1743 | 1743 | |
1744 | 1744 | |
1745 | - //set orderby |
|
1745 | + //set orderby |
|
1746 | 1746 | $this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : ''; |
1747 | 1747 | |
1748 | 1748 | switch ( $this->_req_data['orderby'] ) { |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | * @param bool $routing |
57 | 57 | * @return Transactions_Admin_Page |
58 | 58 | */ |
59 | - public function __construct( $routing = TRUE ) { |
|
60 | - parent::__construct( $routing ); |
|
59 | + public function __construct($routing = TRUE) { |
|
60 | + parent::__construct($routing); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | * @return void |
81 | 81 | */ |
82 | 82 | protected function _ajax_hooks() { |
83 | - add_action('wp_ajax_espresso_apply_payment', array( $this, 'apply_payments_or_refunds')); |
|
84 | - add_action('wp_ajax_espresso_apply_refund', array( $this, 'apply_payments_or_refunds')); |
|
85 | - add_action('wp_ajax_espresso_delete_payment', array( $this, 'delete_payment')); |
|
83 | + add_action('wp_ajax_espresso_apply_payment', array($this, 'apply_payments_or_refunds')); |
|
84 | + add_action('wp_ajax_espresso_apply_refund', array($this, 'apply_payments_or_refunds')); |
|
85 | + add_action('wp_ajax_espresso_delete_payment', array($this, 'delete_payment')); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | 'buttons' => array( |
98 | 98 | 'add' => esc_html__('Add New Transaction', 'event_espresso'), |
99 | 99 | 'edit' => esc_html__('Edit Transaction', 'event_espresso'), |
100 | - 'delete' => esc_html__('Delete Transaction','event_espresso'), |
|
100 | + 'delete' => esc_html__('Delete Transaction', 'event_espresso'), |
|
101 | 101 | ) |
102 | 102 | ); |
103 | 103 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | $this->_set_transaction_status_array(); |
115 | 115 | |
116 | - $txn_id = ! empty( $this->_req_data['TXN_ID'] ) && ! is_array( $this->_req_data['TXN_ID'] ) ? $this->_req_data['TXN_ID'] : 0; |
|
116 | + $txn_id = ! empty($this->_req_data['TXN_ID']) && ! is_array($this->_req_data['TXN_ID']) ? $this->_req_data['TXN_ID'] : 0; |
|
117 | 117 | |
118 | 118 | $this->_page_routes = array( |
119 | 119 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | 'filename' => 'transactions_overview_views_filters_search' |
186 | 186 | ), |
187 | 187 | ), |
188 | - 'help_tour' => array( 'Transactions_Overview_Help_Tour' ), |
|
188 | + 'help_tour' => array('Transactions_Overview_Help_Tour'), |
|
189 | 189 | /** |
190 | 190 | * commented out because currently we are not displaying tips for transaction list table status but this |
191 | 191 | * may change in a later iteration so want to keep the code for then. |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | 'nav' => array( |
198 | 198 | 'label' => esc_html__('View Transaction', 'event_espresso'), |
199 | 199 | 'order' => 5, |
200 | - 'url' => isset($this->_req_data['TXN_ID']) ? add_query_arg(array('TXN_ID' => $this->_req_data['TXN_ID'] ), $this->_current_page_view_url ) : $this->_admin_base_url, |
|
200 | + 'url' => isset($this->_req_data['TXN_ID']) ? add_query_arg(array('TXN_ID' => $this->_req_data['TXN_ID']), $this->_current_page_view_url) : $this->_admin_base_url, |
|
201 | 201 | 'persistent' => FALSE |
202 | 202 | ), |
203 | 203 | 'help_tabs' => array( |
@@ -218,8 +218,8 @@ discard block |
||
218 | 218 | 'filename' => 'transactions_view_transaction_primary_registrant_billing_information' |
219 | 219 | ), |
220 | 220 | ), |
221 | - 'qtips' => array( 'Transaction_Details_Tips' ), |
|
222 | - 'help_tour' => array( 'Transaction_Details_Help_Tour' ), |
|
221 | + 'qtips' => array('Transaction_Details_Tips'), |
|
222 | + 'help_tour' => array('Transaction_Details_Help_Tour'), |
|
223 | 223 | 'metaboxes' => array('_transaction_details_metaboxes'), |
224 | 224 | |
225 | 225 | 'require_nonce' => FALSE |
@@ -237,23 +237,23 @@ discard block |
||
237 | 237 | // IF a registration was JUST added via the admin... |
238 | 238 | if ( |
239 | 239 | isset( |
240 | - $this->_req_data[ 'redirect_from' ], |
|
241 | - $this->_req_data[ 'EVT_ID' ], |
|
242 | - $this->_req_data[ 'event_name' ] |
|
240 | + $this->_req_data['redirect_from'], |
|
241 | + $this->_req_data['EVT_ID'], |
|
242 | + $this->_req_data['event_name'] |
|
243 | 243 | ) |
244 | 244 | ) { |
245 | 245 | // then set a cookie so that we can block any attempts to use |
246 | 246 | // the back button as a way to enter another registration. |
247 | - setcookie( 'ee_registration_added', $this->_req_data[ 'EVT_ID' ], time() + WEEK_IN_SECONDS, '/' ); |
|
247 | + setcookie('ee_registration_added', $this->_req_data['EVT_ID'], time() + WEEK_IN_SECONDS, '/'); |
|
248 | 248 | // and update the global |
249 | - $_COOKIE[ 'ee_registration_added' ] = $this->_req_data[ 'EVT_ID' ]; |
|
249 | + $_COOKIE['ee_registration_added'] = $this->_req_data['EVT_ID']; |
|
250 | 250 | } |
251 | - EE_Registry::$i18n_js_strings[ 'invalid_server_response' ] = esc_html__( 'An error occurred! Your request may have been processed, but a valid response from the server was not received. Please refresh the page and try again.', 'event_espresso' ); |
|
252 | - EE_Registry::$i18n_js_strings[ 'error_occurred' ] = esc_html__( 'An error occurred! Please refresh the page and try again.', 'event_espresso' ); |
|
253 | - EE_Registry::$i18n_js_strings[ 'txn_status_array' ] = self::$_txn_status; |
|
254 | - EE_Registry::$i18n_js_strings[ 'pay_status_array' ] = self::$_pay_status; |
|
255 | - EE_Registry::$i18n_js_strings[ 'payments_total' ] = esc_html__( 'Payments Total', 'event_espresso' ); |
|
256 | - EE_Registry::$i18n_js_strings[ 'transaction_overpaid' ] = esc_html__( 'This transaction has been overpaid ! Payments Total', 'event_espresso' ); |
|
251 | + EE_Registry::$i18n_js_strings['invalid_server_response'] = esc_html__('An error occurred! Your request may have been processed, but a valid response from the server was not received. Please refresh the page and try again.', 'event_espresso'); |
|
252 | + EE_Registry::$i18n_js_strings['error_occurred'] = esc_html__('An error occurred! Please refresh the page and try again.', 'event_espresso'); |
|
253 | + EE_Registry::$i18n_js_strings['txn_status_array'] = self::$_txn_status; |
|
254 | + EE_Registry::$i18n_js_strings['pay_status_array'] = self::$_pay_status; |
|
255 | + EE_Registry::$i18n_js_strings['payments_total'] = esc_html__('Payments Total', 'event_espresso'); |
|
256 | + EE_Registry::$i18n_js_strings['transaction_overpaid'] = esc_html__('This transaction has been overpaid ! Payments Total', 'event_espresso'); |
|
257 | 257 | } |
258 | 258 | public function admin_notices() {} |
259 | 259 | public function admin_footer_scripts() {} |
@@ -320,14 +320,14 @@ discard block |
||
320 | 320 | */ |
321 | 321 | public function load_scripts_styles() { |
322 | 322 | //enqueue style |
323 | - wp_register_style( 'espresso_txn', TXN_ASSETS_URL . 'espresso_transactions_admin.css', array(), EVENT_ESPRESSO_VERSION ); |
|
323 | + wp_register_style('espresso_txn', TXN_ASSETS_URL.'espresso_transactions_admin.css', array(), EVENT_ESPRESSO_VERSION); |
|
324 | 324 | wp_enqueue_style('espresso_txn'); |
325 | 325 | |
326 | 326 | //scripts |
327 | 327 | add_filter('FHEE_load_accounting_js', '__return_true'); |
328 | 328 | |
329 | 329 | //scripts |
330 | - wp_register_script('espresso_txn', TXN_ASSETS_URL . 'espresso_transactions_admin.js', array('ee_admin_js', 'ee-datepicker', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'ee-dialog', 'ee-accounting', 'ee-serialize-full-array'), EVENT_ESPRESSO_VERSION, TRUE); |
|
330 | + wp_register_script('espresso_txn', TXN_ASSETS_URL.'espresso_transactions_admin.js', array('ee_admin_js', 'ee-datepicker', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'ee-dialog', 'ee-accounting', 'ee-serialize-full-array'), EVENT_ESPRESSO_VERSION, TRUE); |
|
331 | 331 | wp_enqueue_script('espresso_txn'); |
332 | 332 | |
333 | 333 | } |
@@ -367,8 +367,8 @@ discard block |
||
367 | 367 | * @return void |
368 | 368 | */ |
369 | 369 | protected function _set_list_table_views_default() { |
370 | - $this->_views = array ( |
|
371 | - 'all' => array ( |
|
370 | + $this->_views = array( |
|
371 | + 'all' => array( |
|
372 | 372 | 'slug' => 'all', |
373 | 373 | 'label' => esc_html__('View All Transactions', 'event_espresso'), |
374 | 374 | 'count' => 0 |
@@ -396,21 +396,21 @@ discard block |
||
396 | 396 | * @return void |
397 | 397 | */ |
398 | 398 | private function _set_transaction_object() { |
399 | - if ( is_object( $this->_transaction) ) |
|
399 | + if (is_object($this->_transaction)) |
|
400 | 400 | return; //get out we've already set the object |
401 | 401 | |
402 | 402 | $TXN = EEM_Transaction::instance(); |
403 | 403 | |
404 | - $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE; |
|
404 | + $TXN_ID = ( ! empty($this->_req_data['TXN_ID'])) ? absint($this->_req_data['TXN_ID']) : FALSE; |
|
405 | 405 | |
406 | 406 | //get transaction object |
407 | 407 | $this->_transaction = $TXN->get_one_by_ID($TXN_ID); |
408 | - $this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL; |
|
408 | + $this->_session = ! empty($this->_transaction) ? $this->_transaction->get('TXN_session_data') : NULL; |
|
409 | 409 | $this->_transaction->verify_abandoned_transaction_status(); |
410 | 410 | |
411 | - if ( empty( $this->_transaction ) ) { |
|
412 | - $error_msg = esc_html__('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID . esc_html__(' could not be retrieved.', 'event_espresso'); |
|
413 | - EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
411 | + if (empty($this->_transaction)) { |
|
412 | + $error_msg = esc_html__('An error occurred and the details for Transaction ID #', 'event_espresso').$TXN_ID.esc_html__(' could not be retrieved.', 'event_espresso'); |
|
413 | + EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__); |
|
414 | 414 | } |
415 | 415 | } |
416 | 416 | |
@@ -423,12 +423,12 @@ discard block |
||
423 | 423 | * @return array |
424 | 424 | */ |
425 | 425 | protected function _transaction_legend_items() { |
426 | - EE_Registry::instance()->load_helper( 'MSG_Template' ); |
|
426 | + EE_Registry::instance()->load_helper('MSG_Template'); |
|
427 | 427 | $items = array(); |
428 | 428 | |
429 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) { |
|
430 | - $related_for_icon = EEH_MSG_Template::get_message_action_icon( 'see_notifications_for' ); |
|
431 | - if ( isset( $related_for_icon['css_class']) && isset( $related_for_icon['label'] ) ) { |
|
429 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) { |
|
430 | + $related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for'); |
|
431 | + if (isset($related_for_icon['css_class']) && isset($related_for_icon['label'])) { |
|
432 | 432 | $items['view_related_messages'] = array( |
433 | 433 | 'class' => $related_for_icon['css_class'], |
434 | 434 | 'desc' => $related_for_icon['label'], |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | |
439 | 439 | $items = apply_filters( |
440 | 440 | 'FHEE__Transactions_Admin_Page___transaction_legend_items__items', |
441 | - array_merge( $items, |
|
441 | + array_merge($items, |
|
442 | 442 | array( |
443 | 443 | 'view_details' => array( |
444 | 444 | 'class' => 'dashicons dashicons-cart', |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | ), |
451 | 451 | 'view_receipt' => array( |
452 | 452 | 'class' => 'dashicons dashicons-media-default', |
453 | - 'desc' => esc_html__('View Transaction Receipt', 'event_espresso' ) |
|
453 | + 'desc' => esc_html__('View Transaction Receipt', 'event_espresso') |
|
454 | 454 | ), |
455 | 455 | 'view_registration' => array( |
456 | 456 | 'class' => 'dashicons dashicons-clipboard', |
@@ -460,8 +460,8 @@ discard block |
||
460 | 460 | ) |
461 | 461 | ); |
462 | 462 | |
463 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_transactions_send_payment_reminder' ) ) { |
|
464 | - if ( EEH_MSG_Template::is_mt_active( 'payment_reminder' ) ) { |
|
463 | + if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder')) { |
|
464 | + if (EEH_MSG_Template::is_mt_active('payment_reminder')) { |
|
465 | 465 | $items['send_payment_reminder'] = array( |
466 | 466 | 'class' => 'dashicons dashicons-email-alt', |
467 | 467 | 'desc' => esc_html__('Send Payment Reminder', 'event_espresso') |
@@ -482,29 +482,29 @@ discard block |
||
482 | 482 | 'FHEE__Transactions_Admin_Page___transaction_legend_items__more_items', |
483 | 483 | array( |
484 | 484 | 'overpaid' => array( |
485 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::overpaid_status_code, |
|
486 | - 'desc' => EEH_Template::pretty_status( EEM_Transaction::overpaid_status_code, FALSE, 'sentence' ) |
|
485 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::overpaid_status_code, |
|
486 | + 'desc' => EEH_Template::pretty_status(EEM_Transaction::overpaid_status_code, FALSE, 'sentence') |
|
487 | 487 | ), |
488 | 488 | 'complete' => array( |
489 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::complete_status_code, |
|
490 | - 'desc' => EEH_Template::pretty_status( EEM_Transaction::complete_status_code, FALSE, 'sentence' ) |
|
489 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::complete_status_code, |
|
490 | + 'desc' => EEH_Template::pretty_status(EEM_Transaction::complete_status_code, FALSE, 'sentence') |
|
491 | 491 | ), |
492 | 492 | 'incomplete' => array( |
493 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::incomplete_status_code, |
|
494 | - 'desc' => EEH_Template::pretty_status( EEM_Transaction::incomplete_status_code, FALSE, 'sentence' ) |
|
493 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::incomplete_status_code, |
|
494 | + 'desc' => EEH_Template::pretty_status(EEM_Transaction::incomplete_status_code, FALSE, 'sentence') |
|
495 | 495 | ), |
496 | 496 | 'abandoned' => array( |
497 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::abandoned_status_code, |
|
498 | - 'desc' => EEH_Template::pretty_status( EEM_Transaction::abandoned_status_code, FALSE, 'sentence' ) |
|
497 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::abandoned_status_code, |
|
498 | + 'desc' => EEH_Template::pretty_status(EEM_Transaction::abandoned_status_code, FALSE, 'sentence') |
|
499 | 499 | ), |
500 | 500 | 'failed' => array( |
501 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::failed_status_code, |
|
502 | - 'desc' => EEH_Template::pretty_status( EEM_Transaction::failed_status_code, FALSE, 'sentence' ) |
|
501 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::failed_status_code, |
|
502 | + 'desc' => EEH_Template::pretty_status(EEM_Transaction::failed_status_code, FALSE, 'sentence') |
|
503 | 503 | ) |
504 | 504 | ) |
505 | 505 | ); |
506 | 506 | |
507 | - return array_merge( $items, $more_items); |
|
507 | + return array_merge($items, $more_items); |
|
508 | 508 | } |
509 | 509 | |
510 | 510 | |
@@ -517,9 +517,9 @@ discard block |
||
517 | 517 | */ |
518 | 518 | protected function _transactions_overview_list_table() { |
519 | 519 | $this->_admin_page_title = esc_html__('Transactions', 'event_espresso'); |
520 | - $event = isset($this->_req_data['EVT_ID']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID'] ) : NULL; |
|
521 | - $this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf( esc_html__('%sViewing Transactions for the Event: %s%s', 'event_espresso'), '<h3>', '<a href="' . EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $event->ID()), EVENTS_ADMIN_URL ) . '" title="' . esc_attr__('Click to Edit event', 'event_espresso') . '">' . $event->get('EVT_name') . '</a>', '</h3>' ) : ''; |
|
522 | - $this->_template_args['after_list_table'] = $this->_display_legend( $this->_transaction_legend_items() ); |
|
520 | + $event = isset($this->_req_data['EVT_ID']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID']) : NULL; |
|
521 | + $this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf(esc_html__('%sViewing Transactions for the Event: %s%s', 'event_espresso'), '<h3>', '<a href="'.EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $event->ID()), EVENTS_ADMIN_URL).'" title="'.esc_attr__('Click to Edit event', 'event_espresso').'">'.$event->get('EVT_name').'</a>', '</h3>') : ''; |
|
522 | + $this->_template_args['after_list_table'] = $this->_display_legend($this->_transaction_legend_items()); |
|
523 | 523 | $this->display_admin_list_table_page_with_no_sidebar(); |
524 | 524 | } |
525 | 525 | |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | * @return void |
534 | 534 | */ |
535 | 535 | protected function _transaction_details() { |
536 | - do_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction ); |
|
536 | + do_action('AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction); |
|
537 | 537 | |
538 | 538 | $this->_set_transaction_status_array(); |
539 | 539 | |
@@ -546,14 +546,14 @@ discard block |
||
546 | 546 | $attendee = $primary_registration instanceof EE_Registration ? $primary_registration->attendee() : NULL; |
547 | 547 | |
548 | 548 | $this->_template_args['txn_nmbr']['value'] = $this->_transaction->ID(); |
549 | - $this->_template_args['txn_nmbr']['label'] = esc_html__( 'Transaction Number', 'event_espresso' ); |
|
549 | + $this->_template_args['txn_nmbr']['label'] = esc_html__('Transaction Number', 'event_espresso'); |
|
550 | 550 | |
551 | 551 | $this->_template_args['txn_datetime']['value'] = $this->_transaction->get_i18n_datetime('TXN_timestamp'); |
552 | - $this->_template_args['txn_datetime']['label'] = esc_html__( 'Date', 'event_espresso' ); |
|
552 | + $this->_template_args['txn_datetime']['label'] = esc_html__('Date', 'event_espresso'); |
|
553 | 553 | |
554 | - $this->_template_args['txn_status']['value'] = self::$_txn_status[ $this->_transaction->get('STS_ID') ]; |
|
555 | - $this->_template_args['txn_status']['label'] = esc_html__( 'Transaction Status', 'event_espresso' ); |
|
556 | - $this->_template_args['txn_status']['class'] = 'status-' . $this->_transaction->get('STS_ID'); |
|
554 | + $this->_template_args['txn_status']['value'] = self::$_txn_status[$this->_transaction->get('STS_ID')]; |
|
555 | + $this->_template_args['txn_status']['label'] = esc_html__('Transaction Status', 'event_espresso'); |
|
556 | + $this->_template_args['txn_status']['class'] = 'status-'.$this->_transaction->get('STS_ID'); |
|
557 | 557 | |
558 | 558 | $this->_template_args['grand_total'] = $this->_transaction->get('TXN_total'); |
559 | 559 | $this->_template_args['total_paid'] = $this->_transaction->get('TXN_paid'); |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | ) |
567 | 567 | ) { |
568 | 568 | $this->_template_args['send_payment_reminder_button'] = |
569 | - EEH_MSG_Template::is_mt_active( 'payment_reminder' ) |
|
569 | + EEH_MSG_Template::is_mt_active('payment_reminder') |
|
570 | 570 | && $this->_transaction->get('STS_ID') != EEM_Transaction::complete_status_code |
571 | 571 | && $this->_transaction->get('STS_ID') != EEM_Transaction::overpaid_status_code |
572 | 572 | ? EEH_Template::get_button_or_link( |
@@ -588,40 +588,40 @@ discard block |
||
588 | 588 | } |
589 | 589 | |
590 | 590 | $amount_due = $this->_transaction->get('TXN_total') - $this->_transaction->get('TXN_paid'); |
591 | - $this->_template_args['amount_due'] = EEH_Template::format_currency( $amount_due, TRUE ); |
|
592 | - if ( EE_Registry::instance()->CFG->currency->sign_b4 ) { |
|
593 | - $this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign . $this->_template_args['amount_due']; |
|
591 | + $this->_template_args['amount_due'] = EEH_Template::format_currency($amount_due, TRUE); |
|
592 | + if (EE_Registry::instance()->CFG->currency->sign_b4) { |
|
593 | + $this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign.$this->_template_args['amount_due']; |
|
594 | 594 | } else { |
595 | - $this->_template_args['amount_due'] = $this->_template_args['amount_due'] . EE_Registry::instance()->CFG->currency->sign; |
|
595 | + $this->_template_args['amount_due'] = $this->_template_args['amount_due'].EE_Registry::instance()->CFG->currency->sign; |
|
596 | 596 | } |
597 | - $this->_template_args['amount_due_class'] = ''; |
|
597 | + $this->_template_args['amount_due_class'] = ''; |
|
598 | 598 | |
599 | - if ( $this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total') ) { |
|
599 | + if ($this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total')) { |
|
600 | 600 | // paid in full |
601 | - $this->_template_args['amount_due'] = FALSE; |
|
602 | - } elseif ( $this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total') ) { |
|
601 | + $this->_template_args['amount_due'] = FALSE; |
|
602 | + } elseif ($this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total')) { |
|
603 | 603 | // overpaid |
604 | - $this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn'; |
|
605 | - } elseif (( $this->_transaction->get('TXN_total') > 0 ) && ( $this->_transaction->get('TXN_paid') > 0 )) { |
|
604 | + $this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn'; |
|
605 | + } elseif (($this->_transaction->get('TXN_total') > 0) && ($this->_transaction->get('TXN_paid') > 0)) { |
|
606 | 606 | // monies owing |
607 | - $this->_template_args['amount_due_class'] = 'txn-overview-part-payment-spn'; |
|
608 | - } elseif (( $this->_transaction->get('TXN_total') > 0 ) && ( $this->_transaction->get('TXN_paid') == 0 )) { |
|
607 | + $this->_template_args['amount_due_class'] = 'txn-overview-part-payment-spn'; |
|
608 | + } elseif (($this->_transaction->get('TXN_total') > 0) && ($this->_transaction->get('TXN_paid') == 0)) { |
|
609 | 609 | // no payments made yet |
610 | - $this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn'; |
|
611 | - } elseif ( $this->_transaction->get('TXN_total') == 0 ) { |
|
610 | + $this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn'; |
|
611 | + } elseif ($this->_transaction->get('TXN_total') == 0) { |
|
612 | 612 | // free event |
613 | - $this->_template_args['amount_due'] = FALSE; |
|
613 | + $this->_template_args['amount_due'] = FALSE; |
|
614 | 614 | } |
615 | 615 | |
616 | 616 | $payment_method = $this->_transaction->payment_method(); |
617 | 617 | |
618 | 618 | $this->_template_args['method_of_payment_name'] = $payment_method instanceof EE_Payment_Method |
619 | 619 | ? $payment_method->admin_name() |
620 | - : esc_html__( 'Unknown', 'event_espresso' ); |
|
620 | + : esc_html__('Unknown', 'event_espresso'); |
|
621 | 621 | |
622 | 622 | $this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign; |
623 | 623 | // link back to overview |
624 | - $this->_template_args['txn_overview_url'] = ! empty ( $_SERVER['HTTP_REFERER'] ) |
|
624 | + $this->_template_args['txn_overview_url'] = ! empty ($_SERVER['HTTP_REFERER']) |
|
625 | 625 | ? $_SERVER['HTTP_REFERER'] |
626 | 626 | : TXN_ADMIN_URL; |
627 | 627 | |
@@ -629,13 +629,13 @@ discard block |
||
629 | 629 | // next link |
630 | 630 | $next_txn = $this->_transaction->next( |
631 | 631 | null, |
632 | - array( array( 'STS_ID' => array( '!=', EEM_Transaction::failed_status_code ) ) ), |
|
632 | + array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))), |
|
633 | 633 | 'TXN_ID' |
634 | 634 | ); |
635 | 635 | $this->_template_args['next_transaction'] = $next_txn |
636 | 636 | ? $this->_next_link( |
637 | 637 | EE_Admin_Page::add_query_args_and_nonce( |
638 | - array( 'action' => 'view_transaction', 'TXN_ID' => $next_txn['TXN_ID'] ), |
|
638 | + array('action' => 'view_transaction', 'TXN_ID' => $next_txn['TXN_ID']), |
|
639 | 639 | TXN_ADMIN_URL |
640 | 640 | ), |
641 | 641 | 'dashicons dashicons-arrow-right ee-icon-size-22' |
@@ -644,13 +644,13 @@ discard block |
||
644 | 644 | // previous link |
645 | 645 | $previous_txn = $this->_transaction->previous( |
646 | 646 | null, |
647 | - array( array( 'STS_ID' => array( '!=', EEM_Transaction::failed_status_code ) ) ), |
|
647 | + array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))), |
|
648 | 648 | 'TXN_ID' |
649 | 649 | ); |
650 | 650 | $this->_template_args['previous_transaction'] = $previous_txn |
651 | 651 | ? $this->_previous_link( |
652 | 652 | EE_Admin_Page::add_query_args_and_nonce( |
653 | - array( 'action' => 'view_transaction', 'TXN_ID' => $previous_txn['TXN_ID'] ), |
|
653 | + array('action' => 'view_transaction', 'TXN_ID' => $previous_txn['TXN_ID']), |
|
654 | 654 | TXN_ADMIN_URL |
655 | 655 | ), |
656 | 656 | 'dashicons dashicons-arrow-left ee-icon-size-22' |
@@ -660,16 +660,16 @@ discard block |
||
660 | 660 | // were we just redirected here after adding a new registration ??? |
661 | 661 | if ( |
662 | 662 | isset( |
663 | - $this->_req_data[ 'redirect_from' ], |
|
664 | - $this->_req_data[ 'EVT_ID' ], |
|
665 | - $this->_req_data[ 'event_name' ] |
|
663 | + $this->_req_data['redirect_from'], |
|
664 | + $this->_req_data['EVT_ID'], |
|
665 | + $this->_req_data['event_name'] |
|
666 | 666 | ) |
667 | 667 | ) { |
668 | 668 | if ( |
669 | 669 | EE_Registry::instance()->CAP->current_user_can( |
670 | 670 | 'ee_edit_registrations', |
671 | 671 | 'espresso_registrations_new_registration', |
672 | - $this->_req_data[ 'EVT_ID' ] |
|
672 | + $this->_req_data['EVT_ID'] |
|
673 | 673 | ) |
674 | 674 | ) { |
675 | 675 | $this->_admin_page_title .= '<a id="add-new-registration" class="add-new-h2 button-primary" href="'; |
@@ -679,25 +679,25 @@ discard block |
||
679 | 679 | 'action' => 'new_registration', |
680 | 680 | 'return' => 'default', |
681 | 681 | 'TXN_ID' => $this->_transaction->ID(), |
682 | - 'event_id' => $this->_req_data[ 'EVT_ID' ], |
|
682 | + 'event_id' => $this->_req_data['EVT_ID'], |
|
683 | 683 | ), |
684 | 684 | REG_ADMIN_URL |
685 | 685 | ); |
686 | 686 | $this->_admin_page_title .= '">'; |
687 | 687 | |
688 | 688 | $this->_admin_page_title .= sprintf( |
689 | - esc_html__('Add Another New Registration to Event: "%1$s" ?', 'event_espresso' ), |
|
690 | - htmlentities( urldecode( $this->_req_data[ 'event_name' ] ), ENT_QUOTES, 'UTF-8' ) |
|
689 | + esc_html__('Add Another New Registration to Event: "%1$s" ?', 'event_espresso'), |
|
690 | + htmlentities(urldecode($this->_req_data['event_name']), ENT_QUOTES, 'UTF-8') |
|
691 | 691 | ); |
692 | 692 | $this->_admin_page_title .= '</a>'; |
693 | 693 | } |
694 | - EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ ); |
|
694 | + EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
695 | 695 | } |
696 | 696 | // grab messages at the last second |
697 | 697 | $this->_template_args['notices'] = EE_Error::get_notices(); |
698 | 698 | // path to template |
699 | - $template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_header.template.php'; |
|
700 | - $this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
699 | + $template_path = TXN_TEMPLATE_PATH.'txn_admin_details_header.template.php'; |
|
700 | + $this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
701 | 701 | |
702 | 702 | // the details template wrapper |
703 | 703 | $this->display_admin_page_with_sidebar(); |
@@ -716,18 +716,18 @@ discard block |
||
716 | 716 | |
717 | 717 | $this->_set_transaction_object(); |
718 | 718 | |
719 | - add_meta_box( 'edit-txn-details-mbox', esc_html__( 'Transaction Details', 'event_espresso' ), array( $this, 'txn_details_meta_box' ), $this->_wp_page_slug, 'normal', 'high' ); |
|
719 | + add_meta_box('edit-txn-details-mbox', esc_html__('Transaction Details', 'event_espresso'), array($this, 'txn_details_meta_box'), $this->_wp_page_slug, 'normal', 'high'); |
|
720 | 720 | add_meta_box( |
721 | 721 | 'edit-txn-attendees-mbox', |
722 | - esc_html__( 'Attendees Registered in this Transaction', 'event_espresso' ), |
|
723 | - array( $this, 'txn_attendees_meta_box' ), |
|
722 | + esc_html__('Attendees Registered in this Transaction', 'event_espresso'), |
|
723 | + array($this, 'txn_attendees_meta_box'), |
|
724 | 724 | $this->_wp_page_slug, |
725 | 725 | 'normal', |
726 | 726 | 'high', |
727 | - array( 'TXN_ID' => $this->_transaction->ID() ) |
|
727 | + array('TXN_ID' => $this->_transaction->ID()) |
|
728 | 728 | ); |
729 | - add_meta_box( 'edit-txn-registrant-mbox', esc_html__( 'Primary Contact', 'event_espresso' ), array( $this, 'txn_registrant_side_meta_box' ), $this->_wp_page_slug, 'side', 'high' ); |
|
730 | - add_meta_box( 'edit-txn-billing-info-mbox', esc_html__( 'Billing Information', 'event_espresso' ), array( $this, 'txn_billing_info_side_meta_box' ), $this->_wp_page_slug, 'side', 'high' ); |
|
729 | + add_meta_box('edit-txn-registrant-mbox', esc_html__('Primary Contact', 'event_espresso'), array($this, 'txn_registrant_side_meta_box'), $this->_wp_page_slug, 'side', 'high'); |
|
730 | + add_meta_box('edit-txn-billing-info-mbox', esc_html__('Billing Information', 'event_espresso'), array($this, 'txn_billing_info_side_meta_box'), $this->_wp_page_slug, 'side', 'high'); |
|
731 | 731 | |
732 | 732 | } |
733 | 733 | |
@@ -748,15 +748,15 @@ discard block |
||
748 | 748 | |
749 | 749 | //get line table |
750 | 750 | EEH_Autoloader::register_line_item_display_autoloaders(); |
751 | - $Line_Item_Display = new EE_Line_Item_Display( 'admin_table', 'EE_Admin_Table_Line_Item_Display_Strategy' ); |
|
752 | - $this->_template_args['line_item_table'] = $Line_Item_Display->display_line_item( $this->_transaction->total_line_item() ); |
|
751 | + $Line_Item_Display = new EE_Line_Item_Display('admin_table', 'EE_Admin_Table_Line_Item_Display_Strategy'); |
|
752 | + $this->_template_args['line_item_table'] = $Line_Item_Display->display_line_item($this->_transaction->total_line_item()); |
|
753 | 753 | $this->_template_args['REG_code'] = $this->_transaction->get_first_related('Registration')->get('REG_code'); |
754 | 754 | |
755 | 755 | // process taxes |
756 | - $taxes = $this->_transaction->get_many_related( 'Line_Item', array( array( 'LIN_type' => EEM_Line_Item::type_tax ))); |
|
757 | - $this->_template_args['taxes'] = ! empty( $taxes ) ? $taxes : FALSE; |
|
756 | + $taxes = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => EEM_Line_Item::type_tax))); |
|
757 | + $this->_template_args['taxes'] = ! empty($taxes) ? $taxes : FALSE; |
|
758 | 758 | |
759 | - $this->_template_args['grand_total'] = EEH_Template::format_currency($this->_transaction->get('TXN_total'), FALSE, FALSE ); |
|
759 | + $this->_template_args['grand_total'] = EEH_Template::format_currency($this->_transaction->get('TXN_total'), FALSE, FALSE); |
|
760 | 760 | $this->_template_args['grand_raw_total'] = $this->_transaction->get('TXN_total'); |
761 | 761 | $this->_template_args['TXN_status'] = $this->_transaction->get('STS_ID'); |
762 | 762 | |
@@ -764,63 +764,63 @@ discard block |
||
764 | 764 | |
765 | 765 | // process payment details |
766 | 766 | $payments = $this->_transaction->get_many_related('Payment'); |
767 | - if( ! empty( $payments ) ) { |
|
768 | - $this->_template_args[ 'payments' ] = $payments; |
|
769 | - $this->_template_args[ 'existing_reg_payments' ] = $this->_get_registration_payment_IDs( $payments ); |
|
767 | + if ( ! empty($payments)) { |
|
768 | + $this->_template_args['payments'] = $payments; |
|
769 | + $this->_template_args['existing_reg_payments'] = $this->_get_registration_payment_IDs($payments); |
|
770 | 770 | } else { |
771 | - $this->_template_args[ 'payments' ] = false; |
|
772 | - $this->_template_args[ 'existing_reg_payments' ] = array(); |
|
771 | + $this->_template_args['payments'] = false; |
|
772 | + $this->_template_args['existing_reg_payments'] = array(); |
|
773 | 773 | } |
774 | 774 | |
775 | - $this->_template_args['edit_payment_url'] = add_query_arg( array( 'action' => 'edit_payment' ), TXN_ADMIN_URL ); |
|
776 | - $this->_template_args['delete_payment_url'] = add_query_arg( array( 'action' => 'espresso_delete_payment' ), TXN_ADMIN_URL ); |
|
775 | + $this->_template_args['edit_payment_url'] = add_query_arg(array('action' => 'edit_payment'), TXN_ADMIN_URL); |
|
776 | + $this->_template_args['delete_payment_url'] = add_query_arg(array('action' => 'espresso_delete_payment'), TXN_ADMIN_URL); |
|
777 | 777 | |
778 | - if ( isset( $txn_details['invoice_number'] )) { |
|
778 | + if (isset($txn_details['invoice_number'])) { |
|
779 | 779 | $this->_template_args['txn_details']['invoice_number']['value'] = $this->_template_args['REG_code']; |
780 | - $this->_template_args['txn_details']['invoice_number']['label'] = esc_html__( 'Invoice Number', 'event_espresso' ); |
|
780 | + $this->_template_args['txn_details']['invoice_number']['label'] = esc_html__('Invoice Number', 'event_espresso'); |
|
781 | 781 | } |
782 | 782 | |
783 | 783 | $this->_template_args['txn_details']['registration_session']['value'] = $this->_transaction->get_first_related('Registration')->get('REG_session'); |
784 | - $this->_template_args['txn_details']['registration_session']['label'] = esc_html__( 'Registration Session', 'event_espresso' ); |
|
784 | + $this->_template_args['txn_details']['registration_session']['label'] = esc_html__('Registration Session', 'event_espresso'); |
|
785 | 785 | |
786 | - $this->_template_args['txn_details']['ip_address']['value'] = isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : ''; |
|
787 | - $this->_template_args['txn_details']['ip_address']['label'] = esc_html__( 'Transaction placed from IP', 'event_espresso' ); |
|
786 | + $this->_template_args['txn_details']['ip_address']['value'] = isset($this->_session['ip_address']) ? $this->_session['ip_address'] : ''; |
|
787 | + $this->_template_args['txn_details']['ip_address']['label'] = esc_html__('Transaction placed from IP', 'event_espresso'); |
|
788 | 788 | |
789 | - $this->_template_args['txn_details']['user_agent']['value'] = isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : ''; |
|
790 | - $this->_template_args['txn_details']['user_agent']['label'] = esc_html__( 'Registrant User Agent', 'event_espresso' ); |
|
789 | + $this->_template_args['txn_details']['user_agent']['value'] = isset($this->_session['user_agent']) ? $this->_session['user_agent'] : ''; |
|
790 | + $this->_template_args['txn_details']['user_agent']['label'] = esc_html__('Registrant User Agent', 'event_espresso'); |
|
791 | 791 | |
792 | 792 | $reg_steps = '<ul>'; |
793 | - foreach ( $this->_transaction->reg_steps() as $reg_step => $reg_step_status ) { |
|
794 | - if ( $reg_step_status === true ) { |
|
795 | - $reg_steps .= '<li style="color:#70cc50">' . sprintf( esc_html__( '%1$s : Completed', 'event_espresso' ), ucwords( str_replace( '_', ' ', $reg_step ) ) ) . '</li>'; |
|
796 | - } else if ( is_numeric( $reg_step_status ) && $reg_step_status !== false ) { |
|
797 | - $reg_steps .= '<li style="color:#2EA2CC">' . sprintf( |
|
798 | - esc_html__( '%1$s : Initiated %2$s', 'event_espresso' ), |
|
799 | - ucwords( str_replace( '_', ' ', $reg_step ) ), |
|
800 | - date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), ( $reg_step_status + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) ) |
|
801 | - ) . '</li>'; |
|
793 | + foreach ($this->_transaction->reg_steps() as $reg_step => $reg_step_status) { |
|
794 | + if ($reg_step_status === true) { |
|
795 | + $reg_steps .= '<li style="color:#70cc50">'.sprintf(esc_html__('%1$s : Completed', 'event_espresso'), ucwords(str_replace('_', ' ', $reg_step))).'</li>'; |
|
796 | + } else if (is_numeric($reg_step_status) && $reg_step_status !== false) { |
|
797 | + $reg_steps .= '<li style="color:#2EA2CC">'.sprintf( |
|
798 | + esc_html__('%1$s : Initiated %2$s', 'event_espresso'), |
|
799 | + ucwords(str_replace('_', ' ', $reg_step)), |
|
800 | + date(get_option('date_format').' '.get_option('time_format'), ($reg_step_status + (get_option('gmt_offset') * HOUR_IN_SECONDS))) |
|
801 | + ).'</li>'; |
|
802 | 802 | } else { |
803 | - $reg_steps .= '<li style="color:#E76700">' . sprintf( esc_html__( '%1$s : Never Initiated', 'event_espresso' ), ucwords( str_replace( '_', ' ', $reg_step ) ) ) . '</li>'; |
|
803 | + $reg_steps .= '<li style="color:#E76700">'.sprintf(esc_html__('%1$s : Never Initiated', 'event_espresso'), ucwords(str_replace('_', ' ', $reg_step))).'</li>'; |
|
804 | 804 | } |
805 | 805 | } |
806 | 806 | $reg_steps .= '</ul>'; |
807 | 807 | $this->_template_args['txn_details']['reg_steps']['value'] = $reg_steps; |
808 | - $this->_template_args['txn_details']['reg_steps']['label'] = esc_html__( 'Registration Step Progress', 'event_espresso' ); |
|
808 | + $this->_template_args['txn_details']['reg_steps']['label'] = esc_html__('Registration Step Progress', 'event_espresso'); |
|
809 | 809 | |
810 | 810 | |
811 | 811 | $this->_get_registrations_to_apply_payment_to(); |
812 | - $this->_get_payment_methods( $payments ); |
|
812 | + $this->_get_payment_methods($payments); |
|
813 | 813 | $this->_get_payment_status_array(); |
814 | 814 | $this->_get_reg_status_selection(); //sets up the template args for the reg status array for the transaction. |
815 | 815 | |
816 | - $this->_template_args['transaction_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'transaction' ), TXN_ADMIN_URL ); |
|
817 | - $this->_template_args['apply_payment_form_url'] = add_query_arg( array( 'page' => 'espresso_transactions', 'action' => 'espresso_apply_payment' ), WP_AJAX_URL ); |
|
818 | - $this->_template_args['delete_payment_form_url'] = add_query_arg( array( 'page' => 'espresso_transactions', 'action' => 'espresso_delete_payment' ), WP_AJAX_URL ); |
|
816 | + $this->_template_args['transaction_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'transaction'), TXN_ADMIN_URL); |
|
817 | + $this->_template_args['apply_payment_form_url'] = add_query_arg(array('page' => 'espresso_transactions', 'action' => 'espresso_apply_payment'), WP_AJAX_URL); |
|
818 | + $this->_template_args['delete_payment_form_url'] = add_query_arg(array('page' => 'espresso_transactions', 'action' => 'espresso_delete_payment'), WP_AJAX_URL); |
|
819 | 819 | |
820 | 820 | // 'espresso_delete_payment_nonce' |
821 | 821 | |
822 | - $template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_main_meta_box_txn_details.template.php'; |
|
823 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
822 | + $template_path = TXN_TEMPLATE_PATH.'txn_admin_details_main_meta_box_txn_details.template.php'; |
|
823 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
824 | 824 | |
825 | 825 | } |
826 | 826 | |
@@ -835,27 +835,27 @@ discard block |
||
835 | 835 | * @param EE_Payment[] $payments |
836 | 836 | * @return array |
837 | 837 | */ |
838 | - protected function _get_registration_payment_IDs( $payments = array() ) { |
|
838 | + protected function _get_registration_payment_IDs($payments = array()) { |
|
839 | 839 | $existing_reg_payments = array(); |
840 | 840 | // get all reg payments for these payments |
841 | - $reg_payments = EEM_Registration_Payment::instance()->get_all( array( |
|
841 | + $reg_payments = EEM_Registration_Payment::instance()->get_all(array( |
|
842 | 842 | array( |
843 | 843 | 'PAY_ID' => array( |
844 | 844 | 'IN', |
845 | - array_keys( $payments ) |
|
845 | + array_keys($payments) |
|
846 | 846 | ) |
847 | 847 | ) |
848 | - ) ); |
|
849 | - if ( ! empty( $reg_payments ) ) { |
|
850 | - foreach ( $payments as $payment ) { |
|
851 | - if ( ! $payment instanceof EE_Payment ) { |
|
848 | + )); |
|
849 | + if ( ! empty($reg_payments)) { |
|
850 | + foreach ($payments as $payment) { |
|
851 | + if ( ! $payment instanceof EE_Payment) { |
|
852 | 852 | continue; |
853 | - } else if ( ! isset( $existing_reg_payments[ $payment->ID() ] ) ) { |
|
854 | - $existing_reg_payments[ $payment->ID() ] = array(); |
|
853 | + } else if ( ! isset($existing_reg_payments[$payment->ID()])) { |
|
854 | + $existing_reg_payments[$payment->ID()] = array(); |
|
855 | 855 | } |
856 | - foreach ( $reg_payments as $reg_payment ) { |
|
857 | - if ( $reg_payment instanceof EE_Registration_Payment && $reg_payment->payment_ID() === $payment->ID() ) { |
|
858 | - $existing_reg_payments[ $payment->ID() ][ ] = $reg_payment->registration_ID(); |
|
856 | + foreach ($reg_payments as $reg_payment) { |
|
857 | + if ($reg_payment instanceof EE_Registration_Payment && $reg_payment->payment_ID() === $payment->ID()) { |
|
858 | + $existing_reg_payments[$payment->ID()][] = $reg_payment->registration_ID(); |
|
859 | 859 | } |
860 | 860 | } |
861 | 861 | } |
@@ -888,54 +888,54 @@ discard block |
||
888 | 888 | ) |
889 | 889 | ) |
890 | 890 | ); |
891 | - $registrations_to_apply_payment_to = EEH_HTML::br() . EEH_HTML::div( |
|
891 | + $registrations_to_apply_payment_to = EEH_HTML::br().EEH_HTML::div( |
|
892 | 892 | '', 'txn-admin-apply-payment-to-registrations-dv', '', 'clear: both; margin: 1.5em 0 0; display: none;' |
893 | 893 | ); |
894 | - $registrations_to_apply_payment_to .= EEH_HTML::br() . EEH_HTML::div( '', '', 'admin-primary-mbox-tbl-wrap' ); |
|
895 | - $registrations_to_apply_payment_to .= EEH_HTML::table( '', '', 'admin-primary-mbox-tbl' ); |
|
894 | + $registrations_to_apply_payment_to .= EEH_HTML::br().EEH_HTML::div('', '', 'admin-primary-mbox-tbl-wrap'); |
|
895 | + $registrations_to_apply_payment_to .= EEH_HTML::table('', '', 'admin-primary-mbox-tbl'); |
|
896 | 896 | $registrations_to_apply_payment_to .= EEH_HTML::thead( |
897 | 897 | EEH_HTML::tr( |
898 | - EEH_HTML::th( esc_html__( 'ID', 'event_espresso' ) ) . |
|
899 | - EEH_HTML::th( esc_html__( 'Registrant', 'event_espresso' ) ) . |
|
900 | - EEH_HTML::th( esc_html__( 'Ticket', 'event_espresso' ) ) . |
|
901 | - EEH_HTML::th( esc_html__( 'Event', 'event_espresso' ) ) . |
|
902 | - EEH_HTML::th( esc_html__( 'Paid', 'event_espresso' ), '', 'txn-admin-payment-paid-td jst-cntr' ) . |
|
903 | - EEH_HTML::th( esc_html__( 'Owing', 'event_espresso' ), '', 'txn-admin-payment-owing-td jst-cntr' ) . |
|
904 | - EEH_HTML::th( esc_html__( 'Apply', 'event_espresso' ), '', 'jst-cntr' ) |
|
898 | + EEH_HTML::th(esc_html__('ID', 'event_espresso')). |
|
899 | + EEH_HTML::th(esc_html__('Registrant', 'event_espresso')). |
|
900 | + EEH_HTML::th(esc_html__('Ticket', 'event_espresso')). |
|
901 | + EEH_HTML::th(esc_html__('Event', 'event_espresso')). |
|
902 | + EEH_HTML::th(esc_html__('Paid', 'event_espresso'), '', 'txn-admin-payment-paid-td jst-cntr'). |
|
903 | + EEH_HTML::th(esc_html__('Owing', 'event_espresso'), '', 'txn-admin-payment-owing-td jst-cntr'). |
|
904 | + EEH_HTML::th(esc_html__('Apply', 'event_espresso'), '', 'jst-cntr') |
|
905 | 905 | ) |
906 | 906 | ); |
907 | 907 | $registrations_to_apply_payment_to .= EEH_HTML::tbody(); |
908 | 908 | // get registrations for TXN |
909 | - $registrations = $this->_transaction->registrations( $query_params ); |
|
910 | - foreach ( $registrations as $registration ) { |
|
911 | - if ( $registration instanceof EE_Registration ) { |
|
909 | + $registrations = $this->_transaction->registrations($query_params); |
|
910 | + foreach ($registrations as $registration) { |
|
911 | + if ($registration instanceof EE_Registration) { |
|
912 | 912 | $attendee_name = $registration->attendee() instanceof EE_Attendee |
913 | 913 | ? $registration->attendee()->full_name() |
914 | - : esc_html__( 'Unknown Attendee', 'event_espresso' ); |
|
914 | + : esc_html__('Unknown Attendee', 'event_espresso'); |
|
915 | 915 | $owing = $registration->final_price() - $registration->paid(); |
916 | 916 | $taxable = $registration->ticket()->taxable() |
917 | - ? ' <span class="smaller-text lt-grey-text"> ' . esc_html__( '+ tax', 'event_espresso' ) . '</span>' |
|
917 | + ? ' <span class="smaller-text lt-grey-text"> '.esc_html__('+ tax', 'event_espresso').'</span>' |
|
918 | 918 | : ''; |
919 | - $checked = empty( $existing_reg_payments ) || in_array( $registration->ID(), $existing_reg_payments ) |
|
919 | + $checked = empty($existing_reg_payments) || in_array($registration->ID(), $existing_reg_payments) |
|
920 | 920 | ? ' checked="checked"' |
921 | 921 | : ''; |
922 | 922 | $disabled = $registration->final_price() > 0 ? '' : ' disabled'; |
923 | 923 | $registrations_to_apply_payment_to .= EEH_HTML::tr( |
924 | - EEH_HTML::td( $registration->ID() ) . |
|
925 | - EEH_HTML::td( $attendee_name ) . |
|
924 | + EEH_HTML::td($registration->ID()). |
|
925 | + EEH_HTML::td($attendee_name). |
|
926 | 926 | EEH_HTML::td( |
927 | - $registration->ticket()->name() . ' : ' . $registration->ticket()->pretty_price() . $taxable |
|
928 | - ) . |
|
929 | - EEH_HTML::td( $registration->event_name() ) . |
|
930 | - EEH_HTML::td( $registration->pretty_paid(), '', 'txn-admin-payment-paid-td jst-cntr' ) . |
|
931 | - EEH_HTML::td( EEH_Template::format_currency( $owing ), '', 'txn-admin-payment-owing-td jst-cntr' ) . |
|
927 | + $registration->ticket()->name().' : '.$registration->ticket()->pretty_price().$taxable |
|
928 | + ). |
|
929 | + EEH_HTML::td($registration->event_name()). |
|
930 | + EEH_HTML::td($registration->pretty_paid(), '', 'txn-admin-payment-paid-td jst-cntr'). |
|
931 | + EEH_HTML::td(EEH_Template::format_currency($owing), '', 'txn-admin-payment-owing-td jst-cntr'). |
|
932 | 932 | EEH_HTML::td( |
933 | - '<input type="checkbox" value="' . $registration->ID() |
|
933 | + '<input type="checkbox" value="'.$registration->ID() |
|
934 | 934 | . '" name="txn_admin_payment[registrations]"' |
935 | - . $checked . $disabled . '>', |
|
935 | + . $checked.$disabled.'>', |
|
936 | 936 | '', 'jst-cntr' |
937 | 937 | ), |
938 | - 'apply-payment-registration-row-' . $registration->ID() |
|
938 | + 'apply-payment-registration-row-'.$registration->ID() |
|
939 | 939 | ); |
940 | 940 | } |
941 | 941 | } |
@@ -950,7 +950,7 @@ discard block |
||
950 | 950 | '', 'clear description' |
951 | 951 | ); |
952 | 952 | $registrations_to_apply_payment_to .= EEH_HTML::divx(); |
953 | - $this->_template_args[ 'registrations_to_apply_payment_to' ] = $registrations_to_apply_payment_to; |
|
953 | + $this->_template_args['registrations_to_apply_payment_to'] = $registrations_to_apply_payment_to; |
|
954 | 954 | } |
955 | 955 | |
956 | 956 | |
@@ -967,9 +967,9 @@ discard block |
||
967 | 967 | $statuses = EEM_Registration::reg_status_array(array(), TRUE); |
968 | 968 | //let's add a "don't change" option. |
969 | 969 | $status_array['NAN'] = esc_html__('Leave the Same', 'event_espresso'); |
970 | - $status_array = array_merge( $status_array, $statuses ); |
|
971 | - $this->_template_args['status_change_select'] = EEH_Form_Fields::select_input( 'txn_reg_status_change[reg_status]', $status_array, 'NAN', 'id="txn-admin-payment-reg-status-inp"', 'txn-reg-status-change-reg-status' ); |
|
972 | - $this->_template_args['delete_status_change_select'] = EEH_Form_Fields::select_input( 'delete_txn_reg_status_change[reg_status]', $status_array, 'NAN', 'delete-txn-admin-payment-reg-status-inp', 'delete-txn-reg-status-change-reg-status' ); |
|
970 | + $status_array = array_merge($status_array, $statuses); |
|
971 | + $this->_template_args['status_change_select'] = EEH_Form_Fields::select_input('txn_reg_status_change[reg_status]', $status_array, 'NAN', 'id="txn-admin-payment-reg-status-inp"', 'txn-reg-status-change-reg-status'); |
|
972 | + $this->_template_args['delete_status_change_select'] = EEH_Form_Fields::select_input('delete_txn_reg_status_change[reg_status]', $status_array, 'NAN', 'delete-txn-admin-payment-reg-status-inp', 'delete-txn-reg-status-change-reg-status'); |
|
973 | 973 | |
974 | 974 | } |
975 | 975 | |
@@ -984,21 +984,21 @@ discard block |
||
984 | 984 | * @param EE_Payment[] to show on this page |
985 | 985 | * @return void |
986 | 986 | */ |
987 | - private function _get_payment_methods( $payments = array() ) { |
|
987 | + private function _get_payment_methods($payments = array()) { |
|
988 | 988 | $payment_methods_of_payments = array(); |
989 | - foreach( $payments as $payment ){ |
|
990 | - if( $payment instanceof EE_Payment ){ |
|
991 | - $payment_methods_of_payments[] = $payment->get( 'PMD_ID' ); |
|
989 | + foreach ($payments as $payment) { |
|
990 | + if ($payment instanceof EE_Payment) { |
|
991 | + $payment_methods_of_payments[] = $payment->get('PMD_ID'); |
|
992 | 992 | } |
993 | 993 | } |
994 | - if( $payment_methods_of_payments ){ |
|
995 | - $query_args = array( array( 'OR*payment_method_for_payment' => array( |
|
996 | - 'PMD_ID' => array( 'IN', $payment_methods_of_payments ), |
|
997 | - 'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) ) ); |
|
998 | - }else{ |
|
999 | - $query_args = array( array( 'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) ); |
|
994 | + if ($payment_methods_of_payments) { |
|
995 | + $query_args = array(array('OR*payment_method_for_payment' => array( |
|
996 | + 'PMD_ID' => array('IN', $payment_methods_of_payments), |
|
997 | + 'PMD_scope' => array('LIKE', '%'.EEM_Payment_Method::scope_admin.'%') ))); |
|
998 | + } else { |
|
999 | + $query_args = array(array('PMD_scope' => array('LIKE', '%'.EEM_Payment_Method::scope_admin.'%'))); |
|
1000 | 1000 | } |
1001 | - $this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all( $query_args ); |
|
1001 | + $this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all($query_args); |
|
1002 | 1002 | } |
1003 | 1003 | |
1004 | 1004 | |
@@ -1012,17 +1012,17 @@ discard block |
||
1012 | 1012 | * @param array $metabox |
1013 | 1013 | * @return void |
1014 | 1014 | */ |
1015 | - public function txn_attendees_meta_box( $post, $metabox = array( 'args' => array() )) { |
|
1015 | + public function txn_attendees_meta_box($post, $metabox = array('args' => array())) { |
|
1016 | 1016 | |
1017 | - extract( $metabox['args'] ); |
|
1017 | + extract($metabox['args']); |
|
1018 | 1018 | $this->_template_args['post'] = $post; |
1019 | 1019 | $this->_template_args['event_attendees'] = array(); |
1020 | 1020 | // process items in cart |
1021 | - $line_items = $this->_transaction->get_many_related('Line_Item', array( array( 'LIN_type' => 'line-item' ) ) ); |
|
1022 | - if ( ! empty( $line_items )) { |
|
1023 | - foreach ( $line_items as $item ) { |
|
1024 | - if ( $item instanceof EE_Line_Item ) { |
|
1025 | - switch( $item->OBJ_type() ) { |
|
1021 | + $line_items = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => 'line-item'))); |
|
1022 | + if ( ! empty($line_items)) { |
|
1023 | + foreach ($line_items as $item) { |
|
1024 | + if ($item instanceof EE_Line_Item) { |
|
1025 | + switch ($item->OBJ_type()) { |
|
1026 | 1026 | |
1027 | 1027 | case 'Event' : |
1028 | 1028 | break; |
@@ -1030,39 +1030,39 @@ discard block |
||
1030 | 1030 | case 'Ticket' : |
1031 | 1031 | $ticket = $item->ticket(); |
1032 | 1032 | //right now we're only handling tickets here. Cause its expected that only tickets will have attendees right? |
1033 | - if ( ! $ticket instanceof EE_Ticket ) { |
|
1033 | + if ( ! $ticket instanceof EE_Ticket) { |
|
1034 | 1034 | continue; |
1035 | 1035 | } |
1036 | 1036 | try { |
1037 | 1037 | $event_name = $ticket->get_event_name(); |
1038 | - } catch ( Exception $e ) { |
|
1039 | - EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__ ); |
|
1040 | - $event_name = esc_html__( 'Unknown Event', 'event_espresso' ); |
|
1038 | + } catch (Exception $e) { |
|
1039 | + EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__); |
|
1040 | + $event_name = esc_html__('Unknown Event', 'event_espresso'); |
|
1041 | 1041 | } |
1042 | - $event_name .= ' - ' . $item->get( 'LIN_name' ); |
|
1043 | - $ticket_price = EEH_Template::format_currency( $item->get( 'LIN_unit_price' ) ); |
|
1042 | + $event_name .= ' - '.$item->get('LIN_name'); |
|
1043 | + $ticket_price = EEH_Template::format_currency($item->get('LIN_unit_price')); |
|
1044 | 1044 | // now get all of the registrations for this transaction that use this ticket |
1045 | - $registrations = $ticket->get_many_related('Registration', array( array('TXN_ID' => $this->_transaction->ID() ))); |
|
1046 | - foreach( $registrations as $registration ) { |
|
1047 | - if ( ! $registration instanceof EE_Registration ) { |
|
1045 | + $registrations = $ticket->get_many_related('Registration', array(array('TXN_ID' => $this->_transaction->ID()))); |
|
1046 | + foreach ($registrations as $registration) { |
|
1047 | + if ( ! $registration instanceof EE_Registration) { |
|
1048 | 1048 | continue; |
1049 | 1049 | } |
1050 | - $this->_template_args['event_attendees'][$registration->ID()]['STS_ID'] = $registration->status_ID(); |
|
1051 | - $this->_template_args['event_attendees'][$registration->ID()]['att_num'] = $registration->count(); |
|
1052 | - $this->_template_args['event_attendees'][$registration->ID()]['event_ticket_name'] = $event_name; |
|
1053 | - $this->_template_args['event_attendees'][$registration->ID()]['ticket_price'] = $ticket_price; |
|
1050 | + $this->_template_args['event_attendees'][$registration->ID()]['STS_ID'] = $registration->status_ID(); |
|
1051 | + $this->_template_args['event_attendees'][$registration->ID()]['att_num'] = $registration->count(); |
|
1052 | + $this->_template_args['event_attendees'][$registration->ID()]['event_ticket_name'] = $event_name; |
|
1053 | + $this->_template_args['event_attendees'][$registration->ID()]['ticket_price'] = $ticket_price; |
|
1054 | 1054 | // attendee info |
1055 | 1055 | $attendee = $registration->get_first_related('Attendee'); |
1056 | - if ( $attendee instanceof EE_Attendee ) { |
|
1057 | - $this->_template_args['event_attendees'][$registration->ID()]['att_id'] = $attendee->ID(); |
|
1058 | - $this->_template_args['event_attendees'][$registration->ID()]['attendee'] = $attendee->full_name(); |
|
1059 | - $this->_template_args['event_attendees'][$registration->ID()]['email'] = '<a href="mailto:' . $attendee->email() . '?subject=' . $event_name . esc_html__(' Event', 'event_espresso') . '">' . $attendee->email() . '</a>'; |
|
1060 | - $this->_template_args['event_attendees'][$registration->ID()]['address'] = EEH_Address::format( $attendee, 'inline', false, false ); |
|
1056 | + if ($attendee instanceof EE_Attendee) { |
|
1057 | + $this->_template_args['event_attendees'][$registration->ID()]['att_id'] = $attendee->ID(); |
|
1058 | + $this->_template_args['event_attendees'][$registration->ID()]['attendee'] = $attendee->full_name(); |
|
1059 | + $this->_template_args['event_attendees'][$registration->ID()]['email'] = '<a href="mailto:'.$attendee->email().'?subject='.$event_name.esc_html__(' Event', 'event_espresso').'">'.$attendee->email().'</a>'; |
|
1060 | + $this->_template_args['event_attendees'][$registration->ID()]['address'] = EEH_Address::format($attendee, 'inline', false, false); |
|
1061 | 1061 | } else { |
1062 | 1062 | $this->_template_args['event_attendees'][$registration->ID()]['att_id'] = ''; |
1063 | - $this->_template_args['event_attendees'][$registration->ID()]['attendee'] = ''; |
|
1063 | + $this->_template_args['event_attendees'][$registration->ID()]['attendee'] = ''; |
|
1064 | 1064 | $this->_template_args['event_attendees'][$registration->ID()]['email'] = ''; |
1065 | - $this->_template_args['event_attendees'][$registration->ID()]['address'] = ''; |
|
1065 | + $this->_template_args['event_attendees'][$registration->ID()]['address'] = ''; |
|
1066 | 1066 | } |
1067 | 1067 | } |
1068 | 1068 | break; |
@@ -1071,12 +1071,12 @@ discard block |
||
1071 | 1071 | } |
1072 | 1072 | } |
1073 | 1073 | |
1074 | - $this->_template_args['transaction_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'attendees' ), TXN_ADMIN_URL ); |
|
1075 | - echo EEH_Template::display_template( TXN_TEMPLATE_PATH . 'txn_admin_details_main_meta_box_attendees.template.php', $this->_template_args, TRUE ); |
|
1074 | + $this->_template_args['transaction_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'attendees'), TXN_ADMIN_URL); |
|
1075 | + echo EEH_Template::display_template(TXN_TEMPLATE_PATH.'txn_admin_details_main_meta_box_attendees.template.php', $this->_template_args, TRUE); |
|
1076 | 1076 | |
1077 | 1077 | } else { |
1078 | 1078 | echo sprintf( |
1079 | - esc_html__( '%1$sFor some reason, there are no attendees registered for this transaction. Likely the registration was abandoned in process.%2$s', 'event_espresso' ), |
|
1079 | + esc_html__('%1$sFor some reason, there are no attendees registered for this transaction. Likely the registration was abandoned in process.%2$s', 'event_espresso'), |
|
1080 | 1080 | '<p class="important-notice">', |
1081 | 1081 | '</p>' |
1082 | 1082 | ); |
@@ -1095,19 +1095,19 @@ discard block |
||
1095 | 1095 | */ |
1096 | 1096 | public function txn_registrant_side_meta_box() { |
1097 | 1097 | $primary_att = $this->_transaction->primary_registration() instanceof EE_Registration ? $this->_transaction->primary_registration()->get_first_related('Attendee') : null; |
1098 | - if ( ! $primary_att instanceof EE_Attendee ) { |
|
1098 | + if ( ! $primary_att instanceof EE_Attendee) { |
|
1099 | 1099 | $this->_template_args['no_attendee_message'] = esc_html__('There is no attached contact for this transaction. The transaction either failed due to an error or was abandoned.', 'event_espresso'); |
1100 | 1100 | $primary_att = EEM_Attendee::instance()->create_default_object(); |
1101 | 1101 | } |
1102 | - $this->_template_args['ATT_ID'] = $primary_att->ID(); |
|
1102 | + $this->_template_args['ATT_ID'] = $primary_att->ID(); |
|
1103 | 1103 | $this->_template_args['prime_reg_fname'] = $primary_att->fname(); |
1104 | 1104 | $this->_template_args['prime_reg_lname'] = $primary_att->lname(); |
1105 | - $this->_template_args['prime_reg_email'] = $primary_att->email(); |
|
1105 | + $this->_template_args['prime_reg_email'] = $primary_att->email(); |
|
1106 | 1106 | $this->_template_args['prime_reg_phone'] = $primary_att->phone(); |
1107 | - $this->_template_args['edit_attendee_url'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'edit_attendee', 'post' => $primary_att->ID() ), REG_ADMIN_URL ); |
|
1107 | + $this->_template_args['edit_attendee_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit_attendee', 'post' => $primary_att->ID()), REG_ADMIN_URL); |
|
1108 | 1108 | // get formatted address for registrant |
1109 | - $this->_template_args[ 'formatted_address' ] = EEH_Address::format( $primary_att ); |
|
1110 | - echo EEH_Template::display_template( TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE ); |
|
1109 | + $this->_template_args['formatted_address'] = EEH_Address::format($primary_att); |
|
1110 | + echo EEH_Template::display_template(TXN_TEMPLATE_PATH.'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE); |
|
1111 | 1111 | } |
1112 | 1112 | |
1113 | 1113 | |
@@ -1123,12 +1123,12 @@ discard block |
||
1123 | 1123 | |
1124 | 1124 | $this->_template_args['billing_form'] = $this->_transaction->billing_info(); |
1125 | 1125 | $this->_template_args['billing_form_url'] = add_query_arg( |
1126 | - array( 'action' => 'edit_transaction', 'process' => 'billing' ), |
|
1126 | + array('action' => 'edit_transaction', 'process' => 'billing'), |
|
1127 | 1127 | TXN_ADMIN_URL |
1128 | 1128 | ); |
1129 | 1129 | |
1130 | - $template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_billing_info.template.php'; |
|
1131 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );/**/ |
|
1130 | + $template_path = TXN_TEMPLATE_PATH.'txn_admin_details_side_meta_box_billing_info.template.php'; |
|
1131 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); /**/ |
|
1132 | 1132 | } |
1133 | 1133 | |
1134 | 1134 | |
@@ -1141,42 +1141,42 @@ discard block |
||
1141 | 1141 | * @return void |
1142 | 1142 | */ |
1143 | 1143 | public function apply_payments_or_refunds() { |
1144 | - $json_response_data = array( 'return_data' => FALSE ); |
|
1144 | + $json_response_data = array('return_data' => FALSE); |
|
1145 | 1145 | $valid_data = $this->_validate_payment_request_data(); |
1146 | - if ( ! empty( $valid_data ) ) { |
|
1147 | - $PAY_ID = $valid_data[ 'PAY_ID' ]; |
|
1146 | + if ( ! empty($valid_data)) { |
|
1147 | + $PAY_ID = $valid_data['PAY_ID']; |
|
1148 | 1148 | //save the new payment |
1149 | - $payment = $this->_create_payment_from_request_data( $valid_data ); |
|
1149 | + $payment = $this->_create_payment_from_request_data($valid_data); |
|
1150 | 1150 | // get the TXN for this payment |
1151 | 1151 | $transaction = $payment->transaction(); |
1152 | 1152 | // verify transaction |
1153 | - if ( $transaction instanceof EE_Transaction ) { |
|
1153 | + if ($transaction instanceof EE_Transaction) { |
|
1154 | 1154 | // calculate_total_payments_and_update_status |
1155 | - $this->_process_transaction_payments( $transaction ); |
|
1156 | - $REG_IDs = $this->_get_REG_IDs_to_apply_payment_to( $payment ); |
|
1157 | - $this->_remove_existing_registration_payments( $payment, $PAY_ID ); |
|
1155 | + $this->_process_transaction_payments($transaction); |
|
1156 | + $REG_IDs = $this->_get_REG_IDs_to_apply_payment_to($payment); |
|
1157 | + $this->_remove_existing_registration_payments($payment, $PAY_ID); |
|
1158 | 1158 | // apply payment to registrations (if applicable) |
1159 | - if ( ! empty( $REG_IDs ) ) { |
|
1160 | - $this->_update_registration_payments( $transaction, $payment, $REG_IDs ); |
|
1159 | + if ( ! empty($REG_IDs)) { |
|
1160 | + $this->_update_registration_payments($transaction, $payment, $REG_IDs); |
|
1161 | 1161 | $this->_maybe_send_notifications(); |
1162 | 1162 | // now process status changes for the same registrations |
1163 | - $this->_process_registration_status_change( $transaction, $REG_IDs ); |
|
1163 | + $this->_process_registration_status_change($transaction, $REG_IDs); |
|
1164 | 1164 | } |
1165 | - $this->_maybe_send_notifications( $payment ); |
|
1165 | + $this->_maybe_send_notifications($payment); |
|
1166 | 1166 | //prepare to render page |
1167 | - $json_response_data[ 'return_data' ] = $this->_build_payment_json_response( $payment, $REG_IDs ); |
|
1168 | - do_action( 'AHEE__Transactions_Admin_Page__apply_payments_or_refund__after_recording', $transaction, $payment ); |
|
1167 | + $json_response_data['return_data'] = $this->_build_payment_json_response($payment, $REG_IDs); |
|
1168 | + do_action('AHEE__Transactions_Admin_Page__apply_payments_or_refund__after_recording', $transaction, $payment); |
|
1169 | 1169 | } else { |
1170 | 1170 | EE_Error::add_error( |
1171 | - esc_html__( 'A valid Transaction for this payment could not be retrieved.', 'event_espresso' ), |
|
1171 | + esc_html__('A valid Transaction for this payment could not be retrieved.', 'event_espresso'), |
|
1172 | 1172 | __FILE__, __FUNCTION__, __LINE__ |
1173 | 1173 | ); |
1174 | 1174 | } |
1175 | 1175 | } else { |
1176 | - EE_Error::add_error( esc_html__( 'The payment form data could not be processed. Please try again.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
1176 | + EE_Error::add_error(esc_html__('The payment form data could not be processed. Please try again.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1177 | 1177 | } |
1178 | 1178 | |
1179 | - $notices = EE_Error::get_notices( false, false, false ); |
|
1179 | + $notices = EE_Error::get_notices(false, false, false); |
|
1180 | 1180 | $this->_template_args = array( |
1181 | 1181 | 'data' => $json_response_data, |
1182 | 1182 | 'error' => $notices['errors'], |
@@ -1193,30 +1193,30 @@ discard block |
||
1193 | 1193 | * @return array |
1194 | 1194 | */ |
1195 | 1195 | protected function _validate_payment_request_data() { |
1196 | - if ( ! isset( $this->_req_data[ 'txn_admin_payment' ] ) ) { |
|
1196 | + if ( ! isset($this->_req_data['txn_admin_payment'])) { |
|
1197 | 1197 | return false; |
1198 | 1198 | } |
1199 | 1199 | $payment_form = $this->_generate_payment_form_section(); |
1200 | 1200 | try { |
1201 | - if ( $payment_form->was_submitted() ) { |
|
1201 | + if ($payment_form->was_submitted()) { |
|
1202 | 1202 | $payment_form->receive_form_submission(); |
1203 | - if ( ! $payment_form->is_valid() ) { |
|
1203 | + if ( ! $payment_form->is_valid()) { |
|
1204 | 1204 | $submission_error_messages = array(); |
1205 | - foreach ( $payment_form->get_validation_errors_accumulated() as $validation_error ) { |
|
1206 | - if ( $validation_error instanceof EE_Validation_Error ) { |
|
1205 | + foreach ($payment_form->get_validation_errors_accumulated() as $validation_error) { |
|
1206 | + if ($validation_error instanceof EE_Validation_Error) { |
|
1207 | 1207 | $submission_error_messages[] = sprintf( |
1208 | - _x( '%s : %s', 'Form Section Name : Form Validation Error', 'event_espresso' ), |
|
1208 | + _x('%s : %s', 'Form Section Name : Form Validation Error', 'event_espresso'), |
|
1209 | 1209 | $validation_error->get_form_section()->html_label_text(), |
1210 | 1210 | $validation_error->getMessage() |
1211 | 1211 | ); |
1212 | 1212 | } |
1213 | 1213 | } |
1214 | - EE_Error::add_error( join( '<br />', $submission_error_messages ), __FILE__, __FUNCTION__, __LINE__ ); |
|
1214 | + EE_Error::add_error(join('<br />', $submission_error_messages), __FILE__, __FUNCTION__, __LINE__); |
|
1215 | 1215 | return array(); |
1216 | 1216 | } |
1217 | 1217 | } |
1218 | - } catch ( EE_Error $e ) { |
|
1219 | - EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__ ); |
|
1218 | + } catch (EE_Error $e) { |
|
1219 | + EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__); |
|
1220 | 1220 | return array(); |
1221 | 1221 | } |
1222 | 1222 | return $payment_form->valid_data(); |
@@ -1238,63 +1238,63 @@ discard block |
||
1238 | 1238 | array( |
1239 | 1239 | 'default' => 0, |
1240 | 1240 | 'required' => false, |
1241 | - 'html_label_text' => esc_html__( 'Payment ID', 'event_espresso' ), |
|
1242 | - 'validation_strategies' => array( new EE_Int_Normalization() ) |
|
1241 | + 'html_label_text' => esc_html__('Payment ID', 'event_espresso'), |
|
1242 | + 'validation_strategies' => array(new EE_Int_Normalization()) |
|
1243 | 1243 | ) |
1244 | 1244 | ), |
1245 | 1245 | 'TXN_ID' => new EE_Text_Input( |
1246 | 1246 | array( |
1247 | 1247 | 'default' => 0, |
1248 | 1248 | 'required' => true, |
1249 | - 'html_label_text' => esc_html__( 'Transaction ID', 'event_espresso' ), |
|
1250 | - 'validation_strategies' => array( new EE_Int_Normalization() ) |
|
1249 | + 'html_label_text' => esc_html__('Transaction ID', 'event_espresso'), |
|
1250 | + 'validation_strategies' => array(new EE_Int_Normalization()) |
|
1251 | 1251 | ) |
1252 | 1252 | ), |
1253 | 1253 | 'type' => new EE_Text_Input( |
1254 | 1254 | array( |
1255 | 1255 | 'default' => 1, |
1256 | 1256 | 'required' => true, |
1257 | - 'html_label_text' => esc_html__( 'Payment or Refund', 'event_espresso' ), |
|
1258 | - 'validation_strategies' => array( new EE_Int_Normalization() ) |
|
1257 | + 'html_label_text' => esc_html__('Payment or Refund', 'event_espresso'), |
|
1258 | + 'validation_strategies' => array(new EE_Int_Normalization()) |
|
1259 | 1259 | ) |
1260 | 1260 | ), |
1261 | 1261 | 'amount' => new EE_Text_Input( |
1262 | 1262 | array( |
1263 | 1263 | 'default' => 0, |
1264 | 1264 | 'required' => true, |
1265 | - 'html_label_text' => esc_html__( 'Payment amount', 'event_espresso' ), |
|
1266 | - 'validation_strategies' => array( new EE_Float_Normalization() ) |
|
1265 | + 'html_label_text' => esc_html__('Payment amount', 'event_espresso'), |
|
1266 | + 'validation_strategies' => array(new EE_Float_Normalization()) |
|
1267 | 1267 | ) |
1268 | 1268 | ), |
1269 | 1269 | 'status' => new EE_Text_Input( |
1270 | 1270 | array( |
1271 | 1271 | 'default' => EEM_Payment::status_id_approved, |
1272 | 1272 | 'required' => true, |
1273 | - 'html_label_text' => esc_html__( 'Payment status', 'event_espresso' ), |
|
1273 | + 'html_label_text' => esc_html__('Payment status', 'event_espresso'), |
|
1274 | 1274 | ) |
1275 | 1275 | ), |
1276 | 1276 | 'PMD_ID' => new EE_Text_Input( |
1277 | 1277 | array( |
1278 | 1278 | 'default' => 2, |
1279 | 1279 | 'required' => true, |
1280 | - 'html_label_text' => esc_html__( 'Payment Method', 'event_espresso' ), |
|
1281 | - 'validation_strategies' => array( new EE_Int_Normalization() ) |
|
1280 | + 'html_label_text' => esc_html__('Payment Method', 'event_espresso'), |
|
1281 | + 'validation_strategies' => array(new EE_Int_Normalization()) |
|
1282 | 1282 | ) |
1283 | 1283 | ), |
1284 | 1284 | 'date' => new EE_Text_Input( |
1285 | 1285 | array( |
1286 | 1286 | 'default' => time(), |
1287 | 1287 | 'required' => true, |
1288 | - 'html_label_text' => esc_html__( 'Payment date', 'event_espresso' ), |
|
1288 | + 'html_label_text' => esc_html__('Payment date', 'event_espresso'), |
|
1289 | 1289 | ) |
1290 | 1290 | ), |
1291 | 1291 | 'txn_id_chq_nmbr' => new EE_Text_Input( |
1292 | 1292 | array( |
1293 | 1293 | 'default' => '', |
1294 | 1294 | 'required' => false, |
1295 | - 'html_label_text' => esc_html__( 'Transaction or Cheque Number', 'event_espresso' ), |
|
1295 | + 'html_label_text' => esc_html__('Transaction or Cheque Number', 'event_espresso'), |
|
1296 | 1296 | 'validation_strategies' => array( |
1297 | - new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ), |
|
1297 | + new EE_Max_Length_Validation_Strategy(esc_html__('Input too long', 'event_espresso'), 100), |
|
1298 | 1298 | ) |
1299 | 1299 | ) |
1300 | 1300 | ), |
@@ -1302,9 +1302,9 @@ discard block |
||
1302 | 1302 | array( |
1303 | 1303 | 'default' => '', |
1304 | 1304 | 'required' => false, |
1305 | - 'html_label_text' => esc_html__( 'Purchase Order Number', 'event_espresso' ), |
|
1305 | + 'html_label_text' => esc_html__('Purchase Order Number', 'event_espresso'), |
|
1306 | 1306 | 'validation_strategies' => array( |
1307 | - new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ), |
|
1307 | + new EE_Max_Length_Validation_Strategy(esc_html__('Input too long', 'event_espresso'), 100), |
|
1308 | 1308 | ) |
1309 | 1309 | ) |
1310 | 1310 | ), |
@@ -1312,9 +1312,9 @@ discard block |
||
1312 | 1312 | array( |
1313 | 1313 | 'default' => '', |
1314 | 1314 | 'required' => false, |
1315 | - 'html_label_text' => esc_html__( 'Extra Field for Accounting', 'event_espresso' ), |
|
1315 | + 'html_label_text' => esc_html__('Extra Field for Accounting', 'event_espresso'), |
|
1316 | 1316 | 'validation_strategies' => array( |
1317 | - new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ), |
|
1317 | + new EE_Max_Length_Validation_Strategy(esc_html__('Input too long', 'event_espresso'), 100), |
|
1318 | 1318 | ) |
1319 | 1319 | ) |
1320 | 1320 | ), |
@@ -1331,37 +1331,37 @@ discard block |
||
1331 | 1331 | * @param array $valid_data |
1332 | 1332 | * @return EE_Payment |
1333 | 1333 | */ |
1334 | - protected function _create_payment_from_request_data( $valid_data ) { |
|
1335 | - $PAY_ID = $valid_data[ 'PAY_ID' ]; |
|
1334 | + protected function _create_payment_from_request_data($valid_data) { |
|
1335 | + $PAY_ID = $valid_data['PAY_ID']; |
|
1336 | 1336 | // get payment amount |
1337 | - $amount = $valid_data[ 'amount' ] ? abs( $valid_data[ 'amount' ] ) : 0; |
|
1337 | + $amount = $valid_data['amount'] ? abs($valid_data['amount']) : 0; |
|
1338 | 1338 | // payments have a type value of 1 and refunds have a type value of -1 |
1339 | 1339 | // so multiplying amount by type will give a positive value for payments, and negative values for refunds |
1340 | - $amount = $valid_data[ 'type' ] < 0 ? $amount * -1 : $amount; |
|
1340 | + $amount = $valid_data['type'] < 0 ? $amount * -1 : $amount; |
|
1341 | 1341 | // for some reason the date string coming in has extra spaces between the date and time. This fixes that. |
1342 | - $date = $valid_data['date'] ? preg_replace( '/\s+/', ' ', $valid_data['date'] ) : date( 'Y-m-d g:i a', current_time( 'timestamp' ) ); |
|
1342 | + $date = $valid_data['date'] ? preg_replace('/\s+/', ' ', $valid_data['date']) : date('Y-m-d g:i a', current_time('timestamp')); |
|
1343 | 1343 | $payment = EE_Payment::new_instance( |
1344 | 1344 | array( |
1345 | - 'TXN_ID' => $valid_data[ 'TXN_ID' ], |
|
1346 | - 'STS_ID' => $valid_data[ 'status' ], |
|
1345 | + 'TXN_ID' => $valid_data['TXN_ID'], |
|
1346 | + 'STS_ID' => $valid_data['status'], |
|
1347 | 1347 | 'PAY_timestamp' => $date, |
1348 | 1348 | 'PAY_source' => EEM_Payment_Method::scope_admin, |
1349 | - 'PMD_ID' => $valid_data[ 'PMD_ID' ], |
|
1349 | + 'PMD_ID' => $valid_data['PMD_ID'], |
|
1350 | 1350 | 'PAY_amount' => $amount, |
1351 | - 'PAY_txn_id_chq_nmbr' => $valid_data[ 'txn_id_chq_nmbr' ], |
|
1352 | - 'PAY_po_number' => $valid_data[ 'po_number' ], |
|
1353 | - 'PAY_extra_accntng' => $valid_data[ 'accounting' ], |
|
1351 | + 'PAY_txn_id_chq_nmbr' => $valid_data['txn_id_chq_nmbr'], |
|
1352 | + 'PAY_po_number' => $valid_data['po_number'], |
|
1353 | + 'PAY_extra_accntng' => $valid_data['accounting'], |
|
1354 | 1354 | 'PAY_details' => $valid_data, |
1355 | 1355 | 'PAY_ID' => $PAY_ID |
1356 | 1356 | ), |
1357 | 1357 | '', |
1358 | - array( 'Y-m-d', 'g:i a' ) |
|
1358 | + array('Y-m-d', 'g:i a') |
|
1359 | 1359 | ); |
1360 | 1360 | |
1361 | - if ( ! $payment->save() ) { |
|
1361 | + if ( ! $payment->save()) { |
|
1362 | 1362 | EE_Error::add_error( |
1363 | 1363 | sprintf( |
1364 | - esc_html__( 'Payment %1$d has not been successfully saved to the database.', 'event_espresso' ), |
|
1364 | + esc_html__('Payment %1$d has not been successfully saved to the database.', 'event_espresso'), |
|
1365 | 1365 | $payment->ID() |
1366 | 1366 | ), |
1367 | 1367 | __FILE__, __FUNCTION__, __LINE__ |
@@ -1378,15 +1378,15 @@ discard block |
||
1378 | 1378 | * @param \EE_Transaction $transaction |
1379 | 1379 | * @return array |
1380 | 1380 | */ |
1381 | - protected function _process_transaction_payments( EE_Transaction $transaction ) { |
|
1381 | + protected function _process_transaction_payments(EE_Transaction $transaction) { |
|
1382 | 1382 | /** @type EE_Transaction_Payments $transaction_payments */ |
1383 | - $transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' ); |
|
1383 | + $transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments'); |
|
1384 | 1384 | //update the transaction with this payment |
1385 | - if ( $transaction_payments->calculate_total_payments_and_update_status( $transaction ) ) { |
|
1386 | - EE_Error::add_success( esc_html__( 'The payment has been processed successfully.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
1385 | + if ($transaction_payments->calculate_total_payments_and_update_status($transaction)) { |
|
1386 | + EE_Error::add_success(esc_html__('The payment has been processed successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1387 | 1387 | } else { |
1388 | 1388 | EE_Error::add_error( |
1389 | - esc_html__( 'The payment was processed successfully but the amount paid for the transaction was not updated.', 'event_espresso' ) |
|
1389 | + esc_html__('The payment was processed successfully but the amount paid for the transaction was not updated.', 'event_espresso') |
|
1390 | 1390 | , __FILE__, __FUNCTION__, __LINE__ |
1391 | 1391 | ); |
1392 | 1392 | } |
@@ -1402,19 +1402,19 @@ discard block |
||
1402 | 1402 | * @param \EE_Payment $payment |
1403 | 1403 | * @return array |
1404 | 1404 | */ |
1405 | - protected function _get_REG_IDs_to_apply_payment_to( EE_Payment $payment ) { |
|
1405 | + protected function _get_REG_IDs_to_apply_payment_to(EE_Payment $payment) { |
|
1406 | 1406 | $REG_IDs = array(); |
1407 | 1407 | // grab array of IDs for specific registrations to apply changes to |
1408 | - if ( isset( $this->_req_data[ 'txn_admin_payment' ][ 'registrations' ] ) ) { |
|
1409 | - $REG_IDs = (array)$this->_req_data[ 'txn_admin_payment' ][ 'registrations' ]; |
|
1408 | + if (isset($this->_req_data['txn_admin_payment']['registrations'])) { |
|
1409 | + $REG_IDs = (array) $this->_req_data['txn_admin_payment']['registrations']; |
|
1410 | 1410 | } |
1411 | 1411 | //nothing specified ? then get all reg IDs |
1412 | - if ( empty( $REG_IDs ) ) { |
|
1412 | + if (empty($REG_IDs)) { |
|
1413 | 1413 | $registrations = $payment->transaction()->registrations(); |
1414 | - $REG_IDs = ! empty( $registrations ) ? array_keys( $registrations ) : $this->_get_existing_reg_payment_REG_IDs( $payment ); |
|
1414 | + $REG_IDs = ! empty($registrations) ? array_keys($registrations) : $this->_get_existing_reg_payment_REG_IDs($payment); |
|
1415 | 1415 | } |
1416 | 1416 | // ensure that REG_IDs are integers and NOT strings |
1417 | - return array_map( 'intval', $REG_IDs ); |
|
1417 | + return array_map('intval', $REG_IDs); |
|
1418 | 1418 | } |
1419 | 1419 | |
1420 | 1420 | |
@@ -1431,7 +1431,7 @@ discard block |
||
1431 | 1431 | /** |
1432 | 1432 | * @param array $existing_reg_payment_REG_IDs |
1433 | 1433 | */ |
1434 | - public function set_existing_reg_payment_REG_IDs( $existing_reg_payment_REG_IDs = null ) { |
|
1434 | + public function set_existing_reg_payment_REG_IDs($existing_reg_payment_REG_IDs = null) { |
|
1435 | 1435 | $this->_existing_reg_payment_REG_IDs = $existing_reg_payment_REG_IDs; |
1436 | 1436 | } |
1437 | 1437 | |
@@ -1446,13 +1446,13 @@ discard block |
||
1446 | 1446 | * @param \EE_Payment $payment |
1447 | 1447 | * @return array |
1448 | 1448 | */ |
1449 | - protected function _get_existing_reg_payment_REG_IDs( EE_Payment $payment ) { |
|
1450 | - if ( $this->existing_reg_payment_REG_IDs() === null ) { |
|
1449 | + protected function _get_existing_reg_payment_REG_IDs(EE_Payment $payment) { |
|
1450 | + if ($this->existing_reg_payment_REG_IDs() === null) { |
|
1451 | 1451 | // let's get any existing reg payment records for this payment |
1452 | - $existing_reg_payment_REG_IDs = $payment->get_many_related( 'Registration' ); |
|
1452 | + $existing_reg_payment_REG_IDs = $payment->get_many_related('Registration'); |
|
1453 | 1453 | // but we only want the REG IDs, so grab the array keys |
1454 | - $existing_reg_payment_REG_IDs = ! empty( $existing_reg_payment_REG_IDs ) ? array_keys( $existing_reg_payment_REG_IDs ) : array(); |
|
1455 | - $this->set_existing_reg_payment_REG_IDs( $existing_reg_payment_REG_IDs ); |
|
1454 | + $existing_reg_payment_REG_IDs = ! empty($existing_reg_payment_REG_IDs) ? array_keys($existing_reg_payment_REG_IDs) : array(); |
|
1455 | + $this->set_existing_reg_payment_REG_IDs($existing_reg_payment_REG_IDs); |
|
1456 | 1456 | } |
1457 | 1457 | return $this->existing_reg_payment_REG_IDs(); |
1458 | 1458 | } |
@@ -1471,23 +1471,23 @@ discard block |
||
1471 | 1471 | * @param int $PAY_ID |
1472 | 1472 | * @return bool; |
1473 | 1473 | */ |
1474 | - protected function _remove_existing_registration_payments( EE_Payment $payment, $PAY_ID = 0 ) { |
|
1474 | + protected function _remove_existing_registration_payments(EE_Payment $payment, $PAY_ID = 0) { |
|
1475 | 1475 | // newly created payments will have nothing recorded for $PAY_ID |
1476 | - if ( $PAY_ID == 0 ) { |
|
1476 | + if ($PAY_ID == 0) { |
|
1477 | 1477 | return false; |
1478 | 1478 | } |
1479 | - $existing_reg_payment_REG_IDs = $this->_get_existing_reg_payment_REG_IDs( $payment ); |
|
1480 | - if ( empty( $existing_reg_payment_REG_IDs )) { |
|
1479 | + $existing_reg_payment_REG_IDs = $this->_get_existing_reg_payment_REG_IDs($payment); |
|
1480 | + if (empty($existing_reg_payment_REG_IDs)) { |
|
1481 | 1481 | return false; |
1482 | 1482 | } |
1483 | 1483 | /** @type EE_Transaction_Payments $transaction_payments */ |
1484 | - $transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' ); |
|
1484 | + $transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments'); |
|
1485 | 1485 | return $transaction_payments->delete_registration_payments_and_update_registrations( |
1486 | 1486 | $payment, |
1487 | 1487 | array( |
1488 | 1488 | array( |
1489 | 1489 | 'PAY_ID' => $payment->ID(), |
1490 | - 'REG_ID' => array( 'IN', $existing_reg_payment_REG_IDs ), |
|
1490 | + 'REG_ID' => array('IN', $existing_reg_payment_REG_IDs), |
|
1491 | 1491 | ) |
1492 | 1492 | ) |
1493 | 1493 | ); |
@@ -1506,25 +1506,25 @@ discard block |
||
1506 | 1506 | * @param array $REG_IDs |
1507 | 1507 | * @return bool |
1508 | 1508 | */ |
1509 | - protected function _update_registration_payments( EE_Transaction $transaction, EE_Payment $payment, $REG_IDs = array() ) { |
|
1509 | + protected function _update_registration_payments(EE_Transaction $transaction, EE_Payment $payment, $REG_IDs = array()) { |
|
1510 | 1510 | // we can pass our own custom set of registrations to EE_Payment_Processor::process_registration_payments() |
1511 | 1511 | // so let's do that using our set of REG_IDs from the form |
1512 | 1512 | $registration_query_where_params = array( |
1513 | - 'REG_ID' => array( 'IN', $REG_IDs ) |
|
1513 | + 'REG_ID' => array('IN', $REG_IDs) |
|
1514 | 1514 | ); |
1515 | 1515 | // but add in some conditions regarding payment, |
1516 | 1516 | // so that we don't apply payments to registrations that are free or have already been paid for |
1517 | 1517 | // but ONLY if the payment is NOT a refund ( ie: the payment amount is not negative ) |
1518 | - if ( ! $payment->is_a_refund() ) { |
|
1519 | - $registration_query_where_params[ 'REG_final_price' ] = array( '!=', 0 ); |
|
1520 | - $registration_query_where_params[ 'REG_final_price*' ] = array( '!=', 'REG_paid', true ); |
|
1518 | + if ( ! $payment->is_a_refund()) { |
|
1519 | + $registration_query_where_params['REG_final_price'] = array('!=', 0); |
|
1520 | + $registration_query_where_params['REG_final_price*'] = array('!=', 'REG_paid', true); |
|
1521 | 1521 | } |
1522 | 1522 | //EEH_Debug_Tools::printr( $registration_query_where_params, '$registration_query_where_params', __FILE__, __LINE__ ); |
1523 | - $registrations = $transaction->registrations( array( $registration_query_where_params ) ); |
|
1524 | - if ( ! empty( $registrations ) ) { |
|
1523 | + $registrations = $transaction->registrations(array($registration_query_where_params)); |
|
1524 | + if ( ! empty($registrations)) { |
|
1525 | 1525 | /** @type EE_Payment_Processor $payment_processor */ |
1526 | - $payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' ); |
|
1527 | - $payment_processor->process_registration_payments( $transaction, $payment, $registrations ); |
|
1526 | + $payment_processor = EE_Registry::instance()->load_core('Payment_Processor'); |
|
1527 | + $payment_processor->process_registration_payments($transaction, $payment, $registrations); |
|
1528 | 1528 | } |
1529 | 1529 | } |
1530 | 1530 | |
@@ -1540,22 +1540,22 @@ discard block |
||
1540 | 1540 | * @param array $REG_IDs |
1541 | 1541 | * @return bool |
1542 | 1542 | */ |
1543 | - protected function _process_registration_status_change( EE_Transaction $transaction, $REG_IDs = array() ) { |
|
1543 | + protected function _process_registration_status_change(EE_Transaction $transaction, $REG_IDs = array()) { |
|
1544 | 1544 | // first if there is no change in status then we get out. |
1545 | 1545 | if ( |
1546 | - ! isset( $this->_req_data['txn_reg_status_change'], $this->_req_data[ 'txn_reg_status_change' ][ 'reg_status' ] ) |
|
1546 | + ! isset($this->_req_data['txn_reg_status_change'], $this->_req_data['txn_reg_status_change']['reg_status']) |
|
1547 | 1547 | || $this->_req_data['txn_reg_status_change']['reg_status'] == 'NAN' |
1548 | 1548 | ) { |
1549 | 1549 | //no error message, no change requested, just nothing to do man. |
1550 | 1550 | return FALSE; |
1551 | 1551 | } |
1552 | 1552 | /** @type EE_Transaction_Processor $transaction_processor */ |
1553 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
1553 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
1554 | 1554 | // made it here dude? Oh WOW. K, let's take care of changing the statuses |
1555 | 1555 | return $transaction_processor->manually_update_registration_statuses( |
1556 | 1556 | $transaction, |
1557 | - sanitize_text_field( $this->_req_data[ 'txn_reg_status_change' ][ 'reg_status' ] ), |
|
1558 | - array( array( 'REG_ID' => array( 'IN', $REG_IDs ) ) ) |
|
1557 | + sanitize_text_field($this->_req_data['txn_reg_status_change']['reg_status']), |
|
1558 | + array(array('REG_ID' => array('IN', $REG_IDs))) |
|
1559 | 1559 | ); |
1560 | 1560 | } |
1561 | 1561 | |
@@ -1570,16 +1570,16 @@ discard block |
||
1570 | 1570 | * @param bool | null $delete_txn_reg_status_change |
1571 | 1571 | * @return array |
1572 | 1572 | */ |
1573 | - protected function _build_payment_json_response( EE_Payment $payment, $REG_IDs = array(), $delete_txn_reg_status_change = null ) { |
|
1573 | + protected function _build_payment_json_response(EE_Payment $payment, $REG_IDs = array(), $delete_txn_reg_status_change = null) { |
|
1574 | 1574 | // was the payment deleted ? |
1575 | - if ( is_bool( $delete_txn_reg_status_change )) { |
|
1575 | + if (is_bool($delete_txn_reg_status_change)) { |
|
1576 | 1576 | return array( |
1577 | 1577 | 'PAY_ID' => $payment->ID(), |
1578 | 1578 | 'amount' => $payment->amount(), |
1579 | 1579 | 'total_paid' => $payment->transaction()->paid(), |
1580 | 1580 | 'txn_status' => $payment->transaction()->status_ID(), |
1581 | 1581 | 'pay_status' => $payment->STS_ID(), |
1582 | - 'registrations' => $this->_registration_payment_data_array( $REG_IDs ), |
|
1582 | + 'registrations' => $this->_registration_payment_data_array($REG_IDs), |
|
1583 | 1583 | 'delete_txn_reg_status_change' => $delete_txn_reg_status_change, |
1584 | 1584 | ); |
1585 | 1585 | } else { |
@@ -1591,16 +1591,16 @@ discard block |
||
1591 | 1591 | 'pay_status' => $payment->STS_ID(), |
1592 | 1592 | 'PAY_ID' => $payment->ID(), |
1593 | 1593 | 'STS_ID' => $payment->STS_ID(), |
1594 | - 'status' => self::$_pay_status[ $payment->STS_ID() ], |
|
1595 | - 'date' => $payment->timestamp( 'Y-m-d', 'h:i a' ), |
|
1596 | - 'method' => strtoupper( $payment->source() ), |
|
1594 | + 'status' => self::$_pay_status[$payment->STS_ID()], |
|
1595 | + 'date' => $payment->timestamp('Y-m-d', 'h:i a'), |
|
1596 | + 'method' => strtoupper($payment->source()), |
|
1597 | 1597 | 'PM_ID' => $payment->payment_method() ? $payment->payment_method()->ID() : 1, |
1598 | - 'gateway' => $payment->payment_method() ? $payment->payment_method()->admin_name() : esc_html__( "Unknown", 'event_espresso' ), |
|
1598 | + 'gateway' => $payment->payment_method() ? $payment->payment_method()->admin_name() : esc_html__("Unknown", 'event_espresso'), |
|
1599 | 1599 | 'gateway_response' => $payment->gateway_response(), |
1600 | 1600 | 'txn_id_chq_nmbr' => $payment->txn_id_chq_nmbr(), |
1601 | 1601 | 'po_number' => $payment->po_number(), |
1602 | 1602 | 'extra_accntng' => $payment->extra_accntng(), |
1603 | - 'registrations' => $this->_registration_payment_data_array( $REG_IDs ), |
|
1603 | + 'registrations' => $this->_registration_payment_data_array($REG_IDs), |
|
1604 | 1604 | ); |
1605 | 1605 | } |
1606 | 1606 | } |
@@ -1615,39 +1615,39 @@ discard block |
||
1615 | 1615 | * @return void |
1616 | 1616 | */ |
1617 | 1617 | public function delete_payment() { |
1618 | - $json_response_data = array( 'return_data' => FALSE ); |
|
1619 | - $PAY_ID = isset( $this->_req_data['delete_txn_admin_payment'], $this->_req_data['delete_txn_admin_payment']['PAY_ID'] ) ? absint( $this->_req_data['delete_txn_admin_payment']['PAY_ID'] ) : 0; |
|
1620 | - if ( $PAY_ID ) { |
|
1621 | - $delete_txn_reg_status_change = isset( $this->_req_data[ 'delete_txn_reg_status_change' ] ) ? $this->_req_data[ 'delete_txn_reg_status_change' ] : false; |
|
1622 | - $payment = EEM_Payment::instance()->get_one_by_ID( $PAY_ID ); |
|
1623 | - if ( $payment instanceof EE_Payment ) { |
|
1624 | - $REG_IDs = $this->_get_existing_reg_payment_REG_IDs( $payment ); |
|
1618 | + $json_response_data = array('return_data' => FALSE); |
|
1619 | + $PAY_ID = isset($this->_req_data['delete_txn_admin_payment'], $this->_req_data['delete_txn_admin_payment']['PAY_ID']) ? absint($this->_req_data['delete_txn_admin_payment']['PAY_ID']) : 0; |
|
1620 | + if ($PAY_ID) { |
|
1621 | + $delete_txn_reg_status_change = isset($this->_req_data['delete_txn_reg_status_change']) ? $this->_req_data['delete_txn_reg_status_change'] : false; |
|
1622 | + $payment = EEM_Payment::instance()->get_one_by_ID($PAY_ID); |
|
1623 | + if ($payment instanceof EE_Payment) { |
|
1624 | + $REG_IDs = $this->_get_existing_reg_payment_REG_IDs($payment); |
|
1625 | 1625 | /** @type EE_Transaction_Payments $transaction_payments */ |
1626 | - $transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' ); |
|
1627 | - if ( $transaction_payments->delete_payment_and_update_transaction( $payment )) { |
|
1628 | - $json_response_data['return_data'] = $this->_build_payment_json_response( $payment, $REG_IDs, $delete_txn_reg_status_change ); |
|
1629 | - if ( $delete_txn_reg_status_change ) { |
|
1626 | + $transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments'); |
|
1627 | + if ($transaction_payments->delete_payment_and_update_transaction($payment)) { |
|
1628 | + $json_response_data['return_data'] = $this->_build_payment_json_response($payment, $REG_IDs, $delete_txn_reg_status_change); |
|
1629 | + if ($delete_txn_reg_status_change) { |
|
1630 | 1630 | $this->_req_data['txn_reg_status_change'] = $delete_txn_reg_status_change; |
1631 | 1631 | //MAKE sure we also add the delete_txn_req_status_change to the |
1632 | 1632 | //$_REQUEST global because that's how messages will be looking for it. |
1633 | 1633 | $_REQUEST['txn_reg_status_change'] = $delete_txn_reg_status_change; |
1634 | 1634 | $this->_maybe_send_notifications(); |
1635 | - $this->_process_registration_status_change( $payment->transaction(), $REG_IDs ); |
|
1635 | + $this->_process_registration_status_change($payment->transaction(), $REG_IDs); |
|
1636 | 1636 | } |
1637 | 1637 | } |
1638 | 1638 | } else { |
1639 | 1639 | EE_Error::add_error( |
1640 | - esc_html__( 'Valid Payment data could not be retrieved from the database.', 'event_espresso' ), |
|
1640 | + esc_html__('Valid Payment data could not be retrieved from the database.', 'event_espresso'), |
|
1641 | 1641 | __FILE__, __FUNCTION__, __LINE__ |
1642 | 1642 | ); |
1643 | 1643 | } |
1644 | 1644 | } else { |
1645 | 1645 | EE_Error::add_error( |
1646 | - esc_html__( 'A valid Payment ID was not received, therefore payment form data could not be loaded.', 'event_espresso' ), |
|
1646 | + esc_html__('A valid Payment ID was not received, therefore payment form data could not be loaded.', 'event_espresso'), |
|
1647 | 1647 | __FILE__, __FUNCTION__, __LINE__ |
1648 | 1648 | ); |
1649 | 1649 | } |
1650 | - $notices = EE_Error::get_notices( false, false, false); |
|
1650 | + $notices = EE_Error::get_notices(false, false, false); |
|
1651 | 1651 | $this->_template_args = array( |
1652 | 1652 | 'data' => $json_response_data, |
1653 | 1653 | 'success' => $notices['success'], |
@@ -1667,16 +1667,16 @@ discard block |
||
1667 | 1667 | * @param array $REG_IDs |
1668 | 1668 | * @return array |
1669 | 1669 | */ |
1670 | - protected function _registration_payment_data_array( $REG_IDs ) { |
|
1670 | + protected function _registration_payment_data_array($REG_IDs) { |
|
1671 | 1671 | $registration_payment_data = array(); |
1672 | 1672 | //if non empty reg_ids lets get an array of registrations and update the values for the apply_payment/refund rows. |
1673 | - if ( ! empty( $REG_IDs ) ) { |
|
1674 | - $registrations = EEM_Registration::instance()->get_all( array( array( 'REG_ID' => array( 'IN', $REG_IDs ) ) ) ); |
|
1675 | - foreach ( $registrations as $registration ) { |
|
1676 | - if ( $registration instanceof EE_Registration ) { |
|
1677 | - $registration_payment_data[ $registration->ID() ] = array( |
|
1673 | + if ( ! empty($REG_IDs)) { |
|
1674 | + $registrations = EEM_Registration::instance()->get_all(array(array('REG_ID' => array('IN', $REG_IDs)))); |
|
1675 | + foreach ($registrations as $registration) { |
|
1676 | + if ($registration instanceof EE_Registration) { |
|
1677 | + $registration_payment_data[$registration->ID()] = array( |
|
1678 | 1678 | 'paid' => $registration->pretty_paid(), |
1679 | - 'owing' => EEH_Template::format_currency( $registration->final_price() - $registration->paid() ), |
|
1679 | + 'owing' => EEH_Template::format_currency($registration->final_price() - $registration->paid()), |
|
1680 | 1680 | ); |
1681 | 1681 | } |
1682 | 1682 | } |
@@ -1696,30 +1696,30 @@ discard block |
||
1696 | 1696 | * @access protected |
1697 | 1697 | * @param \EE_Payment | null $payment |
1698 | 1698 | */ |
1699 | - protected function _maybe_send_notifications( $payment = null ) { |
|
1700 | - switch ( $payment instanceof EE_Payment ) { |
|
1699 | + protected function _maybe_send_notifications($payment = null) { |
|
1700 | + switch ($payment instanceof EE_Payment) { |
|
1701 | 1701 | // payment notifications |
1702 | 1702 | case true : |
1703 | 1703 | if ( |
1704 | 1704 | isset( |
1705 | - $this->_req_data[ 'txn_payments' ], |
|
1706 | - $this->_req_data[ 'txn_payments' ][ 'send_notifications' ] |
|
1705 | + $this->_req_data['txn_payments'], |
|
1706 | + $this->_req_data['txn_payments']['send_notifications'] |
|
1707 | 1707 | ) && |
1708 | - filter_var( $this->_req_data[ 'txn_payments' ][ 'send_notifications' ], FILTER_VALIDATE_BOOLEAN ) |
|
1708 | + filter_var($this->_req_data['txn_payments']['send_notifications'], FILTER_VALIDATE_BOOLEAN) |
|
1709 | 1709 | ) { |
1710 | - $this->_process_payment_notification( $payment ); |
|
1710 | + $this->_process_payment_notification($payment); |
|
1711 | 1711 | } |
1712 | 1712 | break; |
1713 | 1713 | // registration notifications |
1714 | 1714 | case false : |
1715 | 1715 | if ( |
1716 | 1716 | isset( |
1717 | - $this->_req_data[ 'txn_reg_status_change' ], |
|
1718 | - $this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ] |
|
1717 | + $this->_req_data['txn_reg_status_change'], |
|
1718 | + $this->_req_data['txn_reg_status_change']['send_notifications'] |
|
1719 | 1719 | ) && |
1720 | - filter_var( $this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ], FILTER_VALIDATE_BOOLEAN ) |
|
1720 | + filter_var($this->_req_data['txn_reg_status_change']['send_notifications'], FILTER_VALIDATE_BOOLEAN) |
|
1721 | 1721 | ) { |
1722 | - add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true' ); |
|
1722 | + add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true'); |
|
1723 | 1723 | } |
1724 | 1724 | break; |
1725 | 1725 | } |
@@ -1735,11 +1735,11 @@ discard block |
||
1735 | 1735 | * @return void |
1736 | 1736 | */ |
1737 | 1737 | protected function _send_payment_reminder() { |
1738 | - $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE; |
|
1739 | - $transaction = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID ); |
|
1740 | - $query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID'] ) : array(); |
|
1741 | - do_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction ); |
|
1742 | - $this->_redirect_after_action( FALSE, esc_html__('payment reminder', 'event_espresso'), esc_html__('sent', 'event_espresso'), $query_args, TRUE ); |
|
1738 | + $TXN_ID = ( ! empty($this->_req_data['TXN_ID'])) ? absint($this->_req_data['TXN_ID']) : FALSE; |
|
1739 | + $transaction = EEM_Transaction::instance()->get_one_by_ID($TXN_ID); |
|
1740 | + $query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID']) : array(); |
|
1741 | + do_action('AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction); |
|
1742 | + $this->_redirect_after_action(FALSE, esc_html__('payment reminder', 'event_espresso'), esc_html__('sent', 'event_espresso'), $query_args, TRUE); |
|
1743 | 1743 | } |
1744 | 1744 | |
1745 | 1745 | |
@@ -1753,36 +1753,36 @@ discard block |
||
1753 | 1753 | * @param string $view |
1754 | 1754 | * @return mixed int = count || array of transaction objects |
1755 | 1755 | */ |
1756 | - public function get_transactions( $perpage, $count = FALSE, $view = '' ) { |
|
1756 | + public function get_transactions($perpage, $count = FALSE, $view = '') { |
|
1757 | 1757 | |
1758 | 1758 | $TXN = EEM_Transaction::instance(); |
1759 | 1759 | |
1760 | - $start_date = isset( $this->_req_data['txn-filter-start-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-start-date'] ) : date( 'm/d/Y', strtotime( '-10 year' )); |
|
1761 | - $end_date = isset( $this->_req_data['txn-filter-end-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-end-date'] ) : date( 'm/d/Y' ); |
|
1760 | + $start_date = isset($this->_req_data['txn-filter-start-date']) ? wp_strip_all_tags($this->_req_data['txn-filter-start-date']) : date('m/d/Y', strtotime('-10 year')); |
|
1761 | + $end_date = isset($this->_req_data['txn-filter-end-date']) ? wp_strip_all_tags($this->_req_data['txn-filter-end-date']) : date('m/d/Y'); |
|
1762 | 1762 | |
1763 | 1763 | //make sure our timestamps start and end right at the boundaries for each day |
1764 | - $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00'; |
|
1765 | - $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59'; |
|
1764 | + $start_date = date('Y-m-d', strtotime($start_date)).' 00:00:00'; |
|
1765 | + $end_date = date('Y-m-d', strtotime($end_date)).' 23:59:59'; |
|
1766 | 1766 | |
1767 | 1767 | |
1768 | 1768 | //convert to timestamps |
1769 | - $start_date = strtotime( $start_date ); |
|
1770 | - $end_date = strtotime( $end_date ); |
|
1769 | + $start_date = strtotime($start_date); |
|
1770 | + $end_date = strtotime($end_date); |
|
1771 | 1771 | |
1772 | 1772 | //makes sure start date is the lowest value and vice versa |
1773 | - $start_date = min( $start_date, $end_date ); |
|
1774 | - $end_date = max( $start_date, $end_date ); |
|
1773 | + $start_date = min($start_date, $end_date); |
|
1774 | + $end_date = max($start_date, $end_date); |
|
1775 | 1775 | |
1776 | 1776 | //convert to correct format for query |
1777 | - $start_date = EEM_Transaction::instance()->convert_datetime_for_query( 'TXN_timestamp', date( 'Y-m-d H:i:s', $start_date ), 'Y-m-d H:i:s' ); |
|
1778 | - $end_date = EEM_Transaction::instance()->convert_datetime_for_query( 'TXN_timestamp', date( 'Y-m-d H:i:s', $end_date ), 'Y-m-d H:i:s' ); |
|
1777 | + $start_date = EEM_Transaction::instance()->convert_datetime_for_query('TXN_timestamp', date('Y-m-d H:i:s', $start_date), 'Y-m-d H:i:s'); |
|
1778 | + $end_date = EEM_Transaction::instance()->convert_datetime_for_query('TXN_timestamp', date('Y-m-d H:i:s', $end_date), 'Y-m-d H:i:s'); |
|
1779 | 1779 | |
1780 | 1780 | |
1781 | 1781 | |
1782 | 1782 | //set orderby |
1783 | 1783 | $this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : ''; |
1784 | 1784 | |
1785 | - switch ( $this->_req_data['orderby'] ) { |
|
1785 | + switch ($this->_req_data['orderby']) { |
|
1786 | 1786 | case 'TXN_ID': |
1787 | 1787 | $orderby = 'TXN_ID'; |
1788 | 1788 | break; |
@@ -1796,66 +1796,66 @@ discard block |
||
1796 | 1796 | $orderby = 'TXN_timestamp'; |
1797 | 1797 | } |
1798 | 1798 | |
1799 | - $sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC'; |
|
1800 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
1801 | - $per_page = isset( $perpage ) && !empty( $perpage ) ? $perpage : 10; |
|
1802 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
1799 | + $sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC'; |
|
1800 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
1801 | + $per_page = isset($perpage) && ! empty($perpage) ? $perpage : 10; |
|
1802 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
1803 | 1803 | |
1804 | - $offset = ($current_page-1)*$per_page; |
|
1805 | - $limit = array( $offset, $per_page ); |
|
1804 | + $offset = ($current_page - 1) * $per_page; |
|
1805 | + $limit = array($offset, $per_page); |
|
1806 | 1806 | |
1807 | 1807 | $_where = array( |
1808 | - 'TXN_timestamp' => array('BETWEEN', array($start_date, $end_date) ), |
|
1808 | + 'TXN_timestamp' => array('BETWEEN', array($start_date, $end_date)), |
|
1809 | 1809 | 'Registration.REG_count' => 1 |
1810 | 1810 | ); |
1811 | 1811 | |
1812 | - if ( isset( $this->_req_data['EVT_ID'] ) ) { |
|
1812 | + if (isset($this->_req_data['EVT_ID'])) { |
|
1813 | 1813 | $_where['Registration.EVT_ID'] = $this->_req_data['EVT_ID']; |
1814 | 1814 | } |
1815 | 1815 | |
1816 | - if ( isset( $this->_req_data['s'] ) ) { |
|
1817 | - $search_string = '%' . $this->_req_data['s'] . '%'; |
|
1816 | + if (isset($this->_req_data['s'])) { |
|
1817 | + $search_string = '%'.$this->_req_data['s'].'%'; |
|
1818 | 1818 | $_where['OR'] = array( |
1819 | - 'Registration.Event.EVT_name' => array( 'LIKE', $search_string ), |
|
1820 | - 'Registration.Event.EVT_desc' => array( 'LIKE', $search_string ), |
|
1821 | - 'Registration.Event.EVT_short_desc' => array( 'LIKE' , $search_string ), |
|
1822 | - 'Registration.Attendee.ATT_full_name' => array( 'LIKE', $search_string ), |
|
1823 | - 'Registration.Attendee.ATT_fname' => array( 'LIKE', $search_string ), |
|
1824 | - 'Registration.Attendee.ATT_lname' => array( 'LIKE', $search_string ), |
|
1825 | - 'Registration.Attendee.ATT_short_bio' => array( 'LIKE', $search_string ), |
|
1826 | - 'Registration.Attendee.ATT_email' => array('LIKE', $search_string ), |
|
1827 | - 'Registration.Attendee.ATT_address' => array( 'LIKE', $search_string ), |
|
1828 | - 'Registration.Attendee.ATT_address2' => array( 'LIKE', $search_string ), |
|
1829 | - 'Registration.Attendee.ATT_city' => array( 'LIKE', $search_string ), |
|
1830 | - 'Registration.REG_final_price' => array( 'LIKE', $search_string ), |
|
1831 | - 'Registration.REG_code' => array( 'LIKE', $search_string ), |
|
1832 | - 'Registration.REG_count' => array( 'LIKE' , $search_string ), |
|
1833 | - 'Registration.REG_group_size' => array( 'LIKE' , $search_string ), |
|
1834 | - 'Registration.Ticket.TKT_name' => array( 'LIKE', $search_string ), |
|
1835 | - 'Registration.Ticket.TKT_description' => array( 'LIKE', $search_string ), |
|
1836 | - 'Payment.PAY_source' => array('LIKE', $search_string ), |
|
1837 | - 'Payment.Payment_Method.PMD_name' => array('LIKE', $search_string ), |
|
1838 | - 'TXN_session_data' => array( 'LIKE', $search_string ), |
|
1839 | - 'Payment.PAY_txn_id_chq_nmbr' => array( 'LIKE', $search_string ) |
|
1819 | + 'Registration.Event.EVT_name' => array('LIKE', $search_string), |
|
1820 | + 'Registration.Event.EVT_desc' => array('LIKE', $search_string), |
|
1821 | + 'Registration.Event.EVT_short_desc' => array('LIKE', $search_string), |
|
1822 | + 'Registration.Attendee.ATT_full_name' => array('LIKE', $search_string), |
|
1823 | + 'Registration.Attendee.ATT_fname' => array('LIKE', $search_string), |
|
1824 | + 'Registration.Attendee.ATT_lname' => array('LIKE', $search_string), |
|
1825 | + 'Registration.Attendee.ATT_short_bio' => array('LIKE', $search_string), |
|
1826 | + 'Registration.Attendee.ATT_email' => array('LIKE', $search_string), |
|
1827 | + 'Registration.Attendee.ATT_address' => array('LIKE', $search_string), |
|
1828 | + 'Registration.Attendee.ATT_address2' => array('LIKE', $search_string), |
|
1829 | + 'Registration.Attendee.ATT_city' => array('LIKE', $search_string), |
|
1830 | + 'Registration.REG_final_price' => array('LIKE', $search_string), |
|
1831 | + 'Registration.REG_code' => array('LIKE', $search_string), |
|
1832 | + 'Registration.REG_count' => array('LIKE', $search_string), |
|
1833 | + 'Registration.REG_group_size' => array('LIKE', $search_string), |
|
1834 | + 'Registration.Ticket.TKT_name' => array('LIKE', $search_string), |
|
1835 | + 'Registration.Ticket.TKT_description' => array('LIKE', $search_string), |
|
1836 | + 'Payment.PAY_source' => array('LIKE', $search_string), |
|
1837 | + 'Payment.Payment_Method.PMD_name' => array('LIKE', $search_string), |
|
1838 | + 'TXN_session_data' => array('LIKE', $search_string), |
|
1839 | + 'Payment.PAY_txn_id_chq_nmbr' => array('LIKE', $search_string) |
|
1840 | 1840 | ); |
1841 | 1841 | } |
1842 | 1842 | |
1843 | 1843 | //failed transactions |
1844 | - $failed = ( ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'failed' && ! $count ) || ( $count && $view == 'failed' ) ? TRUE: FALSE; |
|
1845 | - $abandoned = ( ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'abandoned' && ! $count ) || ( $count && $view == 'abandoned' ) ? TRUE: FALSE; |
|
1844 | + $failed = ( ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'failed' && ! $count) || ($count && $view == 'failed') ? TRUE : FALSE; |
|
1845 | + $abandoned = ( ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'abandoned' && ! $count) || ($count && $view == 'abandoned') ? TRUE : FALSE; |
|
1846 | 1846 | |
1847 | - if ( $failed ) { |
|
1848 | - $_where[ 'STS_ID' ] = EEM_Transaction::failed_status_code; |
|
1849 | - } else if ( $abandoned ) { |
|
1847 | + if ($failed) { |
|
1848 | + $_where['STS_ID'] = EEM_Transaction::failed_status_code; |
|
1849 | + } else if ($abandoned) { |
|
1850 | 1850 | $_where['STS_ID'] = EEM_Transaction::abandoned_status_code; |
1851 | 1851 | } else { |
1852 | - $_where['STS_ID'] = array( '!=', EEM_Transaction::failed_status_code ); |
|
1853 | - $_where['STS_ID*'] = array( '!=', EEM_Transaction::abandoned_status_code ); |
|
1852 | + $_where['STS_ID'] = array('!=', EEM_Transaction::failed_status_code); |
|
1853 | + $_where['STS_ID*'] = array('!=', EEM_Transaction::abandoned_status_code); |
|
1854 | 1854 | } |
1855 | 1855 | |
1856 | - $query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'limit' => $limit ); |
|
1856 | + $query_params = array($_where, 'order_by' => array($orderby => $sort), 'limit' => $limit); |
|
1857 | 1857 | |
1858 | - $transactions = $count ? $TXN->count( array($_where), 'TXN_ID', TRUE ) : $TXN->get_all($query_params); |
|
1858 | + $transactions = $count ? $TXN->count(array($_where), 'TXN_ID', TRUE) : $TXN->get_all($query_params); |
|
1859 | 1859 | |
1860 | 1860 | |
1861 | 1861 | return $transactions; |
@@ -67,11 +67,11 @@ |
||
67 | 67 | </li> |
68 | 68 | <li style="list-style-type: none;"> |
69 | 69 | <strong><?php _e('View Registration Details <span class="dashicons dashicons-clipboard"></span>', 'event_espresso'); ?></strong><br /> |
70 | -<?php echo sprintf(__('Clicking this icon will take you to the registration page for this transaction. You can also get there via the %sRegistrations page%s.', 'event_espresso'), '<a href="admin.php?page=espresso_registrations">','</a>'); ?> |
|
70 | +<?php echo sprintf(__('Clicking this icon will take you to the registration page for this transaction. You can also get there via the %sRegistrations page%s.', 'event_espresso'), '<a href="admin.php?page=espresso_registrations">', '</a>'); ?> |
|
71 | 71 | </li> |
72 | 72 | <li style="list-style-type: none;"> |
73 | 73 | <strong><?php _e('Send Payment Reminder <span class="dashicons dashicons-email-alt"></span>', 'event_espresso'); ?></strong><br /> |
74 | -<?php echo sprintf(__('Emails the primary registrant the Payment Reminder message. This is set up in the %sMessages page%s.', 'event_espresso'),'<a href="admin.php?page=espresso_messages">','</a>'); ?> |
|
74 | +<?php echo sprintf(__('Emails the primary registrant the Payment Reminder message. This is set up in the %sMessages page%s.', 'event_espresso'), '<a href="admin.php?page=espresso_messages">', '</a>'); ?> |
|
75 | 75 | </li> |
76 | 76 | </ul> |
77 | 77 | </li> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -117,45 +117,45 @@ discard block |
||
117 | 117 | |
118 | 118 | |
119 | 119 | protected function _start() { |
120 | - $content = '<h3>' . __('View Transaction', 'event_espresso') . '</h3>'; |
|
121 | - $content .= '<p>' . __('This tour of the View Transaction page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
120 | + $content = '<h3>'.__('View Transaction', 'event_espresso').'</h3>'; |
|
121 | + $content .= '<p>'.__('This tour of the View Transaction page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
122 | 122 | return $content; |
123 | 123 | } |
124 | 124 | |
125 | 125 | protected function _txn_date_h2_stop() { |
126 | - return '<p>' . __('This is the date that the transaction occurred on.', 'event_espresso') . '</p>'; |
|
126 | + return '<p>'.__('This is the date that the transaction occurred on.', 'event_espresso').'</p>'; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | protected function _txn_status_h2_stop() { |
130 | - return '<p>' . __('View current status of the transaction. Available statuses are Complete, Failed, Incomplete, and Overpaid.', 'event_espresso') . '</p>'; |
|
130 | + return '<p>'.__('View current status of the transaction. Available statuses are Complete, Failed, Incomplete, and Overpaid.', 'event_espresso').'</p>'; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | protected function _txn_amount_due_h2_stop() { |
134 | - return '<p>' . __('View the amount due for a transaction (will not appear if the transaction has been paid in full).', 'event_espresso') . '</p>'; |
|
134 | + return '<p>'.__('View the amount due for a transaction (will not appear if the transaction has been paid in full).', 'event_espresso').'</p>'; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | protected function _txn_details_metabox_stop() { |
138 | - return '<p>' . __('The transaction details area displays various information including Line Item ID, Event Name, Event Date, Ticket Option, Price, Quantity, Line Total, Sales Tax, and the Grand Total. You can also view details about any payments made towards this transaction.', 'event_espresso') . '</p>'; |
|
138 | + return '<p>'.__('The transaction details area displays various information including Line Item ID, Event Name, Event Date, Ticket Option, Price, Quantity, Line Total, Sales Tax, and the Grand Total. You can also view details about any payments made towards this transaction.', 'event_espresso').'</p>'; |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | protected function _txn_session_info_stop() { |
142 | - return '<p>' . __('You can view additional information about the transaction by clicking on the link below. Examples of available information includes IP Address and User Agent.', 'event_espresso') . '</p>'; |
|
142 | + return '<p>'.__('You can view additional information about the transaction by clicking on the link below. Examples of available information includes IP Address and User Agent.', 'event_espresso').'</p>'; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | protected function _txn_attendees_metabox_stop() { |
146 | - return '<p>' . __('View information about registrants that are linked to this transaction.', 'event_espresso') . '</p>'; |
|
146 | + return '<p>'.__('View information about registrants that are linked to this transaction.', 'event_espresso').'</p>'; |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | protected function _txn_primary_reg_metabox_stop() { |
150 | - return '<p>' . __('View contact details on the primary registrant who is linked to this transaction.', 'event_espresso') . '</p>'; |
|
150 | + return '<p>'.__('View contact details on the primary registrant who is linked to this transaction.', 'event_espresso').'</p>'; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | protected function _txn_billing_metabox_stop() { |
154 | - return '<p>' . __('View billing information for this transaction.', 'event_espresso') . '</p>'; |
|
154 | + return '<p>'.__('View billing information for this transaction.', 'event_espresso').'</p>'; |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | protected function _event_name_stop() { |
158 | - return '<p>' . __('event name', 'event_espresso') . '</p>'; |
|
158 | + return '<p>'.__('event name', 'event_espresso').'</p>'; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | } |
162 | 162 | \ No newline at end of file |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -60,16 +60,16 @@ discard block |
||
60 | 60 | |
61 | 61 | |
62 | 62 | protected function _start() { |
63 | - $content = '<h3>' . __('Transaction Reports', 'event_espresso') . '</h3>'; |
|
64 | - $content .= '<p>' . __('This tour of the Transaction Reports page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
63 | + $content = '<h3>'.__('Transaction Reports', 'event_espresso').'</h3>'; |
|
64 | + $content .= '<p>'.__('This tour of the Transaction Reports page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
65 | 65 | return $content; |
66 | 66 | } |
67 | 67 | |
68 | 68 | protected function _txn_per_day_report() { |
69 | - return '<p>' . __('This graph shows revenue for each day.', 'event_espresso') . '</p>'; |
|
69 | + return '<p>'.__('This graph shows revenue for each day.', 'event_espresso').'</p>'; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | protected function _txn_per_event_report() { |
73 | - return '<p>' . __('This graph shows revenue for each event.', 'event_espresso') . '</p>'; |
|
73 | + return '<p>'.__('This graph shows revenue for each event.', 'event_espresso').'</p>'; |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | \ No newline at end of file |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -144,53 +144,53 @@ discard block |
||
144 | 144 | |
145 | 145 | |
146 | 146 | protected function _start() { |
147 | - $content = '<h3>' . __('Transactions Overview', 'event_espresso') . '</h3>'; |
|
148 | - $content .= '<p>' . __('This tour of the Transactions Overview page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
147 | + $content = '<h3>'.__('Transactions Overview', 'event_espresso').'</h3>'; |
|
148 | + $content .= '<p>'.__('This tour of the Transactions Overview page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
149 | 149 | return $content; |
150 | 150 | } |
151 | 151 | |
152 | 152 | protected function _txn_id_stop() { |
153 | - return '<p>' . __('View transaction ID. Can be sorted in ascending or descending order.', 'event_espresso') . '</p>'; |
|
153 | + return '<p>'.__('View transaction ID. Can be sorted in ascending or descending order.', 'event_espresso').'</p>'; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | protected function _txn_timestamp_stop() { |
157 | - return '<p>' . __('View transaction date. Can be sorted in ascending or descending order.', 'event_espresso') . '</p>'; |
|
157 | + return '<p>'.__('View transaction date. Can be sorted in ascending or descending order.', 'event_espresso').'</p>'; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | protected function _txn_total_stop() { |
161 | - return '<p>' . __('View total for transaction.', 'event_espresso') . '</p>'; |
|
161 | + return '<p>'.__('View total for transaction.', 'event_espresso').'</p>'; |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | protected function _txn_paid_stop() { |
165 | - return '<p>' . __('View amount paid for transaction.', 'event_espresso') . '</p>'; |
|
165 | + return '<p>'.__('View amount paid for transaction.', 'event_espresso').'</p>'; |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | protected function _attendee_name_stop() { |
169 | - return '<p>' . __('View name for the primary registrant. Can be sorted in ascending or descending order.', 'event_espresso') . '</p>'; |
|
169 | + return '<p>'.__('View name for the primary registrant. Can be sorted in ascending or descending order.', 'event_espresso').'</p>'; |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | protected function _att_email_stop() { |
173 | - return '<p>' . __('View email address for primary registrant. Can be sorted in ascending or descending order.', 'event_espresso') . '</p>'; |
|
173 | + return '<p>'.__('View email address for primary registrant. Can be sorted in ascending or descending order.', 'event_espresso').'</p>'; |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | protected function _event_name_stop() { |
177 | - return '<p>' . __('View name of event. Can be sorted in ascending or descending order.', 'event_espresso') . '</p>'; |
|
177 | + return '<p>'.__('View name of event. Can be sorted in ascending or descending order.', 'event_espresso').'</p>'; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | protected function _actions_stop() { |
181 | - return '<p>' . __('Perform an action to a transaction. See legend in bottom left corner.', 'event_espresso') . '</p>'; |
|
181 | + return '<p>'.__('Perform an action to a transaction. See legend in bottom left corner.', 'event_espresso').'</p>'; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | protected function _legend_stop() { |
185 | - return '<p>' . __('This legend that describes the actions available in the actions column. Also shows available statuses for a transaction.', 'event_espresso') . '</p>'; |
|
185 | + return '<p>'.__('This legend that describes the actions available in the actions column. Also shows available statuses for a transaction.', 'event_espresso').'</p>'; |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | protected function _stop_about_filters() { |
189 | - return '<p>' . __('Filter transactions by date by selecting two dates and clicking on the filter button. You can clear your current date selection by clicking on the reset filters button.', 'event_espresso') . '</p>'; |
|
189 | + return '<p>'.__('Filter transactions by date by selecting two dates and clicking on the filter button. You can clear your current date selection by clicking on the reset filters button.', 'event_espresso').'</p>'; |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | protected function _search_stop() { |
193 | - return '<p>' . __('Search through transactions. The following sources will be searched: Event Name, Event Description, First Name, Last Name, Biography, Email Address, Address, Comments, Notes, Registration Final Price, Registration Code, Registration Group Size, Ticket Name, Ticket Description, Payment Method, Payment Gateway, Transaction Details, and Transaction Session.', 'event_espresso') . '</p>'; |
|
193 | + return '<p>'.__('Search through transactions. The following sources will be searched: Event Name, Event Description, First Name, Last Name, Biography, Email Address, Address, Comments, Notes, Registration Final Price, Registration Code, Registration Group Size, Ticket Name, Ticket Description, Payment Method, Payment Gateway, Transaction Details, and Transaction Session.', 'event_espresso').'</p>'; |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | } |
197 | 197 | \ No newline at end of file |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | protected function _set_tips_array() { |
32 | 32 | $this->_qtipsa = array( |
33 | 33 | 0 => array( |
34 | - 'content_id' => 'payment-status-' . EEM_Payment::status_id_approved, |
|
35 | - 'target' => '.pymt-status-' . EEM_Payment::status_id_approved, |
|
34 | + 'content_id' => 'payment-status-'.EEM_Payment::status_id_approved, |
|
35 | + 'target' => '.pymt-status-'.EEM_Payment::status_id_approved, |
|
36 | 36 | 'content' => $this->_payment_status_legend(EEM_Payment::status_id_approved), |
37 | 37 | 'options' => array( |
38 | 38 | 'position' => array( |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | ) |
42 | 42 | ), |
43 | 43 | 1 => array( |
44 | - 'content_id' => 'payment-status-' . EEM_Payment::status_id_pending, |
|
45 | - 'target' => '.pymt-status-' . EEM_Payment::status_id_pending, |
|
44 | + 'content_id' => 'payment-status-'.EEM_Payment::status_id_pending, |
|
45 | + 'target' => '.pymt-status-'.EEM_Payment::status_id_pending, |
|
46 | 46 | 'content' => $this->_payment_status_legend(EEM_Payment::status_id_pending), |
47 | 47 | 'options' => array( |
48 | 48 | 'position' => array( |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | ) |
52 | 52 | ), |
53 | 53 | 2 => array( |
54 | - 'content_id' => 'payment-status-' . EEM_Payment::status_id_cancelled, |
|
55 | - 'target' => '.pymt-status-' . EEM_Payment::status_id_cancelled, |
|
54 | + 'content_id' => 'payment-status-'.EEM_Payment::status_id_cancelled, |
|
55 | + 'target' => '.pymt-status-'.EEM_Payment::status_id_cancelled, |
|
56 | 56 | 'content' => $this->_payment_status_legend(EEM_Payment::status_id_cancelled), |
57 | 57 | 'options' => array( |
58 | 58 | 'position' => array( |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | ) |
62 | 62 | ), |
63 | 63 | 3 => array( |
64 | - 'content_id' => 'payment-status-' . EEM_Payment::status_id_declined, |
|
65 | - 'target' => '.pymt-status-' . EEM_Payment::status_id_declined, |
|
64 | + 'content_id' => 'payment-status-'.EEM_Payment::status_id_declined, |
|
65 | + 'target' => '.pymt-status-'.EEM_Payment::status_id_declined, |
|
66 | 66 | 'content' => $this->_payment_status_legend(EEM_Payment::status_id_declined), |
67 | 67 | 'options' => array( |
68 | 68 | 'position' => array( |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | ) |
72 | 72 | ), |
73 | 73 | 4 => array( |
74 | - 'content_id' => 'payment-status-' . EEM_Payment::status_id_failed, |
|
75 | - 'target' => '.pymt-status-' . EEM_Payment::status_id_failed, |
|
74 | + 'content_id' => 'payment-status-'.EEM_Payment::status_id_failed, |
|
75 | + 'target' => '.pymt-status-'.EEM_Payment::status_id_failed, |
|
76 | 76 | 'content' => $this->_payment_status_legend(EEM_Payment::status_id_failed), |
77 | 77 | 'options' => array( |
78 | 78 | 'position' => array( |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @param EEM_Payment constant $status What status is set (by class) |
93 | 93 | * @return string The status legend with the related status highlighted |
94 | 94 | */ |
95 | - private function _payment_status_legend( $status ) { |
|
95 | + private function _payment_status_legend($status) { |
|
96 | 96 | |
97 | 97 | $status_array = array( |
98 | 98 | 'approved' => EEM_Payment::status_id_approved, |
@@ -102,6 +102,6 @@ discard block |
||
102 | 102 | 'failed' => EEM_Payment::status_id_failed, |
103 | 103 | ); |
104 | 104 | |
105 | - return EEH_Template::status_legend( $status_array, $status ); |
|
105 | + return EEH_Template::status_legend($status_array, $status); |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | \ No newline at end of file |
@@ -141,10 +141,13 @@ |
||
141 | 141 | <th class=" jst-rght" colspan="10"><span id="payments-total-spn"><?php echo $overpaid . sprintf( __( 'Payments Total %s', 'event_espresso' ), '(' . EE_Registry::instance()->CFG->currency->code . ')' );?></span></th> |
142 | 142 | <th class=" jst-rght"><span id="txn-admin-payment-total"><?php echo EEH_Template::format_currency($payment_total, FALSE, FALSE);?></span></th> |
143 | 143 | </tr> |
144 | - <?php else : ?> |
|
144 | + <?php else { |
|
145 | + : ?> |
|
145 | 146 | <tr id="txn-admin-no-payments-tr" class="admin-primary-mbox-total-tr"> |
146 | 147 | <td class=" jst-rght" colspan="11"> |
147 | - <span class="important-notice"><?php _e( 'No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.', 'event_espresso' ); ?></span> |
|
148 | + <span class="important-notice"><?php _e( 'No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.', 'event_espresso' ); |
|
149 | +} |
|
150 | +?></span> |
|
148 | 151 | </td> |
149 | 152 | </tr> |
150 | 153 | <tr id="txn-admin-payments-total-tr" class="admin-primary-mbox-total-tr hidden"> |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <div id="admin-primary-mbox-dv" class="admin-primary-mbox-dv"> |
2 | 2 | |
3 | 3 | <h3 class="admin-primary-mbox-h4 hdr-has-icon"> |
4 | - <span class="dashicons dashicons-cart"></span><?php _e( 'Transaction Items', 'event_espresso' );?> |
|
4 | + <span class="dashicons dashicons-cart"></span><?php _e('Transaction Items', 'event_espresso'); ?> |
|
5 | 5 | </h3> |
6 | 6 | |
7 | 7 | <div class="admin-primary-mbox-tbl-wrap"> |
@@ -10,27 +10,27 @@ discard block |
||
10 | 10 | </div> |
11 | 11 | |
12 | 12 | <a id="display-additional-transaction-session-info" class="display-the-hidden smaller-text" rel="additional-transaction-session-info"> |
13 | - <span class="dashicons dashicons-plus-alt"></span><?php _e( 'view additional transaction session details', 'event_espresso' );?> |
|
13 | + <span class="dashicons dashicons-plus-alt"></span><?php _e('view additional transaction session details', 'event_espresso'); ?> |
|
14 | 14 | </a> |
15 | 15 | |
16 | 16 | <div id="additional-transaction-session-info-dv" class="hidden"> |
17 | 17 | |
18 | 18 | <a id="hide-additional-transaction-session-info" class="hide-the-displayed hidden smaller-text" rel="additional-transaction-session-info"> |
19 | - <span class="dashicons dashicons-dismiss"></span><?php _e( 'hide additional transaction session details', 'event_espresso' );?> |
|
19 | + <span class="dashicons dashicons-dismiss"></span><?php _e('hide additional transaction session details', 'event_espresso'); ?> |
|
20 | 20 | </a> |
21 | 21 | <br class="clear"/> |
22 | 22 | |
23 | - <h3 class="admin-primary-mbox-h4"><?php _e( 'Transaction Session Details', 'event_espresso' );?></h3> |
|
23 | + <h3 class="admin-primary-mbox-h4"><?php _e('Transaction Session Details', 'event_espresso'); ?></h3> |
|
24 | 24 | |
25 | 25 | <table id="admin-primary-mbox-txn-extra-session-info-tbl" class="form-table skinny-rows"> |
26 | 26 | <tbody> |
27 | - <?php foreach ( $txn_details as $key => $txn_detail ) : ?> |
|
27 | + <?php foreach ($txn_details as $key => $txn_detail) : ?> |
|
28 | 28 | <tr> |
29 | 29 | <th> |
30 | - <label for="<?php echo $key;?>"><?php echo $txn_detail['label'];?></label> |
|
30 | + <label for="<?php echo $key; ?>"><?php echo $txn_detail['label']; ?></label> |
|
31 | 31 | </th> |
32 | 32 | <td> |
33 | - <?php echo $txn_detail['value'];?> |
|
33 | + <?php echo $txn_detail['value']; ?> |
|
34 | 34 | </td> |
35 | 35 | </tr> |
36 | 36 | <?php endforeach; // $txn_details?> |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | <br class="clear"/> |
41 | 41 | |
42 | 42 | |
43 | - <?php if ( $attendee instanceof EE_Attendee && ( $grand_raw_total > 0 || $TXN_status != 'TCM' || ! empty( $payments ) ) ) : ?> |
|
43 | + <?php if ($attendee instanceof EE_Attendee && ($grand_raw_total > 0 || $TXN_status != 'TCM' || ! empty($payments))) : ?> |
|
44 | 44 | |
45 | 45 | <h3 class="admin-primary-mbox-h4 hdr-has-icon"> |
46 | - <span class="ee-icon ee-icon-cash"></span><?php _e( 'Payment Details', 'event_espresso' );?> |
|
46 | + <span class="ee-icon ee-icon-cash"></span><?php _e('Payment Details', 'event_espresso'); ?> |
|
47 | 47 | </h3> |
48 | 48 | |
49 | 49 | <div class="admin-primary-mbox-tbl-wrap"> |
@@ -52,79 +52,79 @@ discard block |
||
52 | 52 | <tr> |
53 | 53 | <th></th> |
54 | 54 | <th class="jst-cntr"></th> |
55 | - <th class="jst-cntr"><?php _e( 'ID', 'event_espresso' );?></th> |
|
56 | - <th class="jst-left"><?php _e( 'Date', 'event_espresso' );?></th> |
|
57 | - <th class="jst-cntr"><?php _e( 'Source', 'event_espresso' );?></th> |
|
58 | - <th class="jst-left"><?php _e( 'Method', 'event_espresso' );?></th> |
|
59 | - <th class="jst-left"><?php _e( 'Gateway Response', 'event_espresso' );?></th> |
|
60 | - <th class="jst-left"><?php _e( 'TXN ID / CHQ #', 'event_espresso' );?></th> |
|
61 | - <th class="jst-left"><?php _e( 'P.O. / S.O. #', 'event_espresso' );?></th> |
|
62 | - <th class="jst-left"><?php _e( 'Notes / Extra Accounting', 'event_espresso' );?></th> |
|
63 | - <!--<th class="jst-left"><?php _e( 'Details', 'event_espresso' );?></th>--> |
|
64 | - <th class="jst-cntr"><?php _e( 'Amount', 'event_espresso' );?></th> |
|
55 | + <th class="jst-cntr"><?php _e('ID', 'event_espresso'); ?></th> |
|
56 | + <th class="jst-left"><?php _e('Date', 'event_espresso'); ?></th> |
|
57 | + <th class="jst-cntr"><?php _e('Source', 'event_espresso'); ?></th> |
|
58 | + <th class="jst-left"><?php _e('Method', 'event_espresso'); ?></th> |
|
59 | + <th class="jst-left"><?php _e('Gateway Response', 'event_espresso'); ?></th> |
|
60 | + <th class="jst-left"><?php _e('TXN ID / CHQ #', 'event_espresso'); ?></th> |
|
61 | + <th class="jst-left"><?php _e('P.O. / S.O. #', 'event_espresso'); ?></th> |
|
62 | + <th class="jst-left"><?php _e('Notes / Extra Accounting', 'event_espresso'); ?></th> |
|
63 | + <!--<th class="jst-left"><?php _e('Details', 'event_espresso'); ?></th>--> |
|
64 | + <th class="jst-cntr"><?php _e('Amount', 'event_espresso'); ?></th> |
|
65 | 65 | </tr> |
66 | 66 | </thead> |
67 | 67 | <tbody> |
68 | - <?php if ( $payments ) : ?> |
|
68 | + <?php if ($payments) : ?> |
|
69 | 69 | <?php $payment_total = 0; ?> |
70 | - <?php foreach ( $payments as $PAY_ID => $payment ) : |
|
71 | - $existing_reg_payment_json = isset( $existing_reg_payments[ $PAY_ID ] ) |
|
72 | - ? wp_json_encode( $existing_reg_payments[ $PAY_ID ] ) |
|
70 | + <?php foreach ($payments as $PAY_ID => $payment) : |
|
71 | + $existing_reg_payment_json = isset($existing_reg_payments[$PAY_ID]) |
|
72 | + ? wp_json_encode($existing_reg_payments[$PAY_ID]) |
|
73 | 73 | : '{}'; |
74 | 74 | ?> |
75 | - <tr id="txn-admin-payment-tr-<?php echo $PAY_ID;?>"> |
|
75 | + <tr id="txn-admin-payment-tr-<?php echo $PAY_ID; ?>"> |
|
76 | 76 | <td> |
77 | 77 | <span id="payment-status-<?php echo $PAY_ID; ?>" class="ee-status-strip-td ee-status-strip pymt-status-<?php echo $payment->STS_ID(); ?>"></span> |
78 | - <div id="payment-STS_ID-<?php echo $PAY_ID;?>" class="hidden"><?php echo $payment->STS_ID();?></div> |
|
79 | - <div id="reg-payments-<?php echo $PAY_ID;?>" class="hidden"><?php echo $existing_reg_payment_json; ?></div> |
|
78 | + <div id="payment-STS_ID-<?php echo $PAY_ID; ?>" class="hidden"><?php echo $payment->STS_ID(); ?></div> |
|
79 | + <div id="reg-payments-<?php echo $PAY_ID; ?>" class="hidden"><?php echo $existing_reg_payment_json; ?></div> |
|
80 | 80 | </td> |
81 | 81 | <td class=" jst-cntr"> |
82 | 82 | <ul class="txn-overview-actions-ul"> |
83 | 83 | <li> |
84 | - <a class="txn-admin-payment-action-edit-lnk" title="<?php esc_attr_e( 'Edit Payment', 'event_espresso' );?>" data-payment-id="<?php echo $PAY_ID;?>"> |
|
84 | + <a class="txn-admin-payment-action-edit-lnk" title="<?php esc_attr_e('Edit Payment', 'event_espresso'); ?>" data-payment-id="<?php echo $PAY_ID; ?>"> |
|
85 | 85 | <div class="dashicons dashicons-edit" style="margin: 0;"></div> |
86 | 86 | </a> |
87 | 87 | </li> |
88 | 88 | <li> |
89 | - <a class="txn-admin-payment-action-delete-lnk" title="<?php esc_attr_e( 'Delete Payment', 'event_espresso' );?>" data-payment-id="<?php echo $PAY_ID;?>"> |
|
89 | + <a class="txn-admin-payment-action-delete-lnk" title="<?php esc_attr_e('Delete Payment', 'event_espresso'); ?>" data-payment-id="<?php echo $PAY_ID; ?>"> |
|
90 | 90 | <div class="dashicons dashicons-trash" style="margin: 0;"></div> |
91 | 91 | </a> |
92 | 92 | </li> |
93 | 93 | </ul> |
94 | 94 | </td> |
95 | 95 | <td class=" jst-rght"> |
96 | - <div id="payment-id-<?php echo $PAY_ID;?>"><?php echo $PAY_ID;?></div> |
|
96 | + <div id="payment-id-<?php echo $PAY_ID; ?>"><?php echo $PAY_ID; ?></div> |
|
97 | 97 | </td> |
98 | 98 | <td class=" jst-left"> |
99 | - <div id="payment-date-<?php echo $PAY_ID;?>" class="payment-date-dv"><?php echo $payment->timestamp('Y-m-d', 'g:i a');?></div> |
|
99 | + <div id="payment-date-<?php echo $PAY_ID; ?>" class="payment-date-dv"><?php echo $payment->timestamp('Y-m-d', 'g:i a'); ?></div> |
|
100 | 100 | </td> |
101 | 101 | <td class=" jst-cntr"> |
102 | - <div id="payment-method-<?php echo $PAY_ID;?>"> |
|
103 | - <?php echo $payment->source();?> |
|
102 | + <div id="payment-method-<?php echo $PAY_ID; ?>"> |
|
103 | + <?php echo $payment->source(); ?> |
|
104 | 104 | </div> |
105 | 105 | </td> |
106 | 106 | <td class=" jst-left"> |
107 | - <div id="payment-gateway-<?php echo $PAY_ID;?>"> |
|
108 | - <?php echo $payment->payment_method() ? $payment->payment_method()->admin_name() : __("Unknown", 'event_espresso');?> |
|
107 | + <div id="payment-gateway-<?php echo $PAY_ID; ?>"> |
|
108 | + <?php echo $payment->payment_method() ? $payment->payment_method()->admin_name() : __("Unknown", 'event_espresso'); ?> |
|
109 | 109 | </div> |
110 | - <div id="payment-gateway-id-<?php echo $PAY_ID;?>" class="hidden"><?php echo $payment->payment_method() ? $payment->payment_method()->ID() : 0;?></div> |
|
110 | + <div id="payment-gateway-id-<?php echo $PAY_ID; ?>" class="hidden"><?php echo $payment->payment_method() ? $payment->payment_method()->ID() : 0; ?></div> |
|
111 | 111 | </td> |
112 | 112 | <td class=" jst-left"> |
113 | - <div id="payment-response-<?php echo $PAY_ID;?>"><?php echo $payment->gateway_response();?></div> |
|
113 | + <div id="payment-response-<?php echo $PAY_ID; ?>"><?php echo $payment->gateway_response(); ?></div> |
|
114 | 114 | </td> |
115 | 115 | <td class=" jst-left"> |
116 | - <div id="payment-txn-id-chq-nmbr-<?php echo $PAY_ID;?>"><?php echo $payment->txn_id_chq_nmbr();?></div> |
|
116 | + <div id="payment-txn-id-chq-nmbr-<?php echo $PAY_ID; ?>"><?php echo $payment->txn_id_chq_nmbr(); ?></div> |
|
117 | 117 | </td> |
118 | 118 | <td class=" jst-left"> |
119 | - <div id="payment-po-nmbr-<?php echo $PAY_ID;?>"><?php echo $payment->po_number();?></div> |
|
119 | + <div id="payment-po-nmbr-<?php echo $PAY_ID; ?>"><?php echo $payment->po_number(); ?></div> |
|
120 | 120 | </td> |
121 | 121 | <td class=" jst-left"> |
122 | - <div id="payment-accntng-<?php echo $PAY_ID;?>"><?php echo $payment->extra_accntng();?></div> |
|
122 | + <div id="payment-accntng-<?php echo $PAY_ID; ?>"><?php echo $payment->extra_accntng(); ?></div> |
|
123 | 123 | </td> |
124 | 124 | <td class=" jst-rght"> |
125 | - <?php $payment_class = $payment->amount() > 0 ? 'txn-admin-payment-status-' . $payment->STS_ID() : 'txn-admin-payment-status-PDC'; ?> |
|
126 | - <span class="<?php echo $payment_class;?>"> |
|
127 | - <div id="payment-amount-<?php echo $PAY_ID;?>" style="display:inline;"><?php echo EEH_Template::format_currency($payment->amount(), FALSE, FALSE ); ?></div> |
|
125 | + <?php $payment_class = $payment->amount() > 0 ? 'txn-admin-payment-status-'.$payment->STS_ID() : 'txn-admin-payment-status-PDC'; ?> |
|
126 | + <span class="<?php echo $payment_class; ?>"> |
|
127 | + <div id="payment-amount-<?php echo $PAY_ID; ?>" style="display:inline;"><?php echo EEH_Template::format_currency($payment->amount(), FALSE, FALSE); ?></div> |
|
128 | 128 | </span> |
129 | 129 | </td> |
130 | 130 | </tr> |
@@ -134,25 +134,25 @@ discard block |
||
134 | 134 | <?php endforeach; // $payment?> |
135 | 135 | <?php |
136 | 136 | $pay_totals_class = $payment_total > $grand_raw_total ? ' important-notice' : ''; |
137 | - $overpaid = $payment_total > $grand_raw_total ? '<span id="overpaid">' . __( 'This transaction has been overpaid ! ', 'event_espresso' ) . '</span>' : ''; |
|
137 | + $overpaid = $payment_total > $grand_raw_total ? '<span id="overpaid">'.__('This transaction has been overpaid ! ', 'event_espresso').'</span>' : ''; |
|
138 | 138 | ?> |
139 | 139 | <tr id="txn-admin-no-payments-tr" class="admin-primary-mbox-total-tr hidden"> |
140 | 140 | <td class=" jst-rght" colspan="11"> |
141 | - <span class="important-notice"><?php _e( 'No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.', 'event_espresso' ); ?></span> |
|
141 | + <span class="important-notice"><?php _e('No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.', 'event_espresso'); ?></span> |
|
142 | 142 | </td> |
143 | 143 | </tr> |
144 | - <tr id="txn-admin-payments-total-tr" class="admin-primary-mbox-total-tr<?php echo $pay_totals_class;?>"> |
|
145 | - <th class=" jst-rght" colspan="10"><span id="payments-total-spn"><?php echo $overpaid . sprintf( __( 'Payments Total %s', 'event_espresso' ), '(' . EE_Registry::instance()->CFG->currency->code . ')' );?></span></th> |
|
146 | - <th class=" jst-rght"><span id="txn-admin-payment-total"><?php echo EEH_Template::format_currency($payment_total, FALSE, FALSE);?></span></th> |
|
144 | + <tr id="txn-admin-payments-total-tr" class="admin-primary-mbox-total-tr<?php echo $pay_totals_class; ?>"> |
|
145 | + <th class=" jst-rght" colspan="10"><span id="payments-total-spn"><?php echo $overpaid.sprintf(__('Payments Total %s', 'event_espresso'), '('.EE_Registry::instance()->CFG->currency->code.')'); ?></span></th> |
|
146 | + <th class=" jst-rght"><span id="txn-admin-payment-total"><?php echo EEH_Template::format_currency($payment_total, FALSE, FALSE); ?></span></th> |
|
147 | 147 | </tr> |
148 | 148 | <?php else : ?> |
149 | 149 | <tr id="txn-admin-no-payments-tr" class="admin-primary-mbox-total-tr"> |
150 | 150 | <td class=" jst-rght" colspan="11"> |
151 | - <span class="important-notice"><?php _e( 'No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.', 'event_espresso' ); ?></span> |
|
151 | + <span class="important-notice"><?php _e('No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.', 'event_espresso'); ?></span> |
|
152 | 152 | </td> |
153 | 153 | </tr> |
154 | 154 | <tr id="txn-admin-payments-total-tr" class="admin-primary-mbox-total-tr hidden"> |
155 | - <th class=" jst-rght" colspan="10"><span id="payments-total-spn"><?php echo __( 'Payments Total', 'event_espresso' );?></span></th> |
|
155 | + <th class=" jst-rght" colspan="10"><span id="payments-total-spn"><?php echo __('Payments Total', 'event_espresso'); ?></span></th> |
|
156 | 156 | <th class=" jst-rght"><span id="txn-admin-payment-total"></span></th> |
157 | 157 | </tr> |
158 | 158 | <?php endif; // $payments?> |
@@ -165,12 +165,12 @@ discard block |
||
165 | 165 | <td class=" jst-cntr"> |
166 | 166 | <ul class="txn-overview-actions-ul"> |
167 | 167 | <li> |
168 | - <a class="txn-admin-payment-action-edit-lnk" title="<?php esc_attr_e( 'Edit Payment', 'event_espresso' );?>" data-payment-id="PAY_ID"> |
|
168 | + <a class="txn-admin-payment-action-edit-lnk" title="<?php esc_attr_e('Edit Payment', 'event_espresso'); ?>" data-payment-id="PAY_ID"> |
|
169 | 169 | <div class="dashicons dashicons-edit" style="margin: 0;"></div> |
170 | 170 | </a> |
171 | 171 | </li> |
172 | 172 | <li> |
173 | - <a class="txn-admin-payment-action-delete-lnk" title="<?php esc_attr_e( 'Delete Payment', 'event_espresso' );?>" data-payment-id="PAY_ID"> |
|
173 | + <a class="txn-admin-payment-action-delete-lnk" title="<?php esc_attr_e('Delete Payment', 'event_espresso'); ?>" data-payment-id="PAY_ID"> |
|
174 | 174 | <div class="dashicons dashicons-trash" style="margin: 0;"></div> |
175 | 175 | </a> |
176 | 176 | </li> |
@@ -217,12 +217,12 @@ discard block |
||
217 | 217 | <ul id="txn-admin-payment-options-ul"> |
218 | 218 | <li> |
219 | 219 | <a id="display-txn-admin-apply-payment" class="button-primary no-icon no-hide" rel="txn-admin-apply-payment" > <!--display-the-hidden --> |
220 | - <?php _e( 'Apply Payment', 'event_espresso' );?> |
|
220 | + <?php _e('Apply Payment', 'event_espresso'); ?> |
|
221 | 221 | </a> |
222 | 222 | </li> |
223 | 223 | <li> |
224 | 224 | <a id="display-txn-admin-apply-refund" class="button-secondary no-icon no-hide" rel="txn-admin-apply-refund" > <!--display-the-hidden --> |
225 | - <?php _e( 'Apply Refund', 'event_espresso' );?> |
|
225 | + <?php _e('Apply Refund', 'event_espresso'); ?> |
|
226 | 226 | </a> |
227 | 227 | </li> |
228 | 228 | </ul> |
@@ -232,14 +232,14 @@ discard block |
||
232 | 232 | |
233 | 233 | <h2 id="admin-modal-dialog-apply-payment-h2" class="admin-modal-dialog-h2 hdr-has-icon" style="display:none;"> |
234 | 234 | <div class="ee-icon ee-icon-cash-add float-left"></div> |
235 | - <?php echo __( 'Apply a Payment to Transaction #', 'event_espresso' ) . $txn_nmbr['value'];?> |
|
235 | + <?php echo __('Apply a Payment to Transaction #', 'event_espresso').$txn_nmbr['value']; ?> |
|
236 | 236 | </h2> |
237 | 237 | |
238 | 238 | <h2 id="admin-modal-dialog-edit-payment-h2" class="admin-modal-dialog-h2 hdr-has-icon" style="display:none;"> |
239 | 239 | <div class="ee-icon ee-icon-cash-edit float-left"></div> |
240 | 240 | <?php |
241 | 241 | echo sprintf( |
242 | - __( 'Edit Payment #%s for Transaction #%s', 'event_espresso' ), |
|
242 | + __('Edit Payment #%s for Transaction #%s', 'event_espresso'), |
|
243 | 243 | '<span></span>', |
244 | 244 | $txn_nmbr['value'] |
245 | 245 | ); |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | <div class="ee-icon ee-icon-cash-edit float-left"></div> |
251 | 251 | <?php |
252 | 252 | echo sprintf( |
253 | - __( 'Edit Refund #%s for Transaction #%s', 'event_espresso' ), |
|
253 | + __('Edit Refund #%s for Transaction #%s', 'event_espresso'), |
|
254 | 254 | '<span></span>', |
255 | 255 | $txn_nmbr['value'] |
256 | 256 | ); |
@@ -259,14 +259,14 @@ discard block |
||
259 | 259 | |
260 | 260 | <h2 id="admin-modal-dialog-apply-refund-h2" class="admin-modal-dialog-h2 hdr-has-icon" style="display:none;"> |
261 | 261 | <div class="ee-icon ee-icon-cash-remove float-left"></div> |
262 | - <?php echo __( 'Apply a Refund to Transaction #', 'event_espresso' ) . $txn_nmbr['value'];?> |
|
262 | + <?php echo __('Apply a Refund to Transaction #', 'event_espresso').$txn_nmbr['value']; ?> |
|
263 | 263 | </h2> |
264 | 264 | |
265 | 265 | <form name="txn-admin-apply-payment-frm" id="txn-admin-apply-payment-frm" action="<?php echo $apply_payment_form_url; ?>"> |
266 | 266 | <div class="admin-modal-dialog-wrap"> |
267 | 267 | <div class="admin-modal-dialog-inner"> |
268 | 268 | |
269 | - <input type="hidden" name="espresso_apply_payment_nonce" id="espresso_apply_payment_nonce" value="<?php echo wp_create_nonce( 'espresso_apply_payment_nonce' );?>"/> |
|
269 | + <input type="hidden" name="espresso_apply_payment_nonce" id="espresso_apply_payment_nonce" value="<?php echo wp_create_nonce('espresso_apply_payment_nonce'); ?>"/> |
|
270 | 270 | <input type="hidden" name="espresso_ajax" id="espresso-ajax" value="0"/> |
271 | 271 | <input type="hidden" name="noheader" id="txn-admin-noheader-inp" value="0"/> |
272 | 272 | <input type="hidden" name="txn_admin_payment[PAY_ID]" id="txn-admin-payment-payment-id-inp" class="txn-admin-apply-payment-inp" value="0"/> |
@@ -274,108 +274,108 @@ discard block |
||
274 | 274 | <input type="hidden" name="txn_admin_payment[type]" id="txn-admin-payment-type-inp" value="1"/> |
275 | 275 | <input type="hidden" name="txn_admin_payment[details]" id="txn-admin-payment-details-inp" value=""/> |
276 | 276 | <input type="hidden" name="txn_admin_delete_payment_form_url" id="txn-admin-delete-payment-form-url-inp" value="<?php echo $delete_payment_form_url; ?>"/> |
277 | - <input type="hidden" name="txn_admin_todays_date" id="txn-admin-todays-date-inp" value="<?php echo date( 'Y-m-d h:i a', current_time( 'timestamp' )); ?>"/> |
|
277 | + <input type="hidden" name="txn_admin_todays_date" id="txn-admin-todays-date-inp" value="<?php echo date('Y-m-d h:i a', current_time('timestamp')); ?>"/> |
|
278 | 278 | |
279 | 279 | <div class="txn-admin-apply-payment-date-dv admin-modal-dialog-row"> |
280 | - <div class="validation-notice-dv"><?php _e( 'The following is a required field', 'event_espresso' );?></div> |
|
281 | - <label for="txn-admin-payment-date-inp" class=""><?php _e( 'Payment Date', 'event_espresso' );?></label> |
|
282 | - <input name="[date]txn_admin_payment" id="txn-admin-payment-date-inp" class="txn-admin-apply-payment-inp required" type="text" value="<?php echo date( 'Y-m-d g:i a', current_time( 'timestamp' )); ?>"/> |
|
283 | - <p class="description"><?php _e( 'The date the payment was actually made on', 'event_espresso' );?></p> |
|
280 | + <div class="validation-notice-dv"><?php _e('The following is a required field', 'event_espresso'); ?></div> |
|
281 | + <label for="txn-admin-payment-date-inp" class=""><?php _e('Payment Date', 'event_espresso'); ?></label> |
|
282 | + <input name="[date]txn_admin_payment" id="txn-admin-payment-date-inp" class="txn-admin-apply-payment-inp required" type="text" value="<?php echo date('Y-m-d g:i a', current_time('timestamp')); ?>"/> |
|
283 | + <p class="description"><?php _e('The date the payment was actually made on', 'event_espresso'); ?></p> |
|
284 | 284 | </div> |
285 | 285 | |
286 | 286 | <div class="txn-admin-apply-payment-amount-dv admin-modal-dialog-row"> |
287 | - <div class="validation-notice-dv"><?php _e( 'The following is a required field', 'event_espresso' );?></div> |
|
288 | - <label for="txn-admin-payment-amount-inp" class=""><?php _e( 'Amount', 'event_espresso' );?></label> |
|
287 | + <div class="validation-notice-dv"><?php _e('The following is a required field', 'event_espresso'); ?></div> |
|
288 | + <label for="txn-admin-payment-amount-inp" class=""><?php _e('Amount', 'event_espresso'); ?></label> |
|
289 | 289 | <input name="txn_admin_payment[amount]" id="txn-admin-payment-amount-inp" class="txn-admin-apply-payment-inp required" type="text" value=""/> |
290 | - <p class="description"><?php _e( 'The amount of the payment', 'event_espresso' );?></p> |
|
290 | + <p class="description"><?php _e('The amount of the payment', 'event_espresso'); ?></p> |
|
291 | 291 | </div> |
292 | 292 | |
293 | 293 | <div class="txn-admin-apply-payment-method-dv admin-modal-dialog-row"> |
294 | - <div class="validation-notice-dv"><?php _e( 'The following is a required field', 'event_espresso' );?></div> |
|
295 | - <label for="txn-admin-payment-method-inp" class=""><?php _e( 'Method of Payment', 'event_espresso' );?></label> |
|
294 | + <div class="validation-notice-dv"><?php _e('The following is a required field', 'event_espresso'); ?></div> |
|
295 | + <label for="txn-admin-payment-method-inp" class=""><?php _e('Method of Payment', 'event_espresso'); ?></label> |
|
296 | 296 | <select name="txn_admin_payment[PMD_ID]" id="txn-admin-payment-method-slct" class="txn-admin-apply-payment-slct required" type="text" > |
297 | - <?php foreach ( $payment_methods as $method ) : ?> |
|
297 | + <?php foreach ($payment_methods as $method) : ?> |
|
298 | 298 | <?php $selected = $method->slug() == 'cash' ? ' selected="selected"' : ''; ?> |
299 | - <option id="payment-method-opt-<?php echo $method->slug(); ?>" value="<?php echo $method->ID(); ?>"<?php echo $selected; ?>><?php echo sanitize_key( $method->admin_desc() ) ? substr( $method->admin_desc(), 0, 128) : $method->admin_name() ; ?> </option> |
|
299 | + <option id="payment-method-opt-<?php echo $method->slug(); ?>" value="<?php echo $method->ID(); ?>"<?php echo $selected; ?>><?php echo sanitize_key($method->admin_desc()) ? substr($method->admin_desc(), 0, 128) : $method->admin_name(); ?> </option> |
|
300 | 300 | <?php endforeach; ?> |
301 | 301 | </select> |
302 | - <p class="description"><?php _e( 'Whether the payment was made via PayPal, Credit Card, Cheque, or Cash', 'event_espresso' );?></p> |
|
302 | + <p class="description"><?php _e('Whether the payment was made via PayPal, Credit Card, Cheque, or Cash', 'event_espresso'); ?></p> |
|
303 | 303 | </div> |
304 | 304 | |
305 | 305 | <div class="mop-PP mop-CC mop-CHQ mop"> |
306 | 306 | <div class="txn-admin-apply-payment-gw-txn-id-dv admin-modal-dialog-row"> |
307 | - <label for="txn-admin-payment-txn-id-inp" class=""><?php _e( 'TXN ID / CHQ #', 'event_espresso' );?></label> |
|
307 | + <label for="txn-admin-payment-txn-id-inp" class=""><?php _e('TXN ID / CHQ #', 'event_espresso'); ?></label> |
|
308 | 308 | <input name="txn_admin_payment[txn_id_chq_nmbr]" id="txn-admin-payment-txn-id-chq-nmbr-inp" class="txn-admin-apply-payment-inp" type="text" maxlength="100"/> |
309 | - <p class="description"><?php _e( 'The Transaction ID sent back from the payment gateway, or the Cheque #', 'event_espresso' );?></p> |
|
309 | + <p class="description"><?php _e('The Transaction ID sent back from the payment gateway, or the Cheque #', 'event_espresso'); ?></p> |
|
310 | 310 | </div> |
311 | 311 | </div> |
312 | 312 | |
313 | 313 | <div class="mop-CC mop" style="display:none"> |
314 | 314 | <div class="txn-admin-apply-payment-response-dv admin-modal-dialog-row"> |
315 | - <label for="txn-admin-payment-gateway-response-inp" class=""><?php _e( 'Gateway Response', 'event_espresso' );?></label> |
|
315 | + <label for="txn-admin-payment-gateway-response-inp" class=""><?php _e('Gateway Response', 'event_espresso'); ?></label> |
|
316 | 316 | <input name="txn_admin_payment[gateway_response]" id="txn-admin-payment-gateway-response-inp" class="txn-admin-apply-payment-inp" type="text"/> |
317 | - <p class="description"><?php _e( 'The gateway response string (optional)', 'event_espresso' );?></p> |
|
317 | + <p class="description"><?php _e('The gateway response string (optional)', 'event_espresso'); ?></p> |
|
318 | 318 | </div> |
319 | 319 | </div> |
320 | 320 | |
321 | 321 | <div class="mop-PP mop-CC mop"> |
322 | 322 | <div class="txn-admin-apply-payment-status-dv admin-modal-dialog-row"> |
323 | - <label for="txn-admin-payment-status-inp" class=""><?php _e( 'Payment Status', 'event_espresso' );?></label> |
|
323 | + <label for="txn-admin-payment-status-inp" class=""><?php _e('Payment Status', 'event_espresso'); ?></label> |
|
324 | 324 | <select name="txn_admin_payment[status]" id="txn-admin-payment-status-slct" class="txn-admin-apply-payment-slct" type="text" > |
325 | - <?php foreach ( $payment_status as $STS_ID => $STS_code ) : ?> |
|
325 | + <?php foreach ($payment_status as $STS_ID => $STS_code) : ?> |
|
326 | 326 | <?php $selected = $STS_ID == 'PAP' ? ' selected="selected"' : ''; ?> |
327 | 327 | <option id="payment-status-opt-<?php echo $STS_ID; ?>" value="<?php echo $STS_ID; ?>"<?php echo $selected; ?>><?php echo $STS_code; ?> </option> |
328 | 328 | <?php endforeach; ?> |
329 | 329 | </select> |
330 | - <p class="description"><?php _e( 'Whether the payment was approved, cancelled, declined or failed after submission to the gateway', 'event_espresso' );?></p> |
|
330 | + <p class="description"><?php _e('Whether the payment was approved, cancelled, declined or failed after submission to the gateway', 'event_espresso'); ?></p> |
|
331 | 331 | </div> |
332 | 332 | </div> |
333 | 333 | |
334 | 334 | <div class="txn-admin-apply-payment-po-nmbr-dv admin-modal-dialog-row"> |
335 | - <label for="txn-admin-payment-po-nmbr-inp" class=""><?php _e( 'P.O. / S.O. #', 'event_espresso' );?></label> |
|
335 | + <label for="txn-admin-payment-po-nmbr-inp" class=""><?php _e('P.O. / S.O. #', 'event_espresso'); ?></label> |
|
336 | 336 | <input name="txn_admin_payment[po_number]" id="txn-admin-payment-po-nmbr-inp" class="txn-admin-apply-payment-inp" type="text" maxlength="100"/> |
337 | - <p class="description"><?php _e( 'The Purchase or Sales Order Number if any (optional)', 'event_espresso' );?></p> |
|
337 | + <p class="description"><?php _e('The Purchase or Sales Order Number if any (optional)', 'event_espresso'); ?></p> |
|
338 | 338 | </div> |
339 | 339 | |
340 | 340 | <div class="txn-admin-apply-payment-accounting-dv admin-modal-dialog-row"> |
341 | - <label for="txn-admin-payment-accounting-inp" class="last"><?php _e( 'Notes / Extra Accounting', 'event_espresso' );?></label> |
|
341 | + <label for="txn-admin-payment-accounting-inp" class="last"><?php _e('Notes / Extra Accounting', 'event_espresso'); ?></label> |
|
342 | 342 | <input name="txn_admin_payment[accounting]" id="txn-admin-payment-accounting-inp" class="txn-admin-apply-payment-inp" type="text" value="<?php echo $REG_code; ?>" maxlength="100"/> <input type="hidden" id="txn-admin-reg-code-inp" value="<?php echo $REG_code; ?>"/> |
343 | - <p class="description"><?php _e( 'An extra field you may use for accounting purposes or simple notes. Defaults to the primary registrant\'s registration code.', 'event_espresso' );?></p> |
|
343 | + <p class="description"><?php _e('An extra field you may use for accounting purposes or simple notes. Defaults to the primary registrant\'s registration code.', 'event_espresso'); ?></p> |
|
344 | 344 | </div> |
345 | 345 | |
346 | 346 | <div class="txn-admin-apply-payment-registrations-dv admin-modal-dialog-row"> |
347 | - <label for="txn-admin-payment-registrations-inp" class="last"><?php _e( 'Registrations to Apply Payment to:', 'event_espresso' ); ?></label> |
|
347 | + <label for="txn-admin-payment-registrations-inp" class="last"><?php _e('Registrations to Apply Payment to:', 'event_espresso'); ?></label> |
|
348 | 348 | <label class="txn-admin-apply-payment-to-registrations-lbl"> |
349 | 349 | <input type="radio" value="1" id="txn-admin-apply-payment-to-all-registrations-inp" name="txn_admin_payment[apply_to_all_registrations]" checked="checked"/> |
350 | - <?php _e( 'ALL Registrations', 'event_espresso' ); ?> |
|
350 | + <?php _e('ALL Registrations', 'event_espresso'); ?> |
|
351 | 351 | </label> |
352 | 352 | <label class="txn-admin-apply-payment-to-registrations-lbl"> |
353 | 353 | <input type="radio" value="0" id="txn-admin-apply-payment-to-some-registrations-inp" name="txn_admin_payment[apply_to_all_registrations]" /> |
354 | - <?php _e( 'Just the following Registrations', 'event_espresso' ); ?> |
|
354 | + <?php _e('Just the following Registrations', 'event_espresso'); ?> |
|
355 | 355 | </label> |
356 | 356 | <?php echo $registrations_to_apply_payment_to; ?> |
357 | 357 | </div> |
358 | 358 | |
359 | 359 | <div class="txn-admin-payment-reg-status-dv admin-modal-dialog-row"> |
360 | - <label for="txn-admin-payment-reg-status-inp" class="last"><?php _e( 'Change Registration Status?', 'event_espresso' );?></label> |
|
360 | + <label for="txn-admin-payment-reg-status-inp" class="last"><?php _e('Change Registration Status?', 'event_espresso'); ?></label> |
|
361 | 361 | <?php echo $status_change_select; ?> |
362 | - <p class="description"><?php _e( 'If you wish to change the status for the registrations selected above, then select which status from this dropdown.', 'event_espresso' ); ?></p> |
|
362 | + <p class="description"><?php _e('If you wish to change the status for the registrations selected above, then select which status from this dropdown.', 'event_espresso'); ?></p> |
|
363 | 363 | <br/> |
364 | 364 | </div> |
365 | 365 | |
366 | 366 | <div class="txn-admin-apply-payment-send-notifications-dv admin-modal-dialog-row"> |
367 | 367 | |
368 | - <label for="txn-admin-payment-send-notifications-inp" class="last"><?php _e( 'Send Related Messages?', 'event_espresso' );?></label> |
|
368 | + <label for="txn-admin-payment-send-notifications-inp" class="last"><?php _e('Send Related Messages?', 'event_espresso'); ?></label> |
|
369 | 369 | <label class="txn-admin-payment-send-notifications-lbl"> |
370 | 370 | <input type="checkbox" value="1" name="txn_payments[send_notifications]" checked="checked" aria-checked="true" style="vertical-align: middle;"> |
371 | - <?php _e( 'Payment Messages?', 'event_espresso' ); ?> |
|
371 | + <?php _e('Payment Messages?', 'event_espresso'); ?> |
|
372 | 372 | </label> |
373 | 373 | <label class="txn-admin-payment-send-notifications-lbl"> |
374 | 374 | <input type="checkbox" value="1" name="txn_reg_status_change[send_notifications]" style="vertical-align: middle;"> |
375 | - <?php _e( 'Registration Messages?', 'event_espresso' ); ?> |
|
375 | + <?php _e('Registration Messages?', 'event_espresso'); ?> |
|
376 | 376 | </label> |
377 | 377 | <br class="clear-float"/> |
378 | - <p class="description"><?php printf( __('By default %1$sa payment message is sent to the primary registrant%2$s after submitting this form.%3$sHowever, if you check the "Registration Messages" box, the system will also send any related messages matching the status of the registrations to %1$seach registration for this transaction%2$s.', 'event_espresso'), '<strong>', '</strong>', '<br />' ); ?></p> |
|
378 | + <p class="description"><?php printf(__('By default %1$sa payment message is sent to the primary registrant%2$s after submitting this form.%3$sHowever, if you check the "Registration Messages" box, the system will also send any related messages matching the status of the registrations to %1$seach registration for this transaction%2$s.', 'event_espresso'), '<strong>', '</strong>', '<br />'); ?></p> |
|
379 | 379 | <label></label> |
380 | 380 | </div> |
381 | 381 | <div class="clear"></div> |
@@ -386,27 +386,27 @@ discard block |
||
386 | 386 | <ul id="admin-modal-dialog-options-ul"> |
387 | 387 | <li> |
388 | 388 | <a id="txn-admin-modal-dialog-apply-payment-lnk" class="button-primary no-icon" style="display:none;" > |
389 | - <?php _e( 'Apply Payment', 'event_espresso' );?> |
|
389 | + <?php _e('Apply Payment', 'event_espresso'); ?> |
|
390 | 390 | </a> |
391 | 391 | </li> |
392 | 392 | <li> |
393 | 393 | <a id="txn-admin-modal-dialog-edit-payment-lnk" class="button-primary no-icon" style="display:none;" > |
394 | - <?php _e( 'Save Payment Details', 'event_espresso' );?> |
|
394 | + <?php _e('Save Payment Details', 'event_espresso'); ?> |
|
395 | 395 | </a> |
396 | 396 | </li> |
397 | 397 | <li> |
398 | 398 | <a id="txn-admin-modal-dialog-edit-refund-lnk" class="button-primary no-icon" style="display:none;" > |
399 | - <?php _e( 'Save Refund Details', 'event_espresso' );?> |
|
399 | + <?php _e('Save Refund Details', 'event_espresso'); ?> |
|
400 | 400 | </a> |
401 | 401 | </li> |
402 | 402 | <li> |
403 | 403 | <a id="txn-admin-modal-dialog-apply-refund-lnk" class="button-primary no-icon" style="display:none;" > |
404 | - <?php _e( 'Apply Refund', 'event_espresso' );?> |
|
404 | + <?php _e('Apply Refund', 'event_espresso'); ?> |
|
405 | 405 | </a> |
406 | 406 | </li> |
407 | 407 | <li> |
408 | 408 | <a id="txn-admin-modal-dialog-cancel-lnk" class="button-secondary no-icon" > |
409 | - <?php _e( 'Cancel', 'event_espresso' );?> |
|
409 | + <?php _e('Cancel', 'event_espresso'); ?> |
|
410 | 410 | </a> |
411 | 411 | </li> |
412 | 412 | <li> |
@@ -423,29 +423,29 @@ discard block |
||
423 | 423 | |
424 | 424 | <h2 id="admin-modal-dialog-delete-payment-h2" class="admin-modal-dialog-h2 hdr-has-icon" style="display:none;"> |
425 | 425 | <span class="ee-icon ee-icon-cash-add"></span> |
426 | - <?php echo __( 'Delete Payment/Refund for Transaction #', 'event_espresso' ) . $txn_nmbr['value'];?> |
|
426 | + <?php echo __('Delete Payment/Refund for Transaction #', 'event_espresso').$txn_nmbr['value']; ?> |
|
427 | 427 | </h2> |
428 | 428 | |
429 | 429 | <form name="txn-admin-delete-payment-frm" id="txn-admin-delete-payment-frm" action="<?php echo $delete_payment_url; ?>"> |
430 | 430 | <div class="admin-modal-dialog-wrap"> |
431 | 431 | <div class="admin-modal-dialog-inner"> |
432 | 432 | |
433 | - <input type="hidden" name="espresso_delete_payment_nonce" id="espresso_delete_payment_nonce" value="<?php echo wp_create_nonce( 'espresso_delete_payment_nonce' );?>"/> |
|
433 | + <input type="hidden" name="espresso_delete_payment_nonce" id="espresso_delete_payment_nonce" value="<?php echo wp_create_nonce('espresso_delete_payment_nonce'); ?>"/> |
|
434 | 434 | <input type="hidden" name="delete_espresso_ajax" id="delete-espresso-ajax" value="0"/> |
435 | 435 | <input type="hidden" name="delete_noheader" id="delete-txn-admin-noheader-inp" value="0"/> |
436 | 436 | <input type="hidden" name="delete_txn_admin_payment[PAY_ID]" id="delete-txn-admin-payment-payment-id-inp" class="txn-admin-apply-payment-inp" value="0"/> |
437 | 437 | <input type="hidden" name="delete_txn_admin_payment[TXN_ID]" id="delete-txn-admin-payment-txn-id-inp" value="<?php echo $txn_nmbr['value']; ?>"/> |
438 | 438 | |
439 | 439 | <div class="txn-admin-apply-payment-accounting-dv admin-modal-dialog-row"> |
440 | - <label for="delete-txn-admin-payment-reg-status-inp" class="last"><?php _e( 'Change Registration Status?', 'event_espresso' );?></label> |
|
440 | + <label for="delete-txn-admin-payment-reg-status-inp" class="last"><?php _e('Change Registration Status?', 'event_espresso'); ?></label> |
|
441 | 441 | <?php echo $delete_status_change_select; ?> |
442 | - <p class="description"><?php printf( __('If you wish to change the status of all the registrations associated with this transaction after deleting this payment/refund, then select which status from this dropdown. %sNote: ALL registrations associated with this transaction will be updated to this new status.%s', 'event_espresso'), '<strong>', '</strong>' ); ?></p> |
|
442 | + <p class="description"><?php printf(__('If you wish to change the status of all the registrations associated with this transaction after deleting this payment/refund, then select which status from this dropdown. %sNote: ALL registrations associated with this transaction will be updated to this new status.%s', 'event_espresso'), '<strong>', '</strong>'); ?></p> |
|
443 | 443 | </div> |
444 | 444 | |
445 | 445 | <div class="ee-attention txn-admin-apply-payment-accounting-dv admin-modal-dialog-row"> |
446 | - <label for="delete-txn-admin-payment-accounting-inp" class="last"><?php _e( 'Send Related Messages?', 'event_espresso' );?></label> |
|
446 | + <label for="delete-txn-admin-payment-accounting-inp" class="last"><?php _e('Send Related Messages?', 'event_espresso'); ?></label> |
|
447 | 447 | <input type="checkbox" value="1" name="delete_txn_reg_status_change[send_notifications]"> |
448 | - <p class="description"><?php _e( 'If you check this box, the system will send any related registration messages matching the status of the registrations to each registration for this transaction. No Payment notifications are sent when deleting a payment.', 'event_espresso' );?></p> |
|
448 | + <p class="description"><?php _e('If you check this box, the system will send any related registration messages matching the status of the registrations to each registration for this transaction. No Payment notifications are sent when deleting a payment.', 'event_espresso'); ?></p> |
|
449 | 449 | </div> |
450 | 450 | <div class="clear"></div> |
451 | 451 | |
@@ -455,12 +455,12 @@ discard block |
||
455 | 455 | <ul id="del-admin-modal-dialog-options-ul"> |
456 | 456 | <li> |
457 | 457 | <a id="txn-admin-modal-dialog-delete-lnk" class="button-primary no-icon" style="display:none;" > |
458 | - <?php _e( 'Delete', 'event_espresso' );?> |
|
458 | + <?php _e('Delete', 'event_espresso'); ?> |
|
459 | 459 | </a> |
460 | 460 | </li> |
461 | 461 | <li> |
462 | 462 | <a id="del-txn-admin-modal-dialog-cancel-lnk" class="button-secondary no-icon" > |
463 | - <?php _e( 'Cancel', 'event_espresso' );?> |
|
463 | + <?php _e('Cancel', 'event_espresso'); ?> |
|
464 | 464 | </a> |
465 | 465 | </li> |
466 | 466 | <li> |
@@ -476,30 +476,30 @@ discard block |
||
476 | 476 | <?php endif; // $grand_raw_total > 0?> |
477 | 477 | |
478 | 478 | <?php |
479 | - if ( WP_DEBUG ) { |
|
480 | - $delivered_messages = get_option( 'EED_Messages__payment', array() ); |
|
481 | - if ( isset( $delivered_messages[ $TXN_ID ] )) { |
|
479 | + if (WP_DEBUG) { |
|
480 | + $delivered_messages = get_option('EED_Messages__payment', array()); |
|
481 | + if (isset($delivered_messages[$TXN_ID])) { |
|
482 | 482 | ?> |
483 | - <h4 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-email-alt"></span><?php _e( 'Messages Sent to Primary Registrant', 'event_espresso' );?></h4> |
|
483 | + <h4 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-email-alt"></span><?php _e('Messages Sent to Primary Registrant', 'event_espresso'); ?></h4> |
|
484 | 484 | |
485 | 485 | <div class="admin-primary-mbox-tbl-wrap"> |
486 | 486 | <table class="admin-primary-mbox-tbl"> |
487 | 487 | <thead> |
488 | 488 | <tr> |
489 | - <th class="jst-left"><?php _e( 'Date & Time', 'event_espresso' );?></th> |
|
490 | - <th class="jst-left"><?php _e( 'Message Type', 'event_espresso' );?></th> |
|
491 | - <th class="jst-left"><?php _e( 'Payment Status Upon Sending', 'event_espresso' );?></th> |
|
492 | - <th class="jst-left"><?php _e( 'TXN Status Upon Sending', 'event_espresso' );?></th> |
|
489 | + <th class="jst-left"><?php _e('Date & Time', 'event_espresso'); ?></th> |
|
490 | + <th class="jst-left"><?php _e('Message Type', 'event_espresso'); ?></th> |
|
491 | + <th class="jst-left"><?php _e('Payment Status Upon Sending', 'event_espresso'); ?></th> |
|
492 | + <th class="jst-left"><?php _e('TXN Status Upon Sending', 'event_espresso'); ?></th> |
|
493 | 493 | </tr> |
494 | 494 | </thead> |
495 | 495 | <tbody> |
496 | - <?php foreach ( $delivered_messages[ $TXN_ID ] as $timestamp => $delivered_message ) : |
|
496 | + <?php foreach ($delivered_messages[$TXN_ID] as $timestamp => $delivered_message) : |
|
497 | 497 | ?> |
498 | 498 | <tr> |
499 | - <td class="jst-left"><?php echo date( get_option('date_format') . ' ' . get_option('time_format'), ( $timestamp + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) );?></td> |
|
500 | - <td class="jst-left"><?php echo isset( $delivered_message['message_type'] ) ? $delivered_message['message_type'] : '';?></td> |
|
501 | - <td class="jst-left"><?php echo isset( $delivered_message['pay_status'] ) ? $delivered_message['pay_status'] : '';?></td> |
|
502 | - <td class="jst-left"><?php echo isset( $delivered_message['txn_status'] ) ? $delivered_message['txn_status'] : '';?></td> |
|
499 | + <td class="jst-left"><?php echo date(get_option('date_format').' '.get_option('time_format'), ($timestamp + (get_option('gmt_offset') * HOUR_IN_SECONDS))); ?></td> |
|
500 | + <td class="jst-left"><?php echo isset($delivered_message['message_type']) ? $delivered_message['message_type'] : ''; ?></td> |
|
501 | + <td class="jst-left"><?php echo isset($delivered_message['pay_status']) ? $delivered_message['pay_status'] : ''; ?></td> |
|
502 | + <td class="jst-left"><?php echo isset($delivered_message['txn_status']) ? $delivered_message['txn_status'] : ''; ?></td> |
|
503 | 503 | </tr> |
504 | 504 | <?php endforeach; // $delivered_messages?> |
505 | 505 | </tbody> |
@@ -3,13 +3,15 @@ |
||
3 | 3 | <div class="clearfix"> |
4 | 4 | <?php _e( 'There is no billing info for this transaction.', 'event_espresso' );?><br/> |
5 | 5 | </div> |
6 | -<?php else : |
|
6 | +<?php else { |
|
7 | + : |
|
7 | 8 | function ee_show_billing_info_cleaned( EE_Form_Section_Proper $form_section ) { |
8 | 9 | foreach( $form_section->subsections() as $subsection ) { |
9 | 10 | if( $subsection instanceof EE_Form_Input_Base ) { |
10 | 11 | if( $subsection->get_sensitive_data_removal_strategy() instanceof EE_All_Sensitive_Data_Removal || |
11 | 12 | $subsection->get_sensitive_data_removal_strategy() instanceof EE_CCV_Sensitive_Data_Removal ){ |
12 | 13 | continue; |
14 | +} |
|
13 | 15 | } |
14 | 16 | ?> |
15 | 17 | <div class="clearfix"> |
@@ -8,8 +8,8 @@ |
||
8 | 8 | foreach( $form_section->subsections() as $subsection ) { |
9 | 9 | if( $subsection instanceof EE_Form_Input_Base ) { |
10 | 10 | if( $subsection->get_sensitive_data_removal_strategy() instanceof EE_All_Sensitive_Data_Removal |
11 | - || $subsection->get_sensitive_data_removal_strategy() instanceof EE_CCV_Sensitive_Data_Removal |
|
12 | - || $subsection->get_display_strategy() instanceof EE_Hidden_Display_Strategy ){ |
|
11 | + || $subsection->get_sensitive_data_removal_strategy() instanceof EE_CCV_Sensitive_Data_Removal |
|
12 | + || $subsection->get_display_strategy() instanceof EE_Hidden_Display_Strategy ){ |
|
13 | 13 | continue; |
14 | 14 | } |
15 | 15 | if( $subsection->get_sensitive_data_removal_strategy() instanceof EE_Credit_Card_Sensitive_Data_Removal ) { |
@@ -1,38 +1,38 @@ |
||
1 | 1 | <div id="admin-side-mbox-billing-info-dv" class="admin-side-mbox-dv"> |
2 | -<?php if ( empty($billing_form) ) : ?> |
|
2 | +<?php if (empty($billing_form)) : ?> |
|
3 | 3 | <div class="clearfix"> |
4 | - <?php _e( 'There is no billing info for this transaction.', 'event_espresso' );?><br/> |
|
4 | + <?php _e('There is no billing info for this transaction.', 'event_espresso'); ?><br/> |
|
5 | 5 | </div> |
6 | 6 | <?php else : |
7 | - function ee_show_billing_info_cleaned( EE_Form_Section_Proper $form_section, $found_cc_data = false ) { |
|
8 | - foreach( $form_section->subsections() as $subsection ) { |
|
9 | - if( $subsection instanceof EE_Form_Input_Base ) { |
|
10 | - if( $subsection->get_sensitive_data_removal_strategy() instanceof EE_All_Sensitive_Data_Removal |
|
7 | + function ee_show_billing_info_cleaned(EE_Form_Section_Proper $form_section, $found_cc_data = false) { |
|
8 | + foreach ($form_section->subsections() as $subsection) { |
|
9 | + if ($subsection instanceof EE_Form_Input_Base) { |
|
10 | + if ($subsection->get_sensitive_data_removal_strategy() instanceof EE_All_Sensitive_Data_Removal |
|
11 | 11 | || $subsection->get_sensitive_data_removal_strategy() instanceof EE_CCV_Sensitive_Data_Removal |
12 | - || $subsection->get_display_strategy() instanceof EE_Hidden_Display_Strategy ){ |
|
12 | + || $subsection->get_display_strategy() instanceof EE_Hidden_Display_Strategy) { |
|
13 | 13 | continue; |
14 | 14 | } |
15 | - if( $subsection->get_sensitive_data_removal_strategy() instanceof EE_Credit_Card_Sensitive_Data_Removal ) { |
|
15 | + if ($subsection->get_sensitive_data_removal_strategy() instanceof EE_Credit_Card_Sensitive_Data_Removal) { |
|
16 | 16 | $found_cc_data = true; |
17 | 17 | } |
18 | 18 | ?> |
19 | 19 | <div class="clearfix"> |
20 | - <span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php echo $subsection->get_html_for_label();?></span><?php echo $subsection->pretty_value();?> |
|
20 | + <span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php echo $subsection->get_html_for_label(); ?></span><?php echo $subsection->pretty_value(); ?> |
|
21 | 21 | </div><?php |
22 | - } elseif( $subsection instanceof EE_Form_Section_Proper ) { |
|
23 | - $found_cc_data = ee_show_billing_info_cleaned( $subsection, $found_cc_data); |
|
22 | + } elseif ($subsection instanceof EE_Form_Section_Proper) { |
|
23 | + $found_cc_data = ee_show_billing_info_cleaned($subsection, $found_cc_data); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | return $found_cc_data; |
27 | 27 | } |
28 | - $found_cc_data = ee_show_billing_info_cleaned( $billing_form ); |
|
29 | - if( apply_filters( |
|
28 | + $found_cc_data = ee_show_billing_info_cleaned($billing_form); |
|
29 | + if (apply_filters( |
|
30 | 30 | 'FHEE__txn_admin_details_side_meta_box_billing_info__show_default_note', |
31 | 31 | $found_cc_data, |
32 | - $billing_form ) ) {?> |
|
33 | - <p class="help"><?php _e( 'Note: Card expiry dates and CCV are not stored. Only the last 4 digits of card numbers are stored.', 'event_espresso' );?></p> |
|
32 | + $billing_form )) {?> |
|
33 | + <p class="help"><?php _e('Note: Card expiry dates and CCV are not stored. Only the last 4 digits of card numbers are stored.', 'event_espresso'); ?></p> |
|
34 | 34 | <?php } |
35 | - do_action( 'AHEE__txn_admin_details_side_meta_box_billing_info__billing_form_footer', $billing_form ); |
|
35 | + do_action('AHEE__txn_admin_details_side_meta_box_billing_info__billing_form_footer', $billing_form); |
|
36 | 36 | endif; ?> |
37 | 37 | |
38 | 38 | </div> |