Completed
Branch FET-9413-questions-refactor (7aebbc)
by
unknown
89:53 queued 78:26
created
modules/bot_trap/EED_Bot_Trap.module.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 * @return EED_Bot_Trap
19 19
 	 */
20 20
 	public static function instance() {
21
-		return parent::get_instance( __CLASS__ );
21
+		return parent::get_instance(__CLASS__);
22 22
 	}
23 23
 
24 24
 
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 	 */
32 32
 	public static function set_hooks() {
33 33
         if (
34
-			apply_filters( 'FHEE__EED_Bot_Trap__set_hooks__use_bot_trap', true ) &&
34
+			apply_filters('FHEE__EED_Bot_Trap__set_hooks__use_bot_trap', true) &&
35 35
 			\EE_Registry::instance()->CFG->registration->use_bot_trap
36 36
 		) {
37 37
             \EED_Bot_Trap::set_trap();
38 38
 			// redirect bots to bogus success page
39
-			\EE_Config::register_route( 'ticket_selection_received', 'EED_Bot_Trap', 'display_bot_trap_success' );
39
+			\EE_Config::register_route('ticket_selection_received', 'EED_Bot_Trap', 'display_bot_trap_success');
40 40
 		}
41 41
 	}
42 42
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 *  @return 	void
50 50
 	 */
51 51
 	public static function set_trap() {
52
-        define('EE_BOT_TRAP_BASE_URL', plugin_dir_url(__FILE__) . DS);
52
+        define('EE_BOT_TRAP_BASE_URL', plugin_dir_url(__FILE__).DS);
53 53
         add_action(
54 54
             'AHEE__ticket_selector_chart__template__after_ticket_selector',
55 55
             array('EED_Bot_Trap', 'generate_bot_trap'),
@@ -81,12 +81,12 @@  discard block
 block discarded – undo
81 81
         }
82 82
         add_action(
83 83
 			'AHEE__Extend_Registration_Form_Admin_Page___reg_form_settings_template',
84
-			array( 'EED_Bot_Trap', 'bot_trap_settings_form' ),
84
+			array('EED_Bot_Trap', 'bot_trap_settings_form'),
85 85
 			10
86 86
 		);
87 87
 		add_filter(
88 88
 			'FHEE__Extend_Registration_Form_Admin_Page___update_reg_form_settings__CFG_registration',
89
-			array( 'EED_Bot_Trap', 'update_bot_trap_settings_form' ),
89
+			array('EED_Bot_Trap', 'update_bot_trap_settings_form'),
90 90
 			10, 1
91 91
 		);
92 92
 	}
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	 * @param    WP $WP
101 101
 	 * @return    void
102 102
 	 */
103
-	public function run( $WP ) {}
103
+	public function run($WP) {}
104 104
 
105 105
 
106 106
 
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
 	 * @return    void
112 112
 	 */
113 113
 	public static function generate_bot_trap() {
114
-		$do_not_enter = esc_html__( 'please do not enter anything in this input', 'event_espresso' );
114
+		$do_not_enter = esc_html__('please do not enter anything in this input', 'event_espresso');
115 115
 		$html = '<div id="tkt-slctr-request-processor-dv" style="float:left; margin:0 0 0 -999em; height: 0;">';
116
-		$html .= '<label for="tkt-slctr-request-processor-email">' . $do_not_enter  . '</label>';
116
+		$html .= '<label for="tkt-slctr-request-processor-email">'.$do_not_enter.'</label>';
117 117
 		$html .= '<input type="email" name="tkt-slctr-request-processor-email" value=""/>';
118 118
 		$html .= '<input type="hidden" name="tkt-slctr-request-processor-token" value="';
119
-		if ( EE_Registry::instance()->CFG->registration->use_encryption ) {
120
-			EE_Registry::instance()->load_core( 'EE_Encryption' );
121
-			$html .= EE_Encryption::instance()->encrypt( time() );
119
+		if (EE_Registry::instance()->CFG->registration->use_encryption) {
120
+			EE_Registry::instance()->load_core('EE_Encryption');
121
+			$html .= EE_Encryption::instance()->encrypt(time());
122 122
 		} else {
123 123
 			$html .= time();
124 124
 		}
@@ -136,38 +136,38 @@  discard block
 block discarded – undo
136 136
      *                                              It should receive one argument: a boolean indicating
137 137
      *                                              whether the trap was triggered by suspicious timing or not.
138 138
 	 */
139
-	public static function process_bot_trap( $triggered_trap_callback = array() ) {
139
+	public static function process_bot_trap($triggered_trap_callback = array()) {
140 140
         // what's your email address Mr. Bot ?
141
-		$empty_trap = isset( $_REQUEST[ 'tkt-slctr-request-processor-email' ] )
142
-                      && $_REQUEST[ 'tkt-slctr-request-processor-email' ] === ''
141
+		$empty_trap = isset($_REQUEST['tkt-slctr-request-processor-email'])
142
+                      && $_REQUEST['tkt-slctr-request-processor-email'] === ''
143 143
             ? true
144 144
             : false;
145 145
 		// get encrypted timestamp for when the form was originally displayed
146
-		$bot_trap_timestamp = isset( $_REQUEST[ 'tkt-slctr-request-processor-token' ] )
147
-            ? sanitize_text_field( $_REQUEST[ 'tkt-slctr-request-processor-token' ] )
146
+		$bot_trap_timestamp = isset($_REQUEST['tkt-slctr-request-processor-token'])
147
+            ? sanitize_text_field($_REQUEST['tkt-slctr-request-processor-token'])
148 148
             : '';
149 149
 		// decrypt and convert to absolute  integer
150
-		if ( EE_Registry::instance()->CFG->registration->use_encryption ) {
151
-			EE_Registry::instance()->load_core( 'EE_Encryption' );
152
-			$bot_trap_timestamp = absint( EE_Encryption::instance()->decrypt( $bot_trap_timestamp ) );
150
+		if (EE_Registry::instance()->CFG->registration->use_encryption) {
151
+			EE_Registry::instance()->load_core('EE_Encryption');
152
+			$bot_trap_timestamp = absint(EE_Encryption::instance()->decrypt($bot_trap_timestamp));
153 153
 		} else {
154
-			$bot_trap_timestamp = absint( $bot_trap_timestamp );
154
+			$bot_trap_timestamp = absint($bot_trap_timestamp);
155 155
 		}
156 156
 		// ticket form submitted too impossibly fast ( after now ) or more than an hour later ???
157
-		$suspicious_timing = $bot_trap_timestamp > time() || $bot_trap_timestamp < ( time() - HOUR_IN_SECONDS )
157
+		$suspicious_timing = $bot_trap_timestamp > time() || $bot_trap_timestamp < (time() - HOUR_IN_SECONDS)
158 158
             ? true
159 159
             : false;
160 160
 		// are we human ?
161
-		if ( $empty_trap && ! $suspicious_timing ) {
161
+		if ($empty_trap && ! $suspicious_timing) {
162 162
 		    do_action('AHEE__EED_Bot_Trap__process_bot_trap__trap_not_triggered');
163 163
 			return;
164 164
 		}
165 165
 		// check the given callback is valid first before executing
166
-		if ( ! is_callable($triggered_trap_callback ) ) {
166
+		if ( ! is_callable($triggered_trap_callback)) {
167 167
 			// invalid callback so lets just sub in our default.
168
-            $triggered_trap_callback = array( 'EED_Bot_Trap', 'triggered_trap_response' );
168
+            $triggered_trap_callback = array('EED_Bot_Trap', 'triggered_trap_response');
169 169
 		}
170
-		call_user_func_array($triggered_trap_callback, array( $suspicious_timing ) );
170
+		call_user_func_array($triggered_trap_callback, array($suspicious_timing));
171 171
 	}
172 172
 
173 173
 
@@ -178,15 +178,15 @@  discard block
 block discarded – undo
178 178
 	 *
179 179
 	 * @param bool  $suspicious_timing  If true, then the bot trap was triggered due to the suspicious timing test.
180 180
 	 */
181
-	public static function triggered_trap_response( $suspicious_timing ) {
181
+	public static function triggered_trap_response($suspicious_timing) {
182 182
 		// UH OH...
183 183
 		$redirect_url = add_query_arg(
184
-			array( 'ee' => 'ticket_selection_received' ),
184
+			array('ee' => 'ticket_selection_received'),
185 185
 			EE_Registry::instance()->CFG->core->reg_page_url()
186 186
 		);
187
-		if ( $suspicious_timing ) {
187
+		if ($suspicious_timing) {
188 188
 			$redirect_url = add_query_arg(
189
-				array( 'ee-notice' => urlencode( esc_html__( 'We\'re sorry, but your ticket selections could not be processed due to a server timing error. Please hit the back button on your browser and try again.', 'event_espresso' ) ) ),
189
+				array('ee-notice' => urlencode(esc_html__('We\'re sorry, but your ticket selections could not be processed due to a server timing error. Please hit the back button on your browser and try again.', 'event_espresso'))),
190 190
 				$redirect_url
191 191
 			);
192 192
 		}
@@ -217,10 +217,10 @@  discard block
 block discarded – undo
217 217
 	 * @return    void
218 218
 	 */
219 219
 	public static function display_bot_trap_success() {
220
-		add_filter( 'FHEE__EED_Single_Page_Checkout__run', '__return_false' );
221
-		$bot_notice = esc_html__( 'Thank you so much. Your ticket selections have been received for consideration.', 'event_espresso' );
222
-		$bot_notice = isset( $_REQUEST[ 'ee-notice' ] ) && $_REQUEST[ 'ee-notice' ] !== '' ? sanitize_text_field( stripslashes( $_REQUEST[ 'ee-notice' ] ) ) : $bot_notice;
223
-		EE_Registry::instance()->REQ->add_output( EEH_HTML::div( $bot_notice, '', 'ee-attention' ) );
220
+		add_filter('FHEE__EED_Single_Page_Checkout__run', '__return_false');
221
+		$bot_notice = esc_html__('Thank you so much. Your ticket selections have been received for consideration.', 'event_espresso');
222
+		$bot_notice = isset($_REQUEST['ee-notice']) && $_REQUEST['ee-notice'] !== '' ? sanitize_text_field(stripslashes($_REQUEST['ee-notice'])) : $bot_notice;
223
+		EE_Registry::instance()->REQ->add_output(EEH_HTML::div($bot_notice, '', 'ee-attention'));
224 224
 	}
225 225
 
226 226
 
@@ -255,20 +255,20 @@  discard block
 block discarded – undo
255 255
 				'html_id'         			=> 'bot_trap_settings',
256 256
 				'layout_strategy' 	=> new EE_Admin_Two_Column_Layout(),
257 257
 				'subsections'     		=> array(
258
-					'bot_trap_hdr' 		=> new EE_Form_Section_HTML( EEH_HTML::h2( esc_html__( 'Bot Trap Settings', 'event_espresso' ) ) ),
258
+					'bot_trap_hdr' 		=> new EE_Form_Section_HTML(EEH_HTML::h2(esc_html__('Bot Trap Settings', 'event_espresso'))),
259 259
 					'use_bot_trap' 		=> new EE_Yes_No_Input(
260 260
 						array(
261
-							'html_label_text' 	=> esc_html__( 'Enable Bot Trap', 'event_espresso' ),
262
-							'html_help_text' 		=>  esc_html__( 'The Event Espresso Bot Trap will insert a fake input into your Ticket Selector forms that is hidden from regular site visitors, but visible to spam bots. Because the input asks for an email address, it is irresistible to spam bots who will of course enter text into it. Since regular site visitors can not see this input, any value detected during form submission means a bot has been detected, which will then be blocked from submitting the form.', 'event_espresso' ),
263
-							'default'        			=> isset( EE_Registry::instance()->CFG->registration->use_bot_trap ) ? EE_Registry::instance()->CFG->registration->use_bot_trap : true,
261
+							'html_label_text' 	=> esc_html__('Enable Bot Trap', 'event_espresso'),
262
+							'html_help_text' 		=>  esc_html__('The Event Espresso Bot Trap will insert a fake input into your Ticket Selector forms that is hidden from regular site visitors, but visible to spam bots. Because the input asks for an email address, it is irresistible to spam bots who will of course enter text into it. Since regular site visitors can not see this input, any value detected during form submission means a bot has been detected, which will then be blocked from submitting the form.', 'event_espresso'),
263
+							'default'        			=> isset(EE_Registry::instance()->CFG->registration->use_bot_trap) ? EE_Registry::instance()->CFG->registration->use_bot_trap : true,
264 264
 							'required'        		=> false
265 265
 						)
266 266
 					),
267 267
 					'use_encryption' 		=> new EE_Yes_No_Input(
268 268
 						array(
269
-							'html_label_text' 	=> esc_html__( 'Encrypt Bot Trap Data', 'event_espresso' ),
270
-							'html_help_text' 		=>  esc_html__( 'One way to detect spam bots is by looking at how long it takes them to submit a form. They are often inhumanly fast, or will submit forms hours, days, or even weeks after the form was first scraped off the web. The Event Espresso Bot Trap will send a timestamp with the Ticket Selector form when it is submitted. By default, this timestamp is encrypted so that the spam bots can not change it, but encryption may cause issues on some servers due to configuration "conflicts". If you continuously get caught in the bot trap, then try setting this option to "No". This may increase the number of spam submissions you receive, but increases server compatibility.', 'event_espresso' ),
271
-							'default'        			=> isset( EE_Registry::instance()->CFG->registration->use_encryption ) ? EE_Registry::instance()->CFG->registration->use_encryption : true,
269
+							'html_label_text' 	=> esc_html__('Encrypt Bot Trap Data', 'event_espresso'),
270
+							'html_help_text' 		=>  esc_html__('One way to detect spam bots is by looking at how long it takes them to submit a form. They are often inhumanly fast, or will submit forms hours, days, or even weeks after the form was first scraped off the web. The Event Espresso Bot Trap will send a timestamp with the Ticket Selector form when it is submitted. By default, this timestamp is encrypted so that the spam bots can not change it, but encryption may cause issues on some servers due to configuration "conflicts". If you continuously get caught in the bot trap, then try setting this option to "No". This may increase the number of spam submissions you receive, but increases server compatibility.', 'event_espresso'),
271
+							'default'        			=> isset(EE_Registry::instance()->CFG->registration->use_encryption) ? EE_Registry::instance()->CFG->registration->use_encryption : true,
272 272
 							'required'        		=> false
273 273
 						)
274 274
 					),
@@ -286,30 +286,30 @@  discard block
 block discarded – undo
286 286
 	 * @param \EE_Registration_Config $EE_Registration_Config
287 287
 	 * @return \EE_Registration_Config
288 288
 	 */
289
-	public static function update_bot_trap_settings_form( EE_Registration_Config $EE_Registration_Config ) {
289
+	public static function update_bot_trap_settings_form(EE_Registration_Config $EE_Registration_Config) {
290 290
 		try {
291 291
 			$bot_trap_settings_form = EED_Bot_Trap::_bot_trap_settings_form();
292 292
 			// if not displaying a form, then check for form submission
293
-			if ( $bot_trap_settings_form->was_submitted() ) {
293
+			if ($bot_trap_settings_form->was_submitted()) {
294 294
 				// capture form data
295 295
 				$bot_trap_settings_form->receive_form_submission();
296 296
 				// validate form data
297
-				if ( $bot_trap_settings_form->is_valid() ) {
297
+				if ($bot_trap_settings_form->is_valid()) {
298 298
 					// grab validated data from form
299 299
 					$valid_data = $bot_trap_settings_form->valid_data();
300
-					if ( isset( $valid_data[ 'use_bot_trap' ], $valid_data[ 'use_encryption' ] ) ) {
301
-						$EE_Registration_Config->use_bot_trap = $valid_data[ 'use_bot_trap' ];
302
-						$EE_Registration_Config->use_encryption = $valid_data[ 'use_encryption' ];
300
+					if (isset($valid_data['use_bot_trap'], $valid_data['use_encryption'])) {
301
+						$EE_Registration_Config->use_bot_trap = $valid_data['use_bot_trap'];
302
+						$EE_Registration_Config->use_encryption = $valid_data['use_encryption'];
303 303
 					} else {
304
-						EE_Error::add_error( esc_html__( 'Invalid or missing Bot Trap settings. Please refresh the form and try again.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
304
+						EE_Error::add_error(esc_html__('Invalid or missing Bot Trap settings. Please refresh the form and try again.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
305 305
 					}
306 306
 				} else {
307
-					if ( $bot_trap_settings_form->submission_error_message() != '' ) {
308
-						EE_Error::add_error( $bot_trap_settings_form->submission_error_message(), __FILE__, __FUNCTION__, __LINE__ );
307
+					if ($bot_trap_settings_form->submission_error_message() != '') {
308
+						EE_Error::add_error($bot_trap_settings_form->submission_error_message(), __FILE__, __FUNCTION__, __LINE__);
309 309
 					}
310 310
 				}
311 311
 			}
312
-		} catch ( EE_Error $e ) {
312
+		} catch (EE_Error $e) {
313 313
 			$e->get_error();
314 314
 		}
315 315
 		return $EE_Registration_Config;
Please login to merge, or discard this patch.
modules/ticket_selector/templates/ticket_selector_chart_iframe.template.php 1 patch
Indentation   -3 removed lines patch added patch discarded remove patch
@@ -1,16 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3 3
  * Template for the ticket selector when displayed in an iframe.
4
-
5 4
  * Following template arguments are available:
6
-
7 5
  * @type string $notices	HTML for notices and ajax gif
8 6
  * @type string $ticket_selector This is the html for the ticket selector.
9 7
  * @type string $powered_by credit link
10 8
  * @type array $css 		An array of css urls.
11 9
  * @type string $eei18n 	localized JSON vars
12 10
  * @type array $js 			An array of js urls.
13
-
14 11
  * @since 4.6.7
15 12
  * @package Event Espresso
16 13
  * @subpackage module
Please login to merge, or discard this patch.
admin_pages/transactions/Transactions_Admin_Page.core.php 2 patches
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -106,9 +106,9 @@  discard block
 block discarded – undo
106 106
 
107 107
 	/**
108 108
 	 * 		grab url requests and route them
109
-	*		@access private
110
-	*		@return void
111
-	*/
109
+	 *		@access private
110
+	 *		@return void
111
+	 */
112 112
 	public function _set_page_routes() {
113 113
 
114 114
 		$this->_set_transaction_status_array();
@@ -263,10 +263,10 @@  discard block
 block discarded – undo
263 263
 	/**
264 264
 	 * _set_transaction_status_array
265 265
 	 * sets list of transaction statuses
266
-	*
266
+	 *
267 267
 	 * @access private
268
-	*	@return void
269
-	*/
268
+	 *	@return void
269
+	 */
270 270
 	private function _set_transaction_status_array() {
271 271
 		self::$_txn_status = EEM_Transaction::instance()->status_array(TRUE);
272 272
 	}
@@ -288,10 +288,10 @@  discard block
 block discarded – undo
288 288
 
289 289
 	/**
290 290
 	 * 	get list of payment statuses
291
-	*
291
+	 *
292 292
 	 * @access private
293
-	*	@return void
294
-	*/
293
+	 *	@return void
294
+	 */
295 295
 	private function _get_payment_status_array() {
296 296
 		self::$_pay_status = EEM_Payment::instance()->status_array(TRUE);
297 297
 		$this->_template_args['payment_status'] = self::$_pay_status;
@@ -399,19 +399,19 @@  discard block
 block discarded – undo
399 399
 		if ( is_object( $this->_transaction) )
400 400
 			return; //get out we've already set the object
401 401
 
402
-	    $TXN = EEM_Transaction::instance();
402
+		$TXN = EEM_Transaction::instance();
403 403
 
404
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
404
+		$TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
405 405
 
406
-	    //get transaction object
407
-	    $this->_transaction = $TXN->get_one_by_ID($TXN_ID);
408
-	    $this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
406
+		//get transaction object
407
+		$this->_transaction = $TXN->get_one_by_ID($TXN_ID);
408
+		$this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
409 409
 		$this->_transaction->verify_abandoned_transaction_status();
410 410
 
411 411
 	 	if ( empty( $this->_transaction ) ) {
412
-	    	$error_msg = esc_html__('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  esc_html__(' could not be retrieved.', 'event_espresso');
412
+			$error_msg = esc_html__('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  esc_html__(' could not be retrieved.', 'event_espresso');
413 413
 			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
414
-	    }
414
+		}
415 415
 	}
416 416
 
417 417
 
@@ -526,12 +526,12 @@  discard block
 block discarded – undo
526 526
 
527 527
 
528 528
 	/**
529
-	* 	_transaction_details
529
+	 * 	_transaction_details
530 530
 	 * generates HTML for the View Transaction Details Admin page
531
-	*
531
+	 *
532 532
 	 * @access protected
533
-	*	@return void
534
-	*/
533
+	 *	@return void
534
+	 */
535 535
 	protected function _transaction_details() {
536 536
 		do_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction );
537 537
 
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 						'button secondary-button right',
583 583
 						'dashicons dashicons-email-alt'
584 584
 					)
585
-				    : '';
585
+					: '';
586 586
 		} else {
587 587
 			$this->_template_args['send_payment_reminder_button'] = '';
588 588
 		}
@@ -736,10 +736,10 @@  discard block
 block discarded – undo
736 736
 	/**
737 737
 	 * txn_details_meta_box
738 738
 	 * generates HTML for the Transaction main meta box
739
-	*
739
+	 *
740 740
 	 * @access public
741
-	*	@return void
742
-	*/
741
+	 *	@return void
742
+	 */
743 743
 	public function txn_details_meta_box() {
744 744
 
745 745
 		$this->_set_transaction_object();
@@ -1115,10 +1115,10 @@  discard block
 block discarded – undo
1115 1115
 	/**
1116 1116
 	 * txn_billing_info_side_meta_box
1117 1117
 	 * 	generates HTML for the Edit Transaction side meta box
1118
-	*
1118
+	 *
1119 1119
 	 * @access public
1120
-	*	@return void
1121
-	*/
1120
+	 *	@return void
1121
+	 */
1122 1122
 	public function txn_billing_info_side_meta_box() {
1123 1123
 
1124 1124
 		$this->_template_args['billing_form'] = $this->_transaction->billing_info();
@@ -1136,10 +1136,10 @@  discard block
 block discarded – undo
1136 1136
 	/**
1137 1137
 	 * apply_payments_or_refunds
1138 1138
 	 * 	registers a payment or refund made towards a transaction
1139
-	*
1139
+	 *
1140 1140
 	 * @access public
1141
-	*	@return void
1142
-	*/
1141
+	 *	@return void
1142
+	 */
1143 1143
 	public function apply_payments_or_refunds() {
1144 1144
 		$json_response_data = array( 'return_data' => FALSE );
1145 1145
 		$valid_data = $this->_validate_payment_request_data();
@@ -1293,9 +1293,9 @@  discard block
 block discarded – undo
1293 1293
 							'default' => '',
1294 1294
 							'required' => false,
1295 1295
 							'html_label_text' => esc_html__( 'Transaction or Cheque Number', 'event_espresso' ),
1296
-                                                        'validation_strategies' => array(
1297
-                                                            new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1298
-                                                        )
1296
+														'validation_strategies' => array(
1297
+															new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1298
+														)
1299 1299
 						)
1300 1300
 					),
1301 1301
 					'po_number' => new EE_Text_Input(
@@ -1303,9 +1303,9 @@  discard block
 block discarded – undo
1303 1303
 							'default' => '',
1304 1304
 							'required' => false,
1305 1305
 							'html_label_text' => esc_html__( 'Purchase Order Number', 'event_espresso' ),
1306
-                                                        'validation_strategies' => array(
1307
-                                                            new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1308
-                                                        )
1306
+														'validation_strategies' => array(
1307
+															new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1308
+														)
1309 1309
 						)
1310 1310
 					),
1311 1311
 					'accounting' => new EE_Text_Input(
@@ -1313,9 +1313,9 @@  discard block
 block discarded – undo
1313 1313
 							'default' => '',
1314 1314
 							'required' => false,
1315 1315
 							'html_label_text' => esc_html__( 'Extra Field for Accounting', 'event_espresso' ),
1316
-                                                        'validation_strategies' => array(
1317
-                                                            new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1318
-                                                        )
1316
+														'validation_strategies' => array(
1317
+															new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1318
+														)
1319 1319
 						)
1320 1320
 					),
1321 1321
 				)
@@ -1610,10 +1610,10 @@  discard block
 block discarded – undo
1610 1610
 	/**
1611 1611
 	 * delete_payment
1612 1612
 	 * 	delete a payment or refund made towards a transaction
1613
-	*
1613
+	 *
1614 1614
 	 * @access public
1615
-	*	@return void
1616
-	*/
1615
+	 *	@return void
1616
+	 */
1617 1617
 	public function delete_payment() {
1618 1618
 		$json_response_data = array( 'return_data' => FALSE );
1619 1619
 		$PAY_ID = isset( $this->_req_data['delete_txn_admin_payment'], $this->_req_data['delete_txn_admin_payment']['PAY_ID'] ) ? absint( $this->_req_data['delete_txn_admin_payment']['PAY_ID'] ) : 0;
@@ -1730,12 +1730,12 @@  discard block
 block discarded – undo
1730 1730
 	/**
1731 1731
 	 * _send_payment_reminder
1732 1732
 	 * 	generates HTML for the View Transaction Details Admin page
1733
-	*
1733
+	 *
1734 1734
 	 * @access protected
1735
-	*	@return void
1736
-	*/
1735
+	 *	@return void
1736
+	 */
1737 1737
 	protected function _send_payment_reminder() {
1738
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1738
+		$TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1739 1739
 		$transaction = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
1740 1740
 		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID'] ) : array();
1741 1741
 		do_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction );
@@ -1757,29 +1757,29 @@  discard block
 block discarded – undo
1757 1757
 
1758 1758
 		$TXN = EEM_Transaction::instance();
1759 1759
 
1760
-	    $start_date = isset( $this->_req_data['txn-filter-start-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-start-date'] ) : date( 'm/d/Y', strtotime( '-10 year' ));
1761
-	    $end_date = isset( $this->_req_data['txn-filter-end-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-end-date'] ) : date( 'm/d/Y' );
1760
+		$start_date = isset( $this->_req_data['txn-filter-start-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-start-date'] ) : date( 'm/d/Y', strtotime( '-10 year' ));
1761
+		$end_date = isset( $this->_req_data['txn-filter-end-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-end-date'] ) : date( 'm/d/Y' );
1762 1762
 
1763
-	    //make sure our timestamps start and end right at the boundaries for each day
1764
-	    $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1765
-	    $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1763
+		//make sure our timestamps start and end right at the boundaries for each day
1764
+		$start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1765
+		$end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1766 1766
 
1767 1767
 
1768
-	    //convert to timestamps
1769
-	    $start_date = strtotime( $start_date );
1770
-	    $end_date = strtotime( $end_date );
1768
+		//convert to timestamps
1769
+		$start_date = strtotime( $start_date );
1770
+		$end_date = strtotime( $end_date );
1771 1771
 
1772
-	    //makes sure start date is the lowest value and vice versa
1773
-	    $start_date = min( $start_date, $end_date );
1774
-	    $end_date = max( $start_date, $end_date );
1772
+		//makes sure start date is the lowest value and vice versa
1773
+		$start_date = min( $start_date, $end_date );
1774
+		$end_date = max( $start_date, $end_date );
1775 1775
 
1776
-	    //convert to correct format for query
1776
+		//convert to correct format for query
1777 1777
 	$start_date = EEM_Transaction::instance()->convert_datetime_for_query( 'TXN_timestamp', date( 'Y-m-d H:i:s', $start_date ), 'Y-m-d H:i:s' );
1778 1778
 	$end_date = EEM_Transaction::instance()->convert_datetime_for_query( 'TXN_timestamp', date( 'Y-m-d H:i:s', $end_date ), 'Y-m-d H:i:s' );
1779 1779
 
1780 1780
 
1781 1781
 
1782
-	    //set orderby
1782
+		//set orderby
1783 1783
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
1784 1784
 
1785 1785
 		switch ( $this->_req_data['orderby'] ) {
Please login to merge, or discard this patch.
Spacing   +418 added lines, -418 removed lines patch added patch discarded remove patch
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 	 * @param bool $routing
57 57
 	 * @return Transactions_Admin_Page
58 58
 	 */
59
-	public function __construct( $routing = TRUE ) {
60
-		parent::__construct( $routing );
59
+	public function __construct($routing = TRUE) {
60
+		parent::__construct($routing);
61 61
 	}
62 62
 
63 63
 
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
 	 * @return void
81 81
 	 */
82 82
 	protected function _ajax_hooks() {
83
-		add_action('wp_ajax_espresso_apply_payment', array( $this, 'apply_payments_or_refunds'));
84
-		add_action('wp_ajax_espresso_apply_refund', array( $this, 'apply_payments_or_refunds'));
85
-		add_action('wp_ajax_espresso_delete_payment', array( $this, 'delete_payment'));
83
+		add_action('wp_ajax_espresso_apply_payment', array($this, 'apply_payments_or_refunds'));
84
+		add_action('wp_ajax_espresso_apply_refund', array($this, 'apply_payments_or_refunds'));
85
+		add_action('wp_ajax_espresso_delete_payment', array($this, 'delete_payment'));
86 86
 	}
87 87
 
88 88
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 			'buttons' => array(
98 98
 				'add' => esc_html__('Add New Transaction', 'event_espresso'),
99 99
 				'edit' => esc_html__('Edit Transaction', 'event_espresso'),
100
-				'delete' => esc_html__('Delete Transaction','event_espresso'),
100
+				'delete' => esc_html__('Delete Transaction', 'event_espresso'),
101 101
 			)
102 102
 		);
103 103
 	}
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
 		$this->_set_transaction_status_array();
115 115
 
116
-		$txn_id = ! empty( $this->_req_data['TXN_ID'] ) && ! is_array( $this->_req_data['TXN_ID'] ) ? $this->_req_data['TXN_ID'] : 0;
116
+		$txn_id = ! empty($this->_req_data['TXN_ID']) && ! is_array($this->_req_data['TXN_ID']) ? $this->_req_data['TXN_ID'] : 0;
117 117
 
118 118
 		$this->_page_routes = array(
119 119
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 						'filename' => 'transactions_overview_views_filters_search'
186 186
 					),
187 187
 				),
188
-				'help_tour' => array( 'Transactions_Overview_Help_Tour' ),
188
+				'help_tour' => array('Transactions_Overview_Help_Tour'),
189 189
 				/**
190 190
 				 * commented out because currently we are not displaying tips for transaction list table status but this
191 191
 				 * may change in a later iteration so want to keep the code for then.
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 				'nav' => array(
198 198
 					'label' => esc_html__('View Transaction', 'event_espresso'),
199 199
 					'order' => 5,
200
-					'url' => isset($this->_req_data['TXN_ID']) ? add_query_arg(array('TXN_ID' => $this->_req_data['TXN_ID'] ), $this->_current_page_view_url )  : $this->_admin_base_url,
200
+					'url' => isset($this->_req_data['TXN_ID']) ? add_query_arg(array('TXN_ID' => $this->_req_data['TXN_ID']), $this->_current_page_view_url) : $this->_admin_base_url,
201 201
 					'persistent' => FALSE
202 202
 					),
203 203
 				'help_tabs' => array(
@@ -218,8 +218,8 @@  discard block
 block discarded – undo
218 218
 						'filename' => 'transactions_view_transaction_primary_registrant_billing_information'
219 219
 					),
220 220
 				),
221
-				'qtips' => array( 'Transaction_Details_Tips' ),
222
-				'help_tour' => array( 'Transaction_Details_Help_Tour' ),
221
+				'qtips' => array('Transaction_Details_Tips'),
222
+				'help_tour' => array('Transaction_Details_Help_Tour'),
223 223
 				'metaboxes' => array('_transaction_details_metaboxes'),
224 224
 
225 225
 				'require_nonce' => FALSE
@@ -237,23 +237,23 @@  discard block
 block discarded – undo
237 237
 		// IF a registration was JUST added via the admin...
238 238
 		if (
239 239
 		isset(
240
-			$this->_req_data[ 'redirect_from' ],
241
-			$this->_req_data[ 'EVT_ID' ],
242
-			$this->_req_data[ 'event_name' ]
240
+			$this->_req_data['redirect_from'],
241
+			$this->_req_data['EVT_ID'],
242
+			$this->_req_data['event_name']
243 243
 		)
244 244
 		) {
245 245
 			// then set a cookie so that we can block any attempts to use
246 246
 			// the back button as a way to enter another registration.
247
-			setcookie( 'ee_registration_added', $this->_req_data[ 'EVT_ID' ], time() + WEEK_IN_SECONDS, '/' );
247
+			setcookie('ee_registration_added', $this->_req_data['EVT_ID'], time() + WEEK_IN_SECONDS, '/');
248 248
 			// and update the global
249
-			$_COOKIE[ 'ee_registration_added' ] = $this->_req_data[ 'EVT_ID' ];
249
+			$_COOKIE['ee_registration_added'] = $this->_req_data['EVT_ID'];
250 250
 		}
251
-		EE_Registry::$i18n_js_strings[ 'invalid_server_response' ] = esc_html__( 'An error occurred! Your request may have been processed, but a valid response from the server was not received. Please refresh the page and try again.', 'event_espresso' );
252
-		EE_Registry::$i18n_js_strings[ 'error_occurred' ] = esc_html__( 'An error occurred! Please refresh the page and try again.', 'event_espresso' );
253
-		EE_Registry::$i18n_js_strings[ 'txn_status_array' ] = self::$_txn_status;
254
-		EE_Registry::$i18n_js_strings[ 'pay_status_array' ] = self::$_pay_status;
255
-		EE_Registry::$i18n_js_strings[ 'payments_total' ] = esc_html__( 'Payments Total', 'event_espresso' );
256
-		EE_Registry::$i18n_js_strings[ 'transaction_overpaid' ] = esc_html__( 'This transaction has been overpaid ! Payments Total', 'event_espresso' );
251
+		EE_Registry::$i18n_js_strings['invalid_server_response'] = esc_html__('An error occurred! Your request may have been processed, but a valid response from the server was not received. Please refresh the page and try again.', 'event_espresso');
252
+		EE_Registry::$i18n_js_strings['error_occurred'] = esc_html__('An error occurred! Please refresh the page and try again.', 'event_espresso');
253
+		EE_Registry::$i18n_js_strings['txn_status_array'] = self::$_txn_status;
254
+		EE_Registry::$i18n_js_strings['pay_status_array'] = self::$_pay_status;
255
+		EE_Registry::$i18n_js_strings['payments_total'] = esc_html__('Payments Total', 'event_espresso');
256
+		EE_Registry::$i18n_js_strings['transaction_overpaid'] = esc_html__('This transaction has been overpaid ! Payments Total', 'event_espresso');
257 257
 	}
258 258
 	public function admin_notices() {}
259 259
 	public function admin_footer_scripts() {}
@@ -320,14 +320,14 @@  discard block
 block discarded – undo
320 320
 	 */
321 321
 	public function load_scripts_styles() {
322 322
 		//enqueue style
323
-		wp_register_style( 'espresso_txn', TXN_ASSETS_URL . 'espresso_transactions_admin.css', array(), EVENT_ESPRESSO_VERSION );
323
+		wp_register_style('espresso_txn', TXN_ASSETS_URL.'espresso_transactions_admin.css', array(), EVENT_ESPRESSO_VERSION);
324 324
 		wp_enqueue_style('espresso_txn');
325 325
 
326 326
 		//scripts
327 327
 		add_filter('FHEE_load_accounting_js', '__return_true');
328 328
 
329 329
 		//scripts
330
-		wp_register_script('espresso_txn', TXN_ASSETS_URL . 'espresso_transactions_admin.js', array('ee_admin_js', 'ee-datepicker', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'ee-dialog', 'ee-accounting', 'ee-serialize-full-array'), EVENT_ESPRESSO_VERSION, TRUE);
330
+		wp_register_script('espresso_txn', TXN_ASSETS_URL.'espresso_transactions_admin.js', array('ee_admin_js', 'ee-datepicker', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'ee-dialog', 'ee-accounting', 'ee-serialize-full-array'), EVENT_ESPRESSO_VERSION, TRUE);
331 331
 		wp_enqueue_script('espresso_txn');
332 332
 
333 333
 	}
@@ -367,8 +367,8 @@  discard block
 block discarded – undo
367 367
 	 *	@return void
368 368
 	 */
369 369
 	protected function _set_list_table_views_default() {
370
-		$this->_views = array (
371
-			'all' => array (
370
+		$this->_views = array(
371
+			'all' => array(
372 372
 				'slug' 		=> 'all',
373 373
 				'label' 		=> esc_html__('View All Transactions', 'event_espresso'),
374 374
 				'count' 	=> 0
@@ -396,21 +396,21 @@  discard block
 block discarded – undo
396 396
 	 *	@return void
397 397
 	 */
398 398
 	private function _set_transaction_object() {
399
-		if ( is_object( $this->_transaction) )
399
+		if (is_object($this->_transaction))
400 400
 			return; //get out we've already set the object
401 401
 
402 402
 	    $TXN = EEM_Transaction::instance();
403 403
 
404
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
404
+	    $TXN_ID = ( ! empty($this->_req_data['TXN_ID'])) ? absint($this->_req_data['TXN_ID']) : FALSE;
405 405
 
406 406
 	    //get transaction object
407 407
 	    $this->_transaction = $TXN->get_one_by_ID($TXN_ID);
408
-	    $this->_session = !empty( $this->_transaction ) ? $this->_transaction->get('TXN_session_data') : NULL;
408
+	    $this->_session = ! empty($this->_transaction) ? $this->_transaction->get('TXN_session_data') : NULL;
409 409
 		$this->_transaction->verify_abandoned_transaction_status();
410 410
 
411
-	 	if ( empty( $this->_transaction ) ) {
412
-	    	$error_msg = esc_html__('An error occurred and the details for Transaction ID #', 'event_espresso') . $TXN_ID .  esc_html__(' could not be retrieved.', 'event_espresso');
413
-			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
411
+	 	if (empty($this->_transaction)) {
412
+	    	$error_msg = esc_html__('An error occurred and the details for Transaction ID #', 'event_espresso').$TXN_ID.esc_html__(' could not be retrieved.', 'event_espresso');
413
+			EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
414 414
 	    }
415 415
 	}
416 416
 
@@ -423,12 +423,12 @@  discard block
 block discarded – undo
423 423
 	 *	@return array
424 424
 	 */
425 425
 	protected function _transaction_legend_items() {
426
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
426
+		EE_Registry::instance()->load_helper('MSG_Template');
427 427
 		$items = array();
428 428
 
429
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) {
430
-			$related_for_icon = EEH_MSG_Template::get_message_action_icon( 'see_notifications_for' );
431
-			if ( isset( $related_for_icon['css_class']) && isset( $related_for_icon['label'] ) ) {
429
+		if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) {
430
+			$related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for');
431
+			if (isset($related_for_icon['css_class']) && isset($related_for_icon['label'])) {
432 432
 				$items['view_related_messages'] = array(
433 433
 					'class' => $related_for_icon['css_class'],
434 434
 					'desc' => $related_for_icon['label'],
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 
439 439
 		$items = apply_filters(
440 440
 			'FHEE__Transactions_Admin_Page___transaction_legend_items__items',
441
-			array_merge( $items,
441
+			array_merge($items,
442 442
 				array(
443 443
 					'view_details' => array(
444 444
 						'class' => 'dashicons dashicons-cart',
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 					),
451 451
 					'view_receipt' => array(
452 452
 						'class' => 'dashicons dashicons-media-default',
453
-						'desc' => esc_html__('View Transaction Receipt', 'event_espresso' )
453
+						'desc' => esc_html__('View Transaction Receipt', 'event_espresso')
454 454
 					),
455 455
 					'view_registration' => array(
456 456
 						'class' => 'dashicons dashicons-clipboard',
@@ -460,8 +460,8 @@  discard block
 block discarded – undo
460 460
 			)
461 461
 		);
462 462
 
463
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_transactions_send_payment_reminder' ) ) {
464
-			if ( EEH_MSG_Template::is_mt_active( 'payment_reminder' ) ) {
463
+		if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder')) {
464
+			if (EEH_MSG_Template::is_mt_active('payment_reminder')) {
465 465
 				$items['send_payment_reminder'] = array(
466 466
 					'class' => 'dashicons dashicons-email-alt',
467 467
 					'desc' => esc_html__('Send Payment Reminder', 'event_espresso')
@@ -482,29 +482,29 @@  discard block
 block discarded – undo
482 482
 			'FHEE__Transactions_Admin_Page___transaction_legend_items__more_items',
483 483
 			array(
484 484
 				'overpaid'   => array(
485
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::overpaid_status_code,
486
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::overpaid_status_code, FALSE, 'sentence' )
485
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::overpaid_status_code,
486
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::overpaid_status_code, FALSE, 'sentence')
487 487
 				),
488 488
 				'complete'   => array(
489
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::complete_status_code,
490
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::complete_status_code, FALSE, 'sentence' )
489
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::complete_status_code,
490
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::complete_status_code, FALSE, 'sentence')
491 491
 				),
492 492
 				'incomplete' => array(
493
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::incomplete_status_code,
494
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::incomplete_status_code, FALSE, 'sentence' )
493
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::incomplete_status_code,
494
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::incomplete_status_code, FALSE, 'sentence')
495 495
 				),
496 496
 				'abandoned'  => array(
497
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::abandoned_status_code,
498
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::abandoned_status_code, FALSE, 'sentence' )
497
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::abandoned_status_code,
498
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::abandoned_status_code, FALSE, 'sentence')
499 499
 				),
500 500
 				'failed'     => array(
501
-					'class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::failed_status_code,
502
-					'desc'  => EEH_Template::pretty_status( EEM_Transaction::failed_status_code, FALSE, 'sentence' )
501
+					'class' => 'ee-status-legend ee-status-legend-'.EEM_Transaction::failed_status_code,
502
+					'desc'  => EEH_Template::pretty_status(EEM_Transaction::failed_status_code, FALSE, 'sentence')
503 503
 				)
504 504
 			)
505 505
 		);
506 506
 
507
-		return array_merge( $items, $more_items);
507
+		return array_merge($items, $more_items);
508 508
 	}
509 509
 
510 510
 
@@ -517,9 +517,9 @@  discard block
 block discarded – undo
517 517
 	 */
518 518
 	protected function _transactions_overview_list_table() {
519 519
 		$this->_admin_page_title = esc_html__('Transactions', 'event_espresso');
520
-		$event = isset($this->_req_data['EVT_ID']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID'] ) : NULL;
521
-		$this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf( esc_html__('%sViewing Transactions for the Event: %s%s', 'event_espresso'), '<h3>', '<a href="' . EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $event->ID()), EVENTS_ADMIN_URL ) . '" title="' . esc_attr__('Click to Edit event', 'event_espresso') . '">' . $event->get('EVT_name') . '</a>', '</h3>' ) : '';
522
-		$this->_template_args['after_list_table'] = $this->_display_legend( $this->_transaction_legend_items() );
520
+		$event = isset($this->_req_data['EVT_ID']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID']) : NULL;
521
+		$this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf(esc_html__('%sViewing Transactions for the Event: %s%s', 'event_espresso'), '<h3>', '<a href="'.EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $event->ID()), EVENTS_ADMIN_URL).'" title="'.esc_attr__('Click to Edit event', 'event_espresso').'">'.$event->get('EVT_name').'</a>', '</h3>') : '';
522
+		$this->_template_args['after_list_table'] = $this->_display_legend($this->_transaction_legend_items());
523 523
 		$this->display_admin_list_table_page_with_no_sidebar();
524 524
 	}
525 525
 
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 	*	@return void
534 534
 	*/
535 535
 	protected function _transaction_details() {
536
-		do_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction );
536
+		do_action('AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction);
537 537
 
538 538
 		$this->_set_transaction_status_array();
539 539
 
@@ -546,14 +546,14 @@  discard block
 block discarded – undo
546 546
 		$attendee = $primary_registration instanceof EE_Registration ? $primary_registration->attendee() : NULL;
547 547
 
548 548
 		$this->_template_args['txn_nmbr']['value'] = $this->_transaction->ID();
549
-		$this->_template_args['txn_nmbr']['label'] = esc_html__( 'Transaction Number', 'event_espresso' );
549
+		$this->_template_args['txn_nmbr']['label'] = esc_html__('Transaction Number', 'event_espresso');
550 550
 
551 551
 		$this->_template_args['txn_datetime']['value'] = $this->_transaction->get_i18n_datetime('TXN_timestamp');
552
-		$this->_template_args['txn_datetime']['label'] = esc_html__( 'Date', 'event_espresso' );
552
+		$this->_template_args['txn_datetime']['label'] = esc_html__('Date', 'event_espresso');
553 553
 
554
-		$this->_template_args['txn_status']['value'] = self::$_txn_status[ $this->_transaction->get('STS_ID') ];
555
-		$this->_template_args['txn_status']['label'] = esc_html__( 'Transaction Status', 'event_espresso' );
556
-		$this->_template_args['txn_status']['class'] = 'status-' . $this->_transaction->get('STS_ID');
554
+		$this->_template_args['txn_status']['value'] = self::$_txn_status[$this->_transaction->get('STS_ID')];
555
+		$this->_template_args['txn_status']['label'] = esc_html__('Transaction Status', 'event_espresso');
556
+		$this->_template_args['txn_status']['class'] = 'status-'.$this->_transaction->get('STS_ID');
557 557
 
558 558
 		$this->_template_args['grand_total'] = $this->_transaction->get('TXN_total');
559 559
 		$this->_template_args['total_paid'] = $this->_transaction->get('TXN_paid');
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 			)
567 567
 		) {
568 568
 			$this->_template_args['send_payment_reminder_button'] =
569
-				EEH_MSG_Template::is_mt_active( 'payment_reminder' )
569
+				EEH_MSG_Template::is_mt_active('payment_reminder')
570 570
 				&& $this->_transaction->get('STS_ID') != EEM_Transaction::complete_status_code
571 571
 				&& $this->_transaction->get('STS_ID') != EEM_Transaction::overpaid_status_code
572 572
 					? EEH_Template::get_button_or_link(
@@ -588,40 +588,40 @@  discard block
 block discarded – undo
588 588
 		}
589 589
 
590 590
 		$amount_due = $this->_transaction->get('TXN_total') - $this->_transaction->get('TXN_paid');
591
-		$this->_template_args['amount_due'] = EEH_Template::format_currency( $amount_due, TRUE );
592
-		if ( EE_Registry::instance()->CFG->currency->sign_b4 ) {
593
-			$this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign . $this->_template_args['amount_due'];
591
+		$this->_template_args['amount_due'] = EEH_Template::format_currency($amount_due, TRUE);
592
+		if (EE_Registry::instance()->CFG->currency->sign_b4) {
593
+			$this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign.$this->_template_args['amount_due'];
594 594
 		} else {
595
-			$this->_template_args['amount_due'] = $this->_template_args['amount_due'] . EE_Registry::instance()->CFG->currency->sign;
595
+			$this->_template_args['amount_due'] = $this->_template_args['amount_due'].EE_Registry::instance()->CFG->currency->sign;
596 596
 		}
597
-		$this->_template_args['amount_due_class'] =  '';
597
+		$this->_template_args['amount_due_class'] = '';
598 598
 
599
-		if ( $this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total') ) {
599
+		if ($this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total')) {
600 600
 			// paid in full
601
-			$this->_template_args['amount_due'] =  FALSE;
602
-		} elseif ( $this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total') ) {
601
+			$this->_template_args['amount_due'] = FALSE;
602
+		} elseif ($this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total')) {
603 603
 			// overpaid
604
-			$this->_template_args['amount_due_class'] =  'txn-overview-no-payment-spn';
605
-		} elseif (( $this->_transaction->get('TXN_total') > 0 ) && ( $this->_transaction->get('TXN_paid') > 0 )) {
604
+			$this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn';
605
+		} elseif (($this->_transaction->get('TXN_total') > 0) && ($this->_transaction->get('TXN_paid') > 0)) {
606 606
 			// monies owing
607
-			$this->_template_args['amount_due_class'] =  'txn-overview-part-payment-spn';
608
-		} elseif (( $this->_transaction->get('TXN_total') > 0 ) && ( $this->_transaction->get('TXN_paid') == 0 )) {
607
+			$this->_template_args['amount_due_class'] = 'txn-overview-part-payment-spn';
608
+		} elseif (($this->_transaction->get('TXN_total') > 0) && ($this->_transaction->get('TXN_paid') == 0)) {
609 609
 			// no payments made yet
610
-			$this->_template_args['amount_due_class'] =  'txn-overview-no-payment-spn';
611
-		} elseif ( $this->_transaction->get('TXN_total') == 0 ) {
610
+			$this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn';
611
+		} elseif ($this->_transaction->get('TXN_total') == 0) {
612 612
 			// free event
613
-			$this->_template_args['amount_due'] =  FALSE;
613
+			$this->_template_args['amount_due'] = FALSE;
614 614
 		}
615 615
 
616 616
 		$payment_method = $this->_transaction->payment_method();
617 617
 
618 618
 		$this->_template_args['method_of_payment_name'] = $payment_method instanceof EE_Payment_Method
619 619
 			? $payment_method->admin_name()
620
-			: esc_html__( 'Unknown', 'event_espresso' );
620
+			: esc_html__('Unknown', 'event_espresso');
621 621
 
622 622
 		$this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
623 623
 		// link back to overview
624
-		$this->_template_args['txn_overview_url'] = ! empty ( $_SERVER['HTTP_REFERER'] )
624
+		$this->_template_args['txn_overview_url'] = ! empty ($_SERVER['HTTP_REFERER'])
625 625
 			? $_SERVER['HTTP_REFERER']
626 626
 			: TXN_ADMIN_URL;
627 627
 
@@ -629,13 +629,13 @@  discard block
 block discarded – undo
629 629
 		// next link
630 630
 		$next_txn = $this->_transaction->next(
631 631
 			null,
632
-			array( array( 'STS_ID' => array( '!=', EEM_Transaction::failed_status_code ) ) ),
632
+			array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))),
633 633
 			'TXN_ID'
634 634
 		);
635 635
 		$this->_template_args['next_transaction'] = $next_txn
636 636
 			? $this->_next_link(
637 637
 				EE_Admin_Page::add_query_args_and_nonce(
638
-					array( 'action' => 'view_transaction', 'TXN_ID' => $next_txn['TXN_ID'] ),
638
+					array('action' => 'view_transaction', 'TXN_ID' => $next_txn['TXN_ID']),
639 639
 					TXN_ADMIN_URL
640 640
 				),
641 641
 				'dashicons dashicons-arrow-right ee-icon-size-22'
@@ -644,13 +644,13 @@  discard block
 block discarded – undo
644 644
 		// previous link
645 645
 		$previous_txn = $this->_transaction->previous(
646 646
 			null,
647
-			array( array( 'STS_ID' => array( '!=', EEM_Transaction::failed_status_code ) ) ),
647
+			array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))),
648 648
 			'TXN_ID'
649 649
 		);
650 650
 		$this->_template_args['previous_transaction'] = $previous_txn
651 651
 			? $this->_previous_link(
652 652
 				EE_Admin_Page::add_query_args_and_nonce(
653
-					array( 'action' => 'view_transaction', 'TXN_ID' => $previous_txn['TXN_ID'] ),
653
+					array('action' => 'view_transaction', 'TXN_ID' => $previous_txn['TXN_ID']),
654 654
 					TXN_ADMIN_URL
655 655
 				),
656 656
 				'dashicons dashicons-arrow-left ee-icon-size-22'
@@ -660,16 +660,16 @@  discard block
 block discarded – undo
660 660
 		// were we just redirected here after adding a new registration ???
661 661
 		if (
662 662
 			isset(
663
-				$this->_req_data[ 'redirect_from' ],
664
-				$this->_req_data[ 'EVT_ID' ],
665
-				$this->_req_data[ 'event_name' ]
663
+				$this->_req_data['redirect_from'],
664
+				$this->_req_data['EVT_ID'],
665
+				$this->_req_data['event_name']
666 666
 			)
667 667
 		) {
668 668
 			if (
669 669
 				EE_Registry::instance()->CAP->current_user_can(
670 670
 					'ee_edit_registrations',
671 671
 					'espresso_registrations_new_registration',
672
-					$this->_req_data[ 'EVT_ID' ]
672
+					$this->_req_data['EVT_ID']
673 673
 				)
674 674
 			) {
675 675
 				$this->_admin_page_title .= '<a id="add-new-registration" class="add-new-h2 button-primary" href="';
@@ -679,25 +679,25 @@  discard block
 block discarded – undo
679 679
 						'action'   => 'new_registration',
680 680
 						'return'   => 'default',
681 681
 						'TXN_ID'   => $this->_transaction->ID(),
682
-						'event_id' => $this->_req_data[ 'EVT_ID' ],
682
+						'event_id' => $this->_req_data['EVT_ID'],
683 683
 					),
684 684
 					REG_ADMIN_URL
685 685
 				);
686 686
 				$this->_admin_page_title .= '">';
687 687
 
688 688
 				$this->_admin_page_title .= sprintf(
689
-					esc_html__('Add Another New Registration to Event: "%1$s" ?', 'event_espresso' ),
690
-					htmlentities( urldecode( $this->_req_data[ 'event_name' ] ), ENT_QUOTES, 'UTF-8' )
689
+					esc_html__('Add Another New Registration to Event: "%1$s" ?', 'event_espresso'),
690
+					htmlentities(urldecode($this->_req_data['event_name']), ENT_QUOTES, 'UTF-8')
691 691
 				);
692 692
 				$this->_admin_page_title .= '</a>';
693 693
 			}
694
-			EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
694
+			EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
695 695
 		}
696 696
 		// grab messages at the last second
697 697
 		$this->_template_args['notices'] = EE_Error::get_notices();
698 698
 		// path to template
699
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_header.template.php';
700
-		$this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
699
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_header.template.php';
700
+		$this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
701 701
 
702 702
 		// the details template wrapper
703 703
 		$this->display_admin_page_with_sidebar();
@@ -716,18 +716,18 @@  discard block
 block discarded – undo
716 716
 
717 717
 		$this->_set_transaction_object();
718 718
 
719
-		add_meta_box( 'edit-txn-details-mbox', esc_html__( 'Transaction Details', 'event_espresso' ), array( $this, 'txn_details_meta_box' ), $this->_wp_page_slug, 'normal', 'high' );
719
+		add_meta_box('edit-txn-details-mbox', esc_html__('Transaction Details', 'event_espresso'), array($this, 'txn_details_meta_box'), $this->_wp_page_slug, 'normal', 'high');
720 720
 		add_meta_box(
721 721
 			'edit-txn-attendees-mbox',
722
-			esc_html__( 'Attendees Registered in this Transaction', 'event_espresso' ),
723
-			array( $this, 'txn_attendees_meta_box' ),
722
+			esc_html__('Attendees Registered in this Transaction', 'event_espresso'),
723
+			array($this, 'txn_attendees_meta_box'),
724 724
 			$this->_wp_page_slug,
725 725
 			'normal',
726 726
 			'high',
727
-			array( 'TXN_ID' => $this->_transaction->ID() )
727
+			array('TXN_ID' => $this->_transaction->ID())
728 728
 		);
729
-		add_meta_box( 'edit-txn-registrant-mbox', esc_html__( 'Primary Contact', 'event_espresso' ), array( $this, 'txn_registrant_side_meta_box' ), $this->_wp_page_slug, 'side', 'high' );
730
-		add_meta_box( 'edit-txn-billing-info-mbox', esc_html__( 'Billing Information', 'event_espresso' ), array( $this, 'txn_billing_info_side_meta_box' ), $this->_wp_page_slug, 'side', 'high' );
729
+		add_meta_box('edit-txn-registrant-mbox', esc_html__('Primary Contact', 'event_espresso'), array($this, 'txn_registrant_side_meta_box'), $this->_wp_page_slug, 'side', 'high');
730
+		add_meta_box('edit-txn-billing-info-mbox', esc_html__('Billing Information', 'event_espresso'), array($this, 'txn_billing_info_side_meta_box'), $this->_wp_page_slug, 'side', 'high');
731 731
 
732 732
 	}
733 733
 
@@ -748,15 +748,15 @@  discard block
 block discarded – undo
748 748
 
749 749
 		//get line table
750 750
 		EEH_Autoloader::register_line_item_display_autoloaders();
751
-		$Line_Item_Display = new EE_Line_Item_Display( 'admin_table', 'EE_Admin_Table_Line_Item_Display_Strategy' );
752
-		$this->_template_args['line_item_table'] = $Line_Item_Display->display_line_item( $this->_transaction->total_line_item() );
751
+		$Line_Item_Display = new EE_Line_Item_Display('admin_table', 'EE_Admin_Table_Line_Item_Display_Strategy');
752
+		$this->_template_args['line_item_table'] = $Line_Item_Display->display_line_item($this->_transaction->total_line_item());
753 753
 		$this->_template_args['REG_code'] = $this->_transaction->get_first_related('Registration')->get('REG_code');
754 754
 
755 755
 		// process taxes
756
-		$taxes = $this->_transaction->get_many_related( 'Line_Item', array( array( 'LIN_type' => EEM_Line_Item::type_tax )));
757
-		$this->_template_args['taxes'] = ! empty( $taxes ) ? $taxes : FALSE;
756
+		$taxes = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => EEM_Line_Item::type_tax)));
757
+		$this->_template_args['taxes'] = ! empty($taxes) ? $taxes : FALSE;
758 758
 
759
-		$this->_template_args['grand_total'] = EEH_Template::format_currency($this->_transaction->get('TXN_total'), FALSE, FALSE );
759
+		$this->_template_args['grand_total'] = EEH_Template::format_currency($this->_transaction->get('TXN_total'), FALSE, FALSE);
760 760
 		$this->_template_args['grand_raw_total'] = $this->_transaction->get('TXN_total');
761 761
 		$this->_template_args['TXN_status'] = $this->_transaction->get('STS_ID');
762 762
 
@@ -764,63 +764,63 @@  discard block
 block discarded – undo
764 764
 
765 765
 		// process payment details
766 766
 		$payments = $this->_transaction->get_many_related('Payment');
767
-		if( ! empty(  $payments ) ) {
768
-			$this->_template_args[ 'payments' ] = $payments;
769
-			$this->_template_args[ 'existing_reg_payments' ] = $this->_get_registration_payment_IDs( $payments );
767
+		if ( ! empty($payments)) {
768
+			$this->_template_args['payments'] = $payments;
769
+			$this->_template_args['existing_reg_payments'] = $this->_get_registration_payment_IDs($payments);
770 770
 		} else {
771
-			$this->_template_args[ 'payments' ] = false;
772
-			$this->_template_args[ 'existing_reg_payments' ] = array();
771
+			$this->_template_args['payments'] = false;
772
+			$this->_template_args['existing_reg_payments'] = array();
773 773
 		}
774 774
 
775
-		$this->_template_args['edit_payment_url'] = add_query_arg( array( 'action' => 'edit_payment'  ), TXN_ADMIN_URL );
776
-		$this->_template_args['delete_payment_url'] = add_query_arg( array( 'action' => 'espresso_delete_payment' ), TXN_ADMIN_URL );
775
+		$this->_template_args['edit_payment_url'] = add_query_arg(array('action' => 'edit_payment'), TXN_ADMIN_URL);
776
+		$this->_template_args['delete_payment_url'] = add_query_arg(array('action' => 'espresso_delete_payment'), TXN_ADMIN_URL);
777 777
 
778
-		if ( isset( $txn_details['invoice_number'] )) {
778
+		if (isset($txn_details['invoice_number'])) {
779 779
 			$this->_template_args['txn_details']['invoice_number']['value'] = $this->_template_args['REG_code'];
780
-			$this->_template_args['txn_details']['invoice_number']['label'] = esc_html__( 'Invoice Number', 'event_espresso' );
780
+			$this->_template_args['txn_details']['invoice_number']['label'] = esc_html__('Invoice Number', 'event_espresso');
781 781
 		}
782 782
 
783 783
 		$this->_template_args['txn_details']['registration_session']['value'] = $this->_transaction->get_first_related('Registration')->get('REG_session');
784
-		$this->_template_args['txn_details']['registration_session']['label'] = esc_html__( 'Registration Session', 'event_espresso' );
784
+		$this->_template_args['txn_details']['registration_session']['label'] = esc_html__('Registration Session', 'event_espresso');
785 785
 
786
-		$this->_template_args['txn_details']['ip_address']['value'] = isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '';
787
-		$this->_template_args['txn_details']['ip_address']['label'] = esc_html__( 'Transaction placed from IP', 'event_espresso' );
786
+		$this->_template_args['txn_details']['ip_address']['value'] = isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '';
787
+		$this->_template_args['txn_details']['ip_address']['label'] = esc_html__('Transaction placed from IP', 'event_espresso');
788 788
 
789
-		$this->_template_args['txn_details']['user_agent']['value'] = isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '';
790
-		$this->_template_args['txn_details']['user_agent']['label'] = esc_html__( 'Registrant User Agent', 'event_espresso' );
789
+		$this->_template_args['txn_details']['user_agent']['value'] = isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '';
790
+		$this->_template_args['txn_details']['user_agent']['label'] = esc_html__('Registrant User Agent', 'event_espresso');
791 791
 
792 792
 		$reg_steps = '<ul>';
793
-		foreach ( $this->_transaction->reg_steps() as $reg_step => $reg_step_status ) {
794
-			if ( $reg_step_status === true ) {
795
-				$reg_steps .= '<li style="color:#70cc50">' . sprintf( esc_html__( '%1$s : Completed', 'event_espresso' ), ucwords( str_replace( '_', ' ', $reg_step ) ) ) . '</li>';
796
-			} else if ( is_numeric( $reg_step_status ) && $reg_step_status !== false ) {
797
-					$reg_steps .= '<li style="color:#2EA2CC">' . sprintf(
798
-							esc_html__( '%1$s : Initiated %2$s', 'event_espresso' ),
799
-							ucwords( str_replace( '_', ' ', $reg_step ) ),
800
-							gmdate( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), ( $reg_step_status + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) )
801
-						) . '</li>';
793
+		foreach ($this->_transaction->reg_steps() as $reg_step => $reg_step_status) {
794
+			if ($reg_step_status === true) {
795
+				$reg_steps .= '<li style="color:#70cc50">'.sprintf(esc_html__('%1$s : Completed', 'event_espresso'), ucwords(str_replace('_', ' ', $reg_step))).'</li>';
796
+			} else if (is_numeric($reg_step_status) && $reg_step_status !== false) {
797
+					$reg_steps .= '<li style="color:#2EA2CC">'.sprintf(
798
+							esc_html__('%1$s : Initiated %2$s', 'event_espresso'),
799
+							ucwords(str_replace('_', ' ', $reg_step)),
800
+							gmdate(get_option('date_format').' '.get_option('time_format'), ($reg_step_status + (get_option('gmt_offset') * HOUR_IN_SECONDS)))
801
+						).'</li>';
802 802
 				} else {
803
-				$reg_steps .= '<li style="color:#E76700">' . sprintf( esc_html__( '%1$s : Never Initiated', 'event_espresso' ), ucwords( str_replace( '_', ' ', $reg_step ) ) ) . '</li>';
803
+				$reg_steps .= '<li style="color:#E76700">'.sprintf(esc_html__('%1$s : Never Initiated', 'event_espresso'), ucwords(str_replace('_', ' ', $reg_step))).'</li>';
804 804
 			}
805 805
 		}
806 806
 		$reg_steps .= '</ul>';
807 807
 		$this->_template_args['txn_details']['reg_steps']['value'] = $reg_steps;
808
-		$this->_template_args['txn_details']['reg_steps']['label'] = esc_html__( 'Registration Step Progress', 'event_espresso' );
808
+		$this->_template_args['txn_details']['reg_steps']['label'] = esc_html__('Registration Step Progress', 'event_espresso');
809 809
 
810 810
 
811 811
 		$this->_get_registrations_to_apply_payment_to();
812
-		$this->_get_payment_methods( $payments );
812
+		$this->_get_payment_methods($payments);
813 813
 		$this->_get_payment_status_array();
814 814
 		$this->_get_reg_status_selection(); //sets up the template args for the reg status array for the transaction.
815 815
 
816
-		$this->_template_args['transaction_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'transaction'  ), TXN_ADMIN_URL );
817
-		$this->_template_args['apply_payment_form_url'] = add_query_arg( array( 'page' => 'espresso_transactions', 'action' => 'espresso_apply_payment' ), WP_AJAX_URL );
818
-		$this->_template_args['delete_payment_form_url'] = add_query_arg( array( 'page' => 'espresso_transactions', 'action' => 'espresso_delete_payment' ), WP_AJAX_URL );
816
+		$this->_template_args['transaction_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'transaction'), TXN_ADMIN_URL);
817
+		$this->_template_args['apply_payment_form_url'] = add_query_arg(array('page' => 'espresso_transactions', 'action' => 'espresso_apply_payment'), WP_AJAX_URL);
818
+		$this->_template_args['delete_payment_form_url'] = add_query_arg(array('page' => 'espresso_transactions', 'action' => 'espresso_delete_payment'), WP_AJAX_URL);
819 819
 
820 820
 		// 'espresso_delete_payment_nonce'
821 821
 
822
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_main_meta_box_txn_details.template.php';
823
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );
822
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_main_meta_box_txn_details.template.php';
823
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
824 824
 
825 825
 	}
826 826
 
@@ -835,27 +835,27 @@  discard block
 block discarded – undo
835 835
 	 * @param EE_Payment[] $payments
836 836
 	 * @return array
837 837
 	 */
838
-	protected function _get_registration_payment_IDs( $payments = array() ) {
838
+	protected function _get_registration_payment_IDs($payments = array()) {
839 839
 		$existing_reg_payments = array();
840 840
 		// get all reg payments for these payments
841
-		$reg_payments = EEM_Registration_Payment::instance()->get_all( array(
841
+		$reg_payments = EEM_Registration_Payment::instance()->get_all(array(
842 842
 			array(
843 843
 				'PAY_ID' => array(
844 844
 					'IN',
845
-					array_keys( $payments )
845
+					array_keys($payments)
846 846
 				)
847 847
 			)
848
-		) );
849
-		if ( ! empty( $reg_payments ) ) {
850
-			foreach ( $payments as $payment ) {
851
-				if ( ! $payment instanceof EE_Payment ) {
848
+		));
849
+		if ( ! empty($reg_payments)) {
850
+			foreach ($payments as $payment) {
851
+				if ( ! $payment instanceof EE_Payment) {
852 852
 					continue;
853
-				} else if ( ! isset( $existing_reg_payments[ $payment->ID() ] ) ) {
854
-					$existing_reg_payments[ $payment->ID() ] = array();
853
+				} else if ( ! isset($existing_reg_payments[$payment->ID()])) {
854
+					$existing_reg_payments[$payment->ID()] = array();
855 855
 				}
856
-				foreach ( $reg_payments as $reg_payment ) {
857
-					if ( $reg_payment instanceof EE_Registration_Payment && $reg_payment->payment_ID() === $payment->ID() ) {
858
-						$existing_reg_payments[ $payment->ID() ][ ] = $reg_payment->registration_ID();
856
+				foreach ($reg_payments as $reg_payment) {
857
+					if ($reg_payment instanceof EE_Registration_Payment && $reg_payment->payment_ID() === $payment->ID()) {
858
+						$existing_reg_payments[$payment->ID()][] = $reg_payment->registration_ID();
859 859
 					}
860 860
 				}
861 861
 			}
@@ -888,54 +888,54 @@  discard block
 block discarded – undo
888 888
 				)
889 889
 			)
890 890
 		);
891
-		$registrations_to_apply_payment_to = EEH_HTML::br() . EEH_HTML::div(
891
+		$registrations_to_apply_payment_to = EEH_HTML::br().EEH_HTML::div(
892 892
 			'', 'txn-admin-apply-payment-to-registrations-dv', '', 'clear: both; margin: 1.5em 0 0; display: none;'
893 893
 		);
894
-		$registrations_to_apply_payment_to .= EEH_HTML::br() . EEH_HTML::div( '', '', 'admin-primary-mbox-tbl-wrap' );
895
-		$registrations_to_apply_payment_to .= EEH_HTML::table( '', '', 'admin-primary-mbox-tbl' );
894
+		$registrations_to_apply_payment_to .= EEH_HTML::br().EEH_HTML::div('', '', 'admin-primary-mbox-tbl-wrap');
895
+		$registrations_to_apply_payment_to .= EEH_HTML::table('', '', 'admin-primary-mbox-tbl');
896 896
 		$registrations_to_apply_payment_to .= EEH_HTML::thead(
897 897
 			EEH_HTML::tr(
898
-				EEH_HTML::th( esc_html__( 'ID', 'event_espresso' ) ) .
899
-				EEH_HTML::th( esc_html__( 'Registrant', 'event_espresso' ) ) .
900
-				EEH_HTML::th( esc_html__( 'Ticket', 'event_espresso' ) ) .
901
-				EEH_HTML::th( esc_html__( 'Event', 'event_espresso' ) ) .
902
-				EEH_HTML::th( esc_html__( 'Paid', 'event_espresso' ), '', 'txn-admin-payment-paid-td jst-cntr' ) .
903
-				EEH_HTML::th( esc_html__( 'Owing', 'event_espresso' ), '', 'txn-admin-payment-owing-td jst-cntr' ) .
904
-				EEH_HTML::th( esc_html__( 'Apply', 'event_espresso' ), '', 'jst-cntr' )
898
+				EEH_HTML::th(esc_html__('ID', 'event_espresso')).
899
+				EEH_HTML::th(esc_html__('Registrant', 'event_espresso')).
900
+				EEH_HTML::th(esc_html__('Ticket', 'event_espresso')).
901
+				EEH_HTML::th(esc_html__('Event', 'event_espresso')).
902
+				EEH_HTML::th(esc_html__('Paid', 'event_espresso'), '', 'txn-admin-payment-paid-td jst-cntr').
903
+				EEH_HTML::th(esc_html__('Owing', 'event_espresso'), '', 'txn-admin-payment-owing-td jst-cntr').
904
+				EEH_HTML::th(esc_html__('Apply', 'event_espresso'), '', 'jst-cntr')
905 905
 			)
906 906
 		);
907 907
 		$registrations_to_apply_payment_to .= EEH_HTML::tbody();
908 908
 		// get registrations for TXN
909
-		$registrations = $this->_transaction->registrations( $query_params );
910
-		foreach ( $registrations as $registration ) {
911
-			if ( $registration instanceof EE_Registration ) {
909
+		$registrations = $this->_transaction->registrations($query_params);
910
+		foreach ($registrations as $registration) {
911
+			if ($registration instanceof EE_Registration) {
912 912
 				$attendee_name = $registration->attendee() instanceof EE_Attendee
913 913
 					? $registration->attendee()->full_name()
914
-					: esc_html__( 'Unknown Attendee', 'event_espresso' );
914
+					: esc_html__('Unknown Attendee', 'event_espresso');
915 915
 				$owing = $registration->final_price() - $registration->paid();
916 916
 				$taxable = $registration->ticket()->taxable()
917
-					? ' <span class="smaller-text lt-grey-text"> ' . esc_html__( '+ tax', 'event_espresso' ) . '</span>'
917
+					? ' <span class="smaller-text lt-grey-text"> '.esc_html__('+ tax', 'event_espresso').'</span>'
918 918
 					: '';
919
-				$checked = empty( $existing_reg_payments ) || in_array( $registration->ID(), $existing_reg_payments )
919
+				$checked = empty($existing_reg_payments) || in_array($registration->ID(), $existing_reg_payments)
920 920
 					? ' checked="checked"'
921 921
 					: '';
922 922
 				$disabled = $registration->final_price() > 0 ? '' : ' disabled';
923 923
 				$registrations_to_apply_payment_to .= EEH_HTML::tr(
924
-					EEH_HTML::td( $registration->ID() ) .
925
-					EEH_HTML::td( $attendee_name ) .
924
+					EEH_HTML::td($registration->ID()).
925
+					EEH_HTML::td($attendee_name).
926 926
 					EEH_HTML::td(
927
-						$registration->ticket()->name() . ' : ' . $registration->ticket()->pretty_price() . $taxable
928
-					) .
929
-					EEH_HTML::td( $registration->event_name() ) .
930
-					EEH_HTML::td( $registration->pretty_paid(), '', 'txn-admin-payment-paid-td jst-cntr' ) .
931
-					EEH_HTML::td( EEH_Template::format_currency( $owing ), '', 'txn-admin-payment-owing-td jst-cntr' ) .
927
+						$registration->ticket()->name().' : '.$registration->ticket()->pretty_price().$taxable
928
+					).
929
+					EEH_HTML::td($registration->event_name()).
930
+					EEH_HTML::td($registration->pretty_paid(), '', 'txn-admin-payment-paid-td jst-cntr').
931
+					EEH_HTML::td(EEH_Template::format_currency($owing), '', 'txn-admin-payment-owing-td jst-cntr').
932 932
 					EEH_HTML::td(
933
-						'<input type="checkbox" value="' . $registration->ID()
933
+						'<input type="checkbox" value="'.$registration->ID()
934 934
 						. '" name="txn_admin_payment[registrations]"'
935
-						. $checked . $disabled . '>',
935
+						. $checked.$disabled.'>',
936 936
 						'', 'jst-cntr'
937 937
 					),
938
-					'apply-payment-registration-row-' . $registration->ID()
938
+					'apply-payment-registration-row-'.$registration->ID()
939 939
 				);
940 940
 			}
941 941
 		}
@@ -950,7 +950,7 @@  discard block
 block discarded – undo
950 950
 			'', 'clear description'
951 951
 		);
952 952
 		$registrations_to_apply_payment_to .= EEH_HTML::divx();
953
-		$this->_template_args[ 'registrations_to_apply_payment_to' ] = $registrations_to_apply_payment_to;
953
+		$this->_template_args['registrations_to_apply_payment_to'] = $registrations_to_apply_payment_to;
954 954
 	}
955 955
 
956 956
 
@@ -967,9 +967,9 @@  discard block
 block discarded – undo
967 967
 		$statuses = EEM_Registration::reg_status_array(array(), TRUE);
968 968
 		//let's add a "don't change" option.
969 969
 		$status_array['NAN'] = esc_html__('Leave the Same', 'event_espresso');
970
-		$status_array = array_merge( $status_array, $statuses );
971
-		$this->_template_args['status_change_select'] = EEH_Form_Fields::select_input( 'txn_reg_status_change[reg_status]', $status_array, 'NAN', 'id="txn-admin-payment-reg-status-inp"', 'txn-reg-status-change-reg-status' );
972
-		$this->_template_args['delete_status_change_select'] = EEH_Form_Fields::select_input( 'delete_txn_reg_status_change[reg_status]', $status_array, 'NAN', 'delete-txn-admin-payment-reg-status-inp', 'delete-txn-reg-status-change-reg-status' );
970
+		$status_array = array_merge($status_array, $statuses);
971
+		$this->_template_args['status_change_select'] = EEH_Form_Fields::select_input('txn_reg_status_change[reg_status]', $status_array, 'NAN', 'id="txn-admin-payment-reg-status-inp"', 'txn-reg-status-change-reg-status');
972
+		$this->_template_args['delete_status_change_select'] = EEH_Form_Fields::select_input('delete_txn_reg_status_change[reg_status]', $status_array, 'NAN', 'delete-txn-admin-payment-reg-status-inp', 'delete-txn-reg-status-change-reg-status');
973 973
 
974 974
 	}
975 975
 
@@ -984,21 +984,21 @@  discard block
 block discarded – undo
984 984
 	 * @param EE_Payment[] to show on this page
985 985
 	 *	@return void
986 986
 	 */
987
-	private function _get_payment_methods( $payments = array() ) {
987
+	private function _get_payment_methods($payments = array()) {
988 988
 		$payment_methods_of_payments = array();
989
-		foreach( $payments as $payment ){
990
-			if( $payment instanceof EE_Payment ){
991
-				$payment_methods_of_payments[] = $payment->get( 'PMD_ID' );
989
+		foreach ($payments as $payment) {
990
+			if ($payment instanceof EE_Payment) {
991
+				$payment_methods_of_payments[] = $payment->get('PMD_ID');
992 992
 			}
993 993
 		}
994
-		if( $payment_methods_of_payments ){
995
-			$query_args = array( array( 'OR*payment_method_for_payment' => array(
996
-					'PMD_ID' => array( 'IN', $payment_methods_of_payments ),
997
-					'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) ) );
998
-		}else{
999
-			$query_args = array( array( 'PMD_scope' => array( 'LIKE', '%' . EEM_Payment_Method::scope_admin . '%' ) ) );
994
+		if ($payment_methods_of_payments) {
995
+			$query_args = array(array('OR*payment_method_for_payment' => array(
996
+					'PMD_ID' => array('IN', $payment_methods_of_payments),
997
+					'PMD_scope' => array('LIKE', '%'.EEM_Payment_Method::scope_admin.'%') )));
998
+		} else {
999
+			$query_args = array(array('PMD_scope' => array('LIKE', '%'.EEM_Payment_Method::scope_admin.'%')));
1000 1000
 		}
1001
-		$this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all( $query_args );
1001
+		$this->_template_args['payment_methods'] = EEM_Payment_Method::instance()->get_all($query_args);
1002 1002
 	}
1003 1003
 
1004 1004
 
@@ -1012,17 +1012,17 @@  discard block
 block discarded – undo
1012 1012
 	 * @param array $metabox
1013 1013
 	 * @return void
1014 1014
 	 */
1015
-	public function txn_attendees_meta_box( $post, $metabox = array( 'args' => array() )) {
1015
+	public function txn_attendees_meta_box($post, $metabox = array('args' => array())) {
1016 1016
 
1017
-		extract( $metabox['args'] );
1017
+		extract($metabox['args']);
1018 1018
 		$this->_template_args['post'] = $post;
1019 1019
 		$this->_template_args['event_attendees'] = array();
1020 1020
 		// process items in cart
1021
-		$line_items = $this->_transaction->get_many_related('Line_Item', array( array( 'LIN_type' => 'line-item' ) ) );
1022
-		if ( ! empty( $line_items )) {
1023
-			foreach ( $line_items as $item ) {
1024
-				if ( $item instanceof EE_Line_Item ) {
1025
-					switch( $item->OBJ_type() ) {
1021
+		$line_items = $this->_transaction->get_many_related('Line_Item', array(array('LIN_type' => 'line-item')));
1022
+		if ( ! empty($line_items)) {
1023
+			foreach ($line_items as $item) {
1024
+				if ($item instanceof EE_Line_Item) {
1025
+					switch ($item->OBJ_type()) {
1026 1026
 
1027 1027
 						case 'Event' :
1028 1028
 							break;
@@ -1030,39 +1030,39 @@  discard block
 block discarded – undo
1030 1030
 						case 'Ticket' :
1031 1031
 							$ticket = $item->ticket();
1032 1032
 							//right now we're only handling tickets here.  Cause its expected that only tickets will have attendees right?
1033
-							if ( ! $ticket instanceof EE_Ticket ) {
1033
+							if ( ! $ticket instanceof EE_Ticket) {
1034 1034
 								continue;
1035 1035
 							}
1036 1036
 							try {
1037 1037
 								$event_name = $ticket->get_event_name();
1038
-							} catch ( Exception $e ) {
1039
-								EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__ );
1040
-								$event_name = esc_html__( 'Unknown Event', 'event_espresso' );
1038
+							} catch (Exception $e) {
1039
+								EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
1040
+								$event_name = esc_html__('Unknown Event', 'event_espresso');
1041 1041
 							}
1042
-							$event_name .= ' - ' . $item->get( 'LIN_name' );
1043
-							$ticket_price = EEH_Template::format_currency( $item->get( 'LIN_unit_price' ) );
1042
+							$event_name .= ' - '.$item->get('LIN_name');
1043
+							$ticket_price = EEH_Template::format_currency($item->get('LIN_unit_price'));
1044 1044
 							// now get all of the registrations for this transaction that use this ticket
1045
-							$registrations = $ticket->get_many_related('Registration', array( array('TXN_ID' => $this->_transaction->ID() )));
1046
-							foreach( $registrations as $registration ) {
1047
-								if ( ! $registration instanceof EE_Registration ) {
1045
+							$registrations = $ticket->get_many_related('Registration', array(array('TXN_ID' => $this->_transaction->ID())));
1046
+							foreach ($registrations as $registration) {
1047
+								if ( ! $registration instanceof EE_Registration) {
1048 1048
 									continue;
1049 1049
 								}
1050
-								$this->_template_args['event_attendees'][$registration->ID()]['STS_ID'] 			= $registration->status_ID();
1051
-								$this->_template_args['event_attendees'][$registration->ID()]['att_num'] 			= $registration->count();
1052
-								$this->_template_args['event_attendees'][$registration->ID()]['event_ticket_name'] 	= $event_name;
1053
-								$this->_template_args['event_attendees'][$registration->ID()]['ticket_price'] 		= $ticket_price;
1050
+								$this->_template_args['event_attendees'][$registration->ID()]['STS_ID'] = $registration->status_ID();
1051
+								$this->_template_args['event_attendees'][$registration->ID()]['att_num'] = $registration->count();
1052
+								$this->_template_args['event_attendees'][$registration->ID()]['event_ticket_name'] = $event_name;
1053
+								$this->_template_args['event_attendees'][$registration->ID()]['ticket_price'] = $ticket_price;
1054 1054
 								// attendee info
1055 1055
 								$attendee = $registration->get_first_related('Attendee');
1056
-								if ( $attendee instanceof EE_Attendee ) {
1057
-									$this->_template_args['event_attendees'][$registration->ID()]['att_id'] 	= $attendee->ID();
1058
-									$this->_template_args['event_attendees'][$registration->ID()]['attendee'] 	= $attendee->full_name();
1059
-									$this->_template_args['event_attendees'][$registration->ID()]['email']		= '<a href="mailto:' . $attendee->email() . '?subject=' . $event_name . esc_html__(' Event', 'event_espresso') . '">' . $attendee->email() . '</a>';
1060
-									$this->_template_args['event_attendees'][$registration->ID()]['address'] 	= EEH_Address::format( $attendee, 'inline', false, false );
1056
+								if ($attendee instanceof EE_Attendee) {
1057
+									$this->_template_args['event_attendees'][$registration->ID()]['att_id'] = $attendee->ID();
1058
+									$this->_template_args['event_attendees'][$registration->ID()]['attendee'] = $attendee->full_name();
1059
+									$this->_template_args['event_attendees'][$registration->ID()]['email'] = '<a href="mailto:'.$attendee->email().'?subject='.$event_name.esc_html__(' Event', 'event_espresso').'">'.$attendee->email().'</a>';
1060
+									$this->_template_args['event_attendees'][$registration->ID()]['address'] = EEH_Address::format($attendee, 'inline', false, false);
1061 1061
 								} else {
1062 1062
 									$this->_template_args['event_attendees'][$registration->ID()]['att_id'] 	= '';
1063
-									$this->_template_args['event_attendees'][$registration->ID()]['attendee'] 	= '';
1063
+									$this->_template_args['event_attendees'][$registration->ID()]['attendee'] = '';
1064 1064
 									$this->_template_args['event_attendees'][$registration->ID()]['email'] 		= '';
1065
-									$this->_template_args['event_attendees'][$registration->ID()]['address'] 	= '';
1065
+									$this->_template_args['event_attendees'][$registration->ID()]['address'] = '';
1066 1066
 								}
1067 1067
 							}
1068 1068
 							break;
@@ -1071,12 +1071,12 @@  discard block
 block discarded – undo
1071 1071
 				}
1072 1072
 			}
1073 1073
 
1074
-			$this->_template_args['transaction_form_url'] = add_query_arg( array( 'action' => 'edit_transaction', 'process' => 'attendees'  ), TXN_ADMIN_URL );
1075
-			echo EEH_Template::display_template( TXN_TEMPLATE_PATH . 'txn_admin_details_main_meta_box_attendees.template.php', $this->_template_args, TRUE );
1074
+			$this->_template_args['transaction_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'attendees'), TXN_ADMIN_URL);
1075
+			echo EEH_Template::display_template(TXN_TEMPLATE_PATH.'txn_admin_details_main_meta_box_attendees.template.php', $this->_template_args, TRUE);
1076 1076
 
1077 1077
 		} else {
1078 1078
 			echo sprintf(
1079
-				esc_html__( '%1$sFor some reason, there are no attendees registered for this transaction. Likely the registration was abandoned in process.%2$s', 'event_espresso' ),
1079
+				esc_html__('%1$sFor some reason, there are no attendees registered for this transaction. Likely the registration was abandoned in process.%2$s', 'event_espresso'),
1080 1080
 				'<p class="important-notice">',
1081 1081
 				'</p>'
1082 1082
 			);
@@ -1095,19 +1095,19 @@  discard block
 block discarded – undo
1095 1095
 	 */
1096 1096
 	public function txn_registrant_side_meta_box() {
1097 1097
 		$primary_att = $this->_transaction->primary_registration() instanceof EE_Registration ? $this->_transaction->primary_registration()->get_first_related('Attendee') : null;
1098
-		if ( ! $primary_att instanceof EE_Attendee ) {
1098
+		if ( ! $primary_att instanceof EE_Attendee) {
1099 1099
 			$this->_template_args['no_attendee_message'] = esc_html__('There is no attached contact for this transaction.  The transaction either failed due to an error or was abandoned.', 'event_espresso');
1100 1100
 			$primary_att = EEM_Attendee::instance()->create_default_object();
1101 1101
 		}
1102
-		$this->_template_args['ATT_ID'] 						= $primary_att->ID();
1102
+		$this->_template_args['ATT_ID'] = $primary_att->ID();
1103 1103
 		$this->_template_args['prime_reg_fname']		= $primary_att->fname();
1104 1104
 		$this->_template_args['prime_reg_lname']		= $primary_att->lname();
1105
-		$this->_template_args['prime_reg_email'] 		= $primary_att->email();
1105
+		$this->_template_args['prime_reg_email'] = $primary_att->email();
1106 1106
 		$this->_template_args['prime_reg_phone'] 	= $primary_att->phone();
1107
-		$this->_template_args['edit_attendee_url'] 	= EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'edit_attendee', 'post' => $primary_att->ID()  ), REG_ADMIN_URL );
1107
+		$this->_template_args['edit_attendee_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit_attendee', 'post' => $primary_att->ID()), REG_ADMIN_URL);
1108 1108
 		// get formatted address for registrant
1109
-		$this->_template_args[ 'formatted_address' ] = EEH_Address::format( $primary_att );
1110
-		echo EEH_Template::display_template( TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE );
1109
+		$this->_template_args['formatted_address'] = EEH_Address::format($primary_att);
1110
+		echo EEH_Template::display_template(TXN_TEMPLATE_PATH.'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE);
1111 1111
 	}
1112 1112
 
1113 1113
 
@@ -1123,12 +1123,12 @@  discard block
 block discarded – undo
1123 1123
 
1124 1124
 		$this->_template_args['billing_form'] = $this->_transaction->billing_info();
1125 1125
 		$this->_template_args['billing_form_url'] = add_query_arg(
1126
-			array( 'action' => 'edit_transaction', 'process' => 'billing'  ),
1126
+			array('action' => 'edit_transaction', 'process' => 'billing'),
1127 1127
 			TXN_ADMIN_URL
1128 1128
 		);
1129 1129
 
1130
-		$template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_billing_info.template.php';
1131
-		echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE );/**/
1130
+		$template_path = TXN_TEMPLATE_PATH.'txn_admin_details_side_meta_box_billing_info.template.php';
1131
+		echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); /**/
1132 1132
 	}
1133 1133
 
1134 1134
 
@@ -1141,42 +1141,42 @@  discard block
 block discarded – undo
1141 1141
 	*	@return void
1142 1142
 	*/
1143 1143
 	public function apply_payments_or_refunds() {
1144
-		$json_response_data = array( 'return_data' => FALSE );
1144
+		$json_response_data = array('return_data' => FALSE);
1145 1145
 		$valid_data = $this->_validate_payment_request_data();
1146
-		if ( ! empty( $valid_data ) ) {
1147
-			$PAY_ID = $valid_data[ 'PAY_ID' ];
1146
+		if ( ! empty($valid_data)) {
1147
+			$PAY_ID = $valid_data['PAY_ID'];
1148 1148
 			//save  the new payment
1149
-			$payment = $this->_create_payment_from_request_data( $valid_data );
1149
+			$payment = $this->_create_payment_from_request_data($valid_data);
1150 1150
 			// get the TXN for this payment
1151 1151
 			$transaction = $payment->transaction();
1152 1152
 			// verify transaction
1153
-			if ( $transaction instanceof EE_Transaction ) {
1153
+			if ($transaction instanceof EE_Transaction) {
1154 1154
 				// calculate_total_payments_and_update_status
1155
-				$this->_process_transaction_payments( $transaction );
1156
-				$REG_IDs = $this->_get_REG_IDs_to_apply_payment_to( $payment );
1157
-				$this->_remove_existing_registration_payments( $payment, $PAY_ID );
1155
+				$this->_process_transaction_payments($transaction);
1156
+				$REG_IDs = $this->_get_REG_IDs_to_apply_payment_to($payment);
1157
+				$this->_remove_existing_registration_payments($payment, $PAY_ID);
1158 1158
 				// apply payment to registrations (if applicable)
1159
-				if ( ! empty( $REG_IDs ) ) {
1160
-					$this->_update_registration_payments( $transaction, $payment, $REG_IDs );
1159
+				if ( ! empty($REG_IDs)) {
1160
+					$this->_update_registration_payments($transaction, $payment, $REG_IDs);
1161 1161
 					$this->_maybe_send_notifications();
1162 1162
 					// now process status changes for the same registrations
1163
-					$this->_process_registration_status_change( $transaction, $REG_IDs );
1163
+					$this->_process_registration_status_change($transaction, $REG_IDs);
1164 1164
 				}
1165
-				$this->_maybe_send_notifications( $payment );
1165
+				$this->_maybe_send_notifications($payment);
1166 1166
 				//prepare to render page
1167
-				$json_response_data[ 'return_data' ] = $this->_build_payment_json_response( $payment, $REG_IDs );
1168
-				do_action( 'AHEE__Transactions_Admin_Page__apply_payments_or_refund__after_recording', $transaction, $payment );
1167
+				$json_response_data['return_data'] = $this->_build_payment_json_response($payment, $REG_IDs);
1168
+				do_action('AHEE__Transactions_Admin_Page__apply_payments_or_refund__after_recording', $transaction, $payment);
1169 1169
 			} else {
1170 1170
 				EE_Error::add_error(
1171
-					esc_html__( 'A valid Transaction for this payment could not be retrieved.', 'event_espresso' ),
1171
+					esc_html__('A valid Transaction for this payment could not be retrieved.', 'event_espresso'),
1172 1172
 					__FILE__, __FUNCTION__, __LINE__
1173 1173
 				);
1174 1174
 			}
1175 1175
 		} else {
1176
-			EE_Error::add_error( esc_html__( 'The payment form data could not be processed. Please try again.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1176
+			EE_Error::add_error(esc_html__('The payment form data could not be processed. Please try again.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1177 1177
 		}
1178 1178
 
1179
-		$notices = EE_Error::get_notices( false, false, false );
1179
+		$notices = EE_Error::get_notices(false, false, false);
1180 1180
 		$this->_template_args = array(
1181 1181
 			'data' => $json_response_data,
1182 1182
 			'error' => $notices['errors'],
@@ -1193,30 +1193,30 @@  discard block
 block discarded – undo
1193 1193
 	 * @return array
1194 1194
 	 */
1195 1195
 	protected function _validate_payment_request_data() {
1196
-		if ( ! isset( $this->_req_data[ 'txn_admin_payment' ] ) ) {
1196
+		if ( ! isset($this->_req_data['txn_admin_payment'])) {
1197 1197
 			return false;
1198 1198
 		}
1199 1199
 		$payment_form = $this->_generate_payment_form_section();
1200 1200
 		try {
1201
-			if ( $payment_form->was_submitted() ) {
1201
+			if ($payment_form->was_submitted()) {
1202 1202
 				$payment_form->receive_form_submission();
1203
-				if ( ! $payment_form->is_valid() ) {
1203
+				if ( ! $payment_form->is_valid()) {
1204 1204
 					$submission_error_messages = array();
1205
-					foreach ( $payment_form->get_validation_errors_accumulated() as $validation_error ) {
1206
-						if ( $validation_error instanceof EE_Validation_Error ) {
1205
+					foreach ($payment_form->get_validation_errors_accumulated() as $validation_error) {
1206
+						if ($validation_error instanceof EE_Validation_Error) {
1207 1207
 							$submission_error_messages[] = sprintf(
1208
-								_x( '%s : %s', 'Form Section Name : Form Validation Error', 'event_espresso' ),
1208
+								_x('%s : %s', 'Form Section Name : Form Validation Error', 'event_espresso'),
1209 1209
 								$validation_error->get_form_section()->html_label_text(),
1210 1210
 								$validation_error->getMessage()
1211 1211
 							);
1212 1212
 						}
1213 1213
 					}
1214
-					EE_Error::add_error( join( '<br />', $submission_error_messages ), __FILE__, __FUNCTION__, __LINE__ );
1214
+					EE_Error::add_error(join('<br />', $submission_error_messages), __FILE__, __FUNCTION__, __LINE__);
1215 1215
 					return array();
1216 1216
 				}
1217 1217
 			}
1218
-		} catch ( EE_Error $e ) {
1219
-			EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__ );
1218
+		} catch (EE_Error $e) {
1219
+			EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
1220 1220
 			return array();
1221 1221
 		}
1222 1222
 		return $payment_form->valid_data();
@@ -1238,63 +1238,63 @@  discard block
 block discarded – undo
1238 1238
 						array(
1239 1239
 							'default' => 0,
1240 1240
 							'required' => false,
1241
-							'html_label_text' => esc_html__( 'Payment ID', 'event_espresso' ),
1242
-							'validation_strategies' => array( new EE_Int_Normalization() )
1241
+							'html_label_text' => esc_html__('Payment ID', 'event_espresso'),
1242
+							'validation_strategies' => array(new EE_Int_Normalization())
1243 1243
 						)
1244 1244
 					),
1245 1245
 					'TXN_ID' => new EE_Text_Input(
1246 1246
 						array(
1247 1247
 							'default' => 0,
1248 1248
 							'required' => true,
1249
-							'html_label_text' => esc_html__( 'Transaction ID', 'event_espresso' ),
1250
-							'validation_strategies' => array( new EE_Int_Normalization() )
1249
+							'html_label_text' => esc_html__('Transaction ID', 'event_espresso'),
1250
+							'validation_strategies' => array(new EE_Int_Normalization())
1251 1251
 						)
1252 1252
 					),
1253 1253
 					'type' => new EE_Text_Input(
1254 1254
 						array(
1255 1255
 							'default' => 1,
1256 1256
 							'required' => true,
1257
-							'html_label_text' => esc_html__( 'Payment or Refund', 'event_espresso' ),
1258
-							'validation_strategies' => array( new EE_Int_Normalization() )
1257
+							'html_label_text' => esc_html__('Payment or Refund', 'event_espresso'),
1258
+							'validation_strategies' => array(new EE_Int_Normalization())
1259 1259
 						)
1260 1260
 					),
1261 1261
 					'amount' => new EE_Text_Input(
1262 1262
 						array(
1263 1263
 							'default' => 0,
1264 1264
 							'required' => true,
1265
-							'html_label_text' => esc_html__( 'Payment amount', 'event_espresso' ),
1266
-							'validation_strategies' => array( new EE_Float_Normalization() )
1265
+							'html_label_text' => esc_html__('Payment amount', 'event_espresso'),
1266
+							'validation_strategies' => array(new EE_Float_Normalization())
1267 1267
 						)
1268 1268
 					),
1269 1269
 					'status' => new EE_Text_Input(
1270 1270
 						array(
1271 1271
 							'default' => EEM_Payment::status_id_approved,
1272 1272
 							'required' => true,
1273
-							'html_label_text' => esc_html__( 'Payment status', 'event_espresso' ),
1273
+							'html_label_text' => esc_html__('Payment status', 'event_espresso'),
1274 1274
 						)
1275 1275
 					),
1276 1276
 					'PMD_ID' => new EE_Text_Input(
1277 1277
 						array(
1278 1278
 							'default' => 2,
1279 1279
 							'required' => true,
1280
-							'html_label_text' => esc_html__( 'Payment Method', 'event_espresso' ),
1281
-							'validation_strategies' => array( new EE_Int_Normalization() )
1280
+							'html_label_text' => esc_html__('Payment Method', 'event_espresso'),
1281
+							'validation_strategies' => array(new EE_Int_Normalization())
1282 1282
 						)
1283 1283
 					),
1284 1284
 					'date' => new EE_Text_Input(
1285 1285
 						array(
1286 1286
 							'default' => time(),
1287 1287
 							'required' => true,
1288
-							'html_label_text' => esc_html__( 'Payment date', 'event_espresso' ),
1288
+							'html_label_text' => esc_html__('Payment date', 'event_espresso'),
1289 1289
 						)
1290 1290
 					),
1291 1291
 					'txn_id_chq_nmbr' => new EE_Text_Input(
1292 1292
 						array(
1293 1293
 							'default' => '',
1294 1294
 							'required' => false,
1295
-							'html_label_text' => esc_html__( 'Transaction or Cheque Number', 'event_espresso' ),
1295
+							'html_label_text' => esc_html__('Transaction or Cheque Number', 'event_espresso'),
1296 1296
                                                         'validation_strategies' => array(
1297
-                                                            new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1297
+                                                            new EE_Max_Length_Validation_Strategy(esc_html__('Input too long', 'event_espresso'), 100),
1298 1298
                                                         )
1299 1299
 						)
1300 1300
 					),
@@ -1302,9 +1302,9 @@  discard block
 block discarded – undo
1302 1302
 						array(
1303 1303
 							'default' => '',
1304 1304
 							'required' => false,
1305
-							'html_label_text' => esc_html__( 'Purchase Order Number', 'event_espresso' ),
1305
+							'html_label_text' => esc_html__('Purchase Order Number', 'event_espresso'),
1306 1306
                                                         'validation_strategies' => array(
1307
-                                                            new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1307
+                                                            new EE_Max_Length_Validation_Strategy(esc_html__('Input too long', 'event_espresso'), 100),
1308 1308
                                                         )
1309 1309
 						)
1310 1310
 					),
@@ -1312,9 +1312,9 @@  discard block
 block discarded – undo
1312 1312
 						array(
1313 1313
 							'default' => '',
1314 1314
 							'required' => false,
1315
-							'html_label_text' => esc_html__( 'Extra Field for Accounting', 'event_espresso' ),
1315
+							'html_label_text' => esc_html__('Extra Field for Accounting', 'event_espresso'),
1316 1316
                                                         'validation_strategies' => array(
1317
-                                                            new EE_Max_Length_Validation_Strategy( esc_html__('Input too long', 'event_espresso'), 100 ),
1317
+                                                            new EE_Max_Length_Validation_Strategy(esc_html__('Input too long', 'event_espresso'), 100),
1318 1318
                                                         )
1319 1319
 						)
1320 1320
 					),
@@ -1331,37 +1331,37 @@  discard block
 block discarded – undo
1331 1331
 	 * @param array $valid_data
1332 1332
 	 * @return EE_Payment
1333 1333
 	 */
1334
-	protected function _create_payment_from_request_data( $valid_data ) {
1335
-		$PAY_ID = $valid_data[ 'PAY_ID' ];
1334
+	protected function _create_payment_from_request_data($valid_data) {
1335
+		$PAY_ID = $valid_data['PAY_ID'];
1336 1336
 		// get payment amount
1337
-		$amount = $valid_data[ 'amount' ] ? abs( $valid_data[ 'amount' ] ) : 0;
1337
+		$amount = $valid_data['amount'] ? abs($valid_data['amount']) : 0;
1338 1338
 		// payments have a type value of 1 and refunds have a type value of -1
1339 1339
 		// so multiplying amount by type will give a positive value for payments, and negative values for refunds
1340
-		$amount = $valid_data[ 'type' ] < 0 ? $amount * -1 : $amount;
1340
+		$amount = $valid_data['type'] < 0 ? $amount * -1 : $amount;
1341 1341
 		// for some reason the date string coming in has extra spaces between the date and time.  This fixes that.
1342
-		$date = $valid_data['date'] ? preg_replace( '/\s+/', ' ', $valid_data['date'] ) : date( 'Y-m-d g:i a', current_time( 'timestamp' ) );
1342
+		$date = $valid_data['date'] ? preg_replace('/\s+/', ' ', $valid_data['date']) : date('Y-m-d g:i a', current_time('timestamp'));
1343 1343
 		$payment = EE_Payment::new_instance(
1344 1344
 			array(
1345
-				'TXN_ID' 								=> $valid_data[ 'TXN_ID' ],
1346
-				'STS_ID' 								=> $valid_data[ 'status' ],
1345
+				'TXN_ID' 								=> $valid_data['TXN_ID'],
1346
+				'STS_ID' 								=> $valid_data['status'],
1347 1347
 				'PAY_timestamp' 				=> $date,
1348 1348
 				'PAY_source'           			=> EEM_Payment_Method::scope_admin,
1349
-				'PMD_ID'               				=> $valid_data[ 'PMD_ID' ],
1349
+				'PMD_ID'               				=> $valid_data['PMD_ID'],
1350 1350
 				'PAY_amount'           			=> $amount,
1351
-				'PAY_txn_id_chq_nmbr'  	=> $valid_data[ 'txn_id_chq_nmbr' ],
1352
-				'PAY_po_number'        		=> $valid_data[ 'po_number' ],
1353
-				'PAY_extra_accntng'    		=> $valid_data[ 'accounting' ],
1351
+				'PAY_txn_id_chq_nmbr'  	=> $valid_data['txn_id_chq_nmbr'],
1352
+				'PAY_po_number'        		=> $valid_data['po_number'],
1353
+				'PAY_extra_accntng'    		=> $valid_data['accounting'],
1354 1354
 				'PAY_details'          				=> $valid_data,
1355 1355
 				'PAY_ID'               				=> $PAY_ID
1356 1356
 			),
1357 1357
 			'',
1358
-			array( 'Y-m-d', 'g:i a' )
1358
+			array('Y-m-d', 'g:i a')
1359 1359
 		);
1360 1360
 
1361
-		if ( ! $payment->save() ) {
1361
+		if ( ! $payment->save()) {
1362 1362
 			EE_Error::add_error(
1363 1363
 				sprintf(
1364
-					esc_html__( 'Payment %1$d has not been successfully saved to the database.', 'event_espresso' ),
1364
+					esc_html__('Payment %1$d has not been successfully saved to the database.', 'event_espresso'),
1365 1365
 					$payment->ID()
1366 1366
 				),
1367 1367
 				__FILE__, __FUNCTION__, __LINE__
@@ -1378,15 +1378,15 @@  discard block
 block discarded – undo
1378 1378
 	 * @param \EE_Transaction $transaction
1379 1379
 	 * @return array
1380 1380
 	 */
1381
-	protected function _process_transaction_payments( EE_Transaction $transaction ) {
1381
+	protected function _process_transaction_payments(EE_Transaction $transaction) {
1382 1382
 		/** @type EE_Transaction_Payments $transaction_payments */
1383
-		$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1383
+		$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1384 1384
 		//update the transaction with this payment
1385
-		if ( $transaction_payments->calculate_total_payments_and_update_status( $transaction ) ) {
1386
-			EE_Error::add_success( esc_html__( 'The payment has been processed successfully.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1385
+		if ($transaction_payments->calculate_total_payments_and_update_status($transaction)) {
1386
+			EE_Error::add_success(esc_html__('The payment has been processed successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1387 1387
 		} else {
1388 1388
 			EE_Error::add_error(
1389
-				esc_html__( 'The payment was processed successfully but the amount paid for the transaction was not updated.', 'event_espresso' )
1389
+				esc_html__('The payment was processed successfully but the amount paid for the transaction was not updated.', 'event_espresso')
1390 1390
 				, __FILE__, __FUNCTION__, __LINE__
1391 1391
 			);
1392 1392
 		}
@@ -1402,19 +1402,19 @@  discard block
 block discarded – undo
1402 1402
 	 * @param \EE_Payment $payment
1403 1403
 	 * @return array
1404 1404
 	 */
1405
-	protected function _get_REG_IDs_to_apply_payment_to( EE_Payment $payment ) {
1405
+	protected function _get_REG_IDs_to_apply_payment_to(EE_Payment $payment) {
1406 1406
 		$REG_IDs = array();
1407 1407
 		// grab array of IDs for specific registrations to apply changes to
1408
-		if ( isset( $this->_req_data[ 'txn_admin_payment' ][ 'registrations' ] ) ) {
1409
-			$REG_IDs = (array)$this->_req_data[ 'txn_admin_payment' ][ 'registrations' ];
1408
+		if (isset($this->_req_data['txn_admin_payment']['registrations'])) {
1409
+			$REG_IDs = (array) $this->_req_data['txn_admin_payment']['registrations'];
1410 1410
 		}
1411 1411
 		//nothing specified ? then get all reg IDs
1412
-		if ( empty( $REG_IDs ) ) {
1412
+		if (empty($REG_IDs)) {
1413 1413
 			$registrations = $payment->transaction()->registrations();
1414
-			$REG_IDs = ! empty( $registrations ) ? array_keys( $registrations ) : $this->_get_existing_reg_payment_REG_IDs( $payment );
1414
+			$REG_IDs = ! empty($registrations) ? array_keys($registrations) : $this->_get_existing_reg_payment_REG_IDs($payment);
1415 1415
 		}
1416 1416
 		// ensure that REG_IDs are integers and NOT strings
1417
-		return array_map( 'intval', $REG_IDs );
1417
+		return array_map('intval', $REG_IDs);
1418 1418
 	}
1419 1419
 
1420 1420
 
@@ -1431,7 +1431,7 @@  discard block
 block discarded – undo
1431 1431
 	/**
1432 1432
 	 * @param array $existing_reg_payment_REG_IDs
1433 1433
 	 */
1434
-	public function set_existing_reg_payment_REG_IDs( $existing_reg_payment_REG_IDs = null ) {
1434
+	public function set_existing_reg_payment_REG_IDs($existing_reg_payment_REG_IDs = null) {
1435 1435
 		$this->_existing_reg_payment_REG_IDs = $existing_reg_payment_REG_IDs;
1436 1436
 	}
1437 1437
 
@@ -1446,13 +1446,13 @@  discard block
 block discarded – undo
1446 1446
 	 * @param \EE_Payment $payment
1447 1447
 	 * @return array
1448 1448
 	 */
1449
-	protected function _get_existing_reg_payment_REG_IDs( EE_Payment $payment ) {
1450
-		if ( $this->existing_reg_payment_REG_IDs() === null ) {
1449
+	protected function _get_existing_reg_payment_REG_IDs(EE_Payment $payment) {
1450
+		if ($this->existing_reg_payment_REG_IDs() === null) {
1451 1451
 			// let's get any existing reg payment records for this payment
1452
-			$existing_reg_payment_REG_IDs = $payment->get_many_related( 'Registration' );
1452
+			$existing_reg_payment_REG_IDs = $payment->get_many_related('Registration');
1453 1453
 			// but we only want the REG IDs, so grab the array keys
1454
-			$existing_reg_payment_REG_IDs = ! empty( $existing_reg_payment_REG_IDs ) ? array_keys( $existing_reg_payment_REG_IDs ) : array();
1455
-			$this->set_existing_reg_payment_REG_IDs( $existing_reg_payment_REG_IDs );
1454
+			$existing_reg_payment_REG_IDs = ! empty($existing_reg_payment_REG_IDs) ? array_keys($existing_reg_payment_REG_IDs) : array();
1455
+			$this->set_existing_reg_payment_REG_IDs($existing_reg_payment_REG_IDs);
1456 1456
 		}
1457 1457
 		return $this->existing_reg_payment_REG_IDs();
1458 1458
 	}
@@ -1471,23 +1471,23 @@  discard block
 block discarded – undo
1471 1471
 	 * @param int         $PAY_ID
1472 1472
 	 * @return bool;
1473 1473
 	 */
1474
-	protected function _remove_existing_registration_payments( EE_Payment $payment, $PAY_ID = 0 ) {
1474
+	protected function _remove_existing_registration_payments(EE_Payment $payment, $PAY_ID = 0) {
1475 1475
 		// newly created payments will have nothing recorded for $PAY_ID
1476
-		if ( $PAY_ID == 0 ) {
1476
+		if ($PAY_ID == 0) {
1477 1477
 			return false;
1478 1478
 		}
1479
-		$existing_reg_payment_REG_IDs = $this->_get_existing_reg_payment_REG_IDs( $payment );
1480
-		if ( empty( $existing_reg_payment_REG_IDs )) {
1479
+		$existing_reg_payment_REG_IDs = $this->_get_existing_reg_payment_REG_IDs($payment);
1480
+		if (empty($existing_reg_payment_REG_IDs)) {
1481 1481
 			return false;
1482 1482
 		}
1483 1483
 		/** @type EE_Transaction_Payments $transaction_payments */
1484
-		$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1484
+		$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1485 1485
 		return $transaction_payments->delete_registration_payments_and_update_registrations(
1486 1486
 			$payment,
1487 1487
 			array(
1488 1488
 				array(
1489 1489
 					'PAY_ID' => $payment->ID(),
1490
-					'REG_ID' => array( 'IN', $existing_reg_payment_REG_IDs ),
1490
+					'REG_ID' => array('IN', $existing_reg_payment_REG_IDs),
1491 1491
 				)
1492 1492
 			)
1493 1493
 		);
@@ -1506,25 +1506,25 @@  discard block
 block discarded – undo
1506 1506
 	 * @param array $REG_IDs
1507 1507
 	 * @return bool
1508 1508
 	 */
1509
-	protected function _update_registration_payments( EE_Transaction $transaction, EE_Payment $payment, $REG_IDs = array() ) {
1509
+	protected function _update_registration_payments(EE_Transaction $transaction, EE_Payment $payment, $REG_IDs = array()) {
1510 1510
 		// we can pass our own custom set of registrations to EE_Payment_Processor::process_registration_payments()
1511 1511
 		// so let's do that using our set of REG_IDs from the form
1512 1512
 		$registration_query_where_params = array(
1513
-			'REG_ID' => array( 'IN', $REG_IDs )
1513
+			'REG_ID' => array('IN', $REG_IDs)
1514 1514
 		);
1515 1515
 		// but add in some conditions regarding payment,
1516 1516
 		// so that we don't apply payments to registrations that are free or have already been paid for
1517 1517
 		// but ONLY if the payment is NOT a refund ( ie: the payment amount is not negative )
1518
-		if ( ! $payment->is_a_refund() ) {
1519
-			$registration_query_where_params[ 'REG_final_price' ]  = array( '!=', 0 );
1520
-			$registration_query_where_params[ 'REG_final_price*' ]  = array( '!=', 'REG_paid', true );
1518
+		if ( ! $payment->is_a_refund()) {
1519
+			$registration_query_where_params['REG_final_price'] = array('!=', 0);
1520
+			$registration_query_where_params['REG_final_price*'] = array('!=', 'REG_paid', true);
1521 1521
 		}
1522 1522
 		//EEH_Debug_Tools::printr( $registration_query_where_params, '$registration_query_where_params', __FILE__, __LINE__ );
1523
-		$registrations = $transaction->registrations( array( $registration_query_where_params ) );
1524
-		if ( ! empty( $registrations ) ) {
1523
+		$registrations = $transaction->registrations(array($registration_query_where_params));
1524
+		if ( ! empty($registrations)) {
1525 1525
 			/** @type EE_Payment_Processor $payment_processor */
1526
-			$payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' );
1527
-			$payment_processor->process_registration_payments( $transaction, $payment, $registrations );
1526
+			$payment_processor = EE_Registry::instance()->load_core('Payment_Processor');
1527
+			$payment_processor->process_registration_payments($transaction, $payment, $registrations);
1528 1528
 		}
1529 1529
 	}
1530 1530
 
@@ -1540,22 +1540,22 @@  discard block
 block discarded – undo
1540 1540
 	 * @param array $REG_IDs
1541 1541
 	 * @return bool
1542 1542
 	 */
1543
-	protected function _process_registration_status_change( EE_Transaction $transaction, $REG_IDs = array() ) {
1543
+	protected function _process_registration_status_change(EE_Transaction $transaction, $REG_IDs = array()) {
1544 1544
 		// first if there is no change in status then we get out.
1545 1545
 		if (
1546
-			! isset( $this->_req_data['txn_reg_status_change'], $this->_req_data[ 'txn_reg_status_change' ][ 'reg_status' ] )
1546
+			! isset($this->_req_data['txn_reg_status_change'], $this->_req_data['txn_reg_status_change']['reg_status'])
1547 1547
 			|| $this->_req_data['txn_reg_status_change']['reg_status'] == 'NAN'
1548 1548
 		) {
1549 1549
 			//no error message, no change requested, just nothing to do man.
1550 1550
 			return FALSE;
1551 1551
 		}
1552 1552
 		/** @type EE_Transaction_Processor $transaction_processor */
1553
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1553
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1554 1554
 		// made it here dude?  Oh WOW.  K, let's take care of changing the statuses
1555 1555
 		return $transaction_processor->manually_update_registration_statuses(
1556 1556
 			$transaction,
1557
-			sanitize_text_field( $this->_req_data[ 'txn_reg_status_change' ][ 'reg_status' ] ),
1558
-			array( array( 'REG_ID' => array( 'IN', $REG_IDs ) ) )
1557
+			sanitize_text_field($this->_req_data['txn_reg_status_change']['reg_status']),
1558
+			array(array('REG_ID' => array('IN', $REG_IDs)))
1559 1559
 		);
1560 1560
 	}
1561 1561
 
@@ -1570,16 +1570,16 @@  discard block
 block discarded – undo
1570 1570
 	 * @param bool | null        $delete_txn_reg_status_change
1571 1571
 	 * @return array
1572 1572
 	 */
1573
-	protected function _build_payment_json_response( EE_Payment $payment, $REG_IDs = array(), $delete_txn_reg_status_change = null ) {
1573
+	protected function _build_payment_json_response(EE_Payment $payment, $REG_IDs = array(), $delete_txn_reg_status_change = null) {
1574 1574
 		// was the payment deleted ?
1575
-		if ( is_bool( $delete_txn_reg_status_change )) {
1575
+		if (is_bool($delete_txn_reg_status_change)) {
1576 1576
 			return array(
1577 1577
 				'PAY_ID' 				=> $payment->ID(),
1578 1578
 				'amount' 			=> $payment->amount(),
1579 1579
 				'total_paid' 			=> $payment->transaction()->paid(),
1580 1580
 				'txn_status' 			=> $payment->transaction()->status_ID(),
1581 1581
 				'pay_status' 		=> $payment->STS_ID(),
1582
-				'registrations' 	=> $this->_registration_payment_data_array( $REG_IDs ),
1582
+				'registrations' 	=> $this->_registration_payment_data_array($REG_IDs),
1583 1583
 				'delete_txn_reg_status_change' => $delete_txn_reg_status_change,
1584 1584
 			);
1585 1585
 		} else {
@@ -1591,16 +1591,16 @@  discard block
 block discarded – undo
1591 1591
 				'pay_status' 	=> $payment->STS_ID(),
1592 1592
 				'PAY_ID'           => $payment->ID(),
1593 1593
 				'STS_ID' 			=> $payment->STS_ID(),
1594
-				'status' 			=> self::$_pay_status[ $payment->STS_ID() ],
1595
-				'date' 				=> $payment->timestamp( 'Y-m-d', 'h:i a' ),
1596
-				'method' 		=> strtoupper( $payment->source() ),
1594
+				'status' 			=> self::$_pay_status[$payment->STS_ID()],
1595
+				'date' 				=> $payment->timestamp('Y-m-d', 'h:i a'),
1596
+				'method' 		=> strtoupper($payment->source()),
1597 1597
 				'PM_ID' 			=> $payment->payment_method() ? $payment->payment_method()->ID() : 1,
1598
-				'gateway' 		=> $payment->payment_method() ? $payment->payment_method()->admin_name() : esc_html__( "Unknown", 'event_espresso' ),
1598
+				'gateway' 		=> $payment->payment_method() ? $payment->payment_method()->admin_name() : esc_html__("Unknown", 'event_espresso'),
1599 1599
 				'gateway_response' 	=> $payment->gateway_response(),
1600 1600
 				'txn_id_chq_nmbr'  	=> $payment->txn_id_chq_nmbr(),
1601 1601
 				'po_number'        		=> $payment->po_number(),
1602 1602
 				'extra_accntng'    		=> $payment->extra_accntng(),
1603
-				'registrations'    			=> $this->_registration_payment_data_array( $REG_IDs ),
1603
+				'registrations'    			=> $this->_registration_payment_data_array($REG_IDs),
1604 1604
 			);
1605 1605
 		}
1606 1606
 	}
@@ -1615,39 +1615,39 @@  discard block
 block discarded – undo
1615 1615
 	*	@return void
1616 1616
 	*/
1617 1617
 	public function delete_payment() {
1618
-		$json_response_data = array( 'return_data' => FALSE );
1619
-		$PAY_ID = isset( $this->_req_data['delete_txn_admin_payment'], $this->_req_data['delete_txn_admin_payment']['PAY_ID'] ) ? absint( $this->_req_data['delete_txn_admin_payment']['PAY_ID'] ) : 0;
1620
-		if ( $PAY_ID ) {
1621
-			$delete_txn_reg_status_change = isset( $this->_req_data[ 'delete_txn_reg_status_change' ] ) ? $this->_req_data[ 'delete_txn_reg_status_change' ] : false;
1622
-			$payment = EEM_Payment::instance()->get_one_by_ID( $PAY_ID );
1623
-			if ( $payment instanceof EE_Payment ) {
1624
-				$REG_IDs = $this->_get_existing_reg_payment_REG_IDs( $payment );
1618
+		$json_response_data = array('return_data' => FALSE);
1619
+		$PAY_ID = isset($this->_req_data['delete_txn_admin_payment'], $this->_req_data['delete_txn_admin_payment']['PAY_ID']) ? absint($this->_req_data['delete_txn_admin_payment']['PAY_ID']) : 0;
1620
+		if ($PAY_ID) {
1621
+			$delete_txn_reg_status_change = isset($this->_req_data['delete_txn_reg_status_change']) ? $this->_req_data['delete_txn_reg_status_change'] : false;
1622
+			$payment = EEM_Payment::instance()->get_one_by_ID($PAY_ID);
1623
+			if ($payment instanceof EE_Payment) {
1624
+				$REG_IDs = $this->_get_existing_reg_payment_REG_IDs($payment);
1625 1625
 				/** @type EE_Transaction_Payments $transaction_payments */
1626
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1627
-				if ( $transaction_payments->delete_payment_and_update_transaction( $payment )) {
1628
-					$json_response_data['return_data'] = $this->_build_payment_json_response( $payment, $REG_IDs, $delete_txn_reg_status_change );
1629
-					if ( $delete_txn_reg_status_change ) {
1626
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1627
+				if ($transaction_payments->delete_payment_and_update_transaction($payment)) {
1628
+					$json_response_data['return_data'] = $this->_build_payment_json_response($payment, $REG_IDs, $delete_txn_reg_status_change);
1629
+					if ($delete_txn_reg_status_change) {
1630 1630
 						$this->_req_data['txn_reg_status_change'] = $delete_txn_reg_status_change;
1631 1631
 						//MAKE sure we also add the delete_txn_req_status_change to the
1632 1632
 						//$_REQUEST global because that's how messages will be looking for it.
1633 1633
 						$_REQUEST['txn_reg_status_change'] = $delete_txn_reg_status_change;
1634 1634
 						$this->_maybe_send_notifications();
1635
-						$this->_process_registration_status_change( $payment->transaction(), $REG_IDs );
1635
+						$this->_process_registration_status_change($payment->transaction(), $REG_IDs);
1636 1636
 					}
1637 1637
 				}
1638 1638
 			} else {
1639 1639
 				EE_Error::add_error(
1640
-					esc_html__( 'Valid Payment data could not be retrieved from the database.', 'event_espresso' ),
1640
+					esc_html__('Valid Payment data could not be retrieved from the database.', 'event_espresso'),
1641 1641
 					__FILE__, __FUNCTION__, __LINE__
1642 1642
 				);
1643 1643
 			}
1644 1644
 		} else {
1645 1645
 			EE_Error::add_error(
1646
-				esc_html__( 'A valid Payment ID was not received, therefore payment form data could not be loaded.', 'event_espresso' ),
1646
+				esc_html__('A valid Payment ID was not received, therefore payment form data could not be loaded.', 'event_espresso'),
1647 1647
 				__FILE__, __FUNCTION__, __LINE__
1648 1648
 			);
1649 1649
 		}
1650
-		$notices = EE_Error::get_notices( false, false, false);
1650
+		$notices = EE_Error::get_notices(false, false, false);
1651 1651
 		$this->_template_args = array(
1652 1652
 			'data' => $json_response_data,
1653 1653
 			'success' => $notices['success'],
@@ -1667,16 +1667,16 @@  discard block
 block discarded – undo
1667 1667
 	 * @param array $REG_IDs
1668 1668
 	 * @return array
1669 1669
 	 */
1670
-	protected function _registration_payment_data_array( $REG_IDs ) {
1670
+	protected function _registration_payment_data_array($REG_IDs) {
1671 1671
 		$registration_payment_data = array();
1672 1672
 		//if non empty reg_ids lets get an array of registrations and update the values for the apply_payment/refund rows.
1673
-		if ( ! empty( $REG_IDs ) ) {
1674
-			$registrations = EEM_Registration::instance()->get_all( array( array( 'REG_ID' => array( 'IN', $REG_IDs ) ) ) );
1675
-			foreach ( $registrations as $registration ) {
1676
-				if ( $registration instanceof EE_Registration ) {
1677
-					$registration_payment_data[ $registration->ID() ] = array(
1673
+		if ( ! empty($REG_IDs)) {
1674
+			$registrations = EEM_Registration::instance()->get_all(array(array('REG_ID' => array('IN', $REG_IDs))));
1675
+			foreach ($registrations as $registration) {
1676
+				if ($registration instanceof EE_Registration) {
1677
+					$registration_payment_data[$registration->ID()] = array(
1678 1678
 						'paid' => $registration->pretty_paid(),
1679
-						'owing' => EEH_Template::format_currency( $registration->final_price() - $registration->paid() ),
1679
+						'owing' => EEH_Template::format_currency($registration->final_price() - $registration->paid()),
1680 1680
 					);
1681 1681
 				}
1682 1682
 			}
@@ -1696,30 +1696,30 @@  discard block
 block discarded – undo
1696 1696
 	 * @access protected
1697 1697
 	 * @param \EE_Payment | null $payment
1698 1698
 	 */
1699
-	protected function _maybe_send_notifications( $payment = null ) {
1700
-		switch ( $payment instanceof EE_Payment ) {
1699
+	protected function _maybe_send_notifications($payment = null) {
1700
+		switch ($payment instanceof EE_Payment) {
1701 1701
 			// payment notifications
1702 1702
 			case true :
1703 1703
 				if (
1704 1704
 					isset(
1705
-						$this->_req_data[ 'txn_payments' ],
1706
-						$this->_req_data[ 'txn_payments' ][ 'send_notifications' ]
1705
+						$this->_req_data['txn_payments'],
1706
+						$this->_req_data['txn_payments']['send_notifications']
1707 1707
 					) &&
1708
-					filter_var( $this->_req_data[ 'txn_payments' ][ 'send_notifications' ], FILTER_VALIDATE_BOOLEAN )
1708
+					filter_var($this->_req_data['txn_payments']['send_notifications'], FILTER_VALIDATE_BOOLEAN)
1709 1709
 				) {
1710
-					$this->_process_payment_notification( $payment );
1710
+					$this->_process_payment_notification($payment);
1711 1711
 				}
1712 1712
 				break;
1713 1713
 			// registration notifications
1714 1714
 			case false :
1715 1715
 				if (
1716 1716
 					isset(
1717
-						$this->_req_data[ 'txn_reg_status_change' ],
1718
-						$this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ]
1717
+						$this->_req_data['txn_reg_status_change'],
1718
+						$this->_req_data['txn_reg_status_change']['send_notifications']
1719 1719
 					) &&
1720
-					filter_var( $this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ], FILTER_VALIDATE_BOOLEAN )
1720
+					filter_var($this->_req_data['txn_reg_status_change']['send_notifications'], FILTER_VALIDATE_BOOLEAN)
1721 1721
 				) {
1722
-					add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true' );
1722
+					add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true');
1723 1723
 				}
1724 1724
 				break;
1725 1725
 		}
@@ -1735,11 +1735,11 @@  discard block
 block discarded – undo
1735 1735
 	*	@return void
1736 1736
 	*/
1737 1737
 	protected function _send_payment_reminder() {
1738
-	    $TXN_ID = ( ! empty( $this->_req_data['TXN_ID'] )) ? absint( $this->_req_data['TXN_ID'] ) : FALSE;
1739
-		$transaction = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
1740
-		$query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID'] ) : array();
1741
-		do_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction );
1742
-		$this->_redirect_after_action( FALSE, esc_html__('payment reminder', 'event_espresso'), esc_html__('sent', 'event_espresso'), $query_args, TRUE );
1738
+	    $TXN_ID = ( ! empty($this->_req_data['TXN_ID'])) ? absint($this->_req_data['TXN_ID']) : FALSE;
1739
+		$transaction = EEM_Transaction::instance()->get_one_by_ID($TXN_ID);
1740
+		$query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], 'TXN_ID' => $this->_req_data['TXN_ID']) : array();
1741
+		do_action('AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', $transaction);
1742
+		$this->_redirect_after_action(FALSE, esc_html__('payment reminder', 'event_espresso'), esc_html__('sent', 'event_espresso'), $query_args, TRUE);
1743 1743
 	}
1744 1744
 
1745 1745
 
@@ -1753,36 +1753,36 @@  discard block
 block discarded – undo
1753 1753
 	 * @param string   $view
1754 1754
 	 * @return mixed int = count || array of transaction objects
1755 1755
 	 */
1756
-	public function get_transactions( $perpage, $count = FALSE, $view = '' ) {
1756
+	public function get_transactions($perpage, $count = FALSE, $view = '') {
1757 1757
 
1758 1758
 		$TXN = EEM_Transaction::instance();
1759 1759
 
1760
-	    $start_date = isset( $this->_req_data['txn-filter-start-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-start-date'] ) : date( 'm/d/Y', strtotime( '-10 year' ));
1761
-	    $end_date = isset( $this->_req_data['txn-filter-end-date'] ) ? wp_strip_all_tags( $this->_req_data['txn-filter-end-date'] ) : date( 'm/d/Y' );
1760
+	    $start_date = isset($this->_req_data['txn-filter-start-date']) ? wp_strip_all_tags($this->_req_data['txn-filter-start-date']) : date('m/d/Y', strtotime('-10 year'));
1761
+	    $end_date = isset($this->_req_data['txn-filter-end-date']) ? wp_strip_all_tags($this->_req_data['txn-filter-end-date']) : date('m/d/Y');
1762 1762
 
1763 1763
 	    //make sure our timestamps start and end right at the boundaries for each day
1764
-	    $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
1765
-	    $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
1764
+	    $start_date = date('Y-m-d', strtotime($start_date)).' 00:00:00';
1765
+	    $end_date = date('Y-m-d', strtotime($end_date)).' 23:59:59';
1766 1766
 
1767 1767
 
1768 1768
 	    //convert to timestamps
1769
-	    $start_date = strtotime( $start_date );
1770
-	    $end_date = strtotime( $end_date );
1769
+	    $start_date = strtotime($start_date);
1770
+	    $end_date = strtotime($end_date);
1771 1771
 
1772 1772
 	    //makes sure start date is the lowest value and vice versa
1773
-	    $start_date = min( $start_date, $end_date );
1774
-	    $end_date = max( $start_date, $end_date );
1773
+	    $start_date = min($start_date, $end_date);
1774
+	    $end_date = max($start_date, $end_date);
1775 1775
 
1776 1776
 	    //convert to correct format for query
1777
-	$start_date = EEM_Transaction::instance()->convert_datetime_for_query( 'TXN_timestamp', date( 'Y-m-d H:i:s', $start_date ), 'Y-m-d H:i:s' );
1778
-	$end_date = EEM_Transaction::instance()->convert_datetime_for_query( 'TXN_timestamp', date( 'Y-m-d H:i:s', $end_date ), 'Y-m-d H:i:s' );
1777
+	$start_date = EEM_Transaction::instance()->convert_datetime_for_query('TXN_timestamp', date('Y-m-d H:i:s', $start_date), 'Y-m-d H:i:s');
1778
+	$end_date = EEM_Transaction::instance()->convert_datetime_for_query('TXN_timestamp', date('Y-m-d H:i:s', $end_date), 'Y-m-d H:i:s');
1779 1779
 
1780 1780
 
1781 1781
 
1782 1782
 	    //set orderby
1783 1783
 		$this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : '';
1784 1784
 
1785
-		switch ( $this->_req_data['orderby'] ) {
1785
+		switch ($this->_req_data['orderby']) {
1786 1786
 			case 'TXN_ID':
1787 1787
 				$orderby = 'TXN_ID';
1788 1788
 				break;
@@ -1796,66 +1796,66 @@  discard block
 block discarded – undo
1796 1796
 				$orderby = 'TXN_timestamp';
1797 1797
 		}
1798 1798
 
1799
-		$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC';
1800
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
1801
-		$per_page = isset( $perpage ) && !empty( $perpage ) ? $perpage : 10;
1802
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
1799
+		$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC';
1800
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
1801
+		$per_page = isset($perpage) && ! empty($perpage) ? $perpage : 10;
1802
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
1803 1803
 
1804
-		$offset = ($current_page-1)*$per_page;
1805
-		$limit = array( $offset, $per_page );
1804
+		$offset = ($current_page - 1) * $per_page;
1805
+		$limit = array($offset, $per_page);
1806 1806
 
1807 1807
 		$_where = array(
1808
-			'TXN_timestamp' => array('BETWEEN', array($start_date, $end_date) ),
1808
+			'TXN_timestamp' => array('BETWEEN', array($start_date, $end_date)),
1809 1809
 			'Registration.REG_count' => 1
1810 1810
 		);
1811 1811
 
1812
-		if ( isset( $this->_req_data['EVT_ID'] ) ) {
1812
+		if (isset($this->_req_data['EVT_ID'])) {
1813 1813
 			$_where['Registration.EVT_ID'] = $this->_req_data['EVT_ID'];
1814 1814
 		}
1815 1815
 
1816
-		if ( isset( $this->_req_data['s'] ) ) {
1817
-			$search_string = '%' . $this->_req_data['s'] . '%';
1816
+		if (isset($this->_req_data['s'])) {
1817
+			$search_string = '%'.$this->_req_data['s'].'%';
1818 1818
 			$_where['OR'] = array(
1819
-				'Registration.Event.EVT_name' => array( 'LIKE', $search_string ),
1820
-				'Registration.Event.EVT_desc' => array( 'LIKE', $search_string ),
1821
-				'Registration.Event.EVT_short_desc' => array( 'LIKE' , $search_string ),
1822
-				'Registration.Attendee.ATT_full_name' => array( 'LIKE', $search_string ),
1823
-				'Registration.Attendee.ATT_fname' => array( 'LIKE', $search_string ),
1824
-				'Registration.Attendee.ATT_lname' => array( 'LIKE', $search_string ),
1825
-				'Registration.Attendee.ATT_short_bio' => array( 'LIKE', $search_string ),
1826
-				'Registration.Attendee.ATT_email' => array('LIKE', $search_string ),
1827
-				'Registration.Attendee.ATT_address' => array( 'LIKE', $search_string ),
1828
-				'Registration.Attendee.ATT_address2' => array( 'LIKE', $search_string ),
1829
-				'Registration.Attendee.ATT_city' => array( 'LIKE', $search_string ),
1830
-				'Registration.REG_final_price' => array( 'LIKE', $search_string ),
1831
-				'Registration.REG_code' => array( 'LIKE', $search_string ),
1832
-				'Registration.REG_count' => array( 'LIKE' , $search_string ),
1833
-				'Registration.REG_group_size' => array( 'LIKE' , $search_string ),
1834
-				'Registration.Ticket.TKT_name' => array( 'LIKE', $search_string ),
1835
-				'Registration.Ticket.TKT_description' => array( 'LIKE', $search_string ),
1836
-				'Payment.PAY_source' => array('LIKE', $search_string ),
1837
-				'Payment.Payment_Method.PMD_name' => array('LIKE', $search_string ),
1838
-				'TXN_session_data' => array( 'LIKE', $search_string ),
1839
-				'Payment.PAY_txn_id_chq_nmbr' => array( 'LIKE', $search_string )
1819
+				'Registration.Event.EVT_name' => array('LIKE', $search_string),
1820
+				'Registration.Event.EVT_desc' => array('LIKE', $search_string),
1821
+				'Registration.Event.EVT_short_desc' => array('LIKE', $search_string),
1822
+				'Registration.Attendee.ATT_full_name' => array('LIKE', $search_string),
1823
+				'Registration.Attendee.ATT_fname' => array('LIKE', $search_string),
1824
+				'Registration.Attendee.ATT_lname' => array('LIKE', $search_string),
1825
+				'Registration.Attendee.ATT_short_bio' => array('LIKE', $search_string),
1826
+				'Registration.Attendee.ATT_email' => array('LIKE', $search_string),
1827
+				'Registration.Attendee.ATT_address' => array('LIKE', $search_string),
1828
+				'Registration.Attendee.ATT_address2' => array('LIKE', $search_string),
1829
+				'Registration.Attendee.ATT_city' => array('LIKE', $search_string),
1830
+				'Registration.REG_final_price' => array('LIKE', $search_string),
1831
+				'Registration.REG_code' => array('LIKE', $search_string),
1832
+				'Registration.REG_count' => array('LIKE', $search_string),
1833
+				'Registration.REG_group_size' => array('LIKE', $search_string),
1834
+				'Registration.Ticket.TKT_name' => array('LIKE', $search_string),
1835
+				'Registration.Ticket.TKT_description' => array('LIKE', $search_string),
1836
+				'Payment.PAY_source' => array('LIKE', $search_string),
1837
+				'Payment.Payment_Method.PMD_name' => array('LIKE', $search_string),
1838
+				'TXN_session_data' => array('LIKE', $search_string),
1839
+				'Payment.PAY_txn_id_chq_nmbr' => array('LIKE', $search_string)
1840 1840
 				);
1841 1841
 		}
1842 1842
 
1843 1843
 		//failed transactions
1844
-		$failed = ( ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'failed' && ! $count ) || ( $count && $view == 'failed' ) ? TRUE: FALSE;
1845
-		$abandoned = ( ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] == 'abandoned' && ! $count ) || ( $count && $view == 'abandoned' ) ? TRUE: FALSE;
1844
+		$failed = ( ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'failed' && ! $count) || ($count && $view == 'failed') ? TRUE: FALSE;
1845
+		$abandoned = ( ! empty($this->_req_data['status']) && $this->_req_data['status'] == 'abandoned' && ! $count) || ($count && $view == 'abandoned') ? TRUE: FALSE;
1846 1846
 
1847
-		if ( $failed ) {
1848
-			$_where[ 'STS_ID' ] = EEM_Transaction::failed_status_code;
1849
-		} else if ( $abandoned ) {
1847
+		if ($failed) {
1848
+			$_where['STS_ID'] = EEM_Transaction::failed_status_code;
1849
+		} else if ($abandoned) {
1850 1850
 				$_where['STS_ID'] = EEM_Transaction::abandoned_status_code;
1851 1851
 		} else {
1852
-				$_where['STS_ID'] = array( '!=', EEM_Transaction::failed_status_code );
1853
-				$_where['STS_ID*'] = array( '!=', EEM_Transaction::abandoned_status_code );
1852
+				$_where['STS_ID'] = array('!=', EEM_Transaction::failed_status_code);
1853
+				$_where['STS_ID*'] = array('!=', EEM_Transaction::abandoned_status_code);
1854 1854
 		}
1855 1855
 
1856
-		$query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'limit' => $limit );
1856
+		$query_params = array($_where, 'order_by' => array($orderby => $sort), 'limit' => $limit);
1857 1857
 
1858
-		$transactions = $count ? $TXN->count( array($_where), 'TXN_ID', TRUE ) : $TXN->get_all($query_params);
1858
+		$transactions = $count ? $TXN->count(array($_where), 'TXN_ID', TRUE) : $TXN->get_all($query_params);
1859 1859
 
1860 1860
 
1861 1861
 		return $transactions;
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_6_0.dms.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  * @author        Mike Nelson
14 14
  * @since         4.6.0
15 15
  */
16
-class EE_DMS_Core_4_6_0 extends EE_Data_Migration_Script_Base{
16
+class EE_DMS_Core_4_6_0 extends EE_Data_Migration_Script_Base {
17 17
 
18 18
 	/**
19 19
 	 * return EE_DMS_Core_4_6_0
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	 * @param TableAnalysis $table_analysis
23 23
 	 * @throws \EE_Error
24 24
 	 */
25
-	public function __construct( TableManager $table_manager = null, TableAnalysis $table_analysis = null ) {
25
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) {
26 26
 		$this->_load_script_stages();
27 27
 		$this->_pretty_name = __("Data Migration to Event Espresso 4.6.0.P", "event_espresso");
28 28
 		$this->_priority = 10;
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 			new EE_DMS_4_6_0_payments(),
38 38
 			new EE_DMS_4_6_0_invoice_settings()
39 39
 		);
40
-		parent::__construct( $table_manager, $table_analysis );
40
+		parent::__construct($table_manager, $table_analysis);
41 41
 	}
42 42
 
43 43
 
@@ -48,14 +48,14 @@  discard block
 block discarded – undo
48 48
 	 */
49 49
 	public function can_migrate_from_version($version_array) {
50 50
 		$version_string = $version_array['Core'];
51
-		if($version_string <= '4.6.0' && $version_string >= '4.5.0' ){
51
+		if ($version_string <= '4.6.0' && $version_string >= '4.5.0') {
52 52
 //			echo "$version_string can be migrated from";
53 53
 			return true;
54
-		}elseif( ! $version_string ){
54
+		}elseif ( ! $version_string) {
55 55
 //			echo "no version string provided: $version_string";
56 56
 			//no version string provided... this must be pre 4.3
57
-			return false;//changed mind. dont want people thinking they should migrate yet because they cant
58
-		}else{
57
+			return false; //changed mind. dont want people thinking they should migrate yet because they cant
58
+		} else {
59 59
 //			echo "$version_string doesnt apply";
60 60
 			return false;
61 61
 		}
@@ -77,14 +77,14 @@  discard block
 block discarded – undo
77 77
 	 */
78 78
 	public function schema_changes_before_migration() {
79 79
 		//relies on 4.1's EEH_Activation::create_table
80
-		require_once( EE_HELPERS . 'EEH_Activation.helper.php' );
81
-		$table_name='esp_answer';
82
-		$sql=" ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
80
+		require_once(EE_HELPERS.'EEH_Activation.helper.php');
81
+		$table_name = 'esp_answer';
82
+		$sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
83 83
 					REG_ID INT UNSIGNED NOT NULL,
84 84
 					QST_ID INT UNSIGNED NOT NULL,
85 85
 					ANS_value TEXT NOT NULL,
86 86
 					PRIMARY KEY  (ANS_ID)";
87
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
87
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
88 88
 
89 89
 		$table_name = 'esp_attendee_meta';
90 90
 		$sql = "ATTM_ID INT(10) UNSIGNED NOT	NULL AUTO_INCREMENT,
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 					  CNT_is_EU TINYINT(1) DEFAULT '0',
124 124
 					  CNT_active TINYINT(1) DEFAULT '0',
125 125
 					  PRIMARY KEY  (CNT_ISO)";
126
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
126
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
127 127
 
128 128
 		$table_name = 'esp_currency';
129 129
 		$sql = "CUR_code VARCHAR(6) COLLATE utf8_bin NOT NULL,
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 				CUR_dec_plc VARCHAR(1) COLLATE utf8_bin NOT NULL DEFAULT '2',
134 134
 				CUR_active TINYINT(1) DEFAULT '0',
135 135
 				PRIMARY KEY  (CUR_code)";
136
-		$this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB' );
136
+		$this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
137 137
 
138 138
 
139 139
 		$table_name = 'esp_currency_payment_method';
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 
164 164
 
165 165
 
166
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
166
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
167 167
 		$table_name = 'esp_event_meta';
168 168
 		$sql = "
169 169
 			EVTM_ID INT NOT NULL AUTO_INCREMENT,
@@ -180,41 +180,41 @@  discard block
 block discarded – undo
180 180
 			EVT_external_URL VARCHAR(200) NULL,
181 181
 			EVT_donations TINYINT(1) NULL,
182 182
 			PRIMARY KEY  (EVTM_ID)";
183
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
183
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
184 184
 
185 185
 
186 186
 
187
-		$table_name='esp_event_question_group';
188
-		$sql="EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
187
+		$table_name = 'esp_event_question_group';
188
+		$sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
189 189
 					EVT_ID BIGINT(20) UNSIGNED NOT NULL,
190 190
 					QSG_ID INT UNSIGNED NOT NULL,
191 191
 					EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
192 192
 					PRIMARY KEY  (EQG_ID)";
193
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
193
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
194 194
 
195 195
 
196 196
 
197
-		$table_name='esp_event_venue';
198
-		$sql="EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
197
+		$table_name = 'esp_event_venue';
198
+		$sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
199 199
 				EVT_ID BIGINT(20) UNSIGNED NOT NULL,
200 200
 				VNU_ID BIGINT(20) UNSIGNED NOT NULL,
201 201
 				EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
202 202
 				PRIMARY KEY  (EVV_ID)";
203
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
203
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
204 204
 
205 205
 
206 206
 
207
-		$table_name='esp_extra_meta';
208
-		$sql="EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
207
+		$table_name = 'esp_extra_meta';
208
+		$sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
209 209
 				OBJ_ID INT(11) DEFAULT NULL,
210 210
 				EXM_type VARCHAR(45) DEFAULT NULL,
211 211
 				EXM_key VARCHAR(45) DEFAULT NULL,
212 212
 				EXM_value TEXT,
213 213
 				PRIMARY KEY  (EXM_ID)";
214
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
214
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
215 215
 
216
-		$table_name='esp_line_item';
217
-		$sql="LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
216
+		$table_name = 'esp_line_item';
217
+		$sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
218 218
 				LIN_code VARCHAR(245) NOT NULL DEFAULT '',
219 219
 				TXN_ID INT(11) DEFAULT NULL,
220 220
 				LIN_name VARCHAR(245) NOT NULL DEFAULT '',
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 				OBJ_ID INT(11) DEFAULT NULL,
231 231
 				OBJ_type VARCHAR(45)DEFAULT NULL,
232 232
 				PRIMARY KEY  (LIN_ID)";
233
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB' );
233
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
234 234
 
235 235
 		$table_name = 'esp_log';
236 236
 		$sql = "LOG_ID INT(11) NOT NULL AUTO_INCREMENT,
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 					KEY GRP_ID (GRP_ID)";
254 254
 		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
255 255
 
256
-		$this->_get_table_manager()->dropIndex( 'esp_message_template_group', 'EVT_ID' );
256
+		$this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID');
257 257
 
258 258
 		$table_name = 'esp_message_template_group';
259 259
 		$sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 					MTP_is_active TINYINT(1) NOT NULL DEFAULT '1',
269 269
 					PRIMARY KEY  (GRP_ID),
270 270
 					KEY MTP_user_id (MTP_user_id)";
271
-		$this->_table_should_exist_previously( $table_name, $sql, 'ENGINE=InnoDB');
271
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
272 272
 
273 273
 		$table_name = 'esp_event_message_template';
274 274
 		$sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 					PRIMARY KEY  (EMT_ID),
278 278
 					KEY EVT_ID (EVT_ID),
279 279
 					KEY GRP_ID (GRP_ID)";
280
-		$this->_table_should_exist_previously( $table_name, $sql, 'ENGINE=InnoDB');
280
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
281 281
 
282 282
 
283 283
 		$table_name = 'esp_payment';
@@ -345,8 +345,8 @@  discard block
 block discarded – undo
345 345
 					  PRIMARY KEY  (TTM_ID)";
346 346
 		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
347 347
 
348
-		$table_name='esp_question';
349
-		$sql='QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
348
+		$table_name = 'esp_question';
349
+		$sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
350 350
 					QST_display_text TEXT NOT NULL,
351 351
 					QST_admin_label VARCHAR(255) NOT NULL,
352 352
 					QST_system VARCHAR(25) DEFAULT NULL,
@@ -358,27 +358,27 @@  discard block
 block discarded – undo
358 358
 					QST_wp_user BIGINT UNSIGNED NULL,
359 359
 					QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0,
360 360
 					PRIMARY KEY  (QST_ID)';
361
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
361
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
362 362
 
363
-		$table_name='esp_question_group_question';
364
-		$sql="QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
363
+		$table_name = 'esp_question_group_question';
364
+		$sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
365 365
 					QSG_ID INT UNSIGNED NOT NULL,
366 366
 					QST_ID INT UNSIGNED NOT NULL,
367 367
 					QGQ_order INT UNSIGNED NOT NULL DEFAULT 0,
368 368
 					PRIMARY KEY  (QGQ_ID) ";
369
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
369
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
370 370
 
371 371
 
372 372
 
373
-		$table_name='esp_question_option';
374
-		$sql="QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
373
+		$table_name = 'esp_question_option';
374
+		$sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
375 375
 					QSO_value VARCHAR(255) NOT NULL,
376 376
 					QSO_desc TEXT NOT NULL,
377 377
 					QST_ID INT UNSIGNED NOT NULL,
378 378
 					QSO_order INT UNSIGNED NOT NULL DEFAULT 0,
379 379
 					QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
380 380
 					PRIMARY KEY  (QSO_ID)";
381
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
381
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
382 382
 
383 383
 
384 384
 
@@ -411,8 +411,8 @@  discard block
 block discarded – undo
411 411
 
412 412
 
413 413
 
414
-		$table_name='esp_checkin';
415
-		$sql="CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
414
+		$table_name = 'esp_checkin';
415
+		$sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
416 416
 					REG_ID INT(10) UNSIGNED NOT NULL,
417 417
 					DTT_ID INT(10) UNSIGNED NOT NULL,
418 418
 					CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1,
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 					  PRC_wp_user BIGINT UNSIGNED NULL,
502 502
 					  PRC_parent INT(10) UNSIGNED DEFAULT 0,
503 503
 					  PRIMARY KEY  (PRC_ID)";
504
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
504
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
505 505
 
506 506
 		$table_name = "esp_price_type";
507 507
 		$sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -538,12 +538,12 @@  discard block
 block discarded – undo
538 538
 					  TKT_parent INT(10) UNSIGNED DEFAULT '0',
539 539
 					  TKT_deleted TINYINT(1) NOT NULL DEFAULT '0',
540 540
 					  PRIMARY KEY  (TKT_ID)";
541
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
541
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
542 542
 
543
-		$this->_get_table_manager()->dropIndex( 'esp_question_group', 'QSG_identifier_UNIQUE' );
543
+		$this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE');
544 544
 
545 545
 		$table_name = 'esp_question_group';
546
-		$sql='QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
546
+		$sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
547 547
 					QSG_name VARCHAR(255) NOT NULL,
548 548
 					QSG_identifier VARCHAR(100) NOT NULL,
549 549
 					QSG_desc TEXT NULL,
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 					QSG_wp_user BIGINT UNSIGNED NULL,
556 556
 					PRIMARY KEY  (QSG_ID),
557 557
 					UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)';
558
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
558
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
559 559
 
560 560
 		/** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */
561 561
 		$script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
@@ -583,15 +583,15 @@  discard block
 block discarded – undo
583 583
 		return true;
584 584
 	}
585 585
 
586
-	public function migration_page_hooks(){
586
+	public function migration_page_hooks() {
587 587
 
588 588
 	}
589 589
 
590
-	public function add_default_admin_only_payments(){
590
+	public function add_default_admin_only_payments() {
591 591
 		global $wpdb;
592 592
 		$table_name = $wpdb->prefix."esp_payment_method";
593 593
 		$user_id = EEH_Activation::get_default_creator_id();
594
-		if ( $this->_get_table_analysis()->tableExists( $table_name ) ) {
594
+		if ($this->_get_table_analysis()->tableExists($table_name)) {
595 595
 
596 596
 			$SQL = "SELECT COUNT( * ) FROM $table_name";
597 597
 			$existing_payment_methods = $wpdb->get_var($SQL);
@@ -612,11 +612,11 @@  discard block
 block discarded – undo
612 612
 			//so admins can record payments for them from the admin page
613 613
 
614 614
 
615
-			foreach($default_admin_only_payment_methods as $nicename => $description){
615
+			foreach ($default_admin_only_payment_methods as $nicename => $description) {
616 616
 				$slug = sanitize_key($nicename);
617 617
 			//check that such a payment method exists
618
-				$exists = $wpdb->get_var($wpdb->prepare("SELECT count(*) FROM $table_name WHERE PMD_slug = %s",$slug));
619
-				if( ! $exists){
618
+				$exists = $wpdb->get_var($wpdb->prepare("SELECT count(*) FROM $table_name WHERE PMD_slug = %s", $slug));
619
+				if ( ! $exists) {
620 620
 					$values = array(
621 621
 								'PMD_type'=>'Admin_Only',
622 622
 								'PMD_name'=>$nicename,
@@ -630,17 +630,17 @@  discard block
 block discarded – undo
630 630
 							$table_name,
631 631
 							$values,
632 632
 							array(
633
-								'%s',//PMD_type
634
-								'%s',//PMD_name
635
-								'%s',//PMD_admin_name
636
-								'%s',//PMD_admin_desc
637
-								'%s',//PMD_slug
638
-								'%d',//PMD_wp_user
639
-								'%s',//PMD_scope
633
+								'%s', //PMD_type
634
+								'%s', //PMD_name
635
+								'%s', //PMD_admin_name
636
+								'%s', //PMD_admin_desc
637
+								'%s', //PMD_slug
638
+								'%d', //PMD_wp_user
639
+								'%s', //PMD_scope
640 640
 							)
641 641
 							);
642
-					if( ! $success ){
643
-						$this->add_error(sprintf(__("Could not insert new admin-only payment method with values %s during migration", "event_espresso"),$this->_json_encode($values)));
642
+					if ( ! $success) {
643
+						$this->add_error(sprintf(__("Could not insert new admin-only payment method with values %s during migration", "event_espresso"), $this->_json_encode($values)));
644 644
 					}
645 645
 				}
646 646
 			}
@@ -658,11 +658,11 @@  discard block
 block discarded – undo
658 658
 
659 659
 		global $wpdb;
660 660
 		$currency_table = $wpdb->prefix."esp_currency";
661
-		if ( $this->_get_table_analysis()->tableExists( $currency_table ) ) {
661
+		if ($this->_get_table_analysis()->tableExists($currency_table)) {
662 662
 
663 663
 			$SQL = "SELECT COUNT('CUR_code') FROM $currency_table";
664 664
 			$countries = $wpdb->get_var($SQL);
665
-			if ( ! $countries ) {
665
+			if ( ! $countries) {
666 666
 				$SQL = "INSERT INTO $currency_table
667 667
 				( CUR_code, CUR_single, CUR_plural, CUR_sign, CUR_dec_plc, CUR_active) VALUES
668 668
 				( 'EUR',  'Euro',  'Euros',  '€',  2,1),
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_3_0.dms.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  * mostly just
8 8
  * -adds QSO_order to the Question_Option table;
9 9
  */
10
-class EE_DMS_Core_4_3_0 extends EE_Data_Migration_Script_Base{
10
+class EE_DMS_Core_4_3_0 extends EE_Data_Migration_Script_Base {
11 11
 
12 12
 
13 13
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 * @param TableAnalysis $table_analysis
19 19
 	 * @throws \EE_Error
20 20
 	 */
21
-	public function __construct( TableManager $table_manager = null, TableAnalysis $table_analysis = null ) {
21
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) {
22 22
 		$this->_load_script_stages();
23 23
 		$this->_pretty_name = __("Data Migration to Event Espresso 4.3.0.P", "event_espresso");
24 24
 		$this->_priority = 10;
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
 			new EE_DMS_4_3_0_event_message_templates(),
28 28
 			new EE_DMS_4_3_0_critical_page_shortcode_tracking()
29 29
 		);
30
-		parent::__construct( $table_manager, $table_analysis );
30
+		parent::__construct($table_manager, $table_analysis);
31 31
 	}
32 32
 
33 33
 
34 34
 
35 35
 	public function can_migrate_from_version($version_array) {
36 36
 		$version_string = $version_array['Core'];
37
-		if($version_string <= '4.3.0' && $version_string >= '4.2.0' ){
37
+		if ($version_string <= '4.3.0' && $version_string >= '4.2.0') {
38 38
 //			echo "$version_string can be migrated fro";
39 39
 			return true;
40
-		}elseif( ! $version_string ){
40
+		}elseif ( ! $version_string) {
41 41
 //			echo "no version string provided: $version_string";
42 42
 			//no version string provided... this must be pre 4.2
43
-			return false;//changed mind. dont want people thinking they should migrate yet because they cant
44
-		}else{
43
+			return false; //changed mind. dont want people thinking they should migrate yet because they cant
44
+		} else {
45 45
 //			echo "$version_string doesnt apply";
46 46
 			return false;
47 47
 		}
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
 	}
52 52
 	public function schema_changes_before_migration() {
53 53
 		//relies on 4.1's EEH_Activation::create_table
54
-		require_once( EE_HELPERS . 'EEH_Activation.helper.php' );
55
-		$table_name='esp_answer';
56
-		$sql=" ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
54
+		require_once(EE_HELPERS.'EEH_Activation.helper.php');
55
+		$table_name = 'esp_answer';
56
+		$sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
57 57
 					REG_ID INT UNSIGNED NOT NULL,
58 58
 					QST_ID INT UNSIGNED NOT NULL,
59 59
 					ANS_value TEXT NOT NULL,
60 60
 					PRIMARY KEY  (ANS_ID)";
61
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
61
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
62 62
 
63 63
 		$table_name = 'esp_attendee_meta';
64 64
 		$sql = "ATTM_ID INT(10) UNSIGNED NOT	NULL AUTO_INCREMENT,
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 					  CNT_is_EU TINYINT(1) DEFAULT '0',
98 98
 					  CNT_active TINYINT(1) DEFAULT '0',
99 99
 					  PRIMARY KEY  (CNT_ISO)";
100
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
100
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
101 101
 
102 102
 
103 103
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
 
122 122
 
123
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
123
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
124 124
 		$table_name = 'esp_event_meta';
125 125
 		$sql = "
126 126
 			EVTM_ID INT NOT NULL AUTO_INCREMENT,
@@ -137,41 +137,41 @@  discard block
 block discarded – undo
137 137
 			EVT_external_URL VARCHAR(200) NULL,
138 138
 			EVT_donations TINYINT(1) NULL,
139 139
 			PRIMARY KEY  (EVTM_ID)";
140
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
140
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
141 141
 
142 142
 
143 143
 
144
-		$table_name='esp_event_question_group';
145
-		$sql="EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
144
+		$table_name = 'esp_event_question_group';
145
+		$sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
146 146
 					EVT_ID BIGINT(20) UNSIGNED NOT NULL,
147 147
 					QSG_ID INT UNSIGNED NOT NULL,
148 148
 					EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
149 149
 					PRIMARY KEY  (EQG_ID)";
150
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
150
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
151 151
 
152 152
 
153 153
 
154
-		$table_name='esp_event_venue';
155
-		$sql="EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
154
+		$table_name = 'esp_event_venue';
155
+		$sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
156 156
 				EVT_ID BIGINT(20) UNSIGNED NOT NULL,
157 157
 				VNU_ID BIGINT(20) UNSIGNED NOT NULL,
158 158
 				EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
159 159
 				PRIMARY KEY  (EVV_ID)";
160
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
160
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
161 161
 
162 162
 
163 163
 
164
-		$table_name='esp_extra_meta';
165
-		$sql="EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
164
+		$table_name = 'esp_extra_meta';
165
+		$sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
166 166
 				OBJ_ID INT(11) DEFAULT NULL,
167 167
 				EXM_type VARCHAR(45) DEFAULT NULL,
168 168
 				EXM_key VARCHAR(45) DEFAULT NULL,
169 169
 				EXM_value TEXT,
170 170
 				PRIMARY KEY  (EXM_ID)";
171
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
171
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
172 172
 
173
-		$table_name='esp_line_item';
174
-		$sql="LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
173
+		$table_name = 'esp_line_item';
174
+		$sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
175 175
 				LIN_code VARCHAR(245) NOT NULL DEFAULT '',
176 176
 				TXN_ID INT(11) DEFAULT NULL,
177 177
 				LIN_name VARCHAR(245) NOT NULL DEFAULT '',
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 				OBJ_ID INT(11) DEFAULT NULL,
188 188
 				OBJ_type VARCHAR(45)DEFAULT NULL,
189 189
 				PRIMARY KEY  (LIN_ID)";
190
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB' );
190
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
191 191
 
192 192
 		$table_name = 'esp_message_template';
193 193
 		$sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 					KEY GRP_ID (GRP_ID)";
200 200
 		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
201 201
 
202
-		$this->_get_table_manager()->dropIndex( 'esp_message_template_group', 'EVT_ID' );
202
+		$this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID');
203 203
 
204 204
 		$table_name = 'esp_message_template_group';
205 205
 		$sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 					MTP_is_active TINYINT(1) NOT NULL DEFAULT '1',
215 215
 					PRIMARY KEY  (GRP_ID),
216 216
 					KEY MTP_user_id (MTP_user_id)";
217
-		$this->_table_should_exist_previously( $table_name, $sql, 'ENGINE=InnoDB');
217
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
218 218
 
219 219
 		$table_name = 'esp_event_message_template';
220 220
 		$sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 					PRIMARY KEY  (EMT_ID),
224 224
 					KEY EVT_ID (EVT_ID),
225 225
 					KEY GRP_ID (GRP_ID)";
226
-		$this->_table_is_new_in_this_version( $table_name, $sql, 'ENGINE=InnoDB');
226
+		$this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
227 227
 
228 228
 
229 229
 
@@ -332,8 +332,8 @@  discard block
 block discarded – undo
332 332
 
333 333
 
334 334
 
335
-		$table_name='esp_question';
336
-		$sql='QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
335
+		$table_name = 'esp_question';
336
+		$sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
337 337
 					QST_display_text TEXT NOT NULL,
338 338
 					QST_admin_label VARCHAR(255) NOT NULL,
339 339
 					QST_system VARCHAR(25) DEFAULT NULL,
@@ -345,12 +345,12 @@  discard block
 block discarded – undo
345 345
 					QST_wp_user BIGINT UNSIGNED NULL,
346 346
 					QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0,
347 347
 					PRIMARY KEY  (QST_ID)';
348
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
348
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
349 349
 
350
-		$this->_get_table_manager()->dropIndex( 'esp_question_group', 'QSG_identifier_UNIQUE' );
350
+		$this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE');
351 351
 
352 352
 		$table_name = 'esp_question_group';
353
-		$sql='QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
353
+		$sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
354 354
 					QSG_name VARCHAR(255) NOT NULL,
355 355
 					QSG_identifier VARCHAR(100) NOT NULL,
356 356
 					QSG_desc TEXT NULL,
@@ -361,29 +361,29 @@  discard block
 block discarded – undo
361 361
 					QSG_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
362 362
 					PRIMARY KEY  (QSG_ID),
363 363
 					UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)';
364
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
364
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
365 365
 
366 366
 
367 367
 
368
-		$table_name='esp_question_group_question';
369
-		$sql="QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
368
+		$table_name = 'esp_question_group_question';
369
+		$sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
370 370
 					QSG_ID INT UNSIGNED NOT NULL,
371 371
 					QST_ID INT UNSIGNED NOT NULL,
372 372
 					QGQ_order INT UNSIGNED NOT NULL DEFAULT 0,
373 373
 					PRIMARY KEY  (QGQ_ID) ";
374
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
374
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
375 375
 
376 376
 
377 377
 
378
-		$table_name='esp_question_option';
379
-		$sql="QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
378
+		$table_name = 'esp_question_option';
379
+		$sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
380 380
 					QSO_value VARCHAR(255) NOT NULL,
381 381
 					QSO_desc TEXT NOT NULL,
382 382
 					QST_ID INT UNSIGNED NOT NULL,
383 383
 					QSO_order INT UNSIGNED NOT NULL DEFAULT 0,
384 384
 					QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
385 385
 					PRIMARY KEY  (QSO_ID)";
386
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
386
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
387 387
 
388 388
 
389 389
 
@@ -416,8 +416,8 @@  discard block
 block discarded – undo
416 416
 
417 417
 
418 418
 
419
-		$table_name='esp_checkin';
420
-		$sql="CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
419
+		$table_name = 'esp_checkin';
420
+		$sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
421 421
 					REG_ID INT(10) UNSIGNED NOT NULL,
422 422
 					DTT_ID INT(10) UNSIGNED NOT NULL,
423 423
 					CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1,
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
492 492
 
493 493
 
494
-		$script_with_defaults = EE_Registry::instance()->load_dms( 'Core_4_1_0' );
494
+		$script_with_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
495 495
 		//setting up the DEFAULT stats and countries is also essential for the data migrations to run
496 496
 		//(because many need to convert old string states to foreign keys into the states table)
497 497
 		$script_with_defaults->insert_default_states();
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 		return true;
514 514
 	}
515 515
 
516
-	public function migration_page_hooks(){
516
+	public function migration_page_hooks() {
517 517
 
518 518
 	}
519 519
 
@@ -529,34 +529,34 @@  discard block
 block discarded – undo
529 529
 
530 530
 		global $wpdb;
531 531
 		$ticket_table = $wpdb->prefix."esp_ticket";
532
-		if ( $this->_get_table_analysis()->tableExists( $ticket_table ) ) {
532
+		if ($this->_get_table_analysis()->tableExists($ticket_table)) {
533 533
 
534
-			$SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table;
534
+			$SQL = 'SELECT COUNT(TKT_ID) FROM '.$ticket_table;
535 535
 			$tickets_exist = $wpdb->get_var($SQL);
536 536
 
537
-			if ( ! $tickets_exist ) {
537
+			if ( ! $tickets_exist) {
538 538
 				$SQL = "INSERT INTO $ticket_table
539 539
 					( TKT_ID, TTM_ID, TKT_name, TKT_description, TKT_qty, TKT_sold, TKT_uses, TKT_required, TKT_min, TKT_max, TKT_price, TKT_start_date, TKT_end_date, TKT_taxable, TKT_order, TKT_row, TKT_is_default, TKT_parent, TKT_deleted ) VALUES
540
-					( 1, 0, '" . __("Free Ticket", "event_espresso") . "', '', 100, 0, -1, 0, 0, -1, 0.00, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, 0, 1, 1, 0, 0);";
541
-				$SQL = apply_filters( 'FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL', $SQL );
540
+					( 1, 0, '".__("Free Ticket", "event_espresso")."', '', 100, 0, -1, 0, 0, -1, 0.00, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, 0, 1, 1, 0, 0);";
541
+				$SQL = apply_filters('FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL', $SQL);
542 542
 				$wpdb->query($SQL);
543 543
 			}
544 544
 		}
545 545
 		$ticket_price_table = $wpdb->prefix."esp_ticket_price";
546 546
 
547
-		if ( $this->_get_table_analysis()->tableExists( $ticket_price_table ) ) {
547
+		if ($this->_get_table_analysis()->tableExists($ticket_price_table)) {
548 548
 
549
-			$SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table;
549
+			$SQL = 'SELECT COUNT(TKP_ID) FROM '.$ticket_price_table;
550 550
 			$ticket_prc_exist = $wpdb->get_var($SQL);
551 551
 
552
-			if ( ! $ticket_prc_exist ) {
552
+			if ( ! $ticket_prc_exist) {
553 553
 
554 554
 				$SQL = "INSERT INTO $ticket_price_table
555 555
 				( TKP_ID, TKT_ID, PRC_ID ) VALUES
556 556
 				( 1, 1, 1 )
557 557
 				";
558 558
 
559
-				$SQL = apply_filters( 'FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL__ticket_price', $SQL );
559
+				$SQL = apply_filters('FHEE__EE_DMS_4_1_0__insert_default_tickets__SQL__ticket_price', $SQL);
560 560
 				$wpdb->query($SQL);
561 561
 			}
562 562
 		}
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_2_0.dms.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * -adds QGQ_order to the question-group_question table;
9 9
  * -adds DTT_name and DTT_description to the datetime table;
10 10
  */
11
-class EE_DMS_Core_4_2_0 extends EE_Data_Migration_Script_Base{
11
+class EE_DMS_Core_4_2_0 extends EE_Data_Migration_Script_Base {
12 12
 
13 13
 
14 14
 
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	 * @param TableAnalysis $table_analysis
20 20
 	 * @throws \EE_Error
21 21
 	 */
22
-	public function __construct( TableManager $table_manager = null, TableAnalysis $table_analysis = null ) {
22
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) {
23 23
 		$this->_load_script_stages();
24 24
 		$this->_pretty_name = __("Data Migration to Event Espresso 4.2.0.P", "event_espresso");
25 25
 		$this->_priority = 10;
@@ -27,22 +27,22 @@  discard block
 block discarded – undo
27 27
 			new EE_DMS_4_2_0_question_group_questions(),
28 28
 			new EE_DMS_4_2_0_datetime_fields(),
29 29
 		);
30
-		parent::__construct( $table_manager, $table_analysis );
30
+		parent::__construct($table_manager, $table_analysis);
31 31
 	}
32 32
 
33 33
 
34 34
 
35 35
 	public function can_migrate_from_version($version_array) {
36 36
 		$version_string = $version_array['Core'];
37
-		if ( version_compare( $version_string, '4.2.0', '<=' ) && version_compare( $version_string, '4.1.0', '>=' ) ) {
37
+		if (version_compare($version_string, '4.2.0', '<=') && version_compare($version_string, '4.1.0', '>=')) {
38 38
 //			echo "$version_string can be migrated fro";
39 39
 			return true;
40
-		}elseif( ! $version_string ){
40
+		}elseif ( ! $version_string) {
41 41
 //			echo "no version string provided: $version_string";
42 42
 			//no version string provided... this must be pre 4.1
43 43
 			//because since 4.1 we're
44
-			return false;//changed mind. dont want people thinking they should migrate yet because they cant
45
-		}else{
44
+			return false; //changed mind. dont want people thinking they should migrate yet because they cant
45
+		} else {
46 46
 //			echo "$version_string doesnt apply";
47 47
 			return false;
48 48
 		}
@@ -52,14 +52,14 @@  discard block
 block discarded – undo
52 52
 	}
53 53
 	public function schema_changes_before_migration() {
54 54
 		//relies on 4.1's EEH_Activation::create_table
55
-		require_once( EE_HELPERS . 'EEH_Activation.helper.php' );
56
-		$table_name='esp_answer';
57
-		$sql=" ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
55
+		require_once(EE_HELPERS.'EEH_Activation.helper.php');
56
+		$table_name = 'esp_answer';
57
+		$sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
58 58
 					REG_ID INT UNSIGNED NOT NULL,
59 59
 					QST_ID INT UNSIGNED NOT NULL,
60 60
 					ANS_value TEXT NOT NULL,
61 61
 					PRIMARY KEY  (ANS_ID)";
62
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
62
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
63 63
 
64 64
 		$table_name = 'esp_attendee_meta';
65 65
 		$sql = "ATTM_ID INT(10) UNSIGNED NOT	NULL AUTO_INCREMENT,
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 					  CNT_is_EU TINYINT(1) DEFAULT '0',
100 100
 					  CNT_active TINYINT(1) DEFAULT '0',
101 101
 					  PRIMARY KEY  (CNT_ISO)";
102
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
102
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
103 103
 
104 104
 
105 105
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
 
124 124
 
125
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
125
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
126 126
 		$table_name = 'esp_event_meta';
127 127
 		$sql = "
128 128
 			EVTM_ID INT NOT NULL AUTO_INCREMENT,
@@ -139,41 +139,41 @@  discard block
 block discarded – undo
139 139
 			EVT_external_URL VARCHAR(200) NULL,
140 140
 			EVT_donations TINYINT(1) NULL,
141 141
 			PRIMARY KEY  (EVTM_ID)";
142
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
142
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
143 143
 
144 144
 
145 145
 
146
-		$table_name='esp_event_question_group';
147
-		$sql="EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
146
+		$table_name = 'esp_event_question_group';
147
+		$sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
148 148
 					EVT_ID BIGINT(20) UNSIGNED NOT NULL,
149 149
 					QSG_ID INT UNSIGNED NOT NULL,
150 150
 					EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
151 151
 					PRIMARY KEY  (EQG_ID)";
152
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
152
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
153 153
 
154 154
 
155 155
 
156
-		$table_name='esp_event_venue';
157
-		$sql="EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
156
+		$table_name = 'esp_event_venue';
157
+		$sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
158 158
 				EVT_ID BIGINT(20) UNSIGNED NOT NULL,
159 159
 				VNU_ID BIGINT(20) UNSIGNED NOT NULL,
160 160
 				EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
161 161
 				PRIMARY KEY  (EVV_ID)";
162
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
162
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
163 163
 
164 164
 
165 165
 
166
-		$table_name='esp_extra_meta';
167
-		$sql="EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
166
+		$table_name = 'esp_extra_meta';
167
+		$sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
168 168
 				OBJ_ID INT(11) DEFAULT NULL,
169 169
 				EXM_type VARCHAR(45) DEFAULT NULL,
170 170
 				EXM_key VARCHAR(45) DEFAULT NULL,
171 171
 				EXM_value TEXT,
172 172
 				PRIMARY KEY  (EXM_ID)";
173
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
173
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
174 174
 
175
-		$table_name='esp_line_item';
176
-		$sql="LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
175
+		$table_name = 'esp_line_item';
176
+		$sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
177 177
 				LIN_code VARCHAR(245) NOT NULL DEFAULT '',
178 178
 				TXN_ID INT(11) DEFAULT NULL,
179 179
 				LIN_name VARCHAR(245) NOT NULL DEFAULT '',
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 				OBJ_ID INT(11) DEFAULT NULL,
190 190
 				OBJ_type VARCHAR(45)DEFAULT NULL,
191 191
 				PRIMARY KEY  (LIN_ID)";
192
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB' );
192
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
193 193
 
194 194
 		$table_name = 'esp_message_template';
195 195
 		$sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 					PRIMARY KEY  (GRP_ID),
217 217
 					KEY EVT_ID (EVT_ID),
218 218
 					KEY MTP_user_id (MTP_user_id)";
219
-		$this->_table_should_exist_previously( $table_name, $sql, 'ENGINE=InnoDB');
219
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
220 220
 
221 221
 
222 222
 
@@ -324,8 +324,8 @@  discard block
 block discarded – undo
324 324
 
325 325
 
326 326
 
327
-		$table_name='esp_question';
328
-		$sql='QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
327
+		$table_name = 'esp_question';
328
+		$sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
329 329
 					QST_display_text TEXT NOT NULL,
330 330
 					QST_admin_label VARCHAR(255) NOT NULL,
331 331
 					QST_system VARCHAR(25) DEFAULT NULL,
@@ -337,12 +337,12 @@  discard block
 block discarded – undo
337 337
 					QST_wp_user BIGINT UNSIGNED NULL,
338 338
 					QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0,
339 339
 					PRIMARY KEY  (QST_ID)';
340
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
340
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
341 341
 
342
-		$this->_get_table_manager()->dropIndex( 'esp_question_group', 'QSG_identifier_UNIQUE' );
342
+		$this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE');
343 343
 
344 344
 		$table_name = 'esp_question_group';
345
-		$sql='QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
345
+		$sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
346 346
 					QSG_name VARCHAR(255) NOT NULL,
347 347
 					QSG_identifier VARCHAR(100) NOT NULL,
348 348
 					QSG_desc TEXT NULL,
@@ -353,28 +353,28 @@  discard block
 block discarded – undo
353 353
 					QSG_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
354 354
 					PRIMARY KEY  (QSG_ID),
355 355
 					UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)';
356
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
356
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
357 357
 
358 358
 
359 359
 
360
-		$table_name='esp_question_group_question';
361
-		$sql="QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
360
+		$table_name = 'esp_question_group_question';
361
+		$sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
362 362
 					QSG_ID INT UNSIGNED NOT NULL,
363 363
 					QST_ID INT UNSIGNED NOT NULL,
364 364
 					QGQ_order INT UNSIGNED NOT NULL DEFAULT 0,
365 365
 					PRIMARY KEY  (QGQ_ID) ";
366
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
366
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
367 367
 
368 368
 
369 369
 
370
-		$table_name='esp_question_option';
371
-		$sql="QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
370
+		$table_name = 'esp_question_option';
371
+		$sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
372 372
 					QSO_value VARCHAR(255) NOT NULL,
373 373
 					QSO_desc TEXT NOT NULL,
374 374
 					QST_ID INT UNSIGNED NOT NULL,
375 375
 					QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
376 376
 					PRIMARY KEY  (QSO_ID)";
377
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
377
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
378 378
 
379 379
 
380 380
 
@@ -407,8 +407,8 @@  discard block
 block discarded – undo
407 407
 
408 408
 
409 409
 
410
-		$table_name='esp_checkin';
411
-		$sql="CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
410
+		$table_name = 'esp_checkin';
411
+		$sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
412 412
 					REG_ID INT(10) UNSIGNED NOT NULL,
413 413
 					DTT_ID INT(10) UNSIGNED NOT NULL,
414 414
 					CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1,
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
483 483
 
484 484
 
485
-		$script_with_defaults = EE_Registry::instance()->load_dms( 'Core_4_1_0' );
485
+		$script_with_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
486 486
 		//setting up the DEFAULT stats and countries is also essential for the data migrations to run
487 487
 		//(because many need to convert old string states to foreign keys into the states table)
488 488
 		$script_with_defaults->insert_default_states();
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 		return true;
505 505
 	}
506 506
 
507
-	public function migration_page_hooks(){
507
+	public function migration_page_hooks() {
508 508
 
509 509
 	}
510 510
 }
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_8_0.dms.php 1 patch
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @author     Mike Nelson
17 17
  * @since      4.6.0
18 18
  */
19
-class EE_DMS_Core_4_8_0 extends EE_Data_Migration_Script_Base{
19
+class EE_DMS_Core_4_8_0 extends EE_Data_Migration_Script_Base {
20 20
 
21 21
 	/**
22 22
 	 * return EE_DMS_Core_4_8_0
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 * @param TableAnalysis $table_analysis
26 26
 	 * @throws \EE_Error
27 27
 	 */
28
-	public function __construct( TableManager $table_manager = null, TableAnalysis $table_analysis = null ) {
28
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) {
29 29
 		$this->_load_script_stages();
30 30
 		$this->_pretty_name = __("Data Migration to Event Espresso 4.8.0.P (for promotions)", "event_espresso");
31 31
 		$this->_priority = 10;
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 			new EE_DMS_4_8_0_pretax_totals(),
34 34
 			new EE_DMS_4_8_0_event_subtotals(),
35 35
 		);
36
-		parent::__construct( $table_manager, $table_analysis );
36
+		parent::__construct($table_manager, $table_analysis);
37 37
 	}
38 38
 
39 39
 
@@ -48,14 +48,14 @@  discard block
 block discarded – undo
48 48
 	 */
49 49
 	public function can_migrate_from_version($version_array) {
50 50
 		$version_string = $version_array['Core'];
51
-		if( $version_string <= '4.8.0' && $version_string >= '4.7.0' ){
51
+		if ($version_string <= '4.8.0' && $version_string >= '4.7.0') {
52 52
 //			echo "$version_string can be migrated from";
53 53
 			return true;
54
-		}elseif( ! $version_string ){
54
+		}elseif ( ! $version_string) {
55 55
 //			echo "no version string provided: $version_string";
56 56
 			//no version string provided... this must be pre 4.3
57
-			return false;//changed mind. dont want people thinking they should migrate yet because they cant
58
-		}else{
57
+			return false; //changed mind. dont want people thinking they should migrate yet because they cant
58
+		} else {
59 59
 //			echo "$version_string doesnt apply";
60 60
 			return false;
61 61
 		}
@@ -76,19 +76,19 @@  discard block
 block discarded – undo
76 76
 	 * @return bool
77 77
 	 */
78 78
 	public function schema_changes_before_migration() {
79
-		require_once( EE_HELPERS . 'EEH_Activation.helper.php' );
80
-		$now_in_mysql = current_time( 'mysql', true );
79
+		require_once(EE_HELPERS.'EEH_Activation.helper.php');
80
+		$now_in_mysql = current_time('mysql', true);
81 81
 
82
-		require_once( EE_HELPERS . 'EEH_Activation.helper.php' );
83
-		$table_name='esp_answer';
84
-		$sql=" ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
82
+		require_once(EE_HELPERS.'EEH_Activation.helper.php');
83
+		$table_name = 'esp_answer';
84
+		$sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
85 85
 					REG_ID int(10) unsigned NOT NULL,
86 86
 					QST_ID int(10) unsigned NOT NULL,
87 87
 					ANS_value text NOT NULL,
88 88
 					PRIMARY KEY  (ANS_ID),
89 89
 					KEY REG_ID (REG_ID),
90 90
 					KEY QST_ID (QST_ID)";
91
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
91
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
92 92
 
93 93
 		$table_name = 'esp_attendee_meta';
94 94
 		$sql = "ATTM_ID int(10) unsigned NOT	NULL AUTO_INCREMENT,
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 					  CNT_is_EU tinyint(1) DEFAULT '0',
129 129
 					  CNT_active tinyint(1) DEFAULT '0',
130 130
 					  PRIMARY KEY  (CNT_ISO)";
131
-		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' );
131
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
132 132
 
133 133
 		$table_name = 'esp_currency';
134 134
 		$sql = "CUR_code varchar(6) collate utf8_bin NOT NULL,
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 				CUR_dec_plc varchar(1) collate utf8_bin NOT NULL DEFAULT '2',
139 139
 				CUR_active tinyint(1) DEFAULT '0',
140 140
 				PRIMARY KEY  (CUR_code)";
141
-		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' );
141
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
142 142
 
143 143
 
144 144
 		$table_name = 'esp_currency_payment_method';
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 						KEY EVT_ID (EVT_ID),
169 169
 						KEY DTT_is_primary (DTT_is_primary)";
170 170
 
171
-		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' );
171
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
172 172
 
173 173
 		$table_name = 'esp_event_meta';
174 174
 		$sql = "
@@ -187,41 +187,41 @@  discard block
 block discarded – undo
187 187
 			EVT_donations tinyint(1) NULL,
188 188
 			PRIMARY KEY  (EVTM_ID),
189 189
 			KEY EVT_ID (EVT_ID)";
190
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
190
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
191 191
 
192 192
 
193 193
 
194
-		$table_name='esp_event_question_group';
195
-		$sql="EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
194
+		$table_name = 'esp_event_question_group';
195
+		$sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
196 196
 					EVT_ID bigint(20) unsigned NOT NULL,
197 197
 					QSG_ID int(10) unsigned NOT NULL,
198 198
 					EQG_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
199 199
 					PRIMARY KEY  (EQG_ID),
200 200
 					KEY EVT_ID (EVT_ID),
201 201
 					KEY QSG_ID (QSG_ID)";
202
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
202
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
203 203
 
204 204
 
205 205
 
206
-		$table_name='esp_event_venue';
207
-		$sql="EVV_ID int(11) NOT NULL AUTO_INCREMENT,
206
+		$table_name = 'esp_event_venue';
207
+		$sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT,
208 208
 				EVT_ID bigint(20) unsigned NOT NULL,
209 209
 				VNU_ID bigint(20) unsigned NOT NULL,
210 210
 				EVV_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
211 211
 				PRIMARY KEY  (EVV_ID)";
212
-		$this->_table_has_not_changed_since_previous($table_name,$sql, 'ENGINE=InnoDB');
212
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
213 213
 
214 214
 
215 215
 
216
-		$table_name='esp_extra_meta';
217
-		$sql="EXM_ID int(11) NOT NULL AUTO_INCREMENT,
216
+		$table_name = 'esp_extra_meta';
217
+		$sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT,
218 218
 				OBJ_ID int(11) DEFAULT NULL,
219 219
 				EXM_type varchar(45) DEFAULT NULL,
220 220
 				EXM_key varchar(45) DEFAULT NULL,
221 221
 				EXM_value text,
222 222
 				PRIMARY KEY  (EXM_ID),
223 223
 				KEY EXM_type (EXM_type,OBJ_ID,EXM_key)";
224
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
224
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
225 225
 
226 226
 		$table_name = 'esp_extra_join';
227 227
 		$sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT,
@@ -234,8 +234,8 @@  discard block
 block discarded – undo
234 234
 				KEY second_model (EXJ_second_model_name,EXJ_second_model_id)";
235 235
 		$this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB ');
236 236
 
237
-		$table_name='esp_line_item';
238
-		$sql="LIN_ID int(11) NOT NULL AUTO_INCREMENT,
237
+		$table_name = 'esp_line_item';
238
+		$sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT,
239 239
 				LIN_code varchar(245) NOT NULL DEFAULT '',
240 240
 				TXN_ID int(11) DEFAULT NULL,
241 241
 				LIN_name varchar(245) NOT NULL DEFAULT '',
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 				PRIMARY KEY  (LIN_ID),
255 255
 				KEY LIN_code (LIN_code(191)),
256 256
 				KEY TXN_ID (TXN_ID)";
257
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB' );
257
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
258 258
 
259 259
 		$table_name = 'esp_log';
260 260
 		$sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT,
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 					MTP_is_active tinyint(1) NOT NULL DEFAULT '1',
294 294
 					PRIMARY KEY  (GRP_ID),
295 295
 					KEY MTP_user_id (MTP_user_id)";
296
-		$this->_table_has_not_changed_since_previous( $table_name, $sql, 'ENGINE=InnoDB');
296
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
297 297
 
298 298
 		$table_name = 'esp_event_message_template';
299 299
 		$sql = "EMT_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 					PRIMARY KEY  (EMT_ID),
303 303
 					KEY EVT_ID (EVT_ID),
304 304
 					KEY GRP_ID (GRP_ID)";
305
-		$this->_table_has_not_changed_since_previous( $table_name, $sql, 'ENGINE=InnoDB');
305
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
306 306
 
307 307
 
308 308
 		$table_name = 'esp_payment';
@@ -375,8 +375,8 @@  discard block
 block discarded – undo
375 375
 					  PRIMARY KEY  (TTM_ID)";
376 376
 		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
377 377
 
378
-		$table_name='esp_question';
379
-		$sql='QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
378
+		$table_name = 'esp_question';
379
+		$sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
380 380
 					QST_display_text text NOT NULL,
381 381
 					QST_admin_label varchar(255) NOT NULL,
382 382
 					QST_system varchar(25) NOT NULL DEFAULT "",
@@ -390,22 +390,22 @@  discard block
 block discarded – undo
390 390
 					QST_deleted tinyint(2) unsigned NOT NULL DEFAULT 0,
391 391
 					PRIMARY KEY  (QST_ID),
392 392
 					KEY QST_order (QST_order)';
393
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
393
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
394 394
 
395
-		$table_name='esp_question_group_question';
396
-		$sql="QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
395
+		$table_name = 'esp_question_group_question';
396
+		$sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
397 397
 					QSG_ID int(10) unsigned NOT NULL,
398 398
 					QST_ID int(10) unsigned NOT NULL,
399 399
 					QGQ_order int(10) unsigned NOT NULL DEFAULT 0,
400 400
 					PRIMARY KEY  (QGQ_ID),
401 401
 					KEY QST_ID (QST_ID),
402 402
 					KEY QSG_ID_order (QSG_ID,QGQ_order)";
403
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
403
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
404 404
 
405 405
 
406 406
 
407
-		$table_name='esp_question_option';
408
-		$sql="QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
407
+		$table_name = 'esp_question_option';
408
+		$sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
409 409
 					QSO_value varchar(255) NOT NULL,
410 410
 					QSO_desc text NOT NULL,
411 411
 					QST_ID int(10) unsigned NOT NULL,
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 					PRIMARY KEY  (QSO_ID),
416 416
 					KEY QST_ID (QST_ID),
417 417
 					KEY QSO_order (QSO_order)";
418
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
418
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
419 419
 
420 420
 
421 421
 
@@ -461,8 +461,8 @@  discard block
 block discarded – undo
461 461
 
462 462
 
463 463
 
464
-		$table_name='esp_checkin';
465
-		$sql="CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
464
+		$table_name = 'esp_checkin';
465
+		$sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
466 466
 					REG_ID int(10) unsigned NOT NULL,
467 467
 					DTT_ID int(10) unsigned NOT NULL,
468 468
 					CHK_in tinyint(1) unsigned NOT NULL DEFAULT 1,
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 					  PRC_parent int(10) unsigned DEFAULT 0,
558 558
 					  PRIMARY KEY  (PRC_ID),
559 559
 					  KEY PRT_ID (PRT_ID)";
560
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
560
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
561 561
 
562 562
 		$table_name = "esp_price_type";
563 563
 		$sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
@@ -595,10 +595,10 @@  discard block
 block discarded – undo
595 595
 					  TKT_deleted tinyint(1) NOT NULL DEFAULT '0',
596 596
 					  PRIMARY KEY  (TKT_ID),
597 597
 					  KEY TKT_start_date (TKT_start_date)";
598
-		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' );
598
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
599 599
 
600 600
 		$table_name = 'esp_question_group';
601
-		$sql='QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
601
+		$sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
602 602
 					QSG_name varchar(255) NOT NULL,
603 603
 					QSG_identifier varchar(100) NOT NULL,
604 604
 					QSG_desc text NULL,
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
 					PRIMARY KEY  (QSG_ID),
612 612
 					UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier),
613 613
 					KEY QSG_order (QSG_order)';
614
-		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB' );
614
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
615 615
 
616 616
 		/** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */
617 617
 		$script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
 		return $script_4_7_defaults->schema_changes_after_migration();
648 648
 	}
649 649
 
650
-	public function migration_page_hooks(){
650
+	public function migration_page_hooks() {
651 651
 
652 652
 	}
653 653
 
@@ -661,19 +661,19 @@  discard block
 block discarded – undo
661 661
 		//CNT_ISO, CNT_ISO3, RGN_ID, CNT_name, CNT_cur_code, CNT_cur_single, CNT_cur_plural, CNT_cur_sign, CNT_cur_sign_b4, CNT_cur_dec_plc, CNT_tel_code, CNT_is_EU, CNT_active
662 662
 		//('AD', 'AND', 0, 'Andorra', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+376', 0, 0),
663 663
 		$newer_countries = array(
664
-			array( 'AX', 'ALA', 0, 'Alan Islands', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+358', 1, 0 ),
665
-			array( 'BL', 'BLM', 0, 'Saint Barthelemy', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0 ),
666
-			array( 'CW', 'CUW', 0, 'Curacao', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+599', 1, 0 ),
667
-			array( 'GG', 'GGY', 0, 'Guernsey', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+44', 0, 0 ),
668
-			array( 'IM', 'IMN', 0, 'Isle of Man', 'GBP', 'Pound', 'Pounds', '£', 1, 2,  '+44', 0, 0  ),
669
-			array( 'JE', 'JEY', 0, 'Jersey', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0 ),
670
-			array( 'MF', 'MAF', 0, 'Saint Martin', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0 ),
671
-			array( 'ME', 'MNE', 0, 'Montenegro', 'EUR', 'Euro', 'Euros', '€', 1,  2, '+382', 0, 0 ),
672
-			array( 'RS', 'SRB', 0, 'Serbia', 'RSD', 'Dinar', 'Dinars', '', 0, 2, '+941', 1, 0 ),
673
-			array( 'SS', 'SSD', 0, 'South Sudan', 'SSP', 'Pound', 'Pounds', '£', 1, 2, '+211', 0, 0 ),
674
-			array( 'SX', 'SXM', 0, 'Sint Maarten', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+1', 1, 0 ),
675
-			array( 'XK', 'XKX', 0, 'Kosovo', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+381', 0, 0 ),
676
-			array( 'YT', 'MYT', 0, 'Mayotte', 'EUR', 'Euro', 'Euros', '€', 0, 2, '+262', 1, 0 ),
664
+			array('AX', 'ALA', 0, 'Alan Islands', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+358', 1, 0),
665
+			array('BL', 'BLM', 0, 'Saint Barthelemy', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0),
666
+			array('CW', 'CUW', 0, 'Curacao', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+599', 1, 0),
667
+			array('GG', 'GGY', 0, 'Guernsey', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+44', 0, 0),
668
+			array('IM', 'IMN', 0, 'Isle of Man', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0),
669
+			array('JE', 'JEY', 0, 'Jersey', 'GBP', 'Pound', 'Pounds', '£', 1, 2, '+44', 0, 0),
670
+			array('MF', 'MAF', 0, 'Saint Martin', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+590', 1, 0),
671
+			array('ME', 'MNE', 0, 'Montenegro', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+382', 0, 0),
672
+			array('RS', 'SRB', 0, 'Serbia', 'RSD', 'Dinar', 'Dinars', '', 0, 2, '+941', 1, 0),
673
+			array('SS', 'SSD', 0, 'South Sudan', 'SSP', 'Pound', 'Pounds', '£', 1, 2, '+211', 0, 0),
674
+			array('SX', 'SXM', 0, 'Sint Maarten', 'ANG', 'Guilder', 'Guilders', 'ƒ', 1, 2, '+1', 1, 0),
675
+			array('XK', 'XKX', 0, 'Kosovo', 'EUR', 'Euro', 'Euros', '€', 1, 2, '+381', 0, 0),
676
+			array('YT', 'MYT', 0, 'Mayotte', 'EUR', 'Euro', 'Euros', '€', 0, 2, '+262', 1, 0),
677 677
 		);
678 678
 		global $wpdb;
679 679
 		$country_table = $wpdb->prefix."esp_country";
@@ -692,14 +692,14 @@  discard block
 block discarded – undo
692 692
 							"CNT_is_EU" => '%d',
693 693
 							"CNT_active" => '%d',
694 694
 						);
695
-		if ( $this->_get_table_analysis()->tableExists( $country_table ) ) {
696
-			foreach( $newer_countries as $country ) {
697
-				$SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1" ;
695
+		if ($this->_get_table_analysis()->tableExists($country_table)) {
696
+			foreach ($newer_countries as $country) {
697
+				$SQL = "SELECT COUNT('CNT_ISO') FROM {$country_table} WHERE CNT_ISO='{$country[0]}' LIMIT 1";
698 698
 				$countries = $wpdb->get_var($SQL);
699
-				if ( ! $countries ) {
699
+				if ( ! $countries) {
700 700
 
701
-					$wpdb->insert( $country_table,
702
-							array_combine( array_keys( $country_format), $country ),
701
+					$wpdb->insert($country_table,
702
+							array_combine(array_keys($country_format), $country),
703 703
 							$country_format
704 704
 							);
705 705
 				}
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 		// CUR_code, CUR_single, CUR_plural, CUR_sign, CUR_dec_plc, CUR_active
718 718
 		//( 'EUR',  'Euro',  'Euros',  '€',  2,1),
719 719
 		$newer_currencies = array(
720
-			array( 'RSD', 'Dinar', 'Dinars', '', 3, 1 ),
720
+			array('RSD', 'Dinar', 'Dinars', '', 3, 1),
721 721
 		);
722 722
 		global $wpdb;
723 723
 		$currency_table = $wpdb->prefix."esp_currency";
@@ -729,14 +729,14 @@  discard block
 block discarded – undo
729 729
 							"CUR_dec_plc" => '%d',
730 730
 							"CUR_active" => '%d',
731 731
 						);
732
-		if ( $this->_get_table_analysis()->tableExists( $currency_table ) ) {
733
-			foreach( $newer_currencies as $currency ) {
734
-				$SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1" ;
732
+		if ($this->_get_table_analysis()->tableExists($currency_table)) {
733
+			foreach ($newer_currencies as $currency) {
734
+				$SQL = "SELECT COUNT('CUR_code') FROM {$currency_table} WHERE CUR_code='{$currency[0]}' LIMIT 1";
735 735
 				$countries = $wpdb->get_var($SQL);
736
-				if ( ! $countries ) {
736
+				if ( ! $countries) {
737 737
 
738
-					$wpdb->insert( $currency_table,
739
-							array_combine( array_keys( $currency_format), $currency ),
738
+					$wpdb->insert($currency_table,
739
+							array_combine(array_keys($currency_format), $currency),
740 740
 							$currency_format
741 741
 							);
742 742
 				}
@@ -748,9 +748,9 @@  discard block
 block discarded – undo
748 748
 	 * which should just be a temporary issue for folks who installed 4.8.0-4.8.5;
749 749
 	 * we should be able to stop doing this in 4.9
750 750
 	 */
751
-	public function fix_non_default_taxes(){
751
+	public function fix_non_default_taxes() {
752 752
 		global $wpdb;
753
-		$query = $wpdb->prepare( "UPDATE
753
+		$query = $wpdb->prepare("UPDATE
754 754
 				{$wpdb->prefix}esp_price p INNER JOIN
755 755
 				{$wpdb->prefix}esp_price_type pt ON p.PRT_ID = pt.PRT_ID
756 756
 			SET
@@ -758,7 +758,7 @@  discard block
 block discarded – undo
758 758
 			WHERE
759 759
 				p.PRC_is_default = 0 AND
760 760
 				pt.PBT_ID = %d
761
-					", EEM_Price_Type::base_type_tax );
762
-		$wpdb->query( $query );
761
+					", EEM_Price_Type::base_type_tax);
762
+		$wpdb->query($query);
763 763
 	}
764 764
 }
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_5_0.dms.php 1 patch
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * -adds DTT_name and DTT_description to the datetime table;
10 10
  * -adds users onto prices, price types, question groups, and tickets
11 11
  */
12
-class EE_DMS_Core_4_5_0 extends EE_Data_Migration_Script_Base{
12
+class EE_DMS_Core_4_5_0 extends EE_Data_Migration_Script_Base {
13 13
 
14 14
 
15 15
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	 * @param TableAnalysis $table_analysis
21 21
 	 * @throws \EE_Error
22 22
 	 */
23
-	public function __construct( TableManager $table_manager = null, TableAnalysis $table_analysis = null ) {
23
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) {
24 24
 		$this->_load_script_stages();
25 25
 		$this->_pretty_name = __("Data Migration to Event Espresso 4.5.0.P", "event_espresso");
26 26
 		$this->_priority = 10;
@@ -31,21 +31,21 @@  discard block
 block discarded – undo
31 31
 			new EE_DMS_4_5_0_update_wp_user_for_question_groups(),
32 32
 			new EE_DMS_4_5_0_invoice_settings(),
33 33
 			);
34
-		parent::__construct( $table_manager, $table_analysis );
34
+		parent::__construct($table_manager, $table_analysis);
35 35
 	}
36 36
 
37 37
 
38 38
 
39 39
 	public function can_migrate_from_version($version_array) {
40 40
 		$version_string = $version_array['Core'];
41
-		if($version_string <= '4.5.0' && $version_string >= '4.3.0' ){
41
+		if ($version_string <= '4.5.0' && $version_string >= '4.3.0') {
42 42
 //			echo "$version_string can be migrated from";
43 43
 			return true;
44
-		}elseif( ! $version_string ){
44
+		}elseif ( ! $version_string) {
45 45
 //			echo "no version string provided: $version_string";
46 46
 			//no version string provided... this must be pre 4.3
47
-			return false;//changed mind. dont want people thinking they should migrate yet because they cant
48
-		}else{
47
+			return false; //changed mind. dont want people thinking they should migrate yet because they cant
48
+		} else {
49 49
 //			echo "$version_string doesnt apply";
50 50
 			return false;
51 51
 		}
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
55 55
 	}
56 56
 	public function schema_changes_before_migration() {
57 57
 		//relies on 4.1's EEH_Activation::create_table
58
-		require_once( EE_HELPERS . 'EEH_Activation.helper.php' );
59
-		$table_name='esp_answer';
60
-		$sql=" ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
58
+		require_once(EE_HELPERS.'EEH_Activation.helper.php');
59
+		$table_name = 'esp_answer';
60
+		$sql = " ANS_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
61 61
 					REG_ID INT UNSIGNED NOT NULL,
62 62
 					QST_ID INT UNSIGNED NOT NULL,
63 63
 					ANS_value TEXT NOT NULL,
64 64
 					PRIMARY KEY  (ANS_ID)";
65
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
65
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
66 66
 
67 67
 		$table_name = 'esp_attendee_meta';
68 68
 		$sql = "ATTM_ID INT(10) UNSIGNED NOT	NULL AUTO_INCREMENT,
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 					  CNT_is_EU TINYINT(1) DEFAULT '0',
102 102
 					  CNT_active TINYINT(1) DEFAULT '0',
103 103
 					  PRIMARY KEY  (CNT_ISO)";
104
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
104
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
105 105
 
106 106
 		$table_name = 'esp_datetime';
107 107
 		$sql = "DTT_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
 
124 124
 
125
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
125
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
126 126
 		$table_name = 'esp_event_meta';
127 127
 		$sql = "
128 128
 			EVTM_ID INT NOT NULL AUTO_INCREMENT,
@@ -139,41 +139,41 @@  discard block
 block discarded – undo
139 139
 			EVT_external_URL VARCHAR(200) NULL,
140 140
 			EVT_donations TINYINT(1) NULL,
141 141
 			PRIMARY KEY  (EVTM_ID)";
142
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
142
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
143 143
 
144 144
 
145 145
 
146
-		$table_name='esp_event_question_group';
147
-		$sql="EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
146
+		$table_name = 'esp_event_question_group';
147
+		$sql = "EQG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
148 148
 					EVT_ID BIGINT(20) UNSIGNED NOT NULL,
149 149
 					QSG_ID INT UNSIGNED NOT NULL,
150 150
 					EQG_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
151 151
 					PRIMARY KEY  (EQG_ID)";
152
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
152
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
153 153
 
154 154
 
155 155
 
156
-		$table_name='esp_event_venue';
157
-		$sql="EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
156
+		$table_name = 'esp_event_venue';
157
+		$sql = "EVV_ID INT(11) NOT NULL AUTO_INCREMENT,
158 158
 				EVT_ID BIGINT(20) UNSIGNED NOT NULL,
159 159
 				VNU_ID BIGINT(20) UNSIGNED NOT NULL,
160 160
 				EVV_primary TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
161 161
 				PRIMARY KEY  (EVV_ID)";
162
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
162
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
163 163
 
164 164
 
165 165
 
166
-		$table_name='esp_extra_meta';
167
-		$sql="EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
166
+		$table_name = 'esp_extra_meta';
167
+		$sql = "EXM_ID INT(11) NOT NULL AUTO_INCREMENT,
168 168
 				OBJ_ID INT(11) DEFAULT NULL,
169 169
 				EXM_type VARCHAR(45) DEFAULT NULL,
170 170
 				EXM_key VARCHAR(45) DEFAULT NULL,
171 171
 				EXM_value TEXT,
172 172
 				PRIMARY KEY  (EXM_ID)";
173
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
173
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
174 174
 
175
-		$table_name='esp_line_item';
176
-		$sql="LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
175
+		$table_name = 'esp_line_item';
176
+		$sql = "LIN_ID INT(11) NOT NULL AUTO_INCREMENT,
177 177
 				LIN_code VARCHAR(245) NOT NULL DEFAULT '',
178 178
 				TXN_ID INT(11) DEFAULT NULL,
179 179
 				LIN_name VARCHAR(245) NOT NULL DEFAULT '',
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 				OBJ_ID INT(11) DEFAULT NULL,
190 190
 				OBJ_type VARCHAR(45)DEFAULT NULL,
191 191
 				PRIMARY KEY  (LIN_ID)";
192
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB' );
192
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
193 193
 
194 194
 		$table_name = 'esp_message_template';
195 195
 		$sql = "MTP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 					KEY GRP_ID (GRP_ID)";
202 202
 		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
203 203
 
204
-		$this->_get_table_manager()->dropIndex( 'esp_message_template_group', 'EVT_ID' );
204
+		$this->_get_table_manager()->dropIndex('esp_message_template_group', 'EVT_ID');
205 205
 
206 206
 		$table_name = 'esp_message_template_group';
207 207
 		$sql = "GRP_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 					MTP_is_active TINYINT(1) NOT NULL DEFAULT '1',
217 217
 					PRIMARY KEY  (GRP_ID),
218 218
 					KEY MTP_user_id (MTP_user_id)";
219
-		$this->_table_should_exist_previously( $table_name, $sql, 'ENGINE=InnoDB');
219
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
220 220
 
221 221
 		$table_name = 'esp_event_message_template';
222 222
 		$sql = "EMT_ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 					PRIMARY KEY  (EMT_ID),
226 226
 					KEY EVT_ID (EVT_ID),
227 227
 					KEY GRP_ID (GRP_ID)";
228
-		$this->_table_should_exist_previously( $table_name, $sql, 'ENGINE=InnoDB');
228
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
229 229
 
230 230
 
231 231
 		$table_name = 'esp_payment';
@@ -275,8 +275,8 @@  discard block
 block discarded – undo
275 275
 					  PRIMARY KEY  (TTM_ID)";
276 276
 		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
277 277
 
278
-		$table_name='esp_question';
279
-		$sql='QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
278
+		$table_name = 'esp_question';
279
+		$sql = 'QST_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
280 280
 					QST_display_text TEXT NOT NULL,
281 281
 					QST_admin_label VARCHAR(255) NOT NULL,
282 282
 					QST_system VARCHAR(25) DEFAULT NULL,
@@ -288,27 +288,27 @@  discard block
 block discarded – undo
288 288
 					QST_wp_user BIGINT UNSIGNED NULL,
289 289
 					QST_deleted TINYINT UNSIGNED NOT NULL DEFAULT 0,
290 290
 					PRIMARY KEY  (QST_ID)';
291
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
291
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
292 292
 
293
-		$table_name='esp_question_group_question';
294
-		$sql="QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
293
+		$table_name = 'esp_question_group_question';
294
+		$sql = "QGQ_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
295 295
 					QSG_ID INT UNSIGNED NOT NULL,
296 296
 					QST_ID INT UNSIGNED NOT NULL,
297 297
 					QGQ_order INT UNSIGNED NOT NULL DEFAULT 0,
298 298
 					PRIMARY KEY  (QGQ_ID) ";
299
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
299
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
300 300
 
301 301
 
302 302
 
303
-		$table_name='esp_question_option';
304
-		$sql="QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
303
+		$table_name = 'esp_question_option';
304
+		$sql = "QSO_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
305 305
 					QSO_value VARCHAR(255) NOT NULL,
306 306
 					QSO_desc TEXT NOT NULL,
307 307
 					QST_ID INT UNSIGNED NOT NULL,
308 308
 					QSO_order INT UNSIGNED NOT NULL DEFAULT 0,
309 309
 					QSO_deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
310 310
 					PRIMARY KEY  (QSO_ID)";
311
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
311
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
312 312
 
313 313
 
314 314
 
@@ -341,8 +341,8 @@  discard block
 block discarded – undo
341 341
 
342 342
 
343 343
 
344
-		$table_name='esp_checkin';
345
-		$sql="CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
344
+		$table_name = 'esp_checkin';
345
+		$sql = "CHK_ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
346 346
 					REG_ID INT(10) UNSIGNED NOT NULL,
347 347
 					DTT_ID INT(10) UNSIGNED NOT NULL,
348 348
 					CHK_in TINYINT(1) UNSIGNED NOT NULL DEFAULT 1,
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 					  PRC_wp_user BIGINT UNSIGNED NULL,
431 431
 					  PRC_parent INT(10) UNSIGNED DEFAULT 0,
432 432
 					  PRIMARY KEY  (PRC_ID)";
433
-		$this->_table_should_exist_previously($table_name,$sql, 'ENGINE=InnoDB');
433
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
434 434
 
435 435
 		$table_name = "esp_price_type";
436 436
 		$sql = "PRT_ID TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -467,12 +467,12 @@  discard block
 block discarded – undo
467 467
 					  TKT_parent INT(10) UNSIGNED DEFAULT '0',
468 468
 					  TKT_deleted TINYINT(1) NOT NULL DEFAULT '0',
469 469
 					  PRIMARY KEY  (TKT_ID)";
470
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
470
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
471 471
 
472
-		$this->_get_table_manager()->dropIndex( 'esp_question_group', 'QSG_identifier_UNIQUE' );
472
+		$this->_get_table_manager()->dropIndex('esp_question_group', 'QSG_identifier_UNIQUE');
473 473
 
474 474
 		$table_name = 'esp_question_group';
475
-		$sql='QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
475
+		$sql = 'QSG_ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
476 476
 					QSG_name VARCHAR(255) NOT NULL,
477 477
 					QSG_identifier VARCHAR(100) NOT NULL,
478 478
 					QSG_desc TEXT NULL,
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 					QSG_wp_user BIGINT UNSIGNED NULL,
485 485
 					PRIMARY KEY  (QSG_ID),
486 486
 					UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier ASC)';
487
-		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB' );
487
+		$this->_table_should_exist_previously($table_name, $sql, 'ENGINE=InnoDB');
488 488
 
489 489
 		$script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
490 490
 
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 		return true;
509 509
 	}
510 510
 
511
-	public function migration_page_hooks(){
511
+	public function migration_page_hooks() {
512 512
 
513 513
 	}
514 514
 
@@ -522,21 +522,21 @@  discard block
 block discarded – undo
522 522
 		global $wpdb;
523 523
 		$price_type_table = $wpdb->prefix."esp_price_type";
524 524
 
525
-		if ( $this->_get_table_analysis()->tableExists( $price_type_table ) ) {
525
+		if ($this->_get_table_analysis()->tableExists($price_type_table)) {
526 526
 
527
-			$SQL = 'SELECT COUNT(PRT_ID) FROM ' . $price_type_table;
528
-			$price_types_exist = $wpdb->get_var( $SQL );
527
+			$SQL = 'SELECT COUNT(PRT_ID) FROM '.$price_type_table;
528
+			$price_types_exist = $wpdb->get_var($SQL);
529 529
 
530
-			if ( ! $price_types_exist ) {
530
+			if ( ! $price_types_exist) {
531 531
 				$user_id = EEH_Activation::get_default_creator_id();
532 532
 				$SQL = "INSERT INTO $price_type_table ( PRT_ID, PRT_name, PBT_ID, PRT_is_percent, PRT_order, PRT_wp_user, PRT_deleted ) VALUES
533
-							(1, '" . __('Base Price', 'event_espresso') . "', 1,  0, 0, $user_id, 0),
534
-							(2, '" . __('Percent Discount', 'event_espresso') . "', 2,  1, 20, $user_id, 0),
535
-							(3, '" . __('Dollar Discount', 'event_espresso') . "', 2,  0, 30, $user_id, 0),
536
-							(4, '" . __('Percent Surcharge', 'event_espresso') . "', 3,  1, 40, $user_id,  0),
537
-							(5, '" . __('Dollar Surcharge', 'event_espresso') . "', 3,  0, 50, $user_id, 0);";
538
-				$SQL = apply_filters( 'FHEE__EE_DMS_4_5_0__insert_default_price_types__SQL', $SQL );
539
-				$wpdb->query( $SQL );
533
+							(1, '".__('Base Price', 'event_espresso')."', 1,  0, 0, $user_id, 0),
534
+							(2, '".__('Percent Discount', 'event_espresso')."', 2,  1, 20, $user_id, 0),
535
+							(3, '".__('Dollar Discount', 'event_espresso')."', 2,  0, 30, $user_id, 0),
536
+							(4, '".__('Percent Surcharge', 'event_espresso')."', 3,  1, 40, $user_id,  0),
537
+							(5, '".__('Dollar Surcharge', 'event_espresso')."', 3,  0, 50, $user_id, 0);";
538
+				$SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_price_types__SQL', $SQL);
539
+				$wpdb->query($SQL);
540 540
 			}
541 541
 		}
542 542
 	}
@@ -556,17 +556,17 @@  discard block
 block discarded – undo
556 556
 		global $wpdb;
557 557
 		$price_table = $wpdb->prefix."esp_price";
558 558
 
559
-		if ( $this->_get_table_analysis()->tableExists( $price_table ) ) {
559
+		if ($this->_get_table_analysis()->tableExists($price_table)) {
560 560
 
561
-			$SQL = 'SELECT COUNT(PRC_ID) FROM ' .$price_table;
562
-			$prices_exist = $wpdb->get_var( $SQL );
561
+			$SQL = 'SELECT COUNT(PRC_ID) FROM '.$price_table;
562
+			$prices_exist = $wpdb->get_var($SQL);
563 563
 
564
-			if ( ! $prices_exist ) {
564
+			if ( ! $prices_exist) {
565 565
 				$user_id = EEH_Activation::get_default_creator_id();
566 566
 				$SQL = "INSERT INTO $price_table
567 567
 							(PRC_ID, PRT_ID, PRC_amount, PRC_name, PRC_desc,  PRC_is_default, PRC_overrides, PRC_wp_user, PRC_order, PRC_deleted, PRC_parent ) VALUES
568 568
 							(1, 1, '0.00', 'Free Admission', '', 1, NULL, $user_id, 0, 0, 0);";
569
-				$SQL = apply_filters( 'FHEE__EE_DMS_4_5_0__insert_default_prices__SQL', $SQL );
569
+				$SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_prices__SQL', $SQL);
570 570
 				$wpdb->query($SQL);
571 571
 			}
572 572
 		}
@@ -584,35 +584,35 @@  discard block
 block discarded – undo
584 584
 
585 585
 		global $wpdb;
586 586
 		$ticket_table = $wpdb->prefix."esp_ticket";
587
-		if ( $this->_get_table_analysis()->tableExists( $ticket_table ) ) {
587
+		if ($this->_get_table_analysis()->tableExists($ticket_table)) {
588 588
 
589
-			$SQL = 'SELECT COUNT(TKT_ID) FROM ' . $ticket_table;
589
+			$SQL = 'SELECT COUNT(TKT_ID) FROM '.$ticket_table;
590 590
 			$tickets_exist = $wpdb->get_var($SQL);
591 591
 
592
-			if ( ! $tickets_exist ) {
592
+			if ( ! $tickets_exist) {
593 593
 				$user_id = EEH_Activation::get_default_creator_id();
594 594
 				$SQL = "INSERT INTO $ticket_table
595 595
 					( TKT_ID, TTM_ID, TKT_name, TKT_description, TKT_qty, TKT_sold, TKT_uses, TKT_required, TKT_min, TKT_max, TKT_price, TKT_start_date, TKT_end_date, TKT_taxable, TKT_order, TKT_row, TKT_is_default, TKT_parent, TKT_wp_user, TKT_deleted ) VALUES
596
-					( 1, 0, '" . __("Free Ticket", "event_espresso") . "', '', 100, 0, -1, 0, 0, -1, 0.00, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, 0, 1, 1, 0, $user_id, 0);";
597
-				$SQL = apply_filters( 'FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL', $SQL );
596
+					( 1, 0, '".__("Free Ticket", "event_espresso")."', '', 100, 0, -1, 0, 0, -1, 0.00, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, 0, 1, 1, 0, $user_id, 0);";
597
+				$SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL', $SQL);
598 598
 				$wpdb->query($SQL);
599 599
 			}
600 600
 		}
601 601
 		$ticket_price_table = $wpdb->prefix."esp_ticket_price";
602 602
 
603
-		if ( $this->_get_table_analysis()->tableExists( $ticket_price_table ) ) {
603
+		if ($this->_get_table_analysis()->tableExists($ticket_price_table)) {
604 604
 
605
-			$SQL = 'SELECT COUNT(TKP_ID) FROM ' . $ticket_price_table;
605
+			$SQL = 'SELECT COUNT(TKP_ID) FROM '.$ticket_price_table;
606 606
 			$ticket_prc_exist = $wpdb->get_var($SQL);
607 607
 
608
-			if ( ! $ticket_prc_exist ) {
608
+			if ( ! $ticket_prc_exist) {
609 609
 
610 610
 				$SQL = "INSERT INTO $ticket_price_table
611 611
 				( TKP_ID, TKT_ID, PRC_ID ) VALUES
612 612
 				( 1, 1, 1 )
613 613
 				";
614 614
 
615
-				$SQL = apply_filters( 'FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL__ticket_price', $SQL );
615
+				$SQL = apply_filters('FHEE__EE_DMS_4_5_0__insert_default_tickets__SQL__ticket_price', $SQL);
616 616
 				$wpdb->query($SQL);
617 617
 			}
618 618
 		}
Please login to merge, or discard this patch.
core/data_migration_scripts/EE_DMS_Core_4_9_0.dms.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * @author        Mike Nelson
12 12
  * @since         4.6.0
13 13
  */
14
-class EE_DMS_Core_4_9_0 extends EE_Data_Migration_Script_Base{
14
+class EE_DMS_Core_4_9_0 extends EE_Data_Migration_Script_Base {
15 15
 
16 16
 	/**
17 17
 	 * return EE_DMS_Core_4_9_0
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	 * @param TableAnalysis $table_analysis
21 21
 	 * @throws \EE_Error
22 22
 	 */
23
-	public function __construct( TableManager $table_manager = null, TableAnalysis $table_analysis = null ) {
23
+	public function __construct(TableManager $table_manager = null, TableAnalysis $table_analysis = null) {
24 24
 		$this->_load_script_stages();
25 25
 		$this->_pretty_name = __("Data Migration to Event Espresso 4.9.0.P", "event_espresso");
26 26
 		$this->_priority = 10;
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 			new EE_DMS_4_9_0_Email_System_Question(),
29 29
 			new EE_DMS_4_9_0_Answers_With_No_Registration(),
30 30
 		);
31
-		parent::__construct( $table_manager, $table_analysis );
31
+		parent::__construct($table_manager, $table_analysis);
32 32
 	}
33 33
 
34 34
 
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public function can_migrate_from_version($version_array) {
42 42
 		$version_string = $version_array['Core'];
43
-		if( $version_string <= '4.9.0' && $version_string >= '4.8.0' ){
43
+		if ($version_string <= '4.9.0' && $version_string >= '4.8.0') {
44 44
 //			echo "$version_string can be migrated from";
45 45
 			return true;
46
-		} elseif( ! $version_string ){
46
+		} elseif ( ! $version_string) {
47 47
 //			echo "no version string provided: $version_string";
48 48
 			//no version string provided... this must be pre 4.3
49
-			return false;//changed mind. dont want people thinking they should migrate yet because they cant
50
-		}else{
49
+			return false; //changed mind. dont want people thinking they should migrate yet because they cant
50
+		} else {
51 51
 //			echo "$version_string doesnt apply";
52 52
 			return false;
53 53
 		}
@@ -68,18 +68,18 @@  discard block
 block discarded – undo
68 68
 	 * @return bool
69 69
 	 */
70 70
 	public function schema_changes_before_migration() {
71
-		require_once( EE_HELPERS . 'EEH_Activation.helper.php' );
72
-		$now_in_mysql = current_time( 'mysql', true );
71
+		require_once(EE_HELPERS.'EEH_Activation.helper.php');
72
+		$now_in_mysql = current_time('mysql', true);
73 73
 
74
-		$table_name='esp_answer';
75
-		$sql=" ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
74
+		$table_name = 'esp_answer';
75
+		$sql = " ANS_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
76 76
 					REG_ID int(10) unsigned NOT NULL,
77 77
 					QST_ID int(10) unsigned NOT NULL,
78 78
 					ANS_value text NOT NULL,
79 79
 					PRIMARY KEY  (ANS_ID),
80 80
 					KEY REG_ID (REG_ID),
81 81
 					KEY QST_ID (QST_ID)";
82
-		$this->_table_has_not_changed_since_previous($table_name,$sql, 'ENGINE=InnoDB');
82
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
83 83
 
84 84
 		$table_name = 'esp_attendee_meta';
85 85
 		$sql = "ATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 				KEY ATT_fname (ATT_fname)";
102 102
 		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
103 103
 
104
-		$table_name='esp_checkin';
104
+		$table_name = 'esp_checkin';
105 105
 		$sql = "CHK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
106 106
 				REG_ID int(10) unsigned NOT NULL,
107 107
 				DTT_ID int(10) unsigned NOT NULL,
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 				CNT_is_EU tinyint(1) DEFAULT '0',
130 130
 				CNT_active tinyint(1) DEFAULT '0',
131 131
 				PRIMARY KEY  (CNT_ISO)";
132
-		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' );
132
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
133 133
 
134 134
 		$table_name = 'esp_currency';
135 135
 		$sql = "CUR_code varchar(6) collate utf8_bin NOT NULL,
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 				CUR_dec_plc varchar(1) collate utf8_bin NOT NULL DEFAULT '2',
140 140
 				CUR_active tinyint(1) DEFAULT '0',
141 141
 				PRIMARY KEY  (CUR_code)";
142
-		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' );
142
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
143 143
 
144 144
 
145 145
 		$table_name = 'esp_currency_payment_method';
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 				KEY DTT_EVT_start (DTT_EVT_start),
168 168
 				KEY EVT_ID (EVT_ID),
169 169
 				KEY DTT_is_primary (DTT_is_primary)";
170
-		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' );
170
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
171 171
 
172 172
 		$table_name = "esp_datetime_ticket";
173 173
 		$sql = "DTK_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 				PRIMARY KEY  (EMT_ID),
186 186
 				KEY EVT_ID (EVT_ID),
187 187
 				KEY GRP_ID (GRP_ID)";
188
-		$this->_table_has_not_changed_since_previous( $table_name, $sql, 'ENGINE=InnoDB');
188
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
189 189
 
190 190
 		$table_name = 'esp_event_meta';
191 191
 		$sql = "EVTM_ID int(10) NOT NULL AUTO_INCREMENT,
@@ -203,9 +203,9 @@  discard block
 block discarded – undo
203 203
 				EVT_donations tinyint(1) NULL,
204 204
 				PRIMARY KEY  (EVTM_ID),
205 205
 				KEY EVT_ID (EVT_ID)";
206
-		$this->_table_has_not_changed_since_previous($table_name,$sql, 'ENGINE=InnoDB');
206
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
207 207
 
208
-		$table_name='esp_event_question_group';
208
+		$table_name = 'esp_event_question_group';
209 209
 		$sql = "EQG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
210 210
 				EVT_ID bigint(20) unsigned NOT NULL,
211 211
 				QSG_ID int(10) unsigned NOT NULL,
@@ -213,17 +213,17 @@  discard block
 block discarded – undo
213 213
 				PRIMARY KEY  (EQG_ID),
214 214
 				KEY EVT_ID (EVT_ID),
215 215
 				KEY QSG_ID (QSG_ID)";
216
-		$this->_table_is_changed_in_this_version($table_name,$sql, 'ENGINE=InnoDB');
216
+		$this->_table_is_changed_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
217 217
 
218
-		$table_name='esp_event_venue';
218
+		$table_name = 'esp_event_venue';
219 219
 		$sql = "EVV_ID int(11) NOT NULL AUTO_INCREMENT,
220 220
 				EVT_ID bigint(20) unsigned NOT NULL,
221 221
 				VNU_ID bigint(20) unsigned NOT NULL,
222 222
 				EVV_primary tinyint(1) unsigned NOT NULL DEFAULT 0,
223 223
 				PRIMARY KEY  (EVV_ID)";
224
-		$this->_table_has_not_changed_since_previous($table_name,$sql, 'ENGINE=InnoDB');
224
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
225 225
 
226
-		$table_name='esp_extra_meta';
226
+		$table_name = 'esp_extra_meta';
227 227
 		$sql = "EXM_ID int(11) NOT NULL AUTO_INCREMENT,
228 228
 				OBJ_ID int(11) DEFAULT NULL,
229 229
 				EXM_type varchar(45) DEFAULT NULL,
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 				EXM_value text,
232 232
 				PRIMARY KEY  (EXM_ID),
233 233
 				KEY EXM_type (EXM_type,OBJ_ID,EXM_key)";
234
-		$this->_table_has_not_changed_since_previous($table_name,$sql, 'ENGINE=InnoDB');
234
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
235 235
 
236 236
 		$table_name = 'esp_extra_join';
237 237
 		$sql = "EXJ_ID int(11) NOT NULL AUTO_INCREMENT,
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 				KEY second_model (EXJ_second_model_name,EXJ_second_model_id)";
245 245
 		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB ');
246 246
 
247
-		$table_name='esp_line_item';
247
+		$table_name = 'esp_line_item';
248 248
 		$sql = "LIN_ID int(11) NOT NULL AUTO_INCREMENT,
249 249
 				LIN_code varchar(245) NOT NULL DEFAULT '',
250 250
 				TXN_ID int(11) DEFAULT NULL,
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 				PRIMARY KEY  (LIN_ID),
265 265
 				KEY LIN_code (LIN_code(191)),
266 266
 				KEY TXN_ID (TXN_ID)";
267
-		$this->_table_has_not_changed_since_previous($table_name,$sql, 'ENGINE=InnoDB' );
267
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
268 268
 
269 269
 		$table_name = 'esp_log';
270 270
 		$sql = "LOG_ID int(11) NOT NULL AUTO_INCREMENT,
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 				KEY STS_ID (STS_ID),
314 314
 				KEY MSG_created (MSG_created),
315 315
 				KEY MSG_modified (MSG_modified)";
316
-		$this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB' );
316
+		$this->_table_is_new_in_this_version($table_name, $sql, 'ENGINE=InnoDB');
317 317
 
318 318
 		$table_name = 'esp_message_template';
319 319
 		$sql = "MTP_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 				MTP_is_active tinyint(1) NOT NULL DEFAULT '1',
339 339
 				PRIMARY KEY  (GRP_ID),
340 340
 				KEY MTP_user_id (MTP_user_id)";
341
-		$this->_table_has_not_changed_since_previous( $table_name, $sql, 'ENGINE=InnoDB');
341
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
342 342
 
343 343
 		$table_name = 'esp_payment';
344 344
 		$sql = "PAY_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 				PRIMARY KEY  (TTM_ID)";
397 397
 		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
398 398
 
399
-		$table_name='esp_question';
399
+		$table_name = 'esp_question';
400 400
 		$sql = 'QST_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
401 401
 				QST_display_text text NOT NULL,
402 402
 				QST_admin_label varchar(255) NOT NULL,
@@ -411,9 +411,9 @@  discard block
 block discarded – undo
411 411
 				QST_deleted tinyint(2) unsigned NOT NULL DEFAULT 0,
412 412
 				PRIMARY KEY  (QST_ID),
413 413
 				KEY QST_order (QST_order)';
414
-		$this->_table_has_not_changed_since_previous($table_name,$sql, 'ENGINE=InnoDB');
414
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
415 415
 
416
-		$table_name='esp_question_group_question';
416
+		$table_name = 'esp_question_group_question';
417 417
 		$sql = "QGQ_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
418 418
 				QSG_ID int(10) unsigned NOT NULL,
419 419
 				QST_ID int(10) unsigned NOT NULL,
@@ -421,9 +421,9 @@  discard block
 block discarded – undo
421 421
 				PRIMARY KEY  (QGQ_ID),
422 422
 				KEY QST_ID (QST_ID),
423 423
 				KEY QSG_ID_order (QSG_ID,QGQ_order)";
424
-		$this->_table_has_not_changed_since_previous($table_name,$sql, 'ENGINE=InnoDB');
424
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
425 425
 
426
-		$table_name='esp_question_option';
426
+		$table_name = 'esp_question_option';
427 427
 		$sql = "QSO_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
428 428
 				QSO_value varchar(255) NOT NULL,
429 429
 				QSO_desc text NOT NULL,
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 				PRIMARY KEY  (QSO_ID),
435 435
 				KEY QST_ID (QST_ID),
436 436
 				KEY QSO_order (QSO_order)";
437
-		$this->_table_has_not_changed_since_previous($table_name,$sql, 'ENGINE=InnoDB');
437
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
438 438
 
439 439
 		$table_name = 'esp_registration';
440 440
 		$sql = "REG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 				PRC_parent int(10) unsigned DEFAULT 0,
548 548
 				PRIMARY KEY  (PRC_ID),
549 549
 				KEY PRT_ID (PRT_ID)";
550
-		$this->_table_has_not_changed_since_previous($table_name,$sql, 'ENGINE=InnoDB');
550
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
551 551
 
552 552
 		$table_name = "esp_price_type";
553 553
 		$sql = "PRT_ID tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 				TKT_deleted tinyint(1) NOT NULL DEFAULT '0',
585 585
 				PRIMARY KEY  (TKT_ID),
586 586
 				KEY TKT_start_date (TKT_start_date)";
587
-		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' );
587
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
588 588
 
589 589
 		$table_name = 'esp_question_group';
590 590
 		$sql = 'QSG_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
 				PRIMARY KEY  (QSG_ID),
601 601
 				UNIQUE KEY QSG_identifier_UNIQUE (QSG_identifier),
602 602
 				KEY QSG_order (QSG_order)';
603
-		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB' );
603
+		$this->_table_has_not_changed_since_previous($table_name, $sql, 'ENGINE=InnoDB');
604 604
 
605 605
 		/** @var EE_DMS_Core_4_1_0 $script_4_1_defaults */
606 606
 		$script_4_1_defaults = EE_Registry::instance()->load_dms('Core_4_1_0');
@@ -634,5 +634,5 @@  discard block
 block discarded – undo
634 634
 		return true;
635 635
 	}
636 636
 
637
-	public function migration_page_hooks(){}
637
+	public function migration_page_hooks() {}
638 638
 }
639 639
\ No newline at end of file
Please login to merge, or discard this patch.