Completed
Branch FET-4710-for-BETA-4.8-CORE (b46867)
by
unknown
693:23 queued 665:02
created
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.
admin_pages/support/Support_Admin_Page_Init.core.php 2 patches
Spacing   +6 added lines, -6 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
 /**
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
 
33 33
 	public function __construct() {
34 34
 		//define some help/support page related constants
35
-		define( 'EE_SUPPORT_PG_SLUG', 'espresso_support' );
36
-		define( 'EE_SUPPORT_ADMIN_URL', admin_url('admin.php?page=' . EE_SUPPORT_PG_SLUG ));
37
-		define( 'EE_SUPPORT_ADMIN_TEMPLATE_PATH', EE_ADMIN_PAGES . 'support/templates/');
38
-		define( 'EE_SUPPORT_ADMIN', EE_ADMIN_PAGES . 'support/' );
35
+		define('EE_SUPPORT_PG_SLUG', 'espresso_support');
36
+		define('EE_SUPPORT_ADMIN_URL', admin_url('admin.php?page='.EE_SUPPORT_PG_SLUG));
37
+		define('EE_SUPPORT_ADMIN_TEMPLATE_PATH', EE_ADMIN_PAGES.'support/templates/');
38
+		define('EE_SUPPORT_ADMIN', EE_ADMIN_PAGES.'support/');
39 39
 
40 40
 		parent::__construct();
41 41
 	}
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	}
46 46
 
47 47
 	protected function _set_menu_map() {
48
-		$this->_menu_map = new EE_Admin_Page_Sub_Menu( array(
48
+		$this->_menu_map = new EE_Admin_Page_Sub_Menu(array(
49 49
 			'menu_group' => 'extras',
50 50
 			'menu_order' => 30,
51 51
 			'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_AND_NETWORK_ADMIN,
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
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 
90 90
 	/**
91 91
 	 * 		grab url requests and route them
92
-	*		@access private
93
-	*		@return void
94
-	*/
92
+	 *		@access private
93
+	 *		@return void
94
+	 */
95 95
 	public function _set_page_routes() {
96 96
 
97 97
 		$this->_set_transaction_status_array();
@@ -226,10 +226,10 @@  discard block
 block discarded – undo
226 226
 	/**
227 227
 	 * _set_transaction_status_array
228 228
 	 * sets list of transaction statuses
229
-	*
229
+	 *
230 230
 	 * @access private
231
-	*	@return void
232
-	*/
231
+	 *	@return void
232
+	 */
233 233
 	private function _set_transaction_status_array() {
234 234
 		self::$_txn_status = EEM_Transaction::instance()->status_array(TRUE);
235 235
 	}
@@ -251,10 +251,10 @@  discard block
 block discarded – undo
251 251
 
252 252
 	/**
253 253
 	 * 	get list of payment statuses
254
-	*
254
+	 *
255 255
 	 * @access private
256
-	*	@return void
257
-	*/
256
+	 *	@return void
257
+	 */
258 258
 	private function _get_payment_status_array() {
259 259
 		self::$_pay_status = EEM_Payment::instance()->status_array(TRUE);
260 260
 		$this->_template_args['payment_status'] = self::$_pay_status;
@@ -362,18 +362,18 @@  discard block
 block discarded – undo
362 362
 		if ( is_object( $this->_transaction) )
363 363
 			return; //get out we've already set the object
364 364
 
365
-	    $TXN = EEM_Transaction::instance();
365
+		$TXN = EEM_Transaction::instance();
366 366
 
367
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
367
+		$TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
368 368
 
369
-	    //get transaction object
370
-	    $this->_transaction = $TXN->get_one_by_ID($TXN_ID);
371
-	    $this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
369
+		//get transaction object
370
+		$this->_transaction = $TXN->get_one_by_ID($TXN_ID);
371
+		$this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
372 372
 
373 373
 	 	if ( empty( $this->_transaction ) ) {
374
-	    	$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  __(' could not be retrieved.', 'event_espresso');
374
+			$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  __(' could not be retrieved.', 'event_espresso');
375 375
 			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
376
-	    }
376
+		}
377 377
 	}
378 378
 
379 379
 
@@ -475,12 +475,12 @@  discard block
 block discarded – undo
475 475
 
476 476
 
477 477
 	/**
478
-	* 	_transaction_details
478
+	 * 	_transaction_details
479 479
 	 * generates HTML for the View Transaction Details Admin page
480
-	*
480
+	 *
481 481
 	 * @access protected
482
-	*	@return void
483
-	*/
482
+	 *	@return void
483
+	 */
484 484
 	protected function _transaction_details() {
485 485
 		do_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction );
486 486
 		EE_Registry::instance()->load_helper( 'MSG_Template' );
@@ -603,10 +603,10 @@  discard block
 block discarded – undo
603 603
 	/**
604 604
 	 * txn_details_meta_box
605 605
 	 * generates HTML for the Transaction main meta box
606
-	*
606
+	 *
607 607
 	 * @access public
608
-	*	@return void
609
-	*/
608
+	 *	@return void
609
+	 */
610 610
 	public function txn_details_meta_box() {
611 611
 
612 612
 		$this->_set_transaction_object();
@@ -947,10 +947,10 @@  discard block
 block discarded – undo
947 947
 	/**
948 948
 	 * txn_billing_info_side_meta_box
949 949
 	 * 	generates HTML for the Edit Transaction side meta box
950
-	*
950
+	 *
951 951
 	 * @access public
952
-	*	@return void
953
-	*/
952
+	 *	@return void
953
+	 */
954 954
 	public function txn_billing_info_side_meta_box() {
955 955
 
956 956
 		$this->_template_args['billing_form'] = $this->_transaction->billing_info();
@@ -965,10 +965,10 @@  discard block
 block discarded – undo
965 965
 	/**
966 966
 	 * apply_payments_or_refunds
967 967
 	 * 	registers a payment or refund made towards a transaction
968
-	*
968
+	 *
969 969
 	 * @access public
970
-	*	@return void
971
-	*/
970
+	 *	@return void
971
+	 */
972 972
 	public function apply_payments_or_refunds() {
973 973
 
974 974
 		$json_response_data = array( 'return_data' => FALSE );
@@ -1206,10 +1206,10 @@  discard block
 block discarded – undo
1206 1206
 	/**
1207 1207
 	 * delete_payment
1208 1208
 	 * 	delete a payment or refund made towards a transaction
1209
-	*
1209
+	 *
1210 1210
 	 * @access public
1211
-	*	@return void
1212
-	*/
1211
+	 *	@return void
1212
+	 */
1213 1213
 	public function delete_payment() {
1214 1214
 
1215 1215
 		$json_response_data = array( 'return_data' => FALSE );
@@ -1273,12 +1273,12 @@  discard block
 block discarded – undo
1273 1273
 	/**
1274 1274
 	 * _send_payment_reminder
1275 1275
 	 * 	generates HTML for the View Transaction Details Admin page
1276
-	*
1276
+	 *
1277 1277
 	 * @access protected
1278
-	*	@return void
1279
-	*/
1278
+	 *	@return void
1279
+	 */
1280 1280
 	protected function _send_payment_reminder() {
1281
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1281
+		$TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1282 1282
 		$transaction = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
1283 1283
 		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID'] ) : array();
1284 1284
 		do_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction );
@@ -1301,29 +1301,29 @@  discard block
 block discarded – undo
1301 1301
 
1302 1302
 		$TXN = EEM_Transaction::instance();
1303 1303
 
1304
-	    $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' ));
1305
-	    $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' );
1304
+		$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' ));
1305
+		$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' );
1306 1306
 
1307
-	    //make sure our timestamps start and end right at the boundaries for each day
1308
-	    $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1309
-	    $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1307
+		//make sure our timestamps start and end right at the boundaries for each day
1308
+		$start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1309
+		$end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1310 1310
 
1311 1311
 
1312
-	    //convert to timestamps
1313
-	    $start_date = strtotime( $start_date );
1314
-	    $end_date = strtotime( $end_date );
1312
+		//convert to timestamps
1313
+		$start_date = strtotime( $start_date );
1314
+		$end_date = strtotime( $end_date );
1315 1315
 
1316
-	    //makes sure start date is the lowest value and vice versa
1317
-	    $start_date = min( $start_date, $end_date );
1318
-	    $end_date = max( $start_date, $end_date );
1316
+		//makes sure start date is the lowest value and vice versa
1317
+		$start_date = min( $start_date, $end_date );
1318
+		$end_date = max( $start_date, $end_date );
1319 1319
 
1320
-	    //convert to correct format for query
1320
+		//convert to correct format for query
1321 1321
 	$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' );
1322 1322
 	$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' );
1323 1323
 
1324 1324
 
1325 1325
 
1326
-	    //set orderby
1326
+		//set orderby
1327 1327
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
1328 1328
 
1329 1329
 		switch ( $this->_req_data['orderby'] ) {
Please login to merge, or discard this patch.
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   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 	 * just checks the field isn't blank
27 27
 	 *
28 28
 	 * @param $normalized_value
29
-	 * @return bool
29
+	 * @return boolean|null
30 30
 	 * @throws \EE_Validation_Error
31 31
 	 */
32 32
 	function validate($normalized_value) {
Please login to merge, or discard this patch.
Spacing   +334 added lines, -334 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 	 * @param bool $routing
40 40
 	 * @return Transactions_Admin_Page
41 41
 	 */
42
-	public function __construct( $routing = TRUE ) {
43
-		parent::__construct( $routing );
42
+	public function __construct($routing = TRUE) {
43
+		parent::__construct($routing);
44 44
 	}
45 45
 
46 46
 
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
 	 * @return void
64 64
 	 */
65 65
 	protected function _ajax_hooks() {
66
-		add_action('wp_ajax_espresso_apply_payment', array( $this, 'apply_payments_or_refunds'));
67
-		add_action('wp_ajax_espresso_apply_refund', array( $this, 'apply_payments_or_refunds'));
68
-		add_action('wp_ajax_espresso_delete_payment', array( $this, 'delete_payment'));
66
+		add_action('wp_ajax_espresso_apply_payment', array($this, 'apply_payments_or_refunds'));
67
+		add_action('wp_ajax_espresso_apply_refund', array($this, 'apply_payments_or_refunds'));
68
+		add_action('wp_ajax_espresso_delete_payment', array($this, 'delete_payment'));
69 69
 	}
70 70
 
71 71
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 			'buttons' => array(
81 81
 				'add' => __('Add New Transaction', 'event_espresso'),
82 82
 				'edit' => __('Edit Transaction', 'event_espresso'),
83
-				'delete' => __('Delete Transaction','event_espresso')
83
+				'delete' => __('Delete Transaction', 'event_espresso')
84 84
 				)
85 85
 			);
86 86
 	}
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
 		$this->_set_transaction_status_array();
98 98
 
99
-		$txn_id = ! empty( $this->_req_data['TXN_ID'] ) && ! is_array( $this->_req_data['TXN_ID'] ) ? $this->_req_data['TXN_ID'] : 0;
99
+		$txn_id = ! empty($this->_req_data['TXN_ID']) && ! is_array($this->_req_data['TXN_ID']) ? $this->_req_data['TXN_ID'] : 0;
100 100
 
101 101
 		$this->_page_routes = array(
102 102
 
@@ -168,15 +168,15 @@  discard block
 block discarded – undo
168 168
 						'filename' => 'transactions_overview_views_filters_search'
169 169
 					),
170 170
 				),
171
-				'help_tour' => array( 'Transactions_Overview_Help_Tour' ),
172
-				'qtips' => array( 'Transactions_List_Table_Tips' ),
171
+				'help_tour' => array('Transactions_Overview_Help_Tour'),
172
+				'qtips' => array('Transactions_List_Table_Tips'),
173 173
 				'require_nonce' => FALSE
174 174
 				),
175 175
 			'view_transaction' => array(
176 176
 				'nav' => array(
177 177
 					'label' => __('View Transaction', 'event_espresso'),
178 178
 					'order' => 5,
179
-					'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,
179
+					'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,
180 180
 					'persistent' => FALSE
181 181
 					),
182 182
 				'help_tabs' => array(
@@ -197,8 +197,8 @@  discard block
 block discarded – undo
197 197
 						'filename' => 'transactions_view_transaction_primary_registrant_billing_information'
198 198
 					),
199 199
 				),
200
-				'qtips' => array( 'Transaction_Details_Tips' ),
201
-				'help_tour' => array( 'Transaction_Details_Help_Tour' ),
200
+				'qtips' => array('Transaction_Details_Tips'),
201
+				'help_tour' => array('Transaction_Details_Help_Tour'),
202 202
 				'metaboxes' => array('_transaction_details_metaboxes'),
203 203
 
204 204
 				'require_nonce' => FALSE
@@ -278,19 +278,19 @@  discard block
 block discarded – undo
278 278
 	 */
279 279
 	public function load_scripts_styles() {
280 280
 		//enqueue style
281
-		wp_register_style( 'espresso_txn', TXN_ASSETS_URL . 'espresso_transactions_admin.css', array(), EVENT_ESPRESSO_VERSION );
281
+		wp_register_style('espresso_txn', TXN_ASSETS_URL.'espresso_transactions_admin.css', array(), EVENT_ESPRESSO_VERSION);
282 282
 		wp_enqueue_style('espresso_txn');
283 283
 
284 284
 		//scripts
285 285
 		add_filter('FHEE_load_accounting_js', '__return_true');
286 286
 
287 287
 		//scripts
288
-		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);
288
+		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);
289 289
 		wp_enqueue_script('espresso_txn');
290 290
 
291 291
 		;
292
-		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' );
293
-		EE_Registry::$i18n_js_strings['error_occurred'] = __(  'An error occurred! Please refresh the page and try again.', 'event_espresso' );
292
+		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');
293
+		EE_Registry::$i18n_js_strings['error_occurred'] = __('An error occurred! Please refresh the page and try again.', 'event_espresso');
294 294
 		EE_Registry::$i18n_js_strings['txn_status_array'] = self::$_txn_status;
295 295
 		EE_Registry::$i18n_js_strings['pay_status_array'] = self::$_pay_status;
296 296
 
@@ -333,8 +333,8 @@  discard block
 block discarded – undo
333 333
 	 *	@return void
334 334
 	 */
335 335
 	protected function _set_list_table_views_default() {
336
-		$this->_views = array (
337
-			'all' => array (
336
+		$this->_views = array(
337
+			'all' => array(
338 338
 				'slug' 		=> 'all',
339 339
 				'label' 		=> __('View All Transactions', 'event_espresso'),
340 340
 				'count' 	=> 0
@@ -362,20 +362,20 @@  discard block
 block discarded – undo
362 362
 	 *	@return void
363 363
 	 */
364 364
 	private function _set_transaction_object() {
365
-		if ( is_object( $this->_transaction) )
365
+		if (is_object($this->_transaction))
366 366
 			return; //get out we've already set the object
367 367
 
368 368
 	    $TXN = EEM_Transaction::instance();
369 369
 
370
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
370
+	    $TXN_ID = ( ! empty($this->_req_data['TXN_ID'])) ? absint($this->_req_data['TXN_ID']) : FALSE;
371 371
 
372 372
 	    //get transaction object
373 373
 	    $this->_transaction = $TXN->get_one_by_ID($TXN_ID);
374
-	    $this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
374
+	    $this->_session = ! empty($this->_transaction) ? $this->_transaction->get('TXN_session_data') : NULL;
375 375
 
376
-	 	if ( empty( $this->_transaction ) ) {
377
-	    	$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  __(' could not be retrieved.', 'event_espresso');
378
-			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
376
+	 	if (empty($this->_transaction)) {
377
+	    	$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso').$TXN_ID.__(' could not be retrieved.', 'event_espresso');
378
+			EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
379 379
 	    }
380 380
 	}
381 381
 
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 				),
402 402
 				'view_receipt' => array(
403 403
 					'class' => 'dashicons dashicons-media-default',
404
-					'desc' => __('View Transaction Receipt', 'event_espresso' )
404
+					'desc' => __('View Transaction Receipt', 'event_espresso')
405 405
 				),
406 406
 				'view_registration' => array(
407 407
 					'class' => 'dashicons dashicons-clipboard',
@@ -410,10 +410,10 @@  discard block
 block discarded – undo
410 410
 			)
411 411
 		);
412 412
 
413
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_transactions_send_payment_reminder' ) ) {
413
+		if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder')) {
414 414
 
415
-			EE_Registry::instance()->load_helper( 'MSG_Template' );
416
-			if ( EEH_MSG_Template::is_mt_active( 'payment_reminder' ) ) {
415
+			EE_Registry::instance()->load_helper('MSG_Template');
416
+			if (EEH_MSG_Template::is_mt_active('payment_reminder')) {
417 417
 				$items['send_payment_reminder'] = array(
418 418
 					'class' => 'dashicons dashicons-email-alt',
419 419
 					'desc' => __('Send Payment Reminder', 'event_espresso')
@@ -434,29 +434,29 @@  discard block
 block discarded – undo
434 434
 			'FHEE__Transactions_Admin_Page___transaction_legend_items__more_items',
435 435
 			array(
436 436
 				'overpaid'   => array(
437
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::overpaid_status_code,
438
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::overpaid_status_code, FALSE, 'sentence' )
437
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::overpaid_status_code,
438
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::overpaid_status_code, FALSE, 'sentence')
439 439
 				),
440 440
 				'complete'   => array(
441
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::complete_status_code,
442
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::complete_status_code, FALSE, 'sentence' )
441
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::complete_status_code,
442
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::complete_status_code, FALSE, 'sentence')
443 443
 				),
444 444
 				'incomplete' => array(
445
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::incomplete_status_code,
446
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::incomplete_status_code, FALSE, 'sentence' )
445
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::incomplete_status_code,
446
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::incomplete_status_code, FALSE, 'sentence')
447 447
 				),
448 448
 				'abandoned'  => array(
449
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::abandoned_status_code,
450
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::abandoned_status_code, FALSE, 'sentence' )
449
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::abandoned_status_code,
450
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::abandoned_status_code, FALSE, 'sentence')
451 451
 				),
452 452
 				'failed'     => array(
453
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::failed_status_code,
454
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::failed_status_code, FALSE, 'sentence' )
453
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::failed_status_code,
454
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::failed_status_code, FALSE, 'sentence')
455 455
 				)
456 456
 			)
457 457
 		);
458 458
 
459
-		return array_merge( $items, $more_items);
459
+		return array_merge($items, $more_items);
460 460
 	}
461 461
 
462 462
 
@@ -469,9 +469,9 @@  discard block
 block discarded – undo
469 469
 	 */
470 470
 	protected function _transactions_overview_list_table() {
471 471
 		$this->_admin_page_title = __('Transactions', 'event_espresso');
472
-		$event = isset($this->_req_data['EVT_ID']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID'] ) : NULL;
473
-		$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>' ) : '';
474
-		$this->_template_args['after_list_table'] = $this->_display_legend( $this->_transaction_legend_items() );
472
+		$event = isset($this->_req_data['EVT_ID']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID']) : NULL;
473
+		$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>') : '';
474
+		$this->_template_args['after_list_table'] = $this->_display_legend($this->_transaction_legend_items());
475 475
 		$this->display_admin_list_table_page_with_no_sidebar();
476 476
 	}
477 477
 
@@ -485,8 +485,8 @@  discard block
 block discarded – undo
485 485
 	*	@return void
486 486
 	*/
487 487
 	protected function _transaction_details() {
488
-		do_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction );
489
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
488
+		do_action('AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction);
489
+		EE_Registry::instance()->load_helper('MSG_Template');
490 490
 
491 491
 		$this->_set_transaction_status_array();
492 492
 
@@ -499,75 +499,75 @@  discard block
 block discarded – undo
499 499
 		$attendee = $primary_registration instanceof EE_Registration ? $primary_registration->attendee() : NULL;
500 500
 
501 501
 		$this->_template_args['txn_nmbr']['value'] = $this->_transaction->ID();
502
-		$this->_template_args['txn_nmbr']['label'] = __( 'Transaction Number', 'event_espresso' );
502
+		$this->_template_args['txn_nmbr']['label'] = __('Transaction Number', 'event_espresso');
503 503
 
504
-		$this->_template_args['txn_datetime']['value'] = $this->_transaction->get_datetime('TXN_timestamp', 'l F j, Y', 'g:i:s a' );
505
-		$this->_template_args['txn_datetime']['label'] = __( 'Date', 'event_espresso' );
504
+		$this->_template_args['txn_datetime']['value'] = $this->_transaction->get_datetime('TXN_timestamp', 'l F j, Y', 'g:i:s a');
505
+		$this->_template_args['txn_datetime']['label'] = __('Date', 'event_espresso');
506 506
 
507
-		$this->_template_args['txn_status']['value'] = self::$_txn_status[ $this->_transaction->get('STS_ID') ];
508
-		$this->_template_args['txn_status']['label'] = __( 'Transaction Status', 'event_espresso' );
509
-		$this->_template_args['txn_status']['class'] = 'status-' . $this->_transaction->get('STS_ID');
507
+		$this->_template_args['txn_status']['value'] = self::$_txn_status[$this->_transaction->get('STS_ID')];
508
+		$this->_template_args['txn_status']['label'] = __('Transaction Status', 'event_espresso');
509
+		$this->_template_args['txn_status']['class'] = 'status-'.$this->_transaction->get('STS_ID');
510 510
 
511 511
 		$this->_template_args['grand_total'] = $this->_transaction->get('TXN_total');
512 512
 		$this->_template_args['total_paid'] = $this->_transaction->get('TXN_paid');
513 513
 
514
-		if ( $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_transactions_send_payment_reminder' ) ) {
515
-			EE_Registry::instance()->load_helper( 'MSG_Template' );
516
-			$this->_template_args['send_payment_reminder_button'] = EEH_MSG_Template::is_mt_active( 'payment_reminder' )
514
+		if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder')) {
515
+			EE_Registry::instance()->load_helper('MSG_Template');
516
+			$this->_template_args['send_payment_reminder_button'] = EEH_MSG_Template::is_mt_active('payment_reminder')
517 517
 				 && $this->_transaction->get('STS_ID') != EEM_Transaction::complete_status_code
518 518
 				 && $this->_transaction->get('STS_ID') != EEM_Transaction::overpaid_status_code
519
-				 ? 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' )
519
+				 ? 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')
520 520
 				 : '';
521 521
 		} else {
522 522
 			$this->_template_args['send_payment_reminder_button'] = '';
523 523
 		}
524 524
 
525 525
 		$amount_due = $this->_transaction->get('TXN_total') - $this->_transaction->get('TXN_paid');
526
-		$this->_template_args['amount_due'] = EEH_Template::format_currency( $amount_due, TRUE );
527
-		if ( EE_Registry::instance()->CFG->currency->sign_b4 ) {
528
-			$this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign . $this->_template_args['amount_due'];
526
+		$this->_template_args['amount_due'] = EEH_Template::format_currency($amount_due, TRUE);
527
+		if (EE_Registry::instance()->CFG->currency->sign_b4) {
528
+			$this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign.$this->_template_args['amount_due'];
529 529
 		} else {
530
-			$this->_template_args['amount_due'] = $this->_template_args['amount_due'] . EE_Registry::instance()->CFG->currency->sign;
530
+			$this->_template_args['amount_due'] = $this->_template_args['amount_due'].EE_Registry::instance()->CFG->currency->sign;
531 531
 		}
532
-		$this->_template_args['amount_due_class'] =  '';
532
+		$this->_template_args['amount_due_class'] = '';
533 533
 
534
-		if ( $this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total') ) {
534
+		if ($this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total')) {
535 535
 			// paid in full
536
-			$this->_template_args['amount_due'] =  FALSE;
537
-		} elseif ( $this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total') ) {
536
+			$this->_template_args['amount_due'] = FALSE;
537
+		} elseif ($this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total')) {
538 538
 			// overpaid
539
-			$this->_template_args['amount_due_class'] =  'txn-overview-no-payment-spn';
540
-		} elseif (( $this->_transaction->get('TXN_total') > 0 ) && ( $this->_transaction->get('TXN_paid') > 0 )) {
539
+			$this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn';
540
+		} elseif (($this->_transaction->get('TXN_total') > 0) && ($this->_transaction->get('TXN_paid') > 0)) {
541 541
 			// monies owing
542
-			$this->_template_args['amount_due_class'] =  'txn-overview-part-payment-spn';
543
-		} elseif (( $this->_transaction->get('TXN_total') > 0 ) && ( $this->_transaction->get('TXN_paid') == 0 )) {
542
+			$this->_template_args['amount_due_class'] = 'txn-overview-part-payment-spn';
543
+		} elseif (($this->_transaction->get('TXN_total') > 0) && ($this->_transaction->get('TXN_paid') == 0)) {
544 544
 			// no payments made yet
545
-			$this->_template_args['amount_due_class'] =  'txn-overview-no-payment-spn';
546
-		} elseif ( $this->_transaction->get('TXN_total') == 0 ) {
545
+			$this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn';
546
+		} elseif ($this->_transaction->get('TXN_total') == 0) {
547 547
 			// free event
548
-			$this->_template_args['amount_due'] =  FALSE;
548
+			$this->_template_args['amount_due'] = FALSE;
549 549
 		}
550 550
 
551 551
 		$payment_method = $this->_transaction->payment_method();
552 552
 
553
-		$this->_template_args['method_of_payment_name'] = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() : __( 'Unknown', 'event_espresso' );
553
+		$this->_template_args['method_of_payment_name'] = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() : __('Unknown', 'event_espresso');
554 554
 		$this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
555 555
 		// link back to overview
556
-		$this->_template_args['txn_overview_url'] = ! empty ( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : TXN_ADMIN_URL;
556
+		$this->_template_args['txn_overview_url'] = ! empty ($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : TXN_ADMIN_URL;
557 557
 
558 558
 
559 559
 		//next and previous links
560
-		$next_txn = $this->_transaction->next(null, array( array( 'STS_ID' => array( '!=', EEM_Transaction::failed_status_code ) ) ), 'TXN_ID' );
561
-		$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' ) : '';
562
-		$previous_txn = $this->_transaction->previous( null, array( array( 'STS_ID' => array( '!=', EEM_Transaction::failed_status_code ) ) ), 'TXN_ID' );
563
-		$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' ) : '';
560
+		$next_txn = $this->_transaction->next(null, array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))), 'TXN_ID');
561
+		$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') : '';
562
+		$previous_txn = $this->_transaction->previous(null, array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))), 'TXN_ID');
563
+		$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') : '';
564 564
 
565 565
 
566 566
 		// grab messages at the last second
567 567
 		$this->_template_args['notices'] = EE_Error::get_notices();
568 568
 		// path to template
569
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_header.template.php';
570
-		$this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
569
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_header.template.php';
570
+		$this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
571 571
 
572 572
 		// the details template wrapper
573 573
 		$this->display_admin_page_with_sidebar();
@@ -586,18 +586,18 @@  discard block
 block discarded – undo
586 586
 
587 587
 		$this->_set_transaction_object();
588 588
 
589
-		add_meta_box( 'edit-txn-details-mbox', __( 'Transaction Details', 'event_espresso' ), array( $this, 'txn_details_meta_box' ), $this->_wp_page_slug, 'normal', 'high' );
589
+		add_meta_box('edit-txn-details-mbox', __('Transaction Details', 'event_espresso'), array($this, 'txn_details_meta_box'), $this->_wp_page_slug, 'normal', 'high');
590 590
 		add_meta_box(
591 591
 			'edit-txn-attendees-mbox',
592
-			__( 'Attendees Registered in this Transaction', 'event_espresso' ),
593
-			array( $this, 'txn_attendees_meta_box' ),
592
+			__('Attendees Registered in this Transaction', 'event_espresso'),
593
+			array($this, 'txn_attendees_meta_box'),
594 594
 			$this->_wp_page_slug,
595 595
 			'normal',
596 596
 			'high',
597
-			array( 'TXN_ID' => $this->_transaction->ID() )
597
+			array('TXN_ID' => $this->_transaction->ID())
598 598
 		);
599
-		add_meta_box( 'edit-txn-registrant-mbox', __( 'Primary Contact', 'event_espresso' ), array( $this, 'txn_registrant_side_meta_box' ), $this->_wp_page_slug, 'side', 'high' );
600
-		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' );
599
+		add_meta_box('edit-txn-registrant-mbox', __('Primary Contact', 'event_espresso'), array($this, 'txn_registrant_side_meta_box'), $this->_wp_page_slug, 'side', 'high');
600
+		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');
601 601
 
602 602
 	}
603 603
 
@@ -618,15 +618,15 @@  discard block
 block discarded – undo
618 618
 
619 619
 		//get line table
620 620
 		EEH_Autoloader::register_line_item_display_autoloaders();
621
-		$Line_Item_Display = new EE_Line_Item_Display( 'admin_table', 'EE_Admin_Table_Line_Item_Display_Strategy' );
622
-		$this->_template_args['line_item_table'] = $Line_Item_Display->display_line_item( $this->_transaction->total_line_item() );
621
+		$Line_Item_Display = new EE_Line_Item_Display('admin_table', 'EE_Admin_Table_Line_Item_Display_Strategy');
622
+		$this->_template_args['line_item_table'] = $Line_Item_Display->display_line_item($this->_transaction->total_line_item());
623 623
 		$this->_template_args['REG_code'] = $this->_transaction->get_first_related('Registration')->get('REG_code');
624 624
 
625 625
 		// process taxes
626
-		$taxes = $this->_transaction->get_many_related( 'Line_Item', array( array( 'LIN_type' => EEM_Line_Item::type_tax )));
627
-		$this->_template_args['taxes'] = ! empty( $taxes ) ? $taxes : FALSE;
626
+		$taxes = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => EEM_Line_Item::type_tax)));
627
+		$this->_template_args['taxes'] = ! empty($taxes) ? $taxes : FALSE;
628 628
 
629
-		$this->_template_args['grand_total'] = EEH_Template::format_currency($this->_transaction->get('TXN_total'), FALSE, FALSE );
629
+		$this->_template_args['grand_total'] = EEH_Template::format_currency($this->_transaction->get('TXN_total'), FALSE, FALSE);
630 630
 		$this->_template_args['grand_raw_total'] = $this->_transaction->get('TXN_total');
631 631
 		$this->_template_args['TXN_status'] = $this->_transaction->get('STS_ID');
632 632
 
@@ -634,63 +634,63 @@  discard block
 block discarded – undo
634 634
 
635 635
 		// process payment details
636 636
 		$payments = $this->_transaction->get_many_related('Payment');
637
-		if( ! empty(  $payments ) ) {
638
-			$this->_template_args[ 'payments' ] = $payments;
639
-			$this->_template_args[ 'existing_reg_payments' ] = $this->_get_registration_payment_IDs( $payments );
637
+		if ( ! empty($payments)) {
638
+			$this->_template_args['payments'] = $payments;
639
+			$this->_template_args['existing_reg_payments'] = $this->_get_registration_payment_IDs($payments);
640 640
 		} else {
641
-			$this->_template_args[ 'payments' ] = false;
642
-			$this->_template_args[ 'existing_reg_payments' ] = array();
641
+			$this->_template_args['payments'] = false;
642
+			$this->_template_args['existing_reg_payments'] = array();
643 643
 		}
644 644
 
645
-		$this->_template_args['edit_payment_url'] = add_query_arg( array( 'action' => 'edit_payment'  ), TXN_ADMIN_URL );
646
-		$this->_template_args['delete_payment_url'] = add_query_arg( array( 'action' => 'espresso_delete_payment' ), TXN_ADMIN_URL );
645
+		$this->_template_args['edit_payment_url'] = add_query_arg(array('action' => 'edit_payment'), TXN_ADMIN_URL);
646
+		$this->_template_args['delete_payment_url'] = add_query_arg(array('action' => 'espresso_delete_payment'), TXN_ADMIN_URL);
647 647
 
648
-		if ( isset( $txn_details['invoice_number'] )) {
648
+		if (isset($txn_details['invoice_number'])) {
649 649
 			$this->_template_args['txn_details']['invoice_number']['value'] = $this->_template_args['REG_code'];
650
-			$this->_template_args['txn_details']['invoice_number']['label'] = __( 'Invoice Number', 'event_espresso' );
650
+			$this->_template_args['txn_details']['invoice_number']['label'] = __('Invoice Number', 'event_espresso');
651 651
 		}
652 652
 
653 653
 		$this->_template_args['txn_details']['registration_session']['value'] = $this->_transaction->get_first_related('Registration')->get('REG_session');
654
-		$this->_template_args['txn_details']['registration_session']['label'] = __( 'Registration Session', 'event_espresso' );
654
+		$this->_template_args['txn_details']['registration_session']['label'] = __('Registration Session', 'event_espresso');
655 655
 
656
-		$this->_template_args['txn_details']['ip_address']['value'] = isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '';
657
-		$this->_template_args['txn_details']['ip_address']['label'] = __( 'Transaction placed from IP', 'event_espresso' );
656
+		$this->_template_args['txn_details']['ip_address']['value'] = isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '';
657
+		$this->_template_args['txn_details']['ip_address']['label'] = __('Transaction placed from IP', 'event_espresso');
658 658
 
659
-		$this->_template_args['txn_details']['user_agent']['value'] = isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '';
660
-		$this->_template_args['txn_details']['user_agent']['label'] = __( 'Registrant User Agent', 'event_espresso' );
659
+		$this->_template_args['txn_details']['user_agent']['value'] = isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '';
660
+		$this->_template_args['txn_details']['user_agent']['label'] = __('Registrant User Agent', 'event_espresso');
661 661
 
662 662
 		$reg_steps = '<ul>';
663
-		foreach ( $this->_transaction->reg_steps() as $reg_step => $reg_step_status ) {
664
-			if ( $reg_step_status === true ) {
665
-				$reg_steps .= '<li style="color:#70cc50">' . sprintf( __( '%1$s : Completed', 'event_espresso' ), ucwords( str_replace( '_', ' ', $reg_step ) ) ) . '</li>';
666
-			} else if ( is_numeric( $reg_step_status ) && $reg_step_status !== false ) {
667
-					$reg_steps .= '<li style="color:#2EA2CC">' . sprintf(
668
-							__( '%1$s : Initiated %2$s', 'event_espresso' ),
669
-							ucwords( str_replace( '_', ' ', $reg_step ) ),
670
-							gmdate( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), ( $reg_step_status + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) )
671
-						) . '</li>';
663
+		foreach ($this->_transaction->reg_steps() as $reg_step => $reg_step_status) {
664
+			if ($reg_step_status === true) {
665
+				$reg_steps .= '<li style="color:#70cc50">'.sprintf(__('%1$s : Completed', 'event_espresso'), ucwords(str_replace('_', ' ', $reg_step))).'</li>';
666
+			} else if (is_numeric($reg_step_status) && $reg_step_status !== false) {
667
+					$reg_steps .= '<li style="color:#2EA2CC">'.sprintf(
668
+							__('%1$s : Initiated %2$s', 'event_espresso'),
669
+							ucwords(str_replace('_', ' ', $reg_step)),
670
+							gmdate(get_option('date_format').' '.get_option('time_format'), ($reg_step_status + (get_option('gmt_offset') * HOUR_IN_SECONDS)))
671
+						).'</li>';
672 672
 				} else {
673
-				$reg_steps .= '<li style="color:#E76700">' . sprintf( __( '%1$s : Never Initiated', 'event_espresso' ), ucwords( str_replace( '_', ' ', $reg_step ) ) ) . '</li>';
673
+				$reg_steps .= '<li style="color:#E76700">'.sprintf(__('%1$s : Never Initiated', 'event_espresso'), ucwords(str_replace('_', ' ', $reg_step))).'</li>';
674 674
 			}
675 675
 		}
676 676
 		$reg_steps .= '</ul>';
677 677
 		$this->_template_args['txn_details']['reg_steps']['value'] = $reg_steps;
678
-		$this->_template_args['txn_details']['reg_steps']['label'] = __( 'Registration Step Progress', 'event_espresso' );
678
+		$this->_template_args['txn_details']['reg_steps']['label'] = __('Registration Step Progress', 'event_espresso');
679 679
 
680 680
 
681 681
 		$this->_get_registrations_to_apply_payment_to();
682
-		$this->_get_payment_methods( $payments );
682
+		$this->_get_payment_methods($payments);
683 683
 		$this->_get_payment_status_array();
684 684
 		$this->_get_reg_status_selection(); //sets up the template args for the reg status array for the transaction.
685 685
 
686
-		$this->_template_args['transaction_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'transaction'  ), TXN_ADMIN_URL );
687
-		$this->_template_args['apply_payment_form_url'] = add_query_arg( array( 'page' => 'espresso_transactions', 'action' => 'espresso_apply_payment' ), WP_AJAX_URL );
688
-		$this->_template_args['delete_payment_form_url'] = add_query_arg( array( 'page' => 'espresso_transactions', 'action' => 'espresso_delete_payment' ), WP_AJAX_URL );
686
+		$this->_template_args['transaction_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'transaction'), TXN_ADMIN_URL);
687
+		$this->_template_args['apply_payment_form_url'] = add_query_arg(array('page' => 'espresso_transactions', 'action' => 'espresso_apply_payment'), WP_AJAX_URL);
688
+		$this->_template_args['delete_payment_form_url'] = add_query_arg(array('page' => 'espresso_transactions', 'action' => 'espresso_delete_payment'), WP_AJAX_URL);
689 689
 
690 690
 		// 'espresso_delete_payment_nonce'
691 691
 
692
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_main_meta_box_txn_details.template.php';
693
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
692
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_main_meta_box_txn_details.template.php';
693
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
694 694
 
695 695
 	}
696 696
 
@@ -705,27 +705,27 @@  discard block
 block discarded – undo
705 705
 	 * @param EE_Payment[] $payments
706 706
 	 * @return array
707 707
 	 */
708
-	protected function _get_registration_payment_IDs( $payments = array() ) {
708
+	protected function _get_registration_payment_IDs($payments = array()) {
709 709
 		$existing_reg_payments = array();
710 710
 		// get all reg payments for these payments
711
-		$reg_payments = EEM_Registration_Payment::instance()->get_all( array(
711
+		$reg_payments = EEM_Registration_Payment::instance()->get_all(array(
712 712
 			array(
713 713
 				'PAY_ID' => array(
714 714
 					'IN',
715
-					array_keys( $payments )
715
+					array_keys($payments)
716 716
 				)
717 717
 			)
718
-		) );
719
-		if ( ! empty( $reg_payments ) ) {
720
-			foreach ( $payments as $payment ) {
721
-				if ( ! $payment instanceof EE_Payment ) {
718
+		));
719
+		if ( ! empty($reg_payments)) {
720
+			foreach ($payments as $payment) {
721
+				if ( ! $payment instanceof EE_Payment) {
722 722
 					continue;
723
-				} else if ( ! isset( $existing_reg_payments[ $payment->ID() ] ) ) {
724
-					$existing_reg_payments[ $payment->ID() ] = array();
723
+				} else if ( ! isset($existing_reg_payments[$payment->ID()])) {
724
+					$existing_reg_payments[$payment->ID()] = array();
725 725
 				}
726
-				foreach ( $reg_payments as $reg_payment ) {
727
-					if ( $reg_payment instanceof EE_Registration_Payment && $reg_payment->payment_ID() === $payment->ID() ) {
728
-						$existing_reg_payments[ $payment->ID() ][ ] = $reg_payment->registration_ID();
726
+				foreach ($reg_payments as $reg_payment) {
727
+					if ($reg_payment instanceof EE_Registration_Payment && $reg_payment->payment_ID() === $payment->ID()) {
728
+						$existing_reg_payments[$payment->ID()][] = $reg_payment->registration_ID();
729 729
 					}
730 730
 				}
731 731
 			}
@@ -762,39 +762,39 @@  discard block
 block discarded – undo
762 762
 		$registrations_to_apply_payment_to .= '<br /><div class="admin-primary-mbox-tbl-wrap">';
763 763
 		$registrations_to_apply_payment_to .= '<table class="admin-primary-mbox-tbl">';
764 764
 		$registrations_to_apply_payment_to .= '<thead><tr>';
765
-		$registrations_to_apply_payment_to .= '<td>' . __( 'ID', 'event_espresso' ) . '</td>';
766
-		$registrations_to_apply_payment_to .= '<td>' . __( 'Registrant', 'event_espresso' ) . '</td>';
767
-		$registrations_to_apply_payment_to .= '<td>' . __( 'Ticket', 'event_espresso' ) . '</td>';
768
-		$registrations_to_apply_payment_to .= '<td>' . __( 'Event', 'event_espresso' ) . '</td>';
769
-		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-cntr">' . __( 'Paid', 'event_espresso' ) . '</td>';
770
-		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-cntr">' . __( 'Owing', 'event_espresso' ) . '</td>';
771
-		$registrations_to_apply_payment_to .= '<td class="jst-cntr">' . __( 'Apply', 'event_espresso' ) . '</td>';
765
+		$registrations_to_apply_payment_to .= '<td>'.__('ID', 'event_espresso').'</td>';
766
+		$registrations_to_apply_payment_to .= '<td>'.__('Registrant', 'event_espresso').'</td>';
767
+		$registrations_to_apply_payment_to .= '<td>'.__('Ticket', 'event_espresso').'</td>';
768
+		$registrations_to_apply_payment_to .= '<td>'.__('Event', 'event_espresso').'</td>';
769
+		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-cntr">'.__('Paid', 'event_espresso').'</td>';
770
+		$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-cntr">'.__('Owing', 'event_espresso').'</td>';
771
+		$registrations_to_apply_payment_to .= '<td class="jst-cntr">'.__('Apply', 'event_espresso').'</td>';
772 772
 		$registrations_to_apply_payment_to .= '</tr></thead><tbody>';
773 773
 		// get registrations for TXN
774
-		$registrations = $this->_transaction->registrations( $query_params );
775
-		foreach ( $registrations as $registration ) {
776
-			if ( $registration instanceof EE_Registration ) {
774
+		$registrations = $this->_transaction->registrations($query_params);
775
+		foreach ($registrations as $registration) {
776
+			if ($registration instanceof EE_Registration) {
777 777
 				$owing = $registration->final_price() - $registration->paid();
778
-				$taxable = $registration->ticket()->taxable() ? ' <span class="smaller-text lt-grey-text"> ' . __( '+ tax', 'event_espresso' ) . '</span>' : '';
779
-				$checked = empty( $existing_reg_payments ) || in_array( $registration->ID(), $existing_reg_payments ) ? ' checked="checked"' : '';
778
+				$taxable = $registration->ticket()->taxable() ? ' <span class="smaller-text lt-grey-text"> '.__('+ tax', 'event_espresso').'</span>' : '';
779
+				$checked = empty($existing_reg_payments) || in_array($registration->ID(), $existing_reg_payments) ? ' checked="checked"' : '';
780 780
 				$registrations_to_apply_payment_to .= '<tr>';
781 781
 				// add html for checkbox input and label
782
-				$registrations_to_apply_payment_to .= '<td>' . $registration->ID() . '</td>';
783
-				$registrations_to_apply_payment_to .= '<td>' . $registration->attendee()->full_name() . '</td>';
784
-				$registrations_to_apply_payment_to .= '<td>' . $registration->ticket()->name() . ' : ' . $registration->ticket()->pretty_price() . $taxable . '</td>';
785
-				$registrations_to_apply_payment_to .= '<td>' . $registration->event_name() . '</td>';
786
-				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-rght">' . $registration->pretty_paid() . '</td>';
787
-				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-rght">' . EEH_Template::format_currency( $owing ) . '</td>';
782
+				$registrations_to_apply_payment_to .= '<td>'.$registration->ID().'</td>';
783
+				$registrations_to_apply_payment_to .= '<td>'.$registration->attendee()->full_name().'</td>';
784
+				$registrations_to_apply_payment_to .= '<td>'.$registration->ticket()->name().' : '.$registration->ticket()->pretty_price().$taxable.'</td>';
785
+				$registrations_to_apply_payment_to .= '<td>'.$registration->event_name().'</td>';
786
+				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-paid-td jst-rght">'.$registration->pretty_paid().'</td>';
787
+				$registrations_to_apply_payment_to .= '<td class="txn-admin-payment-owing-td jst-rght">'.EEH_Template::format_currency($owing).'</td>';
788 788
 				$registrations_to_apply_payment_to .= '<td class="jst-cntr">';
789 789
 				$disabled = $registration->final_price() > 0 ? '' : ' disabled';
790
-				$registrations_to_apply_payment_to .= '<input type="checkbox" value="' . $registration->ID() . '" name="txn_admin_payment[registrations]"' . $checked . $disabled . '>';
790
+				$registrations_to_apply_payment_to .= '<input type="checkbox" value="'.$registration->ID().'" name="txn_admin_payment[registrations]"'.$checked.$disabled.'>';
791 791
 				$registrations_to_apply_payment_to .= '</td>';
792 792
 				$registrations_to_apply_payment_to .= '</tr>';
793 793
 			}
794 794
 		}
795 795
 		$registrations_to_apply_payment_to .= '</tbody></table></div>';
796
-		$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>';
797
-		$this->_template_args[ 'registrations_to_apply_payment_to' ] = $registrations_to_apply_payment_to;
796
+		$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>';
797
+		$this->_template_args['registrations_to_apply_payment_to'] = $registrations_to_apply_payment_to;
798 798
 	}
799 799
 
800 800
 
@@ -811,9 +811,9 @@  discard block
 block discarded – undo
811 811
 		$statuses = EEM_Registration::reg_status_array(array(), TRUE);
812 812
 		//let's add a "don't change" option.
813 813
 		$status_array['NAN'] = __('Leave the Same', 'event_espresso');
814
-		$status_array = array_merge( $status_array, $statuses );
815
-		$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' );
816
-		$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' );
814
+		$status_array = array_merge($status_array, $statuses);
815
+		$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');
816
+		$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');
817 817
 
818 818
 	}
819 819
 
@@ -828,21 +828,21 @@  discard block
 block discarded – undo
828 828
 	 * @param EE_Payment[] to show on this page
829 829
 	 *	@return void
830 830
 	 */
831
-	private function _get_payment_methods( $payments = array() ) {
831
+	private function _get_payment_methods($payments = array()) {
832 832
 		$payment_methods_of_payments = array();
833
-		foreach( $payments as $payment ){
834
-			if( $payment instanceof EE_Payment ){
835
-				$payment_methods_of_payments[] = $payment->get( 'PMD_ID' );
833
+		foreach ($payments as $payment) {
834
+			if ($payment instanceof EE_Payment) {
835
+				$payment_methods_of_payments[] = $payment->get('PMD_ID');
836 836
 			}
837 837
 		}
838
-		if( $payment_methods_of_payments ){
839
-			$query_args = array( array( 'OR*payment_method_for_payment' => array(
840
-					'PMD_ID' => array( 'IN', $payment_methods_of_payments ),
841
-					'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) ) );
842
-		}else{
843
-			$query_args = array( array( 'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) );
838
+		if ($payment_methods_of_payments) {
839
+			$query_args = array(array('OR*payment_method_for_payment' => array(
840
+					'PMD_ID' => array('IN', $payment_methods_of_payments),
841
+					'PMD_scope' => array('LIKE', '%'.EEM_Payment_Method::scope_admin.'%') )));
842
+		} else {
843
+			$query_args = array(array('PMD_scope' => array('LIKE', '%'.EEM_Payment_Method::scope_admin.'%')));
844 844
 		}
845
-		$this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all( $query_args );
845
+		$this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all($query_args);
846 846
 	}
847 847
 
848 848
 
@@ -856,46 +856,46 @@  discard block
 block discarded – undo
856 856
 	 * @param array $metabox
857 857
 	 * @return void
858 858
 	 */
859
-	public function txn_attendees_meta_box( $post, $metabox = array( 'args' => array() )) {
859
+	public function txn_attendees_meta_box($post, $metabox = array('args' => array())) {
860 860
 
861
-		extract( $metabox['args'] );
861
+		extract($metabox['args']);
862 862
 		$this->_template_args['post'] = $post;
863 863
 		$this->_template_args['event_attendees'] = array();
864 864
 		// process items in cart
865
-		$line_items = $this->_transaction->get_many_related('Line_Item', array( array( 'LIN_type' => 'line-item' ) ) );
866
-		if ( ! empty( $line_items )) {
867
-			foreach ( $line_items as $item ) {
868
-				if ( $item instanceof EE_Line_Item ) {
869
-					switch( $item->OBJ_type() ) {
865
+		$line_items = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => 'line-item')));
866
+		if ( ! empty($line_items)) {
867
+			foreach ($line_items as $item) {
868
+				if ($item instanceof EE_Line_Item) {
869
+					switch ($item->OBJ_type()) {
870 870
 
871 871
 						case 'Event' :
872 872
 							break;
873 873
 
874 874
 						case 'Ticket' :
875 875
 							$ticket = $item->ticket();
876
-							if ( empty( $ticket )) {
876
+							if (empty($ticket)) {
877 877
 								continue; //right now we're only handling tickets here.  Cause its expected that only tickets will have attendees right?
878 878
 							}
879
-							$ticket_price = EEH_Template::format_currency( $item->get( 'LIN_unit_price' ));
879
+							$ticket_price = EEH_Template::format_currency($item->get('LIN_unit_price'));
880 880
 							$event = $ticket->get_first_related('Registration')->get_first_related('Event');
881
-							$event_name = $event instanceof EE_Event ? $event->get('EVT_name') . ' - ' . $item->get('LIN_name') : '';
881
+							$event_name = $event instanceof EE_Event ? $event->get('EVT_name').' - '.$item->get('LIN_name') : '';
882 882
 
883
-							$registrations = $ticket->get_many_related('Registration', array( array('TXN_ID' => $this->_transaction->ID() )));
884
-							foreach( $registrations as $registration ) {
885
-								$this->_template_args['event_attendees'][$registration->ID()]['att_num'] 						= $registration->get('REG_count');
886
-								$this->_template_args['event_attendees'][$registration->ID()]['event_ticket_name'] 	= $event_name;
887
-								$this->_template_args['event_attendees'][$registration->ID()]['ticket_price'] 				= $ticket_price;
883
+							$registrations = $ticket->get_many_related('Registration', array(array('TXN_ID' => $this->_transaction->ID())));
884
+							foreach ($registrations as $registration) {
885
+								$this->_template_args['event_attendees'][$registration->ID()]['att_num'] = $registration->get('REG_count');
886
+								$this->_template_args['event_attendees'][$registration->ID()]['event_ticket_name'] = $event_name;
887
+								$this->_template_args['event_attendees'][$registration->ID()]['ticket_price'] = $ticket_price;
888 888
 								// attendee info
889 889
 								$attendee = $registration->get_first_related('Attendee');
890
-								if ( $attendee instanceof EE_Attendee ) {
890
+								if ($attendee instanceof EE_Attendee) {
891 891
 									$this->_template_args['event_attendees'][$registration->ID()]['att_id'] 			= $attendee->ID();
892 892
 									$this->_template_args['event_attendees'][$registration->ID()]['attendee'] 	= $attendee->full_name();
893
-									$this->_template_args['event_attendees'][$registration->ID()]['email'] 			= '<a href="mailto:' . $attendee->email() . '?subject=' . $event->get('EVT_name') . __(' Event', 'event_espresso') . '">' . $attendee->email() . '</a>';
894
-									$this->_template_args['event_attendees'][$registration->ID()]['address'] 		=  implode(',<br>', $attendee->full_address_as_array() );
893
+									$this->_template_args['event_attendees'][$registration->ID()]['email'] = '<a href="mailto:'.$attendee->email().'?subject='.$event->get('EVT_name').__(' Event', 'event_espresso').'">'.$attendee->email().'</a>';
894
+									$this->_template_args['event_attendees'][$registration->ID()]['address'] 		= implode(',<br>', $attendee->full_address_as_array());
895 895
 								} else {
896 896
 									$this->_template_args['event_attendees'][$registration->ID()]['att_id'] 			= '';
897 897
 									$this->_template_args['event_attendees'][$registration->ID()]['attendee'] 	= '';
898
-									$this->_template_args['event_attendees'][$registration->ID()]['email'] 			= '';
898
+									$this->_template_args['event_attendees'][$registration->ID()]['email'] = '';
899 899
 									$this->_template_args['event_attendees'][$registration->ID()]['address'] 		= '';
900 900
 								}
901 901
 							}
@@ -905,12 +905,12 @@  discard block
 block discarded – undo
905 905
 				}
906 906
 			}
907 907
 
908
-			$this->_template_args['transaction_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'attendees'  ), TXN_ADMIN_URL );
909
-			echo EEH_Template::display_template( TXN_TEMPLATE_PATH . 'txn_admin_details_main_meta_box_attendees.template.php', $this->_template_args, TRUE );
908
+			$this->_template_args['transaction_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'attendees'), TXN_ADMIN_URL);
909
+			echo EEH_Template::display_template(TXN_TEMPLATE_PATH.'txn_admin_details_main_meta_box_attendees.template.php', $this->_template_args, TRUE);
910 910
 
911 911
 		} else {
912 912
 			echo sprintf(
913
-				__( '%1$sFor some reason, there are no attendees registered for this transaction. Likely the registration was abandoned in process.%2$s', 'event_espresso' ),
913
+				__('%1$sFor some reason, there are no attendees registered for this transaction. Likely the registration was abandoned in process.%2$s', 'event_espresso'),
914 914
 				'<p class="important-notice">',
915 915
 				'</p>'
916 916
 			);
@@ -929,20 +929,20 @@  discard block
 block discarded – undo
929 929
 	 */
930 930
 	public function txn_registrant_side_meta_box() {
931 931
 		$primary_att = $this->_transaction->primary_registration() instanceof EE_Registration ? $this->_transaction->primary_registration()->get_first_related('Attendee') : null;
932
-		if ( ! $primary_att instanceof EE_Attendee ) {
932
+		if ( ! $primary_att instanceof EE_Attendee) {
933 933
 			$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');
934 934
 			$primary_att = EEM_Attendee::instance()->create_default_object();
935 935
 		}
936
-		$this->_template_args['ATT_ID'] 						= $primary_att->ID();
936
+		$this->_template_args['ATT_ID'] = $primary_att->ID();
937 937
 		$this->_template_args['prime_reg_fname']		= $primary_att->fname();
938 938
 		$this->_template_args['prime_reg_lname']		= $primary_att->lname();
939
-		$this->_template_args['prime_reg_email'] 		= $primary_att->email();
939
+		$this->_template_args['prime_reg_email'] = $primary_att->email();
940 940
 		$this->_template_args['prime_reg_phone'] 	= $primary_att->phone();
941
-		$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 );
941
+		$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);
942 942
 		// get formatted address for registrant
943
-		EE_Registry::instance()->load_helper( 'Formatter' );
944
-		$this->_template_args[ 'formatted_address' ] = EEH_Address::format( $primary_att );
945
-		echo EEH_Template::display_template( TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE );
943
+		EE_Registry::instance()->load_helper('Formatter');
944
+		$this->_template_args['formatted_address'] = EEH_Address::format($primary_att);
945
+		echo EEH_Template::display_template(TXN_TEMPLATE_PATH.'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE);
946 946
 	}
947 947
 
948 948
 
@@ -957,10 +957,10 @@  discard block
 block discarded – undo
957 957
 	public function txn_billing_info_side_meta_box() {
958 958
 
959 959
 		$this->_template_args['billing_form'] = $this->_transaction->billing_info();
960
-		$this->_template_args['billing_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'billing'  ), TXN_ADMIN_URL );
960
+		$this->_template_args['billing_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'billing'), TXN_ADMIN_URL);
961 961
 
962
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_billing_info.template.php';
963
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );/**/
962
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_side_meta_box_billing_info.template.php';
963
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); /**/
964 964
 	}
965 965
 
966 966
 
@@ -974,9 +974,9 @@  discard block
 block discarded – undo
974 974
 	*/
975 975
 	public function apply_payments_or_refunds() {
976 976
 
977
-		$json_response_data = array( 'return_data' => FALSE );
977
+		$json_response_data = array('return_data' => FALSE);
978 978
 
979
-		if ( isset( $this->_req_data['txn_admin_payment'] ) && isset( $this->_req_data['txn_admin_payment']['TXN_ID'] )) {
979
+		if (isset($this->_req_data['txn_admin_payment']) && isset($this->_req_data['txn_admin_payment']['TXN_ID'])) {
980 980
 
981 981
 			//save  the new payment
982 982
 			$payment = EE_Payment::new_instance(
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
 					'PMD_ID' => $this->_req_data['txn_admin_payment']['PMD_ID'],
989 989
 					// payments have a type value of 1 and refunds have a type value of -1
990 990
 					// so multiplying amount by type will give a positive value for payments, and negative values for refunds
991
-					'PAY_amount' => $this->_req_data['txn_admin_payment']['type'] < 0 ? abs( $this->_req_data['txn_admin_payment']['amount'] ) * -1 : abs( $this->_req_data['txn_admin_payment']['amount'] ),
991
+					'PAY_amount' => $this->_req_data['txn_admin_payment']['type'] < 0 ? abs($this->_req_data['txn_admin_payment']['amount']) * -1 : abs($this->_req_data['txn_admin_payment']['amount']),
992 992
 					'PAY_gateway_response' => '',
993 993
 					'PAY_txn_id_chq_nmbr' => $this->_req_data['txn_admin_payment']['txn_id_chq_nmbr'],
994 994
 					'PAY_po_number' => $this->_req_data['txn_admin_payment']['po_number'],
@@ -997,77 +997,77 @@  discard block
 block discarded – undo
997 997
 					'PAY_ID' => $this->_req_data['txn_admin_payment']['PAY_ID']
998 998
 				),
999 999
 				'',
1000
-				array( 'Y-m-d', 'H:i a' )
1000
+				array('Y-m-d', 'H:i a')
1001 1001
 			);
1002 1002
 
1003
-			if ( ! $payment->save() ){
1004
-				$msg = __( 'An error occurred. The payment has not been processed successfully.', 'event_espresso' );
1005
-				EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
1003
+			if ( ! $payment->save()) {
1004
+				$msg = __('An error occurred. The payment has not been processed successfully.', 'event_espresso');
1005
+				EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1006 1006
 			}
1007 1007
 			// get the TXN for this payment
1008 1008
 			$transaction = $payment->transaction();
1009 1009
 			// verify transaction
1010
-			if ( $transaction instanceof EE_Transaction ) {
1010
+			if ($transaction instanceof EE_Transaction) {
1011 1011
 				/** @type EE_Transaction_Payments $transaction_payments */
1012
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1012
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1013 1013
 				//update the transaction with this payment
1014
-				if ( $transaction_payments->calculate_total_payments_and_update_status( $transaction )) {
1015
-					$msg =__('The payment has been processed successfully.', 'event_espresso');
1016
-					EE_Error::add_success( $msg, __FILE__, __FUNCTION__, __LINE__ );
1014
+				if ($transaction_payments->calculate_total_payments_and_update_status($transaction)) {
1015
+					$msg = __('The payment has been processed successfully.', 'event_espresso');
1016
+					EE_Error::add_success($msg, __FILE__, __FUNCTION__, __LINE__);
1017 1017
 				} else {
1018
-					$msg = __( 'The payment was processed successfully but the amount paid for the transaction was not updated.', 'event_espresso');
1019
-					EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
1018
+					$msg = __('The payment was processed successfully but the amount paid for the transaction was not updated.', 'event_espresso');
1019
+					EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1020 1020
 				}
1021 1021
 				//EEH_Debug_Tools::printr( $payment, '$payment', __FILE__, __LINE__ );
1022 1022
 				// grab array of IDs for registrations to apply changes to
1023
-				if ( isset( $this->_req_data[ 'txn_admin_payment' ][ 'registrations' ] ) ) {
1024
-					$REG_IDs = (array)$this->_req_data[ 'txn_admin_payment' ][ 'registrations' ];
1023
+				if (isset($this->_req_data['txn_admin_payment']['registrations'])) {
1024
+					$REG_IDs = (array) $this->_req_data['txn_admin_payment']['registrations'];
1025 1025
 				} else {
1026
-					$REG_IDs = $this->_get_existing_reg_payment_REG_IDs( $payment );
1026
+					$REG_IDs = $this->_get_existing_reg_payment_REG_IDs($payment);
1027 1027
 				}
1028
-				$this->_remove_non_applicable_registration_payments( $payment, $REG_IDs );
1028
+				$this->_remove_non_applicable_registration_payments($payment, $REG_IDs);
1029 1029
 				// apply payment to registrations (if applicable)
1030
-				if ( ! empty( $REG_IDs ) ) {
1030
+				if ( ! empty($REG_IDs)) {
1031 1031
 					//EEH_Debug_Tools::printr( $REG_IDs, '$REG_IDs', __FILE__, __LINE__ );
1032
-					$registration_query_where_params = array( 'REG_ID' => array( 'IN', $REG_IDs ) );
1033
-					$this->_process_updated_registration_payments( $transaction, $payment, $registration_query_where_params );
1032
+					$registration_query_where_params = array('REG_ID' => array('IN', $REG_IDs));
1033
+					$this->_process_updated_registration_payments($transaction, $payment, $registration_query_where_params);
1034 1034
 					// now process status changes for the same registrations
1035
-					if ( isset( $this->_req_data['txn_reg_status_change'] ) ) {
1036
-						$this->_process_registration_status_change( $transaction, array( $registration_query_where_params ) );
1035
+					if (isset($this->_req_data['txn_reg_status_change'])) {
1036
+						$this->_process_registration_status_change($transaction, array($registration_query_where_params));
1037 1037
 					}
1038 1038
 				}
1039 1039
 
1040
-				$this->_process_payment_notification( $payment );
1040
+				$this->_process_payment_notification($payment);
1041 1041
 
1042 1042
 				//prepare to render page
1043 1043
 				$this->_get_payment_status_array();
1044
-				$json_response_data[ 'return_data' ][ 'amount' ] = $payment->amount();
1045
-				$json_response_data[ 'return_data' ][ 'total_paid' ] = $transaction->paid();
1046
-				$json_response_data[ 'return_data' ][ 'txn_status' ] = $transaction->status_ID();
1047
-				$json_response_data[ 'return_data' ][ 'pay_status' ] = $payment->STS_ID();
1048
-				$json_response_data[ 'return_data' ][ 'PAY_ID' ] = $payment->ID();
1049
-				$json_response_data[ 'return_data' ][ 'STS_ID' ] = $payment->STS_ID();
1050
-				$json_response_data[ 'return_data' ][ 'status' ] = self::$_pay_status[ $payment->STS_ID() ];
1051
-				$json_response_data[ 'return_data' ][ 'date' ] = $payment->timestamp( 'Y-m-d', 'h:i a' );
1052
-				$json_response_data[ 'return_data' ][ 'method' ] = strtoupper( $payment->source() );
1053
-				$json_response_data[ 'return_data' ][ 'PM_ID' ] = $payment->payment_method() ? $payment->payment_method()->ID() : 1;
1054
-				$json_response_data[ 'return_data' ][ 'gateway' ] = $payment->payment_method() ? $payment->payment_method()->admin_name() : __( "Unknown", 'event_espresso' );
1055
-				$json_response_data[ 'return_data' ][ 'gateway_response' ] = $payment->gateway_response();
1056
-				$json_response_data[ 'return_data' ][ 'txn_id_chq_nmbr' ] = $payment->txn_id_chq_nmbr();
1057
-				$json_response_data[ 'return_data' ][ 'po_number' ] = $payment->po_number();
1058
-				$json_response_data[ 'return_data' ][ 'extra_accntng' ] = $payment->extra_accntng();
1044
+				$json_response_data['return_data']['amount'] = $payment->amount();
1045
+				$json_response_data['return_data']['total_paid'] = $transaction->paid();
1046
+				$json_response_data['return_data']['txn_status'] = $transaction->status_ID();
1047
+				$json_response_data['return_data']['pay_status'] = $payment->STS_ID();
1048
+				$json_response_data['return_data']['PAY_ID'] = $payment->ID();
1049
+				$json_response_data['return_data']['STS_ID'] = $payment->STS_ID();
1050
+				$json_response_data['return_data']['status'] = self::$_pay_status[$payment->STS_ID()];
1051
+				$json_response_data['return_data']['date'] = $payment->timestamp('Y-m-d', 'h:i a');
1052
+				$json_response_data['return_data']['method'] = strtoupper($payment->source());
1053
+				$json_response_data['return_data']['PM_ID'] = $payment->payment_method() ? $payment->payment_method()->ID() : 1;
1054
+				$json_response_data['return_data']['gateway'] = $payment->payment_method() ? $payment->payment_method()->admin_name() : __("Unknown", 'event_espresso');
1055
+				$json_response_data['return_data']['gateway_response'] = $payment->gateway_response();
1056
+				$json_response_data['return_data']['txn_id_chq_nmbr'] = $payment->txn_id_chq_nmbr();
1057
+				$json_response_data['return_data']['po_number'] = $payment->po_number();
1058
+				$json_response_data['return_data']['extra_accntng'] = $payment->extra_accntng();
1059 1059
 
1060 1060
 			} else {
1061
-				EE_Error::add_error( __( 'A valid Transaction for this payment could not be retrieved.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1061
+				EE_Error::add_error(__('A valid Transaction for this payment could not be retrieved.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1062 1062
 			}
1063 1063
 
1064 1064
 		} else {
1065
-			$msg = __( 'The payment form data could not be loaded.', 'event_espresso' );
1066
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
1065
+			$msg = __('The payment form data could not be loaded.', 'event_espresso');
1066
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1067 1067
 		}
1068 1068
 
1069
-		$notices = EE_Error::get_notices( FALSE, FALSE, FALSE );
1070
-		echo json_encode( array_merge( $json_response_data, $notices ));
1069
+		$notices = EE_Error::get_notices(FALSE, FALSE, FALSE);
1070
+		echo json_encode(array_merge($json_response_data, $notices));
1071 1071
 		die();
1072 1072
 
1073 1073
 	}
@@ -1083,14 +1083,14 @@  discard block
 block discarded – undo
1083 1083
 	 * @param \EE_Payment $payment
1084 1084
 	 * @return array
1085 1085
 	 */
1086
-	protected function _get_existing_reg_payment_REG_IDs( EE_Payment $payment ) {
1086
+	protected function _get_existing_reg_payment_REG_IDs(EE_Payment $payment) {
1087 1087
 		static $existing_reg_payment_REG_IDs = null;
1088 1088
 		//EEH_Debug_Tools::printr( $existing_reg_payment_REG_IDs, '$existing_reg_payment_REG_IDs', __FILE__, __LINE__ );
1089
-		if ( $existing_reg_payment_REG_IDs === null ) {
1089
+		if ($existing_reg_payment_REG_IDs === null) {
1090 1090
 			// let's get any existing reg payment records for this payment
1091
-			$existing_reg_payment_REG_IDs = $payment->get_many_related( 'Registration' );
1091
+			$existing_reg_payment_REG_IDs = $payment->get_many_related('Registration');
1092 1092
 			// but we only want the REG IDs, so grab the array keys
1093
-			$existing_reg_payment_REG_IDs = ! empty( $existing_reg_payment_REG_IDs ) ? array_keys( $existing_reg_payment_REG_IDs ) : array();
1093
+			$existing_reg_payment_REG_IDs = ! empty($existing_reg_payment_REG_IDs) ? array_keys($existing_reg_payment_REG_IDs) : array();
1094 1094
 		}
1095 1095
 		//EEH_Debug_Tools::printr( $existing_reg_payment_REG_IDs, '$existing_reg_payment_REG_IDs', __FILE__, __LINE__ );
1096 1096
 		return $existing_reg_payment_REG_IDs;
@@ -1111,20 +1111,20 @@  discard block
 block discarded – undo
1111 1111
 	 * @param \EE_Payment $payment
1112 1112
 	 * @param array $new_reg_payment_REG_IDs
1113 1113
 	 */
1114
-	protected function _remove_non_applicable_registration_payments( EE_Payment $payment, $new_reg_payment_REG_IDs = array() ) {
1115
-		$existing_reg_payment_REG_IDs = $this->_get_existing_reg_payment_REG_IDs( $payment );
1114
+	protected function _remove_non_applicable_registration_payments(EE_Payment $payment, $new_reg_payment_REG_IDs = array()) {
1115
+		$existing_reg_payment_REG_IDs = $this->_get_existing_reg_payment_REG_IDs($payment);
1116 1116
 		//EEH_Debug_Tools::printr( $existing_reg_payment_REG_IDs, '$existing_reg_payment_REG_IDs', __FILE__, __LINE__ );
1117 1117
 		// registrations that were unchecked ( ie: NOT in the $REG_IDs array ) need to have existing reg payments removed
1118
-		$reg_payment_REG_IDs_to_remove = array_diff( $existing_reg_payment_REG_IDs, $new_reg_payment_REG_IDs );
1118
+		$reg_payment_REG_IDs_to_remove = array_diff($existing_reg_payment_REG_IDs, $new_reg_payment_REG_IDs);
1119 1119
 		//EEH_Debug_Tools::printr( $reg_payment_REG_IDs_to_remove, '$reg_payment_REG_IDs_to_remove', __FILE__, __LINE__ );
1120 1120
 		/** @type EE_Transaction_Payments $transaction_payments */
1121
-		$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1121
+		$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1122 1122
 		$transaction_payments->delete_registration_payments_and_update_registrations(
1123 1123
 			$payment,
1124 1124
 			array(
1125 1125
 				array(
1126 1126
 					'PAY_ID' => $payment->ID(),
1127
-					'REG_ID' => array( 'IN', $reg_payment_REG_IDs_to_remove )
1127
+					'REG_ID' => array('IN', $reg_payment_REG_IDs_to_remove)
1128 1128
 				)
1129 1129
 			)
1130 1130
 		);
@@ -1143,26 +1143,26 @@  discard block
 block discarded – undo
1143 1143
 	 * @param array $registration_query_where_params
1144 1144
 	 * @return bool
1145 1145
 	 */
1146
-	protected function _process_updated_registration_payments( EE_Transaction $transaction, EE_Payment $payment, $registration_query_where_params = array() ) {
1146
+	protected function _process_updated_registration_payments(EE_Transaction $transaction, EE_Payment $payment, $registration_query_where_params = array()) {
1147 1147
 		// we can pass our own custom set of registrations to EE_Payment_Processor::process_registration_payments()
1148 1148
 		// so let's do that using our set of REG_IDs from the form, but add in some conditions regarding payment
1149 1149
 		// so that we don't apply payments to registrations that are free or have already been paid for
1150 1150
 		// but ONLY if the payment is NOT a refund ( ie: the payment amount is not negative )
1151
-		if ( ! $payment->is_a_refund() ) {
1151
+		if ( ! $payment->is_a_refund()) {
1152 1152
 			$registration_query_where_params = array_merge(
1153 1153
 				$registration_query_where_params,
1154 1154
 				array(
1155
-					'REG_final_price'  => array( '!=', 0 ),
1156
-					'REG_final_price*' => array( '!=', 'REG_paid', true ),
1155
+					'REG_final_price'  => array('!=', 0),
1156
+					'REG_final_price*' => array('!=', 'REG_paid', true),
1157 1157
 				)
1158 1158
 			);
1159 1159
 		}
1160
-		$registrations = $transaction->registrations( array( $registration_query_where_params ) );
1160
+		$registrations = $transaction->registrations(array($registration_query_where_params));
1161 1161
 		//EEH_Debug_Tools::printr( $registrations, '$registrations', __FILE__, __LINE__ );
1162
-		if ( ! empty( $registrations ) ) {
1162
+		if ( ! empty($registrations)) {
1163 1163
 			/** @type EE_Payment_Processor $payment_processor */
1164
-			$payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' );
1165
-			$payment_processor->process_registration_payments( $transaction, $payment, $registrations );
1164
+			$payment_processor = EE_Registry::instance()->load_core('Payment_Processor');
1165
+			$payment_processor->process_registration_payments($transaction, $payment, $registrations);
1166 1166
 		}
1167 1167
 	}
1168 1168
 
@@ -1178,16 +1178,16 @@  discard block
 block discarded – undo
1178 1178
 	 * @param array $registration_query_params
1179 1179
 	 * @return bool
1180 1180
 	 */
1181
-	protected function _process_registration_status_change( EE_Transaction $transaction, $registration_query_params = array() ) {
1181
+	protected function _process_registration_status_change(EE_Transaction $transaction, $registration_query_params = array()) {
1182 1182
 		// first if there is no change in status then we get out.
1183
-		if ( ! isset( $this->_req_data['txn_reg_status_change'], $this->_req_data[ 'txn_reg_status_change' ][ 'reg_status' ] ) || $this->_req_data['txn_reg_status_change']['reg_status'] == 'NAN' ) {
1183
+		if ( ! isset($this->_req_data['txn_reg_status_change'], $this->_req_data['txn_reg_status_change']['reg_status']) || $this->_req_data['txn_reg_status_change']['reg_status'] == 'NAN') {
1184 1184
 			//no error message, no change requested, just nothing to do man.
1185 1185
 			return FALSE;
1186 1186
 		}
1187 1187
 		/** @type EE_Transaction_Processor $transaction_processor */
1188
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1188
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1189 1189
 		// made it here dude?  Oh WOW.  K, let's take care of changing the statuses
1190
-		return $transaction_processor->manually_update_registration_statuses( $transaction, sanitize_text_field( $this->_req_data[ 'txn_reg_status_change' ][ 'reg_status' ] ), $registration_query_params );
1190
+		return $transaction_processor->manually_update_registration_statuses($transaction, sanitize_text_field($this->_req_data['txn_reg_status_change']['reg_status']), $registration_query_params);
1191 1191
 //		$transaction_processor->finalize( $transaction, TRUE, FALSE);
1192 1192
 	}
1193 1193
 
@@ -1202,17 +1202,17 @@  discard block
 block discarded – undo
1202 1202
 	*/
1203 1203
 	public function delete_payment() {
1204 1204
 
1205
-		$json_response_data = array( 'return_data' => FALSE );
1206
-		$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;
1207
-		if ( $PAY_ID ) {
1208
-			$delete_txn_reg_status_change = isset( $this->_req_data[ 'delete_txn_reg_status_change' ] ) ? $this->_req_data[ 'delete_txn_reg_status_change' ] : false;
1209
-			$payment = EEM_Payment::instance()->get_one_by_ID( $PAY_ID );
1210
-			if ( $payment instanceof EE_Payment ) {
1205
+		$json_response_data = array('return_data' => FALSE);
1206
+		$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;
1207
+		if ($PAY_ID) {
1208
+			$delete_txn_reg_status_change = isset($this->_req_data['delete_txn_reg_status_change']) ? $this->_req_data['delete_txn_reg_status_change'] : false;
1209
+			$payment = EEM_Payment::instance()->get_one_by_ID($PAY_ID);
1210
+			if ($payment instanceof EE_Payment) {
1211 1211
 
1212 1212
 				/** @type EE_Transaction_Payments $transaction_payments */
1213
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1214
-				if ( $transaction_payments->delete_payment_and_update_transaction( $payment )) {
1215
-					EE_Error::add_success( __( 'The Payment was successfully deleted.', 'event_espresso' ) );
1213
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1214
+				if ($transaction_payments->delete_payment_and_update_transaction($payment)) {
1215
+					EE_Error::add_success(__('The Payment was successfully deleted.', 'event_espresso'));
1216 1216
 					$json_response_data['return_data'] = array(
1217 1217
 						'PAY_ID' => $PAY_ID,
1218 1218
 						'amount' => $payment->amount(),
@@ -1221,27 +1221,27 @@  discard block
 block discarded – undo
1221 1221
 						'pay_status' => $payment->STS_ID(),
1222 1222
 						'delete_txn_reg_status_change' => $delete_txn_reg_status_change
1223 1223
 					);
1224
-					if ( $delete_txn_reg_status_change ) {
1224
+					if ($delete_txn_reg_status_change) {
1225 1225
 						$this->_req_data['txn_reg_status_change'] = $delete_txn_reg_status_change;
1226 1226
 						//MAKE sure we also add the delete_txn_req_status_change to the
1227 1227
 						//$_REQUEST global because that's how messages will be looking
1228 1228
 						//for it.
1229 1229
 						$_REQUEST['txn_reg_status_change'] = $delete_txn_reg_status_change;
1230
-						$this->_process_registration_status_change( $payment->transaction() );
1230
+						$this->_process_registration_status_change($payment->transaction());
1231 1231
 					}
1232 1232
 				}
1233 1233
 
1234 1234
 			} else {
1235
-				EE_Error::add_error( __( 'Valid Payment data could not be retrieved from the database.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1235
+				EE_Error::add_error(__('Valid Payment data could not be retrieved from the database.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1236 1236
 			}
1237 1237
 
1238 1238
 		} else {
1239
-			$msg = __( 'A valid Payment ID was not received, therefore payment form data could not be loaded.', 'event_espresso' );
1240
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
1239
+			$msg = __('A valid Payment ID was not received, therefore payment form data could not be loaded.', 'event_espresso');
1240
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1241 1241
 		}
1242 1242
 
1243
-		$notices = EE_Error::get_notices( FALSE, FALSE, FALSE );
1244
-		echo json_encode( array_merge( $json_response_data, $notices ));
1243
+		$notices = EE_Error::get_notices(FALSE, FALSE, FALSE);
1244
+		echo json_encode(array_merge($json_response_data, $notices));
1245 1245
 		die();
1246 1246
 	}
1247 1247
 
@@ -1255,12 +1255,12 @@  discard block
 block discarded – undo
1255 1255
 	*	@return void
1256 1256
 	*/
1257 1257
 	protected function _send_payment_reminder() {
1258
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1259
-		$transaction = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
1260
-		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID'] ) : array();
1261
-		do_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction );
1258
+	    $TXN_ID = ( ! empty($this->_req_data['TXN_ID'])) ? absint($this->_req_data['TXN_ID']) : FALSE;
1259
+		$transaction = EEM_Transaction::instance()->get_one_by_ID($TXN_ID);
1260
+		$query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID']) : array();
1261
+		do_action('AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction);
1262 1262
 
1263
-		$this->_redirect_after_action( FALSE, __('payment reminder', 'event_espresso'), __('sent', 'event_espresso'), $query_args, TRUE );
1263
+		$this->_redirect_after_action(FALSE, __('payment reminder', 'event_espresso'), __('sent', 'event_espresso'), $query_args, TRUE);
1264 1264
 	}
1265 1265
 
1266 1266
 
@@ -1274,36 +1274,36 @@  discard block
 block discarded – undo
1274 1274
 	 * @param string   $view
1275 1275
 	 * @return mixed int = count || array of transaction objects
1276 1276
 	 */
1277
-	public function get_transactions( $perpage, $count = FALSE, $view = '' ) {
1277
+	public function get_transactions($perpage, $count = FALSE, $view = '') {
1278 1278
 
1279 1279
 		$TXN = EEM_Transaction::instance();
1280 1280
 
1281
-	    $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' ));
1282
-	    $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' );
1281
+	    $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'));
1282
+	    $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');
1283 1283
 
1284 1284
 	    //make sure our timestamps start and end right at the boundaries for each day
1285
-	    $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1286
-	    $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1285
+	    $start_date = date('Y-m-d', strtotime($start_date)).' 00:00:00';
1286
+	    $end_date = date('Y-m-d', strtotime($end_date)).' 23:59:59';
1287 1287
 
1288 1288
 
1289 1289
 	    //convert to timestamps
1290
-	    $start_date = strtotime( $start_date );
1291
-	    $end_date = strtotime( $end_date );
1290
+	    $start_date = strtotime($start_date);
1291
+	    $end_date = strtotime($end_date);
1292 1292
 
1293 1293
 	    //makes sure start date is the lowest value and vice versa
1294
-	    $start_date = min( $start_date, $end_date );
1295
-	    $end_date = max( $start_date, $end_date );
1294
+	    $start_date = min($start_date, $end_date);
1295
+	    $end_date = max($start_date, $end_date);
1296 1296
 
1297 1297
 	    //convert to correct format for query
1298
-	$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' );
1299
-	$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' );
1298
+	$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');
1299
+	$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');
1300 1300
 
1301 1301
 
1302 1302
 
1303 1303
 	    //set orderby
1304 1304
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
1305 1305
 
1306
-		switch ( $this->_req_data['orderby'] ) {
1306
+		switch ($this->_req_data['orderby']) {
1307 1307
 			case 'TXN_ID':
1308 1308
 				$orderby = 'TXN_ID';
1309 1309
 				break;
@@ -1317,64 +1317,64 @@  discard block
 block discarded – undo
1317 1317
 				$orderby = 'TXN_timestamp';
1318 1318
 		}
1319 1319
 
1320
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC';
1321
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
1322
-		$per_page = isset( $perpage ) && !empty( $perpage ) ? $perpage : 10;
1323
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
1320
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC';
1321
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
1322
+		$per_page = isset($perpage) && ! empty($perpage) ? $perpage : 10;
1323
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
1324 1324
 
1325
-		$offset = ($current_page-1)*$per_page;
1326
-		$limit = array( $offset, $per_page );
1325
+		$offset = ($current_page - 1) * $per_page;
1326
+		$limit = array($offset, $per_page);
1327 1327
 
1328 1328
 		$_where = array(
1329
-			'TXN_timestamp' => array('BETWEEN', array($start_date, $end_date) ),
1329
+			'TXN_timestamp' => array('BETWEEN', array($start_date, $end_date)),
1330 1330
 			'Registration.REG_count' => 1
1331 1331
 		);
1332 1332
 
1333
-		if ( isset( $this->_req_data['EVT_ID'] ) ) {
1333
+		if (isset($this->_req_data['EVT_ID'])) {
1334 1334
 			$_where['Registration.EVT_ID'] = $this->_req_data['EVT_ID'];
1335 1335
 		}
1336 1336
 
1337
-		if ( isset( $this->_req_data['s'] ) ) {
1338
-			$search_string = '%' . $this->_req_data['s'] . '%';
1337
+		if (isset($this->_req_data['s'])) {
1338
+			$search_string = '%'.$this->_req_data['s'].'%';
1339 1339
 			$_where['OR'] = array(
1340
-				'Registration.Event.EVT_name' => array( 'LIKE', $search_string ),
1341
-				'Registration.Event.EVT_desc' => array( 'LIKE', $search_string ),
1342
-				'Registration.Event.EVT_short_desc' => array( 'LIKE' , $search_string ),
1343
-				'Registration.Attendee.ATT_fname' => array( 'LIKE', $search_string ),
1344
-				'Registration.Attendee.ATT_lname' => array( 'LIKE', $search_string ),
1345
-				'Registration.Attendee.ATT_short_bio' => array( 'LIKE', $search_string ),
1346
-				'Registration.Attendee.ATT_email' => array('LIKE', $search_string ),
1347
-				'Registration.Attendee.ATT_address' => array( 'LIKE', $search_string ),
1348
-				'Registration.Attendee.ATT_address2' => array( 'LIKE', $search_string ),
1349
-				'Registration.Attendee.ATT_city' => array( 'LIKE', $search_string ),
1350
-				'Registration.REG_final_price' => array( 'LIKE', $search_string ),
1351
-				'Registration.REG_code' => array( 'LIKE', $search_string ),
1352
-				'Registration.REG_count' => array( 'LIKE' , $search_string ),
1353
-				'Registration.REG_group_size' => array( 'LIKE' , $search_string ),
1354
-				'Registration.Ticket.TKT_name' => array( 'LIKE', $search_string ),
1355
-				'Registration.Ticket.TKT_description' => array( 'LIKE', $search_string ),
1356
-				'Payment.PAY_source' => array('LIKE', $search_string ),
1357
-				'Payment.Payment_Method.PMD_name' => array('LIKE', $search_string ),
1358
-				'TXN_session_data' => array( 'LIKE', $search_string )
1340
+				'Registration.Event.EVT_name' => array('LIKE', $search_string),
1341
+				'Registration.Event.EVT_desc' => array('LIKE', $search_string),
1342
+				'Registration.Event.EVT_short_desc' => array('LIKE', $search_string),
1343
+				'Registration.Attendee.ATT_fname' => array('LIKE', $search_string),
1344
+				'Registration.Attendee.ATT_lname' => array('LIKE', $search_string),
1345
+				'Registration.Attendee.ATT_short_bio' => array('LIKE', $search_string),
1346
+				'Registration.Attendee.ATT_email' => array('LIKE', $search_string),
1347
+				'Registration.Attendee.ATT_address' => array('LIKE', $search_string),
1348
+				'Registration.Attendee.ATT_address2' => array('LIKE', $search_string),
1349
+				'Registration.Attendee.ATT_city' => array('LIKE', $search_string),
1350
+				'Registration.REG_final_price' => array('LIKE', $search_string),
1351
+				'Registration.REG_code' => array('LIKE', $search_string),
1352
+				'Registration.REG_count' => array('LIKE', $search_string),
1353
+				'Registration.REG_group_size' => array('LIKE', $search_string),
1354
+				'Registration.Ticket.TKT_name' => array('LIKE', $search_string),
1355
+				'Registration.Ticket.TKT_description' => array('LIKE', $search_string),
1356
+				'Payment.PAY_source' => array('LIKE', $search_string),
1357
+				'Payment.Payment_Method.PMD_name' => array('LIKE', $search_string),
1358
+				'TXN_session_data' => array('LIKE', $search_string)
1359 1359
 				);
1360 1360
 		}
1361 1361
 
1362 1362
 		//failed transactions
1363
-		$failed = ( ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'failed' && ! $count ) || ( $count && $view == 'failed' ) ? TRUE: FALSE;
1364
-		$abandoned = ( ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'abandoned' && ! $count ) || ( $count && $view == 'abandoned' ) ? TRUE: FALSE;
1363
+		$failed = ( ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'failed' && ! $count) || ($count && $view == 'failed') ? TRUE : FALSE;
1364
+		$abandoned = ( ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'abandoned' && ! $count) || ($count && $view == 'abandoned') ? TRUE : FALSE;
1365 1365
 
1366
-		if ( $failed ) {
1367
-			$_where[ 'STS_ID' ] = EEM_Transaction::failed_status_code;
1368
-		} else if ( $abandoned ) {
1366
+		if ($failed) {
1367
+			$_where['STS_ID'] = EEM_Transaction::failed_status_code;
1368
+		} else if ($abandoned) {
1369 1369
 				$_where['STS_ID'] = EEM_Transaction::abandoned_status_code;
1370 1370
 		} else {
1371
-				$_where['STS_ID'] = array( '!=', EEM_Transaction::failed_status_code );
1372
-				$_where['STS_ID*'] = array( '!=', EEM_Transaction::abandoned_status_code );
1371
+				$_where['STS_ID'] = array('!=', EEM_Transaction::failed_status_code);
1372
+				$_where['STS_ID*'] = array('!=', EEM_Transaction::abandoned_status_code);
1373 1373
 		}
1374 1374
 
1375
-		$query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'limit' => $limit );
1375
+		$query_params = array($_where, 'order_by' => array($orderby => $sort), 'limit' => $limit);
1376 1376
 
1377
-		$transactions = $count ? $TXN->count( array($_where), 'TXN_ID', TRUE ) : $TXN->get_all($query_params);
1377
+		$transactions = $count ? $TXN->count(array($_where), 'TXN_ID', TRUE) : $TXN->get_all($query_params);
1378 1378
 
1379 1379
 
1380 1380
 		return $transactions;
Please login to merge, or discard this patch.
admin_pages/transactions/Transactions_Admin_Page_Init.core.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -32,16 +32,16 @@  discard block
 block discarded – undo
32 32
 	 */
33 33
 	public function __construct() {
34 34
 
35
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
35
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
36 36
 
37
-		define( 'TXN_PG_SLUG', 'espresso_transactions' );
38
-		define( 'TXN_PG_NAME', ucwords( str_replace( '_', '', TXN_PG_SLUG )));
39
-		define( 'TXN_ADMIN', EE_ADMIN_PAGES . 'transactions' . DS );
40
-		define( 'TXN_ADMIN_URL', admin_url( 'admin.php?page=' . TXN_PG_SLUG ));
41
-		define( 'TXN_ASSETS_PATH', TXN_ADMIN . 'assets' . DS );
42
-		define( 'TXN_ASSETS_URL', str_replace( '\\', '/', EE_ADMIN_PAGES_URL . 'transactions/assets' . DS ));
43
-		define( 'TXN_TEMPLATE_PATH', TXN_ADMIN . 'templates' . DS );
44
-		define( 'TXN_TEMPLATE_URL', str_replace( '\\', '/', EE_ADMIN_PAGES_URL . 'transactions/templates' . DS ));
37
+		define('TXN_PG_SLUG', 'espresso_transactions');
38
+		define('TXN_PG_NAME', ucwords(str_replace('_', '', TXN_PG_SLUG)));
39
+		define('TXN_ADMIN', EE_ADMIN_PAGES.'transactions'.DS);
40
+		define('TXN_ADMIN_URL', admin_url('admin.php?page='.TXN_PG_SLUG));
41
+		define('TXN_ASSETS_PATH', TXN_ADMIN.'assets'.DS);
42
+		define('TXN_ASSETS_URL', str_replace('\\', '/', EE_ADMIN_PAGES_URL.'transactions/assets'.DS));
43
+		define('TXN_TEMPLATE_PATH', TXN_ADMIN.'templates'.DS);
44
+		define('TXN_TEMPLATE_URL', str_replace('\\', '/', EE_ADMIN_PAGES_URL.'transactions/templates'.DS));
45 45
 
46 46
 		parent::__construct();
47 47
 	}
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 * @return void
64 64
 	 */
65 65
 	protected function _set_menu_map() {
66
-		$this->_menu_map = new EE_Admin_Page_Sub_Menu( array(
66
+		$this->_menu_map = new EE_Admin_Page_Sub_Menu(array(
67 67
 			'menu_group' => 'main',
68 68
 			'menu_order' => 50,
69 69
 			'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 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
  *
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.