Completed
Branch BETA-4.9-messages-queue-fixed (941081)
by
unknown
30:24 queued 05:56
created
admin_pages/messages/templates/shortcode_selector_skeleton.template.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * This file contains the template for the Messages Shortcode selector.
4
- *
5
- * Template args available are:
6
- * @type    array   $shortcodes An array indexed by shortcode and the values are the labels.
7
- * @type    string  $fieldname  The name of the field the chooser is associated with.
8
- * @type    string  $linked_input_id The name of the input that the shortcode gets inserted to.
9
- */
3
+			 * This file contains the template for the Messages Shortcode selector.
4
+			 *
5
+			 * Template args available are:
6
+			 * @type    array   $shortcodes An array indexed by shortcode and the values are the labels.
7
+			 * @type    string  $fieldname  The name of the field the chooser is associated with.
8
+			 * @type    string  $linked_input_id The name of the input that the shortcode gets inserted to.
9
+			 */
10 10
 if ( ! empty( $shortcodes ) ) : ?>
11 11
 <span class="ee-messages-shortcodes-chooser js-open-list-trigger dashicons dashicons-menu">
12 12
 	<ul id="ee_shortcode_chooser_<?php echo $fieldname; ?>" class="ee_shortcode_chooser_container hidden">
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@
 block discarded – undo
7 7
  * @type    string  $fieldname  The name of the field the chooser is associated with.
8 8
  * @type    string  $linked_input_id The name of the input that the shortcode gets inserted to.
9 9
  */
10
-if ( ! empty( $shortcodes ) ) : ?>
10
+if ( ! empty($shortcodes)) : ?>
11 11
 <span class="ee-messages-shortcodes-chooser js-open-list-trigger dashicons dashicons-menu">
12 12
 	<ul id="ee_shortcode_chooser_<?php echo $fieldname; ?>" class="ee_shortcode_chooser_container hidden">
13
-		<?php foreach( $shortcodes as $shortcode => $label ) : ?>
13
+		<?php foreach ($shortcodes as $shortcode => $label) : ?>
14 14
 			<li>
15
-				<span class="js-shortcode-selection" data-value="<?php echo esc_attr( $shortcode ); ?>" data-linked-input-id="<?php echo esc_attr( $linked_input_id ); ?>"><?php echo $shortcode; ?></span>
15
+				<span class="js-shortcode-selection" data-value="<?php echo esc_attr($shortcode); ?>" data-linked-input-id="<?php echo esc_attr($linked_input_id); ?>"><?php echo $shortcode; ?></span>
16 16
 			</li>
17 17
 		<?php endforeach; ?>
18 18
 	</ul>
19 19
 </span>
20
-<?php endif ; ?>
21 20
\ No newline at end of file
21
+<?php endif; ?>
22 22
\ No newline at end of file
Please login to merge, or discard this patch.
admin_pages/registrations/EE_Registrations_List_Table.class.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -332,12 +332,12 @@  discard block
 block discarded – undo
332 332
 	 * @param \EE_Registration $item
333 333
 	 * @return string
334 334
 	 */
335
-    function column_cb($item){
335
+	function column_cb($item){
336 336
 	/** checkbox/lock **/
337 337
 	$transaction = $item->get_first_related( 'Transaction' );
338 338
 	$payment_count = $transaction instanceof EE_Transaction ? $transaction->count_related( 'Payment' ) : 0;
339 339
 	return $payment_count > 0 ? sprintf( '<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID() ) . '<span class="ee-lock-icon"></span>' : sprintf( '<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID() );
340
-    }
340
+	}
341 341
 
342 342
 
343 343
 
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 	 */
372 372
 	function column__REG_date(EE_Registration $item){
373 373
 		$this->_set_related_details($item);
374
-       		 //Build row actions
374
+	   		 //Build row actions
375 375
 		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=> $this->_transaction_details['id'] ), TXN_ADMIN_URL );
376 376
 		$view_link = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '<a class="ee-status-color-' . $this->_transaction_details['status'] . '" href="'.$view_lnk_url.'" title="' . esc_attr( $this->_transaction_details['title_attr'] ) . '">' . $item->get_i18n_datetime( 'REG_date' ) . '</a>' : $item->get_i18n_datetime( 'REG_date' );
377 377
 		$view_link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $this->_transaction_details['status'], false, 'sentence' ) . '</span>';
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 		} else {
424 424
 			return __( 'There is no ticket on this registration', 'event_espresso' );
425 425
 		}
426
-    }
426
+	}
427 427
 
428 428
 
429 429
 
@@ -445,14 +445,14 @@  discard block
 block discarded – undo
445 445
 		$t = $item->get_first_related('Transaction');
446 446
 		$payment_count = $t instanceof EE_Transaction ? $t->count_related('Payment') : 0;
447 447
 
448
-	    //append group count to name
449
-	    $link .= '&nbsp;' . sprintf(__( '(%1$s / %2$s)', 'event_espresso' ), $item->count(), $item->group_size());
448
+		//append group count to name
449
+		$link .= '&nbsp;' . sprintf(__( '(%1$s / %2$s)', 'event_espresso' ), $item->count(), $item->group_size());
450 450
 
451
-	    //append reg_code
452
-	    $link .= '<br>' . sprintf( __( 'Reg Code: %s', 'event_espresso' ), $item->get('REG_code') );
451
+		//append reg_code
452
+		$link .= '<br>' . sprintf( __( 'Reg Code: %s', 'event_espresso' ), $item->get('REG_code') );
453 453
 
454
-	    //reg status text for accessibility
455
-	    $link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $item->status_ID(), false, 'sentence' ) . '</span>';
454
+		//reg status text for accessibility
455
+		$link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $item->status_ID(), false, 'sentence' ) . '</span>';
456 456
 
457 457
 		//trash/restore/delete actions
458 458
 		$actions = array();
Please login to merge, or discard this patch.
Spacing   +161 added lines, -161 removed lines patch added patch discarded remove patch
@@ -57,20 +57,20 @@  discard block
 block discarded – undo
57 57
 	 * @param \EE_Admin_Page $admin_page
58 58
 	 * @return EE_Registrations_List_Table
59 59
 	 */
60
-	function __construct( $admin_page ){
60
+	function __construct($admin_page) {
61 61
 
62
-		if ( ! empty( $_GET['event_id'] ) ) {
62
+		if ( ! empty($_GET['event_id'])) {
63 63
 			$extra_query_args = array();
64
-			foreach ( $admin_page->get_views() as $key => $view_details ) {
65
-				$extra_query_args[$view_details['slug']] = array( 'event_id' => $_GET['event_id'] );
64
+			foreach ($admin_page->get_views() as $key => $view_details) {
65
+				$extra_query_args[$view_details['slug']] = array('event_id' => $_GET['event_id']);
66 66
 			}
67
-			$this->_views = $admin_page->get_list_table_view_RLs( $extra_query_args );
67
+			$this->_views = $admin_page->get_list_table_view_RLs($extra_query_args);
68 68
 		}
69 69
 
70 70
 		parent::__construct($admin_page);
71 71
 		$this->_status = $this->_admin_page->get_registration_status_array();
72 72
 
73
-		EE_Registry::instance()->load_helper( 'Template' );
73
+		EE_Registry::instance()->load_helper('Template');
74 74
 	}
75 75
 
76 76
 
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 	 * @return void
82 82
 	 */
83 83
 	protected function _setup_data() {
84
-		$this->_data = $this->_admin_page->get_registrations( $this->_per_page );
85
-		$this->_all_data_count = $this->_admin_page->get_registrations( $this->_per_page, TRUE, FALSE, FALSE );
84
+		$this->_data = $this->_admin_page->get_registrations($this->_per_page);
85
+		$this->_all_data_count = $this->_admin_page->get_registrations($this->_per_page, TRUE, FALSE, FALSE);
86 86
 	}
87 87
 
88 88
 
@@ -101,45 +101,45 @@  discard block
 block discarded – undo
101 101
 			);
102 102
 
103 103
 
104
-		if ( isset( $_GET['event_id'] )) {
104
+		if (isset($_GET['event_id'])) {
105 105
 			$this->_columns = array(
106 106
 				'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
107
-				'_REG_ID' => __( 'ID', 'event_espresso' ),
108
-				'ATT_fname' => __( 'Name', 'event_espresso' ),
107
+				'_REG_ID' => __('ID', 'event_espresso'),
108
+				'ATT_fname' => __('Name', 'event_espresso'),
109 109
 				'ATT_email' =>  __('Email', 'event_espresso'),
110
-				'_REG_date' => __( 'Reg Date', 'event_espresso' ),
111
-				'PRC_amount' => __( 'TKT Price', 'event_espresso' ),
112
-				'_REG_final_price' => __( 'Final Price', 'event_espresso' ),
113
-				'TXN_total' => __( 'Total Txn', 'event_espresso' ),
110
+				'_REG_date' => __('Reg Date', 'event_espresso'),
111
+				'PRC_amount' => __('TKT Price', 'event_espresso'),
112
+				'_REG_final_price' => __('Final Price', 'event_espresso'),
113
+				'TXN_total' => __('Total Txn', 'event_espresso'),
114 114
 				'TXN_paid' => __('Paid', 'event_espresso'),
115
-				'actions' => __( 'Actions', 'event_espresso' )
115
+				'actions' => __('Actions', 'event_espresso')
116 116
 				);
117 117
 			$this->_bottom_buttons = array(
118 118
 					'report'=> array(
119 119
 					'route' => 'registrations_report',
120 120
 					'extra_request' =>  
121 121
 						array( 
122
-							'EVT_ID'=> isset( $this->_req_data['event_id'] ) ? $this->_req_data['event_id'] : null, 
123
-							'return_url' => urlencode( "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" ) ) 
122
+							'EVT_ID'=> isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null, 
123
+							'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}") ) 
124 124
 				),
125 125
 			);
126 126
 		} else {
127 127
 			$this->_columns = array(
128 128
 				'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
129
-				'_REG_ID' => __( 'ID', 'event_espresso' ),
130
-				'ATT_fname' => __( 'Name', 'event_espresso' ),
131
-				'_REG_date' => __( 'TXN Date', 'event_espresso' ),
132
-				'event_name' => __( 'Event', 'event_espresso' ),
133
-					'DTT_EVT_start' => __( 'Event Date', 'event_espresso' ),
134
-				'_REG_final_price' => __( 'Price', 'event_espresso' ),
135
-				'_REG_paid' => __( 'Paid', 'event_espresso' ),
136
-				'actions' => __( 'Actions', 'event_espresso' )
129
+				'_REG_ID' => __('ID', 'event_espresso'),
130
+				'ATT_fname' => __('Name', 'event_espresso'),
131
+				'_REG_date' => __('TXN Date', 'event_espresso'),
132
+				'event_name' => __('Event', 'event_espresso'),
133
+					'DTT_EVT_start' => __('Event Date', 'event_espresso'),
134
+				'_REG_final_price' => __('Price', 'event_espresso'),
135
+				'_REG_paid' => __('Paid', 'event_espresso'),
136
+				'actions' => __('Actions', 'event_espresso')
137 137
 			);
138 138
 			$this->_bottom_buttons = array(
139 139
 				'report_all'=> array(
140 140
 				'route' => 'registrations_report',
141 141
 				'extra_request' => array( 
142
-					'return_url' => urlencode( "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" ) )
142
+					'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}") )
143 143
 				),
144 144
 			);
145 145
 		}
@@ -147,11 +147,11 @@  discard block
 block discarded – undo
147 147
 		$this->_primary_column = '_REG_ID';
148 148
 
149 149
 		$this->_sortable_columns = array(
150
-			'_REG_date' => array( '_REG_date' => TRUE ),   //true means its already sorted
151
-			'ATT_fname' => array( 'ATT_fname' => FALSE ),
152
-			'event_name' => array( 'event_name' => FALSE ),
153
-			'DTT_EVT_start'	=> array( 'DTT_EVT_start' => FALSE ),
154
-			'_REG_ID' => array( '_REG_ID' => FALSE ),
150
+			'_REG_date' => array('_REG_date' => TRUE), //true means its already sorted
151
+			'ATT_fname' => array('ATT_fname' => FALSE),
152
+			'event_name' => array('event_name' => FALSE),
153
+			'DTT_EVT_start'	=> array('DTT_EVT_start' => FALSE),
154
+			'_REG_ID' => array('_REG_ID' => FALSE),
155 155
 		);
156 156
 
157 157
 		$this->_hidden_columns = array();
@@ -160,11 +160,11 @@  discard block
 block discarded – undo
160 160
 
161 161
 
162 162
 
163
-	protected function _get_row_class( $item ) {
164
-		$class = parent::_get_row_class( $item );
163
+	protected function _get_row_class($item) {
164
+		$class = parent::_get_row_class($item);
165 165
 		//add status class
166
-		$class .= ' ee-status-strip reg-status-' . $item->status_ID();
167
-		if ( $this->_has_checkbox_column ) {
166
+		$class .= ' ee-status-strip reg-status-'.$item->status_ID();
167
+		if ($this->_has_checkbox_column) {
168 168
 			$class .= ' has-checkbox-column';
169 169
 		}
170 170
 		return $class;
@@ -177,15 +177,15 @@  discard block
 block discarded – undo
177 177
 	 *
178 178
 	 * @param EE_Registration $registration
179 179
 	 */
180
-	protected function _set_related_details( EE_Registration $registration ) {
180
+	protected function _set_related_details(EE_Registration $registration) {
181 181
 
182
-		$transaction = $registration->get_first_related( 'Transaction' );
182
+		$transaction = $registration->get_first_related('Transaction');
183 183
 		$status = $transaction instanceof EE_Transaction ? $transaction->status_ID() : EEM_Transaction::failed_status_code;
184 184
 		$this->_transaction_details = array(
185 185
 			'transaction' => $transaction,
186 186
 			'status' => $status,
187 187
 			'id' => $transaction instanceof EE_Transaction ? $transaction->ID() : 0,
188
-			'title_attr' => sprintf( __('View Transaction Details (%s)', 'event_espresso'), EEH_Template::pretty_status( $status, false, 'sentence' ) )
188
+			'title_attr' => sprintf(__('View Transaction Details (%s)', 'event_espresso'), EEH_Template::pretty_status($status, false, 'sentence'))
189 189
 			);
190 190
 
191 191
 		$event = $registration->event();
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 			'event' => $event,
195 195
 			'status' => $status,
196 196
 			'id' => $event instanceof EE_Event ? $event->ID() : 0,
197
-			'title_attr' => sprintf( __('Edit Event (%s)', 'event_espresso'), EEH_Template::pretty_status( $status, false, 'sentence' ) )
197
+			'title_attr' => sprintf(__('Edit Event (%s)', 'event_espresso'), EEH_Template::pretty_status($status, false, 'sentence'))
198 198
 			);
199 199
 	}
200 200
 
@@ -209,26 +209,26 @@  discard block
 block discarded – undo
209 209
 		$filters = array();
210 210
 
211 211
 		//todo we're currently using old functions here. We need to move things into the Events_Admin_Page() class as methods.
212
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
212
+		EE_Registry::instance()->load_helper('Form_Fields');
213 213
 
214
-		$cur_date = isset( $this->_req_data['month_range'] ) ? $this->_req_data['month_range'] : '';
215
-		$cur_category = isset( $this->_req_data['EVT_CAT'] ) ? $this->_req_data['EVT_CAT'] : -1;
216
-		$reg_status = isset( $this->_req_data['_reg_status'] ) ? $this->_req_data['_reg_status'] : '';
214
+		$cur_date = isset($this->_req_data['month_range']) ? $this->_req_data['month_range'] : '';
215
+		$cur_category = isset($this->_req_data['EVT_CAT']) ? $this->_req_data['EVT_CAT'] : -1;
216
+		$reg_status = isset($this->_req_data['_reg_status']) ? $this->_req_data['_reg_status'] : '';
217 217
 
218
-		$filters[] = EEH_Form_Fields::generate_registration_months_dropdown( $cur_date, $reg_status, $cur_category );
219
-		$filters[] = EEH_Form_Fields::generate_event_category_dropdown( $cur_category );
218
+		$filters[] = EEH_Form_Fields::generate_registration_months_dropdown($cur_date, $reg_status, $cur_category);
219
+		$filters[] = EEH_Form_Fields::generate_event_category_dropdown($cur_category);
220 220
 
221 221
 		$status = array();
222
-		$status[] = array( 'id' => 0, 'text' => __('Select Status', 'event_espresso') );
223
-		foreach ( $this->_status as $key => $value ) {
224
-			$status[] = array( 'id' => $key, 'text' => $value );
222
+		$status[] = array('id' => 0, 'text' => __('Select Status', 'event_espresso'));
223
+		foreach ($this->_status as $key => $value) {
224
+			$status[] = array('id' => $key, 'text' => $value);
225 225
 		}
226
-		if ( $this->_view != 'incomplete' ) {
227
-			$filters[] = EEH_Form_Fields::select_input('_reg_status', $status, isset( $this->_req_data['_reg_status'] ) ? strtoupper( sanitize_key( $this->_req_data['_reg_status'] )) : '' );
226
+		if ($this->_view != 'incomplete') {
227
+			$filters[] = EEH_Form_Fields::select_input('_reg_status', $status, isset($this->_req_data['_reg_status']) ? strtoupper(sanitize_key($this->_req_data['_reg_status'])) : '');
228 228
 		}
229 229
 
230
-		if ( isset( $this->_req_data['event_id'] ) ) {
231
-			$filters[] = EEH_Form_Fields::hidden_input( 'event_id',  $this->_req_data['event_id'], 'reg_event_id' );
230
+		if (isset($this->_req_data['event_id'])) {
231
+			$filters[] = EEH_Form_Fields::hidden_input('event_id', $this->_req_data['event_id'], 'reg_event_id');
232 232
 		}
233 233
 
234 234
 		return $filters;
@@ -245,9 +245,9 @@  discard block
 block discarded – undo
245 245
 		$this->_views['all']['count'] = $this->_total_registrations();
246 246
 		$this->_views['month']['count'] = $this->_total_registrations_this_month();
247 247
 		$this->_views['today']['count'] = $this->_total_registrations_today();
248
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registrations', 'espresso_registrations_trash_registrations' ) ) {
249
-			$this->_views['incomplete']['count'] = $this->_total_registrations( 'incomplete' );
250
-			$this->_views['trash']['count'] = $this->_total_registrations( 'trash' );
248
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registrations', 'espresso_registrations_trash_registrations')) {
249
+			$this->_views['incomplete']['count'] = $this->_total_registrations('incomplete');
250
+			$this->_views['trash']['count'] = $this->_total_registrations('trash');
251 251
 		}
252 252
 	}
253 253
 
@@ -259,23 +259,23 @@  discard block
 block discarded – undo
259 259
 	 * @param string $view
260 260
 	 * @return int
261 261
 	 */
262
-	protected function _total_registrations( $view = '' ){
262
+	protected function _total_registrations($view = '') {
263 263
 		$_where = array();
264
-		$EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : FALSE;
265
-		if( $EVT_ID ) {
264
+		$EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE;
265
+		if ($EVT_ID) {
266 266
 			$_where['EVT_ID'] = $EVT_ID;
267 267
 		}
268
-		switch ( $view ) {
268
+		switch ($view) {
269 269
 			case 'trash' :
270
-				return EEM_Registration::instance()->count_deleted( array( $_where ));
270
+				return EEM_Registration::instance()->count_deleted(array($_where));
271 271
 				break;
272 272
 			case 'incomplete' :
273 273
 				$_where['STS_ID'] = EEM_Registration::status_id_incomplete;
274 274
 				break;
275 275
 			default :
276
-				$_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete );
276
+				$_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete);
277 277
 		}
278
-		return EEM_Registration::instance()->count( array( $_where ));
278
+		return EEM_Registration::instance()->count(array($_where));
279 279
 	}
280 280
 
281 281
 
@@ -285,24 +285,24 @@  discard block
 block discarded – undo
285 285
 	 * @access protected
286 286
 	 * @return int
287 287
 	 */
288
-	protected function _total_registrations_this_month(){
289
-		$EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : FALSE;
290
-		$_where = $EVT_ID ? array( 'EVT_ID' => $EVT_ID ) : array();
288
+	protected function _total_registrations_this_month() {
289
+		$EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE;
290
+		$_where = $EVT_ID ? array('EVT_ID' => $EVT_ID) : array();
291 291
 		$this_year_r = date('Y', current_time('timestamp'));
292 292
 		$time_start = ' 00:00:00';
293 293
 		$time_end = ' 23:59:59';
294 294
 		$this_month_r = date('m', current_time('timestamp'));
295
-		$days_this_month = date( 't', current_time('timestamp') );
295
+		$days_this_month = date('t', current_time('timestamp'));
296 296
 		//setup date query.
297
-		$beginning_string = EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, 'Y-m-d H:i:s' );
298
-		$end_string = EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end, 'Y-m-d H:i:s' );
299
-		$_where['REG_date']= array('BETWEEN',
297
+		$beginning_string = EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-01'.' '.$time_start, 'Y-m-d H:i:s');
298
+		$end_string = EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-'.$days_this_month.' '.$time_end, 'Y-m-d H:i:s');
299
+		$_where['REG_date'] = array('BETWEEN',
300 300
 			array(
301 301
 				$beginning_string,
302 302
 				$end_string
303 303
 		));
304
-		$_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete );
305
-		return EEM_Registration::instance()->count(array( $_where ) );
304
+		$_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete);
305
+		return EEM_Registration::instance()->count(array($_where));
306 306
 	}
307 307
 
308 308
 
@@ -312,20 +312,20 @@  discard block
 block discarded – undo
312 312
 	 * @access protected
313 313
 	 * @return int
314 314
 	 */
315
-	protected function _total_registrations_today(){
315
+	protected function _total_registrations_today() {
316 316
 
317
-		$EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : FALSE;
318
-		$_where = $EVT_ID ? array( 'EVT_ID' => $EVT_ID ) : array();
317
+		$EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE;
318
+		$_where = $EVT_ID ? array('EVT_ID' => $EVT_ID) : array();
319 319
 		$current_date = date('Y-m-d', current_time('timestamp'));
320 320
 		$time_start = ' 00:00:00';
321 321
 		$time_end = ' 23:59:59';
322
-		$_where['REG_date']= array('BETWEEN',
322
+		$_where['REG_date'] = array('BETWEEN',
323 323
 			array(
324
-				EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $current_date . $time_start, 'Y-m-d H:i:s' ),
325
-				EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $current_date . $time_end, 'Y-m-d H:i:s' )
324
+				EEM_Registration::instance()->convert_datetime_for_query('REG_date', $current_date.$time_start, 'Y-m-d H:i:s'),
325
+				EEM_Registration::instance()->convert_datetime_for_query('REG_date', $current_date.$time_end, 'Y-m-d H:i:s')
326 326
 		));
327
-		$_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete );
328
-		return EEM_Registration::instance()->count(array( $_where ) );
327
+		$_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete);
328
+		return EEM_Registration::instance()->count(array($_where));
329 329
 	}
330 330
 
331 331
 
@@ -337,11 +337,11 @@  discard block
 block discarded – undo
337 337
 	 * @param \EE_Registration $item
338 338
 	 * @return string
339 339
 	 */
340
-    function column_cb($item){
340
+    function column_cb($item) {
341 341
 	/** checkbox/lock **/
342
-	$transaction = $item->get_first_related( 'Transaction' );
343
-	$payment_count = $transaction instanceof EE_Transaction ? $transaction->count_related( 'Payment' ) : 0;
344
-	return $payment_count > 0 ? sprintf( '<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID() ) . '<span class="ee-lock-icon"></span>' : sprintf( '<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID() );
342
+	$transaction = $item->get_first_related('Transaction');
343
+	$payment_count = $transaction instanceof EE_Transaction ? $transaction->count_related('Payment') : 0;
344
+	return $payment_count > 0 ? sprintf('<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID()).'<span class="ee-lock-icon"></span>' : sprintf('<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID());
345 345
     }
346 346
 
347 347
 
@@ -353,14 +353,14 @@  discard block
 block discarded – undo
353 353
 	 * @param \EE_Registration $item
354 354
 	 * @return string
355 355
 	 */
356
-	function column__REG_ID(EE_Registration $item){
356
+	function column__REG_ID(EE_Registration $item) {
357 357
 		$attendee = $item->attendee();
358 358
 		$content = $item->ID();
359 359
 		$content .= '<div class="show-on-mobile-view-only">';
360 360
 		$content .= '<br>';
361 361
 		$content .= $attendee instanceof EE_Attendee ? $attendee->full_name() : '';
362
-		$content .= '&nbsp;' . sprintf(__( '(%1$s / %2$s)', 'event_espresso' ), $item->count(), $item->group_size());
363
-		$content .= '<br>' . sprintf( __( 'Reg Code: %s', 'event_espresso' ), $item->get('REG_code') );
362
+		$content .= '&nbsp;'.sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size());
363
+		$content .= '<br>'.sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code'));
364 364
 		$content .= '</div>';
365 365
 		return $content;
366 366
 	}
@@ -374,12 +374,12 @@  discard block
 block discarded – undo
374 374
 	 * @param \EE_Registration $item
375 375
 	 * @return string
376 376
 	 */
377
-	function column__REG_date(EE_Registration $item){
377
+	function column__REG_date(EE_Registration $item) {
378 378
 		$this->_set_related_details($item);
379 379
        		 //Build row actions
380
-		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=> $this->_transaction_details['id'] ), TXN_ADMIN_URL );
381
-		$view_link = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '<a class="ee-status-color-' . $this->_transaction_details['status'] . '" href="'.$view_lnk_url.'" title="' . esc_attr( $this->_transaction_details['title_attr'] ) . '">' . $item->get_i18n_datetime( 'REG_date' ) . '</a>' : $item->get_i18n_datetime( 'REG_date' );
382
-		$view_link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $this->_transaction_details['status'], false, 'sentence' ) . '</span>';
380
+		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=> $this->_transaction_details['id']), TXN_ADMIN_URL);
381
+		$view_link = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '<a class="ee-status-color-'.$this->_transaction_details['status'].'" href="'.$view_lnk_url.'" title="'.esc_attr($this->_transaction_details['title_attr']).'">'.$item->get_i18n_datetime('REG_date').'</a>' : $item->get_i18n_datetime('REG_date');
382
+		$view_link .= '<br><span class="ee-status-text-small">'.EEH_Template::pretty_status($this->_transaction_details['status'], false, 'sentence').'</span>';
383 383
 		return $view_link;
384 384
 	}
385 385
 
@@ -392,18 +392,18 @@  discard block
 block discarded – undo
392 392
 	 * @param \EE_Registration $item
393 393
 	 * @return string
394 394
 	 */
395
-	function column_event_name(EE_Registration $item){
396
-		$this->_set_related_details( $item );
395
+	function column_event_name(EE_Registration $item) {
396
+		$this->_set_related_details($item);
397 397
 		// page=espresso_events&action=edit_event&EVT_ID=2&edit_event_nonce=cf3a7e5b62
398
-		$edit_event_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$item->event_ID() ), EVENTS_ADMIN_URL );
398
+		$edit_event_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$item->event_ID()), EVENTS_ADMIN_URL);
399 399
 		$event_name = $item->event_name();
400 400
 		$event_name = $event_name ? $event_name : __("No Associated Event", 'event_espresso');
401
-		$edit_event = EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'edit_event', $item->event_ID() ) ? '<a class="ee-status-color-' . $this->_event_details['status'] . '" href="' . $edit_event_url . '" title="' . esc_attr( $this->_event_details['title_attr'] ) .'">' .  wp_trim_words( $event_name, 30, '...' ) . '</a>' : wp_trim_words( $event_name, 30, '...' ) ;
401
+		$edit_event = EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'edit_event', $item->event_ID()) ? '<a class="ee-status-color-'.$this->_event_details['status'].'" href="'.$edit_event_url.'" title="'.esc_attr($this->_event_details['title_attr']).'">'.wp_trim_words($event_name, 30, '...').'</a>' : wp_trim_words($event_name, 30, '...');
402 402
 
403
-		$edit_event_url = EE_Admin_Page::add_query_args_and_nonce( array( 'event_id'=>$item->event_ID() ), REG_ADMIN_URL );
404
-		$actions['event_filter'] = '<a href="' . $edit_event_url . '" title="' . sprintf( esc_attr__( 'Filter this list to only show registrations for %s', 'event_espresso' ), $event_name ) .'">' .  __( 'View Registrations', 'event_espresso' ) . '</a>';
403
+		$edit_event_url = EE_Admin_Page::add_query_args_and_nonce(array('event_id'=>$item->event_ID()), REG_ADMIN_URL);
404
+		$actions['event_filter'] = '<a href="'.$edit_event_url.'" title="'.sprintf(esc_attr__('Filter this list to only show registrations for %s', 'event_espresso'), $event_name).'">'.__('View Registrations', 'event_espresso').'</a>';
405 405
 
406
-		return sprintf('%1$s %2$s', $edit_event, $this->row_actions($actions) );
406
+		return sprintf('%1$s %2$s', $edit_event, $this->row_actions($actions));
407 407
 	}
408 408
 
409 409
 
@@ -415,18 +415,18 @@  discard block
 block discarded – undo
415 415
 	 * @param \EE_Registration $item
416 416
 	 * @return string
417 417
 	 */
418
-   	function column_DTT_EVT_start(EE_Registration $item){
418
+   	function column_DTT_EVT_start(EE_Registration $item) {
419 419
 		$datetime_strings = array();
420
-		$ticket = $item->ticket( TRUE );
421
-		if ( $ticket instanceof EE_Ticket ) {
420
+		$ticket = $item->ticket(TRUE);
421
+		if ($ticket instanceof EE_Ticket) {
422 422
 			$remove_defaults = array('default_where_conditions' => 'none');
423 423
 			$datetimes = $ticket->datetimes($remove_defaults);
424
-			foreach($datetimes as $datetime){
425
-				$datetime_strings[] = $datetime->get_i18n_datetime( 'DTT_EVT_start' );
424
+			foreach ($datetimes as $datetime) {
425
+				$datetime_strings[] = $datetime->get_i18n_datetime('DTT_EVT_start');
426 426
 			}
427
-			return implode("<br />",$datetime_strings);
427
+			return implode("<br />", $datetime_strings);
428 428
 		} else {
429
-			return __( 'There is no ticket on this registration', 'event_espresso' );
429
+			return __('There is no ticket on this registration', 'event_espresso');
430 430
 		}
431 431
     }
432 432
 
@@ -439,45 +439,45 @@  discard block
 block discarded – undo
439 439
 	 * @param \EE_Registration $item
440 440
 	 * @return string
441 441
 	 */
442
-   	function column_ATT_fname(EE_Registration $item){
442
+   	function column_ATT_fname(EE_Registration $item) {
443 443
    		$attendee = $item->attendee();
444 444
 
445
-		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL );
445
+		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$item->ID()), REG_ADMIN_URL);
446 446
 		$attendee_name = $attendee instanceof EE_Attendee ? $attendee->full_name() : '';
447
-		$link = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '">' . $attendee_name . '</a>' : $attendee_name;
447
+		$link = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID()) ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'">'.$attendee_name.'</a>' : $attendee_name;
448 448
 		$link .= $item->count() == 1 ? '&nbsp;<sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup>' : '';
449 449
 
450 450
 		$t = $item->get_first_related('Transaction');
451 451
 		$payment_count = $t instanceof EE_Transaction ? $t->count_related('Payment') : 0;
452 452
 
453 453
 	    //append group count to name
454
-	    $link .= '&nbsp;' . sprintf(__( '(%1$s / %2$s)', 'event_espresso' ), $item->count(), $item->group_size());
454
+	    $link .= '&nbsp;'.sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size());
455 455
 
456 456
 	    //append reg_code
457
-	    $link .= '<br>' . sprintf( __( 'Reg Code: %s', 'event_espresso' ), $item->get('REG_code') );
457
+	    $link .= '<br>'.sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code'));
458 458
 
459 459
 	    //reg status text for accessibility
460
-	    $link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $item->status_ID(), false, 'sentence' ) . '</span>';
460
+	    $link .= '<br><span class="ee-status-text-small">'.EEH_Template::pretty_status($item->status_ID(), false, 'sentence').'</span>';
461 461
 
462 462
 		//trash/restore/delete actions
463 463
 		$actions = array();
464
-		if ( $this->_view != 'trash' && $payment_count === 0 && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registration', 'espresso_registrations_trash_registrations', $item->ID() ) ) {
465
-			$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'trash_registrations', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL );
466
-			$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' . esc_attr__( 'Trash Registration', 'event_espresso' ) . '">' . __( 'Trash', 'event_espresso' ) . '</a>';
467
-		} elseif ( $this->_view == 'trash' ) {
464
+		if ($this->_view != 'trash' && $payment_count === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_trash_registrations', $item->ID())) {
465
+			$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'trash_registrations', '_REG_ID'=>$item->ID()), REG_ADMIN_URL);
466
+			$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Trash Registration', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
467
+		} elseif ($this->_view == 'trash') {
468 468
 			// restore registration link
469
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registration', 'espresso_registrations_restore_registrations', $item->ID() ) ) {
470
-				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_registrations', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL );
471
-				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Registration', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>';
469
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_restore_registrations', $item->ID())) {
470
+				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_registrations', '_REG_ID'=>$item->ID()), REG_ADMIN_URL);
471
+				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Registration', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>';
472 472
 			}
473
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registration', 'espresso_registrations_ee_delete_registrations', $item->ID() ) ) {
474
-				$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_registrations', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL );
473
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_ee_delete_registrations', $item->ID())) {
474
+				$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_registrations', '_REG_ID'=>$item->ID()), REG_ADMIN_URL);
475 475
 
476
-				$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Registration Permanently', 'event_espresso' ). '">' . __( 'Delete', 'event_espresso' ) . '</a>';
476
+				$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Registration Permanently', 'event_espresso').'">'.__('Delete', 'event_espresso').'</a>';
477 477
 			}
478 478
 		}
479 479
 
480
-		return sprintf('%1$s %2$s', $link, $this->row_actions($actions) );
480
+		return sprintf('%1$s %2$s', $link, $this->row_actions($actions));
481 481
 	}
482 482
 
483 483
 
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 	 * @param \EE_Registration $item
490 490
 	 * @return string
491 491
 	 */
492
-	function column_ATT_email( EE_Registration $item ) {
492
+	function column_ATT_email(EE_Registration $item) {
493 493
 		$attendee = $item->get_first_related('Attendee');
494 494
 		return ! $attendee instanceof EE_Attendee ? __('No attached contact record.', 'event_espresso') : $attendee->email();
495 495
 	}
@@ -503,8 +503,8 @@  discard block
 block discarded – undo
503 503
 	 * @param \EE_Registration $item
504 504
 	 * @return string
505 505
 	 */
506
-	function column__REG_count(EE_Registration $item){
507
-		return  sprintf(__( '%1$s / %2$s', 'event_espresso' ), $item->count(), $item->group_size());
506
+	function column__REG_count(EE_Registration $item) {
507
+		return  sprintf(__('%1$s / %2$s', 'event_espresso'), $item->count(), $item->group_size());
508 508
 	}
509 509
 
510 510
 
@@ -516,16 +516,16 @@  discard block
 block discarded – undo
516 516
 	 * @param \EE_Registration $item
517 517
 	 * @return string
518 518
 	 */
519
-	function column_PRC_amount(EE_Registration $item){
519
+	function column_PRC_amount(EE_Registration $item) {
520 520
 		$ticket = $item->ticket();
521 521
 
522
-		$content = isset( $_GET['event_id'] ) && $ticket instanceof EE_Ticket ? '<span class="TKT_name">' . $ticket->name() . '</span><br />' : '';
522
+		$content = isset($_GET['event_id']) && $ticket instanceof EE_Ticket ? '<span class="TKT_name">'.$ticket->name().'</span><br />' : '';
523 523
 
524
-		if ( $item->final_price() > 0 ) {
525
-			$content .= '<span class="reg-pad-rght">' . $item->pretty_final_price() . '</span>';
524
+		if ($item->final_price() > 0) {
525
+			$content .= '<span class="reg-pad-rght">'.$item->pretty_final_price().'</span>';
526 526
 		} else {
527 527
 			// free event
528
-			$content .= '<span class="reg-overview-free-event-spn reg-pad-rght">' . __( 'free', 'event_espresso' ) . '</span>';
528
+			$content .= '<span class="reg-overview-free-event-spn reg-pad-rght">'.__('free', 'event_espresso').'</span>';
529 529
 		}
530 530
 
531 531
 		return $content;
@@ -541,11 +541,11 @@  discard block
 block discarded – undo
541 541
 	 * @param \EE_Registration $item
542 542
 	 * @return string
543 543
 	 */
544
-	function column__REG_final_price(EE_Registration $item){
544
+	function column__REG_final_price(EE_Registration $item) {
545 545
 		$ticket = $item->ticket();
546
-		$content = isset( $_GET['event_id'] ) || ! $ticket instanceof EE_Ticket ? '' : '<span class="TKT_name">' . $ticket->name() . '</span><br />';
546
+		$content = isset($_GET['event_id']) || ! $ticket instanceof EE_Ticket ? '' : '<span class="TKT_name">'.$ticket->name().'</span><br />';
547 547
 
548
-		$content .= '<span class="reg-pad-rght">' .  $item->pretty_final_price() . '</span>';
548
+		$content .= '<span class="reg-pad-rght">'.$item->pretty_final_price().'</span>';
549 549
 		return $content;
550 550
 
551 551
 	}
@@ -559,8 +559,8 @@  discard block
 block discarded – undo
559 559
 	 * @param \EE_Registration $item
560 560
 	 * @return string
561 561
 	 */
562
-	function column__REG_paid(EE_Registration $item){
563
-		return '<span class="reg-pad-rght">' .  $item->pretty_paid() . '</span>';
562
+	function column__REG_paid(EE_Registration $item) {
563
+		return '<span class="reg-pad-rght">'.$item->pretty_paid().'</span>';
564 564
 	}
565 565
 
566 566
 
@@ -572,11 +572,11 @@  discard block
 block discarded – undo
572 572
 	 * @param \EE_Registration $item
573 573
 	 * @return string
574 574
 	 */
575
-	function column_TXN_total(EE_Registration $item){
576
-		if($item->transaction()){
577
-			$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID() ), TXN_ADMIN_URL );
578
-			return EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID() ) ? '<span class="reg-pad-rght"><a class="status-'. $item->transaction()->status_ID() .'" href="'.$view_txn_lnk_url.'"  title="' . esc_attr__( 'View Transaction', 'event_espresso' ) . '">'  . $item->transaction()->pretty_total() . '</a></span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_total() . '</span>';
579
-		}else{
575
+	function column_TXN_total(EE_Registration $item) {
576
+		if ($item->transaction()) {
577
+			$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID()), TXN_ADMIN_URL);
578
+			return EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID()) ? '<span class="reg-pad-rght"><a class="status-'.$item->transaction()->status_ID().'" href="'.$view_txn_lnk_url.'"  title="'.esc_attr__('View Transaction', 'event_espresso').'">'.$item->transaction()->pretty_total().'</a></span>' : '<span class="reg-pad-rght">'.$item->transaction()->pretty_total().'</span>';
579
+		} else {
580 580
 			return __("None", "event_espresso");
581 581
 		}
582 582
 	}
@@ -590,15 +590,15 @@  discard block
 block discarded – undo
590 590
 	 * @param \EE_Registration $item
591 591
 	 * @return string
592 592
 	 */
593
-	function column_TXN_paid(EE_Registration $item){
593
+	function column_TXN_paid(EE_Registration $item) {
594 594
 
595
-		if ( $item->count() == 1 ) {
595
+		if ($item->count() == 1) {
596 596
 			$transaction = $item->transaction() ? $item->transaction() : EE_Transaction::new_instance();
597
-			if ( $transaction->paid() >= $transaction->total() ) {
597
+			if ($transaction->paid() >= $transaction->total()) {
598 598
 				return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>';
599 599
 			} else {
600
-				$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID() ), TXN_ADMIN_URL );
601
-				return EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID() ) ? '<span class="reg-pad-rght"><a class="status-'. $transaction->status_ID() .'" href="'.$view_txn_lnk_url.'"  title="' . esc_attr__( 'View Transaction', 'event_espresso' ) . '">' . $item->transaction()->pretty_paid() . '</a><span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>';
600
+				$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID()), TXN_ADMIN_URL);
601
+				return EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID()) ? '<span class="reg-pad-rght"><a class="status-'.$transaction->status_ID().'" href="'.$view_txn_lnk_url.'"  title="'.esc_attr__('View Transaction', 'event_espresso').'">'.$item->transaction()->pretty_paid().'</a><span>' : '<span class="reg-pad-rght">'.$item->transaction()->pretty_paid().'</span>';
602 602
 			}
603 603
 		}
604 604
 
@@ -619,44 +619,44 @@  discard block
 block discarded – undo
619 619
 		EE_Registry::instance()->load_helper('MSG_Template');
620 620
 		$attendee = $item->attendee();
621 621
 		$ticket = $item->ticket();
622
-		$this->_set_related_details( $item );
622
+		$this->_set_related_details($item);
623 623
 
624 624
 		//Build row actions
625
-		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL );
626
-		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->attendee_ID() ), REG_ADMIN_URL );
625
+		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$item->ID()), REG_ADMIN_URL);
626
+		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->attendee_ID()), REG_ADMIN_URL);
627 627
 
628 628
 		// page=attendees&event_admin_reports=resend_email&registration_id=43653465634&event_id=2&form_action=resend_email
629 629
 		//$resend_reg_lnk_url_params = array( 'action'=>'resend_registration', '_REG_ID'=>$item->REG_ID );
630
-		$resend_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'resend_registration', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL, true );
630
+		$resend_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'resend_registration', '_REG_ID'=>$item->ID()), REG_ADMIN_URL, true);
631 631
 
632 632
 
633 633
 		//Build row actions
634
-		$view_lnk = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ? '
634
+		$view_lnk = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID()) ? '
635 635
 			<li>
636
-			<a href="'.$view_lnk_url.'" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '" class="tiny-text">
636
+			<a href="'.$view_lnk_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'" class="tiny-text">
637 637
 				<div class="dashicons dashicons-clipboard"></div>
638 638
 			</a>
639 639
 			</li>' : '';
640 640
 
641
-		$edit_lnk = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee' ) &&  $attendee instanceof EE_Attendee ?'
641
+		$edit_lnk = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') && $attendee instanceof EE_Attendee ? '
642 642
 			<li>
643
-			<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact Details', 'event_espresso' ) . '" class="tiny-text">
643
+			<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact Details', 'event_espresso').'" class="tiny-text">
644 644
 				<div class="ee-icon ee-icon-user-edit ee-icon-size-16"></div>
645 645
 			</a>
646 646
 			</li>' : '';
647 647
 
648
-		 $resend_reg_lnk = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration', $item->ID() ) ? '
648
+		 $resend_reg_lnk = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration', $item->ID()) ? '
649 649
 			<li>
650
-			<a href="'.$resend_reg_lnk_url.'" title="' . esc_attr__( 'Resend Registration Details', 'event_espresso' ) . '" class="tiny-text">
650
+			<a href="'.$resend_reg_lnk_url.'" title="'.esc_attr__('Resend Registration Details', 'event_espresso').'" class="tiny-text">
651 651
 				<div class="dashicons dashicons-email-alt"></div>
652 652
 			</a>
653 653
 			</li>' : '';
654 654
 
655 655
 		// page=transactions&action=view_transaction&txn=256&_wpnonce=6414da4dbb
656
-		$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$this->_transaction_details['id'] ), TXN_ADMIN_URL );
657
-		$view_txn_lnk = EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction', $this->_transaction_details['id'] ) ? '
656
+		$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$this->_transaction_details['id']), TXN_ADMIN_URL);
657
+		$view_txn_lnk = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $this->_transaction_details['id']) ? '
658 658
 			<li>
659
-			<a class="ee-status-color-' . $this->_transaction_details['status'] . '" href="'.$view_txn_lnk_url.'"  title="' . $this->_transaction_details['title_attr'] . '" class="tiny-text">
659
+			<a class="ee-status-color-' . $this->_transaction_details['status'].'" href="'.$view_txn_lnk_url.'"  title="'.$this->_transaction_details['title_attr'].'" class="tiny-text">
660 660
 				<div class="dashicons dashicons-cart"></div>
661 661
 			</a>
662 662
 			</li>' : '';
@@ -664,10 +664,10 @@  discard block
 block discarded – undo
664 664
 		//invoice link
665 665
 		$dl_invoice_lnk_url = $item->invoice_url();
666 666
 		//only show invoice link if message type is active.
667
-		if ( $item->is_primary_registrant() && $attendee instanceof EE_Attendee && EEH_MSG_Template::is_mt_active( 'invoice' ) ) {
667
+		if ($item->is_primary_registrant() && $attendee instanceof EE_Attendee && EEH_MSG_Template::is_mt_active('invoice')) {
668 668
 			$dl_invoice_lnk = '
669 669
 		<li>
670
-			<a title="' . esc_attr__( 'View Transaction Invoice', 'event_espresso' ) . '" target="_blank" href="'.$dl_invoice_lnk_url.'" class="tiny-text">
670
+			<a title="' . esc_attr__('View Transaction Invoice', 'event_espresso').'" target="_blank" href="'.$dl_invoice_lnk_url.'" class="tiny-text">
671 671
 				<span class="dashicons dashicons-media-spreadsheet ee-icon-size-18"></span>
672 672
 			</a>
673 673
 		</li>';
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
 			$dl_invoice_lnk = '';
676 676
 		}
677 677
 
678
-			return $this->_action_string( $view_lnk . $edit_lnk . $resend_reg_lnk . $view_txn_lnk . $dl_invoice_lnk, $item, 'ul', 'reg-overview-actions-ul' );
678
+			return $this->_action_string($view_lnk.$edit_lnk.$resend_reg_lnk.$view_txn_lnk.$dl_invoice_lnk, $item, 'ul', 'reg-overview-actions-ul');
679 679
 	}
680 680
 
681 681
 }
Please login to merge, or discard this patch.
templates/txn_admin_details_main_meta_box_txn_details.template.php 1 patch
Spacing   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <div id="admin-primary-mbox-dv" class="admin-primary-mbox-dv">
2 2
 
3 3
 	<h4 class="admin-primary-mbox-h4 hdr-has-icon">
4
-		<span class="dashicons dashicons-cart"></span><?php _e( 'Transaction Items', 'event_espresso' );?>
4
+		<span class="dashicons dashicons-cart"></span><?php _e('Transaction Items', 'event_espresso'); ?>
5 5
 	</h4>
6 6
 
7 7
 	<div class="admin-primary-mbox-tbl-wrap">
@@ -10,27 +10,27 @@  discard block
 block discarded – undo
10 10
 	</div>
11 11
 
12 12
 	<a id="display-additional-transaction-session-info" class="display-the-hidden smaller-text" rel="additional-transaction-session-info">
13
-		<span class="dashicons dashicons-plus-alt"></span><?php _e( 'view additional transaction session details', 'event_espresso' );?>
13
+		<span class="dashicons dashicons-plus-alt"></span><?php _e('view additional transaction session details', 'event_espresso'); ?>
14 14
 	</a>
15 15
 
16 16
 	<div id="additional-transaction-session-info-dv" class="hidden">
17 17
 
18 18
 		<a id="hide-additional-transaction-session-info" class="hide-the-displayed hidden smaller-text" rel="additional-transaction-session-info">
19
-			<span class="dashicons dashicons-dismiss"></span><?php _e( 'hide additional transaction session details', 'event_espresso' );?>
19
+			<span class="dashicons dashicons-dismiss"></span><?php _e('hide additional transaction session details', 'event_espresso'); ?>
20 20
 		</a>
21 21
 	<br class="clear"/>
22 22
 
23
-		<h4 class="admin-primary-mbox-h4"><?php _e( 'Transaction Session Details', 'event_espresso' );?></h4>
23
+		<h4 class="admin-primary-mbox-h4"><?php _e('Transaction Session Details', 'event_espresso'); ?></h4>
24 24
 
25 25
 		<table id="admin-primary-mbox-txn-extra-session-info-tbl" class="form-table skinny-rows">
26 26
 			<tbody>
27
-			<?php foreach ( $txn_details as $key => $txn_detail ) : ?>
27
+			<?php foreach ($txn_details as $key => $txn_detail) : ?>
28 28
 				<tr>
29 29
 					<th>
30
-						<label for="<?php echo $key;?>"><?php echo $txn_detail['label'];?></label>
30
+						<label for="<?php echo $key; ?>"><?php echo $txn_detail['label']; ?></label>
31 31
 					</th>
32 32
 					<td>
33
-						<?php echo $txn_detail['value'];?>
33
+						<?php echo $txn_detail['value']; ?>
34 34
 					</td>
35 35
 				</tr>
36 36
 			<?php endforeach; // $txn_details?>
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
 	<br class="clear"/>
41 41
 
42 42
 
43
-	<?php if ( $attendee instanceof EE_Attendee && ( $grand_raw_total > 0 || $TXN_status != 'TCM' ) ) : ?>
43
+	<?php if ($attendee instanceof EE_Attendee && ($grand_raw_total > 0 || $TXN_status != 'TCM')) : ?>
44 44
 
45 45
 	<h4 class="admin-primary-mbox-h4 hdr-has-icon">
46
-		<span class="ee-icon ee-icon-cash"></span><?php _e( 'Payment Details', 'event_espresso' );?>
46
+		<span class="ee-icon ee-icon-cash"></span><?php _e('Payment Details', 'event_espresso'); ?>
47 47
 	</h4>
48 48
 
49 49
 	<div class="admin-primary-mbox-tbl-wrap">
@@ -52,75 +52,75 @@  discard block
 block discarded – undo
52 52
 				<tr>
53 53
 					<th></th>
54 54
 					<th class="jst-cntr"></th>
55
-					<th class="jst-cntr"><?php _e( 'ID', 'event_espresso' );?></th>
56
-					<th class="jst-left"><?php _e( 'Date', 'event_espresso' );?></th>
57
-					<th class="jst-cntr"><?php _e( 'Source', 'event_espresso' );?></th>
58
-					<th class="jst-left"><?php _e( 'Method', 'event_espresso' );?></th>
59
-					<th class="jst-left"><?php _e( 'Gateway Response', 'event_espresso' );?></th>
60
-					<th class="jst-left"><?php _e( 'TXN&nbsp;ID / CHQ&nbsp;#', 'event_espresso' );?></th>
61
-					<th class="jst-left"><?php _e( 'P.O. / S.O.&nbsp;#', 'event_espresso' );?></th>
62
-					<th class="jst-left"><?php _e( 'Notes / Extra&nbsp;Accounting', 'event_espresso' );?></th>
63
-					<!--<th class="jst-left"><?php _e( 'Details', 'event_espresso' );?></th>-->
64
-					<th class="jst-cntr"><?php _e( 'Amount', 'event_espresso' );?></th>
55
+					<th class="jst-cntr"><?php _e('ID', 'event_espresso'); ?></th>
56
+					<th class="jst-left"><?php _e('Date', 'event_espresso'); ?></th>
57
+					<th class="jst-cntr"><?php _e('Source', 'event_espresso'); ?></th>
58
+					<th class="jst-left"><?php _e('Method', 'event_espresso'); ?></th>
59
+					<th class="jst-left"><?php _e('Gateway Response', 'event_espresso'); ?></th>
60
+					<th class="jst-left"><?php _e('TXN&nbsp;ID / CHQ&nbsp;#', 'event_espresso'); ?></th>
61
+					<th class="jst-left"><?php _e('P.O. / S.O.&nbsp;#', 'event_espresso'); ?></th>
62
+					<th class="jst-left"><?php _e('Notes / Extra&nbsp;Accounting', 'event_espresso'); ?></th>
63
+					<!--<th class="jst-left"><?php _e('Details', 'event_espresso'); ?></th>-->
64
+					<th class="jst-cntr"><?php _e('Amount', 'event_espresso'); ?></th>
65 65
 				</tr>
66 66
 			</thead>
67 67
 			<tbody>
68
-		<?php if ( $payments ) : ?>
68
+		<?php if ($payments) : ?>
69 69
 			<?php $payment_total = 0; ?>
70
-			<?php foreach ( $payments as $PAY_ID => $payment ) : ?>
71
-				<tr id="txn-admin-payment-tr-<?php echo $PAY_ID;?>">
70
+			<?php foreach ($payments as $PAY_ID => $payment) : ?>
71
+				<tr id="txn-admin-payment-tr-<?php echo $PAY_ID; ?>">
72 72
 					<td>
73 73
 						<span id="payment-status-<?php echo $PAY_ID; ?>" class="ee-status-strip-td ee-status-strip pymt-status-<?php echo $payment->STS_ID(); ?>"></span>
74
-						<div id="payment-STS_ID-<?php echo $PAY_ID;?>" class="hidden"><?php echo $payment->STS_ID();?></div>
75
-						<div id="reg-payments-<?php echo $PAY_ID;?>" class="hidden"><?php echo json_encode( $existing_reg_payments[ $PAY_ID ] );?></div>
74
+						<div id="payment-STS_ID-<?php echo $PAY_ID; ?>" class="hidden"><?php echo $payment->STS_ID(); ?></div>
75
+						<div id="reg-payments-<?php echo $PAY_ID; ?>" class="hidden"><?php echo json_encode($existing_reg_payments[$PAY_ID]); ?></div>
76 76
 					</td>
77 77
 					<td class=" jst-cntr">
78 78
 						<ul class="txn-overview-actions-ul">
79 79
 							<li>
80
-								<a class="txn-admin-payment-action-edit-lnk" title="<?php esc_attr_e( 'Edit Payment', 'event_espresso' );?>" data-payment-id="<?php echo $PAY_ID;?>">
80
+								<a class="txn-admin-payment-action-edit-lnk" title="<?php esc_attr_e('Edit Payment', 'event_espresso'); ?>" data-payment-id="<?php echo $PAY_ID; ?>">
81 81
 									<div class="dashicons dashicons-edit" style="margin: 0;"></div>
82 82
 								</a>
83 83
 							</li>
84 84
 							<li>
85
-								<a class="txn-admin-payment-action-delete-lnk" title="<?php esc_attr_e( 'Delete Payment', 'event_espresso' );?>" data-payment-id="<?php echo $PAY_ID;?>">
85
+								<a class="txn-admin-payment-action-delete-lnk" title="<?php esc_attr_e('Delete Payment', 'event_espresso'); ?>" data-payment-id="<?php echo $PAY_ID; ?>">
86 86
 									<div class="dashicons dashicons-trash" style="margin: 0;"></div>
87 87
 								</a>
88 88
 							</li>
89 89
 						</ul>
90 90
 					</td>
91 91
 					<td class=" jst-rght">
92
-						<div id="payment-id-<?php echo $PAY_ID;?>"><?php echo $PAY_ID;?></div>
92
+						<div id="payment-id-<?php echo $PAY_ID; ?>"><?php echo $PAY_ID; ?></div>
93 93
 					</td>
94 94
 					<td class=" jst-left">
95
-						<div id="payment-date-<?php echo $PAY_ID;?>" class="payment-date-dv"><?php echo $payment->timestamp('Y-m-d', 'h:i a');?></div>
95
+						<div id="payment-date-<?php echo $PAY_ID; ?>" class="payment-date-dv"><?php echo $payment->timestamp('Y-m-d', 'h:i a'); ?></div>
96 96
 					</td>
97 97
 					<td class=" jst-cntr">
98
-						<div id="payment-method-<?php echo $PAY_ID;?>">
99
-							<?php echo $payment->source();?>
98
+						<div id="payment-method-<?php echo $PAY_ID; ?>">
99
+							<?php echo $payment->source(); ?>
100 100
 						</div>
101 101
 					</td>
102 102
 					<td class=" jst-left">
103
-						<div id="payment-gateway-<?php echo $PAY_ID;?>">
104
-							<?php echo $payment->payment_method() ?  $payment->payment_method()->admin_name() : __("Unknown", 'event_espresso');?>
103
+						<div id="payment-gateway-<?php echo $PAY_ID; ?>">
104
+							<?php echo $payment->payment_method() ? $payment->payment_method()->admin_name() : __("Unknown", 'event_espresso'); ?>
105 105
 						</div>
106
-						<div id="payment-gateway-id-<?php echo $PAY_ID;?>" class="hidden"><?php echo $payment->payment_method() ? $payment->payment_method()->ID() : 0;?></div>
106
+						<div id="payment-gateway-id-<?php echo $PAY_ID; ?>" class="hidden"><?php echo $payment->payment_method() ? $payment->payment_method()->ID() : 0; ?></div>
107 107
 					</td>
108 108
 					<td class=" jst-left">
109
-						<div id="payment-response-<?php echo $PAY_ID;?>"><?php echo $payment->gateway_response();?></div>
109
+						<div id="payment-response-<?php echo $PAY_ID; ?>"><?php echo $payment->gateway_response(); ?></div>
110 110
 					</td>
111 111
 					<td class=" jst-left">
112
-						<div id="payment-txn-id-chq-nmbr-<?php echo $PAY_ID;?>"><?php echo $payment->txn_id_chq_nmbr();?></div>
112
+						<div id="payment-txn-id-chq-nmbr-<?php echo $PAY_ID; ?>"><?php echo $payment->txn_id_chq_nmbr(); ?></div>
113 113
 					</td>
114 114
 					<td class=" jst-left">
115
-						<div id="payment-po-nmbr-<?php echo $PAY_ID;?>"><?php echo $payment->po_number();?></div>
115
+						<div id="payment-po-nmbr-<?php echo $PAY_ID; ?>"><?php echo $payment->po_number(); ?></div>
116 116
 					</td>
117 117
 					<td class=" jst-left">
118
-						<div id="payment-accntng-<?php echo $PAY_ID;?>"><?php echo $payment->extra_accntng();?></div>
118
+						<div id="payment-accntng-<?php echo $PAY_ID; ?>"><?php echo $payment->extra_accntng(); ?></div>
119 119
 					</td>
120 120
 					<td class=" jst-rght">
121
-						<?php $payment_class = $payment->amount() > 0 ? 'txn-admin-payment-status-' . $payment->STS_ID() : 'txn-admin-payment-status-PDC'; ?>
122
-						<span class="<?php echo $payment_class;?>">
123
-							<div id="payment-amount-<?php echo $PAY_ID;?>" style="display:inline;"><?php echo EEH_Template::format_currency($payment->amount(), FALSE, FALSE ); ?></div>
121
+						<?php $payment_class = $payment->amount() > 0 ? 'txn-admin-payment-status-'.$payment->STS_ID() : 'txn-admin-payment-status-PDC'; ?>
122
+						<span class="<?php echo $payment_class; ?>">
123
+							<div id="payment-amount-<?php echo $PAY_ID; ?>" style="display:inline;"><?php echo EEH_Template::format_currency($payment->amount(), FALSE, FALSE); ?></div>
124 124
 						</span>
125 125
 					</td>
126 126
 				</tr>
@@ -130,25 +130,25 @@  discard block
 block discarded – undo
130 130
 			<?php endforeach; // $payment?>
131 131
 			<?php
132 132
 				$pay_totals_class = $payment_total > $grand_raw_total ? ' important-notice' : '';
133
-				$overpaid = $payment_total > $grand_raw_total ? '<span id="overpaid">' . __( 'This transaction has been overpaid ! ', 'event_espresso' ) . '</span>' : '';
133
+				$overpaid = $payment_total > $grand_raw_total ? '<span id="overpaid">'.__('This transaction has been overpaid ! ', 'event_espresso').'</span>' : '';
134 134
 			?>
135 135
 				<tr id="txn-admin-no-payments-tr" class="admin-primary-mbox-total-tr hidden">
136 136
 					<td class=" jst-rght" colspan="11">
137
-						<span class="important-notice"><?php _e( 'No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.', 'event_espresso' ); ?></span>
137
+						<span class="important-notice"><?php _e('No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.', 'event_espresso'); ?></span>
138 138
 					</td>
139 139
 				</tr>
140
-				<tr id="txn-admin-payments-total-tr" class="admin-primary-mbox-total-tr<?php echo $pay_totals_class;?>">
141
-					<th class=" jst-rght" colspan="10"><span id="payments-total-spn"><?php echo $overpaid . sprintf( __( 'Payments Total %s', 'event_espresso' ), '(' . EE_Registry::instance()->CFG->currency->code . ')' );?></span></th>
142
-					<th class=" jst-rght"><span id="txn-admin-payment-total"><?php echo EEH_Template::format_currency($payment_total, FALSE, FALSE);?></span></th>
140
+				<tr id="txn-admin-payments-total-tr" class="admin-primary-mbox-total-tr<?php echo $pay_totals_class; ?>">
141
+					<th class=" jst-rght" colspan="10"><span id="payments-total-spn"><?php echo $overpaid.sprintf(__('Payments Total %s', 'event_espresso'), '('.EE_Registry::instance()->CFG->currency->code.')'); ?></span></th>
142
+					<th class=" jst-rght"><span id="txn-admin-payment-total"><?php echo EEH_Template::format_currency($payment_total, FALSE, FALSE); ?></span></th>
143 143
 				</tr>
144 144
 		<?php else : ?>
145 145
 				<tr id="txn-admin-no-payments-tr" class="admin-primary-mbox-total-tr">
146 146
 					<td class=" jst-rght" colspan="11">
147
-						<span class="important-notice"><?php _e( 'No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.', 'event_espresso' ); ?></span>
147
+						<span class="important-notice"><?php _e('No payments have been applied to this transaction yet. Click "Apply Payment" below to make a payment.', 'event_espresso'); ?></span>
148 148
 					</td>
149 149
 				</tr>
150 150
 				<tr id="txn-admin-payments-total-tr" class="admin-primary-mbox-total-tr hidden">
151
-					<th class=" jst-rght" colspan="10"><span id="payments-total-spn"><?php echo __( 'Payments Total', 'event_espresso' );?></span></th>
151
+					<th class=" jst-rght" colspan="10"><span id="payments-total-spn"><?php echo __('Payments Total', 'event_espresso'); ?></span></th>
152 152
 					<th class=" jst-rght"><span id="txn-admin-payment-total"></span></th>
153 153
 				</tr>
154 154
 		<?php endif; // $payments?>
@@ -161,12 +161,12 @@  discard block
 block discarded – undo
161 161
 					<td class=" jst-cntr">
162 162
 						<ul class="txn-overview-actions-ul">
163 163
 							<li>
164
-								<a class="txn-admin-payment-action-edit-lnk" title="<?php esc_attr_e( 'Edit Payment', 'event_espresso' );?>" data-payment-id="PAY_ID">
164
+								<a class="txn-admin-payment-action-edit-lnk" title="<?php esc_attr_e('Edit Payment', 'event_espresso'); ?>" data-payment-id="PAY_ID">
165 165
 									<div class="dashicons dashicons-edit" style="margin: 0;"></div>
166 166
 								</a>
167 167
 							</li>
168 168
 							<li>
169
-								<a class="txn-admin-payment-action-delete-lnk" title="<?php esc_attr_e( 'Delete Payment', 'event_espresso' );?>" data-payment-id="PAY_ID">
169
+								<a class="txn-admin-payment-action-delete-lnk" title="<?php esc_attr_e('Delete Payment', 'event_espresso'); ?>" data-payment-id="PAY_ID">
170 170
 									<div class="dashicons dashicons-trash" style="margin: 0;"></div>
171 171
 								</a>
172 172
 							</li>
@@ -213,12 +213,12 @@  discard block
 block discarded – undo
213 213
 	<ul id="txn-admin-payment-options-ul">
214 214
 		<li>
215 215
 			<a id="display-txn-admin-apply-payment" class="button-primary no-icon no-hide" rel="txn-admin-apply-payment" > <!--display-the-hidden -->
216
-				<?php _e( 'Apply Payment', 'event_espresso' );?>
216
+				<?php _e('Apply Payment', 'event_espresso'); ?>
217 217
 			</a>
218 218
 		</li>
219 219
 		<li>
220 220
 			<a id="display-txn-admin-apply-refund" class="button-secondary no-icon no-hide" rel="txn-admin-apply-refund" >  <!--display-the-hidden -->
221
-				<?php _e( 'Apply Refund', 'event_espresso' );?>
221
+				<?php _e('Apply Refund', 'event_espresso'); ?>
222 222
 			</a>
223 223
 		</li>
224 224
 	</ul>
@@ -228,14 +228,14 @@  discard block
 block discarded – undo
228 228
 
229 229
 		<h2 id="admin-modal-dialog-apply-payment-h2" class="admin-modal-dialog-h2 hdr-has-icon" style="display:none;">
230 230
 			<div class="ee-icon ee-icon-cash-add float-left"></div>
231
-			<?php echo __( 'Apply a Payment to Transaction #', 'event_espresso' ) . $txn_nmbr['value'];?>
231
+			<?php echo __('Apply a Payment to Transaction #', 'event_espresso').$txn_nmbr['value']; ?>
232 232
 		</h2>
233 233
 
234 234
 		<h2 id="admin-modal-dialog-edit-payment-h2" class="admin-modal-dialog-h2 hdr-has-icon" style="display:none;">
235 235
 			<div class="ee-icon ee-icon-cash-edit float-left"></div>
236 236
 			<?php
237 237
 			echo sprintf(
238
-				__( 'Edit Payment #%s for Transaction #%s', 'event_espresso' ),
238
+				__('Edit Payment #%s for Transaction #%s', 'event_espresso'),
239 239
 				'<span></span>',
240 240
 				$txn_nmbr['value']
241 241
 			);
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 			<div class="ee-icon ee-icon-cash-edit float-left"></div>
247 247
 			<?php
248 248
 			echo sprintf(
249
-				__( 'Edit Refund #%s for Transaction #%s', 'event_espresso' ),
249
+				__('Edit Refund #%s for Transaction #%s', 'event_espresso'),
250 250
 				'<span></span>',
251 251
 				$txn_nmbr['value']
252 252
 			);
@@ -255,14 +255,14 @@  discard block
 block discarded – undo
255 255
 
256 256
 		<h2 id="admin-modal-dialog-apply-refund-h2" class="admin-modal-dialog-h2 hdr-has-icon" style="display:none;">
257 257
 			<div class="ee-icon ee-icon-cash-remove float-left"></div>
258
-			<?php echo __( 'Apply a Refund to Transaction #', 'event_espresso' ) . $txn_nmbr['value'];?>
258
+			<?php echo __('Apply a Refund to Transaction #', 'event_espresso').$txn_nmbr['value']; ?>
259 259
 		</h2>
260 260
 
261 261
 		<form name="txn-admin-apply-payment-frm" id="txn-admin-apply-payment-frm" action="<?php echo $apply_payment_form_url; ?>">
262 262
 			<div class="admin-modal-dialog-wrap">
263 263
 				<div class="admin-modal-dialog-inner">
264 264
 
265
-					<input  type="hidden" name="espresso_apply_payment_nonce" id="espresso_apply_payment_nonce" value="<?php echo wp_create_nonce( 'espresso_apply_payment_nonce' );?>"/>
265
+					<input  type="hidden" name="espresso_apply_payment_nonce" id="espresso_apply_payment_nonce" value="<?php echo wp_create_nonce('espresso_apply_payment_nonce'); ?>"/>
266 266
 					<input  type="hidden" name="espresso_ajax" id="espresso-ajax" value="0"/>
267 267
 					<input  type="hidden" name="noheader" id="txn-admin-noheader-inp" value="0"/>
268 268
 					<input  type="hidden" name="txn_admin_payment[PAY_ID]" id="txn-admin-payment-payment-id-inp" class="txn-admin-apply-payment-inp" value="0"/>
@@ -270,108 +270,108 @@  discard block
 block discarded – undo
270 270
 					<input  type="hidden" name="txn_admin_payment[type]" id="txn-admin-payment-type-inp" value="1"/>
271 271
 					<input  type="hidden" name="txn_admin_payment[details]" id="txn-admin-payment-details-inp" value=""/>
272 272
 					<input  type="hidden" name="txn_admin_delete_payment_form_url" id="txn-admin-delete-payment-form-url-inp" value="<?php echo $delete_payment_form_url; ?>"/>
273
-					<input  type="hidden" name="txn_admin_todays_date" id="txn-admin-todays-date-inp" value="<?php echo date( 'Y-m-d h:i a', current_time( 'timestamp' )); ?>"/>
273
+					<input  type="hidden" name="txn_admin_todays_date" id="txn-admin-todays-date-inp" value="<?php echo date('Y-m-d h:i a', current_time('timestamp')); ?>"/>
274 274
 
275 275
 					<div class="txn-admin-apply-payment-date-dv admin-modal-dialog-row">
276
-						<div class="validation-notice-dv"><?php _e( 'The following is  a required field', 'event_espresso' );?></div>
277
-						<label for="txn-admin-payment-date-inp" class=""><?php _e( 'Payment Date', 'event_espresso' );?></label>
278
-						<input name="txn_admin_payment[date]" id="txn-admin-payment-date-inp" class="txn-admin-apply-payment-inp required" type="text" value="<?php echo date( 'Y-m-d h:i a', current_time( 'timestamp' )); ?>"/>
279
-						<p class="description"><?php _e( 'The date the payment was actually made on', 'event_espresso' );?></p>
276
+						<div class="validation-notice-dv"><?php _e('The following is  a required field', 'event_espresso'); ?></div>
277
+						<label for="txn-admin-payment-date-inp" class=""><?php _e('Payment Date', 'event_espresso'); ?></label>
278
+						<input name="txn_admin_payment[date]" id="txn-admin-payment-date-inp" class="txn-admin-apply-payment-inp required" type="text" value="<?php echo date('Y-m-d h:i a', current_time('timestamp')); ?>"/>
279
+						<p class="description"><?php _e('The date the payment was actually made on', 'event_espresso'); ?></p>
280 280
 					</div>
281 281
 
282 282
 					<div class="txn-admin-apply-payment-amount-dv admin-modal-dialog-row">
283
-						<div class="validation-notice-dv"><?php _e( 'The following is  a required field', 'event_espresso' );?></div>
284
-						<label for="txn-admin-payment-amount-inp" class=""><?php _e( 'Amount', 'event_espresso' );?></label>
283
+						<div class="validation-notice-dv"><?php _e('The following is  a required field', 'event_espresso'); ?></div>
284
+						<label for="txn-admin-payment-amount-inp" class=""><?php _e('Amount', 'event_espresso'); ?></label>
285 285
 						<input name="txn_admin_payment[amount]" id="txn-admin-payment-amount-inp" class="txn-admin-apply-payment-inp required" type="text" value=""/>
286
-						<p class="description"><?php _e( 'The amount of the payment', 'event_espresso' );?></p>
286
+						<p class="description"><?php _e('The amount of the payment', 'event_espresso'); ?></p>
287 287
 					</div>
288 288
 
289 289
 					<div class="txn-admin-apply-payment-method-dv admin-modal-dialog-row">
290
-						<div class="validation-notice-dv"><?php _e( 'The following is  a required field', 'event_espresso' );?></div>
291
-						<label for="txn-admin-payment-method-inp" class=""><?php _e( 'Method of Payment', 'event_espresso' );?></label>
290
+						<div class="validation-notice-dv"><?php _e('The following is  a required field', 'event_espresso'); ?></div>
291
+						<label for="txn-admin-payment-method-inp" class=""><?php _e('Method of Payment', 'event_espresso'); ?></label>
292 292
 						<select name="txn_admin_payment[PMD_ID]" id="txn-admin-payment-method-slct" class="txn-admin-apply-payment-slct required" type="text" >
293
-						<?php foreach ( $payment_methods as $method ) : ?>
293
+						<?php foreach ($payment_methods as $method) : ?>
294 294
 							<?php $selected = $method->slug() == 'cash' ? ' selected="selected"' : ''; ?>
295
-							<option id="payment-method-opt-<?php echo $method->slug(); ?>" value="<?php echo $method->ID(); ?>"<?php echo $selected; ?>><?php echo sanitize_key( $method->admin_desc() ) ? substr( $method->admin_desc(), 0, 128) : $method->admin_name() ; ?>&nbsp;&nbsp;</option>
295
+							<option id="payment-method-opt-<?php echo $method->slug(); ?>" value="<?php echo $method->ID(); ?>"<?php echo $selected; ?>><?php echo sanitize_key($method->admin_desc()) ? substr($method->admin_desc(), 0, 128) : $method->admin_name(); ?>&nbsp;&nbsp;</option>
296 296
 						<?php endforeach; ?>
297 297
 						</select>
298
-						<p class="description"><?php _e( 'Whether the payment was made via PayPal, Credit Card, Cheque, or Cash', 'event_espresso' );?></p>
298
+						<p class="description"><?php _e('Whether the payment was made via PayPal, Credit Card, Cheque, or Cash', 'event_espresso'); ?></p>
299 299
 					</div>
300 300
 
301 301
 					<div class="mop-PP mop-CC mop-CHQ mop">
302 302
 						<div class="txn-admin-apply-payment-gw-txn-id-dv admin-modal-dialog-row">
303
-							<label for="txn-admin-payment-txn-id-inp" class=""><?php _e( 'TXN ID / CHQ #', 'event_espresso' );?></label>
303
+							<label for="txn-admin-payment-txn-id-inp" class=""><?php _e('TXN ID / CHQ #', 'event_espresso'); ?></label>
304 304
 							<input name="txn_admin_payment[txn_id_chq_nmbr]" id="txn-admin-payment-txn-id-chq-nmbr-inp" class="txn-admin-apply-payment-inp" type="text" maxlength="100"/>
305
-							<p class="description"><?php _e( 'The Transaction ID sent back from the payment gateway, or the Cheque #', 'event_espresso' );?></p>
305
+							<p class="description"><?php _e('The Transaction ID sent back from the payment gateway, or the Cheque #', 'event_espresso'); ?></p>
306 306
 						</div>
307 307
 					</div>
308 308
 
309 309
 					<div class="mop-CC mop" style="display:none">
310 310
 						<div class="txn-admin-apply-payment-response-dv admin-modal-dialog-row">
311
-							<label for="txn-admin-payment-gateway-response-inp" class=""><?php _e( 'Gateway Response', 'event_espresso' );?></label>
311
+							<label for="txn-admin-payment-gateway-response-inp" class=""><?php _e('Gateway Response', 'event_espresso'); ?></label>
312 312
 							<input name="txn_admin_payment[gateway_response]" id="txn-admin-payment-gateway-response-inp" class="txn-admin-apply-payment-inp" type="text"/>
313
-							<p class="description"><?php _e( 'The gateway response string (optional)', 'event_espresso' );?></p>
313
+							<p class="description"><?php _e('The gateway response string (optional)', 'event_espresso'); ?></p>
314 314
 						</div>
315 315
 					</div>
316 316
 
317 317
 					<div class="mop-PP mop-CC mop">
318 318
 						<div class="txn-admin-apply-payment-status-dv admin-modal-dialog-row">
319
-							<label for="txn-admin-payment-status-inp" class=""><?php _e( 'Payment Status', 'event_espresso' );?></label>
319
+							<label for="txn-admin-payment-status-inp" class=""><?php _e('Payment Status', 'event_espresso'); ?></label>
320 320
 							<select name="txn_admin_payment[status]" id="txn-admin-payment-status-slct" class="txn-admin-apply-payment-slct" type="text" >
321
-							<?php foreach ( $payment_status as $STS_ID => $STS_code ) : ?>
321
+							<?php foreach ($payment_status as $STS_ID => $STS_code) : ?>
322 322
 								<?php $selected = $STS_ID == 'PAP' ? ' selected="selected"' : ''; ?>
323 323
 								<option id="payment-status-opt-<?php echo $STS_ID; ?>" value="<?php echo $STS_ID; ?>"<?php echo $selected; ?>><?php echo $STS_code; ?>&nbsp;&nbsp;</option>
324 324
 							<?php endforeach; ?>
325 325
 							</select>
326
-							<p class="description"><?php _e( 'Whether the payment was approved, cancelled, declined or failed after submission to the gateway', 'event_espresso' );?></p>
326
+							<p class="description"><?php _e('Whether the payment was approved, cancelled, declined or failed after submission to the gateway', 'event_espresso'); ?></p>
327 327
 						</div>
328 328
 					</div>
329 329
 
330 330
 					<div class="txn-admin-apply-payment-po-nmbr-dv admin-modal-dialog-row">
331
-						<label for="txn-admin-payment-po-nmbr-inp" class=""><?php _e( 'P.O. / S.O. #', 'event_espresso' );?></label>
331
+						<label for="txn-admin-payment-po-nmbr-inp" class=""><?php _e('P.O. / S.O. #', 'event_espresso'); ?></label>
332 332
 						<input name="txn_admin_payment[po_number]" id="txn-admin-payment-po-nmbr-inp" class="txn-admin-apply-payment-inp" type="text" maxlength="100"/>
333
-						<p class="description"><?php _e( 'The Purchase or Sales Order Number if any (optional)', 'event_espresso' );?></p>
333
+						<p class="description"><?php _e('The Purchase or Sales Order Number if any (optional)', 'event_espresso'); ?></p>
334 334
 					</div>
335 335
 
336 336
 					<div class="txn-admin-apply-payment-accounting-dv admin-modal-dialog-row">
337
-						<label for="txn-admin-payment-accounting-inp" class="last"><?php _e( 'Notes / Extra Accounting', 'event_espresso' );?></label>
337
+						<label for="txn-admin-payment-accounting-inp" class="last"><?php _e('Notes / Extra Accounting', 'event_espresso'); ?></label>
338 338
 						<input name="txn_admin_payment[accounting]" id="txn-admin-payment-accounting-inp" class="txn-admin-apply-payment-inp" type="text" value="<?php echo $REG_code; ?>" maxlength="100"/>		<input type="hidden" id="txn-admin-reg-code-inp" value="<?php echo $REG_code; ?>"/>
339
-						<p class="description"><?php _e( 'An extra field you may use for accounting purposes or simple notes. Defaults to the primary registrant\'s registration code.', 'event_espresso' );?></p>
339
+						<p class="description"><?php _e('An extra field you may use for accounting purposes or simple notes. Defaults to the primary registrant\'s registration code.', 'event_espresso'); ?></p>
340 340
 					</div>
341 341
 
342 342
 					<div class="txn-admin-apply-payment-registrations-dv admin-modal-dialog-row">
343
-						<label for="txn-admin-payment-registrations-inp" class="last"><?php _e( 'Registrations to Apply Payment to:', 'event_espresso' ); ?></label>
343
+						<label for="txn-admin-payment-registrations-inp" class="last"><?php _e('Registrations to Apply Payment to:', 'event_espresso'); ?></label>
344 344
 						<label class="txn-admin-apply-payment-to-registrations-lbl">
345 345
 							<input type="radio" value="1" id="txn-admin-apply-payment-to-all-registrations-inp" name="txn_admin_payment[apply_to_all_registrations]"  checked="checked"/>
346
-							<?php _e( 'ALL Registrations', 'event_espresso' ); ?>
346
+							<?php _e('ALL Registrations', 'event_espresso'); ?>
347 347
 						</label>
348 348
 						<label class="txn-admin-apply-payment-to-registrations-lbl">
349 349
 							<input type="radio" value="0" id="txn-admin-apply-payment-to-some-registrations-inp" name="txn_admin_payment[apply_to_all_registrations]" />
350
-							<?php _e( 'Just the following Registrations', 'event_espresso' ); ?>
350
+							<?php _e('Just the following Registrations', 'event_espresso'); ?>
351 351
 						</label>
352 352
 						<?php echo $registrations_to_apply_payment_to; ?>
353 353
 					</div>
354 354
 
355 355
 					<div class="txn-admin-payment-reg-status-dv admin-modal-dialog-row">
356
-						<label for="txn-admin-payment-reg-status-inp" class="last"><?php _e( 'Change Registration Status?', 'event_espresso' );?></label>
356
+						<label for="txn-admin-payment-reg-status-inp" class="last"><?php _e('Change Registration Status?', 'event_espresso'); ?></label>
357 357
 						<?php echo $status_change_select; ?>
358
-						<p class="description"><?php _e( 'If you wish to change the status for the registrations selected above, then select which status from this dropdown.', 'event_espresso' ); ?></p>
358
+						<p class="description"><?php _e('If you wish to change the status for the registrations selected above, then select which status from this dropdown.', 'event_espresso'); ?></p>
359 359
 						<br/>
360 360
 					</div>
361 361
 
362 362
 					<div class="txn-admin-apply-payment-send-notifications-dv admin-modal-dialog-row">
363 363
 
364
-						<label for="txn-admin-payment-send-notifications-inp" class="last"><?php _e( 'Send Related Messages?', 'event_espresso' );?></label>
364
+						<label for="txn-admin-payment-send-notifications-inp" class="last"><?php _e('Send Related Messages?', 'event_espresso'); ?></label>
365 365
 						<label class="txn-admin-payment-send-notifications-lbl">
366 366
 							<input type="checkbox" value="1" name="txn_payments[send_notifications]" checked="checked" aria-checked="true" style="vertical-align: middle;">
367
-							<?php _e( 'Payment Messages?', 'event_espresso' ); ?>
367
+							<?php _e('Payment Messages?', 'event_espresso'); ?>
368 368
 						</label>
369 369
 						<label class="txn-admin-payment-send-notifications-lbl">
370 370
 							<input type="checkbox" value="1" name="txn_reg_status_change[send_notifications]" style="vertical-align: middle;">
371
-							<?php _e( 'Registration Messages?', 'event_espresso' ); ?>
371
+							<?php _e('Registration Messages?', 'event_espresso'); ?>
372 372
 						</label>
373 373
 						<br class="clear-float"/>
374
-						<p class="description"><?php printf( __('By default %1$sa payment message is sent to the primary registrant%2$s after submitting this form.%3$sHowever, if you check the "Registration Messages" box, the system will also send any related messages matching the status of the registrations to %1$seach registration for this transaction%2$s.', 'event_espresso'), '<strong>', '</strong>', '<br />' ); ?></p>
374
+						<p class="description"><?php printf(__('By default %1$sa payment message is sent to the primary registrant%2$s after submitting this form.%3$sHowever, if you check the "Registration Messages" box, the system will also send any related messages matching the status of the registrations to %1$seach registration for this transaction%2$s.', 'event_espresso'), '<strong>', '</strong>', '<br />'); ?></p>
375 375
 						<label></label>
376 376
 					</div>
377 377
 					<div class="clear"></div>
@@ -382,27 +382,27 @@  discard block
 block discarded – undo
382 382
 			<ul id="admin-modal-dialog-options-ul">
383 383
 				<li>
384 384
 					<a id="txn-admin-modal-dialog-apply-payment-lnk" class="button-primary no-icon" style="display:none;" >
385
-						<?php _e( 'Apply Payment', 'event_espresso' );?>
385
+						<?php _e('Apply Payment', 'event_espresso'); ?>
386 386
 					</a>
387 387
 				</li>
388 388
 				<li>
389 389
 					<a id="txn-admin-modal-dialog-edit-payment-lnk" class="button-primary no-icon" style="display:none;" >
390
-						<?php _e( 'Save Payment Details', 'event_espresso' );?>
390
+						<?php _e('Save Payment Details', 'event_espresso'); ?>
391 391
 					</a>
392 392
 				</li>
393 393
 				<li>
394 394
 					<a id="txn-admin-modal-dialog-edit-refund-lnk" class="button-primary no-icon" style="display:none;" >
395
-						<?php _e( 'Save Refund Details', 'event_espresso' );?>
395
+						<?php _e('Save Refund Details', 'event_espresso'); ?>
396 396
 					</a>
397 397
 				</li>
398 398
 				<li>
399 399
 					<a id="txn-admin-modal-dialog-apply-refund-lnk" class="button-primary no-icon" style="display:none;" >
400
-						<?php _e( 'Apply Refund', 'event_espresso' );?>
400
+						<?php _e('Apply Refund', 'event_espresso'); ?>
401 401
 					</a>
402 402
 				</li>
403 403
 				<li>
404 404
 					<a id="txn-admin-modal-dialog-cancel-lnk" class="button-secondary no-icon" >
405
-						<?php _e( 'Cancel', 'event_espresso' );?>
405
+						<?php _e('Cancel', 'event_espresso'); ?>
406 406
 					</a>
407 407
 				</li>
408 408
 				<li>
@@ -419,29 +419,29 @@  discard block
 block discarded – undo
419 419
 
420 420
 		<h2 id="admin-modal-dialog-delete-payment-h2" class="admin-modal-dialog-h2 hdr-has-icon" style="display:none;">
421 421
 			<span class="ee-icon ee-icon-cash-add"></span>
422
-			<?php echo __( 'Delete Payment/Refund for Transaction #', 'event_espresso' ) . $txn_nmbr['value'];?>
422
+			<?php echo __('Delete Payment/Refund for Transaction #', 'event_espresso').$txn_nmbr['value']; ?>
423 423
 		</h2>
424 424
 
425 425
 		<form name="txn-admin-delete-payment-frm" id="txn-admin-delete-payment-frm" action="<?php echo $delete_payment_url; ?>">
426 426
 			<div class="admin-modal-dialog-wrap">
427 427
 				<div class="admin-modal-dialog-inner">
428 428
 
429
-					<input  type="hidden" name="espresso_delete_payment_nonce" id="espresso_delete_payment_nonce" value="<?php echo wp_create_nonce( 'espresso_delete_payment_nonce' );?>"/>
429
+					<input  type="hidden" name="espresso_delete_payment_nonce" id="espresso_delete_payment_nonce" value="<?php echo wp_create_nonce('espresso_delete_payment_nonce'); ?>"/>
430 430
 					<input  type="hidden" name="delete_espresso_ajax" id="delete-espresso-ajax" value="0"/>
431 431
 					<input  type="hidden" name="delete_noheader" id="delete-txn-admin-noheader-inp" value="0"/>
432 432
 					<input  type="hidden" name="delete_txn_admin_payment[PAY_ID]" id="delete-txn-admin-payment-payment-id-inp" class="txn-admin-apply-payment-inp" value="0"/>
433 433
 					<input  type="hidden" name="delete_txn_admin_payment[TXN_ID]" id="delete-txn-admin-payment-txn-id-inp" value="<?php echo $txn_nmbr['value']; ?>"/>
434 434
 
435 435
 					<div class="txn-admin-apply-payment-accounting-dv admin-modal-dialog-row">
436
-						<label for="delete-txn-admin-payment-reg-status-inp" class="last"><?php _e( 'Change Registration Status?', 'event_espresso' );?></label>
436
+						<label for="delete-txn-admin-payment-reg-status-inp" class="last"><?php _e('Change Registration Status?', 'event_espresso'); ?></label>
437 437
 						<?php echo $delete_status_change_select; ?>
438
-						<p class="description"><?php printf( __('If you wish to change the status of all the registrations associated with this transaction after deleting this payment/refund, then select which status from this dropdown. %sNote: ALL registrations associated with this transaction will be updated to this new status.%s', 'event_espresso'), '<strong>', '</strong>' ); ?></p>
438
+						<p class="description"><?php printf(__('If you wish to change the status of all the registrations associated with this transaction after deleting this payment/refund, then select which status from this dropdown. %sNote: ALL registrations associated with this transaction will be updated to this new status.%s', 'event_espresso'), '<strong>', '</strong>'); ?></p>
439 439
 					</div>
440 440
 
441 441
 					<div class="ee-attention txn-admin-apply-payment-accounting-dv admin-modal-dialog-row">
442
-						<label for="delete-txn-admin-payment-accounting-inp" class="last"><?php _e( 'Send Related Messages?', 'event_espresso' );?></label>
442
+						<label for="delete-txn-admin-payment-accounting-inp" class="last"><?php _e('Send Related Messages?', 'event_espresso'); ?></label>
443 443
 						<input type="checkbox" value="1" name="delete_txn_reg_status_change[send_notifications]">
444
-						<p class="description"><?php _e( 'If you check this box, the system will send any related registration messages matching the status of the registrations to each registration for this transaction. No Payment notifications are sent when deleting a payment.', 'event_espresso' );?></p>
444
+						<p class="description"><?php _e('If you check this box, the system will send any related registration messages matching the status of the registrations to each registration for this transaction. No Payment notifications are sent when deleting a payment.', 'event_espresso'); ?></p>
445 445
 					</div>
446 446
 					<div class="clear"></div>
447 447
 
@@ -451,12 +451,12 @@  discard block
 block discarded – undo
451 451
 			<ul id="del-admin-modal-dialog-options-ul">
452 452
 				<li>
453 453
 					<a id="txn-admin-modal-dialog-delete-lnk" class="button-primary no-icon" style="display:none;" >
454
-						<?php _e( 'Delete', 'event_espresso' );?>
454
+						<?php _e('Delete', 'event_espresso'); ?>
455 455
 					</a>
456 456
 				</li>
457 457
 				<li>
458 458
 					<a id="del-txn-admin-modal-dialog-cancel-lnk" class="button-secondary no-icon" >
459
-						<?php _e( 'Cancel', 'event_espresso' );?>
459
+						<?php _e('Cancel', 'event_espresso'); ?>
460 460
 					</a>
461 461
 				</li>
462 462
 				<li>
@@ -472,30 +472,30 @@  discard block
 block discarded – undo
472 472
 	<?php endif; // $grand_raw_total > 0?>
473 473
 
474 474
 	<?php
475
-	if ( WP_DEBUG ) {
476
-		$delivered_messages = get_option( 'EED_Messages__payment', array() );
477
-		if ( isset( $delivered_messages[ $TXN_ID ] )) {
475
+	if (WP_DEBUG) {
476
+		$delivered_messages = get_option('EED_Messages__payment', array());
477
+		if (isset($delivered_messages[$TXN_ID])) {
478 478
 			?>
479
-			<h4 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-email-alt"></span><?php _e( 'Messages Sent to Primary Registrant', 'event_espresso' );?></h4>
479
+			<h4 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-email-alt"></span><?php _e('Messages Sent to Primary Registrant', 'event_espresso'); ?></h4>
480 480
 
481 481
 			<div class="admin-primary-mbox-tbl-wrap">
482 482
 				<table class="admin-primary-mbox-tbl">
483 483
 					<thead>
484 484
 						<tr>
485
-							<th class="jst-left"><?php _e( 'Date & Time', 'event_espresso' );?></th>
486
-							<th class="jst-left"><?php _e( 'Message Type', 'event_espresso' );?></th>
487
-							<th class="jst-left"><?php _e( 'Payment Status Upon Sending', 'event_espresso' );?></th>
488
-							<th class="jst-left"><?php _e( 'TXN Status Upon Sending', 'event_espresso' );?></th>
485
+							<th class="jst-left"><?php _e('Date & Time', 'event_espresso'); ?></th>
486
+							<th class="jst-left"><?php _e('Message Type', 'event_espresso'); ?></th>
487
+							<th class="jst-left"><?php _e('Payment Status Upon Sending', 'event_espresso'); ?></th>
488
+							<th class="jst-left"><?php _e('TXN Status Upon Sending', 'event_espresso'); ?></th>
489 489
 						</tr>
490 490
 					</thead>
491 491
 					<tbody>
492
-						<?php foreach ( $delivered_messages[ $TXN_ID ] as $timestamp => $delivered_message ) :
492
+						<?php foreach ($delivered_messages[$TXN_ID] as $timestamp => $delivered_message) :
493 493
 							?>
494 494
 							<tr>
495
-								<td class="jst-left"><?php echo gmdate( get_option('date_format') . ' ' . get_option('time_format'), ( $timestamp + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) );?></td>
496
-								<td class="jst-left"><?php echo isset( $delivered_message['message_type'] ) ? $delivered_message['message_type'] : '';?></td>
497
-								<td class="jst-left"><?php echo isset( $delivered_message['pay_status'] ) ? $delivered_message['pay_status'] : '';?></td>
498
-								<td class="jst-left"><?php echo isset( $delivered_message['txn_status'] ) ? $delivered_message['txn_status'] : '';?></td>
495
+								<td class="jst-left"><?php echo gmdate(get_option('date_format').' '.get_option('time_format'), ($timestamp + (get_option('gmt_offset') * HOUR_IN_SECONDS))); ?></td>
496
+								<td class="jst-left"><?php echo isset($delivered_message['message_type']) ? $delivered_message['message_type'] : ''; ?></td>
497
+								<td class="jst-left"><?php echo isset($delivered_message['pay_status']) ? $delivered_message['pay_status'] : ''; ?></td>
498
+								<td class="jst-left"><?php echo isset($delivered_message['txn_status']) ? $delivered_message['txn_status'] : ''; ?></td>
499 499
 							</tr>
500 500
 						<?php endforeach; // $delivered_messages?>
501 501
 					</tbody>
Please login to merge, or discard this patch.
admin_pages/venues/Venues_Admin_Page_Init.core.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
 
33 33
 	public function __construct() {
34 34
 		//define some event categories related constants
35
-		define( 'EE_VENUES_PG_SLUG', 'espresso_venues' );
36
-		define( 'EE_VENUES_ADMIN_URL', admin_url('admin.php?page=' . EE_VENUES_PG_SLUG ));
37
-		define( 'EE_VENUES_ASSETS_URL', EE_ADMIN_PAGES_URL . 'venues/assets/');
38
-		define( 'EE_VENUES_TEMPLATE_PATH', EE_ADMIN_PAGES . 'venues/templates/' );
35
+		define('EE_VENUES_PG_SLUG', 'espresso_venues');
36
+		define('EE_VENUES_ADMIN_URL', admin_url('admin.php?page='.EE_VENUES_PG_SLUG));
37
+		define('EE_VENUES_ASSETS_URL', EE_ADMIN_PAGES_URL.'venues/assets/');
38
+		define('EE_VENUES_TEMPLATE_PATH', EE_ADMIN_PAGES.'venues/templates/');
39 39
 
40 40
 		parent::__construct();
41
-		$this->_folder_path = EE_ADMIN_PAGES . $this->_folder_name . DS;
41
+		$this->_folder_path = EE_ADMIN_PAGES.$this->_folder_name.DS;
42 42
 	}
43 43
 
44 44
 	protected function _set_init_properties() {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
 
51 51
 	protected function _set_menu_map() {
52
-		$this->_menu_map = new EE_Admin_Page_Sub_Menu( array(
52
+		$this->_menu_map = new EE_Admin_Page_Sub_Menu(array(
53 53
 			'menu_group' => 'management',
54 54
 			'menu_order' => 40,
55 55
 			'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
Please login to merge, or discard this patch.
admin_pages/venues/espresso_events_Venues_Hooks.class.php 1 patch
Spacing   +35 added lines, -35 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
 /**
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 	protected $_event;
34 34
 
35 35
 
36
-	public function __construct( EE_Admin_Page $admin_page ) {
37
-		parent::__construct( $admin_page );
36
+	public function __construct(EE_Admin_Page $admin_page) {
37
+		parent::__construct($admin_page);
38 38
 	}
39 39
 
40 40
 
@@ -49,18 +49,18 @@  discard block
 block discarded – undo
49 49
 				'priority' => 'high',
50 50
 				'context' => 'normal'
51 51
 				)
52
-		);/**/
52
+		); /**/
53 53
 
54 54
 		$this->_scripts_styles = array(
55 55
 			'registers' => array(
56 56
 				'ee_event_venues' => array(
57 57
 					'type' => 'js',
58
-					'url' => EE_VENUES_ASSETS_URL . 'ee-event-venues-admin.js',
58
+					'url' => EE_VENUES_ASSETS_URL.'ee-event-venues-admin.js',
59 59
 					'depends' => array('jquery')
60 60
 					),
61 61
 				'ee_event_venues_css' => array(
62 62
 					'type' => 'css',
63
-					'url' => EE_VENUES_ASSETS_URL . 'ee-event-venues-admin.css',
63
+					'url' => EE_VENUES_ASSETS_URL.'ee-event-venues-admin.css',
64 64
 					)
65 65
 				),
66 66
 			'enqueues' => array(
@@ -70,24 +70,24 @@  discard block
 block discarded – undo
70 70
 			);
71 71
 
72 72
 		//hook into the handler for saving venue
73
-		add_filter( 'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks', array( $this, 'modify_callbacks' ), 10 );
73
+		add_filter('FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks', array($this, 'modify_callbacks'), 10);
74 74
 
75 75
 		//remove default ee_autosave returns for DECAF venues (not needed for CAF venues cause we have a dropdown selector)
76
-		add_filter( 'FHEE__Events_Admin_Page__ee_autosave_edit_do_decaf_venue_save', '__return_false' );
76
+		add_filter('FHEE__Events_Admin_Page__ee_autosave_edit_do_decaf_venue_save', '__return_false');
77 77
 
78 78
 	}
79 79
 
80 80
 
81
-	public function modify_callbacks( $callbacks ) {
81
+	public function modify_callbacks($callbacks) {
82 82
 		// first remove default venue callback
83
-		foreach ( $callbacks as $key => $callback ) {
84
-			if ( $callback[1] == '_default_venue_update' ) {
85
-				unset( $callbacks[$key] );
83
+		foreach ($callbacks as $key => $callback) {
84
+			if ($callback[1] == '_default_venue_update') {
85
+				unset($callbacks[$key]);
86 86
 			}
87 87
 		}
88 88
 
89 89
 		//now let's add the caf version
90
-		$callbacks[] = array( $this, 'caf_venue_update' );
90
+		$callbacks[] = array($this, 'caf_venue_update');
91 91
 		return $callbacks;
92 92
 	}
93 93
 
@@ -103,69 +103,69 @@  discard block
 block discarded – undo
103 103
 		$evt_id = $evt_obj->ID();
104 104
 
105 105
 		//first let's see if we have a venue already
106
-		$evt_venues = !empty( $evt_id ) ? $evt_obj->venues() : array();
107
-		$evt_venue = $evt_venues && is_array( $evt_venues ) ? reset( $evt_venues ) : null;
106
+		$evt_venues = ! empty($evt_id) ? $evt_obj->venues() : array();
107
+		$evt_venue = $evt_venues && is_array($evt_venues) ? reset($evt_venues) : null;
108 108
 		$evt_venue_id = $evt_venue instanceof EE_Venue ? $evt_venue->ID() : null;
109 109
 
110 110
 		//possibly private venues.
111
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_private_venues', 'get_venues' ) ) {
112
-			$vnu_where['status']= array( 'IN' , array( 'publish', 'private' ) );
111
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_private_venues', 'get_venues')) {
112
+			$vnu_where['status'] = array('IN', array('publish', 'private'));
113 113
 		} else {
114 114
 			$vnu_where['status'] = 'publish';
115 115
 		}
116 116
 
117 117
 		//cap checks
118
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_venues', 'get_venues' ) ) {
118
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_venues', 'get_venues')) {
119 119
 			$vnu_where['VNU_wp_user'] = get_current_user_id();
120 120
 		}
121 121
 
122
-		$vnumdl = EE_Registry::instance()->load_model( 'Venue' );
123
-		$venues = $vnumdl->get_all( array( $vnu_where, 'order_by' => array( 'VNU_name' => 'ASC' ) ) );
122
+		$vnumdl = EE_Registry::instance()->load_model('Venue');
123
+		$venues = $vnumdl->get_all(array($vnu_where, 'order_by' => array('VNU_name' => 'ASC')));
124 124
 
125 125
 		$ven_select = array();
126 126
 		$ven_select[0] = __('Select a Venue', 'event_espresso');
127 127
 		//setup venues for selector
128
-		foreach ( $venues as $venue ) {
128
+		foreach ($venues as $venue) {
129 129
 			$ven_select[$venue->ID()] = $venue->name();
130 130
 		}
131 131
 
132 132
 		//if $ven_select does not have the existing venue attached to event then let's add that because we'll always
133 133
 		//show existing attached venues even if it's trashed (or some other restricted status).
134 134
 
135
-		if ( $evt_venue_id && ! isset( $ven_select[$evt_venue_id] ) ) {
135
+		if ($evt_venue_id && ! isset($ven_select[$evt_venue_id])) {
136 136
 			$ven_select[$evt_venue_id] = $evt_venue->name();
137
-			$venues = array_merge( $venues, array( $evt_venue ) );
137
+			$venues = array_merge($venues, array($evt_venue));
138 138
 		}
139 139
 
140 140
 		$template_args['venues'] = $venues;
141 141
 		$template_args['evt_venue_id'] = $evt_venue_id;
142
-		$template_args['venue_selector'] = EEH_Form_Fields::select_input('venue_id', $ven_select, $evt_venue_id, 'id="venue_id"' );
143
-		$template_args['enable_for_gmap'] = EEH_Form_Fields::select_input('enable_for_gmap', $values, is_object( $evt_venue ) ? $evt_venue->enable_for_gmap() : NULL, 'id="enable_for_gmap"');
144
-		$template_path = empty( $venues ) ? EE_VENUES_TEMPLATE_PATH . 'event_venues_metabox_content.template.php' : EE_VENUES_TEMPLATE_PATH . 'event_venues_metabox_content_from_manager.template.php';
145
-		EEH_Template::display_template( $template_path, $template_args );
142
+		$template_args['venue_selector'] = EEH_Form_Fields::select_input('venue_id', $ven_select, $evt_venue_id, 'id="venue_id"');
143
+		$template_args['enable_for_gmap'] = EEH_Form_Fields::select_input('enable_for_gmap', $values, is_object($evt_venue) ? $evt_venue->enable_for_gmap() : NULL, 'id="enable_for_gmap"');
144
+		$template_path = empty($venues) ? EE_VENUES_TEMPLATE_PATH.'event_venues_metabox_content.template.php' : EE_VENUES_TEMPLATE_PATH.'event_venues_metabox_content_from_manager.template.php';
145
+		EEH_Template::display_template($template_path, $template_args);
146 146
 	}
147 147
 
148 148
 
149 149
 
150 150
 
151
-	public function caf_venue_update( $evtobj, $data ) {
151
+	public function caf_venue_update($evtobj, $data) {
152 152
 		EE_Registry::instance()->load_model('Venue');
153
-		$venue_id = !empty( $data['venue_id'] ) ? $data['venue_id'] : NULL;
153
+		$venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : NULL;
154 154
 
155 155
 
156 156
 		//first let's check if the selected venue matches any existing venue attached to the event
157 157
 		$evt_venue = $evtobj->venues();
158
-		$evt_venue = !empty( $evt_venue ) ? array_shift( $evt_venue ) : NULL;
158
+		$evt_venue = ! empty($evt_venue) ? array_shift($evt_venue) : NULL;
159 159
 
160
-		if ( !empty( $evt_venue ) && $evt_venue->ID() != $venue_id )
161
-			$evtobj->_remove_relation_to( $evt_venue->ID(), 'Venue' );
160
+		if ( ! empty($evt_venue) && $evt_venue->ID() != $venue_id)
161
+			$evtobj->_remove_relation_to($evt_venue->ID(), 'Venue');
162 162
 
163
-		if ( empty( $venue_id ) )
163
+		if (empty($venue_id))
164 164
 			return TRUE; //no venue to attach
165 165
 
166 166
 		// this should take care of adding to revisions as well as main post object
167
-		$success = $evtobj->_add_relation_to( $venue_id, 'Venue' );
168
-		return !empty($success) ? TRUE : FALSE;
167
+		$success = $evtobj->_add_relation_to($venue_id, 'Venue');
168
+		return ! empty($success) ? TRUE : FALSE;
169 169
 	}
170 170
 
171 171
 
Please login to merge, or discard this patch.
admin/extend/messages/espresso_events_Messages_Hooks_Extend.class.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -30,15 +30,15 @@  discard block
 block discarded – undo
30 30
 class espresso_events_Messages_Hooks_Extend extends espresso_events_Messages_Hooks {
31 31
 
32 32
 
33
-	public function __construct( EE_Admin_Page $adminpage ) {
33
+	public function __construct(EE_Admin_Page $adminpage) {
34 34
 		/**
35 35
 		 * Add cap restriction ... metaboxes should not show if user does not have the ability to edit_custom_messages
36 36
 		 */
37
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_edit_messages', 'messages_events_editor_metabox' ) ) {
37
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'messages_events_editor_metabox')) {
38 38
 			return;
39 39
 		}
40
-		add_filter('FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks', array( $this, 'caf_updates' ), 10 );
41
-		parent::__construct( $adminpage );
40
+		add_filter('FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks', array($this, 'caf_updates'), 10);
41
+		parent::__construct($adminpage);
42 42
 	}
43 43
 
44 44
 	/**
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	protected function _extend_properties() {
51 51
 
52
-		define( 'EE_MSGS_EXTEND_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/assets/' );
52
+		define('EE_MSGS_EXTEND_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'messages/assets/');
53 53
 		$this->_ajax_func = array(
54 54
 			'ee_msgs_create_new_custom' => 'create_new_custom'
55 55
 			);
56 56
 		$this->_metaboxes = array(
57 57
 			0 => array(
58
-				'page_route' => array('edit','create_new'),
58
+				'page_route' => array('edit', 'create_new'),
59 59
 				'func' => 'messages_metabox',
60 60
 				'label' => __('Notifications', 'event_espresso'),
61 61
 				'priority' => 'high'
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
 		$this->_scripts_styles = array(
67 67
 			'registers' => array(
68 68
 				'events_msg_admin' => array(
69
-					'url' => EE_MSGS_EXTEND_ASSETS_URL . 'events_messages_admin.js',
69
+					'url' => EE_MSGS_EXTEND_ASSETS_URL.'events_messages_admin.js',
70 70
 					'depends' => array('ee-dialog', 'ee-parse-uri', 'ee-serialize-full-array')
71 71
 					),
72 72
 				'events_msg_admin_css' => array(
73
-					'url' => EE_MSGS_EXTEND_ASSETS_URL . 'ee_msg_events_admin.css',
73
+					'url' => EE_MSGS_EXTEND_ASSETS_URL.'ee_msg_events_admin.css',
74 74
 					'type' => 'css'
75 75
 					)
76 76
 				),
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
 	}
83 83
 
84 84
 
85
-	public function caf_updates( $update_callbacks ) {
86
-		$update_callbacks[] = array( $this, 'attach_evt_message_templates' );
85
+	public function caf_updates($update_callbacks) {
86
+		$update_callbacks[] = array($this, 'attach_evt_message_templates');
87 87
 		return $update_callbacks;
88 88
 	}
89 89
 
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
 	 * @param  array       $data   The request data from the form
97 97
 	 * @return bool         success or fail
98 98
 	 */
99
-	public function attach_evt_message_templates( $evtobj, $data ) {
99
+	public function attach_evt_message_templates($evtobj, $data) {
100 100
 		//first we remove all existing relations on the Event for message types.
101 101
 		$evtobj->_remove_relations('Message_Template_Group');
102 102
 
103 103
 		//now let's just loop throught the selected templates and add relations!
104
-		foreach( $data['event_message_templates_relation'] as $grp_ID ) {
105
-			$evtobj->_add_relation_to( $grp_ID, 'Message_Template_Group' );
104
+		foreach ($data['event_message_templates_relation'] as $grp_ID) {
105
+			$evtobj->_add_relation_to($grp_ID, 'Message_Template_Group');
106 106
 		}
107 107
 
108 108
 		//now save
@@ -115,10 +115,10 @@  discard block
 block discarded – undo
115 115
 
116 116
 		//let's get the active messengers (b/c messenger objects have the active message templates)
117 117
 		//convert 'evt_id' to 'EVT_ID'
118
-		$this->_req_data['EVT_ID'] = isset( $this->_req_data['EVT_ID'] ) ? $this->_req_data['EVT_ID'] : NULL;
119
-		$this->_req_data['EVT_ID'] = isset( $this->_req_data['post'] ) && empty( $this->_req_data['EVT_ID'] ) ? $this->_req_data['post'] : $this->_req_data['EVT_ID'];
118
+		$this->_req_data['EVT_ID'] = isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL;
119
+		$this->_req_data['EVT_ID'] = isset($this->_req_data['post']) && empty($this->_req_data['EVT_ID']) ? $this->_req_data['post'] : $this->_req_data['EVT_ID'];
120 120
 
121
-		$this->_req_data['EVT_ID'] = empty($this->_req_data['EVT_ID'] ) && isset($this->_req_data['evt_id'] ) ? $this->_req_data['evt_id'] : $this->_req_data['EVT_ID'];
121
+		$this->_req_data['EVT_ID'] = empty($this->_req_data['EVT_ID']) && isset($this->_req_data['evt_id']) ? $this->_req_data['evt_id'] : $this->_req_data['EVT_ID'];
122 122
 
123 123
 
124 124
 		$EEM_controller = new EE_messages;
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
 
128 128
 		//empty messengers?
129 129
 		//Note message types will always have at least one available because every messenger has a default message type associated with it (payment) if no other message types are selected.
130
-		if ( empty( $active_messengers ) ) {
131
-			$msg_activate_url = EE_Admin_Page::add_query_args_and_nonce( array('action' => 'settings'), EE_MSG_ADMIN_URL );
132
-			$error_msg = sprintf( __('There are no active messengers. So no notifications will go out for <strong>any</strong> events.  You will want to %sActivate a Messenger%s.', 'event_espresso'), '<a href="' . $msg_activate_url . '">', '</a>');
133
-			$error_content = '<div class="error"><p>' . $error_msg . '</p></div>';
134
-			$internal_content = '<div id="messages-error"><p>' . $error_msg . '</p></div>';
130
+		if (empty($active_messengers)) {
131
+			$msg_activate_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'settings'), EE_MSG_ADMIN_URL);
132
+			$error_msg = sprintf(__('There are no active messengers. So no notifications will go out for <strong>any</strong> events.  You will want to %sActivate a Messenger%s.', 'event_espresso'), '<a href="'.$msg_activate_url.'">', '</a>');
133
+			$error_content = '<div class="error"><p>'.$error_msg.'</p></div>';
134
+			$internal_content = '<div id="messages-error"><p>'.$error_msg.'</p></div>';
135 135
 
136 136
 			echo $error_content;
137 137
 			echo $internal_content;
@@ -140,39 +140,39 @@  discard block
 block discarded – undo
140 140
 
141 141
 		$event_id = isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL;
142 142
 		//get content for active messengers
143
-		foreach ( $active_messengers as $name => $messenger ) {
143
+		foreach ($active_messengers as $name => $messenger) {
144 144
 			//first check if there are any active message types for this messenger.
145
-			$active_mts = $EEM_controller->get_active_message_types_per_messenger( $name );
146
-			if ( empty( $active_mts ) ) {
145
+			$active_mts = $EEM_controller->get_active_message_types_per_messenger($name);
146
+			if (empty($active_mts)) {
147 147
 				continue;
148 148
 			}
149 149
 
150
-			$tcont = $messenger->get_messenger_admin_page_content('events', 'edit', array('event' => $event_id) );
150
+			$tcont = $messenger->get_messenger_admin_page_content('events', 'edit', array('event' => $event_id));
151 151
 
152
-			if ( ! empty( $tcont ) ) {
152
+			if ( ! empty($tcont)) {
153 153
 				$tabs[$name] = $tcont;
154 154
 			}
155 155
 		}
156 156
 
157 157
 
158
-		EE_Registry::instance()->load_helper( 'Tabbed_Content' );
158
+		EE_Registry::instance()->load_helper('Tabbed_Content');
159 159
 		//we want this to be tabbed content so let's use the EEH_Tabbed_Content::display helper.
160 160
 		$tabbed_content = EEH_Tabbed_Content::display($tabs);
161
-		if ( is_wp_error($tabbed_content) ) {
161
+		if (is_wp_error($tabbed_content)) {
162 162
 			$tabbed_content = $tabbed_content->get_error_message();
163 163
 		}
164 164
 
165 165
 		$notices = '<div id="espresso-ajax-loading" class="ajax-loader-grey">
166
-				<span class="ee-spinner ee-spin"></span><span class="hidden">' . __('loading...', 'event_espresso') . '</span>
166
+				<span class="ee-spinner ee-spin"></span><span class="hidden">' . __('loading...', 'event_espresso').'</span>
167 167
 			</div><div class="ee-notices"></div>';
168 168
 
169
-		if ( defined('DOING_AJAX' ) ) {
169
+		if (defined('DOING_AJAX')) {
170 170
 			return $tabbed_content;
171 171
 		}
172 172
 
173
-		do_action( 'AHEE__espresso_events_Messages_Hooks_Extend__messages_metabox__before_content' );
174
-		echo $notices . '<div class="messages-tabs-content">' . $tabbed_content . '</div>';
175
-		do_action( 'AHEE__espresso_events_Messages_Hooks_Extend__messages_metabox__after_content' );
173
+		do_action('AHEE__espresso_events_Messages_Hooks_Extend__messages_metabox__before_content');
174
+		echo $notices.'<div class="messages-tabs-content">'.$tabbed_content.'</div>';
175
+		do_action('AHEE__espresso_events_Messages_Hooks_Extend__messages_metabox__after_content');
176 176
 
177 177
 	}
178 178
 
@@ -186,22 +186,22 @@  discard block
 block discarded – undo
186 186
 	 */
187 187
 	public function create_new_custom() {
188 188
 
189
-		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_edit_messages', 'create_new_custom_ajax' ) ) {
190
-			wp_die( __('You don\'t have privileges to do this action', 'event_espresso' ) );
189
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'create_new_custom_ajax')) {
190
+			wp_die(__('You don\'t have privileges to do this action', 'event_espresso'));
191 191
 		}
192 192
 
193 193
 		//let's clean up the _POST global a bit for downstream usage of name and description.
194
-		$_POST['templateName'] = !empty( $this->_req_data['custom_template_args']['MTP_name'] ) ? $this->_req_data['custom_template_args']['MTP_name'] : '';
195
-		$_POST['templateDescription'] = !empty( $this->_req_data['custom_template_args']['MTP_description'] ) ? $this->_req_data['custom_template_args']['MTP_description'] : '';
194
+		$_POST['templateName'] = ! empty($this->_req_data['custom_template_args']['MTP_name']) ? $this->_req_data['custom_template_args']['MTP_name'] : '';
195
+		$_POST['templateDescription'] = ! empty($this->_req_data['custom_template_args']['MTP_description']) ? $this->_req_data['custom_template_args']['MTP_description'] : '';
196 196
 
197 197
 
198 198
 		//set EE_Admin_Page object (see method details in EE_Admin_Hooks parent
199 199
 		$this->_set_page_object();
200 200
 
201 201
 		//is this a template switch if so EE_Admin_Page child needs this object
202
-		$this->_page_object->set_hook_object( $this );
202
+		$this->_page_object->set_hook_object($this);
203 203
 
204
-		$this->_page_object->add_message_template( $this->_req_data['messageType'], $this->_req_data['messenger'], $this->_req_data['group_ID'] );
204
+		$this->_page_object->add_message_template($this->_req_data['messageType'], $this->_req_data['messenger'], $this->_req_data['group_ID']);
205 205
 	}
206 206
 
207 207
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	 * @return string (admin_footer contents)
217 217
 	 */
218 218
 	public function edit_admin_footer() {
219
-		$template_path = EE_CORE_CAF_ADMIN_EXTEND . 'messages/templates/create_custom_template_form.template.php';
219
+		$template_path = EE_CORE_CAF_ADMIN_EXTEND.'messages/templates/create_custom_template_form.template.php';
220 220
 		EEH_Template::display_template($template_path, array());
221 221
 	}
222 222
 
Please login to merge, or discard this patch.
Extend_Registration_Form_Questions_Admin_List_Table.class.php 1 patch
Spacing   +21 added lines, -21 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
 /**
@@ -31,15 +31,15 @@  discard block
 block discarded – undo
31 31
 
32 32
 class Extend_Registration_Form_Questions_Admin_List_Table extends Registration_Form_Questions_Admin_List_Table {
33 33
 
34
-	public function __construct( $admin_page ) {
35
-		parent::__construct( $admin_page );
34
+	public function __construct($admin_page) {
35
+		parent::__construct($admin_page);
36 36
 	}
37 37
 
38 38
 	public function column_display_text(EE_Question $item) {
39 39
 		$system_question = $item->is_system_question();
40 40
 		$actions = array();
41 41
 
42
-		if ( !defined('REG_ADMIN_URL') )
42
+		if ( ! defined('REG_ADMIN_URL'))
43 43
 			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
44 44
 
45 45
 		$edit_query_args = array(
@@ -67,35 +67,35 @@  discard block
 block discarded – undo
67 67
 				'QST_ID' => $item->ID()
68 68
 			);
69 69
 
70
-		$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EE_FORMS_ADMIN_URL );
71
-		$trash_link = EE_Admin_Page::add_query_args_and_nonce( $trash_query_args, EE_FORMS_ADMIN_URL );
72
-		$restore_link = EE_Admin_Page::add_query_args_and_nonce( $restore_query_args, EE_FORMS_ADMIN_URL );
73
-		$delete_link = EE_Admin_Page::add_query_args_and_nonce( $delete_query_args, EE_FORMS_ADMIN_URL );
74
-		$duplicate_link = EE_Admin_Page::add_query_args_and_nonce( $duplicate_query_args, EE_FORMS_ADMIN_URL );
70
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
71
+		$trash_link = EE_Admin_Page::add_query_args_and_nonce($trash_query_args, EE_FORMS_ADMIN_URL);
72
+		$restore_link = EE_Admin_Page::add_query_args_and_nonce($restore_query_args, EE_FORMS_ADMIN_URL);
73
+		$delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_FORMS_ADMIN_URL);
74
+		$duplicate_link = EE_Admin_Page::add_query_args_and_nonce($duplicate_query_args, EE_FORMS_ADMIN_URL);
75 75
 
76
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_question', 'espresso_registration_form_edit_question', $item->ID() ) ) {
76
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_question', 'espresso_registration_form_edit_question', $item->ID())) {
77 77
 			$actions = array(
78
-				'edit' => '<a href="' . $edit_link . '" title="' . __('Edit Question', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>'
78
+				'edit' => '<a href="'.$edit_link.'" title="'.__('Edit Question', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'
79 79
 			);
80 80
 		}
81 81
 
82
-		if ( ! $system_question && $this->_view != 'trash' && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question', 'espresso_registration_form_trash_question', $item->ID() ) ) {
83
-			$actions['delete'] = '<a href="' . $trash_link . '" title="' . __('Trash Question', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
82
+		if ( ! $system_question && $this->_view != 'trash' && EE_Registry::instance()->CAP->current_user_can('ee_delete_question', 'espresso_registration_form_trash_question', $item->ID())) {
83
+			$actions['delete'] = '<a href="'.$trash_link.'" title="'.__('Trash Question', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
84 84
 		}
85 85
 
86
-		if ( $this->_view == 'trash' ) {
87
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question', 'espresso_registration_form_restore_question', $item->ID() ) ) {
88
-				$actions['restore'] = '<a href="' . $restore_link . '" title="' . __('Restore Question', 'event_espresso') . '">' . __('Restore', 'event_espresso') . '</a>';
86
+		if ($this->_view == 'trash') {
87
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_question', 'espresso_registration_form_restore_question', $item->ID())) {
88
+				$actions['restore'] = '<a href="'.$restore_link.'" title="'.__('Restore Question', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>';
89 89
 			}
90
-			if ( $item->count_related('Answer') === 0 && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question', 'espresso_registration_form_delete_questions', $item->ID() ) ) {
91
-				$actions['delete'] = '<a href="' . $delete_link . '" title="' . __('Delete Question Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>';
90
+			if ($item->count_related('Answer') === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_question', 'espresso_registration_form_delete_questions', $item->ID())) {
91
+				$actions['delete'] = '<a href="'.$delete_link.'" title="'.__('Delete Question Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
92 92
 			}
93 93
 		}
94
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_questions', 'espresso_registration_form_edit_question' ) ) {
95
-			$actions[ 'duplicate' ] = '<a href="' . $duplicate_link . '" title="' . __('Duplicate Question', 'event_espresso') . '">' . __('Duplicate', 'event_espresso') . '</a>';
94
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_questions', 'espresso_registration_form_edit_question')) {
95
+			$actions['duplicate'] = '<a href="'.$duplicate_link.'" title="'.__('Duplicate Question', 'event_espresso').'">'.__('Duplicate', 'event_espresso').'</a>';
96 96
 		}
97 97
 
98
-		$content = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_question', 'espresso_registration_form_edit_question', $item->ID() ) ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->display_text() . '</a></strong>' : $item->display_text();
98
+		$content = EE_Registry::instance()->CAP->current_user_can('ee_edit_question', 'espresso_registration_form_edit_question', $item->ID()) ? '<strong><a class="row-title" href="'.$edit_link.'">'.$item->display_text().'</a></strong>' : $item->display_text();
99 99
 		$content .= $this->row_actions($actions);
100 100
 		return $content;
101 101
 	}
Please login to merge, or discard this patch.
Registration_Form_Question_Groups_Admin_List_Table.class.php 1 patch
Spacing   +30 added lines, -30 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
 /**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 class Registration_Form_Question_Groups_Admin_List_Table extends EE_Admin_List_Table {
32 32
 
33 33
 
34
-	public function __construct( $admin_page ) {
34
+	public function __construct($admin_page) {
35 35
 		parent::__construct($admin_page);
36 36
 	}
37 37
 
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 
40 40
 
41 41
 	protected function _setup_data() {
42
-		$this->_data = $this->_view != 'trash' ? $this->_admin_page->get_question_groups( $this->_per_page,$this->_current_page, FALSE ) : $this->_admin_page->get_trashed_question_groups( $this->_per_page,$this->_current_page, FALSE );
43
-		$this->_all_data_count = $this->_view != 'trash' ? $this->_admin_page->get_question_groups( $this->_per_page,$this->_current_page, TRUE ) : $this->_admin_page->get_trashed_question_groups( $this->_per_page,$this->_current_page, TRUE );
42
+		$this->_data = $this->_view != 'trash' ? $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, FALSE) : $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, FALSE);
43
+		$this->_all_data_count = $this->_view != 'trash' ? $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, TRUE) : $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, TRUE);
44 44
 	}
45 45
 
46 46
 
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 
50 50
 	protected function _set_properties() {
51 51
 		$this->_wp_list_args = array(
52
-			'singular' => __('question group', 'event_espresso' ),
53
-			'plural' => __('question groups', 'event_espresso' ),
52
+			'singular' => __('question group', 'event_espresso'),
53
+			'plural' => __('question groups', 'event_espresso'),
54 54
 			'ajax' => TRUE, //for now,
55 55
 			'screen' => $this->_admin_page->get_current_screen()->id
56 56
 			);
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 			);
66 66
 
67 67
 		$this->_sortable_columns = array(
68
-			'id' => array( 'QSG_ID' => FALSE ),
69
-			'name' => array( 'QSG_name' => FALSE )
68
+			'id' => array('QSG_ID' => FALSE),
69
+			'name' => array('QSG_name' => FALSE)
70 70
 			);
71 71
 
72 72
 		$this->_hidden_columns = array(
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
 
93 93
 
94 94
 	protected function _add_view_counts() {
95
-		$this->_views['all']['count'] = $this->_admin_page->get_question_groups( $this->_per_page,$this->_current_page, TRUE );
96
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_groups', 'espresso_registration_form_trash_question_group' ) ) {
97
-			$this->_views['trash']['count'] = $this->_admin_page->get_trashed_question_groups( $this->_per_page,$this->_current_page, TRUE );
95
+		$this->_views['all']['count'] = $this->_admin_page->get_question_groups($this->_per_page, $this->_current_page, TRUE);
96
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_question_groups', 'espresso_registration_form_trash_question_group')) {
97
+			$this->_views['trash']['count'] = $this->_admin_page->get_trashed_question_groups($this->_per_page, $this->_current_page, TRUE);
98 98
 		}
99 99
 	}
100 100
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		$system_group = $item->get('QSG_system');
108 108
 		$has_questions_with_answers = $item->has_questions_with_answers();
109 109
 		$lock_icon = $system_group === 0 && $this->_view == 'trash' && $has_questions_with_answers ? 'ee-lock-icon ee-alternate-color' : 'ee-lock-icon ee-system-lock';
110
-		return $system_group > 0 || ( $system_group === 0 && $this->_view == 'trash' && $has_questions_with_answers ) || ! EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_groups', 'espresso_registration_form_trash_question_groups' ) ? '<span class="' . $lock_icon . '"></span>'  . sprintf( '<input type="hidden" name="hdnchk[%1$d]" value="%1$d" />', $item->ID() )  : sprintf( '<input type="checkbox" id="QSG_ID[%1$d]" name="checkbox[%1$d]" value="%1$d" />', $item->ID() );
110
+		return $system_group > 0 || ($system_group === 0 && $this->_view == 'trash' && $has_questions_with_answers) || ! EE_Registry::instance()->CAP->current_user_can('ee_delete_question_groups', 'espresso_registration_form_trash_question_groups') ? '<span class="'.$lock_icon.'"></span>'.sprintf('<input type="hidden" name="hdnchk[%1$d]" value="%1$d" />', $item->ID()) : sprintf('<input type="checkbox" id="QSG_ID[%1$d]" name="checkbox[%1$d]" value="%1$d" />', $item->ID());
111 111
 	}
112 112
 
113 113
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
 	public function column_id(EE_Question_Group $item) {
119 119
 		$content = $item->ID();
120
-		$content .= '  <span class="show-on-mobile-view-only">' .$item->name() . '</span>';
120
+		$content .= '  <span class="show-on-mobile-view-only">'.$item->name().'</span>';
121 121
 		return $content;
122 122
 	}
123 123
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 		$actions = array();
128 128
 
129 129
 		//return $item->name();
130
-		if ( !defined('REG_ADMIN_URL') )
130
+		if ( ! defined('REG_ADMIN_URL'))
131 131
 			define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
132 132
 
133 133
 		$edit_query_args = array(
@@ -152,32 +152,32 @@  discard block
 block discarded – undo
152 152
 
153 153
 
154 154
 
155
-		$edit_link = EE_Admin_Page::add_query_args_and_nonce( $edit_query_args, EE_FORMS_ADMIN_URL );
156
-		$trash_link = EE_Admin_Page::add_query_args_and_nonce( $trash_query_args, EE_FORMS_ADMIN_URL );
157
-		$restore_link = EE_Admin_Page::add_query_args_and_nonce( $restore_query_args, EE_FORMS_ADMIN_URL );
158
-		$delete_link = EE_Admin_Page::add_query_args_and_nonce( $delete_query_args, EE_FORMS_ADMIN_URL );
155
+		$edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
156
+		$trash_link = EE_Admin_Page::add_query_args_and_nonce($trash_query_args, EE_FORMS_ADMIN_URL);
157
+		$restore_link = EE_Admin_Page::add_query_args_and_nonce($restore_query_args, EE_FORMS_ADMIN_URL);
158
+		$delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_FORMS_ADMIN_URL);
159 159
 
160
-		if (  EE_Registry::instance()->CAP->current_user_can( 'ee_edit_question_group', 'espresso_registration_form_edit_question_group', $item->ID() ) ) {
160
+		if (EE_Registry::instance()->CAP->current_user_can('ee_edit_question_group', 'espresso_registration_form_edit_question_group', $item->ID())) {
161 161
 			$actions = array(
162
-				'edit' => '<a href="' . $edit_link . '" title="' . esc_attr__('Edit Question Group', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>'
162
+				'edit' => '<a href="'.$edit_link.'" title="'.esc_attr__('Edit Question Group', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'
163 163
 			);
164 164
 		}
165
-		if ( $item->get('QSG_system') < 1 && $this->_view != 'trash' &&  EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_group', 'espresso_registration_form_trash_question_group', $item->ID() ) ) {
166
-			$actions['delete'] = '<a href="' . $trash_link . '" title="' . esc_attr__('Delete Question Group', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
165
+		if ($item->get('QSG_system') < 1 && $this->_view != 'trash' && EE_Registry::instance()->CAP->current_user_can('ee_delete_question_group', 'espresso_registration_form_trash_question_group', $item->ID())) {
166
+			$actions['delete'] = '<a href="'.$trash_link.'" title="'.esc_attr__('Delete Question Group', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
167 167
 		}
168 168
 
169
-		if ( $this->_view == 'trash' ) {
169
+		if ($this->_view == 'trash') {
170 170
 
171
-			if (  EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_group', 'espresso_registration_form_restore_question_group', $item->ID() ) ) {
172
-				$actions['restore'] = '<a href="' . $restore_link . '" title="' . esc_attr__('Restore Question Group', 'event_espresso') . '">' . __('Restore', 'event_espresso') . '</a>';
171
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_question_group', 'espresso_registration_form_restore_question_group', $item->ID())) {
172
+				$actions['restore'] = '<a href="'.$restore_link.'" title="'.esc_attr__('Restore Question Group', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>';
173 173
 			}
174 174
 
175
-			if ( !$item->has_questions_with_answers() &&  EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_group', 'espresso_registration_form_delete_question_group', $item->ID() ) ) {
176
-				$actions['delete'] = '<a href="' . $delete_link . '" title="' . esc_attr__('Delete Question Group Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>';
175
+			if ( ! $item->has_questions_with_answers() && EE_Registry::instance()->CAP->current_user_can('ee_delete_question_group', 'espresso_registration_form_delete_question_group', $item->ID())) {
176
+				$actions['delete'] = '<a href="'.$delete_link.'" title="'.esc_attr__('Delete Question Group Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>';
177 177
 			}
178 178
 		}
179 179
 
180
-		$content =  EE_Registry::instance()->CAP->current_user_can( 'ee_edit_question_group', 'espresso_registration_form_edit_question_group', $item->ID() ) ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->name() . '</a></strong>' : $item->name();
180
+		$content = EE_Registry::instance()->CAP->current_user_can('ee_edit_question_group', 'espresso_registration_form_edit_question_group', $item->ID()) ? '<strong><a class="row-title" href="'.$edit_link.'">'.$item->name().'</a></strong>' : $item->name();
181 181
 		$content .= $this->row_actions($actions);
182 182
 		return $content;
183 183
 	}
@@ -198,13 +198,13 @@  discard block
 block discarded – undo
198 198
 
199 199
 
200 200
 	public function column_show_group_name(EE_Question_Group $item) {
201
-		return $this->_yes_no[ $item->show_group_name() ];
201
+		return $this->_yes_no[$item->show_group_name()];
202 202
 	}
203 203
 
204 204
 
205 205
 
206 206
 	public function column_show_group_desc(EE_Question_Group $item) {
207
-		return $this->_yes_no[ $item->show_group_desc() ];
207
+		return $this->_yes_no[$item->show_group_desc()];
208 208
 	}
209 209
 
210 210
 
Please login to merge, or discard this patch.
registration_form/espresso_events_Registration_Form_Hooks_Extend.class.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 class espresso_events_Registration_Form_Hooks_Extend extends espresso_events_Registration_Form_Hooks {
31 31
 
32 32
 
33
-	public function __construct( EE_Admin_Page $admin_page ) {
33
+	public function __construct(EE_Admin_Page $admin_page) {
34 34
 		parent::__construct($admin_page);
35 35
 	}
36 36
 
@@ -54,31 +54,31 @@  discard block
 block discarded – undo
54 54
 				)
55 55
 			);
56 56
 
57
-		$this->_metaboxes = array_merge( $this->_metaboxes, $new_metaboxes);
57
+		$this->_metaboxes = array_merge($this->_metaboxes, $new_metaboxes);
58 58
 	}
59 59
 
60 60
 
61 61
 
62 62
 
63
-	public function modify_callbacks( $callbacks ) {
64
-		$callbacks = parent::modify_callbacks( $callbacks );
65
-		$callbacks[] = array( $this, 'additional_question_group_update' );
63
+	public function modify_callbacks($callbacks) {
64
+		$callbacks = parent::modify_callbacks($callbacks);
65
+		$callbacks[] = array($this, 'additional_question_group_update');
66 66
 		return $callbacks;
67 67
 	}
68 68
 
69 69
 
70 70
 
71
-	public function restore_revision( $post_id, $revision_id ) {
72
-		$post_evt = parent::restore_revision( $post_id, $revision_id );
71
+	public function restore_revision($post_id, $revision_id) {
72
+		$post_evt = parent::restore_revision($post_id, $revision_id);
73 73
 
74 74
 		//restore revision for additional questions
75
-		$post_evt->restore_revision( $revision_id, array('Question_Group'), array('Question_Group' => array('Event_Question_Group.EQG_primary' => 0 ) ) );
75
+		$post_evt->restore_revision($revision_id, array('Question_Group'), array('Question_Group' => array('Event_Question_Group.EQG_primary' => 0)));
76 76
 	}
77 77
 
78 78
 
79 79
 
80 80
 
81
-	public function additional_questions( $post_id, $post ) {
81
+	public function additional_questions($post_id, $post) {
82 82
 		$this->_event = $this->_adminpage_obj->get_event_object();
83 83
 		$event_id = $this->_event->ID();
84 84
 		?>
@@ -95,32 +95,32 @@  discard block
 block discarded – undo
95 95
 			<?php
96 96
 
97 97
 			$qsg_where['QSG_deleted'] = FALSE;
98
-			$query_params = array( $qsg_where, 'order_by' => array( 'QSG_order' => 'ASC' ) );
99
-			$QSGs = EEM_Question_Group::instance()->get_all( $query_params );
100
-			$EQGs = !empty( $event_id ) ? $this->_event->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 0 )) ) : array();
98
+			$query_params = array($qsg_where, 'order_by' => array('QSG_order' => 'ASC'));
99
+			$QSGs = EEM_Question_Group::instance()->get_all($query_params);
100
+			$EQGs = ! empty($event_id) ? $this->_event->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 0))) : array();
101 101
 			$EQGids = array_keys($EQGs);
102 102
 
103
-			if ( ! empty( $QSGs )) {
104
- 				$html = count( $QSGs ) > 10 ? '<div style="height:250px;overflow:auto;">' : '';
105
-				foreach ( $QSGs as $QSG ) {
103
+			if ( ! empty($QSGs)) {
104
+ 				$html = count($QSGs) > 10 ? '<div style="height:250px;overflow:auto;">' : '';
105
+				foreach ($QSGs as $QSG) {
106 106
 
107
-					$checked = in_array( $QSG->ID(), $EQGids ) ? ' checked="checked" ' : '';
108
-					$edit_link = $this->_adminpage_obj->add_query_args_and_nonce( array( 'action' => 'edit_question_group', 'QSG_ID' => $QSG->ID() ), EE_FORMS_ADMIN_URL );
107
+					$checked = in_array($QSG->ID(), $EQGids) ? ' checked="checked" ' : '';
108
+					$edit_link = $this->_adminpage_obj->add_query_args_and_nonce(array('action' => 'edit_question_group', 'QSG_ID' => $QSG->ID()), EE_FORMS_ADMIN_URL);
109 109
 
110 110
 					$html .= '
111
-					<p id="event-question-group-' . $QSG->ID() . '">
112
-						<input value="' . $QSG->ID() . '" type="checkbox" name="add_attendee_question_groups[' . $QSG->ID() . ']"' . $checked . ' />
113
-						<a href="' . $edit_link . '" title="' . sprintf( esc_attr__( 'Edit %s Group', 'event_espresso' ),  $QSG->get('QSG_name') ) . '" target="_blank">' . $QSG->get('QSG_name') . '</a>
111
+					<p id="event-question-group-' . $QSG->ID().'">
112
+						<input value="' . $QSG->ID().'" type="checkbox" name="add_attendee_question_groups['.$QSG->ID().']"'.$checked.' />
113
+						<a href="' . $edit_link.'" title="'.sprintf(esc_attr__('Edit %s Group', 'event_espresso'), $QSG->get('QSG_name')).'" target="_blank">'.$QSG->get('QSG_name').'</a>
114 114
 					</p>';
115 115
 				}
116
-				$html .= count( $QSGs ) > 10 ? '</div>' : '';
116
+				$html .= count($QSGs) > 10 ? '</div>' : '';
117 117
 
118 118
 				echo $html;
119 119
 
120 120
 			} else {
121 121
 				echo __('There seems to be a problem with your questions. Please contact [email protected]', 'event_espresso');
122 122
 			}
123
-			do_action( 'AHEE__espresso_events_Registration_Form_Hooks__additional_questions__after_content' );
123
+			do_action('AHEE__espresso_events_Registration_Form_Hooks__additional_questions__after_content');
124 124
 			?>
125 125
 		</div>
126 126
 		<?php
@@ -130,31 +130,31 @@  discard block
 block discarded – undo
130 130
 
131 131
 
132 132
 
133
-	public function additional_question_group_update( $evtobj, $data ) {
134
-		$question_groups = !empty( $data['add_attendee_question_groups'] ) ? (array) $data['add_attendee_question_groups'] : array();
133
+	public function additional_question_group_update($evtobj, $data) {
134
+		$question_groups = ! empty($data['add_attendee_question_groups']) ? (array) $data['add_attendee_question_groups'] : array();
135 135
 		$added_qgs = array_keys($question_groups);
136 136
 		$success = array();
137 137
 
138 138
 		//let's get all current question groups associated with this event.
139
-		$current_qgs = $evtobj->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 0) ) );
139
+		$current_qgs = $evtobj->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 0)));
140 140
 		$current_qgs = array_keys($current_qgs); //we just want the ids
141 141
 
142 142
 		//now let's get the groups selected in the editor and update (IF we have data)
143
-		if ( !empty( $question_groups ) ) {
144
-			foreach ( $question_groups as $id => $val ) {
143
+		if ( ! empty($question_groups)) {
144
+			foreach ($question_groups as $id => $val) {
145 145
 				//add to event
146
-				if ( $val )
147
-					$qg = $evtobj->_add_relation_to( $id, 'Question_Group', array('EQG_primary' => 0) );
148
-				$success[] = !empty($qg) ? 1 : 0;
146
+				if ($val)
147
+					$qg = $evtobj->_add_relation_to($id, 'Question_Group', array('EQG_primary' => 0));
148
+				$success[] = ! empty($qg) ? 1 : 0;
149 149
 			}
150 150
 		}
151 151
 
152 152
 		//wait a minute... are there question groups missing in the saved groups that ARE with the current event?
153
-		$removed_qgs = array_diff( $current_qgs, $added_qgs );
153
+		$removed_qgs = array_diff($current_qgs, $added_qgs);
154 154
 
155
-		foreach ( $removed_qgs as $qgid ) {
156
-			$qg = $evtobj->_remove_relation_to( $qgid, 'Question_Group', array('EQG_primary' => 0 ) );
157
-			$success[] = !empty($qg) ? 1 : 0;
155
+		foreach ($removed_qgs as $qgid) {
156
+			$qg = $evtobj->_remove_relation_to($qgid, 'Question_Group', array('EQG_primary' => 0));
157
+			$success[] = ! empty($qg) ? 1 : 0;
158 158
 		}
159 159
 
160 160
 
Please login to merge, or discard this patch.