Completed
Branch old/BUG-7514-7935-7936-price-o... (518ae6)
by
unknown
13:33 queued 11:14
created
support/templates/support_admin_details_important_information.template.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@
 block discarded – undo
7 7
 	$is_php_valid = version_compare(phpversion(), $php_req_version, '>');
8 8
 	$is_mysql_valid = version_compare($wpdb->db_version(), $mysql_req_version, '>');
9 9
 
10
-	if (!version_compare($wp_version, $wp_req_version, '>=')) {
11
-		echo '<p class="red_alert">' . __('This version of Event Espresso requires WordPress version', 'event_espresso') . ' ' . $wp_req_version . '+. ' . __('Please upgrade to the latest version of WordPress.', 'event_espresso') . '</p>';
10
+	if ( ! version_compare($wp_version, $wp_req_version, '>=')) {
11
+		echo '<p class="red_alert">'.__('This version of Event Espresso requires WordPress version', 'event_espresso').' '.$wp_req_version.'+. '.__('Please upgrade to the latest version of WordPress.', 'event_espresso').'</p>';
12 12
 	}
13
-	if (!$is_php_valid) {
14
-		echo '<p class="red_alert">' . __('Your version of PHP is out of date, please update to the latest version of PHP. <br>Required version of PHP:', 'event_espresso') . ' ' . $php_req_version . '</p>';
13
+	if ( ! $is_php_valid) {
14
+		echo '<p class="red_alert">'.__('Your version of PHP is out of date, please update to the latest version of PHP. <br>Required version of PHP:', 'event_espresso').' '.$php_req_version.'</p>';
15 15
 	}
16
-	if (!$is_mysql_valid) {
17
-		echo '<p class="red_alert">' . __('Your version of MySQL is out of date, please update to the latest version of MySQL. <br>Required version of MySQL:', 'event_espresso') . ' ' . $mysql_req_version . '</p>';
16
+	if ( ! $is_mysql_valid) {
17
+		echo '<p class="red_alert">'.__('Your version of MySQL is out of date, please update to the latest version of MySQL. <br>Required version of MySQL:', 'event_espresso').' '.$mysql_req_version.'</p>';
18 18
 	}
19 19
 	
20 20
 	$query_args = array(
Please login to merge, or discard this patch.
admin_pages/transactions/EE_Admin_Transactions_List_Table.class.php 3 patches
Braces   +8 added lines, -5 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
  *
@@ -244,10 +246,11 @@  discard block
 block discarded – undo
244 246
 	 */
245 247
 	function column_ATT_email( EE_Transaction $item ){
246 248
 		$attendee = $item->primary_registration()->get_first_related('Attendee');
247
-		if ( !empty( $attendee ) )
248
-			return '<a href="mailto:' . $attendee->get('ATT_email') . '">' . $attendee->get('ATT_email') . '</a>';
249
-		else
250
-			return $item->failed() || $item->is_abandoned() ? __('no contact record.', 'event_espresso') : __('No contact record, because the transaction was abandoned or the registration process failed.', 'event_espresso');
249
+		if ( !empty( $attendee ) ) {
250
+					return '<a href="mailto:' . $attendee->get('ATT_email') . '">' . $attendee->get('ATT_email') . '</a>';
251
+		} else {
252
+					return $item->failed() || $item->is_abandoned() ? __('no contact record.', 'event_espresso') : __('No contact record, because the transaction was abandoned or the registration process failed.', 'event_espresso');
253
+		}
251 254
 		;
252 255
 	}
253 256
 
Please login to merge, or discard this patch.
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 	 * @param \EE_Admin_Page $admin_page
34 34
 	 * @return EE_Admin_Transactions_List_Table
35 35
 	 */
36
-	function __construct( EE_Admin_Page $admin_page ){
37
-   		parent::__construct( $admin_page );
36
+	function __construct(EE_Admin_Page $admin_page) {
37
+   		parent::__construct($admin_page);
38 38
    		$this->_status = $this->_admin_page->get_transaction_status_array();
39 39
 
40 40
 	}
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
 
45 45
 
46 46
 	protected function _setup_data() {
47
-		$this->_data = $this->_admin_page->get_transactions( $this->_per_page );
48
-		$status = ! empty( $this->_req_data['status'] )? $this->_req_data['status'] : 'all';
49
-		$this->_all_data_count = $this->_admin_page->get_transactions( $this->_per_page, TRUE, $status );
47
+		$this->_data = $this->_admin_page->get_transactions($this->_per_page);
48
+		$status = ! empty($this->_req_data['status']) ? $this->_req_data['status'] : 'all';
49
+		$this->_all_data_count = $this->_admin_page->get_transactions($this->_per_page, TRUE, $status);
50 50
 	}
51 51
 
52 52
 
@@ -66,21 +66,21 @@  discard block
 block discarded – undo
66 66
 
67 67
 		$this->_columns = array(
68 68
 			'STS_ID' => '',
69
-			'TXN_ID' => __( 'ID', 'event_espresso' ),
70
-			'TXN_timestamp'	=> __( 'Transaction Date', 'event_espresso' ),
71
-			'TXN_total' => __( 'Total', 'event_espresso' ),
72
-			'TXN_paid' => __( 'Paid', 'event_espresso' ),
73
-			'ATT_fname' => __( 'Primary Registrant', 'event_espresso' ),
74
-			'ATT_email' => __( 'Email Address', 'event_espresso' ),
75
-			'event_name' => __( 'Event', 'event_espresso' ),
76
-			'actions' => __( 'Actions', 'event_espresso' )
69
+			'TXN_ID' => __('ID', 'event_espresso'),
70
+			'TXN_timestamp'	=> __('Transaction Date', 'event_espresso'),
71
+			'TXN_total' => __('Total', 'event_espresso'),
72
+			'TXN_paid' => __('Paid', 'event_espresso'),
73
+			'ATT_fname' => __('Primary Registrant', 'event_espresso'),
74
+			'ATT_email' => __('Email Address', 'event_espresso'),
75
+			'event_name' => __('Event', 'event_espresso'),
76
+			'actions' => __('Actions', 'event_espresso')
77 77
 		);
78 78
 
79 79
 		$this->_sortable_columns = array(
80
-			'TXN_ID' => array( 'TXN_ID' => FALSE ),
81
-			'event_name' => array( 'event_name'=> FALSE ),
82
-			'ATT_fname'	=> array( 'ATT_fname'=> FALSE ),
83
-			'TXN_timestamp'	=> array( 'TXN_timestamp'=> TRUE ) //true means its already sorted
80
+			'TXN_ID' => array('TXN_ID' => FALSE),
81
+			'event_name' => array('event_name'=> FALSE),
82
+			'ATT_fname'	=> array('ATT_fname'=> FALSE),
83
+			'TXN_timestamp'	=> array('TXN_timestamp'=> TRUE) //true means its already sorted
84 84
 		);
85 85
 
86 86
 		$this->_hidden_columns = array();
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	protected function _get_table_filters() {
99 99
 		$filters = array();
100
-		$start_date = isset( $this->_req_data['txn-filter-start-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-start-date'] ) : date( 'D M j, Y', strtotime( '-10 year' ));
101
-		$end_date = isset( $this->_req_data['txn-filter-end-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-end-date'] ) : date( 'D M j, Y' );
100
+		$start_date = isset($this->_req_data['txn-filter-start-date']) ? wp_strip_all_tags($this->_req_data['txn-filter-start-date']) : date('D M j, Y', strtotime('-10 year'));
101
+		$end_date = isset($this->_req_data['txn-filter-end-date']) ? wp_strip_all_tags($this->_req_data['txn-filter-end-date']) : date('D M j, Y');
102 102
 		ob_start();
103 103
 		?>
104 104
 		<label for="txn-filter-start-date">Display Transactions from </label>
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 
117 117
 
118 118
 	protected function _add_view_counts() {
119
-		$this->_views['all']['count'] = $this->_admin_page->get_transactions( $this->_per_page, TRUE, 'all' );
120
-		$this->_views['abandoned']['count'] = $this->_admin_page->get_transactions( $this->_per_page, TRUE, 'abandoned' );
121
-		$this->_views['failed']['count'] = $this->_admin_page->get_transactions( $this->_per_page, TRUE, 'failed' );
119
+		$this->_views['all']['count'] = $this->_admin_page->get_transactions($this->_per_page, TRUE, 'all');
120
+		$this->_views['abandoned']['count'] = $this->_admin_page->get_transactions($this->_per_page, TRUE, 'abandoned');
121
+		$this->_views['failed']['count'] = $this->_admin_page->get_transactions($this->_per_page, TRUE, 'failed');
122 122
 	}
123 123
 
124 124
 
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
 	 * @param \EE_Transaction $item
128 128
 	 * @return string
129 129
 	 */
130
-   function column_TXN_ID( EE_Transaction $item ){
131
-    	$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->ID() ), TXN_ADMIN_URL );
132
-				return '<a href="' . $view_lnk_url . '" title="' . esc_attr__( 'Go to Transaction Details', 'event_espresso' ) . '">' . $item->ID() . '</a>';
130
+   function column_TXN_ID(EE_Transaction $item) {
131
+    	$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->ID()), TXN_ADMIN_URL);
132
+				return '<a href="'.$view_lnk_url.'" title="'.esc_attr__('Go to Transaction Details', 'event_espresso').'">'.$item->ID().'</a>';
133 133
 	}
134 134
 
135 135
 
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
 	 * @param \EE_Transaction $item
139 139
 	 * @return string
140 140
 	 */
141
-	function column_STS_ID( EE_Transaction $item ){
142
-		return '<span class="ee-status-strip ee-status-strip-td txn-status-' . $item->status_ID() . '"></span>';
141
+	function column_STS_ID(EE_Transaction $item) {
142
+		return '<span class="ee-status-strip ee-status-strip-td txn-status-'.$item->status_ID().'"></span>';
143 143
 	}
144 144
 
145 145
 
@@ -148,8 +148,8 @@  discard block
 block discarded – undo
148 148
 	 * @param \EE_Transaction $item
149 149
 	 * @return string
150 150
 	 */
151
-	function column_cb($item ){
152
-		return sprintf( '<input type="checkbox" name="%1$s[]" value="%2$s" />', $this->_wp_list_args['singular'],  $item->ID());
151
+	function column_cb($item) {
152
+		return sprintf('<input type="checkbox" name="%1$s[]" value="%2$s" />', $this->_wp_list_args['singular'], $item->ID());
153 153
 	}
154 154
 
155 155
 
@@ -158,19 +158,19 @@  discard block
 block discarded – undo
158 158
 	 * @param \EE_Transaction $item
159 159
 	 * @return string
160 160
 	 */
161
-	function column_TXN_timestamp( EE_Transaction $item ){
162
-		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->ID() ), TXN_ADMIN_URL );
161
+	function column_TXN_timestamp(EE_Transaction $item) {
162
+		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->ID()), TXN_ADMIN_URL);
163 163
 		// is TXN less than 2 hours old ?
164 164
 		if (
165 165
 			(
166
-				( current_time( 'timestamp' ) - EE_Registry::instance()->SSN->lifespan() )
167
-				< strtotime( $item->datetime() )
166
+				(current_time('timestamp') - EE_Registry::instance()->SSN->lifespan())
167
+				< strtotime($item->datetime())
168 168
 			) &&
169
-			( $item->failed() || $item->is_abandoned() )
169
+			($item->failed() || $item->is_abandoned())
170 170
 		) {
171
-			$txn_date = '<a href="'.$view_lnk_url.'" title="' . esc_attr__( 'View Transaction Details for TXN #', 'event_espresso' ) . $item->ID() . '">' . __( 'TXN in progress...', 'event_espresso' ) . '</a>';
171
+			$txn_date = '<a href="'.$view_lnk_url.'" title="'.esc_attr__('View Transaction Details for TXN #', 'event_espresso').$item->ID().'">'.__('TXN in progress...', 'event_espresso').'</a>';
172 172
 		} else {
173
-			$txn_date = '<a href="'.$view_lnk_url.'" title="' . esc_attr__( 'View Transaction Details for TXN #', 'event_espresso' ) . $item->ID() . '">' . $item->get_i18n_datetime( 'TXN_timestamp' ) .  '</a>';
173
+			$txn_date = '<a href="'.$view_lnk_url.'" title="'.esc_attr__('View Transaction Details for TXN #', 'event_espresso').$item->ID().'">'.$item->get_i18n_datetime('TXN_timestamp').'</a>';
174 174
 		}
175 175
 		return $txn_date;
176 176
 	}
@@ -181,11 +181,11 @@  discard block
 block discarded – undo
181 181
 	 * @param \EE_Transaction $item
182 182
 	 * @return string
183 183
 	 */
184
-	function column_TXN_total( EE_Transaction $item ){
185
-		if ( $item->get('TXN_total') > 0 ) {
186
-			return '<span class="txn-pad-rght">' . $item->get_pretty('TXN_total') . '</span>';
184
+	function column_TXN_total(EE_Transaction $item) {
185
+		if ($item->get('TXN_total') > 0) {
186
+			return '<span class="txn-pad-rght">'.$item->get_pretty('TXN_total').'</span>';
187 187
 		} else {
188
-			return '<span class="txn-overview-free-event-spn">' . __( 'free', 'event_espresso' ) . '</span>';
188
+			return '<span class="txn-overview-free-event-spn">'.__('free', 'event_espresso').'</span>';
189 189
 		}
190 190
 
191 191
 	}
@@ -196,19 +196,19 @@  discard block
 block discarded – undo
196 196
 	 * @param \EE_Transaction $item
197 197
 	 * @return mixed|string
198 198
 	 */
199
-	function column_TXN_paid( EE_Transaction $item ){
199
+	function column_TXN_paid(EE_Transaction $item) {
200 200
 		$transaction_total = $item->get('TXN_total');
201 201
 		$transaction_paid = $item->get('TXN_paid');
202 202
 
203
-		if (( $transaction_total > 0 ) && ( $transaction_paid >= $transaction_total )) {
203
+		if (($transaction_total > 0) && ($transaction_paid >= $transaction_total)) {
204 204
 			// paid in full
205 205
 			$span_class = 'txn-overview-full-payment-spn';
206 206
 
207
-		} elseif (( $transaction_total > 0 ) && ( $transaction_paid > 0 )) {
207
+		} elseif (($transaction_total > 0) && ($transaction_paid > 0)) {
208 208
 			// monies owing
209 209
 			$span_class = 'txn-overview-part-payment-spn';
210 210
 
211
-		} elseif (( $transaction_total > 0 ) && ( $transaction_paid == 0 )) {
211
+		} elseif (($transaction_total > 0) && ($transaction_paid == 0)) {
212 212
 			// no payments made
213 213
 			$span_class = 'txn-overview-no-payment-spn';
214 214
 
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 			$transaction_paid = 0;
218 218
 		}
219 219
 
220
-		return '<span class="' . $span_class . ' txn-pad-rght">' . $transaction_paid !== 0 ? $item->get_pretty('TXN_paid') : $transaction_paid . '</span>';
220
+		return '<span class="'.$span_class.' txn-pad-rght">'.$transaction_paid !== 0 ? $item->get_pretty('TXN_paid') : $transaction_paid.'</span>';
221 221
 
222 222
 	}
223 223
 
@@ -227,12 +227,12 @@  discard block
 block discarded – undo
227 227
 	 * @param \EE_Transaction $item
228 228
 	 * @return string|void
229 229
 	 */
230
-	function column_ATT_fname( EE_Transaction $item ){
230
+	function column_ATT_fname(EE_Transaction $item) {
231 231
 		$primary_reg = $item->primary_registration();
232 232
 		$attendee = $primary_reg->get_first_related('Attendee');
233
-		if ( $attendee instanceof EE_Attendee ) {
234
-			$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$primary_reg->ID() ), REG_ADMIN_URL );
235
-			return EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $primary_reg->ID() ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '">' . $attendee->full_name() . '</a>' : $attendee->full_name();
233
+		if ($attendee instanceof EE_Attendee) {
234
+			$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$primary_reg->ID()), REG_ADMIN_URL);
235
+			return EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $primary_reg->ID()) ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'">'.$attendee->full_name().'</a>' : $attendee->full_name();
236 236
 		}
237 237
 		return $item->failed() || $item->is_abandoned() ? __('no contact record.', 'event_espresso') : __('No contact record, because the transaction was abandoned or the registration process failed.', 'event_espresso');
238 238
 	}
@@ -243,10 +243,10 @@  discard block
 block discarded – undo
243 243
 	 * @param \EE_Transaction $item
244 244
 	 * @return string|void
245 245
 	 */
246
-	function column_ATT_email( EE_Transaction $item ){
246
+	function column_ATT_email(EE_Transaction $item) {
247 247
 		$attendee = $item->primary_registration()->get_first_related('Attendee');
248
-		if ( !empty( $attendee ) )
249
-			return '<a href="mailto:' . $attendee->get('ATT_email') . '">' . $attendee->get('ATT_email') . '</a>';
248
+		if ( ! empty($attendee))
249
+			return '<a href="mailto:'.$attendee->get('ATT_email').'">'.$attendee->get('ATT_email').'</a>';
250 250
 		else
251 251
 			return $item->failed() || $item->is_abandoned() ? __('no contact record.', 'event_espresso') : __('No contact record, because the transaction was abandoned or the registration process failed.', 'event_espresso');
252 252
 		;
@@ -258,20 +258,20 @@  discard block
 block discarded – undo
258 258
 	 * @param \EE_Transaction $item
259 259
 	 * @return string|void
260 260
 	 */
261
-    function column_event_name( EE_Transaction $item ){
261
+    function column_event_name(EE_Transaction $item) {
262 262
     	$actions = array();
263 263
 		$event = $item->primary_registration()->get_first_related('Event');
264
-		if ( !empty( $event ) ) {
265
-			$edit_event_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$event->ID() ), EVENTS_ADMIN_URL );
264
+		if ( ! empty($event)) {
265
+			$edit_event_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$event->ID()), EVENTS_ADMIN_URL);
266 266
 			$event_name = $event->get('EVT_name');
267 267
 
268 268
 			//filter this view by transactions for this event
269
-			$txn_by_event_lnk = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'EVT_ID' => $event->ID() ) );
270
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'espresso_events_edit', $event->ID() ) ) {
271
-				$actions['filter_by_event'] = '<a href="' . $txn_by_event_lnk . '" title="' . esc_attr__('Filter transactions by this event', 'event_espresso') . '">' . __('View Transactions for this event', 'event_espresso') . '</a>';
269
+			$txn_by_event_lnk = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'EVT_ID' => $event->ID()));
270
+			if (EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $event->ID())) {
271
+				$actions['filter_by_event'] = '<a href="'.$txn_by_event_lnk.'" title="'.esc_attr__('Filter transactions by this event', 'event_espresso').'">'.__('View Transactions for this event', 'event_espresso').'</a>';
272 272
 			}
273 273
 
274
-			return sprintf('%1$s %2$s', EE_Registry::instance()->CAP->current_user_can( 'ee_edit_event', 'espresso_events_edit', $event->ID() ) ? '<a href="' . $edit_event_url . '" title="' . sprintf( esc_attr__( 'Edit Event: %s', 'event_espresso' ), $event->get('EVT_name') ) .'">' .  wp_trim_words( $event_name, 30, '...' ) . '</a>' : wp_trim_words( $event_name, 30, '...' ), $this->row_actions($actions) );
274
+			return sprintf('%1$s %2$s', EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $event->ID()) ? '<a href="'.$edit_event_url.'" title="'.sprintf(esc_attr__('Edit Event: %s', 'event_espresso'), $event->get('EVT_name')).'">'.wp_trim_words($event_name, 30, '...').'</a>' : wp_trim_words($event_name, 30, '...'), $this->row_actions($actions));
275 275
 		} else {
276 276
 			return __('The event associated with this transaction via the primary registration cannot be retrieved.', 'event_espresso');
277 277
 		}
@@ -283,33 +283,33 @@  discard block
 block discarded – undo
283 283
 	 * @param \EE_Transaction $item
284 284
 	 * @return string
285 285
 	 */
286
-    function column_actions( EE_Transaction $item ){
286
+    function column_actions(EE_Transaction $item) {
287 287
 
288 288
     	$registration = $item->primary_registration();
289 289
     	$attendee = $registration->attendee();
290
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
290
+		EE_Registry::instance()->load_helper('MSG_Template');
291 291
 
292 292
         //Build row actions
293
-		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->ID() ), TXN_ADMIN_URL );
293
+		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->ID()), TXN_ADMIN_URL);
294 294
 		$dl_invoice_lnk_url = $registration->invoice_url();
295 295
 		$dl_receipt_lnk_url = $registration->receipt_url();
296
-		$view_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$registration->ID() ), REG_ADMIN_URL );
297
-		$send_pay_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'send_payment_reminder', 'TXN_ID'=>$item->ID() ), TXN_ADMIN_URL );
296
+		$view_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$registration->ID()), REG_ADMIN_URL);
297
+		$send_pay_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'send_payment_reminder', 'TXN_ID'=>$item->ID()), TXN_ADMIN_URL);
298 298
 
299 299
 		//Build row actions
300 300
 		$view_lnk = '
301 301
 			<li>
302
-				<a href="'.$view_lnk_url.'" title="' . esc_attr__( 'View Transaction Details', 'event_espresso' ) . '" class="tiny-text">
302
+				<a href="'.$view_lnk_url.'" title="'.esc_attr__('View Transaction Details', 'event_espresso').'" class="tiny-text">
303 303
 					<span class="dashicons dashicons-cart"></span>
304 304
 				</a>
305 305
 			</li>';
306 306
 
307 307
 
308 308
 	//only show invoice link if message type is active.
309
-	if ( $attendee instanceof EE_Attendee && EEH_MSG_Template::is_mt_active( 'invoice' ) ) {
309
+	if ($attendee instanceof EE_Attendee && EEH_MSG_Template::is_mt_active('invoice')) {
310 310
 		$dl_invoice_lnk = '
311 311
 		<li>
312
-			<a title="' . esc_attr__( 'View Transaction Invoice', 'event_espresso' ) . '" target="_blank" href="'.$dl_invoice_lnk_url.'" class="tiny-text">
312
+			<a title="' . esc_attr__('View Transaction Invoice', 'event_espresso').'" target="_blank" href="'.$dl_invoice_lnk_url.'" class="tiny-text">
313 313
 				<span class="dashicons dashicons-media-spreadsheet ee-icon-size-18"></span>
314 314
 			</a>
315 315
 		</li>';
@@ -318,10 +318,10 @@  discard block
 block discarded – undo
318 318
 	}
319 319
 
320 320
 	//only show receipt link if message type is active.
321
-	if ( $attendee instanceof EE_Attendee && EEH_MSG_Template::is_mt_active( 'receipt' ) ) {
321
+	if ($attendee instanceof EE_Attendee && EEH_MSG_Template::is_mt_active('receipt')) {
322 322
 		$dl_receipt_lnk = '
323 323
 		<li>
324
-			<a title="' . esc_attr__( 'View Transaction Receipt', 'event_espresso' ) . '" target="_blank" href="'.$dl_receipt_lnk_url.'" class="tiny-text">
324
+			<a title="' . esc_attr__('View Transaction Receipt', 'event_espresso').'" target="_blank" href="'.$dl_receipt_lnk_url.'" class="tiny-text">
325 325
 				<span class="dashicons dashicons-media-default ee-icon-size-18"></span>
326 326
 			</a>
327 327
 		</li>';
@@ -330,10 +330,10 @@  discard block
 block discarded – undo
330 330
 	}
331 331
 
332 332
       		//only show payment reminder link if the message type is active.
333
-      		if ( EEH_MSG_Template::is_mt_active( 'payment_reminder' ) ) {
334
-		$send_pay_lnk = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_transactions_send_payment_reminder' ) ? '
333
+      		if (EEH_MSG_Template::is_mt_active('payment_reminder')) {
334
+		$send_pay_lnk = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder') ? '
335 335
 			<li>
336
-				<a href="'.$send_pay_lnk_url.'" title="' . esc_attr__( 'Send Payment Reminder', 'event_espresso' ) . '" class="tiny-text">
336
+				<a href="'.$send_pay_lnk_url.'" title="'.esc_attr__('Send Payment Reminder', 'event_espresso').'" class="tiny-text">
337 337
 					<span class="dashicons dashicons-email-alt"></span>
338 338
 				</a>
339 339
 			</li>' : '';
@@ -342,14 +342,14 @@  discard block
 block discarded – undo
342 342
 			$send_pay_lnk = '';
343 343
 		}
344 344
 
345
-		$view_reg_lnk = EE_Registry::instance()->CAP->current_user_can( 'ee_read_registration', 'espresso_registrations_view_registration', $registration->ID() ) ? '
345
+		$view_reg_lnk = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $registration->ID()) ? '
346 346
 			<li>
347
-				<a href="'.$view_reg_lnk_url.'" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '" class="tiny-text">
347
+				<a href="'.$view_reg_lnk_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'" class="tiny-text">
348 348
 					<span class="dashicons dashicons-clipboard"></span>
349 349
 				</a>
350 350
 			</li>' : '';
351 351
 
352
-	return $this->_action_string( $view_lnk . $dl_invoice_lnk . $dl_receipt_lnk . $view_reg_lnk . $send_pay_lnk, $item, 'ul', 'txn-overview-actions-ul' );
352
+	return $this->_action_string($view_lnk.$dl_invoice_lnk.$dl_receipt_lnk.$view_reg_lnk.$send_pay_lnk, $item, 'ul', 'txn-overview-actions-ul');
353 353
     }
354 354
 
355 355
 
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	 * @return string
129 129
 	 */
130 130
    function column_TXN_ID( EE_Transaction $item ){
131
-    	$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->ID() ), TXN_ADMIN_URL );
131
+		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->ID() ), TXN_ADMIN_URL );
132 132
 				return '<a href="' . $view_lnk_url . '" title="' . esc_attr__( 'Go to Transaction Details', 'event_espresso' ) . '">' . $item->ID() . '</a>';
133 133
 	}
134 134
 
@@ -258,8 +258,8 @@  discard block
 block discarded – undo
258 258
 	 * @param \EE_Transaction $item
259 259
 	 * @return string|void
260 260
 	 */
261
-    function column_event_name( EE_Transaction $item ){
262
-    	$actions = array();
261
+	function column_event_name( EE_Transaction $item ){
262
+		$actions = array();
263 263
 		$event = $item->primary_registration()->get_first_related('Event');
264 264
 		if ( !empty( $event ) ) {
265 265
 			$edit_event_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$event->ID() ), EVENTS_ADMIN_URL );
@@ -283,13 +283,13 @@  discard block
 block discarded – undo
283 283
 	 * @param \EE_Transaction $item
284 284
 	 * @return string
285 285
 	 */
286
-    function column_actions( EE_Transaction $item ){
286
+	function column_actions( EE_Transaction $item ){
287 287
 
288
-    	$registration = $item->primary_registration();
289
-    	$attendee = $registration->attendee();
288
+		$registration = $item->primary_registration();
289
+		$attendee = $registration->attendee();
290 290
 		EE_Registry::instance()->load_helper( 'MSG_Template' );
291 291
 
292
-        //Build row actions
292
+		//Build row actions
293 293
 		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->ID() ), TXN_ADMIN_URL );
294 294
 		$dl_invoice_lnk_url = $registration->invoice_url();
295 295
 		$dl_receipt_lnk_url = $registration->receipt_url();
@@ -329,8 +329,8 @@  discard block
 block discarded – undo
329 329
 		$dl_receipt_lnk = '';
330 330
 	}
331 331
 
332
-      		//only show payment reminder link if the message type is active.
333
-      		if ( EEH_MSG_Template::is_mt_active( 'payment_reminder' ) ) {
332
+	  		//only show payment reminder link if the message type is active.
333
+	  		if ( EEH_MSG_Template::is_mt_active( 'payment_reminder' ) ) {
334 334
 		$send_pay_lnk = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_transactions_send_payment_reminder' ) ? '
335 335
 			<li>
336 336
 				<a href="'.$send_pay_lnk_url.'" title="' . esc_attr__( 'Send Payment Reminder', 'event_espresso' ) . '" class="tiny-text">
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 			</li>' : '';
351 351
 
352 352
 	return $this->_action_string( $view_lnk . $dl_invoice_lnk . $dl_receipt_lnk . $view_reg_lnk . $send_pay_lnk, $item, 'ul', 'txn-overview-actions-ul' );
353
-    }
353
+	}
354 354
 
355 355
 
356 356
 }
Please login to merge, or discard this patch.
admin_pages/transactions/Transactions_Admin_Page.core.php 3 patches
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
@@ -359,8 +361,10 @@  discard block
 block discarded – undo
359 361
 	 *	@return void
360 362
 	 */
361 363
 	private function _set_transaction_object() {
362
-		if ( is_object( $this->_transaction) )
363
-			return; //get out we've already set the object
364
+		if ( is_object( $this->_transaction) ) {
365
+					return;
366
+		}
367
+		//get out we've already set the object
364 368
 
365 369
 	    $TXN = EEM_Transaction::instance();
366 370
 
@@ -836,7 +840,7 @@  discard block
 block discarded – undo
836 840
 			$query_args = array( array( 'OR*payment_method_for_payment' => array(
837 841
 					'PMD_ID' => array( 'IN', $payment_methods_of_payments ),
838 842
 					'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) ) );
839
-		}else{
843
+		} else{
840 844
 			$query_args = array( array( 'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) );
841 845
 		}
842 846
 		$this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all( $query_args );
Please login to merge, or discard this patch.
Indentation   +48 added lines, -48 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();
@@ -221,10 +221,10 @@  discard block
 block discarded – undo
221 221
 	/**
222 222
 	 * _set_transaction_status_array
223 223
 	 * sets list of transaction statuses
224
-	*
224
+	 *
225 225
 	 * @access private
226
-	*	@return void
227
-	*/
226
+	 *	@return void
227
+	 */
228 228
 	private function _set_transaction_status_array() {
229 229
 		self::$_txn_status = EEM_Transaction::instance()->status_array(TRUE);
230 230
 	}
@@ -246,10 +246,10 @@  discard block
 block discarded – undo
246 246
 
247 247
 	/**
248 248
 	 * 	get list of payment statuses
249
-	*
249
+	 *
250 250
 	 * @access private
251
-	*	@return void
252
-	*/
251
+	 *	@return void
252
+	 */
253 253
 	private function _get_payment_status_array() {
254 254
 		self::$_pay_status = EEM_Payment::instance()->status_array(TRUE);
255 255
 		$this->_template_args['payment_status'] = self::$_pay_status;
@@ -365,18 +365,18 @@  discard block
 block discarded – undo
365 365
 		if ( is_object( $this->_transaction) )
366 366
 			return; //get out we've already set the object
367 367
 
368
-	    $TXN = EEM_Transaction::instance();
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
-	    //get transaction object
373
-	    $this->_transaction = $TXN->get_one_by_ID($TXN_ID);
374
-	    $this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
372
+		//get transaction object
373
+		$this->_transaction = $TXN->get_one_by_ID($TXN_ID);
374
+		$this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
375 375
 
376 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');
377
+			$error_msg = __('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  __(' could not be retrieved.', 'event_espresso');
378 378
 			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
379
-	    }
379
+		}
380 380
 	}
381 381
 
382 382
 
@@ -473,12 +473,12 @@  discard block
 block discarded – undo
473 473
 
474 474
 
475 475
 	/**
476
-	* 	_transaction_details
476
+	 * 	_transaction_details
477 477
 	 * generates HTML for the View Transaction Details Admin page
478
-	*
478
+	 *
479 479
 	 * @access protected
480
-	*	@return void
481
-	*/
480
+	 *	@return void
481
+	 */
482 482
 	protected function _transaction_details() {
483 483
 		do_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction );
484 484
 		EE_Registry::instance()->load_helper( 'MSG_Template' );
@@ -601,10 +601,10 @@  discard block
 block discarded – undo
601 601
 	/**
602 602
 	 * txn_details_meta_box
603 603
 	 * generates HTML for the Transaction main meta box
604
-	*
604
+	 *
605 605
 	 * @access public
606
-	*	@return void
607
-	*/
606
+	 *	@return void
607
+	 */
608 608
 	public function txn_details_meta_box() {
609 609
 
610 610
 		$this->_set_transaction_object();
@@ -939,10 +939,10 @@  discard block
 block discarded – undo
939 939
 	/**
940 940
 	 * txn_billing_info_side_meta_box
941 941
 	 * 	generates HTML for the Edit Transaction side meta box
942
-	*
942
+	 *
943 943
 	 * @access public
944
-	*	@return void
945
-	*/
944
+	 *	@return void
945
+	 */
946 946
 	public function txn_billing_info_side_meta_box() {
947 947
 
948 948
 		$this->_template_args['billing_form'] = $this->_transaction->billing_info();
@@ -957,10 +957,10 @@  discard block
 block discarded – undo
957 957
 	/**
958 958
 	 * apply_payments_or_refunds
959 959
 	 * 	registers a payment or refund made towards a transaction
960
-	*
960
+	 *
961 961
 	 * @access public
962
-	*	@return void
963
-	*/
962
+	 *	@return void
963
+	 */
964 964
 	public function apply_payments_or_refunds() {
965 965
 
966 966
 		$json_response_data = array( 'return_data' => FALSE );
@@ -1183,10 +1183,10 @@  discard block
 block discarded – undo
1183 1183
 	/**
1184 1184
 	 * delete_payment
1185 1185
 	 * 	delete a payment or refund made towards a transaction
1186
-	*
1186
+	 *
1187 1187
 	 * @access public
1188
-	*	@return void
1189
-	*/
1188
+	 *	@return void
1189
+	 */
1190 1190
 	public function delete_payment() {
1191 1191
 
1192 1192
 		$json_response_data = array( 'return_data' => FALSE );
@@ -1237,12 +1237,12 @@  discard block
 block discarded – undo
1237 1237
 	/**
1238 1238
 	 * _send_payment_reminder
1239 1239
 	 * 	generates HTML for the View Transaction Details Admin page
1240
-	*
1240
+	 *
1241 1241
 	 * @access protected
1242
-	*	@return void
1243
-	*/
1242
+	 *	@return void
1243
+	 */
1244 1244
 	protected function _send_payment_reminder() {
1245
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1245
+		$TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1246 1246
 		$transaction = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
1247 1247
 		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID'] ) : array();
1248 1248
 		do_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction );
@@ -1265,24 +1265,24 @@  discard block
 block discarded – undo
1265 1265
 
1266 1266
 		$TXN = EEM_Transaction::instance();
1267 1267
 
1268
-	    $start_date = isset( $this->_req_data['txn-filter-start-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-start-date'] ) : date( 'D M j, Y', strtotime( '-10 year' ));
1269
-	    $end_date = isset( $this->_req_data['txn-filter-end-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-end-date'] ) : date( 'D M j, Y' );
1268
+		$start_date = isset( $this->_req_data['txn-filter-start-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-start-date'] ) : date( 'D M j, Y', strtotime( '-10 year' ));
1269
+		$end_date = isset( $this->_req_data['txn-filter-end-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-end-date'] ) : date( 'D M j, Y' );
1270 1270
 
1271
-	    //make sure our timestamps start and end right at the boundaries for each day
1272
-	    $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1273
-	    $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1271
+		//make sure our timestamps start and end right at the boundaries for each day
1272
+		$start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1273
+		$end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1274 1274
 
1275 1275
 
1276
-	    //convert to timestamps
1277
-	    $start_date = strtotime( $start_date );
1278
-	    $end_date = strtotime( $end_date );
1276
+		//convert to timestamps
1277
+		$start_date = strtotime( $start_date );
1278
+		$end_date = strtotime( $end_date );
1279 1279
 
1280
-	    //makes sure start date is the lowest value and vice versa
1281
-	    $start_date = min( $start_date, $end_date );
1282
-	    $end_date = max( $start_date, $end_date );
1280
+		//makes sure start date is the lowest value and vice versa
1281
+		$start_date = min( $start_date, $end_date );
1282
+		$end_date = max( $start_date, $end_date );
1283 1283
 
1284 1284
 
1285
-	    //set orderby
1285
+		//set orderby
1286 1286
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
1287 1287
 
1288 1288
 		switch ( $this->_req_data['orderby'] ) {
Please login to merge, or discard this patch.
Spacing   +252 added lines, -252 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,23 +278,23 @@  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
 
297
-		wp_localize_script( 'espresso_txn', 'eei18n', EE_Registry::$i18n_js_strings );
297
+		wp_localize_script('espresso_txn', 'eei18n', EE_Registry::$i18n_js_strings);
298 298
 
299 299
 	}
300 300
 
@@ -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
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 				),
400 400
 			'view_receipt' => array(
401 401
 				'class' => 'dashicons dashicons-media-default',
402
-				'desc' => __('View Transaction Receipt', 'event_espresso' )
402
+				'desc' => __('View Transaction Receipt', 'event_espresso')
403 403
 				),
404 404
 			'view_registration' => array(
405 405
 				'class' => 'dashicons dashicons-clipboard',
@@ -407,10 +407,10 @@  discard block
 block discarded – undo
407 407
 				)
408 408
 		);
409 409
 
410
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_transactions_send_payment_reminder' ) ) {
410
+		if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder')) {
411 411
 
412
-			EE_Registry::instance()->load_helper( 'MSG_Template' );
413
-			if ( EEH_MSG_Template::is_mt_active( 'payment_reminder' ) ) {
412
+			EE_Registry::instance()->load_helper('MSG_Template');
413
+			if (EEH_MSG_Template::is_mt_active('payment_reminder')) {
414 414
 				$items['send_payment_reminder'] = array(
415 415
 					'class' => 'dashicons dashicons-email-alt',
416 416
 					'desc' => __('Send Payment Reminder', 'event_espresso')
@@ -430,28 +430,28 @@  discard block
 block discarded – undo
430 430
 
431 431
 		$more_items = array(
432 432
 			 'overpaid' => array(
433
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::overpaid_status_code,
434
-				'desc' => EEH_Template::pretty_status( EEM_Transaction::overpaid_status_code, FALSE, 'sentence' )
433
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::overpaid_status_code,
434
+				'desc' => EEH_Template::pretty_status(EEM_Transaction::overpaid_status_code, FALSE, 'sentence')
435 435
 				),
436 436
 			 'complete' => array(
437
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::complete_status_code,
438
-				'desc' => EEH_Template::pretty_status( EEM_Transaction::complete_status_code, FALSE, 'sentence' )
437
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::complete_status_code,
438
+				'desc' => EEH_Template::pretty_status(EEM_Transaction::complete_status_code, FALSE, 'sentence')
439 439
 				),
440 440
 			 'incomplete' => array(
441
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::incomplete_status_code,
442
-				'desc' => EEH_Template::pretty_status( EEM_Transaction::incomplete_status_code, FALSE, 'sentence' )
441
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::incomplete_status_code,
442
+				'desc' => EEH_Template::pretty_status(EEM_Transaction::incomplete_status_code, FALSE, 'sentence')
443 443
 				),
444 444
 			 'abandoned' => array(
445
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::abandoned_status_code,
446
-				'desc' => EEH_Template::pretty_status( EEM_Transaction::abandoned_status_code, FALSE, 'sentence' )
445
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::abandoned_status_code,
446
+				'desc' => EEH_Template::pretty_status(EEM_Transaction::abandoned_status_code, FALSE, 'sentence')
447 447
 			 ),
448 448
 			 'failed' => array(
449
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::failed_status_code,
450
-				'desc' => EEH_Template::pretty_status( EEM_Transaction::failed_status_code, FALSE, 'sentence' )
449
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::failed_status_code,
450
+				'desc' => EEH_Template::pretty_status(EEM_Transaction::failed_status_code, FALSE, 'sentence')
451 451
 			)
452 452
 		);
453 453
 
454
-		return array_merge( $items, $more_items);
454
+		return array_merge($items, $more_items);
455 455
 	}
456 456
 
457 457
 
@@ -464,9 +464,9 @@  discard block
 block discarded – undo
464 464
 	 */
465 465
 	protected function _transactions_overview_list_table() {
466 466
 		$this->_admin_page_title = __('Transactions', 'event_espresso');
467
-		$event = isset($this->_req_data['EVT_ID']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID'] ) : NULL;
468
-		$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>' ) : '';
469
-		$this->_template_args['after_list_table'] = $this->_display_legend( $this->_transaction_legend_items() );
467
+		$event = isset($this->_req_data['EVT_ID']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID']) : NULL;
468
+		$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>') : '';
469
+		$this->_template_args['after_list_table'] = $this->_display_legend($this->_transaction_legend_items());
470 470
 		$this->display_admin_list_table_page_with_no_sidebar();
471 471
 	}
472 472
 
@@ -480,8 +480,8 @@  discard block
 block discarded – undo
480 480
 	*	@return void
481 481
 	*/
482 482
 	protected function _transaction_details() {
483
-		do_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction );
484
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
483
+		do_action('AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction);
484
+		EE_Registry::instance()->load_helper('MSG_Template');
485 485
 
486 486
 		$this->_set_transaction_status_array();
487 487
 
@@ -494,53 +494,53 @@  discard block
 block discarded – undo
494 494
 		$attendee = $primary_registration instanceof EE_Registration ? $primary_registration->attendee() : NULL;
495 495
 
496 496
 		$this->_template_args['txn_nmbr']['value'] = $this->_transaction->ID();
497
-		$this->_template_args['txn_nmbr']['label'] = __( 'Transaction Number', 'event_espresso' );
497
+		$this->_template_args['txn_nmbr']['label'] = __('Transaction Number', 'event_espresso');
498 498
 
499
-		$this->_template_args['txn_datetime']['value'] = $this->_transaction->get_datetime('TXN_timestamp', 'l F j, Y', 'g:i:s a' );
500
-		$this->_template_args['txn_datetime']['label'] = __( 'Date', 'event_espresso' );
499
+		$this->_template_args['txn_datetime']['value'] = $this->_transaction->get_datetime('TXN_timestamp', 'l F j, Y', 'g:i:s a');
500
+		$this->_template_args['txn_datetime']['label'] = __('Date', 'event_espresso');
501 501
 
502
-		$this->_template_args['txn_status']['value'] = self::$_txn_status[ $this->_transaction->get('STS_ID') ];
503
-		$this->_template_args['txn_status']['label'] = __( 'Transaction Status', 'event_espresso' );
504
-		$this->_template_args['txn_status']['class'] = 'status-' . $this->_transaction->get('STS_ID');
502
+		$this->_template_args['txn_status']['value'] = self::$_txn_status[$this->_transaction->get('STS_ID')];
503
+		$this->_template_args['txn_status']['label'] = __('Transaction Status', 'event_espresso');
504
+		$this->_template_args['txn_status']['class'] = 'status-'.$this->_transaction->get('STS_ID');
505 505
 
506 506
 		$this->_template_args['grand_total'] = $this->_transaction->get('TXN_total');
507 507
 		$this->_template_args['total_paid'] = $this->_transaction->get('TXN_paid');
508 508
 
509
-		if ( $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_transactions_send_payment_reminder' ) ) {
510
-			EE_Registry::instance()->load_helper( 'MSG_Template' );
511
-			$this->_template_args['send_payment_reminder_button'] = EEH_MSG_Template::is_mt_active( 'payment_reminder' )
509
+		if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder')) {
510
+			EE_Registry::instance()->load_helper('MSG_Template');
511
+			$this->_template_args['send_payment_reminder_button'] = EEH_MSG_Template::is_mt_active('payment_reminder')
512 512
 				 && $this->_transaction->get('STS_ID') != EEM_Transaction::complete_status_code
513 513
 				 && $this->_transaction->get('STS_ID') != EEM_Transaction::overpaid_status_code
514
-				 ? 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' )
514
+				 ? 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')
515 515
 				 : '';
516 516
 		} else {
517 517
 			$this->_template_args['send_payment_reminder_button'] = '';
518 518
 		}
519 519
 
520 520
 		$amount_due = $this->_transaction->get('TXN_total') - $this->_transaction->get('TXN_paid');
521
-		$this->_template_args['amount_due'] =  ' <span id="txn-admin-total-amount-due">' . EEH_Template::format_currency( $amount_due, TRUE ) . '</span>';
522
-		if ( EE_Registry::instance()->CFG->currency->sign_b4 ) {
523
-			$this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign . $this->_template_args['amount_due'];
521
+		$this->_template_args['amount_due'] = ' <span id="txn-admin-total-amount-due">'.EEH_Template::format_currency($amount_due, TRUE).'</span>';
522
+		if (EE_Registry::instance()->CFG->currency->sign_b4) {
523
+			$this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign.$this->_template_args['amount_due'];
524 524
 		} else {
525
-			$this->_template_args['amount_due'] = $this->_template_args['amount_due'] . EE_Registry::instance()->CFG->currency->sign;
525
+			$this->_template_args['amount_due'] = $this->_template_args['amount_due'].EE_Registry::instance()->CFG->currency->sign;
526 526
 		}
527
-		$this->_template_args['amount_due_class'] =  '';
527
+		$this->_template_args['amount_due_class'] = '';
528 528
 
529
-		if ( $this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total') ) {
529
+		if ($this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total')) {
530 530
 			// paid in full
531
-			$this->_template_args['amount_due'] =  FALSE;
532
-		} elseif ( $this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total') ) {
531
+			$this->_template_args['amount_due'] = FALSE;
532
+		} elseif ($this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total')) {
533 533
 			// overpaid
534
-			$this->_template_args['amount_due_class'] =  'txn-overview-no-payment-spn';
535
-		} elseif (( $this->_transaction->get('TXN_total') > 0 ) && ( $this->_transaction->get('TXN_paid') > 0 )) {
534
+			$this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn';
535
+		} elseif (($this->_transaction->get('TXN_total') > 0) && ($this->_transaction->get('TXN_paid') > 0)) {
536 536
 			// monies owing
537
-			$this->_template_args['amount_due_class'] =  'txn-overview-part-payment-spn';
538
-		} elseif (( $this->_transaction->get('TXN_total') > 0 ) && ( $this->_transaction->get('TXN_paid') == 0 )) {
537
+			$this->_template_args['amount_due_class'] = 'txn-overview-part-payment-spn';
538
+		} elseif (($this->_transaction->get('TXN_total') > 0) && ($this->_transaction->get('TXN_paid') == 0)) {
539 539
 			// no payments made yet
540
-			$this->_template_args['amount_due_class'] =  'txn-overview-no-payment-spn';
541
-		} elseif ( $this->_transaction->get('TXN_total') == 0 ) {
540
+			$this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn';
541
+		} elseif ($this->_transaction->get('TXN_total') == 0) {
542 542
 			// free event
543
-			$this->_template_args['amount_due'] =  FALSE;
543
+			$this->_template_args['amount_due'] = FALSE;
544 544
 		}
545 545
 
546 546
 		$gateway = $this->_transaction->get_extra_meta('gateway', true, FALSE);
@@ -548,13 +548,13 @@  discard block
 block discarded – undo
548 548
 		$this->_template_args['method_of_payment'] = $gateway;
549 549
 		$this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
550 550
 		// link back to overview
551
-		$this->_template_args['txn_overview_url'] = ! empty ( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : TXN_ADMIN_URL;
551
+		$this->_template_args['txn_overview_url'] = ! empty ($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : TXN_ADMIN_URL;
552 552
 
553 553
 		// grab messages at the last second
554 554
 		$this->_template_args['notices'] = EE_Error::get_notices();
555 555
 		// path to template
556
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_header.template.php';
557
-		$this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
556
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_header.template.php';
557
+		$this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
558 558
 
559 559
 		// the details template wrapper
560 560
 		$this->display_admin_page_with_sidebar();
@@ -573,18 +573,18 @@  discard block
 block discarded – undo
573 573
 
574 574
 		$this->_set_transaction_object();
575 575
 
576
-		add_meta_box( 'edit-txn-details-mbox', __( 'Transaction Details', 'event_espresso' ), array( $this, 'txn_details_meta_box' ), $this->_wp_page_slug, 'normal', 'high' );
576
+		add_meta_box('edit-txn-details-mbox', __('Transaction Details', 'event_espresso'), array($this, 'txn_details_meta_box'), $this->_wp_page_slug, 'normal', 'high');
577 577
 		add_meta_box(
578 578
 			'edit-txn-attendees-mbox',
579
-			__( 'Attendees Registered in this Transaction', 'event_espresso' ),
580
-			array( $this, 'txn_attendees_meta_box' ),
579
+			__('Attendees Registered in this Transaction', 'event_espresso'),
580
+			array($this, 'txn_attendees_meta_box'),
581 581
 			$this->_wp_page_slug,
582 582
 			'normal',
583 583
 			'high',
584
-			array( 'TXN_ID' => $this->_transaction->ID() )
584
+			array('TXN_ID' => $this->_transaction->ID())
585 585
 		);
586
-		add_meta_box( 'edit-txn-registrant-mbox', __( 'Primary Contact', 'event_espresso' ), array( $this, 'txn_registrant_side_meta_box' ), $this->_wp_page_slug, 'side', 'high' );
587
-		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' );
586
+		add_meta_box('edit-txn-registrant-mbox', __('Primary Contact', 'event_espresso'), array($this, 'txn_registrant_side_meta_box'), $this->_wp_page_slug, 'side', 'high');
587
+		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');
588 588
 
589 589
 	}
590 590
 
@@ -604,14 +604,14 @@  discard block
 block discarded – undo
604 604
 		$this->_template_args['attendee'] = $this->_transaction->primary_registration()->attendee();
605 605
 
606 606
 		//get line items from transaction
607
-		$this->_template_args['line_items'] = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => 'line-item' ) ) );
607
+		$this->_template_args['line_items'] = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => 'line-item')));
608 608
 		$this->_template_args['REG_code'] = $this->_transaction->get_first_related('Registration')->get('REG_code');
609 609
 
610 610
 		// process taxes
611
-		$taxes = $this->_transaction->get_many_related( 'Line_Item', array( array( 'LIN_type' => EEM_Line_Item::type_tax )));
612
-		$this->_template_args['taxes'] = ! empty( $taxes ) ? $taxes : FALSE;
611
+		$taxes = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => EEM_Line_Item::type_tax)));
612
+		$this->_template_args['taxes'] = ! empty($taxes) ? $taxes : FALSE;
613 613
 
614
-		$this->_template_args['grand_total'] = EEH_Template::format_currency($this->_transaction->get('TXN_total'), FALSE, FALSE );
614
+		$this->_template_args['grand_total'] = EEH_Template::format_currency($this->_transaction->get('TXN_total'), FALSE, FALSE);
615 615
 		$this->_template_args['grand_raw_total'] = $this->_transaction->get('TXN_total');
616 616
 		$this->_template_args['TXN_status'] = $this->_transaction->get('STS_ID');
617 617
 
@@ -620,63 +620,63 @@  discard block
 block discarded – undo
620 620
 		// process payment details
621 621
 		$payments = $this->_transaction->get_many_related('Payment');
622 622
 		$this->_template_args['payments'] = $payments;
623
-		if ( empty( $this->_template_args['payments'] )) {
623
+		if (empty($this->_template_args['payments'])) {
624 624
 			$this->_template_args['payments'] = FALSE;
625 625
 		}
626 626
 
627
-		$this->_template_args['edit_payment_url'] = add_query_arg( array( 'action' => 'edit_payment'  ), TXN_ADMIN_URL );
628
-		$this->_template_args['delete_payment_url'] = add_query_arg( array( 'action' => 'espresso_delete_payment' ), TXN_ADMIN_URL );
627
+		$this->_template_args['edit_payment_url'] = add_query_arg(array('action' => 'edit_payment'), TXN_ADMIN_URL);
628
+		$this->_template_args['delete_payment_url'] = add_query_arg(array('action' => 'espresso_delete_payment'), TXN_ADMIN_URL);
629 629
 
630
-		if ( isset( $txn_details['invoice_number'] )) {
630
+		if (isset($txn_details['invoice_number'])) {
631 631
 			$this->_template_args['txn_details']['invoice_number']['value'] = $this->_template_args['REG_code'];
632
-			$this->_template_args['txn_details']['invoice_number']['label'] = __( 'Invoice Number', 'event_espresso' );
632
+			$this->_template_args['txn_details']['invoice_number']['label'] = __('Invoice Number', 'event_espresso');
633 633
 		}
634 634
 
635 635
 		$this->_template_args['txn_details']['registration_session']['value'] = $this->_transaction->get_first_related('Registration')->get('REG_session');
636
-		$this->_template_args['txn_details']['registration_session']['label'] = __( 'Registration Session', 'event_espresso' );
636
+		$this->_template_args['txn_details']['registration_session']['label'] = __('Registration Session', 'event_espresso');
637 637
 
638
-		$this->_template_args['txn_details']['ip_address']['value'] = isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '';
639
-		$this->_template_args['txn_details']['ip_address']['label'] = __( 'Transaction placed from IP', 'event_espresso' );
638
+		$this->_template_args['txn_details']['ip_address']['value'] = isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '';
639
+		$this->_template_args['txn_details']['ip_address']['label'] = __('Transaction placed from IP', 'event_espresso');
640 640
 
641
-		$this->_template_args['txn_details']['user_agent']['value'] = isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '';
642
-		$this->_template_args['txn_details']['user_agent']['label'] = __( 'Registrant User Agent', 'event_espresso' );
641
+		$this->_template_args['txn_details']['user_agent']['value'] = isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '';
642
+		$this->_template_args['txn_details']['user_agent']['label'] = __('Registrant User Agent', 'event_espresso');
643 643
 
644 644
 		$reg_steps = '<ul>';
645
-		foreach ( $this->_transaction->reg_steps() as $reg_step => $reg_step_status ) {
645
+		foreach ($this->_transaction->reg_steps() as $reg_step => $reg_step_status) {
646 646
 //			EEH_Debug_Tools::printr( $reg_step, '$reg_step', __FILE__, __LINE__ );
647
-			switch ( $reg_step_status ) {
647
+			switch ($reg_step_status) {
648 648
 				case $reg_step_status === true :
649
-					$reg_steps .= '<li>' . sprintf( __( '%1$s : Completed', 'event_espresso' ), ucwords( str_replace( '_', ' ', $reg_step ) ) ) . '</li>';
649
+					$reg_steps .= '<li>'.sprintf(__('%1$s : Completed', 'event_espresso'), ucwords(str_replace('_', ' ', $reg_step))).'</li>';
650 650
 					break;
651 651
 				case $reg_step_status === false :
652
-					$reg_steps .= '<li>' . sprintf( __( '%1$s : Never Initiated', 'event_espresso' ), ucwords( str_replace( '_', ' ', $reg_step ) ) ) . '</li>';
652
+					$reg_steps .= '<li>'.sprintf(__('%1$s : Never Initiated', 'event_espresso'), ucwords(str_replace('_', ' ', $reg_step))).'</li>';
653 653
 					break;
654
-				case is_numeric( $reg_step_status ) :
655
-					$reg_steps .= '<li>' . sprintf(
656
-							__( '%1$s : Initiated %2$s', 'event_espresso' ),
657
-							ucwords( str_replace( '_', ' ', $reg_step ) ),
658
-							gmdate( get_option('date_format') . ' ' . get_option('time_format'), ( $reg_step_status + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) )
659
-						) . '</li>';
654
+				case is_numeric($reg_step_status) :
655
+					$reg_steps .= '<li>'.sprintf(
656
+							__('%1$s : Initiated %2$s', 'event_espresso'),
657
+							ucwords(str_replace('_', ' ', $reg_step)),
658
+							gmdate(get_option('date_format').' '.get_option('time_format'), ($reg_step_status + (get_option('gmt_offset') * HOUR_IN_SECONDS)))
659
+						).'</li>';
660 660
 					break;
661 661
 			}
662 662
 		}
663 663
 		$reg_steps .= '</ul>';
664 664
 		$this->_template_args['txn_details']['reg_steps']['value'] = $reg_steps;
665
-		$this->_template_args['txn_details']['reg_steps']['label'] = __( 'Registration Step Progress', 'event_espresso' );
665
+		$this->_template_args['txn_details']['reg_steps']['label'] = __('Registration Step Progress', 'event_espresso');
666 666
 
667 667
 
668
-		$this->_get_payment_methods( $payments );
668
+		$this->_get_payment_methods($payments);
669 669
 		$this->_get_payment_status_array();
670 670
 		$this->_get_reg_status_selection(); //sets up the template args for the reg status array for the transaction.
671 671
 
672
-		$this->_template_args['transaction_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'transaction'  ), TXN_ADMIN_URL );
673
-		$this->_template_args['apply_payment_form_url'] = add_query_arg( array( 'page' => 'espresso_transactions', 'action' => 'espresso_apply_payment' ), WP_AJAX_URL );
674
-		$this->_template_args['delete_payment_form_url'] = add_query_arg( array( 'page' => 'espresso_transactions', 'action' => 'espresso_delete_payment' ), WP_AJAX_URL );
672
+		$this->_template_args['transaction_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'transaction'), TXN_ADMIN_URL);
673
+		$this->_template_args['apply_payment_form_url'] = add_query_arg(array('page' => 'espresso_transactions', 'action' => 'espresso_apply_payment'), WP_AJAX_URL);
674
+		$this->_template_args['delete_payment_form_url'] = add_query_arg(array('page' => 'espresso_transactions', 'action' => 'espresso_delete_payment'), WP_AJAX_URL);
675 675
 
676 676
 		// 'espresso_delete_payment_nonce'
677 677
 
678
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_main_meta_box_txn_details.template.php';
679
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
678
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_main_meta_box_txn_details.template.php';
679
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
680 680
 
681 681
 	}
682 682
 
@@ -694,9 +694,9 @@  discard block
 block discarded – undo
694 694
 		$statuses = EEM_Registration::reg_status_array(array(), TRUE);
695 695
 		//let's add a "don't change" option.
696 696
 		$status_array['NAN'] = __('Leave the Same', 'event_espresso');
697
-		$status_array = array_merge( $status_array, $statuses );
698
-		$this->_template_args['status_change_select'] = EEH_Form_Fields::select_input( 'txn_reg_status_change[reg_status]', $status_array, 'NAN', '', 'txn-reg-status-change-reg-status' );
699
-		$this->_template_args['delete_status_change_select'] = EEH_Form_Fields::select_input( 'delete_txn_reg_status_change[reg_status]', $status_array, 'NAN', '', 'delete-txn-reg-status-change-reg-status' );
697
+		$status_array = array_merge($status_array, $statuses);
698
+		$this->_template_args['status_change_select'] = EEH_Form_Fields::select_input('txn_reg_status_change[reg_status]', $status_array, 'NAN', '', 'txn-reg-status-change-reg-status');
699
+		$this->_template_args['delete_status_change_select'] = EEH_Form_Fields::select_input('delete_txn_reg_status_change[reg_status]', $status_array, 'NAN', '', 'delete-txn-reg-status-change-reg-status');
700 700
 
701 701
 	}
702 702
 
@@ -711,21 +711,21 @@  discard block
 block discarded – undo
711 711
 	 * @param EE_Payment[] to show on this page
712 712
 	 *	@return void
713 713
 	 */
714
-	private function _get_payment_methods( $payments = array() ) {
714
+	private function _get_payment_methods($payments = array()) {
715 715
 		$payment_methods_of_payments = array();
716
-		foreach( $payments as $payment ){
717
-			if( $payment instanceof EE_Payment ){
718
-				$payment_methods_of_payments[] = $payment->get( 'PMD_ID' );
716
+		foreach ($payments as $payment) {
717
+			if ($payment instanceof EE_Payment) {
718
+				$payment_methods_of_payments[] = $payment->get('PMD_ID');
719 719
 			}
720 720
 		}
721
-		if( $payment_methods_of_payments ){
722
-			$query_args = array( array( 'OR*payment_method_for_payment' => array(
723
-					'PMD_ID' => array( 'IN', $payment_methods_of_payments ),
724
-					'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) ) );
725
-		}else{
726
-			$query_args = array( array( 'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) );
721
+		if ($payment_methods_of_payments) {
722
+			$query_args = array(array('OR*payment_method_for_payment' => array(
723
+					'PMD_ID' => array('IN', $payment_methods_of_payments),
724
+					'PMD_scope' => array('LIKE', '%'.EEM_Payment_Method::scope_admin.'%') )));
725
+		} else {
726
+			$query_args = array(array('PMD_scope' => array('LIKE', '%'.EEM_Payment_Method::scope_admin.'%')));
727 727
 		}
728
-		$this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all( $query_args );
728
+		$this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all($query_args);
729 729
 	}
730 730
 
731 731
 
@@ -739,52 +739,52 @@  discard block
 block discarded – undo
739 739
 	 * @param array $metabox
740 740
 	 * @return void
741 741
 	 */
742
-	public function txn_attendees_meta_box( $post, $metabox = array( 'args' => array() )) {
742
+	public function txn_attendees_meta_box($post, $metabox = array('args' => array())) {
743 743
 
744
-		extract( $metabox['args'] );
744
+		extract($metabox['args']);
745 745
 		$this->_template_args['post'] = $post;
746 746
 		$this->_template_args['event_attendees'] = array();
747 747
 		// process items in cart
748
-		$line_items = $this->_transaction->get_many_related('Line_Item', array( array( 'LIN_type' => 'line-item' ) ) );
749
-		if ( ! empty( $line_items )) {
750
-			foreach ( $line_items as $item ) {
751
-				if ( $item instanceof EE_Line_Item ) {
748
+		$line_items = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => 'line-item')));
749
+		if ( ! empty($line_items)) {
750
+			foreach ($line_items as $item) {
751
+				if ($item instanceof EE_Line_Item) {
752 752
 					$ticket = $item->ticket();
753
-					if ( empty( $ticket )) {
753
+					if (empty($ticket)) {
754 754
 						continue; //right now we're only handling tickets here.  Cause its expected that only tickets will have attendees right?
755 755
 					}
756
-					$ticket_price = EEH_Template::format_currency( $item->get( 'LIN_unit_price' ));
756
+					$ticket_price = EEH_Template::format_currency($item->get('LIN_unit_price'));
757 757
 					$event = $ticket->get_first_related('Registration')->get_first_related('Event');
758
-					$event_name = $event instanceof EE_Event ? $event->get('EVT_name') . ' - ' . $item->get('LIN_name') : '';
758
+					$event_name = $event instanceof EE_Event ? $event->get('EVT_name').' - '.$item->get('LIN_name') : '';
759 759
 
760
-					$registrations = $ticket->get_many_related('Registration', array( array('TXN_ID' => $this->_transaction->ID() )));
761
-					foreach( $registrations as $registration ) {
762
-						$this->_template_args['event_attendees'][$registration->ID()]['att_num'] 						= $registration->get('REG_count');
763
-						$this->_template_args['event_attendees'][$registration->ID()]['event_ticket_name'] 	= $event_name;
764
-						$this->_template_args['event_attendees'][$registration->ID()]['ticket_price'] 				= $ticket_price;
760
+					$registrations = $ticket->get_many_related('Registration', array(array('TXN_ID' => $this->_transaction->ID())));
761
+					foreach ($registrations as $registration) {
762
+						$this->_template_args['event_attendees'][$registration->ID()]['att_num'] = $registration->get('REG_count');
763
+						$this->_template_args['event_attendees'][$registration->ID()]['event_ticket_name'] = $event_name;
764
+						$this->_template_args['event_attendees'][$registration->ID()]['ticket_price'] = $ticket_price;
765 765
 						// attendee info
766 766
 						$attendee = $registration->get_first_related('Attendee');
767
-						if ( $attendee instanceof EE_Attendee ) {
767
+						if ($attendee instanceof EE_Attendee) {
768 768
 							$this->_template_args['event_attendees'][$registration->ID()]['att_id'] 			= $attendee->ID();
769 769
 							$this->_template_args['event_attendees'][$registration->ID()]['attendee'] 	= $attendee->full_name();
770
-							$this->_template_args['event_attendees'][$registration->ID()]['email'] 			= $attendee->email();
771
-							$this->_template_args['event_attendees'][$registration->ID()]['address'] 		=  implode(',<br>', $attendee->full_address_as_array() );
770
+							$this->_template_args['event_attendees'][$registration->ID()]['email'] = $attendee->email();
771
+							$this->_template_args['event_attendees'][$registration->ID()]['address'] 		= implode(',<br>', $attendee->full_address_as_array());
772 772
 						} else {
773 773
 							$this->_template_args['event_attendees'][$registration->ID()]['att_id'] 			= '';
774 774
 							$this->_template_args['event_attendees'][$registration->ID()]['attendee'] 	= '';
775
-							$this->_template_args['event_attendees'][$registration->ID()]['email'] 			= '';
775
+							$this->_template_args['event_attendees'][$registration->ID()]['email'] = '';
776 776
 							$this->_template_args['event_attendees'][$registration->ID()]['address'] 		= '';
777 777
 						}
778 778
 					}
779 779
 				}
780 780
 			}
781 781
 
782
-			$this->_template_args['transaction_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'attendees'  ), TXN_ADMIN_URL );
783
-			echo EEH_Template::display_template( TXN_TEMPLATE_PATH . 'txn_admin_details_main_meta_box_attendees.template.php', $this->_template_args, TRUE );
782
+			$this->_template_args['transaction_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'attendees'), TXN_ADMIN_URL);
783
+			echo EEH_Template::display_template(TXN_TEMPLATE_PATH.'txn_admin_details_main_meta_box_attendees.template.php', $this->_template_args, TRUE);
784 784
 
785 785
 		} else {
786 786
 			echo sprintf(
787
-				__( '%1$sFor some reason, there are no attendees registered for this transaction. Likely the registration was abandoned in process.%2$s', 'event_espresso' ),
787
+				__('%1$sFor some reason, there are no attendees registered for this transaction. Likely the registration was abandoned in process.%2$s', 'event_espresso'),
788 788
 				'<p class="important-notice">',
789 789
 				'</p>'
790 790
 			);
@@ -803,24 +803,24 @@  discard block
 block discarded – undo
803 803
 	 */
804 804
 	public function txn_registrant_side_meta_box() {
805 805
 		$primary_att = $this->_transaction->primary_registration()->get_first_related('Attendee');
806
-		if ( ! $primary_att instanceof EE_Attendee ) {
806
+		if ( ! $primary_att instanceof EE_Attendee) {
807 807
 			$this->_template_args['no_attendee_message'] = __('There is no attached contact for this registration.  The transaction either failed due to an error or was abandoned.', 'event_espresso');
808 808
 			$primary_att = EEM_Attendee::instance()->create_default_object();
809 809
 		}
810
-		$this->_template_args['ATT_ID'] 							= $primary_att->get('ATT_ID');
810
+		$this->_template_args['ATT_ID'] = $primary_att->get('ATT_ID');
811 811
 		$this->_template_args['prime_reg_fname'] 		= $primary_att->get('ATT_fname');
812 812
 		$this->_template_args['prime_reg_lname'] 		= $primary_att->get('ATT_lname');
813
-		$this->_template_args['prime_reg_email'] 			= $primary_att->get('ATT_email');
813
+		$this->_template_args['prime_reg_email'] = $primary_att->get('ATT_email');
814 814
 		$this->_template_args['prime_reg_address'] 		= $primary_att->get('ATT_address');
815 815
 		$this->_template_args['prime_reg_address2'] 	= $primary_att->get('ATT_address2');
816 816
 		$this->_template_args['prime_reg_city'] 			= $primary_att->get('ATT_city');
817 817
 		$this->_template_args['prime_reg_zip'] 				= $primary_att->get('ATT_zip');
818 818
 		$this->_template_args['prime_reg_phone'] 		= $primary_att->get('ATT_phone');
819 819
 		$state = $primary_att->state_obj();
820
-		$this->_template_args['prime_reg_state'] 			= $state instanceof EE_State ? $state->get('STA_name' ) : '';
821
-		$this->_template_args['prime_reg_country'] 		= $primary_att->get('CNT_ISO');
822
-		$this->_template_args['registrant_form_url'] 		= add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'registrant'  ), TXN_ADMIN_URL );
823
-		echo EEH_Template::display_template( TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE );
820
+		$this->_template_args['prime_reg_state'] = $state instanceof EE_State ? $state->get('STA_name') : '';
821
+		$this->_template_args['prime_reg_country'] = $primary_att->get('CNT_ISO');
822
+		$this->_template_args['registrant_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'registrant'), TXN_ADMIN_URL);
823
+		echo EEH_Template::display_template(TXN_TEMPLATE_PATH.'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE);
824 824
 	}
825 825
 
826 826
 
@@ -835,10 +835,10 @@  discard block
 block discarded – undo
835 835
 	public function txn_billing_info_side_meta_box() {
836 836
 
837 837
 		$this->_template_args['billing_form'] = $this->_transaction->billing_info();
838
-		$this->_template_args['billing_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'billing'  ), TXN_ADMIN_URL );
838
+		$this->_template_args['billing_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'billing'), TXN_ADMIN_URL);
839 839
 
840
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_billing_info.template.php';
841
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );/**/
840
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_side_meta_box_billing_info.template.php';
841
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); /**/
842 842
 	}
843 843
 
844 844
 
@@ -852,9 +852,9 @@  discard block
 block discarded – undo
852 852
 	*/
853 853
 	public function apply_payments_or_refunds() {
854 854
 
855
-		$json_response_data = array( 'return_data' => FALSE );
855
+		$json_response_data = array('return_data' => FALSE);
856 856
 
857
-		if ( isset( $this->_req_data['txn_admin_payment'] ) && isset( $this->_req_data['txn_admin_payment']['TXN_ID'] )) {
857
+		if (isset($this->_req_data['txn_admin_payment']) && isset($this->_req_data['txn_admin_payment']['TXN_ID'])) {
858 858
 			//save  the new payment
859 859
 			$payment = EE_Payment::new_instance(
860 860
 				array(
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
 					'PMD_ID' => $this->_req_data['txn_admin_payment']['PMD_ID'],
866 866
 					// payments have a type value of 1 and refunds have a type value of -1
867 867
 					// so multiplying amount by type will give a positive value for payments, and negative values for refunds
868
-					'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'] ),
868
+					'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']),
869 869
 					'PAY_gateway_response' => '',
870 870
 					'PAY_txn_id_chq_nmbr' => $this->_req_data['txn_admin_payment']['txn_id_chq_nmbr'],
871 871
 					'PAY_po_number' => $this->_req_data['txn_admin_payment']['po_number'],
@@ -874,23 +874,23 @@  discard block
 block discarded – undo
874 874
 					'PAY_ID' => $this->_req_data['txn_admin_payment']['PAY_ID']
875 875
 				)
876 876
 			);
877
-			if ( ! $payment->save() ){
878
-				$msg = __( 'An error occurred. The payment has not been processed successfully.', 'event_espresso' );
879
-				EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
877
+			if ( ! $payment->save()) {
878
+				$msg = __('An error occurred. The payment has not been processed successfully.', 'event_espresso');
879
+				EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
880 880
 			}
881 881
 			// get the TXN for this payment
882 882
 			$transaction = $payment->transaction();
883 883
 			// verify transaction
884
-			if ( $transaction instanceof EE_Transaction ) {
884
+			if ($transaction instanceof EE_Transaction) {
885 885
 				/** @type EE_Transaction_Payments $transaction_payments */
886
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
886
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
887 887
 				//update the transaction with this payment
888
-				if ( $transaction_payments->calculate_total_payments_and_update_status( $transaction )) {
889
-					$msg =__('The payment has been processed successfully.', 'event_espresso');
890
-					EE_Error::add_success( $msg, __FILE__, __FUNCTION__, __LINE__ );
888
+				if ($transaction_payments->calculate_total_payments_and_update_status($transaction)) {
889
+					$msg = __('The payment has been processed successfully.', 'event_espresso');
890
+					EE_Error::add_success($msg, __FILE__, __FUNCTION__, __LINE__);
891 891
 				} else {
892
-					$msg = __( 'The payment was processed successfully but the amount paid for the transaction was not updated.', 'event_espresso');
893
-					EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
892
+					$msg = __('The payment was processed successfully but the amount paid for the transaction was not updated.', 'event_espresso');
893
+					EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
894 894
 				}
895 895
 
896 896
 				//prepare to render page
@@ -901,33 +901,33 @@  discard block
 block discarded – undo
901 901
 				$json_response_data['return_data']['pay_status'] = $payment->STS_ID();
902 902
 				$json_response_data['return_data']['PAY_ID'] = $payment->ID();
903 903
 				$json_response_data['return_data']['STS_ID'] = $payment->STS_ID();
904
-				$json_response_data['return_data']['status'] = self::$_pay_status[ $payment->STS_ID() ];
905
-				$json_response_data['return_data']['date'] = $payment->timestamp( 'Y-m-d', 'h:i a' );
906
-				$json_response_data['return_data']['method'] = strtoupper( $payment->source() ) ;
904
+				$json_response_data['return_data']['status'] = self::$_pay_status[$payment->STS_ID()];
905
+				$json_response_data['return_data']['date'] = $payment->timestamp('Y-m-d', 'h:i a');
906
+				$json_response_data['return_data']['method'] = strtoupper($payment->source());
907 907
 				$json_response_data['return_data']['PM_ID'] = $payment->payment_method() ? $payment->payment_method()->ID() : 1;
908
-				$json_response_data['return_data']['gateway'] =$payment->payment_method() ? $payment->payment_method()->admin_name()  : __("Unknown", 'event_espresso');
908
+				$json_response_data['return_data']['gateway'] = $payment->payment_method() ? $payment->payment_method()->admin_name() : __("Unknown", 'event_espresso');
909 909
 				$json_response_data['return_data']['gateway_response'] = $payment->gateway_response();
910 910
 				$json_response_data['return_data']['txn_id_chq_nmbr'] = $payment->txn_id_chq_nmbr();
911 911
 				$json_response_data['return_data']['po_number'] = $payment->po_number();
912 912
 				$json_response_data['return_data']['extra_accntng'] = $payment->extra_accntng();
913 913
 
914
-				$this->_process_payment_notification( $payment );
914
+				$this->_process_payment_notification($payment);
915 915
 
916
-				if ( isset($this->_req_data['txn_reg_status_change'] )) {
917
-					$this->_process_registration_status_change( $transaction );
916
+				if (isset($this->_req_data['txn_reg_status_change'])) {
917
+					$this->_process_registration_status_change($transaction);
918 918
 				}
919 919
 
920 920
 			} else {
921
-				EE_Error::add_error( __( 'A valid Transaction for this payment could not be retrieved.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
921
+				EE_Error::add_error(__('A valid Transaction for this payment could not be retrieved.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
922 922
 			}
923 923
 
924 924
 		} else {
925
-			$msg = __( 'The payment form data could not be loaded.', 'event_espresso' );
926
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
925
+			$msg = __('The payment form data could not be loaded.', 'event_espresso');
926
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
927 927
 		}
928 928
 
929
-		$notices = EE_Error::get_notices( FALSE, FALSE, FALSE );
930
-		echo json_encode( array_merge( $json_response_data, $notices ));
929
+		$notices = EE_Error::get_notices(FALSE, FALSE, FALSE);
930
+		echo json_encode(array_merge($json_response_data, $notices));
931 931
 		die();
932 932
 
933 933
 	}
@@ -940,16 +940,16 @@  discard block
 block discarded – undo
940 940
 	 * @param  EE_Transaction $transaction
941 941
 	 * @return boolean
942 942
 	 */
943
-	protected function _process_registration_status_change( EE_Transaction $transaction ) {
943
+	protected function _process_registration_status_change(EE_Transaction $transaction) {
944 944
 		// first if there is no change in status then we get out.
945
-		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' ) {
945
+		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') {
946 946
 			//no error message, no change requested, just nothing to do man.
947 947
 			return FALSE;
948 948
 		}
949 949
 		/** @type EE_Transaction_Processor $transaction_processor */
950
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
950
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
951 951
 		// made it here dude?  Oh WOW.  K, let's take care of changing the statuses
952
-		return $transaction_processor->manually_update_registration_statuses( $transaction, sanitize_text_field( $this->_req_data[ 'txn_reg_status_change' ][ 'reg_status' ] ));
952
+		return $transaction_processor->manually_update_registration_statuses($transaction, sanitize_text_field($this->_req_data['txn_reg_status_change']['reg_status']));
953 953
 //		$transaction_processor->finalize( $transaction, TRUE, FALSE);
954 954
 	}
955 955
 
@@ -963,16 +963,16 @@  discard block
 block discarded – undo
963 963
 	*/
964 964
 	public function delete_payment() {
965 965
 
966
-		$json_response_data = array( 'return_data' => FALSE );
967
-		$PAY_ID = isset( $this->_req_data['delete_txn_admin_payment'] ) && isset( $this->_req_data['delete_txn_admin_payment']['PAY_ID'] ) ? absint( $this->_req_data['delete_txn_admin_payment']['PAY_ID'] ) : 0;
968
-		$delete_txn_reg_status_change = isset( $this->_req_data['delete_txn_reg_status_change'] ) ? $this->_req_data['delete_txn_reg_status_change']: FALSE;
966
+		$json_response_data = array('return_data' => FALSE);
967
+		$PAY_ID = isset($this->_req_data['delete_txn_admin_payment']) && isset($this->_req_data['delete_txn_admin_payment']['PAY_ID']) ? absint($this->_req_data['delete_txn_admin_payment']['PAY_ID']) : 0;
968
+		$delete_txn_reg_status_change = isset($this->_req_data['delete_txn_reg_status_change']) ? $this->_req_data['delete_txn_reg_status_change'] : FALSE;
969 969
 
970
-		if ( $PAY_ID ) {
971
-			$payment = EEM_Payment::instance()->get_one_by_ID( $PAY_ID );
972
-			if ( $payment instanceof EE_Payment ) {
970
+		if ($PAY_ID) {
971
+			$payment = EEM_Payment::instance()->get_one_by_ID($PAY_ID);
972
+			if ($payment instanceof EE_Payment) {
973 973
 				/** @type EE_Transaction_Payments $transaction_payments */
974
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
975
-				if ( $transaction_payments->delete_payment_and_update_transaction( $payment )) {
974
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
975
+				if ($transaction_payments->delete_payment_and_update_transaction($payment)) {
976 976
 					$json_response_data['return_data'] = array(
977 977
 						'PAY_ID' => $PAY_ID,
978 978
 						'amount' => $payment->amount(),
@@ -981,27 +981,27 @@  discard block
 block discarded – undo
981 981
 						'pay_status' => $payment->STS_ID(),
982 982
 						'delete_txn_reg_status_change' => $delete_txn_reg_status_change
983 983
 					);
984
-					if ( $delete_txn_reg_status_change ) {
984
+					if ($delete_txn_reg_status_change) {
985 985
 						$this->_req_data['txn_reg_status_change'] = $delete_txn_reg_status_change;
986 986
 						//MAKE sure we also add the delete_txn_req_status_change to the
987 987
 						//$_REQUEST global because that's how messages will be looking
988 988
 						//for it.
989 989
 						$_REQUEST['txn_reg_status_change'] = $delete_txn_reg_status_change;
990
-						$this->_process_registration_status_change( $payment->transaction() );
990
+						$this->_process_registration_status_change($payment->transaction());
991 991
 					}
992 992
 				}
993 993
 
994 994
 			} else {
995
-				EE_Error::add_error( __( 'Valid Payment data could not be retrieved from the database.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
995
+				EE_Error::add_error(__('Valid Payment data could not be retrieved from the database.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
996 996
 			}
997 997
 
998 998
 		} else {
999
-			$msg = __( 'A valid Payment ID was not received, therefore payment form data could not be loaded.', 'event_espresso' );
1000
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
999
+			$msg = __('A valid Payment ID was not received, therefore payment form data could not be loaded.', 'event_espresso');
1000
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1001 1001
 		}
1002 1002
 
1003
-		$notices = EE_Error::get_notices( FALSE, FALSE, FALSE );
1004
-		echo json_encode( array_merge( $json_response_data, $notices ));
1003
+		$notices = EE_Error::get_notices(FALSE, FALSE, FALSE);
1004
+		echo json_encode(array_merge($json_response_data, $notices));
1005 1005
 		die();
1006 1006
 	}
1007 1007
 
@@ -1015,12 +1015,12 @@  discard block
 block discarded – undo
1015 1015
 	*	@return void
1016 1016
 	*/
1017 1017
 	protected function _send_payment_reminder() {
1018
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1019
-		$transaction = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
1020
-		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID'] ) : array();
1021
-		do_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction );
1018
+	    $TXN_ID = ( ! empty($this->_req_data['TXN_ID'])) ? absint($this->_req_data['TXN_ID']) : FALSE;
1019
+		$transaction = EEM_Transaction::instance()->get_one_by_ID($TXN_ID);
1020
+		$query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID']) : array();
1021
+		do_action('AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction);
1022 1022
 
1023
-		$this->_redirect_after_action( FALSE, __('payment reminder', 'event_espresso'), __('sent', 'event_espresso'), $query_args, TRUE );
1023
+		$this->_redirect_after_action(FALSE, __('payment reminder', 'event_espresso'), __('sent', 'event_espresso'), $query_args, TRUE);
1024 1024
 	}
1025 1025
 
1026 1026
 
@@ -1034,31 +1034,31 @@  discard block
 block discarded – undo
1034 1034
 	 * @param string   $view
1035 1035
 	 * @return mixed int = count || array of transaction objects
1036 1036
 	 */
1037
-	public function get_transactions( $perpage, $count = FALSE, $view = '' ) {
1037
+	public function get_transactions($perpage, $count = FALSE, $view = '') {
1038 1038
 
1039 1039
 		$TXN = EEM_Transaction::instance();
1040 1040
 
1041
-	    $start_date = isset( $this->_req_data['txn-filter-start-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-start-date'] ) : date( 'D M j, Y', strtotime( '-10 year' ));
1042
-	    $end_date = isset( $this->_req_data['txn-filter-end-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-end-date'] ) : date( 'D M j, Y' );
1041
+	    $start_date = isset($this->_req_data['txn-filter-start-date']) ? wp_strip_all_tags($this->_req_data['txn-filter-start-date']) : date('D M j, Y', strtotime('-10 year'));
1042
+	    $end_date = isset($this->_req_data['txn-filter-end-date']) ? wp_strip_all_tags($this->_req_data['txn-filter-end-date']) : date('D M j, Y');
1043 1043
 
1044 1044
 	    //make sure our timestamps start and end right at the boundaries for each day
1045
-	    $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1046
-	    $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1045
+	    $start_date = date('Y-m-d', strtotime($start_date)).' 00:00:00';
1046
+	    $end_date = date('Y-m-d', strtotime($end_date)).' 23:59:59';
1047 1047
 
1048 1048
 
1049 1049
 	    //convert to timestamps
1050
-	    $start_date = strtotime( $start_date );
1051
-	    $end_date = strtotime( $end_date );
1050
+	    $start_date = strtotime($start_date);
1051
+	    $end_date = strtotime($end_date);
1052 1052
 
1053 1053
 	    //makes sure start date is the lowest value and vice versa
1054
-	    $start_date = min( $start_date, $end_date );
1055
-	    $end_date = max( $start_date, $end_date );
1054
+	    $start_date = min($start_date, $end_date);
1055
+	    $end_date = max($start_date, $end_date);
1056 1056
 
1057 1057
 
1058 1058
 	    //set orderby
1059 1059
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
1060 1060
 
1061
-		switch ( $this->_req_data['orderby'] ) {
1061
+		switch ($this->_req_data['orderby']) {
1062 1062
 			case 'TXN_ID':
1063 1063
 				$orderby = 'TXN_ID';
1064 1064
 				break;
@@ -1072,64 +1072,64 @@  discard block
 block discarded – undo
1072 1072
 				$orderby = 'TXN_timestamp';
1073 1073
 		}
1074 1074
 
1075
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC';
1076
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
1077
-		$per_page = isset( $perpage ) && !empty( $perpage ) ? $perpage : 10;
1078
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
1075
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC';
1076
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
1077
+		$per_page = isset($perpage) && ! empty($perpage) ? $perpage : 10;
1078
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
1079 1079
 
1080
-		$offset = ($current_page-1)*$per_page;
1081
-		$limit = array( $offset, $per_page );
1080
+		$offset = ($current_page - 1) * $per_page;
1081
+		$limit = array($offset, $per_page);
1082 1082
 
1083 1083
 		$_where = array(
1084
-			'TXN_timestamp' => array('BETWEEN', array($start_date, $end_date) ),
1084
+			'TXN_timestamp' => array('BETWEEN', array($start_date, $end_date)),
1085 1085
 			'Registration.REG_count' => 1
1086 1086
 		);
1087 1087
 
1088
-		if ( isset( $this->_req_data['EVT_ID'] ) ) {
1088
+		if (isset($this->_req_data['EVT_ID'])) {
1089 1089
 			$_where['Registration.EVT_ID'] = $this->_req_data['EVT_ID'];
1090 1090
 		}
1091 1091
 
1092
-		if ( isset( $this->_req_data['s'] ) ) {
1093
-			$search_string = '%' . $this->_req_data['s'] . '%';
1092
+		if (isset($this->_req_data['s'])) {
1093
+			$search_string = '%'.$this->_req_data['s'].'%';
1094 1094
 			$_where['OR'] = array(
1095
-				'Registration.Event.EVT_name' => array( 'LIKE', $search_string ),
1096
-				'Registration.Event.EVT_desc' => array( 'LIKE', $search_string ),
1097
-				'Registration.Event.EVT_short_desc' => array( 'LIKE' , $search_string ),
1098
-				'Registration.Attendee.ATT_fname' => array( 'LIKE', $search_string ),
1099
-				'Registration.Attendee.ATT_lname' => array( 'LIKE', $search_string ),
1100
-				'Registration.Attendee.ATT_short_bio' => array( 'LIKE', $search_string ),
1101
-				'Registration.Attendee.ATT_email' => array('LIKE', $search_string ),
1102
-				'Registration.Attendee.ATT_address' => array( 'LIKE', $search_string ),
1103
-				'Registration.Attendee.ATT_address2' => array( 'LIKE', $search_string ),
1104
-				'Registration.Attendee.ATT_city' => array( 'LIKE', $search_string ),
1105
-				'Registration.REG_final_price' => array( 'LIKE', $search_string ),
1106
-				'Registration.REG_code' => array( 'LIKE', $search_string ),
1107
-				'Registration.REG_count' => array( 'LIKE' , $search_string ),
1108
-				'Registration.REG_group_size' => array( 'LIKE' , $search_string ),
1109
-				'Registration.Ticket.TKT_name' => array( 'LIKE', $search_string ),
1110
-				'Registration.Ticket.TKT_description' => array( 'LIKE', $search_string ),
1111
-				'Payment.PAY_source' => array('LIKE', $search_string ),
1112
-				'Payment.Payment_Method.PMD_name' => array('LIKE', $search_string ),
1113
-				'TXN_session_data' => array( 'LIKE', $search_string )
1095
+				'Registration.Event.EVT_name' => array('LIKE', $search_string),
1096
+				'Registration.Event.EVT_desc' => array('LIKE', $search_string),
1097
+				'Registration.Event.EVT_short_desc' => array('LIKE', $search_string),
1098
+				'Registration.Attendee.ATT_fname' => array('LIKE', $search_string),
1099
+				'Registration.Attendee.ATT_lname' => array('LIKE', $search_string),
1100
+				'Registration.Attendee.ATT_short_bio' => array('LIKE', $search_string),
1101
+				'Registration.Attendee.ATT_email' => array('LIKE', $search_string),
1102
+				'Registration.Attendee.ATT_address' => array('LIKE', $search_string),
1103
+				'Registration.Attendee.ATT_address2' => array('LIKE', $search_string),
1104
+				'Registration.Attendee.ATT_city' => array('LIKE', $search_string),
1105
+				'Registration.REG_final_price' => array('LIKE', $search_string),
1106
+				'Registration.REG_code' => array('LIKE', $search_string),
1107
+				'Registration.REG_count' => array('LIKE', $search_string),
1108
+				'Registration.REG_group_size' => array('LIKE', $search_string),
1109
+				'Registration.Ticket.TKT_name' => array('LIKE', $search_string),
1110
+				'Registration.Ticket.TKT_description' => array('LIKE', $search_string),
1111
+				'Payment.PAY_source' => array('LIKE', $search_string),
1112
+				'Payment.Payment_Method.PMD_name' => array('LIKE', $search_string),
1113
+				'TXN_session_data' => array('LIKE', $search_string)
1114 1114
 				);
1115 1115
 		}
1116 1116
 
1117 1117
 		//failed transactions
1118
-		$failed = ( ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'failed' && ! $count ) || ( $count && $view == 'failed' ) ? TRUE: FALSE;
1119
-		$abandoned = ( ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'abandoned' && ! $count ) || ( $count && $view == 'abandoned' ) ? TRUE: FALSE;
1118
+		$failed = ( ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'failed' && ! $count) || ($count && $view == 'failed') ? TRUE: FALSE;
1119
+		$abandoned = ( ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'abandoned' && ! $count) || ($count && $view == 'abandoned') ? TRUE: FALSE;
1120 1120
 
1121
-		if ( $failed ) {
1122
-			$_where[ 'STS_ID' ] = EEM_Transaction::failed_status_code;
1123
-		} else if ( $abandoned ) {
1121
+		if ($failed) {
1122
+			$_where['STS_ID'] = EEM_Transaction::failed_status_code;
1123
+		} else if ($abandoned) {
1124 1124
 				$_where['STS_ID'] = EEM_Transaction::abandoned_status_code;
1125 1125
 		} else {
1126
-				$_where['STS_ID'] = array( '!=', EEM_Transaction::failed_status_code );
1127
-				$_where['STS_ID*'] = array( '!=', EEM_Transaction::abandoned_status_code );
1126
+				$_where['STS_ID'] = array('!=', EEM_Transaction::failed_status_code);
1127
+				$_where['STS_ID*'] = array('!=', EEM_Transaction::abandoned_status_code);
1128 1128
 		}
1129 1129
 
1130
-		$query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'limit' => $limit );
1130
+		$query_params = array($_where, 'order_by' => array($orderby => $sort), 'limit' => $limit);
1131 1131
 
1132
-		$transactions = $count ? $TXN->count( array($_where), 'TXN_ID', TRUE ) : $TXN->get_all($query_params);
1132
+		$transactions = $count ? $TXN->count(array($_where), 'TXN_ID', TRUE) : $TXN->get_all($query_params);
1133 1133
 
1134 1134
 
1135 1135
 		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.
admin_pages/transactions/help_tours/Transaction_Details_Help_Tour.class.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -117,45 +117,45 @@  discard block
 block discarded – undo
117 117
 
118 118
 
119 119
 	protected function _start() {
120
-		$content = '<h3>' . __('View Transaction', 'event_espresso') . '</h3>';
121
-		$content .= '<p>' . __('This tour of the View Transaction page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>';
120
+		$content = '<h3>'.__('View Transaction', 'event_espresso').'</h3>';
121
+		$content .= '<p>'.__('This tour of the View Transaction page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>';
122 122
 		return $content;
123 123
 	}
124 124
 
125 125
 	protected function _txn_date_h2_stop() {
126
-		return '<p>' . __('This is the date that the transaction occurred on.', 'event_espresso') . '</p>';
126
+		return '<p>'.__('This is the date that the transaction occurred on.', 'event_espresso').'</p>';
127 127
 	}
128 128
 
129 129
 	protected function _txn_status_h2_stop() {
130
-		return '<p>' . __('View current status of the transaction. Available statuses are Complete, Failed, Incomplete, and Overpaid.', 'event_espresso') . '</p>';
130
+		return '<p>'.__('View current status of the transaction. Available statuses are Complete, Failed, Incomplete, and Overpaid.', 'event_espresso').'</p>';
131 131
 	}
132 132
 
133 133
 	protected function _txn_amount_due_h2_stop() {
134
-		return '<p>' . __('View the amount due for a transaction (will not appear if the transaction has been paid in full).', 'event_espresso') . '</p>';
134
+		return '<p>'.__('View the amount due for a transaction (will not appear if the transaction has been paid in full).', 'event_espresso').'</p>';
135 135
 	}
136 136
 
137 137
 	protected function _txn_details_metabox_stop() {
138
-		return '<p>' . __('The transaction details area displays various information including Line Item ID, Event Name, Event Date, Ticket Option, Price, Quantity, Line Total, Sales Tax, and the Grand Total. You can also view details about any payments made towards this transaction.', 'event_espresso') . '</p>';
138
+		return '<p>'.__('The transaction details area displays various information including Line Item ID, Event Name, Event Date, Ticket Option, Price, Quantity, Line Total, Sales Tax, and the Grand Total. You can also view details about any payments made towards this transaction.', 'event_espresso').'</p>';
139 139
 	}
140 140
 
141 141
 	protected function _txn_session_info_stop() {
142
-		return '<p>' . __('You can view additional information about the transaction by clicking on the link below. Examples of available information includes IP Address and User Agent.', 'event_espresso') . '</p>';
142
+		return '<p>'.__('You can view additional information about the transaction by clicking on the link below. Examples of available information includes IP Address and User Agent.', 'event_espresso').'</p>';
143 143
 	}
144 144
 
145 145
 	protected function _txn_attendees_metabox_stop() {
146
-		return '<p>' . __('View information about registrants that are linked to this transaction.', 'event_espresso') . '</p>';
146
+		return '<p>'.__('View information about registrants that are linked to this transaction.', 'event_espresso').'</p>';
147 147
 	}
148 148
 
149 149
 	protected function _txn_primary_reg_metabox_stop() {
150
-		return '<p>' . __('View contact details on the primary registrant who is linked to this transaction.', 'event_espresso') . '</p>';
150
+		return '<p>'.__('View contact details on the primary registrant who is linked to this transaction.', 'event_espresso').'</p>';
151 151
 	}
152 152
 
153 153
 	protected function _txn_billing_metabox_stop() {
154
-		return '<p>' . __('View billing information for this transaction.', 'event_espresso') . '</p>';
154
+		return '<p>'.__('View billing information for this transaction.', 'event_espresso').'</p>';
155 155
 	}
156 156
 
157 157
 	protected function _event_name_stop() {
158
-		return '<p>' . __('event name', 'event_espresso') . '</p>';
158
+		return '<p>'.__('event name', 'event_espresso').'</p>';
159 159
 	}
160 160
 
161 161
 }
162 162
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
admin_pages/transactions/help_tours/Transaction_Reports_Help_Tour.class.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -60,16 +60,16 @@  discard block
 block discarded – undo
60 60
 
61 61
 
62 62
 	protected function _start() {
63
-		$content = '<h3>' . __('Transaction Reports', 'event_espresso') . '</h3>';
64
-		$content .= '<p>' . __('This tour of the Transaction Reports page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>';
63
+		$content = '<h3>'.__('Transaction Reports', 'event_espresso').'</h3>';
64
+		$content .= '<p>'.__('This tour of the Transaction Reports page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>';
65 65
 		return $content;
66 66
 	}
67 67
 
68 68
 	protected function _txn_per_day_report() {
69
-		return '<p>' . __('This graph shows revenue for each day.', 'event_espresso') . '</p>';
69
+		return '<p>'.__('This graph shows revenue for each day.', 'event_espresso').'</p>';
70 70
 	}
71 71
 
72 72
 	protected function _txn_per_event_report() {
73
-		return '<p>' . __('This graph shows revenue for each event.', 'event_espresso') . '</p>';
73
+		return '<p>'.__('This graph shows revenue for each event.', 'event_espresso').'</p>';
74 74
 	}
75 75
 }
76 76
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
transactions/help_tours/Transactions_Overview_Help_Tour.class.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -144,53 +144,53 @@  discard block
 block discarded – undo
144 144
 
145 145
 
146 146
 	protected function _start() {
147
-		$content = '<h3>' . __('Transactions Overview', 'event_espresso') . '</h3>';
148
-		$content .= '<p>' . __('This tour of the Transactions Overview page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>';
147
+		$content = '<h3>'.__('Transactions Overview', 'event_espresso').'</h3>';
148
+		$content .= '<p>'.__('This tour of the Transactions Overview page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>';
149 149
 		return $content;
150 150
 	}
151 151
 
152 152
 	protected function _txn_id_stop() {
153
-		return '<p>' . __('View transaction ID. Can be sorted in ascending or descending order.', 'event_espresso') . '</p>';
153
+		return '<p>'.__('View transaction ID. Can be sorted in ascending or descending order.', 'event_espresso').'</p>';
154 154
 	}
155 155
 
156 156
 	protected function _txn_timestamp_stop() {
157
-		return '<p>' . __('View transaction date. Can be sorted in ascending or descending order.', 'event_espresso') . '</p>';
157
+		return '<p>'.__('View transaction date. Can be sorted in ascending or descending order.', 'event_espresso').'</p>';
158 158
 	}
159 159
 
160 160
 	protected function _txn_total_stop() {
161
-		return '<p>' . __('View total for transaction.', 'event_espresso') . '</p>';
161
+		return '<p>'.__('View total for transaction.', 'event_espresso').'</p>';
162 162
 	}
163 163
 	
164 164
 	protected function _txn_paid_stop() {
165
-		return '<p>' . __('View amount paid for transaction.', 'event_espresso') . '</p>';
165
+		return '<p>'.__('View amount paid for transaction.', 'event_espresso').'</p>';
166 166
 	}
167 167
 
168 168
 	protected function _attendee_name_stop() {
169
-		return '<p>' . __('View name for the primary registrant. Can be sorted in ascending or descending order.', 'event_espresso') . '</p>';
169
+		return '<p>'.__('View name for the primary registrant. Can be sorted in ascending or descending order.', 'event_espresso').'</p>';
170 170
 	}
171 171
 
172 172
 	protected function _att_email_stop() {
173
-		return '<p>' . __('View email address for primary registrant. Can be sorted in ascending or descending order.', 'event_espresso') . '</p>';
173
+		return '<p>'.__('View email address for primary registrant. Can be sorted in ascending or descending order.', 'event_espresso').'</p>';
174 174
 	}
175 175
 
176 176
 	protected function _event_name_stop() {
177
-		return '<p>' . __('View name of event. Can be sorted in ascending or descending order.', 'event_espresso') . '</p>';
177
+		return '<p>'.__('View name of event. Can be sorted in ascending or descending order.', 'event_espresso').'</p>';
178 178
 	}
179 179
 
180 180
 	protected function _actions_stop() {
181
-		return '<p>' . __('Perform an action to a transaction. See legend in bottom left corner.', 'event_espresso') . '</p>';
181
+		return '<p>'.__('Perform an action to a transaction. See legend in bottom left corner.', 'event_espresso').'</p>';
182 182
 	}
183 183
 
184 184
 	protected function _legend_stop() {
185
-		return '<p>' . __('This legend that describes the actions available in the actions column. Also shows available statuses for a transaction.', 'event_espresso') . '</p>';
185
+		return '<p>'.__('This legend that describes the actions available in the actions column. Also shows available statuses for a transaction.', 'event_espresso').'</p>';
186 186
 	}
187 187
 
188 188
 	protected function _stop_about_filters() {
189
-		return '<p>' . __('Filter transactions by date by selecting two dates and clicking on the filter button. You can clear your current date selection by clicking on the reset filters button.', 'event_espresso') . '</p>';
189
+		return '<p>'.__('Filter transactions by date by selecting two dates and clicking on the filter button. You can clear your current date selection by clicking on the reset filters button.', 'event_espresso').'</p>';
190 190
 	}
191 191
 
192 192
 	protected function _search_stop() {
193
-		return '<p>' . __('Search through transactions. The following sources will be searched: Event Name, Event Description, First Name, Last Name, Biography, Email Address, Address, Comments, Notes, Registration Final Price, Registration Code, Registration Group Size, Ticket Name, Ticket Description, Payment Method, Payment Gateway, Transaction Details, and Transaction Session.', 'event_espresso') . '</p>';
193
+		return '<p>'.__('Search through transactions. The following sources will be searched: Event Name, Event Description, First Name, Last Name, Biography, Email Address, Address, Comments, Notes, Registration Final Price, Registration Code, Registration Group Size, Ticket Name, Ticket Description, Payment Method, Payment Gateway, Transaction Details, and Transaction Session.', 'event_espresso').'</p>';
194 194
 	}
195 195
 
196 196
 }
197 197
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
admin_pages/transactions/qtips/Transaction_Details_Tips.lib.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
 	protected function _set_tips_array() {
32 32
 		$this->_qtipsa = array(
33 33
 			0 => array(
34
-				'content_id' => 'payment-status-' . EEM_Payment::status_id_approved,
35
-				'target' => '.pymt-status-' . EEM_Payment::status_id_approved,
34
+				'content_id' => 'payment-status-'.EEM_Payment::status_id_approved,
35
+				'target' => '.pymt-status-'.EEM_Payment::status_id_approved,
36 36
 				'content' => $this->_payment_status_legend(EEM_Payment::status_id_approved),
37 37
 				'options' => array(
38 38
 					'position' => array(
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 					)
42 42
 				),
43 43
 			1 => array(
44
-				'content_id' => 'payment-status-' . EEM_Payment::status_id_pending,
45
-				'target' => '.pymt-status-' . EEM_Payment::status_id_pending,
44
+				'content_id' => 'payment-status-'.EEM_Payment::status_id_pending,
45
+				'target' => '.pymt-status-'.EEM_Payment::status_id_pending,
46 46
 				'content' => $this->_payment_status_legend(EEM_Payment::status_id_pending),
47 47
 				'options' => array(
48 48
 					'position' => array(
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 					)
52 52
 				),
53 53
 			2 => array(
54
-				'content_id' => 'payment-status-' . EEM_Payment::status_id_cancelled,
55
-				'target' => '.pymt-status-' . EEM_Payment::status_id_cancelled,
54
+				'content_id' => 'payment-status-'.EEM_Payment::status_id_cancelled,
55
+				'target' => '.pymt-status-'.EEM_Payment::status_id_cancelled,
56 56
 				'content' => $this->_payment_status_legend(EEM_Payment::status_id_cancelled),
57 57
 				'options' => array(
58 58
 					'position' => array(
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 					)
62 62
 				),
63 63
 			3 => array(
64
-				'content_id' => 'payment-status-' . EEM_Payment::status_id_declined,
65
-				'target' => '.pymt-status-' . EEM_Payment::status_id_declined,
64
+				'content_id' => 'payment-status-'.EEM_Payment::status_id_declined,
65
+				'target' => '.pymt-status-'.EEM_Payment::status_id_declined,
66 66
 				'content' => $this->_payment_status_legend(EEM_Payment::status_id_declined),
67 67
 				'options' => array(
68 68
 					'position' => array(
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 					)
72 72
 				),
73 73
 			4 => array(
74
-				'content_id' => 'payment-status-' . EEM_Payment::status_id_failed,
75
-				'target' => '.pymt-status-' . EEM_Payment::status_id_failed,
74
+				'content_id' => 'payment-status-'.EEM_Payment::status_id_failed,
75
+				'target' => '.pymt-status-'.EEM_Payment::status_id_failed,
76 76
 				'content' => $this->_payment_status_legend(EEM_Payment::status_id_failed),
77 77
 				'options' => array(
78 78
 					'position' => array(
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	 * @param  EEM_Payment constant $status What status is set (by class)
93 93
 	 * @return string         The status legend with the related status highlighted
94 94
 	 */
95
-	private function _payment_status_legend( $status ) {
95
+	private function _payment_status_legend($status) {
96 96
 
97 97
 		$status_array = array(
98 98
 			'approved' => EEM_Payment::status_id_approved,
@@ -102,6 +102,6 @@  discard block
 block discarded – undo
102 102
 			'failed' => EEM_Payment::status_id_failed,
103 103
 			);
104 104
 
105
-		return EEH_Template::status_legend( $status_array, $status );
105
+		return EEH_Template::status_legend($status_array, $status);
106 106
 	}
107 107
 }
108 108
\ No newline at end of file
Please login to merge, or discard this patch.