Completed
Branch BUG-8511-spco-revisit-oversell... (0aad32)
by
unknown
34:42 queued 17:09
created
core/services/progress_steps/ProgressStepInterface.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\core\services\progress_steps;
3 3
 
4
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
5
-	exit( 'No direct script access allowed' );
4
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 
8 8
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	/**
23 23
 	 * @param boolean $is_current
24 24
 	 */
25
-	public function setIsCurrent( $is_current = true );
25
+	public function setIsCurrent($is_current = true);
26 26
 
27 27
 	/**
28 28
 	 * @return int|string
Please login to merge, or discard this patch.
core/services/collections/CollectionDetails.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@  discard block
 block discarded – undo
8 8
 use EventEspresso\core\services\locators\FqcnLocator;
9 9
 use EventEspresso\core\services\locators\LocatorInterface;
10 10
 
11
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
12
-	exit( 'No direct script access allowed' );
11
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
12
+	exit('No direct script access allowed');
13 13
 }
14 14
 
15 15
 
@@ -170,13 +170,13 @@  discard block
 block discarded – undo
170 170
 		$identifier_callback = '',
171 171
 		LocatorInterface $file_locator = null
172 172
 	) {
173
-		$this->setCollectionName( $collection_name );
174
-		$this->setCollectionInterface( $collection_interface );
175
-		$this->setCollectionFQCNs( $collection_FQCNs );
176
-		$this->setCollectionPaths( $collection_paths );
177
-		$this->setFileMasks( $file_mask );
178
-		$this->setIdentifierType( $identifier_type );
179
-		$this->setIdentifierCallback( $identifier_callback );
173
+		$this->setCollectionName($collection_name);
174
+		$this->setCollectionInterface($collection_interface);
175
+		$this->setCollectionFQCNs($collection_FQCNs);
176
+		$this->setCollectionPaths($collection_paths);
177
+		$this->setFileMasks($file_mask);
178
+		$this->setIdentifierType($identifier_type);
179
+		$this->setIdentifierCallback($identifier_callback);
180 180
 		$this->file_locator = $file_locator;
181 181
 	}
182 182
 
@@ -197,9 +197,9 @@  discard block
 block discarded – undo
197 197
 	 * @param string $collection_interface
198 198
 	 * @throws \EventEspresso\Core\Exceptions\InvalidInterfaceException
199 199
 	 */
200
-	protected function setCollectionInterface( $collection_interface ) {
201
-		if ( ! ( interface_exists( $collection_interface ) || class_exists( $collection_interface ) ) ) {
202
-			throw new InvalidInterfaceException( $collection_interface );
200
+	protected function setCollectionInterface($collection_interface) {
201
+		if ( ! (interface_exists($collection_interface) || class_exists($collection_interface))) {
202
+			throw new InvalidInterfaceException($collection_interface);
203 203
 		}
204 204
 		$this->collection_interface = $collection_interface;
205 205
 	}
@@ -225,14 +225,14 @@  discard block
 block discarded – undo
225 225
 	 * @param string $collection_name
226 226
 	 * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException
227 227
 	 */
228
-	protected function setCollectionName( $collection_name ) {
229
-		if ( ! is_string( $collection_name ) ) {
230
-			throw new InvalidDataTypeException( '$collection_name', $collection_name, 'string' );
228
+	protected function setCollectionName($collection_name) {
229
+		if ( ! is_string($collection_name)) {
230
+			throw new InvalidDataTypeException('$collection_name', $collection_name, 'string');
231 231
 		}
232 232
 		$this->collection_name = str_replace(
233 233
 			'-',
234 234
 			'_',
235
-			sanitize_title_with_dashes( $collection_name, '', 'save' )
235
+			sanitize_title_with_dashes($collection_name, '', 'save')
236 236
 		);
237 237
 	}
238 238
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 	 * @param string $identifier_type
254 254
 	 * @throws \EventEspresso\Core\Exceptions\InvalidIdentifierException
255 255
 	 */
256
-	protected function setIdentifierType( $identifier_type ) {
256
+	protected function setIdentifierType($identifier_type) {
257 257
 		if (
258 258
 			! (
259 259
 				$identifier_type === CollectionDetails::ID_CLASS_NAME
@@ -286,9 +286,9 @@  discard block
 block discarded – undo
286 286
 	 * @param string $identifier_callback
287 287
 	 * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException
288 288
 	 */
289
-	protected function setIdentifierCallback( $identifier_callback = 'identifier' ) {
290
-		if ( ! is_string( $identifier_callback ) ) {
291
-			throw new InvalidDataTypeException( '$identifier_callback', $identifier_callback, 'string' );
289
+	protected function setIdentifierCallback($identifier_callback = 'identifier') {
290
+		if ( ! is_string($identifier_callback)) {
291
+			throw new InvalidDataTypeException('$identifier_callback', $identifier_callback, 'string');
292 292
 		}
293 293
 		$this->identifier_callback = $identifier_callback;
294 294
 	}
@@ -313,12 +313,12 @@  discard block
 block discarded – undo
313 313
 	 * @param string $file_mask
314 314
 	 * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException
315 315
 	 */
316
-	protected function setFileMasks( $file_mask ) {
317
-		$this->file_mask = ! empty( $file_mask ) ? $file_mask : '*.php';
316
+	protected function setFileMasks($file_mask) {
317
+		$this->file_mask = ! empty($file_mask) ? $file_mask : '*.php';
318 318
 		// we know our default is a string, so if it's not a string now,
319 319
 		// then that means the incoming parameter was something else
320
-		if ( ! is_string( $this->file_mask ) ) {
321
-			throw new InvalidDataTypeException( '$file_mask', $this->file_mask, 'string' );
320
+		if ( ! is_string($this->file_mask)) {
321
+			throw new InvalidDataTypeException('$file_mask', $this->file_mask, 'string');
322 322
 		}
323 323
 	}
324 324
 
@@ -340,13 +340,13 @@  discard block
 block discarded – undo
340 340
 	 * @throws \EventEspresso\Core\Exceptions\InvalidClassException
341 341
 	 * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException
342 342
 	 */
343
-	public function setCollectionFQCNs( $collection_FQCNs ) {
344
-		foreach ( (array) $collection_FQCNs as $collection_FQCN ) {
345
-			if ( ! empty( $collection_FQCN ) ) {
346
-				if ( class_exists( $collection_FQCN ) ) {
343
+	public function setCollectionFQCNs($collection_FQCNs) {
344
+		foreach ((array) $collection_FQCNs as $collection_FQCN) {
345
+			if ( ! empty($collection_FQCN)) {
346
+				if (class_exists($collection_FQCN)) {
347 347
 					$this->collection_FQCNs[] = $collection_FQCN;
348 348
 				} else {
349
-					foreach ( $this->getFQCNsFromPartialNamespace( $collection_FQCN ) as $FQCN ) {
349
+					foreach ($this->getFQCNsFromPartialNamespace($collection_FQCN) as $FQCN) {
350 350
 						$this->collection_FQCNs[] = $FQCN;
351 351
 					}
352 352
 				}
@@ -363,11 +363,11 @@  discard block
 block discarded – undo
363 363
 	 * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException
364 364
 	 * @throws \EventEspresso\Core\Exceptions\InvalidClassException
365 365
 	 */
366
-	protected function getFQCNsFromPartialNamespace( $partial_FQCN ) {
367
-		if ( ! $this->file_locator instanceof FqcnLocator ) {
366
+	protected function getFQCNsFromPartialNamespace($partial_FQCN) {
367
+		if ( ! $this->file_locator instanceof FqcnLocator) {
368 368
 			$this->file_locator = new FqcnLocator();
369 369
 		}
370
-		$this->file_locator->locate( $partial_FQCN );
370
+		$this->file_locator->locate($partial_FQCN);
371 371
 		return $this->file_locator->getFQCNs();
372 372
 	}
373 373
 
@@ -388,11 +388,11 @@  discard block
 block discarded – undo
388 388
 	 * @param string|array $collection_paths
389 389
 	 * @throws \EventEspresso\Core\Exceptions\InvalidFilePathException
390 390
 	 */
391
-	public function setCollectionPaths( $collection_paths ) {
392
-		foreach ( (array) $collection_paths as $collection_path ) {
393
-			if ( ! empty( $collection_path ) ) {
394
-				if ( ! is_readable( $collection_path ) ) {
395
-					throw new InvalidFilePathException( $collection_path );
391
+	public function setCollectionPaths($collection_paths) {
392
+		foreach ((array) $collection_paths as $collection_path) {
393
+			if ( ! empty($collection_path)) {
394
+				if ( ! is_readable($collection_path)) {
395
+					throw new InvalidFilePathException($collection_path);
396 396
 				}
397 397
 				$this->collection_paths[] = $collection_path;
398 398
 			}
Please login to merge, or discard this patch.
display_strategies/number_bubbles/number_bubbles.template.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 /**
6 6
  * This is the template for the "Number Bubbles" Progress Steps
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 <!-- progress step display -->
15 15
 <div class="ee-progress-step-main-container">
16 16
 	<div class="progress-step-container number-bubbles-container">
17
-		<?php foreach ( $progress_steps as $progress_step ) : ?>
18
-		<div data-step-nmbr="<?php echo $progress_step->order();?>" id="progress-step-<?php echo $progress_step->id(); ?>" class="progress-step-number <?php echo $progress_step->htmlClass(); ?>">
17
+		<?php foreach ($progress_steps as $progress_step) : ?>
18
+		<div data-step-nmbr="<?php echo $progress_step->order(); ?>" id="progress-step-<?php echo $progress_step->id(); ?>" class="progress-step-number <?php echo $progress_step->htmlClass(); ?>">
19 19
 			<div class="progress-step-line"></div>
20 20
 			<div class="progress-step-bubble"><p><?php echo $progress_step->order(); ?></p></div>
21 21
 			<span class="progress-step-text"><?php echo $progress_step->text(); ?></span>
22 22
 		</div>
23
-		<?php endforeach;?>
23
+		<?php endforeach; ?>
24 24
 	</div>
25 25
 </div>
26 26
 
Please login to merge, or discard this patch.
core/exceptions/InvalidFormSubmissionException.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 
4 4
 use OutOfBoundsException;
5 5
 
6
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
7
-	exit( 'No direct script access allowed' );
6
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
7
+	exit('No direct script access allowed');
8 8
 }
9 9
 
10 10
 
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 	 * @param int        $code
29 29
 	 * @param \Exception $previous
30 30
 	 */
31
-	public function __construct( $form_name, $message = '', $code = 0, \Exception $previous = null ) {
32
-		if ( empty( $message ) ) {
31
+	public function __construct($form_name, $message = '', $code = 0, \Exception $previous = null) {
32
+		if (empty($message)) {
33 33
 			$message = sprintf(
34 34
 				__(
35 35
 					'The data for the "%1$s" form, is either missing or was not submitted properly.',
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 				$form_name
39 39
 			);
40 40
 		}
41
-		parent::__construct( $message, $code, $previous );
41
+		parent::__construct($message, $code, $previous);
42 42
 	}
43 43
 
44 44
 }
Please login to merge, or discard this patch.
admin_pages/registrations/Registrations_Admin_Page.core.php 2 patches
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -163,9 +163,9 @@  discard block
 block discarded – undo
163 163
 
164 164
 	/**
165 165
 	 * 		grab url requests and route them
166
-	*		@access private
167
-	*		@return void
168
-	*/
166
+	 *		@access private
167
+	 *		@return void
168
+	 */
169 169
 	public function _set_page_routes() {
170 170
 
171 171
 		$this->_get_registration_status_array();
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 						'title' => __('Registrations Other', 'event_espresso'),
438 438
 						'filename' => 'registrations_overview_other'
439 439
 					)
440
-                ),
440
+				),
441 441
 				'help_tour' => array( 'Registration_Overview_Help_Tour' ),
442 442
 				'qtips' => array('Registration_List_Table_Tips'),
443 443
 				'list_table' => 'EE_Registrations_List_Table',
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 						: $this->_admin_base_url,
457 457
 					'persistent' => FALSE
458 458
 				),
459
-                'help_tabs' => array(
459
+				'help_tabs' => array(
460 460
 					'registrations_details_help_tab' => array(
461 461
 						'title' => __('Registration Details', 'event_espresso'),
462 462
 						'filename' => 'registrations_details'
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 					'order' => 20
521 521
 				),
522 522
 				'list_table' => 'EE_Attendee_Contact_List_Table',
523
-                'help_tabs' => array(
523
+				'help_tabs' => array(
524 524
 					'registrations_contact_list_help_tab' => array(
525 525
 						'title' => __('Registrations Contact List', 'event_espresso'),
526 526
 						'filename' => 'registrations_contact_list'
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 						'title' => __('Contact List Other', 'event_espresso'),
538 538
 						'filename' => 'registrations_contact_list_other'
539 539
 					)
540
-                ),
540
+				),
541 541
 				'help_tour' => array( 'Contact_List_Help_Tour' ),
542 542
 				'metaboxes' => array(),
543 543
 				'require_nonce' => FALSE
@@ -571,9 +571,9 @@  discard block
 block discarded – undo
571 571
 
572 572
 	/**
573 573
 	 * 		get list of registration statuses
574
-	*		@access private
575
-	*		@return void
576
-	*/
574
+	 *		@access private
575
+	 *		@return void
576
+	 */
577 577
 	private function _get_registration_status_array() {
578 578
 		self::$_reg_status = EEM_Registration::reg_status_array( array(), TRUE);
579 579
 	}
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
 			return TRUE;
892 892
 		}
893 893
 
894
-	    $REG = EEM_Registration::instance();
894
+		$REG = EEM_Registration::instance();
895 895
 
896 896
 		$REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
897 897
 
@@ -1112,9 +1112,9 @@  discard block
 block discarded – undo
1112 1112
 
1113 1113
 	/**
1114 1114
 	 * 		generates HTML for the View Registration Details Admin page
1115
-	*		@access protected
1116
-	*		@return void
1117
-	*/
1115
+	 *		@access protected
1116
+	 *		@return void
1117
+	 */
1118 1118
 	protected function _registration_details() {
1119 1119
 
1120 1120
 		$this->_template_args = array();
@@ -1401,10 +1401,10 @@  discard block
 block discarded – undo
1401 1401
 
1402 1402
 	/**
1403 1403
 	 * 		approve_registration
1404
-	*		@access protected
1405
-	*		@param bool $notify whether or not to notify the registrant about their approval.
1406
-	*		@return void
1407
-	*/
1404
+	 *		@access protected
1405
+	 *		@param bool $notify whether or not to notify the registrant about their approval.
1406
+	 *		@return void
1407
+	 */
1408 1408
 	protected function approve_registration( $notify = false ) {
1409 1409
 		$this->_reg_status_change_return( EEM_Registration::status_id_approved, $notify );
1410 1410
 	}
@@ -1414,10 +1414,10 @@  discard block
 block discarded – undo
1414 1414
 
1415 1415
 	/**
1416 1416
 	 * 		decline_registration
1417
-	*		@access protected
1418
-	*		@param bool $notify whether or not to notify the registrant about their approval.
1419
-	*		@return void
1420
-	*/
1417
+	 *		@access protected
1418
+	 *		@param bool $notify whether or not to notify the registrant about their approval.
1419
+	 *		@return void
1420
+	 */
1421 1421
 	protected function decline_registration( $notify = false ) {
1422 1422
 		$this->_reg_status_change_return( EEM_Registration::status_id_declined, $notify );
1423 1423
 	}
@@ -1427,10 +1427,10 @@  discard block
 block discarded – undo
1427 1427
 
1428 1428
 	/**
1429 1429
 	 * 		cancel_registration
1430
-	*		@access protected
1431
-	*		@param bool $notify whether or not to notify the registrant about their approval.
1432
-	*		@return void
1433
-	*/
1430
+	 *		@access protected
1431
+	 *		@param bool $notify whether or not to notify the registrant about their approval.
1432
+	 *		@return void
1433
+	 */
1434 1434
 	protected function cancel_registration( $notify = false ) {
1435 1435
 		$this->_reg_status_change_return( EEM_Registration::status_id_cancelled, $notify );
1436 1436
 	}
@@ -1441,10 +1441,10 @@  discard block
 block discarded – undo
1441 1441
 
1442 1442
 	/**
1443 1443
 	 * 		not_approve_registration
1444
-	*		@access protected
1445
-	*		@param bool $notify whether or not to notify the registrant about their approval.
1446
-	*		@return void
1447
-	*/
1444
+	 *		@access protected
1445
+	 *		@param bool $notify whether or not to notify the registrant about their approval.
1446
+	 *		@return void
1447
+	 */
1448 1448
 	protected function not_approve_registration( $notify = false ) {
1449 1449
 		$this->_reg_status_change_return( EEM_Registration::status_id_not_approved, $notify );
1450 1450
 	}
@@ -1453,10 +1453,10 @@  discard block
 block discarded – undo
1453 1453
 
1454 1454
 	/**
1455 1455
 	 * 		decline_registration
1456
-	*		@access protected
1457
-	*		@param bool $notify whether or not to notify the registrant about their approval.
1458
-	*		@return void
1459
-	*/
1456
+	 *		@access protected
1457
+	 *		@param bool $notify whether or not to notify the registrant about their approval.
1458
+	 *		@return void
1459
+	 */
1460 1460
 	protected function pending_registration( $notify = false ) {
1461 1461
 		$this->_reg_status_change_return( EEM_Registration::status_id_pending_payment, $notify );
1462 1462
 	}
@@ -1466,9 +1466,9 @@  discard block
 block discarded – undo
1466 1466
 
1467 1467
 	/**
1468 1468
 	 * 		generates HTML for the Registration main meta box
1469
-	*		@access public
1470
-	*		@return void
1471
-	*/
1469
+	 *		@access public
1470
+	 *		@return void
1471
+	 */
1472 1472
 	public function _reg_details_meta_box() {
1473 1473
 		EEH_Autoloader::register_line_item_display_autoloaders();
1474 1474
 		EEH_Autoloader::register_line_item_filter_autoloaders();
@@ -1505,7 +1505,7 @@  discard block
 block discarded – undo
1505 1505
 			: '';
1506 1506
 
1507 1507
 		$this->_template_args['resend_registration_button'] = $attendee instanceof EE_Attendee
1508
-		                                                      && EE_Registry::instance()->CAP->current_user_can(
1508
+															  && EE_Registry::instance()->CAP->current_user_can(
1509 1509
 			'ee_send_message',
1510 1510
 			'espresso_registrations_resend_registration'
1511 1511
 		)
@@ -1581,7 +1581,7 @@  discard block
 block discarded – undo
1581 1581
 	 *
1582 1582
 	 * @access public
1583 1583
 	 * @return void
1584
-	*/
1584
+	 */
1585 1585
 	public function _reg_questions_meta_box() {
1586 1586
 		//allow someone to override this method entirely
1587 1587
 		if( apply_filters( 'FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration ) ) {
@@ -1783,12 +1783,12 @@  discard block
 block discarded – undo
1783 1783
 
1784 1784
 	/**
1785 1785
 	 * 		generates HTML for the Registration main meta box
1786
-	*		@access public
1787
-	*		@return void
1788
-	*/
1786
+	 *		@access public
1787
+	 *		@return void
1788
+	 */
1789 1789
 	public function _reg_attendees_meta_box() {
1790 1790
 
1791
-	    $REG = EEM_Registration::instance();
1791
+		$REG = EEM_Registration::instance();
1792 1792
 		//get all other registrations on this transaction, and cache
1793 1793
 		//the attendees for them so we don't have to run another query using force_join
1794 1794
 		$registrations = $REG->get_all(array(
@@ -1840,9 +1840,9 @@  discard block
 block discarded – undo
1840 1840
 
1841 1841
 	/**
1842 1842
 	 * 		generates HTML for the Edit Registration side meta box
1843
-	*		@access public
1844
-	*		@return void
1845
-	*/
1843
+	 *		@access public
1844
+	 *		@return void
1845
+	 */
1846 1846
 	public function _reg_registrant_side_meta_box() {
1847 1847
 
1848 1848
 		/*@var $attendee EE_Attendee */
@@ -2220,9 +2220,9 @@  discard block
 block discarded – undo
2220 2220
 
2221 2221
 	/**
2222 2222
 	 * 		set_reg_event
2223
-	*		@access private
2224
-	*		@return boolean
2225
-	*/
2223
+	 *		@access private
2224
+	 *		@return boolean
2225
+	 */
2226 2226
 	private function _set_reg_event() {
2227 2227
 		if ( is_object( $this->_reg_event )) {
2228 2228
 			return TRUE;
@@ -2362,9 +2362,9 @@  discard block
 block discarded – undo
2362 2362
 
2363 2363
 	/**
2364 2364
 	 * 		generates HTML for the Attendee Contact List
2365
-	*		@access protected
2366
-	*		@return void
2367
-	*/
2365
+	 *		@access protected
2366
+	 *		@return void
2367
+	 */
2368 2368
 	protected function _attendee_contact_list_table() {
2369 2369
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2370 2370
 		$this->_search_btn_label = __('Contacts', 'event_espresso');
@@ -2378,9 +2378,9 @@  discard block
 block discarded – undo
2378 2378
 	/**
2379 2379
 	 * 		get_attendees
2380 2380
 	 * 		@param bool $count whether to return count or data.
2381
-	*		@access public
2382
-	*		@return array
2383
-	*/
2381
+	 *		@access public
2382
+	 *		@return array
2383
+	 */
2384 2384
 	public function get_attendees( $per_page, $count = FALSE, $trash = FALSE ) {
2385 2385
 
2386 2386
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -2712,9 +2712,9 @@  discard block
 block discarded – undo
2712 2712
 
2713 2713
 	/**
2714 2714
 	 * 		_attendee_details
2715
-	*		@access protected
2716
-	*		@return void
2717
-	*/
2715
+	 *		@access protected
2716
+	 *		@return void
2717
+	 */
2718 2718
 	public function attendee_registrations_meta_box( $post ) {
2719 2719
 
2720 2720
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
@@ -2747,10 +2747,10 @@  discard block
 block discarded – undo
2747 2747
 
2748 2748
 	/**
2749 2749
 	 * 		_trash_or_restore_attendee
2750
-	*		@param boolean 		$trash - whether to move item to trash (TRUE) or restore it (FALSE)
2751
-	*		@access protected
2752
-	*		@return void
2753
-	*/
2750
+	 *		@param boolean 		$trash - whether to move item to trash (TRUE) or restore it (FALSE)
2751
+	 *		@access protected
2752
+	 *		@return void
2753
+	 */
2754 2754
 	protected function _trash_or_restore_attendees( $trash = TRUE ) {
2755 2755
 
2756 2756
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
Please login to merge, or discard this patch.
Spacing   +549 added lines, -549 removed lines patch added patch discarded remove patch
@@ -56,26 +56,26 @@  discard block
 block discarded – undo
56 56
 	 * @param bool $routing
57 57
 	 * @return Registrations_Admin_Page
58 58
 	 */
59
-	public function __construct( $routing = TRUE ) {
60
-		parent::__construct( $routing );
61
-		add_action( 'wp_loaded', array( $this, 'wp_loaded' ));
59
+	public function __construct($routing = TRUE) {
60
+		parent::__construct($routing);
61
+		add_action('wp_loaded', array($this, 'wp_loaded'));
62 62
 	}
63 63
 
64 64
 
65 65
 
66 66
 	public function wp_loaded() {
67 67
 		// when adding a new registration...
68
-		if ( isset( $this->_req_data[ 'action' ] ) && $this->_req_data[ 'action' ] == 'new_registration' ) {
68
+		if (isset($this->_req_data['action']) && $this->_req_data['action'] == 'new_registration') {
69 69
 			EE_System::do_not_cache();
70 70
 			if (
71
-				! isset( $this->_req_data[ 'processing_registration' ] )
72
-				|| absint( $this->_req_data[ 'processing_registration' ] ) !== 1
71
+				! isset($this->_req_data['processing_registration'])
72
+				|| absint($this->_req_data['processing_registration']) !== 1
73 73
 			) {
74 74
 				// and it's NOT the attendee information reg step
75 75
 				// force cookie expiration by setting time to last week
76
-				setcookie( 'ee_registration_added', 0, time() - WEEK_IN_SECONDS, '/' );
76
+				setcookie('ee_registration_added', 0, time() - WEEK_IN_SECONDS, '/');
77 77
 				// and update the global
78
-				$_COOKIE[ 'ee_registration_added' ] = 0;
78
+				$_COOKIE['ee_registration_added'] = 0;
79 79
 			}
80 80
 		}
81 81
 	}
@@ -109,16 +109,16 @@  discard block
 block discarded – undo
109 109
 				'trash' => 'post.php'
110 110
 			);
111 111
 
112
-		add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10 );
112
+		add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10);
113 113
 		//add filters so that the comment urls don't take users to a confusing 404 page
114
-		add_filter('get_comment_link', array( $this, 'clear_comment_link' ), 10, 3 );
114
+		add_filter('get_comment_link', array($this, 'clear_comment_link'), 10, 3);
115 115
 	}
116 116
 
117 117
 
118
-	public function clear_comment_link( $link, $comment, $args ) {
118
+	public function clear_comment_link($link, $comment, $args) {
119 119
 		//gotta make sure this only happens on this route
120
-		$post_type = get_post_type( $comment->comment_post_ID);
121
-		if ( $post_type == 'espresso_attendees' )
120
+		$post_type = get_post_type($comment->comment_post_ID);
121
+		if ($post_type == 'espresso_attendees')
122 122
 			return '#commentsdiv';
123 123
 		return $link;
124 124
 	}
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
 	protected function _ajax_hooks() {
128 128
 		//todo: all hooks for registrations ajax goes in here
129
-		add_action( 'wp_ajax_toggle_checkin_status', array( $this, 'toggle_checkin_status' ));
129
+		add_action('wp_ajax_toggle_checkin_status', array($this, 'toggle_checkin_status'));
130 130
 	}
131 131
 
132 132
 
@@ -141,8 +141,8 @@  discard block
 block discarded – undo
141 141
 				'add-attendee' => __('Add Contact', 'event_espresso'),
142 142
 				'edit' => __('Edit Contact', 'event_espresso'),
143 143
 				'report'=>  __("Event Registrations CSV Report", "event_espresso"),
144
-				'report_all' => __( 'All Registrations CSV Report', 'event_espresso' ),
145
-				'contact_list_report' => __( 'Contact List Report', 'event_espresso' ),
144
+				'report_all' => __('All Registrations CSV Report', 'event_espresso'),
145
+				'contact_list_report' => __('Contact List Report', 'event_espresso'),
146 146
 				'contact_list_export'=>  __("Export Data", "event_espresso"),
147 147
 			),
148 148
 			'publishbox' => array(
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
 
171 171
 		$this->_get_registration_status_array();
172 172
 
173
-		$reg_id = ! empty( $this->_req_data['_REG_ID'] ) && ! is_array( $this->_req_data['_REG_ID'] ) ? $this->_req_data['_REG_ID'] : 0;
174
-		$att_id = ! empty( $this->_req_data[ 'ATT_ID' ] ) && ! is_array( $this->_req_data['ATT_ID'] ) ? $this->_req_data['ATT_ID'] : 0;
175
-		$att_id = ! empty( $this->_req_data['post'] ) && ! is_array( $this->_req_data['post'] ) ? $this->_req_data['post'] : $att_id;
173
+		$reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0;
174
+		$att_id = ! empty($this->_req_data['ATT_ID']) && ! is_array($this->_req_data['ATT_ID']) ? $this->_req_data['ATT_ID'] : 0;
175
+		$att_id = ! empty($this->_req_data['post']) && ! is_array($this->_req_data['post']) ? $this->_req_data['post'] : $att_id;
176 176
 
177 177
 		$this->_page_routes = array(
178 178
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 
206 206
 				'restore_registrations' => array(
207 207
 					'func' => '_trash_or_restore_registrations',
208
-					'args' => array( 'trash' => FALSE ),
208
+					'args' => array('trash' => FALSE),
209 209
 					'noheader' => TRUE,
210 210
 					'capability' => 'ee_delete_registrations'
211 211
 					),
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 						'filename' => 'registrations_overview_other'
439 439
 					)
440 440
                 ),
441
-				'help_tour' => array( 'Registration_Overview_Help_Tour' ),
441
+				'help_tour' => array('Registration_Overview_Help_Tour'),
442 442
 				'qtips' => array('Registration_List_Table_Tips'),
443 443
 				'list_table' => 'EE_Registrations_List_Table',
444 444
 				'require_nonce' => FALSE
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 					'order' => 15,
451 451
 					'url' => isset($this->_req_data['_REG_ID'])
452 452
 						? add_query_arg(
453
-							array('_REG_ID' => $this->_req_data['_REG_ID'] ),
453
+							array('_REG_ID' => $this->_req_data['_REG_ID']),
454 454
 							$this->_current_page_view_url
455 455
 						)
456 456
 						: $this->_admin_base_url,
@@ -474,8 +474,8 @@  discard block
 block discarded – undo
474 474
 						'filename' => 'registrations_details_registrant_details'
475 475
 					)
476 476
 				),
477
-				'help_tour' => array( 'Registration_Details_Help_Tour' ),
478
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_registration_details_metaboxes' ) ),
477
+				'help_tour' => array('Registration_Details_Help_Tour'),
478
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_registration_details_metaboxes')),
479 479
 				'require_nonce' => FALSE
480 480
 			),
481 481
 
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 					'order' => 15,
500 500
 					'persistent' => FALSE
501 501
 				),
502
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes' ) ),
502
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes')),
503 503
 				'require_nonce' => FALSE
504 504
 			),
505 505
 
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 					'label' => __('Edit Contact', 'event_espresso'),
509 509
 					'order' => 15,
510 510
 					'persistent' => FALSE,
511
-					'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID'] ), $this->_current_page_view_url )  : $this->_admin_base_url
511
+					'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID']), $this->_current_page_view_url) : $this->_admin_base_url
512 512
 				),
513 513
 				'metaboxes' => array('attendee_editor_metaboxes'),
514 514
 				'require_nonce' => FALSE
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 						'filename' => 'registrations_contact_list_other'
539 539
 					)
540 540
                 ),
541
-				'help_tour' => array( 'Contact_List_Help_Tour' ),
541
+				'help_tour' => array('Contact_List_Help_Tour'),
542 542
 				'metaboxes' => array(),
543 543
 				'require_nonce' => FALSE
544 544
 			),
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 	protected function _add_screen_options() {}
558 558
 	protected function _add_feature_pointers() {}
559 559
 	public function admin_init() {
560
-		EE_Registry::$i18n_js_strings[ 'update_att_qstns' ] = __( 'click "Update Registration Questions" to save your changes', 'event_espresso' );
560
+		EE_Registry::$i18n_js_strings['update_att_qstns'] = __('click "Update Registration Questions" to save your changes', 'event_espresso');
561 561
 	}
562 562
 	public function admin_notices() {}
563 563
 	public function admin_footer_scripts() {}
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
 	*		@return void
576 576
 	*/
577 577
 	private function _get_registration_status_array() {
578
-		self::$_reg_status = EEM_Registration::reg_status_array( array(), TRUE);
578
+		self::$_reg_status = EEM_Registration::reg_status_array(array(), TRUE);
579 579
 	}
580 580
 
581 581
 
@@ -598,11 +598,11 @@  discard block
 block discarded – undo
598 598
 	public function load_scripts_styles() {
599 599
 		//style
600 600
 		//wp_register_style('espresso_attendees', ATT_ASSETS_URL . 'espresso_attendees_admin.css', array(), EVENT_ESPRESSO_VERSION );
601
-		wp_register_style('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION );
601
+		wp_register_style('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION);
602 602
 		wp_enqueue_style('espresso_reg');
603 603
 
604 604
 		//script
605
-		wp_register_script('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE);
605
+		wp_register_script('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE);
606 606
 		wp_enqueue_script('espresso_reg');
607 607
 	}
608 608
 
@@ -611,9 +611,9 @@  discard block
 block discarded – undo
611 611
 	public function load_scripts_styles_edit_attendee() {
612 612
 		//stuff to only show up on our attendee edit details page.
613 613
 		$attendee_details_translations = array(
614
-			'att_publish_text' => sprintf( __('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created') )
614
+			'att_publish_text' => sprintf(__('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created'))
615 615
 			);
616
-		wp_localize_script( 'espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations );
616
+		wp_localize_script('espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations);
617 617
 		wp_enqueue_script('jquery-validate');
618 618
 	}
619 619
 
@@ -622,8 +622,8 @@  discard block
 block discarded – undo
622 622
 		//styles
623 623
 		wp_enqueue_style('espresso-ui-theme');
624 624
 		//scripts
625
-		$this->_get_reg_custom_questions_form( $this->_registration->ID() );
626
-		$this->_reg_custom_questions_form->wp_enqueue_scripts( true );
625
+		$this->_get_reg_custom_questions_form($this->_registration->ID());
626
+		$this->_reg_custom_questions_form->wp_enqueue_scripts(true);
627 627
 	}
628 628
 
629 629
 
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
 
634 634
 	public function load_scripts_styles_contact_list() {
635 635
 		wp_deregister_style('espresso_reg');
636
-		wp_register_style('espresso_att', REG_ASSETS_URL . 'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION );
636
+		wp_register_style('espresso_att', REG_ASSETS_URL.'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION);
637 637
 		wp_enqueue_style('espresso_att');
638 638
 	}
639 639
 
@@ -642,9 +642,9 @@  discard block
 block discarded – undo
642 642
 
643 643
 
644 644
 	public function load_scripts_styles_new_registration() {
645
-		wp_register_script( 'ee-spco-for-admin', REG_ASSETS_URL . 'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE );
645
+		wp_register_script('ee-spco-for-admin', REG_ASSETS_URL.'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE);
646 646
 		wp_enqueue_script('ee-spco-for-admin');
647
-		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' );
647
+		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true');
648 648
 		EE_Form_Section_Proper::wp_enqueue_scripts();
649 649
 		EED_Ticket_Selector::load_tckt_slctr_assets();
650 650
 		EE_Datepicker_Input::enqueue_styles_and_scripts();
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
 		//for notification related bulk actions we need to make sure only active messengers have an option.
672 672
 		EED_Messages::set_autoloaders();
673 673
 		/** @type EE_Message_Resource_Manager $message_resource_manager */
674
-		$message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' );
674
+		$message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager');
675 675
 		$active_mts = $message_resource_manager->list_of_active_message_types();
676 676
 		//key= bulk_action_slug, value= message type.
677 677
 		$match_array = array(
@@ -684,23 +684,23 @@  discard block
 block discarded – undo
684 684
 
685 685
 		/** setup reg status bulk actions **/
686 686
 		$def_reg_status_actions['approve_registration'] = __('Approve Registrations', 'event_espresso');
687
-		if ( in_array( $match_array['approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
687
+		if (in_array($match_array['approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
688 688
 			$def_reg_status_actions['approve_and_notify_registration'] = __('Approve and Notify Registrations', 'event_espresso');
689 689
 		}
690 690
 		$def_reg_status_actions['decline_registration'] = __('Decline Registrations', 'event_espresso');
691
-		if ( in_array( $match_array['decline_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
691
+		if (in_array($match_array['decline_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
692 692
 			$def_reg_status_actions['decline_and_notify_registration'] = __('Decline and Notify Registrations', 'event_espresso');
693 693
 		}
694 694
 		$def_reg_status_actions['pending_registration'] = __('Set Registrations to Pending Payment', 'event_espresso');
695
-		if ( in_array( $match_array['pending_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
695
+		if (in_array($match_array['pending_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
696 696
 			$def_reg_status_actions['pending_and_notify_registration'] = __('Set Registrations to Pending Payment and Notify', 'event_espresso');
697 697
 		}
698 698
 		$def_reg_status_actions['no_approve_registration'] = __('Set Registrations to Not Approved', 'event_espresso');
699
-		if ( in_array( $match_array['no_approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
699
+		if (in_array($match_array['no_approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
700 700
 			$def_reg_status_actions['no_approve_and_notify_registration'] = __('Set Registrations to Not Approved and Notify', 'event_espresso');
701 701
 		}
702 702
 		$def_reg_status_actions['cancel_registration'] = __('Cancel Registrations', 'event_espresso');
703
-		if ( in_array( $match_array['cancel_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
703
+		if (in_array($match_array['cancel_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
704 704
 			$def_reg_status_actions['cancel_and_notify_registration'] = __('Cancel Registrations and Notify', 'event_espresso');
705 705
 		}
706 706
 
@@ -709,29 +709,29 @@  discard block
 block discarded – undo
709 709
 				'slug' => 'all',
710 710
 				'label' => __('View All Registrations', 'event_espresso'),
711 711
 				'count' => 0,
712
-				'bulk_action' => array_merge( $def_reg_status_actions, array(
712
+				'bulk_action' => array_merge($def_reg_status_actions, array(
713 713
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
714
-					) )
714
+					))
715 715
 				),
716 716
 			'month' => array(
717 717
 				'slug' => 'month',
718 718
 				'label' => __('This Month', 'event_espresso'),
719 719
 				'count' => 0,
720
-				'bulk_action' => array_merge( $def_reg_status_actions, array(
720
+				'bulk_action' => array_merge($def_reg_status_actions, array(
721 721
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
722 722
 					))
723 723
 				),
724 724
 			'today' => array(
725 725
 				'slug' => 'today',
726
-				'label' => sprintf( __('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp' ) ) ),
726
+				'label' => sprintf(__('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp'))),
727 727
 				'count' => 0,
728
-				'bulk_action' => array_merge( $def_reg_status_actions,  array(
728
+				'bulk_action' => array_merge($def_reg_status_actions, array(
729 729
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
730 730
 					))
731 731
 				)
732 732
 			);
733 733
 
734
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registrations', 'espresso_registrations_delete_registration' ) ) {
734
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registrations', 'espresso_registrations_delete_registration')) {
735 735
 			$this->_views['incomplete'] = array(
736 736
 				'slug' => 'incomplete',
737 737
 				'label' => __('Incomplete', 'event_espresso'),
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
 				)
768 768
 			);
769 769
 
770
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_trash_attendees' ) ) {
770
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_trash_attendees')) {
771 771
 			$this->_views['trash'] = array(
772 772
 				'slug' => 'trash',
773 773
 				'label' => __('Trash', 'event_espresso'),
@@ -806,18 +806,18 @@  discard block
 block discarded – undo
806 806
 				'desc' => __('View Transaction Invoice', 'event_espresso')
807 807
 				),
808 808
  			);
809
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) {
809
+		if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) {
810 810
 			$fc_items['resend_registration'] = array(
811 811
 				'class' => 'dashicons dashicons-email-alt',
812 812
 				'desc' => __('Resend Registration Details', 'event_espresso')
813 813
 				);
814 814
 		} else {
815
-			$fc_items['blank'] = array( 'class' => 'blank', 'desc' => '' );
815
+			$fc_items['blank'] = array('class' => 'blank', 'desc' => '');
816 816
 		}
817 817
 
818
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) {
819
-			$related_for_icon = EEH_MSG_Template::get_message_action_icon( 'see_notifications_for' );
820
-			if ( isset( $related_for_icon['css_class']) && isset( $related_for_icon['label'] ) ) {
818
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
819
+			$related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for');
820
+			if (isset($related_for_icon['css_class']) && isset($related_for_icon['label'])) {
821 821
 				$fc_items['view_related_messages'] = array(
822 822
 					'class' => $related_for_icon['css_class'],
823 823
 					'desc' => $related_for_icon['label'],
@@ -827,35 +827,35 @@  discard block
 block discarded – undo
827 827
 
828 828
 		$sc_items = array(
829 829
 			'approved_status' => array(
830
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved,
831
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' )
830
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_approved,
831
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')
832 832
 				),
833 833
 			'pending_status' => array(
834
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment,
835
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' )
834
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_pending_payment,
835
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence')
836 836
 				),
837 837
 			'wait_list' => array(
838
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_wait_list,
839
-				'desc'  => EEH_Template::pretty_status( EEM_Registration::status_id_wait_list, false, 'sentence' )
838
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_wait_list,
839
+				'desc'  => EEH_Template::pretty_status(EEM_Registration::status_id_wait_list, false, 'sentence')
840 840
 			),
841 841
 			'incomplete_status' => array(
842
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_incomplete,
843
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_incomplete, FALSE, 'sentence' )
842
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_incomplete,
843
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_incomplete, FALSE, 'sentence')
844 844
 			),
845 845
 			'not_approved' => array(
846
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved,
847
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' )
846
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_not_approved,
847
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence')
848 848
 				),
849 849
 			'declined_status' => array(
850
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined,
851
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' )
850
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_declined,
851
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence')
852 852
 				),
853 853
 			'cancelled_status' => array(
854
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled,
855
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' )
854
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_cancelled,
855
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence')
856 856
 				)
857 857
 			);
858
-		return array_merge( $fc_items, $sc_items );
858
+		return array_merge($fc_items, $sc_items);
859 859
 	}
860 860
 
861 861
 
@@ -868,15 +868,15 @@  discard block
 block discarded – undo
868 868
 
869 869
 
870 870
 	protected function _registrations_overview_list_table() {
871
-		$EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE;
872
-		if ( $EVT_ID ) {
873
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_registrations', 'espresso_registrations_new_registration', $EVT_ID ) ) {
874
-				$this->_admin_page_title .= $this->get_action_link_or_button( 'new_registration', 'add-registrant', array( 'event_id' => $EVT_ID ), 'add-new-h2' );
871
+		$EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE;
872
+		if ($EVT_ID) {
873
+			if (EE_Registry::instance()->CAP->current_user_can('ee_edit_registrations', 'espresso_registrations_new_registration', $EVT_ID)) {
874
+				$this->_admin_page_title .= $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $EVT_ID), 'add-new-h2');
875 875
 			}
876
-			$event = EEM_Event::instance()->get_one_by_ID( $EVT_ID );
877
-			$this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf( __('%s Viewing registrations for the event: %s%s', 'event_espresso'), '<h2>', '<a href="' . EE_Admin_Page::add_query_args_and_nonce( array('action' => 'edit', 'post' => $event->ID() ), EVENTS_ADMIN_URL ) . '">' . $event->get('EVT_name') . '</a>', '</h2>' ) : '';
876
+			$event = EEM_Event::instance()->get_one_by_ID($EVT_ID);
877
+			$this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf(__('%s Viewing registrations for the event: %s%s', 'event_espresso'), '<h2>', '<a href="'.EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $event->ID()), EVENTS_ADMIN_URL).'">'.$event->get('EVT_name').'</a>', '</h2>') : '';
878 878
 		}
879
-		$this->_template_args['after_list_table'] = $this->_display_legend( $this->_registration_legend_items() );
879
+		$this->_template_args['after_list_table'] = $this->_display_legend($this->_registration_legend_items());
880 880
 		$this->display_admin_list_table_page_with_no_sidebar();
881 881
 	}
882 882
 
@@ -891,19 +891,19 @@  discard block
 block discarded – undo
891 891
 	 */
892 892
 	private function _set_registration_object() {
893 893
 		//get out if we've already set the object
894
-		if ( is_object( $this->_registration )) {
894
+		if (is_object($this->_registration)) {
895 895
 			return TRUE;
896 896
 		}
897 897
 
898 898
 	    $REG = EEM_Registration::instance();
899 899
 
900
-		$REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
900
+		$REG_ID = ( ! empty($this->_req_data['_REG_ID'])) ? absint($this->_req_data['_REG_ID']) : FALSE;
901 901
 
902
-		if ( $this->_registration = $REG->get_one_by_ID( $REG_ID ))
902
+		if ($this->_registration = $REG->get_one_by_ID($REG_ID))
903 903
 			return TRUE;
904 904
 		else {
905
-			$error_msg = sprintf( __('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID );
906
-			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
905
+			$error_msg = sprintf(__('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID);
906
+			EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
907 907
 			$this->_registration = NULL;
908 908
 			return FALSE;
909 909
 		}
@@ -921,24 +921,24 @@  discard block
 block discarded – undo
921 921
 	 * @throws \EE_Error
922 922
 	 * @return mixed (int|array)  int = count || array of registration objects
923 923
 	 */
924
-	public function get_registrations( $per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE ) {
925
-		$EVT_ID = ! empty( $this->_req_data['event_id'] ) && $this->_req_data['event_id'] > 0 ? absint( $this->_req_data['event_id'] ) : FALSE;
926
-		$CAT_ID = ! empty( $this->_req_data['EVT_CAT'] ) && (int) $this->_req_data['EVT_CAT'] > 0? absint( $this->_req_data['EVT_CAT'] ) : FALSE;
927
-		$reg_status = ! empty( $this->_req_data['_reg_status'] ) ? sanitize_text_field( $this->_req_data['_reg_status'] ) : FALSE;
928
-		$month_range = ! empty( $this->_req_data['month_range'] ) ? sanitize_text_field( $this->_req_data['month_range'] ) : FALSE;//should be like 2013-april
929
-		$today_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'today' ? TRUE : FALSE;
930
-		$this_month_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'month' ? TRUE  : FALSE;
924
+	public function get_registrations($per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE) {
925
+		$EVT_ID = ! empty($this->_req_data['event_id']) && $this->_req_data['event_id'] > 0 ? absint($this->_req_data['event_id']) : FALSE;
926
+		$CAT_ID = ! empty($this->_req_data['EVT_CAT']) && (int) $this->_req_data['EVT_CAT'] > 0 ? absint($this->_req_data['EVT_CAT']) : FALSE;
927
+		$reg_status = ! empty($this->_req_data['_reg_status']) ? sanitize_text_field($this->_req_data['_reg_status']) : FALSE;
928
+		$month_range = ! empty($this->_req_data['month_range']) ? sanitize_text_field($this->_req_data['month_range']) : FALSE; //should be like 2013-april
929
+		$today_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'today' ? TRUE : FALSE;
930
+		$this_month_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'month' ? TRUE : FALSE;
931 931
 		$start_date = FALSE;
932 932
 		$end_date = FALSE;
933 933
 		$_where = array();
934
-		$trash = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'trash' ? TRUE : FALSE;
935
-		$incomplete = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'incomplete' ? TRUE : FALSE;
934
+		$trash = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'trash' ? TRUE : FALSE;
935
+		$incomplete = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'incomplete' ? TRUE : FALSE;
936 936
 
937 937
 		//set orderby
938 938
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
939 939
 
940 940
 
941
-		switch ( $this->_req_data['orderby'] ) {
941
+		switch ($this->_req_data['orderby']) {
942 942
 			case '_REG_ID':
943 943
 				$orderby = 'REG_ID';
944 944
 				break;
@@ -958,26 +958,26 @@  discard block
 block discarded – undo
958 958
 				$orderby = 'REG_date';
959 959
 		}
960 960
 
961
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC';
962
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
963
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
961
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC';
962
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
963
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
964 964
 
965 965
 
966
-		$offset = ($current_page-1)*$per_page;
967
-		$limit = $count  ? NULL : array( $offset, $per_page );
966
+		$offset = ($current_page - 1) * $per_page;
967
+		$limit = $count ? NULL : array($offset, $per_page);
968 968
 
969
-		if($EVT_ID){
970
-			$_where['EVT_ID']=$EVT_ID;
969
+		if ($EVT_ID) {
970
+			$_where['EVT_ID'] = $EVT_ID;
971 971
 		}
972
-		if($CAT_ID){
972
+		if ($CAT_ID) {
973 973
 			$_where['Event.Term_Taxonomy.term_id'] = $CAT_ID;
974 974
 		}
975
-		if ( $incomplete ) {
975
+		if ($incomplete) {
976 976
 			$_where['STS_ID'] = EEM_Registration::status_id_incomplete;
977 977
 		} else if ( ! $trash) {
978
-			$_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete );
978
+			$_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete);
979 979
 		}
980
-		if($reg_status){
980
+		if ($reg_status) {
981 981
 			$_where['STS_ID'] = $reg_status;
982 982
 		}
983 983
 
@@ -989,105 +989,105 @@  discard block
 block discarded – undo
989 989
 		$time_start = ' 00:00:00';
990 990
 		$time_end = ' 23:59:59';
991 991
 
992
-		if($today_a || $today ){
992
+		if ($today_a || $today) {
993 993
 			$curdate = date('Y-m-d', current_time('timestamp'));
994
-			$_where['REG_date']= array('BETWEEN',
994
+			$_where['REG_date'] = array('BETWEEN',
995 995
 				array(
996
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_start, 'Y-m-d H:i:s' ),
997
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_end, 'Y-m-d H:i:s' ),
996
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_start, 'Y-m-d H:i:s'),
997
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_end, 'Y-m-d H:i:s'),
998 998
 			));
999
-		}elseif($this_month_a || $this_month){
999
+		}elseif ($this_month_a || $this_month) {
1000 1000
 			$this_month_r = date('m', current_time('timestamp'));
1001
-			$days_this_month = date( 't', current_time('timestamp') );
1002
-			$_where['REG_date']= array('BETWEEN',
1001
+			$days_this_month = date('t', current_time('timestamp'));
1002
+			$_where['REG_date'] = array('BETWEEN',
1003 1003
 				array(
1004
-					EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, 'Y-m-d H:i:s' ),
1005
-					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' )
1004
+					EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-01'.' '.$time_start, 'Y-m-d H:i:s'),
1005
+					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')
1006 1006
 			));
1007
-		}elseif($month_range){
1007
+		}elseif ($month_range) {
1008 1008
 			$pieces = explode(' ', $this->_req_data['month_range'], 3);
1009
-			$month_r = !empty($pieces[0]) ? date('m', strtotime( $month_range ) ) : '';
1010
-			$year_r = !empty($pieces[1]) ? $pieces[1] : '';
1011
-			$days_in_month = date('t', strtotime($year_r .  '-' . $month_r . '-' . '01') );
1012
-			$_where['REG_date']= array('BETWEEN',
1013
-				array(  EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-' . $days_in_month .  ' 23:59:59', 'Y-m-d H:i:s' ) ) );
1014
-		}elseif($start_date && $end_date){
1009
+			$month_r = ! empty($pieces[0]) ? date('m', strtotime($month_range)) : '';
1010
+			$year_r = ! empty($pieces[1]) ? $pieces[1] : '';
1011
+			$days_in_month = date('t', strtotime($year_r.'-'.$month_r.'-'.'01'));
1012
+			$_where['REG_date'] = array('BETWEEN',
1013
+				array(EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-'.$days_in_month.' 23:59:59', 'Y-m-d H:i:s')));
1014
+		}elseif ($start_date && $end_date) {
1015 1015
 			throw new EE_Error("not yet supported");
1016
-		}elseif($start_date){
1016
+		}elseif ($start_date) {
1017 1017
 			throw new EE_Error("not yet supported");
1018
-		}elseif($end_date){
1018
+		}elseif ($end_date) {
1019 1019
 			throw new EE_Error("not yet supported");
1020 1020
 		}
1021 1021
 
1022
-		if ( ! empty( $this->_req_data['s'] ) ) {
1023
-			$sstr = '%' . $this->_req_data['s'] . '%';
1022
+		if ( ! empty($this->_req_data['s'])) {
1023
+			$sstr = '%'.$this->_req_data['s'].'%';
1024 1024
 			$_where['OR'] = array(
1025
-				'Event.EVT_name' => array( 'LIKE', $sstr),
1026
-				'Event.EVT_desc' => array( 'LIKE', $sstr ),
1027
-				'Event.EVT_short_desc' => array( 'LIKE' , $sstr ),
1028
-				'Attendee.ATT_full_name' => array( 'LIKE', $sstr ),
1029
-				'Attendee.ATT_fname' => array( 'LIKE', $sstr ),
1030
-				'Attendee.ATT_lname' => array( 'LIKE', $sstr ),
1031
-				'Attendee.ATT_short_bio' => array( 'LIKE', $sstr ),
1032
-				'Attendee.ATT_email' => array('LIKE', $sstr ),
1033
-				'Attendee.ATT_address' => array( 'LIKE', $sstr ),
1034
-				'Attendee.ATT_address2' => array( 'LIKE', $sstr ),
1035
-				'Attendee.ATT_city' => array( 'LIKE', $sstr ),
1036
-				'REG_final_price' => array( 'LIKE', $sstr ),
1037
-				'REG_code' => array( 'LIKE', $sstr ),
1038
-				'REG_count' => array( 'LIKE' , $sstr ),
1039
-				'REG_group_size' => array( 'LIKE' , $sstr ),
1040
-				'Ticket.TKT_name' => array( 'LIKE', $sstr ),
1041
-				'Ticket.TKT_description' => array( 'LIKE', $sstr ),
1042
-				'Transaction.Payment.PAY_txn_id_chq_nmbr' => array( 'LIKE', $sstr )
1025
+				'Event.EVT_name' => array('LIKE', $sstr),
1026
+				'Event.EVT_desc' => array('LIKE', $sstr),
1027
+				'Event.EVT_short_desc' => array('LIKE', $sstr),
1028
+				'Attendee.ATT_full_name' => array('LIKE', $sstr),
1029
+				'Attendee.ATT_fname' => array('LIKE', $sstr),
1030
+				'Attendee.ATT_lname' => array('LIKE', $sstr),
1031
+				'Attendee.ATT_short_bio' => array('LIKE', $sstr),
1032
+				'Attendee.ATT_email' => array('LIKE', $sstr),
1033
+				'Attendee.ATT_address' => array('LIKE', $sstr),
1034
+				'Attendee.ATT_address2' => array('LIKE', $sstr),
1035
+				'Attendee.ATT_city' => array('LIKE', $sstr),
1036
+				'REG_final_price' => array('LIKE', $sstr),
1037
+				'REG_code' => array('LIKE', $sstr),
1038
+				'REG_count' => array('LIKE', $sstr),
1039
+				'REG_group_size' => array('LIKE', $sstr),
1040
+				'Ticket.TKT_name' => array('LIKE', $sstr),
1041
+				'Ticket.TKT_description' => array('LIKE', $sstr),
1042
+				'Transaction.Payment.PAY_txn_id_chq_nmbr' => array('LIKE', $sstr)
1043 1043
 				);
1044 1044
 		}
1045 1045
 
1046 1046
 		//capability checks
1047
-		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations' ) ) {
1047
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations')) {
1048 1048
 			$_where['AND'] = array(
1049 1049
 				'Event.EVT_wp_user' => get_current_user_id()
1050 1050
 				);
1051 1051
 		}
1052 1052
 
1053 1053
 
1054
-		if( $count ){
1055
-			if ( $trash ) {
1056
-				return EEM_Registration::instance()->count_deleted( array( $_where ));
1057
-			} else if ( $incomplete ) {
1058
-				return EEM_Registration::instance()->count( array( $_where ));
1054
+		if ($count) {
1055
+			if ($trash) {
1056
+				return EEM_Registration::instance()->count_deleted(array($_where));
1057
+			} else if ($incomplete) {
1058
+				return EEM_Registration::instance()->count(array($_where));
1059 1059
 			} else {
1060
-				return EEM_Registration::instance()->count( array( $_where, 'default_where_conditions' => 'this_model_only' ));
1060
+				return EEM_Registration::instance()->count(array($_where, 'default_where_conditions' => 'this_model_only'));
1061 1061
 			}
1062 1062
 		} else {
1063 1063
 			//make sure we remove default where conditions cause all registrations matching query are returned
1064
-			$query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'default_where_conditions' => 'this_model_only' );
1065
-			if ( $per_page !== -1 ) {
1064
+			$query_params = array($_where, 'order_by' => array($orderby => $sort), 'default_where_conditions' => 'this_model_only');
1065
+			if ($per_page !== -1) {
1066 1066
 				$query_params['limit'] = $limit;
1067 1067
 			}
1068
-			$registrations =  $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params);
1068
+			$registrations = $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params);
1069 1069
 
1070 1070
 
1071
-			if ( $EVT_ID && isset( $registrations[0] ) && $registrations[0] instanceof EE_Registration &&  $registrations[0]->event_obj()) {
1071
+			if ($EVT_ID && isset($registrations[0]) && $registrations[0] instanceof EE_Registration && $registrations[0]->event_obj()) {
1072 1072
 				$first_registration = $registrations[0];
1073 1073
 				//EEH_Debug_Tools::printr( $registrations[0], '$registrations  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
1074 1074
 				$event_name = $first_registration->event_obj()->name();
1075
-				$event_date = $first_registration->date_obj()->start_date_and_time('l F j, Y,', 'g:i:s a');// isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y,    g:i:s a', $registrations[0]->DTT_EVT_start ) : '';
1075
+				$event_date = $first_registration->date_obj()->start_date_and_time('l F j, Y,', 'g:i:s a'); // isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y,    g:i:s a', $registrations[0]->DTT_EVT_start ) : '';
1076 1076
 				// edit event link
1077
-				if ( $event_name != '' ) {
1078
-					$edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit_event', 'EVT_ID'=>$EVT_ID ), EVENTS_ADMIN_URL );
1079
-					$edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $event_name . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>';
1080
-					$event_name .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ;
1077
+				if ($event_name != '') {
1078
+					$edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit_event', 'EVT_ID'=>$EVT_ID), EVENTS_ADMIN_URL);
1079
+					$edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$event_name.'">'.__('Edit Event', 'event_espresso').'</a>';
1080
+					$event_name .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>';
1081 1081
 				}
1082 1082
 
1083
-				$back_2_reg_url = self::add_query_args_and_nonce( array( 'action'=>'default' ), REG_ADMIN_URL );
1084
-				$back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="' . esc_attr__( 'click to return to viewing all registrations ', 'event_espresso' ) . '">&laquo; ' . __( 'Back to All Registrations', 'event_espresso' ) . '</a>';
1083
+				$back_2_reg_url = self::add_query_args_and_nonce(array('action'=>'default'), REG_ADMIN_URL);
1084
+				$back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="'.esc_attr__('click to return to viewing all registrations ', 'event_espresso').'">&laquo; '.__('Back to All Registrations', 'event_espresso').'</a>';
1085 1085
 
1086 1086
 				$this->_template_args['before_admin_page_content'] = '
1087 1087
 			<div id="admin-page-header">
1088
-				<h1><span class="small-text not-bold">'.__( 'Event: ', 'event_espresso' ).'</span>'. $event_name .'</h1>
1089
-				<h3><span class="small-text not-bold">'.__( 'Date: ', 'event_espresso' ). '</span>'. $event_date .'</h3>
1090
-				<span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk . '</span>
1088
+				<h1><span class="small-text not-bold">'.__('Event: ', 'event_espresso').'</span>'.$event_name.'</h1>
1089
+				<h3><span class="small-text not-bold">'.__('Date: ', 'event_espresso').'</span>'.$event_date.'</h3>
1090
+				<span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk.'</span>
1091 1091
 			</div>
1092 1092
 			';
1093 1093
 
@@ -1125,7 +1125,7 @@  discard block
 block discarded – undo
1125 1125
 
1126 1126
 		$this->_set_registration_object();
1127 1127
 
1128
-		if ( is_object( $this->_registration )) {
1128
+		if (is_object($this->_registration)) {
1129 1129
 			$transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance();
1130 1130
 			$this->_session = $transaction->session_data();
1131 1131
 
@@ -1133,10 +1133,10 @@  discard block
 block discarded – undo
1133 1133
 
1134 1134
 
1135 1135
 			$this->_template_args['reg_nmbr']['value'] = $this->_registration->ID();
1136
-			$this->_template_args['reg_nmbr']['label'] = __( 'Registration Number', 'event_espresso' );
1136
+			$this->_template_args['reg_nmbr']['label'] = __('Registration Number', 'event_espresso');
1137 1137
 
1138
-			$this->_template_args['reg_datetime']['value'] =  $this->_registration->get_i18n_datetime( 'REG_date' );
1139
-			$this->_template_args['reg_datetime']['label'] = __( 'Date', 'event_espresso' );
1138
+			$this->_template_args['reg_datetime']['value'] = $this->_registration->get_i18n_datetime('REG_date');
1139
+			$this->_template_args['reg_datetime']['label'] = __('Date', 'event_espresso');
1140 1140
 
1141 1141
 			$this->_template_args['grand_total'] = $transaction->total();
1142 1142
 
@@ -1144,19 +1144,19 @@  discard block
 block discarded – undo
1144 1144
 			// link back to overview
1145 1145
 			$this->_template_args['reg_overview_url'] = REG_ADMIN_URL;
1146 1146
 			$this->_template_args['registration'] = $this->_registration;
1147
-			$this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'event_id' => $event_id ), REG_ADMIN_URL );
1148
-			$this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions' ), admin_url( 'admin.php' ) );
1149
-			$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id ), admin_url( 'admin.php' ) );
1147
+			$this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $event_id), REG_ADMIN_URL);
1148
+			$this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions'), admin_url('admin.php'));
1149
+			$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id), admin_url('admin.php'));
1150 1150
 
1151 1151
 			//next and previous links
1152
-			$next_reg = $this->_registration->next(null, array(), 'REG_ID' );
1153
-			$this->_template_args['next_registration'] = $next_reg ? $this->_next_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-right ee-icon-size-22' ) : '';
1154
-			$previous_reg = $this->_registration->previous( null, array(), 'REG_ID' );
1155
-			$this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-left ee-icon-size-22' ) : '';
1152
+			$next_reg = $this->_registration->next(null, array(), 'REG_ID');
1153
+			$this->_template_args['next_registration'] = $next_reg ? $this->_next_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-right ee-icon-size-22') : '';
1154
+			$previous_reg = $this->_registration->previous(null, array(), 'REG_ID');
1155
+			$this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-left ee-icon-size-22') : '';
1156 1156
 
1157 1157
 			// grab header
1158
-			$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_header.template.php';
1159
-			$this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1158
+			$template_path = REG_TEMPLATE_PATH.'reg_admin_details_header.template.php';
1159
+			$this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1160 1160
 
1161 1161
 		} else {
1162 1162
 
@@ -1175,17 +1175,17 @@  discard block
 block discarded – undo
1175 1175
 
1176 1176
 
1177 1177
 	protected function _registration_details_metaboxes() {
1178
-		do_action( 'AHEE__Registrations_Admin_Page___registration_details_metabox__start', $this );
1178
+		do_action('AHEE__Registrations_Admin_Page___registration_details_metabox__start', $this);
1179 1179
 		$this->_set_registration_object();
1180 1180
 		$attendee = $this->_registration instanceof EE_Registration ? $this->_registration->attendee() : null;
1181
-		add_meta_box( 'edit-reg-status-mbox', __( 'Registration Status', 'event_espresso' ), array( $this, 'set_reg_status_buttons_metabox' ), $this->wp_page_slug, 'normal', 'high' );
1182
-		add_meta_box( 'edit-reg-details-mbox', __( 'Registration Details', 'event_espresso' ), array( $this, '_reg_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1183
-		if ( $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox' ) ) {
1184
-			add_meta_box( 'edit-reg-questions-mbox', __( 'Registration Form Answers', 'event_espresso' ), array( $this, '_reg_questions_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1181
+		add_meta_box('edit-reg-status-mbox', __('Registration Status', 'event_espresso'), array($this, 'set_reg_status_buttons_metabox'), $this->wp_page_slug, 'normal', 'high');
1182
+		add_meta_box('edit-reg-details-mbox', __('Registration Details', 'event_espresso'), array($this, '_reg_details_meta_box'), $this->wp_page_slug, 'normal', 'high');
1183
+		if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox')) {
1184
+			add_meta_box('edit-reg-questions-mbox', __('Registration Form Answers', 'event_espresso'), array($this, '_reg_questions_meta_box'), $this->wp_page_slug, 'normal', 'high');
1185 1185
 		}
1186
-		add_meta_box( 'edit-reg-registrant-mbox', __( 'Contact Details', 'event_espresso' ), array( $this, '_reg_registrant_side_meta_box' ), $this->wp_page_slug, 'side', 'high' );
1187
-		if ( $this->_registration->group_size() > 1 ) {
1188
-			add_meta_box( 'edit-reg-attendees-mbox', __( 'Other Registrations in this Transaction', 'event_espresso' ), array( $this, '_reg_attendees_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1186
+		add_meta_box('edit-reg-registrant-mbox', __('Contact Details', 'event_espresso'), array($this, '_reg_registrant_side_meta_box'), $this->wp_page_slug, 'side', 'high');
1187
+		if ($this->_registration->group_size() > 1) {
1188
+			add_meta_box('edit-reg-attendees-mbox', __('Other Registrations in this Transaction', 'event_espresso'), array($this, '_reg_attendees_meta_box'), $this->wp_page_slug, 'normal', 'high');
1189 1189
 		}
1190 1190
 	}
1191 1191
 
@@ -1204,22 +1204,22 @@  discard block
 block discarded – undo
1204 1204
 		$is_complete = $this->_registration->transaction()->is_completed();
1205 1205
 		//let's get an array of all possible buttons that we can just reference
1206 1206
 		$status_buttons = $this->_get_reg_status_buttons();
1207
-		$template_args[ 'reg_status_value' ] = $this->_registration->pretty_status();
1208
-		$template_args[ 'reg_status_class' ] = 'status-' . $this->_registration->status_ID();
1207
+		$template_args['reg_status_value'] = $this->_registration->pretty_status();
1208
+		$template_args['reg_status_class'] = 'status-'.$this->_registration->status_ID();
1209 1209
 		$template_args['attendee'] = $this->_registration->attendee();
1210
-		$template = REG_TEMPLATE_PATH . 'reg_status_change_buttons.template.php';
1211
-		if ( $this->_set_registration_object() ) {
1210
+		$template = REG_TEMPLATE_PATH.'reg_status_change_buttons.template.php';
1211
+		if ($this->_set_registration_object()) {
1212 1212
 			$current_status = $this->_registration->status_ID();
1213
-			unset( $status_buttons[$current_status] );
1214
-			if ( $current_status != EEM_Registration::status_id_pending_payment && $is_complete ) {
1215
-				unset( $status_buttons[EEM_Registration::status_id_pending_payment] );
1213
+			unset($status_buttons[$current_status]);
1214
+			if ($current_status != EEM_Registration::status_id_pending_payment && $is_complete) {
1215
+				unset($status_buttons[EEM_Registration::status_id_pending_payment]);
1216 1216
 			}
1217
-			$template_args['status_buttons'] = implode( "\n", $status_buttons );
1217
+			$template_args['status_buttons'] = implode("\n", $status_buttons);
1218 1218
 		}
1219 1219
 		$template_args['form_url'] = REG_ADMIN_URL;
1220 1220
 		$template_args['REG_ID'] = $this->_registration->ID();
1221
-		$template_args['nonce'] = wp_nonce_field( 'change_reg_status_nonce',  'change_reg_status_nonce', FALSE, FALSE );
1222
-		EEH_Template::display_template( $template, $template_args );
1221
+		$template_args['nonce'] = wp_nonce_field('change_reg_status_nonce', 'change_reg_status_nonce', FALSE, FALSE);
1222
+		EEH_Template::display_template($template, $template_args);
1223 1223
 
1224 1224
 	}
1225 1225
 
@@ -1233,11 +1233,11 @@  discard block
 block discarded – undo
1233 1233
 	private function _get_reg_status_buttons() {
1234 1234
 
1235 1235
 		$buttons = array(
1236
-			EEM_Registration::status_id_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_approved . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) . '">',
1237
-			EEM_Registration::status_id_pending_payment => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_pending_payment . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ) . '">',
1238
-			EEM_Registration::status_id_not_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_not_approved . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ) . '">',
1239
-			EEM_Registration::status_id_declined => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_declined . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' ) . '">',
1240
-			EEM_Registration::status_id_cancelled =>'<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_cancelled . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' ) . '">',
1236
+			EEM_Registration::status_id_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_approved.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence').'">',
1237
+			EEM_Registration::status_id_pending_payment => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_pending_payment.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence').'">',
1238
+			EEM_Registration::status_id_not_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_not_approved.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence').'">',
1239
+			EEM_Registration::status_id_declined => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_declined.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence').'">',
1240
+			EEM_Registration::status_id_cancelled =>'<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_cancelled.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence').'">',
1241 1241
 			);
1242 1242
 		return $buttons;
1243 1243
 	}
@@ -1251,13 +1251,13 @@  discard block
 block discarded – undo
1251 1251
 	 *
1252 1252
 	 * @return array  (array with reg_id(s) updated and whether update was successful.
1253 1253
 	 */
1254
-	protected function _set_registration_status_from_request( $status = false, $notify = false ) {
1255
-		$REG_ID = isset( $this->_req_data['_REG_ID'] ) ? (array) $this->_req_data['_REG_ID'] : array();
1254
+	protected function _set_registration_status_from_request($status = false, $notify = false) {
1255
+		$REG_ID = isset($this->_req_data['_REG_ID']) ? (array) $this->_req_data['_REG_ID'] : array();
1256 1256
 
1257
-		$success = $this->_set_registration_status( $REG_ID, $status );
1257
+		$success = $this->_set_registration_status($REG_ID, $status);
1258 1258
 
1259 1259
 		//notify?
1260
-		if ( $success && $notify && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) {
1260
+		if ($success && $notify && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) {
1261 1261
 			$this->_process_resend_registration();
1262 1262
 		}
1263 1263
 
@@ -1275,19 +1275,19 @@  discard block
 block discarded – undo
1275 1275
 	 * @param bool $status
1276 1276
 	 * @return array (an array with 'success' key representing whether status change was successful, and 'REG_ID' as the array of updated registrations).
1277 1277
 	 */
1278
-	protected function _set_registration_status( $REG_ID, $status = false ) {
1278
+	protected function _set_registration_status($REG_ID, $status = false) {
1279 1279
 		$success = true;
1280 1280
 		// set default status if none is passed
1281 1281
 		$status = $status ? $status : EEM_Registration::status_id_pending_payment;
1282 1282
 
1283 1283
 		//typecast and sanitize reg_id
1284
-		$reg_ids = array_filter( (array) $REG_ID, 'absint' );
1284
+		$reg_ids = array_filter((array) $REG_ID, 'absint');
1285 1285
 
1286 1286
 		//loop through REG_ID's and change status
1287
-		foreach ( $reg_ids as $r_id ) {
1288
-			$registration = EEM_Registration::instance()->get_one_by_ID( $r_id );
1289
-			if ( $registration instanceof EE_Registration ) {
1290
-				$registration->set_status( $status );
1287
+		foreach ($reg_ids as $r_id) {
1288
+			$registration = EEM_Registration::instance()->get_one_by_ID($r_id);
1289
+			if ($registration instanceof EE_Registration) {
1290
+				$registration->set_status($status);
1291 1291
 				$result = $registration->save();
1292 1292
 
1293 1293
 				//verifying explicit fails because update *may* just return 0 for 0 rows affected
@@ -1299,7 +1299,7 @@  discard block
 block discarded – undo
1299 1299
 		$this->_req_data['_REG_ID'] = $reg_ids;
1300 1300
 
1301 1301
 		//return $success and processed registrations
1302
-		return array( 'REG_ID' => $reg_ids, 'success' => $success );
1302
+		return array('REG_ID' => $reg_ids, 'success' => $success);
1303 1303
 	}
1304 1304
 
1305 1305
 
@@ -1311,37 +1311,37 @@  discard block
 block discarded – undo
1311 1311
 	 * @param   bool    $notify indicates whether the _set_registration_status_from_request does notifications or not.
1312 1312
 	 * @return void
1313 1313
 	 */
1314
-	protected function _reg_status_change_return( $STS_ID, $notify = false ) {
1314
+	protected function _reg_status_change_return($STS_ID, $notify = false) {
1315 1315
 
1316
-		$result = ! empty( $STS_ID ) ? $this->_set_registration_status_from_request( $STS_ID, $notify ) : array( 'success' => false );
1316
+		$result = ! empty($STS_ID) ? $this->_set_registration_status_from_request($STS_ID, $notify) : array('success' => false);
1317 1317
 
1318 1318
 
1319
-		$success = isset( $result['success'] ) && $result['success'];
1319
+		$success = isset($result['success']) && $result['success'];
1320 1320
 
1321 1321
 		//setup success message
1322
-		if ( $success ) {
1323
-			$msg = is_array( $result['REG_ID'] ) && count( $result['REG_ID'] ) > 1  ? sprintf( __('Registration status has been set to %s', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower' ) ) :  sprintf( __('Registrations have been set to %s.', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower' ) ) ;
1324
-			EE_Error::add_success( $msg );
1322
+		if ($success) {
1323
+			$msg = is_array($result['REG_ID']) && count($result['REG_ID']) > 1 ? sprintf(__('Registration status has been set to %s', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower')) : sprintf(__('Registrations have been set to %s.', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower'));
1324
+			EE_Error::add_success($msg);
1325 1325
 		} else {
1326
-			EE_Error::add_error( __('Something went wrong, and the status was not changed', 'event_espresso' ), __FILE__, __LINE__, __FUNCTION__ );
1326
+			EE_Error::add_error(__('Something went wrong, and the status was not changed', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__);
1327 1327
 		}
1328 1328
 
1329
-		$route = isset( $this->_req_data['return'] ) && $this->_req_data['return'] == 'view_registration' ? array( 'action' => 'view_registration', '_REG_ID' => $result['REG_ID'][0] ) : array( 'action' => 'default' );
1329
+		$route = isset($this->_req_data['return']) && $this->_req_data['return'] == 'view_registration' ? array('action' => 'view_registration', '_REG_ID' => $result['REG_ID'][0]) : array('action' => 'default');
1330 1330
 		//unset nonces
1331
-		foreach ( $this->_req_data as $ref => $value ) {
1332
-			if ( strpos( $ref, 'nonce' ) !== false ) {
1333
-				unset( $this->_req_data[$ref] );
1331
+		foreach ($this->_req_data as $ref => $value) {
1332
+			if (strpos($ref, 'nonce') !== false) {
1333
+				unset($this->_req_data[$ref]);
1334 1334
 				continue;
1335 1335
 			}
1336 1336
 
1337
-			$value = is_array( $value ) ? array_map( 'urlencode', $value ) : urlencode( $value );
1337
+			$value = is_array($value) ? array_map('urlencode', $value) : urlencode($value);
1338 1338
 			$this->_req_data[$ref] = $value;
1339 1339
 		}
1340 1340
 
1341 1341
 		//merge request vars so that the reloaded list table contains any existing filter query params
1342
-		$route = array_merge( $this->_req_data, $route );
1342
+		$route = array_merge($this->_req_data, $route);
1343 1343
 
1344
-		$this->_redirect_after_action( false, '', '', $route, true );
1344
+		$this->_redirect_after_action(false, '', '', $route, true);
1345 1345
 	}
1346 1346
 
1347 1347
 
@@ -1353,29 +1353,29 @@  discard block
 block discarded – undo
1353 1353
 	protected function _change_reg_status() {
1354 1354
 		$this->_req_data['return'] = 'view_registration';
1355 1355
 		//set notify based on whether the send notifications toggle is set or not
1356
-		$notify = ! empty( $this->_req_data['txn_reg_status_change']['send_notifications'] );
1357
-		$this->_req_data[ '_reg_status_id' ] = isset( $this->_req_data[ '_reg_status_id' ] ) ? $this->_req_data[ '_reg_status_id' ] : '';
1356
+		$notify = ! empty($this->_req_data['txn_reg_status_change']['send_notifications']);
1357
+		$this->_req_data['_reg_status_id'] = isset($this->_req_data['_reg_status_id']) ? $this->_req_data['_reg_status_id'] : '';
1358 1358
 
1359
-		switch ( $this->_req_data['_reg_status_id'] ) {
1360
-			case EEH_Template::pretty_status( EEM_Registration::status_id_approved, false, 'sentence' ) :
1361
-				$this->approve_registration( $notify );
1359
+		switch ($this->_req_data['_reg_status_id']) {
1360
+			case EEH_Template::pretty_status(EEM_Registration::status_id_approved, false, 'sentence') :
1361
+				$this->approve_registration($notify);
1362 1362
 				break;
1363
-			case EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, false, 'sentence' ) :
1364
-				$this->pending_registration( $notify );
1363
+			case EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, false, 'sentence') :
1364
+				$this->pending_registration($notify);
1365 1365
 				break;
1366
-			case EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, false, 'sentence' ) :
1367
-				$this->not_approve_registration( $notify );
1366
+			case EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, false, 'sentence') :
1367
+				$this->not_approve_registration($notify);
1368 1368
 				break;
1369
-			case EEH_Template::pretty_status( EEM_Registration::status_id_declined, false, 'sentence' ) :
1370
-				$this->decline_registration( $notify );
1369
+			case EEH_Template::pretty_status(EEM_Registration::status_id_declined, false, 'sentence') :
1370
+				$this->decline_registration($notify);
1371 1371
 				break;
1372
-			case EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, false, 'sentence' ) :
1373
-				$this->cancel_registration( $notify );
1372
+			case EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, false, 'sentence') :
1373
+				$this->cancel_registration($notify);
1374 1374
 				break;
1375 1375
 			default :
1376 1376
 				$result['success'] = false;
1377
-				unset( $this->_req_data['return'] );
1378
-				$this->_reg_status_change_return( '', false );
1377
+				unset($this->_req_data['return']);
1378
+				$this->_reg_status_change_return('', false);
1379 1379
 				break;
1380 1380
 		}
1381 1381
 	}
@@ -1388,8 +1388,8 @@  discard block
 block discarded – undo
1388 1388
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1389 1389
 	*		@return void
1390 1390
 	*/
1391
-	protected function approve_registration( $notify = false ) {
1392
-		$this->_reg_status_change_return( EEM_Registration::status_id_approved, $notify );
1391
+	protected function approve_registration($notify = false) {
1392
+		$this->_reg_status_change_return(EEM_Registration::status_id_approved, $notify);
1393 1393
 	}
1394 1394
 
1395 1395
 
@@ -1401,8 +1401,8 @@  discard block
 block discarded – undo
1401 1401
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1402 1402
 	*		@return void
1403 1403
 	*/
1404
-	protected function decline_registration( $notify = false ) {
1405
-		$this->_reg_status_change_return( EEM_Registration::status_id_declined, $notify );
1404
+	protected function decline_registration($notify = false) {
1405
+		$this->_reg_status_change_return(EEM_Registration::status_id_declined, $notify);
1406 1406
 	}
1407 1407
 
1408 1408
 
@@ -1414,8 +1414,8 @@  discard block
 block discarded – undo
1414 1414
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1415 1415
 	*		@return void
1416 1416
 	*/
1417
-	protected function cancel_registration( $notify = false ) {
1418
-		$this->_reg_status_change_return( EEM_Registration::status_id_cancelled, $notify );
1417
+	protected function cancel_registration($notify = false) {
1418
+		$this->_reg_status_change_return(EEM_Registration::status_id_cancelled, $notify);
1419 1419
 	}
1420 1420
 
1421 1421
 
@@ -1428,8 +1428,8 @@  discard block
 block discarded – undo
1428 1428
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1429 1429
 	*		@return void
1430 1430
 	*/
1431
-	protected function not_approve_registration( $notify = false ) {
1432
-		$this->_reg_status_change_return( EEM_Registration::status_id_not_approved, $notify );
1431
+	protected function not_approve_registration($notify = false) {
1432
+		$this->_reg_status_change_return(EEM_Registration::status_id_not_approved, $notify);
1433 1433
 	}
1434 1434
 
1435 1435
 
@@ -1440,8 +1440,8 @@  discard block
 block discarded – undo
1440 1440
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1441 1441
 	*		@return void
1442 1442
 	*/
1443
-	protected function pending_registration( $notify = false ) {
1444
-		$this->_reg_status_change_return( EEM_Registration::status_id_pending_payment, $notify );
1443
+	protected function pending_registration($notify = false) {
1444
+		$this->_reg_status_change_return(EEM_Registration::status_id_pending_payment, $notify);
1445 1445
 	}
1446 1446
 
1447 1447
 
@@ -1455,19 +1455,19 @@  discard block
 block discarded – undo
1455 1455
 	public function _reg_details_meta_box() {
1456 1456
 		EEH_Autoloader::register_line_item_display_autoloaders();
1457 1457
 		EEH_Autoloader::register_line_item_filter_autoloaders();
1458
-		EE_Registry::instance()->load_helper( 'Line_Item' );
1458
+		EE_Registry::instance()->load_helper('Line_Item');
1459 1459
 		$transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance();
1460 1460
 		$this->_session = $transaction->session_data();
1461 1461
 
1462 1462
 		$filters = new EE_Line_Item_Filter_Collection();
1463
-		$filters->add( new EE_Single_Registration_Line_Item_Filter( $this->_registration ) );
1464
-		$filters->add( new EE_Non_Zero_Line_Item_Filter() );
1465
-		$line_item_filter_processor = new EE_Line_Item_Filter_Processor( $filters, $transaction->total_line_item() );
1463
+		$filters->add(new EE_Single_Registration_Line_Item_Filter($this->_registration));
1464
+		$filters->add(new EE_Non_Zero_Line_Item_Filter());
1465
+		$line_item_filter_processor = new EE_Line_Item_Filter_Processor($filters, $transaction->total_line_item());
1466 1466
 		$filtered_line_item_tree = $line_item_filter_processor->process();
1467 1467
 
1468 1468
 		$this->_template_args['REG_ID'] = $this->_registration->ID();
1469
-		$line_item_display = new EE_Line_Item_Display( 'reg_admin_table', 'EE_Admin_Table_Registration_Line_Item_Display_Strategy' );
1470
-		$this->_template_args['line_item_table'] = $line_item_display->display_line_item( $filtered_line_item_tree, array( 'EE_Registration' => $this->_registration ) );
1469
+		$line_item_display = new EE_Line_Item_Display('reg_admin_table', 'EE_Admin_Table_Registration_Line_Item_Display_Strategy');
1470
+		$this->_template_args['line_item_table'] = $line_item_display->display_line_item($filtered_line_item_tree, array('EE_Registration' => $this->_registration));
1471 1471
 
1472 1472
 
1473 1473
 		$attendee = $this->_registration->attendee();
@@ -1478,10 +1478,10 @@  discard block
 block discarded – undo
1478 1478
 		)
1479 1479
 			? EEH_Template::get_button_or_link(
1480 1480
 				EE_Admin_Page::add_query_args_and_nonce(
1481
-					array( 'action' => 'view_transaction', 'TXN_ID' => $transaction->ID() ),
1481
+					array('action' => 'view_transaction', 'TXN_ID' => $transaction->ID()),
1482 1482
 					TXN_ADMIN_URL
1483 1483
 				),
1484
-				esc_html__( ' View Transaction' ),
1484
+				esc_html__(' View Transaction'),
1485 1485
 				'button secondary-button right',
1486 1486
 				'dashicons dashicons-cart'
1487 1487
 			)
@@ -1501,59 +1501,59 @@  discard block
 block discarded – undo
1501 1501
 					),
1502 1502
 					REG_ADMIN_URL
1503 1503
 				),
1504
-				esc_html__( ' Resend Registration' ),
1504
+				esc_html__(' Resend Registration'),
1505 1505
 				'button secondary-button right',
1506 1506
 				'dashicons dashicons-email-alt'
1507 1507
 			)
1508 1508
 			: '';
1509 1509
 
1510 1510
 		$this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
1511
-		$payment = $transaction->get_first_related( 'Payment' );
1511
+		$payment = $transaction->get_first_related('Payment');
1512 1512
 		$payment = ! $payment instanceof EE_Payment ? EE_Payment::new_instance() : $payment;
1513
-		$payment_method = $payment->get_first_related( 'Payment_Method' );
1513
+		$payment_method = $payment->get_first_related('Payment_Method');
1514 1514
 		$payment_method = ! $payment_method instanceof EE_Payment_Method ? EE_Payment_Method::new_instance() : $payment_method;
1515
-		$reg_status_class = 'status-' . $this->_registration->status_ID();
1515
+		$reg_status_class = 'status-'.$this->_registration->status_ID();
1516 1516
 		$reg_details = array(
1517 1517
 			'payment_method' => $payment_method->name(),
1518 1518
 			'response_msg' => $payment->gateway_response(),
1519
-			'registration_id' => $this->_registration->get( 'REG_code' ),
1519
+			'registration_id' => $this->_registration->get('REG_code'),
1520 1520
 			'registration_session' => $this->_registration->session_ID(),
1521
-			'ip_address' => isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '',
1522
-			'user_agent' => isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '',
1521
+			'ip_address' => isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '',
1522
+			'user_agent' => isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '',
1523 1523
 			);
1524 1524
 
1525 1525
 
1526
-		if ( isset( $reg_details['registration_id'] )) {
1526
+		if (isset($reg_details['registration_id'])) {
1527 1527
 			$this->_template_args['reg_details']['registration_id']['value'] = $reg_details['registration_id'];
1528
-			$this->_template_args['reg_details']['registration_id']['label'] = __( 'Registration ID', 'event_espresso' );
1528
+			$this->_template_args['reg_details']['registration_id']['label'] = __('Registration ID', 'event_espresso');
1529 1529
 			$this->_template_args['reg_details']['registration_id']['class'] = 'regular-text';
1530 1530
 		}
1531 1531
 
1532
-		if ( isset( $reg_details['payment_method'] ) ) {
1532
+		if (isset($reg_details['payment_method'])) {
1533 1533
 			$this->_template_args['reg_details']['payment_method']['value'] = $reg_details['payment_method'];
1534
-			$this->_template_args['reg_details']['payment_method']['label'] = __( 'Most Recent Payment Method', 'event_espresso' );
1534
+			$this->_template_args['reg_details']['payment_method']['label'] = __('Most Recent Payment Method', 'event_espresso');
1535 1535
 			$this->_template_args['reg_details']['payment_method']['class'] = 'regular-text';
1536 1536
 			$this->_template_args['reg_details']['response_msg']['value'] = $reg_details['response_msg'];
1537
-			$this->_template_args['reg_details']['response_msg']['label'] = __( 'Payment method response', 'event_espresso' );
1537
+			$this->_template_args['reg_details']['response_msg']['label'] = __('Payment method response', 'event_espresso');
1538 1538
 			$this->_template_args['reg_details']['response_msg']['class'] = 'regular-text';
1539 1539
 		}
1540 1540
 
1541 1541
 		$this->_template_args['reg_details']['registration_session']['value'] = $reg_details['registration_session'];
1542
-		$this->_template_args['reg_details']['registration_session']['label'] = __( 'Registration Session', 'event_espresso' );
1542
+		$this->_template_args['reg_details']['registration_session']['label'] = __('Registration Session', 'event_espresso');
1543 1543
 		$this->_template_args['reg_details']['registration_session']['class'] = 'regular-text';
1544 1544
 
1545 1545
 		$this->_template_args['reg_details']['ip_address']['value'] = $reg_details['ip_address'];
1546
-		$this->_template_args['reg_details']['ip_address']['label'] = __( 'Registration placed from IP', 'event_espresso' );
1546
+		$this->_template_args['reg_details']['ip_address']['label'] = __('Registration placed from IP', 'event_espresso');
1547 1547
 		$this->_template_args['reg_details']['ip_address']['class'] = 'regular-text';
1548 1548
 
1549 1549
 		$this->_template_args['reg_details']['user_agent']['value'] = $reg_details['user_agent'];
1550
-		$this->_template_args['reg_details']['user_agent']['label'] = __( 'Registrant User Agent', 'event_espresso' );
1550
+		$this->_template_args['reg_details']['user_agent']['label'] = __('Registrant User Agent', 'event_espresso');
1551 1551
 		$this->_template_args['reg_details']['user_agent']['class'] = 'large-text';
1552 1552
 
1553
-		$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'event_id' => $this->_registration->event_ID()), REG_ADMIN_URL );
1553
+		$this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $this->_registration->event_ID()), REG_ADMIN_URL);
1554 1554
 
1555
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_details.template.php';
1556
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1555
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_details.template.php';
1556
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1557 1557
 
1558 1558
 	}
1559 1559
 
@@ -1567,14 +1567,14 @@  discard block
 block discarded – undo
1567 1567
 	*/
1568 1568
 	public function _reg_questions_meta_box() {
1569 1569
 		//allow someone to override this method entirely
1570
-		if( apply_filters( 'FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration ) ) {
1571
-			$form = $this->_get_reg_custom_questions_form( $this->_registration->ID() );
1572
-			$this->_template_args[ 'att_questions' ] = count( $form->subforms() ) > 0 ? $form->get_html_and_js() : '';
1570
+		if (apply_filters('FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration)) {
1571
+			$form = $this->_get_reg_custom_questions_form($this->_registration->ID());
1572
+			$this->_template_args['att_questions'] = count($form->subforms()) > 0 ? $form->get_html_and_js() : '';
1573 1573
 			$this->_template_args['reg_questions_form_action'] = 'edit_registration';
1574 1574
 			$this->_template_args['REG_ID'] = $this->_registration->ID();
1575 1575
 
1576
-			$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_questions.template.php';
1577
-			echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1576
+			$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_questions.template.php';
1577
+			echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1578 1578
 		}
1579 1579
 	}
1580 1580
 
@@ -1588,12 +1588,12 @@  discard block
 block discarded – undo
1588 1588
 	 * @param        string $output
1589 1589
 	 * @return        string
1590 1590
 	 */
1591
-	public function form_before_question_group( $output ) {
1591
+	public function form_before_question_group($output) {
1592 1592
 		EE_Error::doing_it_wrong(
1593
-			__CLASS__ . '::' . __FUNCTION__,
1594
-			__( 'This method would have been protected but was used on a filter callback'
1593
+			__CLASS__.'::'.__FUNCTION__,
1594
+			__('This method would have been protected but was used on a filter callback'
1595 1595
 				. 'so needed to be public. Please discontinue usage as it will be removed soon.',
1596
-				'event_espresso' ),
1596
+				'event_espresso'),
1597 1597
 			'4.8.32.rc.000'
1598 1598
 		);
1599 1599
 		return '
@@ -1612,20 +1612,20 @@  discard block
 block discarded – undo
1612 1612
 	 * @param        string $output
1613 1613
 	 * @return        string
1614 1614
 	 */
1615
-	public function form_after_question_group( $output ) {
1615
+	public function form_after_question_group($output) {
1616 1616
 		EE_Error::doing_it_wrong(
1617
-			__CLASS__ . '::' . __FUNCTION__,
1618
-			__( 'This method would have been protected but was used on a filter callback'
1617
+			__CLASS__.'::'.__FUNCTION__,
1618
+			__('This method would have been protected but was used on a filter callback'
1619 1619
 				. 'so needed to be public. Please discontinue usage as it will be removed soon.',
1620
-				'event_espresso' ),
1620
+				'event_espresso'),
1621 1621
 			'4.8.32.rc.000'
1622 1622
 		);
1623 1623
 		return  '
1624 1624
 			<tr class="hide-if-no-js">
1625 1625
 				<th> </th>
1626 1626
 				<td class="reg-admin-edit-attendee-question-td">
1627
-					<a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__( 'click to edit question', 'event_espresso' ) . '">
1628
-						<span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __( 'edit the above question group', 'event_espresso' ) . '</span>
1627
+					<a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__('click to edit question', 'event_espresso').'">
1628
+						<span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __('edit the above question group', 'event_espresso').'</span>
1629 1629
 						<div class="dashicons dashicons-edit"></div>
1630 1630
 					</a>
1631 1631
 				</td>
@@ -1645,18 +1645,18 @@  discard block
 block discarded – undo
1645 1645
 	 * @param        string $label
1646 1646
 	 * @return        string
1647 1647
 	 */
1648
-	public function form_form_field_label_wrap( $label ) {
1648
+	public function form_form_field_label_wrap($label) {
1649 1649
 		EE_Error::doing_it_wrong(
1650
-			__CLASS__ . '::' . __FUNCTION__,
1651
-			__( 'This method would have been protected but was used on a filter callback'
1650
+			__CLASS__.'::'.__FUNCTION__,
1651
+			__('This method would have been protected but was used on a filter callback'
1652 1652
 				. 'so needed to be public. Please discontinue usage as it will be removed soon.',
1653
-				'event_espresso' ),
1653
+				'event_espresso'),
1654 1654
 			'4.8.32.rc.000'
1655 1655
 		);
1656 1656
 		return '
1657 1657
 			<tr>
1658 1658
 				<th>
1659
-					' . $label  . '
1659
+					' . $label.'
1660 1660
 				</th>';
1661 1661
 	}
1662 1662
 
@@ -1670,17 +1670,17 @@  discard block
 block discarded – undo
1670 1670
 	 * @param        string $input
1671 1671
 	 * @return        string
1672 1672
 	 */
1673
-	public function form_form_field_input__wrap( $input ) {
1673
+	public function form_form_field_input__wrap($input) {
1674 1674
 		EE_Error::doing_it_wrong(
1675
-			__CLASS__ . '::' . __FUNCTION__,
1676
-			__( 'This method would have been protected but was used on a filter callback'
1675
+			__CLASS__.'::'.__FUNCTION__,
1676
+			__('This method would have been protected but was used on a filter callback'
1677 1677
 				. 'so needed to be public. Please discontinue usage as it will be removed soon.',
1678
-				'event_espresso' ),
1678
+				'event_espresso'),
1679 1679
 			'4.8.32.rc.000'
1680 1680
 		);
1681 1681
 		return '
1682 1682
 				<td class="reg-admin-attendee-questions-input-td disabled-input">
1683
-					' . $input . '
1683
+					' . $input.'
1684 1684
 				</td>
1685 1685
 			</tr>';
1686 1686
 	}
@@ -1694,14 +1694,14 @@  discard block
 block discarded – undo
1694 1694
 	 * @return void
1695 1695
 	 */
1696 1696
 	protected function _update_attendee_registration_form() {
1697
-		do_action( 'AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', $this );
1698
-		if( $_SERVER['REQUEST_METHOD'] == 'POST'){
1699
-			$REG_ID = isset( $this->_req_data['_REG_ID'] ) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
1700
-			$success = $this->_save_reg_custom_questions_form( $REG_ID );
1701
-			if( $success ) {
1697
+		do_action('AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', $this);
1698
+		if ($_SERVER['REQUEST_METHOD'] == 'POST') {
1699
+			$REG_ID = isset($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : FALSE;
1700
+			$success = $this->_save_reg_custom_questions_form($REG_ID);
1701
+			if ($success) {
1702 1702
 				$what = __('Registration Form', 'event_espresso');
1703
-				$route = $REG_ID ? array( 'action' => 'view_registration', '_REG_ID' => $REG_ID ) : array( 'action' => 'default' );
1704
-				$this->_redirect_after_action( $success, $what, __('updated', 'event_espresso'), $route );
1703
+				$route = $REG_ID ? array('action' => 'view_registration', '_REG_ID' => $REG_ID) : array('action' => 'default');
1704
+				$this->_redirect_after_action($success, $what, __('updated', 'event_espresso'), $route);
1705 1705
 			}
1706 1706
 		}
1707 1707
 	}
@@ -1712,11 +1712,11 @@  discard block
 block discarded – undo
1712 1712
 	 * @param int $REG_ID
1713 1713
 	 * @return EE_Registration_Custom_Questions_Form
1714 1714
 	 */
1715
-	protected function _get_reg_custom_questions_form( $REG_ID ) {
1716
-		if( ! $this->_reg_custom_questions_form ) {
1717
-			require_once( REG_ADMIN . 'form_sections' . DS . 'EE_Registration_Custom_Questions_Form.form.php' );
1718
-			$this->_reg_custom_questions_form = new EE_Registration_Custom_Questions_Form( EEM_Registration::instance()->get_one_by_ID( $REG_ID ) );
1719
-			$this->_reg_custom_questions_form->_construct_finalize( null, null );
1715
+	protected function _get_reg_custom_questions_form($REG_ID) {
1716
+		if ( ! $this->_reg_custom_questions_form) {
1717
+			require_once(REG_ADMIN.'form_sections'.DS.'EE_Registration_Custom_Questions_Form.form.php');
1718
+			$this->_reg_custom_questions_form = new EE_Registration_Custom_Questions_Form(EEM_Registration::instance()->get_one_by_ID($REG_ID));
1719
+			$this->_reg_custom_questions_form->_construct_finalize(null, null);
1720 1720
 		}
1721 1721
 		return $this->_reg_custom_questions_form;
1722 1722
 	}
@@ -1729,17 +1729,17 @@  discard block
 block discarded – undo
1729 1729
 	 * @param bool $REG_ID
1730 1730
 	 * @return bool
1731 1731
 	 */
1732
-	private function _save_reg_custom_questions_form( $REG_ID = FALSE ) {
1732
+	private function _save_reg_custom_questions_form($REG_ID = FALSE) {
1733 1733
 
1734 1734
 		if ( ! $REG_ID) {
1735
-			EE_Error::add_error( __('An error occurred. No registration ID was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1735
+			EE_Error::add_error(__('An error occurred. No registration ID was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1736 1736
 		}
1737
-		$form = $this->_get_reg_custom_questions_form( $REG_ID );
1738
-		$form->receive_form_submission( $this->_req_data );
1737
+		$form = $this->_get_reg_custom_questions_form($REG_ID);
1738
+		$form->receive_form_submission($this->_req_data);
1739 1739
 		$success = false;
1740
-		if( $form->is_valid() ) {
1741
-			foreach( $form->subforms() as $question_group_id => $question_group_form ) {
1742
-				foreach( $question_group_form->inputs() as $question_id => $input ) {
1740
+		if ($form->is_valid()) {
1741
+			foreach ($form->subforms() as $question_group_id => $question_group_form) {
1742
+				foreach ($question_group_form->inputs() as $question_id => $input) {
1743 1743
 					$where_conditions = array(
1744 1744
 							'QST_ID' => $question_id,
1745 1745
 							'REG_ID' => $REG_ID
@@ -1747,19 +1747,19 @@  discard block
 block discarded – undo
1747 1747
 					$possibly_new_values = array(
1748 1748
 							'ANS_value' => $input->normalized_value()
1749 1749
 						);
1750
-					$answer = EEM_Answer::instance()->get_one( array( $where_conditions ) );
1751
-					if( $answer instanceof EE_Answer ) {
1752
-						$success = $answer->save( $possibly_new_values );
1750
+					$answer = EEM_Answer::instance()->get_one(array($where_conditions));
1751
+					if ($answer instanceof EE_Answer) {
1752
+						$success = $answer->save($possibly_new_values);
1753 1753
 					} else {
1754 1754
 						//insert it then
1755
-						$cols_n_vals = array_merge( $where_conditions, $possibly_new_values );
1756
-						$answer = EE_Answer::new_instance( $cols_n_vals );
1755
+						$cols_n_vals = array_merge($where_conditions, $possibly_new_values);
1756
+						$answer = EE_Answer::new_instance($cols_n_vals);
1757 1757
 						$success = $answer->save();
1758 1758
 					}
1759 1759
 				}
1760 1760
 			}
1761 1761
 		} else {
1762
-			EE_Error::add_error( $form->get_validation_error_string(), __FILE__, __FUNCTION__, __LINE__ );
1762
+			EE_Error::add_error($form->get_validation_error_string(), __FILE__, __FUNCTION__, __LINE__);
1763 1763
 		}
1764 1764
 		return $success;
1765 1765
 	}
@@ -1777,31 +1777,31 @@  discard block
 block discarded – undo
1777 1777
 		$registrations = $REG->get_all(array(
1778 1778
 			array(
1779 1779
 				'TXN_ID'=>$this->_registration->transaction_ID(),
1780
-				'REG_ID'=>array('!=',$this->_registration->ID())
1780
+				'REG_ID'=>array('!=', $this->_registration->ID())
1781 1781
 			),
1782 1782
 			'force_join'=>array('Attendee')));
1783 1783
 
1784 1784
 		$this->_template_args['attendees'] = array();
1785 1785
 		$this->_template_args['attendee_notice'] = '';
1786
-		if ( empty( $registrations)  || ( is_array($registrations) &&  ! EEH_Array::get_one_item_from_array($registrations) ) ) {
1787
-			EE_Error::add_error( __('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1786
+		if (empty($registrations) || (is_array($registrations) && ! EEH_Array::get_one_item_from_array($registrations))) {
1787
+			EE_Error::add_error(__('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1788 1788
 			$this->_template_args['attendee_notice'] = EE_Error::get_notices();
1789 1789
 		} else {
1790 1790
 
1791 1791
 			$att_nmbr = 1;
1792
-			foreach ( $registrations as $registration ) {
1792
+			foreach ($registrations as $registration) {
1793 1793
 				/* @var $registration EE_Registration */
1794 1794
 				$attendee = $registration->attendee() ? $registration->attendee() : EEM_Attendee::instance()->create_default_object();
1795
-				$this->_template_args['attendees'][ $att_nmbr ]['STS_ID'] = $registration->status_ID();
1796
-				$this->_template_args['attendees'][ $att_nmbr ]['fname'] = $attendee->fname();//( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : '';
1797
-				$this->_template_args['attendees'][ $att_nmbr ]['lname'] = $attendee->lname();//( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : '';
1798
-				$this->_template_args['attendees'][ $att_nmbr ]['email'] = $attendee->email();//( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : '';
1799
-				$this->_template_args['attendees'][ $att_nmbr ]['final_price'] = $registration->final_price();//( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : '';
1795
+				$this->_template_args['attendees'][$att_nmbr]['STS_ID'] = $registration->status_ID();
1796
+				$this->_template_args['attendees'][$att_nmbr]['fname'] = $attendee->fname(); //( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : '';
1797
+				$this->_template_args['attendees'][$att_nmbr]['lname'] = $attendee->lname(); //( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : '';
1798
+				$this->_template_args['attendees'][$att_nmbr]['email'] = $attendee->email(); //( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : '';
1799
+				$this->_template_args['attendees'][$att_nmbr]['final_price'] = $registration->final_price(); //( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : '';
1800 1800
 
1801
-				$this->_template_args['attendees'][ $att_nmbr ]['address'] = implode( ', ', $attendee->full_address_as_array() );
1801
+				$this->_template_args['attendees'][$att_nmbr]['address'] = implode(', ', $attendee->full_address_as_array());
1802 1802
 
1803
-				$this->_template_args['attendees'][ $att_nmbr ]['att_link'] = self::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL );
1804
-				$this->_template_args['attendees'][ $att_nmbr ]['event_name'] = $registration->event_obj()->name();
1803
+				$this->_template_args['attendees'][$att_nmbr]['att_link'] = self::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL);
1804
+				$this->_template_args['attendees'][$att_nmbr]['event_name'] = $registration->event_obj()->name();
1805 1805
 
1806 1806
 				$att_nmbr++;
1807 1807
 			}
@@ -1811,8 +1811,8 @@  discard block
 block discarded – undo
1811 1811
 
1812 1812
 	//			$this->_template_args['registration_form_url'] = add_query_arg( array( 'action' => 'edit_registration', 'process' => 'attendees'  ), REG_ADMIN_URL );
1813 1813
 		}
1814
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_attendees.template.php';
1815
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1814
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_attendees.template.php';
1815
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1816 1816
 
1817 1817
 	}
1818 1818
 
@@ -1833,14 +1833,14 @@  discard block
 block discarded – undo
1833 1833
 		$attendee = $att_check instanceof EE_Attendee ? $att_check : EEM_Attendee::instance()->create_default_object();
1834 1834
 
1835 1835
 		//now let's determine if this is not the primary registration.  If it isn't then we set the primary_registration object for reference BUT ONLY if the Attendee object loaded is not the same as the primary registration object (that way we know if we need to show create button or not)
1836
-		if ( ! $this->_registration->is_primary_registrant() ) {
1836
+		if ( ! $this->_registration->is_primary_registrant()) {
1837 1837
 
1838 1838
 			$primary_registration = $this->_registration->get_primary_registration();
1839 1839
 			$primary_attendee = $primary_registration instanceof EE_Registration
1840 1840
 				? $primary_registration->attendee()
1841 1841
 				: null;
1842 1842
 
1843
-			if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID() ) {
1843
+			if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID()) {
1844 1844
 				//in here?  This means the displayed registration is not the primary registrant but ALREADY HAS its own custom attendee object so let's not worry about the primary reg.
1845 1845
 				$primary_registration = NULL;
1846 1846
 			}
@@ -1849,27 +1849,27 @@  discard block
 block discarded – undo
1849 1849
 		}
1850 1850
 
1851 1851
 		$this->_template_args['ATT_ID'] = $attendee->ID();
1852
-		$this->_template_args['fname'] = $attendee->fname();//$this->_registration->ATT_fname;
1853
-		$this->_template_args['lname'] = $attendee->lname();//$this->_registration->ATT_lname;
1854
-		$this->_template_args['email'] = $attendee->email();//$this->_registration->ATT_email;
1852
+		$this->_template_args['fname'] = $attendee->fname(); //$this->_registration->ATT_fname;
1853
+		$this->_template_args['lname'] = $attendee->lname(); //$this->_registration->ATT_lname;
1854
+		$this->_template_args['email'] = $attendee->email(); //$this->_registration->ATT_email;
1855 1855
 		$this->_template_args['phone'] = $attendee->phone();
1856 1856
 
1857
-		$this->_template_args[ 'formatted_address' ] = EEH_Address::format( $attendee );
1857
+		$this->_template_args['formatted_address'] = EEH_Address::format($attendee);
1858 1858
 
1859 1859
 
1860 1860
 		//edit link
1861
-		$this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL );
1861
+		$this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL);
1862 1862
 		$this->_template_args['att_edit_label'] = __('View/Edit Contact', 'event_espresso');
1863 1863
 
1864 1864
 		//create link
1865
-		$this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'duplicate_attendee',  '_REG_ID' => $this->_registration->ID() ), REG_ADMIN_URL ): '';
1865
+		$this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'duplicate_attendee', '_REG_ID' => $this->_registration->ID()), REG_ADMIN_URL) : '';
1866 1866
 		$this->_template_args['create_label'] = __('Create Contact', 'event_espresso');
1867 1867
 
1868 1868
 		$this->_template_args['att_check'] = $att_check;
1869 1869
 
1870 1870
 
1871
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_side_meta_box_registrant.template.php';
1872
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1871
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_side_meta_box_registrant.template.php';
1872
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1873 1873
 	}
1874 1874
 
1875 1875
 
@@ -1882,7 +1882,7 @@  discard block
 block discarded – undo
1882 1882
 	 * @access protected
1883 1883
 	 * @return void
1884 1884
 	 */
1885
-	protected function _trash_or_restore_registrations( $trash = TRUE ) {
1885
+	protected function _trash_or_restore_registrations($trash = TRUE) {
1886 1886
 		$REGM = EEM_Registration::instance();
1887 1887
 
1888 1888
 		$success = 1;
@@ -1892,26 +1892,26 @@  discard block
 block discarded – undo
1892 1892
 		$dtts = array();
1893 1893
 
1894 1894
 		//if empty _REG_ID then get out because there's nothing to do
1895
-		if ( empty( $this->_req_data['_REG_ID'] ) ) {
1895
+		if (empty($this->_req_data['_REG_ID'])) {
1896 1896
 			$msg = $trash ? __('In order to trash registrations you must select which ones you wish to trash by clicking the checkboxes.', 'event_espresso') : __('In order to restore registrations you must select which ones you wish to restore by clicking the checkboxes.', 'event_espresso');
1897
-			EE_Error::add_error( $msg, __FILE__, __LINE__, __FUNCTION__ );
1898
-			$this->_redirect_after_action(FALSE, '', '', array(), TRUE );
1897
+			EE_Error::add_error($msg, __FILE__, __LINE__, __FUNCTION__);
1898
+			$this->_redirect_after_action(FALSE, '', '', array(), TRUE);
1899 1899
 		}
1900 1900
 
1901 1901
 		//Checkboxes
1902
-		if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1902
+		if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1903 1903
 			// if array has more than one element than success message should be plural
1904
-			$success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1;
1904
+			$success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1;
1905 1905
 			// cycle thru checkboxes
1906
-			while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) {
1906
+			while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) {
1907 1907
 				/** @var EE_Registration $REG */
1908
-				$REG = $REGM->get_one_by_ID( $REG_ID);
1908
+				$REG = $REGM->get_one_by_ID($REG_ID);
1909 1909
 				$payment_count = $REG->get_first_related('Transaction')->count_related('Payment');
1910
-				if ( $payment_count > 0 ) {
1911
-					$name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __( 'Unknown Attendee', 'event_espresso' );
1910
+				if ($payment_count > 0) {
1911
+					$name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __('Unknown Attendee', 'event_espresso');
1912 1912
 					$error = 1;
1913 1913
 					$success = 0;
1914
-					EE_Error::add_error( sprintf( __('The registration for %s could not be trashed because it has payments attached to the related transaction.  If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name ), __FILE__, __FUNCTION__, __LINE__ );
1914
+					EE_Error::add_error(sprintf(__('The registration for %s could not be trashed because it has payments attached to the related transaction.  If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name), __FILE__, __FUNCTION__, __LINE__);
1915 1915
 					continue; //can't trash this registration because it has payments.
1916 1916
 				}
1917 1917
 				$ticket = $REG->get_first_related('Ticket');
@@ -1920,7 +1920,7 @@  discard block
 block discarded – undo
1920 1920
 				$dtts = array_merge($dtts, $dtt);
1921 1921
 
1922 1922
 				$updated = $trash ? $REG->delete() : $REG->restore();
1923
-				if ( !$updated ) {
1923
+				if ( ! $updated) {
1924 1924
 					$success = 0;
1925 1925
 				} else {
1926 1926
 					$success = 2;
@@ -1935,7 +1935,7 @@  discard block
 block discarded – undo
1935 1935
 			$tickets[$ticket->ID()] = $ticket;
1936 1936
 			$dtts = $ticket->get_many_related('Datetime');
1937 1937
 			$updated = $trash ? $REG->delete() : $REG->restore();
1938
-			if ( ! $updated ) {
1938
+			if ( ! $updated) {
1939 1939
 				$success = 0;
1940 1940
 			}
1941 1941
 
@@ -1945,10 +1945,10 @@  discard block
 block discarded – undo
1945 1945
 		EEM_Ticket::instance()->update_tickets_sold($tickets);
1946 1946
 		EEM_Datetime::instance()->update_sold($dtts);
1947 1947
 
1948
-		$what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' );
1949
-		$action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' );
1948
+		$what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso');
1949
+		$action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso');
1950 1950
 		$overwrite_msgs = $error ? TRUE : FALSE;
1951
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), $overwrite_msgs );
1951
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), $overwrite_msgs);
1952 1952
 	}
1953 1953
 
1954 1954
 
@@ -1972,16 +1972,16 @@  discard block
 block discarded – undo
1972 1972
 		$success = 1;
1973 1973
 
1974 1974
 		//Checkboxes
1975
-		if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1975
+		if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1976 1976
 			// if array has more than one element than success message should be plural
1977
-			$success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1;
1977
+			$success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1;
1978 1978
 			// cycle thru checkboxes
1979
-			while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) {
1979
+			while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) {
1980 1980
 				$REG = $REG_MDL->get_one_by_ID($REG_ID);
1981
-				if ( ! $REG instanceof EE_Registration )
1981
+				if ( ! $REG instanceof EE_Registration)
1982 1982
 					continue;
1983 1983
 				$deleted = $this->_delete_registration($REG);
1984
-				if ( !$deleted ) {
1984
+				if ( ! $deleted) {
1985 1985
 					$success = 0;
1986 1986
 				}
1987 1987
 			}
@@ -1991,15 +1991,15 @@  discard block
 block discarded – undo
1991 1991
 			$REG_ID = $this->_req_data['_REG_ID'];
1992 1992
 			$REG = $REG_MDL->get_one_by_ID($REG_ID);
1993 1993
 			$deleted = $this->_delete_registration($REG);
1994
-			if ( ! $deleted ) {
1994
+			if ( ! $deleted) {
1995 1995
 				$success = 0;
1996 1996
 			}
1997 1997
 
1998 1998
 		}
1999 1999
 
2000
-		$what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' );
2001
-		$action_desc = __( 'permanently deleted.', 'event_espresso' );
2002
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), TRUE );
2000
+		$what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso');
2001
+		$action_desc = __('permanently deleted.', 'event_espresso');
2002
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), TRUE);
2003 2003
 	}
2004 2004
 
2005 2005
 
@@ -2011,31 +2011,31 @@  discard block
 block discarded – undo
2011 2011
 	 * @param  EE_Registration $REG registration to be deleted permenantly
2012 2012
 	 * @return boolean              true = successful deletion, false = fail.
2013 2013
 	 */
2014
-	protected function _delete_registration( EE_Registration $REG ) {
2014
+	protected function _delete_registration(EE_Registration $REG) {
2015 2015
 		//first we start with the transaction... ultimately, we WILL not delete permanently if there are any related registrations on the transaction that are NOT trashed.
2016 2016
 		$TXN = $REG->get_first_related('Transaction');
2017 2017
 		$REGS = $TXN->get_many_related('Registration');
2018 2018
 
2019 2019
 		$all_trashed = TRUE;
2020
-		foreach ( $REGS as $registration ) {
2021
-			if ( ! $registration->get('REG_deleted') )
2020
+		foreach ($REGS as $registration) {
2021
+			if ( ! $registration->get('REG_deleted'))
2022 2022
 				$all_trashed = FALSE;
2023 2023
 		}
2024 2024
 
2025
-		if ( ! $all_trashed ) {
2026
-			EE_Error::add_error( __('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well.  These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
2025
+		if ( ! $all_trashed) {
2026
+			EE_Error::add_error(__('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well.  These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
2027 2027
 			return false;
2028 2028
 		}
2029 2029
 
2030 2030
 		//k made it here so that means we can delete all the related transactions and their answers (but let's do them separately from THIS one).
2031
-		foreach ( $REGS as $registration ) {
2031
+		foreach ($REGS as $registration) {
2032 2032
 
2033 2033
 			//delete related answers
2034 2034
 			$registration->delete_related_permanently('Answer');
2035 2035
 
2036 2036
 			//remove relationship to EE_Attendee (but we ALWAYS leave the contact record intact)
2037 2037
 			$attendee = $registration->get_first_related('Attendee');
2038
-			if ( $attendee instanceof EE_Attendee ) {
2038
+			if ($attendee instanceof EE_Attendee) {
2039 2039
 				$registration->_remove_relation_to($attendee, 'Attendee');
2040 2040
 			}
2041 2041
 
@@ -2045,7 +2045,7 @@  discard block
 block discarded – undo
2045 2045
 			//now delete permanently the checkins related to this registration.
2046 2046
 			$registration->delete_related_permanently('Checkin');
2047 2047
 
2048
-			if ( $registration->ID() === $REG->ID() )
2048
+			if ($registration->ID() === $REG->ID())
2049 2049
 				continue; //we don't want to delete permanently the existing registration just yet.
2050 2050
 
2051 2051
 			//remove relation to transaction for these registrations if NOT the existing registrations
@@ -2078,35 +2078,35 @@  discard block
 block discarded – undo
2078 2078
 	 * @return void
2079 2079
 	 */
2080 2080
 	public function new_registration() {
2081
-		if ( ! $this->_set_reg_event() ) {
2082
-			throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso') );
2081
+		if ( ! $this->_set_reg_event()) {
2082
+			throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso'));
2083 2083
 		}
2084
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
2084
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
2085 2085
 		// gotta start with a clean slate if we're not coming here via ajax
2086 2086
 		if (
2087
-			! defined('DOING_AJAX' )
2088
-			&& ( ! isset( $this->_req_data['processing_registration'] ) || isset( $this->_req_data['step_error'] ) )
2087
+			! defined('DOING_AJAX')
2088
+			&& ( ! isset($this->_req_data['processing_registration']) || isset($this->_req_data['step_error']))
2089 2089
 		) {
2090
-			EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
2090
+			EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
2091 2091
 		}
2092 2092
 
2093
-		$this->_template_args['event_name'] = '' ;
2093
+		$this->_template_args['event_name'] = '';
2094 2094
 		// event name
2095
-		if ( $this->_reg_event ) {
2095
+		if ($this->_reg_event) {
2096 2096
 			$this->_template_args['event_name'] = $this->_reg_event->name();
2097
-			$edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$this->_reg_event->ID() ), EVENTS_ADMIN_URL );
2098
-			$edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $this->_reg_event->name() . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>';
2099
-			$this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ;
2097
+			$edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$this->_reg_event->ID()), EVENTS_ADMIN_URL);
2098
+			$edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$this->_reg_event->name().'">'.__('Edit Event', 'event_espresso').'</a>';
2099
+			$this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>';
2100 2100
 		}
2101 2101
 
2102 2102
 		$this->_template_args['step_content'] = $this->_get_registration_step_content();
2103 2103
 
2104
-		if ( defined('DOING_AJAX' ) ) {
2104
+		if (defined('DOING_AJAX')) {
2105 2105
 			$this->_return_json();
2106 2106
 		}
2107 2107
 		// grab header
2108
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee.template.php';
2109
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
2108
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_register_new_attendee.template.php';
2109
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
2110 2110
 
2111 2111
 		//$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
2112 2112
 		// the details template wrapper
@@ -2123,7 +2123,7 @@  discard block
 block discarded – undo
2123 2123
 	 * @return string html
2124 2124
 	 */
2125 2125
 	protected function _get_registration_step_content() {
2126
-		if ( isset( $_COOKIE[ 'ee_registration_added' ] ) && $_COOKIE[ 'ee_registration_added' ] ) {
2126
+		if (isset($_COOKIE['ee_registration_added']) && $_COOKIE['ee_registration_added']) {
2127 2127
 			$warning_msg = sprintf(
2128 2128
 				__(
2129 2129
 					'%2$sWARNING!!!%3$s%1$sPlease do not use the back button to return to this page for the purpose of adding another registration.%1$sThis can result in lost and/or corrupted data.%1$sIf you wish to add another registration, then please click the%1$s%7$s"Add Another New Registration to Event"%8$s button%1$son the Transaction details page, after you are redirected.%1$s%1$s%4$s redirecting in %5$s seconds %6$s',
@@ -2139,7 +2139,7 @@  discard block
 block discarded – undo
2139 2139
 				'</b>'
2140 2140
 			);
2141 2141
 			return '
2142
-	<div id="ee-add-reg-back-button-dv"><p>' . $warning_msg . '</p></div>
2142
+	<div id="ee-add-reg-back-button-dv"><p>' . $warning_msg.'</p></div>
2143 2143
 	<script >
2144 2144
 		// WHOAH !!! it appears that someone is using the back button from the Transaction admin page
2145 2145
 		// after just adding a new registration... we gotta try to put a stop to that !!!
@@ -2174,16 +2174,16 @@  discard block
 block discarded – undo
2174 2174
 		$cart = EE_Registry::instance()->SSN->cart();
2175 2175
 		$step = ! $cart instanceof EE_Cart ? 'ticket' : 'questions';
2176 2176
 
2177
-		switch ( $step ) {
2177
+		switch ($step) {
2178 2178
 			case 'ticket' :
2179 2179
 				$hidden_fields['processing_registration']['value'] = 1;
2180 2180
 				$template_args['title'] = __('Step One: Select the Ticket for this registration', 'event_espresso');
2181
-				$template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector( $this->_reg_event );
2181
+				$template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector($this->_reg_event);
2182 2182
 				$template_args['step_button_text'] = __('Add Tickets and Continue to Registrant Details', 'event_espresso');
2183 2183
 				$template_args['show_notification_toggle'] = FALSE;
2184 2184
 				break;
2185 2185
 			case 'questions' :
2186
-				$hidden_fields[ 'processing_registration' ][ 'value' ] = 2;
2186
+				$hidden_fields['processing_registration']['value'] = 2;
2187 2187
 				$template_args['title'] = __('Step Two: Add Registrant Details for this Registration', 'event_espresso');
2188 2188
 				//in theory we should be able to run EED_SPCO at this point because the cart should have been setup properly by the first process_reg_step run.
2189 2189
 				$template_args['content'] = EED_Single_Page_Checkout::registration_checkout_for_admin();
@@ -2192,10 +2192,10 @@  discard block
 block discarded – undo
2192 2192
 				break;
2193 2193
 		}
2194 2194
 
2195
-		$this->_set_add_edit_form_tags( 'process_reg_step', $hidden_fields ); //we come back to the process_registration_step route.
2195
+		$this->_set_add_edit_form_tags('process_reg_step', $hidden_fields); //we come back to the process_registration_step route.
2196 2196
 
2197 2197
 		return EEH_Template::display_template(
2198
-			REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee_step_content.template.php', $template_args, TRUE
2198
+			REG_TEMPLATE_PATH.'reg_admin_register_new_attendee_step_content.template.php', $template_args, TRUE
2199 2199
 		);
2200 2200
 	}
2201 2201
 
@@ -2210,11 +2210,11 @@  discard block
 block discarded – undo
2210 2210
 	*		@return boolean
2211 2211
 	*/
2212 2212
 	private function _set_reg_event() {
2213
-		if ( is_object( $this->_reg_event )) {
2213
+		if (is_object($this->_reg_event)) {
2214 2214
 			return TRUE;
2215 2215
 		}
2216
-		$EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE;
2217
-		if ( ! $EVT_ID ) {
2216
+		$EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE;
2217
+		if ( ! $EVT_ID) {
2218 2218
 			return FALSE;
2219 2219
 		}
2220 2220
 
@@ -2235,82 +2235,82 @@  discard block
 block discarded – undo
2235 2235
 	public function process_reg_step() {
2236 2236
 		EE_System::do_not_cache();
2237 2237
 		$this->_set_reg_event();
2238
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
2238
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
2239 2239
 
2240 2240
 		//what step are we on?
2241 2241
 		$cart = EE_Registry::instance()->SSN->cart();
2242 2242
 		$step = ! $cart instanceof EE_Cart ? 'ticket' : 'questions';
2243 2243
 
2244 2244
 		//if doing ajax then we need to verify the nonce
2245
-		if ( defined( 'DOING_AJAX' ) ) {
2246
-			$nonce = isset( $this->_req_data[$this->_req_nonce] ) ? sanitize_text_field( $this->_req_data[$this->_req_nonce] ) : '';
2247
-			$this->_verify_nonce( $nonce, $this->_req_nonce );
2245
+		if (defined('DOING_AJAX')) {
2246
+			$nonce = isset($this->_req_data[$this->_req_nonce]) ? sanitize_text_field($this->_req_data[$this->_req_nonce]) : '';
2247
+			$this->_verify_nonce($nonce, $this->_req_nonce);
2248 2248
 		}
2249 2249
 
2250
-		switch ( $step ) {
2250
+		switch ($step) {
2251 2251
 
2252 2252
 			case 'ticket' :
2253 2253
 				//process ticket selection
2254 2254
 				$success = EED_Ticket_Selector::instance()->process_ticket_selections();
2255
-				if ( $success ) {
2256
-					EE_Error::add_success( __('Tickets Selected. Now complete the registration.'), 'event_espresso');
2255
+				if ($success) {
2256
+					EE_Error::add_success(__('Tickets Selected. Now complete the registration.'), 'event_espresso');
2257 2257
 				} else {
2258 2258
 					$query_args['step_error'] = $this->_req_data['step_error'] = TRUE;
2259 2259
 				}
2260
-				if ( defined('DOING_AJAX') ) {
2260
+				if (defined('DOING_AJAX')) {
2261 2261
 					$this->new_registration(); //display next step
2262 2262
 				} else {
2263 2263
 					$query_args['action'] = 'new_registration';
2264 2264
 					$query_args['processing_registration'] = 1;
2265 2265
 					$query_args['event_id'] = $this->_reg_event->ID();
2266
-					$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
2266
+					$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2267 2267
 				}
2268 2268
 				break;
2269 2269
 
2270 2270
 			case 'questions' :
2271
-				if( ! isset( $this->_req_data[ 'txn_reg_status_change' ], $this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ] ) ) {
2272
-					add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15 );
2271
+				if ( ! isset($this->_req_data['txn_reg_status_change'], $this->_req_data['txn_reg_status_change']['send_notifications'])) {
2272
+					add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15);
2273 2273
 				}
2274 2274
 				//process registration
2275 2275
 				$transaction = EED_Single_Page_Checkout::instance()->process_registration_from_admin();
2276
-				if ( $cart instanceof EE_Cart ) {
2276
+				if ($cart instanceof EE_Cart) {
2277 2277
 					$grand_total = $cart->get_cart_grand_total();
2278
-					if ( $grand_total instanceof EE_Line_Item ) {
2278
+					if ($grand_total instanceof EE_Line_Item) {
2279 2279
 						$grand_total->save_this_and_descendants_to_txn();
2280 2280
 					}
2281 2281
 				}
2282
-				if ( ! $transaction instanceof EE_Transaction ) {
2282
+				if ( ! $transaction instanceof EE_Transaction) {
2283 2283
 					$query_args = array(
2284 2284
 						'action' => 'new_registration',
2285 2285
 						'processing_registration' => 2,
2286 2286
 						'event_id' => $this->_reg_event->ID()
2287 2287
 					);
2288 2288
 
2289
-					if ( defined('DOING_AJAX' )) {
2289
+					if (defined('DOING_AJAX')) {
2290 2290
 						//display registration form again because there are errors (maybe validation?)
2291 2291
 						$this->new_registration();
2292 2292
 						return;
2293 2293
 					} else {
2294
-						$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
2294
+						$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2295 2295
 						return;
2296 2296
 					}
2297 2297
 				}
2298 2298
 				/** @type EE_Transaction_Payments $transaction_payments */
2299
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
2299
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
2300 2300
 				// maybe update status, and make sure to save transaction if not done already
2301
-				if ( ! $transaction_payments->update_transaction_status_based_on_total_paid( $transaction )) {
2301
+				if ( ! $transaction_payments->update_transaction_status_based_on_total_paid($transaction)) {
2302 2302
 					$transaction->save();
2303 2303
 				}
2304
-				EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
2304
+				EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
2305 2305
 				$this->_req_data = array();
2306 2306
 				$query_args = array(
2307 2307
 					'action'        => 'redirect_to_txn',
2308 2308
 					'TXN_ID'        => $transaction->ID(),
2309 2309
 					'EVT_ID'        => $this->_reg_event->ID(),
2310
-					'event_name'    => urlencode( $this->_reg_event->name() ),
2310
+					'event_name'    => urlencode($this->_reg_event->name()),
2311 2311
 					'redirect_from' => 'new_registration'
2312 2312
 				);
2313
-				$this->_redirect_after_action( false, '', '', $query_args, true );
2313
+				$this->_redirect_after_action(false, '', '', $query_args, true);
2314 2314
 				break;
2315 2315
 		}
2316 2316
 
@@ -2327,21 +2327,21 @@  discard block
 block discarded – undo
2327 2327
 	 */
2328 2328
 	public function redirect_to_txn() {
2329 2329
 		EE_System::do_not_cache();
2330
-		EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
2330
+		EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
2331 2331
 		$query_args = array(
2332 2332
 			'action' => 'view_transaction',
2333
-			'TXN_ID' => isset( $this->_req_data['TXN_ID'] ) ? absint( $this->_req_data[ 'TXN_ID' ] )  : 0,
2333
+			'TXN_ID' => isset($this->_req_data['TXN_ID']) ? absint($this->_req_data['TXN_ID']) : 0,
2334 2334
 			'page'   => 'espresso_transactions'
2335 2335
 		);
2336
-		if ( isset( $this->_req_data[ 'EVT_ID' ], $this->_req_data[ 'redirect_from' ] ) ) {
2337
-			$query_args['EVT_ID'] = $this->_req_data[ 'EVT_ID' ];
2338
-			$query_args['event_name'] = urlencode( $this->_req_data[ 'event_name' ] );
2339
-			$query_args['redirect_from'] = $this->_req_data[ 'redirect_from' ];
2336
+		if (isset($this->_req_data['EVT_ID'], $this->_req_data['redirect_from'])) {
2337
+			$query_args['EVT_ID'] = $this->_req_data['EVT_ID'];
2338
+			$query_args['event_name'] = urlencode($this->_req_data['event_name']);
2339
+			$query_args['redirect_from'] = $this->_req_data['redirect_from'];
2340 2340
 		}
2341 2341
 		EE_Error::add_success(
2342
-			__( 'Registration Created.  Please review the transaction and add any payments as necessary', 'event_espresso' )
2342
+			__('Registration Created.  Please review the transaction and add any payments as necessary', 'event_espresso')
2343 2343
 		);
2344
-		$this->_redirect_after_action( false, '', '', $query_args, true );
2344
+		$this->_redirect_after_action(false, '', '', $query_args, true);
2345 2345
 	}
2346 2346
 
2347 2347
 
@@ -2352,7 +2352,7 @@  discard block
 block discarded – undo
2352 2352
 	*		@return void
2353 2353
 	*/
2354 2354
 	protected function _attendee_contact_list_table() {
2355
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2355
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2356 2356
 		$this->_search_btn_label = __('Contacts', 'event_espresso');
2357 2357
 		$this->display_admin_list_table_page_with_no_sidebar();
2358 2358
 	}
@@ -2367,10 +2367,10 @@  discard block
 block discarded – undo
2367 2367
 	*		@access public
2368 2368
 	*		@return array
2369 2369
 	*/
2370
-	public function get_attendees( $per_page, $count = FALSE, $trash = FALSE ) {
2370
+	public function get_attendees($per_page, $count = FALSE, $trash = FALSE) {
2371 2371
 
2372
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2373
-		require_once( REG_ADMIN . 'EE_Attendee_Contact_List_Table.class.php' );
2372
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2373
+		require_once(REG_ADMIN.'EE_Attendee_Contact_List_Table.class.php');
2374 2374
 		$ATT_MDL = EEM_Attendee::instance();
2375 2375
 
2376 2376
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
@@ -2398,47 +2398,47 @@  discard block
 block discarded – undo
2398 2398
 				$orderby = 'ATT_lname';
2399 2399
 		}
2400 2400
 
2401
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC';
2401
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC';
2402 2402
 
2403
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
2404
-		$per_page = isset( $per_page ) && !empty( $per_page ) ? $per_page : 10;
2405
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
2403
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
2404
+		$per_page = isset($per_page) && ! empty($per_page) ? $per_page : 10;
2405
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
2406 2406
 
2407 2407
 		$_where = array();
2408 2408
 
2409
-		if ( isset( $this->_req_data['s'] ) ) {
2410
-			$sstr = '%' . $this->_req_data['s'] . '%';
2409
+		if (isset($this->_req_data['s'])) {
2410
+			$sstr = '%'.$this->_req_data['s'].'%';
2411 2411
 			$_where['OR'] = array(
2412
-				'Registration.Event.EVT_name' => array( 'LIKE', $sstr),
2413
-				'Registration.Event.EVT_desc' => array( 'LIKE', $sstr ),
2414
-				'Registration.Event.EVT_short_desc' => array( 'LIKE' , $sstr ),
2415
-				'ATT_fname' => array( 'LIKE', $sstr ),
2416
-				'ATT_lname' => array( 'LIKE', $sstr ),
2417
-				'ATT_short_bio' => array( 'LIKE', $sstr ),
2418
-				'ATT_email' => array('LIKE', $sstr ),
2419
-				'ATT_address' => array( 'LIKE', $sstr ),
2420
-				'ATT_address2' => array( 'LIKE', $sstr ),
2421
-				'ATT_city' => array( 'LIKE', $sstr ),
2422
-				'Country.CNT_name' => array( 'LIKE', $sstr ),
2423
-				'State.STA_name' => array('LIKE', $sstr ),
2424
-				'ATT_phone' => array( 'LIKE', $sstr ),
2425
-				'Registration.REG_final_price' => array( 'LIKE', $sstr ),
2426
-				'Registration.REG_code' => array( 'LIKE', $sstr ),
2427
-				'Registration.REG_count' => array( 'LIKE' , $sstr ),
2428
-				'Registration.REG_group_size' => array( 'LIKE' , $sstr )
2412
+				'Registration.Event.EVT_name' => array('LIKE', $sstr),
2413
+				'Registration.Event.EVT_desc' => array('LIKE', $sstr),
2414
+				'Registration.Event.EVT_short_desc' => array('LIKE', $sstr),
2415
+				'ATT_fname' => array('LIKE', $sstr),
2416
+				'ATT_lname' => array('LIKE', $sstr),
2417
+				'ATT_short_bio' => array('LIKE', $sstr),
2418
+				'ATT_email' => array('LIKE', $sstr),
2419
+				'ATT_address' => array('LIKE', $sstr),
2420
+				'ATT_address2' => array('LIKE', $sstr),
2421
+				'ATT_city' => array('LIKE', $sstr),
2422
+				'Country.CNT_name' => array('LIKE', $sstr),
2423
+				'State.STA_name' => array('LIKE', $sstr),
2424
+				'ATT_phone' => array('LIKE', $sstr),
2425
+				'Registration.REG_final_price' => array('LIKE', $sstr),
2426
+				'Registration.REG_code' => array('LIKE', $sstr),
2427
+				'Registration.REG_count' => array('LIKE', $sstr),
2428
+				'Registration.REG_group_size' => array('LIKE', $sstr)
2429 2429
 				);
2430 2430
 		}
2431 2431
 
2432 2432
 
2433
-		$offset = ($current_page-1)*$per_page;
2434
-		$limit = $count ? NULL : array( $offset, $per_page );
2433
+		$offset = ($current_page - 1) * $per_page;
2434
+		$limit = $count ? NULL : array($offset, $per_page);
2435 2435
 
2436
-		if ( $trash ) {
2437
-			$_where['status'] = array( '!=', 'publish' );
2438
-			$all_attendees = $count ? $ATT_MDL->count( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit)): $ATT_MDL->get_all( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit));
2436
+		if ($trash) {
2437
+			$_where['status'] = array('!=', 'publish');
2438
+			$all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit));
2439 2439
 		} else {
2440
-			$_where['status'] = array( 'IN', array( 'publish' ) );
2441
-			$all_attendees = $count ? $ATT_MDL->count( array($_where, 'order_by'=>array($orderby=>$sort),'limit'=>$limit)) : $ATT_MDL->get_all( array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit) );
2440
+			$_where['status'] = array('IN', array('publish'));
2441
+			$all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit));
2442 2442
 		}
2443 2443
 
2444 2444
 		return $all_attendees;
@@ -2455,10 +2455,10 @@  discard block
 block discarded – undo
2455 2455
 	 */
2456 2456
 	protected function _resend_registration() {
2457 2457
 		$this->_process_resend_registration();
2458
-		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID'] ) : array(
2458
+		$query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID']) : array(
2459 2459
 			'action' => 'default'
2460 2460
 		);
2461
-		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE );
2461
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2462 2462
 	}
2463 2463
 
2464 2464
 
@@ -2466,26 +2466,26 @@  discard block
 block discarded – undo
2466 2466
 
2467 2467
 
2468 2468
 
2469
-	public function _registrations_report(){
2470
-		if( ! defined( 'EE_USE_OLD_CSV_REPORT_CLASS' ) ) {
2471
-			wp_redirect( EE_Admin_Page::add_query_args_and_nonce(
2469
+	public function _registrations_report() {
2470
+		if ( ! defined('EE_USE_OLD_CSV_REPORT_CLASS')) {
2471
+			wp_redirect(EE_Admin_Page::add_query_args_and_nonce(
2472 2472
 				array(
2473 2473
 					'page' => 'espresso_batch',
2474 2474
 					'batch' => 'file',
2475
-					'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL,
2476
-					'job_handler' => urlencode( 'EventEspressoBatchRequest\JobHandlers\RegistrationsReport' ),
2477
-					'return_url' => urlencode( $this->_req_data[ 'return_url' ] ),
2478
-				)) );
2475
+					'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL,
2476
+					'job_handler' => urlencode('EventEspressoBatchRequest\JobHandlers\RegistrationsReport'),
2477
+					'return_url' => urlencode($this->_req_data['return_url']),
2478
+				)));
2479 2479
 		} else {
2480 2480
 			$new_request_args = array(
2481 2481
 				'export' => 'report',
2482 2482
 				'action' => 'registrations_report_for_event',
2483
-				'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL,
2483
+				'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL,
2484 2484
 			);
2485 2485
 			$this->_req_data = array_merge($this->_req_data, $new_request_args);
2486 2486
 
2487
-			if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2488
-				require_once(EE_CLASSES . 'EE_Export.class.php');
2487
+			if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2488
+				require_once(EE_CLASSES.'EE_Export.class.php');
2489 2489
 				$EE_Export = EE_Export::instance($this->_req_data);
2490 2490
 				$EE_Export->export();
2491 2491
 			}
@@ -2494,26 +2494,26 @@  discard block
 block discarded – undo
2494 2494
 
2495 2495
 
2496 2496
 
2497
-	public function _contact_list_export(){
2498
-		if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2499
-			require_once(EE_CLASSES . 'EE_Export.class.php');
2497
+	public function _contact_list_export() {
2498
+		if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2499
+			require_once(EE_CLASSES.'EE_Export.class.php');
2500 2500
 			$EE_Export = EE_Export::instance($this->_req_data);
2501 2501
 			$EE_Export->export_attendees();
2502 2502
 		}
2503 2503
 	}
2504 2504
 
2505
-	public function _contact_list_report(){
2506
-		if( ! defined( 'EE_USE_OLD_CSV_REPORT_CLASS' ) ) {
2507
-			wp_redirect( EE_Admin_Page::add_query_args_and_nonce(
2505
+	public function _contact_list_report() {
2506
+		if ( ! defined('EE_USE_OLD_CSV_REPORT_CLASS')) {
2507
+			wp_redirect(EE_Admin_Page::add_query_args_and_nonce(
2508 2508
 				array(
2509 2509
 					'page' => 'espresso_batch',
2510 2510
 					'batch' => 'file',
2511
-					'job_handler' => urlencode( 'EventEspressoBatchRequest\JobHandlers\AttendeesReport' ),
2512
-					'return_url' => urlencode( $this->_req_data[ 'return_url' ] ),
2513
-				)) );
2511
+					'job_handler' => urlencode('EventEspressoBatchRequest\JobHandlers\AttendeesReport'),
2512
+					'return_url' => urlencode($this->_req_data['return_url']),
2513
+				)));
2514 2514
 		} else {
2515
-			if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2516
-				require_once(EE_CLASSES . 'EE_Export.class.php');
2515
+			if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2516
+				require_once(EE_CLASSES.'EE_Export.class.php');
2517 2517
 				$EE_Export = EE_Export::instance($this->_req_data);
2518 2518
 				$EE_Export->report_attendees();
2519 2519
 			}
@@ -2532,73 +2532,73 @@  discard block
 block discarded – undo
2532 2532
 	 * @return void
2533 2533
 	 */
2534 2534
 	protected function _duplicate_attendee() {
2535
-		$action = !empty( $this->_req_data['return'] ) ? $this->_req_data['return'] : 'default';
2535
+		$action = ! empty($this->_req_data['return']) ? $this->_req_data['return'] : 'default';
2536 2536
 		//verify we have necessary info
2537
-		if ( empty($this->_req_data['_REG_ID'] )  ) {
2538
-			EE_Error::add_error( __('Unable to create the contact for the registration because the required parameters are not present (_REG_ID )', 'event_espresso'),  __FILE__, __LINE__, __FUNCTION__ );
2539
-			$query_args = array( 'action' => $action );
2537
+		if (empty($this->_req_data['_REG_ID'])) {
2538
+			EE_Error::add_error(__('Unable to create the contact for the registration because the required parameters are not present (_REG_ID )', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__);
2539
+			$query_args = array('action' => $action);
2540 2540
 			$this->_redirect_after_action('', '', '', $query_args, TRUE);
2541 2541
 		}
2542 2542
 
2543 2543
 		//okay necessary deets present... let's dupe the incoming attendee and attach to incoming registration.
2544
-		$registration = EEM_Registration::instance()->get_one_by_ID( $this->_req_data['_REG_ID'] );
2544
+		$registration = EEM_Registration::instance()->get_one_by_ID($this->_req_data['_REG_ID']);
2545 2545
 		$attendee = $registration->attendee();
2546 2546
 
2547 2547
 		//remove relation of existing attendee on registration
2548
-		$registration->_remove_relation_to($attendee, 'Attendee' );
2548
+		$registration->_remove_relation_to($attendee, 'Attendee');
2549 2549
 		//new attendee
2550 2550
 		$new_attendee = clone $attendee;
2551
-		$new_attendee->set( 'ATT_ID', 0 );
2551
+		$new_attendee->set('ATT_ID', 0);
2552 2552
 		$new_attendee->save();
2553 2553
 
2554 2554
 		//add new attendee to reg
2555
-		$registration->_add_relation_to( $new_attendee, 'Attendee');
2555
+		$registration->_add_relation_to($new_attendee, 'Attendee');
2556 2556
 
2557
-		EE_Error::add_success( __('New Contact record created.  Now make any edits you wish to make for this contact.', 'event_espresso') );
2557
+		EE_Error::add_success(__('New Contact record created.  Now make any edits you wish to make for this contact.', 'event_espresso'));
2558 2558
 
2559 2559
 		//redirect to edit page for attendee
2560
-		$query_args = array( 'post' => $new_attendee->ID(), 'action' => 'edit_attendee' );
2560
+		$query_args = array('post' => $new_attendee->ID(), 'action' => 'edit_attendee');
2561 2561
 
2562
-		$this->_redirect_after_action( '', '', '', $query_args, TRUE );
2562
+		$this->_redirect_after_action('', '', '', $query_args, TRUE);
2563 2563
 	}
2564 2564
 
2565 2565
 
2566 2566
 	//related to cpt routes
2567 2567
 	protected function _insert_update_cpt_item($post_id, $post) {
2568 2568
 		$success = true;
2569
-		$attendee = EEM_Attendee::instance()->get_one_by_ID( $post_id );
2569
+		$attendee = EEM_Attendee::instance()->get_one_by_ID($post_id);
2570 2570
 		//for attendee updates
2571
-		if ( $post->post_type = 'espresso_attendees' && !empty( $attendee ) ) {
2571
+		if ($post->post_type = 'espresso_attendees' && ! empty($attendee)) {
2572 2572
 			//note we should only be UPDATING attendees at this point.
2573 2573
 			$updated_fields = array(
2574 2574
 				'ATT_fname' => $this->_req_data['ATT_fname'],
2575 2575
 				'ATT_lname' => $this->_req_data['ATT_lname'],
2576
-				'ATT_full_name'=> $this->_req_data['ATT_fname'] . ' ' . $this->_req_data['ATT_lname'],
2576
+				'ATT_full_name'=> $this->_req_data['ATT_fname'].' '.$this->_req_data['ATT_lname'],
2577 2577
 				'ATT_address' => isset($this->_req_data['ATT_address']) ? $this->_req_data['ATT_address'] : '',
2578 2578
 				'ATT_address2' => isset($this->_req_data['ATT_address2']) ? $this->_req_data['ATT_address2'] : '',
2579
-				'ATT_city' => isset( $this->_req_data['ATT_city'] ) ? $this->_req_data['ATT_city'] : '',
2580
-				'STA_ID' => isset( $this->_req_data['STA_ID'] ) ? $this->_req_data['STA_ID'] : '',
2581
-				'CNT_ISO' => isset( $this->_req_data['CNT_ISO'] ) ? $this->_req_data['CNT_ISO'] : '',
2582
-				'ATT_zip' => isset( $this->_req_data['ATT_zip'] ) ? $this->_req_data['ATT_zip'] : '',
2583
-				'ATT_email' => isset( $this->_req_data['ATT_email'] ) ? $this->_req_data['ATT_email'] : '',
2584
-				'ATT_phone' => isset( $this->_req_data['ATT_phone'] ) ? $this->_req_data['ATT_phone'] : ''
2579
+				'ATT_city' => isset($this->_req_data['ATT_city']) ? $this->_req_data['ATT_city'] : '',
2580
+				'STA_ID' => isset($this->_req_data['STA_ID']) ? $this->_req_data['STA_ID'] : '',
2581
+				'CNT_ISO' => isset($this->_req_data['CNT_ISO']) ? $this->_req_data['CNT_ISO'] : '',
2582
+				'ATT_zip' => isset($this->_req_data['ATT_zip']) ? $this->_req_data['ATT_zip'] : '',
2583
+				'ATT_email' => isset($this->_req_data['ATT_email']) ? $this->_req_data['ATT_email'] : '',
2584
+				'ATT_phone' => isset($this->_req_data['ATT_phone']) ? $this->_req_data['ATT_phone'] : ''
2585 2585
 				);
2586
-			foreach ( $updated_fields as $field => $value ) {
2586
+			foreach ($updated_fields as $field => $value) {
2587 2587
 				$attendee->set($field, $value);
2588 2588
 			}
2589 2589
 
2590 2590
 			$success = $attendee->save();
2591 2591
 
2592
-			$attendee_update_callbacks = apply_filters( 'FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array() );
2593
-			foreach ( $attendee_update_callbacks as $a_callback ) {
2594
-				if ( FALSE === call_user_func_array( $a_callback, array($attendee, $this->_req_data ) ) ) {
2595
-					throw new EE_Error( sprintf( __('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback.  Please check the spelling.', 'event_espresso'), $a_callback ) );
2592
+			$attendee_update_callbacks = apply_filters('FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array());
2593
+			foreach ($attendee_update_callbacks as $a_callback) {
2594
+				if (FALSE === call_user_func_array($a_callback, array($attendee, $this->_req_data))) {
2595
+					throw new EE_Error(sprintf(__('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback.  Please check the spelling.', 'event_espresso'), $a_callback));
2596 2596
 				}
2597 2597
 			}
2598 2598
 		}
2599 2599
 
2600
-		if ( $success === FALSE )
2601
-			EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
2600
+		if ($success === FALSE)
2601
+			EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
2602 2602
 
2603 2603
 	}
2604 2604
 
@@ -2618,17 +2618,17 @@  discard block
 block discarded – undo
2618 2618
 		remove_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2619 2619
 		remove_meta_box('commentstatusdiv', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2620 2620
 
2621
-		if ( post_type_supports( 'espresso_attendees', 'excerpt') ) {
2622
-			add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal' );
2621
+		if (post_type_supports('espresso_attendees', 'excerpt')) {
2622
+			add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal');
2623 2623
 		}
2624 2624
 
2625
-		if ( post_type_supports( 'espresso_attendees', 'comments') ) {
2625
+		if (post_type_supports('espresso_attendees', 'comments')) {
2626 2626
 			add_meta_box('commentsdiv', __('Notes on the Contact', 'event_espresso'), 'post_comment_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2627 2627
 		}
2628 2628
 
2629
-		add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array( $this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core' );
2630
-		add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core' );
2631
-		add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array( $this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high');
2629
+		add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array($this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core');
2630
+		add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2631
+		add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array($this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high');
2632 2632
 	}
2633 2633
 
2634 2634
 
@@ -2637,10 +2637,10 @@  discard block
 block discarded – undo
2637 2637
 	 * @param  WP_Post $post wp post object
2638 2638
 	 * @return string        attendee contact info ( and form )
2639 2639
 	 */
2640
-	public function attendee_contact_info( $post ) {
2640
+	public function attendee_contact_info($post) {
2641 2641
 		//get attendee object ( should already have it )
2642 2642
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2643
-		$template = REG_TEMPLATE_PATH . 'attendee_contact_info_metabox_content.template.php';
2643
+		$template = REG_TEMPLATE_PATH.'attendee_contact_info_metabox_content.template.php';
2644 2644
 		EEH_Template::display_template($template, $this->_template_args);
2645 2645
 	}
2646 2646
 
@@ -2656,12 +2656,12 @@  discard block
 block discarded – undo
2656 2656
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2657 2657
 		$this->_template_args['state_html'] = EEH_Form_Fields::generate_form_input(
2658 2658
 				new EE_Question_Form_Input(
2659
-				EE_Question::new_instance( array(
2659
+				EE_Question::new_instance(array(
2660 2660
 					'QST_ID' => 0,
2661 2661
 					'QST_display_text' => __('State/Province', 'event_espresso'),
2662 2662
 					'QST_system' => 'admin-state'
2663 2663
 					)),
2664
-				EE_Answer::new_instance( array(
2664
+				EE_Answer::new_instance(array(
2665 2665
 					'ANS_ID' => 0,
2666 2666
 					'ANS_value' => $this->_cpt_model_obj->state_ID()
2667 2667
 					)),
@@ -2674,12 +2674,12 @@  discard block
 block discarded – undo
2674 2674
 			));
2675 2675
 		$this->_template_args['country_html'] = EEH_Form_Fields::generate_form_input(
2676 2676
 				new EE_Question_Form_Input(
2677
-				EE_Question::new_instance( array(
2677
+				EE_Question::new_instance(array(
2678 2678
 					'QST_ID' => 0,
2679 2679
 					'QST_display_text' => __('Country', 'event_espresso'),
2680 2680
 					'QST_system' => 'admin-country'
2681 2681
 					)),
2682
-				EE_Answer::new_instance( array(
2682
+				EE_Answer::new_instance(array(
2683 2683
 					'ANS_ID' => 0,
2684 2684
 					'ANS_value' => $this->_cpt_model_obj->country_ID()
2685 2685
 					)),
@@ -2690,8 +2690,8 @@  discard block
 block discarded – undo
2690 2690
 					'append_qstn_id' => FALSE
2691 2691
 					)
2692 2692
 				));
2693
-		$template = REG_TEMPLATE_PATH . 'attendee_address_details_metabox_content.template.php';
2694
-		EEH_Template::display_template($template, $this->_template_args );
2693
+		$template = REG_TEMPLATE_PATH.'attendee_address_details_metabox_content.template.php';
2694
+		EEH_Template::display_template($template, $this->_template_args);
2695 2695
 
2696 2696
 	}
2697 2697
 
@@ -2701,11 +2701,11 @@  discard block
 block discarded – undo
2701 2701
 	*		@access protected
2702 2702
 	*		@return void
2703 2703
 	*/
2704
-	public function attendee_registrations_meta_box( $post ) {
2704
+	public function attendee_registrations_meta_box($post) {
2705 2705
 
2706 2706
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2707 2707
 		$this->_template_args['registrations'] = $this->_cpt_model_obj->get_many_related('Registration');
2708
-		$template = REG_TEMPLATE_PATH . 'attendee_registrations_main_meta_box.template.php';
2708
+		$template = REG_TEMPLATE_PATH.'attendee_registrations_main_meta_box.template.php';
2709 2709
 		EEH_Template::display_template($template, $this->_template_args);
2710 2710
 
2711 2711
 	}
@@ -2719,8 +2719,8 @@  discard block
 block discarded – undo
2719 2719
 	 * @return string        html for new form.
2720 2720
 	 */
2721 2721
 	public function after_title_form_fields($post) {
2722
-		if ( $post->post_type == 'espresso_attendees' ) {
2723
-			$template = REG_TEMPLATE_PATH . 'attendee_details_after_title_form_fields.template.php';
2722
+		if ($post->post_type == 'espresso_attendees') {
2723
+			$template = REG_TEMPLATE_PATH.'attendee_details_after_title_form_fields.template.php';
2724 2724
 			$template_args['attendee'] = $this->_cpt_model_obj;
2725 2725
 			EEH_Template::display_template($template, $template_args);
2726 2726
 		}
@@ -2737,21 +2737,21 @@  discard block
 block discarded – undo
2737 2737
 	*		@access protected
2738 2738
 	*		@return void
2739 2739
 	*/
2740
-	protected function _trash_or_restore_attendees( $trash = TRUE ) {
2740
+	protected function _trash_or_restore_attendees($trash = TRUE) {
2741 2741
 
2742
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2742
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2743 2743
 
2744 2744
 		$ATT_MDL = EEM_Attendee::instance();
2745 2745
 
2746 2746
 		$success = 1;
2747 2747
 		//Checkboxes
2748
-		if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
2748
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
2749 2749
 			// if array has more than one element than success message should be plural
2750
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
2750
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
2751 2751
 			// cycle thru checkboxes
2752
-			while (list( $ATT_ID, $value ) = each($this->_req_data['checkbox'])) {
2753
-				$updated = $trash ? $ATT_MDL->update_by_ID(array( 'status' => 'trash' ), $ATT_ID) : $ATT_MDL->update_by_ID( array('status' => 'publish' ), $ATT_ID);
2754
-				if ( !$updated ) {
2752
+			while (list($ATT_ID, $value) = each($this->_req_data['checkbox'])) {
2753
+				$updated = $trash ? $ATT_MDL->update_by_ID(array('status' => 'trash'), $ATT_ID) : $ATT_MDL->update_by_ID(array('status' => 'publish'), $ATT_ID);
2754
+				if ( ! $updated) {
2755 2755
 					$success = 0;
2756 2756
 				}
2757 2757
 			}
@@ -2760,18 +2760,18 @@  discard block
 block discarded – undo
2760 2760
 			// grab single id and delete
2761 2761
 			$ATT_ID = absint($this->_req_data['ATT_ID']);
2762 2762
 			//get attendee
2763
-			$att = $ATT_MDL->get_one_by_ID( $ATT_ID );
2763
+			$att = $ATT_MDL->get_one_by_ID($ATT_ID);
2764 2764
 			$updated = $trash ? $att->set_status('trash') : $att->set_status('publish');
2765 2765
 			$updated = $att->save();
2766
-			if ( ! $updated ) {
2766
+			if ( ! $updated) {
2767 2767
 				$success = 0;
2768 2768
 			}
2769 2769
 
2770 2770
 		}
2771 2771
 
2772
-		$what = $success > 1 ? __( 'Contacts', 'event_espresso' ) : __( 'Contact', 'event_espresso' );
2773
-		$action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' );
2774
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'contact_list' ) );
2772
+		$what = $success > 1 ? __('Contacts', 'event_espresso') : __('Contact', 'event_espresso');
2773
+		$action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso');
2774
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'contact_list'));
2775 2775
 
2776 2776
 	}
2777 2777
 
Please login to merge, or discard this patch.
admin_pages/registrations/EE_Registrations_List_Table.class.php 1 patch
Spacing   +167 added lines, -167 removed lines patch added patch discarded remove patch
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
 	/**
55 55
 	 * @param \Registrations_Admin_Page $admin_page
56 56
 	 */
57
-	public function __construct( Registrations_Admin_Page $admin_page ){
58
-		if ( ! empty( $_GET['event_id'] ) ) {
57
+	public function __construct(Registrations_Admin_Page $admin_page) {
58
+		if ( ! empty($_GET['event_id'])) {
59 59
 			$extra_query_args = array();
60
-			foreach ( $admin_page->get_views() as $key => $view_details ) {
61
-				$extra_query_args[$view_details['slug']] = array( 'event_id' => $_GET['event_id'] );
60
+			foreach ($admin_page->get_views() as $key => $view_details) {
61
+				$extra_query_args[$view_details['slug']] = array('event_id' => $_GET['event_id']);
62 62
 			}
63
-			$this->_views = $admin_page->get_list_table_view_RLs( $extra_query_args );
63
+			$this->_views = $admin_page->get_list_table_view_RLs($extra_query_args);
64 64
 		}
65 65
 		parent::__construct($admin_page);
66 66
 		$this->_status = $this->_admin_page->get_registration_status_array();
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 	 * @return void
76 76
 	 */
77 77
 	protected function _setup_data() {
78
-		$this->_data = $this->_admin_page->get_registrations( $this->_per_page );
79
-		$this->_all_data_count = $this->_admin_page->get_registrations( $this->_per_page, TRUE, FALSE, FALSE );
78
+		$this->_data = $this->_admin_page->get_registrations($this->_per_page);
79
+		$this->_all_data_count = $this->_admin_page->get_registrations($this->_per_page, TRUE, FALSE, FALSE);
80 80
 	}
81 81
 
82 82
 
@@ -93,30 +93,30 @@  discard block
 block discarded – undo
93 93
 			'ajax' => TRUE,
94 94
 			'screen' => $this->_admin_page->get_current_screen()->id
95 95
 			);
96
-		$ID_column_name = __( 'ID', 'event_espresso' );
96
+		$ID_column_name = __('ID', 'event_espresso');
97 97
 		$ID_column_name .= ' : <span class="show-on-mobile-view-only" style="float:none">';
98
-		$ID_column_name .= __( 'Registrant Name', 'event_espresso' );
98
+		$ID_column_name .= __('Registrant Name', 'event_espresso');
99 99
 		$ID_column_name .= '</span> ';
100
-		if ( isset( $_GET['event_id'] )) {
100
+		if (isset($_GET['event_id'])) {
101 101
 			$this->_columns = array(
102 102
 				'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
103 103
 				'_REG_ID' => $ID_column_name,
104
-				'ATT_fname' => __( 'Name', 'event_espresso' ),
104
+				'ATT_fname' => __('Name', 'event_espresso'),
105 105
 				'ATT_email' =>  __('Email', 'event_espresso'),
106
-				'_REG_date' => __( 'Reg Date', 'event_espresso' ),
107
-				'PRC_amount' => __( 'TKT Price', 'event_espresso' ),
108
-				'_REG_final_price' => __( 'Final Price', 'event_espresso' ),
109
-				'TXN_total' => __( 'Total Txn', 'event_espresso' ),
106
+				'_REG_date' => __('Reg Date', 'event_espresso'),
107
+				'PRC_amount' => __('TKT Price', 'event_espresso'),
108
+				'_REG_final_price' => __('Final Price', 'event_espresso'),
109
+				'TXN_total' => __('Total Txn', 'event_espresso'),
110 110
 				'TXN_paid' => __('Paid', 'event_espresso'),
111
-				'actions' => __( 'Actions', 'event_espresso' )
111
+				'actions' => __('Actions', 'event_espresso')
112 112
 				);
113 113
 			$this->_bottom_buttons = array(
114 114
 					'report'=> array(
115 115
 					'route' => 'registrations_report',
116 116
 					'extra_request' =>
117 117
 						array(
118
-							'EVT_ID'=> isset( $this->_req_data['event_id'] ) ? $this->_req_data['event_id'] : null,
119
-							'return_url' => urlencode( "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" )
118
+							'EVT_ID'=> isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null,
119
+							'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}")
120 120
 						)
121 121
 				),
122 122
 			);
@@ -124,19 +124,19 @@  discard block
 block discarded – undo
124 124
 			$this->_columns = array(
125 125
 				'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
126 126
 				'_REG_ID' => $ID_column_name,
127
-				'ATT_fname' => __( 'Name', 'event_espresso' ),
128
-				'_REG_date' => __( 'TXN Date', 'event_espresso' ),
129
-				'event_name' => __( 'Event', 'event_espresso' ),
130
-				'DTT_EVT_start' => __( 'Event Date', 'event_espresso' ),
131
-				'_REG_final_price' => __( 'Price', 'event_espresso' ),
132
-				'_REG_paid' => __( 'Paid', 'event_espresso' ),
133
-				'actions' => __( 'Actions', 'event_espresso' )
127
+				'ATT_fname' => __('Name', 'event_espresso'),
128
+				'_REG_date' => __('TXN Date', 'event_espresso'),
129
+				'event_name' => __('Event', 'event_espresso'),
130
+				'DTT_EVT_start' => __('Event Date', 'event_espresso'),
131
+				'_REG_final_price' => __('Price', 'event_espresso'),
132
+				'_REG_paid' => __('Paid', 'event_espresso'),
133
+				'actions' => __('Actions', 'event_espresso')
134 134
 			);
135 135
 			$this->_bottom_buttons = array(
136 136
 				'report_all'=> array(
137 137
 				'route' => 'registrations_report',
138 138
 				'extra_request' => array(
139
-					'return_url' => urlencode( "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" ) )
139
+					'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}") )
140 140
 				),
141 141
 			);
142 142
 		}
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
 		$this->_primary_column = '_REG_ID';
145 145
 
146 146
 		$this->_sortable_columns = array(
147
-			'_REG_date' => array( '_REG_date' => TRUE ),   //true means its already sorted
148
-			'ATT_fname' => array( 'ATT_fname' => FALSE ),
149
-			'event_name' => array( 'event_name' => FALSE ),
150
-			'DTT_EVT_start'	=> array( 'DTT_EVT_start' => FALSE ),
151
-			'_REG_ID' => array( '_REG_ID' => FALSE ),
147
+			'_REG_date' => array('_REG_date' => TRUE), //true means its already sorted
148
+			'ATT_fname' => array('ATT_fname' => FALSE),
149
+			'event_name' => array('event_name' => FALSE),
150
+			'DTT_EVT_start'	=> array('DTT_EVT_start' => FALSE),
151
+			'_REG_ID' => array('_REG_ID' => FALSE),
152 152
 		);
153 153
 
154 154
 		$this->_hidden_columns = array();
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
 	 * @param  EE_Registration $item the current item
163 163
 	 * @return string
164 164
 	 */
165
-	protected function _get_row_class( $item ) {
166
-		$class = parent::_get_row_class( $item );
165
+	protected function _get_row_class($item) {
166
+		$class = parent::_get_row_class($item);
167 167
 		//add status class
168
-		$class .= ' ee-status-strip reg-status-' . $item->status_ID();
169
-		if ( $this->_has_checkbox_column ) {
168
+		$class .= ' ee-status-strip reg-status-'.$item->status_ID();
169
+		if ($this->_has_checkbox_column) {
170 170
 			$class .= ' has-checkbox-column';
171 171
 		}
172 172
 		return $class;
@@ -180,9 +180,9 @@  discard block
 block discarded – undo
180 180
 	 * @param EE_Registration $registration
181 181
 	 * @throws \EE_Error
182 182
 	 */
183
-	protected function _set_related_details( EE_Registration $registration ) {
183
+	protected function _set_related_details(EE_Registration $registration) {
184 184
 
185
-		$transaction = $registration->get_first_related( 'Transaction' );
185
+		$transaction = $registration->get_first_related('Transaction');
186 186
 		$status = $transaction instanceof EE_Transaction
187 187
 			? $transaction->status_ID()
188 188
 			: EEM_Transaction::failed_status_code;
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
 			'status' => $status,
192 192
 			'id' => $transaction instanceof EE_Transaction ? $transaction->ID() : 0,
193 193
 			'title_attr' => sprintf(
194
-				__( 'View Transaction Details (%s)', 'event_espresso' ),
195
-				EEH_Template::pretty_status( $status, false, 'sentence' )
194
+				__('View Transaction Details (%s)', 'event_espresso'),
195
+				EEH_Template::pretty_status($status, false, 'sentence')
196 196
 			)
197 197
 		);
198 198
 
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
 			'status' => $status,
204 204
 			'id' => $event instanceof EE_Event ? $event->ID() : 0,
205 205
 			'title_attr' => sprintf(
206
-				__( 'Edit Event (%s)', 'event_espresso' ),
207
-				EEH_Template::pretty_status( $status, false, 'sentence' )
206
+				__('Edit Event (%s)', 'event_espresso'),
207
+				EEH_Template::pretty_status($status, false, 'sentence')
208 208
 			)
209 209
 		);
210 210
 	}
@@ -221,30 +221,30 @@  discard block
 block discarded – undo
221 221
 
222 222
 		//todo we're currently using old functions here. We need to move things into the Events_Admin_Page() class as methods.
223 223
 
224
-		$cur_date = isset( $this->_req_data['month_range'] ) ? $this->_req_data['month_range'] : '';
225
-		$cur_category = isset( $this->_req_data['EVT_CAT'] ) ? $this->_req_data['EVT_CAT'] : -1;
226
-		$reg_status = isset( $this->_req_data['_reg_status'] ) ? $this->_req_data['_reg_status'] : '';
224
+		$cur_date = isset($this->_req_data['month_range']) ? $this->_req_data['month_range'] : '';
225
+		$cur_category = isset($this->_req_data['EVT_CAT']) ? $this->_req_data['EVT_CAT'] : -1;
226
+		$reg_status = isset($this->_req_data['_reg_status']) ? $this->_req_data['_reg_status'] : '';
227 227
 
228
-		$filters[] = EEH_Form_Fields::generate_registration_months_dropdown( $cur_date, $reg_status, $cur_category );
229
-		$filters[] = EEH_Form_Fields::generate_event_category_dropdown( $cur_category );
228
+		$filters[] = EEH_Form_Fields::generate_registration_months_dropdown($cur_date, $reg_status, $cur_category);
229
+		$filters[] = EEH_Form_Fields::generate_event_category_dropdown($cur_category);
230 230
 
231 231
 		$status = array();
232
-		$status[] = array( 'id' => 0, 'text' => __('Select Status', 'event_espresso') );
233
-		foreach ( $this->_status as $key => $value ) {
234
-			$status[] = array( 'id' => $key, 'text' => $value );
232
+		$status[] = array('id' => 0, 'text' => __('Select Status', 'event_espresso'));
233
+		foreach ($this->_status as $key => $value) {
234
+			$status[] = array('id' => $key, 'text' => $value);
235 235
 		}
236
-		if ( $this->_view !== 'incomplete' ) {
236
+		if ($this->_view !== 'incomplete') {
237 237
 			$filters[] = EEH_Form_Fields::select_input(
238 238
 				'_reg_status',
239 239
 				$status,
240
-				isset( $this->_req_data['_reg_status'] )
241
-					? strtoupper( sanitize_key( $this->_req_data['_reg_status'] ))
240
+				isset($this->_req_data['_reg_status'])
241
+					? strtoupper(sanitize_key($this->_req_data['_reg_status']))
242 242
 					: ''
243 243
 			);
244 244
 		}
245 245
 
246
-		if ( isset( $this->_req_data['event_id'] ) ) {
247
-			$filters[] = EEH_Form_Fields::hidden_input( 'event_id',  $this->_req_data['event_id'], 'reg_event_id' );
246
+		if (isset($this->_req_data['event_id'])) {
247
+			$filters[] = EEH_Form_Fields::hidden_input('event_id', $this->_req_data['event_id'], 'reg_event_id');
248 248
 		}
249 249
 
250 250
 		return $filters;
@@ -263,9 +263,9 @@  discard block
 block discarded – undo
263 263
 		$this->_views['all']['count'] = $this->_total_registrations();
264 264
 		$this->_views['month']['count'] = $this->_total_registrations_this_month();
265 265
 		$this->_views['today']['count'] = $this->_total_registrations_today();
266
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registrations', 'espresso_registrations_trash_registrations' ) ) {
267
-			$this->_views['incomplete']['count'] = $this->_total_registrations( 'incomplete' );
268
-			$this->_views['trash']['count'] = $this->_total_registrations( 'trash' );
266
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registrations', 'espresso_registrations_trash_registrations')) {
267
+			$this->_views['incomplete']['count'] = $this->_total_registrations('incomplete');
268
+			$this->_views['trash']['count'] = $this->_total_registrations('trash');
269 269
 		}
270 270
 	}
271 271
 
@@ -279,23 +279,23 @@  discard block
 block discarded – undo
279 279
 	 * @return int
280 280
 	 * @throws \EE_Error
281 281
 	 */
282
-	protected function _total_registrations( $view = '' ){
282
+	protected function _total_registrations($view = '') {
283 283
 		$_where = array();
284
-		$EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : FALSE;
285
-		if( $EVT_ID ) {
284
+		$EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE;
285
+		if ($EVT_ID) {
286 286
 			$_where['EVT_ID'] = $EVT_ID;
287 287
 		}
288
-		switch ( $view ) {
288
+		switch ($view) {
289 289
 			case 'trash' :
290
-				return EEM_Registration::instance()->count_deleted( array( $_where ));
290
+				return EEM_Registration::instance()->count_deleted(array($_where));
291 291
 				break;
292 292
 			case 'incomplete' :
293 293
 				$_where['STS_ID'] = EEM_Registration::status_id_incomplete;
294 294
 				break;
295 295
 			default :
296
-				$_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete );
296
+				$_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete);
297 297
 		}
298
-		return EEM_Registration::instance()->count( array( $_where ));
298
+		return EEM_Registration::instance()->count(array($_where));
299 299
 	}
300 300
 
301 301
 
@@ -307,32 +307,32 @@  discard block
 block discarded – undo
307 307
 	 * @return int
308 308
 	 * @throws \EE_Error
309 309
 	 */
310
-	protected function _total_registrations_this_month(){
311
-		$EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : FALSE;
312
-		$_where = $EVT_ID ? array( 'EVT_ID' => $EVT_ID ) : array();
310
+	protected function _total_registrations_this_month() {
311
+		$EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE;
312
+		$_where = $EVT_ID ? array('EVT_ID' => $EVT_ID) : array();
313 313
 		$this_year_r = date('Y', current_time('timestamp'));
314 314
 		$time_start = ' 00:00:00';
315 315
 		$time_end = ' 23:59:59';
316 316
 		$this_month_r = date('m', current_time('timestamp'));
317
-		$days_this_month = date( 't', current_time('timestamp') );
317
+		$days_this_month = date('t', current_time('timestamp'));
318 318
 		//setup date query.
319 319
 		$beginning_string = EEM_Registration::instance()->convert_datetime_for_query(
320 320
 			'REG_date',
321
-			$this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start,
321
+			$this_year_r.'-'.$this_month_r.'-01'.' '.$time_start,
322 322
 			'Y-m-d H:i:s'
323 323
 		);
324 324
 		$end_string = EEM_Registration::instance()->convert_datetime_for_query(
325 325
 			'REG_date',
326
-			$this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end,
326
+			$this_year_r.'-'.$this_month_r.'-'.$days_this_month.' '.$time_end,
327 327
 			'Y-m-d H:i:s'
328 328
 		);
329
-		$_where['REG_date']= array('BETWEEN',
329
+		$_where['REG_date'] = array('BETWEEN',
330 330
 			array(
331 331
 				$beginning_string,
332 332
 				$end_string
333 333
 		));
334
-		$_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete );
335
-		return EEM_Registration::instance()->count(array( $_where ) );
334
+		$_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete);
335
+		return EEM_Registration::instance()->count(array($_where));
336 336
 	}
337 337
 
338 338
 
@@ -344,20 +344,20 @@  discard block
 block discarded – undo
344 344
 	 * @return int
345 345
 	 * @throws \EE_Error
346 346
 	 */
347
-	protected function _total_registrations_today(){
347
+	protected function _total_registrations_today() {
348 348
 
349
-		$EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : FALSE;
350
-		$_where = $EVT_ID ? array( 'EVT_ID' => $EVT_ID ) : array();
349
+		$EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE;
350
+		$_where = $EVT_ID ? array('EVT_ID' => $EVT_ID) : array();
351 351
 		$current_date = date('Y-m-d', current_time('timestamp'));
352 352
 		$time_start = ' 00:00:00';
353 353
 		$time_end = ' 23:59:59';
354
-		$_where['REG_date']= array('BETWEEN',
354
+		$_where['REG_date'] = array('BETWEEN',
355 355
 			array(
356
-				EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $current_date . $time_start, 'Y-m-d H:i:s' ),
357
-				EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $current_date . $time_end, 'Y-m-d H:i:s' )
356
+				EEM_Registration::instance()->convert_datetime_for_query('REG_date', $current_date.$time_start, 'Y-m-d H:i:s'),
357
+				EEM_Registration::instance()->convert_datetime_for_query('REG_date', $current_date.$time_end, 'Y-m-d H:i:s')
358 358
 		));
359
-		$_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete );
360
-		return EEM_Registration::instance()->count(array( $_where ) );
359
+		$_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete);
360
+		return EEM_Registration::instance()->count(array($_where));
361 361
 	}
362 362
 
363 363
 
@@ -370,12 +370,12 @@  discard block
 block discarded – undo
370 370
 	 * @return string
371 371
 	 * @throws \EE_Error
372 372
 	 */
373
-    public function column_cb($item){
373
+    public function column_cb($item) {
374 374
 	/** checkbox/lock **/
375
-	$transaction = $item->get_first_related( 'Transaction' );
376
-	$payment_count = $transaction instanceof EE_Transaction ? $transaction->count_related( 'Payment' ) : 0;
375
+	$transaction = $item->get_first_related('Transaction');
376
+	$payment_count = $transaction instanceof EE_Transaction ? $transaction->count_related('Payment') : 0;
377 377
 	    return $payment_count > 0
378
-		    ? sprintf( '<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID() )
378
+		    ? sprintf('<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID())
379 379
 		      . '<span class="ee-lock-icon"></span>'
380 380
 		    : sprintf(
381 381
 			    '<input type="checkbox" name="_REG_ID[]" value="%1$s" />',
@@ -393,14 +393,14 @@  discard block
 block discarded – undo
393 393
 	 * @return string
394 394
 	 * @throws \EE_Error
395 395
 	 */
396
-	public function column__REG_ID(EE_Registration $item){
396
+	public function column__REG_ID(EE_Registration $item) {
397 397
 		$attendee = $item->attendee();
398 398
 		$content = $item->ID();
399 399
 		$content .= '<div class="show-on-mobile-view-only">';
400 400
 		$content .= '<br>';
401 401
 		$content .= $attendee instanceof EE_Attendee ? $attendee->full_name() : '';
402
-		$content .= '&nbsp;' . sprintf(__( '(%1$s / %2$s)', 'event_espresso' ), $item->count(), $item->group_size());
403
-		$content .= '<br>' . sprintf( __( 'Reg Code: %s', 'event_espresso' ), $item->get('REG_code') );
402
+		$content .= '&nbsp;'.sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size());
403
+		$content .= '<br>'.sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code'));
404 404
 		$content .= '</div>';
405 405
 		return $content;
406 406
 	}
@@ -415,12 +415,12 @@  discard block
 block discarded – undo
415 415
 	 * @return string
416 416
 	 * @throws \EE_Error
417 417
 	 */
418
-	public function column__REG_date(EE_Registration $item){
418
+	public function column__REG_date(EE_Registration $item) {
419 419
 		$this->_set_related_details($item);
420 420
        		 //Build row actions
421
-		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=> $this->_transaction_details['id'] ), TXN_ADMIN_URL );
422
-		$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' );
423
-		$view_link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $this->_transaction_details['status'], false, 'sentence' ) . '</span>';
421
+		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=> $this->_transaction_details['id']), TXN_ADMIN_URL);
422
+		$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');
423
+		$view_link .= '<br><span class="ee-status-text-small">'.EEH_Template::pretty_status($this->_transaction_details['status'], false, 'sentence').'</span>';
424 424
 		return $view_link;
425 425
 	}
426 426
 
@@ -434,18 +434,18 @@  discard block
 block discarded – undo
434 434
 	 * @return string
435 435
 	 * @throws \EE_Error
436 436
 	 */
437
-	public function column_event_name(EE_Registration $item){
438
-		$this->_set_related_details( $item );
437
+	public function column_event_name(EE_Registration $item) {
438
+		$this->_set_related_details($item);
439 439
 		// page=espresso_events&action=edit_event&EVT_ID=2&edit_event_nonce=cf3a7e5b62
440
-		$edit_event_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$item->event_ID() ), EVENTS_ADMIN_URL );
440
+		$edit_event_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$item->event_ID()), EVENTS_ADMIN_URL);
441 441
 		$event_name = $item->event_name();
442 442
 		$event_name = $event_name ? $event_name : __("No Associated Event", 'event_espresso');
443
-		$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, '...' ) ;
443
+		$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, '...');
444 444
 
445
-		$edit_event_url = EE_Admin_Page::add_query_args_and_nonce( array( 'event_id'=>$item->event_ID() ), REG_ADMIN_URL );
446
-		$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>';
445
+		$edit_event_url = EE_Admin_Page::add_query_args_and_nonce(array('event_id'=>$item->event_ID()), REG_ADMIN_URL);
446
+		$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>';
447 447
 
448
-		return sprintf('%1$s %2$s', $edit_event, $this->row_actions($actions) );
448
+		return sprintf('%1$s %2$s', $edit_event, $this->row_actions($actions));
449 449
 	}
450 450
 
451 451
 
@@ -458,18 +458,18 @@  discard block
 block discarded – undo
458 458
 	 * @return string
459 459
 	 * @throws \EE_Error
460 460
 	 */
461
-   	public function column_DTT_EVT_start(EE_Registration $item){
461
+   	public function column_DTT_EVT_start(EE_Registration $item) {
462 462
 		$datetime_strings = array();
463
-		$ticket = $item->ticket( TRUE );
464
-		if ( $ticket instanceof EE_Ticket ) {
463
+		$ticket = $item->ticket(TRUE);
464
+		if ($ticket instanceof EE_Ticket) {
465 465
 			$remove_defaults = array('default_where_conditions' => 'none');
466 466
 			$datetimes = $ticket->datetimes($remove_defaults);
467
-			foreach($datetimes as $datetime){
468
-				$datetime_strings[] = $datetime->get_i18n_datetime( 'DTT_EVT_start' );
467
+			foreach ($datetimes as $datetime) {
468
+				$datetime_strings[] = $datetime->get_i18n_datetime('DTT_EVT_start');
469 469
 			}
470
-			return implode("<br />",$datetime_strings);
470
+			return implode("<br />", $datetime_strings);
471 471
 		} else {
472
-			return __( 'There is no ticket on this registration', 'event_espresso' );
472
+			return __('There is no ticket on this registration', 'event_espresso');
473 473
 		}
474 474
     }
475 475
 
@@ -483,45 +483,45 @@  discard block
 block discarded – undo
483 483
 	 * @return string
484 484
 	 * @throws \EE_Error
485 485
 	 */
486
-   	public function column_ATT_fname(EE_Registration $item){
486
+   	public function column_ATT_fname(EE_Registration $item) {
487 487
    		$attendee = $item->attendee();
488 488
 
489
-		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL );
489
+		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$item->ID()), REG_ADMIN_URL);
490 490
 		$attendee_name = $attendee instanceof EE_Attendee ? $attendee->full_name() : '';
491
-		$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;
491
+		$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;
492 492
 		$link .= $item->count() === 1 ? '&nbsp;<sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup>' : '';
493 493
 
494 494
 		$t = $item->get_first_related('Transaction');
495 495
 		$payment_count = $t instanceof EE_Transaction ? $t->count_related('Payment') : 0;
496 496
 
497 497
 	    //append group count to name
498
-	    $link .= '&nbsp;' . sprintf(__( '(%1$s / %2$s)', 'event_espresso' ), $item->count(), $item->group_size());
498
+	    $link .= '&nbsp;'.sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size());
499 499
 
500 500
 	    //append reg_code
501
-	    $link .= '<br>' . sprintf( __( 'Reg Code: %s', 'event_espresso' ), $item->get('REG_code') );
501
+	    $link .= '<br>'.sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code'));
502 502
 
503 503
 	    //reg status text for accessibility
504
-	    $link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $item->status_ID(), false, 'sentence' ) . '</span>';
504
+	    $link .= '<br><span class="ee-status-text-small">'.EEH_Template::pretty_status($item->status_ID(), false, 'sentence').'</span>';
505 505
 
506 506
 		//trash/restore/delete actions
507 507
 		$actions = array();
508
-		if ( $this->_view !== 'trash' && $payment_count === 0 && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registration', 'espresso_registrations_trash_registrations', $item->ID() ) ) {
509
-			$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'trash_registrations', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL );
510
-			$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' . esc_attr__( 'Trash Registration', 'event_espresso' ) . '">' . __( 'Trash', 'event_espresso' ) . '</a>';
511
-		} elseif ( $this->_view === 'trash' ) {
508
+		if ($this->_view !== 'trash' && $payment_count === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_trash_registrations', $item->ID())) {
509
+			$trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'trash_registrations', '_REG_ID'=>$item->ID()), REG_ADMIN_URL);
510
+			$actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Trash Registration', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>';
511
+		} elseif ($this->_view === 'trash') {
512 512
 			// restore registration link
513
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registration', 'espresso_registrations_restore_registrations', $item->ID() ) ) {
514
-				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_registrations', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL );
515
-				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Registration', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>';
513
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_restore_registrations', $item->ID())) {
514
+				$restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_registrations', '_REG_ID'=>$item->ID()), REG_ADMIN_URL);
515
+				$actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Registration', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>';
516 516
 			}
517
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registration', 'espresso_registrations_ee_delete_registrations', $item->ID() ) ) {
518
-				$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_registrations', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL );
517
+			if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_ee_delete_registrations', $item->ID())) {
518
+				$delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_registrations', '_REG_ID'=>$item->ID()), REG_ADMIN_URL);
519 519
 
520
-				$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Registration Permanently', 'event_espresso' ). '">' . __( 'Delete', 'event_espresso' ) . '</a>';
520
+				$actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Registration Permanently', 'event_espresso').'">'.__('Delete', 'event_espresso').'</a>';
521 521
 			}
522 522
 		}
523 523
 
524
-		return sprintf('%1$s %2$s', $link, $this->row_actions($actions) );
524
+		return sprintf('%1$s %2$s', $link, $this->row_actions($actions));
525 525
 	}
526 526
 
527 527
 
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 	 * @return string
535 535
 	 * @throws \EE_Error
536 536
 	 */
537
-	public function column_ATT_email( EE_Registration $item ) {
537
+	public function column_ATT_email(EE_Registration $item) {
538 538
 		$attendee = $item->get_first_related('Attendee');
539 539
 		return ! $attendee instanceof EE_Attendee ? __('No attached contact record.', 'event_espresso') : $attendee->email();
540 540
 	}
@@ -548,8 +548,8 @@  discard block
 block discarded – undo
548 548
 	 * @param \EE_Registration $item
549 549
 	 * @return string
550 550
 	 */
551
-	public function column__REG_count(EE_Registration $item){
552
-		return  sprintf(__( '%1$s / %2$s', 'event_espresso' ), $item->count(), $item->group_size());
551
+	public function column__REG_count(EE_Registration $item) {
552
+		return  sprintf(__('%1$s / %2$s', 'event_espresso'), $item->count(), $item->group_size());
553 553
 	}
554 554
 
555 555
 
@@ -561,16 +561,16 @@  discard block
 block discarded – undo
561 561
 	 * @param \EE_Registration $item
562 562
 	 * @return string
563 563
 	 */
564
-	public function column_PRC_amount(EE_Registration $item){
564
+	public function column_PRC_amount(EE_Registration $item) {
565 565
 		$ticket = $item->ticket();
566 566
 
567
-		$content = isset( $_GET['event_id'] ) && $ticket instanceof EE_Ticket ? '<span class="TKT_name">' . $ticket->name() . '</span><br />' : '';
567
+		$content = isset($_GET['event_id']) && $ticket instanceof EE_Ticket ? '<span class="TKT_name">'.$ticket->name().'</span><br />' : '';
568 568
 
569
-		if ( $item->final_price() > 0 ) {
570
-			$content .= '<span class="reg-pad-rght">' . $item->pretty_final_price() . '</span>';
569
+		if ($item->final_price() > 0) {
570
+			$content .= '<span class="reg-pad-rght">'.$item->pretty_final_price().'</span>';
571 571
 		} else {
572 572
 			// free event
573
-			$content .= '<span class="reg-overview-free-event-spn reg-pad-rght">' . __( 'free', 'event_espresso' ) . '</span>';
573
+			$content .= '<span class="reg-overview-free-event-spn reg-pad-rght">'.__('free', 'event_espresso').'</span>';
574 574
 		}
575 575
 
576 576
 		return $content;
@@ -586,11 +586,11 @@  discard block
 block discarded – undo
586 586
 	 * @param \EE_Registration $item
587 587
 	 * @return string
588 588
 	 */
589
-	public function column__REG_final_price(EE_Registration $item){
589
+	public function column__REG_final_price(EE_Registration $item) {
590 590
 		$ticket = $item->ticket();
591
-		$content = isset( $_GET['event_id'] ) || ! $ticket instanceof EE_Ticket ? '' : '<span class="TKT_name">' . $ticket->name() . '</span><br />';
591
+		$content = isset($_GET['event_id']) || ! $ticket instanceof EE_Ticket ? '' : '<span class="TKT_name">'.$ticket->name().'</span><br />';
592 592
 
593
-		$content .= '<span class="reg-pad-rght">' .  $item->pretty_final_price() . '</span>';
593
+		$content .= '<span class="reg-pad-rght">'.$item->pretty_final_price().'</span>';
594 594
 		return $content;
595 595
 
596 596
 	}
@@ -604,13 +604,13 @@  discard block
 block discarded – undo
604 604
 	 * @param \EE_Registration $item
605 605
 	 * @return string
606 606
 	 */
607
-	public function column__REG_paid(EE_Registration $item){
607
+	public function column__REG_paid(EE_Registration $item) {
608 608
 		$payment_method = $item->payment_method();
609
-		$payment_method_name = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() : __( 'Unknown', 'event_espresso' );
609
+		$payment_method_name = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() : __('Unknown', 'event_espresso');
610 610
 
611
-		$content = '<span class="reg-pad-rght">' .  $item->pretty_paid() . '</span>';
612
-		if ( $item->paid() > 0 ) {
613
-			$content .= '<br><span class="ee-status-text-small">' . sprintf( __( '...via %s', 'event_espresso' ), $payment_method_name ) . '</span>';
611
+		$content = '<span class="reg-pad-rght">'.$item->pretty_paid().'</span>';
612
+		if ($item->paid() > 0) {
613
+			$content .= '<br><span class="ee-status-text-small">'.sprintf(__('...via %s', 'event_espresso'), $payment_method_name).'</span>';
614 614
 		}
615 615
 		return $content;
616 616
 	}
@@ -625,11 +625,11 @@  discard block
 block discarded – undo
625 625
 	 * @return string
626 626
 	 * @throws \EE_Error
627 627
 	 */
628
-	public function column_TXN_total(EE_Registration $item){
629
-		if($item->transaction()){
630
-			$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID() ), TXN_ADMIN_URL );
631
-			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>';
632
-		}else{
628
+	public function column_TXN_total(EE_Registration $item) {
629
+		if ($item->transaction()) {
630
+			$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID()), TXN_ADMIN_URL);
631
+			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>';
632
+		} else {
633 633
 			return __("None", "event_espresso");
634 634
 		}
635 635
 	}
@@ -644,15 +644,15 @@  discard block
 block discarded – undo
644 644
 	 * @return string
645 645
 	 * @throws \EE_Error
646 646
 	 */
647
-	public function column_TXN_paid(EE_Registration $item){
647
+	public function column_TXN_paid(EE_Registration $item) {
648 648
 
649
-		if ( $item->count() === 1 ) {
649
+		if ($item->count() === 1) {
650 650
 			$transaction = $item->transaction() ? $item->transaction() : EE_Transaction::new_instance();
651
-			if ( $transaction->paid() >= $transaction->total() ) {
651
+			if ($transaction->paid() >= $transaction->total()) {
652 652
 				return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>';
653 653
 			} else {
654
-				$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID() ), TXN_ADMIN_URL );
655
-				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>';
654
+				$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID()), TXN_ADMIN_URL);
655
+				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>';
656 656
 			}
657 657
 		}
658 658
 
@@ -673,42 +673,42 @@  discard block
 block discarded – undo
673 673
 	public function column_actions(EE_Registration $item) {
674 674
 		$actions = array();
675 675
 		$attendee = $item->attendee();
676
-		$this->_set_related_details( $item );
676
+		$this->_set_related_details($item);
677 677
 
678 678
 		//Build row actions
679
-		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL );
680
-		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->attendee_ID() ), REG_ADMIN_URL );
679
+		$view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$item->ID()), REG_ADMIN_URL);
680
+		$edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->attendee_ID()), REG_ADMIN_URL);
681 681
 
682 682
 		// page=attendees&event_admin_reports=resend_email&registration_id=43653465634&event_id=2&form_action=resend_email
683 683
 		//$resend_reg_lnk_url_params = array( 'action'=>'resend_registration', '_REG_ID'=>$item->REG_ID );
684
-		$resend_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'resend_registration', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL, true );
684
+		$resend_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'resend_registration', '_REG_ID'=>$item->ID()), REG_ADMIN_URL, true);
685 685
 
686 686
 
687 687
 		//Build row actions
688
-		$actions['view_lnk'] = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ? '
688
+		$actions['view_lnk'] = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID()) ? '
689 689
 			<li>
690
-			<a href="'.$view_lnk_url.'" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '" class="tiny-text">
690
+			<a href="'.$view_lnk_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'" class="tiny-text">
691 691
 				<div class="dashicons dashicons-clipboard"></div>
692 692
 			</a>
693 693
 			</li>' : '';
694
-		$actions['edit_lnk'] = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee' ) &&  $attendee instanceof EE_Attendee ?'
694
+		$actions['edit_lnk'] = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') && $attendee instanceof EE_Attendee ? '
695 695
 			<li>
696
-			<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact Details', 'event_espresso' ) . '" class="tiny-text">
696
+			<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact Details', 'event_espresso').'" class="tiny-text">
697 697
 				<div class="ee-icon ee-icon-user-edit ee-icon-size-16"></div>
698 698
 			</a>
699 699
 			</li>' : '';
700
-		$actions['resend_reg_lnk'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration', $item->ID() ) ? '
700
+		$actions['resend_reg_lnk'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration', $item->ID()) ? '
701 701
 			<li>
702
-			<a href="'.$resend_reg_lnk_url.'" title="' . esc_attr__( 'Resend Registration Details', 'event_espresso' ) . '" class="tiny-text">
702
+			<a href="'.$resend_reg_lnk_url.'" title="'.esc_attr__('Resend Registration Details', 'event_espresso').'" class="tiny-text">
703 703
 				<div class="dashicons dashicons-email-alt"></div>
704 704
 			</a>
705 705
 			</li>' : '';
706 706
 
707 707
 		// page=transactions&action=view_transaction&txn=256&_wpnonce=6414da4dbb
708
-		$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 );
709
-		$actions['view_txn_lnk'] = EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction', $this->_transaction_details['id'] ) ? '
708
+		$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);
709
+		$actions['view_txn_lnk'] = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $this->_transaction_details['id']) ? '
710 710
 			<li>
711
-			<a class="ee-status-color-' . $this->_transaction_details['status'] . ' tiny-text" href="'.$view_txn_lnk_url.'"  title="' . $this->_transaction_details['title_attr'] . '">
711
+			<a class="ee-status-color-' . $this->_transaction_details['status'].' tiny-text" href="'.$view_txn_lnk_url.'"  title="'.$this->_transaction_details['title_attr'].'">
712 712
 				<div class="dashicons dashicons-cart"></div>
713 713
 			</a>
714 714
 			</li>' : '';
@@ -717,17 +717,17 @@  discard block
 block discarded – undo
717 717
 		$actions['dl_invoice_lnk'] = '';
718 718
 		$dl_invoice_lnk_url = $item->invoice_url();
719 719
 		//only show invoice link if message type is active.
720
-		if ( $attendee instanceof EE_Attendee && $item->is_primary_registrant() && EEH_MSG_Template::is_mt_active( 'invoice' ) ) {
720
+		if ($attendee instanceof EE_Attendee && $item->is_primary_registrant() && EEH_MSG_Template::is_mt_active('invoice')) {
721 721
 			$actions['dl_invoice_lnk'] = '
722 722
 		<li>
723
-			<a title="' . esc_attr__( 'View Transaction Invoice', 'event_espresso' ) . '" target="_blank" href="'.$dl_invoice_lnk_url.'" class="tiny-text">
723
+			<a title="' . esc_attr__('View Transaction Invoice', 'event_espresso').'" target="_blank" href="'.$dl_invoice_lnk_url.'" class="tiny-text">
724 724
 				<span class="dashicons dashicons-media-spreadsheet ee-icon-size-18"></span>
725 725
 			</a>
726 726
 		</li>';
727 727
 		}
728 728
 		$actions['filtered_messages_link'] = '';
729 729
 		//message list table link (filtered by REG_ID
730
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) {
730
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
731 731
 			$actions['filtered_messages_link'] = '<li>'
732 732
 			                          . EEH_MSG_Template::get_message_action_link(
733 733
 											'see_notifications_for',
@@ -738,9 +738,9 @@  discard block
 block discarded – undo
738 738
 											)
739 739
 			                          . '</li>';
740 740
 		}
741
-		$actions = apply_filters( 'FHEE__EE_Registrations_List_Table__column_actions__actions', $actions, $item, $this );
741
+		$actions = apply_filters('FHEE__EE_Registrations_List_Table__column_actions__actions', $actions, $item, $this);
742 742
 		return $this->_action_string(
743
-			implode( '',  $actions ),
743
+			implode('', $actions),
744 744
 			$item,
745 745
 			'ul',
746 746
 			'reg-overview-actions-ul'
Please login to merge, or discard this patch.
core/libraries/form_sections/base/EE_Form_Section_Validatable.form.php 2 patches
Spacing   +15 added lines, -15 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
 /**
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
  *
35 35
  * ------------------------------------------------------------------------
36 36
  */
37
-abstract class EE_Form_Section_Validatable extends EE_Form_Section_Base{
37
+abstract class EE_Form_Section_Validatable extends EE_Form_Section_Base {
38 38
 
39 39
 	/**
40 40
 	 * Array of validation errors in this section. Does not contain validation errors in subsections, however.
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 * called get_validation_errors_accumulated
50 50
 	 * @return EE_Validation_Error[]
51 51
 	 */
52
-	public function get_validation_errors(){
52
+	public function get_validation_errors() {
53 53
 		return $this->_validation_errors;
54 54
 	}
55 55
 	/**
@@ -57,16 +57,16 @@  discard block
 block discarded – undo
57 57
 	 * If we want this to be customizable, we may decide to create a strategy for displaying it.
58 58
 	 * @return string
59 59
 	 */
60
-	public function get_validation_error_string(){
60
+	public function get_validation_error_string() {
61 61
 		$validation_error_messages = array();
62
-		if($this->get_validation_errors()){
63
-			foreach($this->get_validation_errors() as $validation_error){
64
-				if ( $validation_error instanceof EE_Validation_Error ) {
65
-					$validation_error_messages[] =$validation_error->getMessage();
62
+		if ($this->get_validation_errors()) {
63
+			foreach ($this->get_validation_errors() as $validation_error) {
64
+				if ($validation_error instanceof EE_Validation_Error) {
65
+					$validation_error_messages[] = $validation_error->getMessage();
66 66
 				}
67 67
 			}
68 68
 		}
69
-		return implode(", ",$validation_error_messages);
69
+		return implode(", ", $validation_error_messages);
70 70
 	}
71 71
 
72 72
 
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
 	 * @return boolean
83 83
 	 */
84 84
 	public function is_valid() {
85
-		if(count($this->_validation_errors)){
85
+		if (count($this->_validation_errors)) {
86 86
 			return false;
87
-		}else{
87
+		} else {
88 88
 			return true;
89 89
 		}
90 90
 	}
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
 	 * @param Exception $previous_exception if there was an exception that caused the error, that exception
110 110
 	 * @return void
111 111
 	 */
112
-	public function add_validation_error( $message_or_object, $error_code = NULL, $previous_exception = NULL ){
113
-		if($message_or_object instanceof EE_Validation_Error){
114
-			$validation_error= $message_or_object;
112
+	public function add_validation_error($message_or_object, $error_code = NULL, $previous_exception = NULL) {
113
+		if ($message_or_object instanceof EE_Validation_Error) {
114
+			$validation_error = $message_or_object;
115 115
 			$validation_error->set_form_section($this);
116
-		}else{
116
+		} else {
117 117
 			$validation_error = new EE_Validation_Error($message_or_object, $error_code, $this, $previous_exception);
118 118
 		}
119 119
 		$this->_validation_errors[] = $validation_error;
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 				$validation_error_message = $default_validation_strategy->get_validation_error_message();
43 43
 			}
44 44
 			throw new EE_Validation_Error( $validation_error_message, 'float_only' );
45
-		}else{
45
+		} else{
46 46
 			return floatval($normalized_value);
47 47
 		}
48 48
 	}
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	public function unnormalize($normalized_value) {
56 56
 		if( empty( $normalized_value ) ){
57 57
 			return '0.00';
58
-		}else{
58
+		} else{
59 59
 			return "$normalized_value";
60 60
 		}
61 61
 	}
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Hidden_Input.input.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,20 +6,20 @@
 block discarded – undo
6 6
  * @subpackage
7 7
  * @author				Mike Nelson
8 8
  */
9
-class EE_Hidden_Input extends EE_Form_Input_Base{
9
+class EE_Hidden_Input extends EE_Form_Input_Base {
10 10
 
11 11
 	/**
12 12
 	 * @param array $input_settings
13 13
 	 */
14
-	public function __construct($input_settings = array()){
14
+	public function __construct($input_settings = array()) {
15 15
 		//require_once('strategies/display_strategies/EE_Text_Input_Display_Strategy.strategy.php');
16 16
 		$this->_set_display_strategy(new EE_Hidden_Display_Strategy());
17
-		if ( isset( $input_settings['normalization_strategy'] ) && $input_settings['normalization_strategy'] instanceof EE_Normalization_Strategy_Base ) {
18
-			$this->_set_normalization_strategy( $input_settings['normalization_strategy'] );
17
+		if (isset($input_settings['normalization_strategy']) && $input_settings['normalization_strategy'] instanceof EE_Normalization_Strategy_Base) {
18
+			$this->_set_normalization_strategy($input_settings['normalization_strategy']);
19 19
 		} else {
20
-			$this->_set_normalization_strategy( new EE_Text_Normalization() );
20
+			$this->_set_normalization_strategy(new EE_Text_Normalization());
21 21
 		}
22
-		parent::__construct( $input_settings );
22
+		parent::__construct($input_settings);
23 23
 	}
24 24
 
25 25
 
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Submit_Input.input.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,15 +8,15 @@
 block discarded – undo
8 8
  *
9 9
  * This input has a default validation strategy of plaintext (which can be removed after construction)
10 10
  */
11
-class EE_Submit_Input extends EE_Form_Input_Base{
11
+class EE_Submit_Input extends EE_Form_Input_Base {
12 12
 
13 13
 	/**
14 14
 	 * @param array $options
15 15
 	 */
16
-	public function __construct($options = array()){
16
+	public function __construct($options = array()) {
17 17
 		$this->_set_display_strategy(new EE_Submit_Input_Display_Strategy());
18 18
 		$this->_set_normalization_strategy(new EE_Text_Normalization());
19
-		$this->_add_validation_strategy( new EE_Plaintext_Validation_Strategy() );
19
+		$this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy());
20 20
 		parent::__construct($options);
21 21
 	}
22 22
 }
23 23
\ No newline at end of file
Please login to merge, or discard this patch.