Completed
Branch BUG-9715-shortcode-resources (aae731)
by
unknown
78:39 queued 67:53
created
templates/reg_admin_details_main_meta_box_reg_questions.template.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,8 +11,11 @@
 block discarded – undo
11 11
 		<?php echo $att_questions; ?>
12 12
 		<?php if ( !empty($att_questions) ) : ?>
13 13
 			<input id="reg-admin-attendee-questions-submit" class="button-primary" value="Update Registration Questions" type="submit" />
14
-		<?php else : ?>
15
-			<p class="ee-attention"><?php _e('There were no custom questions asked for this registration.', 'event_espresso'); ?></p>
14
+		<?php else {
15
+	: ?>
16
+			<p class="ee-attention"><?php _e('There were no custom questions asked for this registration.', 'event_espresso');
17
+}
18
+?></p>
16 19
 		<?php endif; ?>
17 20
 
18 21
 	</form>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,14 +2,14 @@
 block discarded – undo
2 2
 	<p><?php _e('This displays the custom questions and answers for this registrant.  Please note that any answers to system questions have been saved with the contact record.  You can edit those answers via the "View/Edit this Contact" link in the Contact Details metabox in the sidebar.', 'event_espresso'); ?></p>
3 3
 	
4 4
 	<form name="reg-admin-attendee-questions-frm" id="reg-admin-attendee-questions-frm" action="<?php echo REG_ADMIN_URL; ?>" method="post">
5
-		<?php wp_nonce_field( $reg_questions_form_action . '_nonce', $reg_questions_form_action . '_nonce' ); ?>
5
+		<?php wp_nonce_field($reg_questions_form_action.'_nonce', $reg_questions_form_action.'_nonce'); ?>
6 6
 		<input  type="hidden" name="page" value="<?php echo REG_PG_SLUG; ?>"/>
7 7
 		<input  type="hidden" name="action" value="<?php echo $reg_questions_form_action; ?>"/>
8 8
 		<input  type="hidden" name="_REG_ID" value="<?php echo $REG_ID; ?>"/>
9 9
 		<input  type="hidden" name="espresso_ajax" id="espresso-ajax" value="0"/>
10 10
 		<input  type="hidden" name="noheader" id="reg-admin-noheader-inp" value="true"/>
11 11
 		<?php echo $att_questions; ?>
12
-		<?php if ( !empty($att_questions) ) : ?>
12
+		<?php if ( ! empty($att_questions)) : ?>
13 13
 			<input id="reg-admin-attendee-questions-submit" class="button-primary" value="Update Registration Questions" type="submit" />
14 14
 		<?php else : ?>
15 15
 			<p class="ee-attention"><?php _e('There were no custom questions asked for this registration.', 'event_espresso'); ?></p>
Please login to merge, or discard this patch.
templates/reg_admin_details_side_meta_box_registrant.template.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,28 +1,28 @@
 block discarded – undo
1 1
 <div id="admin-side-mbox-primary-registrant-dv" class="admin-side-mbox-dv">
2 2
 	<p class="clearfix">
3
-		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e('Name', 'event_espresso'); ?></span><?php echo $fname . ' ' . $lname;?>
3
+		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e('Name', 'event_espresso'); ?></span><?php echo $fname.' '.$lname; ?>
4 4
 	</p>
5 5
 	<p class="clearfix">
6
-		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e('Email', 'event_espresso'); ?></span><a href="mailto:<?php echo $email;?>"><?php echo $email;?></a>
6
+		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e('Email', 'event_espresso'); ?></span><a href="mailto:<?php echo $email; ?>"><?php echo $email; ?></a>
7 7
 	</p>
8 8
 	<p class="clearfix">
9
-		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e('Phone #', 'event_espresso'); ?></span><?php echo $phone;?>
9
+		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e('Phone #', 'event_espresso'); ?></span><?php echo $phone; ?>
10 10
 	</p>
11 11
 	<p class="clearfix">
12 12
 		<span class="admin-side-mbox-label-spn lt-grey-txt float-left"><?php _e('Address', 'event_espresso'); ?></span>
13 13
 		<div class="admin-side-mbox-text-dv">
14
-			<?php echo $formatted_address;?>
14
+			<?php echo $formatted_address; ?>
15 15
 		</div>
16 16
 	</p>
17 17
 </div>
18 18
 
19 19
 
20 20
 <p class="contact-details-buttons">
21
-	<?php if ( $att_check instanceof EE_Attendee ) : ?>
22
-		<a class="button button-small" href="<?php echo $att_edit_link; ?>" title="<?php echo esc_attr( $att_edit_label ); ?>">
21
+	<?php if ($att_check instanceof EE_Attendee) : ?>
22
+		<a class="button button-small" href="<?php echo $att_edit_link; ?>" title="<?php echo esc_attr($att_edit_label); ?>">
23 23
 			<span class="ee-icon ee-icon-user-edit"></span><?php echo $att_edit_label; ?>
24 24
 		</a>
25
-		<?php if ( !empty( $create_link ) ) : ?>
25
+		<?php if ( ! empty($create_link)) : ?>
26 26
 			<a class="button button-small" href="<?php echo $create_link; ?>" title="<?php esc_attr_e('This registration shares the contact details for the primary registration in this group.  If you\'d like this registration to have its own details, you can do so by clicking this button', 'event_espresso'); ?>">
27 27
 				<span class="ee-icon ee-icon-user-add-new"></span><?php echo $create_label; ?>
28 28
 		</a>
Please login to merge, or discard this patch.
registrations/templates/reg_admin_register_new_attendee.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,2 +1,2 @@
 block discarded – undo
1
-<h1><span class="small-text not-bold"><?php _e( 'Adding Registration For: ', 'event_espresso' );?></span><?php echo $event_name;?></h1>
1
+<h1><span class="small-text not-bold"><?php _e('Adding Registration For: ', 'event_espresso'); ?></span><?php echo $event_name; ?></h1>
2 2
 <?php echo $step_content; ?>
3 3
\ No newline at end of file
Please login to merge, or discard this patch.
templates/reg_admin_register_new_attendee_step_content.template.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,13 +2,13 @@
 block discarded – undo
2 2
 	<h2 class="ee-new-registration-step-header"><?php echo $title ?></h2>
3 3
 	<div class="ee-new-registration-step-content">
4 4
 		<?php echo $content; ?>
5
-		<?php if ( $show_notification_toggle && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'registration_message_type' ) ) : ?>
5
+		<?php if ($show_notification_toggle && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'registration_message_type')) : ?>
6 6
 			<div class="ee-attention">
7
-				<label for="txn_reg_status_change" class="last"><?php _e( 'Send Related Messages?', 'event_espresso' );?></label>
7
+				<label for="txn_reg_status_change" class="last"><?php _e('Send Related Messages?', 'event_espresso'); ?></label>
8 8
 				<input type="checkbox" value="1" name="txn_reg_status_change[send_notifications]" checked=checked>
9 9
 				<br/>
10 10
 				<br />
11
-				<p class="description"><?php _e( 'Send a notification to registrants after processing?', 'event_espresso' );?></p><br/>
11
+				<p class="description"><?php _e('Send a notification to registrants after processing?', 'event_espresso'); ?></p><br/>
12 12
 				<label></label>
13 13
 			</div>
14 14
 		<?php endif; ?>
Please login to merge, or discard this patch.
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.
Spacing   +402 added lines, -402 removed lines patch added patch discarded remove patch
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 	 * @param bool $routing
57 57
 	 * @return Transactions_Admin_Page
58 58
 	 */
59
-	public function __construct( $routing = TRUE ) {
60
-		parent::__construct( $routing );
59
+	public function __construct($routing = TRUE) {
60
+		parent::__construct($routing);
61 61
 	}
62 62
 
63 63
 
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
 	 * @return void
81 81
 	 */
82 82
 	protected function _ajax_hooks() {
83
-		add_action('wp_ajax_espresso_apply_payment', array( $this, 'apply_payments_or_refunds'));
84
-		add_action('wp_ajax_espresso_apply_refund', array( $this, 'apply_payments_or_refunds'));
85
-		add_action('wp_ajax_espresso_delete_payment', array( $this, 'delete_payment'));
83
+		add_action('wp_ajax_espresso_apply_payment', array($this, 'apply_payments_or_refunds'));
84
+		add_action('wp_ajax_espresso_apply_refund', array($this, 'apply_payments_or_refunds'));
85
+		add_action('wp_ajax_espresso_delete_payment', array($this, 'delete_payment'));
86 86
 	}
87 87
 
88 88
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 			'buttons' => array(
98 98
 				'add' => __('Add New Transaction', 'event_espresso'),
99 99
 				'edit' => __('Edit Transaction', 'event_espresso'),
100
-				'delete' => __('Delete Transaction','event_espresso'),
100
+				'delete' => __('Delete Transaction', 'event_espresso'),
101 101
 			)
102 102
 		);
103 103
 	}
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
 		$this->_set_transaction_status_array();
115 115
 
116
-		$txn_id = ! empty( $this->_req_data['TXN_ID'] ) && ! is_array( $this->_req_data['TXN_ID'] ) ? $this->_req_data['TXN_ID'] : 0;
116
+		$txn_id = ! empty($this->_req_data['TXN_ID']) && ! is_array($this->_req_data['TXN_ID']) ? $this->_req_data['TXN_ID'] : 0;
117 117
 
118 118
 		$this->_page_routes = array(
119 119
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 						'filename' => 'transactions_overview_views_filters_search'
186 186
 					),
187 187
 				),
188
-				'help_tour' => array( 'Transactions_Overview_Help_Tour' ),
188
+				'help_tour' => array('Transactions_Overview_Help_Tour'),
189 189
 				/**
190 190
 				 * commented out because currently we are not displaying tips for transaction list table status but this
191 191
 				 * may change in a later iteration so want to keep the code for then.
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 				'nav' => array(
198 198
 					'label' => __('View Transaction', 'event_espresso'),
199 199
 					'order' => 5,
200
-					'url' => isset($this->_req_data['TXN_ID']) ? add_query_arg(array('TXN_ID' => $this->_req_data['TXN_ID'] ), $this->_current_page_view_url )  : $this->_admin_base_url,
200
+					'url' => isset($this->_req_data['TXN_ID']) ? add_query_arg(array('TXN_ID' => $this->_req_data['TXN_ID']), $this->_current_page_view_url) : $this->_admin_base_url,
201 201
 					'persistent' => FALSE
202 202
 					),
203 203
 				'help_tabs' => array(
@@ -218,8 +218,8 @@  discard block
 block discarded – undo
218 218
 						'filename' => 'transactions_view_transaction_primary_registrant_billing_information'
219 219
 					),
220 220
 				),
221
-				'qtips' => array( 'Transaction_Details_Tips' ),
222
-				'help_tour' => array( 'Transaction_Details_Help_Tour' ),
221
+				'qtips' => array('Transaction_Details_Tips'),
222
+				'help_tour' => array('Transaction_Details_Help_Tour'),
223 223
 				'metaboxes' => array('_transaction_details_metaboxes'),
224 224
 
225 225
 				'require_nonce' => FALSE
@@ -237,21 +237,21 @@  discard block
 block discarded – undo
237 237
 		// IF a registration was JUST added via the admin...
238 238
 		if (
239 239
 		isset(
240
-			$this->_req_data[ 'redirect_from' ],
241
-			$this->_req_data[ 'EVT_ID' ],
242
-			$this->_req_data[ 'event_name' ]
240
+			$this->_req_data['redirect_from'],
241
+			$this->_req_data['EVT_ID'],
242
+			$this->_req_data['event_name']
243 243
 		)
244 244
 		) {
245 245
 			// then set a cookie so that we can block any attempts to use
246 246
 			// the back button as a way to enter another registration.
247
-			setcookie( 'ee_registration_added', $this->_req_data[ 'EVT_ID' ], time() + WEEK_IN_SECONDS, '/' );
247
+			setcookie('ee_registration_added', $this->_req_data['EVT_ID'], time() + WEEK_IN_SECONDS, '/');
248 248
 			// and update the global
249
-			$_COOKIE[ 'ee_registration_added' ] = $this->_req_data[ 'EVT_ID' ];
249
+			$_COOKIE['ee_registration_added'] = $this->_req_data['EVT_ID'];
250 250
 		}
251
-		EE_Registry::$i18n_js_strings[ 'invalid_server_response' ] = __( 'An error occurred! Your request may have been processed, but a valid response from the server was not received. Please refresh the page and try again.', 'event_espresso' );
252
-		EE_Registry::$i18n_js_strings[ 'error_occurred' ] = __( 'An error occurred! Please refresh the page and try again.', 'event_espresso' );
253
-		EE_Registry::$i18n_js_strings[ 'txn_status_array' ] = self::$_txn_status;
254
-		EE_Registry::$i18n_js_strings[ 'pay_status_array' ] = self::$_pay_status;
251
+		EE_Registry::$i18n_js_strings['invalid_server_response'] = __('An error occurred! Your request may have been processed, but a valid response from the server was not received. Please refresh the page and try again.', 'event_espresso');
252
+		EE_Registry::$i18n_js_strings['error_occurred'] = __('An error occurred! Please refresh the page and try again.', 'event_espresso');
253
+		EE_Registry::$i18n_js_strings['txn_status_array'] = self::$_txn_status;
254
+		EE_Registry::$i18n_js_strings['pay_status_array'] = self::$_pay_status;
255 255
 	}
256 256
 	public function admin_notices() {}
257 257
 	public function admin_footer_scripts() {}
@@ -318,14 +318,14 @@  discard block
 block discarded – undo
318 318
 	 */
319 319
 	public function load_scripts_styles() {
320 320
 		//enqueue style
321
-		wp_register_style( 'espresso_txn', TXN_ASSETS_URL . 'espresso_transactions_admin.css', array(), EVENT_ESPRESSO_VERSION );
321
+		wp_register_style('espresso_txn', TXN_ASSETS_URL.'espresso_transactions_admin.css', array(), EVENT_ESPRESSO_VERSION);
322 322
 		wp_enqueue_style('espresso_txn');
323 323
 
324 324
 		//scripts
325 325
 		add_filter('FHEE_load_accounting_js', '__return_true');
326 326
 
327 327
 		//scripts
328
-		wp_register_script('espresso_txn', TXN_ASSETS_URL . 'espresso_transactions_admin.js', array('ee_admin_js', 'ee-datepicker', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'ee-dialog', 'ee-accounting', 'ee-serialize-full-array'), EVENT_ESPRESSO_VERSION, TRUE);
328
+		wp_register_script('espresso_txn', TXN_ASSETS_URL.'espresso_transactions_admin.js', array('ee_admin_js', 'ee-datepicker', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'ee-dialog', 'ee-accounting', 'ee-serialize-full-array'), EVENT_ESPRESSO_VERSION, TRUE);
329 329
 		wp_enqueue_script('espresso_txn');
330 330
 
331 331
 	}
@@ -365,8 +365,8 @@  discard block
 block discarded – undo
365 365
 	 *	@return void
366 366
 	 */
367 367
 	protected function _set_list_table_views_default() {
368
-		$this->_views = array (
369
-			'all' => array (
368
+		$this->_views = array(
369
+			'all' => array(
370 370
 				'slug' 		=> 'all',
371 371
 				'label' 		=> __('View All Transactions', 'event_espresso'),
372 372
 				'count' 	=> 0
@@ -394,20 +394,20 @@  discard block
 block discarded – undo
394 394
 	 *	@return void
395 395
 	 */
396 396
 	private function _set_transaction_object() {
397
-		if ( is_object( $this->_transaction) )
397
+		if (is_object($this->_transaction))
398 398
 			return; //get out we've already set the object
399 399
 
400 400
 	    $TXN = EEM_Transaction::instance();
401 401
 
402
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
402
+	    $TXN_ID = ( ! empty($this->_req_data['TXN_ID'])) ? absint($this->_req_data['TXN_ID']) : FALSE;
403 403
 
404 404
 	    //get transaction object
405 405
 	    $this->_transaction = $TXN->get_one_by_ID($TXN_ID);
406
-	    $this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
406
+	    $this->_session = ! empty($this->_transaction) ? $this->_transaction->get('TXN_session_data') : NULL;
407 407
 
408
-	 	if ( empty( $this->_transaction ) ) {
409
-	    	$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  __(' could not be retrieved.', 'event_espresso');
410
-			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
408
+	 	if (empty($this->_transaction)) {
409
+	    	$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso').$TXN_ID.__(' could not be retrieved.', 'event_espresso');
410
+			EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
411 411
 	    }
412 412
 	}
413 413
 
@@ -420,11 +420,11 @@  discard block
 block discarded – undo
420 420
 	 *	@return array
421 421
 	 */
422 422
 	protected function _transaction_legend_items() {
423
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
423
+		EE_Registry::instance()->load_helper('MSG_Template');
424 424
 
425
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_messages', 'view_filtered_messages' ) ) {
426
-			$related_for_icon = EEH_MSG_Template::get_message_action_icon( 'see_notifications_for' );
427
-			if ( isset( $related_for_icon['css_class']) && isset( $related_for_icon['label'] ) ) {
425
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_messages', 'view_filtered_messages')) {
426
+			$related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for');
427
+			if (isset($related_for_icon['css_class']) && isset($related_for_icon['label'])) {
428 428
 				$items['view_related_messages'] = array(
429 429
 					'class' => $related_for_icon['css_class'],
430 430
 					'desc' => $related_for_icon['label'],
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 
435 435
 		$items = apply_filters(
436 436
 			'FHEE__Transactions_Admin_Page___transaction_legend_items__items',
437
-			array_merge( $items,
437
+			array_merge($items,
438 438
 				array(
439 439
 					'view_details' => array(
440 440
 						'class' => 'dashicons dashicons-cart',
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 					),
447 447
 					'view_receipt' => array(
448 448
 						'class' => 'dashicons dashicons-media-default',
449
-						'desc' => __('View Transaction Receipt', 'event_espresso' )
449
+						'desc' => __('View Transaction Receipt', 'event_espresso')
450 450
 					),
451 451
 					'view_registration' => array(
452 452
 						'class' => 'dashicons dashicons-clipboard',
@@ -456,8 +456,8 @@  discard block
 block discarded – undo
456 456
 			)
457 457
 		);
458 458
 
459
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_transactions_send_payment_reminder' ) ) {
460
-			if ( EEH_MSG_Template::is_mt_active( 'payment_reminder' ) ) {
459
+		if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder')) {
460
+			if (EEH_MSG_Template::is_mt_active('payment_reminder')) {
461 461
 				$items['send_payment_reminder'] = array(
462 462
 					'class' => 'dashicons dashicons-email-alt',
463 463
 					'desc' => __('Send Payment Reminder', 'event_espresso')
@@ -478,29 +478,29 @@  discard block
 block discarded – undo
478 478
 			'FHEE__Transactions_Admin_Page___transaction_legend_items__more_items',
479 479
 			array(
480 480
 				'overpaid'   => array(
481
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::overpaid_status_code,
482
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::overpaid_status_code, FALSE, 'sentence' )
481
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::overpaid_status_code,
482
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::overpaid_status_code, FALSE, 'sentence')
483 483
 				),
484 484
 				'complete'   => array(
485
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::complete_status_code,
486
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::complete_status_code, FALSE, 'sentence' )
485
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::complete_status_code,
486
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::complete_status_code, FALSE, 'sentence')
487 487
 				),
488 488
 				'incomplete' => array(
489
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::incomplete_status_code,
490
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::incomplete_status_code, FALSE, 'sentence' )
489
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::incomplete_status_code,
490
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::incomplete_status_code, FALSE, 'sentence')
491 491
 				),
492 492
 				'abandoned'  => array(
493
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::abandoned_status_code,
494
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::abandoned_status_code, FALSE, 'sentence' )
493
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::abandoned_status_code,
494
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::abandoned_status_code, FALSE, 'sentence')
495 495
 				),
496 496
 				'failed'     => array(
497
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::failed_status_code,
498
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::failed_status_code, FALSE, 'sentence' )
497
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::failed_status_code,
498
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::failed_status_code, FALSE, 'sentence')
499 499
 				)
500 500
 			)
501 501
 		);
502 502
 
503
-		return array_merge( $items, $more_items);
503
+		return array_merge($items, $more_items);
504 504
 	}
505 505
 
506 506
 
@@ -513,9 +513,9 @@  discard block
 block discarded – undo
513 513
 	 */
514 514
 	protected function _transactions_overview_list_table() {
515 515
 		$this->_admin_page_title = __('Transactions', 'event_espresso');
516
-		$event = isset($this->_req_data['EVT_ID']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID'] ) : NULL;
517
-		$this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf( __('%sViewing Transactions for the Event: %s%s', 'event_espresso'), '<h3>', '<a href="' . EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $event->ID()), EVENTS_ADMIN_URL ) . '" title="' . esc_attr__('Click to Edit event', 'event_espresso') . '">' . $event->get('EVT_name') . '</a>', '</h3>' ) : '';
518
-		$this->_template_args['after_list_table'] = $this->_display_legend( $this->_transaction_legend_items() );
516
+		$event = isset($this->_req_data['EVT_ID']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID']) : NULL;
517
+		$this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf(__('%sViewing Transactions for the Event: %s%s', 'event_espresso'), '<h3>', '<a href="'.EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $event->ID()), EVENTS_ADMIN_URL).'" title="'.esc_attr__('Click to Edit event', 'event_espresso').'">'.$event->get('EVT_name').'</a>', '</h3>') : '';
518
+		$this->_template_args['after_list_table'] = $this->_display_legend($this->_transaction_legend_items());
519 519
 		$this->display_admin_list_table_page_with_no_sidebar();
520 520
 	}
521 521
 
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 	*	@return void
530 530
 	*/
531 531
 	protected function _transaction_details() {
532
-		do_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction );
532
+		do_action('AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction);
533 533
 
534 534
 		$this->_set_transaction_status_array();
535 535
 
@@ -542,14 +542,14 @@  discard block
 block discarded – undo
542 542
 		$attendee = $primary_registration instanceof EE_Registration ? $primary_registration->attendee() : NULL;
543 543
 
544 544
 		$this->_template_args['txn_nmbr']['value'] = $this->_transaction->ID();
545
-		$this->_template_args['txn_nmbr']['label'] = __( 'Transaction Number', 'event_espresso' );
545
+		$this->_template_args['txn_nmbr']['label'] = __('Transaction Number', 'event_espresso');
546 546
 
547 547
 		$this->_template_args['txn_datetime']['value'] = $this->_transaction->get_i18n_datetime('TXN_timestamp');
548
-		$this->_template_args['txn_datetime']['label'] = __( 'Date', 'event_espresso' );
548
+		$this->_template_args['txn_datetime']['label'] = __('Date', 'event_espresso');
549 549
 
550
-		$this->_template_args['txn_status']['value'] = self::$_txn_status[ $this->_transaction->get('STS_ID') ];
551
-		$this->_template_args['txn_status']['label'] = __( 'Transaction Status', 'event_espresso' );
552
-		$this->_template_args['txn_status']['class'] = 'status-' . $this->_transaction->get('STS_ID');
550
+		$this->_template_args['txn_status']['value'] = self::$_txn_status[$this->_transaction->get('STS_ID')];
551
+		$this->_template_args['txn_status']['label'] = __('Transaction Status', 'event_espresso');
552
+		$this->_template_args['txn_status']['class'] = 'status-'.$this->_transaction->get('STS_ID');
553 553
 
554 554
 		$this->_template_args['grand_total'] = $this->_transaction->get('TXN_total');
555 555
 		$this->_template_args['total_paid'] = $this->_transaction->get('TXN_paid');
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
 			)
563 563
 		) {
564 564
 			$this->_template_args['send_payment_reminder_button'] =
565
-				EEH_MSG_Template::is_mt_active( 'payment_reminder' )
565
+				EEH_MSG_Template::is_mt_active('payment_reminder')
566 566
 				&& $this->_transaction->get('STS_ID') != EEM_Transaction::complete_status_code
567 567
 				&& $this->_transaction->get('STS_ID') != EEM_Transaction::overpaid_status_code
568 568
 					? EEH_Template::get_button_or_link(
@@ -584,40 +584,40 @@  discard block
 block discarded – undo
584 584
 		}
585 585
 
586 586
 		$amount_due = $this->_transaction->get('TXN_total') - $this->_transaction->get('TXN_paid');
587
-		$this->_template_args['amount_due'] = EEH_Template::format_currency( $amount_due, TRUE );
588
-		if ( EE_Registry::instance()->CFG->currency->sign_b4 ) {
589
-			$this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign . $this->_template_args['amount_due'];
587
+		$this->_template_args['amount_due'] = EEH_Template::format_currency($amount_due, TRUE);
588
+		if (EE_Registry::instance()->CFG->currency->sign_b4) {
589
+			$this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign.$this->_template_args['amount_due'];
590 590
 		} else {
591
-			$this->_template_args['amount_due'] = $this->_template_args['amount_due'] . EE_Registry::instance()->CFG->currency->sign;
591
+			$this->_template_args['amount_due'] = $this->_template_args['amount_due'].EE_Registry::instance()->CFG->currency->sign;
592 592
 		}
593
-		$this->_template_args['amount_due_class'] =  '';
593
+		$this->_template_args['amount_due_class'] = '';
594 594
 
595
-		if ( $this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total') ) {
595
+		if ($this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total')) {
596 596
 			// paid in full
597
-			$this->_template_args['amount_due'] =  FALSE;
598
-		} elseif ( $this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total') ) {
597
+			$this->_template_args['amount_due'] = FALSE;
598
+		} elseif ($this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total')) {
599 599
 			// overpaid
600
-			$this->_template_args['amount_due_class'] =  'txn-overview-no-payment-spn';
601
-		} elseif (( $this->_transaction->get('TXN_total') > 0 ) && ( $this->_transaction->get('TXN_paid') > 0 )) {
600
+			$this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn';
601
+		} elseif (($this->_transaction->get('TXN_total') > 0) && ($this->_transaction->get('TXN_paid') > 0)) {
602 602
 			// monies owing
603
-			$this->_template_args['amount_due_class'] =  'txn-overview-part-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-part-payment-spn';
604
+		} elseif (($this->_transaction->get('TXN_total') > 0) && ($this->_transaction->get('TXN_paid') == 0)) {
605 605
 			// no payments made yet
606
-			$this->_template_args['amount_due_class'] =  'txn-overview-no-payment-spn';
607
-		} elseif ( $this->_transaction->get('TXN_total') == 0 ) {
606
+			$this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn';
607
+		} elseif ($this->_transaction->get('TXN_total') == 0) {
608 608
 			// free event
609
-			$this->_template_args['amount_due'] =  FALSE;
609
+			$this->_template_args['amount_due'] = FALSE;
610 610
 		}
611 611
 
612 612
 		$payment_method = $this->_transaction->payment_method();
613 613
 
614 614
 		$this->_template_args['method_of_payment_name'] = $payment_method instanceof EE_Payment_Method
615 615
 			? $payment_method->admin_name()
616
-			: __( 'Unknown', 'event_espresso' );
616
+			: __('Unknown', 'event_espresso');
617 617
 
618 618
 		$this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
619 619
 		// link back to overview
620
-		$this->_template_args['txn_overview_url'] = ! empty ( $_SERVER['HTTP_REFERER'] )
620
+		$this->_template_args['txn_overview_url'] = ! empty ($_SERVER['HTTP_REFERER'])
621 621
 			? $_SERVER['HTTP_REFERER']
622 622
 			: TXN_ADMIN_URL;
623 623
 
@@ -625,13 +625,13 @@  discard block
 block discarded – undo
625 625
 		// next link
626 626
 		$next_txn = $this->_transaction->next(
627 627
 			null,
628
-			array( array( 'STS_ID' => array( '!=', EEM_Transaction::failed_status_code ) ) ),
628
+			array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))),
629 629
 			'TXN_ID'
630 630
 		);
631 631
 		$this->_template_args['next_transaction'] = $next_txn
632 632
 			? $this->_next_link(
633 633
 				EE_Admin_Page::add_query_args_and_nonce(
634
-					array( 'action' => 'view_transaction', 'TXN_ID' => $next_txn['TXN_ID'] ),
634
+					array('action' => 'view_transaction', 'TXN_ID' => $next_txn['TXN_ID']),
635 635
 					TXN_ADMIN_URL
636 636
 				),
637 637
 				'dashicons dashicons-arrow-right ee-icon-size-22'
@@ -640,13 +640,13 @@  discard block
 block discarded – undo
640 640
 		// previous link
641 641
 		$previous_txn = $this->_transaction->previous(
642 642
 			null,
643
-			array( array( 'STS_ID' => array( '!=', EEM_Transaction::failed_status_code ) ) ),
643
+			array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))),
644 644
 			'TXN_ID'
645 645
 		);
646 646
 		$this->_template_args['previous_transaction'] = $previous_txn
647 647
 			? $this->_previous_link(
648 648
 				EE_Admin_Page::add_query_args_and_nonce(
649
-					array( 'action' => 'view_transaction', 'TXN_ID' => $previous_txn['TXN_ID'] ),
649
+					array('action' => 'view_transaction', 'TXN_ID' => $previous_txn['TXN_ID']),
650 650
 					TXN_ADMIN_URL
651 651
 				),
652 652
 				'dashicons dashicons-arrow-left ee-icon-size-22'
@@ -656,16 +656,16 @@  discard block
 block discarded – undo
656 656
 		// were we just redirected here after adding a new registration ???
657 657
 		if (
658 658
 			isset(
659
-				$this->_req_data[ 'redirect_from' ],
660
-				$this->_req_data[ 'EVT_ID' ],
661
-				$this->_req_data[ 'event_name' ]
659
+				$this->_req_data['redirect_from'],
660
+				$this->_req_data['EVT_ID'],
661
+				$this->_req_data['event_name']
662 662
 			)
663 663
 		) {
664 664
 			if (
665 665
 				EE_Registry::instance()->CAP->current_user_can(
666 666
 					'ee_edit_registrations',
667 667
 					'espresso_registrations_new_registration',
668
-					$this->_req_data[ 'EVT_ID' ]
668
+					$this->_req_data['EVT_ID']
669 669
 				)
670 670
 			) {
671 671
 				$this->_admin_page_title .= '<a id="add-new-registration" class="add-new-h2 button-primary" href="';
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
 						'action'   => 'new_registration',
676 676
 						'return'   => 'default',
677 677
 						'TXN_ID'   => $this->_transaction->ID(),
678
-						'event_id' => $this->_req_data[ 'EVT_ID' ],
678
+						'event_id' => $this->_req_data['EVT_ID'],
679 679
 					),
680 680
 					REG_ADMIN_URL
681 681
 				);
@@ -683,17 +683,17 @@  discard block
 block discarded – undo
683 683
 
684 684
 				$this->_admin_page_title .= sprintf(
685 685
 					__('Add Another New Registration to Event: "%1$s" ?'),
686
-					htmlentities( urldecode( $this->_req_data[ 'event_name' ] ), ENT_QUOTES, 'UTF-8' )
686
+					htmlentities(urldecode($this->_req_data['event_name']), ENT_QUOTES, 'UTF-8')
687 687
 				);
688 688
 				$this->_admin_page_title .= '</a>';
689 689
 			}
690
-			EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
690
+			EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
691 691
 		}
692 692
 		// grab messages at the last second
693 693
 		$this->_template_args['notices'] = EE_Error::get_notices();
694 694
 		// path to template
695
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_header.template.php';
696
-		$this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
695
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_header.template.php';
696
+		$this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
697 697
 
698 698
 		// the details template wrapper
699 699
 		$this->display_admin_page_with_sidebar();
@@ -712,18 +712,18 @@  discard block
 block discarded – undo
712 712
 
713 713
 		$this->_set_transaction_object();
714 714
 
715
-		add_meta_box( 'edit-txn-details-mbox', __( 'Transaction Details', 'event_espresso' ), array( $this, 'txn_details_meta_box' ), $this->_wp_page_slug, 'normal', 'high' );
715
+		add_meta_box('edit-txn-details-mbox', __('Transaction Details', 'event_espresso'), array($this, 'txn_details_meta_box'), $this->_wp_page_slug, 'normal', 'high');
716 716
 		add_meta_box(
717 717
 			'edit-txn-attendees-mbox',
718
-			__( 'Attendees Registered in this Transaction', 'event_espresso' ),
719
-			array( $this, 'txn_attendees_meta_box' ),
718
+			__('Attendees Registered in this Transaction', 'event_espresso'),
719
+			array($this, 'txn_attendees_meta_box'),
720 720
 			$this->_wp_page_slug,
721 721
 			'normal',
722 722
 			'high',
723
-			array( 'TXN_ID' => $this->_transaction->ID() )
723
+			array('TXN_ID' => $this->_transaction->ID())
724 724
 		);
725
-		add_meta_box( 'edit-txn-registrant-mbox', __( 'Primary Contact', 'event_espresso' ), array( $this, 'txn_registrant_side_meta_box' ), $this->_wp_page_slug, 'side', 'high' );
726
-		add_meta_box( 'edit-txn-billing-info-mbox', __( 'Billing Information', 'event_espresso' ), array( $this, 'txn_billing_info_side_meta_box' ), $this->_wp_page_slug, 'side', 'high' );
725
+		add_meta_box('edit-txn-registrant-mbox', __('Primary Contact', 'event_espresso'), array($this, 'txn_registrant_side_meta_box'), $this->_wp_page_slug, 'side', 'high');
726
+		add_meta_box('edit-txn-billing-info-mbox', __('Billing Information', 'event_espresso'), array($this, 'txn_billing_info_side_meta_box'), $this->_wp_page_slug, 'side', 'high');
727 727
 
728 728
 	}
729 729
 
@@ -744,15 +744,15 @@  discard block
 block discarded – undo
744 744
 
745 745
 		//get line table
746 746
 		EEH_Autoloader::register_line_item_display_autoloaders();
747
-		$Line_Item_Display = new EE_Line_Item_Display( 'admin_table', 'EE_Admin_Table_Line_Item_Display_Strategy' );
748
-		$this->_template_args['line_item_table'] = $Line_Item_Display->display_line_item( $this->_transaction->total_line_item() );
747
+		$Line_Item_Display = new EE_Line_Item_Display('admin_table', 'EE_Admin_Table_Line_Item_Display_Strategy');
748
+		$this->_template_args['line_item_table'] = $Line_Item_Display->display_line_item($this->_transaction->total_line_item());
749 749
 		$this->_template_args['REG_code'] = $this->_transaction->get_first_related('Registration')->get('REG_code');
750 750
 
751 751
 		// process taxes
752
-		$taxes = $this->_transaction->get_many_related( 'Line_Item', array( array( 'LIN_type' => EEM_Line_Item::type_tax )));
753
-		$this->_template_args['taxes'] = ! empty( $taxes ) ? $taxes : FALSE;
752
+		$taxes = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => EEM_Line_Item::type_tax)));
753
+		$this->_template_args['taxes'] = ! empty($taxes) ? $taxes : FALSE;
754 754
 
755
-		$this->_template_args['grand_total'] = EEH_Template::format_currency($this->_transaction->get('TXN_total'), FALSE, FALSE );
755
+		$this->_template_args['grand_total'] = EEH_Template::format_currency($this->_transaction->get('TXN_total'), FALSE, FALSE);
756 756
 		$this->_template_args['grand_raw_total'] = $this->_transaction->get('TXN_total');
757 757
 		$this->_template_args['TXN_status'] = $this->_transaction->get('STS_ID');
758 758
 
@@ -760,63 +760,63 @@  discard block
 block discarded – undo
760 760
 
761 761
 		// process payment details
762 762
 		$payments = $this->_transaction->get_many_related('Payment');
763
-		if( ! empty(  $payments ) ) {
764
-			$this->_template_args[ 'payments' ] = $payments;
765
-			$this->_template_args[ 'existing_reg_payments' ] = $this->_get_registration_payment_IDs( $payments );
763
+		if ( ! empty($payments)) {
764
+			$this->_template_args['payments'] = $payments;
765
+			$this->_template_args['existing_reg_payments'] = $this->_get_registration_payment_IDs($payments);
766 766
 		} else {
767
-			$this->_template_args[ 'payments' ] = false;
768
-			$this->_template_args[ 'existing_reg_payments' ] = array();
767
+			$this->_template_args['payments'] = false;
768
+			$this->_template_args['existing_reg_payments'] = array();
769 769
 		}
770 770
 
771
-		$this->_template_args['edit_payment_url'] = add_query_arg( array( 'action' => 'edit_payment'  ), TXN_ADMIN_URL );
772
-		$this->_template_args['delete_payment_url'] = add_query_arg( array( 'action' => 'espresso_delete_payment' ), TXN_ADMIN_URL );
771
+		$this->_template_args['edit_payment_url'] = add_query_arg(array('action' => 'edit_payment'), TXN_ADMIN_URL);
772
+		$this->_template_args['delete_payment_url'] = add_query_arg(array('action' => 'espresso_delete_payment'), TXN_ADMIN_URL);
773 773
 
774
-		if ( isset( $txn_details['invoice_number'] )) {
774
+		if (isset($txn_details['invoice_number'])) {
775 775
 			$this->_template_args['txn_details']['invoice_number']['value'] = $this->_template_args['REG_code'];
776
-			$this->_template_args['txn_details']['invoice_number']['label'] = __( 'Invoice Number', 'event_espresso' );
776
+			$this->_template_args['txn_details']['invoice_number']['label'] = __('Invoice Number', 'event_espresso');
777 777
 		}
778 778
 
779 779
 		$this->_template_args['txn_details']['registration_session']['value'] = $this->_transaction->get_first_related('Registration')->get('REG_session');
780
-		$this->_template_args['txn_details']['registration_session']['label'] = __( 'Registration Session', 'event_espresso' );
780
+		$this->_template_args['txn_details']['registration_session']['label'] = __('Registration Session', 'event_espresso');
781 781
 
782
-		$this->_template_args['txn_details']['ip_address']['value'] = isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '';
783
-		$this->_template_args['txn_details']['ip_address']['label'] = __( 'Transaction placed from IP', 'event_espresso' );
782
+		$this->_template_args['txn_details']['ip_address']['value'] = isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '';
783
+		$this->_template_args['txn_details']['ip_address']['label'] = __('Transaction placed from IP', 'event_espresso');
784 784
 
785
-		$this->_template_args['txn_details']['user_agent']['value'] = isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '';
786
-		$this->_template_args['txn_details']['user_agent']['label'] = __( 'Registrant User Agent', 'event_espresso' );
785
+		$this->_template_args['txn_details']['user_agent']['value'] = isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '';
786
+		$this->_template_args['txn_details']['user_agent']['label'] = __('Registrant User Agent', 'event_espresso');
787 787
 
788 788
 		$reg_steps = '<ul>';
789
-		foreach ( $this->_transaction->reg_steps() as $reg_step => $reg_step_status ) {
790
-			if ( $reg_step_status === true ) {
791
-				$reg_steps .= '<li style="color:#70cc50">' . sprintf( __( '%1$s : Completed', 'event_espresso' ), ucwords( str_replace( '_', ' ', $reg_step ) ) ) . '</li>';
792
-			} else if ( is_numeric( $reg_step_status ) && $reg_step_status !== false ) {
793
-					$reg_steps .= '<li style="color:#2EA2CC">' . sprintf(
794
-							__( '%1$s : Initiated %2$s', 'event_espresso' ),
795
-							ucwords( str_replace( '_', ' ', $reg_step ) ),
796
-							gmdate( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), ( $reg_step_status + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) )
797
-						) . '</li>';
789
+		foreach ($this->_transaction->reg_steps() as $reg_step => $reg_step_status) {
790
+			if ($reg_step_status === true) {
791
+				$reg_steps .= '<li style="color:#70cc50">'.sprintf(__('%1$s : Completed', 'event_espresso'), ucwords(str_replace('_', ' ', $reg_step))).'</li>';
792
+			} else if (is_numeric($reg_step_status) && $reg_step_status !== false) {
793
+					$reg_steps .= '<li style="color:#2EA2CC">'.sprintf(
794
+							__('%1$s : Initiated %2$s', 'event_espresso'),
795
+							ucwords(str_replace('_', ' ', $reg_step)),
796
+							gmdate(get_option('date_format').' '.get_option('time_format'), ($reg_step_status + (get_option('gmt_offset') * HOUR_IN_SECONDS)))
797
+						).'</li>';
798 798
 				} else {
799
-				$reg_steps .= '<li style="color:#E76700">' . sprintf( __( '%1$s : Never Initiated', 'event_espresso' ), ucwords( str_replace( '_', ' ', $reg_step ) ) ) . '</li>';
799
+				$reg_steps .= '<li style="color:#E76700">'.sprintf(__('%1$s : Never Initiated', 'event_espresso'), ucwords(str_replace('_', ' ', $reg_step))).'</li>';
800 800
 			}
801 801
 		}
802 802
 		$reg_steps .= '</ul>';
803 803
 		$this->_template_args['txn_details']['reg_steps']['value'] = $reg_steps;
804
-		$this->_template_args['txn_details']['reg_steps']['label'] = __( 'Registration Step Progress', 'event_espresso' );
804
+		$this->_template_args['txn_details']['reg_steps']['label'] = __('Registration Step Progress', 'event_espresso');
805 805
 
806 806
 
807 807
 		$this->_get_registrations_to_apply_payment_to();
808
-		$this->_get_payment_methods( $payments );
808
+		$this->_get_payment_methods($payments);
809 809
 		$this->_get_payment_status_array();
810 810
 		$this->_get_reg_status_selection(); //sets up the template args for the reg status array for the transaction.
811 811
 
812
-		$this->_template_args['transaction_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'transaction'  ), TXN_ADMIN_URL );
813
-		$this->_template_args['apply_payment_form_url'] = add_query_arg( array( 'page' => 'espresso_transactions', 'action' => 'espresso_apply_payment' ), WP_AJAX_URL );
814
-		$this->_template_args['delete_payment_form_url'] = add_query_arg( array( 'page' => 'espresso_transactions', 'action' => 'espresso_delete_payment' ), WP_AJAX_URL );
812
+		$this->_template_args['transaction_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'transaction'), TXN_ADMIN_URL);
813
+		$this->_template_args['apply_payment_form_url'] = add_query_arg(array('page' => 'espresso_transactions', 'action' => 'espresso_apply_payment'), WP_AJAX_URL);
814
+		$this->_template_args['delete_payment_form_url'] = add_query_arg(array('page' => 'espresso_transactions', 'action' => 'espresso_delete_payment'), WP_AJAX_URL);
815 815
 
816 816
 		// 'espresso_delete_payment_nonce'
817 817
 
818
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_main_meta_box_txn_details.template.php';
819
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
818
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_main_meta_box_txn_details.template.php';
819
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
820 820
 
821 821
 	}
822 822
 
@@ -831,27 +831,27 @@  discard block
 block discarded – undo
831 831
 	 * @param EE_Payment[] $payments
832 832
 	 * @return array
833 833
 	 */
834
-	protected function _get_registration_payment_IDs( $payments = array() ) {
834
+	protected function _get_registration_payment_IDs($payments = array()) {
835 835
 		$existing_reg_payments = array();
836 836
 		// get all reg payments for these payments
837
-		$reg_payments = EEM_Registration_Payment::instance()->get_all( array(
837
+		$reg_payments = EEM_Registration_Payment::instance()->get_all(array(
838 838
 			array(
839 839
 				'PAY_ID' => array(
840 840
 					'IN',
841
-					array_keys( $payments )
841
+					array_keys($payments)
842 842
 				)
843 843
 			)
844
-		) );
845
-		if ( ! empty( $reg_payments ) ) {
846
-			foreach ( $payments as $payment ) {
847
-				if ( ! $payment instanceof EE_Payment ) {
844
+		));
845
+		if ( ! empty($reg_payments)) {
846
+			foreach ($payments as $payment) {
847
+				if ( ! $payment instanceof EE_Payment) {
848 848
 					continue;
849
-				} else if ( ! isset( $existing_reg_payments[ $payment->ID() ] ) ) {
850
-					$existing_reg_payments[ $payment->ID() ] = array();
849
+				} else if ( ! isset($existing_reg_payments[$payment->ID()])) {
850
+					$existing_reg_payments[$payment->ID()] = array();
851 851
 				}
852
-				foreach ( $reg_payments as $reg_payment ) {
853
-					if ( $reg_payment instanceof EE_Registration_Payment && $reg_payment->payment_ID() === $payment->ID() ) {
854
-						$existing_reg_payments[ $payment->ID() ][ ] = $reg_payment->registration_ID();
852
+				foreach ($reg_payments as $reg_payment) {
853
+					if ($reg_payment instanceof EE_Registration_Payment && $reg_payment->payment_ID() === $payment->ID()) {
854
+						$existing_reg_payments[$payment->ID()][] = $reg_payment->registration_ID();
855 855
 					}
856 856
 				}
857 857
 			}
@@ -888,39 +888,39 @@  discard block
 block discarded – undo
888 888
 		$registrations_to_apply_payment_to .= '<br /><div class="admin-primary-mbox-tbl-wrap">';
889 889
 		$registrations_to_apply_payment_to .= '<table class="admin-primary-mbox-tbl">';
890 890
 		$registrations_to_apply_payment_to .= '<thead><tr>';
891
-		$registrations_to_apply_payment_to .= '<td>' . __( 'ID', 'event_espresso' ) . '</td>';
892
-		$registrations_to_apply_payment_to .= '<td>' . __( 'Registrant', 'event_espresso' ) . '</td>';
893
-		$registrations_to_apply_payment_to .= '<td>' . __( 'Ticket', 'event_espresso' ) . '</td>';
894
-		$registrations_to_apply_payment_to .= '<td>' . __( 'Event', 'event_espresso' ) . '</td>';
895
-		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-cntr">' . __( 'Paid', 'event_espresso' ) . '</td>';
896
-		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-cntr">' . __( 'Owing', 'event_espresso' ) . '</td>';
897
-		$registrations_to_apply_payment_to .= '<td class="jst-cntr">' . __( 'Apply', 'event_espresso' ) . '</td>';
891
+		$registrations_to_apply_payment_to .= '<td>'.__('ID', 'event_espresso').'</td>';
892
+		$registrations_to_apply_payment_to .= '<td>'.__('Registrant', 'event_espresso').'</td>';
893
+		$registrations_to_apply_payment_to .= '<td>'.__('Ticket', 'event_espresso').'</td>';
894
+		$registrations_to_apply_payment_to .= '<td>'.__('Event', 'event_espresso').'</td>';
895
+		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-cntr">'.__('Paid', 'event_espresso').'</td>';
896
+		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-cntr">'.__('Owing', 'event_espresso').'</td>';
897
+		$registrations_to_apply_payment_to .= '<td class="jst-cntr">'.__('Apply', 'event_espresso').'</td>';
898 898
 		$registrations_to_apply_payment_to .= '</tr></thead><tbody>';
899 899
 		// get registrations for TXN
900
-		$registrations = $this->_transaction->registrations( $query_params );
901
-		foreach ( $registrations as $registration ) {
902
-			if ( $registration instanceof EE_Registration ) {
900
+		$registrations = $this->_transaction->registrations($query_params);
901
+		foreach ($registrations as $registration) {
902
+			if ($registration instanceof EE_Registration) {
903 903
 				$owing = $registration->final_price() - $registration->paid();
904
-				$taxable = $registration->ticket()->taxable() ? ' <span class="smaller-text lt-grey-text"> ' . __( '+ tax', 'event_espresso' ) . '</span>' : '';
905
-				$checked = empty( $existing_reg_payments ) || in_array( $registration->ID(), $existing_reg_payments ) ? ' checked="checked"' : '';
906
-				$registrations_to_apply_payment_to .= '<tr id="apply-payment-registration-row-' . $registration->ID() . '">';
904
+				$taxable = $registration->ticket()->taxable() ? ' <span class="smaller-text lt-grey-text"> '.__('+ tax', 'event_espresso').'</span>' : '';
905
+				$checked = empty($existing_reg_payments) || in_array($registration->ID(), $existing_reg_payments) ? ' checked="checked"' : '';
906
+				$registrations_to_apply_payment_to .= '<tr id="apply-payment-registration-row-'.$registration->ID().'">';
907 907
 				// add html for checkbox input and label
908
-				$registrations_to_apply_payment_to .= '<td>' . $registration->ID() . '</td>';
909
-				$registrations_to_apply_payment_to .= '<td>' . $registration->attendee() instanceof EE_Attendee ? $registration->attendee()->full_name() : __( 'Unknown Attendee', 'event_espresso' ) . '</td>';
910
-				$registrations_to_apply_payment_to .= '<td>' . $registration->ticket()->name() . ' : ' . $registration->ticket()->pretty_price() . $taxable . '</td>';
911
-				$registrations_to_apply_payment_to .= '<td>' . $registration->event_name() . '</td>';
912
-				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-rght">' . $registration->pretty_paid() . '</td>';
913
-				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-rght">' . EEH_Template::format_currency( $owing ) . '</td>';
908
+				$registrations_to_apply_payment_to .= '<td>'.$registration->ID().'</td>';
909
+				$registrations_to_apply_payment_to .= '<td>'.$registration->attendee() instanceof EE_Attendee ? $registration->attendee()->full_name() : __('Unknown Attendee', 'event_espresso').'</td>';
910
+				$registrations_to_apply_payment_to .= '<td>'.$registration->ticket()->name().' : '.$registration->ticket()->pretty_price().$taxable.'</td>';
911
+				$registrations_to_apply_payment_to .= '<td>'.$registration->event_name().'</td>';
912
+				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-rght">'.$registration->pretty_paid().'</td>';
913
+				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-rght">'.EEH_Template::format_currency($owing).'</td>';
914 914
 				$registrations_to_apply_payment_to .= '<td class="jst-cntr">';
915 915
 				$disabled = $registration->final_price() > 0 ? '' : ' disabled';
916
-				$registrations_to_apply_payment_to .= '<input type="checkbox" value="' . $registration->ID() . '" name="txn_admin_payment[registrations]"' . $checked . $disabled . '>';
916
+				$registrations_to_apply_payment_to .= '<input type="checkbox" value="'.$registration->ID().'" name="txn_admin_payment[registrations]"'.$checked.$disabled.'>';
917 917
 				$registrations_to_apply_payment_to .= '</td>';
918 918
 				$registrations_to_apply_payment_to .= '</tr>';
919 919
 			}
920 920
 		}
921 921
 		$registrations_to_apply_payment_to .= '</tbody></table></div>';
922
-		$registrations_to_apply_payment_to .= '<p class="clear description">' . __( 'The payment will only be applied to the registrations that have a check mark in their corresponding check box. Checkboxes for free registrations have been disabled.', 'event_espresso' ) . '</p></div>';
923
-		$this->_template_args[ 'registrations_to_apply_payment_to' ] = $registrations_to_apply_payment_to;
922
+		$registrations_to_apply_payment_to .= '<p class="clear description">'.__('The payment will only be applied to the registrations that have a check mark in their corresponding check box. Checkboxes for free registrations have been disabled.', 'event_espresso').'</p></div>';
923
+		$this->_template_args['registrations_to_apply_payment_to'] = $registrations_to_apply_payment_to;
924 924
 	}
925 925
 
926 926
 
@@ -937,9 +937,9 @@  discard block
 block discarded – undo
937 937
 		$statuses = EEM_Registration::reg_status_array(array(), TRUE);
938 938
 		//let's add a "don't change" option.
939 939
 		$status_array['NAN'] = __('Leave the Same', 'event_espresso');
940
-		$status_array = array_merge( $status_array, $statuses );
941
-		$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' );
942
-		$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' );
940
+		$status_array = array_merge($status_array, $statuses);
941
+		$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');
942
+		$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 943
 
944 944
 	}
945 945
 
@@ -954,21 +954,21 @@  discard block
 block discarded – undo
954 954
 	 * @param EE_Payment[] to show on this page
955 955
 	 *	@return void
956 956
 	 */
957
-	private function _get_payment_methods( $payments = array() ) {
957
+	private function _get_payment_methods($payments = array()) {
958 958
 		$payment_methods_of_payments = array();
959
-		foreach( $payments as $payment ){
960
-			if( $payment instanceof EE_Payment ){
961
-				$payment_methods_of_payments[] = $payment->get( 'PMD_ID' );
959
+		foreach ($payments as $payment) {
960
+			if ($payment instanceof EE_Payment) {
961
+				$payment_methods_of_payments[] = $payment->get('PMD_ID');
962 962
 			}
963 963
 		}
964
-		if( $payment_methods_of_payments ){
965
-			$query_args = array( array( 'OR*payment_method_for_payment' => array(
966
-					'PMD_ID' => array( 'IN', $payment_methods_of_payments ),
967
-					'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) ) );
968
-		}else{
969
-			$query_args = array( array( 'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) );
964
+		if ($payment_methods_of_payments) {
965
+			$query_args = array(array('OR*payment_method_for_payment' => array(
966
+					'PMD_ID' => array('IN', $payment_methods_of_payments),
967
+					'PMD_scope' => array('LIKE', '%'.EEM_Payment_Method::scope_admin.'%') )));
968
+		} else {
969
+			$query_args = array(array('PMD_scope' => array('LIKE', '%'.EEM_Payment_Method::scope_admin.'%')));
970 970
 		}
971
-		$this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all( $query_args );
971
+		$this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all($query_args);
972 972
 	}
973 973
 
974 974
 
@@ -982,46 +982,46 @@  discard block
 block discarded – undo
982 982
 	 * @param array $metabox
983 983
 	 * @return void
984 984
 	 */
985
-	public function txn_attendees_meta_box( $post, $metabox = array( 'args' => array() )) {
985
+	public function txn_attendees_meta_box($post, $metabox = array('args' => array())) {
986 986
 
987
-		extract( $metabox['args'] );
987
+		extract($metabox['args']);
988 988
 		$this->_template_args['post'] = $post;
989 989
 		$this->_template_args['event_attendees'] = array();
990 990
 		// process items in cart
991
-		$line_items = $this->_transaction->get_many_related('Line_Item', array( array( 'LIN_type' => 'line-item' ) ) );
992
-		if ( ! empty( $line_items )) {
993
-			foreach ( $line_items as $item ) {
994
-				if ( $item instanceof EE_Line_Item ) {
995
-					switch( $item->OBJ_type() ) {
991
+		$line_items = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => 'line-item')));
992
+		if ( ! empty($line_items)) {
993
+			foreach ($line_items as $item) {
994
+				if ($item instanceof EE_Line_Item) {
995
+					switch ($item->OBJ_type()) {
996 996
 
997 997
 						case 'Event' :
998 998
 							break;
999 999
 
1000 1000
 						case 'Ticket' :
1001 1001
 							$ticket = $item->ticket();
1002
-							if ( empty( $ticket )) {
1002
+							if (empty($ticket)) {
1003 1003
 								continue; //right now we're only handling tickets here.  Cause its expected that only tickets will have attendees right?
1004 1004
 							}
1005
-							$ticket_price = EEH_Template::format_currency( $item->get( 'LIN_unit_price' ));
1005
+							$ticket_price = EEH_Template::format_currency($item->get('LIN_unit_price'));
1006 1006
 							$event = $ticket->get_first_related('Registration')->get_first_related('Event');
1007
-							$event_name = $event instanceof EE_Event ? $event->get('EVT_name') . ' - ' . $item->get('LIN_name') : '';
1007
+							$event_name = $event instanceof EE_Event ? $event->get('EVT_name').' - '.$item->get('LIN_name') : '';
1008 1008
 
1009
-							$registrations = $ticket->get_many_related('Registration', array( array('TXN_ID' => $this->_transaction->ID() )));
1010
-							foreach( $registrations as $registration ) {
1011
-								$this->_template_args['event_attendees'][$registration->ID()]['att_num'] 						= $registration->get('REG_count');
1012
-								$this->_template_args['event_attendees'][$registration->ID()]['event_ticket_name'] 	= $event_name;
1013
-								$this->_template_args['event_attendees'][$registration->ID()]['ticket_price'] 				= $ticket_price;
1009
+							$registrations = $ticket->get_many_related('Registration', array(array('TXN_ID' => $this->_transaction->ID())));
1010
+							foreach ($registrations as $registration) {
1011
+								$this->_template_args['event_attendees'][$registration->ID()]['att_num'] = $registration->get('REG_count');
1012
+								$this->_template_args['event_attendees'][$registration->ID()]['event_ticket_name'] = $event_name;
1013
+								$this->_template_args['event_attendees'][$registration->ID()]['ticket_price'] = $ticket_price;
1014 1014
 								// attendee info
1015 1015
 								$attendee = $registration->get_first_related('Attendee');
1016
-								if ( $attendee instanceof EE_Attendee ) {
1016
+								if ($attendee instanceof EE_Attendee) {
1017 1017
 									$this->_template_args['event_attendees'][$registration->ID()]['att_id'] 			= $attendee->ID();
1018 1018
 									$this->_template_args['event_attendees'][$registration->ID()]['attendee'] 	= $attendee->full_name();
1019
-									$this->_template_args['event_attendees'][$registration->ID()]['email'] 			= '<a href="mailto:' . $attendee->email() . '?subject=' . $event->get('EVT_name') . __(' Event', 'event_espresso') . '">' . $attendee->email() . '</a>';
1020
-									$this->_template_args['event_attendees'][$registration->ID()]['address'] 		=  implode(',<br>', $attendee->full_address_as_array() );
1019
+									$this->_template_args['event_attendees'][$registration->ID()]['email'] = '<a href="mailto:'.$attendee->email().'?subject='.$event->get('EVT_name').__(' Event', 'event_espresso').'">'.$attendee->email().'</a>';
1020
+									$this->_template_args['event_attendees'][$registration->ID()]['address'] 		= implode(',<br>', $attendee->full_address_as_array());
1021 1021
 								} else {
1022 1022
 									$this->_template_args['event_attendees'][$registration->ID()]['att_id'] 			= '';
1023 1023
 									$this->_template_args['event_attendees'][$registration->ID()]['attendee'] 	= '';
1024
-									$this->_template_args['event_attendees'][$registration->ID()]['email'] 			= '';
1024
+									$this->_template_args['event_attendees'][$registration->ID()]['email'] = '';
1025 1025
 									$this->_template_args['event_attendees'][$registration->ID()]['address'] 		= '';
1026 1026
 								}
1027 1027
 							}
@@ -1031,12 +1031,12 @@  discard block
 block discarded – undo
1031 1031
 				}
1032 1032
 			}
1033 1033
 
1034
-			$this->_template_args['transaction_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'attendees'  ), TXN_ADMIN_URL );
1035
-			echo EEH_Template::display_template( TXN_TEMPLATE_PATH . 'txn_admin_details_main_meta_box_attendees.template.php', $this->_template_args, TRUE );
1034
+			$this->_template_args['transaction_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'attendees'), TXN_ADMIN_URL);
1035
+			echo EEH_Template::display_template(TXN_TEMPLATE_PATH.'txn_admin_details_main_meta_box_attendees.template.php', $this->_template_args, TRUE);
1036 1036
 
1037 1037
 		} else {
1038 1038
 			echo sprintf(
1039
-				__( '%1$sFor some reason, there are no attendees registered for this transaction. Likely the registration was abandoned in process.%2$s', 'event_espresso' ),
1039
+				__('%1$sFor some reason, there are no attendees registered for this transaction. Likely the registration was abandoned in process.%2$s', 'event_espresso'),
1040 1040
 				'<p class="important-notice">',
1041 1041
 				'</p>'
1042 1042
 			);
@@ -1055,19 +1055,19 @@  discard block
 block discarded – undo
1055 1055
 	 */
1056 1056
 	public function txn_registrant_side_meta_box() {
1057 1057
 		$primary_att = $this->_transaction->primary_registration() instanceof EE_Registration ? $this->_transaction->primary_registration()->get_first_related('Attendee') : null;
1058
-		if ( ! $primary_att instanceof EE_Attendee ) {
1058
+		if ( ! $primary_att instanceof EE_Attendee) {
1059 1059
 			$this->_template_args['no_attendee_message'] = __('There is no attached contact for this transaction.  The transaction either failed due to an error or was abandoned.', 'event_espresso');
1060 1060
 			$primary_att = EEM_Attendee::instance()->create_default_object();
1061 1061
 		}
1062
-		$this->_template_args['ATT_ID'] 						= $primary_att->ID();
1062
+		$this->_template_args['ATT_ID'] = $primary_att->ID();
1063 1063
 		$this->_template_args['prime_reg_fname']		= $primary_att->fname();
1064 1064
 		$this->_template_args['prime_reg_lname']		= $primary_att->lname();
1065
-		$this->_template_args['prime_reg_email'] 		= $primary_att->email();
1065
+		$this->_template_args['prime_reg_email'] = $primary_att->email();
1066 1066
 		$this->_template_args['prime_reg_phone'] 	= $primary_att->phone();
1067
-		$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 );
1067
+		$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);
1068 1068
 		// get formatted address for registrant
1069
-		$this->_template_args[ 'formatted_address' ] = EEH_Address::format( $primary_att );
1070
-		echo EEH_Template::display_template( TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE );
1069
+		$this->_template_args['formatted_address'] = EEH_Address::format($primary_att);
1070
+		echo EEH_Template::display_template(TXN_TEMPLATE_PATH.'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE);
1071 1071
 	}
1072 1072
 
1073 1073
 
@@ -1083,12 +1083,12 @@  discard block
 block discarded – undo
1083 1083
 
1084 1084
 		$this->_template_args['billing_form'] = $this->_transaction->billing_info();
1085 1085
 		$this->_template_args['billing_form_url'] = add_query_arg(
1086
-			array( 'action' => 'edit_transaction', 'process' => 'billing'  ),
1086
+			array('action' => 'edit_transaction', 'process' => 'billing'),
1087 1087
 			TXN_ADMIN_URL
1088 1088
 		);
1089 1089
 
1090
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_billing_info.template.php';
1091
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );/**/
1090
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_side_meta_box_billing_info.template.php';
1091
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); /**/
1092 1092
 	}
1093 1093
 
1094 1094
 
@@ -1101,42 +1101,42 @@  discard block
 block discarded – undo
1101 1101
 	*	@return void
1102 1102
 	*/
1103 1103
 	public function apply_payments_or_refunds() {
1104
-		$json_response_data = array( 'return_data' => FALSE );
1104
+		$json_response_data = array('return_data' => FALSE);
1105 1105
 		$valid_data = $this->_validate_payment_request_data();
1106
-		if ( ! empty( $valid_data ) ) {
1107
-			$PAY_ID = $valid_data[ 'PAY_ID' ];
1106
+		if ( ! empty($valid_data)) {
1107
+			$PAY_ID = $valid_data['PAY_ID'];
1108 1108
 			//save  the new payment
1109
-			$payment = $this->_create_payment_from_request_data( $valid_data );
1109
+			$payment = $this->_create_payment_from_request_data($valid_data);
1110 1110
 			// get the TXN for this payment
1111 1111
 			$transaction = $payment->transaction();
1112 1112
 			// verify transaction
1113
-			if ( $transaction instanceof EE_Transaction ) {
1113
+			if ($transaction instanceof EE_Transaction) {
1114 1114
 				// calculate_total_payments_and_update_status
1115
-				$this->_process_transaction_payments( $transaction );
1116
-				$REG_IDs = $this->_get_REG_IDs_to_apply_payment_to( $payment );
1117
-				$this->_remove_existing_registration_payments( $payment, $PAY_ID );
1115
+				$this->_process_transaction_payments($transaction);
1116
+				$REG_IDs = $this->_get_REG_IDs_to_apply_payment_to($payment);
1117
+				$this->_remove_existing_registration_payments($payment, $PAY_ID);
1118 1118
 				// apply payment to registrations (if applicable)
1119
-				if ( ! empty( $REG_IDs ) ) {
1120
-					$this->_update_registration_payments( $transaction, $payment, $REG_IDs );
1119
+				if ( ! empty($REG_IDs)) {
1120
+					$this->_update_registration_payments($transaction, $payment, $REG_IDs);
1121 1121
 					$this->_maybe_send_notifications();
1122 1122
 					// now process status changes for the same registrations
1123
-					$this->_process_registration_status_change( $transaction, $REG_IDs );
1123
+					$this->_process_registration_status_change($transaction, $REG_IDs);
1124 1124
 				}
1125
-				$this->_maybe_send_notifications( $payment );
1125
+				$this->_maybe_send_notifications($payment);
1126 1126
 				//prepare to render page
1127
-				$json_response_data[ 'return_data' ] = $this->_build_payment_json_response( $payment, $REG_IDs );
1128
-				do_action( 'AHEE__Transactions_Admin_Page__apply_payments_or_refund__after_recording', $transaction, $payment );
1127
+				$json_response_data['return_data'] = $this->_build_payment_json_response($payment, $REG_IDs);
1128
+				do_action('AHEE__Transactions_Admin_Page__apply_payments_or_refund__after_recording', $transaction, $payment);
1129 1129
 			} else {
1130 1130
 				EE_Error::add_error(
1131
-					__( 'A valid Transaction for this payment could not be retrieved.', 'event_espresso' ),
1131
+					__('A valid Transaction for this payment could not be retrieved.', 'event_espresso'),
1132 1132
 					__FILE__, __FUNCTION__, __LINE__
1133 1133
 				);
1134 1134
 			}
1135 1135
 		} else {
1136
-			EE_Error::add_error( __( 'The payment form data could not be processed. Please try again.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1136
+			EE_Error::add_error(__('The payment form data could not be processed. Please try again.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1137 1137
 		}
1138 1138
 
1139
-		$notices = EE_Error::get_notices( false, false, false );
1139
+		$notices = EE_Error::get_notices(false, false, false);
1140 1140
 		$this->_template_args = array(
1141 1141
 			'data' => $json_response_data,
1142 1142
 			'error' => $notices['errors'],
@@ -1153,30 +1153,30 @@  discard block
 block discarded – undo
1153 1153
 	 * @return array
1154 1154
 	 */
1155 1155
 	protected function _validate_payment_request_data() {
1156
-		if ( ! isset( $this->_req_data[ 'txn_admin_payment' ] ) ) {
1156
+		if ( ! isset($this->_req_data['txn_admin_payment'])) {
1157 1157
 			return false;
1158 1158
 		}
1159 1159
 		$payment_form = $this->_generate_payment_form_section();
1160 1160
 		try {
1161
-			if ( $payment_form->was_submitted() ) {
1161
+			if ($payment_form->was_submitted()) {
1162 1162
 				$payment_form->receive_form_submission();
1163
-				if ( ! $payment_form->is_valid() ) {
1163
+				if ( ! $payment_form->is_valid()) {
1164 1164
 					$submission_error_messages = array();
1165
-					foreach ( $payment_form->get_validation_errors_accumulated() as $validation_error ) {
1166
-						if ( $validation_error instanceof EE_Validation_Error ) {
1165
+					foreach ($payment_form->get_validation_errors_accumulated() as $validation_error) {
1166
+						if ($validation_error instanceof EE_Validation_Error) {
1167 1167
 							$submission_error_messages[] = sprintf(
1168
-								_x( '%s : %s', 'Form Section Name : Form Validation Error', 'event_espresso' ),
1168
+								_x('%s : %s', 'Form Section Name : Form Validation Error', 'event_espresso'),
1169 1169
 								$validation_error->get_form_section()->html_label_text(),
1170 1170
 								$validation_error->getMessage()
1171 1171
 							);
1172 1172
 						}
1173 1173
 					}
1174
-					EE_Error::add_error( join( '<br />', $submission_error_messages ), __FILE__, __FUNCTION__, __LINE__ );
1174
+					EE_Error::add_error(join('<br />', $submission_error_messages), __FILE__, __FUNCTION__, __LINE__);
1175 1175
 					return array();
1176 1176
 				}
1177 1177
 			}
1178
-		} catch ( EE_Error $e ) {
1179
-			EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__ );
1178
+		} catch (EE_Error $e) {
1179
+			EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
1180 1180
 			return array();
1181 1181
 		}
1182 1182
 		return $payment_form->valid_data();
@@ -1198,63 +1198,63 @@  discard block
 block discarded – undo
1198 1198
 						array(
1199 1199
 							'default' => 0,
1200 1200
 							'required' => false,
1201
-							'html_label_text' => __( 'Payment ID', 'event_espresso' ),
1202
-							'validation_strategies' => array( new EE_Int_Normalization() )
1201
+							'html_label_text' => __('Payment ID', 'event_espresso'),
1202
+							'validation_strategies' => array(new EE_Int_Normalization())
1203 1203
 						)
1204 1204
 					),
1205 1205
 					'TXN_ID' => new EE_Text_Input(
1206 1206
 						array(
1207 1207
 							'default' => 0,
1208 1208
 							'required' => true,
1209
-							'html_label_text' => __( 'Transaction ID', 'event_espresso' ),
1210
-							'validation_strategies' => array( new EE_Int_Normalization() )
1209
+							'html_label_text' => __('Transaction ID', 'event_espresso'),
1210
+							'validation_strategies' => array(new EE_Int_Normalization())
1211 1211
 						)
1212 1212
 					),
1213 1213
 					'type' => new EE_Text_Input(
1214 1214
 						array(
1215 1215
 							'default' => 1,
1216 1216
 							'required' => true,
1217
-							'html_label_text' => __( 'Payment or Refund', 'event_espresso' ),
1218
-							'validation_strategies' => array( new EE_Int_Normalization() )
1217
+							'html_label_text' => __('Payment or Refund', 'event_espresso'),
1218
+							'validation_strategies' => array(new EE_Int_Normalization())
1219 1219
 						)
1220 1220
 					),
1221 1221
 					'amount' => new EE_Text_Input(
1222 1222
 						array(
1223 1223
 							'default' => 0,
1224 1224
 							'required' => true,
1225
-							'html_label_text' => __( 'Payment amount', 'event_espresso' ),
1226
-							'validation_strategies' => array( new EE_Float_Normalization() )
1225
+							'html_label_text' => __('Payment amount', 'event_espresso'),
1226
+							'validation_strategies' => array(new EE_Float_Normalization())
1227 1227
 						)
1228 1228
 					),
1229 1229
 					'status' => new EE_Text_Input(
1230 1230
 						array(
1231 1231
 							'default' => EEM_Payment::status_id_approved,
1232 1232
 							'required' => true,
1233
-							'html_label_text' => __( 'Payment status', 'event_espresso' ),
1233
+							'html_label_text' => __('Payment status', 'event_espresso'),
1234 1234
 						)
1235 1235
 					),
1236 1236
 					'PMD_ID' => new EE_Text_Input(
1237 1237
 						array(
1238 1238
 							'default' => 2,
1239 1239
 							'required' => true,
1240
-							'html_label_text' => __( 'Payment Method', 'event_espresso' ),
1241
-							'validation_strategies' => array( new EE_Int_Normalization() )
1240
+							'html_label_text' => __('Payment Method', 'event_espresso'),
1241
+							'validation_strategies' => array(new EE_Int_Normalization())
1242 1242
 						)
1243 1243
 					),
1244 1244
 					'date' => new EE_Text_Input(
1245 1245
 						array(
1246 1246
 							'default' => time(),
1247 1247
 							'required' => true,
1248
-							'html_label_text' => __( 'Payment date', 'event_espresso' ),
1248
+							'html_label_text' => __('Payment date', 'event_espresso'),
1249 1249
 						)
1250 1250
 					),
1251 1251
 					'txn_id_chq_nmbr' => new EE_Text_Input(
1252 1252
 						array(
1253 1253
 							'default' => '',
1254 1254
 							'required' => false,
1255
-							'html_label_text' => __( 'Transaction or Cheque Number', 'event_espresso' ),
1255
+							'html_label_text' => __('Transaction or Cheque Number', 'event_espresso'),
1256 1256
                                                         'validation_strategies' => array(
1257
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1257
+                                                            new EE_Max_Length_Validation_Strategy(__('Input too long', 'event_espresso'), 100),
1258 1258
                                                         )
1259 1259
 						)
1260 1260
 					),
@@ -1262,9 +1262,9 @@  discard block
 block discarded – undo
1262 1262
 						array(
1263 1263
 							'default' => '',
1264 1264
 							'required' => false,
1265
-							'html_label_text' => __( 'Purchase Order Number', 'event_espresso' ),
1265
+							'html_label_text' => __('Purchase Order Number', 'event_espresso'),
1266 1266
                                                         'validation_strategies' => array(
1267
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1267
+                                                            new EE_Max_Length_Validation_Strategy(__('Input too long', 'event_espresso'), 100),
1268 1268
                                                         )
1269 1269
 						)
1270 1270
 					),
@@ -1272,9 +1272,9 @@  discard block
 block discarded – undo
1272 1272
 						array(
1273 1273
 							'default' => '',
1274 1274
 							'required' => false,
1275
-							'html_label_text' => __( 'Extra Field for Accounting', 'event_espresso' ),
1275
+							'html_label_text' => __('Extra Field for Accounting', 'event_espresso'),
1276 1276
                                                         'validation_strategies' => array(
1277
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1277
+                                                            new EE_Max_Length_Validation_Strategy(__('Input too long', 'event_espresso'), 100),
1278 1278
                                                         )
1279 1279
 						)
1280 1280
 					),
@@ -1291,37 +1291,37 @@  discard block
 block discarded – undo
1291 1291
 	 * @param array $valid_data
1292 1292
 	 * @return EE_Payment
1293 1293
 	 */
1294
-	protected function _create_payment_from_request_data( $valid_data ) {
1295
-		$PAY_ID = $valid_data[ 'PAY_ID' ];
1294
+	protected function _create_payment_from_request_data($valid_data) {
1295
+		$PAY_ID = $valid_data['PAY_ID'];
1296 1296
 		// get payment amount
1297
-		$amount = $valid_data[ 'amount' ] ? abs( $valid_data[ 'amount' ] ) : 0;
1297
+		$amount = $valid_data['amount'] ? abs($valid_data['amount']) : 0;
1298 1298
 		// payments have a type value of 1 and refunds have a type value of -1
1299 1299
 		// so multiplying amount by type will give a positive value for payments, and negative values for refunds
1300
-		$amount = $valid_data[ 'type' ] < 0 ? $amount * -1 : $amount;
1300
+		$amount = $valid_data['type'] < 0 ? $amount * -1 : $amount;
1301 1301
 		// for some reason the date string coming in has extra spaces between the date and time.  This fixes that.
1302
-		$date = $valid_data['date'] ? preg_replace( '/\s+/', ' ', $valid_data['date'] ) : date( 'Y-m-d g:i a', current_time( 'timestamp' ) );
1302
+		$date = $valid_data['date'] ? preg_replace('/\s+/', ' ', $valid_data['date']) : date('Y-m-d g:i a', current_time('timestamp'));
1303 1303
 		$payment = EE_Payment::new_instance(
1304 1304
 			array(
1305
-				'TXN_ID' 								=> $valid_data[ 'TXN_ID' ],
1306
-				'STS_ID' 								=> $valid_data[ 'status' ],
1305
+				'TXN_ID' 								=> $valid_data['TXN_ID'],
1306
+				'STS_ID' 								=> $valid_data['status'],
1307 1307
 				'PAY_timestamp' 				=> $date,
1308 1308
 				'PAY_source'           			=> EEM_Payment_Method::scope_admin,
1309
-				'PMD_ID'               				=> $valid_data[ 'PMD_ID' ],
1309
+				'PMD_ID'               				=> $valid_data['PMD_ID'],
1310 1310
 				'PAY_amount'           			=> $amount,
1311
-				'PAY_txn_id_chq_nmbr'  	=> $valid_data[ 'txn_id_chq_nmbr' ],
1312
-				'PAY_po_number'        		=> $valid_data[ 'po_number' ],
1313
-				'PAY_extra_accntng'    		=> $valid_data[ 'accounting' ],
1311
+				'PAY_txn_id_chq_nmbr'  	=> $valid_data['txn_id_chq_nmbr'],
1312
+				'PAY_po_number'        		=> $valid_data['po_number'],
1313
+				'PAY_extra_accntng'    		=> $valid_data['accounting'],
1314 1314
 				'PAY_details'          				=> $valid_data,
1315 1315
 				'PAY_ID'               				=> $PAY_ID
1316 1316
 			),
1317 1317
 			'',
1318
-			array( 'Y-m-d', 'g:i a' )
1318
+			array('Y-m-d', 'g:i a')
1319 1319
 		);
1320 1320
 
1321
-		if ( ! $payment->save() ) {
1321
+		if ( ! $payment->save()) {
1322 1322
 			EE_Error::add_error(
1323 1323
 				sprintf(
1324
-					__( 'Payment %1$d has not been successfully saved to the database.', 'event_espresso' ),
1324
+					__('Payment %1$d has not been successfully saved to the database.', 'event_espresso'),
1325 1325
 					$payment->ID()
1326 1326
 				),
1327 1327
 				__FILE__, __FUNCTION__, __LINE__
@@ -1338,15 +1338,15 @@  discard block
 block discarded – undo
1338 1338
 	 * @param \EE_Transaction $transaction
1339 1339
 	 * @return array
1340 1340
 	 */
1341
-	protected function _process_transaction_payments( EE_Transaction $transaction ) {
1341
+	protected function _process_transaction_payments(EE_Transaction $transaction) {
1342 1342
 		/** @type EE_Transaction_Payments $transaction_payments */
1343
-		$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1343
+		$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1344 1344
 		//update the transaction with this payment
1345
-		if ( $transaction_payments->calculate_total_payments_and_update_status( $transaction ) ) {
1346
-			EE_Error::add_success( __( 'The payment has been processed successfully.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1345
+		if ($transaction_payments->calculate_total_payments_and_update_status($transaction)) {
1346
+			EE_Error::add_success(__('The payment has been processed successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1347 1347
 		} else {
1348 1348
 			EE_Error::add_error(
1349
-				__( 'The payment was processed successfully but the amount paid for the transaction was not updated.', 'event_espresso' )
1349
+				__('The payment was processed successfully but the amount paid for the transaction was not updated.', 'event_espresso')
1350 1350
 				, __FILE__, __FUNCTION__, __LINE__
1351 1351
 			);
1352 1352
 		}
@@ -1362,19 +1362,19 @@  discard block
 block discarded – undo
1362 1362
 	 * @param \EE_Payment $payment
1363 1363
 	 * @return array
1364 1364
 	 */
1365
-	protected function _get_REG_IDs_to_apply_payment_to( EE_Payment $payment ) {
1365
+	protected function _get_REG_IDs_to_apply_payment_to(EE_Payment $payment) {
1366 1366
 		$REG_IDs = array();
1367 1367
 		// grab array of IDs for specific registrations to apply changes to
1368
-		if ( isset( $this->_req_data[ 'txn_admin_payment' ][ 'registrations' ] ) ) {
1369
-			$REG_IDs = (array)$this->_req_data[ 'txn_admin_payment' ][ 'registrations' ];
1368
+		if (isset($this->_req_data['txn_admin_payment']['registrations'])) {
1369
+			$REG_IDs = (array) $this->_req_data['txn_admin_payment']['registrations'];
1370 1370
 		}
1371 1371
 		//nothing specified ? then get all reg IDs
1372
-		if ( empty( $REG_IDs ) ) {
1372
+		if (empty($REG_IDs)) {
1373 1373
 			$registrations = $payment->transaction()->registrations();
1374
-			$REG_IDs = ! empty( $registrations ) ? array_keys( $registrations ) : $this->_get_existing_reg_payment_REG_IDs( $payment );
1374
+			$REG_IDs = ! empty($registrations) ? array_keys($registrations) : $this->_get_existing_reg_payment_REG_IDs($payment);
1375 1375
 		}
1376 1376
 		// ensure that REG_IDs are integers and NOT strings
1377
-		return array_map( 'intval', $REG_IDs );
1377
+		return array_map('intval', $REG_IDs);
1378 1378
 	}
1379 1379
 
1380 1380
 
@@ -1391,7 +1391,7 @@  discard block
 block discarded – undo
1391 1391
 	/**
1392 1392
 	 * @param array $existing_reg_payment_REG_IDs
1393 1393
 	 */
1394
-	public function set_existing_reg_payment_REG_IDs( $existing_reg_payment_REG_IDs = null ) {
1394
+	public function set_existing_reg_payment_REG_IDs($existing_reg_payment_REG_IDs = null) {
1395 1395
 		$this->_existing_reg_payment_REG_IDs = $existing_reg_payment_REG_IDs;
1396 1396
 	}
1397 1397
 
@@ -1406,13 +1406,13 @@  discard block
 block discarded – undo
1406 1406
 	 * @param \EE_Payment $payment
1407 1407
 	 * @return array
1408 1408
 	 */
1409
-	protected function _get_existing_reg_payment_REG_IDs( EE_Payment $payment ) {
1410
-		if ( $this->existing_reg_payment_REG_IDs() === null ) {
1409
+	protected function _get_existing_reg_payment_REG_IDs(EE_Payment $payment) {
1410
+		if ($this->existing_reg_payment_REG_IDs() === null) {
1411 1411
 			// let's get any existing reg payment records for this payment
1412
-			$existing_reg_payment_REG_IDs = $payment->get_many_related( 'Registration' );
1412
+			$existing_reg_payment_REG_IDs = $payment->get_many_related('Registration');
1413 1413
 			// but we only want the REG IDs, so grab the array keys
1414
-			$existing_reg_payment_REG_IDs = ! empty( $existing_reg_payment_REG_IDs ) ? array_keys( $existing_reg_payment_REG_IDs ) : array();
1415
-			$this->set_existing_reg_payment_REG_IDs( $existing_reg_payment_REG_IDs );
1414
+			$existing_reg_payment_REG_IDs = ! empty($existing_reg_payment_REG_IDs) ? array_keys($existing_reg_payment_REG_IDs) : array();
1415
+			$this->set_existing_reg_payment_REG_IDs($existing_reg_payment_REG_IDs);
1416 1416
 		}
1417 1417
 		return $this->existing_reg_payment_REG_IDs();
1418 1418
 	}
@@ -1431,23 +1431,23 @@  discard block
 block discarded – undo
1431 1431
 	 * @param int         $PAY_ID
1432 1432
 	 * @return bool;
1433 1433
 	 */
1434
-	protected function _remove_existing_registration_payments( EE_Payment $payment, $PAY_ID = 0 ) {
1434
+	protected function _remove_existing_registration_payments(EE_Payment $payment, $PAY_ID = 0) {
1435 1435
 		// newly created payments will have nothing recorded for $PAY_ID
1436
-		if ( $PAY_ID == 0 ) {
1436
+		if ($PAY_ID == 0) {
1437 1437
 			return false;
1438 1438
 		}
1439
-		$existing_reg_payment_REG_IDs = $this->_get_existing_reg_payment_REG_IDs( $payment );
1440
-		if ( empty( $existing_reg_payment_REG_IDs )) {
1439
+		$existing_reg_payment_REG_IDs = $this->_get_existing_reg_payment_REG_IDs($payment);
1440
+		if (empty($existing_reg_payment_REG_IDs)) {
1441 1441
 			return false;
1442 1442
 		}
1443 1443
 		/** @type EE_Transaction_Payments $transaction_payments */
1444
-		$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1444
+		$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1445 1445
 		return $transaction_payments->delete_registration_payments_and_update_registrations(
1446 1446
 			$payment,
1447 1447
 			array(
1448 1448
 				array(
1449 1449
 					'PAY_ID' => $payment->ID(),
1450
-					'REG_ID' => array( 'IN', $existing_reg_payment_REG_IDs ),
1450
+					'REG_ID' => array('IN', $existing_reg_payment_REG_IDs),
1451 1451
 				)
1452 1452
 			)
1453 1453
 		);
@@ -1466,25 +1466,25 @@  discard block
 block discarded – undo
1466 1466
 	 * @param array $REG_IDs
1467 1467
 	 * @return bool
1468 1468
 	 */
1469
-	protected function _update_registration_payments( EE_Transaction $transaction, EE_Payment $payment, $REG_IDs = array() ) {
1469
+	protected function _update_registration_payments(EE_Transaction $transaction, EE_Payment $payment, $REG_IDs = array()) {
1470 1470
 		// we can pass our own custom set of registrations to EE_Payment_Processor::process_registration_payments()
1471 1471
 		// so let's do that using our set of REG_IDs from the form
1472 1472
 		$registration_query_where_params = array(
1473
-			'REG_ID' => array( 'IN', $REG_IDs )
1473
+			'REG_ID' => array('IN', $REG_IDs)
1474 1474
 		);
1475 1475
 		// but add in some conditions regarding payment,
1476 1476
 		// so that we don't apply payments to registrations that are free or have already been paid for
1477 1477
 		// but ONLY if the payment is NOT a refund ( ie: the payment amount is not negative )
1478
-		if ( ! $payment->is_a_refund() ) {
1479
-			$registration_query_where_params[ 'REG_final_price' ]  = array( '!=', 0 );
1480
-			$registration_query_where_params[ 'REG_final_price*' ]  = array( '!=', 'REG_paid', true );
1478
+		if ( ! $payment->is_a_refund()) {
1479
+			$registration_query_where_params['REG_final_price'] = array('!=', 0);
1480
+			$registration_query_where_params['REG_final_price*'] = array('!=', 'REG_paid', true);
1481 1481
 		}
1482 1482
 		//EEH_Debug_Tools::printr( $registration_query_where_params, '$registration_query_where_params', __FILE__, __LINE__ );
1483
-		$registrations = $transaction->registrations( array( $registration_query_where_params ) );
1484
-		if ( ! empty( $registrations ) ) {
1483
+		$registrations = $transaction->registrations(array($registration_query_where_params));
1484
+		if ( ! empty($registrations)) {
1485 1485
 			/** @type EE_Payment_Processor $payment_processor */
1486
-			$payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' );
1487
-			$payment_processor->process_registration_payments( $transaction, $payment, $registrations );
1486
+			$payment_processor = EE_Registry::instance()->load_core('Payment_Processor');
1487
+			$payment_processor->process_registration_payments($transaction, $payment, $registrations);
1488 1488
 		}
1489 1489
 	}
1490 1490
 
@@ -1500,22 +1500,22 @@  discard block
 block discarded – undo
1500 1500
 	 * @param array $REG_IDs
1501 1501
 	 * @return bool
1502 1502
 	 */
1503
-	protected function _process_registration_status_change( EE_Transaction $transaction, $REG_IDs = array() ) {
1503
+	protected function _process_registration_status_change(EE_Transaction $transaction, $REG_IDs = array()) {
1504 1504
 		// first if there is no change in status then we get out.
1505 1505
 		if (
1506
-			! isset( $this->_req_data['txn_reg_status_change'], $this->_req_data[ 'txn_reg_status_change' ][ 'reg_status' ] )
1506
+			! isset($this->_req_data['txn_reg_status_change'], $this->_req_data['txn_reg_status_change']['reg_status'])
1507 1507
 			|| $this->_req_data['txn_reg_status_change']['reg_status'] == 'NAN'
1508 1508
 		) {
1509 1509
 			//no error message, no change requested, just nothing to do man.
1510 1510
 			return FALSE;
1511 1511
 		}
1512 1512
 		/** @type EE_Transaction_Processor $transaction_processor */
1513
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1513
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1514 1514
 		// made it here dude?  Oh WOW.  K, let's take care of changing the statuses
1515 1515
 		return $transaction_processor->manually_update_registration_statuses(
1516 1516
 			$transaction,
1517
-			sanitize_text_field( $this->_req_data[ 'txn_reg_status_change' ][ 'reg_status' ] ),
1518
-			array( array( 'REG_ID' => array( 'IN', $REG_IDs ) ) )
1517
+			sanitize_text_field($this->_req_data['txn_reg_status_change']['reg_status']),
1518
+			array(array('REG_ID' => array('IN', $REG_IDs)))
1519 1519
 		);
1520 1520
 	}
1521 1521
 
@@ -1530,16 +1530,16 @@  discard block
 block discarded – undo
1530 1530
 	 * @param bool | null        $delete_txn_reg_status_change
1531 1531
 	 * @return array
1532 1532
 	 */
1533
-	protected function _build_payment_json_response( EE_Payment $payment, $REG_IDs = array(), $delete_txn_reg_status_change = null ) {
1533
+	protected function _build_payment_json_response(EE_Payment $payment, $REG_IDs = array(), $delete_txn_reg_status_change = null) {
1534 1534
 		// was the payment deleted ?
1535
-		if ( is_bool( $delete_txn_reg_status_change )) {
1535
+		if (is_bool($delete_txn_reg_status_change)) {
1536 1536
 			return array(
1537 1537
 				'PAY_ID' 				=> $payment->ID(),
1538 1538
 				'amount' 			=> $payment->amount(),
1539 1539
 				'total_paid' 			=> $payment->transaction()->paid(),
1540 1540
 				'txn_status' 			=> $payment->transaction()->status_ID(),
1541 1541
 				'pay_status' 		=> $payment->STS_ID(),
1542
-				'registrations' 	=> $this->_registration_payment_data_array( $REG_IDs ),
1542
+				'registrations' 	=> $this->_registration_payment_data_array($REG_IDs),
1543 1543
 				'delete_txn_reg_status_change' => $delete_txn_reg_status_change,
1544 1544
 			);
1545 1545
 		} else {
@@ -1551,16 +1551,16 @@  discard block
 block discarded – undo
1551 1551
 				'pay_status' 	=> $payment->STS_ID(),
1552 1552
 				'PAY_ID'           => $payment->ID(),
1553 1553
 				'STS_ID' 			=> $payment->STS_ID(),
1554
-				'status' 			=> self::$_pay_status[ $payment->STS_ID() ],
1555
-				'date' 				=> $payment->timestamp( 'Y-m-d', 'h:i a' ),
1556
-				'method' 		=> strtoupper( $payment->source() ),
1554
+				'status' 			=> self::$_pay_status[$payment->STS_ID()],
1555
+				'date' 				=> $payment->timestamp('Y-m-d', 'h:i a'),
1556
+				'method' 		=> strtoupper($payment->source()),
1557 1557
 				'PM_ID' 			=> $payment->payment_method() ? $payment->payment_method()->ID() : 1,
1558
-				'gateway' 		=> $payment->payment_method() ? $payment->payment_method()->admin_name() : __( "Unknown", 'event_espresso' ),
1558
+				'gateway' 		=> $payment->payment_method() ? $payment->payment_method()->admin_name() : __("Unknown", 'event_espresso'),
1559 1559
 				'gateway_response' 	=> $payment->gateway_response(),
1560 1560
 				'txn_id_chq_nmbr'  	=> $payment->txn_id_chq_nmbr(),
1561 1561
 				'po_number'        		=> $payment->po_number(),
1562 1562
 				'extra_accntng'    		=> $payment->extra_accntng(),
1563
-				'registrations'    			=> $this->_registration_payment_data_array( $REG_IDs ),
1563
+				'registrations'    			=> $this->_registration_payment_data_array($REG_IDs),
1564 1564
 			);
1565 1565
 		}
1566 1566
 	}
@@ -1575,39 +1575,39 @@  discard block
 block discarded – undo
1575 1575
 	*	@return void
1576 1576
 	*/
1577 1577
 	public function delete_payment() {
1578
-		$json_response_data = array( 'return_data' => FALSE );
1579
-		$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;
1580
-		if ( $PAY_ID ) {
1581
-			$delete_txn_reg_status_change = isset( $this->_req_data[ 'delete_txn_reg_status_change' ] ) ? $this->_req_data[ 'delete_txn_reg_status_change' ] : false;
1582
-			$payment = EEM_Payment::instance()->get_one_by_ID( $PAY_ID );
1583
-			if ( $payment instanceof EE_Payment ) {
1584
-				$REG_IDs = $this->_get_existing_reg_payment_REG_IDs( $payment );
1578
+		$json_response_data = array('return_data' => FALSE);
1579
+		$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;
1580
+		if ($PAY_ID) {
1581
+			$delete_txn_reg_status_change = isset($this->_req_data['delete_txn_reg_status_change']) ? $this->_req_data['delete_txn_reg_status_change'] : false;
1582
+			$payment = EEM_Payment::instance()->get_one_by_ID($PAY_ID);
1583
+			if ($payment instanceof EE_Payment) {
1584
+				$REG_IDs = $this->_get_existing_reg_payment_REG_IDs($payment);
1585 1585
 				/** @type EE_Transaction_Payments $transaction_payments */
1586
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1587
-				if ( $transaction_payments->delete_payment_and_update_transaction( $payment )) {
1588
-					$json_response_data['return_data'] = $this->_build_payment_json_response( $payment, $REG_IDs, $delete_txn_reg_status_change );
1589
-					if ( $delete_txn_reg_status_change ) {
1586
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1587
+				if ($transaction_payments->delete_payment_and_update_transaction($payment)) {
1588
+					$json_response_data['return_data'] = $this->_build_payment_json_response($payment, $REG_IDs, $delete_txn_reg_status_change);
1589
+					if ($delete_txn_reg_status_change) {
1590 1590
 						$this->_req_data['txn_reg_status_change'] = $delete_txn_reg_status_change;
1591 1591
 						//MAKE sure we also add the delete_txn_req_status_change to the
1592 1592
 						//$_REQUEST global because that's how messages will be looking for it.
1593 1593
 						$_REQUEST['txn_reg_status_change'] = $delete_txn_reg_status_change;
1594 1594
 						$this->_maybe_send_notifications();
1595
-						$this->_process_registration_status_change( $payment->transaction(), $REG_IDs );
1595
+						$this->_process_registration_status_change($payment->transaction(), $REG_IDs);
1596 1596
 					}
1597 1597
 				}
1598 1598
 			} else {
1599 1599
 				EE_Error::add_error(
1600
-					__( 'Valid Payment data could not be retrieved from the database.', 'event_espresso' ),
1600
+					__('Valid Payment data could not be retrieved from the database.', 'event_espresso'),
1601 1601
 					__FILE__, __FUNCTION__, __LINE__
1602 1602
 				);
1603 1603
 			}
1604 1604
 		} else {
1605 1605
 			EE_Error::add_error(
1606
-				__( 'A valid Payment ID was not received, therefore payment form data could not be loaded.', 'event_espresso' ),
1606
+				__('A valid Payment ID was not received, therefore payment form data could not be loaded.', 'event_espresso'),
1607 1607
 				__FILE__, __FUNCTION__, __LINE__
1608 1608
 			);
1609 1609
 		}
1610
-		$notices = EE_Error::get_notices( false, false, false);
1610
+		$notices = EE_Error::get_notices(false, false, false);
1611 1611
 		$this->_template_args = array(
1612 1612
 			'data' => $json_response_data,
1613 1613
 			'success' => $notices['success'],
@@ -1627,16 +1627,16 @@  discard block
 block discarded – undo
1627 1627
 	 * @param array $REG_IDs
1628 1628
 	 * @return array
1629 1629
 	 */
1630
-	protected function _registration_payment_data_array( $REG_IDs ) {
1630
+	protected function _registration_payment_data_array($REG_IDs) {
1631 1631
 		$registration_payment_data = array();
1632 1632
 		//if non empty reg_ids lets get an array of registrations and update the values for the apply_payment/refund rows.
1633
-		if ( ! empty( $REG_IDs ) ) {
1634
-			$registrations = EEM_Registration::instance()->get_all( array( array( 'REG_ID' => array( 'IN', $REG_IDs ) ) ) );
1635
-			foreach ( $registrations as $registration ) {
1636
-				if ( $registration instanceof EE_Registration ) {
1637
-					$registration_payment_data[ $registration->ID() ] = array(
1633
+		if ( ! empty($REG_IDs)) {
1634
+			$registrations = EEM_Registration::instance()->get_all(array(array('REG_ID' => array('IN', $REG_IDs))));
1635
+			foreach ($registrations as $registration) {
1636
+				if ($registration instanceof EE_Registration) {
1637
+					$registration_payment_data[$registration->ID()] = array(
1638 1638
 						'paid' => $registration->pretty_paid(),
1639
-						'owing' => EEH_Template::format_currency( $registration->final_price() - $registration->paid() ),
1639
+						'owing' => EEH_Template::format_currency($registration->final_price() - $registration->paid()),
1640 1640
 					);
1641 1641
 				}
1642 1642
 			}
@@ -1656,30 +1656,30 @@  discard block
 block discarded – undo
1656 1656
 	 * @access protected
1657 1657
 	 * @param \EE_Payment | null $payment
1658 1658
 	 */
1659
-	protected function _maybe_send_notifications( $payment = null ) {
1660
-		switch ( $payment instanceof EE_Payment ) {
1659
+	protected function _maybe_send_notifications($payment = null) {
1660
+		switch ($payment instanceof EE_Payment) {
1661 1661
 			// payment notifications
1662 1662
 			case true :
1663 1663
 				if (
1664 1664
 					isset(
1665
-						$this->_req_data[ 'txn_payments' ],
1666
-						$this->_req_data[ 'txn_payments' ][ 'send_notifications' ]
1665
+						$this->_req_data['txn_payments'],
1666
+						$this->_req_data['txn_payments']['send_notifications']
1667 1667
 					) &&
1668
-					filter_var( $this->_req_data[ 'txn_payments' ][ 'send_notifications' ], FILTER_VALIDATE_BOOLEAN )
1668
+					filter_var($this->_req_data['txn_payments']['send_notifications'], FILTER_VALIDATE_BOOLEAN)
1669 1669
 				) {
1670
-					$this->_process_payment_notification( $payment );
1670
+					$this->_process_payment_notification($payment);
1671 1671
 				}
1672 1672
 				break;
1673 1673
 			// registration notifications
1674 1674
 			case false :
1675 1675
 				if (
1676 1676
 					isset(
1677
-						$this->_req_data[ 'txn_reg_status_change' ],
1678
-						$this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ]
1677
+						$this->_req_data['txn_reg_status_change'],
1678
+						$this->_req_data['txn_reg_status_change']['send_notifications']
1679 1679
 					) &&
1680
-					filter_var( $this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ], FILTER_VALIDATE_BOOLEAN )
1680
+					filter_var($this->_req_data['txn_reg_status_change']['send_notifications'], FILTER_VALIDATE_BOOLEAN)
1681 1681
 				) {
1682
-					add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true' );
1682
+					add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true');
1683 1683
 				}
1684 1684
 				break;
1685 1685
 		}
@@ -1695,11 +1695,11 @@  discard block
 block discarded – undo
1695 1695
 	*	@return void
1696 1696
 	*/
1697 1697
 	protected function _send_payment_reminder() {
1698
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1699
-		$transaction = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
1700
-		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID'] ) : array();
1701
-		do_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction );
1702
-		$this->_redirect_after_action( FALSE, __('payment reminder', 'event_espresso'), __('sent', 'event_espresso'), $query_args, TRUE );
1698
+	    $TXN_ID = ( ! empty($this->_req_data['TXN_ID'])) ? absint($this->_req_data['TXN_ID']) : FALSE;
1699
+		$transaction = EEM_Transaction::instance()->get_one_by_ID($TXN_ID);
1700
+		$query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID']) : array();
1701
+		do_action('AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction);
1702
+		$this->_redirect_after_action(FALSE, __('payment reminder', 'event_espresso'), __('sent', 'event_espresso'), $query_args, TRUE);
1703 1703
 	}
1704 1704
 
1705 1705
 
@@ -1713,36 +1713,36 @@  discard block
 block discarded – undo
1713 1713
 	 * @param string   $view
1714 1714
 	 * @return mixed int = count || array of transaction objects
1715 1715
 	 */
1716
-	public function get_transactions( $perpage, $count = FALSE, $view = '' ) {
1716
+	public function get_transactions($perpage, $count = FALSE, $view = '') {
1717 1717
 
1718 1718
 		$TXN = EEM_Transaction::instance();
1719 1719
 
1720
-	    $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' ));
1721
-	    $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' );
1720
+	    $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'));
1721
+	    $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');
1722 1722
 
1723 1723
 	    //make sure our timestamps start and end right at the boundaries for each day
1724
-	    $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1725
-	    $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1724
+	    $start_date = date('Y-m-d', strtotime($start_date)).' 00:00:00';
1725
+	    $end_date = date('Y-m-d', strtotime($end_date)).' 23:59:59';
1726 1726
 
1727 1727
 
1728 1728
 	    //convert to timestamps
1729
-	    $start_date = strtotime( $start_date );
1730
-	    $end_date = strtotime( $end_date );
1729
+	    $start_date = strtotime($start_date);
1730
+	    $end_date = strtotime($end_date);
1731 1731
 
1732 1732
 	    //makes sure start date is the lowest value and vice versa
1733
-	    $start_date = min( $start_date, $end_date );
1734
-	    $end_date = max( $start_date, $end_date );
1733
+	    $start_date = min($start_date, $end_date);
1734
+	    $end_date = max($start_date, $end_date);
1735 1735
 
1736 1736
 	    //convert to correct format for query
1737
-	$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' );
1738
-	$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' );
1737
+	$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');
1738
+	$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');
1739 1739
 
1740 1740
 
1741 1741
 
1742 1742
 	    //set orderby
1743 1743
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
1744 1744
 
1745
-		switch ( $this->_req_data['orderby'] ) {
1745
+		switch ($this->_req_data['orderby']) {
1746 1746
 			case 'TXN_ID':
1747 1747
 				$orderby = 'TXN_ID';
1748 1748
 				break;
@@ -1756,66 +1756,66 @@  discard block
 block discarded – undo
1756 1756
 				$orderby = 'TXN_timestamp';
1757 1757
 		}
1758 1758
 
1759
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC';
1760
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
1761
-		$per_page = isset( $perpage ) && !empty( $perpage ) ? $perpage : 10;
1762
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
1759
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC';
1760
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
1761
+		$per_page = isset($perpage) && ! empty($perpage) ? $perpage : 10;
1762
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
1763 1763
 
1764
-		$offset = ($current_page-1)*$per_page;
1765
-		$limit = array( $offset, $per_page );
1764
+		$offset = ($current_page - 1) * $per_page;
1765
+		$limit = array($offset, $per_page);
1766 1766
 
1767 1767
 		$_where = array(
1768
-			'TXN_timestamp' => array('BETWEEN', array($start_date, $end_date) ),
1768
+			'TXN_timestamp' => array('BETWEEN', array($start_date, $end_date)),
1769 1769
 			'Registration.REG_count' => 1
1770 1770
 		);
1771 1771
 
1772
-		if ( isset( $this->_req_data['EVT_ID'] ) ) {
1772
+		if (isset($this->_req_data['EVT_ID'])) {
1773 1773
 			$_where['Registration.EVT_ID'] = $this->_req_data['EVT_ID'];
1774 1774
 		}
1775 1775
 
1776
-		if ( isset( $this->_req_data['s'] ) ) {
1777
-			$search_string = '%' . $this->_req_data['s'] . '%';
1776
+		if (isset($this->_req_data['s'])) {
1777
+			$search_string = '%'.$this->_req_data['s'].'%';
1778 1778
 			$_where['OR'] = array(
1779
-				'Registration.Event.EVT_name' => array( 'LIKE', $search_string ),
1780
-				'Registration.Event.EVT_desc' => array( 'LIKE', $search_string ),
1781
-				'Registration.Event.EVT_short_desc' => array( 'LIKE' , $search_string ),
1782
-				'Registration.Attendee.ATT_full_name' => array( 'LIKE', $search_string ),
1783
-				'Registration.Attendee.ATT_fname' => array( 'LIKE', $search_string ),
1784
-				'Registration.Attendee.ATT_lname' => array( 'LIKE', $search_string ),
1785
-				'Registration.Attendee.ATT_short_bio' => array( 'LIKE', $search_string ),
1786
-				'Registration.Attendee.ATT_email' => array('LIKE', $search_string ),
1787
-				'Registration.Attendee.ATT_address' => array( 'LIKE', $search_string ),
1788
-				'Registration.Attendee.ATT_address2' => array( 'LIKE', $search_string ),
1789
-				'Registration.Attendee.ATT_city' => array( 'LIKE', $search_string ),
1790
-				'Registration.REG_final_price' => array( 'LIKE', $search_string ),
1791
-				'Registration.REG_code' => array( 'LIKE', $search_string ),
1792
-				'Registration.REG_count' => array( 'LIKE' , $search_string ),
1793
-				'Registration.REG_group_size' => array( 'LIKE' , $search_string ),
1794
-				'Registration.Ticket.TKT_name' => array( 'LIKE', $search_string ),
1795
-				'Registration.Ticket.TKT_description' => array( 'LIKE', $search_string ),
1796
-				'Payment.PAY_source' => array('LIKE', $search_string ),
1797
-				'Payment.Payment_Method.PMD_name' => array('LIKE', $search_string ),
1798
-				'TXN_session_data' => array( 'LIKE', $search_string ),
1799
-				'Payment.PAY_txn_id_chq_nmbr' => array( 'LIKE', $search_string )
1779
+				'Registration.Event.EVT_name' => array('LIKE', $search_string),
1780
+				'Registration.Event.EVT_desc' => array('LIKE', $search_string),
1781
+				'Registration.Event.EVT_short_desc' => array('LIKE', $search_string),
1782
+				'Registration.Attendee.ATT_full_name' => array('LIKE', $search_string),
1783
+				'Registration.Attendee.ATT_fname' => array('LIKE', $search_string),
1784
+				'Registration.Attendee.ATT_lname' => array('LIKE', $search_string),
1785
+				'Registration.Attendee.ATT_short_bio' => array('LIKE', $search_string),
1786
+				'Registration.Attendee.ATT_email' => array('LIKE', $search_string),
1787
+				'Registration.Attendee.ATT_address' => array('LIKE', $search_string),
1788
+				'Registration.Attendee.ATT_address2' => array('LIKE', $search_string),
1789
+				'Registration.Attendee.ATT_city' => array('LIKE', $search_string),
1790
+				'Registration.REG_final_price' => array('LIKE', $search_string),
1791
+				'Registration.REG_code' => array('LIKE', $search_string),
1792
+				'Registration.REG_count' => array('LIKE', $search_string),
1793
+				'Registration.REG_group_size' => array('LIKE', $search_string),
1794
+				'Registration.Ticket.TKT_name' => array('LIKE', $search_string),
1795
+				'Registration.Ticket.TKT_description' => array('LIKE', $search_string),
1796
+				'Payment.PAY_source' => array('LIKE', $search_string),
1797
+				'Payment.Payment_Method.PMD_name' => array('LIKE', $search_string),
1798
+				'TXN_session_data' => array('LIKE', $search_string),
1799
+				'Payment.PAY_txn_id_chq_nmbr' => array('LIKE', $search_string)
1800 1800
 				);
1801 1801
 		}
1802 1802
 
1803 1803
 		//failed transactions
1804
-		$failed = ( ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'failed' && ! $count ) || ( $count && $view == 'failed' ) ? TRUE: FALSE;
1805
-		$abandoned = ( ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'abandoned' && ! $count ) || ( $count && $view == 'abandoned' ) ? TRUE: FALSE;
1804
+		$failed = ( ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'failed' && ! $count) || ($count && $view == 'failed') ? TRUE : FALSE;
1805
+		$abandoned = ( ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'abandoned' && ! $count) || ($count && $view == 'abandoned') ? TRUE : FALSE;
1806 1806
 
1807
-		if ( $failed ) {
1808
-			$_where[ 'STS_ID' ] = EEM_Transaction::failed_status_code;
1809
-		} else if ( $abandoned ) {
1807
+		if ($failed) {
1808
+			$_where['STS_ID'] = EEM_Transaction::failed_status_code;
1809
+		} else if ($abandoned) {
1810 1810
 				$_where['STS_ID'] = EEM_Transaction::abandoned_status_code;
1811 1811
 		} else {
1812
-				$_where['STS_ID'] = array( '!=', EEM_Transaction::failed_status_code );
1813
-				$_where['STS_ID*'] = array( '!=', EEM_Transaction::abandoned_status_code );
1812
+				$_where['STS_ID'] = array('!=', EEM_Transaction::failed_status_code);
1813
+				$_where['STS_ID*'] = array('!=', EEM_Transaction::abandoned_status_code);
1814 1814
 		}
1815 1815
 
1816
-		$query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'limit' => $limit );
1816
+		$query_params = array($_where, 'order_by' => array($orderby => $sort), 'limit' => $limit);
1817 1817
 
1818
-		$transactions = $count ? $TXN->count( array($_where), 'TXN_ID', TRUE ) : $TXN->get_all($query_params);
1818
+		$transactions = $count ? $TXN->count(array($_where), 'TXN_ID', TRUE) : $TXN->get_all($query_params);
1819 1819
 
1820 1820
 
1821 1821
 		return $transactions;
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();
@@ -261,10 +261,10 @@  discard block
 block discarded – undo
261 261
 	/**
262 262
 	 * _set_transaction_status_array
263 263
 	 * sets list of transaction statuses
264
-	*
264
+	 *
265 265
 	 * @access private
266
-	*	@return void
267
-	*/
266
+	 *	@return void
267
+	 */
268 268
 	private function _set_transaction_status_array() {
269 269
 		self::$_txn_status = EEM_Transaction::instance()->status_array(TRUE);
270 270
 	}
@@ -286,10 +286,10 @@  discard block
 block discarded – undo
286 286
 
287 287
 	/**
288 288
 	 * 	get list of payment statuses
289
-	*
289
+	 *
290 290
 	 * @access private
291
-	*	@return void
292
-	*/
291
+	 *	@return void
292
+	 */
293 293
 	private function _get_payment_status_array() {
294 294
 		self::$_pay_status = EEM_Payment::instance()->status_array(TRUE);
295 295
 		$this->_template_args['payment_status'] = self::$_pay_status;
@@ -397,18 +397,18 @@  discard block
 block discarded – undo
397 397
 		if ( is_object( $this->_transaction) )
398 398
 			return; //get out we've already set the object
399 399
 
400
-	    $TXN = EEM_Transaction::instance();
400
+		$TXN = EEM_Transaction::instance();
401 401
 
402
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
402
+		$TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
403 403
 
404
-	    //get transaction object
405
-	    $this->_transaction = $TXN->get_one_by_ID($TXN_ID);
406
-	    $this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
404
+		//get transaction object
405
+		$this->_transaction = $TXN->get_one_by_ID($TXN_ID);
406
+		$this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
407 407
 
408 408
 	 	if ( empty( $this->_transaction ) ) {
409
-	    	$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  __(' could not be retrieved.', 'event_espresso');
409
+			$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  __(' could not be retrieved.', 'event_espresso');
410 410
 			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
411
-	    }
411
+		}
412 412
 	}
413 413
 
414 414
 
@@ -523,12 +523,12 @@  discard block
 block discarded – undo
523 523
 
524 524
 
525 525
 	/**
526
-	* 	_transaction_details
526
+	 * 	_transaction_details
527 527
 	 * generates HTML for the View Transaction Details Admin page
528
-	*
528
+	 *
529 529
 	 * @access protected
530
-	*	@return void
531
-	*/
530
+	 *	@return void
531
+	 */
532 532
 	protected function _transaction_details() {
533 533
 		do_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction );
534 534
 
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 						'button secondary-button right',
580 580
 						'dashicons dashicons-email-alt'
581 581
 					)
582
-				    : '';
582
+					: '';
583 583
 		} else {
584 584
 			$this->_template_args['send_payment_reminder_button'] = '';
585 585
 		}
@@ -733,10 +733,10 @@  discard block
 block discarded – undo
733 733
 	/**
734 734
 	 * txn_details_meta_box
735 735
 	 * generates HTML for the Transaction main meta box
736
-	*
736
+	 *
737 737
 	 * @access public
738
-	*	@return void
739
-	*/
738
+	 *	@return void
739
+	 */
740 740
 	public function txn_details_meta_box() {
741 741
 
742 742
 		$this->_set_transaction_object();
@@ -1076,10 +1076,10 @@  discard block
 block discarded – undo
1076 1076
 	/**
1077 1077
 	 * txn_billing_info_side_meta_box
1078 1078
 	 * 	generates HTML for the Edit Transaction side meta box
1079
-	*
1079
+	 *
1080 1080
 	 * @access public
1081
-	*	@return void
1082
-	*/
1081
+	 *	@return void
1082
+	 */
1083 1083
 	public function txn_billing_info_side_meta_box() {
1084 1084
 
1085 1085
 		$this->_template_args['billing_form'] = $this->_transaction->billing_info();
@@ -1097,10 +1097,10 @@  discard block
 block discarded – undo
1097 1097
 	/**
1098 1098
 	 * apply_payments_or_refunds
1099 1099
 	 * 	registers a payment or refund made towards a transaction
1100
-	*
1100
+	 *
1101 1101
 	 * @access public
1102
-	*	@return void
1103
-	*/
1102
+	 *	@return void
1103
+	 */
1104 1104
 	public function apply_payments_or_refunds() {
1105 1105
 		$json_response_data = array( 'return_data' => FALSE );
1106 1106
 		$valid_data = $this->_validate_payment_request_data();
@@ -1254,9 +1254,9 @@  discard block
 block discarded – undo
1254 1254
 							'default' => '',
1255 1255
 							'required' => false,
1256 1256
 							'html_label_text' => __( 'Transaction or Cheque Number', 'event_espresso' ),
1257
-                                                        'validation_strategies' => array(
1258
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1259
-                                                        )
1257
+														'validation_strategies' => array(
1258
+															new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1259
+														)
1260 1260
 						)
1261 1261
 					),
1262 1262
 					'po_number' => new EE_Text_Input(
@@ -1264,9 +1264,9 @@  discard block
 block discarded – undo
1264 1264
 							'default' => '',
1265 1265
 							'required' => false,
1266 1266
 							'html_label_text' => __( 'Purchase Order Number', 'event_espresso' ),
1267
-                                                        'validation_strategies' => array(
1268
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1269
-                                                        )
1267
+														'validation_strategies' => array(
1268
+															new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1269
+														)
1270 1270
 						)
1271 1271
 					),
1272 1272
 					'accounting' => new EE_Text_Input(
@@ -1274,9 +1274,9 @@  discard block
 block discarded – undo
1274 1274
 							'default' => '',
1275 1275
 							'required' => false,
1276 1276
 							'html_label_text' => __( 'Extra Field for Accounting', 'event_espresso' ),
1277
-                                                        'validation_strategies' => array(
1278
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1279
-                                                        )
1277
+														'validation_strategies' => array(
1278
+															new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1279
+														)
1280 1280
 						)
1281 1281
 					),
1282 1282
 				)
@@ -1571,10 +1571,10 @@  discard block
 block discarded – undo
1571 1571
 	/**
1572 1572
 	 * delete_payment
1573 1573
 	 * 	delete a payment or refund made towards a transaction
1574
-	*
1574
+	 *
1575 1575
 	 * @access public
1576
-	*	@return void
1577
-	*/
1576
+	 *	@return void
1577
+	 */
1578 1578
 	public function delete_payment() {
1579 1579
 		$json_response_data = array( 'return_data' => FALSE );
1580 1580
 		$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;
@@ -1691,12 +1691,12 @@  discard block
 block discarded – undo
1691 1691
 	/**
1692 1692
 	 * _send_payment_reminder
1693 1693
 	 * 	generates HTML for the View Transaction Details Admin page
1694
-	*
1694
+	 *
1695 1695
 	 * @access protected
1696
-	*	@return void
1697
-	*/
1696
+	 *	@return void
1697
+	 */
1698 1698
 	protected function _send_payment_reminder() {
1699
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1699
+		$TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1700 1700
 		$transaction = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
1701 1701
 		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID'] ) : array();
1702 1702
 		do_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction );
@@ -1718,29 +1718,29 @@  discard block
 block discarded – undo
1718 1718
 
1719 1719
 		$TXN = EEM_Transaction::instance();
1720 1720
 
1721
-	    $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' ));
1722
-	    $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' );
1721
+		$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' ));
1722
+		$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 1723
 
1724
-	    //make sure our timestamps start and end right at the boundaries for each day
1725
-	    $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1726
-	    $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1724
+		//make sure our timestamps start and end right at the boundaries for each day
1725
+		$start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1726
+		$end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1727 1727
 
1728 1728
 
1729
-	    //convert to timestamps
1730
-	    $start_date = strtotime( $start_date );
1731
-	    $end_date = strtotime( $end_date );
1729
+		//convert to timestamps
1730
+		$start_date = strtotime( $start_date );
1731
+		$end_date = strtotime( $end_date );
1732 1732
 
1733
-	    //makes sure start date is the lowest value and vice versa
1734
-	    $start_date = min( $start_date, $end_date );
1735
-	    $end_date = max( $start_date, $end_date );
1733
+		//makes sure start date is the lowest value and vice versa
1734
+		$start_date = min( $start_date, $end_date );
1735
+		$end_date = max( $start_date, $end_date );
1736 1736
 
1737
-	    //convert to correct format for query
1737
+		//convert to correct format for query
1738 1738
 	$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' );
1739 1739
 	$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 1740
 
1741 1741
 
1742 1742
 
1743
-	    //set orderby
1743
+		//set orderby
1744 1744
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
1745 1745
 
1746 1746
 		switch ( $this->_req_data['orderby'] ) {
Please login to merge, or discard this patch.