Completed
Branch BUG-9548-transaction-completio... (b1c41e)
by
unknown
519:42 queued 503:28
created
support/templates/support_admin_details_important_information.template.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@
 block discarded – undo
7 7
 	$is_php_valid = version_compare(phpversion(), $php_req_version, '>');
8 8
 	$is_mysql_valid = version_compare($wpdb->db_version(), $mysql_req_version, '>');
9 9
 
10
-	if (!version_compare($wp_version, $wp_req_version, '>=')) {
11
-		echo '<p class="red_alert">' . __('This version of Event Espresso requires WordPress version', 'event_espresso') . ' ' . $wp_req_version . '+. ' . __('Please upgrade to the latest version of WordPress.', 'event_espresso') . '</p>';
10
+	if ( ! version_compare($wp_version, $wp_req_version, '>=')) {
11
+		echo '<p class="red_alert">'.__('This version of Event Espresso requires WordPress version', 'event_espresso').' '.$wp_req_version.'+. '.__('Please upgrade to the latest version of WordPress.', 'event_espresso').'</p>';
12 12
 	}
13
-	if (!$is_php_valid) {
14
-		echo '<p class="red_alert">' . __('Your version of PHP is out of date, please update to the latest version of PHP. <br>Required version of PHP:', 'event_espresso') . ' ' . $php_req_version . '</p>';
13
+	if ( ! $is_php_valid) {
14
+		echo '<p class="red_alert">'.__('Your version of PHP is out of date, please update to the latest version of PHP. <br>Required version of PHP:', 'event_espresso').' '.$php_req_version.'</p>';
15 15
 	}
16
-	if (!$is_mysql_valid) {
17
-		echo '<p class="red_alert">' . __('Your version of MySQL is out of date, please update to the latest version of MySQL. <br>Required version of MySQL:', 'event_espresso') . ' ' . $mysql_req_version . '</p>';
16
+	if ( ! $is_mysql_valid) {
17
+		echo '<p class="red_alert">'.__('Your version of MySQL is out of date, please update to the latest version of MySQL. <br>Required version of MySQL:', 'event_espresso').' '.$mysql_req_version.'</p>';
18 18
 	}
19 19
 	
20 20
 	$query_args = array(
Please login to merge, or discard this patch.
support/templates/support_admin_details_shortcodes_attendee.template.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -6,42 +6,42 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
admin_pages/transactions/Transactions_Admin_Page.core.php 4 patches
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 );
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1455,7 +1455,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 ) {
Please login to merge, or discard this patch.
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 /**
3
- * Event Espresso
4
- *
5
- * Event Registration and Management Plugin for WordPress
6
- *
7
- * @ package			Event Espresso
8
- * @ author				Seth Shoultes
9
- * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
10
- * @ license			{@link http://eventespresso.com/support/terms-conditions/}   * see Plugin Licensing *
11
- * @ link					{@link http://www.eventespresso.com}
12
- * @ since		 		4.0
13
- *
14
- * ------------------------------------------------------------------------
15
- *
16
- * EE_Admin_Transactions class
17
- *
18
- * @package			Event Espresso
19
- * @subpackage	includes/core/admin/transactions/Transactions_Admin_Page.core.php
20
- * @author				Brent Christensen
21
- *
22
- * ------------------------------------------------------------------------
23
- */
3
+	 * Event Espresso
4
+	 *
5
+	 * Event Registration and Management Plugin for WordPress
6
+	 *
7
+	 * @ package			Event Espresso
8
+	 * @ author				Seth Shoultes
9
+	 * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
10
+	 * @ license			{@link http://eventespresso.com/support/terms-conditions/}   * see Plugin Licensing *
11
+	 * @ link					{@link http://www.eventespresso.com}
12
+	 * @ since		 		4.0
13
+	 *
14
+	 * ------------------------------------------------------------------------
15
+	 *
16
+	 * EE_Admin_Transactions class
17
+	 *
18
+	 * @package			Event Espresso
19
+	 * @subpackage	includes/core/admin/transactions/Transactions_Admin_Page.core.php
20
+	 * @author				Brent Christensen
21
+	 *
22
+	 * ------------------------------------------------------------------------
23
+	 */
24 24
 class Transactions_Admin_Page extends EE_Admin_Page {
25 25
 
26 26
 	/**
@@ -106,9 +106,9 @@  discard block
 block discarded – undo
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();
@@ -261,10 +261,10 @@  discard block
 block discarded – undo
261 261
 	/**
262 262
 	 * _set_transaction_status_array
263 263
 	 * sets list of transaction statuses
264
-	*
264
+	 *
265 265
 	 * @access private
266
-	*	@return void
267
-	*/
266
+	 *	@return void
267
+	 */
268 268
 	private function _set_transaction_status_array() {
269 269
 		self::$_txn_status = EEM_Transaction::instance()->status_array(TRUE);
270 270
 	}
@@ -286,10 +286,10 @@  discard block
 block discarded – undo
286 286
 
287 287
 	/**
288 288
 	 * 	get list of payment statuses
289
-	*
289
+	 *
290 290
 	 * @access private
291
-	*	@return void
292
-	*/
291
+	 *	@return void
292
+	 */
293 293
 	private function _get_payment_status_array() {
294 294
 		self::$_pay_status = EEM_Payment::instance()->status_array(TRUE);
295 295
 		$this->_template_args['payment_status'] = self::$_pay_status;
@@ -397,18 +397,18 @@  discard block
 block discarded – undo
397 397
 		if ( is_object( $this->_transaction) )
398 398
 			return; //get out we've already set the object
399 399
 
400
-	    $TXN = EEM_Transaction::instance();
400
+		$TXN = EEM_Transaction::instance();
401 401
 
402
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
402
+		$TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
403 403
 
404
-	    //get transaction object
405
-	    $this->_transaction = $TXN->get_one_by_ID($TXN_ID);
406
-	    $this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
404
+		//get transaction object
405
+		$this->_transaction = $TXN->get_one_by_ID($TXN_ID);
406
+		$this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
407 407
 
408 408
 	 	if ( empty( $this->_transaction ) ) {
409
-	    	$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  __(' could not be retrieved.', 'event_espresso');
409
+			$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  __(' could not be retrieved.', 'event_espresso');
410 410
 			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
411
-	    }
411
+		}
412 412
 	}
413 413
 
414 414
 
@@ -510,12 +510,12 @@  discard block
 block discarded – undo
510 510
 
511 511
 
512 512
 	/**
513
-	* 	_transaction_details
513
+	 * 	_transaction_details
514 514
 	 * generates HTML for the View Transaction Details Admin page
515
-	*
515
+	 *
516 516
 	 * @access protected
517
-	*	@return void
518
-	*/
517
+	 *	@return void
518
+	 */
519 519
 	protected function _transaction_details() {
520 520
 		do_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction );
521 521
 		EE_Registry::instance()->load_helper( 'MSG_Template' );
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
 						'button secondary-button right',
569 569
 						'dashicons dashicons-email-alt'
570 570
 					)
571
-				    : '';
571
+					: '';
572 572
 		} else {
573 573
 			$this->_template_args['send_payment_reminder_button'] = '';
574 574
 		}
@@ -722,10 +722,10 @@  discard block
 block discarded – undo
722 722
 	/**
723 723
 	 * txn_details_meta_box
724 724
 	 * generates HTML for the Transaction main meta box
725
-	*
725
+	 *
726 726
 	 * @access public
727
-	*	@return void
728
-	*/
727
+	 *	@return void
728
+	 */
729 729
 	public function txn_details_meta_box() {
730 730
 
731 731
 		$this->_set_transaction_object();
@@ -1066,10 +1066,10 @@  discard block
 block discarded – undo
1066 1066
 	/**
1067 1067
 	 * txn_billing_info_side_meta_box
1068 1068
 	 * 	generates HTML for the Edit Transaction side meta box
1069
-	*
1069
+	 *
1070 1070
 	 * @access public
1071
-	*	@return void
1072
-	*/
1071
+	 *	@return void
1072
+	 */
1073 1073
 	public function txn_billing_info_side_meta_box() {
1074 1074
 
1075 1075
 		$this->_template_args['billing_form'] = $this->_transaction->billing_info();
@@ -1087,10 +1087,10 @@  discard block
 block discarded – undo
1087 1087
 	/**
1088 1088
 	 * apply_payments_or_refunds
1089 1089
 	 * 	registers a payment or refund made towards a transaction
1090
-	*
1090
+	 *
1091 1091
 	 * @access public
1092
-	*	@return void
1093
-	*/
1092
+	 *	@return void
1093
+	 */
1094 1094
 	public function apply_payments_or_refunds() {
1095 1095
 		$json_response_data = array( 'return_data' => FALSE );
1096 1096
 		$valid_data = $this->_validate_payment_request_data();
@@ -1244,9 +1244,9 @@  discard block
 block discarded – undo
1244 1244
 							'default' => '',
1245 1245
 							'required' => false,
1246 1246
 							'html_label_text' => __( 'Transaction or Cheque Number', 'event_espresso' ),
1247
-                                                        'validation_strategies' => array(
1248
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1249
-                                                        )
1247
+														'validation_strategies' => array(
1248
+															new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1249
+														)
1250 1250
 						)
1251 1251
 					),
1252 1252
 					'po_number' => new EE_Text_Input(
@@ -1254,9 +1254,9 @@  discard block
 block discarded – undo
1254 1254
 							'default' => '',
1255 1255
 							'required' => false,
1256 1256
 							'html_label_text' => __( 'Purchase Order Number', 'event_espresso' ),
1257
-                                                        'validation_strategies' => array(
1258
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1259
-                                                        )
1257
+														'validation_strategies' => array(
1258
+															new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1259
+														)
1260 1260
 						)
1261 1261
 					),
1262 1262
 					'accounting' => new EE_Text_Input(
@@ -1264,9 +1264,9 @@  discard block
 block discarded – undo
1264 1264
 							'default' => '',
1265 1265
 							'required' => false,
1266 1266
 							'html_label_text' => __( 'Extra Field for Accounting', 'event_espresso' ),
1267
-                                                        'validation_strategies' => array(
1268
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1269
-                                                        )
1267
+														'validation_strategies' => array(
1268
+															new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1269
+														)
1270 1270
 						)
1271 1271
 					),
1272 1272
 				)
@@ -1561,10 +1561,10 @@  discard block
 block discarded – undo
1561 1561
 	/**
1562 1562
 	 * delete_payment
1563 1563
 	 * 	delete a payment or refund made towards a transaction
1564
-	*
1564
+	 *
1565 1565
 	 * @access public
1566
-	*	@return void
1567
-	*/
1566
+	 *	@return void
1567
+	 */
1568 1568
 	public function delete_payment() {
1569 1569
 		$json_response_data = array( 'return_data' => FALSE );
1570 1570
 		$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;
@@ -1682,12 +1682,12 @@  discard block
 block discarded – undo
1682 1682
 	/**
1683 1683
 	 * _send_payment_reminder
1684 1684
 	 * 	generates HTML for the View Transaction Details Admin page
1685
-	*
1685
+	 *
1686 1686
 	 * @access protected
1687
-	*	@return void
1688
-	*/
1687
+	 *	@return void
1688
+	 */
1689 1689
 	protected function _send_payment_reminder() {
1690
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1690
+		$TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1691 1691
 		$transaction = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
1692 1692
 		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID'] ) : array();
1693 1693
 		do_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction );
@@ -1709,29 +1709,29 @@  discard block
 block discarded – undo
1709 1709
 
1710 1710
 		$TXN = EEM_Transaction::instance();
1711 1711
 
1712
-	    $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' ));
1713
-	    $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' );
1712
+		$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' ));
1713
+		$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' );
1714 1714
 
1715
-	    //make sure our timestamps start and end right at the boundaries for each day
1716
-	    $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1717
-	    $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1715
+		//make sure our timestamps start and end right at the boundaries for each day
1716
+		$start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1717
+		$end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1718 1718
 
1719 1719
 
1720
-	    //convert to timestamps
1721
-	    $start_date = strtotime( $start_date );
1722
-	    $end_date = strtotime( $end_date );
1720
+		//convert to timestamps
1721
+		$start_date = strtotime( $start_date );
1722
+		$end_date = strtotime( $end_date );
1723 1723
 
1724
-	    //makes sure start date is the lowest value and vice versa
1725
-	    $start_date = min( $start_date, $end_date );
1726
-	    $end_date = max( $start_date, $end_date );
1724
+		//makes sure start date is the lowest value and vice versa
1725
+		$start_date = min( $start_date, $end_date );
1726
+		$end_date = max( $start_date, $end_date );
1727 1727
 
1728
-	    //convert to correct format for query
1728
+		//convert to correct format for query
1729 1729
 	$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' );
1730 1730
 	$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' );
1731 1731
 
1732 1732
 
1733 1733
 
1734
-	    //set orderby
1734
+		//set orderby
1735 1735
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
1736 1736
 
1737 1737
 		switch ( $this->_req_data['orderby'] ) {
Please login to merge, or discard this patch.
Spacing   +398 added lines, -398 removed lines patch added patch discarded remove patch
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
97 97
 			'buttons' => array(
98 98
 				'add' => __('Add New Transaction', 'event_espresso'),
99 99
 				'edit' => __('Edit Transaction', 'event_espresso'),
100
-				'delete' => __('Delete Transaction','event_espresso'),
100
+				'delete' => __('Delete Transaction', 'event_espresso'),
101 101
 			)
102 102
 		);
103 103
 	}
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
197 197
 				'nav' => array(
198 198
 					'label' => __('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
 block discarded – undo
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,21 +237,21 @@  discard block
 block discarded – undo
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' ] = __( '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' ] = __( '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;
251
+		EE_Registry::$i18n_js_strings['invalid_server_response'] = __('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'] = __('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 255
 	}
256 256
 	public function admin_notices() {}
257 257
 	public function admin_footer_scripts() {}
@@ -318,14 +318,14 @@  discard block
 block discarded – undo
318 318
 	 */
319 319
 	public function load_scripts_styles() {
320 320
 		//enqueue style
321
-		wp_register_style( 'espresso_txn', TXN_ASSETS_URL . 'espresso_transactions_admin.css', array(), EVENT_ESPRESSO_VERSION );
321
+		wp_register_style('espresso_txn', TXN_ASSETS_URL.'espresso_transactions_admin.css', array(), EVENT_ESPRESSO_VERSION);
322 322
 		wp_enqueue_style('espresso_txn');
323 323
 
324 324
 		//scripts
325 325
 		add_filter('FHEE_load_accounting_js', '__return_true');
326 326
 
327 327
 		//scripts
328
-		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);
328
+		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);
329 329
 		wp_enqueue_script('espresso_txn');
330 330
 
331 331
 	}
@@ -365,8 +365,8 @@  discard block
 block discarded – undo
365 365
 	 *	@return void
366 366
 	 */
367 367
 	protected function _set_list_table_views_default() {
368
-		$this->_views = array (
369
-			'all' => array (
368
+		$this->_views = array(
369
+			'all' => array(
370 370
 				'slug' 		=> 'all',
371 371
 				'label' 		=> __('View All Transactions', 'event_espresso'),
372 372
 				'count' 	=> 0
@@ -394,20 +394,20 @@  discard block
 block discarded – undo
394 394
 	 *	@return void
395 395
 	 */
396 396
 	private function _set_transaction_object() {
397
-		if ( is_object( $this->_transaction) )
397
+		if (is_object($this->_transaction))
398 398
 			return; //get out we've already set the object
399 399
 
400 400
 	    $TXN = EEM_Transaction::instance();
401 401
 
402
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
402
+	    $TXN_ID = ( ! empty($this->_req_data['TXN_ID'])) ? absint($this->_req_data['TXN_ID']) : FALSE;
403 403
 
404 404
 	    //get transaction object
405 405
 	    $this->_transaction = $TXN->get_one_by_ID($TXN_ID);
406
-	    $this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
406
+	    $this->_session = ! empty($this->_transaction) ? $this->_transaction->get('TXN_session_data') : NULL;
407 407
 
408
-	 	if ( empty( $this->_transaction ) ) {
409
-	    	$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  __(' could not be retrieved.', 'event_espresso');
410
-			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
408
+	 	if (empty($this->_transaction)) {
409
+	    	$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso').$TXN_ID.__(' could not be retrieved.', 'event_espresso');
410
+			EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
411 411
 	    }
412 412
 	}
413 413
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 				),
434 434
 				'view_receipt' => array(
435 435
 					'class' => 'dashicons dashicons-media-default',
436
-					'desc' => __('View Transaction Receipt', 'event_espresso' )
436
+					'desc' => __('View Transaction Receipt', 'event_espresso')
437 437
 				),
438 438
 				'view_registration' => array(
439 439
 					'class' => 'dashicons dashicons-clipboard',
@@ -442,9 +442,9 @@  discard block
 block discarded – undo
442 442
 			)
443 443
 		);
444 444
 
445
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_transactions_send_payment_reminder' ) ) {
445
+		if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder')) {
446 446
 
447
-			if ( EEH_MSG_Template::is_mt_active( 'payment_reminder' ) ) {
447
+			if (EEH_MSG_Template::is_mt_active('payment_reminder')) {
448 448
 				$items['send_payment_reminder'] = array(
449 449
 					'class' => 'dashicons dashicons-email-alt',
450 450
 					'desc' => __('Send Payment Reminder', 'event_espresso')
@@ -465,29 +465,29 @@  discard block
 block discarded – undo
465 465
 			'FHEE__Transactions_Admin_Page___transaction_legend_items__more_items',
466 466
 			array(
467 467
 				'overpaid'   => array(
468
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::overpaid_status_code,
469
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::overpaid_status_code, FALSE, 'sentence' )
468
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::overpaid_status_code,
469
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::overpaid_status_code, FALSE, 'sentence')
470 470
 				),
471 471
 				'complete'   => array(
472
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::complete_status_code,
473
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::complete_status_code, FALSE, 'sentence' )
472
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::complete_status_code,
473
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::complete_status_code, FALSE, 'sentence')
474 474
 				),
475 475
 				'incomplete' => array(
476
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::incomplete_status_code,
477
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::incomplete_status_code, FALSE, 'sentence' )
476
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::incomplete_status_code,
477
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::incomplete_status_code, FALSE, 'sentence')
478 478
 				),
479 479
 				'abandoned'  => array(
480
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::abandoned_status_code,
481
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::abandoned_status_code, FALSE, 'sentence' )
480
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::abandoned_status_code,
481
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::abandoned_status_code, FALSE, 'sentence')
482 482
 				),
483 483
 				'failed'     => array(
484
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::failed_status_code,
485
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::failed_status_code, FALSE, 'sentence' )
484
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::failed_status_code,
485
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::failed_status_code, FALSE, 'sentence')
486 486
 				)
487 487
 			)
488 488
 		);
489 489
 
490
-		return array_merge( $items, $more_items);
490
+		return array_merge($items, $more_items);
491 491
 	}
492 492
 
493 493
 
@@ -500,9 +500,9 @@  discard block
 block discarded – undo
500 500
 	 */
501 501
 	protected function _transactions_overview_list_table() {
502 502
 		$this->_admin_page_title = __('Transactions', 'event_espresso');
503
-		$event = isset($this->_req_data['EVT_ID']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID'] ) : NULL;
504
-		$this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf( __('%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>' ) : '';
505
-		$this->_template_args['after_list_table'] = $this->_display_legend( $this->_transaction_legend_items() );
503
+		$event = isset($this->_req_data['EVT_ID']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID']) : NULL;
504
+		$this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf(__('%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>') : '';
505
+		$this->_template_args['after_list_table'] = $this->_display_legend($this->_transaction_legend_items());
506 506
 		$this->display_admin_list_table_page_with_no_sidebar();
507 507
 	}
508 508
 
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
 	*	@return void
517 517
 	*/
518 518
 	protected function _transaction_details() {
519
-		do_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction );
519
+		do_action('AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction);
520 520
 
521 521
 		$this->_set_transaction_status_array();
522 522
 
@@ -529,14 +529,14 @@  discard block
 block discarded – undo
529 529
 		$attendee = $primary_registration instanceof EE_Registration ? $primary_registration->attendee() : NULL;
530 530
 
531 531
 		$this->_template_args['txn_nmbr']['value'] = $this->_transaction->ID();
532
-		$this->_template_args['txn_nmbr']['label'] = __( 'Transaction Number', 'event_espresso' );
532
+		$this->_template_args['txn_nmbr']['label'] = __('Transaction Number', 'event_espresso');
533 533
 
534
-		$this->_template_args['txn_datetime']['value'] = $this->_transaction->get_datetime('TXN_timestamp', 'l F j, Y', 'g:i:s a' );
535
-		$this->_template_args['txn_datetime']['label'] = __( 'Date', 'event_espresso' );
534
+		$this->_template_args['txn_datetime']['value'] = $this->_transaction->get_datetime('TXN_timestamp', 'l F j, Y', 'g:i:s a');
535
+		$this->_template_args['txn_datetime']['label'] = __('Date', 'event_espresso');
536 536
 
537
-		$this->_template_args['txn_status']['value'] = self::$_txn_status[ $this->_transaction->get('STS_ID') ];
538
-		$this->_template_args['txn_status']['label'] = __( 'Transaction Status', 'event_espresso' );
539
-		$this->_template_args['txn_status']['class'] = 'status-' . $this->_transaction->get('STS_ID');
537
+		$this->_template_args['txn_status']['value'] = self::$_txn_status[$this->_transaction->get('STS_ID')];
538
+		$this->_template_args['txn_status']['label'] = __('Transaction Status', 'event_espresso');
539
+		$this->_template_args['txn_status']['class'] = 'status-'.$this->_transaction->get('STS_ID');
540 540
 
541 541
 		$this->_template_args['grand_total'] = $this->_transaction->get('TXN_total');
542 542
 		$this->_template_args['total_paid'] = $this->_transaction->get('TXN_paid');
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 			)
550 550
 		) {
551 551
 			$this->_template_args['send_payment_reminder_button'] =
552
-				EEH_MSG_Template::is_mt_active( 'payment_reminder' )
552
+				EEH_MSG_Template::is_mt_active('payment_reminder')
553 553
 				&& $this->_transaction->get('STS_ID') != EEM_Transaction::complete_status_code
554 554
 				&& $this->_transaction->get('STS_ID') != EEM_Transaction::overpaid_status_code
555 555
 					? EEH_Template::get_button_or_link(
@@ -571,40 +571,40 @@  discard block
 block discarded – undo
571 571
 		}
572 572
 
573 573
 		$amount_due = $this->_transaction->get('TXN_total') - $this->_transaction->get('TXN_paid');
574
-		$this->_template_args['amount_due'] = EEH_Template::format_currency( $amount_due, TRUE );
575
-		if ( EE_Registry::instance()->CFG->currency->sign_b4 ) {
576
-			$this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign . $this->_template_args['amount_due'];
574
+		$this->_template_args['amount_due'] = EEH_Template::format_currency($amount_due, TRUE);
575
+		if (EE_Registry::instance()->CFG->currency->sign_b4) {
576
+			$this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign.$this->_template_args['amount_due'];
577 577
 		} else {
578
-			$this->_template_args['amount_due'] = $this->_template_args['amount_due'] . EE_Registry::instance()->CFG->currency->sign;
578
+			$this->_template_args['amount_due'] = $this->_template_args['amount_due'].EE_Registry::instance()->CFG->currency->sign;
579 579
 		}
580
-		$this->_template_args['amount_due_class'] =  '';
580
+		$this->_template_args['amount_due_class'] = '';
581 581
 
582
-		if ( $this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total') ) {
582
+		if ($this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total')) {
583 583
 			// paid in full
584
-			$this->_template_args['amount_due'] =  FALSE;
585
-		} elseif ( $this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total') ) {
584
+			$this->_template_args['amount_due'] = FALSE;
585
+		} elseif ($this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total')) {
586 586
 			// overpaid
587
-			$this->_template_args['amount_due_class'] =  'txn-overview-no-payment-spn';
588
-		} elseif (( $this->_transaction->get('TXN_total') > 0 ) && ( $this->_transaction->get('TXN_paid') > 0 )) {
587
+			$this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn';
588
+		} elseif (($this->_transaction->get('TXN_total') > 0) && ($this->_transaction->get('TXN_paid') > 0)) {
589 589
 			// monies owing
590
-			$this->_template_args['amount_due_class'] =  'txn-overview-part-payment-spn';
591
-		} elseif (( $this->_transaction->get('TXN_total') > 0 ) && ( $this->_transaction->get('TXN_paid') == 0 )) {
590
+			$this->_template_args['amount_due_class'] = 'txn-overview-part-payment-spn';
591
+		} elseif (($this->_transaction->get('TXN_total') > 0) && ($this->_transaction->get('TXN_paid') == 0)) {
592 592
 			// no payments made yet
593
-			$this->_template_args['amount_due_class'] =  'txn-overview-no-payment-spn';
594
-		} elseif ( $this->_transaction->get('TXN_total') == 0 ) {
593
+			$this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn';
594
+		} elseif ($this->_transaction->get('TXN_total') == 0) {
595 595
 			// free event
596
-			$this->_template_args['amount_due'] =  FALSE;
596
+			$this->_template_args['amount_due'] = FALSE;
597 597
 		}
598 598
 
599 599
 		$payment_method = $this->_transaction->payment_method();
600 600
 
601 601
 		$this->_template_args['method_of_payment_name'] = $payment_method instanceof EE_Payment_Method
602 602
 			? $payment_method->admin_name()
603
-			: __( 'Unknown', 'event_espresso' );
603
+			: __('Unknown', 'event_espresso');
604 604
 
605 605
 		$this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
606 606
 		// link back to overview
607
-		$this->_template_args['txn_overview_url'] = ! empty ( $_SERVER['HTTP_REFERER'] )
607
+		$this->_template_args['txn_overview_url'] = ! empty ($_SERVER['HTTP_REFERER'])
608 608
 			? $_SERVER['HTTP_REFERER']
609 609
 			: TXN_ADMIN_URL;
610 610
 
@@ -612,13 +612,13 @@  discard block
 block discarded – undo
612 612
 		// next link
613 613
 		$next_txn = $this->_transaction->next(
614 614
 			null,
615
-			array( array( 'STS_ID' => array( '!=', EEM_Transaction::failed_status_code ) ) ),
615
+			array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))),
616 616
 			'TXN_ID'
617 617
 		);
618 618
 		$this->_template_args['next_transaction'] = $next_txn
619 619
 			? $this->_next_link(
620 620
 				EE_Admin_Page::add_query_args_and_nonce(
621
-					array( 'action' => 'view_transaction', 'TXN_ID' => $next_txn['TXN_ID'] ),
621
+					array('action' => 'view_transaction', 'TXN_ID' => $next_txn['TXN_ID']),
622 622
 					TXN_ADMIN_URL
623 623
 				),
624 624
 				'dashicons dashicons-arrow-right ee-icon-size-22'
@@ -627,13 +627,13 @@  discard block
 block discarded – undo
627 627
 		// previous link
628 628
 		$previous_txn = $this->_transaction->previous(
629 629
 			null,
630
-			array( array( 'STS_ID' => array( '!=', EEM_Transaction::failed_status_code ) ) ),
630
+			array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))),
631 631
 			'TXN_ID'
632 632
 		);
633 633
 		$this->_template_args['previous_transaction'] = $previous_txn
634 634
 			? $this->_previous_link(
635 635
 				EE_Admin_Page::add_query_args_and_nonce(
636
-					array( 'action' => 'view_transaction', 'TXN_ID' => $previous_txn['TXN_ID'] ),
636
+					array('action' => 'view_transaction', 'TXN_ID' => $previous_txn['TXN_ID']),
637 637
 					TXN_ADMIN_URL
638 638
 				),
639 639
 				'dashicons dashicons-arrow-left ee-icon-size-22'
@@ -643,16 +643,16 @@  discard block
 block discarded – undo
643 643
 		// were we just redirected here after adding a new registration ???
644 644
 		if (
645 645
 			isset(
646
-				$this->_req_data[ 'redirect_from' ],
647
-				$this->_req_data[ 'EVT_ID' ],
648
-				$this->_req_data[ 'event_name' ]
646
+				$this->_req_data['redirect_from'],
647
+				$this->_req_data['EVT_ID'],
648
+				$this->_req_data['event_name']
649 649
 			)
650 650
 		) {
651 651
 			if (
652 652
 				EE_Registry::instance()->CAP->current_user_can(
653 653
 					'ee_edit_registrations',
654 654
 					'espresso_registrations_new_registration',
655
-					$this->_req_data[ 'EVT_ID' ]
655
+					$this->_req_data['EVT_ID']
656 656
 				)
657 657
 			) {
658 658
 				$this->_admin_page_title .= '<a id="add-new-registration" class="add-new-h2 button-primary" href="';
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
 						'action'   => 'new_registration',
663 663
 						'return'   => 'default',
664 664
 						'TXN_ID'   => $this->_transaction->ID(),
665
-						'event_id' => $this->_req_data[ 'EVT_ID' ],
665
+						'event_id' => $this->_req_data['EVT_ID'],
666 666
 					),
667 667
 					REG_ADMIN_URL
668 668
 				);
@@ -670,17 +670,17 @@  discard block
 block discarded – undo
670 670
 
671 671
 				$this->_admin_page_title .= sprintf(
672 672
 					__('Add Another New Registration to Event: "%1$s" ?'),
673
-					htmlentities( urldecode( $this->_req_data[ 'event_name' ] ), ENT_QUOTES, 'UTF-8' )
673
+					htmlentities(urldecode($this->_req_data['event_name']), ENT_QUOTES, 'UTF-8')
674 674
 				);
675 675
 				$this->_admin_page_title .= '</a>';
676 676
 			}
677
-			EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
677
+			EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
678 678
 		}
679 679
 		// grab messages at the last second
680 680
 		$this->_template_args['notices'] = EE_Error::get_notices();
681 681
 		// path to template
682
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_header.template.php';
683
-		$this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
682
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_header.template.php';
683
+		$this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
684 684
 
685 685
 		// the details template wrapper
686 686
 		$this->display_admin_page_with_sidebar();
@@ -699,18 +699,18 @@  discard block
 block discarded – undo
699 699
 
700 700
 		$this->_set_transaction_object();
701 701
 
702
-		add_meta_box( 'edit-txn-details-mbox', __( 'Transaction Details', 'event_espresso' ), array( $this, 'txn_details_meta_box' ), $this->_wp_page_slug, 'normal', 'high' );
702
+		add_meta_box('edit-txn-details-mbox', __('Transaction Details', 'event_espresso'), array($this, 'txn_details_meta_box'), $this->_wp_page_slug, 'normal', 'high');
703 703
 		add_meta_box(
704 704
 			'edit-txn-attendees-mbox',
705
-			__( 'Attendees Registered in this Transaction', 'event_espresso' ),
706
-			array( $this, 'txn_attendees_meta_box' ),
705
+			__('Attendees Registered in this Transaction', 'event_espresso'),
706
+			array($this, 'txn_attendees_meta_box'),
707 707
 			$this->_wp_page_slug,
708 708
 			'normal',
709 709
 			'high',
710
-			array( 'TXN_ID' => $this->_transaction->ID() )
710
+			array('TXN_ID' => $this->_transaction->ID())
711 711
 		);
712
-		add_meta_box( 'edit-txn-registrant-mbox', __( 'Primary Contact', 'event_espresso' ), array( $this, 'txn_registrant_side_meta_box' ), $this->_wp_page_slug, 'side', 'high' );
713
-		add_meta_box( 'edit-txn-billing-info-mbox', __( 'Billing Information', 'event_espresso' ), array( $this, 'txn_billing_info_side_meta_box' ), $this->_wp_page_slug, 'side', 'high' );
712
+		add_meta_box('edit-txn-registrant-mbox', __('Primary Contact', 'event_espresso'), array($this, 'txn_registrant_side_meta_box'), $this->_wp_page_slug, 'side', 'high');
713
+		add_meta_box('edit-txn-billing-info-mbox', __('Billing Information', 'event_espresso'), array($this, 'txn_billing_info_side_meta_box'), $this->_wp_page_slug, 'side', 'high');
714 714
 
715 715
 	}
716 716
 
@@ -731,15 +731,15 @@  discard block
 block discarded – undo
731 731
 
732 732
 		//get line table
733 733
 		EEH_Autoloader::register_line_item_display_autoloaders();
734
-		$Line_Item_Display = new EE_Line_Item_Display( 'admin_table', 'EE_Admin_Table_Line_Item_Display_Strategy' );
735
-		$this->_template_args['line_item_table'] = $Line_Item_Display->display_line_item( $this->_transaction->total_line_item() );
734
+		$Line_Item_Display = new EE_Line_Item_Display('admin_table', 'EE_Admin_Table_Line_Item_Display_Strategy');
735
+		$this->_template_args['line_item_table'] = $Line_Item_Display->display_line_item($this->_transaction->total_line_item());
736 736
 		$this->_template_args['REG_code'] = $this->_transaction->get_first_related('Registration')->get('REG_code');
737 737
 
738 738
 		// process taxes
739
-		$taxes = $this->_transaction->get_many_related( 'Line_Item', array( array( 'LIN_type' => EEM_Line_Item::type_tax )));
740
-		$this->_template_args['taxes'] = ! empty( $taxes ) ? $taxes : FALSE;
739
+		$taxes = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => EEM_Line_Item::type_tax)));
740
+		$this->_template_args['taxes'] = ! empty($taxes) ? $taxes : FALSE;
741 741
 
742
-		$this->_template_args['grand_total'] = EEH_Template::format_currency($this->_transaction->get('TXN_total'), FALSE, FALSE );
742
+		$this->_template_args['grand_total'] = EEH_Template::format_currency($this->_transaction->get('TXN_total'), FALSE, FALSE);
743 743
 		$this->_template_args['grand_raw_total'] = $this->_transaction->get('TXN_total');
744 744
 		$this->_template_args['TXN_status'] = $this->_transaction->get('STS_ID');
745 745
 
@@ -747,63 +747,63 @@  discard block
 block discarded – undo
747 747
 
748 748
 		// process payment details
749 749
 		$payments = $this->_transaction->get_many_related('Payment');
750
-		if( ! empty(  $payments ) ) {
751
-			$this->_template_args[ 'payments' ] = $payments;
752
-			$this->_template_args[ 'existing_reg_payments' ] = $this->_get_registration_payment_IDs( $payments );
750
+		if ( ! empty($payments)) {
751
+			$this->_template_args['payments'] = $payments;
752
+			$this->_template_args['existing_reg_payments'] = $this->_get_registration_payment_IDs($payments);
753 753
 		} else {
754
-			$this->_template_args[ 'payments' ] = false;
755
-			$this->_template_args[ 'existing_reg_payments' ] = array();
754
+			$this->_template_args['payments'] = false;
755
+			$this->_template_args['existing_reg_payments'] = array();
756 756
 		}
757 757
 
758
-		$this->_template_args['edit_payment_url'] = add_query_arg( array( 'action' => 'edit_payment'  ), TXN_ADMIN_URL );
759
-		$this->_template_args['delete_payment_url'] = add_query_arg( array( 'action' => 'espresso_delete_payment' ), TXN_ADMIN_URL );
758
+		$this->_template_args['edit_payment_url'] = add_query_arg(array('action' => 'edit_payment'), TXN_ADMIN_URL);
759
+		$this->_template_args['delete_payment_url'] = add_query_arg(array('action' => 'espresso_delete_payment'), TXN_ADMIN_URL);
760 760
 
761
-		if ( isset( $txn_details['invoice_number'] )) {
761
+		if (isset($txn_details['invoice_number'])) {
762 762
 			$this->_template_args['txn_details']['invoice_number']['value'] = $this->_template_args['REG_code'];
763
-			$this->_template_args['txn_details']['invoice_number']['label'] = __( 'Invoice Number', 'event_espresso' );
763
+			$this->_template_args['txn_details']['invoice_number']['label'] = __('Invoice Number', 'event_espresso');
764 764
 		}
765 765
 
766 766
 		$this->_template_args['txn_details']['registration_session']['value'] = $this->_transaction->get_first_related('Registration')->get('REG_session');
767
-		$this->_template_args['txn_details']['registration_session']['label'] = __( 'Registration Session', 'event_espresso' );
767
+		$this->_template_args['txn_details']['registration_session']['label'] = __('Registration Session', 'event_espresso');
768 768
 
769
-		$this->_template_args['txn_details']['ip_address']['value'] = isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '';
770
-		$this->_template_args['txn_details']['ip_address']['label'] = __( 'Transaction placed from IP', 'event_espresso' );
769
+		$this->_template_args['txn_details']['ip_address']['value'] = isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '';
770
+		$this->_template_args['txn_details']['ip_address']['label'] = __('Transaction placed from IP', 'event_espresso');
771 771
 
772
-		$this->_template_args['txn_details']['user_agent']['value'] = isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '';
773
-		$this->_template_args['txn_details']['user_agent']['label'] = __( 'Registrant User Agent', 'event_espresso' );
772
+		$this->_template_args['txn_details']['user_agent']['value'] = isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '';
773
+		$this->_template_args['txn_details']['user_agent']['label'] = __('Registrant User Agent', 'event_espresso');
774 774
 
775 775
 		$reg_steps = '<ul>';
776
-		foreach ( $this->_transaction->reg_steps() as $reg_step => $reg_step_status ) {
777
-			if ( $reg_step_status === true ) {
778
-				$reg_steps .= '<li style="color:#70cc50">' . sprintf( __( '%1$s : Completed', 'event_espresso' ), ucwords( str_replace( '_', ' ', $reg_step ) ) ) . '</li>';
779
-			} else if ( is_numeric( $reg_step_status ) && $reg_step_status !== false ) {
780
-					$reg_steps .= '<li style="color:#2EA2CC">' . sprintf(
781
-							__( '%1$s : Initiated %2$s', 'event_espresso' ),
782
-							ucwords( str_replace( '_', ' ', $reg_step ) ),
783
-							gmdate( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), ( $reg_step_status + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) )
784
-						) . '</li>';
776
+		foreach ($this->_transaction->reg_steps() as $reg_step => $reg_step_status) {
777
+			if ($reg_step_status === true) {
778
+				$reg_steps .= '<li style="color:#70cc50">'.sprintf(__('%1$s : Completed', 'event_espresso'), ucwords(str_replace('_', ' ', $reg_step))).'</li>';
779
+			} else if (is_numeric($reg_step_status) && $reg_step_status !== false) {
780
+					$reg_steps .= '<li style="color:#2EA2CC">'.sprintf(
781
+							__('%1$s : Initiated %2$s', 'event_espresso'),
782
+							ucwords(str_replace('_', ' ', $reg_step)),
783
+							gmdate(get_option('date_format').' '.get_option('time_format'), ($reg_step_status + (get_option('gmt_offset') * HOUR_IN_SECONDS)))
784
+						).'</li>';
785 785
 				} else {
786
-				$reg_steps .= '<li style="color:#E76700">' . sprintf( __( '%1$s : Never Initiated', 'event_espresso' ), ucwords( str_replace( '_', ' ', $reg_step ) ) ) . '</li>';
786
+				$reg_steps .= '<li style="color:#E76700">'.sprintf(__('%1$s : Never Initiated', 'event_espresso'), ucwords(str_replace('_', ' ', $reg_step))).'</li>';
787 787
 			}
788 788
 		}
789 789
 		$reg_steps .= '</ul>';
790 790
 		$this->_template_args['txn_details']['reg_steps']['value'] = $reg_steps;
791
-		$this->_template_args['txn_details']['reg_steps']['label'] = __( 'Registration Step Progress', 'event_espresso' );
791
+		$this->_template_args['txn_details']['reg_steps']['label'] = __('Registration Step Progress', 'event_espresso');
792 792
 
793 793
 
794 794
 		$this->_get_registrations_to_apply_payment_to();
795
-		$this->_get_payment_methods( $payments );
795
+		$this->_get_payment_methods($payments);
796 796
 		$this->_get_payment_status_array();
797 797
 		$this->_get_reg_status_selection(); //sets up the template args for the reg status array for the transaction.
798 798
 
799
-		$this->_template_args['transaction_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'transaction'  ), TXN_ADMIN_URL );
800
-		$this->_template_args['apply_payment_form_url'] = add_query_arg( array( 'page' => 'espresso_transactions', 'action' => 'espresso_apply_payment' ), WP_AJAX_URL );
801
-		$this->_template_args['delete_payment_form_url'] = add_query_arg( array( 'page' => 'espresso_transactions', 'action' => 'espresso_delete_payment' ), WP_AJAX_URL );
799
+		$this->_template_args['transaction_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'transaction'), TXN_ADMIN_URL);
800
+		$this->_template_args['apply_payment_form_url'] = add_query_arg(array('page' => 'espresso_transactions', 'action' => 'espresso_apply_payment'), WP_AJAX_URL);
801
+		$this->_template_args['delete_payment_form_url'] = add_query_arg(array('page' => 'espresso_transactions', 'action' => 'espresso_delete_payment'), WP_AJAX_URL);
802 802
 
803 803
 		// 'espresso_delete_payment_nonce'
804 804
 
805
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_main_meta_box_txn_details.template.php';
806
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
805
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_main_meta_box_txn_details.template.php';
806
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
807 807
 
808 808
 	}
809 809
 
@@ -818,27 +818,27 @@  discard block
 block discarded – undo
818 818
 	 * @param EE_Payment[] $payments
819 819
 	 * @return array
820 820
 	 */
821
-	protected function _get_registration_payment_IDs( $payments = array() ) {
821
+	protected function _get_registration_payment_IDs($payments = array()) {
822 822
 		$existing_reg_payments = array();
823 823
 		// get all reg payments for these payments
824
-		$reg_payments = EEM_Registration_Payment::instance()->get_all( array(
824
+		$reg_payments = EEM_Registration_Payment::instance()->get_all(array(
825 825
 			array(
826 826
 				'PAY_ID' => array(
827 827
 					'IN',
828
-					array_keys( $payments )
828
+					array_keys($payments)
829 829
 				)
830 830
 			)
831
-		) );
832
-		if ( ! empty( $reg_payments ) ) {
833
-			foreach ( $payments as $payment ) {
834
-				if ( ! $payment instanceof EE_Payment ) {
831
+		));
832
+		if ( ! empty($reg_payments)) {
833
+			foreach ($payments as $payment) {
834
+				if ( ! $payment instanceof EE_Payment) {
835 835
 					continue;
836
-				} else if ( ! isset( $existing_reg_payments[ $payment->ID() ] ) ) {
837
-					$existing_reg_payments[ $payment->ID() ] = array();
836
+				} else if ( ! isset($existing_reg_payments[$payment->ID()])) {
837
+					$existing_reg_payments[$payment->ID()] = array();
838 838
 				}
839
-				foreach ( $reg_payments as $reg_payment ) {
840
-					if ( $reg_payment instanceof EE_Registration_Payment && $reg_payment->payment_ID() === $payment->ID() ) {
841
-						$existing_reg_payments[ $payment->ID() ][ ] = $reg_payment->registration_ID();
839
+				foreach ($reg_payments as $reg_payment) {
840
+					if ($reg_payment instanceof EE_Registration_Payment && $reg_payment->payment_ID() === $payment->ID()) {
841
+						$existing_reg_payments[$payment->ID()][] = $reg_payment->registration_ID();
842 842
 					}
843 843
 				}
844 844
 			}
@@ -875,39 +875,39 @@  discard block
 block discarded – undo
875 875
 		$registrations_to_apply_payment_to .= '<br /><div class="admin-primary-mbox-tbl-wrap">';
876 876
 		$registrations_to_apply_payment_to .= '<table class="admin-primary-mbox-tbl">';
877 877
 		$registrations_to_apply_payment_to .= '<thead><tr>';
878
-		$registrations_to_apply_payment_to .= '<td>' . __( 'ID', 'event_espresso' ) . '</td>';
879
-		$registrations_to_apply_payment_to .= '<td>' . __( 'Registrant', 'event_espresso' ) . '</td>';
880
-		$registrations_to_apply_payment_to .= '<td>' . __( 'Ticket', 'event_espresso' ) . '</td>';
881
-		$registrations_to_apply_payment_to .= '<td>' . __( 'Event', 'event_espresso' ) . '</td>';
882
-		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-cntr">' . __( 'Paid', 'event_espresso' ) . '</td>';
883
-		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-cntr">' . __( 'Owing', 'event_espresso' ) . '</td>';
884
-		$registrations_to_apply_payment_to .= '<td class="jst-cntr">' . __( 'Apply', 'event_espresso' ) . '</td>';
878
+		$registrations_to_apply_payment_to .= '<td>'.__('ID', 'event_espresso').'</td>';
879
+		$registrations_to_apply_payment_to .= '<td>'.__('Registrant', 'event_espresso').'</td>';
880
+		$registrations_to_apply_payment_to .= '<td>'.__('Ticket', 'event_espresso').'</td>';
881
+		$registrations_to_apply_payment_to .= '<td>'.__('Event', 'event_espresso').'</td>';
882
+		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-cntr">'.__('Paid', 'event_espresso').'</td>';
883
+		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-cntr">'.__('Owing', 'event_espresso').'</td>';
884
+		$registrations_to_apply_payment_to .= '<td class="jst-cntr">'.__('Apply', 'event_espresso').'</td>';
885 885
 		$registrations_to_apply_payment_to .= '</tr></thead><tbody>';
886 886
 		// get registrations for TXN
887
-		$registrations = $this->_transaction->registrations( $query_params );
888
-		foreach ( $registrations as $registration ) {
889
-			if ( $registration instanceof EE_Registration ) {
887
+		$registrations = $this->_transaction->registrations($query_params);
888
+		foreach ($registrations as $registration) {
889
+			if ($registration instanceof EE_Registration) {
890 890
 				$owing = $registration->final_price() - $registration->paid();
891
-				$taxable = $registration->ticket()->taxable() ? ' <span class="smaller-text lt-grey-text"> ' . __( '+ tax', 'event_espresso' ) . '</span>' : '';
892
-				$checked = empty( $existing_reg_payments ) || in_array( $registration->ID(), $existing_reg_payments ) ? ' checked="checked"' : '';
893
-				$registrations_to_apply_payment_to .= '<tr id="apply-payment-registration-row-' . $registration->ID() . '">';
891
+				$taxable = $registration->ticket()->taxable() ? ' <span class="smaller-text lt-grey-text"> '.__('+ tax', 'event_espresso').'</span>' : '';
892
+				$checked = empty($existing_reg_payments) || in_array($registration->ID(), $existing_reg_payments) ? ' checked="checked"' : '';
893
+				$registrations_to_apply_payment_to .= '<tr id="apply-payment-registration-row-'.$registration->ID().'">';
894 894
 				// add html for checkbox input and label
895
-				$registrations_to_apply_payment_to .= '<td>' . $registration->ID() . '</td>';
896
-				$registrations_to_apply_payment_to .= '<td>' . $registration->attendee() instanceof EE_Attendee ? $registration->attendee()->full_name() : __( 'Unknown Attendee', 'event_espresso' ) . '</td>';
897
-				$registrations_to_apply_payment_to .= '<td>' . $registration->ticket()->name() . ' : ' . $registration->ticket()->pretty_price() . $taxable . '</td>';
898
-				$registrations_to_apply_payment_to .= '<td>' . $registration->event_name() . '</td>';
899
-				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-rght">' . $registration->pretty_paid() . '</td>';
900
-				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-rght">' . EEH_Template::format_currency( $owing ) . '</td>';
895
+				$registrations_to_apply_payment_to .= '<td>'.$registration->ID().'</td>';
896
+				$registrations_to_apply_payment_to .= '<td>'.$registration->attendee() instanceof EE_Attendee ? $registration->attendee()->full_name() : __('Unknown Attendee', 'event_espresso').'</td>';
897
+				$registrations_to_apply_payment_to .= '<td>'.$registration->ticket()->name().' : '.$registration->ticket()->pretty_price().$taxable.'</td>';
898
+				$registrations_to_apply_payment_to .= '<td>'.$registration->event_name().'</td>';
899
+				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-rght">'.$registration->pretty_paid().'</td>';
900
+				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-rght">'.EEH_Template::format_currency($owing).'</td>';
901 901
 				$registrations_to_apply_payment_to .= '<td class="jst-cntr">';
902 902
 				$disabled = $registration->final_price() > 0 ? '' : ' disabled';
903
-				$registrations_to_apply_payment_to .= '<input type="checkbox" value="' . $registration->ID() . '" name="txn_admin_payment[registrations]"' . $checked . $disabled . '>';
903
+				$registrations_to_apply_payment_to .= '<input type="checkbox" value="'.$registration->ID().'" name="txn_admin_payment[registrations]"'.$checked.$disabled.'>';
904 904
 				$registrations_to_apply_payment_to .= '</td>';
905 905
 				$registrations_to_apply_payment_to .= '</tr>';
906 906
 			}
907 907
 		}
908 908
 		$registrations_to_apply_payment_to .= '</tbody></table></div>';
909
-		$registrations_to_apply_payment_to .= '<p class="clear description">' . __( 'The payment will only be applied to the registrations that have a check mark in their corresponding check box. Checkboxes for free registrations have been disabled.', 'event_espresso' ) . '</p></div>';
910
-		$this->_template_args[ 'registrations_to_apply_payment_to' ] = $registrations_to_apply_payment_to;
909
+		$registrations_to_apply_payment_to .= '<p class="clear description">'.__('The payment will only be applied to the registrations that have a check mark in their corresponding check box. Checkboxes for free registrations have been disabled.', 'event_espresso').'</p></div>';
910
+		$this->_template_args['registrations_to_apply_payment_to'] = $registrations_to_apply_payment_to;
911 911
 	}
912 912
 
913 913
 
@@ -924,9 +924,9 @@  discard block
 block discarded – undo
924 924
 		$statuses = EEM_Registration::reg_status_array(array(), TRUE);
925 925
 		//let's add a "don't change" option.
926 926
 		$status_array['NAN'] = __('Leave the Same', 'event_espresso');
927
-		$status_array = array_merge( $status_array, $statuses );
928
-		$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' );
929
-		$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' );
927
+		$status_array = array_merge($status_array, $statuses);
928
+		$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');
929
+		$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');
930 930
 
931 931
 	}
932 932
 
@@ -941,21 +941,21 @@  discard block
 block discarded – undo
941 941
 	 * @param EE_Payment[] to show on this page
942 942
 	 *	@return void
943 943
 	 */
944
-	private function _get_payment_methods( $payments = array() ) {
944
+	private function _get_payment_methods($payments = array()) {
945 945
 		$payment_methods_of_payments = array();
946
-		foreach( $payments as $payment ){
947
-			if( $payment instanceof EE_Payment ){
948
-				$payment_methods_of_payments[] = $payment->get( 'PMD_ID' );
946
+		foreach ($payments as $payment) {
947
+			if ($payment instanceof EE_Payment) {
948
+				$payment_methods_of_payments[] = $payment->get('PMD_ID');
949 949
 			}
950 950
 		}
951
-		if( $payment_methods_of_payments ){
952
-			$query_args = array( array( 'OR*payment_method_for_payment' => array(
953
-					'PMD_ID' => array( 'IN', $payment_methods_of_payments ),
954
-					'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) ) );
955
-		}else{
956
-			$query_args = array( array( 'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) );
951
+		if ($payment_methods_of_payments) {
952
+			$query_args = array(array('OR*payment_method_for_payment' => array(
953
+					'PMD_ID' => array('IN', $payment_methods_of_payments),
954
+					'PMD_scope' => array('LIKE', '%'.EEM_Payment_Method::scope_admin.'%') )));
955
+		} else {
956
+			$query_args = array(array('PMD_scope' => array('LIKE', '%'.EEM_Payment_Method::scope_admin.'%')));
957 957
 		}
958
-		$this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all( $query_args );
958
+		$this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all($query_args);
959 959
 	}
960 960
 
961 961
 
@@ -969,46 +969,46 @@  discard block
 block discarded – undo
969 969
 	 * @param array $metabox
970 970
 	 * @return void
971 971
 	 */
972
-	public function txn_attendees_meta_box( $post, $metabox = array( 'args' => array() )) {
972
+	public function txn_attendees_meta_box($post, $metabox = array('args' => array())) {
973 973
 
974
-		extract( $metabox['args'] );
974
+		extract($metabox['args']);
975 975
 		$this->_template_args['post'] = $post;
976 976
 		$this->_template_args['event_attendees'] = array();
977 977
 		// process items in cart
978
-		$line_items = $this->_transaction->get_many_related('Line_Item', array( array( 'LIN_type' => 'line-item' ) ) );
979
-		if ( ! empty( $line_items )) {
980
-			foreach ( $line_items as $item ) {
981
-				if ( $item instanceof EE_Line_Item ) {
982
-					switch( $item->OBJ_type() ) {
978
+		$line_items = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => 'line-item')));
979
+		if ( ! empty($line_items)) {
980
+			foreach ($line_items as $item) {
981
+				if ($item instanceof EE_Line_Item) {
982
+					switch ($item->OBJ_type()) {
983 983
 
984 984
 						case 'Event' :
985 985
 							break;
986 986
 
987 987
 						case 'Ticket' :
988 988
 							$ticket = $item->ticket();
989
-							if ( empty( $ticket )) {
989
+							if (empty($ticket)) {
990 990
 								continue; //right now we're only handling tickets here.  Cause its expected that only tickets will have attendees right?
991 991
 							}
992
-							$ticket_price = EEH_Template::format_currency( $item->get( 'LIN_unit_price' ));
992
+							$ticket_price = EEH_Template::format_currency($item->get('LIN_unit_price'));
993 993
 							$event = $ticket->get_first_related('Registration')->get_first_related('Event');
994
-							$event_name = $event instanceof EE_Event ? $event->get('EVT_name') . ' - ' . $item->get('LIN_name') : '';
994
+							$event_name = $event instanceof EE_Event ? $event->get('EVT_name').' - '.$item->get('LIN_name') : '';
995 995
 
996
-							$registrations = $ticket->get_many_related('Registration', array( array('TXN_ID' => $this->_transaction->ID() )));
997
-							foreach( $registrations as $registration ) {
998
-								$this->_template_args['event_attendees'][$registration->ID()]['att_num'] 						= $registration->get('REG_count');
999
-								$this->_template_args['event_attendees'][$registration->ID()]['event_ticket_name'] 	= $event_name;
1000
-								$this->_template_args['event_attendees'][$registration->ID()]['ticket_price'] 				= $ticket_price;
996
+							$registrations = $ticket->get_many_related('Registration', array(array('TXN_ID' => $this->_transaction->ID())));
997
+							foreach ($registrations as $registration) {
998
+								$this->_template_args['event_attendees'][$registration->ID()]['att_num'] = $registration->get('REG_count');
999
+								$this->_template_args['event_attendees'][$registration->ID()]['event_ticket_name'] = $event_name;
1000
+								$this->_template_args['event_attendees'][$registration->ID()]['ticket_price'] = $ticket_price;
1001 1001
 								// attendee info
1002 1002
 								$attendee = $registration->get_first_related('Attendee');
1003
-								if ( $attendee instanceof EE_Attendee ) {
1003
+								if ($attendee instanceof EE_Attendee) {
1004 1004
 									$this->_template_args['event_attendees'][$registration->ID()]['att_id'] 			= $attendee->ID();
1005 1005
 									$this->_template_args['event_attendees'][$registration->ID()]['attendee'] 	= $attendee->full_name();
1006
-									$this->_template_args['event_attendees'][$registration->ID()]['email'] 			= '<a href="mailto:' . $attendee->email() . '?subject=' . $event->get('EVT_name') . __(' Event', 'event_espresso') . '">' . $attendee->email() . '</a>';
1007
-									$this->_template_args['event_attendees'][$registration->ID()]['address'] 		=  implode(',<br>', $attendee->full_address_as_array() );
1006
+									$this->_template_args['event_attendees'][$registration->ID()]['email'] = '<a href="mailto:'.$attendee->email().'?subject='.$event->get('EVT_name').__(' Event', 'event_espresso').'">'.$attendee->email().'</a>';
1007
+									$this->_template_args['event_attendees'][$registration->ID()]['address'] 		= implode(',<br>', $attendee->full_address_as_array());
1008 1008
 								} else {
1009 1009
 									$this->_template_args['event_attendees'][$registration->ID()]['att_id'] 			= '';
1010 1010
 									$this->_template_args['event_attendees'][$registration->ID()]['attendee'] 	= '';
1011
-									$this->_template_args['event_attendees'][$registration->ID()]['email'] 			= '';
1011
+									$this->_template_args['event_attendees'][$registration->ID()]['email'] = '';
1012 1012
 									$this->_template_args['event_attendees'][$registration->ID()]['address'] 		= '';
1013 1013
 								}
1014 1014
 							}
@@ -1018,12 +1018,12 @@  discard block
 block discarded – undo
1018 1018
 				}
1019 1019
 			}
1020 1020
 
1021
-			$this->_template_args['transaction_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'attendees'  ), TXN_ADMIN_URL );
1022
-			echo EEH_Template::display_template( TXN_TEMPLATE_PATH . 'txn_admin_details_main_meta_box_attendees.template.php', $this->_template_args, TRUE );
1021
+			$this->_template_args['transaction_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'attendees'), TXN_ADMIN_URL);
1022
+			echo EEH_Template::display_template(TXN_TEMPLATE_PATH.'txn_admin_details_main_meta_box_attendees.template.php', $this->_template_args, TRUE);
1023 1023
 
1024 1024
 		} else {
1025 1025
 			echo sprintf(
1026
-				__( '%1$sFor some reason, there are no attendees registered for this transaction. Likely the registration was abandoned in process.%2$s', 'event_espresso' ),
1026
+				__('%1$sFor some reason, there are no attendees registered for this transaction. Likely the registration was abandoned in process.%2$s', 'event_espresso'),
1027 1027
 				'<p class="important-notice">',
1028 1028
 				'</p>'
1029 1029
 			);
@@ -1042,19 +1042,19 @@  discard block
 block discarded – undo
1042 1042
 	 */
1043 1043
 	public function txn_registrant_side_meta_box() {
1044 1044
 		$primary_att = $this->_transaction->primary_registration() instanceof EE_Registration ? $this->_transaction->primary_registration()->get_first_related('Attendee') : null;
1045
-		if ( ! $primary_att instanceof EE_Attendee ) {
1045
+		if ( ! $primary_att instanceof EE_Attendee) {
1046 1046
 			$this->_template_args['no_attendee_message'] = __('There is no attached contact for this transaction.  The transaction either failed due to an error or was abandoned.', 'event_espresso');
1047 1047
 			$primary_att = EEM_Attendee::instance()->create_default_object();
1048 1048
 		}
1049
-		$this->_template_args['ATT_ID'] 						= $primary_att->ID();
1049
+		$this->_template_args['ATT_ID'] = $primary_att->ID();
1050 1050
 		$this->_template_args['prime_reg_fname']		= $primary_att->fname();
1051 1051
 		$this->_template_args['prime_reg_lname']		= $primary_att->lname();
1052
-		$this->_template_args['prime_reg_email'] 		= $primary_att->email();
1052
+		$this->_template_args['prime_reg_email'] = $primary_att->email();
1053 1053
 		$this->_template_args['prime_reg_phone'] 	= $primary_att->phone();
1054
-		$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 );
1054
+		$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);
1055 1055
 		// get formatted address for registrant
1056
-		$this->_template_args[ 'formatted_address' ] = EEH_Address::format( $primary_att );
1057
-		echo EEH_Template::display_template( TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE );
1056
+		$this->_template_args['formatted_address'] = EEH_Address::format($primary_att);
1057
+		echo EEH_Template::display_template(TXN_TEMPLATE_PATH.'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE);
1058 1058
 	}
1059 1059
 
1060 1060
 
@@ -1070,12 +1070,12 @@  discard block
 block discarded – undo
1070 1070
 
1071 1071
 		$this->_template_args['billing_form'] = $this->_transaction->billing_info();
1072 1072
 		$this->_template_args['billing_form_url'] = add_query_arg(
1073
-			array( 'action' => 'edit_transaction', 'process' => 'billing'  ),
1073
+			array('action' => 'edit_transaction', 'process' => 'billing'),
1074 1074
 			TXN_ADMIN_URL
1075 1075
 		);
1076 1076
 
1077
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_billing_info.template.php';
1078
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );/**/
1077
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_side_meta_box_billing_info.template.php';
1078
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); /**/
1079 1079
 	}
1080 1080
 
1081 1081
 
@@ -1088,42 +1088,42 @@  discard block
 block discarded – undo
1088 1088
 	*	@return void
1089 1089
 	*/
1090 1090
 	public function apply_payments_or_refunds() {
1091
-		$json_response_data = array( 'return_data' => FALSE );
1091
+		$json_response_data = array('return_data' => FALSE);
1092 1092
 		$valid_data = $this->_validate_payment_request_data();
1093
-		if ( ! empty( $valid_data ) ) {
1094
-			$PAY_ID = $valid_data[ 'PAY_ID' ];
1093
+		if ( ! empty($valid_data)) {
1094
+			$PAY_ID = $valid_data['PAY_ID'];
1095 1095
 			//save  the new payment
1096
-			$payment = $this->_create_payment_from_request_data( $valid_data );
1096
+			$payment = $this->_create_payment_from_request_data($valid_data);
1097 1097
 			// get the TXN for this payment
1098 1098
 			$transaction = $payment->transaction();
1099 1099
 			// verify transaction
1100
-			if ( $transaction instanceof EE_Transaction ) {
1100
+			if ($transaction instanceof EE_Transaction) {
1101 1101
 				// calculate_total_payments_and_update_status
1102
-				$this->_process_transaction_payments( $transaction );
1103
-				$REG_IDs = $this->_get_REG_IDs_to_apply_payment_to( $payment );
1104
-				$this->_remove_existing_registration_payments( $payment, $PAY_ID );
1102
+				$this->_process_transaction_payments($transaction);
1103
+				$REG_IDs = $this->_get_REG_IDs_to_apply_payment_to($payment);
1104
+				$this->_remove_existing_registration_payments($payment, $PAY_ID);
1105 1105
 				// apply payment to registrations (if applicable)
1106
-				if ( ! empty( $REG_IDs ) ) {
1107
-					$this->_update_registration_payments( $transaction, $payment, $REG_IDs );
1106
+				if ( ! empty($REG_IDs)) {
1107
+					$this->_update_registration_payments($transaction, $payment, $REG_IDs);
1108 1108
 					$this->_maybe_send_notifications();
1109 1109
 					// now process status changes for the same registrations
1110
-					$this->_process_registration_status_change( $transaction, $REG_IDs );
1110
+					$this->_process_registration_status_change($transaction, $REG_IDs);
1111 1111
 				}
1112
-				$this->_maybe_send_notifications( $payment );
1112
+				$this->_maybe_send_notifications($payment);
1113 1113
 				//prepare to render page
1114
-				$json_response_data[ 'return_data' ] = $this->_build_payment_json_response( $payment, $REG_IDs );
1115
-				do_action( 'AHEE__Transactions_Admin_Page__apply_payments_or_refund__after_recording', $transaction, $payment );
1114
+				$json_response_data['return_data'] = $this->_build_payment_json_response($payment, $REG_IDs);
1115
+				do_action('AHEE__Transactions_Admin_Page__apply_payments_or_refund__after_recording', $transaction, $payment);
1116 1116
 			} else {
1117 1117
 				EE_Error::add_error(
1118
-					__( 'A valid Transaction for this payment could not be retrieved.', 'event_espresso' ),
1118
+					__('A valid Transaction for this payment could not be retrieved.', 'event_espresso'),
1119 1119
 					__FILE__, __FUNCTION__, __LINE__
1120 1120
 				);
1121 1121
 			}
1122 1122
 		} else {
1123
-			EE_Error::add_error( __( 'The payment form data could not be processed. Please try again.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1123
+			EE_Error::add_error(__('The payment form data could not be processed. Please try again.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1124 1124
 		}
1125 1125
 
1126
-		$notices = EE_Error::get_notices( false, false, false );
1126
+		$notices = EE_Error::get_notices(false, false, false);
1127 1127
 		$this->_template_args = array(
1128 1128
 			'data' => $json_response_data,
1129 1129
 			'error' => $notices['errors'],
@@ -1140,30 +1140,30 @@  discard block
 block discarded – undo
1140 1140
 	 * @return array
1141 1141
 	 */
1142 1142
 	protected function _validate_payment_request_data() {
1143
-		if ( ! isset( $this->_req_data[ 'txn_admin_payment' ] ) ) {
1143
+		if ( ! isset($this->_req_data['txn_admin_payment'])) {
1144 1144
 			return false;
1145 1145
 		}
1146 1146
 		$payment_form = $this->_generate_payment_form_section();
1147 1147
 		try {
1148
-			if ( $payment_form->was_submitted() ) {
1148
+			if ($payment_form->was_submitted()) {
1149 1149
 				$payment_form->receive_form_submission();
1150
-				if ( ! $payment_form->is_valid() ) {
1150
+				if ( ! $payment_form->is_valid()) {
1151 1151
 					$submission_error_messages = array();
1152
-					foreach ( $payment_form->get_validation_errors_accumulated() as $validation_error ) {
1153
-						if ( $validation_error instanceof EE_Validation_Error ) {
1152
+					foreach ($payment_form->get_validation_errors_accumulated() as $validation_error) {
1153
+						if ($validation_error instanceof EE_Validation_Error) {
1154 1154
 							$submission_error_messages[] = sprintf(
1155
-								_x( '%s : %s', 'Form Section Name : Form Validation Error', 'event_espresso' ),
1155
+								_x('%s : %s', 'Form Section Name : Form Validation Error', 'event_espresso'),
1156 1156
 								$validation_error->get_form_section()->html_label_text(),
1157 1157
 								$validation_error->getMessage()
1158 1158
 							);
1159 1159
 						}
1160 1160
 					}
1161
-					EE_Error::add_error( join( '<br />', $submission_error_messages ), __FILE__, __FUNCTION__, __LINE__ );
1161
+					EE_Error::add_error(join('<br />', $submission_error_messages), __FILE__, __FUNCTION__, __LINE__);
1162 1162
 					return array();
1163 1163
 				}
1164 1164
 			}
1165
-		} catch ( EE_Error $e ) {
1166
-			EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__ );
1165
+		} catch (EE_Error $e) {
1166
+			EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
1167 1167
 			return array();
1168 1168
 		}
1169 1169
 		return $payment_form->valid_data();
@@ -1185,63 +1185,63 @@  discard block
 block discarded – undo
1185 1185
 						array(
1186 1186
 							'default' => 0,
1187 1187
 							'required' => false,
1188
-							'html_label_text' => __( 'Payment ID', 'event_espresso' ),
1189
-							'validation_strategies' => array( new EE_Int_Normalization() )
1188
+							'html_label_text' => __('Payment ID', 'event_espresso'),
1189
+							'validation_strategies' => array(new EE_Int_Normalization())
1190 1190
 						)
1191 1191
 					),
1192 1192
 					'TXN_ID' => new EE_Text_Input(
1193 1193
 						array(
1194 1194
 							'default' => 0,
1195 1195
 							'required' => true,
1196
-							'html_label_text' => __( 'Transaction ID', 'event_espresso' ),
1197
-							'validation_strategies' => array( new EE_Int_Normalization() )
1196
+							'html_label_text' => __('Transaction ID', 'event_espresso'),
1197
+							'validation_strategies' => array(new EE_Int_Normalization())
1198 1198
 						)
1199 1199
 					),
1200 1200
 					'type' => new EE_Text_Input(
1201 1201
 						array(
1202 1202
 							'default' => 1,
1203 1203
 							'required' => true,
1204
-							'html_label_text' => __( 'Payment or Refund', 'event_espresso' ),
1205
-							'validation_strategies' => array( new EE_Int_Normalization() )
1204
+							'html_label_text' => __('Payment or Refund', 'event_espresso'),
1205
+							'validation_strategies' => array(new EE_Int_Normalization())
1206 1206
 						)
1207 1207
 					),
1208 1208
 					'amount' => new EE_Text_Input(
1209 1209
 						array(
1210 1210
 							'default' => 0,
1211 1211
 							'required' => true,
1212
-							'html_label_text' => __( 'Payment amount', 'event_espresso' ),
1213
-							'validation_strategies' => array( new EE_Float_Normalization() )
1212
+							'html_label_text' => __('Payment amount', 'event_espresso'),
1213
+							'validation_strategies' => array(new EE_Float_Normalization())
1214 1214
 						)
1215 1215
 					),
1216 1216
 					'status' => new EE_Text_Input(
1217 1217
 						array(
1218 1218
 							'default' => EEM_Payment::status_id_approved,
1219 1219
 							'required' => true,
1220
-							'html_label_text' => __( 'Payment status', 'event_espresso' ),
1220
+							'html_label_text' => __('Payment status', 'event_espresso'),
1221 1221
 						)
1222 1222
 					),
1223 1223
 					'PMD_ID' => new EE_Text_Input(
1224 1224
 						array(
1225 1225
 							'default' => 2,
1226 1226
 							'required' => true,
1227
-							'html_label_text' => __( 'Payment Method', 'event_espresso' ),
1228
-							'validation_strategies' => array( new EE_Int_Normalization() )
1227
+							'html_label_text' => __('Payment Method', 'event_espresso'),
1228
+							'validation_strategies' => array(new EE_Int_Normalization())
1229 1229
 						)
1230 1230
 					),
1231 1231
 					'date' => new EE_Text_Input(
1232 1232
 						array(
1233 1233
 							'default' => time(),
1234 1234
 							'required' => true,
1235
-							'html_label_text' => __( 'Payment date', 'event_espresso' ),
1235
+							'html_label_text' => __('Payment date', 'event_espresso'),
1236 1236
 						)
1237 1237
 					),
1238 1238
 					'txn_id_chq_nmbr' => new EE_Text_Input(
1239 1239
 						array(
1240 1240
 							'default' => '',
1241 1241
 							'required' => false,
1242
-							'html_label_text' => __( 'Transaction or Cheque Number', 'event_espresso' ),
1242
+							'html_label_text' => __('Transaction or Cheque Number', 'event_espresso'),
1243 1243
                                                         'validation_strategies' => array(
1244
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1244
+                                                            new EE_Max_Length_Validation_Strategy(__('Input too long', 'event_espresso'), 100),
1245 1245
                                                         )
1246 1246
 						)
1247 1247
 					),
@@ -1249,9 +1249,9 @@  discard block
 block discarded – undo
1249 1249
 						array(
1250 1250
 							'default' => '',
1251 1251
 							'required' => false,
1252
-							'html_label_text' => __( 'Purchase Order Number', 'event_espresso' ),
1252
+							'html_label_text' => __('Purchase Order Number', 'event_espresso'),
1253 1253
                                                         'validation_strategies' => array(
1254
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1254
+                                                            new EE_Max_Length_Validation_Strategy(__('Input too long', 'event_espresso'), 100),
1255 1255
                                                         )
1256 1256
 						)
1257 1257
 					),
@@ -1259,9 +1259,9 @@  discard block
 block discarded – undo
1259 1259
 						array(
1260 1260
 							'default' => '',
1261 1261
 							'required' => false,
1262
-							'html_label_text' => __( 'Extra Field for Accounting', 'event_espresso' ),
1262
+							'html_label_text' => __('Extra Field for Accounting', 'event_espresso'),
1263 1263
                                                         'validation_strategies' => array(
1264
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1264
+                                                            new EE_Max_Length_Validation_Strategy(__('Input too long', 'event_espresso'), 100),
1265 1265
                                                         )
1266 1266
 						)
1267 1267
 					),
@@ -1278,37 +1278,37 @@  discard block
 block discarded – undo
1278 1278
 	 * @param array $valid_data
1279 1279
 	 * @return EE_Payment
1280 1280
 	 */
1281
-	protected function _create_payment_from_request_data( $valid_data ) {
1282
-		$PAY_ID = $valid_data[ 'PAY_ID' ];
1281
+	protected function _create_payment_from_request_data($valid_data) {
1282
+		$PAY_ID = $valid_data['PAY_ID'];
1283 1283
 		// get payment amount
1284
-		$amount = $valid_data[ 'amount' ] ? abs( $valid_data[ 'amount' ] ) : 0;
1284
+		$amount = $valid_data['amount'] ? abs($valid_data['amount']) : 0;
1285 1285
 		// payments have a type value of 1 and refunds have a type value of -1
1286 1286
 		// so multiplying amount by type will give a positive value for payments, and negative values for refunds
1287
-		$amount = $valid_data[ 'type' ] < 0 ? $amount * -1 : $amount;
1287
+		$amount = $valid_data['type'] < 0 ? $amount * -1 : $amount;
1288 1288
 		// for some reason the date string coming in has extra spaces between the date and time.  This fixes that.
1289
-		$date = $valid_data['date'] ? preg_replace( '/\s+/', ' ', $valid_data['date'] ) : date( 'Y-m-d g:i a', current_time( 'timestamp' ) );
1289
+		$date = $valid_data['date'] ? preg_replace('/\s+/', ' ', $valid_data['date']) : date('Y-m-d g:i a', current_time('timestamp'));
1290 1290
 		$payment = EE_Payment::new_instance(
1291 1291
 			array(
1292
-				'TXN_ID' 								=> $valid_data[ 'TXN_ID' ],
1293
-				'STS_ID' 								=> $valid_data[ 'status' ],
1292
+				'TXN_ID' 								=> $valid_data['TXN_ID'],
1293
+				'STS_ID' 								=> $valid_data['status'],
1294 1294
 				'PAY_timestamp' 				=> $date,
1295 1295
 				'PAY_source'           			=> EEM_Payment_Method::scope_admin,
1296
-				'PMD_ID'               				=> $valid_data[ 'PMD_ID' ],
1296
+				'PMD_ID'               				=> $valid_data['PMD_ID'],
1297 1297
 				'PAY_amount'           			=> $amount,
1298
-				'PAY_txn_id_chq_nmbr'  	=> $valid_data[ 'txn_id_chq_nmbr' ],
1299
-				'PAY_po_number'        		=> $valid_data[ 'po_number' ],
1300
-				'PAY_extra_accntng'    		=> $valid_data[ 'accounting' ],
1298
+				'PAY_txn_id_chq_nmbr'  	=> $valid_data['txn_id_chq_nmbr'],
1299
+				'PAY_po_number'        		=> $valid_data['po_number'],
1300
+				'PAY_extra_accntng'    		=> $valid_data['accounting'],
1301 1301
 				'PAY_details'          				=> $valid_data,
1302 1302
 				'PAY_ID'               				=> $PAY_ID
1303 1303
 			),
1304 1304
 			'',
1305
-			array( 'Y-m-d', 'g:i a' )
1305
+			array('Y-m-d', 'g:i a')
1306 1306
 		);
1307 1307
 
1308
-		if ( ! $payment->save() ) {
1308
+		if ( ! $payment->save()) {
1309 1309
 			EE_Error::add_error(
1310 1310
 				sprintf(
1311
-					__( 'Payment %1$d has not been successfully saved to the database.', 'event_espresso' ),
1311
+					__('Payment %1$d has not been successfully saved to the database.', 'event_espresso'),
1312 1312
 					$payment->ID()
1313 1313
 				),
1314 1314
 				__FILE__, __FUNCTION__, __LINE__
@@ -1325,15 +1325,15 @@  discard block
 block discarded – undo
1325 1325
 	 * @param \EE_Transaction $transaction
1326 1326
 	 * @return array
1327 1327
 	 */
1328
-	protected function _process_transaction_payments( EE_Transaction $transaction ) {
1328
+	protected function _process_transaction_payments(EE_Transaction $transaction) {
1329 1329
 		/** @type EE_Transaction_Payments $transaction_payments */
1330
-		$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1330
+		$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1331 1331
 		//update the transaction with this payment
1332
-		if ( $transaction_payments->calculate_total_payments_and_update_status( $transaction ) ) {
1333
-			EE_Error::add_success( __( 'The payment has been processed successfully.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1332
+		if ($transaction_payments->calculate_total_payments_and_update_status($transaction)) {
1333
+			EE_Error::add_success(__('The payment has been processed successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1334 1334
 		} else {
1335 1335
 			EE_Error::add_error(
1336
-				__( 'The payment was processed successfully but the amount paid for the transaction was not updated.', 'event_espresso' )
1336
+				__('The payment was processed successfully but the amount paid for the transaction was not updated.', 'event_espresso')
1337 1337
 				, __FILE__, __FUNCTION__, __LINE__
1338 1338
 			);
1339 1339
 		}
@@ -1349,19 +1349,19 @@  discard block
 block discarded – undo
1349 1349
 	 * @param \EE_Payment $payment
1350 1350
 	 * @return array
1351 1351
 	 */
1352
-	protected function _get_REG_IDs_to_apply_payment_to( EE_Payment $payment ) {
1352
+	protected function _get_REG_IDs_to_apply_payment_to(EE_Payment $payment) {
1353 1353
 		$REG_IDs = array();
1354 1354
 		// grab array of IDs for specific registrations to apply changes to
1355
-		if ( isset( $this->_req_data[ 'txn_admin_payment' ][ 'registrations' ] ) ) {
1356
-			$REG_IDs = (array)$this->_req_data[ 'txn_admin_payment' ][ 'registrations' ];
1355
+		if (isset($this->_req_data['txn_admin_payment']['registrations'])) {
1356
+			$REG_IDs = (array) $this->_req_data['txn_admin_payment']['registrations'];
1357 1357
 		}
1358 1358
 		//nothing specified ? then get all reg IDs
1359
-		if ( empty( $REG_IDs ) ) {
1359
+		if (empty($REG_IDs)) {
1360 1360
 			$registrations = $payment->transaction()->registrations();
1361
-			$REG_IDs = ! empty( $registrations ) ? array_keys( $registrations ) : $this->_get_existing_reg_payment_REG_IDs( $payment );
1361
+			$REG_IDs = ! empty($registrations) ? array_keys($registrations) : $this->_get_existing_reg_payment_REG_IDs($payment);
1362 1362
 		}
1363 1363
 		// ensure that REG_IDs are integers and NOT strings
1364
-		return array_map( 'intval', $REG_IDs );
1364
+		return array_map('intval', $REG_IDs);
1365 1365
 	}
1366 1366
 
1367 1367
 
@@ -1378,7 +1378,7 @@  discard block
 block discarded – undo
1378 1378
 	/**
1379 1379
 	 * @param array $existing_reg_payment_REG_IDs
1380 1380
 	 */
1381
-	public function set_existing_reg_payment_REG_IDs( $existing_reg_payment_REG_IDs = null ) {
1381
+	public function set_existing_reg_payment_REG_IDs($existing_reg_payment_REG_IDs = null) {
1382 1382
 		$this->_existing_reg_payment_REG_IDs = $existing_reg_payment_REG_IDs;
1383 1383
 	}
1384 1384
 
@@ -1393,13 +1393,13 @@  discard block
 block discarded – undo
1393 1393
 	 * @param \EE_Payment $payment
1394 1394
 	 * @return array
1395 1395
 	 */
1396
-	protected function _get_existing_reg_payment_REG_IDs( EE_Payment $payment ) {
1397
-		if ( $this->existing_reg_payment_REG_IDs() === null ) {
1396
+	protected function _get_existing_reg_payment_REG_IDs(EE_Payment $payment) {
1397
+		if ($this->existing_reg_payment_REG_IDs() === null) {
1398 1398
 			// let's get any existing reg payment records for this payment
1399
-			$existing_reg_payment_REG_IDs = $payment->get_many_related( 'Registration' );
1399
+			$existing_reg_payment_REG_IDs = $payment->get_many_related('Registration');
1400 1400
 			// but we only want the REG IDs, so grab the array keys
1401
-			$existing_reg_payment_REG_IDs = ! empty( $existing_reg_payment_REG_IDs ) ? array_keys( $existing_reg_payment_REG_IDs ) : array();
1402
-			$this->set_existing_reg_payment_REG_IDs( $existing_reg_payment_REG_IDs );
1401
+			$existing_reg_payment_REG_IDs = ! empty($existing_reg_payment_REG_IDs) ? array_keys($existing_reg_payment_REG_IDs) : array();
1402
+			$this->set_existing_reg_payment_REG_IDs($existing_reg_payment_REG_IDs);
1403 1403
 		}
1404 1404
 		return $this->existing_reg_payment_REG_IDs();
1405 1405
 	}
@@ -1418,23 +1418,23 @@  discard block
 block discarded – undo
1418 1418
 	 * @param int         $PAY_ID
1419 1419
 	 * @return bool;
1420 1420
 	 */
1421
-	protected function _remove_existing_registration_payments( EE_Payment $payment, $PAY_ID = 0 ) {
1421
+	protected function _remove_existing_registration_payments(EE_Payment $payment, $PAY_ID = 0) {
1422 1422
 		// newly created payments will have nothing recorded for $PAY_ID
1423
-		if ( $PAY_ID == 0 ) {
1423
+		if ($PAY_ID == 0) {
1424 1424
 			return false;
1425 1425
 		}
1426
-		$existing_reg_payment_REG_IDs = $this->_get_existing_reg_payment_REG_IDs( $payment );
1427
-		if ( empty( $existing_reg_payment_REG_IDs )) {
1426
+		$existing_reg_payment_REG_IDs = $this->_get_existing_reg_payment_REG_IDs($payment);
1427
+		if (empty($existing_reg_payment_REG_IDs)) {
1428 1428
 			return false;
1429 1429
 		}
1430 1430
 		/** @type EE_Transaction_Payments $transaction_payments */
1431
-		$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1431
+		$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1432 1432
 		return $transaction_payments->delete_registration_payments_and_update_registrations(
1433 1433
 			$payment,
1434 1434
 			array(
1435 1435
 				array(
1436 1436
 					'PAY_ID' => $payment->ID(),
1437
-					'REG_ID' => array( 'IN', $existing_reg_payment_REG_IDs ),
1437
+					'REG_ID' => array('IN', $existing_reg_payment_REG_IDs),
1438 1438
 				)
1439 1439
 			)
1440 1440
 		);
@@ -1453,25 +1453,25 @@  discard block
 block discarded – undo
1453 1453
 	 * @param array $REG_IDs
1454 1454
 	 * @return bool
1455 1455
 	 */
1456
-	protected function _update_registration_payments( EE_Transaction $transaction, EE_Payment $payment, $REG_IDs = array() ) {
1456
+	protected function _update_registration_payments(EE_Transaction $transaction, EE_Payment $payment, $REG_IDs = array()) {
1457 1457
 		// we can pass our own custom set of registrations to EE_Payment_Processor::process_registration_payments()
1458 1458
 		// so let's do that using our set of REG_IDs from the form
1459 1459
 		$registration_query_where_params = array(
1460
-			'REG_ID' => array( 'IN', $REG_IDs )
1460
+			'REG_ID' => array('IN', $REG_IDs)
1461 1461
 		);
1462 1462
 		// but add in some conditions regarding payment,
1463 1463
 		// so that we don't apply payments to registrations that are free or have already been paid for
1464 1464
 		// but ONLY if the payment is NOT a refund ( ie: the payment amount is not negative )
1465
-		if ( ! $payment->is_a_refund() ) {
1466
-			$registration_query_where_params[ 'REG_final_price' ]  = array( '!=', 0 );
1467
-			$registration_query_where_params[ 'REG_final_price*' ]  = array( '!=', 'REG_paid', true );
1465
+		if ( ! $payment->is_a_refund()) {
1466
+			$registration_query_where_params['REG_final_price'] = array('!=', 0);
1467
+			$registration_query_where_params['REG_final_price*'] = array('!=', 'REG_paid', true);
1468 1468
 		}
1469 1469
 		//EEH_Debug_Tools::printr( $registration_query_where_params, '$registration_query_where_params', __FILE__, __LINE__ );
1470
-		$registrations = $transaction->registrations( array( $registration_query_where_params ) );
1471
-		if ( ! empty( $registrations ) ) {
1470
+		$registrations = $transaction->registrations(array($registration_query_where_params));
1471
+		if ( ! empty($registrations)) {
1472 1472
 			/** @type EE_Payment_Processor $payment_processor */
1473
-			$payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' );
1474
-			$payment_processor->process_registration_payments( $transaction, $payment, $registrations );
1473
+			$payment_processor = EE_Registry::instance()->load_core('Payment_Processor');
1474
+			$payment_processor->process_registration_payments($transaction, $payment, $registrations);
1475 1475
 		}
1476 1476
 	}
1477 1477
 
@@ -1487,22 +1487,22 @@  discard block
 block discarded – undo
1487 1487
 	 * @param array $REG_IDs
1488 1488
 	 * @return bool
1489 1489
 	 */
1490
-	protected function _process_registration_status_change( EE_Transaction $transaction, $REG_IDs = array() ) {
1490
+	protected function _process_registration_status_change(EE_Transaction $transaction, $REG_IDs = array()) {
1491 1491
 		// first if there is no change in status then we get out.
1492 1492
 		if (
1493
-			! isset( $this->_req_data['txn_reg_status_change'], $this->_req_data[ 'txn_reg_status_change' ][ 'reg_status' ] )
1493
+			! isset($this->_req_data['txn_reg_status_change'], $this->_req_data['txn_reg_status_change']['reg_status'])
1494 1494
 			|| $this->_req_data['txn_reg_status_change']['reg_status'] == 'NAN'
1495 1495
 		) {
1496 1496
 			//no error message, no change requested, just nothing to do man.
1497 1497
 			return FALSE;
1498 1498
 		}
1499 1499
 		/** @type EE_Transaction_Processor $transaction_processor */
1500
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1500
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1501 1501
 		// made it here dude?  Oh WOW.  K, let's take care of changing the statuses
1502 1502
 		return $transaction_processor->manually_update_registration_statuses(
1503 1503
 			$transaction,
1504
-			sanitize_text_field( $this->_req_data[ 'txn_reg_status_change' ][ 'reg_status' ] ),
1505
-			array( array( 'REG_ID' => array( 'IN', $REG_IDs ) ) )
1504
+			sanitize_text_field($this->_req_data['txn_reg_status_change']['reg_status']),
1505
+			array(array('REG_ID' => array('IN', $REG_IDs)))
1506 1506
 		);
1507 1507
 	}
1508 1508
 
@@ -1517,16 +1517,16 @@  discard block
 block discarded – undo
1517 1517
 	 * @param bool | null        $delete_txn_reg_status_change
1518 1518
 	 * @return array
1519 1519
 	 */
1520
-	protected function _build_payment_json_response( EE_Payment $payment, $REG_IDs = array(), $delete_txn_reg_status_change = null ) {
1520
+	protected function _build_payment_json_response(EE_Payment $payment, $REG_IDs = array(), $delete_txn_reg_status_change = null) {
1521 1521
 		// was the payment deleted ?
1522
-		if ( is_bool( $delete_txn_reg_status_change )) {
1522
+		if (is_bool($delete_txn_reg_status_change)) {
1523 1523
 			return array(
1524 1524
 				'PAY_ID' 				=> $payment->ID(),
1525 1525
 				'amount' 			=> $payment->amount(),
1526 1526
 				'total_paid' 			=> $payment->transaction()->paid(),
1527 1527
 				'txn_status' 			=> $payment->transaction()->status_ID(),
1528 1528
 				'pay_status' 		=> $payment->STS_ID(),
1529
-				'registrations' 	=> $this->_registration_payment_data_array( $REG_IDs ),
1529
+				'registrations' 	=> $this->_registration_payment_data_array($REG_IDs),
1530 1530
 				'delete_txn_reg_status_change' => $delete_txn_reg_status_change,
1531 1531
 			);
1532 1532
 		} else {
@@ -1538,16 +1538,16 @@  discard block
 block discarded – undo
1538 1538
 				'pay_status' 	=> $payment->STS_ID(),
1539 1539
 				'PAY_ID'           => $payment->ID(),
1540 1540
 				'STS_ID' 			=> $payment->STS_ID(),
1541
-				'status' 			=> self::$_pay_status[ $payment->STS_ID() ],
1542
-				'date' 				=> $payment->timestamp( 'Y-m-d', 'h:i a' ),
1543
-				'method' 		=> strtoupper( $payment->source() ),
1541
+				'status' 			=> self::$_pay_status[$payment->STS_ID()],
1542
+				'date' 				=> $payment->timestamp('Y-m-d', 'h:i a'),
1543
+				'method' 		=> strtoupper($payment->source()),
1544 1544
 				'PM_ID' 			=> $payment->payment_method() ? $payment->payment_method()->ID() : 1,
1545
-				'gateway' 		=> $payment->payment_method() ? $payment->payment_method()->admin_name() : __( "Unknown", 'event_espresso' ),
1545
+				'gateway' 		=> $payment->payment_method() ? $payment->payment_method()->admin_name() : __("Unknown", 'event_espresso'),
1546 1546
 				'gateway_response' 	=> $payment->gateway_response(),
1547 1547
 				'txn_id_chq_nmbr'  	=> $payment->txn_id_chq_nmbr(),
1548 1548
 				'po_number'        		=> $payment->po_number(),
1549 1549
 				'extra_accntng'    		=> $payment->extra_accntng(),
1550
-				'registrations'    			=> $this->_registration_payment_data_array( $REG_IDs ),
1550
+				'registrations'    			=> $this->_registration_payment_data_array($REG_IDs),
1551 1551
 			);
1552 1552
 		}
1553 1553
 	}
@@ -1562,39 +1562,39 @@  discard block
 block discarded – undo
1562 1562
 	*	@return void
1563 1563
 	*/
1564 1564
 	public function delete_payment() {
1565
-		$json_response_data = array( 'return_data' => FALSE );
1566
-		$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;
1567
-		if ( $PAY_ID ) {
1568
-			$delete_txn_reg_status_change = isset( $this->_req_data[ 'delete_txn_reg_status_change' ] ) ? $this->_req_data[ 'delete_txn_reg_status_change' ] : false;
1569
-			$payment = EEM_Payment::instance()->get_one_by_ID( $PAY_ID );
1570
-			if ( $payment instanceof EE_Payment ) {
1571
-				$REG_IDs = $this->_get_existing_reg_payment_REG_IDs( $payment );
1565
+		$json_response_data = array('return_data' => FALSE);
1566
+		$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;
1567
+		if ($PAY_ID) {
1568
+			$delete_txn_reg_status_change = isset($this->_req_data['delete_txn_reg_status_change']) ? $this->_req_data['delete_txn_reg_status_change'] : false;
1569
+			$payment = EEM_Payment::instance()->get_one_by_ID($PAY_ID);
1570
+			if ($payment instanceof EE_Payment) {
1571
+				$REG_IDs = $this->_get_existing_reg_payment_REG_IDs($payment);
1572 1572
 				/** @type EE_Transaction_Payments $transaction_payments */
1573
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1574
-				if ( $transaction_payments->delete_payment_and_update_transaction( $payment )) {
1575
-					$json_response_data['return_data'] = $this->_build_payment_json_response( $payment, $REG_IDs, $delete_txn_reg_status_change );
1576
-					if ( $delete_txn_reg_status_change ) {
1573
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1574
+				if ($transaction_payments->delete_payment_and_update_transaction($payment)) {
1575
+					$json_response_data['return_data'] = $this->_build_payment_json_response($payment, $REG_IDs, $delete_txn_reg_status_change);
1576
+					if ($delete_txn_reg_status_change) {
1577 1577
 						$this->_req_data['txn_reg_status_change'] = $delete_txn_reg_status_change;
1578 1578
 						//MAKE sure we also add the delete_txn_req_status_change to the
1579 1579
 						//$_REQUEST global because that's how messages will be looking for it.
1580 1580
 						$_REQUEST['txn_reg_status_change'] = $delete_txn_reg_status_change;
1581 1581
 						$this->_maybe_send_notifications();
1582
-						$this->_process_registration_status_change( $payment->transaction(), $REG_IDs );
1582
+						$this->_process_registration_status_change($payment->transaction(), $REG_IDs);
1583 1583
 					}
1584 1584
 				}
1585 1585
 			} else {
1586 1586
 				EE_Error::add_error(
1587
-					__( 'Valid Payment data could not be retrieved from the database.', 'event_espresso' ),
1587
+					__('Valid Payment data could not be retrieved from the database.', 'event_espresso'),
1588 1588
 					__FILE__, __FUNCTION__, __LINE__
1589 1589
 				);
1590 1590
 			}
1591 1591
 		} else {
1592 1592
 			EE_Error::add_error(
1593
-				__( 'A valid Payment ID was not received, therefore payment form data could not be loaded.', 'event_espresso' ),
1593
+				__('A valid Payment ID was not received, therefore payment form data could not be loaded.', 'event_espresso'),
1594 1594
 				__FILE__, __FUNCTION__, __LINE__
1595 1595
 			);
1596 1596
 		}
1597
-		$notices = EE_Error::get_notices( false, false, false);
1597
+		$notices = EE_Error::get_notices(false, false, false);
1598 1598
 		$this->_template_args = array(
1599 1599
 			'data' => $json_response_data,
1600 1600
 			'success' => $notices['success'],
@@ -1614,16 +1614,16 @@  discard block
 block discarded – undo
1614 1614
 	 * @param array $REG_IDs
1615 1615
 	 * @return array
1616 1616
 	 */
1617
-	protected function _registration_payment_data_array( $REG_IDs ) {
1617
+	protected function _registration_payment_data_array($REG_IDs) {
1618 1618
 		$registration_payment_data = array();
1619 1619
 		//if non empty reg_ids lets get an array of registrations and update the values for the apply_payment/refund rows.
1620
-		if ( ! empty( $REG_IDs ) ) {
1621
-			$registrations = EEM_Registration::instance()->get_all( array( array( 'REG_ID' => array( 'IN', $REG_IDs ) ) ) );
1622
-			foreach ( $registrations as $registration ) {
1623
-				if ( $registration instanceof EE_Registration ) {
1624
-					$registration_payment_data[ $registration->ID() ] = array(
1620
+		if ( ! empty($REG_IDs)) {
1621
+			$registrations = EEM_Registration::instance()->get_all(array(array('REG_ID' => array('IN', $REG_IDs))));
1622
+			foreach ($registrations as $registration) {
1623
+				if ($registration instanceof EE_Registration) {
1624
+					$registration_payment_data[$registration->ID()] = array(
1625 1625
 						'paid' => $registration->pretty_paid(),
1626
-						'owing' => EEH_Template::format_currency( $registration->final_price() - $registration->paid() ),
1626
+						'owing' => EEH_Template::format_currency($registration->final_price() - $registration->paid()),
1627 1627
 					);
1628 1628
 				}
1629 1629
 			}
@@ -1643,30 +1643,30 @@  discard block
 block discarded – undo
1643 1643
 	 * @access protected
1644 1644
 	 * @param \EE_Payment | null $payment
1645 1645
 	 */
1646
-	protected function _maybe_send_notifications( $payment = null ) {
1647
-		switch ( $payment instanceof EE_Payment ) {
1646
+	protected function _maybe_send_notifications($payment = null) {
1647
+		switch ($payment instanceof EE_Payment) {
1648 1648
 			// payment notifications
1649 1649
 			case true :
1650 1650
 				if (
1651 1651
 					isset(
1652
-						$this->_req_data[ 'txn_payments' ],
1653
-						$this->_req_data[ 'txn_payments' ][ 'send_notifications' ]
1652
+						$this->_req_data['txn_payments'],
1653
+						$this->_req_data['txn_payments']['send_notifications']
1654 1654
 					) &&
1655
-					filter_var( $this->_req_data[ 'txn_payments' ][ 'send_notifications' ], FILTER_VALIDATE_BOOLEAN )
1655
+					filter_var($this->_req_data['txn_payments']['send_notifications'], FILTER_VALIDATE_BOOLEAN)
1656 1656
 				) {
1657
-					$this->_process_payment_notification( $payment );
1657
+					$this->_process_payment_notification($payment);
1658 1658
 				}
1659 1659
 				break;
1660 1660
 			// registration notifications
1661 1661
 			case false :
1662 1662
 				if (
1663 1663
 					isset(
1664
-						$this->_req_data[ 'txn_reg_status_change' ],
1665
-						$this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ]
1664
+						$this->_req_data['txn_reg_status_change'],
1665
+						$this->_req_data['txn_reg_status_change']['send_notifications']
1666 1666
 					) &&
1667
-					filter_var( $this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ], FILTER_VALIDATE_BOOLEAN )
1667
+					filter_var($this->_req_data['txn_reg_status_change']['send_notifications'], FILTER_VALIDATE_BOOLEAN)
1668 1668
 				) {
1669
-					add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true' );
1669
+					add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true');
1670 1670
 				}
1671 1671
 				break;
1672 1672
 		}
@@ -1682,11 +1682,11 @@  discard block
 block discarded – undo
1682 1682
 	*	@return void
1683 1683
 	*/
1684 1684
 	protected function _send_payment_reminder() {
1685
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1686
-		$transaction = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
1687
-		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID'] ) : array();
1688
-		do_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction );
1689
-		$this->_redirect_after_action( FALSE, __('payment reminder', 'event_espresso'), __('sent', 'event_espresso'), $query_args, TRUE );
1685
+	    $TXN_ID = ( ! empty($this->_req_data['TXN_ID'])) ? absint($this->_req_data['TXN_ID']) : FALSE;
1686
+		$transaction = EEM_Transaction::instance()->get_one_by_ID($TXN_ID);
1687
+		$query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID']) : array();
1688
+		do_action('AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction);
1689
+		$this->_redirect_after_action(FALSE, __('payment reminder', 'event_espresso'), __('sent', 'event_espresso'), $query_args, TRUE);
1690 1690
 	}
1691 1691
 
1692 1692
 
@@ -1700,36 +1700,36 @@  discard block
 block discarded – undo
1700 1700
 	 * @param string   $view
1701 1701
 	 * @return mixed int = count || array of transaction objects
1702 1702
 	 */
1703
-	public function get_transactions( $perpage, $count = FALSE, $view = '' ) {
1703
+	public function get_transactions($perpage, $count = FALSE, $view = '') {
1704 1704
 
1705 1705
 		$TXN = EEM_Transaction::instance();
1706 1706
 
1707
-	    $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' ));
1708
-	    $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' );
1707
+	    $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'));
1708
+	    $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');
1709 1709
 
1710 1710
 	    //make sure our timestamps start and end right at the boundaries for each day
1711
-	    $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1712
-	    $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1711
+	    $start_date = date('Y-m-d', strtotime($start_date)).' 00:00:00';
1712
+	    $end_date = date('Y-m-d', strtotime($end_date)).' 23:59:59';
1713 1713
 
1714 1714
 
1715 1715
 	    //convert to timestamps
1716
-	    $start_date = strtotime( $start_date );
1717
-	    $end_date = strtotime( $end_date );
1716
+	    $start_date = strtotime($start_date);
1717
+	    $end_date = strtotime($end_date);
1718 1718
 
1719 1719
 	    //makes sure start date is the lowest value and vice versa
1720
-	    $start_date = min( $start_date, $end_date );
1721
-	    $end_date = max( $start_date, $end_date );
1720
+	    $start_date = min($start_date, $end_date);
1721
+	    $end_date = max($start_date, $end_date);
1722 1722
 
1723 1723
 	    //convert to correct format for query
1724
-	$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' );
1725
-	$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' );
1724
+	$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');
1725
+	$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');
1726 1726
 
1727 1727
 
1728 1728
 
1729 1729
 	    //set orderby
1730 1730
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
1731 1731
 
1732
-		switch ( $this->_req_data['orderby'] ) {
1732
+		switch ($this->_req_data['orderby']) {
1733 1733
 			case 'TXN_ID':
1734 1734
 				$orderby = 'TXN_ID';
1735 1735
 				break;
@@ -1743,66 +1743,66 @@  discard block
 block discarded – undo
1743 1743
 				$orderby = 'TXN_timestamp';
1744 1744
 		}
1745 1745
 
1746
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC';
1747
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
1748
-		$per_page = isset( $perpage ) && !empty( $perpage ) ? $perpage : 10;
1749
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
1746
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC';
1747
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
1748
+		$per_page = isset($perpage) && ! empty($perpage) ? $perpage : 10;
1749
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
1750 1750
 
1751
-		$offset = ($current_page-1)*$per_page;
1752
-		$limit = array( $offset, $per_page );
1751
+		$offset = ($current_page - 1) * $per_page;
1752
+		$limit = array($offset, $per_page);
1753 1753
 
1754 1754
 		$_where = array(
1755
-			'TXN_timestamp' => array('BETWEEN', array($start_date, $end_date) ),
1755
+			'TXN_timestamp' => array('BETWEEN', array($start_date, $end_date)),
1756 1756
 			'Registration.REG_count' => 1
1757 1757
 		);
1758 1758
 
1759
-		if ( isset( $this->_req_data['EVT_ID'] ) ) {
1759
+		if (isset($this->_req_data['EVT_ID'])) {
1760 1760
 			$_where['Registration.EVT_ID'] = $this->_req_data['EVT_ID'];
1761 1761
 		}
1762 1762
 
1763
-		if ( isset( $this->_req_data['s'] ) ) {
1764
-			$search_string = '%' . $this->_req_data['s'] . '%';
1763
+		if (isset($this->_req_data['s'])) {
1764
+			$search_string = '%'.$this->_req_data['s'].'%';
1765 1765
 			$_where['OR'] = array(
1766
-				'Registration.Event.EVT_name' => array( 'LIKE', $search_string ),
1767
-				'Registration.Event.EVT_desc' => array( 'LIKE', $search_string ),
1768
-				'Registration.Event.EVT_short_desc' => array( 'LIKE' , $search_string ),
1769
-				'Registration.Attendee.ATT_full_name' => array( 'LIKE', $search_string ),
1770
-				'Registration.Attendee.ATT_fname' => array( 'LIKE', $search_string ),
1771
-				'Registration.Attendee.ATT_lname' => array( 'LIKE', $search_string ),
1772
-				'Registration.Attendee.ATT_short_bio' => array( 'LIKE', $search_string ),
1773
-				'Registration.Attendee.ATT_email' => array('LIKE', $search_string ),
1774
-				'Registration.Attendee.ATT_address' => array( 'LIKE', $search_string ),
1775
-				'Registration.Attendee.ATT_address2' => array( 'LIKE', $search_string ),
1776
-				'Registration.Attendee.ATT_city' => array( 'LIKE', $search_string ),
1777
-				'Registration.REG_final_price' => array( 'LIKE', $search_string ),
1778
-				'Registration.REG_code' => array( 'LIKE', $search_string ),
1779
-				'Registration.REG_count' => array( 'LIKE' , $search_string ),
1780
-				'Registration.REG_group_size' => array( 'LIKE' , $search_string ),
1781
-				'Registration.Ticket.TKT_name' => array( 'LIKE', $search_string ),
1782
-				'Registration.Ticket.TKT_description' => array( 'LIKE', $search_string ),
1783
-				'Payment.PAY_source' => array('LIKE', $search_string ),
1784
-				'Payment.Payment_Method.PMD_name' => array('LIKE', $search_string ),
1785
-				'TXN_session_data' => array( 'LIKE', $search_string ),
1786
-				'Payment.PAY_txn_id_chq_nmbr' => array( 'LIKE', $search_string )
1766
+				'Registration.Event.EVT_name' => array('LIKE', $search_string),
1767
+				'Registration.Event.EVT_desc' => array('LIKE', $search_string),
1768
+				'Registration.Event.EVT_short_desc' => array('LIKE', $search_string),
1769
+				'Registration.Attendee.ATT_full_name' => array('LIKE', $search_string),
1770
+				'Registration.Attendee.ATT_fname' => array('LIKE', $search_string),
1771
+				'Registration.Attendee.ATT_lname' => array('LIKE', $search_string),
1772
+				'Registration.Attendee.ATT_short_bio' => array('LIKE', $search_string),
1773
+				'Registration.Attendee.ATT_email' => array('LIKE', $search_string),
1774
+				'Registration.Attendee.ATT_address' => array('LIKE', $search_string),
1775
+				'Registration.Attendee.ATT_address2' => array('LIKE', $search_string),
1776
+				'Registration.Attendee.ATT_city' => array('LIKE', $search_string),
1777
+				'Registration.REG_final_price' => array('LIKE', $search_string),
1778
+				'Registration.REG_code' => array('LIKE', $search_string),
1779
+				'Registration.REG_count' => array('LIKE', $search_string),
1780
+				'Registration.REG_group_size' => array('LIKE', $search_string),
1781
+				'Registration.Ticket.TKT_name' => array('LIKE', $search_string),
1782
+				'Registration.Ticket.TKT_description' => array('LIKE', $search_string),
1783
+				'Payment.PAY_source' => array('LIKE', $search_string),
1784
+				'Payment.Payment_Method.PMD_name' => array('LIKE', $search_string),
1785
+				'TXN_session_data' => array('LIKE', $search_string),
1786
+				'Payment.PAY_txn_id_chq_nmbr' => array('LIKE', $search_string)
1787 1787
 				);
1788 1788
 		}
1789 1789
 
1790 1790
 		//failed transactions
1791
-		$failed = ( ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'failed' && ! $count ) || ( $count && $view == 'failed' ) ? TRUE: FALSE;
1792
-		$abandoned = ( ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'abandoned' && ! $count ) || ( $count && $view == 'abandoned' ) ? TRUE: FALSE;
1791
+		$failed = ( ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'failed' && ! $count) || ($count && $view == 'failed') ? TRUE : FALSE;
1792
+		$abandoned = ( ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'abandoned' && ! $count) || ($count && $view == 'abandoned') ? TRUE : FALSE;
1793 1793
 
1794
-		if ( $failed ) {
1795
-			$_where[ 'STS_ID' ] = EEM_Transaction::failed_status_code;
1796
-		} else if ( $abandoned ) {
1794
+		if ($failed) {
1795
+			$_where['STS_ID'] = EEM_Transaction::failed_status_code;
1796
+		} else if ($abandoned) {
1797 1797
 				$_where['STS_ID'] = EEM_Transaction::abandoned_status_code;
1798 1798
 		} else {
1799
-				$_where['STS_ID'] = array( '!=', EEM_Transaction::failed_status_code );
1800
-				$_where['STS_ID*'] = array( '!=', EEM_Transaction::abandoned_status_code );
1799
+				$_where['STS_ID'] = array('!=', EEM_Transaction::failed_status_code);
1800
+				$_where['STS_ID*'] = array('!=', EEM_Transaction::abandoned_status_code);
1801 1801
 		}
1802 1802
 
1803
-		$query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'limit' => $limit );
1803
+		$query_params = array($_where, 'order_by' => array($orderby => $sort), 'limit' => $limit);
1804 1804
 
1805
-		$transactions = $count ? $TXN->count( array($_where), 'TXN_ID', TRUE ) : $TXN->get_all($query_params);
1805
+		$transactions = $count ? $TXN->count(array($_where), 'TXN_ID', TRUE) : $TXN->get_all($query_params);
1806 1806
 
1807 1807
 
1808 1808
 		return $transactions;
Please login to merge, or discard this patch.
help_tabs/transactions_overview_table_column_headings.help_tab.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,11 +67,11 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.
admin_pages/transactions/help_tours/Transaction_Details_Help_Tour.class.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
admin_pages/transactions/help_tours/Transaction_Reports_Help_Tour.class.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
transactions/help_tours/Transactions_Overview_Help_Tour.class.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
admin_pages/transactions/qtips/Transaction_Details_Tips.lib.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
templates/txn_admin_details_main_meta_box_attendees.template.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -5,25 +5,25 @@
 block discarded – undo
5 5
 		<table class="admin-primary-mbox-tbl">
6 6
 			<thead>
7 7
 				<tr>
8
-					<th class="jst-left"><?php _e( '#', 'event_espresso' );?></th>
9
-					<th class="jst-left"><?php _e( 'Event Name and Ticket', 'event_espresso' );?></th>
10
-					<th class="jst-left"><?php _e( 'Registrant', 'event_espresso' );?></th>
11
-					<th class="jst-rght"><?php _e( 'Ticket Price', 'event_espresso' );?></th>
12
-					<th class="jst-left"><?php _e( 'Email', 'event_espresso' );?></th>
13
-					<th class="jst-left"><?php _e( 'Address', 'event_espresso' );?></th>
8
+					<th class="jst-left"><?php _e('#', 'event_espresso'); ?></th>
9
+					<th class="jst-left"><?php _e('Event Name and Ticket', 'event_espresso'); ?></th>
10
+					<th class="jst-left"><?php _e('Registrant', 'event_espresso'); ?></th>
11
+					<th class="jst-rght"><?php _e('Ticket Price', 'event_espresso'); ?></th>
12
+					<th class="jst-left"><?php _e('Email', 'event_espresso'); ?></th>
13
+					<th class="jst-left"><?php _e('Address', 'event_espresso'); ?></th>
14 14
 				</tr>
15 15
 			</thead>
16 16
 			<tbody>
17
-		<?php if ( isset( $event_attendees ) && is_array( $event_attendees )) : ?>
18
-			<?php foreach ( $event_attendees as $registration => $attendee ) : ?>
17
+		<?php if (isset($event_attendees) && is_array($event_attendees)) : ?>
18
+			<?php foreach ($event_attendees as $registration => $attendee) : ?>
19 19
 				<tr>
20
-					<td class="jst-left"><?php echo $attendee['att_num'];?></td>
21
-					<td class="jst-left"><?php echo $attendee['event_ticket_name'];?></td>
20
+					<td class="jst-left"><?php echo $attendee['att_num']; ?></td>
21
+					<td class="jst-left"><?php echo $attendee['event_ticket_name']; ?></td>
22 22
 					<td class="jst-left">
23 23
 						<?php
24
-						$att_link = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$registration), REG_ADMIN_URL );
24
+						$att_link = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$registration), REG_ADMIN_URL);
25 25
 						?>
26
-						<a href="<?php echo $att_link; ?>" title="<?php _e( 'View details for this registrant', 'event_espresso' );?>">
26
+						<a href="<?php echo $att_link; ?>" title="<?php _e('View details for this registrant', 'event_espresso'); ?>">
27 27
 							<?php echo $attendee['attendee']?>
28 28
 						</a>
29 29
 					</td>
Please login to merge, or discard this patch.