Completed
Branch old/BUG-7514-7935-7936-price-o... (518ae6)
by
unknown
25:14 queued 22:51
created
messages/message_type/EE_Not_Approved_Registration_message_type.class.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 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
 /**
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Payment_List_Shortcodes.lib.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
10 10
 	exit('NO direct script access allowed');
11 11
 
12 12
 /**
@@ -32,18 +32,18 @@  discard block
 block discarded – undo
32 32
 		$this->label = __('Payment List Shortcodes', 'event_espresso');
33 33
 		$this->description = __('All shortcodes specific to payment lists', 'event_espresso');
34 34
 		$this->_shortcodes = array(
35
-			'[PAYMENT_LIST_*]' => __('Outputs a list of payment items. Note, this is a dynamic shortcode in that it accepts some attributes for setting certain defaults.  Attributes that are available are:', 'event_espresso') . '<p><ul>' .
36
-				'<li><strong>no_payments</strong>:' . sprintf( __('Indicate with this attribute what will be used if there are no payments present.  Default is: "%sNo approved payments have been received.%s"', 'event_espresso'),  htmlspecialchars('<td class="aln-cntr" colspan="6">'), htmlspecialchars('</td>') ) . '</li>' .
35
+			'[PAYMENT_LIST_*]' => __('Outputs a list of payment items. Note, this is a dynamic shortcode in that it accepts some attributes for setting certain defaults.  Attributes that are available are:', 'event_espresso').'<p><ul>'.
36
+				'<li><strong>no_payments</strong>:'.sprintf(__('Indicate with this attribute what will be used if there are no payments present.  Default is: "%sNo approved payments have been received.%s"', 'event_espresso'), htmlspecialchars('<td class="aln-cntr" colspan="6">'), htmlspecialchars('</td>')).'</li>'.
37 37
 				'</ul></p>'
38 38
 			);
39 39
 	}
40 40
 
41 41
 
42 42
 
43
-	protected function _parser( $shortcode ) {
43
+	protected function _parser($shortcode) {
44 44
 
45
-		if ( strpos( $shortcode, '[PAYMENT_LIST_*' ) !== FALSE ) {
46
-			return $this->_get_payment_list( $shortcode );
45
+		if (strpos($shortcode, '[PAYMENT_LIST_*') !== FALSE) {
46
+			return $this->_get_payment_list($shortcode);
47 47
 		}
48 48
 		return '';
49 49
 	}
@@ -60,33 +60,33 @@  discard block
 block discarded – undo
60 60
 	 *
61 61
 	 * @return string parsed ticket line item list.
62 62
 	 */
63
-	private function _get_payment_list( $shortcode ) {
63
+	private function _get_payment_list($shortcode) {
64 64
 		$this->_validate_list_requirements();
65 65
 		$this->_set_shortcode_helper();
66 66
 
67 67
 
68
-		if ( ! $this->_data['data'] instanceof EE_Messages_Addressee ) {
68
+		if ( ! $this->_data['data'] instanceof EE_Messages_Addressee) {
69 69
 			return '';
70 70
 		}
71 71
 
72
-		$valid_shortcodes = array( 'payment' );
72
+		$valid_shortcodes = array('payment');
73 73
 
74 74
 		$addressee_obj = $this->_data['data'];
75 75
 		$templates = $this->_extra_data['template'];
76 76
 		$payments = $addressee_obj->payments;
77 77
 
78 78
 		//let's get any attributes that may be present and set the defaults.
79
-		$atts = $this->_get_shortcode_attrs( $shortcode );
79
+		$atts = $this->_get_shortcode_attrs($shortcode);
80 80
 
81
-		$no_payments_msg = empty( $atts['no_payments'] ) ?  __('No approved payments have been received.','event_espresso') : $atts['no_payments'];
81
+		$no_payments_msg = empty($atts['no_payments']) ?  __('No approved payments have been received.', 'event_espresso') : $atts['no_payments'];
82 82
 
83 83
 		//made it here so we have an array of paymnets, so we should have what we need.
84
-		$payment_content = empty( $payments ) ? $no_payments_msg : '';
84
+		$payment_content = empty($payments) ? $no_payments_msg : '';
85 85
 
86 86
 		$payments = (array) $payments;
87 87
 
88
-		foreach ( $payments as $payment ) {
89
-			$payment_content .= $this->_shortcode_helper->parse_payment_list_template( $templates['payment_list'], $payment, $valid_shortcodes, $this->_extra_data );
88
+		foreach ($payments as $payment) {
89
+			$payment_content .= $this->_shortcode_helper->parse_payment_list_template($templates['payment_list'], $payment, $valid_shortcodes, $this->_extra_data);
90 90
 		}
91 91
 
92 92
 		return $payment_content;
Please login to merge, or discard this patch.
admin_pages/events/help_tours/Event_Editor_Help_Tour.class.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -122,14 +122,14 @@  discard block
 block discarded – undo
122 122
 					'tipLocation' => 'left'
123 123
 					)
124 124
 				),
125
-            110 => array(
125
+			110 => array(
126 126
 				'id' => 'espresso_event_editor_event_options',
127 127
 				'content' => $this->_event_registration_options_stop(),
128 128
 				'options' => array(
129 129
 					'tipLocation' => 'left'
130 130
 					)
131 131
 				),
132
-            120 => array(
132
+			120 => array(
133 133
 				'id' => 'submitpost',
134 134
 				'content' => $this->_publish_event_stop(),
135 135
 				'options' => array(
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 		return '<p>' . __('Set a feature image for your event here.', 'event_espresso') . '</p>';
196 196
 	}
197 197
     
198
-    protected function _publish_event_stop() {
198
+	protected function _publish_event_stop() {
199 199
 		return '<p>' . __('Easily control the state of your event. The main states are Published, Pending Review, and Draft. Additional states are Cancelled, Postponed, and Sold Out.', 'event_espresso') . '</p>';
200 200
 	}
201 201
 	
Please login to merge, or discard this patch.
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
 /**
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
 
143 143
 
144 144
 	protected function _start() {
145
-		$content = '<h3>' . __('Event Editor', 'event_espresso') . '</h3>';
146
-		$content .= '<p>' . __('This tour of the Event Editor will provide an overview of the different areas of the screen to help you understand what they are used for. Let\'s get started on setting up your first event with Event Espresso!', 'event_espresso') . '</p>';
145
+		$content = '<h3>'.__('Event Editor', 'event_espresso').'</h3>';
146
+		$content .= '<p>'.__('This tour of the Event Editor will provide an overview of the different areas of the screen to help you understand what they are used for. Let\'s get started on setting up your first event with Event Espresso!', 'event_espresso').'</p>';
147 147
 		return $content;
148 148
 	}
149 149
 
@@ -152,51 +152,51 @@  discard block
 block discarded – undo
152 152
 	}
153 153
 
154 154
 	protected function _event_description_stop() {
155
-		return '<p>' . __('The rich text editor can be used to add information about your event. Images and links can also be added along with your text.', 'event_espresso') . '</p>';
155
+		return '<p>'.__('The rich text editor can be used to add information about your event. Images and links can also be added along with your text.', 'event_espresso').'</p>';
156 156
 	}
157 157
 
158 158
 	protected function _event_venues_caf() {
159
-		return '<p>' . __('In this section, you can select the venue that is hosting your event.', 'event_espresso') . '</p>';
159
+		return '<p>'.__('In this section, you can select the venue that is hosting your event.', 'event_espresso').'</p>';
160 160
 	}
161 161
 
162 162
 	protected function _event_venues_stop() {
163
-		return '<p>' . __('In this section, you can enter information about the venue that is hosting your event.', 'event_espresso') . '</p>';
163
+		return '<p>'.__('In this section, you can enter information about the venue that is hosting your event.', 'event_espresso').'</p>';
164 164
 	}
165 165
 
166 166
 	protected function _event_pricing_stop() {
167
-		return '<p>' . __('Use the Event Datetime & Ticket section to enter details about when the event is happening and what tickets you want to offer for access to the event.', 'event_espresso') . '</p>';
167
+		return '<p>'.__('Use the Event Datetime & Ticket section to enter details about when the event is happening and what tickets you want to offer for access to the event.', 'event_espresso').'</p>';
168 168
 	}
169 169
 
170 170
 	protected function _event_pricing_caf() {
171
-		return '<p>' . __('Use the Event Datetimes & Ticket section to enter details about when the event is happening and what tickets you want to offer for access to the event.', 'event_espresso') . '</p>';
171
+		return '<p>'.__('Use the Event Datetimes & Ticket section to enter details about when the event is happening and what tickets you want to offer for access to the event.', 'event_espresso').'</p>';
172 172
 	}
173 173
 	
174 174
 	protected function _event_registration_options_stop() {
175
-		return '<p>' . __('Setup custom options for your event registration.', 'event_espresso') . '</p>';
175
+		return '<p>'.__('Setup custom options for your event registration.', 'event_espresso').'</p>';
176 176
 	}
177 177
 	
178 178
 	protected function _event_post_tag_stop() {
179
-		return '<p>' . __('Quickly add tags to your event.', 'event_espresso') . '</p>';
179
+		return '<p>'.__('Quickly add tags to your event.', 'event_espresso').'</p>';
180 180
 	}
181 181
 
182 182
 	protected function _event_categories_stop() {
183
-		return '<p>' . __('Events can also be categorized if you wish.', 'event_espresso') . '</p>';
183
+		return '<p>'.__('Events can also be categorized if you wish.', 'event_espresso').'</p>';
184 184
 	}
185 185
 
186 186
 	protected function _primary_question_stop_caf() {
187
-		return '<p>' . __('Use the questions group to request information from your primary registrant.', 'event_espresso') . '</p>';
187
+		return '<p>'.__('Use the questions group to request information from your primary registrant.', 'event_espresso').'</p>';
188 188
 	}
189 189
 
190 190
 	protected function _additional_questions_stop_caf() {
191
-		return '<p>' . __('Use the questions group to request information from your additional registrant.', 'event_espresso') . '</p>';
191
+		return '<p>'.__('Use the questions group to request information from your additional registrant.', 'event_espresso').'</p>';
192 192
 	}
193 193
 	
194 194
 	protected function _featured_image_stop() {
195
-		return '<p>' . __('Set a feature image for your event here.', 'event_espresso') . '</p>';
195
+		return '<p>'.__('Set a feature image for your event here.', 'event_espresso').'</p>';
196 196
 	}
197 197
     
198 198
     protected function _publish_event_stop() {
199
-		return '<p>' . __('Easily control the state of your event. The main states are Published, Pending Review, and Draft. Additional states are Cancelled, Postponed, and Sold Out.', 'event_espresso') . '</p>';
199
+		return '<p>'.__('Easily control the state of your event. The main states are Published, Pending Review, and Draft. Additional states are Cancelled, Postponed, and Sold Out.', 'event_espresso').'</p>';
200 200
 	}
201 201
 	
202 202
 }
203 203
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
single_page_checkout/templates/registration_page_wrapper.template.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
1 1
 <div id="ee-single-page-checkout-dv" class="">
2
-	<?php if ( apply_filters(
2
+	<?php if (apply_filters(
3 3
 			'FHEE__registration_page_wrapper_template__display_time_limit',
4
-			FALSE ) ) { ?>
4
+			FALSE )) { ?>
5 5
 	<p id="spco-registration-time-limit-pg" class="spco-steps-pg ee-attention important-notice">
6 6
 		<?php echo sprintf(
7 7
 			apply_filters(
8 8
 				'FHEE__registration_page_wrapper_template___time_limit',
9 9
 				__('You have %1$s to complete your registration.', 'event_espresso')
10 10
 			),
11
-			'<span id="spco-registration-time-limit-spn" class="spco-registration-time-limit-spn">' . $registration_time_limit	. '</span>'
11
+			'<span id="spco-registration-time-limit-spn" class="spco-registration-time-limit-spn">'.$registration_time_limit.'</span>'
12 12
 		);
13 13
 		?>
14 14
 		<span id="spco-registration-expiration-spn" class=""
@@ -16,27 +16,27 @@  discard block
 block discarded – undo
16 16
 	</p>
17 17
 	<?php } ?>
18 18
 	<?php
19
-if ( ! $empty_cart ) {
20
-	if ( ! $revisit && apply_filters( 'FHEE__registration_page_wrapper_template__steps_display', TRUE )) {
19
+if ( ! $empty_cart) {
20
+	if ( ! $revisit && apply_filters('FHEE__registration_page_wrapper_template__steps_display', TRUE)) {
21 21
 ?>
22 22
 	<h2 id="spco-steps-big-hdr" class="spco-steps-big-hdr"><?php _e(' Steps', 'event_espresso'); ?></h2>
23 23
 
24 24
 	<div id="spco-steps-display-dv">
25 25
 	<?php
26 26
 		$step_nmbr = 1;
27
-		$total_steps = count( $reg_steps ) - 1;
28
-		foreach ( $reg_steps as $reg_step ) {
29
-			if ( $reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration' ) {
27
+		$total_steps = count($reg_steps) - 1;
28
+		foreach ($reg_steps as $reg_step) {
29
+			if ($reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration') {
30 30
 				$slug = $reg_step->slug();
31 31
 				$step_display_dv_class = $reg_step->is_current_step() ? 'active-step' : 'inactive-step';
32 32
 		?>
33 33
 		<div id="spco-step-<?php echo $slug; ?>-display-dv" class="spco-step-display-dv <?php echo $step_display_dv_class; ?> steps-<?php echo $total_steps; ?>">
34 34
 			<h4 id="spco-step-<?php echo $slug; ?>-display-hdr" class="spco-steps-display-hdr">
35
-				<span class="spco-step-big-nmbr"><?php echo $step_nmbr; ?></span>&nbsp;<span class="spco-step-name"><?php echo str_replace( '&nbsp;', '<br/>&nbsp;', $reg_step->name() ); ?></span>
35
+				<span class="spco-step-big-nmbr"><?php echo $step_nmbr; ?></span>&nbsp;<span class="spco-step-name"><?php echo str_replace('&nbsp;', '<br/>&nbsp;', $reg_step->name()); ?></span>
36 36
 			</h4>
37 37
 		</div>
38 38
 
39
-		<?php if ( $step_nmbr < $total_steps ) { ?>
39
+		<?php if ($step_nmbr < $total_steps) { ?>
40 40
 		<div class="spco-step-arrow-dv">&raquo;</div>
41 41
 		<?php
42 42
 				}
@@ -50,22 +50,22 @@  discard block
 block discarded – undo
50 50
 	<?php
51 51
 	}
52 52
 
53
-	do_action( 'AHEE__SPCO__before_registration_steps' );
53
+	do_action('AHEE__SPCO__before_registration_steps');
54 54
 	$step_nmbr = 1;
55
-	foreach ( $reg_steps as $reg_step ) {
56
-		if ( $reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration' ) {
55
+	foreach ($reg_steps as $reg_step) {
56
+		if ($reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration') {
57 57
 			$slug = $reg_step->slug();
58
-			do_action( 'AHEE__' . $slug . '__reg_step_start', $reg_step );
58
+			do_action('AHEE__'.$slug.'__reg_step_start', $reg_step);
59 59
 			// todo: deprecate hook AHEE__registration_page_attendee_information__start
60 60
 	?>
61 61
 		<div id="spco-<?php echo $slug; ?>-dv" class="spco-step-dv <?php echo $reg_step->div_class(); ?>">
62 62
 			<?php echo $reg_step->display_reg_form(); ?>
63
-			<?php do_action( 'AHEE__SPCO_after_reg_step_form', $slug, $next_step ); ?>
63
+			<?php do_action('AHEE__SPCO_after_reg_step_form', $slug, $next_step); ?>
64 64
 		</div>
65 65
 			<?php $step_nmbr++;
66 66
 		}
67 67
 	}
68
-	do_action( 'AHEE__SPCO__after_registration_steps' );
68
+	do_action('AHEE__SPCO__after_registration_steps');
69 69
 
70 70
 } else {
71 71
 ?>
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	<p><?php echo $empty_msg; ?></p>
74 74
 <?php
75 75
 }
76
-do_action( 'AHEE__SPCO__reg_form_footer' );
76
+do_action('AHEE__SPCO__reg_form_footer');
77 77
 ?>
78 78
 
79 79
 </div>
Please login to merge, or discard this patch.
admin_pages/registrations/Registrations_Admin_Page.core.php 3 patches
Indentation   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
 
124 124
 	/**
125 125
 	 * 		grab url requests and route them
126
-	*		@access private
127
-	*		@return void
128
-	*/
126
+	 *		@access private
127
+	 *		@return void
128
+	 */
129 129
 	public function _set_page_routes() {
130 130
 
131 131
 		$this->_get_registration_status_array();
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 						'title' => __('Registrations Other', 'event_espresso'),
398 398
 						'filename' => 'registrations_overview_other'
399 399
 					)
400
-                ),
400
+				),
401 401
 				'help_tour' => array( 'Registration_Overview_Help_Tour' ),
402 402
 				'qtips' => array('Registration_List_Table_Tips'),
403 403
 				'list_table' => 'EE_Registrations_List_Table',
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 					'url' => isset($this->_req_data['_REG_ID']) ? add_query_arg(array('_REG_ID' => $this->_req_data['_REG_ID'] ), $this->_current_page_view_url )  : $this->_admin_base_url,
412 412
 					'persistent' => FALSE
413 413
 					),
414
-                'help_tabs' => array(
414
+				'help_tabs' => array(
415 415
 					'registrations_details_help_tab' => array(
416 416
 						'title' => __('Registration Details', 'event_espresso'),
417 417
 						'filename' => 'registrations_details'
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 					'order' => 20
475 475
 					),
476 476
 				'list_table' => 'EE_Attendee_Contact_List_Table',
477
-                'help_tabs' => array(
477
+				'help_tabs' => array(
478 478
 					'registrations_contact_list_help_tab' => array(
479 479
 						'title' => __('Registrations Contact List', 'event_espresso'),
480 480
 						'filename' => 'registrations_contact_list'
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 						'title' => __('Contact List Other', 'event_espresso'),
492 492
 						'filename' => 'registrations_contact_list_other'
493 493
 					)
494
-                ),
494
+				),
495 495
 				'help_tour' => array( 'Contact_List_Help_Tour' ),
496 496
 				'metaboxes' => array(),
497 497
 				'require_nonce' => FALSE
@@ -523,9 +523,9 @@  discard block
 block discarded – undo
523 523
 
524 524
 	/**
525 525
 	 * 		get list of registration statuses
526
-	*		@access private
527
-	*		@return void
528
-	*/
526
+	 *		@access private
527
+	 *		@return void
528
+	 */
529 529
 	private function _get_registration_status_array() {
530 530
 		self::$_reg_status = EEM_Registration::reg_status_array( array(), TRUE);
531 531
 	}
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 			return TRUE;
829 829
 		}
830 830
 
831
-	    $REG = EEM_Registration::instance();
831
+		$REG = EEM_Registration::instance();
832 832
 
833 833
 		$REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
834 834
 
@@ -1047,9 +1047,9 @@  discard block
 block discarded – undo
1047 1047
 
1048 1048
 	/**
1049 1049
 	 * 		generates HTML for the View Registration Details Admin page
1050
-	*		@access protected
1051
-	*		@return void
1052
-	*/
1050
+	 *		@access protected
1051
+	 *		@return void
1052
+	 */
1053 1053
 	protected function _registration_details() {
1054 1054
 
1055 1055
 		$this->_template_args = array();
@@ -1124,9 +1124,9 @@  discard block
 block discarded – undo
1124 1124
 
1125 1125
 	/**
1126 1126
 	 * 		_set_approve_or_decline_reg_status_buttons
1127
-	*		@access protected
1128
-	*		@return string
1129
-	*/
1127
+	 *		@access protected
1128
+	 *		@return string
1129
+	 */
1130 1130
 	protected function _set_approve_or_decline_reg_status_buttons() {
1131 1131
 
1132 1132
 		//is registration for free event OR for a completed transaction? This will determine whether the set to pending option is shown.
@@ -1296,10 +1296,10 @@  discard block
 block discarded – undo
1296 1296
 
1297 1297
 	/**
1298 1298
 	 * 		approve_registration
1299
-	*		@access protected
1300
-	*		@param bool $notify whether or not to notify the registrant about their approval.
1301
-	*		@return void
1302
-	*/
1299
+	 *		@access protected
1300
+	 *		@param bool $notify whether or not to notify the registrant about their approval.
1301
+	 *		@return void
1302
+	 */
1303 1303
 	protected function approve_registration( $notify = FALSE ) {
1304 1304
 		$result = $this->_set_registration_status( FALSE, EEM_Registration::status_id_approved, $notify );
1305 1305
 		$this->_reg_status_change_return( EEM_Registration::status_id_approved, $result );
@@ -1309,10 +1309,10 @@  discard block
 block discarded – undo
1309 1309
 
1310 1310
 	/**
1311 1311
 	 * 		decline_registration
1312
-	*		@access protected
1313
-	*		@param bool $notify whether or not to notify the registrant about their approval.
1314
-	*		@return void
1315
-	*/
1312
+	 *		@access protected
1313
+	 *		@param bool $notify whether or not to notify the registrant about their approval.
1314
+	 *		@return void
1315
+	 */
1316 1316
 	protected function decline_registration( $notify = FALSE ) {
1317 1317
 		$result = $this->_set_registration_status( FALSE, EEM_Registration::status_id_declined, $notify );
1318 1318
 		$this->_reg_status_change_return( EEM_Registration::status_id_declined, $result );
@@ -1323,10 +1323,10 @@  discard block
 block discarded – undo
1323 1323
 
1324 1324
 	/**
1325 1325
 	 * 		cancel_registration
1326
-	*		@access protected
1327
-	*		@param bool $notify whether or not to notify the registrant about their approval.
1328
-	*		@return void
1329
-	*/
1326
+	 *		@access protected
1327
+	 *		@param bool $notify whether or not to notify the registrant about their approval.
1328
+	 *		@return void
1329
+	 */
1330 1330
 	protected function cancel_registration( $notify = FALSE ) {
1331 1331
 		$result = $this->_set_registration_status( FALSE, EEM_Registration::status_id_cancelled, $notify );
1332 1332
 		$this->_reg_status_change_return( EEM_Registration::status_id_cancelled, $result );
@@ -1338,10 +1338,10 @@  discard block
 block discarded – undo
1338 1338
 
1339 1339
 	/**
1340 1340
 	 * 		not_approve_registration
1341
-	*		@access protected
1342
-	*		@param bool $notify whether or not to notify the registrant about their approval.
1343
-	*		@return void
1344
-	*/
1341
+	 *		@access protected
1342
+	 *		@param bool $notify whether or not to notify the registrant about their approval.
1343
+	 *		@return void
1344
+	 */
1345 1345
 	protected function not_approve_registration( $notify = FALSE ) {
1346 1346
 		$result = $this->_set_registration_status( FALSE, EEM_Registration::status_id_not_approved, $notify );
1347 1347
 		$this->_reg_status_change_return( EEM_Registration::status_id_not_approved, $result );
@@ -1351,10 +1351,10 @@  discard block
 block discarded – undo
1351 1351
 
1352 1352
 	/**
1353 1353
 	 * 		decline_registration
1354
-	*		@access protected
1355
-	*		@param bool $notify whether or not to notify the registrant about their approval.
1356
-	*		@return void
1357
-	*/
1354
+	 *		@access protected
1355
+	 *		@param bool $notify whether or not to notify the registrant about their approval.
1356
+	 *		@return void
1357
+	 */
1358 1358
 	protected function pending_registration( $notify = FALSE ) {
1359 1359
 		$result = $this->_set_registration_status( FALSE, EEM_Registration::status_id_pending_payment, $notify );
1360 1360
 		$this->_reg_status_change_return( EEM_Registration::status_id_pending_payment, $result );
@@ -1365,9 +1365,9 @@  discard block
 block discarded – undo
1365 1365
 
1366 1366
 	/**
1367 1367
 	 * 		generates HTML for the Registration main meta box
1368
-	*		@access public
1369
-	*		@return void
1370
-	*/
1368
+	 *		@access public
1369
+	 *		@return void
1370
+	 */
1371 1371
 	public function _reg_details_meta_box() {
1372 1372
 		$transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance();
1373 1373
 		$this->_session = $transaction->session_data();
@@ -1447,9 +1447,9 @@  discard block
 block discarded – undo
1447 1447
 
1448 1448
 	/**
1449 1449
 	 * 		generates HTML for the Registration Questions meta box
1450
-	*		@access public
1451
-	*		@return void
1452
-	*/
1450
+	 *		@access public
1451
+	 *		@return void
1452
+	 */
1453 1453
 	public function _reg_questions_meta_box() {
1454 1454
 
1455 1455
 		add_filter( 'FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', array( $this, 'form_before_question_group' ), 10, 1 );
@@ -1557,9 +1557,9 @@  discard block
 block discarded – undo
1557 1557
 
1558 1558
 	/**
1559 1559
 	 * 		generates HTML for the Registration main meta box
1560
-	*		@access protected
1561
-	*		@return void
1562
-	*/
1560
+	 *		@access protected
1561
+	 *		@return void
1562
+	 */
1563 1563
 	protected function _update_attendee_registration_form() {
1564 1564
 		$qstns = isset( $this->_req_data['qstn'] ) ? $this->_req_data['qstn'] : FALSE;
1565 1565
 		$REG_ID = isset( $this->_req_data['_REG_ID'] ) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
@@ -1641,12 +1641,12 @@  discard block
 block discarded – undo
1641 1641
 
1642 1642
 	/**
1643 1643
 	 * 		generates HTML for the Registration main meta box
1644
-	*		@access public
1645
-	*		@return void
1646
-	*/
1644
+	 *		@access public
1645
+	 *		@return void
1646
+	 */
1647 1647
 	public function _reg_attendees_meta_box() {
1648 1648
 
1649
-	    $REG = EEM_Registration::instance();
1649
+		$REG = EEM_Registration::instance();
1650 1650
 		//get all other registrations on this transaction, and cache
1651 1651
 		//the attendees for them so we don't have to run another query using force_join
1652 1652
 		$registrations = $REG->get_all(array(
@@ -1699,9 +1699,9 @@  discard block
 block discarded – undo
1699 1699
 
1700 1700
 	/**
1701 1701
 	 * 		generates HTML for the Edit Registration side meta box
1702
-	*		@access public
1703
-	*		@return void
1704
-	*/
1702
+	 *		@access public
1703
+	 *		@return void
1704
+	 */
1705 1705
 	public function _reg_registrant_side_meta_box() {
1706 1706
 
1707 1707
 		/*@var $attendee EE_Attendee */
@@ -2049,9 +2049,9 @@  discard block
 block discarded – undo
2049 2049
 
2050 2050
 	/**
2051 2051
 	 * 		set_reg_event
2052
-	*		@access private
2053
-	*		@return boolean
2054
-	*/
2052
+	 *		@access private
2053
+	 *		@return boolean
2054
+	 */
2055 2055
 	private function _set_reg_event() {
2056 2056
 		if ( is_object( $this->_reg_event )) {
2057 2057
 			return TRUE;
@@ -2155,9 +2155,9 @@  discard block
 block discarded – undo
2155 2155
 
2156 2156
 	/**
2157 2157
 	 * 		generates HTML for the Attendee Contact List
2158
-	*		@access protected
2159
-	*		@return void
2160
-	*/
2158
+	 *		@access protected
2159
+	 *		@return void
2160
+	 */
2161 2161
 	protected function _attendee_contact_list_table() {
2162 2162
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2163 2163
 		$this->_search_btn_label = __('Contacts', 'event_espresso');
@@ -2171,9 +2171,9 @@  discard block
 block discarded – undo
2171 2171
 	/**
2172 2172
 	 * 		get_attendees
2173 2173
 	 * 		@param bool $count whether to return count or data.
2174
-	*		@access public
2175
-	*		@return array
2176
-	*/
2174
+	 *		@access public
2175
+	 *		@return array
2176
+	 */
2177 2177
 	public function get_attendees( $per_page, $count = FALSE, $trash = FALSE ) {
2178 2178
 
2179 2179
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -2491,9 +2491,9 @@  discard block
 block discarded – undo
2491 2491
 
2492 2492
 	/**
2493 2493
 	 * 		_attendee_details
2494
-	*		@access protected
2495
-	*		@return void
2496
-	*/
2494
+	 *		@access protected
2495
+	 *		@return void
2496
+	 */
2497 2497
 	public function attendee_registrations_meta_box( $post ) {
2498 2498
 
2499 2499
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
@@ -2526,10 +2526,10 @@  discard block
 block discarded – undo
2526 2526
 
2527 2527
 	/**
2528 2528
 	 * 		_trash_or_restore_attendee
2529
-	*		@param boolean 		$trash - whether to move item to trash (TRUE) or restore it (FALSE)
2530
-	*		@access protected
2531
-	*		@return void
2532
-	*/
2529
+	 *		@param boolean 		$trash - whether to move item to trash (TRUE) or restore it (FALSE)
2530
+	 *		@access protected
2531
+	 *		@return void
2532
+	 */
2533 2533
 	protected function _trash_or_restore_attendees( $trash = TRUE ) {
2534 2534
 
2535 2535
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
Please login to merge, or discard this patch.
Braces   +30 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
@@ -79,8 +81,9 @@  discard block
 block discarded – undo
79 81
 	public function clear_comment_link( $link, $comment, $args ) {
80 82
 		//gotta make sure this only happens on this route
81 83
 		$post_type = get_post_type( $comment->comment_post_ID);
82
-		if ( $post_type == 'espresso_attendees' )
83
-			return '#commentsdiv';
84
+		if ( $post_type == 'espresso_attendees' ) {
85
+					return '#commentsdiv';
86
+		}
84 87
 		return $link;
85 88
 	}
86 89
 
@@ -832,9 +835,9 @@  discard block
 block discarded – undo
832 835
 
833 836
 		$REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
834 837
 
835
-		if ( $this->_registration = $REG->get_one_by_ID( $REG_ID ))
836
-			return TRUE;
837
-		else {
838
+		if ( $this->_registration = $REG->get_one_by_ID( $REG_ID )) {
839
+					return TRUE;
840
+		} else {
838 841
 			$error_msg = sprintf( __('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID );
839 842
 			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
840 843
 			$this->_registration = NULL;
@@ -930,7 +933,7 @@  discard block
 block discarded – undo
930 933
 					strtotime($curdate . $time_start),
931 934
 					strtotime($curdate . $time_end)
932 935
 			));
933
-		}elseif($this_month_a || $this_month){
936
+		} elseif($this_month_a || $this_month){
934 937
 			$this_month_r = date('m', current_time('timestamp'));
935 938
 			$days_this_month = date( 't', current_time('timestamp') );
936 939
 			$_where['REG_date']= array('BETWEEN',
@@ -938,17 +941,17 @@  discard block
 block discarded – undo
938 941
 					strtotime( $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start ),
939 942
 					strtotime( $this_year_r . '-' . $this_month_r . $days_this_month . ' ' . $time_end )
940 943
 			));
941
-		}elseif($month_range){
944
+		} elseif($month_range){
942 945
 			$pieces = explode(' ', $this->_req_data['month_range'], 3);
943 946
 			$month_r = !empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
944 947
 			$year_r = !empty($pieces[1]) ? $pieces[1] : '';
945 948
 			$_where['REG_date']= array('BETWEEN',
946 949
 				array( strtotime($year_r . '-' . $month_r . '-01 00:00:00'), strtotime($year_r . '-' . $month_r . '-31 23:59:59' ) ) );
947
-		}elseif($start_date && $end_date){
950
+		} elseif($start_date && $end_date){
948 951
 			throw new EE_Error("not yet supported");
949
-		}elseif($start_date){
952
+		} elseif($start_date){
950 953
 			throw new EE_Error("not yet supported");
951
-		}elseif($end_date){
954
+		} elseif($end_date){
952 955
 			throw new EE_Error("not yet supported");
953 956
 		}
954 957
 
@@ -1854,8 +1857,9 @@  discard block
 block discarded – undo
1854 1857
 			// cycle thru checkboxes
1855 1858
 			while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) {
1856 1859
 				$REG = $REG_MDL->get_one_by_ID($REG_ID);
1857
-				if ( ! $REG instanceof EE_Registration )
1858
-					continue;
1860
+				if ( ! $REG instanceof EE_Registration ) {
1861
+									continue;
1862
+				}
1859 1863
 				$deleted = $this->_delete_registration($REG);
1860 1864
 				if ( !$deleted ) {
1861 1865
 					$success = 0;
@@ -1894,8 +1898,9 @@  discard block
 block discarded – undo
1894 1898
 
1895 1899
 		$all_trashed = TRUE;
1896 1900
 		foreach ( $REGS as $registration ) {
1897
-			if ( ! $registration->get('REG_deleted') )
1898
-				$all_trashed = FALSE;
1901
+			if ( ! $registration->get('REG_deleted') ) {
1902
+							$all_trashed = FALSE;
1903
+			}
1899 1904
 		}
1900 1905
 
1901 1906
 		if ( ! $all_trashed ) {
@@ -1921,8 +1926,10 @@  discard block
 block discarded – undo
1921 1926
 			//now delete permanently the checkins related to this registration.
1922 1927
 			$registration->delete_related_permanently('Checkin');
1923 1928
 
1924
-			if ( $registration->ID() === $REG->ID() )
1925
-				continue; //we don't want to delete permanently the existing registration just yet.
1929
+			if ( $registration->ID() === $REG->ID() ) {
1930
+							continue;
1931
+			}
1932
+			//we don't want to delete permanently the existing registration just yet.
1926 1933
 
1927 1934
 			//remove relation to transaction for these registrations if NOT the existing registrations
1928 1935
 			$registration->_remove_relations('Transaction');
@@ -1975,8 +1982,9 @@  discard block
 block discarded – undo
1975 1982
 
1976 1983
 		$this->_template_args['step_content'] = $this->_get_registration_step_content();
1977 1984
 
1978
-		if ( defined('DOING_AJAX' ) )
1979
-			$this->_return_json();
1985
+		if ( defined('DOING_AJAX' ) ) {
1986
+					$this->_return_json();
1987
+		}
1980 1988
 
1981 1989
 
1982 1990
 		// grab header
@@ -2390,8 +2398,9 @@  discard block
 block discarded – undo
2390 2398
 			}
2391 2399
 		}
2392 2400
 
2393
-		if ( $success === FALSE )
2394
-			EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
2401
+		if ( $success === FALSE ) {
2402
+					EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
2403
+		}
2395 2404
 
2396 2405
 	}
2397 2406
 
Please login to merge, or discard this patch.
Spacing   +487 added lines, -487 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 	 * @param bool $routing
43 43
 	 * @return Registrations_Admin_Page
44 44
 	 */
45
-	public function __construct( $routing = TRUE ) {
46
-		parent::__construct( $routing );
45
+	public function __construct($routing = TRUE) {
46
+		parent::__construct($routing);
47 47
 	}
48 48
 
49 49
 
@@ -70,16 +70,16 @@  discard block
 block discarded – undo
70 70
 			'espresso_attendees' => 'edit_attendee'
71 71
 			);
72 72
 
73
-		add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10 );
73
+		add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10);
74 74
 		//add filters so that the comment urls don't take users to a confusing 404 page
75
-		add_filter('get_comment_link', array( $this, 'clear_comment_link' ), 10, 3 );
75
+		add_filter('get_comment_link', array($this, 'clear_comment_link'), 10, 3);
76 76
 	}
77 77
 
78 78
 
79
-	public function clear_comment_link( $link, $comment, $args ) {
79
+	public function clear_comment_link($link, $comment, $args) {
80 80
 		//gotta make sure this only happens on this route
81
-		$post_type = get_post_type( $comment->comment_post_ID);
82
-		if ( $post_type == 'espresso_attendees' )
81
+		$post_type = get_post_type($comment->comment_post_ID);
82
+		if ($post_type == 'espresso_attendees')
83 83
 			return '#commentsdiv';
84 84
 		return $link;
85 85
 	}
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
 	protected function _ajax_hooks() {
89 89
 		//todo: all hooks for registrations ajax goes in here
90
-		add_action( 'wp_ajax_toggle_checkin_status', array( $this, 'toggle_checkin_status' ));
90
+		add_action('wp_ajax_toggle_checkin_status', array($this, 'toggle_checkin_status'));
91 91
 	}
92 92
 
93 93
 
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
 					'add-attendee' => __('Add Contact', 'event_espresso'),
103 103
 					'edit' => __('Edit Contact', 'event_espresso'),
104 104
 					'report'=>  __("Event Registrations CSV Report", "event_espresso"),
105
-					'report_all' => __( 'All Registrations CSV Report', 'event_espresso' ),
106
-					'contact_list_report' => __( 'Contact List Report', 'event_espresso' ),
105
+					'report_all' => __('All Registrations CSV Report', 'event_espresso'),
106
+					'contact_list_report' => __('Contact List Report', 'event_espresso'),
107 107
 					'contact_list_export'=>  __("Export Data", "event_espresso"),
108 108
 				),
109 109
 			'publishbox' => array(
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
 
131 131
 		$this->_get_registration_status_array();
132 132
 
133
-		$reg_id = ! empty( $this->_req_data['_REG_ID'] ) && ! is_array( $this->_req_data['_REG_ID'] ) ? $this->_req_data['_REG_ID'] : 0;
134
-		$att_id = ! empty( $this->_req_data[ 'ATT_ID' ] ) && ! is_array( $this->_req_data['ATT_ID'] ) ? $this->_req_data['ATT_ID'] : 0;
135
-		$att_id = ! empty( $this->_req_data['post'] ) && ! is_array( $this->_req_data['post'] ) ? $this->_req_data['post'] : $att_id;
133
+		$reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0;
134
+		$att_id = ! empty($this->_req_data['ATT_ID']) && ! is_array($this->_req_data['ATT_ID']) ? $this->_req_data['ATT_ID'] : 0;
135
+		$att_id = ! empty($this->_req_data['post']) && ! is_array($this->_req_data['post']) ? $this->_req_data['post'] : $att_id;
136 136
 
137 137
 		$this->_page_routes = array(
138 138
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
 				'edit_registration'	=> array(
151 151
 						'func' => '_registration_details',
152
-						'args' => array( 'edit' ),
152
+						'args' => array('edit'),
153 153
 						'noheader' => TRUE,
154 154
 						'capability' => 'ee_edit_registration',
155 155
 						'obj_id' => $reg_id
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 
165 165
 				'restore_registrations' => array(
166 166
 					'func' => '_trash_or_restore_registrations',
167
-					'args' => array( 'trash' => FALSE ),
167
+					'args' => array('trash' => FALSE),
168 168
 					'noheader' => TRUE,
169 169
 					'capability' => 'ee_delete_registrations'
170 170
 					),
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 						'filename' => 'registrations_overview_other'
399 399
 					)
400 400
                 ),
401
-				'help_tour' => array( 'Registration_Overview_Help_Tour' ),
401
+				'help_tour' => array('Registration_Overview_Help_Tour'),
402 402
 				'qtips' => array('Registration_List_Table_Tips'),
403 403
 				'list_table' => 'EE_Registrations_List_Table',
404 404
 				'require_nonce' => FALSE
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 				'nav' => array(
409 409
 					'label' => __('REG Details', 'event_espresso'),
410 410
 					'order' => 15,
411
-					'url' => isset($this->_req_data['_REG_ID']) ? add_query_arg(array('_REG_ID' => $this->_req_data['_REG_ID'] ), $this->_current_page_view_url )  : $this->_admin_base_url,
411
+					'url' => isset($this->_req_data['_REG_ID']) ? add_query_arg(array('_REG_ID' => $this->_req_data['_REG_ID']), $this->_current_page_view_url) : $this->_admin_base_url,
412 412
 					'persistent' => FALSE
413 413
 					),
414 414
                 'help_tabs' => array(
@@ -429,8 +429,8 @@  discard block
 block discarded – undo
429 429
 						'filename' => 'registrations_details_registrant_details'
430 430
 						)
431 431
 					),
432
-				'help_tour' => array( 'Registration_Details_Help_Tour' ),
433
-				'metaboxes' => array( '_registration_details_metaboxes', '_espresso_news_post_box', '_espresso_links_post_box', '_espresso_sponsors_post_box' ),
432
+				'help_tour' => array('Registration_Details_Help_Tour'),
433
+				'metaboxes' => array('_registration_details_metaboxes', '_espresso_news_post_box', '_espresso_links_post_box', '_espresso_sponsors_post_box'),
434 434
 				'require_nonce' => FALSE
435 435
 				),
436 436
 
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 					'order' => 15,
441 441
 					'persistent' => FALSE
442 442
 					),
443
-				'metaboxes' => array( '_espresso_news_post_box', '_espresso_links_post_box', '_espresso_sponsors_post_box' ),
443
+				'metaboxes' => array('_espresso_news_post_box', '_espresso_links_post_box', '_espresso_sponsors_post_box'),
444 444
 				'labels' => array(
445 445
 					'publishbox' => __('Save Registration', 'event_espresso')
446 446
 					),
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 					'label' => __('Edit Contact', 'event_espresso'),
463 463
 					'order' => 15,
464 464
 					'persistent' => FALSE,
465
-					'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
465
+					'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
466 466
 					),
467 467
 				'metaboxes' => array('attendee_editor_metaboxes'),
468 468
 				'require_nonce' => FALSE
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 						'filename' => 'registrations_contact_list_other'
493 493
 					)
494 494
                 ),
495
-				'help_tour' => array( 'Contact_List_Help_Tour' ),
495
+				'help_tour' => array('Contact_List_Help_Tour'),
496 496
 				'metaboxes' => array(),
497 497
 				'require_nonce' => FALSE
498 498
 				),
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 	*		@return void
528 528
 	*/
529 529
 	private function _get_registration_status_array() {
530
-		self::$_reg_status = EEM_Registration::reg_status_array( array(), TRUE);
530
+		self::$_reg_status = EEM_Registration::reg_status_array(array(), TRUE);
531 531
 	}
532 532
 
533 533
 
@@ -550,11 +550,11 @@  discard block
 block discarded – undo
550 550
 	public function load_scripts_styles() {
551 551
 		//style
552 552
 		//wp_register_style('espresso_attendees', ATT_ASSETS_URL . 'espresso_attendees_admin.css', array(), EVENT_ESPRESSO_VERSION );
553
-		wp_register_style('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION );
553
+		wp_register_style('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION);
554 554
 		wp_enqueue_style('espresso_reg');
555 555
 
556 556
 		//script
557
-		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);
557
+		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);
558 558
 		wp_enqueue_script('espresso_reg');
559 559
 	}
560 560
 
@@ -563,9 +563,9 @@  discard block
 block discarded – undo
563 563
 	public function load_scripts_styles_edit_attendee() {
564 564
 		//stuff to only show up on our attendee edit details page.
565 565
 		$attendee_details_translations = array(
566
-			'att_publish_text' => sprintf( __('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created') )
566
+			'att_publish_text' => sprintf(__('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created'))
567 567
 			);
568
-		wp_localize_script( 'espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations );
568
+		wp_localize_script('espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations);
569 569
 		wp_enqueue_script('jquery-validate');
570 570
 	}
571 571
 
@@ -574,8 +574,8 @@  discard block
 block discarded – undo
574 574
 		//styles
575 575
 		wp_enqueue_style('espresso-ui-theme');
576 576
 		//scripts
577
-		EE_Registry::$i18n_js_strings['update_att_qstns'] = __( 'click "Update Registration Questions" to save your changes', 'event_espresso' );
578
-		wp_localize_script( 'espresso_reg', 'eei18n', EE_Registry::$i18n_js_strings );
577
+		EE_Registry::$i18n_js_strings['update_att_qstns'] = __('click "Update Registration Questions" to save your changes', 'event_espresso');
578
+		wp_localize_script('espresso_reg', 'eei18n', EE_Registry::$i18n_js_strings);
579 579
 	}
580 580
 
581 581
 
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 
586 586
 	public function load_scripts_styles_contact_list() {
587 587
 		wp_deregister_style('espresso_reg');
588
-		wp_register_style('espresso_att', REG_ASSETS_URL . 'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION );
588
+		wp_register_style('espresso_att', REG_ASSETS_URL.'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION);
589 589
 		wp_enqueue_style('espresso_att');
590 590
 	}
591 591
 
@@ -594,9 +594,9 @@  discard block
 block discarded – undo
594 594
 
595 595
 
596 596
 	public function load_scripts_styles_new_registration() {
597
-		wp_register_script( 'ee-spco-for-admin', REG_ASSETS_URL . 'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE );
597
+		wp_register_script('ee-spco-for-admin', REG_ASSETS_URL.'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE);
598 598
 		wp_enqueue_script('ee-spco-for-admin');
599
-		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' );
599
+		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true');
600 600
 		EE_Form_Section_Proper::wp_enqueue_scripts();
601 601
 		EED_Ticket_Selector::load_tckt_slctr_assets();
602 602
 		EE_Datepicker_Input::enqueue_styles_and_scripts();
@@ -635,23 +635,23 @@  discard block
 block discarded – undo
635 635
 
636 636
 		/** setup reg status bulk actions **/
637 637
 		$def_reg_status_actions['approve_registration'] = __('Approve Registrations', 'event_espresso');
638
-		if ( in_array( $match_array['approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
638
+		if (in_array($match_array['approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
639 639
 			$def_reg_status_actions['approve_and_notify_registration'] = __('Approve and Notify Registrations', 'event_espresso');
640 640
 		}
641 641
 		$def_reg_status_actions['decline_registration'] = __('Decline Registrations', 'event_espresso');
642
-		if ( in_array( $match_array['decline_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
642
+		if (in_array($match_array['decline_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
643 643
 			$def_reg_status_actions['decline_and_notify_registration'] = __('Decline and Notify Registrations', 'event_espresso');
644 644
 		}
645 645
 		$def_reg_status_actions['pending_registration'] = __('Set Registrations to Pending Payment', 'event_espresso');
646
-		if ( in_array( $match_array['pending_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
646
+		if (in_array($match_array['pending_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
647 647
 			$def_reg_status_actions['pending_and_notify_registration'] = __('Set Registrations to Pending Payment and Notify', 'event_espresso');
648 648
 		}
649 649
 		$def_reg_status_actions['no_approve_registration'] = __('Set Registrations to Not Approved', 'event_espresso');
650
-		if ( in_array( $match_array['no_approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
650
+		if (in_array($match_array['no_approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
651 651
 			$def_reg_status_actions['no_approve_and_notify_registration'] = __('Set Registrations to Not Approved and Notify', 'event_espresso');
652 652
 		}
653 653
 		$def_reg_status_actions['cancel_registration'] = __('Cancel Registrations', 'event_espresso');
654
-		if ( in_array( $match_array['cancel_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) {
654
+		if (in_array($match_array['cancel_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) {
655 655
 			$def_reg_status_actions['cancel_and_notify_registration'] = __('Cancel Registrations and Notify', 'event_espresso');
656 656
 		}
657 657
 
@@ -660,29 +660,29 @@  discard block
 block discarded – undo
660 660
 				'slug' => 'all',
661 661
 				'label' => __('View All Registrations', 'event_espresso'),
662 662
 				'count' => 0,
663
-				'bulk_action' => array_merge( $def_reg_status_actions, array(
663
+				'bulk_action' => array_merge($def_reg_status_actions, array(
664 664
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
665
-					) )
665
+					))
666 666
 				),
667 667
 			'month' => array(
668 668
 				'slug' => 'month',
669 669
 				'label' => __('This Month', 'event_espresso'),
670 670
 				'count' => 0,
671
-				'bulk_action' => array_merge( $def_reg_status_actions, array(
671
+				'bulk_action' => array_merge($def_reg_status_actions, array(
672 672
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
673 673
 					))
674 674
 				),
675 675
 			'today' => array(
676 676
 				'slug' => 'today',
677
-				'label' => sprintf( __('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp', 0) ) ),
677
+				'label' => sprintf(__('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp', 0))),
678 678
 				'count' => 0,
679
-				'bulk_action' => array_merge( $def_reg_status_actions,  array(
679
+				'bulk_action' => array_merge($def_reg_status_actions, array(
680 680
 					'trash_registrations' => __('Trash Registrations', 'event_espresso')
681 681
 					))
682 682
 				)
683 683
 			);
684 684
 
685
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registrations', 'espresso_registrations_delete_registration' ) ) {
685
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registrations', 'espresso_registrations_delete_registration')) {
686 686
 			$this->_views['incomplete'] = array(
687 687
 				'slug' => 'incomplete',
688 688
 				'label' => __('Incomplete', 'event_espresso'),
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
 				)
719 719
 			);
720 720
 
721
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_trash_attendees' ) ) {
721
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_trash_attendees')) {
722 722
 			$this->_views['trash'] = array(
723 723
 				'slug' => 'trash',
724 724
 				'label' => __('Trash', 'event_espresso'),
@@ -753,42 +753,42 @@  discard block
 block discarded – undo
753 753
 				'desc' => __('View Transaction Details', 'event_espresso')
754 754
 				)
755 755
  			);
756
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) {
756
+		if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) {
757 757
 			$fc_items['resend_registration'] = array(
758 758
 				'class' => 'dashicons dashicons-email-alt',
759 759
 				'desc' => __('Resend Registration Details', 'event_espresso')
760 760
 				);
761 761
 		} else {
762
-			$fc_items['blank'] = array( 'class' => 'blank', 'desc' => '' );
762
+			$fc_items['blank'] = array('class' => 'blank', 'desc' => '');
763 763
 		}
764 764
 
765 765
 		$sc_items = array(
766 766
 			'approved_status' => array(
767
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved,
768
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' )
767
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_approved,
768
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')
769 769
 				),
770 770
 			'pending_status' => array(
771
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment,
772
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' )
771
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_pending_payment,
772
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence')
773 773
 				),
774 774
 			'incomplete_status' => array(
775
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_incomplete,
776
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_incomplete, FALSE, 'sentence' )
775
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_incomplete,
776
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_incomplete, FALSE, 'sentence')
777 777
 			),
778 778
 			'not_approved' => array(
779
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved,
780
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' )
779
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_not_approved,
780
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence')
781 781
 				),
782 782
 			'declined_status' => array(
783
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined,
784
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' )
783
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_declined,
784
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence')
785 785
 				),
786 786
 			'cancelled_status' => array(
787
-				'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled,
788
-				'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' )
787
+				'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_cancelled,
788
+				'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence')
789 789
 				)
790 790
 			);
791
-		return array_merge( $fc_items, $sc_items );
791
+		return array_merge($fc_items, $sc_items);
792 792
 	}
793 793
 
794 794
 
@@ -801,15 +801,15 @@  discard block
 block discarded – undo
801 801
 
802 802
 
803 803
 	protected function _registrations_overview_list_table() {
804
-		$EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE;
805
-		if ( $EVT_ID ) {
806
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_registrations', 'espresso_registrations_new_registration', $EVT_ID ) ) {
807
-				$this->_admin_page_title .= $this->get_action_link_or_button( 'new_registration', 'add-registrant', array( 'event_id' => $EVT_ID ), 'add-new-h2' );
804
+		$EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE;
805
+		if ($EVT_ID) {
806
+			if (EE_Registry::instance()->CAP->current_user_can('ee_edit_registrations', 'espresso_registrations_new_registration', $EVT_ID)) {
807
+				$this->_admin_page_title .= $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $EVT_ID), 'add-new-h2');
808 808
 			}
809
-			$event = EEM_Event::instance()->get_one_by_ID( $EVT_ID );
810
-			$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>' ) : '';
809
+			$event = EEM_Event::instance()->get_one_by_ID($EVT_ID);
810
+			$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>') : '';
811 811
 		}
812
-		$this->_template_args['after_list_table'] = $this->_display_legend( $this->_registration_legend_items() );
812
+		$this->_template_args['after_list_table'] = $this->_display_legend($this->_registration_legend_items());
813 813
 		$this->display_admin_list_table_page_with_no_sidebar();
814 814
 	}
815 815
 
@@ -824,19 +824,19 @@  discard block
 block discarded – undo
824 824
 	 */
825 825
 	private function _set_registration_object() {
826 826
 		//get out if we've already set the object
827
-		if ( is_object( $this->_registration )) {
827
+		if (is_object($this->_registration)) {
828 828
 			return TRUE;
829 829
 		}
830 830
 
831 831
 	    $REG = EEM_Registration::instance();
832 832
 
833
-		$REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
833
+		$REG_ID = ( ! empty($this->_req_data['_REG_ID'])) ? absint($this->_req_data['_REG_ID']) : FALSE;
834 834
 
835
-		if ( $this->_registration = $REG->get_one_by_ID( $REG_ID ))
835
+		if ($this->_registration = $REG->get_one_by_ID($REG_ID))
836 836
 			return TRUE;
837 837
 		else {
838
-			$error_msg = sprintf( __('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID );
839
-			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
838
+			$error_msg = sprintf(__('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID);
839
+			EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
840 840
 			$this->_registration = NULL;
841 841
 			return FALSE;
842 842
 		}
@@ -855,24 +855,24 @@  discard block
 block discarded – undo
855 855
 	 * @internal param bool $all whether to ignore all query params and just return ALL registrations (or count if count is set)
856 856
 	 * @return mixed (int|array)  int = count || array of registration objects
857 857
 	 */
858
-	public function get_registrations( $per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE ) {
859
-
860
-		$EVT_ID = ! empty( $this->_req_data['event_id'] ) && $this->_req_data['event_id'] > 0 ? absint( $this->_req_data['event_id'] ) : FALSE;
861
-		$CAT_ID = ! empty( $this->_req_data['EVT_CAT'] ) && (int) $this->_req_data['EVT_CAT'] > 0? absint( $this->_req_data['EVT_CAT'] ) : FALSE;
862
-		$reg_status = ! empty( $this->_req_data['_reg_status'] ) ? sanitize_text_field( $this->_req_data['_reg_status'] ) : FALSE;
863
-		$month_range = ! empty( $this->_req_data['month_range'] ) ? sanitize_text_field( $this->_req_data['month_range'] ) : FALSE;//should be like 2013-april
864
-		$today_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'today' ? TRUE : FALSE;
865
-		$this_month_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'month' ? TRUE  : FALSE;
858
+	public function get_registrations($per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE) {
859
+
860
+		$EVT_ID = ! empty($this->_req_data['event_id']) && $this->_req_data['event_id'] > 0 ? absint($this->_req_data['event_id']) : FALSE;
861
+		$CAT_ID = ! empty($this->_req_data['EVT_CAT']) && (int) $this->_req_data['EVT_CAT'] > 0 ? absint($this->_req_data['EVT_CAT']) : FALSE;
862
+		$reg_status = ! empty($this->_req_data['_reg_status']) ? sanitize_text_field($this->_req_data['_reg_status']) : FALSE;
863
+		$month_range = ! empty($this->_req_data['month_range']) ? sanitize_text_field($this->_req_data['month_range']) : FALSE; //should be like 2013-april
864
+		$today_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'today' ? TRUE : FALSE;
865
+		$this_month_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'month' ? TRUE  : FALSE;
866 866
 		$start_date = FALSE;
867 867
 		$end_date = FALSE;
868 868
 		$_where = array();
869
-		$trash = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'trash' ? TRUE : FALSE;
870
-		$incomplete = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'incomplete' ? TRUE : FALSE;
869
+		$trash = ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'trash' ? TRUE : FALSE;
870
+		$incomplete = ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'incomplete' ? TRUE : FALSE;
871 871
 
872 872
 		//set orderby
873 873
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
874 874
 
875
-		switch ( $this->_req_data['orderby'] ) {
875
+		switch ($this->_req_data['orderby']) {
876 876
 			case '_REG_ID':
877 877
 				$orderby = 'REG_ID';
878 878
 				break;
@@ -892,26 +892,26 @@  discard block
 block discarded – undo
892 892
 				$orderby = 'REG_date';
893 893
 		}
894 894
 
895
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC';
896
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
897
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
895
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC';
896
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
897
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
898 898
 
899 899
 
900
-		$offset = ($current_page-1)*$per_page;
901
-		$limit = $count  ? NULL : array( $offset, $per_page );
900
+		$offset = ($current_page - 1) * $per_page;
901
+		$limit = $count ? NULL : array($offset, $per_page);
902 902
 
903
-		if($EVT_ID){
904
-			$_where['EVT_ID']=$EVT_ID;
903
+		if ($EVT_ID) {
904
+			$_where['EVT_ID'] = $EVT_ID;
905 905
 		}
906
-		if($CAT_ID){
906
+		if ($CAT_ID) {
907 907
 			$_where['Event.Term_Taxonomy.term_id'] = $CAT_ID;
908 908
 		}
909
-		if ( $incomplete ) {
909
+		if ($incomplete) {
910 910
 			$_where['STS_ID'] = EEM_Registration::status_id_incomplete;
911 911
 		} else if ( ! $trash) {
912
-			$_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete );
912
+			$_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete);
913 913
 		}
914
-		if($reg_status){
914
+		if ($reg_status) {
915 915
 			$_where['STS_ID'] = $reg_status;
916 916
 		}
917 917
 
@@ -923,102 +923,102 @@  discard block
 block discarded – undo
923 923
 		$time_start = ' 00:00:00';
924 924
 		$time_end = ' 23:59:59';
925 925
 
926
-		if($today_a || $today ){
926
+		if ($today_a || $today) {
927 927
 			$curdate = date('Y-m-d', current_time('timestamp'));
928
-			$_where['REG_date']= array('BETWEEN',
928
+			$_where['REG_date'] = array('BETWEEN',
929 929
 				array(
930
-					strtotime($curdate . $time_start),
931
-					strtotime($curdate . $time_end)
930
+					strtotime($curdate.$time_start),
931
+					strtotime($curdate.$time_end)
932 932
 			));
933
-		}elseif($this_month_a || $this_month){
933
+		}elseif ($this_month_a || $this_month) {
934 934
 			$this_month_r = date('m', current_time('timestamp'));
935
-			$days_this_month = date( 't', current_time('timestamp') );
936
-			$_where['REG_date']= array('BETWEEN',
935
+			$days_this_month = date('t', current_time('timestamp'));
936
+			$_where['REG_date'] = array('BETWEEN',
937 937
 				array(
938
-					strtotime( $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start ),
939
-					strtotime( $this_year_r . '-' . $this_month_r . $days_this_month . ' ' . $time_end )
938
+					strtotime($this_year_r.'-'.$this_month_r.'-01'.' '.$time_start),
939
+					strtotime($this_year_r.'-'.$this_month_r.$days_this_month.' '.$time_end)
940 940
 			));
941
-		}elseif($month_range){
941
+		}elseif ($month_range) {
942 942
 			$pieces = explode(' ', $this->_req_data['month_range'], 3);
943
-			$month_r = !empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
944
-			$year_r = !empty($pieces[1]) ? $pieces[1] : '';
945
-			$_where['REG_date']= array('BETWEEN',
946
-				array( strtotime($year_r . '-' . $month_r . '-01 00:00:00'), strtotime($year_r . '-' . $month_r . '-31 23:59:59' ) ) );
947
-		}elseif($start_date && $end_date){
943
+			$month_r = ! empty($pieces[0]) ? date('m', strtotime($pieces[0])) : '';
944
+			$year_r = ! empty($pieces[1]) ? $pieces[1] : '';
945
+			$_where['REG_date'] = array('BETWEEN',
946
+				array(strtotime($year_r.'-'.$month_r.'-01 00:00:00'), strtotime($year_r.'-'.$month_r.'-31 23:59:59')));
947
+		}elseif ($start_date && $end_date) {
948 948
 			throw new EE_Error("not yet supported");
949
-		}elseif($start_date){
949
+		}elseif ($start_date) {
950 950
 			throw new EE_Error("not yet supported");
951
-		}elseif($end_date){
951
+		}elseif ($end_date) {
952 952
 			throw new EE_Error("not yet supported");
953 953
 		}
954 954
 
955
-		if ( isset( $this->_req_data['s'] ) ) {
956
-			$sstr = '%' . $this->_req_data['s'] . '%';
955
+		if (isset($this->_req_data['s'])) {
956
+			$sstr = '%'.$this->_req_data['s'].'%';
957 957
 			$_where['OR'] = array(
958
-				'Event.EVT_name' => array( 'LIKE', $sstr),
959
-				'Event.EVT_desc' => array( 'LIKE', $sstr ),
960
-				'Event.EVT_short_desc' => array( 'LIKE' , $sstr ),
961
-				'Attendee.ATT_fname' => array( 'LIKE', $sstr ),
962
-				'Attendee.ATT_lname' => array( 'LIKE', $sstr ),
963
-				'Attendee.ATT_short_bio' => array( 'LIKE', $sstr ),
964
-				'Attendee.ATT_email' => array('LIKE', $sstr ),
965
-				'Attendee.ATT_address' => array( 'LIKE', $sstr ),
966
-				'Attendee.ATT_address2' => array( 'LIKE', $sstr ),
967
-				'Attendee.ATT_city' => array( 'LIKE', $sstr ),
968
-				'REG_final_price' => array( 'LIKE', $sstr ),
969
-				'REG_code' => array( 'LIKE', $sstr ),
970
-				'REG_count' => array( 'LIKE' , $sstr ),
971
-				'REG_group_size' => array( 'LIKE' , $sstr ),
972
-				'Ticket.TKT_name' => array( 'LIKE', $sstr ),
973
-				'Ticket.TKT_description' => array( 'LIKE', $sstr )
958
+				'Event.EVT_name' => array('LIKE', $sstr),
959
+				'Event.EVT_desc' => array('LIKE', $sstr),
960
+				'Event.EVT_short_desc' => array('LIKE', $sstr),
961
+				'Attendee.ATT_fname' => array('LIKE', $sstr),
962
+				'Attendee.ATT_lname' => array('LIKE', $sstr),
963
+				'Attendee.ATT_short_bio' => array('LIKE', $sstr),
964
+				'Attendee.ATT_email' => array('LIKE', $sstr),
965
+				'Attendee.ATT_address' => array('LIKE', $sstr),
966
+				'Attendee.ATT_address2' => array('LIKE', $sstr),
967
+				'Attendee.ATT_city' => array('LIKE', $sstr),
968
+				'REG_final_price' => array('LIKE', $sstr),
969
+				'REG_code' => array('LIKE', $sstr),
970
+				'REG_count' => array('LIKE', $sstr),
971
+				'REG_group_size' => array('LIKE', $sstr),
972
+				'Ticket.TKT_name' => array('LIKE', $sstr),
973
+				'Ticket.TKT_description' => array('LIKE', $sstr)
974 974
 				);
975 975
 		}
976 976
 
977 977
 		//capability checks
978
-		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations' ) ) {
978
+		if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations')) {
979 979
 			$_where['AND'] = array(
980 980
 				'Event.EVT_wp_user' => get_current_user_id()
981 981
 				);
982 982
 		}
983 983
 
984 984
 
985
-		if( $count ){
986
-			if ( $trash ) {
987
-				return EEM_Registration::instance()->count_deleted( array( $_where ));
988
-			} else if ( $incomplete ) {
989
-				return EEM_Registration::instance()->count( array( $_where ));
985
+		if ($count) {
986
+			if ($trash) {
987
+				return EEM_Registration::instance()->count_deleted(array($_where));
988
+			} else if ($incomplete) {
989
+				return EEM_Registration::instance()->count(array($_where));
990 990
 			} else {
991
-				return EEM_Registration::instance()->count( array( $_where, 'default_where_conditions' => 'this_model_only' ));
991
+				return EEM_Registration::instance()->count(array($_where, 'default_where_conditions' => 'this_model_only'));
992 992
 			}
993 993
 		} else {
994 994
 			//make sure we remove default where conditions cause all registrations matching query are returned
995
-			$query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'default_where_conditions' => 'this_model_only' );
996
-			if ( $per_page !== -1 ) {
995
+			$query_params = array($_where, 'order_by' => array($orderby => $sort), 'default_where_conditions' => 'this_model_only');
996
+			if ($per_page !== -1) {
997 997
 				$query_params['limit'] = $limit;
998 998
 			}
999
-			$registrations =  $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params);
999
+			$registrations = $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params);
1000 1000
 
1001 1001
 
1002
-			if ( $EVT_ID && isset( $registrations[0] ) && $registrations[0] instanceof EE_Registration &&  $registrations[0]->event_obj()) {
1002
+			if ($EVT_ID && isset($registrations[0]) && $registrations[0] instanceof EE_Registration && $registrations[0]->event_obj()) {
1003 1003
 				$first_registration = $registrations[0];
1004 1004
 				//EEH_Debug_Tools::printr( $registrations[0], '$registrations  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
1005 1005
 				$event_name = $first_registration->event_obj()->name();
1006
-				$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 ) : '';
1006
+				$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 ) : '';
1007 1007
 				// edit event link
1008
-				if ( $event_name != '' ) {
1009
-					$edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit_event', 'EVT_ID'=>$EVT_ID ), EVENTS_ADMIN_URL );
1010
-					$edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $event_name . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>';
1011
-					$event_name .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ;
1008
+				if ($event_name != '') {
1009
+					$edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit_event', 'EVT_ID'=>$EVT_ID), EVENTS_ADMIN_URL);
1010
+					$edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$event_name.'">'.__('Edit Event', 'event_espresso').'</a>';
1011
+					$event_name .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>';
1012 1012
 				}
1013 1013
 
1014
-				$back_2_reg_url = self::add_query_args_and_nonce( array( 'action'=>'default' ), REG_ADMIN_URL );
1015
-				$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>';
1014
+				$back_2_reg_url = self::add_query_args_and_nonce(array('action'=>'default'), REG_ADMIN_URL);
1015
+				$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>';
1016 1016
 
1017 1017
 				$this->_template_args['before_admin_page_content'] = '
1018 1018
 			<div id="admin-page-header">
1019
-				<h1><span class="small-text not-bold">'.__( 'Event: ', 'event_espresso' ).'</span>'. $event_name .'</h1>
1020
-				<h3><span class="small-text not-bold">'.__( 'Date: ', 'event_espresso' ). '</span>'. $event_date .'</h3>
1021
-				<span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk . '</span>
1019
+				<h1><span class="small-text not-bold">'.__('Event: ', 'event_espresso').'</span>'.$event_name.'</h1>
1020
+				<h3><span class="small-text not-bold">'.__('Date: ', 'event_espresso').'</span>'.$event_date.'</h3>
1021
+				<span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk.'</span>
1022 1022
 			</div>
1023 1023
 			';
1024 1024
 
@@ -1056,24 +1056,24 @@  discard block
 block discarded – undo
1056 1056
 
1057 1057
 		$this->_set_registration_object();
1058 1058
 
1059
-		if ( is_object( $this->_registration )) {
1059
+		if (is_object($this->_registration)) {
1060 1060
 			$transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance();
1061 1061
 			$this->_session = $transaction->session_data();
1062 1062
 
1063
-			$title = __( ucwords( str_replace( '_', ' ', $this->_req_action )), 'event_espresso' );
1063
+			$title = __(ucwords(str_replace('_', ' ', $this->_req_action)), 'event_espresso');
1064 1064
 			// add PRC_ID to title if editing
1065
-			$title = $this->_registration->ID() ? $title . ' # ' . $this->_registration->ID() : $title;
1065
+			$title = $this->_registration->ID() ? $title.' # '.$this->_registration->ID() : $title;
1066 1066
 
1067 1067
 
1068 1068
 			$this->_template_args['reg_nmbr']['value'] = $this->_registration->ID();
1069
-			$this->_template_args['reg_nmbr']['label'] = __( 'Registration Number', 'event_espresso' );
1069
+			$this->_template_args['reg_nmbr']['label'] = __('Registration Number', 'event_espresso');
1070 1070
 
1071
-			$this->_template_args['reg_datetime']['value'] =  $this->_registration->pretty_date('l F j, Y','g:i:s a') ;
1072
-			$this->_template_args['reg_datetime']['label'] = __( 'Date', 'event_espresso' );
1071
+			$this->_template_args['reg_datetime']['value'] = $this->_registration->pretty_date('l F j, Y', 'g:i:s a');
1072
+			$this->_template_args['reg_datetime']['label'] = __('Date', 'event_espresso');
1073 1073
 
1074 1074
 			$this->_template_args['reg_status']['value'] = $this->_registration->pretty_status();
1075
-			$this->_template_args['reg_status']['label'] = __( 'Registration Status', 'event_espresso' );
1076
-			$this->_template_args['reg_status']['class'] = 'status-' . $this->_registration->status_ID();
1075
+			$this->_template_args['reg_status']['label'] = __('Registration Status', 'event_espresso');
1076
+			$this->_template_args['reg_status']['class'] = 'status-'.$this->_registration->status_ID();
1077 1077
 
1078 1078
 			$this->_template_args['approve_decline_reg_status_buttons'] = $this->_set_approve_or_decline_reg_status_buttons();
1079 1079
 
@@ -1085,8 +1085,8 @@  discard block
 block discarded – undo
1085 1085
 			$this->_template_args['registration'] = $this->_registration;
1086 1086
 
1087 1087
 			// grab header
1088
-			$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_header.template.php';
1089
-			$this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1088
+			$template_path = REG_TEMPLATE_PATH.'reg_admin_details_header.template.php';
1089
+			$this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1090 1090
 
1091 1091
 		} else {
1092 1092
 
@@ -1107,13 +1107,13 @@  discard block
 block discarded – undo
1107 1107
 	protected function _registration_details_metaboxes() {
1108 1108
 		$this->_set_registration_object();
1109 1109
 		$attendee = $this->_registration instanceof EE_Registration ? $this->_registration->attendee() : null;
1110
-		add_meta_box( 'edit-reg-details-mbox', __( 'Registration Details', 'event_espresso' ), array( $this, '_reg_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1111
-		if ( $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox' ) ) {
1112
-			add_meta_box( 'edit-reg-questions-mbox', __( 'Registration Form Answers', 'event_espresso' ), array( $this, '_reg_questions_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1110
+		add_meta_box('edit-reg-details-mbox', __('Registration Details', 'event_espresso'), array($this, '_reg_details_meta_box'), $this->wp_page_slug, 'normal', 'high');
1111
+		if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox')) {
1112
+			add_meta_box('edit-reg-questions-mbox', __('Registration Form Answers', 'event_espresso'), array($this, '_reg_questions_meta_box'), $this->wp_page_slug, 'normal', 'high');
1113 1113
 		}
1114
-		add_meta_box( 'edit-reg-registrant-mbox', __( 'Contact Details', 'event_espresso' ), array( $this, '_reg_registrant_side_meta_box' ), $this->wp_page_slug, 'side', 'high' );
1115
-		if ( $this->_registration->group_size() > 1 ) {
1116
-			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' );
1114
+		add_meta_box('edit-reg-registrant-mbox', __('Contact Details', 'event_espresso'), array($this, '_reg_registrant_side_meta_box'), $this->wp_page_slug, 'side', 'high');
1115
+		if ($this->_registration->group_size() > 1) {
1116
+			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');
1117 1117
 		}
1118 1118
 	}
1119 1119
 
@@ -1137,20 +1137,20 @@  discard block
 block discarded – undo
1137 1137
 
1138 1138
 		$default_status = EE_Registry::instance()->CFG->registration->default_STS_ID;
1139 1139
 		$template_args['attendee'] = $this->_registration->attendee();
1140
-		$template = REG_TEMPLATE_PATH . 'reg_status_change_buttons.template.php';
1141
-		if ( $this->_set_registration_object() ) {
1140
+		$template = REG_TEMPLATE_PATH.'reg_status_change_buttons.template.php';
1141
+		if ($this->_set_registration_object()) {
1142 1142
 			$current_status = $this->_registration->status_ID();
1143
-			unset( $status_buttons[$current_status] );
1144
-			if ( $current_status != EEM_Registration::status_id_pending_payment && $is_complete ) {
1145
-				unset( $status_buttons[EEM_Registration::status_id_pending_payment] );
1143
+			unset($status_buttons[$current_status]);
1144
+			if ($current_status != EEM_Registration::status_id_pending_payment && $is_complete) {
1145
+				unset($status_buttons[EEM_Registration::status_id_pending_payment]);
1146 1146
 			}
1147
-			$template_args['status_buttons'] = implode( "\n", $status_buttons );
1147
+			$template_args['status_buttons'] = implode("\n", $status_buttons);
1148 1148
 		}
1149 1149
 		$template_args['form_url'] = REG_ADMIN_URL;
1150 1150
 		$template_args['REG_ID'] = $this->_registration->ID();
1151
-		$template_args['nonce'] = wp_nonce_field( 'change_reg_status_nonce',  'change_reg_status_nonce', FALSE, FALSE );
1151
+		$template_args['nonce'] = wp_nonce_field('change_reg_status_nonce', 'change_reg_status_nonce', FALSE, FALSE);
1152 1152
 
1153
-		return EEH_Template::display_template( $template, $template_args, TRUE );
1153
+		return EEH_Template::display_template($template, $template_args, TRUE);
1154 1154
 
1155 1155
 	}
1156 1156
 
@@ -1164,11 +1164,11 @@  discard block
 block discarded – undo
1164 1164
 	private function _get_reg_status_buttons() {
1165 1165
 
1166 1166
 		$buttons = array(
1167
-			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' ) . '">',
1168
-			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' ) . '">',
1169
-			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' ) . '">',
1170
-			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' ) . '">',
1171
-			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' ) . '">',
1167
+			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').'">',
1168
+			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').'">',
1169
+			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').'">',
1170
+			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').'">',
1171
+			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').'">',
1172 1172
 			);
1173 1173
 		return $buttons;
1174 1174
 	}
@@ -1185,42 +1185,42 @@  discard block
 block discarded – undo
1185 1185
 	 * @internal param $bool $notify Whether or not to notify the registrant(s) about the status change.
1186 1186
 	 * @return array
1187 1187
 	 */
1188
-	private function _set_registration_status( $REG_ID = FALSE, $status = FALSE, $notify = FALSE ) {
1188
+	private function _set_registration_status($REG_ID = FALSE, $status = FALSE, $notify = FALSE) {
1189 1189
 		$success = FALSE;
1190 1190
 		// set default status if none is passed
1191 1191
 		$status = $status ? $status : EEM_Registration::status_id_pending_payment;
1192 1192
 		// have we been passed a REG_ID ?
1193
-		if ( ! $REG_ID ) {
1193
+		if ( ! $REG_ID) {
1194 1194
 			// no ? then check for one in the req data
1195
-			$REG_ID = isset( $this->_req_data['_REG_ID'] ) && !is_array( $this->_req_data['_REG_ID'] ) ? absint( $this->_req_data['_REG_ID'] ) : $REG_ID;
1195
+			$REG_ID = isset($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : $REG_ID;
1196 1196
 		}
1197 1197
 		// still don't have one?
1198
-		if ( ! $REG_ID ) {
1198
+		if ( ! $REG_ID) {
1199 1199
 			// then check req data for an array of REG_IDs
1200
-			$REG_IDs = isset( $this->_req_data['_REG_ID'] ) && is_array( $this->_req_data['_REG_ID'] ) ? (array) $this->_req_data['_REG_ID'] : array();
1200
+			$REG_IDs = isset($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID']) ? (array) $this->_req_data['_REG_ID'] : array();
1201 1201
 			$success = TRUE;
1202 1202
 			// loop thru REG_IDs and set each reg status separately
1203
-			foreach ( $REG_IDs as $REG_ID ) {
1204
-				$result = $this->_set_registration_status( $REG_ID, $status, $notify );
1205
-				$success = isset( $result['success'] ) && $result['success'] ? $success : FALSE;
1203
+			foreach ($REG_IDs as $REG_ID) {
1204
+				$result = $this->_set_registration_status($REG_ID, $status, $notify);
1205
+				$success = isset($result['success']) && $result['success'] ? $success : FALSE;
1206 1206
 			}
1207 1207
 			$REG_ID = FALSE;
1208 1208
 		}
1209
-		if ( $REG_ID ) {
1210
-			$registration = EEM_Registration::instance()->get_one_by_ID( $REG_ID );
1211
-			if ( $registration instanceof EE_Registration ) {
1212
-				$registration->set_status( $status );
1209
+		if ($REG_ID) {
1210
+			$registration = EEM_Registration::instance()->get_one_by_ID($REG_ID);
1211
+			if ($registration instanceof EE_Registration) {
1212
+				$registration->set_status($status);
1213 1213
 				$success = $registration->save();
1214 1214
 			}
1215 1215
 			//make sure we don't just get 0 updated
1216 1216
 			$success = $success === FALSE ? FALSE : TRUE;
1217 1217
 
1218
-			if ( $success && $notify && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) {
1218
+			if ($success && $notify && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) {
1219 1219
 				$this->_req_data['_REG_ID'] = $REG_ID;
1220 1220
 				$this->_process_resend_registration();
1221 1221
 			}
1222 1222
 		}
1223
-		return array( 'REG_ID' => $REG_ID, 'success' => $success );
1223
+		return array('REG_ID' => $REG_ID, 'success' => $success);
1224 1224
 	}
1225 1225
 
1226 1226
 
@@ -1232,27 +1232,27 @@  discard block
 block discarded – undo
1232 1232
 	 * @param  array  $result array from _set_registration_status()
1233 1233
 	 * @return void
1234 1234
 	 */
1235
-	private function _reg_status_change_return( $STS_ID, $result ) {
1236
-		$success = isset( $result['success'] ) && $result['success'] ? TRUE : FALSE;
1235
+	private function _reg_status_change_return($STS_ID, $result) {
1236
+		$success = isset($result['success']) && $result['success'] ? TRUE : FALSE;
1237 1237
 
1238 1238
 		//setup success message
1239
-		if ( $success ) {
1239
+		if ($success) {
1240 1240
 
1241
-			$msg = $result['REG_ID'] ? sprintf( __('Registration status has been set to %s', 'event_espresso'), EEH_Template::pretty_status($STS_ID, FALSE, 'lower' ) ) :  sprintf( __('Registrations have been %s.', 'event_espresso'), EEH_Template::pretty_status($STS_ID, FALSE, 'lower' ) ) ;
1242
-			EE_Error::add_success( $msg );
1241
+			$msg = $result['REG_ID'] ? sprintf(__('Registration status has been set to %s', 'event_espresso'), EEH_Template::pretty_status($STS_ID, FALSE, 'lower')) : sprintf(__('Registrations have been %s.', 'event_espresso'), EEH_Template::pretty_status($STS_ID, FALSE, 'lower'));
1242
+			EE_Error::add_success($msg);
1243 1243
 		} else {
1244
-			EE_Error::add_error( __('Something went wrong, and the status was not changed', 'event_espresso' ), __FILE__, __LINE__, __FUNCTION__ );
1244
+			EE_Error::add_error(__('Something went wrong, and the status was not changed', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__);
1245 1245
 		}
1246 1246
 
1247
-		$route = isset( $this->_req_data['return'] ) && $this->_req_data['return'] == 'view_registration' ? array( 'action' => 'view_registration', '_REG_ID' => $result['REG_ID'] ) : array( 'action' => 'default' );
1247
+		$route = isset($this->_req_data['return']) && $this->_req_data['return'] == 'view_registration' ? array('action' => 'view_registration', '_REG_ID' => $result['REG_ID']) : array('action' => 'default');
1248 1248
 
1249 1249
 		//was the send notification toggle checked?
1250
-		if ( !empty( $this->_req_data['txn_reg_status_change']['send_notifications'] ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) {
1250
+		if ( ! empty($this->_req_data['txn_reg_status_change']['send_notifications']) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) {
1251 1251
 			$this->_req_data['_REG_ID'] = $result['REG_ID'];
1252 1252
 			$this->_process_resend_registration();
1253 1253
 		}
1254 1254
 
1255
-		$this->_redirect_after_action( FALSE, '', '', $route, TRUE );
1255
+		$this->_redirect_after_action(FALSE, '', '', $route, TRUE);
1256 1256
 	}
1257 1257
 
1258 1258
 
@@ -1264,30 +1264,30 @@  discard block
 block discarded – undo
1264 1264
 	protected function _change_reg_status() {
1265 1265
 		$success = FALSE;
1266 1266
 		$this->_req_data['return'] = 'view_registration';
1267
-		if ( !isset( $this->_req_data['_reg_status_id'] ) ) {
1267
+		if ( ! isset($this->_req_data['_reg_status_id'])) {
1268 1268
 			$result['success'] = FALSE;
1269
-			$this->_reg_status_change_return( '', $result );
1269
+			$this->_reg_status_change_return('', $result);
1270 1270
 		}
1271 1271
 
1272
-		switch ( $this->_req_data['_reg_status_id'] ) {
1273
-			case EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) :
1272
+		switch ($this->_req_data['_reg_status_id']) {
1273
+			case EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence') :
1274 1274
 				$this->approve_registration();
1275 1275
 				break;
1276
-			case EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ) :
1276
+			case EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence') :
1277 1277
 				$this->pending_registration();
1278 1278
 				break;
1279
-			case EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ) :
1279
+			case EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence') :
1280 1280
 				$this->not_approve_registration();
1281 1281
 				break;
1282
-			case EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' ) :
1282
+			case EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence') :
1283 1283
 				$this->decline_registration();
1284 1284
 				break;
1285
-			case EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' ) :
1285
+			case EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence') :
1286 1286
 				$this->cancel_registration();
1287 1287
 				break;
1288 1288
 			default :
1289 1289
 				$result['success'] = FALSE;
1290
-				$this->_reg_status_change_return( '', $result );
1290
+				$this->_reg_status_change_return('', $result);
1291 1291
 				break;
1292 1292
 		}
1293 1293
 	}
@@ -1300,9 +1300,9 @@  discard block
 block discarded – undo
1300 1300
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1301 1301
 	*		@return void
1302 1302
 	*/
1303
-	protected function approve_registration( $notify = FALSE ) {
1304
-		$result = $this->_set_registration_status( FALSE, EEM_Registration::status_id_approved, $notify );
1305
-		$this->_reg_status_change_return( EEM_Registration::status_id_approved, $result );
1303
+	protected function approve_registration($notify = FALSE) {
1304
+		$result = $this->_set_registration_status(FALSE, EEM_Registration::status_id_approved, $notify);
1305
+		$this->_reg_status_change_return(EEM_Registration::status_id_approved, $result);
1306 1306
 	}
1307 1307
 
1308 1308
 
@@ -1313,9 +1313,9 @@  discard block
 block discarded – undo
1313 1313
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1314 1314
 	*		@return void
1315 1315
 	*/
1316
-	protected function decline_registration( $notify = FALSE ) {
1317
-		$result = $this->_set_registration_status( FALSE, EEM_Registration::status_id_declined, $notify );
1318
-		$this->_reg_status_change_return( EEM_Registration::status_id_declined, $result );
1316
+	protected function decline_registration($notify = FALSE) {
1317
+		$result = $this->_set_registration_status(FALSE, EEM_Registration::status_id_declined, $notify);
1318
+		$this->_reg_status_change_return(EEM_Registration::status_id_declined, $result);
1319 1319
 	}
1320 1320
 
1321 1321
 
@@ -1327,9 +1327,9 @@  discard block
 block discarded – undo
1327 1327
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1328 1328
 	*		@return void
1329 1329
 	*/
1330
-	protected function cancel_registration( $notify = FALSE ) {
1331
-		$result = $this->_set_registration_status( FALSE, EEM_Registration::status_id_cancelled, $notify );
1332
-		$this->_reg_status_change_return( EEM_Registration::status_id_cancelled, $result );
1330
+	protected function cancel_registration($notify = FALSE) {
1331
+		$result = $this->_set_registration_status(FALSE, EEM_Registration::status_id_cancelled, $notify);
1332
+		$this->_reg_status_change_return(EEM_Registration::status_id_cancelled, $result);
1333 1333
 	}
1334 1334
 
1335 1335
 
@@ -1342,9 +1342,9 @@  discard block
 block discarded – undo
1342 1342
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1343 1343
 	*		@return void
1344 1344
 	*/
1345
-	protected function not_approve_registration( $notify = FALSE ) {
1346
-		$result = $this->_set_registration_status( FALSE, EEM_Registration::status_id_not_approved, $notify );
1347
-		$this->_reg_status_change_return( EEM_Registration::status_id_not_approved, $result );
1345
+	protected function not_approve_registration($notify = FALSE) {
1346
+		$result = $this->_set_registration_status(FALSE, EEM_Registration::status_id_not_approved, $notify);
1347
+		$this->_reg_status_change_return(EEM_Registration::status_id_not_approved, $result);
1348 1348
 	}
1349 1349
 
1350 1350
 
@@ -1355,9 +1355,9 @@  discard block
 block discarded – undo
1355 1355
 	*		@param bool $notify whether or not to notify the registrant about their approval.
1356 1356
 	*		@return void
1357 1357
 	*/
1358
-	protected function pending_registration( $notify = FALSE ) {
1359
-		$result = $this->_set_registration_status( FALSE, EEM_Registration::status_id_pending_payment, $notify );
1360
-		$this->_reg_status_change_return( EEM_Registration::status_id_pending_payment, $result );
1358
+	protected function pending_registration($notify = FALSE) {
1359
+		$result = $this->_set_registration_status(FALSE, EEM_Registration::status_id_pending_payment, $notify);
1360
+		$this->_reg_status_change_return(EEM_Registration::status_id_pending_payment, $result);
1361 1361
 	}
1362 1362
 
1363 1363
 
@@ -1373,70 +1373,70 @@  discard block
 block discarded – undo
1373 1373
 		$this->_session = $transaction->session_data();
1374 1374
 
1375 1375
 		$this->_template_args['REG_ID'] = $this->_registration->ID();
1376
-		$this->_template_args['line_items'] = $transaction->get_many_related('Line_Item', array( array('LIN_type' => 'line-item' ) ) );
1376
+		$this->_template_args['line_items'] = $transaction->get_many_related('Line_Item', array(array('LIN_type' => 'line-item')));
1377 1377
 
1378 1378
 
1379 1379
 		$attendee = $this->_registration->attendee();
1380 1380
 
1381 1381
 		// process taxes
1382
-		if ( $transaction ) {
1382
+		if ($transaction) {
1383 1383
 			//get all "tax" line items for this transaction and we'll use them for the tax display.
1384
-			$taxes = $transaction->get_many_related('Line_Item', array(array('LIN_type' => EEM_Line_Item::type_tax ) ) );
1385
-			$this->_template_args['taxes'] = !empty($taxes) ? $taxes : array();
1384
+			$taxes = $transaction->get_many_related('Line_Item', array(array('LIN_type' => EEM_Line_Item::type_tax)));
1385
+			$this->_template_args['taxes'] = ! empty($taxes) ? $taxes : array();
1386 1386
 		} else {
1387 1387
 			$this->_template_args['taxes'] = array();
1388 1388
 		}
1389 1389
 
1390
-		$this->_template_args['view_transaction_button'] = EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction' ) ?EEH_Template::get_button_or_link( EE_Admin_Page::add_query_args_and_nonce( array('action'=> 'view_transaction', 'TXN_ID' => $transaction->ID() ), TXN_ADMIN_URL ), __(' View Transaction'), 'button secondary-button right', 'dashicons dashicons-cart' ) : '';
1391
-		$this->_template_args['resend_registration_button'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ?EEH_Template::get_button_or_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'resend_registration', '_REG_ID'=>$this->_registration->ID(), 'redirect_to' => 'view_registration' ), REG_ADMIN_URL ), __(' Resend Registration'), 'button secondary-button right', 'dashicons dashicons-email-alt' ) : '';
1390
+		$this->_template_args['view_transaction_button'] = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ?EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action'=> 'view_transaction', 'TXN_ID' => $transaction->ID()), TXN_ADMIN_URL), __(' View Transaction'), 'button secondary-button right', 'dashicons dashicons-cart') : '';
1391
+		$this->_template_args['resend_registration_button'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration') ?EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action'=>'resend_registration', '_REG_ID'=>$this->_registration->ID(), 'redirect_to' => 'view_registration'), REG_ADMIN_URL), __(' Resend Registration'), 'button secondary-button right', 'dashicons dashicons-email-alt') : '';
1392 1392
 
1393
-		$this->_template_args['grand_total'] = EEH_Template::format_currency( $transaction->total() );
1393
+		$this->_template_args['grand_total'] = EEH_Template::format_currency($transaction->total());
1394 1394
 
1395 1395
 		$this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
1396
-		$payment = $transaction->get_first_related( 'Payment' );
1396
+		$payment = $transaction->get_first_related('Payment');
1397 1397
 		$payment = ! $payment instanceof EE_Payment ? EE_Payment::new_instance() : $payment;
1398
-		$payment_method = $payment->get_first_related( 'Payment_Method' );
1398
+		$payment_method = $payment->get_first_related('Payment_Method');
1399 1399
 		$payment_method = ! $payment_method instanceof EE_Payment_Method ? EE_Payment_Method::new_instance() : $payment_method;
1400
-		$reg_status_class = 'status-' . $this->_registration->status_ID();
1400
+		$reg_status_class = 'status-'.$this->_registration->status_ID();
1401 1401
 		$reg_details = array(
1402 1402
 			'payment_method' => $payment_method->name(),
1403 1403
 			'response_msg' => $payment->gateway_response(),
1404
-			'registration_id' => $this->_registration->get( 'REG_code' ),
1404
+			'registration_id' => $this->_registration->get('REG_code'),
1405 1405
 			'registration_session' => $this->_registration->session_ID(),
1406
-			'ip_address' => isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '',
1407
-			'user_agent' => isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '',
1406
+			'ip_address' => isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '',
1407
+			'user_agent' => isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '',
1408 1408
 			);
1409 1409
 
1410 1410
 
1411
-		if ( isset( $reg_details['registration_id'] )) {
1411
+		if (isset($reg_details['registration_id'])) {
1412 1412
 			$this->_template_args['reg_details']['registration_id']['value'] = $reg_details['registration_id'];
1413
-			$this->_template_args['reg_details']['registration_id']['label'] = __( 'Registration ID', 'event_espresso' );
1413
+			$this->_template_args['reg_details']['registration_id']['label'] = __('Registration ID', 'event_espresso');
1414 1414
 			$this->_template_args['reg_details']['registration_id']['class'] = 'regular-text';
1415 1415
 		}
1416 1416
 
1417
-		if ( isset( $reg_details['payment_method'] ) ) {
1417
+		if (isset($reg_details['payment_method'])) {
1418 1418
 			$this->_template_args['reg_details']['payment_method']['value'] = $reg_details['payment_method'];
1419
-			$this->_template_args['reg_details']['payment_method']['label'] = __( 'Most Recent Payment Method', 'event_espresso' );
1419
+			$this->_template_args['reg_details']['payment_method']['label'] = __('Most Recent Payment Method', 'event_espresso');
1420 1420
 			$this->_template_args['reg_details']['payment_method']['class'] = 'regular-text';
1421 1421
 			$this->_template_args['reg_details']['response_msg']['value'] = $reg_details['response_msg'];
1422
-			$this->_template_args['reg_details']['response_msg']['label'] = __( 'Payment method response', 'event_espresso' );
1422
+			$this->_template_args['reg_details']['response_msg']['label'] = __('Payment method response', 'event_espresso');
1423 1423
 			$this->_template_args['reg_details']['response_msg']['class'] = 'regular-text';
1424 1424
 		}
1425 1425
 
1426 1426
 		$this->_template_args['reg_details']['registration_session']['value'] = $reg_details['registration_session'];
1427
-		$this->_template_args['reg_details']['registration_session']['label'] = __( 'Registration Session', 'event_espresso' );
1427
+		$this->_template_args['reg_details']['registration_session']['label'] = __('Registration Session', 'event_espresso');
1428 1428
 		$this->_template_args['reg_details']['registration_session']['class'] = 'regular-text';
1429 1429
 
1430 1430
 		$this->_template_args['reg_details']['ip_address']['value'] = $reg_details['ip_address'];
1431
-		$this->_template_args['reg_details']['ip_address']['label'] = __( 'Registration placed from IP', 'event_espresso' );
1431
+		$this->_template_args['reg_details']['ip_address']['label'] = __('Registration placed from IP', 'event_espresso');
1432 1432
 		$this->_template_args['reg_details']['ip_address']['class'] = 'regular-text';
1433 1433
 
1434 1434
 		$this->_template_args['reg_details']['user_agent']['value'] = $reg_details['user_agent'];
1435
-		$this->_template_args['reg_details']['user_agent']['label'] = __( 'Registrant User Agent', 'event_espresso' );
1435
+		$this->_template_args['reg_details']['user_agent']['label'] = __('Registrant User Agent', 'event_espresso');
1436 1436
 		$this->_template_args['reg_details']['user_agent']['class'] = 'large-text';
1437 1437
 
1438
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_details.template.php';
1439
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1438
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_details.template.php';
1439
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1440 1440
 
1441 1441
 	}
1442 1442
 
@@ -1452,23 +1452,23 @@  discard block
 block discarded – undo
1452 1452
 	*/
1453 1453
 	public function _reg_questions_meta_box() {
1454 1454
 
1455
-		add_filter( 'FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', array( $this, 'form_before_question_group' ), 10, 1 );
1456
-		add_filter( 'FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', array( $this, 'form_after_question_group' ), 10, 1 );
1457
-		add_filter( 'FHEE__EEH_Form_Fields__label_html', array( $this, 'form_form_field_label_wrap' ), 10, 1 );
1458
-		add_filter( 'FHEE__EEH_Form_Fields__input_html', array( $this, 'form_form_field_input__wrap' ), 10, 1 );
1455
+		add_filter('FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', array($this, 'form_before_question_group'), 10, 1);
1456
+		add_filter('FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', array($this, 'form_after_question_group'), 10, 1);
1457
+		add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'form_form_field_label_wrap'), 10, 1);
1458
+		add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'form_form_field_input__wrap'), 10, 1);
1459 1459
 
1460
-		$question_groups = EEM_Event::instance()->assemble_array_of_groups_questions_and_options( $this->_registration, $this->_registration->get('EVT_ID') );
1460
+		$question_groups = EEM_Event::instance()->assemble_array_of_groups_questions_and_options($this->_registration, $this->_registration->get('EVT_ID'));
1461 1461
 
1462 1462
 		//EEH_Debug_Tools::printr( $question_groups, '$question_groups  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
1463 1463
 
1464
-		EE_Registry::instance()->load_helper( 'Form_Fields' );
1465
-		$this->_template_args['att_questions'] = EEH_Form_Fields::generate_question_groups_html( $question_groups );
1464
+		EE_Registry::instance()->load_helper('Form_Fields');
1465
+		$this->_template_args['att_questions'] = EEH_Form_Fields::generate_question_groups_html($question_groups);
1466 1466
 
1467 1467
 		$this->_template_args['reg_questions_form_action'] = 'update_attendee_registration_form';
1468 1468
 		$this->_template_args['REG_ID'] = $this->_registration->ID();
1469 1469
 
1470
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_questions.template.php';
1471
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1470
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_questions.template.php';
1471
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1472 1472
 
1473 1473
 	}
1474 1474
 
@@ -1483,7 +1483,7 @@  discard block
 block discarded – undo
1483 1483
 	 * 		@param 		string 		$output
1484 1484
 	 * 		@return 		string
1485 1485
 	 */
1486
-	public function form_before_question_group( $output ) {
1486
+	public function form_before_question_group($output) {
1487 1487
 		return '
1488 1488
 	<table class="form-table ee-width-100">
1489 1489
 		<tbody>
@@ -1500,13 +1500,13 @@  discard block
 block discarded – undo
1500 1500
 	 * 		@param 		string 		$output
1501 1501
 	 * 		@return 		string
1502 1502
 	 */
1503
-	public function form_after_question_group( $output ) {
1503
+	public function form_after_question_group($output) {
1504 1504
 		return  '
1505 1505
 			<tr class="hide-if-no-js">
1506 1506
 				<th> </th>
1507 1507
 				<td class="reg-admin-edit-attendee-question-td">
1508
-					<a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__( 'click to edit question', 'event_espresso' ) . '">
1509
-						<span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __( 'edit the above question group', 'event_espresso' ) . '</span>
1508
+					<a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__('click to edit question', 'event_espresso').'">
1509
+						<span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __('edit the above question group', 'event_espresso').'</span>
1510 1510
 						<div class="dashicons dashicons-edit"></div>
1511 1511
 					</a>
1512 1512
 				</td>
@@ -1526,11 +1526,11 @@  discard block
 block discarded – undo
1526 1526
 	 * 		@param 		string 		$label
1527 1527
 	 * 		@return 		string
1528 1528
 	 */
1529
-	public function form_form_field_label_wrap( $label ) {
1529
+	public function form_form_field_label_wrap($label) {
1530 1530
 		return '
1531 1531
 			<tr>
1532 1532
 				<th>
1533
-					' . $label  . '
1533
+					' . $label.'
1534 1534
 				</th>';
1535 1535
 	}
1536 1536
 
@@ -1544,10 +1544,10 @@  discard block
 block discarded – undo
1544 1544
 	 * 		@param 		string 		$label
1545 1545
 	 * 		@return 		string
1546 1546
 	 */
1547
-	public function form_form_field_input__wrap( $input ) {
1547
+	public function form_form_field_input__wrap($input) {
1548 1548
 		return '
1549 1549
 				<td class="reg-admin-attendee-questions-input-td disabled-input">
1550
-					' . $input . '
1550
+					' . $input.'
1551 1551
 				</td>
1552 1552
 			</tr>';
1553 1553
 	}
@@ -1561,13 +1561,13 @@  discard block
 block discarded – undo
1561 1561
 	*		@return void
1562 1562
 	*/
1563 1563
 	protected function _update_attendee_registration_form() {
1564
-		$qstns = isset( $this->_req_data['qstn'] ) ? $this->_req_data['qstn'] : FALSE;
1565
-		$REG_ID = isset( $this->_req_data['_REG_ID'] ) ? absint( $this->_req_data['_REG_ID'] ) : FALSE;
1566
-		$qstns = apply_filters( 'FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns', $qstns );
1567
-		$success = $this->_save_attendee_registration_form( $REG_ID, $qstns );
1564
+		$qstns = isset($this->_req_data['qstn']) ? $this->_req_data['qstn'] : FALSE;
1565
+		$REG_ID = isset($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : FALSE;
1566
+		$qstns = apply_filters('FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns', $qstns);
1567
+		$success = $this->_save_attendee_registration_form($REG_ID, $qstns);
1568 1568
 		$what = __('Registration Form', 'event_espresso');
1569
-		$route = $REG_ID ? array( 'action' => 'view_registration', '_REG_ID' => $REG_ID ) : array( 'action' => 'default' );
1570
-		$this->_redirect_after_action( $success, $what, __('updated', 'event_espresso'), $route );
1569
+		$route = $REG_ID ? array('action' => 'view_registration', '_REG_ID' => $REG_ID) : array('action' => 'default');
1570
+		$this->_redirect_after_action($success, $what, __('updated', 'event_espresso'), $route);
1571 1571
 
1572 1572
 	}
1573 1573
 
@@ -1580,26 +1580,26 @@  discard block
 block discarded – undo
1580 1580
 	 * @param bool $qstns
1581 1581
 	 * @return bool
1582 1582
 	 */
1583
-	private function _save_attendee_registration_form( $REG_ID = FALSE, $qstns = FALSE ) {
1583
+	private function _save_attendee_registration_form($REG_ID = FALSE, $qstns = FALSE) {
1584 1584
 
1585
-		if ( ! $REG_ID || ! $qstns ) {
1586
-			EE_Error::add_error( __('An error occurred. No registration ID and/or registration questions were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1585
+		if ( ! $REG_ID || ! $qstns) {
1586
+			EE_Error::add_error(__('An error occurred. No registration ID and/or registration questions were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1587 1587
 		}
1588 1588
 		$success = TRUE;
1589 1589
 
1590 1590
 		// allow others to get in on this awesome fun   :D
1591
-		do_action( 'AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save', $REG_ID, $qstns );
1591
+		do_action('AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save', $REG_ID, $qstns);
1592 1592
 		// loop thru questions... FINALLY!!!
1593 1593
 
1594
-		foreach ( $qstns as $QST_ID => $qstn ) {
1594
+		foreach ($qstns as $QST_ID => $qstn) {
1595 1595
 			//if $qstn isn't an array then it doesn't already have an answer, so let's create the answer
1596
-			if ( !is_array($qstn) ) {
1597
-				$success = $this->_save_new_answer( $REG_ID, $QST_ID, $qstn);
1596
+			if ( ! is_array($qstn)) {
1597
+				$success = $this->_save_new_answer($REG_ID, $QST_ID, $qstn);
1598 1598
 				continue;
1599 1599
 			}
1600 1600
 
1601 1601
 
1602
-			foreach ( $qstn as $ANS_ID => $ANS_value ) {
1602
+			foreach ($qstn as $ANS_ID => $ANS_value) {
1603 1603
 				//get answer
1604 1604
 				$query_params = array(
1605 1605
 					0 => array(
@@ -1610,8 +1610,8 @@  discard block
 block discarded – undo
1610 1610
 					);
1611 1611
 				$answer = EEM_Answer::instance()->get_one($query_params);
1612 1612
 				//this MAY be an array but NOT have an answer because its multi select.  If so then we need to create the answer
1613
-				if ( ! $answer instanceof EE_Answer ) {
1614
-					$success = $this->_save_new_answer( $REG_ID, $QST_ID, $qstn);
1613
+				if ( ! $answer instanceof EE_Answer) {
1614
+					$success = $this->_save_new_answer($REG_ID, $QST_ID, $qstn);
1615 1615
 					continue 2;
1616 1616
 				}
1617 1617
 
@@ -1625,7 +1625,7 @@  discard block
 block discarded – undo
1625 1625
 
1626 1626
 
1627 1627
 	//TODO: try changing this to use the model directly... not indirectly through creating a default object...
1628
-	private function _save_new_answer( $REG_ID, $QST_ID, $ans ) {
1628
+	private function _save_new_answer($REG_ID, $QST_ID, $ans) {
1629 1629
 		$set_values = array(
1630 1630
 			'QST_ID' => $QST_ID,
1631 1631
 			'REG_ID' => $REG_ID,
@@ -1652,30 +1652,30 @@  discard block
 block discarded – undo
1652 1652
 		$registrations = $REG->get_all(array(
1653 1653
 			array(
1654 1654
 				'TXN_ID'=>$this->_registration->transaction_ID(),
1655
-				'REG_ID'=>array('!=',$this->_registration->ID())
1655
+				'REG_ID'=>array('!=', $this->_registration->ID())
1656 1656
 			),
1657 1657
 			'force_join'=>array('Attendee')));
1658 1658
 
1659 1659
 		$this->_template_args['attendees'] = array();
1660 1660
 		$this->_template_args['attendee_notice'] = '';
1661 1661
 		EE_Registry::instance()->load_helper('Array');
1662
-		if ( empty( $registrations)  || ( is_array($registrations) &&  ! EEH_Array::get_one_item_from_array($registrations) ) ) {
1663
-			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__ );
1662
+		if (empty($registrations) || (is_array($registrations) && ! EEH_Array::get_one_item_from_array($registrations))) {
1663
+			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__);
1664 1664
 			$this->_template_args['attendee_notice'] = EE_Error::get_notices();
1665 1665
 		} else {
1666 1666
 
1667 1667
 			$att_nmbr = 1;
1668
-			foreach ( $registrations as $registration ) {
1668
+			foreach ($registrations as $registration) {
1669 1669
 				/* @var $registration EE_Registration */
1670 1670
 				$attendee = $registration->attendee() ? $registration->attendee() : EEM_Attendee::instance()->create_default_object();
1671
-				$this->_template_args['attendees'][ $att_nmbr ]['fname'] = $attendee->fname();//( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : '';
1672
-				$this->_template_args['attendees'][ $att_nmbr ]['lname'] = $attendee->lname();//( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : '';
1673
-				$this->_template_args['attendees'][ $att_nmbr ]['email'] = $attendee->email();//( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : '';
1674
-				$this->_template_args['attendees'][ $att_nmbr ]['final_price'] = $registration->price_paid();//( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : '';
1671
+				$this->_template_args['attendees'][$att_nmbr]['fname'] = $attendee->fname(); //( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : '';
1672
+				$this->_template_args['attendees'][$att_nmbr]['lname'] = $attendee->lname(); //( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : '';
1673
+				$this->_template_args['attendees'][$att_nmbr]['email'] = $attendee->email(); //( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : '';
1674
+				$this->_template_args['attendees'][$att_nmbr]['final_price'] = $registration->price_paid(); //( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : '';
1675 1675
 
1676
-				$this->_template_args['attendees'][ $att_nmbr ]['address'] = implode( ', ', $attendee->full_address_as_array() );
1676
+				$this->_template_args['attendees'][$att_nmbr]['address'] = implode(', ', $attendee->full_address_as_array());
1677 1677
 
1678
-				$this->_template_args['attendees'][ $att_nmbr ]['att_link'] = self::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL );
1678
+				$this->_template_args['attendees'][$att_nmbr]['att_link'] = self::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL);
1679 1679
 
1680 1680
 				$att_nmbr++;
1681 1681
 			}
@@ -1687,8 +1687,8 @@  discard block
 block discarded – undo
1687 1687
 
1688 1688
 	//			$this->_template_args['registration_form_url'] = add_query_arg( array( 'action' => 'edit_registration', 'process' => 'attendees'  ), REG_ADMIN_URL );
1689 1689
 		}
1690
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_attendees.template.php';
1691
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1690
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_attendees.template.php';
1691
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1692 1692
 
1693 1693
 	}
1694 1694
 
@@ -1709,11 +1709,11 @@  discard block
 block discarded – undo
1709 1709
 		$attendee = $att_check instanceof EE_Attendee ? $att_check : EEM_Attendee::instance()->create_default_object();
1710 1710
 
1711 1711
 		//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 cereate button or not)
1712
-		if ( ! $this->_registration->is_primary_registrant() ) {
1712
+		if ( ! $this->_registration->is_primary_registrant()) {
1713 1713
 			$primary_registration = $this->_registration->get_primary_registration();
1714 1714
 			$primary_attendee = $primary_registration->attendee();
1715 1715
 
1716
-			if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID() ) {
1716
+			if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID()) {
1717 1717
 				//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.
1718 1718
 				$primary_registration = NULL;
1719 1719
 			}
@@ -1722,30 +1722,30 @@  discard block
 block discarded – undo
1722 1722
 		}
1723 1723
 
1724 1724
 		$this->_template_args['ATT_ID'] = $attendee->ID();
1725
-		$this->_template_args['fname'] = $attendee->fname();//$this->_registration->ATT_fname;
1726
-		$this->_template_args['lname'] = $attendee->lname();//$this->_registration->ATT_lname;
1727
-		$this->_template_args['email'] = $attendee->email();//$this->_registration->ATT_email;
1728
-		$this->_template_args['address'] = $attendee->address();//$this->_registration->ATT_address;
1729
-		$this->_template_args['address2'] =  $attendee->address2() ? '<br />' . $attendee->address2() : '';
1730
-		$this->_template_args['city'] =  $attendee->city() ? '<br />' . $attendee->city(). ', ' : '';
1731
-		$this->_template_args['state'] =  $attendee->state_obj() ? '<br />' . $attendee->state_obj()->name() . ', ' : '';
1732
-		$this->_template_args['country'] =  $attendee->country_obj() ? $attendee->country_obj()->name() : '';
1733
-		$this->_template_args['zip'] =  $attendee->zip() ? '<br />' . $attendee->zip() : '';
1725
+		$this->_template_args['fname'] = $attendee->fname(); //$this->_registration->ATT_fname;
1726
+		$this->_template_args['lname'] = $attendee->lname(); //$this->_registration->ATT_lname;
1727
+		$this->_template_args['email'] = $attendee->email(); //$this->_registration->ATT_email;
1728
+		$this->_template_args['address'] = $attendee->address(); //$this->_registration->ATT_address;
1729
+		$this->_template_args['address2'] = $attendee->address2() ? '<br />'.$attendee->address2() : '';
1730
+		$this->_template_args['city'] = $attendee->city() ? '<br />'.$attendee->city().', ' : '';
1731
+		$this->_template_args['state'] = $attendee->state_obj() ? '<br />'.$attendee->state_obj()->name().', ' : '';
1732
+		$this->_template_args['country'] = $attendee->country_obj() ? $attendee->country_obj()->name() : '';
1733
+		$this->_template_args['zip'] = $attendee->zip() ? '<br />'.$attendee->zip() : '';
1734 1734
 		$this->_template_args['phone'] = $attendee->phone();
1735 1735
 
1736 1736
 		//edit link
1737
-		$this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL );
1738
-		$this->_template_args['att_edit_label'] = __('View/Edit Contact' );
1737
+		$this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL);
1738
+		$this->_template_args['att_edit_label'] = __('View/Edit Contact');
1739 1739
 
1740 1740
 		//create link
1741
-		$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 ): '';
1741
+		$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) : '';
1742 1742
 		$this->_template_args['create_label'] = __('Create Contact', 'event_espresso');
1743 1743
 
1744 1744
 		$this->_template_args['att_check'] = $att_check;
1745 1745
 
1746 1746
 
1747
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_side_meta_box_registrant.template.php';
1748
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1747
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_details_side_meta_box_registrant.template.php';
1748
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1749 1749
 	}
1750 1750
 
1751 1751
 
@@ -1758,7 +1758,7 @@  discard block
 block discarded – undo
1758 1758
 	 * @access protected
1759 1759
 	 * @return void
1760 1760
 	 */
1761
-	protected function _trash_or_restore_registrations( $trash = TRUE ) {
1761
+	protected function _trash_or_restore_registrations($trash = TRUE) {
1762 1762
 		$REGM = EEM_Registration::instance();
1763 1763
 
1764 1764
 		$success = 1;
@@ -1768,26 +1768,26 @@  discard block
 block discarded – undo
1768 1768
 		$dtts = array();
1769 1769
 
1770 1770
 		//if empty _REG_ID then get out because there's nothing to do
1771
-		if ( empty( $this->_req_data['_REG_ID'] ) ) {
1771
+		if (empty($this->_req_data['_REG_ID'])) {
1772 1772
 			$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');
1773
-			EE_Error::add_error( $msg, __FILE__, __LINE__, __FUNCTION__ );
1774
-			$this->_redirect_after_action(FALSE, '', '', array(), TRUE );
1773
+			EE_Error::add_error($msg, __FILE__, __LINE__, __FUNCTION__);
1774
+			$this->_redirect_after_action(FALSE, '', '', array(), TRUE);
1775 1775
 		}
1776 1776
 
1777 1777
 		//Checkboxes
1778
-		if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1778
+		if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1779 1779
 			// if array has more than one element than success message should be plural
1780
-			$success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1;
1780
+			$success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1;
1781 1781
 			// cycle thru checkboxes
1782
-			while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) {
1782
+			while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) {
1783 1783
 
1784 1784
 				$REG = $REGM->get_one_by_ID($REG_ID);
1785 1785
 				$payment_count = $REG->get_first_related('Transaction')->count_related('Payment');
1786
-				if ( $payment_count > 0 ) {
1786
+				if ($payment_count > 0) {
1787 1787
 					$name = $REG->attendee()->full_name();
1788 1788
 					$error = 1;
1789 1789
 					$success = 0;
1790
-					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__ );
1790
+					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__);
1791 1791
 					continue; //can't trash this registration because it has payments.
1792 1792
 				}
1793 1793
 				$ticket = $REG->get_first_related('Ticket');
@@ -1796,7 +1796,7 @@  discard block
 block discarded – undo
1796 1796
 				$dtts = array_merge($dtts, $dtt);
1797 1797
 
1798 1798
 				$updated = $trash ? $REG->delete() : $REG->restore();
1799
-				if ( !$updated ) {
1799
+				if ( ! $updated) {
1800 1800
 					$success = 0;
1801 1801
 				} else {
1802 1802
 					$success = 2;
@@ -1811,7 +1811,7 @@  discard block
 block discarded – undo
1811 1811
 			$tickets[$ticket->ID()] = $ticket;
1812 1812
 			$dtts = $ticket->get_many_related('Datetime');
1813 1813
 			$updated = $trash ? $REG->delete() : $REG->restore();
1814
-			if ( ! $updated ) {
1814
+			if ( ! $updated) {
1815 1815
 				$success = 0;
1816 1816
 			}
1817 1817
 
@@ -1821,10 +1821,10 @@  discard block
 block discarded – undo
1821 1821
 		EEM_Ticket::instance()->update_tickets_sold($tickets);
1822 1822
 		EEM_Datetime::instance()->update_sold($dtts);
1823 1823
 
1824
-		$what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' );
1825
-		$action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' );
1824
+		$what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso');
1825
+		$action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso');
1826 1826
 		$overwrite_msgs = $error ? TRUE : FALSE;
1827
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), $overwrite_msgs );
1827
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), $overwrite_msgs);
1828 1828
 	}
1829 1829
 
1830 1830
 
@@ -1848,16 +1848,16 @@  discard block
 block discarded – undo
1848 1848
 		$success = 1;
1849 1849
 
1850 1850
 		//Checkboxes
1851
-		if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1851
+		if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) {
1852 1852
 			// if array has more than one element than success message should be plural
1853
-			$success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1;
1853
+			$success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1;
1854 1854
 			// cycle thru checkboxes
1855
-			while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) {
1855
+			while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) {
1856 1856
 				$REG = $REG_MDL->get_one_by_ID($REG_ID);
1857
-				if ( ! $REG instanceof EE_Registration )
1857
+				if ( ! $REG instanceof EE_Registration)
1858 1858
 					continue;
1859 1859
 				$deleted = $this->_delete_registration($REG);
1860
-				if ( !$deleted ) {
1860
+				if ( ! $deleted) {
1861 1861
 					$success = 0;
1862 1862
 				}
1863 1863
 			}
@@ -1867,15 +1867,15 @@  discard block
 block discarded – undo
1867 1867
 			$REG_ID = $this->_req_data['_REG_ID'];
1868 1868
 			$REG = $REG_MDL->get_one_by_ID($REG_ID);
1869 1869
 			$deleted = $this->_delete_registration($REG);
1870
-			if ( ! $deleted ) {
1870
+			if ( ! $deleted) {
1871 1871
 				$success = 0;
1872 1872
 			}
1873 1873
 
1874 1874
 		}
1875 1875
 
1876
-		$what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' );
1877
-		$action_desc = __( 'permanently deleted.', 'event_espresso' );
1878
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), TRUE );
1876
+		$what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso');
1877
+		$action_desc = __('permanently deleted.', 'event_espresso');
1878
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), TRUE);
1879 1879
 	}
1880 1880
 
1881 1881
 
@@ -1887,31 +1887,31 @@  discard block
 block discarded – undo
1887 1887
 	 * @param  EE_Registration $REG registration to be deleted permenantly
1888 1888
 	 * @return boolean              true = successful deletion, false = fail.
1889 1889
 	 */
1890
-	protected function _delete_registration( EE_Registration $REG ) {
1890
+	protected function _delete_registration(EE_Registration $REG) {
1891 1891
 		//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.
1892 1892
 		$TXN = $REG->get_first_related('Transaction');
1893 1893
 		$REGS = $TXN->get_many_related('Registration');
1894 1894
 
1895 1895
 		$all_trashed = TRUE;
1896
-		foreach ( $REGS as $registration ) {
1897
-			if ( ! $registration->get('REG_deleted') )
1896
+		foreach ($REGS as $registration) {
1897
+			if ( ! $registration->get('REG_deleted'))
1898 1898
 				$all_trashed = FALSE;
1899 1899
 		}
1900 1900
 
1901
-		if ( ! $all_trashed ) {
1902
-			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__ );
1901
+		if ( ! $all_trashed) {
1902
+			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__);
1903 1903
 			return false;
1904 1904
 		}
1905 1905
 
1906 1906
 		//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).
1907
-		foreach ( $REGS as $registration ) {
1907
+		foreach ($REGS as $registration) {
1908 1908
 
1909 1909
 			//delete related answers
1910 1910
 			$registration->delete_related_permanently('Answer');
1911 1911
 
1912 1912
 			//remove relationship to EE_Attendee (but we ALWAYS leave the contact record intact)
1913 1913
 			$attendee = $registration->get_first_related('Attendee');
1914
-			if ( $attendee instanceof EE_Attendee ) {
1914
+			if ($attendee instanceof EE_Attendee) {
1915 1915
 				$registration->_remove_relation_to($attendee, 'Attendee');
1916 1916
 			}
1917 1917
 
@@ -1921,7 +1921,7 @@  discard block
 block discarded – undo
1921 1921
 			//now delete permanently the checkins related to this registration.
1922 1922
 			$registration->delete_related_permanently('Checkin');
1923 1923
 
1924
-			if ( $registration->ID() === $REG->ID() )
1924
+			if ($registration->ID() === $REG->ID())
1925 1925
 				continue; //we don't want to delete permanently the existing registration just yet.
1926 1926
 
1927 1927
 			//remove relation to transaction for these registrations if NOT the existing registrations
@@ -1954,34 +1954,34 @@  discard block
 block discarded – undo
1954 1954
 	 * @return void
1955 1955
 	 */
1956 1956
 	public function new_registration() {
1957
-		if ( ! $this->_set_reg_event() ) {
1958
-			throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso') );
1957
+		if ( ! $this->_set_reg_event()) {
1958
+			throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso'));
1959 1959
 		}
1960
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
1960
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
1961 1961
 
1962 1962
 		// gotta start with a clean slate if we're not coming here via ajax
1963
-		if ( ! defined('DOING_AJAX' ) && ( ! isset( $this->_req_data['processing_registration'] ) || isset( $this->_req_data['step_error'] ))) {
1964
-			EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
1963
+		if ( ! defined('DOING_AJAX') && ( ! isset($this->_req_data['processing_registration']) || isset($this->_req_data['step_error']))) {
1964
+			EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
1965 1965
 		}
1966 1966
 
1967
-		$this->_template_args['event_name'] = '' ;
1967
+		$this->_template_args['event_name'] = '';
1968 1968
 		// event name
1969
-		if ( $this->_reg_event ) {
1969
+		if ($this->_reg_event) {
1970 1970
 			$this->_template_args['event_name'] = $this->_reg_event->name();
1971
-			$edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$this->_reg_event->ID() ), EVENTS_ADMIN_URL );
1972
-			$edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $this->_reg_event->name() . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>';
1973
-			$this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ;
1971
+			$edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$this->_reg_event->ID()), EVENTS_ADMIN_URL);
1972
+			$edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$this->_reg_event->name().'">'.__('Edit Event', 'event_espresso').'</a>';
1973
+			$this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>';
1974 1974
 		}
1975 1975
 
1976 1976
 		$this->_template_args['step_content'] = $this->_get_registration_step_content();
1977 1977
 
1978
-		if ( defined('DOING_AJAX' ) )
1978
+		if (defined('DOING_AJAX'))
1979 1979
 			$this->_return_json();
1980 1980
 
1981 1981
 
1982 1982
 		// grab header
1983
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee.template.php';
1984
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
1983
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_register_new_attendee.template.php';
1984
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
1985 1985
 
1986 1986
 		//$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
1987 1987
 		// the details template wrapper
@@ -1999,7 +1999,7 @@  discard block
 block discarded – undo
1999 1999
 	 */
2000 2000
 	protected function _get_registration_step_content() {
2001 2001
 
2002
-		$template_path = REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee_step_content.template.php';
2002
+		$template_path = REG_TEMPLATE_PATH.'reg_admin_register_new_attendee_step_content.template.php';
2003 2003
 		$template_args = array(
2004 2004
 			'title' => '',
2005 2005
 			'content' => '',
@@ -2020,11 +2020,11 @@  discard block
 block discarded – undo
2020 2020
 
2021 2021
 		//if the cart is empty then we know we're at step one so we'll display ticket selector
2022 2022
 		$cart = EE_Registry::instance()->SSN->get_session_data('cart');
2023
-		$step = empty( $cart ) ? 'ticket' : 'questions';
2024
-		switch ( $step ) {
2023
+		$step = empty($cart) ? 'ticket' : 'questions';
2024
+		switch ($step) {
2025 2025
 			case 'ticket' :
2026 2026
 				$template_args['title'] = __('Step One: Select the Ticket for this registration', 'event_espresso');
2027
-				$template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector( $this->_reg_event );
2027
+				$template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector($this->_reg_event);
2028 2028
 				$template_args['step_button_text'] = __('Add Tickets and Continue to Registrant Details', 'event_espresso');
2029 2029
 				$template_args['show_notification_toggle'] = FALSE;
2030 2030
 				break;
@@ -2037,9 +2037,9 @@  discard block
 block discarded – undo
2037 2037
 				break;
2038 2038
 		}
2039 2039
 
2040
-		$this->_set_add_edit_form_tags( 'process_reg_step', $hidden_fields ); //we come back to the process_registration_step route.
2040
+		$this->_set_add_edit_form_tags('process_reg_step', $hidden_fields); //we come back to the process_registration_step route.
2041 2041
 
2042
-		return EEH_Template::display_template( $template_path, $template_args, TRUE );
2042
+		return EEH_Template::display_template($template_path, $template_args, TRUE);
2043 2043
 	}
2044 2044
 
2045 2045
 
@@ -2053,11 +2053,11 @@  discard block
 block discarded – undo
2053 2053
 	*		@return boolean
2054 2054
 	*/
2055 2055
 	private function _set_reg_event() {
2056
-		if ( is_object( $this->_reg_event )) {
2056
+		if (is_object($this->_reg_event)) {
2057 2057
 			return TRUE;
2058 2058
 		}
2059
-		$EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE;
2060
-		if ( ! $EVT_ID ) {
2059
+		$EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE;
2060
+		if ( ! $EVT_ID) {
2061 2061
 			return FALSE;
2062 2062
 		}
2063 2063
 
@@ -2078,59 +2078,59 @@  discard block
 block discarded – undo
2078 2078
 	public function process_reg_step() {
2079 2079
 
2080 2080
 		$this->_set_reg_event();
2081
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
2081
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
2082 2082
 
2083 2083
 		//what step are we on?
2084
-		$cart = EE_Registry::instance()->SSN->get_session_data( 'cart' );
2085
-		$step = empty( $cart ) ? 'ticket' : 'questions';
2084
+		$cart = EE_Registry::instance()->SSN->get_session_data('cart');
2085
+		$step = empty($cart) ? 'ticket' : 'questions';
2086 2086
 
2087 2087
 		//if doing ajax then we need to verify the nonce
2088
-		if ( 'DOING_AJAX' ) {
2089
-			$nonce = isset( $this->_req_data[$this->_req_nonce] ) ? sanitize_text_field( $this->_req_data[$this->_req_nonce] ) : '';
2090
-			$this->_verify_nonce( $nonce, $this->_req_nonce );
2088
+		if ('DOING_AJAX') {
2089
+			$nonce = isset($this->_req_data[$this->_req_nonce]) ? sanitize_text_field($this->_req_data[$this->_req_nonce]) : '';
2090
+			$this->_verify_nonce($nonce, $this->_req_nonce);
2091 2091
 		}
2092 2092
 
2093
-		switch ( $step ) {
2093
+		switch ($step) {
2094 2094
 			case 'ticket' :
2095 2095
 				//process ticket selection
2096 2096
 				$success = EED_Ticket_Selector::instance()->process_ticket_selections();
2097
-				if ( $success ) {
2098
-					EE_Error::add_success( __('Tickets Selected. Now complete the registration.'), 'event_espresso');
2097
+				if ($success) {
2098
+					EE_Error::add_success(__('Tickets Selected. Now complete the registration.'), 'event_espresso');
2099 2099
 				} else {
2100 2100
 					$query_args['step_error'] = $this->_req_data['step_error'] = TRUE;
2101 2101
 				}
2102
-				if ( defined('DOING_AJAX') ) {
2102
+				if (defined('DOING_AJAX')) {
2103 2103
 					$this->new_registration(); //display next step
2104 2104
 				} else {
2105 2105
 					$query_args['action'] = 'new_registration';
2106 2106
 					$query_args['processing_registration'] = true;
2107 2107
 					$query_args['event_id'] = $this->_reg_event->ID();
2108
-					$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
2108
+					$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2109 2109
 				}
2110 2110
 				break;
2111 2111
 			case 'questions' :
2112 2112
 				//process registration
2113 2113
 				$transaction = EED_Single_Page_Checkout::instance()->process_registration_from_admin();
2114
-				if ( ! $transaction instanceof EE_Transaction ) {
2114
+				if ( ! $transaction instanceof EE_Transaction) {
2115 2115
 					$query_args = array(
2116 2116
 						'action' => 'new_registration',
2117 2117
 						'processing_registration' => true,
2118 2118
 						'event_id' => $this->_reg_event->ID()
2119 2119
 					);
2120 2120
 
2121
-					if ( defined('DOING_AJAX' )) {
2121
+					if (defined('DOING_AJAX')) {
2122 2122
 						//display registration form again because there are errors (maybe validation?)
2123 2123
 						$this->new_registration();
2124 2124
 						return;
2125 2125
 					} else {
2126
-						$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
2126
+						$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2127 2127
 						return;
2128 2128
 					}
2129 2129
 				}
2130 2130
 				/** @type EE_Transaction_Payments $transaction_payments */
2131
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
2131
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
2132 2132
 				// maybe update status, and make sure to save transaction if not done already
2133
-				if ( ! $transaction_payments->update_transaction_status_based_on_total_paid( $transaction )) {
2133
+				if ( ! $transaction_payments->update_transaction_status_based_on_total_paid($transaction)) {
2134 2134
 					$transaction->save();
2135 2135
 				}
2136 2136
 				$query_args = array(
@@ -2138,8 +2138,8 @@  discard block
 block discarded – undo
2138 2138
 					'TXN_ID' => $transaction->ID(),
2139 2139
 					'page' => 'espresso_transactions'
2140 2140
 				);
2141
-				EE_Error::add_success( __('Registration Created.  Please review the transaction and add any payments as necessary', 'event_espresso') );
2142
-				$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
2141
+				EE_Error::add_success(__('Registration Created.  Please review the transaction and add any payments as necessary', 'event_espresso'));
2142
+				$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2143 2143
 				break;
2144 2144
 			}
2145 2145
 
@@ -2159,7 +2159,7 @@  discard block
 block discarded – undo
2159 2159
 	*		@return void
2160 2160
 	*/
2161 2161
 	protected function _attendee_contact_list_table() {
2162
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2162
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2163 2163
 		$this->_search_btn_label = __('Contacts', 'event_espresso');
2164 2164
 		$this->display_admin_list_table_page_with_no_sidebar();
2165 2165
 	}
@@ -2174,13 +2174,13 @@  discard block
 block discarded – undo
2174 2174
 	*		@access public
2175 2175
 	*		@return array
2176 2176
 	*/
2177
-	public function get_attendees( $per_page, $count = FALSE, $trash = FALSE ) {
2177
+	public function get_attendees($per_page, $count = FALSE, $trash = FALSE) {
2178 2178
 
2179
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2179
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2180 2180
 		// start with an empty array
2181 2181
 		$attendees = array();
2182 2182
 
2183
-		require_once( REG_ADMIN . 'EE_Attendee_Contact_List_Table.class.php' );
2183
+		require_once(REG_ADMIN.'EE_Attendee_Contact_List_Table.class.php');
2184 2184
 		$ATT_MDL = EEM_Attendee::instance();
2185 2185
 
2186 2186
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
@@ -2208,47 +2208,47 @@  discard block
 block discarded – undo
2208 2208
 				$orderby = 'ATT_lname';
2209 2209
 		}
2210 2210
 
2211
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC';
2211
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC';
2212 2212
 
2213
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
2214
-		$per_page = isset( $per_page ) && !empty( $per_page ) ? $per_page : 10;
2215
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
2213
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
2214
+		$per_page = isset($per_page) && ! empty($per_page) ? $per_page : 10;
2215
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
2216 2216
 
2217 2217
 		$_where = array();
2218 2218
 
2219
-		if ( isset( $this->_req_data['s'] ) ) {
2220
-			$sstr = '%' . $this->_req_data['s'] . '%';
2219
+		if (isset($this->_req_data['s'])) {
2220
+			$sstr = '%'.$this->_req_data['s'].'%';
2221 2221
 			$_where['OR'] = array(
2222
-				'Registration.Event.EVT_name' => array( 'LIKE', $sstr),
2223
-				'Registration.Event.EVT_desc' => array( 'LIKE', $sstr ),
2224
-				'Registration.Event.EVT_short_desc' => array( 'LIKE' , $sstr ),
2225
-				'ATT_fname' => array( 'LIKE', $sstr ),
2226
-				'ATT_lname' => array( 'LIKE', $sstr ),
2227
-				'ATT_short_bio' => array( 'LIKE', $sstr ),
2228
-				'ATT_email' => array('LIKE', $sstr ),
2229
-				'ATT_address' => array( 'LIKE', $sstr ),
2230
-				'ATT_address2' => array( 'LIKE', $sstr ),
2231
-				'ATT_city' => array( 'LIKE', $sstr ),
2232
-				'Country.CNT_name' => array( 'LIKE', $sstr ),
2233
-				'State.STA_name' => array('LIKE', $sstr ),
2234
-				'ATT_phone' => array( 'LIKE', $sstr ),
2235
-				'Registration.REG_final_price' => array( 'LIKE', $sstr ),
2236
-				'Registration.REG_code' => array( 'LIKE', $sstr ),
2237
-				'Registration.REG_count' => array( 'LIKE' , $sstr ),
2238
-				'Registration.REG_group_size' => array( 'LIKE' , $sstr )
2222
+				'Registration.Event.EVT_name' => array('LIKE', $sstr),
2223
+				'Registration.Event.EVT_desc' => array('LIKE', $sstr),
2224
+				'Registration.Event.EVT_short_desc' => array('LIKE', $sstr),
2225
+				'ATT_fname' => array('LIKE', $sstr),
2226
+				'ATT_lname' => array('LIKE', $sstr),
2227
+				'ATT_short_bio' => array('LIKE', $sstr),
2228
+				'ATT_email' => array('LIKE', $sstr),
2229
+				'ATT_address' => array('LIKE', $sstr),
2230
+				'ATT_address2' => array('LIKE', $sstr),
2231
+				'ATT_city' => array('LIKE', $sstr),
2232
+				'Country.CNT_name' => array('LIKE', $sstr),
2233
+				'State.STA_name' => array('LIKE', $sstr),
2234
+				'ATT_phone' => array('LIKE', $sstr),
2235
+				'Registration.REG_final_price' => array('LIKE', $sstr),
2236
+				'Registration.REG_code' => array('LIKE', $sstr),
2237
+				'Registration.REG_count' => array('LIKE', $sstr),
2238
+				'Registration.REG_group_size' => array('LIKE', $sstr)
2239 2239
 				);
2240 2240
 		}
2241 2241
 
2242 2242
 
2243
-		$offset = ($current_page-1)*$per_page;
2244
-		$limit = $count ? NULL : array( $offset, $per_page );
2243
+		$offset = ($current_page - 1) * $per_page;
2244
+		$limit = $count ? NULL : array($offset, $per_page);
2245 2245
 
2246
-		if ( $trash ) {
2247
-			$_where['status'] = array( '!=', 'publish' );
2248
-			$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));
2246
+		if ($trash) {
2247
+			$_where['status'] = array('!=', 'publish');
2248
+			$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));
2249 2249
 		} else {
2250
-			$_where['status'] = array( 'IN', array( 'publish' ) );
2251
-			$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) );
2250
+			$_where['status'] = array('IN', array('publish'));
2251
+			$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));
2252 2252
 		}
2253 2253
 
2254 2254
 		return $all_attendees;
@@ -2265,10 +2265,10 @@  discard block
 block discarded – undo
2265 2265
 	 */
2266 2266
 	protected function _resend_registration() {
2267 2267
 		$success = $this->_process_resend_registration();
2268
-		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID'] ) : array(
2268
+		$query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID']) : array(
2269 2269
 			'action' => 'default'
2270 2270
 		);
2271
-		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE );
2271
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
2272 2272
 	}
2273 2273
 
2274 2274
 
@@ -2276,17 +2276,17 @@  discard block
 block discarded – undo
2276 2276
 
2277 2277
 
2278 2278
 
2279
-	public function _registrations_report(){
2280
-		EE_Registry::instance()->load_helper( 'File' );
2279
+	public function _registrations_report() {
2280
+		EE_Registry::instance()->load_helper('File');
2281 2281
 		$new_request_args = array(
2282 2282
 			'export' => 'report',
2283 2283
 			'action' => 'registrations_report_for_event',
2284
-			'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL,
2284
+			'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL,
2285 2285
 		);
2286 2286
 		$this->_req_data = array_merge($this->_req_data, $new_request_args);
2287 2287
 
2288
-		if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2289
-			require_once(EE_CLASSES . 'EE_Export.class.php');
2288
+		if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2289
+			require_once(EE_CLASSES.'EE_Export.class.php');
2290 2290
 			$EE_Export = EE_Export::instance($this->_req_data);
2291 2291
 			$EE_Export->export();
2292 2292
 		}
@@ -2294,19 +2294,19 @@  discard block
 block discarded – undo
2294 2294
 
2295 2295
 
2296 2296
 
2297
-	public function _contact_list_export(){
2298
-		EE_Registry::instance()->load_helper( 'File' );
2299
-		if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2300
-			require_once(EE_CLASSES . 'EE_Export.class.php');
2297
+	public function _contact_list_export() {
2298
+		EE_Registry::instance()->load_helper('File');
2299
+		if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2300
+			require_once(EE_CLASSES.'EE_Export.class.php');
2301 2301
 			$EE_Export = EE_Export::instance($this->_req_data);
2302 2302
 			$EE_Export->export_attendees();
2303 2303
 		}
2304 2304
 	}
2305 2305
 
2306
-	public function _contact_list_report(){
2307
-		EE_Registry::instance()->load_helper( 'File' );
2308
-		if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) {
2309
-			require_once(EE_CLASSES . 'EE_Export.class.php');
2306
+	public function _contact_list_report() {
2307
+		EE_Registry::instance()->load_helper('File');
2308
+		if (is_readable(EE_CLASSES.'EE_Export.class.php')) {
2309
+			require_once(EE_CLASSES.'EE_Export.class.php');
2310 2310
 			$EE_Export = EE_Export::instance($this->_req_data);
2311 2311
 			$EE_Export->report_attendees();
2312 2312
 		}
@@ -2325,73 +2325,73 @@  discard block
 block discarded – undo
2325 2325
 	 * @return void
2326 2326
 	 */
2327 2327
 	protected function _duplicate_attendee() {
2328
-		$action = !empty( $this->_req_data['return'] ) ? $this->_req_data['return'] : 'default';
2328
+		$action = ! empty($this->_req_data['return']) ? $this->_req_data['return'] : 'default';
2329 2329
 		//verify we have necessary info
2330
-		if ( empty($this->_req_data['_REG_ID'] )  ) {
2331
-			EE_Error::add_error( __('Unable to create the contact for the registration because the required paramaters are not present (_REG_ID )', 'event_espresso'),  __FILE__, __LINE__, __FUNCTION__ );
2332
-			$query_args = array( 'action' => $action );
2330
+		if (empty($this->_req_data['_REG_ID'])) {
2331
+			EE_Error::add_error(__('Unable to create the contact for the registration because the required paramaters are not present (_REG_ID )', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__);
2332
+			$query_args = array('action' => $action);
2333 2333
 			$this->_redirect_after_action('', '', '', $query_args, TRUE);
2334 2334
 		}
2335 2335
 
2336 2336
 		//okay necessary deets present... let's dupe the incoming attendee and attach to incoming registration.
2337
-		$registration = EEM_Registration::instance()->get_one_by_ID( $this->_req_data['_REG_ID'] );
2337
+		$registration = EEM_Registration::instance()->get_one_by_ID($this->_req_data['_REG_ID']);
2338 2338
 		$attendee = $registration->attendee();
2339 2339
 
2340 2340
 		//remove relation of existing attendee on registration
2341
-		$registration->_remove_relation_to($attendee, 'Attendee' );
2341
+		$registration->_remove_relation_to($attendee, 'Attendee');
2342 2342
 		//new attendee
2343 2343
 		$new_attendee = clone $attendee;
2344
-		$new_attendee->set( 'ATT_ID', 0 );
2344
+		$new_attendee->set('ATT_ID', 0);
2345 2345
 		$new_attendee->save();
2346 2346
 
2347 2347
 		//add new attendee to reg
2348
-		$registration->_add_relation_to( $new_attendee, 'Attendee');
2348
+		$registration->_add_relation_to($new_attendee, 'Attendee');
2349 2349
 
2350
-		EE_Error::add_success( __('New Contact record created.  Now make any edits you wish to make for this contact.', 'event_espresso') );
2350
+		EE_Error::add_success(__('New Contact record created.  Now make any edits you wish to make for this contact.', 'event_espresso'));
2351 2351
 
2352 2352
 		//redirect to edit page for attendee
2353
-		$query_args = array( 'post' => $new_attendee->ID(), 'action' => 'edit_attendee' );
2353
+		$query_args = array('post' => $new_attendee->ID(), 'action' => 'edit_attendee');
2354 2354
 
2355
-		$this->_redirect_after_action( '', '', '', $query_args, TRUE );
2355
+		$this->_redirect_after_action('', '', '', $query_args, TRUE);
2356 2356
 	}
2357 2357
 
2358 2358
 
2359 2359
 	//related to cpt routes
2360 2360
 	protected function _insert_update_cpt_item($post_id, $post) {
2361 2361
 		$success = true;
2362
-		$attendee = EEM_Attendee::instance()->get_one_by_ID( $post_id );
2362
+		$attendee = EEM_Attendee::instance()->get_one_by_ID($post_id);
2363 2363
 		//for attendee updates
2364
-		if ( $post->post_type = 'espresso_attendees' && !empty( $attendee ) ) {
2364
+		if ($post->post_type = 'espresso_attendees' && ! empty($attendee)) {
2365 2365
 			//note we should only be UPDATING attendees at this point.
2366 2366
 			$updated_fields = array(
2367 2367
 				'ATT_fname' => $this->_req_data['ATT_fname'],
2368 2368
 				'ATT_lname' => $this->_req_data['ATT_lname'],
2369
-				'ATT_full_name'=> $this->_req_data['ATT_fname'] . ' ' . $this->_req_data['ATT_lname'],
2369
+				'ATT_full_name'=> $this->_req_data['ATT_fname'].' '.$this->_req_data['ATT_lname'],
2370 2370
 				'ATT_address' => isset($this->_req_data['ATT_address']) ? $this->_req_data['ATT_address'] : '',
2371 2371
 				'ATT_address2' => isset($this->_req_data['ATT_address2']) ? $this->_req_data['ATT_address2'] : '',
2372
-				'ATT_city' => isset( $this->_req_data['ATT_city'] ) ? $this->_req_data['ATT_city'] : '',
2373
-				'STA_ID' => isset( $this->_req_data['STA_ID'] ) ? $this->_req_data['STA_ID'] : '',
2374
-				'CNT_ISO' => isset( $this->_req_data['CNT_ISO'] ) ? $this->_req_data['CNT_ISO'] : '',
2375
-				'ATT_zip' => isset( $this->_req_data['ATT_zip'] ) ? $this->_req_data['ATT_zip'] : '',
2376
-				'ATT_email' => isset( $this->_req_data['ATT_email'] ) ? $this->_req_data['ATT_email'] : '',
2377
-				'ATT_phone' => isset( $this->_req_data['ATT_phone'] ) ? $this->_req_data['ATT_phone'] : ''
2372
+				'ATT_city' => isset($this->_req_data['ATT_city']) ? $this->_req_data['ATT_city'] : '',
2373
+				'STA_ID' => isset($this->_req_data['STA_ID']) ? $this->_req_data['STA_ID'] : '',
2374
+				'CNT_ISO' => isset($this->_req_data['CNT_ISO']) ? $this->_req_data['CNT_ISO'] : '',
2375
+				'ATT_zip' => isset($this->_req_data['ATT_zip']) ? $this->_req_data['ATT_zip'] : '',
2376
+				'ATT_email' => isset($this->_req_data['ATT_email']) ? $this->_req_data['ATT_email'] : '',
2377
+				'ATT_phone' => isset($this->_req_data['ATT_phone']) ? $this->_req_data['ATT_phone'] : ''
2378 2378
 				);
2379
-			foreach ( $updated_fields as $field => $value ) {
2379
+			foreach ($updated_fields as $field => $value) {
2380 2380
 				$attendee->set($field, $value);
2381 2381
 			}
2382 2382
 
2383 2383
 			$success = $attendee->save();
2384 2384
 
2385
-			$attendee_update_callbacks = apply_filters( 'FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array() );
2386
-			foreach ( $attendee_update_callbacks as $a_callback ) {
2387
-				if ( FALSE === call_user_func_array( $a_callback, array($attendee, $this->_req_data ) ) ) {
2388
-					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 ) );
2385
+			$attendee_update_callbacks = apply_filters('FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array());
2386
+			foreach ($attendee_update_callbacks as $a_callback) {
2387
+				if (FALSE === call_user_func_array($a_callback, array($attendee, $this->_req_data))) {
2388
+					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));
2389 2389
 				}
2390 2390
 			}
2391 2391
 		}
2392 2392
 
2393
-		if ( $success === FALSE )
2394
-			EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
2393
+		if ($success === FALSE)
2394
+			EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
2395 2395
 
2396 2396
 	}
2397 2397
 
@@ -2411,17 +2411,17 @@  discard block
 block discarded – undo
2411 2411
 		remove_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2412 2412
 		remove_meta_box('commentstatusdiv', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2413 2413
 
2414
-		if ( post_type_supports( 'espresso_attendees', 'excerpt') ) {
2415
-			add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal' );
2414
+		if (post_type_supports('espresso_attendees', 'excerpt')) {
2415
+			add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal');
2416 2416
 		}
2417 2417
 
2418
-		if ( post_type_supports( 'espresso_attendees', 'comments') ) {
2418
+		if (post_type_supports('espresso_attendees', 'comments')) {
2419 2419
 			add_meta_box('commentsdiv', __('Notes on the Contact', 'event_espresso'), 'post_comment_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2420 2420
 		}
2421 2421
 
2422
-		add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array( $this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core' );
2423
-		add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core' );
2424
-		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');
2422
+		add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array($this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core');
2423
+		add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core');
2424
+		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');
2425 2425
 	}
2426 2426
 
2427 2427
 
@@ -2430,10 +2430,10 @@  discard block
 block discarded – undo
2430 2430
 	 * @param  WP_Post $post wp post object
2431 2431
 	 * @return string        attendee contact info ( and form )
2432 2432
 	 */
2433
-	public function attendee_contact_info( $post ) {
2433
+	public function attendee_contact_info($post) {
2434 2434
 		//get attendee object ( should already have it )
2435 2435
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2436
-		$template = REG_TEMPLATE_PATH . 'attendee_contact_info_metabox_content.template.php';
2436
+		$template = REG_TEMPLATE_PATH.'attendee_contact_info_metabox_content.template.php';
2437 2437
 		EEH_Template::display_template($template, $this->_template_args);
2438 2438
 	}
2439 2439
 
@@ -2449,12 +2449,12 @@  discard block
 block discarded – undo
2449 2449
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2450 2450
 		$this->_template_args['state_html'] = EEH_Form_Fields::generate_form_input(
2451 2451
 				new EE_Question_Form_Input(
2452
-				EE_Question::new_instance( array(
2452
+				EE_Question::new_instance(array(
2453 2453
 					'QST_ID' => 0,
2454 2454
 					'QST_display_text' => __('State/Province', 'event_espresso'),
2455 2455
 					'QST_system' => 'admin-state'
2456 2456
 					)),
2457
-				EE_Answer::new_instance( array(
2457
+				EE_Answer::new_instance(array(
2458 2458
 					'ANS_ID' => 0,
2459 2459
 					'ANS_value' => $this->_cpt_model_obj->state_ID()
2460 2460
 					)),
@@ -2467,12 +2467,12 @@  discard block
 block discarded – undo
2467 2467
 			));
2468 2468
 		$this->_template_args['country_html'] = EEH_Form_Fields::generate_form_input(
2469 2469
 				new EE_Question_Form_Input(
2470
-				EE_Question::new_instance( array(
2470
+				EE_Question::new_instance(array(
2471 2471
 					'QST_ID' => 0,
2472 2472
 					'QST_display_text' => __('Country', 'event_espresso'),
2473 2473
 					'QST_system' => 'admin-country'
2474 2474
 					)),
2475
-				EE_Answer::new_instance( array(
2475
+				EE_Answer::new_instance(array(
2476 2476
 					'ANS_ID' => 0,
2477 2477
 					'ANS_value' => $this->_cpt_model_obj->country_ID()
2478 2478
 					)),
@@ -2483,8 +2483,8 @@  discard block
 block discarded – undo
2483 2483
 					'append_qstn_id' => FALSE
2484 2484
 					)
2485 2485
 				));
2486
-		$template = REG_TEMPLATE_PATH . 'attendee_address_details_metabox_content.template.php';
2487
-		EEH_Template::display_template($template, $this->_template_args );
2486
+		$template = REG_TEMPLATE_PATH.'attendee_address_details_metabox_content.template.php';
2487
+		EEH_Template::display_template($template, $this->_template_args);
2488 2488
 
2489 2489
 	}
2490 2490
 
@@ -2494,11 +2494,11 @@  discard block
 block discarded – undo
2494 2494
 	*		@access protected
2495 2495
 	*		@return void
2496 2496
 	*/
2497
-	public function attendee_registrations_meta_box( $post ) {
2497
+	public function attendee_registrations_meta_box($post) {
2498 2498
 
2499 2499
 		$this->_template_args['attendee'] = $this->_cpt_model_obj;
2500 2500
 		$this->_template_args['registrations'] = $this->_cpt_model_obj->get_many_related('Registration');
2501
-		$template = REG_TEMPLATE_PATH . 'attendee_registrations_main_meta_box.template.php';
2501
+		$template = REG_TEMPLATE_PATH.'attendee_registrations_main_meta_box.template.php';
2502 2502
 		EEH_Template::display_template($template, $this->_template_args);
2503 2503
 
2504 2504
 	}
@@ -2512,8 +2512,8 @@  discard block
 block discarded – undo
2512 2512
 	 * @return string        html for new form.
2513 2513
 	 */
2514 2514
 	public function after_title_form_fields($post) {
2515
-		if ( $post->post_type == 'espresso_attendees' ) {
2516
-			$template = REG_TEMPLATE_PATH . 'attendee_details_after_title_form_fields.template.php';
2515
+		if ($post->post_type == 'espresso_attendees') {
2516
+			$template = REG_TEMPLATE_PATH.'attendee_details_after_title_form_fields.template.php';
2517 2517
 			$template_args['attendee'] = $this->_cpt_model_obj;
2518 2518
 			EEH_Template::display_template($template, $template_args);
2519 2519
 		}
@@ -2530,21 +2530,21 @@  discard block
 block discarded – undo
2530 2530
 	*		@access protected
2531 2531
 	*		@return void
2532 2532
 	*/
2533
-	protected function _trash_or_restore_attendees( $trash = TRUE ) {
2533
+	protected function _trash_or_restore_attendees($trash = TRUE) {
2534 2534
 
2535
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
2535
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2536 2536
 
2537 2537
 		$ATT_MDL = EEM_Attendee::instance();
2538 2538
 
2539 2539
 		$success = 1;
2540 2540
 		//Checkboxes
2541
-		if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
2541
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
2542 2542
 			// if array has more than one element than success message should be plural
2543
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
2543
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
2544 2544
 			// cycle thru checkboxes
2545
-			while (list( $ATT_ID, $value ) = each($this->_req_data['checkbox'])) {
2546
-				$updated = $trash ? $ATT_MDL->update_by_ID(array( 'status' => 'trash' ), $ATT_ID) : $ATT_MDL->update_by_ID( array('status' => 'publish' ), $ATT_ID);
2547
-				if ( !$updated ) {
2545
+			while (list($ATT_ID, $value) = each($this->_req_data['checkbox'])) {
2546
+				$updated = $trash ? $ATT_MDL->update_by_ID(array('status' => 'trash'), $ATT_ID) : $ATT_MDL->update_by_ID(array('status' => 'publish'), $ATT_ID);
2547
+				if ( ! $updated) {
2548 2548
 					$success = 0;
2549 2549
 				}
2550 2550
 			}
@@ -2553,18 +2553,18 @@  discard block
 block discarded – undo
2553 2553
 			// grab single id and delete
2554 2554
 			$ATT_ID = absint($this->_req_data['ATT_ID']);
2555 2555
 			//get attendee
2556
-			$att = $ATT_MDL->get_one_by_ID( $ATT_ID );
2556
+			$att = $ATT_MDL->get_one_by_ID($ATT_ID);
2557 2557
 			$updated = $trash ? $att->set_status('trash') : $att->set_status('publish');
2558 2558
 			$updated = $att->save();
2559
-			if ( ! $updated ) {
2559
+			if ( ! $updated) {
2560 2560
 				$success = 0;
2561 2561
 			}
2562 2562
 
2563 2563
 		}
2564 2564
 
2565
-		$what = $success > 1 ? __( 'Contacts', 'event_espresso' ) : __( 'Contact', 'event_espresso' );
2566
-		$action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' );
2567
-		$this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'contact_list' ) );
2565
+		$what = $success > 1 ? __('Contacts', 'event_espresso') : __('Contact', 'event_espresso');
2566
+		$action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso');
2567
+		$this->_redirect_after_action($success, $what, $action_desc, array('action' => 'contact_list'));
2568 2568
 
2569 2569
 	}
2570 2570
 
Please login to merge, or discard this patch.
core/libraries/plugin_api/EE_Register_Payment_Method.lib.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -48,33 +48,33 @@  discard block
 block discarded – undo
48 48
 	 * @internal param string payment_method_paths 	an array of full server paths to folders containing any EE_PMT_Base children, or to the EED_Module files themselves
49 49
 	 * @return void
50 50
 	 */
51
-	public static function register( $payment_method_id = NULL, $setup_args = array()  ) {
51
+	public static function register($payment_method_id = NULL, $setup_args = array()) {
52 52
 
53 53
 		//required fields MUST be present, so let's make sure they are.
54
-		if ( empty( $payment_method_id ) || ! is_array( $setup_args ) || empty( $setup_args['payment_method_paths'] )) {
55
-			throw new EE_Error( __( 'In order to register Payment Methods with EE_Register_Payment_Method::register(), you must include a "payment_method_id" (a unique identifier for this set of modules), and an array containing the following keys: "payment_method_paths" (an array of full server paths to folders that contain modules, or to the module files themselves)', 'event_espresso' ));
54
+		if (empty($payment_method_id) || ! is_array($setup_args) || empty($setup_args['payment_method_paths'])) {
55
+			throw new EE_Error(__('In order to register Payment Methods with EE_Register_Payment_Method::register(), you must include a "payment_method_id" (a unique identifier for this set of modules), and an array containing the following keys: "payment_method_paths" (an array of full server paths to folders that contain modules, or to the module files themselves)', 'event_espresso'));
56 56
 		}
57 57
 
58 58
 		//make sure we don't register twice
59
-		if( isset( self::$_settings[ $payment_method_id ] ) ){
59
+		if (isset(self::$_settings[$payment_method_id])) {
60 60
 			return;
61 61
 		}
62 62
 
63 63
 		//make sure this was called in the right place!
64
-		if ( ! did_action( 'AHEE__EE_System__load_espresso_addons' ) || did_action( 'AHEE__EE_System__register_shortcodes_modules_and_widgets' )) {
64
+		if ( ! did_action('AHEE__EE_System__load_espresso_addons') || did_action('AHEE__EE_System__register_shortcodes_modules_and_widgets')) {
65 65
 			EE_Error::doing_it_wrong(
66 66
 				__METHOD__,
67
-				__( 'An attempt to register modules has failed because it was not registered at the correct time.  Please use the "AHEE__EE_System__register_shortcodes_modules_and_widgets" hook to register modules.','event_espresso'),
67
+				__('An attempt to register modules has failed because it was not registered at the correct time.  Please use the "AHEE__EE_System__register_shortcodes_modules_and_widgets" hook to register modules.', 'event_espresso'),
68 68
 				'4.3.0'
69 69
 			);
70 70
 		}
71 71
 		//setup $_settings array from incoming values.
72
-		self::$_settings[ $payment_method_id ] = array(
72
+		self::$_settings[$payment_method_id] = array(
73 73
 			// array of full server paths to any EE_PMT_Base children used
74
-			'payment_method_paths'  => isset( $setup_args['payment_method_paths'] ) ? (array)$setup_args['payment_method_paths'] : array(),
74
+			'payment_method_paths'  => isset($setup_args['payment_method_paths']) ? (array) $setup_args['payment_method_paths'] : array(),
75 75
 		);
76 76
 		// add to list of modules to be registered
77
-		add_filter( 'FHEE__EE_Payment_Method_Manager__register_payment_methods__payment_methods_to_register', array( 'EE_Register_Payment_Method', 'add_payment_methods' ));
77
+		add_filter('FHEE__EE_Payment_Method_Manager__register_payment_methods__payment_methods_to_register', array('EE_Register_Payment_Method', 'add_payment_methods'));
78 78
 
79 79
 		/**
80 80
 		 * If EE_Payment_Method_Manager::register_payment_methods has already been called, we need it to be called again
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
 		 * will be called only once per payment method from an addon, so going with that assumption we should always do this.
83 83
 		 * If that assumption is false, we should verify this newly-registered paymetn method isn't on the EE_Payment_Method_Manager::_payment_method_types array before calling this (this code should be changed to improve performance)
84 84
 		 */
85
-		if ( did_action( 'FHEE__EE_Payment_Method_Manager__register_payment_methods__registered_payment_methods' ) ) {
85
+		if (did_action('FHEE__EE_Payment_Method_Manager__register_payment_methods__registered_payment_methods')) {
86 86
 			EE_Registry::instance()->load_lib('Payment_Method_Manager');
87
-			EE_Payment_Method_Manager::instance()->maybe_register_payment_methods( TRUE );
87
+			EE_Payment_Method_Manager::instance()->maybe_register_payment_methods(TRUE);
88 88
 		}
89 89
 	}
90 90
 
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
 	 * @param array $payment_method_folders  array of paths to all payment methods that require registering
98 98
 	 * @return array
99 99
 	 */
100
-	public static function add_payment_methods( $payment_method_folders ){
101
-		foreach( self::$_settings as $settings ) {
102
-			$payment_method_folders = array_merge( $payment_method_folders, $settings['payment_method_paths'] );
100
+	public static function add_payment_methods($payment_method_folders) {
101
+		foreach (self::$_settings as $settings) {
102
+			$payment_method_folders = array_merge($payment_method_folders, $settings['payment_method_paths']);
103 103
 		}
104 104
 		return $payment_method_folders;
105 105
 	}
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 	 * @param string  $module_id the name for the module that was previously registered
115 115
 	 * @return void
116 116
 	 */
117
-	public static function deregister( $module_id = NULL ) {
118
-		if ( isset( self::$_settings[ $module_id ] )) {
119
-			unset( self::$_settings[ $module_id ] );
117
+	public static function deregister($module_id = NULL) {
118
+		if (isset(self::$_settings[$module_id])) {
119
+			unset(self::$_settings[$module_id]);
120 120
 		}
121 121
 	}
122 122
 
Please login to merge, or discard this patch.
core/libraries/plugin_api/EE_Register_Module.lib.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -44,33 +44,33 @@  discard block
 block discarded – undo
44 44
 	 * @internal param string module_paths 	an array of full server paths to folders containing any EED_Modules, or to the EED_Module files themselves
45 45
 	 * @return void
46 46
 	 */
47
-	public static function register( $module_id = NULL, $setup_args = array()  ) {
47
+	public static function register($module_id = NULL, $setup_args = array()) {
48 48
 
49 49
 		//required fields MUST be present, so let's make sure they are.
50
-		if ( empty( $module_id ) || ! is_array( $setup_args ) || empty( $setup_args['module_paths'] )) {
51
-			throw new EE_Error( __( 'In order to register Modules with EE_Register_Module::register(), you must include a "module_id" (a unique identifier for this set of modules), and an array containing the following keys: "module_paths" (an array of full server paths to folders that contain modules, or to the module files themselves)', 'event_espresso' ));
50
+		if (empty($module_id) || ! is_array($setup_args) || empty($setup_args['module_paths'])) {
51
+			throw new EE_Error(__('In order to register Modules with EE_Register_Module::register(), you must include a "module_id" (a unique identifier for this set of modules), and an array containing the following keys: "module_paths" (an array of full server paths to folders that contain modules, or to the module files themselves)', 'event_espresso'));
52 52
 		}
53 53
 
54 54
 		//make sure we don't register twice
55
-		if( isset( self::$_settings[ $module_id ] ) ){
55
+		if (isset(self::$_settings[$module_id])) {
56 56
 			return;
57 57
 		}
58 58
 
59 59
 		//make sure this was called in the right place!
60
-		if ( ! did_action( 'AHEE__EE_System__load_espresso_addons' ) || did_action( 'AHEE__EE_System__register_shortcodes_modules_and_widgets' )) {
60
+		if ( ! did_action('AHEE__EE_System__load_espresso_addons') || did_action('AHEE__EE_System__register_shortcodes_modules_and_widgets')) {
61 61
 			EE_Error::doing_it_wrong(
62 62
 				__METHOD__,
63
-				__( 'An attempt to register modules has failed because it was not registered at the correct time.  Please use the "AHEE__EE_System__register_shortcodes_modules_and_widgets" hook to register modules.','event_espresso'),
63
+				__('An attempt to register modules has failed because it was not registered at the correct time.  Please use the "AHEE__EE_System__register_shortcodes_modules_and_widgets" hook to register modules.', 'event_espresso'),
64 64
 				'4.3.0'
65 65
 			);
66 66
 		}
67 67
 		//setup $_settings array from incoming values.
68
-		self::$_settings[ $module_id ] = array(
68
+		self::$_settings[$module_id] = array(
69 69
 			// array of full server paths to any EED_Modules used by the module
70
-			'module_paths'  => isset( $setup_args['module_paths'] ) ? (array)$setup_args['module_paths'] : array(),
70
+			'module_paths'  => isset($setup_args['module_paths']) ? (array) $setup_args['module_paths'] : array(),
71 71
 		);
72 72
 		// add to list of modules to be registered
73
-		add_filter( 'FHEE__EE_Config__register_modules__modules_to_register', array( 'EE_Register_Module', 'add_modules' ));
73
+		add_filter('FHEE__EE_Config__register_modules__modules_to_register', array('EE_Register_Module', 'add_modules'));
74 74
 	}
75 75
 
76 76
 
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
 	 * @param array $modules_to_register  array of paths to all modules that require registering
84 84
 	 * @return array
85 85
 	 */
86
-	public static function add_modules( $modules_to_register ){
87
-		foreach( self::$_settings as $settings ) {
88
-			$modules_to_register = array_merge( $modules_to_register, $settings['module_paths'] );
86
+	public static function add_modules($modules_to_register) {
87
+		foreach (self::$_settings as $settings) {
88
+			$modules_to_register = array_merge($modules_to_register, $settings['module_paths']);
89 89
 		}
90 90
 		return $modules_to_register;
91 91
 	}
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
 	 * @param string  $module_id the name for the module that was previously registered
102 102
 	 * @return void
103 103
 	 */
104
-	public static function deregister( $module_id = NULL ) {
105
-		if ( isset( self::$_settings[ $module_id ] )) {
106
-			unset( self::$_settings[ $module_id ] );
104
+	public static function deregister($module_id = NULL) {
105
+		if (isset(self::$_settings[$module_id])) {
106
+			unset(self::$_settings[$module_id]);
107 107
 		}
108 108
 	}
109 109
 
Please login to merge, or discard this patch.
messages/data_class/EE_Messages_EE_Session_incoming_data.class.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 class EE_Messages_EE_Session_incoming_data extends EE_Messages_incoming_data {
32 32
 
33 33
 
34
-	public function __construct( EE_Session $data ) {
34
+	public function __construct(EE_Session $data) {
35 35
 		parent::__construct($data);
36 36
 	}
37 37
 
@@ -42,21 +42,21 @@  discard block
 block discarded – undo
42 42
 		$session = $this->_data->get_session_data();
43 43
 		$this->txn = $session['transaction'];
44 44
 
45
-		if ( empty( $this->txn ) || ! $this->txn instanceof EE_Transaction ) {
46
-			throw new EE_Error( __('Incoming data for the EE_Session data handler must have a valid EE_Transaction object in order to setup the data') );
45
+		if (empty($this->txn) || ! $this->txn instanceof EE_Transaction) {
46
+			throw new EE_Error(__('Incoming data for the EE_Session data handler must have a valid EE_Transaction object in order to setup the data'));
47 47
 		}
48 48
 
49 49
 		$this->reg_info = array();
50 50
 		$this->incoming_data = $session;
51 51
 
52 52
 		//other data from the session (if possible)
53
-		$this->user_id = isset( $session['user_id'] ) ? $session['user_id'] : '';
54
-		$this->ip_address = isset( $session['ip_address'] ) ? $session['ip_address'] : '';
55
-		$this->user_agent = isset( $session['user_agent'] ) ? $session['user_agent'] : '';
53
+		$this->user_id = isset($session['user_id']) ? $session['user_id'] : '';
54
+		$this->ip_address = isset($session['ip_address']) ? $session['ip_address'] : '';
55
+		$this->user_agent = isset($session['user_agent']) ? $session['user_agent'] : '';
56 56
 		$this->init_access = $this->last_access = '';
57 57
 
58 58
 		$this->payment = $this->txn->get_first_related('Payment');
59
-		$this->payment = empty( $this->payment ) ? EE_Payment::new_instance( array(
59
+		$this->payment = empty($this->payment) ? EE_Payment::new_instance(array(
60 60
 			'STS_ID' => EEM_Payment::status_id_pending,
61 61
 			'PAY_timestamp' => (int) current_time('timestamp'),
62 62
 			'PMD_ID' => $this->txn->payment_method_ID(),
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
Please login to merge, or discard this patch.
libraries/messages/defaults/default/html_receipt_attendee_list.template.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@
 block discarded – undo
6 6
 <li class="ticket-registration">
7 7
 	<table class="registration-details">
8 8
 		<tr class="odd">
9
-			<th><?php	_e('Attendee', 'event_espresso');?></th>
9
+			<th><?php	_e('Attendee', 'event_espresso'); ?></th>
10 10
 			<td>[FNAME] [LNAME] ([ATTENDEE_EMAIL])</td>
11 11
 		</tr>
12 12
 		<tr>
13
-			<th><?php _e("Registration Code:", "event_espresso");?></th>
13
+			<th><?php _e("Registration Code:", "event_espresso"); ?></th>
14 14
 			<td>[REGISTRATION_CODE] - <span class="[REGISTRATION_STATUS_ID]">[REGISTRATION_STATUS_LABEL]</span></td>
15 15
 		</tr>
16 16
 		<tr>
Please login to merge, or discard this patch.