Completed
Branch BUG-9680-compress-dompdf-files... (43e183)
by
unknown
74:11 queued 62:29
created
admin_pages/registrations/templates/reg_status_change_buttons.template.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <div id="reg-admin-approve-decline-reg-status-dv">
2 2
 
3 3
 	<h2 id="reg-admin-reg-details-reg-status-hdr">
4
-		<?php echo __( 'Current Registration Status : ', 'event_espresso' ); ?>
4
+		<?php echo __('Current Registration Status : ', 'event_espresso'); ?>
5 5
 		<span class="<?php echo $reg_status_class; ?> bigger-text"><?php echo $reg_status_value; ?></span>
6 6
 	</h2>
7 7
 
8 8
 	<h3 id="reg-admin-reg-details-reg-status-hdr">
9
-		<?php echo __( 'Change Registration Status to :', 'event_espresso' ); ?>
9
+		<?php echo __('Change Registration Status to :', 'event_espresso'); ?>
10 10
 	</h3>
11 11
 
12 12
 	<form id="reg_status_change_form" method="POST" action="<?php echo $form_url; ?>">
@@ -15,15 +15,15 @@  discard block
 block discarded – undo
15 15
 		<input type="hidden" name="return" value="view_registration">
16 16
 		<?php echo $nonce; ?>
17 17
 		<?php echo $status_buttons; ?>
18
-		<?php if ( $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'registration_message_type' ) ) : ?>
18
+		<?php if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'registration_message_type')) : ?>
19 19
 			<span id="send-related-messages-dv">
20
-			<label for="txn-reg-status-send-notifications-inp" class="important-notice"><?php _e( '...and send related messages ?', 'event_espresso' ); ?>
20
+			<label for="txn-reg-status-send-notifications-inp" class="important-notice"><?php _e('...and send related messages ?', 'event_espresso'); ?>
21 21
 				<input type="checkbox" value="1" id="txn-reg-status-send-notifications-inp" name="txn_reg_status_change[send_notifications]">
22 22
 			</label>
23 23
 			<br/>
24 24
 		</span>
25 25
 			<br/>
26
-			<p class="description"><?php _e( 'If the "send related messages"checkbox is checked when changing status, then the related messages will be sent to the registrant.', 'event_espresso' ); ?></p>
26
+			<p class="description"><?php _e('If the "send related messages"checkbox is checked when changing status, then the related messages will be sent to the registrant.', 'event_espresso'); ?></p>
27 27
 		<?php endif; ?>
28 28
 	</form>
29 29
 </div>
Please login to merge, or discard this patch.
templates/registration_page_registration_questions.template.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <div id="single-page-checkout" class="ui-widget">
2
-	<?php do_action( 'AHEE__registration_page_registration_questions__template__after_spco_attendee_information_header' )?>
2
+	<?php do_action('AHEE__registration_page_registration_questions__template__after_spco_attendee_information_header')?>
3 3
 	<div id="spco-attendee_information-dv" class="spco-step-dv">
4 4
 
5 5
 		<p id="spco-attendee_information-pg" class="spco-steps-pg small-text drk-grey-text">
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 			__('In order to process your registration, we ask you to provide the following information.%1$sPlease note that all fields marked with an asterisk (%2$s) are required.', 'event_espresso'),
8 8
 			'<br />',
9 9
 			'<span class="asterisk">*</span>'
10
-			);?>
10
+			); ?>
11 11
 		</p>
12 12
 
13 13
 	<?php
@@ -15,20 +15,20 @@  discard block
 block discarded – undo
15 15
 	$att_nmbr = 0;
16 16
 	$prev_event = '';
17 17
 
18
-	if ( $event_queue['total_items'] > 0 ) {
19
-		foreach ( $event_queue['items'] as $line_item => $item ) {
18
+	if ($event_queue['total_items'] > 0) {
19
+		foreach ($event_queue['items'] as $line_item => $item) {
20 20
 			$att_nmbr++;
21
-			if ( $item['attendee_questions'] != '' ) {
21
+			if ($item['attendee_questions'] != '') {
22 22
 	?>
23 23
 
24
-			<div id="spco-attendee-panel-dv-<?php echo $line_item;?>" class="spco-attendee-panel-dv">
24
+			<div id="spco-attendee-panel-dv-<?php echo $line_item; ?>" class="spco-attendee-panel-dv">
25 25
 
26
-				<?php if ( $item['ticket']->name() != $prev_event ) { ?>
26
+				<?php if ($item['ticket']->name() != $prev_event) { ?>
27 27
 			<p class="spco-ticket-info-pg">
28 28
 			<?php
29
-				echo $item['ticket']->name() . ':  ' . EEH_Template::format_currency( $item['ticket']->price(), FALSE, FALSE );
30
-				echo $item['ticket']->qty() ? ' &nbsp; x &nbsp; ' . $ticket_count[ $item['ticket']->ID() ] . __(' tickets', 'event_espresso') . ' &nbsp; = &nbsp; ' . EEH_Template::format_currency( $item['ticket']->price() * $ticket_count[ $item['ticket']->ID() ] ) : '';
31
-				echo $item['ticket']->description() ? '<br/>' . __('Ticket Details: ', 'event_espresso') . $item['ticket']->description() : '';
29
+				echo $item['ticket']->name().':  '.EEH_Template::format_currency($item['ticket']->price(), FALSE, FALSE);
30
+				echo $item['ticket']->qty() ? ' &nbsp; x &nbsp; '.$ticket_count[$item['ticket']->ID()].__(' tickets', 'event_espresso').' &nbsp; = &nbsp; '.EEH_Template::format_currency($item['ticket']->price() * $ticket_count[$item['ticket']->ID()]) : '';
31
+				echo $item['ticket']->description() ? '<br/>'.__('Ticket Details: ', 'event_espresso').$item['ticket']->description() : '';
32 32
 			?>
33 33
 			</p>
34 34
 
@@ -36,50 +36,50 @@  discard block
 block discarded – undo
36 36
 				}
37 37
 			?>
38 38
 
39
-				<fieldset id="spco-attendee-wrap-<?php echo $line_item;?>" class="spco-attendee-wrap-fs">
40
-	  				<legend class="spco-attendee-lgnd smaller-text lt-grey-text"><?php echo __('Registrant #', 'event_espresso') . $att_nmbr;?></legend>
39
+				<fieldset id="spco-attendee-wrap-<?php echo $line_item; ?>" class="spco-attendee-wrap-fs">
40
+	  				<legend class="spco-attendee-lgnd smaller-text lt-grey-text"><?php echo __('Registrant #', 'event_espresso').$att_nmbr; ?></legend>
41 41
 
42 42
 			<?php
43 43
 				//do an action before the questions output, including the item and count
44
-				echo do_action( 'AHEE__registration_page_registration_questions__template___before_questions', $item, $att_nmbr );
44
+				echo do_action('AHEE__registration_page_registration_questions__template___before_questions', $item, $att_nmbr);
45 45
 				echo $item['attendee_questions'];
46 46
 
47
-				if ( $att_nmbr == 1 && $print_copy_info ) { ?>
47
+				if ($att_nmbr == 1 && $print_copy_info) { ?>
48 48
 
49 49
 						<input type="hidden" id="primary-attendee" name="qstn[primary_attendee]" value="<?php echo $prmy_att_input_name ?>" />
50 50
 
51 51
 						<div id="spco-copy-attendee-dv" class="hide-if-no-js">
52 52
 
53 53
 							<p class="spco-copy-all-attendee-pg">
54
-								<label class="wide"><?php  _e('Use Registrant #1\'s information for ALL registrants', 'event_espresso');?>
54
+								<label class="wide"><?php  _e('Use Registrant #1\'s information for ALL registrants', 'event_espresso'); ?>
55 55
 									<input id="spco-copy-all-attendee-chk" class="spco-copy-all-attendee-chk ui-widget-content ui-corner-all" type="checkbox" value="copy-all">
56 56
 								</label>
57 57
 							</p>
58 58
 
59 59
 							<p class="spco-copy-attendee-pg"><?php _e('This option allows you to use the above information for all additional registrant question fields. <span>(&nbsp;Please note that some events may have additional questions that you may still be required to answer in order to complete your registration.&nbsp;)</span>', 'event_espresso'); ?></p>
60 60
 
61
-							<a id="display-more-attendee-copy-options" class="display-the-hidden smaller-text float-right" rel="more-attendee-copy-options" ><?php  _e('more options', 'event_espresso');?></a>
61
+							<a id="display-more-attendee-copy-options" class="display-the-hidden smaller-text float-right" rel="more-attendee-copy-options" ><?php  _e('more options', 'event_espresso'); ?></a>
62 62
 
63 63
 							<div id="more-attendee-copy-options-dv" class="">
64
-								<a id="hide-more-attendee-copy-options" class="hide-the-displayed smaller-text float-right" rel="more-attendee-copy-options" ><?php  _e('less options', 'event_espresso');?></a>
64
+								<a id="hide-more-attendee-copy-options" class="hide-the-displayed smaller-text float-right" rel="more-attendee-copy-options" ><?php  _e('less options', 'event_espresso'); ?></a>
65 65
 								<p class="spco-copy-attendee-pg">
66 66
 									<?php _e('The following checkboxes allow you to use the above information for only the selected additional event registrants.', 'event_espresso'); ?>
67 67
 								</p>
68 68
 
69 69
 						<?php
70
-								foreach ( $additional_event_attendees as $event_attendees ) {
71
-									foreach ( $event_attendees as $attendee ) {
70
+								foreach ($additional_event_attendees as $event_attendees) {
71
+									foreach ($event_attendees as $attendee) {
72 72
 
73
-										if ( $attendee['event_hdr'] ) { ?>
73
+										if ($attendee['event_hdr']) { ?>
74 74
 								<h6 class="spco-copy-attendee-event-hdr"><?php echo $attendee['event_hdr']; ?></h6>
75 75
 										<?php	} ?>
76 76
 
77 77
 								<p class="event_form_field spco-copy-attendee-chk-pg">
78
-									<label><?php echo __('Attendee #', 'event_espresso') . $attendee['att_nmbr'];?>
78
+									<label><?php echo __('Attendee #', 'event_espresso').$attendee['att_nmbr']; ?>
79 79
 										<input 	type="checkbox"
80
-														id="spco-copy-attendee-chk-<?php echo $attendee['input_id'];?>"
81
-														class="spco-copy-attendee-chk <?php echo $css_class;?>"
82
-														value="<?php echo $attendee['input_id'];?>"
80
+														id="spco-copy-attendee-chk-<?php echo $attendee['input_id']; ?>"
81
+														class="spco-copy-attendee-chk <?php echo $css_class; ?>"
82
+														value="<?php echo $attendee['input_id']; ?>"
83 83
 												/>
84 84
 									</label>
85 85
 								</p>
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 				<?php
96 96
 							$print_copy_info = FALSE;
97 97
 
98
-					} else if ( $att_nmbr == 1 ) {
98
+					} else if ($att_nmbr == 1) {
99 99
 				?>
100 100
 					<p id="spco-auto-copy-attendee-pg" class="smaller-text lt-grey-text">
101 101
 						<?php _e('The above information will be used for any additional tickets/registrants.', 'event_espresso'); ?>
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 			</div>
110 110
 	<?php
111 111
 			} else {
112
-				 if ( $att_nmbr == 1 ) {
112
+				 if ($att_nmbr == 1) {
113 113
 			?>
114
-		<div id="spco-attendee-panel-dv-<?php echo $line_item;?>" class="spco-attendee-panel-dv">
114
+		<div id="spco-attendee-panel-dv-<?php echo $line_item; ?>" class="spco-attendee-panel-dv">
115 115
 			<h3 id="event_title-<?php echo $item['ticket']->ID() ?>" class="big-event-title-hdr">
116 116
 				<?php echo $item['event']->name(); ?>
117 117
 			</h3>
118
-			<fieldset id="spco-attendee-wrap-<?php echo $line_item;?>" class="spco-attendee-wrap-fs">
118
+			<fieldset id="spco-attendee-wrap-<?php echo $line_item; ?>" class="spco-attendee-wrap-fs">
119 119
  				<h6><?php _e('No information is required to attend this event. Please proceed to the next Step', 'event_espresso'); ?></h6>
120 120
 				<input type="hidden" id="no-questions" name="qstn[]" value="0" />
121 121
 			</fieldset>
Please login to merge, or discard this patch.
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   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -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();
@@ -263,10 +263,10 @@  discard block
 block discarded – undo
263 263
 	/**
264 264
 	 * _set_transaction_status_array
265 265
 	 * sets list of transaction statuses
266
-	*
266
+	 *
267 267
 	 * @access private
268
-	*	@return void
269
-	*/
268
+	 *	@return void
269
+	 */
270 270
 	private function _set_transaction_status_array() {
271 271
 		self::$_txn_status = EEM_Transaction::instance()->status_array(TRUE);
272 272
 	}
@@ -288,10 +288,10 @@  discard block
 block discarded – undo
288 288
 
289 289
 	/**
290 290
 	 * 	get list of payment statuses
291
-	*
291
+	 *
292 292
 	 * @access private
293
-	*	@return void
294
-	*/
293
+	 *	@return void
294
+	 */
295 295
 	private function _get_payment_status_array() {
296 296
 		self::$_pay_status = EEM_Payment::instance()->status_array(TRUE);
297 297
 		$this->_template_args['payment_status'] = self::$_pay_status;
@@ -399,18 +399,18 @@  discard block
 block discarded – undo
399 399
 		if ( is_object( $this->_transaction) )
400 400
 			return; //get out we've already set the object
401 401
 
402
-	    $TXN = EEM_Transaction::instance();
402
+		$TXN = EEM_Transaction::instance();
403 403
 
404
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
404
+		$TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
405 405
 
406
-	    //get transaction object
407
-	    $this->_transaction = $TXN->get_one_by_ID($TXN_ID);
408
-	    $this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
406
+		//get transaction object
407
+		$this->_transaction = $TXN->get_one_by_ID($TXN_ID);
408
+		$this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
409 409
 
410 410
 	 	if ( empty( $this->_transaction ) ) {
411
-	    	$error_msg = esc_html__('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  esc_html__(' could not be retrieved.', 'event_espresso');
411
+			$error_msg = esc_html__('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  esc_html__(' could not be retrieved.', 'event_espresso');
412 412
 			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
413
-	    }
413
+		}
414 414
 	}
415 415
 
416 416
 
@@ -525,12 +525,12 @@  discard block
 block discarded – undo
525 525
 
526 526
 
527 527
 	/**
528
-	* 	_transaction_details
528
+	 * 	_transaction_details
529 529
 	 * generates HTML for the View Transaction Details Admin page
530
-	*
530
+	 *
531 531
 	 * @access protected
532
-	*	@return void
533
-	*/
532
+	 *	@return void
533
+	 */
534 534
 	protected function _transaction_details() {
535 535
 		do_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction );
536 536
 
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
 						'button secondary-button right',
582 582
 						'dashicons dashicons-email-alt'
583 583
 					)
584
-				    : '';
584
+					: '';
585 585
 		} else {
586 586
 			$this->_template_args['send_payment_reminder_button'] = '';
587 587
 		}
@@ -735,10 +735,10 @@  discard block
 block discarded – undo
735 735
 	/**
736 736
 	 * txn_details_meta_box
737 737
 	 * generates HTML for the Transaction main meta box
738
-	*
738
+	 *
739 739
 	 * @access public
740
-	*	@return void
741
-	*/
740
+	 *	@return void
741
+	 */
742 742
 	public function txn_details_meta_box() {
743 743
 
744 744
 		$this->_set_transaction_object();
@@ -1078,10 +1078,10 @@  discard block
 block discarded – undo
1078 1078
 	/**
1079 1079
 	 * txn_billing_info_side_meta_box
1080 1080
 	 * 	generates HTML for the Edit Transaction side meta box
1081
-	*
1081
+	 *
1082 1082
 	 * @access public
1083
-	*	@return void
1084
-	*/
1083
+	 *	@return void
1084
+	 */
1085 1085
 	public function txn_billing_info_side_meta_box() {
1086 1086
 
1087 1087
 		$this->_template_args['billing_form'] = $this->_transaction->billing_info();
@@ -1099,10 +1099,10 @@  discard block
 block discarded – undo
1099 1099
 	/**
1100 1100
 	 * apply_payments_or_refunds
1101 1101
 	 * 	registers a payment or refund made towards a transaction
1102
-	*
1102
+	 *
1103 1103
 	 * @access public
1104
-	*	@return void
1105
-	*/
1104
+	 *	@return void
1105
+	 */
1106 1106
 	public function apply_payments_or_refunds() {
1107 1107
 		$json_response_data = array( 'return_data' => FALSE );
1108 1108
 		$valid_data = $this->_validate_payment_request_data();
@@ -1256,9 +1256,9 @@  discard block
 block discarded – undo
1256 1256
 							'default' => '',
1257 1257
 							'required' => false,
1258 1258
 							'html_label_text' => esc_html__( 'Transaction or Cheque Number', 'event_espresso' ),
1259
-                                                        'validation_strategies' => array(
1260
-                                                            new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1261
-                                                        )
1259
+														'validation_strategies' => array(
1260
+															new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1261
+														)
1262 1262
 						)
1263 1263
 					),
1264 1264
 					'po_number' => new EE_Text_Input(
@@ -1266,9 +1266,9 @@  discard block
 block discarded – undo
1266 1266
 							'default' => '',
1267 1267
 							'required' => false,
1268 1268
 							'html_label_text' => esc_html__( 'Purchase Order Number', 'event_espresso' ),
1269
-                                                        'validation_strategies' => array(
1270
-                                                            new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1271
-                                                        )
1269
+														'validation_strategies' => array(
1270
+															new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1271
+														)
1272 1272
 						)
1273 1273
 					),
1274 1274
 					'accounting' => new EE_Text_Input(
@@ -1276,9 +1276,9 @@  discard block
 block discarded – undo
1276 1276
 							'default' => '',
1277 1277
 							'required' => false,
1278 1278
 							'html_label_text' => esc_html__( 'Extra Field for Accounting', 'event_espresso' ),
1279
-                                                        'validation_strategies' => array(
1280
-                                                            new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1281
-                                                        )
1279
+														'validation_strategies' => array(
1280
+															new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1281
+														)
1282 1282
 						)
1283 1283
 					),
1284 1284
 				)
@@ -1573,10 +1573,10 @@  discard block
 block discarded – undo
1573 1573
 	/**
1574 1574
 	 * delete_payment
1575 1575
 	 * 	delete a payment or refund made towards a transaction
1576
-	*
1576
+	 *
1577 1577
 	 * @access public
1578
-	*	@return void
1579
-	*/
1578
+	 *	@return void
1579
+	 */
1580 1580
 	public function delete_payment() {
1581 1581
 		$json_response_data = array( 'return_data' => FALSE );
1582 1582
 		$PAY_ID = isset( $this->_req_data['delete_txn_admin_payment'], $this->_req_data['delete_txn_admin_payment']['PAY_ID'] ) ? absint( $this->_req_data['delete_txn_admin_payment']['PAY_ID'] ) : 0;
@@ -1693,12 +1693,12 @@  discard block
 block discarded – undo
1693 1693
 	/**
1694 1694
 	 * _send_payment_reminder
1695 1695
 	 * 	generates HTML for the View Transaction Details Admin page
1696
-	*
1696
+	 *
1697 1697
 	 * @access protected
1698
-	*	@return void
1699
-	*/
1698
+	 *	@return void
1699
+	 */
1700 1700
 	protected function _send_payment_reminder() {
1701
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1701
+		$TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1702 1702
 		$transaction = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
1703 1703
 		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID'] ) : array();
1704 1704
 		do_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction );
@@ -1720,29 +1720,29 @@  discard block
 block discarded – undo
1720 1720
 
1721 1721
 		$TXN = EEM_Transaction::instance();
1722 1722
 
1723
-	    $start_date = isset( $this->_req_data['txn-filter-start-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-start-date'] ) : date( 'm/d/Y', strtotime( '-10 year' ));
1724
-	    $end_date = isset( $this->_req_data['txn-filter-end-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-end-date'] ) : date( 'm/d/Y' );
1723
+		$start_date = isset( $this->_req_data['txn-filter-start-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-start-date'] ) : date( 'm/d/Y', strtotime( '-10 year' ));
1724
+		$end_date = isset( $this->_req_data['txn-filter-end-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-end-date'] ) : date( 'm/d/Y' );
1725 1725
 
1726
-	    //make sure our timestamps start and end right at the boundaries for each day
1727
-	    $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1728
-	    $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1726
+		//make sure our timestamps start and end right at the boundaries for each day
1727
+		$start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1728
+		$end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1729 1729
 
1730 1730
 
1731
-	    //convert to timestamps
1732
-	    $start_date = strtotime( $start_date );
1733
-	    $end_date = strtotime( $end_date );
1731
+		//convert to timestamps
1732
+		$start_date = strtotime( $start_date );
1733
+		$end_date = strtotime( $end_date );
1734 1734
 
1735
-	    //makes sure start date is the lowest value and vice versa
1736
-	    $start_date = min( $start_date, $end_date );
1737
-	    $end_date = max( $start_date, $end_date );
1735
+		//makes sure start date is the lowest value and vice versa
1736
+		$start_date = min( $start_date, $end_date );
1737
+		$end_date = max( $start_date, $end_date );
1738 1738
 
1739
-	    //convert to correct format for query
1739
+		//convert to correct format for query
1740 1740
 	$start_date = EEM_Transaction::instance()->convert_datetime_for_query( 'TXN_timestamp', date( 'Y-m-d H:i:s', $start_date ), 'Y-m-d H:i:s' );
1741 1741
 	$end_date = EEM_Transaction::instance()->convert_datetime_for_query( 'TXN_timestamp', date( 'Y-m-d H:i:s', $end_date ), 'Y-m-d H:i:s' );
1742 1742
 
1743 1743
 
1744 1744
 
1745
-	    //set orderby
1745
+		//set orderby
1746 1746
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
1747 1747
 
1748 1748
 		switch ( $this->_req_data['orderby'] ) {
Please login to merge, or discard this patch.
Spacing   +405 added lines, -405 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' => esc_html__('Add New Transaction', 'event_espresso'),
99 99
 				'edit' => esc_html__('Edit Transaction', 'event_espresso'),
100
-				'delete' => esc_html__('Delete Transaction','event_espresso'),
100
+				'delete' => esc_html__('Delete Transaction', 'event_espresso'),
101 101
 			)
102 102
 		);
103 103
 	}
@@ -113,7 +113,7 @@  discard block
 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' => esc_html__('View Transaction', 'event_espresso'),
199 199
 					'order' => 5,
200
-					'url' => isset($this->_req_data['TXN_ID']) ? add_query_arg(array('TXN_ID' => $this->_req_data['TXN_ID'] ), $this->_current_page_view_url )  : $this->_admin_base_url,
200
+					'url' => isset($this->_req_data['TXN_ID']) ? add_query_arg(array('TXN_ID' => $this->_req_data['TXN_ID']), $this->_current_page_view_url) : $this->_admin_base_url,
201 201
 					'persistent' => FALSE
202 202
 					),
203 203
 				'help_tabs' => array(
@@ -218,8 +218,8 @@  discard block
 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,23 +237,23 @@  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' ] = esc_html__( 'An error occurred! Your request may have been processed, but a valid response from the server was not received. Please refresh the page and try again.', 'event_espresso' );
252
-		EE_Registry::$i18n_js_strings[ 'error_occurred' ] = esc_html__( 'An error occurred! Please refresh the page and try again.', 'event_espresso' );
253
-		EE_Registry::$i18n_js_strings[ 'txn_status_array' ] = self::$_txn_status;
254
-		EE_Registry::$i18n_js_strings[ 'pay_status_array' ] = self::$_pay_status;
255
-		EE_Registry::$i18n_js_strings[ 'payments_total' ] = esc_html__( 'Payments Total', 'event_espresso' );
256
-		EE_Registry::$i18n_js_strings[ 'transaction_overpaid' ] = esc_html__( 'This transaction has been overpaid ! Payments Total', 'event_espresso' );
251
+		EE_Registry::$i18n_js_strings['invalid_server_response'] = esc_html__('An error occurred! Your request may have been processed, but a valid response from the server was not received. Please refresh the page and try again.', 'event_espresso');
252
+		EE_Registry::$i18n_js_strings['error_occurred'] = esc_html__('An error occurred! Please refresh the page and try again.', 'event_espresso');
253
+		EE_Registry::$i18n_js_strings['txn_status_array'] = self::$_txn_status;
254
+		EE_Registry::$i18n_js_strings['pay_status_array'] = self::$_pay_status;
255
+		EE_Registry::$i18n_js_strings['payments_total'] = esc_html__('Payments Total', 'event_espresso');
256
+		EE_Registry::$i18n_js_strings['transaction_overpaid'] = esc_html__('This transaction has been overpaid ! Payments Total', 'event_espresso');
257 257
 	}
258 258
 	public function admin_notices() {}
259 259
 	public function admin_footer_scripts() {}
@@ -320,14 +320,14 @@  discard block
 block discarded – undo
320 320
 	 */
321 321
 	public function load_scripts_styles() {
322 322
 		//enqueue style
323
-		wp_register_style( 'espresso_txn', TXN_ASSETS_URL . 'espresso_transactions_admin.css', array(), EVENT_ESPRESSO_VERSION );
323
+		wp_register_style('espresso_txn', TXN_ASSETS_URL.'espresso_transactions_admin.css', array(), EVENT_ESPRESSO_VERSION);
324 324
 		wp_enqueue_style('espresso_txn');
325 325
 
326 326
 		//scripts
327 327
 		add_filter('FHEE_load_accounting_js', '__return_true');
328 328
 
329 329
 		//scripts
330
-		wp_register_script('espresso_txn', TXN_ASSETS_URL . 'espresso_transactions_admin.js', array('ee_admin_js', 'ee-datepicker', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'ee-dialog', 'ee-accounting', 'ee-serialize-full-array'), EVENT_ESPRESSO_VERSION, TRUE);
330
+		wp_register_script('espresso_txn', TXN_ASSETS_URL.'espresso_transactions_admin.js', array('ee_admin_js', 'ee-datepicker', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'ee-dialog', 'ee-accounting', 'ee-serialize-full-array'), EVENT_ESPRESSO_VERSION, TRUE);
331 331
 		wp_enqueue_script('espresso_txn');
332 332
 
333 333
 	}
@@ -367,8 +367,8 @@  discard block
 block discarded – undo
367 367
 	 *	@return void
368 368
 	 */
369 369
 	protected function _set_list_table_views_default() {
370
-		$this->_views = array (
371
-			'all' => array (
370
+		$this->_views = array(
371
+			'all' => array(
372 372
 				'slug' 		=> 'all',
373 373
 				'label' 		=> esc_html__('View All Transactions', 'event_espresso'),
374 374
 				'count' 	=> 0
@@ -396,20 +396,20 @@  discard block
 block discarded – undo
396 396
 	 *	@return void
397 397
 	 */
398 398
 	private function _set_transaction_object() {
399
-		if ( is_object( $this->_transaction) )
399
+		if (is_object($this->_transaction))
400 400
 			return; //get out we've already set the object
401 401
 
402 402
 	    $TXN = EEM_Transaction::instance();
403 403
 
404
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
404
+	    $TXN_ID = ( ! empty($this->_req_data['TXN_ID'])) ? absint($this->_req_data['TXN_ID']) : FALSE;
405 405
 
406 406
 	    //get transaction object
407 407
 	    $this->_transaction = $TXN->get_one_by_ID($TXN_ID);
408
-	    $this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
408
+	    $this->_session = ! empty($this->_transaction) ? $this->_transaction->get('TXN_session_data') : NULL;
409 409
 
410
-	 	if ( empty( $this->_transaction ) ) {
411
-	    	$error_msg = esc_html__('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  esc_html__(' could not be retrieved.', 'event_espresso');
412
-			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
410
+	 	if (empty($this->_transaction)) {
411
+	    	$error_msg = esc_html__('An error occurred and the details for Transaction ID #', 'event_espresso').$TXN_ID.esc_html__(' could not be retrieved.', 'event_espresso');
412
+			EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
413 413
 	    }
414 414
 	}
415 415
 
@@ -422,12 +422,12 @@  discard block
 block discarded – undo
422 422
 	 *	@return array
423 423
 	 */
424 424
 	protected function _transaction_legend_items() {
425
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
425
+		EE_Registry::instance()->load_helper('MSG_Template');
426 426
 		$items = array();
427 427
 
428
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) {
429
-			$related_for_icon = EEH_MSG_Template::get_message_action_icon( 'see_notifications_for' );
430
-			if ( isset( $related_for_icon['css_class']) && isset( $related_for_icon['label'] ) ) {
428
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
429
+			$related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for');
430
+			if (isset($related_for_icon['css_class']) && isset($related_for_icon['label'])) {
431 431
 				$items['view_related_messages'] = array(
432 432
 					'class' => $related_for_icon['css_class'],
433 433
 					'desc' => $related_for_icon['label'],
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 
438 438
 		$items = apply_filters(
439 439
 			'FHEE__Transactions_Admin_Page___transaction_legend_items__items',
440
-			array_merge( $items,
440
+			array_merge($items,
441 441
 				array(
442 442
 					'view_details' => array(
443 443
 						'class' => 'dashicons dashicons-cart',
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 					),
450 450
 					'view_receipt' => array(
451 451
 						'class' => 'dashicons dashicons-media-default',
452
-						'desc' => esc_html__('View Transaction Receipt', 'event_espresso' )
452
+						'desc' => esc_html__('View Transaction Receipt', 'event_espresso')
453 453
 					),
454 454
 					'view_registration' => array(
455 455
 						'class' => 'dashicons dashicons-clipboard',
@@ -459,8 +459,8 @@  discard block
 block discarded – undo
459 459
 			)
460 460
 		);
461 461
 
462
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_transactions_send_payment_reminder' ) ) {
463
-			if ( EEH_MSG_Template::is_mt_active( 'payment_reminder' ) ) {
462
+		if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder')) {
463
+			if (EEH_MSG_Template::is_mt_active('payment_reminder')) {
464 464
 				$items['send_payment_reminder'] = array(
465 465
 					'class' => 'dashicons dashicons-email-alt',
466 466
 					'desc' => esc_html__('Send Payment Reminder', 'event_espresso')
@@ -481,29 +481,29 @@  discard block
 block discarded – undo
481 481
 			'FHEE__Transactions_Admin_Page___transaction_legend_items__more_items',
482 482
 			array(
483 483
 				'overpaid'   => array(
484
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::overpaid_status_code,
485
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::overpaid_status_code, FALSE, 'sentence' )
484
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::overpaid_status_code,
485
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::overpaid_status_code, FALSE, 'sentence')
486 486
 				),
487 487
 				'complete'   => array(
488
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::complete_status_code,
489
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::complete_status_code, FALSE, 'sentence' )
488
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::complete_status_code,
489
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::complete_status_code, FALSE, 'sentence')
490 490
 				),
491 491
 				'incomplete' => array(
492
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::incomplete_status_code,
493
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::incomplete_status_code, FALSE, 'sentence' )
492
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::incomplete_status_code,
493
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::incomplete_status_code, FALSE, 'sentence')
494 494
 				),
495 495
 				'abandoned'  => array(
496
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::abandoned_status_code,
497
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::abandoned_status_code, FALSE, 'sentence' )
496
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::abandoned_status_code,
497
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::abandoned_status_code, FALSE, 'sentence')
498 498
 				),
499 499
 				'failed'     => array(
500
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::failed_status_code,
501
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::failed_status_code, FALSE, 'sentence' )
500
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::failed_status_code,
501
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::failed_status_code, FALSE, 'sentence')
502 502
 				)
503 503
 			)
504 504
 		);
505 505
 
506
-		return array_merge( $items, $more_items);
506
+		return array_merge($items, $more_items);
507 507
 	}
508 508
 
509 509
 
@@ -516,9 +516,9 @@  discard block
 block discarded – undo
516 516
 	 */
517 517
 	protected function _transactions_overview_list_table() {
518 518
 		$this->_admin_page_title = esc_html__('Transactions', 'event_espresso');
519
-		$event = isset($this->_req_data['EVT_ID']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID'] ) : NULL;
520
-		$this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf( esc_html__('%sViewing Transactions for the Event: %s%s', 'event_espresso'), '<h3>', '<a href="' . EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $event->ID()), EVENTS_ADMIN_URL ) . '" title="' . esc_attr__('Click to Edit event', 'event_espresso') . '">' . $event->get('EVT_name') . '</a>', '</h3>' ) : '';
521
-		$this->_template_args['after_list_table'] = $this->_display_legend( $this->_transaction_legend_items() );
519
+		$event = isset($this->_req_data['EVT_ID']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID']) : NULL;
520
+		$this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf(esc_html__('%sViewing Transactions for the Event: %s%s', 'event_espresso'), '<h3>', '<a href="'.EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $event->ID()), EVENTS_ADMIN_URL).'" title="'.esc_attr__('Click to Edit event', 'event_espresso').'">'.$event->get('EVT_name').'</a>', '</h3>') : '';
521
+		$this->_template_args['after_list_table'] = $this->_display_legend($this->_transaction_legend_items());
522 522
 		$this->display_admin_list_table_page_with_no_sidebar();
523 523
 	}
524 524
 
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
 	*	@return void
533 533
 	*/
534 534
 	protected function _transaction_details() {
535
-		do_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction );
535
+		do_action('AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction);
536 536
 
537 537
 		$this->_set_transaction_status_array();
538 538
 
@@ -545,14 +545,14 @@  discard block
 block discarded – undo
545 545
 		$attendee = $primary_registration instanceof EE_Registration ? $primary_registration->attendee() : NULL;
546 546
 
547 547
 		$this->_template_args['txn_nmbr']['value'] = $this->_transaction->ID();
548
-		$this->_template_args['txn_nmbr']['label'] = esc_html__( 'Transaction Number', 'event_espresso' );
548
+		$this->_template_args['txn_nmbr']['label'] = esc_html__('Transaction Number', 'event_espresso');
549 549
 
550 550
 		$this->_template_args['txn_datetime']['value'] = $this->_transaction->get_i18n_datetime('TXN_timestamp');
551
-		$this->_template_args['txn_datetime']['label'] = esc_html__( 'Date', 'event_espresso' );
551
+		$this->_template_args['txn_datetime']['label'] = esc_html__('Date', 'event_espresso');
552 552
 
553
-		$this->_template_args['txn_status']['value'] = self::$_txn_status[ $this->_transaction->get('STS_ID') ];
554
-		$this->_template_args['txn_status']['label'] = esc_html__( 'Transaction Status', 'event_espresso' );
555
-		$this->_template_args['txn_status']['class'] = 'status-' . $this->_transaction->get('STS_ID');
553
+		$this->_template_args['txn_status']['value'] = self::$_txn_status[$this->_transaction->get('STS_ID')];
554
+		$this->_template_args['txn_status']['label'] = esc_html__('Transaction Status', 'event_espresso');
555
+		$this->_template_args['txn_status']['class'] = 'status-'.$this->_transaction->get('STS_ID');
556 556
 
557 557
 		$this->_template_args['grand_total'] = $this->_transaction->get('TXN_total');
558 558
 		$this->_template_args['total_paid'] = $this->_transaction->get('TXN_paid');
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 			)
566 566
 		) {
567 567
 			$this->_template_args['send_payment_reminder_button'] =
568
-				EEH_MSG_Template::is_mt_active( 'payment_reminder' )
568
+				EEH_MSG_Template::is_mt_active('payment_reminder')
569 569
 				&& $this->_transaction->get('STS_ID') != EEM_Transaction::complete_status_code
570 570
 				&& $this->_transaction->get('STS_ID') != EEM_Transaction::overpaid_status_code
571 571
 					? EEH_Template::get_button_or_link(
@@ -587,40 +587,40 @@  discard block
 block discarded – undo
587 587
 		}
588 588
 
589 589
 		$amount_due = $this->_transaction->get('TXN_total') - $this->_transaction->get('TXN_paid');
590
-		$this->_template_args['amount_due'] = EEH_Template::format_currency( $amount_due, TRUE );
591
-		if ( EE_Registry::instance()->CFG->currency->sign_b4 ) {
592
-			$this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign . $this->_template_args['amount_due'];
590
+		$this->_template_args['amount_due'] = EEH_Template::format_currency($amount_due, TRUE);
591
+		if (EE_Registry::instance()->CFG->currency->sign_b4) {
592
+			$this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign.$this->_template_args['amount_due'];
593 593
 		} else {
594
-			$this->_template_args['amount_due'] = $this->_template_args['amount_due'] . EE_Registry::instance()->CFG->currency->sign;
594
+			$this->_template_args['amount_due'] = $this->_template_args['amount_due'].EE_Registry::instance()->CFG->currency->sign;
595 595
 		}
596
-		$this->_template_args['amount_due_class'] =  '';
596
+		$this->_template_args['amount_due_class'] = '';
597 597
 
598
-		if ( $this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total') ) {
598
+		if ($this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total')) {
599 599
 			// paid in full
600
-			$this->_template_args['amount_due'] =  FALSE;
601
-		} elseif ( $this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total') ) {
600
+			$this->_template_args['amount_due'] = FALSE;
601
+		} elseif ($this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total')) {
602 602
 			// overpaid
603
-			$this->_template_args['amount_due_class'] =  'txn-overview-no-payment-spn';
604
-		} elseif (( $this->_transaction->get('TXN_total') > 0 ) && ( $this->_transaction->get('TXN_paid') > 0 )) {
603
+			$this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn';
604
+		} elseif (($this->_transaction->get('TXN_total') > 0) && ($this->_transaction->get('TXN_paid') > 0)) {
605 605
 			// monies owing
606
-			$this->_template_args['amount_due_class'] =  'txn-overview-part-payment-spn';
607
-		} elseif (( $this->_transaction->get('TXN_total') > 0 ) && ( $this->_transaction->get('TXN_paid') == 0 )) {
606
+			$this->_template_args['amount_due_class'] = 'txn-overview-part-payment-spn';
607
+		} elseif (($this->_transaction->get('TXN_total') > 0) && ($this->_transaction->get('TXN_paid') == 0)) {
608 608
 			// no payments made yet
609
-			$this->_template_args['amount_due_class'] =  'txn-overview-no-payment-spn';
610
-		} elseif ( $this->_transaction->get('TXN_total') == 0 ) {
609
+			$this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn';
610
+		} elseif ($this->_transaction->get('TXN_total') == 0) {
611 611
 			// free event
612
-			$this->_template_args['amount_due'] =  FALSE;
612
+			$this->_template_args['amount_due'] = FALSE;
613 613
 		}
614 614
 
615 615
 		$payment_method = $this->_transaction->payment_method();
616 616
 
617 617
 		$this->_template_args['method_of_payment_name'] = $payment_method instanceof EE_Payment_Method
618 618
 			? $payment_method->admin_name()
619
-			: esc_html__( 'Unknown', 'event_espresso' );
619
+			: esc_html__('Unknown', 'event_espresso');
620 620
 
621 621
 		$this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
622 622
 		// link back to overview
623
-		$this->_template_args['txn_overview_url'] = ! empty ( $_SERVER['HTTP_REFERER'] )
623
+		$this->_template_args['txn_overview_url'] = ! empty ($_SERVER['HTTP_REFERER'])
624 624
 			? $_SERVER['HTTP_REFERER']
625 625
 			: TXN_ADMIN_URL;
626 626
 
@@ -628,13 +628,13 @@  discard block
 block discarded – undo
628 628
 		// next link
629 629
 		$next_txn = $this->_transaction->next(
630 630
 			null,
631
-			array( array( 'STS_ID' => array( '!=', EEM_Transaction::failed_status_code ) ) ),
631
+			array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))),
632 632
 			'TXN_ID'
633 633
 		);
634 634
 		$this->_template_args['next_transaction'] = $next_txn
635 635
 			? $this->_next_link(
636 636
 				EE_Admin_Page::add_query_args_and_nonce(
637
-					array( 'action' => 'view_transaction', 'TXN_ID' => $next_txn['TXN_ID'] ),
637
+					array('action' => 'view_transaction', 'TXN_ID' => $next_txn['TXN_ID']),
638 638
 					TXN_ADMIN_URL
639 639
 				),
640 640
 				'dashicons dashicons-arrow-right ee-icon-size-22'
@@ -643,13 +643,13 @@  discard block
 block discarded – undo
643 643
 		// previous link
644 644
 		$previous_txn = $this->_transaction->previous(
645 645
 			null,
646
-			array( array( 'STS_ID' => array( '!=', EEM_Transaction::failed_status_code ) ) ),
646
+			array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))),
647 647
 			'TXN_ID'
648 648
 		);
649 649
 		$this->_template_args['previous_transaction'] = $previous_txn
650 650
 			? $this->_previous_link(
651 651
 				EE_Admin_Page::add_query_args_and_nonce(
652
-					array( 'action' => 'view_transaction', 'TXN_ID' => $previous_txn['TXN_ID'] ),
652
+					array('action' => 'view_transaction', 'TXN_ID' => $previous_txn['TXN_ID']),
653 653
 					TXN_ADMIN_URL
654 654
 				),
655 655
 				'dashicons dashicons-arrow-left ee-icon-size-22'
@@ -659,16 +659,16 @@  discard block
 block discarded – undo
659 659
 		// were we just redirected here after adding a new registration ???
660 660
 		if (
661 661
 			isset(
662
-				$this->_req_data[ 'redirect_from' ],
663
-				$this->_req_data[ 'EVT_ID' ],
664
-				$this->_req_data[ 'event_name' ]
662
+				$this->_req_data['redirect_from'],
663
+				$this->_req_data['EVT_ID'],
664
+				$this->_req_data['event_name']
665 665
 			)
666 666
 		) {
667 667
 			if (
668 668
 				EE_Registry::instance()->CAP->current_user_can(
669 669
 					'ee_edit_registrations',
670 670
 					'espresso_registrations_new_registration',
671
-					$this->_req_data[ 'EVT_ID' ]
671
+					$this->_req_data['EVT_ID']
672 672
 				)
673 673
 			) {
674 674
 				$this->_admin_page_title .= '<a id="add-new-registration" class="add-new-h2 button-primary" href="';
@@ -678,25 +678,25 @@  discard block
 block discarded – undo
678 678
 						'action'   => 'new_registration',
679 679
 						'return'   => 'default',
680 680
 						'TXN_ID'   => $this->_transaction->ID(),
681
-						'event_id' => $this->_req_data[ 'EVT_ID' ],
681
+						'event_id' => $this->_req_data['EVT_ID'],
682 682
 					),
683 683
 					REG_ADMIN_URL
684 684
 				);
685 685
 				$this->_admin_page_title .= '">';
686 686
 
687 687
 				$this->_admin_page_title .= sprintf(
688
-					esc_html__('Add Another New Registration to Event: "%1$s" ?', 'event_espresso' ),
689
-					htmlentities( urldecode( $this->_req_data[ 'event_name' ] ), ENT_QUOTES, 'UTF-8' )
688
+					esc_html__('Add Another New Registration to Event: "%1$s" ?', 'event_espresso'),
689
+					htmlentities(urldecode($this->_req_data['event_name']), ENT_QUOTES, 'UTF-8')
690 690
 				);
691 691
 				$this->_admin_page_title .= '</a>';
692 692
 			}
693
-			EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
693
+			EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
694 694
 		}
695 695
 		// grab messages at the last second
696 696
 		$this->_template_args['notices'] = EE_Error::get_notices();
697 697
 		// path to template
698
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_header.template.php';
699
-		$this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
698
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_header.template.php';
699
+		$this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
700 700
 
701 701
 		// the details template wrapper
702 702
 		$this->display_admin_page_with_sidebar();
@@ -715,18 +715,18 @@  discard block
 block discarded – undo
715 715
 
716 716
 		$this->_set_transaction_object();
717 717
 
718
-		add_meta_box( 'edit-txn-details-mbox', esc_html__( 'Transaction Details', 'event_espresso' ), array( $this, 'txn_details_meta_box' ), $this->_wp_page_slug, 'normal', 'high' );
718
+		add_meta_box('edit-txn-details-mbox', esc_html__('Transaction Details', 'event_espresso'), array($this, 'txn_details_meta_box'), $this->_wp_page_slug, 'normal', 'high');
719 719
 		add_meta_box(
720 720
 			'edit-txn-attendees-mbox',
721
-			esc_html__( 'Attendees Registered in this Transaction', 'event_espresso' ),
722
-			array( $this, 'txn_attendees_meta_box' ),
721
+			esc_html__('Attendees Registered in this Transaction', 'event_espresso'),
722
+			array($this, 'txn_attendees_meta_box'),
723 723
 			$this->_wp_page_slug,
724 724
 			'normal',
725 725
 			'high',
726
-			array( 'TXN_ID' => $this->_transaction->ID() )
726
+			array('TXN_ID' => $this->_transaction->ID())
727 727
 		);
728
-		add_meta_box( 'edit-txn-registrant-mbox', esc_html__( 'Primary Contact', 'event_espresso' ), array( $this, 'txn_registrant_side_meta_box' ), $this->_wp_page_slug, 'side', 'high' );
729
-		add_meta_box( 'edit-txn-billing-info-mbox', esc_html__( 'Billing Information', 'event_espresso' ), array( $this, 'txn_billing_info_side_meta_box' ), $this->_wp_page_slug, 'side', 'high' );
728
+		add_meta_box('edit-txn-registrant-mbox', esc_html__('Primary Contact', 'event_espresso'), array($this, 'txn_registrant_side_meta_box'), $this->_wp_page_slug, 'side', 'high');
729
+		add_meta_box('edit-txn-billing-info-mbox', esc_html__('Billing Information', 'event_espresso'), array($this, 'txn_billing_info_side_meta_box'), $this->_wp_page_slug, 'side', 'high');
730 730
 
731 731
 	}
732 732
 
@@ -747,15 +747,15 @@  discard block
 block discarded – undo
747 747
 
748 748
 		//get line table
749 749
 		EEH_Autoloader::register_line_item_display_autoloaders();
750
-		$Line_Item_Display = new EE_Line_Item_Display( 'admin_table', 'EE_Admin_Table_Line_Item_Display_Strategy' );
751
-		$this->_template_args['line_item_table'] = $Line_Item_Display->display_line_item( $this->_transaction->total_line_item() );
750
+		$Line_Item_Display = new EE_Line_Item_Display('admin_table', 'EE_Admin_Table_Line_Item_Display_Strategy');
751
+		$this->_template_args['line_item_table'] = $Line_Item_Display->display_line_item($this->_transaction->total_line_item());
752 752
 		$this->_template_args['REG_code'] = $this->_transaction->get_first_related('Registration')->get('REG_code');
753 753
 
754 754
 		// process taxes
755
-		$taxes = $this->_transaction->get_many_related( 'Line_Item', array( array( 'LIN_type' => EEM_Line_Item::type_tax )));
756
-		$this->_template_args['taxes'] = ! empty( $taxes ) ? $taxes : FALSE;
755
+		$taxes = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => EEM_Line_Item::type_tax)));
756
+		$this->_template_args['taxes'] = ! empty($taxes) ? $taxes : FALSE;
757 757
 
758
-		$this->_template_args['grand_total'] = EEH_Template::format_currency($this->_transaction->get('TXN_total'), FALSE, FALSE );
758
+		$this->_template_args['grand_total'] = EEH_Template::format_currency($this->_transaction->get('TXN_total'), FALSE, FALSE);
759 759
 		$this->_template_args['grand_raw_total'] = $this->_transaction->get('TXN_total');
760 760
 		$this->_template_args['TXN_status'] = $this->_transaction->get('STS_ID');
761 761
 
@@ -763,63 +763,63 @@  discard block
 block discarded – undo
763 763
 
764 764
 		// process payment details
765 765
 		$payments = $this->_transaction->get_many_related('Payment');
766
-		if( ! empty(  $payments ) ) {
767
-			$this->_template_args[ 'payments' ] = $payments;
768
-			$this->_template_args[ 'existing_reg_payments' ] = $this->_get_registration_payment_IDs( $payments );
766
+		if ( ! empty($payments)) {
767
+			$this->_template_args['payments'] = $payments;
768
+			$this->_template_args['existing_reg_payments'] = $this->_get_registration_payment_IDs($payments);
769 769
 		} else {
770
-			$this->_template_args[ 'payments' ] = false;
771
-			$this->_template_args[ 'existing_reg_payments' ] = array();
770
+			$this->_template_args['payments'] = false;
771
+			$this->_template_args['existing_reg_payments'] = array();
772 772
 		}
773 773
 
774
-		$this->_template_args['edit_payment_url'] = add_query_arg( array( 'action' => 'edit_payment'  ), TXN_ADMIN_URL );
775
-		$this->_template_args['delete_payment_url'] = add_query_arg( array( 'action' => 'espresso_delete_payment' ), TXN_ADMIN_URL );
774
+		$this->_template_args['edit_payment_url'] = add_query_arg(array('action' => 'edit_payment'), TXN_ADMIN_URL);
775
+		$this->_template_args['delete_payment_url'] = add_query_arg(array('action' => 'espresso_delete_payment'), TXN_ADMIN_URL);
776 776
 
777
-		if ( isset( $txn_details['invoice_number'] )) {
777
+		if (isset($txn_details['invoice_number'])) {
778 778
 			$this->_template_args['txn_details']['invoice_number']['value'] = $this->_template_args['REG_code'];
779
-			$this->_template_args['txn_details']['invoice_number']['label'] = esc_html__( 'Invoice Number', 'event_espresso' );
779
+			$this->_template_args['txn_details']['invoice_number']['label'] = esc_html__('Invoice Number', 'event_espresso');
780 780
 		}
781 781
 
782 782
 		$this->_template_args['txn_details']['registration_session']['value'] = $this->_transaction->get_first_related('Registration')->get('REG_session');
783
-		$this->_template_args['txn_details']['registration_session']['label'] = esc_html__( 'Registration Session', 'event_espresso' );
783
+		$this->_template_args['txn_details']['registration_session']['label'] = esc_html__('Registration Session', 'event_espresso');
784 784
 
785
-		$this->_template_args['txn_details']['ip_address']['value'] = isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '';
786
-		$this->_template_args['txn_details']['ip_address']['label'] = esc_html__( 'Transaction placed from IP', 'event_espresso' );
785
+		$this->_template_args['txn_details']['ip_address']['value'] = isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '';
786
+		$this->_template_args['txn_details']['ip_address']['label'] = esc_html__('Transaction placed from IP', 'event_espresso');
787 787
 
788
-		$this->_template_args['txn_details']['user_agent']['value'] = isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '';
789
-		$this->_template_args['txn_details']['user_agent']['label'] = esc_html__( 'Registrant User Agent', 'event_espresso' );
788
+		$this->_template_args['txn_details']['user_agent']['value'] = isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '';
789
+		$this->_template_args['txn_details']['user_agent']['label'] = esc_html__('Registrant User Agent', 'event_espresso');
790 790
 
791 791
 		$reg_steps = '<ul>';
792
-		foreach ( $this->_transaction->reg_steps() as $reg_step => $reg_step_status ) {
793
-			if ( $reg_step_status === true ) {
794
-				$reg_steps .= '<li style="color:#70cc50">' . sprintf( esc_html__( '%1$s : Completed', 'event_espresso' ), ucwords( str_replace( '_', ' ', $reg_step ) ) ) . '</li>';
795
-			} else if ( is_numeric( $reg_step_status ) && $reg_step_status !== false ) {
796
-					$reg_steps .= '<li style="color:#2EA2CC">' . sprintf(
797
-							esc_html__( '%1$s : Initiated %2$s', 'event_espresso' ),
798
-							ucwords( str_replace( '_', ' ', $reg_step ) ),
799
-							gmdate( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), ( $reg_step_status + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) )
800
-						) . '</li>';
792
+		foreach ($this->_transaction->reg_steps() as $reg_step => $reg_step_status) {
793
+			if ($reg_step_status === true) {
794
+				$reg_steps .= '<li style="color:#70cc50">'.sprintf(esc_html__('%1$s : Completed', 'event_espresso'), ucwords(str_replace('_', ' ', $reg_step))).'</li>';
795
+			} else if (is_numeric($reg_step_status) && $reg_step_status !== false) {
796
+					$reg_steps .= '<li style="color:#2EA2CC">'.sprintf(
797
+							esc_html__('%1$s : Initiated %2$s', 'event_espresso'),
798
+							ucwords(str_replace('_', ' ', $reg_step)),
799
+							gmdate(get_option('date_format').' '.get_option('time_format'), ($reg_step_status + (get_option('gmt_offset') * HOUR_IN_SECONDS)))
800
+						).'</li>';
801 801
 				} else {
802
-				$reg_steps .= '<li style="color:#E76700">' . sprintf( esc_html__( '%1$s : Never Initiated', 'event_espresso' ), ucwords( str_replace( '_', ' ', $reg_step ) ) ) . '</li>';
802
+				$reg_steps .= '<li style="color:#E76700">'.sprintf(esc_html__('%1$s : Never Initiated', 'event_espresso'), ucwords(str_replace('_', ' ', $reg_step))).'</li>';
803 803
 			}
804 804
 		}
805 805
 		$reg_steps .= '</ul>';
806 806
 		$this->_template_args['txn_details']['reg_steps']['value'] = $reg_steps;
807
-		$this->_template_args['txn_details']['reg_steps']['label'] = esc_html__( 'Registration Step Progress', 'event_espresso' );
807
+		$this->_template_args['txn_details']['reg_steps']['label'] = esc_html__('Registration Step Progress', 'event_espresso');
808 808
 
809 809
 
810 810
 		$this->_get_registrations_to_apply_payment_to();
811
-		$this->_get_payment_methods( $payments );
811
+		$this->_get_payment_methods($payments);
812 812
 		$this->_get_payment_status_array();
813 813
 		$this->_get_reg_status_selection(); //sets up the template args for the reg status array for the transaction.
814 814
 
815
-		$this->_template_args['transaction_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'transaction'  ), TXN_ADMIN_URL );
816
-		$this->_template_args['apply_payment_form_url'] = add_query_arg( array( 'page' => 'espresso_transactions', 'action' => 'espresso_apply_payment' ), WP_AJAX_URL );
817
-		$this->_template_args['delete_payment_form_url'] = add_query_arg( array( 'page' => 'espresso_transactions', 'action' => 'espresso_delete_payment' ), WP_AJAX_URL );
815
+		$this->_template_args['transaction_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'transaction'), TXN_ADMIN_URL);
816
+		$this->_template_args['apply_payment_form_url'] = add_query_arg(array('page' => 'espresso_transactions', 'action' => 'espresso_apply_payment'), WP_AJAX_URL);
817
+		$this->_template_args['delete_payment_form_url'] = add_query_arg(array('page' => 'espresso_transactions', 'action' => 'espresso_delete_payment'), WP_AJAX_URL);
818 818
 
819 819
 		// 'espresso_delete_payment_nonce'
820 820
 
821
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_main_meta_box_txn_details.template.php';
822
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
821
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_main_meta_box_txn_details.template.php';
822
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
823 823
 
824 824
 	}
825 825
 
@@ -834,27 +834,27 @@  discard block
 block discarded – undo
834 834
 	 * @param EE_Payment[] $payments
835 835
 	 * @return array
836 836
 	 */
837
-	protected function _get_registration_payment_IDs( $payments = array() ) {
837
+	protected function _get_registration_payment_IDs($payments = array()) {
838 838
 		$existing_reg_payments = array();
839 839
 		// get all reg payments for these payments
840
-		$reg_payments = EEM_Registration_Payment::instance()->get_all( array(
840
+		$reg_payments = EEM_Registration_Payment::instance()->get_all(array(
841 841
 			array(
842 842
 				'PAY_ID' => array(
843 843
 					'IN',
844
-					array_keys( $payments )
844
+					array_keys($payments)
845 845
 				)
846 846
 			)
847
-		) );
848
-		if ( ! empty( $reg_payments ) ) {
849
-			foreach ( $payments as $payment ) {
850
-				if ( ! $payment instanceof EE_Payment ) {
847
+		));
848
+		if ( ! empty($reg_payments)) {
849
+			foreach ($payments as $payment) {
850
+				if ( ! $payment instanceof EE_Payment) {
851 851
 					continue;
852
-				} else if ( ! isset( $existing_reg_payments[ $payment->ID() ] ) ) {
853
-					$existing_reg_payments[ $payment->ID() ] = array();
852
+				} else if ( ! isset($existing_reg_payments[$payment->ID()])) {
853
+					$existing_reg_payments[$payment->ID()] = array();
854 854
 				}
855
-				foreach ( $reg_payments as $reg_payment ) {
856
-					if ( $reg_payment instanceof EE_Registration_Payment && $reg_payment->payment_ID() === $payment->ID() ) {
857
-						$existing_reg_payments[ $payment->ID() ][ ] = $reg_payment->registration_ID();
855
+				foreach ($reg_payments as $reg_payment) {
856
+					if ($reg_payment instanceof EE_Registration_Payment && $reg_payment->payment_ID() === $payment->ID()) {
857
+						$existing_reg_payments[$payment->ID()][] = $reg_payment->registration_ID();
858 858
 					}
859 859
 				}
860 860
 			}
@@ -891,39 +891,39 @@  discard block
 block discarded – undo
891 891
 		$registrations_to_apply_payment_to .= '<br /><div class="admin-primary-mbox-tbl-wrap">';
892 892
 		$registrations_to_apply_payment_to .= '<table class="admin-primary-mbox-tbl">';
893 893
 		$registrations_to_apply_payment_to .= '<thead><tr>';
894
-		$registrations_to_apply_payment_to .= '<td>' . esc_html__( 'ID', 'event_espresso' ) . '</td>';
895
-		$registrations_to_apply_payment_to .= '<td>' . esc_html__( 'Registrant', 'event_espresso' ) . '</td>';
896
-		$registrations_to_apply_payment_to .= '<td>' . esc_html__( 'Ticket', 'event_espresso' ) . '</td>';
897
-		$registrations_to_apply_payment_to .= '<td>' . esc_html__( 'Event', 'event_espresso' ) . '</td>';
898
-		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-cntr">' . esc_html__( 'Paid', 'event_espresso' ) . '</td>';
899
-		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-cntr">' . esc_html__( 'Owing', 'event_espresso' ) . '</td>';
900
-		$registrations_to_apply_payment_to .= '<td class="jst-cntr">' . esc_html__( 'Apply', 'event_espresso' ) . '</td>';
894
+		$registrations_to_apply_payment_to .= '<td>'.esc_html__('ID', 'event_espresso').'</td>';
895
+		$registrations_to_apply_payment_to .= '<td>'.esc_html__('Registrant', 'event_espresso').'</td>';
896
+		$registrations_to_apply_payment_to .= '<td>'.esc_html__('Ticket', 'event_espresso').'</td>';
897
+		$registrations_to_apply_payment_to .= '<td>'.esc_html__('Event', 'event_espresso').'</td>';
898
+		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-cntr">'.esc_html__('Paid', 'event_espresso').'</td>';
899
+		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-cntr">'.esc_html__('Owing', 'event_espresso').'</td>';
900
+		$registrations_to_apply_payment_to .= '<td class="jst-cntr">'.esc_html__('Apply', 'event_espresso').'</td>';
901 901
 		$registrations_to_apply_payment_to .= '</tr></thead><tbody>';
902 902
 		// get registrations for TXN
903
-		$registrations = $this->_transaction->registrations( $query_params );
904
-		foreach ( $registrations as $registration ) {
905
-			if ( $registration instanceof EE_Registration ) {
903
+		$registrations = $this->_transaction->registrations($query_params);
904
+		foreach ($registrations as $registration) {
905
+			if ($registration instanceof EE_Registration) {
906 906
 				$owing = $registration->final_price() - $registration->paid();
907
-				$taxable = $registration->ticket()->taxable() ? ' <span class="smaller-text lt-grey-text"> ' . esc_html__( '+ tax', 'event_espresso' ) . '</span>' : '';
908
-				$checked = empty( $existing_reg_payments ) || in_array( $registration->ID(), $existing_reg_payments ) ? ' checked="checked"' : '';
909
-				$registrations_to_apply_payment_to .= '<tr id="apply-payment-registration-row-' . $registration->ID() . '">';
907
+				$taxable = $registration->ticket()->taxable() ? ' <span class="smaller-text lt-grey-text"> '.esc_html__('+ tax', 'event_espresso').'</span>' : '';
908
+				$checked = empty($existing_reg_payments) || in_array($registration->ID(), $existing_reg_payments) ? ' checked="checked"' : '';
909
+				$registrations_to_apply_payment_to .= '<tr id="apply-payment-registration-row-'.$registration->ID().'">';
910 910
 				// add html for checkbox input and label
911
-				$registrations_to_apply_payment_to .= '<td>' . $registration->ID() . '</td>';
912
-				$registrations_to_apply_payment_to .= '<td>' . $registration->attendee() instanceof EE_Attendee ? $registration->attendee()->full_name() : esc_html__( 'Unknown Attendee', 'event_espresso' ) . '</td>';
913
-				$registrations_to_apply_payment_to .= '<td>' . $registration->ticket()->name() . ' : ' . $registration->ticket()->pretty_price() . $taxable . '</td>';
914
-				$registrations_to_apply_payment_to .= '<td>' . $registration->event_name() . '</td>';
915
-				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-rght">' . $registration->pretty_paid() . '</td>';
916
-				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-rght">' . EEH_Template::format_currency( $owing ) . '</td>';
911
+				$registrations_to_apply_payment_to .= '<td>'.$registration->ID().'</td>';
912
+				$registrations_to_apply_payment_to .= '<td>'.$registration->attendee() instanceof EE_Attendee ? $registration->attendee()->full_name() : esc_html__('Unknown Attendee', 'event_espresso').'</td>';
913
+				$registrations_to_apply_payment_to .= '<td>'.$registration->ticket()->name().' : '.$registration->ticket()->pretty_price().$taxable.'</td>';
914
+				$registrations_to_apply_payment_to .= '<td>'.$registration->event_name().'</td>';
915
+				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-rght">'.$registration->pretty_paid().'</td>';
916
+				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-rght">'.EEH_Template::format_currency($owing).'</td>';
917 917
 				$registrations_to_apply_payment_to .= '<td class="jst-cntr">';
918 918
 				$disabled = $registration->final_price() > 0 ? '' : ' disabled';
919
-				$registrations_to_apply_payment_to .= '<input type="checkbox" value="' . $registration->ID() . '" name="txn_admin_payment[registrations]"' . $checked . $disabled . '>';
919
+				$registrations_to_apply_payment_to .= '<input type="checkbox" value="'.$registration->ID().'" name="txn_admin_payment[registrations]"'.$checked.$disabled.'>';
920 920
 				$registrations_to_apply_payment_to .= '</td>';
921 921
 				$registrations_to_apply_payment_to .= '</tr>';
922 922
 			}
923 923
 		}
924 924
 		$registrations_to_apply_payment_to .= '</tbody></table></div>';
925
-		$registrations_to_apply_payment_to .= '<p class="clear description">' . esc_html__( '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>';
926
-		$this->_template_args[ 'registrations_to_apply_payment_to' ] = $registrations_to_apply_payment_to;
925
+		$registrations_to_apply_payment_to .= '<p class="clear description">'.esc_html__('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>';
926
+		$this->_template_args['registrations_to_apply_payment_to'] = $registrations_to_apply_payment_to;
927 927
 	}
928 928
 
929 929
 
@@ -940,9 +940,9 @@  discard block
 block discarded – undo
940 940
 		$statuses = EEM_Registration::reg_status_array(array(), TRUE);
941 941
 		//let's add a "don't change" option.
942 942
 		$status_array['NAN'] = esc_html__('Leave the Same', 'event_espresso');
943
-		$status_array = array_merge( $status_array, $statuses );
944
-		$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' );
945
-		$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' );
943
+		$status_array = array_merge($status_array, $statuses);
944
+		$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');
945
+		$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');
946 946
 
947 947
 	}
948 948
 
@@ -957,21 +957,21 @@  discard block
 block discarded – undo
957 957
 	 * @param EE_Payment[] to show on this page
958 958
 	 *	@return void
959 959
 	 */
960
-	private function _get_payment_methods( $payments = array() ) {
960
+	private function _get_payment_methods($payments = array()) {
961 961
 		$payment_methods_of_payments = array();
962
-		foreach( $payments as $payment ){
963
-			if( $payment instanceof EE_Payment ){
964
-				$payment_methods_of_payments[] = $payment->get( 'PMD_ID' );
962
+		foreach ($payments as $payment) {
963
+			if ($payment instanceof EE_Payment) {
964
+				$payment_methods_of_payments[] = $payment->get('PMD_ID');
965 965
 			}
966 966
 		}
967
-		if( $payment_methods_of_payments ){
968
-			$query_args = array( array( 'OR*payment_method_for_payment' => array(
969
-					'PMD_ID' => array( 'IN', $payment_methods_of_payments ),
970
-					'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) ) );
971
-		}else{
972
-			$query_args = array( array( 'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) );
967
+		if ($payment_methods_of_payments) {
968
+			$query_args = array(array('OR*payment_method_for_payment' => array(
969
+					'PMD_ID' => array('IN', $payment_methods_of_payments),
970
+					'PMD_scope' => array('LIKE', '%'.EEM_Payment_Method::scope_admin.'%') )));
971
+		} else {
972
+			$query_args = array(array('PMD_scope' => array('LIKE', '%'.EEM_Payment_Method::scope_admin.'%')));
973 973
 		}
974
-		$this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all( $query_args );
974
+		$this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all($query_args);
975 975
 	}
976 976
 
977 977
 
@@ -985,46 +985,46 @@  discard block
 block discarded – undo
985 985
 	 * @param array $metabox
986 986
 	 * @return void
987 987
 	 */
988
-	public function txn_attendees_meta_box( $post, $metabox = array( 'args' => array() )) {
988
+	public function txn_attendees_meta_box($post, $metabox = array('args' => array())) {
989 989
 
990
-		extract( $metabox['args'] );
990
+		extract($metabox['args']);
991 991
 		$this->_template_args['post'] = $post;
992 992
 		$this->_template_args['event_attendees'] = array();
993 993
 		// process items in cart
994
-		$line_items = $this->_transaction->get_many_related('Line_Item', array( array( 'LIN_type' => 'line-item' ) ) );
995
-		if ( ! empty( $line_items )) {
996
-			foreach ( $line_items as $item ) {
997
-				if ( $item instanceof EE_Line_Item ) {
998
-					switch( $item->OBJ_type() ) {
994
+		$line_items = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => 'line-item')));
995
+		if ( ! empty($line_items)) {
996
+			foreach ($line_items as $item) {
997
+				if ($item instanceof EE_Line_Item) {
998
+					switch ($item->OBJ_type()) {
999 999
 
1000 1000
 						case 'Event' :
1001 1001
 							break;
1002 1002
 
1003 1003
 						case 'Ticket' :
1004 1004
 							$ticket = $item->ticket();
1005
-							if ( empty( $ticket )) {
1005
+							if (empty($ticket)) {
1006 1006
 								continue; //right now we're only handling tickets here.  Cause its expected that only tickets will have attendees right?
1007 1007
 							}
1008
-							$ticket_price = EEH_Template::format_currency( $item->get( 'LIN_unit_price' ));
1008
+							$ticket_price = EEH_Template::format_currency($item->get('LIN_unit_price'));
1009 1009
 							$event = $ticket->get_first_related('Registration')->get_first_related('Event');
1010
-							$event_name = $event instanceof EE_Event ? $event->get('EVT_name') . ' - ' . $item->get('LIN_name') : '';
1010
+							$event_name = $event instanceof EE_Event ? $event->get('EVT_name').' - '.$item->get('LIN_name') : '';
1011 1011
 
1012
-							$registrations = $ticket->get_many_related('Registration', array( array('TXN_ID' => $this->_transaction->ID() )));
1013
-							foreach( $registrations as $registration ) {
1014
-								$this->_template_args['event_attendees'][$registration->ID()]['att_num'] 						= $registration->get('REG_count');
1015
-								$this->_template_args['event_attendees'][$registration->ID()]['event_ticket_name'] 	= $event_name;
1016
-								$this->_template_args['event_attendees'][$registration->ID()]['ticket_price'] 				= $ticket_price;
1012
+							$registrations = $ticket->get_many_related('Registration', array(array('TXN_ID' => $this->_transaction->ID())));
1013
+							foreach ($registrations as $registration) {
1014
+								$this->_template_args['event_attendees'][$registration->ID()]['att_num'] = $registration->get('REG_count');
1015
+								$this->_template_args['event_attendees'][$registration->ID()]['event_ticket_name'] = $event_name;
1016
+								$this->_template_args['event_attendees'][$registration->ID()]['ticket_price'] = $ticket_price;
1017 1017
 								// attendee info
1018 1018
 								$attendee = $registration->get_first_related('Attendee');
1019
-								if ( $attendee instanceof EE_Attendee ) {
1019
+								if ($attendee instanceof EE_Attendee) {
1020 1020
 									$this->_template_args['event_attendees'][$registration->ID()]['att_id'] 			= $attendee->ID();
1021 1021
 									$this->_template_args['event_attendees'][$registration->ID()]['attendee'] 	= $attendee->full_name();
1022
-									$this->_template_args['event_attendees'][$registration->ID()]['email'] 			= '<a href="mailto:' . $attendee->email() . '?subject=' . $event->get('EVT_name') . esc_html__(' Event', 'event_espresso') . '">' . $attendee->email() . '</a>';
1023
-									$this->_template_args['event_attendees'][$registration->ID()]['address'] 		=  implode(',<br>', $attendee->full_address_as_array() );
1022
+									$this->_template_args['event_attendees'][$registration->ID()]['email'] = '<a href="mailto:'.$attendee->email().'?subject='.$event->get('EVT_name').esc_html__(' Event', 'event_espresso').'">'.$attendee->email().'</a>';
1023
+									$this->_template_args['event_attendees'][$registration->ID()]['address'] 		= implode(',<br>', $attendee->full_address_as_array());
1024 1024
 								} else {
1025 1025
 									$this->_template_args['event_attendees'][$registration->ID()]['att_id'] 			= '';
1026 1026
 									$this->_template_args['event_attendees'][$registration->ID()]['attendee'] 	= '';
1027
-									$this->_template_args['event_attendees'][$registration->ID()]['email'] 			= '';
1027
+									$this->_template_args['event_attendees'][$registration->ID()]['email'] = '';
1028 1028
 									$this->_template_args['event_attendees'][$registration->ID()]['address'] 		= '';
1029 1029
 								}
1030 1030
 							}
@@ -1034,12 +1034,12 @@  discard block
 block discarded – undo
1034 1034
 				}
1035 1035
 			}
1036 1036
 
1037
-			$this->_template_args['transaction_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'attendees'  ), TXN_ADMIN_URL );
1038
-			echo EEH_Template::display_template( TXN_TEMPLATE_PATH . 'txn_admin_details_main_meta_box_attendees.template.php', $this->_template_args, TRUE );
1037
+			$this->_template_args['transaction_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'attendees'), TXN_ADMIN_URL);
1038
+			echo EEH_Template::display_template(TXN_TEMPLATE_PATH.'txn_admin_details_main_meta_box_attendees.template.php', $this->_template_args, TRUE);
1039 1039
 
1040 1040
 		} else {
1041 1041
 			echo sprintf(
1042
-				esc_html__( '%1$sFor some reason, there are no attendees registered for this transaction. Likely the registration was abandoned in process.%2$s', 'event_espresso' ),
1042
+				esc_html__('%1$sFor some reason, there are no attendees registered for this transaction. Likely the registration was abandoned in process.%2$s', 'event_espresso'),
1043 1043
 				'<p class="important-notice">',
1044 1044
 				'</p>'
1045 1045
 			);
@@ -1058,19 +1058,19 @@  discard block
 block discarded – undo
1058 1058
 	 */
1059 1059
 	public function txn_registrant_side_meta_box() {
1060 1060
 		$primary_att = $this->_transaction->primary_registration() instanceof EE_Registration ? $this->_transaction->primary_registration()->get_first_related('Attendee') : null;
1061
-		if ( ! $primary_att instanceof EE_Attendee ) {
1061
+		if ( ! $primary_att instanceof EE_Attendee) {
1062 1062
 			$this->_template_args['no_attendee_message'] = esc_html__('There is no attached contact for this transaction.  The transaction either failed due to an error or was abandoned.', 'event_espresso');
1063 1063
 			$primary_att = EEM_Attendee::instance()->create_default_object();
1064 1064
 		}
1065
-		$this->_template_args['ATT_ID'] 						= $primary_att->ID();
1065
+		$this->_template_args['ATT_ID'] = $primary_att->ID();
1066 1066
 		$this->_template_args['prime_reg_fname']		= $primary_att->fname();
1067 1067
 		$this->_template_args['prime_reg_lname']		= $primary_att->lname();
1068
-		$this->_template_args['prime_reg_email'] 		= $primary_att->email();
1068
+		$this->_template_args['prime_reg_email'] = $primary_att->email();
1069 1069
 		$this->_template_args['prime_reg_phone'] 	= $primary_att->phone();
1070
-		$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 );
1070
+		$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);
1071 1071
 		// get formatted address for registrant
1072
-		$this->_template_args[ 'formatted_address' ] = EEH_Address::format( $primary_att );
1073
-		echo EEH_Template::display_template( TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE );
1072
+		$this->_template_args['formatted_address'] = EEH_Address::format($primary_att);
1073
+		echo EEH_Template::display_template(TXN_TEMPLATE_PATH.'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE);
1074 1074
 	}
1075 1075
 
1076 1076
 
@@ -1086,12 +1086,12 @@  discard block
 block discarded – undo
1086 1086
 
1087 1087
 		$this->_template_args['billing_form'] = $this->_transaction->billing_info();
1088 1088
 		$this->_template_args['billing_form_url'] = add_query_arg(
1089
-			array( 'action' => 'edit_transaction', 'process' => 'billing'  ),
1089
+			array('action' => 'edit_transaction', 'process' => 'billing'),
1090 1090
 			TXN_ADMIN_URL
1091 1091
 		);
1092 1092
 
1093
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_billing_info.template.php';
1094
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );/**/
1093
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_side_meta_box_billing_info.template.php';
1094
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); /**/
1095 1095
 	}
1096 1096
 
1097 1097
 
@@ -1104,42 +1104,42 @@  discard block
 block discarded – undo
1104 1104
 	*	@return void
1105 1105
 	*/
1106 1106
 	public function apply_payments_or_refunds() {
1107
-		$json_response_data = array( 'return_data' => FALSE );
1107
+		$json_response_data = array('return_data' => FALSE);
1108 1108
 		$valid_data = $this->_validate_payment_request_data();
1109
-		if ( ! empty( $valid_data ) ) {
1110
-			$PAY_ID = $valid_data[ 'PAY_ID' ];
1109
+		if ( ! empty($valid_data)) {
1110
+			$PAY_ID = $valid_data['PAY_ID'];
1111 1111
 			//save  the new payment
1112
-			$payment = $this->_create_payment_from_request_data( $valid_data );
1112
+			$payment = $this->_create_payment_from_request_data($valid_data);
1113 1113
 			// get the TXN for this payment
1114 1114
 			$transaction = $payment->transaction();
1115 1115
 			// verify transaction
1116
-			if ( $transaction instanceof EE_Transaction ) {
1116
+			if ($transaction instanceof EE_Transaction) {
1117 1117
 				// calculate_total_payments_and_update_status
1118
-				$this->_process_transaction_payments( $transaction );
1119
-				$REG_IDs = $this->_get_REG_IDs_to_apply_payment_to( $payment );
1120
-				$this->_remove_existing_registration_payments( $payment, $PAY_ID );
1118
+				$this->_process_transaction_payments($transaction);
1119
+				$REG_IDs = $this->_get_REG_IDs_to_apply_payment_to($payment);
1120
+				$this->_remove_existing_registration_payments($payment, $PAY_ID);
1121 1121
 				// apply payment to registrations (if applicable)
1122
-				if ( ! empty( $REG_IDs ) ) {
1123
-					$this->_update_registration_payments( $transaction, $payment, $REG_IDs );
1122
+				if ( ! empty($REG_IDs)) {
1123
+					$this->_update_registration_payments($transaction, $payment, $REG_IDs);
1124 1124
 					$this->_maybe_send_notifications();
1125 1125
 					// now process status changes for the same registrations
1126
-					$this->_process_registration_status_change( $transaction, $REG_IDs );
1126
+					$this->_process_registration_status_change($transaction, $REG_IDs);
1127 1127
 				}
1128
-				$this->_maybe_send_notifications( $payment );
1128
+				$this->_maybe_send_notifications($payment);
1129 1129
 				//prepare to render page
1130
-				$json_response_data[ 'return_data' ] = $this->_build_payment_json_response( $payment, $REG_IDs );
1131
-				do_action( 'AHEE__Transactions_Admin_Page__apply_payments_or_refund__after_recording', $transaction, $payment );
1130
+				$json_response_data['return_data'] = $this->_build_payment_json_response($payment, $REG_IDs);
1131
+				do_action('AHEE__Transactions_Admin_Page__apply_payments_or_refund__after_recording', $transaction, $payment);
1132 1132
 			} else {
1133 1133
 				EE_Error::add_error(
1134
-					esc_html__( 'A valid Transaction for this payment could not be retrieved.', 'event_espresso' ),
1134
+					esc_html__('A valid Transaction for this payment could not be retrieved.', 'event_espresso'),
1135 1135
 					__FILE__, __FUNCTION__, __LINE__
1136 1136
 				);
1137 1137
 			}
1138 1138
 		} else {
1139
-			EE_Error::add_error( esc_html__( 'The payment form data could not be processed. Please try again.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1139
+			EE_Error::add_error(esc_html__('The payment form data could not be processed. Please try again.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1140 1140
 		}
1141 1141
 
1142
-		$notices = EE_Error::get_notices( false, false, false );
1142
+		$notices = EE_Error::get_notices(false, false, false);
1143 1143
 		$this->_template_args = array(
1144 1144
 			'data' => $json_response_data,
1145 1145
 			'error' => $notices['errors'],
@@ -1156,30 +1156,30 @@  discard block
 block discarded – undo
1156 1156
 	 * @return array
1157 1157
 	 */
1158 1158
 	protected function _validate_payment_request_data() {
1159
-		if ( ! isset( $this->_req_data[ 'txn_admin_payment' ] ) ) {
1159
+		if ( ! isset($this->_req_data['txn_admin_payment'])) {
1160 1160
 			return false;
1161 1161
 		}
1162 1162
 		$payment_form = $this->_generate_payment_form_section();
1163 1163
 		try {
1164
-			if ( $payment_form->was_submitted() ) {
1164
+			if ($payment_form->was_submitted()) {
1165 1165
 				$payment_form->receive_form_submission();
1166
-				if ( ! $payment_form->is_valid() ) {
1166
+				if ( ! $payment_form->is_valid()) {
1167 1167
 					$submission_error_messages = array();
1168
-					foreach ( $payment_form->get_validation_errors_accumulated() as $validation_error ) {
1169
-						if ( $validation_error instanceof EE_Validation_Error ) {
1168
+					foreach ($payment_form->get_validation_errors_accumulated() as $validation_error) {
1169
+						if ($validation_error instanceof EE_Validation_Error) {
1170 1170
 							$submission_error_messages[] = sprintf(
1171
-								_x( '%s : %s', 'Form Section Name : Form Validation Error', 'event_espresso' ),
1171
+								_x('%s : %s', 'Form Section Name : Form Validation Error', 'event_espresso'),
1172 1172
 								$validation_error->get_form_section()->html_label_text(),
1173 1173
 								$validation_error->getMessage()
1174 1174
 							);
1175 1175
 						}
1176 1176
 					}
1177
-					EE_Error::add_error( join( '<br />', $submission_error_messages ), __FILE__, __FUNCTION__, __LINE__ );
1177
+					EE_Error::add_error(join('<br />', $submission_error_messages), __FILE__, __FUNCTION__, __LINE__);
1178 1178
 					return array();
1179 1179
 				}
1180 1180
 			}
1181
-		} catch ( EE_Error $e ) {
1182
-			EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__ );
1181
+		} catch (EE_Error $e) {
1182
+			EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
1183 1183
 			return array();
1184 1184
 		}
1185 1185
 		return $payment_form->valid_data();
@@ -1201,63 +1201,63 @@  discard block
 block discarded – undo
1201 1201
 						array(
1202 1202
 							'default' => 0,
1203 1203
 							'required' => false,
1204
-							'html_label_text' => esc_html__( 'Payment ID', 'event_espresso' ),
1205
-							'validation_strategies' => array( new EE_Int_Normalization() )
1204
+							'html_label_text' => esc_html__('Payment ID', 'event_espresso'),
1205
+							'validation_strategies' => array(new EE_Int_Normalization())
1206 1206
 						)
1207 1207
 					),
1208 1208
 					'TXN_ID' => new EE_Text_Input(
1209 1209
 						array(
1210 1210
 							'default' => 0,
1211 1211
 							'required' => true,
1212
-							'html_label_text' => esc_html__( 'Transaction ID', 'event_espresso' ),
1213
-							'validation_strategies' => array( new EE_Int_Normalization() )
1212
+							'html_label_text' => esc_html__('Transaction ID', 'event_espresso'),
1213
+							'validation_strategies' => array(new EE_Int_Normalization())
1214 1214
 						)
1215 1215
 					),
1216 1216
 					'type' => new EE_Text_Input(
1217 1217
 						array(
1218 1218
 							'default' => 1,
1219 1219
 							'required' => true,
1220
-							'html_label_text' => esc_html__( 'Payment or Refund', 'event_espresso' ),
1221
-							'validation_strategies' => array( new EE_Int_Normalization() )
1220
+							'html_label_text' => esc_html__('Payment or Refund', 'event_espresso'),
1221
+							'validation_strategies' => array(new EE_Int_Normalization())
1222 1222
 						)
1223 1223
 					),
1224 1224
 					'amount' => new EE_Text_Input(
1225 1225
 						array(
1226 1226
 							'default' => 0,
1227 1227
 							'required' => true,
1228
-							'html_label_text' => esc_html__( 'Payment amount', 'event_espresso' ),
1229
-							'validation_strategies' => array( new EE_Float_Normalization() )
1228
+							'html_label_text' => esc_html__('Payment amount', 'event_espresso'),
1229
+							'validation_strategies' => array(new EE_Float_Normalization())
1230 1230
 						)
1231 1231
 					),
1232 1232
 					'status' => new EE_Text_Input(
1233 1233
 						array(
1234 1234
 							'default' => EEM_Payment::status_id_approved,
1235 1235
 							'required' => true,
1236
-							'html_label_text' => esc_html__( 'Payment status', 'event_espresso' ),
1236
+							'html_label_text' => esc_html__('Payment status', 'event_espresso'),
1237 1237
 						)
1238 1238
 					),
1239 1239
 					'PMD_ID' => new EE_Text_Input(
1240 1240
 						array(
1241 1241
 							'default' => 2,
1242 1242
 							'required' => true,
1243
-							'html_label_text' => esc_html__( 'Payment Method', 'event_espresso' ),
1244
-							'validation_strategies' => array( new EE_Int_Normalization() )
1243
+							'html_label_text' => esc_html__('Payment Method', 'event_espresso'),
1244
+							'validation_strategies' => array(new EE_Int_Normalization())
1245 1245
 						)
1246 1246
 					),
1247 1247
 					'date' => new EE_Text_Input(
1248 1248
 						array(
1249 1249
 							'default' => time(),
1250 1250
 							'required' => true,
1251
-							'html_label_text' => esc_html__( 'Payment date', 'event_espresso' ),
1251
+							'html_label_text' => esc_html__('Payment date', 'event_espresso'),
1252 1252
 						)
1253 1253
 					),
1254 1254
 					'txn_id_chq_nmbr' => new EE_Text_Input(
1255 1255
 						array(
1256 1256
 							'default' => '',
1257 1257
 							'required' => false,
1258
-							'html_label_text' => esc_html__( 'Transaction or Cheque Number', 'event_espresso' ),
1258
+							'html_label_text' => esc_html__('Transaction or Cheque Number', 'event_espresso'),
1259 1259
                                                         'validation_strategies' => array(
1260
-                                                            new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1260
+                                                            new EE_Max_Length_Validation_Strategy(esc_html__('Input too long', 'event_espresso'), 100),
1261 1261
                                                         )
1262 1262
 						)
1263 1263
 					),
@@ -1265,9 +1265,9 @@  discard block
 block discarded – undo
1265 1265
 						array(
1266 1266
 							'default' => '',
1267 1267
 							'required' => false,
1268
-							'html_label_text' => esc_html__( 'Purchase Order Number', 'event_espresso' ),
1268
+							'html_label_text' => esc_html__('Purchase Order Number', 'event_espresso'),
1269 1269
                                                         'validation_strategies' => array(
1270
-                                                            new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1270
+                                                            new EE_Max_Length_Validation_Strategy(esc_html__('Input too long', 'event_espresso'), 100),
1271 1271
                                                         )
1272 1272
 						)
1273 1273
 					),
@@ -1275,9 +1275,9 @@  discard block
 block discarded – undo
1275 1275
 						array(
1276 1276
 							'default' => '',
1277 1277
 							'required' => false,
1278
-							'html_label_text' => esc_html__( 'Extra Field for Accounting', 'event_espresso' ),
1278
+							'html_label_text' => esc_html__('Extra Field for Accounting', 'event_espresso'),
1279 1279
                                                         'validation_strategies' => array(
1280
-                                                            new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1280
+                                                            new EE_Max_Length_Validation_Strategy(esc_html__('Input too long', 'event_espresso'), 100),
1281 1281
                                                         )
1282 1282
 						)
1283 1283
 					),
@@ -1294,37 +1294,37 @@  discard block
 block discarded – undo
1294 1294
 	 * @param array $valid_data
1295 1295
 	 * @return EE_Payment
1296 1296
 	 */
1297
-	protected function _create_payment_from_request_data( $valid_data ) {
1298
-		$PAY_ID = $valid_data[ 'PAY_ID' ];
1297
+	protected function _create_payment_from_request_data($valid_data) {
1298
+		$PAY_ID = $valid_data['PAY_ID'];
1299 1299
 		// get payment amount
1300
-		$amount = $valid_data[ 'amount' ] ? abs( $valid_data[ 'amount' ] ) : 0;
1300
+		$amount = $valid_data['amount'] ? abs($valid_data['amount']) : 0;
1301 1301
 		// payments have a type value of 1 and refunds have a type value of -1
1302 1302
 		// so multiplying amount by type will give a positive value for payments, and negative values for refunds
1303
-		$amount = $valid_data[ 'type' ] < 0 ? $amount * -1 : $amount;
1303
+		$amount = $valid_data['type'] < 0 ? $amount * -1 : $amount;
1304 1304
 		// for some reason the date string coming in has extra spaces between the date and time.  This fixes that.
1305
-		$date = $valid_data['date'] ? preg_replace( '/\s+/', ' ', $valid_data['date'] ) : date( 'Y-m-d g:i a', current_time( 'timestamp' ) );
1305
+		$date = $valid_data['date'] ? preg_replace('/\s+/', ' ', $valid_data['date']) : date('Y-m-d g:i a', current_time('timestamp'));
1306 1306
 		$payment = EE_Payment::new_instance(
1307 1307
 			array(
1308
-				'TXN_ID' 								=> $valid_data[ 'TXN_ID' ],
1309
-				'STS_ID' 								=> $valid_data[ 'status' ],
1308
+				'TXN_ID' 								=> $valid_data['TXN_ID'],
1309
+				'STS_ID' 								=> $valid_data['status'],
1310 1310
 				'PAY_timestamp' 				=> $date,
1311 1311
 				'PAY_source'           			=> EEM_Payment_Method::scope_admin,
1312
-				'PMD_ID'               				=> $valid_data[ 'PMD_ID' ],
1312
+				'PMD_ID'               				=> $valid_data['PMD_ID'],
1313 1313
 				'PAY_amount'           			=> $amount,
1314
-				'PAY_txn_id_chq_nmbr'  	=> $valid_data[ 'txn_id_chq_nmbr' ],
1315
-				'PAY_po_number'        		=> $valid_data[ 'po_number' ],
1316
-				'PAY_extra_accntng'    		=> $valid_data[ 'accounting' ],
1314
+				'PAY_txn_id_chq_nmbr'  	=> $valid_data['txn_id_chq_nmbr'],
1315
+				'PAY_po_number'        		=> $valid_data['po_number'],
1316
+				'PAY_extra_accntng'    		=> $valid_data['accounting'],
1317 1317
 				'PAY_details'          				=> $valid_data,
1318 1318
 				'PAY_ID'               				=> $PAY_ID
1319 1319
 			),
1320 1320
 			'',
1321
-			array( 'Y-m-d', 'g:i a' )
1321
+			array('Y-m-d', 'g:i a')
1322 1322
 		);
1323 1323
 
1324
-		if ( ! $payment->save() ) {
1324
+		if ( ! $payment->save()) {
1325 1325
 			EE_Error::add_error(
1326 1326
 				sprintf(
1327
-					esc_html__( 'Payment %1$d has not been successfully saved to the database.', 'event_espresso' ),
1327
+					esc_html__('Payment %1$d has not been successfully saved to the database.', 'event_espresso'),
1328 1328
 					$payment->ID()
1329 1329
 				),
1330 1330
 				__FILE__, __FUNCTION__, __LINE__
@@ -1341,15 +1341,15 @@  discard block
 block discarded – undo
1341 1341
 	 * @param \EE_Transaction $transaction
1342 1342
 	 * @return array
1343 1343
 	 */
1344
-	protected function _process_transaction_payments( EE_Transaction $transaction ) {
1344
+	protected function _process_transaction_payments(EE_Transaction $transaction) {
1345 1345
 		/** @type EE_Transaction_Payments $transaction_payments */
1346
-		$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1346
+		$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1347 1347
 		//update the transaction with this payment
1348
-		if ( $transaction_payments->calculate_total_payments_and_update_status( $transaction ) ) {
1349
-			EE_Error::add_success( esc_html__( 'The payment has been processed successfully.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1348
+		if ($transaction_payments->calculate_total_payments_and_update_status($transaction)) {
1349
+			EE_Error::add_success(esc_html__('The payment has been processed successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1350 1350
 		} else {
1351 1351
 			EE_Error::add_error(
1352
-				esc_html__( 'The payment was processed successfully but the amount paid for the transaction was not updated.', 'event_espresso' )
1352
+				esc_html__('The payment was processed successfully but the amount paid for the transaction was not updated.', 'event_espresso')
1353 1353
 				, __FILE__, __FUNCTION__, __LINE__
1354 1354
 			);
1355 1355
 		}
@@ -1365,19 +1365,19 @@  discard block
 block discarded – undo
1365 1365
 	 * @param \EE_Payment $payment
1366 1366
 	 * @return array
1367 1367
 	 */
1368
-	protected function _get_REG_IDs_to_apply_payment_to( EE_Payment $payment ) {
1368
+	protected function _get_REG_IDs_to_apply_payment_to(EE_Payment $payment) {
1369 1369
 		$REG_IDs = array();
1370 1370
 		// grab array of IDs for specific registrations to apply changes to
1371
-		if ( isset( $this->_req_data[ 'txn_admin_payment' ][ 'registrations' ] ) ) {
1372
-			$REG_IDs = (array)$this->_req_data[ 'txn_admin_payment' ][ 'registrations' ];
1371
+		if (isset($this->_req_data['txn_admin_payment']['registrations'])) {
1372
+			$REG_IDs = (array) $this->_req_data['txn_admin_payment']['registrations'];
1373 1373
 		}
1374 1374
 		//nothing specified ? then get all reg IDs
1375
-		if ( empty( $REG_IDs ) ) {
1375
+		if (empty($REG_IDs)) {
1376 1376
 			$registrations = $payment->transaction()->registrations();
1377
-			$REG_IDs = ! empty( $registrations ) ? array_keys( $registrations ) : $this->_get_existing_reg_payment_REG_IDs( $payment );
1377
+			$REG_IDs = ! empty($registrations) ? array_keys($registrations) : $this->_get_existing_reg_payment_REG_IDs($payment);
1378 1378
 		}
1379 1379
 		// ensure that REG_IDs are integers and NOT strings
1380
-		return array_map( 'intval', $REG_IDs );
1380
+		return array_map('intval', $REG_IDs);
1381 1381
 	}
1382 1382
 
1383 1383
 
@@ -1394,7 +1394,7 @@  discard block
 block discarded – undo
1394 1394
 	/**
1395 1395
 	 * @param array $existing_reg_payment_REG_IDs
1396 1396
 	 */
1397
-	public function set_existing_reg_payment_REG_IDs( $existing_reg_payment_REG_IDs = null ) {
1397
+	public function set_existing_reg_payment_REG_IDs($existing_reg_payment_REG_IDs = null) {
1398 1398
 		$this->_existing_reg_payment_REG_IDs = $existing_reg_payment_REG_IDs;
1399 1399
 	}
1400 1400
 
@@ -1409,13 +1409,13 @@  discard block
 block discarded – undo
1409 1409
 	 * @param \EE_Payment $payment
1410 1410
 	 * @return array
1411 1411
 	 */
1412
-	protected function _get_existing_reg_payment_REG_IDs( EE_Payment $payment ) {
1413
-		if ( $this->existing_reg_payment_REG_IDs() === null ) {
1412
+	protected function _get_existing_reg_payment_REG_IDs(EE_Payment $payment) {
1413
+		if ($this->existing_reg_payment_REG_IDs() === null) {
1414 1414
 			// let's get any existing reg payment records for this payment
1415
-			$existing_reg_payment_REG_IDs = $payment->get_many_related( 'Registration' );
1415
+			$existing_reg_payment_REG_IDs = $payment->get_many_related('Registration');
1416 1416
 			// but we only want the REG IDs, so grab the array keys
1417
-			$existing_reg_payment_REG_IDs = ! empty( $existing_reg_payment_REG_IDs ) ? array_keys( $existing_reg_payment_REG_IDs ) : array();
1418
-			$this->set_existing_reg_payment_REG_IDs( $existing_reg_payment_REG_IDs );
1417
+			$existing_reg_payment_REG_IDs = ! empty($existing_reg_payment_REG_IDs) ? array_keys($existing_reg_payment_REG_IDs) : array();
1418
+			$this->set_existing_reg_payment_REG_IDs($existing_reg_payment_REG_IDs);
1419 1419
 		}
1420 1420
 		return $this->existing_reg_payment_REG_IDs();
1421 1421
 	}
@@ -1434,23 +1434,23 @@  discard block
 block discarded – undo
1434 1434
 	 * @param int         $PAY_ID
1435 1435
 	 * @return bool;
1436 1436
 	 */
1437
-	protected function _remove_existing_registration_payments( EE_Payment $payment, $PAY_ID = 0 ) {
1437
+	protected function _remove_existing_registration_payments(EE_Payment $payment, $PAY_ID = 0) {
1438 1438
 		// newly created payments will have nothing recorded for $PAY_ID
1439
-		if ( $PAY_ID == 0 ) {
1439
+		if ($PAY_ID == 0) {
1440 1440
 			return false;
1441 1441
 		}
1442
-		$existing_reg_payment_REG_IDs = $this->_get_existing_reg_payment_REG_IDs( $payment );
1443
-		if ( empty( $existing_reg_payment_REG_IDs )) {
1442
+		$existing_reg_payment_REG_IDs = $this->_get_existing_reg_payment_REG_IDs($payment);
1443
+		if (empty($existing_reg_payment_REG_IDs)) {
1444 1444
 			return false;
1445 1445
 		}
1446 1446
 		/** @type EE_Transaction_Payments $transaction_payments */
1447
-		$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1447
+		$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1448 1448
 		return $transaction_payments->delete_registration_payments_and_update_registrations(
1449 1449
 			$payment,
1450 1450
 			array(
1451 1451
 				array(
1452 1452
 					'PAY_ID' => $payment->ID(),
1453
-					'REG_ID' => array( 'IN', $existing_reg_payment_REG_IDs ),
1453
+					'REG_ID' => array('IN', $existing_reg_payment_REG_IDs),
1454 1454
 				)
1455 1455
 			)
1456 1456
 		);
@@ -1469,25 +1469,25 @@  discard block
 block discarded – undo
1469 1469
 	 * @param array $REG_IDs
1470 1470
 	 * @return bool
1471 1471
 	 */
1472
-	protected function _update_registration_payments( EE_Transaction $transaction, EE_Payment $payment, $REG_IDs = array() ) {
1472
+	protected function _update_registration_payments(EE_Transaction $transaction, EE_Payment $payment, $REG_IDs = array()) {
1473 1473
 		// we can pass our own custom set of registrations to EE_Payment_Processor::process_registration_payments()
1474 1474
 		// so let's do that using our set of REG_IDs from the form
1475 1475
 		$registration_query_where_params = array(
1476
-			'REG_ID' => array( 'IN', $REG_IDs )
1476
+			'REG_ID' => array('IN', $REG_IDs)
1477 1477
 		);
1478 1478
 		// but add in some conditions regarding payment,
1479 1479
 		// so that we don't apply payments to registrations that are free or have already been paid for
1480 1480
 		// but ONLY if the payment is NOT a refund ( ie: the payment amount is not negative )
1481
-		if ( ! $payment->is_a_refund() ) {
1482
-			$registration_query_where_params[ 'REG_final_price' ]  = array( '!=', 0 );
1483
-			$registration_query_where_params[ 'REG_final_price*' ]  = array( '!=', 'REG_paid', true );
1481
+		if ( ! $payment->is_a_refund()) {
1482
+			$registration_query_where_params['REG_final_price'] = array('!=', 0);
1483
+			$registration_query_where_params['REG_final_price*'] = array('!=', 'REG_paid', true);
1484 1484
 		}
1485 1485
 		//EEH_Debug_Tools::printr( $registration_query_where_params, '$registration_query_where_params', __FILE__, __LINE__ );
1486
-		$registrations = $transaction->registrations( array( $registration_query_where_params ) );
1487
-		if ( ! empty( $registrations ) ) {
1486
+		$registrations = $transaction->registrations(array($registration_query_where_params));
1487
+		if ( ! empty($registrations)) {
1488 1488
 			/** @type EE_Payment_Processor $payment_processor */
1489
-			$payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' );
1490
-			$payment_processor->process_registration_payments( $transaction, $payment, $registrations );
1489
+			$payment_processor = EE_Registry::instance()->load_core('Payment_Processor');
1490
+			$payment_processor->process_registration_payments($transaction, $payment, $registrations);
1491 1491
 		}
1492 1492
 	}
1493 1493
 
@@ -1503,22 +1503,22 @@  discard block
 block discarded – undo
1503 1503
 	 * @param array $REG_IDs
1504 1504
 	 * @return bool
1505 1505
 	 */
1506
-	protected function _process_registration_status_change( EE_Transaction $transaction, $REG_IDs = array() ) {
1506
+	protected function _process_registration_status_change(EE_Transaction $transaction, $REG_IDs = array()) {
1507 1507
 		// first if there is no change in status then we get out.
1508 1508
 		if (
1509
-			! isset( $this->_req_data['txn_reg_status_change'], $this->_req_data[ 'txn_reg_status_change' ][ 'reg_status' ] )
1509
+			! isset($this->_req_data['txn_reg_status_change'], $this->_req_data['txn_reg_status_change']['reg_status'])
1510 1510
 			|| $this->_req_data['txn_reg_status_change']['reg_status'] == 'NAN'
1511 1511
 		) {
1512 1512
 			//no error message, no change requested, just nothing to do man.
1513 1513
 			return FALSE;
1514 1514
 		}
1515 1515
 		/** @type EE_Transaction_Processor $transaction_processor */
1516
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1516
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1517 1517
 		// made it here dude?  Oh WOW.  K, let's take care of changing the statuses
1518 1518
 		return $transaction_processor->manually_update_registration_statuses(
1519 1519
 			$transaction,
1520
-			sanitize_text_field( $this->_req_data[ 'txn_reg_status_change' ][ 'reg_status' ] ),
1521
-			array( array( 'REG_ID' => array( 'IN', $REG_IDs ) ) )
1520
+			sanitize_text_field($this->_req_data['txn_reg_status_change']['reg_status']),
1521
+			array(array('REG_ID' => array('IN', $REG_IDs)))
1522 1522
 		);
1523 1523
 	}
1524 1524
 
@@ -1533,16 +1533,16 @@  discard block
 block discarded – undo
1533 1533
 	 * @param bool | null        $delete_txn_reg_status_change
1534 1534
 	 * @return array
1535 1535
 	 */
1536
-	protected function _build_payment_json_response( EE_Payment $payment, $REG_IDs = array(), $delete_txn_reg_status_change = null ) {
1536
+	protected function _build_payment_json_response(EE_Payment $payment, $REG_IDs = array(), $delete_txn_reg_status_change = null) {
1537 1537
 		// was the payment deleted ?
1538
-		if ( is_bool( $delete_txn_reg_status_change )) {
1538
+		if (is_bool($delete_txn_reg_status_change)) {
1539 1539
 			return array(
1540 1540
 				'PAY_ID' 				=> $payment->ID(),
1541 1541
 				'amount' 			=> $payment->amount(),
1542 1542
 				'total_paid' 			=> $payment->transaction()->paid(),
1543 1543
 				'txn_status' 			=> $payment->transaction()->status_ID(),
1544 1544
 				'pay_status' 		=> $payment->STS_ID(),
1545
-				'registrations' 	=> $this->_registration_payment_data_array( $REG_IDs ),
1545
+				'registrations' 	=> $this->_registration_payment_data_array($REG_IDs),
1546 1546
 				'delete_txn_reg_status_change' => $delete_txn_reg_status_change,
1547 1547
 			);
1548 1548
 		} else {
@@ -1554,16 +1554,16 @@  discard block
 block discarded – undo
1554 1554
 				'pay_status' 	=> $payment->STS_ID(),
1555 1555
 				'PAY_ID'           => $payment->ID(),
1556 1556
 				'STS_ID' 			=> $payment->STS_ID(),
1557
-				'status' 			=> self::$_pay_status[ $payment->STS_ID() ],
1558
-				'date' 				=> $payment->timestamp( 'Y-m-d', 'h:i a' ),
1559
-				'method' 		=> strtoupper( $payment->source() ),
1557
+				'status' 			=> self::$_pay_status[$payment->STS_ID()],
1558
+				'date' 				=> $payment->timestamp('Y-m-d', 'h:i a'),
1559
+				'method' 		=> strtoupper($payment->source()),
1560 1560
 				'PM_ID' 			=> $payment->payment_method() ? $payment->payment_method()->ID() : 1,
1561
-				'gateway' 		=> $payment->payment_method() ? $payment->payment_method()->admin_name() : esc_html__( "Unknown", 'event_espresso' ),
1561
+				'gateway' 		=> $payment->payment_method() ? $payment->payment_method()->admin_name() : esc_html__("Unknown", 'event_espresso'),
1562 1562
 				'gateway_response' 	=> $payment->gateway_response(),
1563 1563
 				'txn_id_chq_nmbr'  	=> $payment->txn_id_chq_nmbr(),
1564 1564
 				'po_number'        		=> $payment->po_number(),
1565 1565
 				'extra_accntng'    		=> $payment->extra_accntng(),
1566
-				'registrations'    			=> $this->_registration_payment_data_array( $REG_IDs ),
1566
+				'registrations'    			=> $this->_registration_payment_data_array($REG_IDs),
1567 1567
 			);
1568 1568
 		}
1569 1569
 	}
@@ -1578,39 +1578,39 @@  discard block
 block discarded – undo
1578 1578
 	*	@return void
1579 1579
 	*/
1580 1580
 	public function delete_payment() {
1581
-		$json_response_data = array( 'return_data' => FALSE );
1582
-		$PAY_ID = isset( $this->_req_data['delete_txn_admin_payment'], $this->_req_data['delete_txn_admin_payment']['PAY_ID'] ) ? absint( $this->_req_data['delete_txn_admin_payment']['PAY_ID'] ) : 0;
1583
-		if ( $PAY_ID ) {
1584
-			$delete_txn_reg_status_change = isset( $this->_req_data[ 'delete_txn_reg_status_change' ] ) ? $this->_req_data[ 'delete_txn_reg_status_change' ] : false;
1585
-			$payment = EEM_Payment::instance()->get_one_by_ID( $PAY_ID );
1586
-			if ( $payment instanceof EE_Payment ) {
1587
-				$REG_IDs = $this->_get_existing_reg_payment_REG_IDs( $payment );
1581
+		$json_response_data = array('return_data' => FALSE);
1582
+		$PAY_ID = isset($this->_req_data['delete_txn_admin_payment'], $this->_req_data['delete_txn_admin_payment']['PAY_ID']) ? absint($this->_req_data['delete_txn_admin_payment']['PAY_ID']) : 0;
1583
+		if ($PAY_ID) {
1584
+			$delete_txn_reg_status_change = isset($this->_req_data['delete_txn_reg_status_change']) ? $this->_req_data['delete_txn_reg_status_change'] : false;
1585
+			$payment = EEM_Payment::instance()->get_one_by_ID($PAY_ID);
1586
+			if ($payment instanceof EE_Payment) {
1587
+				$REG_IDs = $this->_get_existing_reg_payment_REG_IDs($payment);
1588 1588
 				/** @type EE_Transaction_Payments $transaction_payments */
1589
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1590
-				if ( $transaction_payments->delete_payment_and_update_transaction( $payment )) {
1591
-					$json_response_data['return_data'] = $this->_build_payment_json_response( $payment, $REG_IDs, $delete_txn_reg_status_change );
1592
-					if ( $delete_txn_reg_status_change ) {
1589
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1590
+				if ($transaction_payments->delete_payment_and_update_transaction($payment)) {
1591
+					$json_response_data['return_data'] = $this->_build_payment_json_response($payment, $REG_IDs, $delete_txn_reg_status_change);
1592
+					if ($delete_txn_reg_status_change) {
1593 1593
 						$this->_req_data['txn_reg_status_change'] = $delete_txn_reg_status_change;
1594 1594
 						//MAKE sure we also add the delete_txn_req_status_change to the
1595 1595
 						//$_REQUEST global because that's how messages will be looking for it.
1596 1596
 						$_REQUEST['txn_reg_status_change'] = $delete_txn_reg_status_change;
1597 1597
 						$this->_maybe_send_notifications();
1598
-						$this->_process_registration_status_change( $payment->transaction(), $REG_IDs );
1598
+						$this->_process_registration_status_change($payment->transaction(), $REG_IDs);
1599 1599
 					}
1600 1600
 				}
1601 1601
 			} else {
1602 1602
 				EE_Error::add_error(
1603
-					esc_html__( 'Valid Payment data could not be retrieved from the database.', 'event_espresso' ),
1603
+					esc_html__('Valid Payment data could not be retrieved from the database.', 'event_espresso'),
1604 1604
 					__FILE__, __FUNCTION__, __LINE__
1605 1605
 				);
1606 1606
 			}
1607 1607
 		} else {
1608 1608
 			EE_Error::add_error(
1609
-				esc_html__( 'A valid Payment ID was not received, therefore payment form data could not be loaded.', 'event_espresso' ),
1609
+				esc_html__('A valid Payment ID was not received, therefore payment form data could not be loaded.', 'event_espresso'),
1610 1610
 				__FILE__, __FUNCTION__, __LINE__
1611 1611
 			);
1612 1612
 		}
1613
-		$notices = EE_Error::get_notices( false, false, false);
1613
+		$notices = EE_Error::get_notices(false, false, false);
1614 1614
 		$this->_template_args = array(
1615 1615
 			'data' => $json_response_data,
1616 1616
 			'success' => $notices['success'],
@@ -1630,16 +1630,16 @@  discard block
 block discarded – undo
1630 1630
 	 * @param array $REG_IDs
1631 1631
 	 * @return array
1632 1632
 	 */
1633
-	protected function _registration_payment_data_array( $REG_IDs ) {
1633
+	protected function _registration_payment_data_array($REG_IDs) {
1634 1634
 		$registration_payment_data = array();
1635 1635
 		//if non empty reg_ids lets get an array of registrations and update the values for the apply_payment/refund rows.
1636
-		if ( ! empty( $REG_IDs ) ) {
1637
-			$registrations = EEM_Registration::instance()->get_all( array( array( 'REG_ID' => array( 'IN', $REG_IDs ) ) ) );
1638
-			foreach ( $registrations as $registration ) {
1639
-				if ( $registration instanceof EE_Registration ) {
1640
-					$registration_payment_data[ $registration->ID() ] = array(
1636
+		if ( ! empty($REG_IDs)) {
1637
+			$registrations = EEM_Registration::instance()->get_all(array(array('REG_ID' => array('IN', $REG_IDs))));
1638
+			foreach ($registrations as $registration) {
1639
+				if ($registration instanceof EE_Registration) {
1640
+					$registration_payment_data[$registration->ID()] = array(
1641 1641
 						'paid' => $registration->pretty_paid(),
1642
-						'owing' => EEH_Template::format_currency( $registration->final_price() - $registration->paid() ),
1642
+						'owing' => EEH_Template::format_currency($registration->final_price() - $registration->paid()),
1643 1643
 					);
1644 1644
 				}
1645 1645
 			}
@@ -1659,30 +1659,30 @@  discard block
 block discarded – undo
1659 1659
 	 * @access protected
1660 1660
 	 * @param \EE_Payment | null $payment
1661 1661
 	 */
1662
-	protected function _maybe_send_notifications( $payment = null ) {
1663
-		switch ( $payment instanceof EE_Payment ) {
1662
+	protected function _maybe_send_notifications($payment = null) {
1663
+		switch ($payment instanceof EE_Payment) {
1664 1664
 			// payment notifications
1665 1665
 			case true :
1666 1666
 				if (
1667 1667
 					isset(
1668
-						$this->_req_data[ 'txn_payments' ],
1669
-						$this->_req_data[ 'txn_payments' ][ 'send_notifications' ]
1668
+						$this->_req_data['txn_payments'],
1669
+						$this->_req_data['txn_payments']['send_notifications']
1670 1670
 					) &&
1671
-					filter_var( $this->_req_data[ 'txn_payments' ][ 'send_notifications' ], FILTER_VALIDATE_BOOLEAN )
1671
+					filter_var($this->_req_data['txn_payments']['send_notifications'], FILTER_VALIDATE_BOOLEAN)
1672 1672
 				) {
1673
-					$this->_process_payment_notification( $payment );
1673
+					$this->_process_payment_notification($payment);
1674 1674
 				}
1675 1675
 				break;
1676 1676
 			// registration notifications
1677 1677
 			case false :
1678 1678
 				if (
1679 1679
 					isset(
1680
-						$this->_req_data[ 'txn_reg_status_change' ],
1681
-						$this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ]
1680
+						$this->_req_data['txn_reg_status_change'],
1681
+						$this->_req_data['txn_reg_status_change']['send_notifications']
1682 1682
 					) &&
1683
-					filter_var( $this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ], FILTER_VALIDATE_BOOLEAN )
1683
+					filter_var($this->_req_data['txn_reg_status_change']['send_notifications'], FILTER_VALIDATE_BOOLEAN)
1684 1684
 				) {
1685
-					add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true' );
1685
+					add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true');
1686 1686
 				}
1687 1687
 				break;
1688 1688
 		}
@@ -1698,11 +1698,11 @@  discard block
 block discarded – undo
1698 1698
 	*	@return void
1699 1699
 	*/
1700 1700
 	protected function _send_payment_reminder() {
1701
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1702
-		$transaction = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
1703
-		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID'] ) : array();
1704
-		do_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction );
1705
-		$this->_redirect_after_action( FALSE, esc_html__('payment reminder', 'event_espresso'), esc_html__('sent', 'event_espresso'), $query_args, TRUE );
1701
+	    $TXN_ID = ( ! empty($this->_req_data['TXN_ID'])) ? absint($this->_req_data['TXN_ID']) : FALSE;
1702
+		$transaction = EEM_Transaction::instance()->get_one_by_ID($TXN_ID);
1703
+		$query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID']) : array();
1704
+		do_action('AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction);
1705
+		$this->_redirect_after_action(FALSE, esc_html__('payment reminder', 'event_espresso'), esc_html__('sent', 'event_espresso'), $query_args, TRUE);
1706 1706
 	}
1707 1707
 
1708 1708
 
@@ -1716,36 +1716,36 @@  discard block
 block discarded – undo
1716 1716
 	 * @param string   $view
1717 1717
 	 * @return mixed int = count || array of transaction objects
1718 1718
 	 */
1719
-	public function get_transactions( $perpage, $count = FALSE, $view = '' ) {
1719
+	public function get_transactions($perpage, $count = FALSE, $view = '') {
1720 1720
 
1721 1721
 		$TXN = EEM_Transaction::instance();
1722 1722
 
1723
-	    $start_date = isset( $this->_req_data['txn-filter-start-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-start-date'] ) : date( 'm/d/Y', strtotime( '-10 year' ));
1724
-	    $end_date = isset( $this->_req_data['txn-filter-end-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-end-date'] ) : date( 'm/d/Y' );
1723
+	    $start_date = isset($this->_req_data['txn-filter-start-date']) ? wp_strip_all_tags($this->_req_data['txn-filter-start-date']) : date('m/d/Y', strtotime('-10 year'));
1724
+	    $end_date = isset($this->_req_data['txn-filter-end-date']) ? wp_strip_all_tags($this->_req_data['txn-filter-end-date']) : date('m/d/Y');
1725 1725
 
1726 1726
 	    //make sure our timestamps start and end right at the boundaries for each day
1727
-	    $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1728
-	    $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1727
+	    $start_date = date('Y-m-d', strtotime($start_date)).' 00:00:00';
1728
+	    $end_date = date('Y-m-d', strtotime($end_date)).' 23:59:59';
1729 1729
 
1730 1730
 
1731 1731
 	    //convert to timestamps
1732
-	    $start_date = strtotime( $start_date );
1733
-	    $end_date = strtotime( $end_date );
1732
+	    $start_date = strtotime($start_date);
1733
+	    $end_date = strtotime($end_date);
1734 1734
 
1735 1735
 	    //makes sure start date is the lowest value and vice versa
1736
-	    $start_date = min( $start_date, $end_date );
1737
-	    $end_date = max( $start_date, $end_date );
1736
+	    $start_date = min($start_date, $end_date);
1737
+	    $end_date = max($start_date, $end_date);
1738 1738
 
1739 1739
 	    //convert to correct format for query
1740
-	$start_date = EEM_Transaction::instance()->convert_datetime_for_query( 'TXN_timestamp', date( 'Y-m-d H:i:s', $start_date ), 'Y-m-d H:i:s' );
1741
-	$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' );
1740
+	$start_date = EEM_Transaction::instance()->convert_datetime_for_query('TXN_timestamp', date('Y-m-d H:i:s', $start_date), 'Y-m-d H:i:s');
1741
+	$end_date = EEM_Transaction::instance()->convert_datetime_for_query('TXN_timestamp', date('Y-m-d H:i:s', $end_date), 'Y-m-d H:i:s');
1742 1742
 
1743 1743
 
1744 1744
 
1745 1745
 	    //set orderby
1746 1746
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
1747 1747
 
1748
-		switch ( $this->_req_data['orderby'] ) {
1748
+		switch ($this->_req_data['orderby']) {
1749 1749
 			case 'TXN_ID':
1750 1750
 				$orderby = 'TXN_ID';
1751 1751
 				break;
@@ -1759,66 +1759,66 @@  discard block
 block discarded – undo
1759 1759
 				$orderby = 'TXN_timestamp';
1760 1760
 		}
1761 1761
 
1762
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC';
1763
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
1764
-		$per_page = isset( $perpage ) && !empty( $perpage ) ? $perpage : 10;
1765
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
1762
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC';
1763
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
1764
+		$per_page = isset($perpage) && ! empty($perpage) ? $perpage : 10;
1765
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
1766 1766
 
1767
-		$offset = ($current_page-1)*$per_page;
1768
-		$limit = array( $offset, $per_page );
1767
+		$offset = ($current_page - 1) * $per_page;
1768
+		$limit = array($offset, $per_page);
1769 1769
 
1770 1770
 		$_where = array(
1771
-			'TXN_timestamp' => array('BETWEEN', array($start_date, $end_date) ),
1771
+			'TXN_timestamp' => array('BETWEEN', array($start_date, $end_date)),
1772 1772
 			'Registration.REG_count' => 1
1773 1773
 		);
1774 1774
 
1775
-		if ( isset( $this->_req_data['EVT_ID'] ) ) {
1775
+		if (isset($this->_req_data['EVT_ID'])) {
1776 1776
 			$_where['Registration.EVT_ID'] = $this->_req_data['EVT_ID'];
1777 1777
 		}
1778 1778
 
1779
-		if ( isset( $this->_req_data['s'] ) ) {
1780
-			$search_string = '%' . $this->_req_data['s'] . '%';
1779
+		if (isset($this->_req_data['s'])) {
1780
+			$search_string = '%'.$this->_req_data['s'].'%';
1781 1781
 			$_where['OR'] = array(
1782
-				'Registration.Event.EVT_name' => array( 'LIKE', $search_string ),
1783
-				'Registration.Event.EVT_desc' => array( 'LIKE', $search_string ),
1784
-				'Registration.Event.EVT_short_desc' => array( 'LIKE' , $search_string ),
1785
-				'Registration.Attendee.ATT_full_name' => array( 'LIKE', $search_string ),
1786
-				'Registration.Attendee.ATT_fname' => array( 'LIKE', $search_string ),
1787
-				'Registration.Attendee.ATT_lname' => array( 'LIKE', $search_string ),
1788
-				'Registration.Attendee.ATT_short_bio' => array( 'LIKE', $search_string ),
1789
-				'Registration.Attendee.ATT_email' => array('LIKE', $search_string ),
1790
-				'Registration.Attendee.ATT_address' => array( 'LIKE', $search_string ),
1791
-				'Registration.Attendee.ATT_address2' => array( 'LIKE', $search_string ),
1792
-				'Registration.Attendee.ATT_city' => array( 'LIKE', $search_string ),
1793
-				'Registration.REG_final_price' => array( 'LIKE', $search_string ),
1794
-				'Registration.REG_code' => array( 'LIKE', $search_string ),
1795
-				'Registration.REG_count' => array( 'LIKE' , $search_string ),
1796
-				'Registration.REG_group_size' => array( 'LIKE' , $search_string ),
1797
-				'Registration.Ticket.TKT_name' => array( 'LIKE', $search_string ),
1798
-				'Registration.Ticket.TKT_description' => array( 'LIKE', $search_string ),
1799
-				'Payment.PAY_source' => array('LIKE', $search_string ),
1800
-				'Payment.Payment_Method.PMD_name' => array('LIKE', $search_string ),
1801
-				'TXN_session_data' => array( 'LIKE', $search_string ),
1802
-				'Payment.PAY_txn_id_chq_nmbr' => array( 'LIKE', $search_string )
1782
+				'Registration.Event.EVT_name' => array('LIKE', $search_string),
1783
+				'Registration.Event.EVT_desc' => array('LIKE', $search_string),
1784
+				'Registration.Event.EVT_short_desc' => array('LIKE', $search_string),
1785
+				'Registration.Attendee.ATT_full_name' => array('LIKE', $search_string),
1786
+				'Registration.Attendee.ATT_fname' => array('LIKE', $search_string),
1787
+				'Registration.Attendee.ATT_lname' => array('LIKE', $search_string),
1788
+				'Registration.Attendee.ATT_short_bio' => array('LIKE', $search_string),
1789
+				'Registration.Attendee.ATT_email' => array('LIKE', $search_string),
1790
+				'Registration.Attendee.ATT_address' => array('LIKE', $search_string),
1791
+				'Registration.Attendee.ATT_address2' => array('LIKE', $search_string),
1792
+				'Registration.Attendee.ATT_city' => array('LIKE', $search_string),
1793
+				'Registration.REG_final_price' => array('LIKE', $search_string),
1794
+				'Registration.REG_code' => array('LIKE', $search_string),
1795
+				'Registration.REG_count' => array('LIKE', $search_string),
1796
+				'Registration.REG_group_size' => array('LIKE', $search_string),
1797
+				'Registration.Ticket.TKT_name' => array('LIKE', $search_string),
1798
+				'Registration.Ticket.TKT_description' => array('LIKE', $search_string),
1799
+				'Payment.PAY_source' => array('LIKE', $search_string),
1800
+				'Payment.Payment_Method.PMD_name' => array('LIKE', $search_string),
1801
+				'TXN_session_data' => array('LIKE', $search_string),
1802
+				'Payment.PAY_txn_id_chq_nmbr' => array('LIKE', $search_string)
1803 1803
 				);
1804 1804
 		}
1805 1805
 
1806 1806
 		//failed transactions
1807
-		$failed = ( ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'failed' && ! $count ) || ( $count && $view == 'failed' ) ? TRUE: FALSE;
1808
-		$abandoned = ( ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'abandoned' && ! $count ) || ( $count && $view == 'abandoned' ) ? TRUE: FALSE;
1807
+		$failed = ( ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'failed' && ! $count) || ($count && $view == 'failed') ? TRUE: FALSE;
1808
+		$abandoned = ( ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'abandoned' && ! $count) || ($count && $view == 'abandoned') ? TRUE: FALSE;
1809 1809
 
1810
-		if ( $failed ) {
1811
-			$_where[ 'STS_ID' ] = EEM_Transaction::failed_status_code;
1812
-		} else if ( $abandoned ) {
1810
+		if ($failed) {
1811
+			$_where['STS_ID'] = EEM_Transaction::failed_status_code;
1812
+		} else if ($abandoned) {
1813 1813
 				$_where['STS_ID'] = EEM_Transaction::abandoned_status_code;
1814 1814
 		} else {
1815
-				$_where['STS_ID'] = array( '!=', EEM_Transaction::failed_status_code );
1816
-				$_where['STS_ID*'] = array( '!=', EEM_Transaction::abandoned_status_code );
1815
+				$_where['STS_ID'] = array('!=', EEM_Transaction::failed_status_code);
1816
+				$_where['STS_ID*'] = array('!=', EEM_Transaction::abandoned_status_code);
1817 1817
 		}
1818 1818
 
1819
-		$query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'limit' => $limit );
1819
+		$query_params = array($_where, 'order_by' => array($orderby => $sort), 'limit' => $limit);
1820 1820
 
1821
-		$transactions = $count ? $TXN->count( array($_where), 'TXN_ID', TRUE ) : $TXN->get_all($query_params);
1821
+		$transactions = $count ? $TXN->count(array($_where), 'TXN_ID', TRUE) : $TXN->get_all($query_params);
1822 1822
 
1823 1823
 
1824 1824
 		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
@@ -1,6 +1,7 @@
 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 6
 /**
6 7
  * Event Espresso
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
@@ -1,6 +1,7 @@
 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 6
 /**
6 7
  * Event Espresso
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
@@ -1,6 +1,7 @@
 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 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.