Completed
Branch FET-5580-registration-cancella... (d3ffee)
by
unknown
1266:34 queued 1253:32
created
caffeinated/admin/extend/events/help_tabs/import_page.help_tab.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,18 +2,18 @@
 block discarded – undo
2 2
 <p>
3 3
 <?php _e('The importer can be used to import event information into Event Espresso using a CSV file.', 'event_espresso'); ?>
4 4
 </p>
5
-<h3><?php _e("Importing from other Event Espresso 4 Sites", 'event_espresso');?></h3>
5
+<h3><?php _e("Importing from other Event Espresso 4 Sites", 'event_espresso'); ?></h3>
6 6
 <p>
7 7
 <?php _e('To import Event Espresso data from another Event Espresso 4 install, export a CSV file from the admin Events overview page, or anywhere you can generate a CSV export file from. Then upload that file here (regardless of what type of information was exported).', 'event_espresso'); ?>
8 8
 </p>
9 9
 <p>
10 10
 <?php _e('Note: its possible that data from the other site have the same IDs as data in this site. The importer recognizes that this data is from a different database and inserts new items for each item in the CSV file, regardless of whether its ID matches that of an item in this site\'s database or not. However, the importer also remembers the mapping from the old site\'s database to this site\'s database, and on subsequent CSV importers from that site, the data in this database will be updated instead of re-inserting new items.', 'event_espresso'); ?>
11 11
 </p>
12
-<h3><?php _e("Importing from this Site", 'event_espresso');?></h3>
13
-<p><?php _e("You may want to export data from this site, modify it (or modify the database), and re-import it. When this is done, the importer recognizes that the data is from this site\'s database and updates the records (instead of inserting new items like it would have, had the CSV data been from a different site).", 'event_espresso');?></p>
12
+<h3><?php _e("Importing from this Site", 'event_espresso'); ?></h3>
13
+<p><?php _e("You may want to export data from this site, modify it (or modify the database), and re-import it. When this is done, the importer recognizes that the data is from this site\'s database and updates the records (instead of inserting new items like it would have, had the CSV data been from a different site).", 'event_espresso'); ?></p>
14 14
 
15
-	<h3><?php _e("Notes about Generating your own CSV Import Files", "event_espresso");?></h3>
16
-	<p><?php _e("If you think you could save time entering data into a CSV file, you can use the sample import file below. Note that creating your own CSV file is more complicated than in Event Espresso 3.1 because of the more advanced data structure, and so we recommend creating/editing your events using the normal web-interface.", "event_espresso");?></p>
17
-	<p><?php _e("The export file is just an export of an event, or if you do not have any events in your system, it will only contain column headers. Do not change those column headers. Add as many rows as you like. ", "event_espresso");?></p>
18
-	<p><?php _e("In the ID columns (columns ending in '_ID'), you should enter 'temporary IDs', which are unique numbers/words that identify that item, which can be used later when you want to refer to that item. (For example, if you assign an event's EVT_ID to be a temporary id of 'my-event-1', then use that same phrase 'my-event-1' to refer to that event in the Datetime model's EVT_ID column)", "event_espresso");?></p>
19
-	<p><?php _e("Also note, you do NOT have to enter info in for each model. (You can, for example, only enter in Term_Taxonomies and Term model data)", "event_espresso");?></p>
20 15
\ No newline at end of file
16
+	<h3><?php _e("Notes about Generating your own CSV Import Files", "event_espresso"); ?></h3>
17
+	<p><?php _e("If you think you could save time entering data into a CSV file, you can use the sample import file below. Note that creating your own CSV file is more complicated than in Event Espresso 3.1 because of the more advanced data structure, and so we recommend creating/editing your events using the normal web-interface.", "event_espresso"); ?></p>
18
+	<p><?php _e("The export file is just an export of an event, or if you do not have any events in your system, it will only contain column headers. Do not change those column headers. Add as many rows as you like. ", "event_espresso"); ?></p>
19
+	<p><?php _e("In the ID columns (columns ending in '_ID'), you should enter 'temporary IDs', which are unique numbers/words that identify that item, which can be used later when you want to refer to that item. (For example, if you assign an event's EVT_ID to be a temporary id of 'my-event-1', then use that same phrase 'my-event-1' to refer to that event in the Datetime model's EVT_ID column)", "event_espresso"); ?></p>
20
+	<p><?php _e("Also note, you do NOT have to enter info in for each model. (You can, for example, only enter in Term_Taxonomies and Term model data)", "event_espresso"); ?></p>
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
core/business/EE_Transaction_Payments.class.php 2 patches
Doc Comments   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	 * @access private
117 117
 	 * @param EE_Transaction $transaction
118 118
 	 * @param bool           $update_txn
119
-	 * @return bool true if TXN total was updated, false if not
119
+	 * @return boolean|null true if TXN total was updated, false if not
120 120
 	 * @throws \EE_Error
121 121
 	 */
122 122
 	public function recalculate_transaction_total( EE_Transaction $transaction, $update_txn = true ) {
@@ -147,7 +147,6 @@  discard block
 block discarded – undo
147 147
 	 * then client code needs to take responsibility for saving the TXN
148 148
 	 * regardless of what happens within EE_Transaction_Payments;
149 149
 	 *
150
-	 * @param EE_Transaction/int $transaction_obj_or_id EE_Transaction or its ID
151 150
 	 * @param 	boolean $update_txn  	whether to save the TXN
152 151
 	 * @return 	boolean 	 	whether the TXN was saved
153 152
 	 */
@@ -185,7 +184,7 @@  discard block
 block discarded – undo
185 184
 	 * 		@access		public
186 185
 	 * 		@param EE_Transaction $transaction
187 186
 	 *		@param	string $payment_status, one of EEM_Payment's statuses, like 'PAP' (Approved). By default, searches for approved payments
188
-	 *		@return 		mixed		float on success, false on fail
187
+	 *		@return 		double		float on success, false on fail
189 188
 	 */
190 189
 	public function recalculate_total_payments_for_transaction( EE_Transaction $transaction, $payment_status = EEM_Payment::status_id_approved ) {
191 190
 		// verify transaction
Please login to merge, or discard this patch.
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2
-EE_Registry::instance()->load_class( 'Processor_Base' );
2
+EE_Registry::instance()->load_class('Processor_Base');
3 3
 
4 4
 /**
5 5
  * Class EE_Transaction_Payments
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 */
45 45
 	public static function instance() {
46 46
 		// check if class object is instantiated
47
-		if ( ! self::$_instance instanceof EE_Transaction_Payments ) {
47
+		if ( ! self::$_instance instanceof EE_Transaction_Payments) {
48 48
 			self::$_instance = new self();
49 49
 		}
50 50
 		return self::$_instance;
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
 	/**
73 73
 	 * @param string $old_txn_status
74 74
 	 */
75
-	public function set_old_txn_status( $old_txn_status ) {
75
+	public function set_old_txn_status($old_txn_status) {
76 76
 		// only set the first time
77
-		if ( $this->_old_txn_status === null ) {
77
+		if ($this->_old_txn_status === null) {
78 78
 			$this->_old_txn_status = $old_txn_status;
79 79
 		}
80 80
 	}
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	/**
94 94
 	 * @param string $new_txn_status
95 95
 	 */
96
-	public function set_new_txn_status( $new_txn_status ) {
96
+	public function set_new_txn_status($new_txn_status) {
97 97
 		$this->_new_txn_status = $new_txn_status;
98 98
 	}
99 99
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 	 * @return bool
106 106
 	 */
107 107
 	public function txn_status_updated() {
108
-		return $this->_new_txn_status !== $this->_old_txn_status && $this->_old_txn_status !== null  ? true : false;
108
+		return $this->_new_txn_status !== $this->_old_txn_status && $this->_old_txn_status !== null ? true : false;
109 109
 	}
110 110
 
111 111
 
@@ -119,18 +119,18 @@  discard block
 block discarded – undo
119 119
 	 * @return bool true if TXN total was updated, false if not
120 120
 	 * @throws \EE_Error
121 121
 	 */
122
-	public function recalculate_transaction_total( EE_Transaction $transaction, $update_txn = true ) {
122
+	public function recalculate_transaction_total(EE_Transaction $transaction, $update_txn = true) {
123 123
 		$total_line_item = $transaction->total_line_item();
124
-		if ( ! $total_line_item instanceof EE_Line_Item ) {
124
+		if ( ! $total_line_item instanceof EE_Line_Item) {
125 125
 			EE_Error::add_error(
126
-				sprintf( __( 'The Total Line Item for Transaction %1$d\'s was not found or is invalid.', 'event_espresso' ), $transaction->ID() ),
126
+				sprintf(__('The Total Line Item for Transaction %1$d\'s was not found or is invalid.', 'event_espresso'), $transaction->ID()),
127 127
 				__FILE__, __FUNCTION__, __LINE__
128 128
 			);
129 129
 			return false;
130 130
 		}
131 131
 		$new_total = $total_line_item->recalculate_total_including_taxes();
132
-		$transaction->set_total( $new_total );
133
-		if ( $update_txn ) {
132
+		$transaction->set_total($new_total);
133
+		if ($update_txn) {
134 134
 			return $transaction->save() ? true : false;
135 135
 		}
136 136
 	}
@@ -151,22 +151,22 @@  discard block
 block discarded – undo
151 151
 	 * @param 	boolean $update_txn  	whether to save the TXN
152 152
 	 * @return 	boolean 	 	whether the TXN was saved
153 153
 	 */
154
-	public function calculate_total_payments_and_update_status( EE_Transaction $transaction, $update_txn = true ){
154
+	public function calculate_total_payments_and_update_status(EE_Transaction $transaction, $update_txn = true) {
155 155
 		// verify transaction
156
-		if ( ! $transaction instanceof EE_Transaction ) {
157
-			EE_Error::add_error( __( 'Please provide a valid EE_Transaction object.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
156
+		if ( ! $transaction instanceof EE_Transaction) {
157
+			EE_Error::add_error(__('Please provide a valid EE_Transaction object.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
158 158
 			return false;
159 159
 		}
160 160
 		// set incoming TXN_Status
161
-		$this->set_old_txn_status( $transaction->status_ID() );
161
+		$this->set_old_txn_status($transaction->status_ID());
162 162
 		// calculate total paid
163
-		$total_paid = $this->recalculate_total_payments_for_transaction( $transaction );
163
+		$total_paid = $this->recalculate_total_payments_for_transaction($transaction);
164 164
 		// if total paid has changed
165
-		if ( $total_paid != $transaction->paid() ) {
166
-			$transaction->set_paid( $total_paid );
165
+		if ($total_paid != $transaction->paid()) {
166
+			$transaction->set_paid($total_paid);
167 167
 			// maybe update status, and make sure to save transaction if not done already
168
-			if ( ! $this->update_transaction_status_based_on_total_paid( $transaction, $update_txn )) {
169
-				if ( $update_txn ) {
168
+			if ( ! $this->update_transaction_status_based_on_total_paid($transaction, $update_txn)) {
169
+				if ($update_txn) {
170 170
 					return $transaction->save() ? true : false;
171 171
 				}
172 172
 			} else {
@@ -187,18 +187,18 @@  discard block
 block discarded – undo
187 187
 	 *		@param	string $payment_status, one of EEM_Payment's statuses, like 'PAP' (Approved). By default, searches for approved payments
188 188
 	 *		@return 		mixed		float on success, false on fail
189 189
 	 */
190
-	public function recalculate_total_payments_for_transaction( EE_Transaction $transaction, $payment_status = EEM_Payment::status_id_approved ) {
190
+	public function recalculate_total_payments_for_transaction(EE_Transaction $transaction, $payment_status = EEM_Payment::status_id_approved) {
191 191
 		// verify transaction
192
-		if ( ! $transaction instanceof EE_Transaction ) {
193
-			EE_Error::add_error( __( 'Please provide a valid EE_Transaction object.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
192
+		if ( ! $transaction instanceof EE_Transaction) {
193
+			EE_Error::add_error(__('Please provide a valid EE_Transaction object.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
194 194
 			return false;
195 195
 		}
196 196
 		// ensure Payment model is loaded
197
-		EE_Registry::instance()->load_model( 'Payment' );
197
+		EE_Registry::instance()->load_model('Payment');
198 198
 		// calls EEM_Base::sum()
199 199
 		return EEM_Payment::instance()->sum(
200 200
 			// query params
201
-			array( array( 'TXN_ID' => $transaction->ID(), 'STS_ID' => $payment_status )),
201
+			array(array('TXN_ID' => $transaction->ID(), 'STS_ID' => $payment_status)),
202 202
 			// field to sum
203 203
 			'PAY_amount'
204 204
 		);
@@ -214,37 +214,37 @@  discard block
 block discarded – undo
214 214
 	 * @return 	boolean 	 	whether the TXN was saved
215 215
 	 * @throws \EE_Error
216 216
 	 */
217
-	public function update_transaction_status_based_on_total_paid( EE_Transaction $transaction, $update_txn = TRUE ) {
217
+	public function update_transaction_status_based_on_total_paid(EE_Transaction $transaction, $update_txn = TRUE) {
218 218
 		// verify transaction
219
-		if ( ! $transaction instanceof EE_Transaction ) {
219
+		if ( ! $transaction instanceof EE_Transaction) {
220 220
 			EE_Error::add_error(
221
-				__( 'Please provide a valid EE_Transaction object.', 'event_espresso' ),
221
+				__('Please provide a valid EE_Transaction object.', 'event_espresso'),
222 222
 				__FILE__, __FUNCTION__, __LINE__
223 223
 			);
224 224
 			return FALSE;
225 225
 		}
226
-		EE_Registry::instance()->load_helper( 'Money' );
226
+		EE_Registry::instance()->load_helper('Money');
227 227
 		// set incoming TXN_Status
228
-		$this->set_old_txn_status( $transaction->status_ID() );
228
+		$this->set_old_txn_status($transaction->status_ID());
229 229
 		// set transaction status based on comparison of TXN_paid vs TXN_total
230
-		if ( EEH_Money::compare_floats( $transaction->paid(), $transaction->total(), '>' ) ){
230
+		if (EEH_Money::compare_floats($transaction->paid(), $transaction->total(), '>')) {
231 231
 			$new_txn_status = EEM_Transaction::overpaid_status_code;
232
-		} else if ( EEH_Money::compare_floats( $transaction->paid(), $transaction->total() ) ) {
232
+		} else if (EEH_Money::compare_floats($transaction->paid(), $transaction->total())) {
233 233
 			$new_txn_status = EEM_Transaction::complete_status_code;
234
-		} else if ( EEH_Money::compare_floats( $transaction->paid(), $transaction->total(), '<' ) ) {
234
+		} else if (EEH_Money::compare_floats($transaction->paid(), $transaction->total(), '<')) {
235 235
 			$new_txn_status = EEM_Transaction::incomplete_status_code;
236 236
 		} else {
237 237
 			EE_Error::add_error(
238
-				__( 'The total paid calculation for this transaction is inaccurate.', 'event_espresso' ),
238
+				__('The total paid calculation for this transaction is inaccurate.', 'event_espresso'),
239 239
 				__FILE__, __FUNCTION__, __LINE__
240 240
 			);
241 241
 			return FALSE;
242 242
 		}
243
-		if ( $new_txn_status !== $transaction->status_ID() ) {
243
+		if ($new_txn_status !== $transaction->status_ID()) {
244 244
 			// set incoming TXN_Status
245
-			$this->set_new_txn_status( $new_txn_status );
246
-			$transaction->set_status( $new_txn_status );
247
-			if ( $update_txn ) {
245
+			$this->set_new_txn_status($new_txn_status);
246
+			$transaction->set_status($new_txn_status);
247
+			if ($update_txn) {
248 248
 				return $transaction->save() ? TRUE : FALSE;
249 249
 			}
250 250
 		}
@@ -263,21 +263,21 @@  discard block
 block discarded – undo
263 263
 	 * @param EE_Payment $payment
264 264
 	 * @return boolean
265 265
 	 */
266
-	public function delete_payment_and_update_transaction( EE_Payment $payment ) {
266
+	public function delete_payment_and_update_transaction(EE_Payment $payment) {
267 267
 		// verify payment
268
-		if ( ! $payment instanceof EE_Payment ) {
269
-			EE_Error::add_error( __( 'A valid Payment object was not received.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
268
+		if ( ! $payment instanceof EE_Payment) {
269
+			EE_Error::add_error(__('A valid Payment object was not received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
270 270
 			return FALSE;
271 271
 		}
272
-		if ( ! $this->delete_registration_payments_and_update_registrations( $payment ) ) {
272
+		if ( ! $this->delete_registration_payments_and_update_registrations($payment)) {
273 273
 			return false;
274 274
 		}
275
-		if ( ! $payment->delete() ) {
276
-			EE_Error::add_error( __( 'The payment could not be deleted.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
275
+		if ( ! $payment->delete()) {
276
+			EE_Error::add_error(__('The payment could not be deleted.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
277 277
 			return false;
278 278
 		}
279 279
 		$transaction = $payment->transaction();
280
-		return $this->calculate_total_payments_and_update_status( $transaction );
280
+		return $this->calculate_total_payments_and_update_status($transaction);
281 281
 	}
282 282
 
283 283
 
@@ -293,28 +293,28 @@  discard block
 block discarded – undo
293 293
 	 * @return bool
294 294
 	 * @throws \EE_Error
295 295
 	 */
296
-	public function delete_registration_payments_and_update_registrations( EE_Payment $payment, $reg_payment_query_params = array() ) {
296
+	public function delete_registration_payments_and_update_registrations(EE_Payment $payment, $reg_payment_query_params = array()) {
297 297
 		$save_payment = false;
298
-		$reg_payment_query_params = ! empty( $reg_payment_query_params ) ? $reg_payment_query_params : array( array( 'PAY_ID' => $payment->ID() ) );
299
-		$registration_payments = EEM_Registration_Payment::instance()->get_all( $reg_payment_query_params );
300
-		if ( ! empty( $registration_payments )) {
301
-			foreach ( $registration_payments as $registration_payment ) {
302
-				if ( $registration_payment instanceof EE_Registration_Payment ) {
298
+		$reg_payment_query_params = ! empty($reg_payment_query_params) ? $reg_payment_query_params : array(array('PAY_ID' => $payment->ID()));
299
+		$registration_payments = EEM_Registration_Payment::instance()->get_all($reg_payment_query_params);
300
+		if ( ! empty($registration_payments)) {
301
+			foreach ($registration_payments as $registration_payment) {
302
+				if ($registration_payment instanceof EE_Registration_Payment) {
303 303
 					$amount_paid = $registration_payment->amount();
304 304
 					$registration = $registration_payment->registration();
305
-					if ( $registration instanceof EE_Registration ) {
306
-						$registration->set_paid( $registration->paid() - $amount_paid );
307
-						if ( $registration->save() ) {
308
-							if ( $registration_payment->delete() ) {
309
-								$registration->_remove_relation_to( $payment, 'Payment' );
310
-								$payment->_remove_relation_to( $registration, 'Registration' );
305
+					if ($registration instanceof EE_Registration) {
306
+						$registration->set_paid($registration->paid() - $amount_paid);
307
+						if ($registration->save()) {
308
+							if ($registration_payment->delete()) {
309
+								$registration->_remove_relation_to($payment, 'Payment');
310
+								$payment->_remove_relation_to($registration, 'Registration');
311 311
 							}
312 312
 							$save_payment = true;
313 313
 						}
314 314
 					} else {
315 315
 						EE_Error::add_error(
316 316
 							sprintf(
317
-								__( 'An invalid Registration object was associated with Registration Payment ID# %1$d.', 'event_espresso' ),
317
+								__('An invalid Registration object was associated with Registration Payment ID# %1$d.', 'event_espresso'),
318 318
 								$registration_payment->ID()
319 319
 							),
320 320
 							__FILE__, __FUNCTION__, __LINE__
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 				} else {
325 325
 					EE_Error::add_error(
326 326
 						sprintf(
327
-							__( 'An invalid Registration Payment object was associated with payment ID# %1$d.', 'event_espresso' ),
327
+							__('An invalid Registration Payment object was associated with payment ID# %1$d.', 'event_espresso'),
328 328
 							$payment->ID()
329 329
 						),
330 330
 						__FILE__, __FUNCTION__, __LINE__
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 				}
334 334
 			}
335 335
 		}
336
-		if ( $save_payment ) {
336
+		if ($save_payment) {
337 337
 			$payment->save();
338 338
 		}
339 339
 		return true;
Please login to merge, or discard this patch.
templates/txn_admin_details_main_meta_box_attendees.template.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -5,25 +5,25 @@
 block discarded – undo
5 5
 		<table class="admin-primary-mbox-tbl">
6 6
 			<thead>
7 7
 				<tr>
8
-					<th class="jst-left"><?php _e( '#', 'event_espresso' );?></th>
9
-					<th class="jst-left"><?php _e( 'Event Name and Ticket', 'event_espresso' );?></th>
10
-					<th class="jst-left"><?php _e( 'Registrant', 'event_espresso' );?></th>
11
-					<th class="jst-left"><?php _e( 'Ticket Price', 'event_espresso' );?></th>
12
-					<th class="jst-left"><?php _e( 'Email', 'event_espresso' );?></th>
13
-					<th class="jst-left"><?php _e( 'Address', 'event_espresso' );?></th>
8
+					<th class="jst-left"><?php _e('#', 'event_espresso'); ?></th>
9
+					<th class="jst-left"><?php _e('Event Name and Ticket', 'event_espresso'); ?></th>
10
+					<th class="jst-left"><?php _e('Registrant', 'event_espresso'); ?></th>
11
+					<th class="jst-left"><?php _e('Ticket Price', 'event_espresso'); ?></th>
12
+					<th class="jst-left"><?php _e('Email', 'event_espresso'); ?></th>
13
+					<th class="jst-left"><?php _e('Address', 'event_espresso'); ?></th>
14 14
 				</tr>
15 15
 			</thead>
16 16
 			<tbody>
17
-		<?php if ( isset( $event_attendees ) && is_array( $event_attendees )) : ?>
18
-			<?php foreach ( $event_attendees as $registration => $attendee ) : ?>
17
+		<?php if (isset($event_attendees) && is_array($event_attendees)) : ?>
18
+			<?php foreach ($event_attendees as $registration => $attendee) : ?>
19 19
 				<tr>
20
-					<td class="jst-left"><?php echo $attendee['att_num'];?></td>
21
-					<td class="jst-left"><?php echo $attendee['event_ticket_name'];?></td>
20
+					<td class="jst-left"><?php echo $attendee['att_num']; ?></td>
21
+					<td class="jst-left"><?php echo $attendee['event_ticket_name']; ?></td>
22 22
 					<td class="jst-left">
23 23
 						<?php
24
-						$att_link = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$registration), REG_ADMIN_URL );
24
+						$att_link = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$registration), REG_ADMIN_URL);
25 25
 						?>
26
-						<a href="<?php echo $att_link; ?>" title="<?php _e( 'View details for this registrant', 'event_espresso' );?>">
26
+						<a href="<?php echo $att_link; ?>" title="<?php _e('View details for this registrant', 'event_espresso'); ?>">
27 27
 							<?php echo $attendee['attendee']?>
28 28
 						</a>
29 29
 					</td>
Please login to merge, or discard this patch.
core/db_classes/EE_Registration.class.php 4 patches
Spacing   +191 added lines, -191 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * EE_Registration class
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
 	 *                             		    date_format and the second value is the time format
42 42
 	 * @return EE_Registration
43 43
 	 */
44
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
45
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__ );
46
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
44
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
45
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__);
46
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
47 47
 	}
48 48
 
49 49
 
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
 	 *                          		the website will be used.
55 55
 	 * @return EE_Registration
56 56
 	 */
57
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
58
-		return new self( $props_n_values, TRUE, $timezone );
57
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
58
+		return new self($props_n_values, TRUE, $timezone);
59 59
 	}
60 60
 
61 61
 
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 	 * @access        public
67 67
 	 * @param        int $EVT_ID Event ID
68 68
 	 */
69
-	public function set_event( $EVT_ID = 0 ) {
70
-		$this->set( 'EVT_ID', $EVT_ID );
69
+	public function set_event($EVT_ID = 0) {
70
+		$this->set('EVT_ID', $EVT_ID);
71 71
 	}
72 72
 
73 73
 
@@ -78,18 +78,18 @@  discard block
 block discarded – undo
78 78
 	 * @param mixed  $field_value
79 79
 	 * @param bool   $use_default
80 80
 	 */
81
-	public function set( $field_name, $field_value, $use_default = FALSE ) {
82
-		switch( $field_name ) {
81
+	public function set($field_name, $field_value, $use_default = FALSE) {
82
+		switch ($field_name) {
83 83
 			case 'REG_code' :
84
-				if ( ! empty( $field_value ) && $this->reg_code() == '' ) {
85
-					$this->set_reg_code( $field_value, $use_default );
84
+				if ( ! empty($field_value) && $this->reg_code() == '') {
85
+					$this->set_reg_code($field_value, $use_default);
86 86
 				}
87 87
 				break;
88 88
 			case 'STS_ID' :
89
-				$this->set_status( $field_value, $use_default );
89
+				$this->set_status($field_value, $use_default);
90 90
 				break;
91 91
 			default :
92
-				parent::set( $field_name, $field_value, $use_default );
92
+				parent::set($field_name, $field_value, $use_default);
93 93
 		}
94 94
 	}
95 95
 
@@ -106,42 +106,42 @@  discard block
 block discarded – undo
106 106
 	 * @param boolean $use_default
107 107
 	 * @return bool
108 108
 	 */
109
-	public function set_status( $new_STS_ID = NULL, $use_default = FALSE ) {
109
+	public function set_status($new_STS_ID = NULL, $use_default = FALSE) {
110 110
 		// get current REG_Status
111 111
 		$old_STS_ID = $this->status_ID();
112 112
 		// if status has changed
113 113
 		if (
114 114
 			$this->ID() // ensure registration is in the db
115 115
 			&& $old_STS_ID != $new_STS_ID // and that status has actually changed
116
-			&& ! empty( $old_STS_ID ) // and that old status is actually set
117
-			&& ! empty( $new_STS_ID ) // as well as the new status
116
+			&& ! empty($old_STS_ID) // and that old status is actually set
117
+			&& ! empty($new_STS_ID) // as well as the new status
118 118
 		) {
119 119
 			// TO approved
120
-			if ( $new_STS_ID == EEM_Registration::status_id_approved ) {
120
+			if ($new_STS_ID == EEM_Registration::status_id_approved) {
121 121
 				// reserve a space by incrementing ticket and datetime sold values
122 122
 				$this->_reserve_registration_space();
123
-				do_action( 'AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID );
123
+				do_action('AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID);
124 124
 			// OR FROM  approved
125
-			} else if ( $old_STS_ID == EEM_Registration::status_id_approved ) {
125
+			} else if ($old_STS_ID == EEM_Registration::status_id_approved) {
126 126
 				// release a space by decrementing ticket and datetime sold values
127 127
 				$this->_release_registration_space();
128
-				do_action( 'AHEE__EE_Registration__set_status__from_approved', $this, $old_STS_ID, $new_STS_ID );
128
+				do_action('AHEE__EE_Registration__set_status__from_approved', $this, $old_STS_ID, $new_STS_ID);
129 129
 			}
130 130
 			// update status
131
-			parent::set( 'STS_ID', $new_STS_ID, $use_default );
131
+			parent::set('STS_ID', $new_STS_ID, $use_default);
132 132
 			/** @type EE_Registration_Processor $registration_processor */
133
-			$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
133
+			$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
134 134
 			/** @type EE_Transaction_Processor $transaction_processor */
135
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
135
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
136 136
 			/** @type EE_Transaction_Payments $transaction_payments */
137
-			$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
137
+			$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
138 138
 			// these reg statuses should not be considered in any calculations involving monies owing
139
-			$closed_reg_statuses = ! empty( $closed_reg_statuses )
139
+			$closed_reg_statuses = ! empty($closed_reg_statuses)
140 140
 				? $closed_reg_statuses
141 141
 				: EEM_Registration::closed_reg_statuses();
142 142
 			if (
143
-				in_array( $new_STS_ID, $closed_reg_statuses )
144
-				&& ! in_array( $old_STS_ID, $closed_reg_statuses )
143
+				in_array($new_STS_ID, $closed_reg_statuses)
144
+				&& ! in_array($old_STS_ID, $closed_reg_statuses)
145 145
 			) {
146 146
 				// cancelled or declined registration
147 147
 				$registration_processor->update_registration_after_being_canceled_or_declined(
@@ -154,24 +154,24 @@  discard block
 block discarded – undo
154 154
 					false
155 155
 				);
156 156
 			} else if (
157
-				in_array( $old_STS_ID, $closed_reg_statuses )
158
-				&& ! in_array( $new_STS_ID, $closed_reg_statuses )
157
+				in_array($old_STS_ID, $closed_reg_statuses)
158
+				&& ! in_array($new_STS_ID, $closed_reg_statuses)
159 159
 			) {
160 160
 				// reinstating cancelled or declined registration
161 161
 				$registration_processor->update_canceled_or_declined_registration_after_being_reinstated(
162 162
 					$this,
163 163
 					$closed_reg_statuses
164 164
 				);
165
-				$transaction_processor->update_transaction_after_reinstating_canceled_registration( $this );
165
+				$transaction_processor->update_transaction_after_reinstating_canceled_registration($this);
166 166
 			}
167
-			$transaction_payments->recalculate_transaction_total( $this->transaction(), false );
168
-			$transaction_payments->update_transaction_status_based_on_total_paid( $this->transaction(), true );
169
-			do_action( 'AHEE__EE_Registration__set_status__after_update', $this );
167
+			$transaction_payments->recalculate_transaction_total($this->transaction(), false);
168
+			$transaction_payments->update_transaction_status_based_on_total_paid($this->transaction(), true);
169
+			do_action('AHEE__EE_Registration__set_status__after_update', $this);
170 170
 			return TRUE;
171 171
 		} else {
172 172
 			//even though the old value matches the new value, it's still good to
173 173
 			//allow the parent set method to have a say
174
-			parent::set( 'STS_ID', $new_STS_ID, $use_default );
174
+			parent::set('STS_ID', $new_STS_ID, $use_default);
175 175
 			return TRUE;
176 176
 		}
177 177
 	}
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 	 * @access        public
184 184
 	 */
185 185
 	public function status_ID() {
186
-		return $this->get( 'STS_ID' );
186
+		return $this->get('STS_ID');
187 187
 	}
188 188
 
189 189
 
@@ -208,12 +208,12 @@  discard block
 block discarded – undo
208 208
 	 * @param boolean $include_archived whether to include archived tickets or not.
209 209
 	 * @return EE_Ticket
210 210
 	 */
211
-	public function ticket( $include_archived = TRUE ) {
211
+	public function ticket($include_archived = TRUE) {
212 212
 		$query_params = array();
213
-		if ( $include_archived ) {
214
-			$query_params[ 'default_where_conditions' ] = 'none';
213
+		if ($include_archived) {
214
+			$query_params['default_where_conditions'] = 'none';
215 215
 		}
216
-		return $this->get_first_related( 'Ticket', $query_params );
216
+		return $this->get_first_related('Ticket', $query_params);
217 217
 	}
218 218
 
219 219
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 	 * @return EE_Event
224 224
 	 */
225 225
 	public function event() {
226
-		return $this->get_first_related( 'Event' );
226
+		return $this->get_first_related('Event');
227 227
 	}
228 228
 
229 229
 
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 	 */
238 238
 	public function wp_user() {
239 239
 		$event = $this->event();
240
-		if ( $event instanceof EE_Event ) {
240
+		if ($event instanceof EE_Event) {
241 241
 			return $event->wp_user();
242 242
 		}
243 243
 		return 0;
@@ -263,8 +263,8 @@  discard block
 block discarded – undo
263 263
 	 * @access        public
264 264
 	 * @param        int $ATT_ID Attendee ID
265 265
 	 */
266
-	public function set_attendee_id( $ATT_ID = 0 ) {
267
-		$this->set( 'ATT_ID', $ATT_ID );
266
+	public function set_attendee_id($ATT_ID = 0) {
267
+		$this->set('ATT_ID', $ATT_ID);
268 268
 	}
269 269
 
270 270
 
@@ -275,8 +275,8 @@  discard block
 block discarded – undo
275 275
 	 * @access        public
276 276
 	 * @param        int $TXN_ID Transaction ID
277 277
 	 */
278
-	public function set_transaction_id( $TXN_ID = 0 ) {
279
-		$this->set( 'TXN_ID', $TXN_ID );
278
+	public function set_transaction_id($TXN_ID = 0) {
279
+		$this->set('TXN_ID', $TXN_ID);
280 280
 	}
281 281
 
282 282
 
@@ -287,8 +287,8 @@  discard block
 block discarded – undo
287 287
 	 * @access    public
288 288
 	 * @param    string $REG_session PHP Session ID
289 289
 	 */
290
-	public function set_session( $REG_session = '' ) {
291
-		$this->set( 'REG_session', $REG_session );
290
+	public function set_session($REG_session = '') {
291
+		$this->set('REG_session', $REG_session);
292 292
 	}
293 293
 
294 294
 
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
 	 * @access    public
300 300
 	 * @param    string $REG_url_link Registration URL Link
301 301
 	 */
302
-	public function set_reg_url_link( $REG_url_link = '' ) {
303
-		$this->set( 'REG_url_link', $REG_url_link );
302
+	public function set_reg_url_link($REG_url_link = '') {
303
+		$this->set('REG_url_link', $REG_url_link);
304 304
 	}
305 305
 
306 306
 
@@ -311,8 +311,8 @@  discard block
 block discarded – undo
311 311
 	 * @access        public
312 312
 	 * @param        int $REG_count Primary Attendee
313 313
 	 */
314
-	public function set_count( $REG_count = 1 ) {
315
-		$this->set( 'REG_count', $REG_count );
314
+	public function set_count($REG_count = 1) {
315
+		$this->set('REG_count', $REG_count);
316 316
 	}
317 317
 
318 318
 
@@ -323,8 +323,8 @@  discard block
 block discarded – undo
323 323
 	 * @access        public
324 324
 	 * @param        boolean $REG_group_size Group Registration
325 325
 	 */
326
-	public function set_group_size( $REG_group_size = FALSE ) {
327
-		$this->set( 'REG_group_size', $REG_group_size );
326
+	public function set_group_size($REG_group_size = FALSE) {
327
+		$this->set('REG_group_size', $REG_group_size);
328 328
 	}
329 329
 
330 330
 
@@ -407,8 +407,8 @@  discard block
 block discarded – undo
407 407
 	 * @access        public
408 408
 	 * @param        mixed ( int or string ) $REG_date Registration Date - Unix timestamp or string representation of Date
409 409
 	 */
410
-	public function set_reg_date( $REG_date = FALSE ) {
411
-		$this->set( 'REG_date', $REG_date );
410
+	public function set_reg_date($REG_date = FALSE) {
411
+		$this->set('REG_date', $REG_date);
412 412
 	}
413 413
 
414 414
 
@@ -419,8 +419,8 @@  discard block
 block discarded – undo
419 419
 	 * @access    public
420 420
 	 * @param    float $REG_final_price
421 421
 	 */
422
-	public function set_final_price( $REG_final_price = 0.00 ) {
423
-		$this->set( 'REG_final_price', $REG_final_price );
422
+	public function set_final_price($REG_final_price = 0.00) {
423
+		$this->set('REG_final_price', $REG_final_price);
424 424
 	}
425 425
 
426 426
 
@@ -431,8 +431,8 @@  discard block
 block discarded – undo
431 431
 	 * @access    public
432 432
 	 * @param    float $REG_paid
433 433
 	 */
434
-	public function set_paid( $REG_paid = 0.00 ) {
435
-		$this->set( 'REG_paid', $REG_paid );
434
+	public function set_paid($REG_paid = 0.00) {
435
+		$this->set('REG_paid', $REG_paid);
436 436
 	}
437 437
 
438 438
 
@@ -443,8 +443,8 @@  discard block
 block discarded – undo
443 443
 	 * @access        public
444 444
 	 * @param        boolean $REG_att_is_going Attendee Is Going
445 445
 	 */
446
-	public function set_att_is_going( $REG_att_is_going = FALSE ) {
447
-		$this->set( 'REG_att_is_going', $REG_att_is_going );
446
+	public function set_att_is_going($REG_att_is_going = FALSE) {
447
+		$this->set('REG_att_is_going', $REG_att_is_going);
448 448
 	}
449 449
 
450 450
 
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 	 * @return EE_Attendee
455 455
 	 */
456 456
 	public function attendee() {
457
-		return $this->get_first_related( 'Attendee' );
457
+		return $this->get_first_related('Attendee');
458 458
 	}
459 459
 
460 460
 
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 	 * @access        public
465 465
 	 */
466 466
 	public function event_ID() {
467
-		return $this->get( 'EVT_ID' );
467
+		return $this->get('EVT_ID');
468 468
 	}
469 469
 
470 470
 
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
 	 */
476 476
 	public function event_name() {
477 477
 		$event = $this->event_obj();
478
-		if ( $event ) {
478
+		if ($event) {
479 479
 			return $event->name();
480 480
 		} else {
481 481
 			return NULL;
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 	 * @return EE_Event
490 490
 	 */
491 491
 	public function event_obj() {
492
-		return $this->get_first_related( 'Event' );
492
+		return $this->get_first_related('Event');
493 493
 	}
494 494
 
495 495
 
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 	 * @access        public
500 500
 	 */
501 501
 	public function attendee_ID() {
502
-		return $this->get( 'ATT_ID' );
502
+		return $this->get('ATT_ID');
503 503
 	}
504 504
 
505 505
 
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 	 * @access        public
510 510
 	 */
511 511
 	public function session_ID() {
512
-		return $this->get( 'REG_session' );
512
+		return $this->get('REG_session');
513 513
 	}
514 514
 
515 515
 
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 	 * @param string $messenger 'pdf' or 'html'.  Default 'html'.
520 520
 	 * @return string
521 521
 	 */
522
-	public function receipt_url( $messenger = 'html' ) {
522
+	public function receipt_url($messenger = 'html') {
523 523
 
524 524
 		/**
525 525
 		 * The below will be deprecated one version after this.  We check first if there is a custom receipt template already in use on old system.  If there is then we just return the standard url for it.
@@ -528,12 +528,12 @@  discard block
 block discarded – undo
528 528
 		 */
529 529
 		EE_Registry::instance()->load_helper('Template');
530 530
 		$template_relative_path = 'modules/gateways/Invoice/lib/templates/receipt_body.template.php';
531
-		$has_custom = EEH_Template::locate_template( $template_relative_path , array(), TRUE, TRUE, TRUE );
531
+		$has_custom = EEH_Template::locate_template($template_relative_path, array(), TRUE, TRUE, TRUE);
532 532
 
533
-		if ( $has_custom ) {
534
-			return add_query_arg( array( 'receipt' => 'true' ), $this->invoice_url( 'launch' ) );
533
+		if ($has_custom) {
534
+			return add_query_arg(array('receipt' => 'true'), $this->invoice_url('launch'));
535 535
 		}
536
-		return apply_filters( 'FHEE__EE_Registration__receipt_url__receipt_url', '', $this, $messenger, 'receipt' );
536
+		return apply_filters('FHEE__EE_Registration__receipt_url__receipt_url', '', $this, $messenger, 'receipt');
537 537
 	}
538 538
 
539 539
 
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 	 * @param string $messenger 'pdf' or 'html'.  Default 'html'.
545 545
 	 * @return string
546 546
 	 */
547
-	public function invoice_url( $messenger = 'html' ) {
547
+	public function invoice_url($messenger = 'html') {
548 548
 		/**
549 549
 		 * The below will be deprecated one version after this.  We check first if there is a custom invoice template already in use on old system.  If there is then we just return the standard url for it.
550 550
 		 *
@@ -552,21 +552,21 @@  discard block
 block discarded – undo
552 552
 		 */
553 553
 		EE_Registry::instance()->load_helper('Template');
554 554
 		$template_relative_path = 'modules/gateways/Invoice/lib/templates/invoice_body.template.php';
555
-		$has_custom = EEH_Template::locate_template( $template_relative_path , array(), TRUE, TRUE, TRUE );
555
+		$has_custom = EEH_Template::locate_template($template_relative_path, array(), TRUE, TRUE, TRUE);
556 556
 
557
-		if ( $has_custom ) {
558
-			if ( $messenger == 'html' ) {
559
-				return $this->invoice_url( 'launch' );
557
+		if ($has_custom) {
558
+			if ($messenger == 'html') {
559
+				return $this->invoice_url('launch');
560 560
 			}
561 561
 			$route = $messenger == 'download' || $messenger == 'pdf' ? 'download_invoice' : 'launch_invoice';
562 562
 
563
-			$query_args = array( 'ee' => $route, 'id' => $this->reg_url_link() );
564
-			if ( $messenger == 'html' ) {
563
+			$query_args = array('ee' => $route, 'id' => $this->reg_url_link());
564
+			if ($messenger == 'html') {
565 565
 				$query_args['html'] = TRUE;
566 566
 			}
567
-			return add_query_arg( $query_args, get_permalink( EE_Registry::instance()->CFG->core->thank_you_page_id ) );
567
+			return add_query_arg($query_args, get_permalink(EE_Registry::instance()->CFG->core->thank_you_page_id));
568 568
 		}
569
-		return apply_filters( 'FHEE__EE_Registration__invoice_url__invoice_url', '', $this, $messenger, 'invoice' );
569
+		return apply_filters('FHEE__EE_Registration__invoice_url__invoice_url', '', $this, $messenger, 'invoice');
570 570
 	}
571 571
 
572 572
 
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 	 * @access        public
577 577
 	 */
578 578
 	public function reg_url_link() {
579
-		return $this->get( 'REG_url_link' );
579
+		return $this->get('REG_url_link');
580 580
 	}
581 581
 
582 582
 
@@ -586,8 +586,8 @@  discard block
 block discarded – undo
586 586
 	 * @param string $type 'download','launch', or 'html' (default is 'launch')
587 587
 	 * @return void
588 588
 	 */
589
-	public function e_invoice_url( $type = 'launch' ) {
590
-		echo $this->invoice_url( $type );
589
+	public function e_invoice_url($type = 'launch') {
590
+		echo $this->invoice_url($type);
591 591
 	}
592 592
 
593 593
 
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
 	 * @return string
608 608
 	 */
609 609
 	public function payment_overview_url() {
610
-		return add_query_arg( array( 'e_reg_url_link' => $this->reg_url_link(), 'step' => 'payment_options', 'revisit' => TRUE ), EE_Registry::instance()->CFG->core->reg_page_url() );
610
+		return add_query_arg(array('e_reg_url_link' => $this->reg_url_link(), 'step' => 'payment_options', 'revisit' => TRUE), EE_Registry::instance()->CFG->core->reg_page_url());
611 611
 	}
612 612
 
613 613
 
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 	 * @return string
619 619
 	 */
620 620
 	public function edit_attendee_information_url() {
621
-		return add_query_arg( array( 'e_reg_url_link' => $this->reg_url_link(), 'step' => 'attendee_information', 'revisit' => TRUE ), EE_Registry::instance()->CFG->core->reg_page_url() );
621
+		return add_query_arg(array('e_reg_url_link' => $this->reg_url_link(), 'step' => 'attendee_information', 'revisit' => TRUE), EE_Registry::instance()->CFG->core->reg_page_url());
622 622
 	}
623 623
 
624 624
 
@@ -628,8 +628,8 @@  discard block
 block discarded – undo
628 628
 	 * @return string
629 629
 	 */
630 630
 	public function get_admin_edit_url() {
631
-		EE_Registry::instance()->load_helper( 'URL' );
632
-		return EEH_URL::add_query_args_and_nonce( array( 'page' => 'espresso_registrations', 'action' => 'view_registration', '_REG_ID' => $this->ID() ), admin_url( 'admin.php' ) );
631
+		EE_Registry::instance()->load_helper('URL');
632
+		return EEH_URL::add_query_args_and_nonce(array('page' => 'espresso_registrations', 'action' => 'view_registration', '_REG_ID' => $this->ID()), admin_url('admin.php'));
633 633
 	}
634 634
 
635 635
 
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 	 * @access        public
640 640
 	 */
641 641
 	public function is_primary_registrant() {
642
-		return $this->get( 'REG_count' ) == 1 ? TRUE : FALSE;
642
+		return $this->get('REG_count') == 1 ? TRUE : FALSE;
643 643
 	}
644 644
 
645 645
 
@@ -648,12 +648,12 @@  discard block
 block discarded – undo
648 648
 	 * This returns the primary registration object for this registration group (which may be this object).
649 649
 	 * @return EE_Registration
650 650
 	 */
651
-	public function get_primary_registration()  {
652
-		if ( $this->is_primary_registrant() )
651
+	public function get_primary_registration() {
652
+		if ($this->is_primary_registrant())
653 653
 			return $this;
654 654
 
655 655
 		//k reg_count !== 1 so let's get the EE_Registration object matching this txn_id and reg_count == 1
656
-		$primary_registrant = EEM_Registration::instance()->get_one( array( array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1 ) ) );
656
+		$primary_registrant = EEM_Registration::instance()->get_one(array(array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1)));
657 657
 		return $primary_registrant;
658 658
 	}
659 659
 
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
 	* 		@access		public
665 665
 	*/
666 666
 	public function count() {
667
-		return $this->get( 'REG_count' );
667
+		return $this->get('REG_count');
668 668
 	}
669 669
 
670 670
 
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
 	 * @access        public
675 675
 	 */
676 676
 	public function group_size() {
677
-		return $this->get( 'REG_group_size' );
677
+		return $this->get('REG_group_size');
678 678
 	}
679 679
 
680 680
 
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 	 * @access        public
685 685
 	 */
686 686
 	public function date() {
687
-		return $this->get( 'REG_date' );
687
+		return $this->get('REG_date');
688 688
 	}
689 689
 
690 690
 
@@ -695,8 +695,8 @@  discard block
 block discarded – undo
695 695
 	 * @param string $time_format
696 696
 	 * @return string
697 697
 	 */
698
-	public function pretty_date( $date_format = NULL, $time_format = NULL ) {
699
-		return $this->get_datetime( 'REG_date', $date_format, $time_format );
698
+	public function pretty_date($date_format = NULL, $time_format = NULL) {
699
+		return $this->get_datetime('REG_date', $date_format, $time_format);
700 700
 	}
701 701
 
702 702
 
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 	 * @return    float
710 710
 	 */
711 711
 	public function final_price() {
712
-		return $this->get( 'REG_final_price' );
712
+		return $this->get('REG_final_price');
713 713
 	}
714 714
 
715 715
 
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
 	 * @return string
721 721
 	 */
722 722
 	public function pretty_final_price() {
723
-		return $this->get_pretty( 'REG_final_price' );
723
+		return $this->get_pretty('REG_final_price');
724 724
 	}
725 725
 
726 726
 
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 	 * @return 	float
732 732
 	 */
733 733
 	public function paid() {
734
-		return $this->get( 'REG_paid' );
734
+		return $this->get('REG_paid');
735 735
 	}
736 736
 
737 737
 
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
 	 * @return 	float
743 743
 	 */
744 744
 	public function pretty_paid() {
745
-		return $this->get_pretty( 'REG_paid' );
745
+		return $this->get_pretty('REG_paid');
746 746
 	}
747 747
 
748 748
 
@@ -754,11 +754,11 @@  discard block
 block discarded – undo
754 754
 	 * @param array $requires_payment
755 755
 	 * @return bool
756 756
 	 */
757
-	public function owes_monies_and_can_pay( $requires_payment = array()) {
757
+	public function owes_monies_and_can_pay($requires_payment = array()) {
758 758
 		// these reg statuses require payment (if event is not free)
759
-		$requires_payment = ! empty( $requires_payment ) ? $requires_payment : EEM_Registration::reg_statuses_that_allow_payment();
759
+		$requires_payment = ! empty($requires_payment) ? $requires_payment : EEM_Registration::reg_statuses_that_allow_payment();
760 760
 		if (
761
-			in_array( $this->status_ID(), $requires_payment ) &&
761
+			in_array($this->status_ID(), $requires_payment) &&
762 762
 			$this->final_price() != 0 &&
763 763
 			$this->final_price() != $this->paid()
764 764
 		) {
@@ -775,8 +775,8 @@  discard block
 block discarded – undo
775 775
 	 * @param bool $show_icons
776 776
 	 * @return void
777 777
 	 */
778
-	public function e_pretty_status( $show_icons = FALSE ) {
779
-		echo $this->pretty_status( $show_icons );
778
+	public function e_pretty_status($show_icons = FALSE) {
779
+		echo $this->pretty_status($show_icons);
780 780
 	}
781 781
 
782 782
 
@@ -787,10 +787,10 @@  discard block
 block discarded – undo
787 787
 	 * @param bool $show_icons
788 788
 	 * @return string
789 789
 	 */
790
-	public function pretty_status( $show_icons = FALSE ) {
791
-		$status = EEM_Status::instance()->localized_status( array( $this->status_ID() => __( 'unknown', 'event_espresso' ) ), FALSE, 'sentence' );
790
+	public function pretty_status($show_icons = FALSE) {
791
+		$status = EEM_Status::instance()->localized_status(array($this->status_ID() => __('unknown', 'event_espresso')), FALSE, 'sentence');
792 792
 		$icon = '';
793
-		switch ( $this->status_ID() ) {
793
+		switch ($this->status_ID()) {
794 794
 			case EEM_Registration::status_id_approved:
795 795
 				$icon = $show_icons ? '<span class="dashicons dashicons-star-filled ee-icon-size-16 green-text"></span>' : '';
796 796
 				break;
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
 				$icon = $show_icons ? '<span class="dashicons dashicons-no ee-icon-size-16 red-text"></span>' : '';
811 811
 				break;
812 812
 		}
813
-		return $icon . $status[ $this->status_ID() ];
813
+		return $icon.$status[$this->status_ID()];
814 814
 	}
815 815
 
816 816
 
@@ -820,7 +820,7 @@  discard block
 block discarded – undo
820 820
 	 * @access        public
821 821
 	 */
822 822
 	public function att_is_going() {
823
-		return $this->get( 'REG_att_is_going' );
823
+		return $this->get('REG_att_is_going');
824 824
 	}
825 825
 
826 826
 
@@ -830,8 +830,8 @@  discard block
 block discarded – undo
830 830
 	 * @param array $query_params like EEM_Base::get_all
831 831
 	 * @return EE_Answer[]
832 832
 	 */
833
-	public function answers( $query_params = NULL ) {
834
-		return $this->get_many_related( 'Answer', $query_params );
833
+	public function answers($query_params = NULL) {
834
+		return $this->get_many_related('Answer', $query_params);
835 835
 	}
836 836
 
837 837
 
@@ -845,9 +845,9 @@  discard block
 block discarded – undo
845 845
 	 * (because the answer might be an array of answer values, so passing pretty_value=true
846 846
 	 * will convert it into some kind of string)
847 847
 	 */
848
-	public function answer_value_to_question( $question, $pretty_value=true ) {
848
+	public function answer_value_to_question($question, $pretty_value = true) {
849 849
 		$question_id = EEM_Question::instance()->ensure_is_ID($question);
850
-		return EEM_Answer::instance()->get_answer_value_to_question($this,$question_id,$pretty_value);
850
+		return EEM_Answer::instance()->get_answer_value_to_question($this, $question_id, $pretty_value);
851 851
 	}
852 852
 
853 853
 
@@ -860,13 +860,13 @@  discard block
 block discarded – undo
860 860
 	 */
861 861
 	public function question_groups() {
862 862
 		$question_groups = array();
863
-		if ( $this->event() instanceof EE_Event ) {
863
+		if ($this->event() instanceof EE_Event) {
864 864
 			$question_groups = $this->event()->question_groups(
865 865
 				array(
866 866
 					array(
867 867
 						'Event_Question_Group.EQG_primary' => $this->count() == 1 ? true : false
868 868
 					),
869
-					'order_by' => array( 'QSG_order' => 'ASC' )
869
+					'order_by' => array('QSG_order' => 'ASC')
870 870
 				)
871 871
 			);
872 872
 		}
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
 	 */
884 884
 	public function count_question_groups() {
885 885
 		$qg_count = 0;
886
-		if ( $this->event() instanceof EE_Event ) {
886
+		if ($this->event() instanceof EE_Event) {
887 887
 			$qg_count = $this->event()->count_related(
888 888
 				'Question_Group',
889 889
 				array(
@@ -904,7 +904,7 @@  discard block
 block discarded – undo
904 904
 	 * @return string
905 905
 	 */
906 906
 	public function reg_date() {
907
-		return $this->get_datetime( 'REG_date' );
907
+		return $this->get_datetime('REG_date');
908 908
 	}
909 909
 
910 910
 
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
 	 * @return EE_Datetime_Ticket
917 917
 	 */
918 918
 	public function datetime_ticket() {
919
-		return $this->get_first_related( 'Datetime_Ticket' );
919
+		return $this->get_first_related('Datetime_Ticket');
920 920
 	}
921 921
 
922 922
 
@@ -926,15 +926,15 @@  discard block
 block discarded – undo
926 926
 	 * @param EE_Datetime_Ticket $datetime_ticket
927 927
 	 * @return EE_Datetime_Ticket
928 928
 	 */
929
-	public function set_datetime_ticket( $datetime_ticket ) {
930
-		return $this->_add_relation_to( $datetime_ticket, 'Datetime_Ticket' );
929
+	public function set_datetime_ticket($datetime_ticket) {
930
+		return $this->_add_relation_to($datetime_ticket, 'Datetime_Ticket');
931 931
 	}
932 932
 	/**
933 933
 	 * Gets deleted
934 934
 	 * @return boolean
935 935
 	 */
936 936
 	public function deleted() {
937
-		return $this->get( 'REG_deleted' );
937
+		return $this->get('REG_deleted');
938 938
 	}
939 939
 
940 940
 	/**
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
 	 * @return boolean
944 944
 	 */
945 945
 	public function set_deleted($deleted) {
946
-		$this->set( 'REG_deleted', $deleted );
946
+		$this->set('REG_deleted', $deleted);
947 947
 	}
948 948
 
949 949
 
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
 	 * @return EE_Status
954 954
 	 */
955 955
 	public function status_obj() {
956
-		return $this->get_first_related( 'Status' );
956
+		return $this->get_first_related('Status');
957 957
 	}
958 958
 
959 959
 
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
 	 * @return int
965 965
 	 */
966 966
 	public function count_checkins() {
967
-		return $this->get_model()->count_related( $this, 'Checkin' );
967
+		return $this->get_model()->count_related($this, 'Checkin');
968 968
 	}
969 969
 
970 970
 
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
 	 * @return int
975 975
 	 */
976 976
 	public function count_checkins_not_checkedout() {
977
-		return $this->get_model()->count_related( $this, 'Checkin', array( array( 'CHK_in' => 1 ) ) );
977
+		return $this->get_model()->count_related($this, 'Checkin', array(array('CHK_in' => 1)));
978 978
 	}
979 979
 
980 980
 
@@ -987,20 +987,20 @@  discard block
 block discarded – undo
987 987
 	 *
988 988
 	 * @return bool
989 989
 	 */
990
-	public function can_checkin( $DTT_OR_ID, $check_approved = TRUE ) {
991
-		$DTT_ID = EEM_Datetime::instance()->ensure_is_ID( $DTT_OR_ID );
990
+	public function can_checkin($DTT_OR_ID, $check_approved = TRUE) {
991
+		$DTT_ID = EEM_Datetime::instance()->ensure_is_ID($DTT_OR_ID);
992 992
 
993 993
 		//first check registration status
994
-		if (  ( $check_approved && ! $this->is_approved() ) || ! $DTT_ID ) {
994
+		if (($check_approved && ! $this->is_approved()) || ! $DTT_ID) {
995 995
 			return false;
996 996
 		}
997 997
 		//is there a datetime ticket that matches this dtt_ID?
998
-		if ( ! ( EEM_Datetime_Ticket::instance()->exists( array( array( 'TKT_ID' => $this->get('TKT_ID' ), 'DTT_ID' => $DTT_ID ) ) ) ) ) {
998
+		if ( ! (EEM_Datetime_Ticket::instance()->exists(array(array('TKT_ID' => $this->get('TKT_ID'), 'DTT_ID' => $DTT_ID))))) {
999 999
 			return false;
1000 1000
 		}
1001 1001
 
1002 1002
 		//final check is against TKT_uses
1003
-		return $this->verify_can_checkin_against_TKT_uses( $DTT_ID );
1003
+		return $this->verify_can_checkin_against_TKT_uses($DTT_ID);
1004 1004
 	}
1005 1005
 
1006 1006
 
@@ -1013,10 +1013,10 @@  discard block
 block discarded – undo
1013 1013
 	 * @param int | EE_Datetime  $DTT_OR_ID  The datetime the registration is being checked against
1014 1014
 	 * @return bool   true means can checkin.  false means cannot checkin.
1015 1015
 	 */
1016
-	public function verify_can_checkin_against_TKT_uses( $DTT_OR_ID ) {
1017
-		$DTT_ID = EEM_Datetime::instance()->ensure_is_ID( $DTT_OR_ID );
1016
+	public function verify_can_checkin_against_TKT_uses($DTT_OR_ID) {
1017
+		$DTT_ID = EEM_Datetime::instance()->ensure_is_ID($DTT_OR_ID);
1018 1018
 
1019
-		if ( ! $DTT_ID ) {
1019
+		if ( ! $DTT_ID) {
1020 1020
 			return false;
1021 1021
 		}
1022 1022
 
@@ -1024,23 +1024,23 @@  discard block
 block discarded – undo
1024 1024
 
1025 1025
 		// if max uses is not set or equals infinity then return true cause its not a factor for whether user can check-in
1026 1026
 		// or not.
1027
-		if ( ! $max_uses || $max_uses === EE_INF ) {
1027
+		if ( ! $max_uses || $max_uses === EE_INF) {
1028 1028
 			return true;
1029 1029
 		}
1030 1030
 
1031 1031
 		//does this datetime have a checkin record?  If so, then the dtt count has already been verified so we can just
1032 1032
 		//go ahead and toggle.
1033
-		if ( EEM_Checkin::instance()->exists( array( array( 'REG_ID' => $this->ID(), 'DTT_ID' => $DTT_ID ) ) ) ) {
1033
+		if (EEM_Checkin::instance()->exists(array(array('REG_ID' => $this->ID(), 'DTT_ID' => $DTT_ID)))) {
1034 1034
 			return true;
1035 1035
 		}
1036 1036
 
1037 1037
 		//made it here so the last check is whether the number of checkins per unique datetime on this registration
1038 1038
 		//disallows further check-ins.
1039
-		$count_unique_dtt_checkins = EEM_Checkin::instance()->count( array( array( 'REG_ID' => $this->ID(), 'CHK_in' => true ) ), 'DTT_ID', true );
1039
+		$count_unique_dtt_checkins = EEM_Checkin::instance()->count(array(array('REG_ID' => $this->ID(), 'CHK_in' => true)), 'DTT_ID', true);
1040 1040
 		// checkins have already reached their max number of uses
1041 1041
 		// so registrant can NOT checkin
1042
-		if ( $count_unique_dtt_checkins >= $max_uses ) {
1043
-			EE_Error::add_error( __( 'Check-in denied because number of datetime uses for the ticket has been reached or exceeded.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1042
+		if ($count_unique_dtt_checkins >= $max_uses) {
1043
+			EE_Error::add_error(__('Check-in denied because number of datetime uses for the ticket has been reached or exceeded.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1044 1044
 			return false;
1045 1045
 		}
1046 1046
 		return true;
@@ -1061,15 +1061,15 @@  discard block
 block discarded – undo
1061 1061
 	 * @param  bool $verify  If true then can_checkin() is used to verify whether the person can be checked in or not.  Otherwise this forces change in checkin status.
1062 1062
 	 * @return int|BOOL            the chk_in status toggled to OR false if nothing got changed.
1063 1063
 	 */
1064
-	public function toggle_checkin_status( $DTT_ID = null, $verify = false ) {
1065
-		if ( empty( $DTT_ID ) ) {
1064
+	public function toggle_checkin_status($DTT_ID = null, $verify = false) {
1065
+		if (empty($DTT_ID)) {
1066 1066
 			$datetime = $this->get_related_primary_datetime();
1067 1067
 			$DTT_ID = $datetime->ID();
1068 1068
 		// verify the registration can checkin for the given DTT_ID
1069
-		} elseif ( ! $this->can_checkin( $DTT_ID, $verify ) ) {
1069
+		} elseif ( ! $this->can_checkin($DTT_ID, $verify)) {
1070 1070
 			EE_Error::add_error(
1071 1071
 					sprintf(
1072
-						__( 'The given registration (ID:%1$d) can not be checked in to the given DTT_ID (%2$d), because the registration does not have access', 'event_espresso'),
1072
+						__('The given registration (ID:%1$d) can not be checked in to the given DTT_ID (%2$d), because the registration does not have access', 'event_espresso'),
1073 1073
 						$this->ID(),
1074 1074
 						$DTT_ID
1075 1075
 					),
@@ -1083,8 +1083,8 @@  discard block
 block discarded – undo
1083 1083
 			EE_Registration::checkin_status_out => EE_Registration::checkin_status_in
1084 1084
 		);
1085 1085
 		//start by getting the current status so we know what status we'll be changing to.
1086
-		$cur_status = $this->check_in_status_for_datetime( $DTT_ID, NULL );
1087
-		$status_to = $status_paths[ $cur_status ];
1086
+		$cur_status = $this->check_in_status_for_datetime($DTT_ID, NULL);
1087
+		$status_to = $status_paths[$cur_status];
1088 1088
 		// database only records true for checked IN or false for checked OUT
1089 1089
 		// no record ( null ) means checked in NEVER, but we obviously don't save that
1090 1090
 		$new_status = $status_to == EE_Registration::checkin_status_in ? true : false;
@@ -1092,24 +1092,24 @@  discard block
 block discarded – undo
1092 1092
 		// because we are keeping track of Check-ins over time.
1093 1093
 		// Eventually we'll probably want to show a list table
1094 1094
 		// for the individual Check-ins so that they can be managed.
1095
-		$checkin = EE_Checkin::new_instance( array(
1095
+		$checkin = EE_Checkin::new_instance(array(
1096 1096
 				'REG_ID' => $this->ID(),
1097 1097
 				'DTT_ID' => $DTT_ID,
1098 1098
 				'CHK_in' => $new_status
1099
-		) );
1099
+		));
1100 1100
 		// if the record could not be saved then return false
1101
-		if ( $checkin->save() === 0 ) {
1102
-			if ( WP_DEBUG ) {
1101
+		if ($checkin->save() === 0) {
1102
+			if (WP_DEBUG) {
1103 1103
 				global $wpdb;
1104 1104
 				$error = sprintf(
1105
-					__( 'Registration check in update failed because of the following database error: %1$s%2$s', 'event_espresso' ),
1105
+					__('Registration check in update failed because of the following database error: %1$s%2$s', 'event_espresso'),
1106 1106
 					'<br />',
1107 1107
 					$wpdb->last_error
1108 1108
 				);
1109 1109
 			} else {
1110
-				$error = __( 'Registration check in update failed because of an unknown database error', 'event_espresso' );
1110
+				$error = __('Registration check in update failed because of an unknown database error', 'event_espresso');
1111 1111
 			}
1112
-			EE_Error::add_error( $error, __FILE__, __FUNCTION__, __LINE__ );
1112
+			EE_Error::add_error($error, __FILE__, __FUNCTION__, __LINE__);
1113 1113
 			return false;
1114 1114
 		}
1115 1115
 		return $status_to;
@@ -1133,19 +1133,19 @@  discard block
 block discarded – undo
1133 1133
 	 * @param EE_Checkin $checkin If present, we use the given checkin object rather than the dtt_id.
1134 1134
 	 * @return int            Integer representing Check-in status.
1135 1135
 	 */
1136
-	public function check_in_status_for_datetime( $DTT_ID = 0, $checkin = NULL ) {
1137
-		if ( empty( $DTT_ID ) && ! $checkin instanceof EE_Checkin ) {
1136
+	public function check_in_status_for_datetime($DTT_ID = 0, $checkin = NULL) {
1137
+		if (empty($DTT_ID) && ! $checkin instanceof EE_Checkin) {
1138 1138
 			$datetime = $this->get_related_primary_datetime();
1139
-			if ( ! $datetime instanceof EE_Datetime ) {
1139
+			if ( ! $datetime instanceof EE_Datetime) {
1140 1140
 				return 0;
1141 1141
 			}
1142 1142
 			$DTT_ID = $datetime->ID();
1143 1143
 		//verify the registration can checkin for the given DTT_ID
1144 1144
 		}
1145 1145
 		//get checkin object (if exists)
1146
-		$checkin = $checkin instanceof EE_Checkin ? $checkin : $this->get_first_related( 'Checkin', array( array( 'DTT_ID' => $DTT_ID ), 'order_by' => array( 'CHK_timestamp' => 'DESC' ) ) );
1147
-		if ( $checkin instanceof EE_Checkin ) {
1148
-			if ( $checkin->get( 'CHK_in' ) ) {
1146
+		$checkin = $checkin instanceof EE_Checkin ? $checkin : $this->get_first_related('Checkin', array(array('DTT_ID' => $DTT_ID), 'order_by' => array('CHK_timestamp' => 'DESC')));
1147
+		if ($checkin instanceof EE_Checkin) {
1148
+			if ($checkin->get('CHK_in')) {
1149 1149
 				return EE_Registration::checkin_status_in; //checked in
1150 1150
 			} else {
1151 1151
 				return EE_Registration::checkin_status_out; //had checked in but is now checked out.
@@ -1163,28 +1163,28 @@  discard block
 block discarded – undo
1163 1163
 	 * @param bool $error  This just flags that you want an error message returned. This is put in so that the error message can be customized with the attendee name.
1164 1164
 	 * @return string         internationalized message
1165 1165
 	 */
1166
-	public function get_checkin_msg( $DTT_ID, $error = FALSE ) {
1166
+	public function get_checkin_msg($DTT_ID, $error = FALSE) {
1167 1167
 		//let's get the attendee first so we can include the name of the attendee
1168
-		$attendee = $this->get_first_related( 'Attendee' );
1169
-		if ( $attendee instanceof EE_Attendee ) {
1170
-			if ( $error ) {
1171
-				return sprintf( __( "%s's check-in status was not changed.", "event_espresso" ), $attendee->full_name() );
1168
+		$attendee = $this->get_first_related('Attendee');
1169
+		if ($attendee instanceof EE_Attendee) {
1170
+			if ($error) {
1171
+				return sprintf(__("%s's check-in status was not changed.", "event_espresso"), $attendee->full_name());
1172 1172
 			}
1173
-			$cur_status = $this->check_in_status_for_datetime( $DTT_ID );
1173
+			$cur_status = $this->check_in_status_for_datetime($DTT_ID);
1174 1174
 			//what is the status message going to be?
1175
-			switch ( $cur_status ) {
1175
+			switch ($cur_status) {
1176 1176
 				case EE_Registration::checkin_status_never :
1177
-					return sprintf( __( "%s has been removed from Check-in records", "event_espresso" ), $attendee->full_name() );
1177
+					return sprintf(__("%s has been removed from Check-in records", "event_espresso"), $attendee->full_name());
1178 1178
 					break;
1179 1179
 				case EE_Registration::checkin_status_in :
1180
-					return sprintf( __( '%s has been checked in', 'event_espresso' ), $attendee->full_name() );
1180
+					return sprintf(__('%s has been checked in', 'event_espresso'), $attendee->full_name());
1181 1181
 					break;
1182 1182
 				case EE_Registration::checkin_status_out :
1183
-					return sprintf( __( '%s has been checked out', 'event_espresso' ), $attendee->full_name() );
1183
+					return sprintf(__('%s has been checked out', 'event_espresso'), $attendee->full_name());
1184 1184
 					break;
1185 1185
 			}
1186 1186
 		}
1187
-		return __( "The check-in status could not be determined.", "event_espresso" );
1187
+		return __("The check-in status could not be determined.", "event_espresso");
1188 1188
 	}
1189 1189
 
1190 1190
 
@@ -1194,7 +1194,7 @@  discard block
 block discarded – undo
1194 1194
 	 * @return EE_Transaction
1195 1195
 	 */
1196 1196
 	public function transaction() {
1197
-		return $this->get_first_related( 'Transaction' );
1197
+		return $this->get_first_related('Transaction');
1198 1198
 	}
1199 1199
 
1200 1200
 
@@ -1205,7 +1205,7 @@  discard block
 block discarded – undo
1205 1205
 	 * @access        public
1206 1206
 	 */
1207 1207
 	public function reg_code() {
1208
-		return $this->get( 'REG_code' );
1208
+		return $this->get('REG_code');
1209 1209
 	}
1210 1210
 
1211 1211
 
@@ -1215,7 +1215,7 @@  discard block
 block discarded – undo
1215 1215
 	 * @access        public
1216 1216
 	 */
1217 1217
 	public function transaction_ID() {
1218
-		return $this->get( 'TXN_ID' );
1218
+		return $this->get('TXN_ID');
1219 1219
 	}
1220 1220
 
1221 1221
 
@@ -1224,7 +1224,7 @@  discard block
 block discarded – undo
1224 1224
 	 * @return int
1225 1225
 	 */
1226 1226
 	public function ticket_ID() {
1227
-		return $this->get( 'TKT_ID' );
1227
+		return $this->get('TKT_ID');
1228 1228
 	}
1229 1229
 
1230 1230
 
@@ -1236,17 +1236,17 @@  discard block
 block discarded – undo
1236 1236
 	 * @param    string $REG_code Registration Code
1237 1237
 	 * @param	boolean $use_default
1238 1238
 	 */
1239
-	public function set_reg_code( $REG_code, $use_default = FALSE ) {
1240
-		if ( empty( $REG_code )) {
1241
-			EE_Error::add_error( __( 'REG_code can not be empty.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1239
+	public function set_reg_code($REG_code, $use_default = FALSE) {
1240
+		if (empty($REG_code)) {
1241
+			EE_Error::add_error(__('REG_code can not be empty.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1242 1242
 			return;
1243 1243
 		}
1244
-		if ( ! $this->reg_code() ) {
1245
-			parent::set( 'REG_code', $REG_code, $use_default );
1244
+		if ( ! $this->reg_code()) {
1245
+			parent::set('REG_code', $REG_code, $use_default);
1246 1246
 		} else {
1247 1247
 			EE_Error::doing_it_wrong(
1248
-				__CLASS__ . '::' . __FUNCTION__,
1249
-				__( 'Can not change a registration REG_code once it has been set.', 'event_espresso' ),
1248
+				__CLASS__.'::'.__FUNCTION__,
1249
+				__('Can not change a registration REG_code once it has been set.', 'event_espresso'),
1250 1250
 				'4.6.0'
1251 1251
 			);
1252 1252
 		}
@@ -1266,17 +1266,17 @@  discard block
 block discarded – undo
1266 1266
 	 * @return EE_Registration[]  or empty array if this isn't a group registration.
1267 1267
 	 */
1268 1268
 	public function get_all_other_registrations_in_group() {
1269
-		if ( $this->group_size() < 2 ) {
1269
+		if ($this->group_size() < 2) {
1270 1270
 			return array();
1271 1271
 		}
1272 1272
 
1273 1273
 		$query[0] = array(
1274 1274
 			'TXN_ID' => $this->transaction_ID(),
1275
-			'REG_ID' => array( '!=', $this->ID() ),
1275
+			'REG_ID' => array('!=', $this->ID()),
1276 1276
 			'TKT_ID' => $this->ticket_ID()
1277 1277
 			);
1278 1278
 
1279
-		$registrations = $this->get_model()->get_all( $query );
1279
+		$registrations = $this->get_model()->get_all($query);
1280 1280
 		return $registrations;
1281 1281
 	}
1282 1282
 
@@ -1288,7 +1288,7 @@  discard block
 block discarded – undo
1288 1288
 	 * @access 	public
1289 1289
 	 */
1290 1290
 	public function price_paid() {
1291
-		EE_Error::doing_it_wrong( 'EE_Registration::price_paid()', __( 'This method is deprecated, please use EE_Registration::final_price() instead.', 'event_espresso' ), '4.7.0' );
1291
+		EE_Error::doing_it_wrong('EE_Registration::price_paid()', __('This method is deprecated, please use EE_Registration::final_price() instead.', 'event_espresso'), '4.7.0');
1292 1292
 		return $this->final_price();
1293 1293
 	}
1294 1294
 
@@ -1300,9 +1300,9 @@  discard block
 block discarded – undo
1300 1300
 	 * @access    public
1301 1301
 	 * @param    float $REG_final_price
1302 1302
 	 */
1303
-	public function set_price_paid( $REG_final_price = 0.00 ) {
1304
-		EE_Error::doing_it_wrong( 'EE_Registration::set_price_paid()', __( 'This method is deprecated, please use EE_Registration::set_final_price() instead.', 'event_espresso' ), '4.7.0' );
1305
-		$this->set_final_price( $REG_final_price );
1303
+	public function set_price_paid($REG_final_price = 0.00) {
1304
+		EE_Error::doing_it_wrong('EE_Registration::set_price_paid()', __('This method is deprecated, please use EE_Registration::set_final_price() instead.', 'event_espresso'), '4.7.0');
1305
+		$this->set_final_price($REG_final_price);
1306 1306
 	}
1307 1307
 
1308 1308
 
@@ -1313,7 +1313,7 @@  discard block
 block discarded – undo
1313 1313
 	 * @return string
1314 1314
 	 */
1315 1315
 	public function pretty_price_paid() {
1316
-		EE_Error::doing_it_wrong( 'EE_Registration::pretty_price_paid()', __( 'This method is deprecated, please use EE_Registration::pretty_final_price() instead.', 'event_espresso' ), '4.7.0' );
1316
+		EE_Error::doing_it_wrong('EE_Registration::pretty_price_paid()', __('This method is deprecated, please use EE_Registration::pretty_final_price() instead.', 'event_espresso'), '4.7.0');
1317 1317
 		return $this->pretty_final_price();
1318 1318
 	}
1319 1319
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -649,8 +649,9 @@
 block discarded – undo
649 649
 	 * @return EE_Registration
650 650
 	 */
651 651
 	public function get_primary_registration()  {
652
-		if ( $this->is_primary_registrant() )
653
-			return $this;
652
+		if ( $this->is_primary_registrant() ) {
653
+					return $this;
654
+		}
654 655
 
655 656
 		//k reg_count !== 1 so let's get the EE_Registration object matching this txn_id and reg_count == 1
656 657
 		$primary_registrant = EEM_Registration::instance()->get_one( array( array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1 ) ) );
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -618,9 +618,9 @@
 block discarded – undo
618 618
 
619 619
 
620 620
 	/**
621
-	*		get  Attendee Number
622
-	* 		@access		public
623
-	*/
621
+	 *		get  Attendee Number
622
+	 * 		@access		public
623
+	 */
624 624
 	public function count() {
625 625
 		return $this->get( 'REG_count' );
626 626
 	}
Please login to merge, or discard this patch.
Doc Comments   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 	 * the registration's share of the transaction total, so that the
683 683
 	 * sum of all the transaction's REG_final_prices equal the transaction's total
684 684
 	 * @access        public
685
-	 * @return    float
685
+	 * @return    boolean
686 686
 	 */
687 687
 	public function final_price() {
688 688
 		return $this->get( 'REG_final_price' );
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
 	/**
705 705
 	 * get paid (yeah)
706 706
 	 * @access        public
707
-	 * @return 	float
707
+	 * @return 	boolean
708 708
 	 */
709 709
 	public function paid() {
710 710
 		return $this->get( 'REG_paid' );
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
 	/**
869 869
 	 * Sets deleted
870 870
 	 * @param boolean $deleted
871
-	 * @return boolean
871
+	 * @return boolean|null
872 872
 	 */
873 873
 	public function set_deleted($deleted) {
874 874
 		$this->set( 'REG_deleted', $deleted );
@@ -912,6 +912,7 @@  discard block
 block discarded – undo
912 912
 	 *
913 913
 	 * @param int | EE_Datetime $DTT_OR_ID The datetime the registration is being checked against
914 914
 	 * @param bool   $check_approved   This is used to indicate whether the caller wants can_checkin to also consider registration status as well as datetime access.
915
+	 * @param integer $DTT_OR_ID
915 916
 	 *
916 917
 	 * @return bool
917 918
 	 */
@@ -1150,7 +1151,7 @@  discard block
 block discarded – undo
1150 1151
 
1151 1152
 
1152 1153
 	/**
1153
-	 * @return int
1154
+	 * @return boolean
1154 1155
 	 */
1155 1156
 	public function ticket_ID() {
1156 1157
 		return $this->get( 'TKT_ID' );
Please login to merge, or discard this patch.
line_item_filters/EE_Specific_Registrations_Line_Item_Filter.class.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@
 block discarded – undo
18 18
  */
19 19
 class EE_Specific_Registrations_Line_Item_Filter extends EE_Line_Item_Filter_Base {
20 20
 /**
21
-	 * array of line item codes and their corresponding quantities for registrations
22
-	 *
21
+ * array of line item codes and their corresponding quantities for registrations
22
+ *
23 23
 *@type array $_line_item_registrations
24
-	 */
24
+ */
25 25
 	protected $_line_item_registrations = array();
26 26
 
27 27
 	/**
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 
6 6
 /**
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	 * EE_Billable_Line_Item_Filter constructor.
43 43
 	 * @param EE_Registration[] $registrations
44 44
 	 */
45
-	public function __construct( $registrations ) {
45
+	public function __construct($registrations) {
46 46
 		$this->_registrations = $registrations;
47
-		$this->_calculate_registrations_per_line_item_code( $registrations );
47
+		$this->_calculate_registrations_per_line_item_code($registrations);
48 48
 		// these reg statuses should NOT increment the line item quantity
49 49
 		$this->_closed_reg_statuses = EEM_Registration::closed_reg_statuses();
50 50
 	}
@@ -55,20 +55,20 @@  discard block
 block discarded – undo
55 55
 	 * @param EE_Registration[] $registrations
56 56
 	 * @return void
57 57
 	 */
58
-	protected function _calculate_registrations_per_line_item_code( $registrations ) {
59
-		foreach( $registrations as $registration ) {
58
+	protected function _calculate_registrations_per_line_item_code($registrations) {
59
+		foreach ($registrations as $registration) {
60 60
 			$line_item_code = EEM_Line_Item::instance()->get_var(
61 61
 				EEM_Line_Item::instance()->line_item_for_registration_query_params(
62 62
 					$registration,
63
-					array( 'limit' => 1 )
63
+					array('limit' => 1)
64 64
 				),
65 65
 				'LIN_code'
66 66
 			);
67
-			if( $line_item_code ) {
68
-				if( ! isset( $this->_line_item_registrations[ $line_item_code ] ) ) {
69
-					$this->_line_item_registrations[ $line_item_code ] = array();
67
+			if ($line_item_code) {
68
+				if ( ! isset($this->_line_item_registrations[$line_item_code])) {
69
+					$this->_line_item_registrations[$line_item_code] = array();
70 70
 				}
71
-				$this->_line_item_registrations[ $line_item_code ][ $registration->ID() ] = $registration;
71
+				$this->_line_item_registrations[$line_item_code][$registration->ID()] = $registration;
72 72
 			}
73 73
 		}
74 74
 	}
@@ -81,61 +81,61 @@  discard block
 block discarded – undo
81 81
 	 * @param EEI_Line_Item      $line_item
82 82
 	 * @return \EEI_Line_Item
83 83
 	 */
84
-	public function process( EEI_Line_Item $line_item ) {
85
-		$this->_adjust_line_item_quantity( $line_item );
86
-		if( ! $line_item->children() ) {
84
+	public function process(EEI_Line_Item $line_item) {
85
+		$this->_adjust_line_item_quantity($line_item);
86
+		if ( ! $line_item->children()) {
87 87
 			return $line_item;
88 88
 		}
89 89
 		//the original running total (taking ALL tickets into account)
90 90
 		$running_total_of_children = 0;
91 91
 		//the new running total (only taking the specified ticket quantities into account)
92 92
 		$running_total_of_children_under_consideration = 0;
93
-		foreach ( $line_item->children() as $child_line_item ) {
94
-			if( $child_line_item->is_percent() ) {
93
+		foreach ($line_item->children() as $child_line_item) {
94
+			if ($child_line_item->is_percent()) {
95 95
 				$original_li_total = $running_total_of_children * $child_line_item->percent() / 100;
96
-			}else{
96
+			} else {
97 97
 				$original_li_total = $child_line_item->unit_price() * $child_line_item->quantity();
98 98
 			}
99 99
 
100
-			$this->process( $child_line_item );
100
+			$this->process($child_line_item);
101 101
 			/*
102 102
 			 * If this line item is a normal line item that isn't for a ticket
103 103
 			 * we want to modify its total (and unit price if not a percentage line item)
104 104
 			 * so it reflects only that portion of the surcharge/discount shared by these
105 105
 			 * registrations
106 106
 			 */
107
-			if(
107
+			if (
108 108
 				$child_line_item->type() === EEM_Line_Item::type_line_item
109 109
 				&& $child_line_item->OBJ_type() !== 'Ticket'
110 110
 			) {
111
-				if( $running_total_of_children ) {
111
+				if ($running_total_of_children) {
112 112
 					$percent_of_running_total = $original_li_total / $running_total_of_children;
113 113
 				} else {
114 114
 					$percent_of_running_total = 0;
115 115
 				}
116 116
 
117
-				$child_line_item->set_total( $running_total_of_children_under_consideration * $percent_of_running_total );
118
-				if( ! $child_line_item->is_percent() ) {
119
-					$child_line_item->set_unit_price( $child_line_item->total() / $child_line_item->quantity() );
117
+				$child_line_item->set_total($running_total_of_children_under_consideration * $percent_of_running_total);
118
+				if ( ! $child_line_item->is_percent()) {
119
+					$child_line_item->set_unit_price($child_line_item->total() / $child_line_item->quantity());
120 120
 				}
121 121
 			} else if (
122 122
 				$line_item->type() === EEM_Line_Item::type_line_item
123 123
 				&& $line_item->OBJ_type() === 'Ticket'
124 124
 			) {
125 125
 				//make sure this item's quantity matches its parent
126
-				if( ! $child_line_item->is_percent() ) {
127
-					$child_line_item->set_quantity( $line_item->quantity() );
128
-					$child_line_item->set_total( $child_line_item->unit_price() * $child_line_item->quantity() );
126
+				if ( ! $child_line_item->is_percent()) {
127
+					$child_line_item->set_quantity($line_item->quantity());
128
+					$child_line_item->set_total($child_line_item->unit_price() * $child_line_item->quantity());
129 129
 				}
130 130
 			}
131 131
 			$running_total_of_children += $original_li_total;
132 132
 			$running_total_of_children_under_consideration += $child_line_item->total();
133 133
 		}
134
-		$line_item->set_total( $running_total_of_children_under_consideration );
135
-		if( $line_item->quantity() ) {
136
-			$line_item->set_unit_price( $running_total_of_children_under_consideration / $line_item->quantity() );
134
+		$line_item->set_total($running_total_of_children_under_consideration);
135
+		if ($line_item->quantity()) {
136
+			$line_item->set_unit_price($running_total_of_children_under_consideration / $line_item->quantity());
137 137
 		} else {
138
-			$line_item->set_unit_price( 0 );
138
+			$line_item->set_unit_price(0);
139 139
 		}
140 140
 		return $line_item;
141 141
 	}
@@ -148,27 +148,27 @@  discard block
 block discarded – undo
148 148
 	 * @param EEI_Line_Item $line_item
149 149
 	 * @return EEI_Line_Item
150 150
 	 */
151
-	protected function _adjust_line_item_quantity( EEI_Line_Item $line_item ) {
151
+	protected function _adjust_line_item_quantity(EEI_Line_Item $line_item) {
152 152
 		// is this a ticket ?
153
-		if ( $line_item->type() === EEM_Line_Item::type_line_item && $line_item->OBJ_type() == 'Ticket' ) {
153
+		if ($line_item->type() === EEM_Line_Item::type_line_item && $line_item->OBJ_type() == 'Ticket') {
154 154
 			$quantity = 0;
155 155
 			// if this ticket is billable at this moment, then we should have a positive quantity
156 156
 			if (
157
-				isset( $this->_line_item_registrations[ $line_item->code() ] )
158
-				&& is_array( $this->_line_item_registrations[ $line_item->code() ] )
157
+				isset($this->_line_item_registrations[$line_item->code()])
158
+				&& is_array($this->_line_item_registrations[$line_item->code()])
159 159
 			) {
160 160
 				// set quantity based on number of open registrations for this ticket
161
-				foreach ( $this->_line_item_registrations[ $line_item->code() ] as $registration ) {
161
+				foreach ($this->_line_item_registrations[$line_item->code()] as $registration) {
162 162
 					if (
163 163
 						$registration instanceof EE_Registration
164
-						&& ! in_array( $registration->status_ID(), $this->_closed_reg_statuses )
164
+						&& ! in_array($registration->status_ID(), $this->_closed_reg_statuses)
165 165
 					) {
166 166
 						$quantity++;
167 167
 					}
168 168
 				}
169 169
 			}
170
-			$line_item->set_quantity( $quantity );
171
-			$line_item->set_total( $line_item->unit_price() * $line_item->quantity() );
170
+			$line_item->set_quantity($quantity);
171
+			$line_item->set_total($line_item->unit_price() * $line_item->quantity());
172 172
 		}
173 173
 		return $line_item;
174 174
 	}
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 		if( $normalized_value ){
34 34
 			if (filter_var($normalized_value, FILTER_VALIDATE_URL) === false){
35 35
 				throw new EE_Validation_Error( $this->get_validation_error_message(), 'invalid_url');
36
-			}else{
36
+			} else{
37 37
 				EE_Registry::instance()->load_helper('URL');
38 38
 				if( ! EEH_URL::remote_file_exists(
39 39
 						$normalized_value,
Please login to merge, or discard this patch.
caffeinated/modules/recaptcha/ReCaptcha/RequestMethod/Post.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -34,37 +34,37 @@
 block discarded – undo
34 34
  */
35 35
 class Post implements RequestMethod
36 36
 {
37
-    /**
38
-     * URL to which requests are POSTed.
39
-     * @const string
40
-     */
41
-    const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify';
37
+	/**
38
+	 * URL to which requests are POSTed.
39
+	 * @const string
40
+	 */
41
+	const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify';
42 42
 
43
-    /**
44
-     * Submit the POST request with the specified parameters.
45
-     *
46
-     * @param RequestParameters $params Request parameters
47
-     * @return string Body of the reCAPTCHA response
48
-     */
49
-    public function submit(RequestParameters $params)
50
-    {
51
-        /**
52
-         * PHP 5.6.0 changed the way you specify the peer name for SSL context options.
53
-         * Using "CN_name" will still work, but it will raise deprecated errors.
54
-         */
55
-        $peer_key = version_compare(PHP_VERSION, '5.6.0', '<') ? 'CN_name' : 'peer_name';
56
-        $options = array(
57
-            'http' => array(
58
-                'header' => "Content-type: application/x-www-form-urlencoded\r\n",
59
-                'method' => 'POST',
60
-                'content' => $params->toQueryString(),
61
-                // Force the peer to validate (not needed in 5.6.0+, but still works
62
-                'verify_peer' => true,
63
-                // Force the peer validation to use www.google.com
64
-                $peer_key => 'www.google.com',
65
-            ),
66
-        );
67
-        $context = stream_context_create($options);
68
-        return file_get_contents(self::SITE_VERIFY_URL, false, $context);
69
-    }
43
+	/**
44
+	 * Submit the POST request with the specified parameters.
45
+	 *
46
+	 * @param RequestParameters $params Request parameters
47
+	 * @return string Body of the reCAPTCHA response
48
+	 */
49
+	public function submit(RequestParameters $params)
50
+	{
51
+		/**
52
+		 * PHP 5.6.0 changed the way you specify the peer name for SSL context options.
53
+		 * Using "CN_name" will still work, but it will raise deprecated errors.
54
+		 */
55
+		$peer_key = version_compare(PHP_VERSION, '5.6.0', '<') ? 'CN_name' : 'peer_name';
56
+		$options = array(
57
+			'http' => array(
58
+				'header' => "Content-type: application/x-www-form-urlencoded\r\n",
59
+				'method' => 'POST',
60
+				'content' => $params->toQueryString(),
61
+				// Force the peer to validate (not needed in 5.6.0+, but still works
62
+				'verify_peer' => true,
63
+				// Force the peer validation to use www.google.com
64
+				$peer_key => 'www.google.com',
65
+			),
66
+		);
67
+		$context = stream_context_create($options);
68
+		return file_get_contents(self::SITE_VERIFY_URL, false, $context);
69
+	}
70 70
 }
Please login to merge, or discard this patch.
caffeinated/modules/recaptcha/ReCaptcha/RequestMethod.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@
 block discarded – undo
32 32
 interface RequestMethod
33 33
 {
34 34
 
35
-    /**
36
-     * Submit the request with the specified parameters.
37
-     *
38
-     * @param RequestParameters $params Request parameters
39
-     * @return string Body of the reCAPTCHA response
40
-     */
41
-    public function submit(RequestParameters $params);
35
+	/**
36
+	 * Submit the request with the specified parameters.
37
+	 *
38
+	 * @param RequestParameters $params Request parameters
39
+	 * @return string Body of the reCAPTCHA response
40
+	 */
41
+	public function submit(RequestParameters $params);
42 42
 }
Please login to merge, or discard this patch.
caffeinated/modules/recaptcha/ReCaptcha/RequestMethod/Socket.php 1 patch
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -32,73 +32,73 @@
 block discarded – undo
32 32
  */
33 33
 class Socket
34 34
 {
35
-    private $handle = null;
35
+	private $handle = null;
36 36
 
37
-    /**
38
-     * fsockopen
39
-     * 
40
-     * @see http://php.net/fsockopen
41
-     * @param string $hostname
42
-     * @param int $port
43
-     * @param int $errno
44
-     * @param string $errstr
45
-     * @param float $timeout
46
-     * @return resource
47
-     */
48
-    public function fsockopen($hostname, $port = -1, &$errno = 0, &$errstr = '', $timeout = null)
49
-    {
50
-        $this->handle = fsockopen($hostname, $port, $errno, $errstr, (is_null($timeout) ? ini_get("default_socket_timeout") : $timeout));
37
+	/**
38
+	 * fsockopen
39
+	 * 
40
+	 * @see http://php.net/fsockopen
41
+	 * @param string $hostname
42
+	 * @param int $port
43
+	 * @param int $errno
44
+	 * @param string $errstr
45
+	 * @param float $timeout
46
+	 * @return resource
47
+	 */
48
+	public function fsockopen($hostname, $port = -1, &$errno = 0, &$errstr = '', $timeout = null)
49
+	{
50
+		$this->handle = fsockopen($hostname, $port, $errno, $errstr, (is_null($timeout) ? ini_get("default_socket_timeout") : $timeout));
51 51
 
52
-        if ($this->handle != false && $errno === 0 && $errstr === '') {
53
-            return $this->handle;
54
-        } else {
55
-            return false;
56
-        }
57
-    }
52
+		if ($this->handle != false && $errno === 0 && $errstr === '') {
53
+			return $this->handle;
54
+		} else {
55
+			return false;
56
+		}
57
+	}
58 58
 
59
-    /**
60
-     * fwrite
61
-     * 
62
-     * @see http://php.net/fwrite
63
-     * @param string $string
64
-     * @param int $length
65
-     * @return int | bool
66
-     */
67
-    public function fwrite($string, $length = null)
68
-    {
69
-        return fwrite($this->handle, $string, (is_null($length) ? strlen($string) : $length));
70
-    }
59
+	/**
60
+	 * fwrite
61
+	 * 
62
+	 * @see http://php.net/fwrite
63
+	 * @param string $string
64
+	 * @param int $length
65
+	 * @return int | bool
66
+	 */
67
+	public function fwrite($string, $length = null)
68
+	{
69
+		return fwrite($this->handle, $string, (is_null($length) ? strlen($string) : $length));
70
+	}
71 71
 
72
-    /**
73
-     * fgets
74
-     * 
75
-     * @see http://php.net/fgets
76
-     * @param int $length
77
-     */
78
-    public function fgets($length = null)
79
-    {
80
-        return fgets($this->handle, $length);
81
-    }
72
+	/**
73
+	 * fgets
74
+	 * 
75
+	 * @see http://php.net/fgets
76
+	 * @param int $length
77
+	 */
78
+	public function fgets($length = null)
79
+	{
80
+		return fgets($this->handle, $length);
81
+	}
82 82
 
83
-    /**
84
-     * feof
85
-     * 
86
-     * @see http://php.net/feof
87
-     * @return bool
88
-     */
89
-    public function feof()
90
-    {
91
-        return feof($this->handle);
92
-    }
83
+	/**
84
+	 * feof
85
+	 * 
86
+	 * @see http://php.net/feof
87
+	 * @return bool
88
+	 */
89
+	public function feof()
90
+	{
91
+		return feof($this->handle);
92
+	}
93 93
 
94
-    /**
95
-     * fclose
96
-     * 
97
-     * @see http://php.net/fclose
98
-     * @return bool
99
-     */
100
-    public function fclose()
101
-    {
102
-        return fclose($this->handle);
103
-    }
94
+	/**
95
+	 * fclose
96
+	 * 
97
+	 * @see http://php.net/fclose
98
+	 * @return bool
99
+	 */
100
+	public function fclose()
101
+	{
102
+		return fclose($this->handle);
103
+	}
104 104
 }
Please login to merge, or discard this patch.
admin/extend/events/templates/event_type_metabox_contents.template.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@
 block discarded – undo
4 4
 	</ul>
5 5
 	<div id="espresso_event_type-all" class="tabs-panel">
6 6
 		<?php
7
-        $name = 'tax_input[espresso_event_type]';
8
-        echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
9
-        ?>
7
+		$name = 'tax_input[espresso_event_type]';
8
+		echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
9
+		?>
10 10
 		<ul id="espresso_event_typechecklist" data-wp-lists="list:espresso_event_type" class="categorychecklist form-no-clear">
11 11
 			<?php echo $radio_list; ?>
12 12
 		</ul>
Please login to merge, or discard this patch.