Completed
Branch FET/10766/extract-activation-d... (f6eee0)
by
unknown
13:03 queued 10:52
created
core/db_classes/EE_Export.class.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -500,11 +500,11 @@
 block discarded – undo
500 500
 					}else{
501 501
 						$question_label = sprintf( __( 'Question $s', 'event_espresso' ), $answer_row[ 'Answer.QST_ID' ] );
502 502
 					}
503
-                                        if( isset( $answer_row[ 'Question.QST_type'] ) && $answer_row[ 'Question.QST_type' ] == EEM_Question::QST_type_state ) {
504
-                                            $reg_csv_array[ $question_label ] = EEM_State::instance()->get_state_name_by_ID( $answer_row[ 'Answer.ANS_value' ] );
505
-                                        } else {
506
-                                            $reg_csv_array[ $question_label ] = $this->_prepare_value_from_db_for_display( EEM_Answer::instance(), 'ANS_value', $answer_row[ 'Answer.ANS_value' ] );
507
-                                        }
503
+										if( isset( $answer_row[ 'Question.QST_type'] ) && $answer_row[ 'Question.QST_type' ] == EEM_Question::QST_type_state ) {
504
+											$reg_csv_array[ $question_label ] = EEM_State::instance()->get_state_name_by_ID( $answer_row[ 'Answer.ANS_value' ] );
505
+										} else {
506
+											$reg_csv_array[ $question_label ] = $this->_prepare_value_from_db_for_display( EEM_Answer::instance(), 'ANS_value', $answer_row[ 'Answer.ANS_value' ] );
507
+										}
508 508
 				}
509 509
 				$registrations_csv_ready_array[] = apply_filters( 'FHEE__EE_Export__report_registrations__reg_csv_array', $reg_csv_array, $reg_row );
510 510
 			}
Please login to merge, or discard this patch.
Spacing   +170 added lines, -170 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2
-do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2
+do_action('AHEE_log', __FILE__, __FUNCTION__, '');
3 3
 /**
4 4
  * EE_Export class
5 5
  * 
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 	  * @access private
40 40
 	  * @param array $request_data
41 41
 	  */
42
- 	private function __construct( $request_data = array() ) {
42
+ 	private function __construct($request_data = array()) {
43 43
 		$this->_req_data = $request_data;
44
-		$this->today = date("Y-m-d",time());
45
-		require_once( EE_CLASSES . 'EE_CSV.class.php' );
46
-		$this->EE_CSV= EE_CSV::instance();
44
+		$this->today = date("Y-m-d", time());
45
+		require_once(EE_CLASSES.'EE_CSV.class.php');
46
+		$this->EE_CSV = EE_CSV::instance();
47 47
 	}
48 48
 
49 49
 
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 	  * @param array $request_data
56 56
 	  * @return \EE_Export
57 57
 	  */
58
-	public static function instance( $request_data = array() ) {
58
+	public static function instance($request_data = array()) {
59 59
 		// check if class object is instantiated
60
-		if ( self::$_instance === NULL  or ! is_object( self::$_instance ) or ! ( self::$_instance instanceof EE_Export )) {
61
-			self::$_instance = new self( $request_data );
60
+		if (self::$_instance === NULL or ! is_object(self::$_instance) or ! (self::$_instance instanceof EE_Export)) {
61
+			self::$_instance = new self($request_data);
62 62
 		}
63 63
 		return self::$_instance;
64 64
 	}
@@ -72,15 +72,15 @@  discard block
 block discarded – undo
72 72
 	public function export() {
73 73
 
74 74
 		// in case of bulk exports, the "actual" action will be in action2, but first check regular action for "export" keyword
75
-		if ( isset( $this->_req_data['action'] ) && strpos( $this->_req_data['action'], 'export' ) === FALSE ) {
75
+		if (isset($this->_req_data['action']) && strpos($this->_req_data['action'], 'export') === FALSE) {
76 76
 			// check if action2 has export action
77
-			if ( isset( $this->_req_data['action2'] ) && strpos( $this->_req_data['action2'], 'export' ) !== FALSE ) {
77
+			if (isset($this->_req_data['action2']) && strpos($this->_req_data['action2'], 'export') !== FALSE) {
78 78
 				// whoop! there it is!
79 79
 				$this->_req_data['action'] = $this->_req_data['action2'];
80 80
 			}
81 81
 		}
82 82
 
83
-		$this->_req_data['export'] = isset( $this->_req_data['export'] ) ? $this->_req_data['export'] : '';
83
+		$this->_req_data['export'] = isset($this->_req_data['export']) ? $this->_req_data['export'] : '';
84 84
 
85 85
 		switch ($this->_req_data['export']) {
86 86
 			case 'report':
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 					break;
95 95
 
96 96
 					case 'registrations_report_for_event':
97
-						$this->report_registrations_for_event( $this->_req_data['EVT_ID'] );
97
+						$this->report_registrations_for_event($this->_req_data['EVT_ID']);
98 98
 					break;
99 99
 
100 100
 					case 'attendees':
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 					break;
107 107
 
108 108
 					default:
109
-						EE_Error::add_error(__('An error occurred! The requested export report could not be found.','event_espresso'), __FILE__, __FUNCTION__, __LINE__ ) ;
109
+						EE_Error::add_error(__('An error occurred! The requested export report could not be found.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
110 110
 						return FALSE;
111 111
 					break;
112 112
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	 * Downloads a CSV file with all the columns, but no data. This should be used for importing
125 125
 	 * @return null kills execution
126 126
 	 */
127
-	function export_sample(){
127
+	function export_sample() {
128 128
 		$event = EEM_Event::instance()->get_one();
129 129
 		$this->_req_data['EVT_ID'] = $event->ID();
130 130
 		$this->export_all_event_data();
@@ -150,23 +150,23 @@  discard block
 block discarded – undo
150 150
 		$state_country_query_params = array();
151 151
 		$question_group_query_params = array();
152 152
 		$question_query_params = array();
153
-		if ( isset( $this->_req_data['EVT_ID'] )) {
153
+		if (isset($this->_req_data['EVT_ID'])) {
154 154
 			// do we have an array of IDs ?
155 155
 
156
-			if ( is_array( $this->_req_data['EVT_ID'] )) {
157
-				$EVT_IDs =  array_map( 'sanitize_text_field', $this->_req_data['EVT_ID'] );
158
-				$value_to_equal = array('IN',$EVT_IDs);
156
+			if (is_array($this->_req_data['EVT_ID'])) {
157
+				$EVT_IDs = array_map('sanitize_text_field', $this->_req_data['EVT_ID']);
158
+				$value_to_equal = array('IN', $EVT_IDs);
159 159
 				$filename = 'events';
160 160
 			} else {
161 161
 				// generate regular where = clause
162
-				$EVT_ID = absint( $this->_req_data['EVT_ID'] );
162
+				$EVT_ID = absint($this->_req_data['EVT_ID']);
163 163
 				$value_to_equal = $EVT_ID;
164 164
 				$event = EE_Registry::instance()->load_model('Event')->get_one_by_ID($EVT_ID);
165 165
 
166
-				$filename = 'event-' . ( $event instanceof EE_Event ? $event->slug() : __( 'unknown', 'event_espresso' ) );
166
+				$filename = 'event-'.($event instanceof EE_Event ? $event->slug() : __('unknown', 'event_espresso'));
167 167
 
168 168
 			}
169
-			$event_query_params[0]['EVT_ID'] =$value_to_equal;
169
+			$event_query_params[0]['EVT_ID'] = $value_to_equal;
170 170
 			$related_models_query_params[0]['Event.EVT_ID'] = $value_to_equal;
171 171
 			$related_through_reg_query_params[0]['Registration.EVT_ID'] = $value_to_equal;
172 172
 			$datetime_ticket_query_params[0]['Datetime.EVT_ID'] = $value_to_equal;
@@ -210,42 +210,42 @@  discard block
 block discarded – undo
210 210
 
211 211
 			);
212 212
 
213
-		$model_data = $this->_get_export_data_for_models( $models_to_export );
213
+		$model_data = $this->_get_export_data_for_models($models_to_export);
214 214
 
215
-		$filename = $this->generate_filename ( $filename );
215
+		$filename = $this->generate_filename($filename);
216 216
 
217
-		if ( ! $this->EE_CSV->export_multiple_model_data_to_csv( $filename, $model_data )) {
218
-			EE_Error::add_error(__("'An error occurred and the Event details could not be exported from the database.'", "event_espresso"), __FILE__, __FUNCTION__, __LINE__ );
217
+		if ( ! $this->EE_CSV->export_multiple_model_data_to_csv($filename, $model_data)) {
218
+			EE_Error::add_error(__("'An error occurred and the Event details could not be exported from the database.'", "event_espresso"), __FILE__, __FUNCTION__, __LINE__);
219 219
 		}
220 220
 	}
221 221
 
222
-	function report_attendees(){
222
+	function report_attendees() {
223 223
 		$attendee_rows = EEM_Attendee::instance()->get_all_wpdb_results( 
224 224
 			array( 
225
-				'force_join' => array( 'State', 'Country' ), 
225
+				'force_join' => array('State', 'Country'), 
226 226
 				'caps' => EEM_Base::caps_read_admin 
227 227
 			) 
228 228
 		);
229 229
 		$csv_data = array();
230
-		foreach( $attendee_rows as $attendee_row ){
230
+		foreach ($attendee_rows as $attendee_row) {
231 231
 			$csv_row = array();
232
-			foreach( EEM_Attendee::instance()->field_settings() as $field_name => $field_obj ){
233
-				if( $field_name == 'STA_ID' ){
234
-					$state_name_field = EEM_State::instance()->field_settings_for( 'STA_name' );
235
-					$csv_row[ __( 'State', 'event_espresso' ) ] = $attendee_row[ $state_name_field->get_qualified_column() ];
236
-				}elseif( $field_name == 'CNT_ISO' ){
237
-					$country_name_field = EEM_Country::instance()->field_settings_for( 'CNT_name' );
238
-					$csv_row[ __( 'Country', 'event_espresso' ) ] = $attendee_row[ $country_name_field->get_qualified_column() ];
239
-				}else{
240
-					$csv_row[ $field_obj->get_nicename() ] = $attendee_row[ $field_obj->get_qualified_column() ];
232
+			foreach (EEM_Attendee::instance()->field_settings() as $field_name => $field_obj) {
233
+				if ($field_name == 'STA_ID') {
234
+					$state_name_field = EEM_State::instance()->field_settings_for('STA_name');
235
+					$csv_row[__('State', 'event_espresso')] = $attendee_row[$state_name_field->get_qualified_column()];
236
+				}elseif ($field_name == 'CNT_ISO') {
237
+					$country_name_field = EEM_Country::instance()->field_settings_for('CNT_name');
238
+					$csv_row[__('Country', 'event_espresso')] = $attendee_row[$country_name_field->get_qualified_column()];
239
+				} else {
240
+					$csv_row[$field_obj->get_nicename()] = $attendee_row[$field_obj->get_qualified_column()];
241 241
 				}
242 242
 			}
243 243
 			$csv_data[] = $csv_row;
244 244
 		}
245 245
 
246
-		$filename = $this->generate_filename ( 'contact-list-report' );
246
+		$filename = $this->generate_filename('contact-list-report');
247 247
 
248
-		$handle = $this->EE_CSV->begin_sending_csv( $filename);
248
+		$handle = $this->EE_CSV->begin_sending_csv($filename);
249 249
 		$this->EE_CSV->write_data_array_to_csv($handle, $csv_data);
250 250
 		$this->EE_CSV->end_sending_csv($handle);
251 251
 	}
@@ -262,18 +262,18 @@  discard block
 block discarded – undo
262 262
 		$countries_that_have_an_attendee = EEM_Country::instance()->get_all(array(0=>array('Attendee.ATT_ID'=>array('IS NOT NULL'))));
263 263
 //		$states_to_export_query_params
264 264
 		$models_to_export = array(
265
-			'Country'=>array(array('CNT_ISO'=>array('IN',array_keys($countries_that_have_an_attendee)))),
266
-			'State'=>array(array('STA_ID'=>array('IN',array_keys($states_that_have_an_attendee)))),
265
+			'Country'=>array(array('CNT_ISO'=>array('IN', array_keys($countries_that_have_an_attendee)))),
266
+			'State'=>array(array('STA_ID'=>array('IN', array_keys($states_that_have_an_attendee)))),
267 267
 			'Attendee'=>array(),
268 268
 		);
269 269
 
270 270
 
271 271
 
272
-		$model_data = $this->_get_export_data_for_models( $models_to_export );
273
-		$filename = $this->generate_filename ( 'all-attendees' );
272
+		$model_data = $this->_get_export_data_for_models($models_to_export);
273
+		$filename = $this->generate_filename('all-attendees');
274 274
 
275
-		if ( ! $this->EE_CSV->export_multiple_model_data_to_csv( $filename, $model_data )) {
276
-			EE_Error::add_error(__('An error occurred and the Attendee data could not be exported from the database.','event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
275
+		if ( ! $this->EE_CSV->export_multiple_model_data_to_csv($filename, $model_data)) {
276
+			EE_Error::add_error(__('An error occurred and the Attendee data could not be exported from the database.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
277 277
 		}
278 278
 	}
279 279
 
@@ -285,19 +285,19 @@  discard block
 block discarded – undo
285 285
 	 * @param boolean|string $pretty_schema true to display pretty, a string to use a specific "Schema", or false to NOT display pretty
286 286
 	 * @return string
287 287
 	 */
288
-	protected function _prepare_value_from_db_for_display( $model, $field_name,  $raw_db_value, $pretty_schema = true ) {
289
-		$field_obj = $model->field_settings_for( $field_name );
290
-		$value_on_model_obj = $field_obj->prepare_for_set_from_db( $raw_db_value );
291
-		if( $field_obj instanceof EE_Datetime_Field ) {
292
-			$field_obj->set_date_format( EE_CSV::instance()->get_date_format_for_csv( $field_obj->get_date_format( $pretty_schema ) ), $pretty_schema );
293
-			$field_obj->set_time_format( EE_CSV::instance()->get_time_format_for_csv( $field_obj->get_time_format( $pretty_schema ) ), $pretty_schema );
288
+	protected function _prepare_value_from_db_for_display($model, $field_name, $raw_db_value, $pretty_schema = true) {
289
+		$field_obj = $model->field_settings_for($field_name);
290
+		$value_on_model_obj = $field_obj->prepare_for_set_from_db($raw_db_value);
291
+		if ($field_obj instanceof EE_Datetime_Field) {
292
+			$field_obj->set_date_format(EE_CSV::instance()->get_date_format_for_csv($field_obj->get_date_format($pretty_schema)), $pretty_schema);
293
+			$field_obj->set_time_format(EE_CSV::instance()->get_time_format_for_csv($field_obj->get_time_format($pretty_schema)), $pretty_schema);
294 294
 		}
295
-		if( $pretty_schema === true){
296
-			return $field_obj->prepare_for_pretty_echoing( $value_on_model_obj );
297
-		}elseif( is_string( $pretty_schema ) ) {
298
-			return $field_obj->prepare_for_pretty_echoing($value_on_model_obj, $pretty_schema );
299
-		}else{
300
-			return $field_obj->prepare_for_get( $value_on_model_obj );
295
+		if ($pretty_schema === true) {
296
+			return $field_obj->prepare_for_pretty_echoing($value_on_model_obj);
297
+		}elseif (is_string($pretty_schema)) {
298
+			return $field_obj->prepare_for_pretty_echoing($value_on_model_obj, $pretty_schema);
299
+		} else {
300
+			return $field_obj->prepare_for_get($value_on_model_obj);
301 301
 		}
302 302
 	}
303 303
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	 * and the questions associated with the registrations
307 307
 	 * @param int $event_id
308 308
 	 */
309
-	function report_registrations_for_event( $event_id = NULL ){
309
+	function report_registrations_for_event($event_id = NULL) {
310 310
 		$reg_fields_to_include = array(
311 311
 				'TXN_ID',
312 312
 				'ATT_ID',
@@ -338,126 +338,126 @@  discard block
 block discarded – undo
338 338
 				array(
339 339
 					'OR' => array(
340 340
 						//don't include registrations from failed or abandoned transactions...
341
-						'Transaction.STS_ID' => array( 'NOT IN', array( EEM_Transaction::failed_status_code, EEM_Transaction::abandoned_status_code ) ),
341
+						'Transaction.STS_ID' => array('NOT IN', array(EEM_Transaction::failed_status_code, EEM_Transaction::abandoned_status_code)),
342 342
 						//unless the registration is approved, in which case include it regardless of transaction status
343 343
 						'STS_ID' => EEM_Registration::status_id_approved
344 344
 						),
345
-					'Ticket.TKT_deleted' => array( 'IN', array( true, false ) )
345
+					'Ticket.TKT_deleted' => array('IN', array(true, false))
346 346
 					),
347
-				'order_by' => array('Transaction.TXN_ID'=>'asc','REG_count'=>'asc'),
348
-				'force_join' => array( 'Transaction', 'Ticket', 'Attendee' ),
347
+				'order_by' => array('Transaction.TXN_ID'=>'asc', 'REG_count'=>'asc'),
348
+				'force_join' => array('Transaction', 'Ticket', 'Attendee'),
349 349
 				'caps' => EEM_Base::caps_read_admin
350 350
 			),
351 351
 			$event_id
352 352
 		);
353
-		if( $event_id ){
354
-			$query_params[0]['EVT_ID'] =  $event_id;
355
-		}else{
356
-			$query_params[ 'force_join' ][] = 'Event';
353
+		if ($event_id) {
354
+			$query_params[0]['EVT_ID'] = $event_id;
355
+		} else {
356
+			$query_params['force_join'][] = 'Event';
357 357
 		}
358
-		$registration_rows = $reg_model->get_all_wpdb_results( $query_params );
358
+		$registration_rows = $reg_model->get_all_wpdb_results($query_params);
359 359
 		//get all questions which relate to someone in this group
360 360
 		$registration_ids = array();
361
-		foreach( $registration_rows as $reg_row ) {
362
-			$registration_ids[] = intval( $reg_row[ 'Registration.REG_ID'] );
361
+		foreach ($registration_rows as $reg_row) {
362
+			$registration_ids[] = intval($reg_row['Registration.REG_ID']);
363 363
 		}
364 364
 //		EEM_Question::instance()->show_next_x_db_queries();
365
-		$questions_for_these_regs_rows = EEM_Question::instance()->get_all_wpdb_results(array(array('Answer.REG_ID'=>array('IN',$registration_ids))));
366
-		foreach($registration_rows as $reg_row){
367
-			if ( is_array( $reg_row ) ) {
365
+		$questions_for_these_regs_rows = EEM_Question::instance()->get_all_wpdb_results(array(array('Answer.REG_ID'=>array('IN', $registration_ids))));
366
+		foreach ($registration_rows as $reg_row) {
367
+			if (is_array($reg_row)) {
368 368
 				$reg_csv_array = array();
369
-				if( ! $event_id ){
369
+				if ( ! $event_id) {
370 370
 					//get the event's name and Id
371
-					$reg_csv_array[ __( 'Event', 'event_espresso' ) ] = sprintf( __( '%1$s (%2$s)', 'event_espresso' ), $this->_prepare_value_from_db_for_display( EEM_Event::instance(), 'EVT_name', $reg_row[ 'Event_CPT.post_title'] ), $reg_row[ 'Event_CPT.ID' ] );
371
+					$reg_csv_array[__('Event', 'event_espresso')] = sprintf(__('%1$s (%2$s)', 'event_espresso'), $this->_prepare_value_from_db_for_display(EEM_Event::instance(), 'EVT_name', $reg_row['Event_CPT.post_title']), $reg_row['Event_CPT.ID']);
372 372
 				}
373
-				$is_primary_reg = $reg_row[ 'Registration.REG_count' ] == '1' ? true : false;
373
+				$is_primary_reg = $reg_row['Registration.REG_count'] == '1' ? true : false;
374 374
 				/*@var $reg_row EE_Registration */
375
-				foreach($reg_fields_to_include as $field_name){
375
+				foreach ($reg_fields_to_include as $field_name) {
376 376
 					$field = $reg_model->field_settings_for($field_name);
377
-					if($field_name == 'REG_final_price'){
378
-						$value = $this->_prepare_value_from_db_for_display( $reg_model, $field_name, $reg_row[ 'Registration.REG_final_price'], 'localized_float' );
379
-					}elseif( $field_name == 'REG_count' ){
380
-						$value = sprintf( __( '%s of %s', 'event_espresso' ), $this->_prepare_value_from_db_for_display( $reg_model, 'REG_count', $reg_row['Registration.REG_count'] ), $this->_prepare_value_from_db_for_display( $reg_model, 'REG_group_size', $reg_row['Registration.REG_group_size' ] ) );
381
-					}elseif( $field_name == 'REG_date' ) {
382
-						$value = $this->_prepare_value_from_db_for_display( $reg_model, $field_name, $reg_row[ 'Registration.REG_date'], 'no_html' );
383
-					}else{
384
-						$value = $this->_prepare_value_from_db_for_display( $reg_model, $field_name, $reg_row[ $field->get_qualified_column() ] );
377
+					if ($field_name == 'REG_final_price') {
378
+						$value = $this->_prepare_value_from_db_for_display($reg_model, $field_name, $reg_row['Registration.REG_final_price'], 'localized_float');
379
+					}elseif ($field_name == 'REG_count') {
380
+						$value = sprintf(__('%s of %s', 'event_espresso'), $this->_prepare_value_from_db_for_display($reg_model, 'REG_count', $reg_row['Registration.REG_count']), $this->_prepare_value_from_db_for_display($reg_model, 'REG_group_size', $reg_row['Registration.REG_group_size']));
381
+					}elseif ($field_name == 'REG_date') {
382
+						$value = $this->_prepare_value_from_db_for_display($reg_model, $field_name, $reg_row['Registration.REG_date'], 'no_html');
383
+					} else {
384
+						$value = $this->_prepare_value_from_db_for_display($reg_model, $field_name, $reg_row[$field->get_qualified_column()]);
385 385
 					}
386 386
 					$reg_csv_array[$this->_get_column_name_for_field($field)] = $value;
387
-					if($field_name == 'REG_final_price'){
387
+					if ($field_name == 'REG_final_price') {
388 388
 						//add a column named Currency after the final price
389 389
 						$reg_csv_array[__("Currency", "event_espresso")] = EE_Config::instance()->currency->code;
390 390
 					}
391 391
 				}
392 392
 				//get pretty status
393
-				$stati = EEM_Status::instance()->localized_status( array(
394
-					$reg_row[ 'Registration.STS_ID' ] => __( 'unknown', 'event_espresso' ),
395
-					$reg_row[ 'TransactionTable.STS_ID' ] => __( 'unknown', 'event_espresso' ) ),
393
+				$stati = EEM_Status::instance()->localized_status(array(
394
+					$reg_row['Registration.STS_ID'] => __('unknown', 'event_espresso'),
395
+					$reg_row['TransactionTable.STS_ID'] => __('unknown', 'event_espresso') ),
396 396
 						FALSE,
397
-						'sentence' );
398
-				$reg_csv_array[__("Registration Status", 'event_espresso')] = $stati[ $reg_row[ 'Registration.STS_ID' ] ];
397
+						'sentence');
398
+				$reg_csv_array[__("Registration Status", 'event_espresso')] = $stati[$reg_row['Registration.STS_ID']];
399 399
 				//get pretty trnasaction status
400
-				$reg_csv_array[__("Transaction Status", 'event_espresso')] = $stati[ $reg_row[ 'TransactionTable.STS_ID' ] ];
401
-				$reg_csv_array[ __( 'Transaction Amount Due', 'event_espresso' ) ] = $is_primary_reg ? $this->_prepare_value_from_db_for_display( EEM_Transaction::instance(), 'TXN_total', $reg_row[ 'TransactionTable.TXN_total' ], 'localized_float' ) : '0.00';
402
-				$reg_csv_array[ __( 'Amount Paid', 'event_espresso' )] = $is_primary_reg ? $this->_prepare_value_from_db_for_display( EEM_Transaction::instance(), 'TXN_paid', $reg_row[ 'TransactionTable.TXN_paid' ], 'localized_float' ) : '0.00';
400
+				$reg_csv_array[__("Transaction Status", 'event_espresso')] = $stati[$reg_row['TransactionTable.STS_ID']];
401
+				$reg_csv_array[__('Transaction Amount Due', 'event_espresso')] = $is_primary_reg ? $this->_prepare_value_from_db_for_display(EEM_Transaction::instance(), 'TXN_total', $reg_row['TransactionTable.TXN_total'], 'localized_float') : '0.00';
402
+				$reg_csv_array[__('Amount Paid', 'event_espresso')] = $is_primary_reg ? $this->_prepare_value_from_db_for_display(EEM_Transaction::instance(), 'TXN_paid', $reg_row['TransactionTable.TXN_paid'], 'localized_float') : '0.00';
403 403
 				$payment_methods = array();
404 404
 				$gateway_txn_ids_etc = array();
405 405
 				$payment_times = array();
406
-				if( $is_primary_reg && $reg_row[ 'TransactionTable.TXN_ID' ] ){
406
+				if ($is_primary_reg && $reg_row['TransactionTable.TXN_ID']) {
407 407
 					$payments_info = EEM_Payment::instance()->get_all_wpdb_results(
408 408
 							array(
409 409
 								array(
410
-									'TXN_ID' => $reg_row[ 'TransactionTable.TXN_ID' ],
410
+									'TXN_ID' => $reg_row['TransactionTable.TXN_ID'],
411 411
 									'STS_ID' => EEM_Payment::status_id_approved
412 412
 								),
413
-								'force_join' => array( 'Payment_Method' ),
413
+								'force_join' => array('Payment_Method'),
414 414
 
415 415
 							),
416 416
 							ARRAY_A,
417 417
 							'Payment_Method.PMD_admin_name as name, Payment.PAY_txn_id_chq_nmbr as gateway_txn_id, Payment.PAY_timestamp as payment_time' );
418 418
 
419
-					foreach( $payments_info as $payment_method_and_gateway_txn_id ){
420
-						$payment_methods[] = isset( $payment_method_and_gateway_txn_id[ 'name' ] ) ? $payment_method_and_gateway_txn_id[ 'name' ] : __( 'Unknown', 'event_espresso' );
421
-						$gateway_txn_ids_etc[] = isset( $payment_method_and_gateway_txn_id[ 'gateway_txn_id' ] ) ? $payment_method_and_gateway_txn_id[ 'gateway_txn_id' ] : '';
422
-						$payment_times[] = isset( $payment_method_and_gateway_txn_id[ 'payment_time' ] ) ? $payment_method_and_gateway_txn_id[ 'payment_time' ] : '';
419
+					foreach ($payments_info as $payment_method_and_gateway_txn_id) {
420
+						$payment_methods[] = isset($payment_method_and_gateway_txn_id['name']) ? $payment_method_and_gateway_txn_id['name'] : __('Unknown', 'event_espresso');
421
+						$gateway_txn_ids_etc[] = isset($payment_method_and_gateway_txn_id['gateway_txn_id']) ? $payment_method_and_gateway_txn_id['gateway_txn_id'] : '';
422
+						$payment_times[] = isset($payment_method_and_gateway_txn_id['payment_time']) ? $payment_method_and_gateway_txn_id['payment_time'] : '';
423 423
 					}
424 424
 
425 425
 				}
426
-				$reg_csv_array[ __( 'Payment Date(s)', 'event_espresso' ) ] = implode( ',', $payment_times );
427
-				$reg_csv_array[ __( 'Payment Method(s)', 'event_espresso' ) ] = implode( ",", $payment_methods );
428
-				$reg_csv_array[ __( 'Gateway Transaction ID(s)', 'event_espresso' )] = implode( ',', $gateway_txn_ids_etc );
426
+				$reg_csv_array[__('Payment Date(s)', 'event_espresso')] = implode(',', $payment_times);
427
+				$reg_csv_array[__('Payment Method(s)', 'event_espresso')] = implode(",", $payment_methods);
428
+				$reg_csv_array[__('Gateway Transaction ID(s)', 'event_espresso')] = implode(',', $gateway_txn_ids_etc);
429 429
 
430 430
 				//get whether or not the user has checked in
431
-				$reg_csv_array[__("Check-Ins", "event_espresso")] = $reg_model->count_related( $reg_row[ 'Registration.REG_ID'] , 'Checkin' );
431
+				$reg_csv_array[__("Check-Ins", "event_espresso")] = $reg_model->count_related($reg_row['Registration.REG_ID'], 'Checkin');
432 432
 				//get ticket of registration and its price
433 433
 				$ticket_model = EE_Registry::instance()->load_model('Ticket');
434
-				if( $reg_row[ 'Ticket.TKT_ID'] ) {
435
-					$ticket_name = $this->_prepare_value_from_db_for_display( $ticket_model, 'TKT_name', $reg_row[ 'Ticket.TKT_name' ] );
434
+				if ($reg_row['Ticket.TKT_ID']) {
435
+					$ticket_name = $this->_prepare_value_from_db_for_display($ticket_model, 'TKT_name', $reg_row['Ticket.TKT_name']);
436 436
 					$datetimes_strings = array();
437
-					foreach( EEM_Datetime::instance()->get_all_wpdb_results( array( array( 'Ticket.TKT_ID' => $reg_row[ 'Ticket.TKT_ID' ] ), 'order_by' => array( 'DTT_EVT_start' => 'ASC' ), 'default_where_conditions' => 'none' ) ) as $datetime){
438
-						$datetimes_strings[] = $this->_prepare_value_from_db_for_display( EEM_Datetime::instance(), 'DTT_EVT_start', $datetime[ 'Datetime.DTT_EVT_start'] );
437
+					foreach (EEM_Datetime::instance()->get_all_wpdb_results(array(array('Ticket.TKT_ID' => $reg_row['Ticket.TKT_ID']), 'order_by' => array('DTT_EVT_start' => 'ASC'), 'default_where_conditions' => 'none')) as $datetime) {
438
+						$datetimes_strings[] = $this->_prepare_value_from_db_for_display(EEM_Datetime::instance(), 'DTT_EVT_start', $datetime['Datetime.DTT_EVT_start']);
439 439
 					}
440 440
 
441 441
 				} else {
442
-					$ticket_name = __( 'Unknown', 'event_espresso' );
443
-					$datetimes_strings = array( __( 'Unknown', 'event_espresso' ) );
442
+					$ticket_name = __('Unknown', 'event_espresso');
443
+					$datetimes_strings = array(__('Unknown', 'event_espresso'));
444 444
 				}
445 445
 				$reg_csv_array[$ticket_model->field_settings_for('TKT_name')->get_nicename()] = $ticket_name;
446 446
 				$reg_csv_array[__("Datetimes of Ticket", "event_espresso")] = implode(", ", $datetimes_strings);
447 447
 				//get datetime(s) of registration
448 448
 
449 449
 				//add attendee columns
450
-				foreach($att_fields_to_include as $att_field_name){
450
+				foreach ($att_fields_to_include as $att_field_name) {
451 451
 					$field_obj = EEM_Attendee::instance()->field_settings_for($att_field_name);
452
-					if( $reg_row[ 'Attendee_CPT.ID' ]){
453
-						if($att_field_name == 'STA_ID'){
454
-							$value = EEM_State::instance()->get_var( array( array( 'STA_ID' => $reg_row[ 'Attendee_Meta.STA_ID' ] ) ), 'STA_name' );
455
-						}elseif($att_field_name == 'CNT_ISO'){
456
-							$value = EEM_Country::instance()->get_var( array( array( 'CNT_ISO' => $reg_row[ 'Attendee_Meta.CNT_ISO' ] ) ), 'CNT_name' );
457
-						}else{
458
-							$value = $this->_prepare_value_from_db_for_display( EEM_Attendee::instance(), $att_field_name, $reg_row[ $field_obj->get_qualified_column() ] );
452
+					if ($reg_row['Attendee_CPT.ID']) {
453
+						if ($att_field_name == 'STA_ID') {
454
+							$value = EEM_State::instance()->get_var(array(array('STA_ID' => $reg_row['Attendee_Meta.STA_ID'])), 'STA_name');
455
+						}elseif ($att_field_name == 'CNT_ISO') {
456
+							$value = EEM_Country::instance()->get_var(array(array('CNT_ISO' => $reg_row['Attendee_Meta.CNT_ISO'])), 'CNT_name');
457
+						} else {
458
+							$value = $this->_prepare_value_from_db_for_display(EEM_Attendee::instance(), $att_field_name, $reg_row[$field_obj->get_qualified_column()]);
459 459
 						}
460
-					}else{
460
+					} else {
461 461
 						$value = '';
462 462
 					}
463 463
 
@@ -465,56 +465,56 @@  discard block
 block discarded – undo
465 465
 				}
466 466
 
467 467
 				//make sure each registration has the same questions in the same order
468
-				foreach($questions_for_these_regs_rows as $question_row){
469
-					if( ! isset($reg_csv_array[$question_row[ 'Question.QST_admin_label']])){
470
-						$reg_csv_array[$question_row[ 'Question.QST_admin_label' ] ] = null;
468
+				foreach ($questions_for_these_regs_rows as $question_row) {
469
+					if ( ! isset($reg_csv_array[$question_row['Question.QST_admin_label']])) {
470
+						$reg_csv_array[$question_row['Question.QST_admin_label']] = null;
471 471
 					}
472 472
 				}
473 473
 				//now fill out the questions THEY answered
474
-				foreach( EEM_Answer::instance()->get_all_wpdb_results( array( array( 'REG_ID' => $reg_row[ 'Registration.REG_ID' ] ), 'force_join' => array( 'Question' ) ) ) as $answer_row){
474
+				foreach (EEM_Answer::instance()->get_all_wpdb_results(array(array('REG_ID' => $reg_row['Registration.REG_ID']), 'force_join' => array('Question'))) as $answer_row) {
475 475
 					/* @var $answer EE_Answer */
476
-					if( $answer_row[ 'Question.QST_ID' ] ){
477
-						$question_label = $this->_prepare_value_from_db_for_display( EEM_Question::instance(), 'QST_admin_label', $answer_row[ 'Question.QST_admin_label' ] );
478
-					}else{
479
-						$question_label = sprintf( __( 'Question $s', 'event_espresso' ), $answer_row[ 'Answer.QST_ID' ] );
476
+					if ($answer_row['Question.QST_ID']) {
477
+						$question_label = $this->_prepare_value_from_db_for_display(EEM_Question::instance(), 'QST_admin_label', $answer_row['Question.QST_admin_label']);
478
+					} else {
479
+						$question_label = sprintf(__('Question $s', 'event_espresso'), $answer_row['Answer.QST_ID']);
480 480
 					}
481
-                                        if( isset( $answer_row[ 'Question.QST_type'] ) && $answer_row[ 'Question.QST_type' ] == EEM_Question::QST_type_state ) {
482
-                                            $reg_csv_array[ $question_label ] = EEM_State::instance()->get_state_name_by_ID( $answer_row[ 'Answer.ANS_value' ] );
481
+                                        if (isset($answer_row['Question.QST_type']) && $answer_row['Question.QST_type'] == EEM_Question::QST_type_state) {
482
+                                            $reg_csv_array[$question_label] = EEM_State::instance()->get_state_name_by_ID($answer_row['Answer.ANS_value']);
483 483
                                         } else {
484
-                                            $reg_csv_array[ $question_label ] = $this->_prepare_value_from_db_for_display( EEM_Answer::instance(), 'ANS_value', $answer_row[ 'Answer.ANS_value' ] );
484
+                                            $reg_csv_array[$question_label] = $this->_prepare_value_from_db_for_display(EEM_Answer::instance(), 'ANS_value', $answer_row['Answer.ANS_value']);
485 485
                                         }
486 486
 				}
487
-				$registrations_csv_ready_array[] = apply_filters( 'FHEE__EE_Export__report_registrations__reg_csv_array', $reg_csv_array, $reg_row );
487
+				$registrations_csv_ready_array[] = apply_filters('FHEE__EE_Export__report_registrations__reg_csv_array', $reg_csv_array, $reg_row);
488 488
 			}
489 489
 		}
490 490
 
491 491
 		//if we couldn't export anything, we want to at least show the column headers
492
-		if(empty($registrations_csv_ready_array)){
492
+		if (empty($registrations_csv_ready_array)) {
493 493
 			$reg_csv_array = array();
494 494
 			$model_and_fields_to_include = array(
495 495
 				'Registration' => $reg_fields_to_include,
496 496
 				'Attendee' => $att_fields_to_include
497 497
 			);
498
-			foreach($model_and_fields_to_include as $model_name => $field_list){
498
+			foreach ($model_and_fields_to_include as $model_name => $field_list) {
499 499
 				$model = EE_Registry::instance()->load_model($model_name);
500
-				foreach($field_list as $field_name){
500
+				foreach ($field_list as $field_name) {
501 501
 					$field = $model->field_settings_for($field_name);
502
-					$reg_csv_array[$this->_get_column_name_for_field($field)] = null;//$registration->get($field->get_name());
502
+					$reg_csv_array[$this->_get_column_name_for_field($field)] = null; //$registration->get($field->get_name());
503 503
 				}
504 504
 			}
505 505
 			$registrations_csv_ready_array [] = $reg_csv_array;
506 506
 		}
507
-		if( $event_id ){
508
-			$event_slug =  EEM_Event::instance()->get_var( array( array( 'EVT_ID' => $event_id ) ), 'EVT_slug' );
509
-			if( ! $event_slug ) {
510
-				$event_slug = __( 'unknown', 'event_espresso' );
507
+		if ($event_id) {
508
+			$event_slug = EEM_Event::instance()->get_var(array(array('EVT_ID' => $event_id)), 'EVT_slug');
509
+			if ( ! $event_slug) {
510
+				$event_slug = __('unknown', 'event_espresso');
511 511
 			}
512
-		}else{
513
-			$event_slug = __( 'all', 'event_espresso' );
512
+		} else {
513
+			$event_slug = __('all', 'event_espresso');
514 514
 		}
515
-		$filename = sprintf( "registrations-for-%s", $event_slug );
515
+		$filename = sprintf("registrations-for-%s", $event_slug);
516 516
 
517
-		$handle = $this->EE_CSV->begin_sending_csv( $filename);
517
+		$handle = $this->EE_CSV->begin_sending_csv($filename);
518 518
 		$this->EE_CSV->write_data_array_to_csv($handle, $registrations_csv_ready_array);
519 519
 		$this->EE_CSV->end_sending_csv($handle);
520 520
 	}
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 	 * @param EE_Model_Field_Base $field
525 525
 	 * @return string
526 526
 	 */
527
-	protected function _get_column_name_for_field(EE_Model_Field_Base $field){
527
+	protected function _get_column_name_for_field(EE_Model_Field_Base $field) {
528 528
 		return $field->get_nicename()."[".$field->get_name()."]";
529 529
 	}
530 530
 
@@ -537,17 +537,17 @@  discard block
 block discarded – undo
537 537
 	function export_categories() {
538 538
 		// are any Event IDs set?
539 539
 		$query_params = array();
540
-		if ( isset( $this->_req_data['EVT_CAT_ID'] )) {
540
+		if (isset($this->_req_data['EVT_CAT_ID'])) {
541 541
 			// do we have an array of IDs ?
542
-			if ( is_array( $this->_req_data['EVT_CAT_ID'] )) {
542
+			if (is_array($this->_req_data['EVT_CAT_ID'])) {
543 543
 				// generate an "IN (CSV)" where clause
544
-				$EVT_CAT_IDs = array_map( 'sanitize_text_field', $this->_req_data['EVT_CAT_ID'] );
544
+				$EVT_CAT_IDs = array_map('sanitize_text_field', $this->_req_data['EVT_CAT_ID']);
545 545
 				$filename = 'event-categories';
546
-				$query_params[0]['term_taxonomy_id'] = array('IN',$EVT_CAT_IDs);
546
+				$query_params[0]['term_taxonomy_id'] = array('IN', $EVT_CAT_IDs);
547 547
 			} else {
548 548
 				// generate regular where = clause
549
-				$EVT_CAT_ID = absint( $this->_req_data['EVT_CAT_ID'] );
550
-				$filename = 'event-category#' . $EVT_CAT_ID;
549
+				$EVT_CAT_ID = absint($this->_req_data['EVT_CAT_ID']);
550
+				$filename = 'event-category#'.$EVT_CAT_ID;
551 551
 				$query_params[0]['term_taxonomy_id'] = $EVT_CAT_ID;
552 552
 			}
553 553
 		} else {
@@ -559,11 +559,11 @@  discard block
 block discarded – undo
559 559
 				'Term_Taxonomy' => $query_params
560 560
 			);
561 561
 
562
-		$table_data = $this->_get_export_data_for_models( $tables_to_export );
563
-		$filename = $this->generate_filename ( $filename );
562
+		$table_data = $this->_get_export_data_for_models($tables_to_export);
563
+		$filename = $this->generate_filename($filename);
564 564
 
565
-		if ( ! $this->EE_CSV->export_multiple_model_data_to_csv( $filename, $table_data )) {
566
-			EE_Error::add_error(__('An error occurred and the Category details could not be exported from the database.','event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
565
+		if ( ! $this->EE_CSV->export_multiple_model_data_to_csv($filename, $table_data)) {
566
+			EE_Error::add_error(__('An error occurred and the Category details could not be exported from the database.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
567 567
 		}
568 568
 	}
569 569
 
@@ -574,13 +574,13 @@  discard block
 block discarded – undo
574 574
 	 *		  @param string - export_name
575 575
 	 *			@return string on success, FALSE on fail
576 576
 	 */
577
-	private function generate_filename ( $export_name = '' ) {
578
-		if ( $export_name != '' ) {
579
-			$filename = get_bloginfo('name') . '-' . $export_name;
580
-			$filename = sanitize_key( $filename ) . '-' . $this->today;
577
+	private function generate_filename($export_name = '') {
578
+		if ($export_name != '') {
579
+			$filename = get_bloginfo('name').'-'.$export_name;
580
+			$filename = sanitize_key($filename).'-'.$this->today;
581 581
 			return $filename;
582
-		}	 else {
583
-			EE_Error::add_error(__("No filename was provided", "event_espresso"), __FILE__, __FUNCTION__, __LINE__ );
582
+		} else {
583
+			EE_Error::add_error(__("No filename was provided", "event_espresso"), __FILE__, __FUNCTION__, __LINE__);
584 584
 		}
585 585
 		return false;
586 586
 	}
@@ -593,12 +593,12 @@  discard block
 block discarded – undo
593 593
 	 *	@param array $models_to_export keys are model names (eg 'Event', 'Attendee', etc.) and values are arrays of query params like on EEM_Base::get_all
594 594
 	 *	@return array on success, FALSE on fail
595 595
 	 */
596
-	private function _get_export_data_for_models( $models_to_export = array() ) {
596
+	private function _get_export_data_for_models($models_to_export = array()) {
597 597
 		$table_data = FALSE;
598
-		if ( is_array( $models_to_export ) ) {
599
-			foreach ( $models_to_export as $model_name => $query_params ) {
598
+		if (is_array($models_to_export)) {
599
+			foreach ($models_to_export as $model_name => $query_params) {
600 600
 				//check for a numerically-indexed array. in that case, $model_name is the value!!
601
-				if(is_int($model_name)){
601
+				if (is_int($model_name)) {
602 602
 					$model_name = $query_params;
603 603
 					$query_params = array();
604 604
 				}
@@ -606,17 +606,17 @@  discard block
 block discarded – undo
606 606
 				$model_objects = $model->get_all($query_params);
607 607
 
608 608
 				$table_data[$model_name] = array();
609
-				foreach($model_objects as $model_object){
609
+				foreach ($model_objects as $model_object) {
610 610
 					$model_data_array = array();
611 611
 					$fields = $model->field_settings();
612
-					foreach($fields as $field){
612
+					foreach ($fields as $field) {
613 613
 						$column_name = $field->get_nicename()."[".$field->get_name()."]";
614
-						if($field instanceof EE_Datetime_Field){
614
+						if ($field instanceof EE_Datetime_Field) {
615 615
 //							$field->set_date_format('Y-m-d');
616 616
 //							$field->set_time_format('H:i:s');
617
-							$model_data_array[$column_name] = $model_object->get_datetime($field->get_name(),'Y-m-d','H:i:s');
617
+							$model_data_array[$column_name] = $model_object->get_datetime($field->get_name(), 'Y-m-d', 'H:i:s');
618 618
 						}
619
-						else{
619
+						else {
620 620
 							$model_data_array[$column_name] = $model_object->get($field->get_name());
621 621
 						}
622 622
 					}
Please login to merge, or discard this patch.
Braces   +18 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if (!defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
3 5
 /**
4 6
  * EE_Export class
@@ -233,10 +235,10 @@  discard block
 block discarded – undo
233 235
 				if( $field_name == 'STA_ID' ){
234 236
 					$state_name_field = EEM_State::instance()->field_settings_for( 'STA_name' );
235 237
 					$csv_row[ __( 'State', 'event_espresso' ) ] = $attendee_row[ $state_name_field->get_qualified_column() ];
236
-				}elseif( $field_name == 'CNT_ISO' ){
238
+				} elseif( $field_name == 'CNT_ISO' ){
237 239
 					$country_name_field = EEM_Country::instance()->field_settings_for( 'CNT_name' );
238 240
 					$csv_row[ __( 'Country', 'event_espresso' ) ] = $attendee_row[ $country_name_field->get_qualified_column() ];
239
-				}else{
241
+				} else{
240 242
 					$csv_row[ $field_obj->get_nicename() ] = $attendee_row[ $field_obj->get_qualified_column() ];
241 243
 				}
242 244
 			}
@@ -294,9 +296,9 @@  discard block
 block discarded – undo
294 296
 		}
295 297
 		if( $pretty_schema === true){
296 298
 			return $field_obj->prepare_for_pretty_echoing( $value_on_model_obj );
297
-		}elseif( is_string( $pretty_schema ) ) {
299
+		} elseif( is_string( $pretty_schema ) ) {
298 300
 			return $field_obj->prepare_for_pretty_echoing($value_on_model_obj, $pretty_schema );
299
-		}else{
301
+		} else{
300 302
 			return $field_obj->prepare_for_get( $value_on_model_obj );
301 303
 		}
302 304
 	}
@@ -352,7 +354,7 @@  discard block
 block discarded – undo
352 354
 		);
353 355
 		if( $event_id ){
354 356
 			$query_params[0]['EVT_ID'] =  $event_id;
355
-		}else{
357
+		} else{
356 358
 			$query_params[ 'force_join' ][] = 'Event';
357 359
 		}
358 360
 		$registration_rows = $reg_model->get_all_wpdb_results( $query_params );
@@ -376,11 +378,11 @@  discard block
 block discarded – undo
376 378
 					$field = $reg_model->field_settings_for($field_name);
377 379
 					if($field_name == 'REG_final_price'){
378 380
 						$value = $this->_prepare_value_from_db_for_display( $reg_model, $field_name, $reg_row[ 'Registration.REG_final_price'], 'localized_float' );
379
-					}elseif( $field_name == 'REG_count' ){
381
+					} elseif( $field_name == 'REG_count' ){
380 382
 						$value = sprintf( __( '%s of %s', 'event_espresso' ), $this->_prepare_value_from_db_for_display( $reg_model, 'REG_count', $reg_row['Registration.REG_count'] ), $this->_prepare_value_from_db_for_display( $reg_model, 'REG_group_size', $reg_row['Registration.REG_group_size' ] ) );
381
-					}elseif( $field_name == 'REG_date' ) {
383
+					} elseif( $field_name == 'REG_date' ) {
382 384
 						$value = $this->_prepare_value_from_db_for_display( $reg_model, $field_name, $reg_row[ 'Registration.REG_date'], 'no_html' );
383
-					}else{
385
+					} else{
384 386
 						$value = $this->_prepare_value_from_db_for_display( $reg_model, $field_name, $reg_row[ $field->get_qualified_column() ] );
385 387
 					}
386 388
 					$reg_csv_array[$this->_get_column_name_for_field($field)] = $value;
@@ -452,12 +454,12 @@  discard block
 block discarded – undo
452 454
 					if( $reg_row[ 'Attendee_CPT.ID' ]){
453 455
 						if($att_field_name == 'STA_ID'){
454 456
 							$value = EEM_State::instance()->get_var( array( array( 'STA_ID' => $reg_row[ 'Attendee_Meta.STA_ID' ] ) ), 'STA_name' );
455
-						}elseif($att_field_name == 'CNT_ISO'){
457
+						} elseif($att_field_name == 'CNT_ISO'){
456 458
 							$value = EEM_Country::instance()->get_var( array( array( 'CNT_ISO' => $reg_row[ 'Attendee_Meta.CNT_ISO' ] ) ), 'CNT_name' );
457
-						}else{
459
+						} else{
458 460
 							$value = $this->_prepare_value_from_db_for_display( EEM_Attendee::instance(), $att_field_name, $reg_row[ $field_obj->get_qualified_column() ] );
459 461
 						}
460
-					}else{
462
+					} else{
461 463
 						$value = '';
462 464
 					}
463 465
 
@@ -475,7 +477,7 @@  discard block
 block discarded – undo
475 477
 					/* @var $answer EE_Answer */
476 478
 					if( $answer_row[ 'Question.QST_ID' ] ){
477 479
 						$question_label = $this->_prepare_value_from_db_for_display( EEM_Question::instance(), 'QST_admin_label', $answer_row[ 'Question.QST_admin_label' ] );
478
-					}else{
480
+					} else{
479 481
 						$question_label = sprintf( __( 'Question $s', 'event_espresso' ), $answer_row[ 'Answer.QST_ID' ] );
480 482
 					}
481 483
                                         if( isset( $answer_row[ 'Question.QST_type'] ) && $answer_row[ 'Question.QST_type' ] == EEM_Question::QST_type_state ) {
@@ -509,7 +511,7 @@  discard block
 block discarded – undo
509 511
 			if( ! $event_slug ) {
510 512
 				$event_slug = __( 'unknown', 'event_espresso' );
511 513
 			}
512
-		}else{
514
+		} else{
513 515
 			$event_slug = __( 'all', 'event_espresso' );
514 516
 		}
515 517
 		$filename = sprintf( "registrations-for-%s", $event_slug );
@@ -579,7 +581,7 @@  discard block
 block discarded – undo
579 581
 			$filename = get_bloginfo('name') . '-' . $export_name;
580 582
 			$filename = sanitize_key( $filename ) . '-' . $this->today;
581 583
 			return $filename;
582
-		}	 else {
584
+		} else {
583 585
 			EE_Error::add_error(__("No filename was provided", "event_espresso"), __FILE__, __FUNCTION__, __LINE__ );
584 586
 		}
585 587
 		return false;
@@ -615,8 +617,7 @@  discard block
 block discarded – undo
615 617
 //							$field->set_date_format('Y-m-d');
616 618
 //							$field->set_time_format('H:i:s');
617 619
 							$model_data_array[$column_name] = $model_object->get_datetime($field->get_name(),'Y-m-d','H:i:s');
618
-						}
619
-						else{
620
+						} else{
620 621
 							$model_data_array[$column_name] = $model_object->get($field->get_name());
621 622
 						}
622 623
 					}
Please login to merge, or discard this patch.
core/db_classes/EE_Post_Meta.class.php 1 patch
Spacing   +19 added lines, -19 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
  * Event Espresso
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 	 * @param array $props_n_values
31 31
 	 * @return EE_Post_Meta|mixed
32 32
 	 */
33
-	public static function new_instance( $props_n_values = array() ) {
34
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__ );
35
-		return $has_object ? $has_object : new self( $props_n_values );
33
+	public static function new_instance($props_n_values = array()) {
34
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__);
35
+		return $has_object ? $has_object : new self($props_n_values);
36 36
 	}
37 37
 
38 38
 
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 	 * @param array $props_n_values
42 42
 	 * @return EE_Post_Meta
43 43
 	 */
44
-	public static function new_instance_from_db( $props_n_values = array() ) {
45
-		return new self( $props_n_values, TRUE );
44
+	public static function new_instance_from_db($props_n_values = array()) {
45
+		return new self($props_n_values, TRUE);
46 46
 	}
47 47
 
48 48
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 * @return int
53 53
 	 */
54 54
 	function meta_id() {
55
-		return $this->get( 'meta_id' );
55
+		return $this->get('meta_id');
56 56
 	}
57 57
 
58 58
 
@@ -62,15 +62,15 @@  discard block
 block discarded – undo
62 62
 	 * @param int $meta_id
63 63
 	 * @return boolean
64 64
 	 */
65
-	function set_meta_id( $meta_id) {
66
-		return $this->set( 'meta_id', $meta_id);
65
+	function set_meta_id($meta_id) {
66
+		return $this->set('meta_id', $meta_id);
67 67
 	}
68 68
 	/**
69 69
 	 * Gets post_id
70 70
 	 * @return int
71 71
 	 */
72 72
 	function post_id() {
73
-		return $this->get( 'post_id' );
73
+		return $this->get('post_id');
74 74
 	}
75 75
 
76 76
 
@@ -80,15 +80,15 @@  discard block
 block discarded – undo
80 80
 	 * @param int $post_id
81 81
 	 * @return boolean
82 82
 	 */
83
-	function set_post_id( $post_id) {
84
-		return $this->set( 'post_id', $post_id);
83
+	function set_post_id($post_id) {
84
+		return $this->set('post_id', $post_id);
85 85
 	}
86 86
 	/**
87 87
 	 * Gets meta_key
88 88
 	 * @return string
89 89
 	 */
90 90
 	function meta_key() {
91
-		return $this->get( 'meta_key' );
91
+		return $this->get('meta_key');
92 92
 	}
93 93
 
94 94
 
@@ -98,15 +98,15 @@  discard block
 block discarded – undo
98 98
 	 * @param string $meta_key
99 99
 	 * @return boolean
100 100
 	 */
101
-	function set_meta_key( $meta_key) {
102
-		return $this->set( 'meta_key', $meta_key);
101
+	function set_meta_key($meta_key) {
102
+		return $this->set('meta_key', $meta_key);
103 103
 	}
104 104
 	/**
105 105
 	 * Gets meta_value
106 106
 	 * @return mixed
107 107
 	 */
108 108
 	function meta_value() {
109
-		return $this->get( 'meta_value' );
109
+		return $this->get('meta_value');
110 110
 	}
111 111
 
112 112
 
@@ -116,8 +116,8 @@  discard block
 block discarded – undo
116 116
 	 * @param mixed $meta_value
117 117
 	 * @return boolean
118 118
 	 */
119
-	function set_meta_value( $meta_value) {
120
-		return $this->set( 'meta_value', $meta_value);
119
+	function set_meta_value($meta_value) {
120
+		return $this->set('meta_value', $meta_value);
121 121
 	}
122 122
 
123 123
 
Please login to merge, or discard this patch.
core/db_models/EEM_Answer.model.php 3 patches
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
@@ -90,7 +92,7 @@  discard block
 block discarded – undo
90 92
 			if( $answer_obj instanceof EE_Answer ){
91 93
 				if($pretty_answer){
92 94
 					$value = $answer_obj->pretty_value();
93
-				}else{
95
+				} else{
94 96
 					$value = $answer_obj->value();
95 97
 				}
96 98
 			}
@@ -148,7 +150,7 @@  discard block
 block discarded – undo
148 150
 						$value = $registration->attendee()->get_pretty( $field_name );
149 151
 					}
150 152
 					//if field name is blank, leave the value as null too
151
-				}else{
153
+				} else{
152 154
 					$value = $registration->attendee()->get( $field_name );
153 155
 				}
154 156
 			}
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -125,14 +125,14 @@
 block discarded – undo
125 125
 	public function get_attendee_property_answer_value( EE_Registration $registration, $question_system_id = NULL, $pretty_answer = FALSE ){
126 126
 		$field_name = NULL;
127 127
 		$value = NULL;
128
-                //backward compat: we still want to find the question's ID
129
-                if( is_numeric( $question_system_id ) ) {
130
-                    //find this question's QST_system value
131
-                    $question_id = $question_system_id;
132
-                    $question_system_id = EEM_Question::instance()->get_var( array( array( 'QST_ID' => $question_system_id ) ), 'QST_system' );
133
-                } else {
134
-                    $question_id = (int) EEM_Question::instance()->get_var( array( array( 'QST_system' => $question_system_id ) ), 'QST_ID' );
135
-                }
128
+				//backward compat: we still want to find the question's ID
129
+				if( is_numeric( $question_system_id ) ) {
130
+					//find this question's QST_system value
131
+					$question_id = $question_system_id;
132
+					$question_system_id = EEM_Question::instance()->get_var( array( array( 'QST_ID' => $question_system_id ) ), 'QST_system' );
133
+				} else {
134
+					$question_id = (int) EEM_Question::instance()->get_var( array( array( 'QST_system' => $question_system_id ) ), 'QST_ID' );
135
+				}
136 136
 		//only bother checking if the registration has an attendee
137 137
 		if( $registration->attendee() instanceof EE_Attendee ) {
138 138
 			$field_name = EEM_Attendee::instance()->get_attendee_field_for_system_question( $question_system_id );
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -51,18 +51,18 @@  discard block
 block discarded – undo
51 51
 	/**
52 52
 	 * 	constructor
53 53
 	 */
54
-	protected function __construct( $timezone = NULL ){
55
-		$this->singular_item = __('Answer','event_espresso');
56
-		$this->plural_item = __('Answers','event_espresso');
54
+	protected function __construct($timezone = NULL) {
55
+		$this->singular_item = __('Answer', 'event_espresso');
56
+		$this->plural_item = __('Answers', 'event_espresso');
57 57
 		$this->_tables = array(
58 58
 			'Answer'=> new EE_Primary_Table('esp_answer', 'ANS_ID')
59 59
 		);
60 60
 		$this->_fields = array(
61 61
 			'Answer'=>array(
62
-				'ANS_ID'=> new EE_Primary_Key_Int_Field('ANS_ID', __('Answer ID','event_espresso')),
63
-				'REG_ID'=>new EE_Foreign_Key_Int_Field('REG_ID', __('Registration ID','event_espresso'), false, 0, 'Registration'),
64
-				'QST_ID'=>new EE_Foreign_Key_Int_Field('QST_ID', __('Question ID','event_espresso'), false, 0, 'Question'),
65
-				'ANS_value'=>new EE_Maybe_Serialized_Simple_HTML_Field('ANS_value', __('Answer Value','event_espresso'), false, '')
62
+				'ANS_ID'=> new EE_Primary_Key_Int_Field('ANS_ID', __('Answer ID', 'event_espresso')),
63
+				'REG_ID'=>new EE_Foreign_Key_Int_Field('REG_ID', __('Registration ID', 'event_espresso'), false, 0, 'Registration'),
64
+				'QST_ID'=>new EE_Foreign_Key_Int_Field('QST_ID', __('Question ID', 'event_espresso'), false, 0, 'Question'),
65
+				'ANS_value'=>new EE_Maybe_Serialized_Simple_HTML_Field('ANS_value', __('Answer Value', 'event_espresso'), false, '')
66 66
 			));
67 67
 		$this->_model_relations = array(
68 68
 			'Registration'=>new EE_Belongs_To_Relation(),
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 		);
71 71
 		$this->_model_chain_to_wp_user = 'Registration.Event';
72 72
 		$this->_caps_slug = 'registrations';
73
-		parent::__construct( $timezone );
73
+		parent::__construct($timezone);
74 74
 	}
75 75
 
76 76
 
@@ -83,19 +83,19 @@  discard block
 block discarded – undo
83 83
 	 * @param boolean $pretty_answer whether to call 'pretty_value' or just 'value'
84 84
 	 * @return string
85 85
 	 */
86
-	public function get_answer_value_to_question( EE_Registration $registration, $question_id = NULL,$pretty_answer = FALSE ){
87
-		$value = $this->get_attendee_property_answer_value( $registration, $question_id, $pretty_answer );
88
-		if (  $value === NULL ){
89
-			$answer_obj = $this->get_registration_question_answer_object( $registration, $question_id);
90
-			if( $answer_obj instanceof EE_Answer ){
91
-				if($pretty_answer){
86
+	public function get_answer_value_to_question(EE_Registration $registration, $question_id = NULL, $pretty_answer = FALSE) {
87
+		$value = $this->get_attendee_property_answer_value($registration, $question_id, $pretty_answer);
88
+		if ($value === NULL) {
89
+			$answer_obj = $this->get_registration_question_answer_object($registration, $question_id);
90
+			if ($answer_obj instanceof EE_Answer) {
91
+				if ($pretty_answer) {
92 92
 					$value = $answer_obj->pretty_value();
93
-				}else{
93
+				} else {
94 94
 					$value = $answer_obj->value();
95 95
 				}
96 96
 			}
97 97
 		}
98
-		return apply_filters( 'FHEE__EEM_Answer__get_answer_value_to_question__answer_value', $value, $registration, $question_id );
98
+		return apply_filters('FHEE__EEM_Answer__get_answer_value_to_question__answer_value', $value, $registration, $question_id);
99 99
 	}
100 100
 
101 101
 
@@ -106,9 +106,9 @@  discard block
 block discarded – undo
106 106
 	 * @param int $question_id
107 107
 	 * @return EE_Answer
108 108
 	 */
109
-	public function get_registration_question_answer_object( EE_Registration $registration, $question_id = NULL){
110
-		$answer_obj = $this->get_one( array( array( 'QST_ID'=>$question_id, 'REG_ID'=>$registration->ID() )));
111
-		return apply_filters( 'FHEE__EEM_Answer__get_registration_question_answer_object__answer_obj', $answer_obj, $registration, $question_id );
109
+	public function get_registration_question_answer_object(EE_Registration $registration, $question_id = NULL) {
110
+		$answer_obj = $this->get_one(array(array('QST_ID'=>$question_id, 'REG_ID'=>$registration->ID())));
111
+		return apply_filters('FHEE__EEM_Answer__get_registration_question_answer_object__answer_obj', $answer_obj, $registration, $question_id);
112 112
 	}
113 113
 
114 114
 
@@ -122,39 +122,39 @@  discard block
 block discarded – undo
122 122
 	 * @return string|null (if the registration has no attendee, or the question_system_id is not a QST_ID or QST_system for
123 123
 	 * a question corresponding to an attendee field, returns null)
124 124
 	 */
125
-	public function get_attendee_property_answer_value( EE_Registration $registration, $question_system_id = NULL, $pretty_answer = FALSE ){
125
+	public function get_attendee_property_answer_value(EE_Registration $registration, $question_system_id = NULL, $pretty_answer = FALSE) {
126 126
 		$field_name = NULL;
127 127
 		$value = NULL;
128 128
                 //backward compat: we still want to find the question's ID
129
-                if( is_numeric( $question_system_id ) ) {
129
+                if (is_numeric($question_system_id)) {
130 130
                     //find this question's QST_system value
131 131
                     $question_id = $question_system_id;
132
-                    $question_system_id = EEM_Question::instance()->get_var( array( array( 'QST_ID' => $question_system_id ) ), 'QST_system' );
132
+                    $question_system_id = EEM_Question::instance()->get_var(array(array('QST_ID' => $question_system_id)), 'QST_system');
133 133
                 } else {
134
-                    $question_id = (int) EEM_Question::instance()->get_var( array( array( 'QST_system' => $question_system_id ) ), 'QST_ID' );
134
+                    $question_id = (int) EEM_Question::instance()->get_var(array(array('QST_system' => $question_system_id)), 'QST_ID');
135 135
                 }
136 136
 		//only bother checking if the registration has an attendee
137
-		if( $registration->attendee() instanceof EE_Attendee ) {
138
-			$field_name = EEM_Attendee::instance()->get_attendee_field_for_system_question( $question_system_id );
139
-			if( $field_name ) {
140
-				if( $pretty_answer ) {
141
-					if( $field_name === 'STA_ID' ) {
137
+		if ($registration->attendee() instanceof EE_Attendee) {
138
+			$field_name = EEM_Attendee::instance()->get_attendee_field_for_system_question($question_system_id);
139
+			if ($field_name) {
140
+				if ($pretty_answer) {
141
+					if ($field_name === 'STA_ID') {
142 142
 						$state = $registration->attendee()->state_obj();
143
-						$value = $state instanceof EE_State ? $state->name() : sprintf( __('Unknown State (%s)', 'event_espresso'), $registration->attendee()->state_ID() );
144
-					} else if($field_name === 'CNT_ISO') {
143
+						$value = $state instanceof EE_State ? $state->name() : sprintf(__('Unknown State (%s)', 'event_espresso'), $registration->attendee()->state_ID());
144
+					} else if ($field_name === 'CNT_ISO') {
145 145
 						$country = $registration->attendee()->country_obj();
146
-						$value = $country instanceof EE_Country ? $country->name() : sprintf(__('Unknown Country (%s)', "event_espresso"),$registration->attendee()->country_ID());
146
+						$value = $country instanceof EE_Country ? $country->name() : sprintf(__('Unknown Country (%s)', "event_espresso"), $registration->attendee()->country_ID());
147 147
 					} else {
148
-						$value = $registration->attendee()->get_pretty( $field_name );
148
+						$value = $registration->attendee()->get_pretty($field_name);
149 149
 					}
150 150
 					//if field name is blank, leave the value as null too
151
-				}else{
152
-					$value = $registration->attendee()->get( $field_name );
151
+				} else {
152
+					$value = $registration->attendee()->get($field_name);
153 153
 				}
154 154
 			}
155 155
 			//if no field was found, leave value blank
156 156
 		}
157
-		return apply_filters( 'FHEE__EEM_Answer__get_attendee_question_answer_value__answer_value', $value, $registration, $question_id, $question_system_id );
157
+		return apply_filters('FHEE__EEM_Answer__get_attendee_question_answer_value__answer_value', $value, $registration, $question_id, $question_system_id);
158 158
 	}
159 159
 
160 160
 
Please login to merge, or discard this patch.
core/interfaces/EEI_Duplicatable.interface.php 1 patch
Spacing   +3 added lines, -3 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
 /**
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 *	with the exception of a particular attribute
27 27
 	 * @return object of the same class as what was called on
28 28
 	 */
29
-	public function duplicate( $options = array() );
29
+	public function duplicate($options = array());
30 30
 
31 31
 
32 32
 
Please login to merge, or discard this patch.
core/libraries/messages/defaults/default/email_main_wrapper.template.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
 	<!-- Facebook sharing information tags -->
8 8
 	<meta property="og:title" content="<?php echo $subject; ?>" />
9 9
 	<title><?php echo $subject; ?></title>
10
-	<?php do_action( 'AHEE__EE_Email_Messenger_main_wrapper_template_head', $message_type, $subject, $from, $main_body ); ?>
10
+	<?php do_action('AHEE__EE_Email_Messenger_main_wrapper_template_head', $message_type, $subject, $from, $main_body); ?>
11 11
 </head>
12
-<?php do_action( 'AHEE__EE_Email_Messenger_main_wrapper_template_header', $message_type, $subject, $from, $main_body ); ?>
12
+<?php do_action('AHEE__EE_Email_Messenger_main_wrapper_template_header', $message_type, $subject, $from, $main_body); ?>
13 13
 <body bgcolor="#FFFFFF" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
14
-<?php do_action( 'AHEE__EE_Email_Messenger_main_wrapper_template_before_main_body', $message_type, $subject, $from, $main_body ); ?>
14
+<?php do_action('AHEE__EE_Email_Messenger_main_wrapper_template_before_main_body', $message_type, $subject, $from, $main_body); ?>
15 15
 <?php echo $main_body; ?>
16
-<?php do_action( 'AHEE__EE_Email_Messenger_main_wrapper_template_after_main_body', $message_type, $subject, $from, $main_body ); ?>
16
+<?php do_action('AHEE__EE_Email_Messenger_main_wrapper_template_after_main_body', $message_type, $subject, $from, $main_body); ?>
17 17
 </body>
18
-<?php do_action( 'AHEE__EE_Email_Messenger_main_wrapper_template_footer', $message_type, $subject, $from, $main_body ); ?>
18
+<?php do_action('AHEE__EE_Email_Messenger_main_wrapper_template_footer', $message_type, $subject, $from, $main_body); ?>
19 19
 </html>
20 20
\ No newline at end of file
Please login to merge, or discard this patch.
core/libraries/messages/defaults/default/html_main_wrapper.template.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,21 +27,21 @@
 block discarded – undo
27 27
 		<!-- Primary Style Sheet -->
28 28
 		<link rel="stylesheet" type="text/css" href="<?php echo $main_css; ?>" />
29 29
 		<!-- Make sure the buttons don't print -->
30
-		<?php if ( isset( $extra_css )) : ?>
30
+		<?php if (isset($extra_css)) : ?>
31 31
 		<!-- Additional Style Sheet -->
32 32
 		<link rel="stylesheet" type="text/css" href="<?php echo $extra_css; ?>" />
33 33
 		<?php endif; ?>
34 34
 		<style type="text/css">
35 35
 		@media print{ .noPrint{ display:none !important;height:0!important; width:0!important; margin:0!important; padding:0!important; }}
36 36
 		</style>
37
-		<?php do_action( 'AHEE__EE_Html_Messenger_main_wrapper_template_head', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?>
37
+		<?php do_action('AHEE__EE_Html_Messenger_main_wrapper_template_head', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?>
38 38
 	</head>
39
-	<?php do_action( 'AHEE__EE_Html_Messenger_main_wrapper_template_header', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?>
39
+	<?php do_action('AHEE__EE_Html_Messenger_main_wrapper_template_header', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?>
40 40
 	<body>
41
-		<?php do_action( 'AHEE__EE_Html_Messenger_main_wrapper_template_before_main_body', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?>
41
+		<?php do_action('AHEE__EE_Html_Messenger_main_wrapper_template_before_main_body', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?>
42 42
 		<?php echo $main_body; ?>
43
-		<?php do_action( 'AHEE__EE_Html_Messenger_main_wrapper_template_after_main_body', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?>
43
+		<?php do_action('AHEE__EE_Html_Messenger_main_wrapper_template_after_main_body', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?>
44 44
 	</body>
45
-	<?php do_action( 'AHEE__EE_Html_Messenger_main_wrapper_template_footer', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?>
45
+	<?php do_action('AHEE__EE_Html_Messenger_main_wrapper_template_footer', $message_type, $page_title, $base_css, $print_css, $main_css, $main_body); ?>
46 46
 	<?php wp_footer(); ?>
47 47
 </html>
48 48
\ No newline at end of file
Please login to merge, or discard this patch.
core/libraries/template_parts/EE_Template_Part.class.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 //namespace EventEspresso\core\libraries\templates;
3 3
 
4
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
5
-	exit( 'No direct script access allowed' );
4
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 /**
8 8
  * Class EE_Template_Part
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
 	 * @param string $template
48 48
 	 * @param int    $priority
49 49
 	 */
50
-	public function __construct( $name, $label, $template, $priority = 100 ) {
51
-		$this->set_name( $name );
52
-		$this->set_label( $label );
53
-		$this->set_template( $template );
54
-		$this->set_priority( $priority );
50
+	public function __construct($name, $label, $template, $priority = 100) {
51
+		$this->set_name($name);
52
+		$this->set_label($label);
53
+		$this->set_template($template);
54
+		$this->set_priority($priority);
55 55
 	}
56 56
 
57 57
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	/**
69 69
 	 * @param mixed $name
70 70
 	 */
71
-	public function set_name( $name ) {
71
+	public function set_name($name) {
72 72
 		$this->name = $name;
73 73
 	}
74 74
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	/**
87 87
 	 * @param string $label
88 88
 	 */
89
-	public function set_label( $label ) {
89
+	public function set_label($label) {
90 90
 		$this->label = $label;
91 91
 	}
92 92
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	/**
105 105
 	 * @param string $template
106 106
 	 */
107
-	public function set_template( $template ) {
107
+	public function set_template($template) {
108 108
 		$this->template = $template;
109 109
 	}
110 110
 
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
 	/**
123 123
 	 * @param int $priority
124 124
 	 */
125
-	public function set_priority( $priority ) {
126
-		$this->priority = intval( $priority );
125
+	public function set_priority($priority) {
126
+		$this->priority = intval($priority);
127 127
 	}
128 128
 
129 129
 
Please login to merge, or discard this patch.
core/libraries/template_parts/EE_Template_Part_PriorityQueue.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 //namespace EventEspresso\core\libraries\templates;
3 3
 
4
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
5
-	exit( 'No direct script access allowed' );
4
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 /**
8 8
  * Class EE_Template_Part_PriorityQueue
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
 	 * @param int $priority
32 32
 	 * @return bool
33 33
 	 */
34
-	public function insert( $object, $priority = 100 ) {
35
-		if ( $object instanceof EE_Template_Part ) {
36
-			parent::insert( $object, $priority );
34
+	public function insert($object, $priority = 100) {
35
+		if ($object instanceof EE_Template_Part) {
36
+			parent::insert($object, $priority);
37 37
 			return true;
38 38
 		} else {
39 39
 			return false;
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
 	 * @param int $priority2
53 53
 	 * @return bool
54 54
 	 */
55
-	public function compare( $priority1, $priority2 ) {
56
-		if ( $priority1 === $priority2 ) {
55
+	public function compare($priority1, $priority2) {
56
+		if ($priority1 === $priority2) {
57 57
 			return 0;
58 58
 		}
59 59
 		return $priority1 > $priority2 ? -1 : 1;
Please login to merge, or discard this patch.
reg_steps/payment_options/events_requiring_pre_approval.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 /** @type string $events_requiring_pre_approval_msg */
4 4
 ?>
5 5
 
6
-<h4><span class="orange-text"><?php _e('Important Notice: Events Requiring Pre-Approval', 'event_espresso');?></span></h4>
6
+<h4><span class="orange-text"><?php _e('Important Notice: Events Requiring Pre-Approval', 'event_espresso'); ?></span></h4>
7 7
 	<p id="events-requiring-pre-approval-pg" class="small-text drk-grey-text">
8 8
 		<?php echo $events_requiring_pre_approval_msg; ?>
9 9
 	</p>
Please login to merge, or discard this patch.