Completed
Branch BETA-4.9-messages-queue-fixed (c79dab)
by
unknown
28:50 queued 13s
created
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.
admin_pages/support/Support_Admin_Page.core.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 class Support_Admin_Page extends EE_Admin_Page {
31 31
 
32 32
 
33
-	public function __construct( $routing = TRUE ) {
34
-		parent::__construct( $routing );
33
+	public function __construct($routing = TRUE) {
34
+		parent::__construct($routing);
35 35
 	}
36 36
 
37 37
 
@@ -85,14 +85,14 @@  discard block
 block discarded – undo
85 85
 				'nav' => array(
86 86
 					'label' => __('Shortcodes', 'event_espresso'),
87 87
 					'order' => 30),
88
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_shortcodes_boxes' ) ),
88
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_shortcodes_boxes')),
89 89
 				'require_nonce' => FALSE
90 90
 				),
91 91
 			'contact_support' => array(
92 92
 				'nav' => array(
93 93
 					'label' => __('Support', 'event_espresso'),
94 94
 					'order' => 40),
95
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_support_boxes' ) ),
95
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_support_boxes')),
96 96
 				'require_nonce' => FALSE
97 97
 				),
98 98
 			'developers' => array(
@@ -120,8 +120,8 @@  discard block
 block discarded – undo
120 120
 
121 121
 
122 122
 	protected function _installation() {
123
-		$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_installation.template.php';
124
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, '', TRUE);
123
+		$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'support_admin_details_installation.template.php';
124
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, '', TRUE);
125 125
 		$this->display_admin_page_with_sidebar();
126 126
 	}
127 127
 
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
 			'other_resources' => __('Other Resources', 'event_espresso')
147 147
 			);
148 148
 
149
-		foreach ( $boxes as $box => $label ) {
150
-			$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_' . $box . '.template.php';
149
+		foreach ($boxes as $box => $label) {
150
+			$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'support_admin_details_'.$box.'.template.php';
151 151
 			$callback_args = array('template_path' => $template_path);
152
-			add_meta_box( 'espresso_' . $box . '_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], "", TRUE );'), $this->_current_screen_id, 'normal', 'high', $callback_args);
152
+			add_meta_box('espresso_'.$box.'_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], "", TRUE );'), $this->_current_screen_id, 'normal', 'high', $callback_args);
153 153
 		}
154 154
 	}
155 155
 
@@ -170,15 +170,15 @@  discard block
 block discarded – undo
170 170
 			'shortcodes_event_listings' => __('Event Listings', 'event_espresso'),
171 171
 			'shortcodes_ticket_selector' => __('Event Ticket Selector', 'event_espresso'),
172 172
 			'shortcodes_category' => __('Event Categories', 'event_espresso'),
173
-			'shortcodes_attendee' => __( 'Event Attendees', 'event_espresso' )
173
+			'shortcodes_attendee' => __('Event Attendees', 'event_espresso')
174 174
 			/*'shortcodes_single_events' => __('Single Events', 'event_espresso'),*/
175 175
 			/*'shortcodes_attendee_listings' => __('Attendee Listings', 'event_espresso'),*/
176 176
 			);
177 177
 
178
-		foreach ( $boxes as $box => $label ) {
179
-			$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_' . $box . '.template.php';
178
+		foreach ($boxes as $box => $label) {
179
+			$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'support_admin_details_'.$box.'.template.php';
180 180
 			$callback_args = array('template_path' => $template_path);
181
-			add_meta_box( 'espresso_' . $box . '_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], "", TRUE );'), $this->_current_screen_id, 'normal', 'high', $callback_args);
181
+			add_meta_box('espresso_'.$box.'_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], "", TRUE );'), $this->_current_screen_id, 'normal', 'high', $callback_args);
182 182
 		}
183 183
 	}
184 184
 
@@ -197,17 +197,17 @@  discard block
 block discarded – undo
197 197
 			'important_information' => __('Important Information', 'event_espresso')
198 198
 			);
199 199
 
200
-		foreach ( $boxes as $box => $label ) {
201
-			$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'support_admin_details_' . $box . '.template.php';
200
+		foreach ($boxes as $box => $label) {
201
+			$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'support_admin_details_'.$box.'.template.php';
202 202
 			$callback_args = array('template_path' => $template_path, 'template_args' => $this->_template_args);
203
-			add_meta_box( 'espresso_' . $box . '_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], $metabox["args"]["template_args"], TRUE );'), $this->_current_screen_id, 'normal', 'high', $callback_args);
203
+			add_meta_box('espresso_'.$box.'_settings', $label, create_function('$post, $metabox', 'echo EEH_Template::display_template( $metabox["args"]["template_path"], $metabox["args"]["template_args"], TRUE );'), $this->_current_screen_id, 'normal', 'high', $callback_args);
204 204
 		}
205 205
 	}
206 206
 
207 207
 
208 208
 	protected function _developers() {
209
-		$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'developers_admin_details.template.php';
210
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, array(), true );
209
+		$template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH.'developers_admin_details.template.php';
210
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, array(), true);
211 211
 		$this->display_admin_page_with_sidebar();
212 212
 	}
213 213
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
support/templates/support_admin_details_contact_support.template.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 		<?php _e('As with most open source programs (and closed licensed programs), the possibility exists that you may find the occasional bug or discover that something is not working as expected. Please don\'t panic! We are here to help you.', 'event_espresso'); ?>
10 10
 	</p>
11 11
 	<p>
12
-		<?php printf( __('If your problems are not urgent, please post in our %ssupport forums%s. If you need immediate help, please purchase a support token and you\'ll be able to schedule one-on-one time with a member of our team.', 'event_espresso'), '<a href="http://eventespresso.com/support/forums/" target="_blank">', '</a>' ); ?>
12
+		<?php printf(__('If your problems are not urgent, please post in our %ssupport forums%s. If you need immediate help, please purchase a support token and you\'ll be able to schedule one-on-one time with a member of our team.', 'event_espresso'), '<a href="http://eventespresso.com/support/forums/" target="_blank">', '</a>'); ?>
13 13
 	</p>
14 14
 	<p class="ee-attention">
15 15
 		<strong class="red_text">
@@ -30,6 +30,6 @@  discard block
 block discarded – undo
30 30
 		<?php _e('A support token can be used towards receiving support for a single incident. Support is provided up to 30 minutes via phone call, instant message, or priority email support. Here are examples of how support tokens can be used: how-to questions, best practices questions, technical issues, advising on custom development.', 'event_espresso'); ?>
31 31
 	</p>
32 32
 	<p>
33
-		<?php printf( __('You can learn more about support tokens and purchase one by %sclicking here%s.', 'event_espresso'),'<a href="http://eventespresso.com/product/priority-support-tokens/?utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=help_support_tab&utm_content=support_token" target="_blank">','</a>'); ?>
33
+		<?php printf(__('You can learn more about support tokens and purchase one by %sclicking here%s.', 'event_espresso'), '<a href="http://eventespresso.com/product/priority-support-tokens/?utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=help_support_tab&utm_content=support_token" target="_blank">', '</a>'); ?>
34 34
 	</p>
35 35
 </div>
36 36
\ No newline at end of file
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   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
 	 * _create_payment_from_request_data
1177 1177
 	 *
1178 1178
 	 * @param array $valid_data
1179
-	 * @return EE_Payment
1179
+	 * @return EE_Attendee
1180 1180
 	 */
1181 1181
 	protected function _create_payment_from_request_data( $valid_data ) {
1182 1182
 		$PAY_ID = $valid_data[ 'PAY_ID' ];
@@ -1348,7 +1348,7 @@  discard block
 block discarded – undo
1348 1348
 	 * @param  EE_Transaction $transaction
1349 1349
 	 * @param \EE_Payment $payment
1350 1350
 	 * @param array $REG_IDs
1351
-	 * @return bool
1351
+	 * @return boolean|null
1352 1352
 	 */
1353 1353
 	protected function _update_registration_payments( EE_Transaction $transaction, EE_Payment $payment, $REG_IDs = array() ) {
1354 1354
 		// we can pass our own custom set of registrations to EE_Payment_Processor::process_registration_payments()
@@ -1537,6 +1537,7 @@  discard block
 block discarded – undo
1537 1537
 	 *
1538 1538
 	 * @access protected
1539 1539
 	 * @param \EE_Payment | null $payment
1540
+	 * @param EE_Attendee $payment
1540 1541
 	 */
1541 1542
 	protected function _maybe_send_notifications( $payment = null ) {
1542 1543
 		switch ( $payment instanceof EE_Payment ) {
Please login to merge, or discard this patch.
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2 2
 /**
3
- * Event Espresso
4
- *
5
- * Event Registration and Management Plugin for WordPress
6
- *
7
- * @ package			Event Espresso
8
- * @ author				Seth Shoultes
9
- * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
10
- * @ license			{@link http://eventespresso.com/support/terms-conditions/}   * see Plugin Licensing *
11
- * @ link					{@link http://www.eventespresso.com}
12
- * @ since		 		4.0
13
- *
14
- * ------------------------------------------------------------------------
15
- *
16
- * EE_Admin_Transactions class
17
- *
18
- * @package			Event Espresso
19
- * @subpackage	includes/core/admin/transactions/Transactions_Admin_Page.core.php
20
- * @author				Brent Christensen
21
- *
22
- * ------------------------------------------------------------------------
23
- */
3
+	 * Event Espresso
4
+	 *
5
+	 * Event Registration and Management Plugin for WordPress
6
+	 *
7
+	 * @ package			Event Espresso
8
+	 * @ author				Seth Shoultes
9
+	 * @ copyright		(c) 2008-2011 Event Espresso  All Rights Reserved.
10
+	 * @ license			{@link http://eventespresso.com/support/terms-conditions/}   * see Plugin Licensing *
11
+	 * @ link					{@link http://www.eventespresso.com}
12
+	 * @ since		 		4.0
13
+	 *
14
+	 * ------------------------------------------------------------------------
15
+	 *
16
+	 * EE_Admin_Transactions class
17
+	 *
18
+	 * @package			Event Espresso
19
+	 * @subpackage	includes/core/admin/transactions/Transactions_Admin_Page.core.php
20
+	 * @author				Brent Christensen
21
+	 *
22
+	 * ------------------------------------------------------------------------
23
+	 */
24 24
 class Transactions_Admin_Page extends EE_Admin_Page {
25 25
 
26 26
 	/**
@@ -106,9 +106,9 @@  discard block
 block discarded – undo
106 106
 
107 107
 	/**
108 108
 	 * 		grab url requests and route them
109
-	*		@access private
110
-	*		@return void
111
-	*/
109
+	 *		@access private
110
+	 *		@return void
111
+	 */
112 112
 	public function _set_page_routes() {
113 113
 
114 114
 		$this->_set_transaction_status_array();
@@ -247,10 +247,10 @@  discard block
 block discarded – undo
247 247
 	/**
248 248
 	 * _set_transaction_status_array
249 249
 	 * sets list of transaction statuses
250
-	*
250
+	 *
251 251
 	 * @access private
252
-	*	@return void
253
-	*/
252
+	 *	@return void
253
+	 */
254 254
 	private function _set_transaction_status_array() {
255 255
 		self::$_txn_status = EEM_Transaction::instance()->status_array(TRUE);
256 256
 	}
@@ -272,10 +272,10 @@  discard block
 block discarded – undo
272 272
 
273 273
 	/**
274 274
 	 * 	get list of payment statuses
275
-	*
275
+	 *
276 276
 	 * @access private
277
-	*	@return void
278
-	*/
277
+	 *	@return void
278
+	 */
279 279
 	private function _get_payment_status_array() {
280 280
 		self::$_pay_status = EEM_Payment::instance()->status_array(TRUE);
281 281
 		$this->_template_args['payment_status'] = self::$_pay_status;
@@ -383,18 +383,18 @@  discard block
 block discarded – undo
383 383
 		if ( is_object( $this->_transaction) )
384 384
 			return; //get out we've already set the object
385 385
 
386
-	    $TXN = EEM_Transaction::instance();
386
+		$TXN = EEM_Transaction::instance();
387 387
 
388
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
388
+		$TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
389 389
 
390
-	    //get transaction object
391
-	    $this->_transaction = $TXN->get_one_by_ID($TXN_ID);
392
-	    $this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
390
+		//get transaction object
391
+		$this->_transaction = $TXN->get_one_by_ID($TXN_ID);
392
+		$this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
393 393
 
394 394
 	 	if ( empty( $this->_transaction ) ) {
395
-	    	$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  __(' could not be retrieved.', 'event_espresso');
395
+			$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  __(' could not be retrieved.', 'event_espresso');
396 396
 			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
397
-	    }
397
+		}
398 398
 	}
399 399
 
400 400
 
@@ -496,12 +496,12 @@  discard block
 block discarded – undo
496 496
 
497 497
 
498 498
 	/**
499
-	* 	_transaction_details
499
+	 * 	_transaction_details
500 500
 	 * generates HTML for the View Transaction Details Admin page
501
-	*
501
+	 *
502 502
 	 * @access protected
503
-	*	@return void
504
-	*/
503
+	 *	@return void
504
+	 */
505 505
 	protected function _transaction_details() {
506 506
 		do_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction );
507 507
 		EE_Registry::instance()->load_helper( 'MSG_Template' );
@@ -624,10 +624,10 @@  discard block
 block discarded – undo
624 624
 	/**
625 625
 	 * txn_details_meta_box
626 626
 	 * generates HTML for the Transaction main meta box
627
-	*
627
+	 *
628 628
 	 * @access public
629
-	*	@return void
630
-	*/
629
+	 *	@return void
630
+	 */
631 631
 	public function txn_details_meta_box() {
632 632
 
633 633
 		$this->_set_transaction_object();
@@ -968,10 +968,10 @@  discard block
 block discarded – undo
968 968
 	/**
969 969
 	 * txn_billing_info_side_meta_box
970 970
 	 * 	generates HTML for the Edit Transaction side meta box
971
-	*
971
+	 *
972 972
 	 * @access public
973
-	*	@return void
974
-	*/
973
+	 *	@return void
974
+	 */
975 975
 	public function txn_billing_info_side_meta_box() {
976 976
 
977 977
 		$this->_template_args['billing_form'] = $this->_transaction->billing_info();
@@ -989,10 +989,10 @@  discard block
 block discarded – undo
989 989
 	/**
990 990
 	 * apply_payments_or_refunds
991 991
 	 * 	registers a payment or refund made towards a transaction
992
-	*
992
+	 *
993 993
 	 * @access public
994
-	*	@return void
995
-	*/
994
+	 *	@return void
995
+	 */
996 996
 	public function apply_payments_or_refunds() {
997 997
 		$json_response_data = array( 'return_data' => FALSE );
998 998
 		$valid_data = $this->_validate_payment_request_data();
@@ -1140,9 +1140,9 @@  discard block
 block discarded – undo
1140 1140
 							'default' => '',
1141 1141
 							'required' => false,
1142 1142
 							'html_label_text' => __( 'Transaction or Cheque Number', 'event_espresso' ),
1143
-                                                        'validation_strategies' => array(
1144
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1145
-                                                        )
1143
+														'validation_strategies' => array(
1144
+															new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1145
+														)
1146 1146
 						)
1147 1147
 					),
1148 1148
 					'po_number' => new EE_Text_Input(
@@ -1150,9 +1150,9 @@  discard block
 block discarded – undo
1150 1150
 							'default' => '',
1151 1151
 							'required' => false,
1152 1152
 							'html_label_text' => __( 'Purchase Order Number', 'event_espresso' ),
1153
-                                                        'validation_strategies' => array(
1154
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1155
-                                                        )
1153
+														'validation_strategies' => array(
1154
+															new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1155
+														)
1156 1156
 						)
1157 1157
 					),
1158 1158
 					'accounting' => new EE_Text_Input(
@@ -1160,9 +1160,9 @@  discard block
 block discarded – undo
1160 1160
 							'default' => '',
1161 1161
 							'required' => false,
1162 1162
 							'html_label_text' => __( 'Extra Field for Accounting', 'event_espresso' ),
1163
-                                                        'validation_strategies' => array(
1164
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1165
-                                                        )
1163
+														'validation_strategies' => array(
1164
+															new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1165
+														)
1166 1166
 						)
1167 1167
 					),
1168 1168
 				)
@@ -1454,10 +1454,10 @@  discard block
 block discarded – undo
1454 1454
 	/**
1455 1455
 	 * delete_payment
1456 1456
 	 * 	delete a payment or refund made towards a transaction
1457
-	*
1457
+	 *
1458 1458
 	 * @access public
1459
-	*	@return void
1460
-	*/
1459
+	 *	@return void
1460
+	 */
1461 1461
 	public function delete_payment() {
1462 1462
 		$json_response_data = array( 'return_data' => FALSE );
1463 1463
 		$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;
@@ -1572,12 +1572,12 @@  discard block
 block discarded – undo
1572 1572
 	/**
1573 1573
 	 * _send_payment_reminder
1574 1574
 	 * 	generates HTML for the View Transaction Details Admin page
1575
-	*
1575
+	 *
1576 1576
 	 * @access protected
1577
-	*	@return void
1578
-	*/
1577
+	 *	@return void
1578
+	 */
1579 1579
 	protected function _send_payment_reminder() {
1580
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1580
+		$TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1581 1581
 		$transaction = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
1582 1582
 		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID'] ) : array();
1583 1583
 		do_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction );
@@ -1599,29 +1599,29 @@  discard block
 block discarded – undo
1599 1599
 
1600 1600
 		$TXN = EEM_Transaction::instance();
1601 1601
 
1602
-	    $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' ));
1603
-	    $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' );
1602
+		$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' ));
1603
+		$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' );
1604 1604
 
1605
-	    //make sure our timestamps start and end right at the boundaries for each day
1606
-	    $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1607
-	    $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1605
+		//make sure our timestamps start and end right at the boundaries for each day
1606
+		$start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1607
+		$end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1608 1608
 
1609 1609
 
1610
-	    //convert to timestamps
1611
-	    $start_date = strtotime( $start_date );
1612
-	    $end_date = strtotime( $end_date );
1610
+		//convert to timestamps
1611
+		$start_date = strtotime( $start_date );
1612
+		$end_date = strtotime( $end_date );
1613 1613
 
1614
-	    //makes sure start date is the lowest value and vice versa
1615
-	    $start_date = min( $start_date, $end_date );
1616
-	    $end_date = max( $start_date, $end_date );
1614
+		//makes sure start date is the lowest value and vice versa
1615
+		$start_date = min( $start_date, $end_date );
1616
+		$end_date = max( $start_date, $end_date );
1617 1617
 
1618
-	    //convert to correct format for query
1618
+		//convert to correct format for query
1619 1619
 	$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' );
1620 1620
 	$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' );
1621 1621
 
1622 1622
 
1623 1623
 
1624
-	    //set orderby
1624
+		//set orderby
1625 1625
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
1626 1626
 
1627 1627
 		switch ( $this->_req_data['orderby'] ) {
Please login to merge, or discard this patch.
Spacing   +400 added lines, -400 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
@@ -234,10 +234,10 @@  discard block
 block discarded – undo
234 234
 	protected function _add_screen_options() {}
235 235
 	protected function _add_feature_pointers() {}
236 236
 	public function admin_init() {
237
-		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' );
238
-		EE_Registry::$i18n_js_strings[ 'error_occurred' ] = __( 'An error occurred! Please refresh the page and try again.', 'event_espresso' );
239
-		EE_Registry::$i18n_js_strings[ 'txn_status_array' ] = self::$_txn_status;
240
-		EE_Registry::$i18n_js_strings[ 'pay_status_array' ] = self::$_pay_status;
237
+		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');
238
+		EE_Registry::$i18n_js_strings['error_occurred'] = __('An error occurred! Please refresh the page and try again.', 'event_espresso');
239
+		EE_Registry::$i18n_js_strings['txn_status_array'] = self::$_txn_status;
240
+		EE_Registry::$i18n_js_strings['pay_status_array'] = self::$_pay_status;
241 241
 	}
242 242
 	public function admin_notices() {}
243 243
 	public function admin_footer_scripts() {}
@@ -304,14 +304,14 @@  discard block
 block discarded – undo
304 304
 	 */
305 305
 	public function load_scripts_styles() {
306 306
 		//enqueue style
307
-		wp_register_style( 'espresso_txn', TXN_ASSETS_URL . 'espresso_transactions_admin.css', array(), EVENT_ESPRESSO_VERSION );
307
+		wp_register_style('espresso_txn', TXN_ASSETS_URL.'espresso_transactions_admin.css', array(), EVENT_ESPRESSO_VERSION);
308 308
 		wp_enqueue_style('espresso_txn');
309 309
 
310 310
 		//scripts
311 311
 		add_filter('FHEE_load_accounting_js', '__return_true');
312 312
 
313 313
 		//scripts
314
-		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);
314
+		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);
315 315
 		wp_enqueue_script('espresso_txn');
316 316
 
317 317
 	}
@@ -351,8 +351,8 @@  discard block
 block discarded – undo
351 351
 	 *	@return void
352 352
 	 */
353 353
 	protected function _set_list_table_views_default() {
354
-		$this->_views = array (
355
-			'all' => array (
354
+		$this->_views = array(
355
+			'all' => array(
356 356
 				'slug' 		=> 'all',
357 357
 				'label' 		=> __('View All Transactions', 'event_espresso'),
358 358
 				'count' 	=> 0
@@ -380,20 +380,20 @@  discard block
 block discarded – undo
380 380
 	 *	@return void
381 381
 	 */
382 382
 	private function _set_transaction_object() {
383
-		if ( is_object( $this->_transaction) )
383
+		if (is_object($this->_transaction))
384 384
 			return; //get out we've already set the object
385 385
 
386 386
 	    $TXN = EEM_Transaction::instance();
387 387
 
388
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
388
+	    $TXN_ID = ( ! empty($this->_req_data['TXN_ID'])) ? absint($this->_req_data['TXN_ID']) : FALSE;
389 389
 
390 390
 	    //get transaction object
391 391
 	    $this->_transaction = $TXN->get_one_by_ID($TXN_ID);
392
-	    $this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
392
+	    $this->_session = ! empty($this->_transaction) ? $this->_transaction->get('TXN_session_data') : NULL;
393 393
 
394
-	 	if ( empty( $this->_transaction ) ) {
395
-	    	$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  __(' could not be retrieved.', 'event_espresso');
396
-			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
394
+	 	if (empty($this->_transaction)) {
395
+	    	$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso').$TXN_ID.__(' could not be retrieved.', 'event_espresso');
396
+			EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
397 397
 	    }
398 398
 	}
399 399
 
@@ -406,11 +406,11 @@  discard block
 block discarded – undo
406 406
 	 *	@return array
407 407
 	 */
408 408
 	protected function _transaction_legend_items() {
409
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
409
+		EE_Registry::instance()->load_helper('MSG_Template');
410 410
 
411
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_messages', 'view_filtered_messages' ) ) {
412
-			$related_for_icon = EEH_MSG_Template::get_message_action_icon( 'see_notifications_for' );
413
-			if ( isset( $related_for_icon['css_class']) && isset( $related_for_icon['label'] ) ) {
411
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_messages', 'view_filtered_messages')) {
412
+			$related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for');
413
+			if (isset($related_for_icon['css_class']) && isset($related_for_icon['label'])) {
414 414
 				$items['view_related_messages'] = array(
415 415
 					'class' => $related_for_icon['css_class'],
416 416
 					'desc' => $related_for_icon['label'],
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 
421 421
 		$items = apply_filters(
422 422
 			'FHEE__Transactions_Admin_Page___transaction_legend_items__items',
423
-			array_merge( $items,
423
+			array_merge($items,
424 424
 				array(
425 425
 					'view_details' => array(
426 426
 						'class' => 'dashicons dashicons-cart',
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 					),
433 433
 					'view_receipt' => array(
434 434
 						'class' => 'dashicons dashicons-media-default',
435
-						'desc' => __('View Transaction Receipt', 'event_espresso' )
435
+						'desc' => __('View Transaction Receipt', 'event_espresso')
436 436
 					),
437 437
 					'view_registration' => array(
438 438
 						'class' => 'dashicons dashicons-clipboard',
@@ -442,8 +442,8 @@  discard block
 block discarded – undo
442 442
 			)
443 443
 		);
444 444
 
445
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_transactions_send_payment_reminder' ) ) {
446
-			if ( EEH_MSG_Template::is_mt_active( 'payment_reminder' ) ) {
445
+		if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder')) {
446
+			if (EEH_MSG_Template::is_mt_active('payment_reminder')) {
447 447
 				$items['send_payment_reminder'] = array(
448 448
 					'class' => 'dashicons dashicons-email-alt',
449 449
 					'desc' => __('Send Payment Reminder', 'event_espresso')
@@ -464,29 +464,29 @@  discard block
 block discarded – undo
464 464
 			'FHEE__Transactions_Admin_Page___transaction_legend_items__more_items',
465 465
 			array(
466 466
 				'overpaid'   => array(
467
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::overpaid_status_code,
468
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::overpaid_status_code, FALSE, 'sentence' )
467
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::overpaid_status_code,
468
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::overpaid_status_code, FALSE, 'sentence')
469 469
 				),
470 470
 				'complete'   => array(
471
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::complete_status_code,
472
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::complete_status_code, FALSE, 'sentence' )
471
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::complete_status_code,
472
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::complete_status_code, FALSE, 'sentence')
473 473
 				),
474 474
 				'incomplete' => array(
475
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::incomplete_status_code,
476
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::incomplete_status_code, FALSE, 'sentence' )
475
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::incomplete_status_code,
476
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::incomplete_status_code, FALSE, 'sentence')
477 477
 				),
478 478
 				'abandoned'  => array(
479
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::abandoned_status_code,
480
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::abandoned_status_code, FALSE, 'sentence' )
479
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::abandoned_status_code,
480
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::abandoned_status_code, FALSE, 'sentence')
481 481
 				),
482 482
 				'failed'     => array(
483
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::failed_status_code,
484
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::failed_status_code, FALSE, 'sentence' )
483
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::failed_status_code,
484
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::failed_status_code, FALSE, 'sentence')
485 485
 				)
486 486
 			)
487 487
 		);
488 488
 
489
-		return array_merge( $items, $more_items);
489
+		return array_merge($items, $more_items);
490 490
 	}
491 491
 
492 492
 
@@ -499,9 +499,9 @@  discard block
 block discarded – undo
499 499
 	 */
500 500
 	protected function _transactions_overview_list_table() {
501 501
 		$this->_admin_page_title = __('Transactions', 'event_espresso');
502
-		$event = isset($this->_req_data['EVT_ID']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID'] ) : NULL;
503
-		$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>' ) : '';
504
-		$this->_template_args['after_list_table'] = $this->_display_legend( $this->_transaction_legend_items() );
502
+		$event = isset($this->_req_data['EVT_ID']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID']) : NULL;
503
+		$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>') : '';
504
+		$this->_template_args['after_list_table'] = $this->_display_legend($this->_transaction_legend_items());
505 505
 		$this->display_admin_list_table_page_with_no_sidebar();
506 506
 	}
507 507
 
@@ -515,8 +515,8 @@  discard block
 block discarded – undo
515 515
 	*	@return void
516 516
 	*/
517 517
 	protected function _transaction_details() {
518
-		do_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction );
519
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
518
+		do_action('AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction);
519
+		EE_Registry::instance()->load_helper('MSG_Template');
520 520
 
521 521
 		$this->_set_transaction_status_array();
522 522
 
@@ -529,75 +529,75 @@  discard block
 block discarded – undo
529 529
 		$attendee = $primary_registration instanceof EE_Registration ? $primary_registration->attendee() : NULL;
530 530
 
531 531
 		$this->_template_args['txn_nmbr']['value'] = $this->_transaction->ID();
532
-		$this->_template_args['txn_nmbr']['label'] = __( 'Transaction Number', 'event_espresso' );
532
+		$this->_template_args['txn_nmbr']['label'] = __('Transaction Number', 'event_espresso');
533 533
 
534
-		$this->_template_args['txn_datetime']['value'] = $this->_transaction->get_datetime('TXN_timestamp', 'l F j, Y', 'g:i:s a' );
535
-		$this->_template_args['txn_datetime']['label'] = __( 'Date', 'event_espresso' );
534
+		$this->_template_args['txn_datetime']['value'] = $this->_transaction->get_datetime('TXN_timestamp', 'l F j, Y', 'g:i:s a');
535
+		$this->_template_args['txn_datetime']['label'] = __('Date', 'event_espresso');
536 536
 
537
-		$this->_template_args['txn_status']['value'] = self::$_txn_status[ $this->_transaction->get('STS_ID') ];
538
-		$this->_template_args['txn_status']['label'] = __( 'Transaction Status', 'event_espresso' );
539
-		$this->_template_args['txn_status']['class'] = 'status-' . $this->_transaction->get('STS_ID');
537
+		$this->_template_args['txn_status']['value'] = self::$_txn_status[$this->_transaction->get('STS_ID')];
538
+		$this->_template_args['txn_status']['label'] = __('Transaction Status', 'event_espresso');
539
+		$this->_template_args['txn_status']['class'] = 'status-'.$this->_transaction->get('STS_ID');
540 540
 
541 541
 		$this->_template_args['grand_total'] = $this->_transaction->get('TXN_total');
542 542
 		$this->_template_args['total_paid'] = $this->_transaction->get('TXN_paid');
543 543
 
544
-		if ( $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_transactions_send_payment_reminder' ) ) {
545
-			EE_Registry::instance()->load_helper( 'MSG_Template' );
546
-			$this->_template_args['send_payment_reminder_button'] = EEH_MSG_Template::is_mt_active( 'payment_reminder' )
544
+		if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder')) {
545
+			EE_Registry::instance()->load_helper('MSG_Template');
546
+			$this->_template_args['send_payment_reminder_button'] = EEH_MSG_Template::is_mt_active('payment_reminder')
547 547
 				 && $this->_transaction->get('STS_ID') != EEM_Transaction::complete_status_code
548 548
 				 && $this->_transaction->get('STS_ID') != EEM_Transaction::overpaid_status_code
549
-				 ? EEH_Template::get_button_or_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'send_payment_reminder', 'TXN_ID'=>$this->_transaction->ID(), 'redirect_to' => 'view_transaction' ), TXN_ADMIN_URL ), __(' Send Payment Reminder'), 'button secondary-button right',  'dashicons dashicons-email-alt' )
549
+				 ? EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action'=>'send_payment_reminder', 'TXN_ID'=>$this->_transaction->ID(), 'redirect_to' => 'view_transaction'), TXN_ADMIN_URL), __(' Send Payment Reminder'), 'button secondary-button right', 'dashicons dashicons-email-alt')
550 550
 				 : '';
551 551
 		} else {
552 552
 			$this->_template_args['send_payment_reminder_button'] = '';
553 553
 		}
554 554
 
555 555
 		$amount_due = $this->_transaction->get('TXN_total') - $this->_transaction->get('TXN_paid');
556
-		$this->_template_args['amount_due'] = EEH_Template::format_currency( $amount_due, TRUE );
557
-		if ( EE_Registry::instance()->CFG->currency->sign_b4 ) {
558
-			$this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign . $this->_template_args['amount_due'];
556
+		$this->_template_args['amount_due'] = EEH_Template::format_currency($amount_due, TRUE);
557
+		if (EE_Registry::instance()->CFG->currency->sign_b4) {
558
+			$this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign.$this->_template_args['amount_due'];
559 559
 		} else {
560
-			$this->_template_args['amount_due'] = $this->_template_args['amount_due'] . EE_Registry::instance()->CFG->currency->sign;
560
+			$this->_template_args['amount_due'] = $this->_template_args['amount_due'].EE_Registry::instance()->CFG->currency->sign;
561 561
 		}
562
-		$this->_template_args['amount_due_class'] =  '';
562
+		$this->_template_args['amount_due_class'] = '';
563 563
 
564
-		if ( $this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total') ) {
564
+		if ($this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total')) {
565 565
 			// paid in full
566
-			$this->_template_args['amount_due'] =  FALSE;
567
-		} elseif ( $this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total') ) {
566
+			$this->_template_args['amount_due'] = FALSE;
567
+		} elseif ($this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total')) {
568 568
 			// overpaid
569
-			$this->_template_args['amount_due_class'] =  'txn-overview-no-payment-spn';
570
-		} elseif (( $this->_transaction->get('TXN_total') > 0 ) && ( $this->_transaction->get('TXN_paid') > 0 )) {
569
+			$this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn';
570
+		} elseif (($this->_transaction->get('TXN_total') > 0) && ($this->_transaction->get('TXN_paid') > 0)) {
571 571
 			// monies owing
572
-			$this->_template_args['amount_due_class'] =  'txn-overview-part-payment-spn';
573
-		} elseif (( $this->_transaction->get('TXN_total') > 0 ) && ( $this->_transaction->get('TXN_paid') == 0 )) {
572
+			$this->_template_args['amount_due_class'] = 'txn-overview-part-payment-spn';
573
+		} elseif (($this->_transaction->get('TXN_total') > 0) && ($this->_transaction->get('TXN_paid') == 0)) {
574 574
 			// no payments made yet
575
-			$this->_template_args['amount_due_class'] =  'txn-overview-no-payment-spn';
576
-		} elseif ( $this->_transaction->get('TXN_total') == 0 ) {
575
+			$this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn';
576
+		} elseif ($this->_transaction->get('TXN_total') == 0) {
577 577
 			// free event
578
-			$this->_template_args['amount_due'] =  FALSE;
578
+			$this->_template_args['amount_due'] = FALSE;
579 579
 		}
580 580
 
581 581
 		$payment_method = $this->_transaction->payment_method();
582 582
 
583
-		$this->_template_args['method_of_payment_name'] = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() : __( 'Unknown', 'event_espresso' );
583
+		$this->_template_args['method_of_payment_name'] = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() : __('Unknown', 'event_espresso');
584 584
 		$this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
585 585
 		// link back to overview
586
-		$this->_template_args['txn_overview_url'] = ! empty ( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : TXN_ADMIN_URL;
586
+		$this->_template_args['txn_overview_url'] = ! empty ($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : TXN_ADMIN_URL;
587 587
 
588 588
 
589 589
 		//next and previous links
590
-		$next_txn = $this->_transaction->next(null, array( array( 'STS_ID' => array( '!=', EEM_Transaction::failed_status_code ) ) ), 'TXN_ID' );
591
-		$this->_template_args['next_transaction'] = $next_txn ? $this->_next_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_transaction', 'TXN_ID' => $next_txn['TXN_ID'] ), TXN_ADMIN_URL ), 'dashicons dashicons-arrow-right ee-icon-size-22' ) : '';
592
-		$previous_txn = $this->_transaction->previous( null, array( array( 'STS_ID' => array( '!=', EEM_Transaction::failed_status_code ) ) ), 'TXN_ID' );
593
-		$this->_template_args['previous_transaction'] = $previous_txn ? $this->_previous_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_transaction', 'TXN_ID' => $previous_txn['TXN_ID'] ), TXN_ADMIN_URL ), 'dashicons dashicons-arrow-left ee-icon-size-22' ) : '';
590
+		$next_txn = $this->_transaction->next(null, array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))), 'TXN_ID');
591
+		$this->_template_args['next_transaction'] = $next_txn ? $this->_next_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_transaction', 'TXN_ID' => $next_txn['TXN_ID']), TXN_ADMIN_URL), 'dashicons dashicons-arrow-right ee-icon-size-22') : '';
592
+		$previous_txn = $this->_transaction->previous(null, array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))), 'TXN_ID');
593
+		$this->_template_args['previous_transaction'] = $previous_txn ? $this->_previous_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_transaction', 'TXN_ID' => $previous_txn['TXN_ID']), TXN_ADMIN_URL), 'dashicons dashicons-arrow-left ee-icon-size-22') : '';
594 594
 
595 595
 
596 596
 		// grab messages at the last second
597 597
 		$this->_template_args['notices'] = EE_Error::get_notices();
598 598
 		// path to template
599
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_header.template.php';
600
-		$this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
599
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_header.template.php';
600
+		$this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
601 601
 
602 602
 		// the details template wrapper
603 603
 		$this->display_admin_page_with_sidebar();
@@ -616,18 +616,18 @@  discard block
 block discarded – undo
616 616
 
617 617
 		$this->_set_transaction_object();
618 618
 
619
-		add_meta_box( 'edit-txn-details-mbox', __( 'Transaction Details', 'event_espresso' ), array( $this, 'txn_details_meta_box' ), $this->_wp_page_slug, 'normal', 'high' );
619
+		add_meta_box('edit-txn-details-mbox', __('Transaction Details', 'event_espresso'), array($this, 'txn_details_meta_box'), $this->_wp_page_slug, 'normal', 'high');
620 620
 		add_meta_box(
621 621
 			'edit-txn-attendees-mbox',
622
-			__( 'Attendees Registered in this Transaction', 'event_espresso' ),
623
-			array( $this, 'txn_attendees_meta_box' ),
622
+			__('Attendees Registered in this Transaction', 'event_espresso'),
623
+			array($this, 'txn_attendees_meta_box'),
624 624
 			$this->_wp_page_slug,
625 625
 			'normal',
626 626
 			'high',
627
-			array( 'TXN_ID' => $this->_transaction->ID() )
627
+			array('TXN_ID' => $this->_transaction->ID())
628 628
 		);
629
-		add_meta_box( 'edit-txn-registrant-mbox', __( 'Primary Contact', 'event_espresso' ), array( $this, 'txn_registrant_side_meta_box' ), $this->_wp_page_slug, 'side', 'high' );
630
-		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' );
629
+		add_meta_box('edit-txn-registrant-mbox', __('Primary Contact', 'event_espresso'), array($this, 'txn_registrant_side_meta_box'), $this->_wp_page_slug, 'side', 'high');
630
+		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');
631 631
 
632 632
 	}
633 633
 
@@ -648,15 +648,15 @@  discard block
 block discarded – undo
648 648
 
649 649
 		//get line table
650 650
 		EEH_Autoloader::register_line_item_display_autoloaders();
651
-		$Line_Item_Display = new EE_Line_Item_Display( 'admin_table', 'EE_Admin_Table_Line_Item_Display_Strategy' );
652
-		$this->_template_args['line_item_table'] = $Line_Item_Display->display_line_item( $this->_transaction->total_line_item() );
651
+		$Line_Item_Display = new EE_Line_Item_Display('admin_table', 'EE_Admin_Table_Line_Item_Display_Strategy');
652
+		$this->_template_args['line_item_table'] = $Line_Item_Display->display_line_item($this->_transaction->total_line_item());
653 653
 		$this->_template_args['REG_code'] = $this->_transaction->get_first_related('Registration')->get('REG_code');
654 654
 
655 655
 		// process taxes
656
-		$taxes = $this->_transaction->get_many_related( 'Line_Item', array( array( 'LIN_type' => EEM_Line_Item::type_tax )));
657
-		$this->_template_args['taxes'] = ! empty( $taxes ) ? $taxes : FALSE;
656
+		$taxes = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => EEM_Line_Item::type_tax)));
657
+		$this->_template_args['taxes'] = ! empty($taxes) ? $taxes : FALSE;
658 658
 
659
-		$this->_template_args['grand_total'] = EEH_Template::format_currency($this->_transaction->get('TXN_total'), FALSE, FALSE );
659
+		$this->_template_args['grand_total'] = EEH_Template::format_currency($this->_transaction->get('TXN_total'), FALSE, FALSE);
660 660
 		$this->_template_args['grand_raw_total'] = $this->_transaction->get('TXN_total');
661 661
 		$this->_template_args['TXN_status'] = $this->_transaction->get('STS_ID');
662 662
 
@@ -664,63 +664,63 @@  discard block
 block discarded – undo
664 664
 
665 665
 		// process payment details
666 666
 		$payments = $this->_transaction->get_many_related('Payment');
667
-		if( ! empty(  $payments ) ) {
668
-			$this->_template_args[ 'payments' ] = $payments;
669
-			$this->_template_args[ 'existing_reg_payments' ] = $this->_get_registration_payment_IDs( $payments );
667
+		if ( ! empty($payments)) {
668
+			$this->_template_args['payments'] = $payments;
669
+			$this->_template_args['existing_reg_payments'] = $this->_get_registration_payment_IDs($payments);
670 670
 		} else {
671
-			$this->_template_args[ 'payments' ] = false;
672
-			$this->_template_args[ 'existing_reg_payments' ] = array();
671
+			$this->_template_args['payments'] = false;
672
+			$this->_template_args['existing_reg_payments'] = array();
673 673
 		}
674 674
 
675
-		$this->_template_args['edit_payment_url'] = add_query_arg( array( 'action' => 'edit_payment'  ), TXN_ADMIN_URL );
676
-		$this->_template_args['delete_payment_url'] = add_query_arg( array( 'action' => 'espresso_delete_payment' ), TXN_ADMIN_URL );
675
+		$this->_template_args['edit_payment_url'] = add_query_arg(array('action' => 'edit_payment'), TXN_ADMIN_URL);
676
+		$this->_template_args['delete_payment_url'] = add_query_arg(array('action' => 'espresso_delete_payment'), TXN_ADMIN_URL);
677 677
 
678
-		if ( isset( $txn_details['invoice_number'] )) {
678
+		if (isset($txn_details['invoice_number'])) {
679 679
 			$this->_template_args['txn_details']['invoice_number']['value'] = $this->_template_args['REG_code'];
680
-			$this->_template_args['txn_details']['invoice_number']['label'] = __( 'Invoice Number', 'event_espresso' );
680
+			$this->_template_args['txn_details']['invoice_number']['label'] = __('Invoice Number', 'event_espresso');
681 681
 		}
682 682
 
683 683
 		$this->_template_args['txn_details']['registration_session']['value'] = $this->_transaction->get_first_related('Registration')->get('REG_session');
684
-		$this->_template_args['txn_details']['registration_session']['label'] = __( 'Registration Session', 'event_espresso' );
684
+		$this->_template_args['txn_details']['registration_session']['label'] = __('Registration Session', 'event_espresso');
685 685
 
686
-		$this->_template_args['txn_details']['ip_address']['value'] = isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '';
687
-		$this->_template_args['txn_details']['ip_address']['label'] = __( 'Transaction placed from IP', 'event_espresso' );
686
+		$this->_template_args['txn_details']['ip_address']['value'] = isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '';
687
+		$this->_template_args['txn_details']['ip_address']['label'] = __('Transaction placed from IP', 'event_espresso');
688 688
 
689
-		$this->_template_args['txn_details']['user_agent']['value'] = isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '';
690
-		$this->_template_args['txn_details']['user_agent']['label'] = __( 'Registrant User Agent', 'event_espresso' );
689
+		$this->_template_args['txn_details']['user_agent']['value'] = isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '';
690
+		$this->_template_args['txn_details']['user_agent']['label'] = __('Registrant User Agent', 'event_espresso');
691 691
 
692 692
 		$reg_steps = '<ul>';
693
-		foreach ( $this->_transaction->reg_steps() as $reg_step => $reg_step_status ) {
694
-			if ( $reg_step_status === true ) {
695
-				$reg_steps .= '<li style="color:#70cc50">' . sprintf( __( '%1$s : Completed', 'event_espresso' ), ucwords( str_replace( '_', ' ', $reg_step ) ) ) . '</li>';
696
-			} else if ( is_numeric( $reg_step_status ) && $reg_step_status !== false ) {
697
-					$reg_steps .= '<li style="color:#2EA2CC">' . sprintf(
698
-							__( '%1$s : Initiated %2$s', 'event_espresso' ),
699
-							ucwords( str_replace( '_', ' ', $reg_step ) ),
700
-							gmdate( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), ( $reg_step_status + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) )
701
-						) . '</li>';
693
+		foreach ($this->_transaction->reg_steps() as $reg_step => $reg_step_status) {
694
+			if ($reg_step_status === true) {
695
+				$reg_steps .= '<li style="color:#70cc50">'.sprintf(__('%1$s : Completed', 'event_espresso'), ucwords(str_replace('_', ' ', $reg_step))).'</li>';
696
+			} else if (is_numeric($reg_step_status) && $reg_step_status !== false) {
697
+					$reg_steps .= '<li style="color:#2EA2CC">'.sprintf(
698
+							__('%1$s : Initiated %2$s', 'event_espresso'),
699
+							ucwords(str_replace('_', ' ', $reg_step)),
700
+							gmdate(get_option('date_format').' '.get_option('time_format'), ($reg_step_status + (get_option('gmt_offset') * HOUR_IN_SECONDS)))
701
+						).'</li>';
702 702
 				} else {
703
-				$reg_steps .= '<li style="color:#E76700">' . sprintf( __( '%1$s : Never Initiated', 'event_espresso' ), ucwords( str_replace( '_', ' ', $reg_step ) ) ) . '</li>';
703
+				$reg_steps .= '<li style="color:#E76700">'.sprintf(__('%1$s : Never Initiated', 'event_espresso'), ucwords(str_replace('_', ' ', $reg_step))).'</li>';
704 704
 			}
705 705
 		}
706 706
 		$reg_steps .= '</ul>';
707 707
 		$this->_template_args['txn_details']['reg_steps']['value'] = $reg_steps;
708
-		$this->_template_args['txn_details']['reg_steps']['label'] = __( 'Registration Step Progress', 'event_espresso' );
708
+		$this->_template_args['txn_details']['reg_steps']['label'] = __('Registration Step Progress', 'event_espresso');
709 709
 
710 710
 
711 711
 		$this->_get_registrations_to_apply_payment_to();
712
-		$this->_get_payment_methods( $payments );
712
+		$this->_get_payment_methods($payments);
713 713
 		$this->_get_payment_status_array();
714 714
 		$this->_get_reg_status_selection(); //sets up the template args for the reg status array for the transaction.
715 715
 
716
-		$this->_template_args['transaction_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'transaction'  ), TXN_ADMIN_URL );
717
-		$this->_template_args['apply_payment_form_url'] = add_query_arg( array( 'page' => 'espresso_transactions', 'action' => 'espresso_apply_payment' ), WP_AJAX_URL );
718
-		$this->_template_args['delete_payment_form_url'] = add_query_arg( array( 'page' => 'espresso_transactions', 'action' => 'espresso_delete_payment' ), WP_AJAX_URL );
716
+		$this->_template_args['transaction_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'transaction'), TXN_ADMIN_URL);
717
+		$this->_template_args['apply_payment_form_url'] = add_query_arg(array('page' => 'espresso_transactions', 'action' => 'espresso_apply_payment'), WP_AJAX_URL);
718
+		$this->_template_args['delete_payment_form_url'] = add_query_arg(array('page' => 'espresso_transactions', 'action' => 'espresso_delete_payment'), WP_AJAX_URL);
719 719
 
720 720
 		// 'espresso_delete_payment_nonce'
721 721
 
722
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_main_meta_box_txn_details.template.php';
723
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
722
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_main_meta_box_txn_details.template.php';
723
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
724 724
 
725 725
 	}
726 726
 
@@ -735,27 +735,27 @@  discard block
 block discarded – undo
735 735
 	 * @param EE_Payment[] $payments
736 736
 	 * @return array
737 737
 	 */
738
-	protected function _get_registration_payment_IDs( $payments = array() ) {
738
+	protected function _get_registration_payment_IDs($payments = array()) {
739 739
 		$existing_reg_payments = array();
740 740
 		// get all reg payments for these payments
741
-		$reg_payments = EEM_Registration_Payment::instance()->get_all( array(
741
+		$reg_payments = EEM_Registration_Payment::instance()->get_all(array(
742 742
 			array(
743 743
 				'PAY_ID' => array(
744 744
 					'IN',
745
-					array_keys( $payments )
745
+					array_keys($payments)
746 746
 				)
747 747
 			)
748
-		) );
749
-		if ( ! empty( $reg_payments ) ) {
750
-			foreach ( $payments as $payment ) {
751
-				if ( ! $payment instanceof EE_Payment ) {
748
+		));
749
+		if ( ! empty($reg_payments)) {
750
+			foreach ($payments as $payment) {
751
+				if ( ! $payment instanceof EE_Payment) {
752 752
 					continue;
753
-				} else if ( ! isset( $existing_reg_payments[ $payment->ID() ] ) ) {
754
-					$existing_reg_payments[ $payment->ID() ] = array();
753
+				} else if ( ! isset($existing_reg_payments[$payment->ID()])) {
754
+					$existing_reg_payments[$payment->ID()] = array();
755 755
 				}
756
-				foreach ( $reg_payments as $reg_payment ) {
757
-					if ( $reg_payment instanceof EE_Registration_Payment && $reg_payment->payment_ID() === $payment->ID() ) {
758
-						$existing_reg_payments[ $payment->ID() ][ ] = $reg_payment->registration_ID();
756
+				foreach ($reg_payments as $reg_payment) {
757
+					if ($reg_payment instanceof EE_Registration_Payment && $reg_payment->payment_ID() === $payment->ID()) {
758
+						$existing_reg_payments[$payment->ID()][] = $reg_payment->registration_ID();
759 759
 					}
760 760
 				}
761 761
 			}
@@ -792,39 +792,39 @@  discard block
 block discarded – undo
792 792
 		$registrations_to_apply_payment_to .= '<br /><div class="admin-primary-mbox-tbl-wrap">';
793 793
 		$registrations_to_apply_payment_to .= '<table class="admin-primary-mbox-tbl">';
794 794
 		$registrations_to_apply_payment_to .= '<thead><tr>';
795
-		$registrations_to_apply_payment_to .= '<td>' . __( 'ID', 'event_espresso' ) . '</td>';
796
-		$registrations_to_apply_payment_to .= '<td>' . __( 'Registrant', 'event_espresso' ) . '</td>';
797
-		$registrations_to_apply_payment_to .= '<td>' . __( 'Ticket', 'event_espresso' ) . '</td>';
798
-		$registrations_to_apply_payment_to .= '<td>' . __( 'Event', 'event_espresso' ) . '</td>';
799
-		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-cntr">' . __( 'Paid', 'event_espresso' ) . '</td>';
800
-		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-cntr">' . __( 'Owing', 'event_espresso' ) . '</td>';
801
-		$registrations_to_apply_payment_to .= '<td class="jst-cntr">' . __( 'Apply', 'event_espresso' ) . '</td>';
795
+		$registrations_to_apply_payment_to .= '<td>'.__('ID', 'event_espresso').'</td>';
796
+		$registrations_to_apply_payment_to .= '<td>'.__('Registrant', 'event_espresso').'</td>';
797
+		$registrations_to_apply_payment_to .= '<td>'.__('Ticket', 'event_espresso').'</td>';
798
+		$registrations_to_apply_payment_to .= '<td>'.__('Event', 'event_espresso').'</td>';
799
+		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-cntr">'.__('Paid', 'event_espresso').'</td>';
800
+		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-cntr">'.__('Owing', 'event_espresso').'</td>';
801
+		$registrations_to_apply_payment_to .= '<td class="jst-cntr">'.__('Apply', 'event_espresso').'</td>';
802 802
 		$registrations_to_apply_payment_to .= '</tr></thead><tbody>';
803 803
 		// get registrations for TXN
804
-		$registrations = $this->_transaction->registrations( $query_params );
805
-		foreach ( $registrations as $registration ) {
806
-			if ( $registration instanceof EE_Registration ) {
804
+		$registrations = $this->_transaction->registrations($query_params);
805
+		foreach ($registrations as $registration) {
806
+			if ($registration instanceof EE_Registration) {
807 807
 				$owing = $registration->final_price() - $registration->paid();
808
-				$taxable = $registration->ticket()->taxable() ? ' <span class="smaller-text lt-grey-text"> ' . __( '+ tax', 'event_espresso' ) . '</span>' : '';
809
-				$checked = empty( $existing_reg_payments ) || in_array( $registration->ID(), $existing_reg_payments ) ? ' checked="checked"' : '';
810
-				$registrations_to_apply_payment_to .= '<tr id="apply-payment-registration-row-' . $registration->ID() . '">';
808
+				$taxable = $registration->ticket()->taxable() ? ' <span class="smaller-text lt-grey-text"> '.__('+ tax', 'event_espresso').'</span>' : '';
809
+				$checked = empty($existing_reg_payments) || in_array($registration->ID(), $existing_reg_payments) ? ' checked="checked"' : '';
810
+				$registrations_to_apply_payment_to .= '<tr id="apply-payment-registration-row-'.$registration->ID().'">';
811 811
 				// add html for checkbox input and label
812
-				$registrations_to_apply_payment_to .= '<td>' . $registration->ID() . '</td>';
813
-				$registrations_to_apply_payment_to .= '<td>' . $registration->attendee() instanceof EE_Attendee ? $registration->attendee()->full_name() : __( 'Unknown Attendee', 'event_espresso' ) . '</td>';
814
-				$registrations_to_apply_payment_to .= '<td>' . $registration->ticket()->name() . ' : ' . $registration->ticket()->pretty_price() . $taxable . '</td>';
815
-				$registrations_to_apply_payment_to .= '<td>' . $registration->event_name() . '</td>';
816
-				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-rght">' . $registration->pretty_paid() . '</td>';
817
-				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-rght">' . EEH_Template::format_currency( $owing ) . '</td>';
812
+				$registrations_to_apply_payment_to .= '<td>'.$registration->ID().'</td>';
813
+				$registrations_to_apply_payment_to .= '<td>'.$registration->attendee() instanceof EE_Attendee ? $registration->attendee()->full_name() : __('Unknown Attendee', 'event_espresso').'</td>';
814
+				$registrations_to_apply_payment_to .= '<td>'.$registration->ticket()->name().' : '.$registration->ticket()->pretty_price().$taxable.'</td>';
815
+				$registrations_to_apply_payment_to .= '<td>'.$registration->event_name().'</td>';
816
+				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-rght">'.$registration->pretty_paid().'</td>';
817
+				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-rght">'.EEH_Template::format_currency($owing).'</td>';
818 818
 				$registrations_to_apply_payment_to .= '<td class="jst-cntr">';
819 819
 				$disabled = $registration->final_price() > 0 ? '' : ' disabled';
820
-				$registrations_to_apply_payment_to .= '<input type="checkbox" value="' . $registration->ID() . '" name="txn_admin_payment[registrations]"' . $checked . $disabled . '>';
820
+				$registrations_to_apply_payment_to .= '<input type="checkbox" value="'.$registration->ID().'" name="txn_admin_payment[registrations]"'.$checked.$disabled.'>';
821 821
 				$registrations_to_apply_payment_to .= '</td>';
822 822
 				$registrations_to_apply_payment_to .= '</tr>';
823 823
 			}
824 824
 		}
825 825
 		$registrations_to_apply_payment_to .= '</tbody></table></div>';
826
-		$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>';
827
-		$this->_template_args[ 'registrations_to_apply_payment_to' ] = $registrations_to_apply_payment_to;
826
+		$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>';
827
+		$this->_template_args['registrations_to_apply_payment_to'] = $registrations_to_apply_payment_to;
828 828
 	}
829 829
 
830 830
 
@@ -841,9 +841,9 @@  discard block
 block discarded – undo
841 841
 		$statuses = EEM_Registration::reg_status_array(array(), TRUE);
842 842
 		//let's add a "don't change" option.
843 843
 		$status_array['NAN'] = __('Leave the Same', 'event_espresso');
844
-		$status_array = array_merge( $status_array, $statuses );
845
-		$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' );
846
-		$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' );
844
+		$status_array = array_merge($status_array, $statuses);
845
+		$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');
846
+		$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');
847 847
 
848 848
 	}
849 849
 
@@ -858,21 +858,21 @@  discard block
 block discarded – undo
858 858
 	 * @param EE_Payment[] to show on this page
859 859
 	 *	@return void
860 860
 	 */
861
-	private function _get_payment_methods( $payments = array() ) {
861
+	private function _get_payment_methods($payments = array()) {
862 862
 		$payment_methods_of_payments = array();
863
-		foreach( $payments as $payment ){
864
-			if( $payment instanceof EE_Payment ){
865
-				$payment_methods_of_payments[] = $payment->get( 'PMD_ID' );
863
+		foreach ($payments as $payment) {
864
+			if ($payment instanceof EE_Payment) {
865
+				$payment_methods_of_payments[] = $payment->get('PMD_ID');
866 866
 			}
867 867
 		}
868
-		if( $payment_methods_of_payments ){
869
-			$query_args = array( array( 'OR*payment_method_for_payment' => array(
870
-					'PMD_ID' => array( 'IN', $payment_methods_of_payments ),
871
-					'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) ) );
872
-		}else{
873
-			$query_args = array( array( 'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) );
868
+		if ($payment_methods_of_payments) {
869
+			$query_args = array(array('OR*payment_method_for_payment' => array(
870
+					'PMD_ID' => array('IN', $payment_methods_of_payments),
871
+					'PMD_scope' => array('LIKE', '%'.EEM_Payment_Method::scope_admin.'%') )));
872
+		} else {
873
+			$query_args = array(array('PMD_scope' => array('LIKE', '%'.EEM_Payment_Method::scope_admin.'%')));
874 874
 		}
875
-		$this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all( $query_args );
875
+		$this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all($query_args);
876 876
 	}
877 877
 
878 878
 
@@ -886,46 +886,46 @@  discard block
 block discarded – undo
886 886
 	 * @param array $metabox
887 887
 	 * @return void
888 888
 	 */
889
-	public function txn_attendees_meta_box( $post, $metabox = array( 'args' => array() )) {
889
+	public function txn_attendees_meta_box($post, $metabox = array('args' => array())) {
890 890
 
891
-		extract( $metabox['args'] );
891
+		extract($metabox['args']);
892 892
 		$this->_template_args['post'] = $post;
893 893
 		$this->_template_args['event_attendees'] = array();
894 894
 		// process items in cart
895
-		$line_items = $this->_transaction->get_many_related('Line_Item', array( array( 'LIN_type' => 'line-item' ) ) );
896
-		if ( ! empty( $line_items )) {
897
-			foreach ( $line_items as $item ) {
898
-				if ( $item instanceof EE_Line_Item ) {
899
-					switch( $item->OBJ_type() ) {
895
+		$line_items = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => 'line-item')));
896
+		if ( ! empty($line_items)) {
897
+			foreach ($line_items as $item) {
898
+				if ($item instanceof EE_Line_Item) {
899
+					switch ($item->OBJ_type()) {
900 900
 
901 901
 						case 'Event' :
902 902
 							break;
903 903
 
904 904
 						case 'Ticket' :
905 905
 							$ticket = $item->ticket();
906
-							if ( empty( $ticket )) {
906
+							if (empty($ticket)) {
907 907
 								continue; //right now we're only handling tickets here.  Cause its expected that only tickets will have attendees right?
908 908
 							}
909
-							$ticket_price = EEH_Template::format_currency( $item->get( 'LIN_unit_price' ));
909
+							$ticket_price = EEH_Template::format_currency($item->get('LIN_unit_price'));
910 910
 							$event = $ticket->get_first_related('Registration')->get_first_related('Event');
911
-							$event_name = $event instanceof EE_Event ? $event->get('EVT_name') . ' - ' . $item->get('LIN_name') : '';
911
+							$event_name = $event instanceof EE_Event ? $event->get('EVT_name').' - '.$item->get('LIN_name') : '';
912 912
 
913
-							$registrations = $ticket->get_many_related('Registration', array( array('TXN_ID' => $this->_transaction->ID() )));
914
-							foreach( $registrations as $registration ) {
915
-								$this->_template_args['event_attendees'][$registration->ID()]['att_num'] 						= $registration->get('REG_count');
916
-								$this->_template_args['event_attendees'][$registration->ID()]['event_ticket_name'] 	= $event_name;
917
-								$this->_template_args['event_attendees'][$registration->ID()]['ticket_price'] 				= $ticket_price;
913
+							$registrations = $ticket->get_many_related('Registration', array(array('TXN_ID' => $this->_transaction->ID())));
914
+							foreach ($registrations as $registration) {
915
+								$this->_template_args['event_attendees'][$registration->ID()]['att_num'] = $registration->get('REG_count');
916
+								$this->_template_args['event_attendees'][$registration->ID()]['event_ticket_name'] = $event_name;
917
+								$this->_template_args['event_attendees'][$registration->ID()]['ticket_price'] = $ticket_price;
918 918
 								// attendee info
919 919
 								$attendee = $registration->get_first_related('Attendee');
920
-								if ( $attendee instanceof EE_Attendee ) {
920
+								if ($attendee instanceof EE_Attendee) {
921 921
 									$this->_template_args['event_attendees'][$registration->ID()]['att_id'] 			= $attendee->ID();
922 922
 									$this->_template_args['event_attendees'][$registration->ID()]['attendee'] 	= $attendee->full_name();
923
-									$this->_template_args['event_attendees'][$registration->ID()]['email'] 			= '<a href="mailto:' . $attendee->email() . '?subject=' . $event->get('EVT_name') . __(' Event', 'event_espresso') . '">' . $attendee->email() . '</a>';
924
-									$this->_template_args['event_attendees'][$registration->ID()]['address'] 		=  implode(',<br>', $attendee->full_address_as_array() );
923
+									$this->_template_args['event_attendees'][$registration->ID()]['email'] = '<a href="mailto:'.$attendee->email().'?subject='.$event->get('EVT_name').__(' Event', 'event_espresso').'">'.$attendee->email().'</a>';
924
+									$this->_template_args['event_attendees'][$registration->ID()]['address'] 		= implode(',<br>', $attendee->full_address_as_array());
925 925
 								} else {
926 926
 									$this->_template_args['event_attendees'][$registration->ID()]['att_id'] 			= '';
927 927
 									$this->_template_args['event_attendees'][$registration->ID()]['attendee'] 	= '';
928
-									$this->_template_args['event_attendees'][$registration->ID()]['email'] 			= '';
928
+									$this->_template_args['event_attendees'][$registration->ID()]['email'] = '';
929 929
 									$this->_template_args['event_attendees'][$registration->ID()]['address'] 		= '';
930 930
 								}
931 931
 							}
@@ -935,12 +935,12 @@  discard block
 block discarded – undo
935 935
 				}
936 936
 			}
937 937
 
938
-			$this->_template_args['transaction_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'attendees'  ), TXN_ADMIN_URL );
939
-			echo EEH_Template::display_template( TXN_TEMPLATE_PATH . 'txn_admin_details_main_meta_box_attendees.template.php', $this->_template_args, TRUE );
938
+			$this->_template_args['transaction_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'attendees'), TXN_ADMIN_URL);
939
+			echo EEH_Template::display_template(TXN_TEMPLATE_PATH.'txn_admin_details_main_meta_box_attendees.template.php', $this->_template_args, TRUE);
940 940
 
941 941
 		} else {
942 942
 			echo sprintf(
943
-				__( '%1$sFor some reason, there are no attendees registered for this transaction. Likely the registration was abandoned in process.%2$s', 'event_espresso' ),
943
+				__('%1$sFor some reason, there are no attendees registered for this transaction. Likely the registration was abandoned in process.%2$s', 'event_espresso'),
944 944
 				'<p class="important-notice">',
945 945
 				'</p>'
946 946
 			);
@@ -959,20 +959,20 @@  discard block
 block discarded – undo
959 959
 	 */
960 960
 	public function txn_registrant_side_meta_box() {
961 961
 		$primary_att = $this->_transaction->primary_registration() instanceof EE_Registration ? $this->_transaction->primary_registration()->get_first_related('Attendee') : null;
962
-		if ( ! $primary_att instanceof EE_Attendee ) {
962
+		if ( ! $primary_att instanceof EE_Attendee) {
963 963
 			$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');
964 964
 			$primary_att = EEM_Attendee::instance()->create_default_object();
965 965
 		}
966
-		$this->_template_args['ATT_ID'] 						= $primary_att->ID();
966
+		$this->_template_args['ATT_ID'] = $primary_att->ID();
967 967
 		$this->_template_args['prime_reg_fname']		= $primary_att->fname();
968 968
 		$this->_template_args['prime_reg_lname']		= $primary_att->lname();
969
-		$this->_template_args['prime_reg_email'] 		= $primary_att->email();
969
+		$this->_template_args['prime_reg_email'] = $primary_att->email();
970 970
 		$this->_template_args['prime_reg_phone'] 	= $primary_att->phone();
971
-		$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 );
971
+		$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);
972 972
 		// get formatted address for registrant
973
-		EE_Registry::instance()->load_helper( 'Formatter' );
974
-		$this->_template_args[ 'formatted_address' ] = EEH_Address::format( $primary_att );
975
-		echo EEH_Template::display_template( TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE );
973
+		EE_Registry::instance()->load_helper('Formatter');
974
+		$this->_template_args['formatted_address'] = EEH_Address::format($primary_att);
975
+		echo EEH_Template::display_template(TXN_TEMPLATE_PATH.'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE);
976 976
 	}
977 977
 
978 978
 
@@ -988,12 +988,12 @@  discard block
 block discarded – undo
988 988
 
989 989
 		$this->_template_args['billing_form'] = $this->_transaction->billing_info();
990 990
 		$this->_template_args['billing_form_url'] = add_query_arg(
991
-			array( 'action' => 'edit_transaction', 'process' => 'billing'  ),
991
+			array('action' => 'edit_transaction', 'process' => 'billing'),
992 992
 			TXN_ADMIN_URL
993 993
 		);
994 994
 
995
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_billing_info.template.php';
996
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );/**/
995
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_side_meta_box_billing_info.template.php';
996
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); /**/
997 997
 	}
998 998
 
999 999
 
@@ -1006,43 +1006,43 @@  discard block
 block discarded – undo
1006 1006
 	*	@return void
1007 1007
 	*/
1008 1008
 	public function apply_payments_or_refunds() {
1009
-		$json_response_data = array( 'return_data' => FALSE );
1009
+		$json_response_data = array('return_data' => FALSE);
1010 1010
 		$valid_data = $this->_validate_payment_request_data();
1011
-		if ( ! empty( $valid_data ) ) {
1012
-			$PAY_ID = $valid_data[ 'PAY_ID' ];
1011
+		if ( ! empty($valid_data)) {
1012
+			$PAY_ID = $valid_data['PAY_ID'];
1013 1013
 			//save  the new payment
1014
-			$payment = $this->_create_payment_from_request_data( $valid_data );
1014
+			$payment = $this->_create_payment_from_request_data($valid_data);
1015 1015
 			// get the TXN for this payment
1016 1016
 			$transaction = $payment->transaction();
1017 1017
 			// verify transaction
1018
-			if ( $transaction instanceof EE_Transaction ) {
1018
+			if ($transaction instanceof EE_Transaction) {
1019 1019
 				// calculate_total_payments_and_update_status
1020
-				$this->_process_transaction_payments( $transaction );
1021
-				$REG_IDs = $this->_get_REG_IDs_to_apply_payment_to( $payment );
1022
-				$this->_remove_existing_registration_payments( $payment, $PAY_ID );
1020
+				$this->_process_transaction_payments($transaction);
1021
+				$REG_IDs = $this->_get_REG_IDs_to_apply_payment_to($payment);
1022
+				$this->_remove_existing_registration_payments($payment, $PAY_ID);
1023 1023
 				// apply payment to registrations (if applicable)
1024
-				if ( ! empty( $REG_IDs ) ) {
1025
-					$this->_update_registration_payments( $transaction, $payment, $REG_IDs );
1024
+				if ( ! empty($REG_IDs)) {
1025
+					$this->_update_registration_payments($transaction, $payment, $REG_IDs);
1026 1026
 					$this->_maybe_send_notifications();
1027 1027
 					// now process status changes for the same registrations
1028
-					$this->_process_registration_status_change( $transaction, $REG_IDs );
1028
+					$this->_process_registration_status_change($transaction, $REG_IDs);
1029 1029
 				}
1030
-				$this->_maybe_send_notifications( $payment );
1030
+				$this->_maybe_send_notifications($payment);
1031 1031
 				//prepare to render page
1032
-				$json_response_data[ 'return_data' ] = $this->_build_payment_json_response( $payment, $REG_IDs );
1033
-				do_action( 'AHEE__Transactions_Admin_Page__apply_payments_or_refund__after_recording', $transaction, $payment );
1032
+				$json_response_data['return_data'] = $this->_build_payment_json_response($payment, $REG_IDs);
1033
+				do_action('AHEE__Transactions_Admin_Page__apply_payments_or_refund__after_recording', $transaction, $payment);
1034 1034
 			} else {
1035 1035
 				EE_Error::add_error(
1036
-					__( 'A valid Transaction for this payment could not be retrieved.', 'event_espresso' ),
1036
+					__('A valid Transaction for this payment could not be retrieved.', 'event_espresso'),
1037 1037
 					__FILE__, __FUNCTION__, __LINE__
1038 1038
 				);
1039 1039
 			}
1040 1040
 		} else {
1041
-			EE_Error::add_error( __( 'The payment form data could not be processed. Please try again.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1041
+			EE_Error::add_error(__('The payment form data could not be processed. Please try again.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1042 1042
 		}
1043 1043
 
1044
-		$notices = EE_Error::get_notices( FALSE, FALSE, FALSE );
1045
-		echo json_encode( array_merge( $json_response_data, $notices ));
1044
+		$notices = EE_Error::get_notices(FALSE, FALSE, FALSE);
1045
+		echo json_encode(array_merge($json_response_data, $notices));
1046 1046
 		die();
1047 1047
 	}
1048 1048
 
@@ -1054,30 +1054,30 @@  discard block
 block discarded – undo
1054 1054
 	 * @return array
1055 1055
 	 */
1056 1056
 	protected function _validate_payment_request_data() {
1057
-		if ( ! isset( $this->_req_data[ 'txn_admin_payment' ] ) ) {
1057
+		if ( ! isset($this->_req_data['txn_admin_payment'])) {
1058 1058
 			return false;
1059 1059
 		}
1060 1060
 		$payment_form = $this->_generate_payment_form_section();
1061 1061
 		try {
1062
-			if ( $payment_form->was_submitted() ) {
1062
+			if ($payment_form->was_submitted()) {
1063 1063
 				$payment_form->receive_form_submission();
1064
-				if ( ! $payment_form->is_valid() ) {
1064
+				if ( ! $payment_form->is_valid()) {
1065 1065
 					$submission_error_messages = array();
1066
-					foreach ( $payment_form->get_validation_errors_accumulated() as $validation_error ) {
1067
-						if ( $validation_error instanceof EE_Validation_Error ) {
1066
+					foreach ($payment_form->get_validation_errors_accumulated() as $validation_error) {
1067
+						if ($validation_error instanceof EE_Validation_Error) {
1068 1068
 							$submission_error_messages[] = sprintf(
1069
-								_x( '%s : %s', 'Form Section Name : Form Validation Error', 'event_espresso' ),
1069
+								_x('%s : %s', 'Form Section Name : Form Validation Error', 'event_espresso'),
1070 1070
 								$validation_error->get_form_section()->html_label_text(),
1071 1071
 								$validation_error->getMessage()
1072 1072
 							);
1073 1073
 						}
1074 1074
 					}
1075
-					EE_Error::add_error( join( '<br />', $submission_error_messages ), __FILE__, __FUNCTION__, __LINE__ );
1075
+					EE_Error::add_error(join('<br />', $submission_error_messages), __FILE__, __FUNCTION__, __LINE__);
1076 1076
 					return array();
1077 1077
 				}
1078 1078
 			}
1079
-		} catch ( EE_Error $e ) {
1080
-			EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__ );
1079
+		} catch (EE_Error $e) {
1080
+			EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
1081 1081
 			return array();
1082 1082
 		}
1083 1083
 		return $payment_form->valid_data();
@@ -1099,63 +1099,63 @@  discard block
 block discarded – undo
1099 1099
 						array(
1100 1100
 							'default' => 0,
1101 1101
 							'required' => false,
1102
-							'html_label_text' => __( 'Payment ID', 'event_espresso' ),
1103
-							'validation_strategies' => array( new EE_Int_Normalization() )
1102
+							'html_label_text' => __('Payment ID', 'event_espresso'),
1103
+							'validation_strategies' => array(new EE_Int_Normalization())
1104 1104
 						)
1105 1105
 					),
1106 1106
 					'TXN_ID' => new EE_Text_Input(
1107 1107
 						array(
1108 1108
 							'default' => 0,
1109 1109
 							'required' => true,
1110
-							'html_label_text' => __( 'Transaction ID', 'event_espresso' ),
1111
-							'validation_strategies' => array( new EE_Int_Normalization() )
1110
+							'html_label_text' => __('Transaction ID', 'event_espresso'),
1111
+							'validation_strategies' => array(new EE_Int_Normalization())
1112 1112
 						)
1113 1113
 					),
1114 1114
 					'type' => new EE_Text_Input(
1115 1115
 						array(
1116 1116
 							'default' => 1,
1117 1117
 							'required' => true,
1118
-							'html_label_text' => __( 'Payment or Refund', 'event_espresso' ),
1119
-							'validation_strategies' => array( new EE_Int_Normalization() )
1118
+							'html_label_text' => __('Payment or Refund', 'event_espresso'),
1119
+							'validation_strategies' => array(new EE_Int_Normalization())
1120 1120
 						)
1121 1121
 					),
1122 1122
 					'amount' => new EE_Text_Input(
1123 1123
 						array(
1124 1124
 							'default' => 0,
1125 1125
 							'required' => true,
1126
-							'html_label_text' => __( 'Payment amount', 'event_espresso' ),
1127
-							'validation_strategies' => array( new EE_Float_Normalization() )
1126
+							'html_label_text' => __('Payment amount', 'event_espresso'),
1127
+							'validation_strategies' => array(new EE_Float_Normalization())
1128 1128
 						)
1129 1129
 					),
1130 1130
 					'status' => new EE_Text_Input(
1131 1131
 						array(
1132 1132
 							'default' => EEM_Payment::status_id_approved,
1133 1133
 							'required' => true,
1134
-							'html_label_text' => __( 'Payment status', 'event_espresso' ),
1134
+							'html_label_text' => __('Payment status', 'event_espresso'),
1135 1135
 						)
1136 1136
 					),
1137 1137
 					'PMD_ID' => new EE_Text_Input(
1138 1138
 						array(
1139 1139
 							'default' => 2,
1140 1140
 							'required' => true,
1141
-							'html_label_text' => __( 'Payment Method', 'event_espresso' ),
1142
-							'validation_strategies' => array( new EE_Int_Normalization() )
1141
+							'html_label_text' => __('Payment Method', 'event_espresso'),
1142
+							'validation_strategies' => array(new EE_Int_Normalization())
1143 1143
 						)
1144 1144
 					),
1145 1145
 					'date' => new EE_Text_Input(
1146 1146
 						array(
1147 1147
 							'default' => time(),
1148 1148
 							'required' => true,
1149
-							'html_label_text' => __( 'Payment date', 'event_espresso' ),
1149
+							'html_label_text' => __('Payment date', 'event_espresso'),
1150 1150
 						)
1151 1151
 					),
1152 1152
 					'txn_id_chq_nmbr' => new EE_Text_Input(
1153 1153
 						array(
1154 1154
 							'default' => '',
1155 1155
 							'required' => false,
1156
-							'html_label_text' => __( 'Transaction or Cheque Number', 'event_espresso' ),
1156
+							'html_label_text' => __('Transaction or Cheque Number', 'event_espresso'),
1157 1157
                                                         'validation_strategies' => array(
1158
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1158
+                                                            new EE_Max_Length_Validation_Strategy(__('Input too long', 'event_espresso'), 100),
1159 1159
                                                         )
1160 1160
 						)
1161 1161
 					),
@@ -1163,9 +1163,9 @@  discard block
 block discarded – undo
1163 1163
 						array(
1164 1164
 							'default' => '',
1165 1165
 							'required' => false,
1166
-							'html_label_text' => __( 'Purchase Order Number', 'event_espresso' ),
1166
+							'html_label_text' => __('Purchase Order Number', 'event_espresso'),
1167 1167
                                                         'validation_strategies' => array(
1168
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1168
+                                                            new EE_Max_Length_Validation_Strategy(__('Input too long', 'event_espresso'), 100),
1169 1169
                                                         )
1170 1170
 						)
1171 1171
 					),
@@ -1173,9 +1173,9 @@  discard block
 block discarded – undo
1173 1173
 						array(
1174 1174
 							'default' => '',
1175 1175
 							'required' => false,
1176
-							'html_label_text' => __( 'Extra Field for Accounting', 'event_espresso' ),
1176
+							'html_label_text' => __('Extra Field for Accounting', 'event_espresso'),
1177 1177
                                                         'validation_strategies' => array(
1178
-                                                            new EE_Max_Length_Validation_Strategy( __('Input too long', 'event_espresso'), 100 ),
1178
+                                                            new EE_Max_Length_Validation_Strategy(__('Input too long', 'event_espresso'), 100),
1179 1179
                                                         )
1180 1180
 						)
1181 1181
 					),
@@ -1192,34 +1192,34 @@  discard block
 block discarded – undo
1192 1192
 	 * @param array $valid_data
1193 1193
 	 * @return EE_Payment
1194 1194
 	 */
1195
-	protected function _create_payment_from_request_data( $valid_data ) {
1196
-		$PAY_ID = $valid_data[ 'PAY_ID' ];
1195
+	protected function _create_payment_from_request_data($valid_data) {
1196
+		$PAY_ID = $valid_data['PAY_ID'];
1197 1197
 		// get payment amount
1198
-		$amount = $valid_data[ 'amount' ] ? abs( $valid_data[ 'amount' ] ) : 0;
1198
+		$amount = $valid_data['amount'] ? abs($valid_data['amount']) : 0;
1199 1199
 		// payments have a type value of 1 and refunds have a type value of -1
1200 1200
 		// so multiplying amount by type will give a positive value for payments, and negative values for refunds
1201
-		$amount = $valid_data[ 'type' ] < 0 ? $amount * -1 : $amount;
1201
+		$amount = $valid_data['type'] < 0 ? $amount * -1 : $amount;
1202 1202
 		$payment = EE_Payment::new_instance(
1203 1203
 			array(
1204
-				'TXN_ID' 								=> $valid_data[ 'TXN_ID' ],
1205
-				'STS_ID' 								=> $valid_data[ 'status' ],
1206
-				'PAY_timestamp' 				=> $valid_data[ 'date' ],
1204
+				'TXN_ID' 								=> $valid_data['TXN_ID'],
1205
+				'STS_ID' 								=> $valid_data['status'],
1206
+				'PAY_timestamp' 				=> $valid_data['date'],
1207 1207
 				'PAY_source'           			=> EEM_Payment_Method::scope_admin,
1208
-				'PMD_ID'               				=> $valid_data[ 'PMD_ID' ],
1208
+				'PMD_ID'               				=> $valid_data['PMD_ID'],
1209 1209
 				'PAY_amount'           			=> $amount,
1210
-				'PAY_txn_id_chq_nmbr'  	=> $valid_data[ 'txn_id_chq_nmbr' ],
1211
-				'PAY_po_number'        		=> $valid_data[ 'po_number' ],
1212
-				'PAY_extra_accntng'    		=> $valid_data[ 'accounting' ],
1210
+				'PAY_txn_id_chq_nmbr'  	=> $valid_data['txn_id_chq_nmbr'],
1211
+				'PAY_po_number'        		=> $valid_data['po_number'],
1212
+				'PAY_extra_accntng'    		=> $valid_data['accounting'],
1213 1213
 				'PAY_details'          				=> $valid_data,
1214 1214
 				'PAY_ID'               				=> $PAY_ID
1215 1215
 			),
1216 1216
 			'',
1217
-			array( 'Y-m-d', 'H:i a' )
1217
+			array('Y-m-d', 'H:i a')
1218 1218
 		);
1219
-		if ( ! $payment->save() ) {
1219
+		if ( ! $payment->save()) {
1220 1220
 			EE_Error::add_error(
1221 1221
 				sprintf(
1222
-					__( 'Payment %1$d has not been successfully saved to the database.', 'event_espresso' ),
1222
+					__('Payment %1$d has not been successfully saved to the database.', 'event_espresso'),
1223 1223
 					$payment->ID()
1224 1224
 				),
1225 1225
 				__FILE__, __FUNCTION__, __LINE__
@@ -1236,15 +1236,15 @@  discard block
 block discarded – undo
1236 1236
 	 * @param \EE_Transaction $transaction
1237 1237
 	 * @return array
1238 1238
 	 */
1239
-	protected function _process_transaction_payments( EE_Transaction $transaction ) {
1239
+	protected function _process_transaction_payments(EE_Transaction $transaction) {
1240 1240
 		/** @type EE_Transaction_Payments $transaction_payments */
1241
-		$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1241
+		$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1242 1242
 		//update the transaction with this payment
1243
-		if ( $transaction_payments->calculate_total_payments_and_update_status( $transaction ) ) {
1244
-			EE_Error::add_success( __( 'The payment has been processed successfully.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1243
+		if ($transaction_payments->calculate_total_payments_and_update_status($transaction)) {
1244
+			EE_Error::add_success(__('The payment has been processed successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1245 1245
 		} else {
1246 1246
 			EE_Error::add_error(
1247
-				__( 'The payment was processed successfully but the amount paid for the transaction was not updated.', 'event_espresso' )
1247
+				__('The payment was processed successfully but the amount paid for the transaction was not updated.', 'event_espresso')
1248 1248
 				, __FILE__, __FUNCTION__, __LINE__
1249 1249
 			);
1250 1250
 		}
@@ -1260,19 +1260,19 @@  discard block
 block discarded – undo
1260 1260
 	 * @param \EE_Payment $payment
1261 1261
 	 * @return array
1262 1262
 	 */
1263
-	protected function _get_REG_IDs_to_apply_payment_to( EE_Payment $payment ) {
1263
+	protected function _get_REG_IDs_to_apply_payment_to(EE_Payment $payment) {
1264 1264
 		$REG_IDs = array();
1265 1265
 		// grab array of IDs for specific registrations to apply changes to
1266
-		if ( isset( $this->_req_data[ 'txn_admin_payment' ][ 'registrations' ] ) ) {
1267
-			$REG_IDs = (array)$this->_req_data[ 'txn_admin_payment' ][ 'registrations' ];
1266
+		if (isset($this->_req_data['txn_admin_payment']['registrations'])) {
1267
+			$REG_IDs = (array) $this->_req_data['txn_admin_payment']['registrations'];
1268 1268
 		}
1269 1269
 		//nothing specified ? then get all reg IDs
1270
-		if ( empty( $REG_IDs ) ) {
1270
+		if (empty($REG_IDs)) {
1271 1271
 			$registrations = $payment->transaction()->registrations();
1272
-			$REG_IDs = ! empty( $registrations ) ? array_keys( $registrations ) : $this->_get_existing_reg_payment_REG_IDs( $payment );
1272
+			$REG_IDs = ! empty($registrations) ? array_keys($registrations) : $this->_get_existing_reg_payment_REG_IDs($payment);
1273 1273
 		}
1274 1274
 		// ensure that REG_IDs are integers and NOT strings
1275
-		return array_map( 'intval', $REG_IDs );
1275
+		return array_map('intval', $REG_IDs);
1276 1276
 	}
1277 1277
 
1278 1278
 
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
 	/**
1290 1290
 	 * @param array $existing_reg_payment_REG_IDs
1291 1291
 	 */
1292
-	public function set_existing_reg_payment_REG_IDs( $existing_reg_payment_REG_IDs = null ) {
1292
+	public function set_existing_reg_payment_REG_IDs($existing_reg_payment_REG_IDs = null) {
1293 1293
 		$this->_existing_reg_payment_REG_IDs = $existing_reg_payment_REG_IDs;
1294 1294
 	}
1295 1295
 
@@ -1304,13 +1304,13 @@  discard block
 block discarded – undo
1304 1304
 	 * @param \EE_Payment $payment
1305 1305
 	 * @return array
1306 1306
 	 */
1307
-	protected function _get_existing_reg_payment_REG_IDs( EE_Payment $payment ) {
1308
-		if ( $this->existing_reg_payment_REG_IDs() === null ) {
1307
+	protected function _get_existing_reg_payment_REG_IDs(EE_Payment $payment) {
1308
+		if ($this->existing_reg_payment_REG_IDs() === null) {
1309 1309
 			// let's get any existing reg payment records for this payment
1310
-			$existing_reg_payment_REG_IDs = $payment->get_many_related( 'Registration' );
1310
+			$existing_reg_payment_REG_IDs = $payment->get_many_related('Registration');
1311 1311
 			// but we only want the REG IDs, so grab the array keys
1312
-			$existing_reg_payment_REG_IDs = ! empty( $existing_reg_payment_REG_IDs ) ? array_keys( $existing_reg_payment_REG_IDs ) : array();
1313
-			$this->set_existing_reg_payment_REG_IDs( $existing_reg_payment_REG_IDs );
1312
+			$existing_reg_payment_REG_IDs = ! empty($existing_reg_payment_REG_IDs) ? array_keys($existing_reg_payment_REG_IDs) : array();
1313
+			$this->set_existing_reg_payment_REG_IDs($existing_reg_payment_REG_IDs);
1314 1314
 		}
1315 1315
 		return $this->existing_reg_payment_REG_IDs();
1316 1316
 	}
@@ -1329,23 +1329,23 @@  discard block
 block discarded – undo
1329 1329
 	 * @param int         $PAY_ID
1330 1330
 	 * @return bool;
1331 1331
 	 */
1332
-	protected function _remove_existing_registration_payments( EE_Payment $payment, $PAY_ID = 0 ) {
1332
+	protected function _remove_existing_registration_payments(EE_Payment $payment, $PAY_ID = 0) {
1333 1333
 		// newly created payments will have nothing recorded for $PAY_ID
1334
-		if ( $PAY_ID == 0 ) {
1334
+		if ($PAY_ID == 0) {
1335 1335
 			return false;
1336 1336
 		}
1337
-		$existing_reg_payment_REG_IDs = $this->_get_existing_reg_payment_REG_IDs( $payment );
1338
-		if ( empty( $existing_reg_payment_REG_IDs )) {
1337
+		$existing_reg_payment_REG_IDs = $this->_get_existing_reg_payment_REG_IDs($payment);
1338
+		if (empty($existing_reg_payment_REG_IDs)) {
1339 1339
 			return false;
1340 1340
 		}
1341 1341
 		/** @type EE_Transaction_Payments $transaction_payments */
1342
-		$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1342
+		$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1343 1343
 		return $transaction_payments->delete_registration_payments_and_update_registrations(
1344 1344
 			$payment,
1345 1345
 			array(
1346 1346
 				array(
1347 1347
 					'PAY_ID' => $payment->ID(),
1348
-					'REG_ID' => array( 'IN', $existing_reg_payment_REG_IDs ),
1348
+					'REG_ID' => array('IN', $existing_reg_payment_REG_IDs),
1349 1349
 				)
1350 1350
 			)
1351 1351
 		);
@@ -1364,25 +1364,25 @@  discard block
 block discarded – undo
1364 1364
 	 * @param array $REG_IDs
1365 1365
 	 * @return bool
1366 1366
 	 */
1367
-	protected function _update_registration_payments( EE_Transaction $transaction, EE_Payment $payment, $REG_IDs = array() ) {
1367
+	protected function _update_registration_payments(EE_Transaction $transaction, EE_Payment $payment, $REG_IDs = array()) {
1368 1368
 		// we can pass our own custom set of registrations to EE_Payment_Processor::process_registration_payments()
1369 1369
 		// so let's do that using our set of REG_IDs from the form
1370 1370
 		$registration_query_where_params = array(
1371
-			'REG_ID' => array( 'IN', $REG_IDs )
1371
+			'REG_ID' => array('IN', $REG_IDs)
1372 1372
 		);
1373 1373
 		// but add in some conditions regarding payment,
1374 1374
 		// so that we don't apply payments to registrations that are free or have already been paid for
1375 1375
 		// but ONLY if the payment is NOT a refund ( ie: the payment amount is not negative )
1376
-		if ( ! $payment->is_a_refund() ) {
1377
-			$registration_query_where_params[ 'REG_final_price' ]  = array( '!=', 0 );
1378
-			$registration_query_where_params[ 'REG_final_price*' ]  = array( '!=', 'REG_paid', true );
1376
+		if ( ! $payment->is_a_refund()) {
1377
+			$registration_query_where_params['REG_final_price'] = array('!=', 0);
1378
+			$registration_query_where_params['REG_final_price*'] = array('!=', 'REG_paid', true);
1379 1379
 		}
1380 1380
 		//EEH_Debug_Tools::printr( $registration_query_where_params, '$registration_query_where_params', __FILE__, __LINE__ );
1381
-		$registrations = $transaction->registrations( array( $registration_query_where_params ) );
1382
-		if ( ! empty( $registrations ) ) {
1381
+		$registrations = $transaction->registrations(array($registration_query_where_params));
1382
+		if ( ! empty($registrations)) {
1383 1383
 			/** @type EE_Payment_Processor $payment_processor */
1384
-			$payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' );
1385
-			$payment_processor->process_registration_payments( $transaction, $payment, $registrations );
1384
+			$payment_processor = EE_Registry::instance()->load_core('Payment_Processor');
1385
+			$payment_processor->process_registration_payments($transaction, $payment, $registrations);
1386 1386
 		}
1387 1387
 	}
1388 1388
 
@@ -1398,22 +1398,22 @@  discard block
 block discarded – undo
1398 1398
 	 * @param array $REG_IDs
1399 1399
 	 * @return bool
1400 1400
 	 */
1401
-	protected function _process_registration_status_change( EE_Transaction $transaction, $REG_IDs = array() ) {
1401
+	protected function _process_registration_status_change(EE_Transaction $transaction, $REG_IDs = array()) {
1402 1402
 		// first if there is no change in status then we get out.
1403 1403
 		if (
1404
-			! isset( $this->_req_data['txn_reg_status_change'], $this->_req_data[ 'txn_reg_status_change' ][ 'reg_status' ] )
1404
+			! isset($this->_req_data['txn_reg_status_change'], $this->_req_data['txn_reg_status_change']['reg_status'])
1405 1405
 			|| $this->_req_data['txn_reg_status_change']['reg_status'] == 'NAN'
1406 1406
 		) {
1407 1407
 			//no error message, no change requested, just nothing to do man.
1408 1408
 			return FALSE;
1409 1409
 		}
1410 1410
 		/** @type EE_Transaction_Processor $transaction_processor */
1411
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1411
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1412 1412
 		// made it here dude?  Oh WOW.  K, let's take care of changing the statuses
1413 1413
 		return $transaction_processor->manually_update_registration_statuses(
1414 1414
 			$transaction,
1415
-			sanitize_text_field( $this->_req_data[ 'txn_reg_status_change' ][ 'reg_status' ] ),
1416
-			array( array( 'REG_ID' => array( 'IN', $REG_IDs ) ) )
1415
+			sanitize_text_field($this->_req_data['txn_reg_status_change']['reg_status']),
1416
+			array(array('REG_ID' => array('IN', $REG_IDs)))
1417 1417
 		);
1418 1418
 	}
1419 1419
 
@@ -1428,16 +1428,16 @@  discard block
 block discarded – undo
1428 1428
 	 * @param bool | null        $delete_txn_reg_status_change
1429 1429
 	 * @return array
1430 1430
 	 */
1431
-	protected function _build_payment_json_response( EE_Payment $payment, $REG_IDs = array(), $delete_txn_reg_status_change = null ) {
1431
+	protected function _build_payment_json_response(EE_Payment $payment, $REG_IDs = array(), $delete_txn_reg_status_change = null) {
1432 1432
 		// was the payment deleted ?
1433
-		if ( is_bool( $delete_txn_reg_status_change )) {
1433
+		if (is_bool($delete_txn_reg_status_change)) {
1434 1434
 			return array(
1435 1435
 				'PAY_ID' 				=> $payment->ID(),
1436 1436
 				'amount' 			=> $payment->amount(),
1437 1437
 				'total_paid' 			=> $payment->transaction()->paid(),
1438 1438
 				'txn_status' 			=> $payment->transaction()->status_ID(),
1439 1439
 				'pay_status' 		=> $payment->STS_ID(),
1440
-				'registrations' 	=> $this->_registration_payment_data_array( $REG_IDs ),
1440
+				'registrations' 	=> $this->_registration_payment_data_array($REG_IDs),
1441 1441
 				'delete_txn_reg_status_change' => $delete_txn_reg_status_change,
1442 1442
 			);
1443 1443
 		} else {
@@ -1449,16 +1449,16 @@  discard block
 block discarded – undo
1449 1449
 				'pay_status' 	=> $payment->STS_ID(),
1450 1450
 				'PAY_ID'           => $payment->ID(),
1451 1451
 				'STS_ID' 			=> $payment->STS_ID(),
1452
-				'status' 			=> self::$_pay_status[ $payment->STS_ID() ],
1453
-				'date' 				=> $payment->timestamp( 'Y-m-d', 'h:i a' ),
1454
-				'method' 		=> strtoupper( $payment->source() ),
1452
+				'status' 			=> self::$_pay_status[$payment->STS_ID()],
1453
+				'date' 				=> $payment->timestamp('Y-m-d', 'h:i a'),
1454
+				'method' 		=> strtoupper($payment->source()),
1455 1455
 				'PM_ID' 			=> $payment->payment_method() ? $payment->payment_method()->ID() : 1,
1456
-				'gateway' 		=> $payment->payment_method() ? $payment->payment_method()->admin_name() : __( "Unknown", 'event_espresso' ),
1456
+				'gateway' 		=> $payment->payment_method() ? $payment->payment_method()->admin_name() : __("Unknown", 'event_espresso'),
1457 1457
 				'gateway_response' 	=> $payment->gateway_response(),
1458 1458
 				'txn_id_chq_nmbr'  	=> $payment->txn_id_chq_nmbr(),
1459 1459
 				'po_number'        		=> $payment->po_number(),
1460 1460
 				'extra_accntng'    		=> $payment->extra_accntng(),
1461
-				'registrations'    			=> $this->_registration_payment_data_array( $REG_IDs ),
1461
+				'registrations'    			=> $this->_registration_payment_data_array($REG_IDs),
1462 1462
 			);
1463 1463
 		}
1464 1464
 	}
@@ -1473,42 +1473,42 @@  discard block
 block discarded – undo
1473 1473
 	*	@return void
1474 1474
 	*/
1475 1475
 	public function delete_payment() {
1476
-		$json_response_data = array( 'return_data' => FALSE );
1477
-		$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;
1478
-		if ( $PAY_ID ) {
1479
-			$delete_txn_reg_status_change = isset( $this->_req_data[ 'delete_txn_reg_status_change' ] ) ? $this->_req_data[ 'delete_txn_reg_status_change' ] : false;
1480
-			$payment = EEM_Payment::instance()->get_one_by_ID( $PAY_ID );
1481
-			if ( $payment instanceof EE_Payment ) {
1482
-				$REG_IDs = $this->_get_existing_reg_payment_REG_IDs( $payment );
1476
+		$json_response_data = array('return_data' => FALSE);
1477
+		$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;
1478
+		if ($PAY_ID) {
1479
+			$delete_txn_reg_status_change = isset($this->_req_data['delete_txn_reg_status_change']) ? $this->_req_data['delete_txn_reg_status_change'] : false;
1480
+			$payment = EEM_Payment::instance()->get_one_by_ID($PAY_ID);
1481
+			if ($payment instanceof EE_Payment) {
1482
+				$REG_IDs = $this->_get_existing_reg_payment_REG_IDs($payment);
1483 1483
 				/** @type EE_Transaction_Payments $transaction_payments */
1484
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1485
-				if ( $transaction_payments->delete_payment_and_update_transaction( $payment )) {
1486
-					EE_Error::add_success( __( 'The Payment was successfully deleted.', 'event_espresso' ) );
1487
-					$json_response_data['return_data'] = $this->_build_payment_json_response( $payment, $REG_IDs, $delete_txn_reg_status_change );
1488
-					if ( $delete_txn_reg_status_change ) {
1484
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1485
+				if ($transaction_payments->delete_payment_and_update_transaction($payment)) {
1486
+					EE_Error::add_success(__('The Payment was successfully deleted.', 'event_espresso'));
1487
+					$json_response_data['return_data'] = $this->_build_payment_json_response($payment, $REG_IDs, $delete_txn_reg_status_change);
1488
+					if ($delete_txn_reg_status_change) {
1489 1489
 						$this->_req_data['txn_reg_status_change'] = $delete_txn_reg_status_change;
1490 1490
 						//MAKE sure we also add the delete_txn_req_status_change to the
1491 1491
 						//$_REQUEST global because that's how messages will be looking for it.
1492 1492
 						$_REQUEST['txn_reg_status_change'] = $delete_txn_reg_status_change;
1493 1493
 						$this->_maybe_send_notifications();
1494
-						$this->_process_registration_status_change( $payment->transaction(), $REG_IDs );
1494
+						$this->_process_registration_status_change($payment->transaction(), $REG_IDs);
1495 1495
 						//$this->_maybe_send_notifications( $payment );
1496 1496
 					}
1497 1497
 				}
1498 1498
 			} else {
1499 1499
 				EE_Error::add_error(
1500
-					__( 'Valid Payment data could not be retrieved from the database.', 'event_espresso' ),
1500
+					__('Valid Payment data could not be retrieved from the database.', 'event_espresso'),
1501 1501
 					__FILE__, __FUNCTION__, __LINE__
1502 1502
 				);
1503 1503
 			}
1504 1504
 		} else {
1505 1505
 			EE_Error::add_error(
1506
-				__( 'A valid Payment ID was not received, therefore payment form data could not be loaded.', 'event_espresso' ),
1506
+				__('A valid Payment ID was not received, therefore payment form data could not be loaded.', 'event_espresso'),
1507 1507
 				__FILE__, __FUNCTION__, __LINE__
1508 1508
 			);
1509 1509
 		}
1510
-		$notices = EE_Error::get_notices( FALSE, FALSE, FALSE );
1511
-		echo json_encode( array_merge( $json_response_data, $notices ));
1510
+		$notices = EE_Error::get_notices(FALSE, FALSE, FALSE);
1511
+		echo json_encode(array_merge($json_response_data, $notices));
1512 1512
 		die();
1513 1513
 	}
1514 1514
 
@@ -1522,17 +1522,17 @@  discard block
 block discarded – undo
1522 1522
 	 * @param array $REG_IDs
1523 1523
 	 * @return array
1524 1524
 	 */
1525
-	protected function _registration_payment_data_array( $REG_IDs ) {
1525
+	protected function _registration_payment_data_array($REG_IDs) {
1526 1526
 		$registration_payment_data = array();
1527 1527
 		//if non empty reg_ids lets get an array of registrations and update the values for the apply_payment/refund rows.
1528
-		if ( ! empty( $REG_IDs ) ) {
1529
-			EE_Registry::instance()->load_helper( 'Template' );
1530
-			$registrations = EEM_Registration::instance()->get_all( array( array( 'REG_ID' => array( 'IN', $REG_IDs ) ) ) );
1531
-			foreach ( $registrations as $registration ) {
1532
-				if ( $registration instanceof EE_Registration ) {
1533
-					$registration_payment_data[ $registration->ID() ] = array(
1528
+		if ( ! empty($REG_IDs)) {
1529
+			EE_Registry::instance()->load_helper('Template');
1530
+			$registrations = EEM_Registration::instance()->get_all(array(array('REG_ID' => array('IN', $REG_IDs))));
1531
+			foreach ($registrations as $registration) {
1532
+				if ($registration instanceof EE_Registration) {
1533
+					$registration_payment_data[$registration->ID()] = array(
1534 1534
 						'paid' => $registration->pretty_paid(),
1535
-						'owing' => EEH_Template::format_currency( $registration->final_price() - $registration->paid() ),
1535
+						'owing' => EEH_Template::format_currency($registration->final_price() - $registration->paid()),
1536 1536
 					);
1537 1537
 				}
1538 1538
 			}
@@ -1552,30 +1552,30 @@  discard block
 block discarded – undo
1552 1552
 	 * @access protected
1553 1553
 	 * @param \EE_Payment | null $payment
1554 1554
 	 */
1555
-	protected function _maybe_send_notifications( $payment = null ) {
1556
-		switch ( $payment instanceof EE_Payment ) {
1555
+	protected function _maybe_send_notifications($payment = null) {
1556
+		switch ($payment instanceof EE_Payment) {
1557 1557
 			// payment notifications
1558 1558
 			case true :
1559 1559
 				if (
1560 1560
 					isset(
1561
-						$this->_req_data[ 'txn_payments' ],
1562
-						$this->_req_data[ 'txn_payments' ][ 'send_notifications' ]
1561
+						$this->_req_data['txn_payments'],
1562
+						$this->_req_data['txn_payments']['send_notifications']
1563 1563
 					) &&
1564
-					filter_var( $this->_req_data[ 'txn_payments' ][ 'send_notifications' ], FILTER_VALIDATE_BOOLEAN )
1564
+					filter_var($this->_req_data['txn_payments']['send_notifications'], FILTER_VALIDATE_BOOLEAN)
1565 1565
 				) {
1566
-					$this->_process_payment_notification( $payment );
1566
+					$this->_process_payment_notification($payment);
1567 1567
 				}
1568 1568
 				break;
1569 1569
 			// registration notifications
1570 1570
 			case false :
1571 1571
 				if (
1572 1572
 					isset(
1573
-						$this->_req_data[ 'txn_reg_status_change' ],
1574
-						$this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ]
1573
+						$this->_req_data['txn_reg_status_change'],
1574
+						$this->_req_data['txn_reg_status_change']['send_notifications']
1575 1575
 					) &&
1576
-					filter_var( $this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ], FILTER_VALIDATE_BOOLEAN )
1576
+					filter_var($this->_req_data['txn_reg_status_change']['send_notifications'], FILTER_VALIDATE_BOOLEAN)
1577 1577
 				) {
1578
-					add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true' );
1578
+					add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true');
1579 1579
 				}
1580 1580
 				break;
1581 1581
 		}
@@ -1591,11 +1591,11 @@  discard block
 block discarded – undo
1591 1591
 	*	@return void
1592 1592
 	*/
1593 1593
 	protected function _send_payment_reminder() {
1594
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1595
-		$transaction = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
1596
-		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID'] ) : array();
1597
-		do_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction );
1598
-		$this->_redirect_after_action( FALSE, __('payment reminder', 'event_espresso'), __('sent', 'event_espresso'), $query_args, TRUE );
1594
+	    $TXN_ID = ( ! empty($this->_req_data['TXN_ID'])) ? absint($this->_req_data['TXN_ID']) : FALSE;
1595
+		$transaction = EEM_Transaction::instance()->get_one_by_ID($TXN_ID);
1596
+		$query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID']) : array();
1597
+		do_action('AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction);
1598
+		$this->_redirect_after_action(FALSE, __('payment reminder', 'event_espresso'), __('sent', 'event_espresso'), $query_args, TRUE);
1599 1599
 	}
1600 1600
 
1601 1601
 
@@ -1609,36 +1609,36 @@  discard block
 block discarded – undo
1609 1609
 	 * @param string   $view
1610 1610
 	 * @return mixed int = count || array of transaction objects
1611 1611
 	 */
1612
-	public function get_transactions( $perpage, $count = FALSE, $view = '' ) {
1612
+	public function get_transactions($perpage, $count = FALSE, $view = '') {
1613 1613
 
1614 1614
 		$TXN = EEM_Transaction::instance();
1615 1615
 
1616
-	    $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' ));
1617
-	    $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' );
1616
+	    $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'));
1617
+	    $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');
1618 1618
 
1619 1619
 	    //make sure our timestamps start and end right at the boundaries for each day
1620
-	    $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1621
-	    $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1620
+	    $start_date = date('Y-m-d', strtotime($start_date)).' 00:00:00';
1621
+	    $end_date = date('Y-m-d', strtotime($end_date)).' 23:59:59';
1622 1622
 
1623 1623
 
1624 1624
 	    //convert to timestamps
1625
-	    $start_date = strtotime( $start_date );
1626
-	    $end_date = strtotime( $end_date );
1625
+	    $start_date = strtotime($start_date);
1626
+	    $end_date = strtotime($end_date);
1627 1627
 
1628 1628
 	    //makes sure start date is the lowest value and vice versa
1629
-	    $start_date = min( $start_date, $end_date );
1630
-	    $end_date = max( $start_date, $end_date );
1629
+	    $start_date = min($start_date, $end_date);
1630
+	    $end_date = max($start_date, $end_date);
1631 1631
 
1632 1632
 	    //convert to correct format for query
1633
-	$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' );
1634
-	$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' );
1633
+	$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');
1634
+	$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');
1635 1635
 
1636 1636
 
1637 1637
 
1638 1638
 	    //set orderby
1639 1639
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
1640 1640
 
1641
-		switch ( $this->_req_data['orderby'] ) {
1641
+		switch ($this->_req_data['orderby']) {
1642 1642
 			case 'TXN_ID':
1643 1643
 				$orderby = 'TXN_ID';
1644 1644
 				break;
@@ -1652,66 +1652,66 @@  discard block
 block discarded – undo
1652 1652
 				$orderby = 'TXN_timestamp';
1653 1653
 		}
1654 1654
 
1655
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC';
1656
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
1657
-		$per_page = isset( $perpage ) && !empty( $perpage ) ? $perpage : 10;
1658
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
1655
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC';
1656
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
1657
+		$per_page = isset($perpage) && ! empty($perpage) ? $perpage : 10;
1658
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
1659 1659
 
1660
-		$offset = ($current_page-1)*$per_page;
1661
-		$limit = array( $offset, $per_page );
1660
+		$offset = ($current_page - 1) * $per_page;
1661
+		$limit = array($offset, $per_page);
1662 1662
 
1663 1663
 		$_where = array(
1664
-			'TXN_timestamp' => array('BETWEEN', array($start_date, $end_date) ),
1664
+			'TXN_timestamp' => array('BETWEEN', array($start_date, $end_date)),
1665 1665
 			'Registration.REG_count' => 1
1666 1666
 		);
1667 1667
 
1668
-		if ( isset( $this->_req_data['EVT_ID'] ) ) {
1668
+		if (isset($this->_req_data['EVT_ID'])) {
1669 1669
 			$_where['Registration.EVT_ID'] = $this->_req_data['EVT_ID'];
1670 1670
 		}
1671 1671
 
1672
-		if ( isset( $this->_req_data['s'] ) ) {
1673
-			$search_string = '%' . $this->_req_data['s'] . '%';
1672
+		if (isset($this->_req_data['s'])) {
1673
+			$search_string = '%'.$this->_req_data['s'].'%';
1674 1674
 			$_where['OR'] = array(
1675
-				'Registration.Event.EVT_name' => array( 'LIKE', $search_string ),
1676
-				'Registration.Event.EVT_desc' => array( 'LIKE', $search_string ),
1677
-				'Registration.Event.EVT_short_desc' => array( 'LIKE' , $search_string ),
1678
-				'Registration.Attendee.ATT_full_name' => array( 'LIKE', $search_string ),
1679
-				'Registration.Attendee.ATT_fname' => array( 'LIKE', $search_string ),
1680
-				'Registration.Attendee.ATT_lname' => array( 'LIKE', $search_string ),
1681
-				'Registration.Attendee.ATT_short_bio' => array( 'LIKE', $search_string ),
1682
-				'Registration.Attendee.ATT_email' => array('LIKE', $search_string ),
1683
-				'Registration.Attendee.ATT_address' => array( 'LIKE', $search_string ),
1684
-				'Registration.Attendee.ATT_address2' => array( 'LIKE', $search_string ),
1685
-				'Registration.Attendee.ATT_city' => array( 'LIKE', $search_string ),
1686
-				'Registration.REG_final_price' => array( 'LIKE', $search_string ),
1687
-				'Registration.REG_code' => array( 'LIKE', $search_string ),
1688
-				'Registration.REG_count' => array( 'LIKE' , $search_string ),
1689
-				'Registration.REG_group_size' => array( 'LIKE' , $search_string ),
1690
-				'Registration.Ticket.TKT_name' => array( 'LIKE', $search_string ),
1691
-				'Registration.Ticket.TKT_description' => array( 'LIKE', $search_string ),
1692
-				'Payment.PAY_source' => array('LIKE', $search_string ),
1693
-				'Payment.Payment_Method.PMD_name' => array('LIKE', $search_string ),
1694
-				'TXN_session_data' => array( 'LIKE', $search_string ),
1695
-				'Payment.PAY_txn_id_chq_nmbr' => array( 'LIKE', $search_string )
1675
+				'Registration.Event.EVT_name' => array('LIKE', $search_string),
1676
+				'Registration.Event.EVT_desc' => array('LIKE', $search_string),
1677
+				'Registration.Event.EVT_short_desc' => array('LIKE', $search_string),
1678
+				'Registration.Attendee.ATT_full_name' => array('LIKE', $search_string),
1679
+				'Registration.Attendee.ATT_fname' => array('LIKE', $search_string),
1680
+				'Registration.Attendee.ATT_lname' => array('LIKE', $search_string),
1681
+				'Registration.Attendee.ATT_short_bio' => array('LIKE', $search_string),
1682
+				'Registration.Attendee.ATT_email' => array('LIKE', $search_string),
1683
+				'Registration.Attendee.ATT_address' => array('LIKE', $search_string),
1684
+				'Registration.Attendee.ATT_address2' => array('LIKE', $search_string),
1685
+				'Registration.Attendee.ATT_city' => array('LIKE', $search_string),
1686
+				'Registration.REG_final_price' => array('LIKE', $search_string),
1687
+				'Registration.REG_code' => array('LIKE', $search_string),
1688
+				'Registration.REG_count' => array('LIKE', $search_string),
1689
+				'Registration.REG_group_size' => array('LIKE', $search_string),
1690
+				'Registration.Ticket.TKT_name' => array('LIKE', $search_string),
1691
+				'Registration.Ticket.TKT_description' => array('LIKE', $search_string),
1692
+				'Payment.PAY_source' => array('LIKE', $search_string),
1693
+				'Payment.Payment_Method.PMD_name' => array('LIKE', $search_string),
1694
+				'TXN_session_data' => array('LIKE', $search_string),
1695
+				'Payment.PAY_txn_id_chq_nmbr' => array('LIKE', $search_string)
1696 1696
 				);
1697 1697
 		}
1698 1698
 
1699 1699
 		//failed transactions
1700
-		$failed = ( ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'failed' && ! $count ) || ( $count && $view == 'failed' ) ? TRUE: FALSE;
1701
-		$abandoned = ( ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'abandoned' && ! $count ) || ( $count && $view == 'abandoned' ) ? TRUE: FALSE;
1700
+		$failed = ( ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'failed' && ! $count) || ($count && $view == 'failed') ? TRUE : FALSE;
1701
+		$abandoned = ( ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'abandoned' && ! $count) || ($count && $view == 'abandoned') ? TRUE : FALSE;
1702 1702
 
1703
-		if ( $failed ) {
1704
-			$_where[ 'STS_ID' ] = EEM_Transaction::failed_status_code;
1705
-		} else if ( $abandoned ) {
1703
+		if ($failed) {
1704
+			$_where['STS_ID'] = EEM_Transaction::failed_status_code;
1705
+		} else if ($abandoned) {
1706 1706
 				$_where['STS_ID'] = EEM_Transaction::abandoned_status_code;
1707 1707
 		} else {
1708
-				$_where['STS_ID'] = array( '!=', EEM_Transaction::failed_status_code );
1709
-				$_where['STS_ID*'] = array( '!=', EEM_Transaction::abandoned_status_code );
1708
+				$_where['STS_ID'] = array('!=', EEM_Transaction::failed_status_code);
1709
+				$_where['STS_ID*'] = array('!=', EEM_Transaction::abandoned_status_code);
1710 1710
 		}
1711 1711
 
1712
-		$query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'limit' => $limit );
1712
+		$query_params = array($_where, 'order_by' => array($orderby => $sort), 'limit' => $limit);
1713 1713
 
1714
-		$transactions = $count ? $TXN->count( array($_where), 'TXN_ID', TRUE ) : $TXN->get_all($query_params);
1714
+		$transactions = $count ? $TXN->count(array($_where), 'TXN_ID', TRUE) : $TXN->get_all($query_params);
1715 1715
 
1716 1716
 
1717 1717
 		return $transactions;
Please login to merge, or discard this patch.
help_tabs/transactions_overview_table_column_headings.help_tab.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,11 +67,11 @@
 block discarded – undo
67 67
 </li>
68 68
 <li style="list-style-type: none;">
69 69
 <strong><?php _e('View Registration Details <span class="dashicons dashicons-clipboard"></span>', 'event_espresso'); ?></strong><br />
70
-<?php echo sprintf(__('Clicking this icon will take you to the registration page for this transaction. You can also get there via the %sRegistrations page%s.', 'event_espresso'), '<a href="admin.php?page=espresso_registrations">','</a>'); ?>
70
+<?php echo sprintf(__('Clicking this icon will take you to the registration page for this transaction. You can also get there via the %sRegistrations page%s.', 'event_espresso'), '<a href="admin.php?page=espresso_registrations">', '</a>'); ?>
71 71
 </li>
72 72
 <li style="list-style-type: none;">
73 73
 <strong><?php _e('Send Payment Reminder <span class="dashicons dashicons-email-alt"></span>', 'event_espresso'); ?></strong><br />
74
-<?php echo sprintf(__('Emails the primary registrant the Payment Reminder message. This is set up in the %sMessages page%s.', 'event_espresso'),'<a href="admin.php?page=espresso_messages">','</a>'); ?>
74
+<?php echo sprintf(__('Emails the primary registrant the Payment Reminder message. This is set up in the %sMessages page%s.', 'event_espresso'), '<a href="admin.php?page=espresso_messages">', '</a>'); ?>
75 75
 </li>
76 76
 </ul>
77 77
 </li>
Please login to merge, or discard this patch.