Completed
Branch FET/11491/implement-wordpress-... (33c5aa)
by
unknown
56:22 queued 11s
created
core/db_classes/EE_Taxes.class.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 
5 5
 
@@ -38,21 +38,21 @@  discard block
 block discarded – undo
38 38
 	 * @return float             total taxes to apply to ticket.
39 39
 	 * @throws \EE_Error
40 40
 	 */
41
-	public static function get_total_taxes_for_admin( EE_Ticket $ticket ) {
41
+	public static function get_total_taxes_for_admin(EE_Ticket $ticket) {
42 42
 		$tax = 0;
43 43
 		$total_tax = 0;
44 44
 		//This first checks to see if the given ticket is taxable.
45
-		if ( ! $ticket->get( 'TKT_taxable' ) ) {
45
+		if ( ! $ticket->get('TKT_taxable')) {
46 46
 			return $tax;
47 47
 		}
48 48
 		//get subtotal (notice we're only retrieving a subtotal if there isn't one given)
49
-		$subtotal = self::get_subtotal_for_admin( $ticket );
49
+		$subtotal = self::get_subtotal_for_admin($ticket);
50 50
 		//get taxes
51 51
 		$taxes = self::get_taxes_for_admin();
52 52
 		//apply taxes to subtotal
53
-		foreach ( $taxes as $tax ) {
53
+		foreach ($taxes as $tax) {
54 54
 			//assuming taxes are not cumulative
55
-			$total_tax += $subtotal * $tax->get( 'PRC_amount' ) / 100;
55
+			$total_tax += $subtotal * $tax->get('PRC_amount') / 100;
56 56
 		}
57 57
 		return $total_tax;
58 58
 	}
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 	 */
69 69
 	public static function get_total_taxes_percentage() {
70 70
 		$total_tax_percent = 0;
71
-		foreach ( self::get_taxes_for_admin() as $tax_price ) {
72
-			$total_tax_percent += $tax_price->get( 'PRC_amount' );
71
+		foreach (self::get_taxes_for_admin() as $tax_price) {
72
+			$total_tax_percent += $tax_price->get('PRC_amount');
73 73
 		}
74 74
 		return $total_tax_percent;
75 75
 	}
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
 	 * @return float
82 82
 	 * @throws \EE_Error
83 83
 	 */
84
-	public static function get_subtotal_for_admin( EE_Ticket $ticket ) {
84
+	public static function get_subtotal_for_admin(EE_Ticket $ticket) {
85 85
 		$TKT_ID = $ticket->ID();
86
-		return isset( self::$_subtotal[ $TKT_ID ] )
87
-			? self::$_subtotal[ $TKT_ID ]
88
-			: self::_get_subtotal_for_admin( $ticket );
86
+		return isset(self::$_subtotal[$TKT_ID])
87
+			? self::$_subtotal[$TKT_ID]
88
+			: self::_get_subtotal_for_admin($ticket);
89 89
 	}
90 90
 
91 91
 
@@ -97,37 +97,37 @@  discard block
 block discarded – undo
97 97
 	 * @return float     subtotal calculated from all EE_Price[] on Ticket.
98 98
 	 * @throws \EE_Error
99 99
 	 */
100
-	private static function _get_subtotal_for_admin( EE_Ticket $ticket ) {
100
+	private static function _get_subtotal_for_admin(EE_Ticket $ticket) {
101 101
 		$subtotal = 0;
102 102
 		//get all prices
103 103
 		$prices = $ticket->get_many_related(
104 104
 			'Price',
105 105
 			array(
106 106
 				'default_where_conditions' => 'none',
107
-				'order_by'                 => array( 'PRC_order' => 'ASC' ),
107
+				'order_by'                 => array('PRC_order' => 'ASC'),
108 108
 			)
109 109
 		);
110 110
 		//let's loop through them (base price is always the first item)
111
-		foreach ( $prices as $price ) {
112
-			if ( $price instanceof EE_Price ) {
111
+		foreach ($prices as $price) {
112
+			if ($price instanceof EE_Price) {
113 113
 				$price_type = $price->type_obj();
114
-				if ( $price_type instanceof EE_Price_Type ) {
115
-					switch ( $price->type_obj()->base_type() ) {
114
+				if ($price_type instanceof EE_Price_Type) {
115
+					switch ($price->type_obj()->base_type()) {
116 116
 						case 1: // base price
117 117
 						case 3: // surcharges
118
-							$subtotal += $price->is_percent() ? $subtotal * $price->get( 'PRC_amount' ) / 100
119
-								: $price->get( 'PRC_amount' );
118
+							$subtotal += $price->is_percent() ? $subtotal * $price->get('PRC_amount') / 100
119
+								: $price->get('PRC_amount');
120 120
 							break;
121 121
 						case 2: // discounts
122
-							$subtotal -= $price->is_percent() ? $subtotal * $price->get( 'PRC_amount' ) / 100
123
-								: $price->get( 'PRC_amount' );
122
+							$subtotal -= $price->is_percent() ? $subtotal * $price->get('PRC_amount') / 100
123
+								: $price->get('PRC_amount');
124 124
 							break;
125 125
 					}
126 126
 				}
127 127
 			}
128 128
 		}
129 129
 		$TKT_ID = $ticket->ID();
130
-		self::$_subtotal = array( $TKT_ID => $subtotal );
130
+		self::$_subtotal = array($TKT_ID => $subtotal);
131 131
 		return $subtotal;
132 132
 	}
133 133
 
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
 	 * @throws \EE_Error
141 141
 	 */
142 142
 	public static function get_taxes_for_admin() {
143
-		if ( empty( self::$_default_taxes ) ) {
144
-			self::$_default_taxes = EE_Registry::instance()->load_model( 'Price' )->get_all(
145
-				array( array( 'Price_Type.PBT_ID' => 4 ) )
143
+		if (empty(self::$_default_taxes)) {
144
+			self::$_default_taxes = EE_Registry::instance()->load_model('Price')->get_all(
145
+				array(array('Price_Type.PBT_ID' => 4))
146 146
 			);
147 147
 		}
148 148
 		return self::$_default_taxes;
Please login to merge, or discard this patch.
help_tabs/payment_methods_overview_paypalstandard.help_tab.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <p><strong><?php _e('PayPal Standard', 'event_espresso'); ?></strong></p>
2
-<p><span class="required"><?php _e('Please Note! This gateway has been deprecated and replaced with the PayPal Express payment method. ', 'event_espresso'); ?> <?php printf( __('If you still want to use this gateway, please follow the directions to %1$sactivate it here%2$s.', 'event_espresso'), "<a href='https://eventespresso.com/wiki/paypal-standard-payment-gateway/#deprecated' target='_blank'>", '</a>'); ?></span></p>
2
+<p><span class="required"><?php _e('Please Note! This gateway has been deprecated and replaced with the PayPal Express payment method. ', 'event_espresso'); ?> <?php printf(__('If you still want to use this gateway, please follow the directions to %1$sactivate it here%2$s.', 'event_espresso'), "<a href='https://eventespresso.com/wiki/paypal-standard-payment-gateway/#deprecated' target='_blank'>", '</a>'); ?></span></p>
3 3
 <p>
4 4
 <?php _e('Adjust the settings for the PayPal Standard payment gateway.', 'event_espresso'); ?>
5 5
 </p>
6 6
 <p>
7
-<?php printf( __( 'See %1$shere%2$s for list of currencies supported by Paypal Standard.', 'event_espresso' ), "<a href='https://www.paypal.com/multicurrency' target='_blank'>","</a>" ); ?>
7
+<?php printf(__('See %1$shere%2$s for list of currencies supported by Paypal Standard.', 'event_espresso'), "<a href='https://www.paypal.com/multicurrency' target='_blank'>", "</a>"); ?>
8 8
 </p>
9 9
 <p><strong><?php _e('PayPal Standard Settings', 'event_espresso'); ?></strong></p>
10 10
 <ul>
@@ -22,18 +22,18 @@  discard block
 block discarded – undo
22 22
 </li>
23 23
 <li>
24 24
 <strong><?php _e('PayPal Calculates Taxes', 'event_espresso'); ?></strong><br />
25
-<?php printf( __('If set to "Yes", we will indicate to PayPal that it should calculate the taxes on the order and add it. This means PayPal\'s tax calculations will be used on the order instead of Event Espresso\'s. %1$sRead here for more information.%2$s', 'event_espresso'), "<a href='https://www.paypal.com/ca/cgi-bin/webscr?cmd=xpt/Marketing/shipping/EasyCalculateShipAndTax-outside' target='_blank'>", '</a>' ); ?><br/>
26
-<?php _e( 'Note: It may confuse users if Event Espresso initially calculates taxes on the order, and then they go to PayPal and it calculates taxes differently. So it is recommended that if PayPal is calculating taxes, that you do not set any taxes in Event Espresso.', 'event_espresso' );?>
25
+<?php printf(__('If set to "Yes", we will indicate to PayPal that it should calculate the taxes on the order and add it. This means PayPal\'s tax calculations will be used on the order instead of Event Espresso\'s. %1$sRead here for more information.%2$s', 'event_espresso'), "<a href='https://www.paypal.com/ca/cgi-bin/webscr?cmd=xpt/Marketing/shipping/EasyCalculateShipAndTax-outside' target='_blank'>", '</a>'); ?><br/>
26
+<?php _e('Note: It may confuse users if Event Espresso initially calculates taxes on the order, and then they go to PayPal and it calculates taxes differently. So it is recommended that if PayPal is calculating taxes, that you do not set any taxes in Event Espresso.', 'event_espresso'); ?>
27 27
 </li>
28 28
 <li>
29 29
 <strong><?php _e('PayPal Calculates Shipping', 'event_espresso'); ?></strong><br />
30 30
 <?php _e('Similar to the "PayPal Calculates Taxes" setting, if this is set to "Yes", we will indicate to PayPal that it should calculate the shipping on each payment (if there are multiple payments for a single transaction, PayPal is permitted to add shipping charges to each payment.)', 'event_espresso'); ?><br/>
31
-<?php _e( 'Important Note: PayPal will ONLY calculate shipping on an order if "Shipping Address Options" is set to "Prompt for an Address" (otherwise how will PayPal know how much to charge for shipping if it doesn\'t know where it\'s shipping to?)', 'event_espresso' );?>
31
+<?php _e('Important Note: PayPal will ONLY calculate shipping on an order if "Shipping Address Options" is set to "Prompt for an Address" (otherwise how will PayPal know how much to charge for shipping if it doesn\'t know where it\'s shipping to?)', 'event_espresso'); ?>
32 32
 <li>
33
-<strong><?php _e( 'Notes Regarding Paypal Taxes and Shipping', 'event_espresso' );?></strong><br/>
34
-<?php _e( 'If you want PayPal to calculate taxes and shipping on an order, those changes will NOT appear during the initial registration process until the user is redirected to PayPal for payment.', 'event_espresso' );?><br/>
35
-<?php _e( 'However, after the user has returned from PayPal, their order in Event Espresso will be updated with the new taxes and added shipping charges (e.g. it will appear on their receipt.)', 'event_espresso' );?><br/>
36
-<?php _e( 'Also Note: In order for PayPal to properly calculate taxes and shipping, they need to receive the entire order at the same time. So if a user goes to make a payment using PayPal, and their order somehow already has a payment on it, PayPal CANNOT calculate taxes or shipping on that order.', 'event_espresso' );?>
33
+<strong><?php _e('Notes Regarding Paypal Taxes and Shipping', 'event_espresso'); ?></strong><br/>
34
+<?php _e('If you want PayPal to calculate taxes and shipping on an order, those changes will NOT appear during the initial registration process until the user is redirected to PayPal for payment.', 'event_espresso'); ?><br/>
35
+<?php _e('However, after the user has returned from PayPal, their order in Event Espresso will be updated with the new taxes and added shipping charges (e.g. it will appear on their receipt.)', 'event_espresso'); ?><br/>
36
+<?php _e('Also Note: In order for PayPal to properly calculate taxes and shipping, they need to receive the entire order at the same time. So if a user goes to make a payment using PayPal, and their order somehow already has a payment on it, PayPal CANNOT calculate taxes or shipping on that order.', 'event_espresso'); ?>
37 37
 </li>
38 38
 <li>
39 39
 <strong><?php _e('Shipping Address Options', 'event_espresso'); ?></strong><br />
Please login to merge, or discard this patch.
caffeinated/admin/new/pricing/Pricing_Admin_Page.core.php 3 patches
Indentation   +181 added lines, -181 removed lines patch added patch discarded remove patch
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
 
79 79
 	/**
80 80
 	 * 		an array for storing request actions and their corresponding methods
81
-	*		@access private
82
-	*		@return void
83
-	*/
81
+	 *		@access private
82
+	 *		@return void
83
+	 */
84 84
 	protected function _set_page_routes() {
85 85
 		$prc_id = ! empty( $this->_req_data['PRC_ID'] ) && ! is_array( $this->_req_data['PRC_ID'] ) ? $this->_req_data['PRC_ID'] : 0;
86 86
 		$prt_id =  ! empty( $this->_req_data['PRT_ID'] ) && ! is_array( $this->_req_data['PRT_ID'] ) ? $this->_req_data['PRT_ID'] : 0;
@@ -185,16 +185,16 @@  discard block
 block discarded – undo
185 185
 					'capability' => 'ee_delete_default_price_type',
186 186
 					'obj_id' => $prt_id
187 187
 				),
188
-            'tax_settings' => array(
189
-                'func'       => '_tax_settings',
190
-                'capability' => 'manage_options'
191
-            ),
192
-            'update_tax_settings' => array(
193
-                'func'       => '_update_tax_settings',
194
-                'capability' => 'manage_options',
195
-                'noheader'   => true
196
-            ),
197
-        );
188
+			'tax_settings' => array(
189
+				'func'       => '_tax_settings',
190
+				'capability' => 'manage_options'
191
+			),
192
+			'update_tax_settings' => array(
193
+				'func'       => '_update_tax_settings',
194
+				'capability' => 'manage_options',
195
+				'noheader'   => true
196
+			),
197
+		);
198 198
 	}
199 199
 
200 200
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 							'order' => 10
210 210
 						),
211 211
 					'list_table' => 'Prices_List_Table',
212
-                    'help_tabs' => array(
212
+					'help_tabs' => array(
213 213
 						'pricing_default_pricing_help_tab' => array(
214 214
 							'title' => __('Default Pricing', 'event_espresso'),
215 215
 							'filename' => 'pricing_default_pricing'
@@ -232,13 +232,13 @@  discard block
 block discarded – undo
232 232
 							'order' => 20,
233 233
 							'persistent' => FALSE
234 234
 						),
235
-                    'help_tabs' => array(
235
+					'help_tabs' => array(
236 236
 						'add_new_default_price_help_tab' => array(
237 237
 							'title' => __('Add New Default Price', 'event_espresso'),
238 238
 							'filename' => 'pricing_add_new_default_price'
239 239
 							)
240 240
 						),
241
-                    'help_tour' => array('Pricing_Add_New_Default_Price_Help_Tour'),
241
+					'help_tour' => array('Pricing_Add_New_Default_Price_Help_Tour'),
242 242
 					'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes' ),
243 243
 					'require_nonce' => FALSE
244 244
 				),
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 							'persistent' => FALSE
251 251
 						),
252 252
 					'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes' ),
253
-                    'help_tabs' => array(
253
+					'help_tabs' => array(
254 254
 						'edit_default_price_help_tab' => array(
255 255
 							'title' => __('Edit Default Price', 'event_espresso'),
256 256
 							'filename' => 'pricing_edit_default_price'
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 							'order' => 30
266 266
 						),
267 267
 					'list_table' => 'Price_Types_List_Table',
268
-                    'help_tabs' => array(
268
+					'help_tabs' => array(
269 269
 						'pricing_price_types_help_tab' => array(
270 270
 							'title' => __('Price Types', 'event_espresso'),
271 271
 							'filename' => 'pricing_price_types'
@@ -289,13 +289,13 @@  discard block
 block discarded – undo
289 289
 							'order' => 40,
290 290
 							'persistent' => FALSE
291 291
 						),
292
-                    'help_tabs' => array(
292
+					'help_tabs' => array(
293 293
 						'add_new_price_type_help_tab' => array(
294 294
 							'title' => __('Add New Price Type', 'event_espresso'),
295 295
 							'filename' => 'pricing_add_new_price_type'
296 296
 							)
297 297
 						),
298
-                    'help_tour' => array( 'Pricing_Add_New_Price_Type_Help_Tour' ),
298
+					'help_tour' => array( 'Pricing_Add_New_Price_Type_Help_Tour' ),
299 299
 					'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes' ),
300 300
 					'require_nonce' => FALSE
301 301
 				),
@@ -305,36 +305,36 @@  discard block
 block discarded – undo
305 305
 							'order' => 40,
306 306
 							'persistent' => FALSE
307 307
 						),
308
-                    'help_tabs' => array(
308
+					'help_tabs' => array(
309 309
 						'edit_price_type_help_tab' => array(
310 310
 							'title' => __('Edit Price Type', 'event_espresso'),
311 311
 							'filename' => 'pricing_edit_price_type'
312 312
 							)
313 313
 						),
314
-                    'help_tour' => array( 'Pricing_Edit_Price_Type_Help_Tour' ),
314
+					'help_tour' => array( 'Pricing_Edit_Price_Type_Help_Tour' ),
315 315
 					'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes' ),
316 316
 
317 317
 					'require_nonce' => FALSE
318 318
 				),
319
-            'tax_settings' => array(
320
-                'nav'           => array(
321
-                    'label' => esc_html__('Tax Settings', 'event_espresso'),
322
-                    'order' => 40
323
-                ),
324
-                'labels'        => array(
325
-                    'publishbox' => esc_html__('Update Tax Settings', 'event_espresso')
326
-                ),
327
-                'metaboxes'     => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
328
-                // 'help_tabs'     => array(
329
-                //     'registration_form_reg_form_settings_help_tab' => array(
330
-                //         'title'    => esc_html__('Registration Form Settings', 'event_espresso'),
331
-                //         'filename' => 'registration_form_reg_form_settings'
332
-                //     ),
333
-                // ),
334
-                // 'help_tour'     => array('Registration_Form_Settings_Help_Tour'),
335
-                'require_nonce' => true
336
-            )
337
-        );
319
+			'tax_settings' => array(
320
+				'nav'           => array(
321
+					'label' => esc_html__('Tax Settings', 'event_espresso'),
322
+					'order' => 40
323
+				),
324
+				'labels'        => array(
325
+					'publishbox' => esc_html__('Update Tax Settings', 'event_espresso')
326
+				),
327
+				'metaboxes'     => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
328
+				// 'help_tabs'     => array(
329
+				//     'registration_form_reg_form_settings_help_tab' => array(
330
+				//         'title'    => esc_html__('Registration Form Settings', 'event_espresso'),
331
+				//         'filename' => 'registration_form_reg_form_settings'
332
+				//     ),
333
+				// ),
334
+				// 'help_tour'     => array('Registration_Form_Settings_Help_Tour'),
335
+				'require_nonce' => true
336
+			)
337
+		);
338 338
 	}
339 339
 
340 340
 
@@ -460,16 +460,16 @@  discard block
 block discarded – undo
460 460
 
461 461
 	/**
462 462
 	 * 		generates HTML for main Prices Admin page
463
-	*		@access protected
464
-	*		@return void
465
-	*/
463
+	 *		@access protected
464
+	 *		@return void
465
+	 */
466 466
 	protected function _price_overview_list_table() {
467 467
 		$this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
468
-		    'add_new_price',
469
-            'add',
470
-            array(),
471
-            'add-new-h2'
472
-        );
468
+			'add_new_price',
469
+			'add',
470
+			array(),
471
+			'add-new-h2'
472
+		);
473 473
 		$this->admin_page_title .= $this->_learn_more_about_pricing_link();
474 474
 		$this->_search_btn_label = __('Default Prices', 'event_espresso');
475 475
 		$this->display_admin_list_table_page_with_no_sidebar();
@@ -481,13 +481,13 @@  discard block
 block discarded – undo
481 481
 
482 482
 
483 483
 	/**
484
-	*	retrieve data for Prices List table
485
-	*	@access public
486
-	* 	@param  int  $per_page    how many prices displayed per page
487
-	* 	@param  boolean $count   return the count or objects
488
-	* 	@param  boolean $trashed   whether the current view is of the trash can - eww yuck!
489
-	* 	@return mixed (int|array)  int = count || array of price objects
490
-	*/
484
+	 *	retrieve data for Prices List table
485
+	 *	@access public
486
+	 * 	@param  int  $per_page    how many prices displayed per page
487
+	 * 	@param  boolean $count   return the count or objects
488
+	 * 	@param  boolean $trashed   whether the current view is of the trash can - eww yuck!
489
+	 * 	@return mixed (int|array)  int = count || array of price objects
490
+	 */
491 491
 	public function get_prices_overview_data( $per_page = 10, $count = FALSE, $trashed = FALSE ) {
492 492
 
493 493
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -557,9 +557,9 @@  discard block
 block discarded – undo
557 557
 
558 558
 	/**
559 559
 	 * 		_price_details
560
-	*		@access protected
561
-	*		@return void
562
-	*/
560
+	 *		@access protected
561
+	 *		@return void
562
+	 */
563 563
 	protected function _edit_price_details() {
564 564
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
565 565
 		// grab price ID
@@ -628,9 +628,9 @@  discard block
 block discarded – undo
628 628
 
629 629
 	/**
630 630
 	 * 		declare price details page metaboxes
631
-	*		@access protected
632
-	*		@return void
633
-	*/
631
+	 *		@access protected
632
+	 *		@return void
633
+	 */
634 634
 	protected function _price_details_meta_boxes() {
635 635
 		add_meta_box( 'edit-price-details-mbox', __( 'Default Price Details', 'event_espresso' ), array( $this, '_edit_price_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
636 636
 	}
@@ -642,9 +642,9 @@  discard block
 block discarded – undo
642 642
 
643 643
 	/**
644 644
 	 * 		_edit_price_details_meta_box
645
-	*		@access public
646
-	*		@return void
647
-	*/
645
+	 *		@access public
646
+	 *		@return void
647
+	 */
648 648
 	public function _edit_price_details_meta_box() {
649 649
 		echo EEH_Template::display_template( PRICING_TEMPLATE_PATH . 'pricing_details_main_meta_box.template.php', $this->_template_args, TRUE );
650 650
 	}
@@ -655,9 +655,9 @@  discard block
 block discarded – undo
655 655
 
656 656
 	/**
657 657
 	 * 		set_price_column_values
658
-	*		@access protected
659
-	*		@return array
660
-	*/
658
+	 *		@access protected
659
+	 *		@return array
660
+	 */
661 661
 	protected function set_price_column_values() {
662 662
 
663 663
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -684,10 +684,10 @@  discard block
 block discarded – undo
684 684
 
685 685
 	/**
686 686
 	 * 		insert_or_update_price
687
-	*		@param boolean 		$insert - whether to insert or update
688
-	*		@access protected
689
-	*		@return void
690
-	*/
687
+	 *		@param boolean 		$insert - whether to insert or update
688
+	 *		@access protected
689
+	 *		@return void
690
+	 */
691 691
 	protected function _insert_or_update_price( $insert = FALSE ) {
692 692
 
693 693
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
@@ -760,10 +760,10 @@  discard block
 block discarded – undo
760 760
 
761 761
 	/**
762 762
 	 * 		_trash_or_restore_price
763
-	*		@param boolean 		$trash - whether to move item to trash (TRUE) or restore it (FALSE)
764
-	*		@access protected
765
-	*		@return void
766
-	*/
763
+	 *		@param boolean 		$trash - whether to move item to trash (TRUE) or restore it (FALSE)
764
+	 *		@access protected
765
+	 *		@return void
766
+	 */
767 767
 	protected function _trash_or_restore_price( $trash = TRUE ) {
768 768
 
769 769
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
@@ -843,9 +843,9 @@  discard block
 block discarded – undo
843 843
 
844 844
 	/**
845 845
 	 * 		_delete_price
846
-	*		@access protected
847
-	*		@return void
848
-	*/
846
+	 *		@access protected
847
+	 *		@return void
848
+	 */
849 849
 	protected function _delete_price() {
850 850
 
851 851
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
@@ -922,16 +922,16 @@  discard block
 block discarded – undo
922 922
 
923 923
 	/**
924 924
 	 * 		generates HTML for main Prices Admin page
925
-	*		@access protected
926
-	*		@return void
927
-	*/
925
+	 *		@access protected
926
+	 *		@return void
927
+	 */
928 928
 	protected function _price_types_overview_list_table() {
929 929
 		$this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
930
-		    'add_new_price_type',
931
-            'add_type',
932
-            array(),
933
-            'add-new-h2'
934
-        );
930
+			'add_new_price_type',
931
+			'add_type',
932
+			array(),
933
+			'add-new-h2'
934
+		);
935 935
 		$this->admin_page_title .= $this->_learn_more_about_pricing_link();
936 936
 		$this->_search_btn_label = __('Price Types', 'event_espresso');
937 937
 		$this->display_admin_list_table_page_with_no_sidebar();
@@ -943,13 +943,13 @@  discard block
 block discarded – undo
943 943
 
944 944
 
945 945
 	/**
946
-	*	retrieve data for Price Types List table
947
-	*	@access public
948
-	* 	@param  int  $per_page    how many prices displayed per page
949
-	* 	@param  boolean $count   return the count or objects
950
-	* 	@param  boolean $trashed   whether the current view is of the trash can - eww yuck!
951
-	* 	@return mixed (int|array)  int = count || array of price objects
952
-	*/
946
+	 *	retrieve data for Price Types List table
947
+	 *	@access public
948
+	 * 	@param  int  $per_page    how many prices displayed per page
949
+	 * 	@param  boolean $count   return the count or objects
950
+	 * 	@param  boolean $trashed   whether the current view is of the trash can - eww yuck!
951
+	 * 	@return mixed (int|array)  int = count || array of price objects
952
+	 */
953 953
 	public function get_price_types_overview_data( $per_page = 10, $count = FALSE, $trashed = FALSE ) {
954 954
 
955 955
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -1004,9 +1004,9 @@  discard block
 block discarded – undo
1004 1004
 
1005 1005
 	/**
1006 1006
 	 * 		_edit_price_type_details
1007
-	*		@access protected
1008
-	*		@return void
1009
-	*/
1007
+	 *		@access protected
1008
+	 *		@return void
1009
+	 */
1010 1010
 	protected function _edit_price_type_details() {
1011 1011
 
1012 1012
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -1070,9 +1070,9 @@  discard block
 block discarded – undo
1070 1070
 
1071 1071
 	/**
1072 1072
 	 * 		declare price type details page metaboxes
1073
-	*		@access protected
1074
-	*		@return void
1075
-	*/
1073
+	 *		@access protected
1074
+	 *		@return void
1075
+	 */
1076 1076
 	protected function _price_type_details_meta_boxes() {
1077 1077
 		add_meta_box( 'edit-price-details-mbox', __( 'Price Type Details', 'event_espresso' ), array( $this, '_edit_price_type_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1078 1078
 	}
@@ -1083,9 +1083,9 @@  discard block
 block discarded – undo
1083 1083
 
1084 1084
 	/**
1085 1085
 	 * 		_edit_price_type_details_meta_box
1086
-	*		@access public
1087
-	*		@return void
1088
-	*/
1086
+	 *		@access public
1087
+	 *		@return void
1088
+	 */
1089 1089
 	public function _edit_price_type_details_meta_box() {
1090 1090
 		echo EEH_Template::display_template( PRICING_TEMPLATE_PATH . 'pricing_type_details_main_meta_box.template.php', $this->_template_args, TRUE );
1091 1091
 	}
@@ -1095,9 +1095,9 @@  discard block
 block discarded – undo
1095 1095
 
1096 1096
 	/**
1097 1097
 	 * 		set_price_type_column_values
1098
-	*		@access protected
1099
-	*		@return void
1100
-	*/
1098
+	 *		@access protected
1099
+	 *		@return void
1100
+	 */
1101 1101
 	protected function set_price_type_column_values() {
1102 1102
 
1103 1103
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -1145,10 +1145,10 @@  discard block
 block discarded – undo
1145 1145
 
1146 1146
 	/**
1147 1147
 	 * 		_insert_or_update_price_type
1148
-	*		@param boolean 		$new_price_type - whether to insert or update
1149
-	*		@access protected
1150
-	*		@return void
1151
-	*/
1148
+	 *		@param boolean 		$new_price_type - whether to insert or update
1149
+	 *		@access protected
1150
+	 *		@return void
1151
+	 */
1152 1152
 	protected function _insert_or_update_price_type( $new_price_type = FALSE ) {
1153 1153
 
1154 1154
 //		echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
@@ -1189,10 +1189,10 @@  discard block
 block discarded – undo
1189 1189
 
1190 1190
 	/**
1191 1191
 	 * 		_trash_or_restore_price_type
1192
-	*		@param boolean 		$trash - whether to move item to trash (TRUE) or restore it (FALSE)
1193
-	*		@access protected
1194
-	*		@return void
1195
-	*/
1192
+	 *		@param boolean 		$trash - whether to move item to trash (TRUE) or restore it (FALSE)
1193
+	 *		@access protected
1194
+	 *		@return void
1195
+	 */
1196 1196
 	protected function _trash_or_restore_price_type( $trash = TRUE ) {
1197 1197
 
1198 1198
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
@@ -1246,9 +1246,9 @@  discard block
 block discarded – undo
1246 1246
 
1247 1247
 	/**
1248 1248
 	 * 		_delete_price_type
1249
-	*		@access protected
1250
-	*		@return void
1251
-	*/
1249
+	 *		@access protected
1250
+	 *		@return void
1251
+	 */
1252 1252
 	protected function _delete_price_type() {
1253 1253
 
1254 1254
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
@@ -1285,76 +1285,76 @@  discard block
 block discarded – undo
1285 1285
 
1286 1286
 	/**
1287 1287
 	 * 		_learn_more_about_pricing_link
1288
-	*		@access protected
1289
-	*		@return string
1290
-	*/
1288
+	 *		@access protected
1289
+	 *		@return string
1290
+	 */
1291 1291
 	protected function _learn_more_about_pricing_link() {
1292 1292
 		return '<a class="hidden" style="margin:0 20px; cursor:pointer; font-size:12px;" >' . __('learn more about how pricing works', 'event_espresso') . '</a>';
1293 1293
 	}
1294 1294
 
1295 1295
 
1296 1296
 
1297
-    protected function _tax_settings() {
1298
-        $this->_set_add_edit_form_tags('update_tax_settings');
1299
-        $this->_set_publish_post_box_vars(null, false, false, null, false);
1300
-        $this->_template_args['admin_page_content'] = $this->tax_settings_form()->get_html();
1301
-        $this->display_admin_page_with_sidebar();
1302
-    }
1303
-
1304
-
1305
-
1306
-    /**
1307
-     * @return \EE_Form_Section_Proper
1308
-     * @throws \EE_Error
1309
-     */
1310
-    protected function tax_settings_form() {
1311
-        return new EE_Form_Section_Proper(
1312
-            array(
1313
-                'name'            => 'tax_settings_form',
1314
-                'html_id'         => 'tax_settings_form',
1315
-                'layout_strategy' => new EE_Div_Per_Section_Layout(),
1316
-                'subsections'     => apply_filters(
1317
-                    'FHEE__Pricing_Admin_Page__tax_settings_form__form_subsections',
1318
-                    array(
1319
-                        'tax_settings'     => new EE_Form_Section_Proper(
1320
-	                        array(
1321
-		                        'name'            => 'tax_settings_tbl',
1322
-		                        'html_id'         => 'tax_settings_tbl',
1323
-		                        'html_class'      => 'form-table',
1324
-		                        'layout_strategy' => new EE_Admin_Two_Column_Layout(),
1325
-		                        'subsections'     => array(
1326
-			                        'prices_displayed_including_taxes' => new EE_Yes_No_Input(
1327
-				                        array(
1328
-					                        'html_label_text'         => __(
1329
-						                        "Show Prices With Taxes Included?",
1330
-						                        'event_espresso'
1331
-					                        ),
1332
-					                        'html_help_text'          => __(
1333
-						                        'Indicates whether or not to display prices with the taxes included',
1334
-						                        'event_espresso'
1335
-					                        ),
1336
-					                        'default'                 => isset(
1337
-					                            EE_Registry::instance()
1338
-							                        ->CFG
1339
-							                        ->tax_settings
1340
-							                        ->prices_displayed_including_taxes
1341
-					                        )
1342
-						                        ? EE_Registry::instance()
1343
-							                        ->CFG
1344
-							                        ->tax_settings
1345
-							                        ->prices_displayed_including_taxes
1346
-						                        : true,
1347
-					                        'display_html_label_text' => false
1348
-				                        )
1349
-			                        ),
1350
-		                        )
1351
-	                        )
1352
-                        )
1353
-                    )
1354
-                )
1355
-            )
1356
-        );
1357
-    }
1297
+	protected function _tax_settings() {
1298
+		$this->_set_add_edit_form_tags('update_tax_settings');
1299
+		$this->_set_publish_post_box_vars(null, false, false, null, false);
1300
+		$this->_template_args['admin_page_content'] = $this->tax_settings_form()->get_html();
1301
+		$this->display_admin_page_with_sidebar();
1302
+	}
1303
+
1304
+
1305
+
1306
+	/**
1307
+	 * @return \EE_Form_Section_Proper
1308
+	 * @throws \EE_Error
1309
+	 */
1310
+	protected function tax_settings_form() {
1311
+		return new EE_Form_Section_Proper(
1312
+			array(
1313
+				'name'            => 'tax_settings_form',
1314
+				'html_id'         => 'tax_settings_form',
1315
+				'layout_strategy' => new EE_Div_Per_Section_Layout(),
1316
+				'subsections'     => apply_filters(
1317
+					'FHEE__Pricing_Admin_Page__tax_settings_form__form_subsections',
1318
+					array(
1319
+						'tax_settings'     => new EE_Form_Section_Proper(
1320
+							array(
1321
+								'name'            => 'tax_settings_tbl',
1322
+								'html_id'         => 'tax_settings_tbl',
1323
+								'html_class'      => 'form-table',
1324
+								'layout_strategy' => new EE_Admin_Two_Column_Layout(),
1325
+								'subsections'     => array(
1326
+									'prices_displayed_including_taxes' => new EE_Yes_No_Input(
1327
+										array(
1328
+											'html_label_text'         => __(
1329
+												"Show Prices With Taxes Included?",
1330
+												'event_espresso'
1331
+											),
1332
+											'html_help_text'          => __(
1333
+												'Indicates whether or not to display prices with the taxes included',
1334
+												'event_espresso'
1335
+											),
1336
+											'default'                 => isset(
1337
+												EE_Registry::instance()
1338
+													->CFG
1339
+													->tax_settings
1340
+													->prices_displayed_including_taxes
1341
+											)
1342
+												? EE_Registry::instance()
1343
+													->CFG
1344
+													->tax_settings
1345
+													->prices_displayed_including_taxes
1346
+												: true,
1347
+											'display_html_label_text' => false
1348
+										)
1349
+									),
1350
+								)
1351
+							)
1352
+						)
1353
+					)
1354
+				)
1355
+			)
1356
+		);
1357
+	}
1358 1358
 
1359 1359
 
1360 1360
 
Please login to merge, or discard this patch.
Spacing   +199 added lines, -199 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
 	 * @param bool $routing
32 32
 	 * @return Pricing_Admin_Page
33 33
 	 */
34
-	public function __construct( $routing = TRUE ) {
35
-		parent::__construct( $routing );
34
+	public function __construct($routing = TRUE) {
35
+		parent::__construct($routing);
36 36
 	}
37 37
 
38 38
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
 
51 51
 	protected function _ajax_hooks() {
52
-		add_action('wp_ajax_espresso_update_prices_order', array( $this, 'update_price_order' ));
52
+		add_action('wp_ajax_espresso_update_prices_order', array($this, 'update_price_order'));
53 53
 	}
54 54
 
55 55
 
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
 	*		@return void
83 83
 	*/
84 84
 	protected function _set_page_routes() {
85
-		$prc_id = ! empty( $this->_req_data['PRC_ID'] ) && ! is_array( $this->_req_data['PRC_ID'] ) ? $this->_req_data['PRC_ID'] : 0;
86
-		$prt_id =  ! empty( $this->_req_data['PRT_ID'] ) && ! is_array( $this->_req_data['PRT_ID'] ) ? $this->_req_data['PRT_ID'] : 0;
85
+		$prc_id = ! empty($this->_req_data['PRC_ID']) && ! is_array($this->_req_data['PRC_ID']) ? $this->_req_data['PRC_ID'] : 0;
86
+		$prt_id = ! empty($this->_req_data['PRT_ID']) && ! is_array($this->_req_data['PRT_ID']) ? $this->_req_data['PRT_ID'] : 0;
87 87
 		$this->_page_routes = array(
88 88
 			'default' => array(
89 89
 					'func' => '_price_overview_list_table',
@@ -91,38 +91,38 @@  discard block
 block discarded – undo
91 91
 				),
92 92
 			'add_new_price'	=> array(
93 93
 					'func' => '_edit_price_details',
94
-					'args' => array( 'new_price' => TRUE ),
94
+					'args' => array('new_price' => TRUE),
95 95
 					'capability' => 'ee_edit_default_prices'
96 96
 				),
97 97
 			'edit_price'	=> array(
98 98
 					'func' => '_edit_price_details',
99
-					'args' => array( 'new_price' => FALSE ),
99
+					'args' => array('new_price' => FALSE),
100 100
 					'capability' => 'ee_edit_default_price',
101 101
 					'obj_id' => $prc_id
102 102
 				),
103 103
 			'insert_price'	=> array(
104 104
 					'func' => '_insert_or_update_price',
105
-					'args' => array( 'new_price' => TRUE ),
105
+					'args' => array('new_price' => TRUE),
106 106
 					'noheader' => TRUE,
107 107
 					'capability' => 'ee_edit_default_prices',
108 108
 				),
109 109
 			'update_price'	=> array(
110 110
 					'func' => '_insert_or_update_price',
111
-					'args' => array( 'new_price' => FALSE ),
111
+					'args' => array('new_price' => FALSE),
112 112
 					'noheader' => TRUE,
113 113
 					'capability' => 'ee_edit_default_price',
114 114
 					'obj_id' => $prc_id
115 115
 				),
116 116
 			'trash_price'	=> array(
117 117
 					'func' => '_trash_or_restore_price',
118
-					'args' => array( 'trash' => TRUE ),
118
+					'args' => array('trash' => TRUE),
119 119
 					'noheader' => TRUE,
120 120
 					'capability' => 'ee_delete_default_price',
121 121
 					'obj_id' => $prc_id
122 122
 				),
123 123
 			'restore_price'	=> array(
124 124
 					'func' => '_trash_or_restore_price',
125
-					'args' => array( 'trash' => FALSE ),
125
+					'args' => array('trash' => FALSE),
126 126
 					'noheader' => TRUE,
127 127
 					'capability' => 'ee_delete_default_price',
128 128
 					'obj_id' => $prc_id
@@ -154,27 +154,27 @@  discard block
 block discarded – undo
154 154
 				),
155 155
 			'insert_price_type'	=> array(
156 156
 					'func' => '_insert_or_update_price_type',
157
-					'args' => array( 'new_price_type' => TRUE ),
157
+					'args' => array('new_price_type' => TRUE),
158 158
 					'noheader' => TRUE,
159 159
 					'capability' => 'ee_edit_default_price_types'
160 160
 				),
161 161
 			'update_price_type' => array(
162 162
 					'func' => '_insert_or_update_price_type',
163
-					'args' => array( 'new_price_type' => FALSE ),
163
+					'args' => array('new_price_type' => FALSE),
164 164
 					'noheader' => TRUE,
165 165
 					'capability' => 'ee_edit_default_price_type',
166 166
 					'obj_id' => $prt_id
167 167
 				),
168 168
 			'trash_price_type'	=> array(
169 169
 					'func' => '_trash_or_restore_price_type',
170
-					'args' => array( 'trash' => TRUE ),
170
+					'args' => array('trash' => TRUE),
171 171
 					'noheader' => TRUE,
172 172
 					'capability' => 'ee_delete_default_price_type',
173 173
 					'obj_id' => $prt_id
174 174
 				),
175 175
 			'restore_price_type'	=> array(
176 176
 					'func' => '_trash_or_restore_price_type',
177
-					'args' => array( 'trash' => FALSE ),
177
+					'args' => array('trash' => FALSE),
178 178
 					'noheader' => TRUE,
179 179
 					'capability' => 'ee_delete_default_price_type',
180 180
 					'obj_id' => $prt_id
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 							'filename' => 'pricing_default_pricing_views_bulk_actions_search'
224 224
 							)
225 225
 						),
226
-					'help_tour' => array( 'Pricing_Default_Prices_Help_Tour'),
226
+					'help_tour' => array('Pricing_Default_Prices_Help_Tour'),
227 227
 					'require_nonce' => FALSE
228 228
 				),
229 229
 			'add_new_price' => array(
@@ -239,24 +239,24 @@  discard block
 block discarded – undo
239 239
 							)
240 240
 						),
241 241
                     'help_tour' => array('Pricing_Add_New_Default_Price_Help_Tour'),
242
-					'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes' ),
242
+					'metaboxes' => array('_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes'),
243 243
 					'require_nonce' => FALSE
244 244
 				),
245 245
 			'edit_price' => array(
246 246
 					'nav' => array(
247 247
 							'label' => __('Edit Default Price', 'event_espresso'),
248 248
 							'order' => 20,
249
-							'url' => isset($this->_req_data['id']) ? add_query_arg(array('id' => $this->_req_data['id'] ), $this->_current_page_view_url )  : $this->_admin_base_url,
249
+							'url' => isset($this->_req_data['id']) ? add_query_arg(array('id' => $this->_req_data['id']), $this->_current_page_view_url) : $this->_admin_base_url,
250 250
 							'persistent' => FALSE
251 251
 						),
252
-					'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes' ),
252
+					'metaboxes' => array('_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes'),
253 253
                     'help_tabs' => array(
254 254
 						'edit_default_price_help_tab' => array(
255 255
 							'title' => __('Edit Default Price', 'event_espresso'),
256 256
 							'filename' => 'pricing_edit_default_price'
257 257
 							)
258 258
 						),
259
-					'help_tour' => array( 'Pricing_Edit_Default_Price_Help_Tour' ),
259
+					'help_tour' => array('Pricing_Edit_Default_Price_Help_Tour'),
260 260
 					'require_nonce' => FALSE
261 261
 				),
262 262
 			'price_types' => array(
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 							'filename' => 'pricing_price_types_views_bulk_actions_search'
280 280
 							),
281 281
 						),
282
-					'help_tour' => array( 'Pricing_Price_Types_Default_Help_Tour' ),
282
+					'help_tour' => array('Pricing_Price_Types_Default_Help_Tour'),
283 283
 					'metaboxes' => array('_espresso_news_post_box', '_espresso_links_post_box'),
284 284
 					'require_nonce' => FALSE
285 285
 				),
@@ -295,8 +295,8 @@  discard block
 block discarded – undo
295 295
 							'filename' => 'pricing_add_new_price_type'
296 296
 							)
297 297
 						),
298
-                    'help_tour' => array( 'Pricing_Add_New_Price_Type_Help_Tour' ),
299
-					'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes' ),
298
+                    'help_tour' => array('Pricing_Add_New_Price_Type_Help_Tour'),
299
+					'metaboxes' => array('_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes'),
300 300
 					'require_nonce' => FALSE
301 301
 				),
302 302
 			'edit_price_type' => array(
@@ -311,8 +311,8 @@  discard block
 block discarded – undo
311 311
 							'filename' => 'pricing_edit_price_type'
312 312
 							)
313 313
 						),
314
-                    'help_tour' => array( 'Pricing_Edit_Price_Type_Help_Tour' ),
315
-					'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes' ),
314
+                    'help_tour' => array('Pricing_Edit_Price_Type_Help_Tour'),
315
+					'metaboxes' => array('_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes'),
316 316
 
317 317
 					'require_nonce' => FALSE
318 318
 				),
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 	public function load_scripts_styles() {
368 368
 		//styles
369 369
 		wp_enqueue_style('espresso-ui-theme');
370
-		wp_register_style( 'espresso_PRICING', PRICING_ASSETS_URL . 'espresso_pricing_admin.css', array(), EVENT_ESPRESSO_VERSION );
370
+		wp_register_style('espresso_PRICING', PRICING_ASSETS_URL.'espresso_pricing_admin.css', array(), EVENT_ESPRESSO_VERSION);
371 371
 		wp_enqueue_style('espresso_PRICING');
372 372
 
373 373
 		//scripts
@@ -377,8 +377,8 @@  discard block
 block discarded – undo
377 377
 		//wp_enqueue_script('jquery-ui-dialog');
378 378
 		//wp_enqueue_script('jquery-ui-draggable');
379 379
 		//wp_enqueue_script('jquery-ui-datepicker');
380
-		wp_register_script( 'espresso_PRICING', PRICING_ASSETS_URL . 'espresso_pricing_admin.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE );
381
-		wp_enqueue_script( 'espresso_PRICING' );
380
+		wp_register_script('espresso_PRICING', PRICING_ASSETS_URL.'espresso_pricing_admin.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE);
381
+		wp_enqueue_script('espresso_PRICING');
382 382
 	}
383 383
 
384 384
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 
387 387
 
388 388
 	public function load_scripts_styles_default() {
389
-		wp_enqueue_script( 'espresso_ajax_table_sorting' );
389
+		wp_enqueue_script('espresso_ajax_table_sorting');
390 390
 	}
391 391
 
392 392
 
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 				)
415 415
 		);
416 416
 
417
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_prices', 'pricing_trash_price' ) ) {
417
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_prices', 'pricing_trash_price')) {
418 418
 			$this->_views['trashed'] = array(
419 419
 					'slug' => 'trashed',
420 420
 					'label' => __('Trash', 'event_espresso'),
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 				)
445 445
 		);
446 446
 
447
-		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price_types', 'pricing_trash_price_type' ) ) {
447
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price_types', 'pricing_trash_price_type')) {
448 448
 			 $this->_views['trashed'] = array(
449 449
 					'slug' => 'trashed',
450 450
 					'label' => __('Trash', 'event_espresso'),
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 	*		@return void
465 465
 	*/
466 466
 	protected function _price_overview_list_table() {
467
-		$this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
467
+		$this->_admin_page_title .= ' '.$this->get_action_link_or_button(
468 468
 		    'add_new_price',
469 469
             'add',
470 470
             array(),
@@ -488,18 +488,18 @@  discard block
 block discarded – undo
488 488
 	* 	@param  boolean $trashed   whether the current view is of the trash can - eww yuck!
489 489
 	* 	@return mixed (int|array)  int = count || array of price objects
490 490
 	*/
491
-	public function get_prices_overview_data( $per_page = 10, $count = FALSE, $trashed = FALSE ) {
491
+	public function get_prices_overview_data($per_page = 10, $count = FALSE, $trashed = FALSE) {
492 492
 
493
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
493
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
494 494
 		// start with an empty array
495 495
 		$event_pricing = array();
496 496
 
497
-		require_once( PRICING_ADMIN . 'Prices_List_Table.class.php' );
498
-		require_once(EE_MODELS . 'EEM_Price.model.php');
497
+		require_once(PRICING_ADMIN.'Prices_List_Table.class.php');
498
+		require_once(EE_MODELS.'EEM_Price.model.php');
499 499
 		//$PRC = EEM_Price::instance();
500 500
 
501 501
 		$this->_req_data['orderby'] = empty($this->_req_data['orderby']) ? '' : $this->_req_data['orderby'];
502
-		$order = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC';
502
+		$order = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC';
503 503
 
504 504
 		switch ($this->_req_data['orderby']) {
505 505
 			case 'name':
@@ -512,27 +512,27 @@  discard block
 block discarded – undo
512 512
 				$orderby = array('PRC_amount'=>$order);
513 513
 				break;
514 514
 			default:
515
-				$orderby = array( 'PRC_order'=>$order, 'Price_Type.PRT_order'=>$order, 'PRC_ID'=>$order);
515
+				$orderby = array('PRC_order'=>$order, 'Price_Type.PRT_order'=>$order, 'PRC_ID'=>$order);
516 516
 		}
517 517
 
518
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
519
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
518
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
519
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
520 520
 
521 521
 		$_where = array(
522 522
 				'PRC_is_default' => 1,
523 523
 				'PRC_deleted' => $trashed
524 524
 				);
525 525
 
526
-		$offset = ($current_page-1)*$per_page;
527
-		$limit = array( $offset, $per_page );
526
+		$offset = ($current_page - 1) * $per_page;
527
+		$limit = array($offset, $per_page);
528 528
 
529
-		if ( isset( $this->_req_data['s'] ) ) {
530
-			$sstr = '%' . $this->_req_data['s'] . '%';
529
+		if (isset($this->_req_data['s'])) {
530
+			$sstr = '%'.$this->_req_data['s'].'%';
531 531
 			$_where['OR'] = array(
532
-				'PRC_name' => array('LIKE',$sstr ),
533
-				'PRC_desc' => array('LIKE',$sstr ),
534
-				'PRC_amount' => array( 'LIKE',$sstr ),
535
-				'Price_Type.PRT_name' => array( 'LIKE', $sstr )
532
+				'PRC_name' => array('LIKE', $sstr),
533
+				'PRC_desc' => array('LIKE', $sstr),
534
+				'PRC_amount' => array('LIKE', $sstr),
535
+				'Price_Type.PRT_name' => array('LIKE', $sstr)
536 536
 				);
537 537
 		}
538 538
 
@@ -543,9 +543,9 @@  discard block
 block discarded – undo
543 543
 			'group_by'=>'PRC_ID'
544 544
 			);
545 545
 
546
-		if($count){
547
-			return $trashed ? EEM_Price::instance()->count( array( $_where ) ) : EEM_Price::instance()->count_deleted_and_undeleted(array($_where));
548
-		}else{
546
+		if ($count) {
547
+			return $trashed ? EEM_Price::instance()->count(array($_where)) : EEM_Price::instance()->count_deleted_and_undeleted(array($_where));
548
+		} else {
549 549
 			return EEM_Price::instance()->get_all_deleted_and_undeleted($query_params);
550 550
 		}
551 551
 	}
@@ -561,49 +561,49 @@  discard block
 block discarded – undo
561 561
 	*		@return void
562 562
 	*/
563 563
 	protected function _edit_price_details() {
564
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
564
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
565 565
 		// grab price ID
566
-		$PRC_ID = isset( $this->_req_data['id'] ) && ! empty( $this->_req_data['id'] ) ? absint( $this->_req_data['id'] ) : FALSE;
566
+		$PRC_ID = isset($this->_req_data['id']) && ! empty($this->_req_data['id']) ? absint($this->_req_data['id']) : FALSE;
567 567
 		// change page title based on request action
568
-		switch( $this->_req_action ) {
568
+		switch ($this->_req_action) {
569 569
 			case 'add_new_price' :
570
-				$this->_admin_page_title = esc_html__( 'Add New Price', 'event_espresso' );
570
+				$this->_admin_page_title = esc_html__('Add New Price', 'event_espresso');
571 571
 				break;
572 572
 			case 'edit_price' :
573
-				$this->_admin_page_title = esc_html__( 'Edit Price', 'event_espresso' );
573
+				$this->_admin_page_title = esc_html__('Edit Price', 'event_espresso');
574 574
 				break;
575 575
 			default :
576
-				$this->_admin_page_title = ucwords( str_replace( '_', ' ', $this->_req_action ));
576
+				$this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action));
577 577
 		}
578 578
 		// add PRC_ID to title if editing
579
-		$this->_admin_page_title = $PRC_ID ? $this->_admin_page_title . ' # ' . $PRC_ID : $this->_admin_page_title;
579
+		$this->_admin_page_title = $PRC_ID ? $this->_admin_page_title.' # '.$PRC_ID : $this->_admin_page_title;
580 580
 
581 581
 		// get prices
582
-		require_once(EE_MODELS . 'EEM_Price.model.php');
582
+		require_once(EE_MODELS.'EEM_Price.model.php');
583 583
 		$PRC = EEM_Price::instance();
584 584
 
585
-		if ( $PRC_ID ) {
586
-			$price = $PRC->get_one_by_ID( $PRC_ID );
585
+		if ($PRC_ID) {
586
+			$price = $PRC->get_one_by_ID($PRC_ID);
587 587
 			$additional_hidden_fields = array(
588
-					'PRC_ID' => array( 'type' => 'hidden', 'value' => $PRC_ID )
588
+					'PRC_ID' => array('type' => 'hidden', 'value' => $PRC_ID)
589 589
 				);
590
-			$this->_set_add_edit_form_tags( 'update_price', $additional_hidden_fields );
590
+			$this->_set_add_edit_form_tags('update_price', $additional_hidden_fields);
591 591
 		} else {
592 592
 			$price = $PRC->get_new_price();
593
-			$this->_set_add_edit_form_tags( 'insert_price' );
593
+			$this->_set_add_edit_form_tags('insert_price');
594 594
 		}
595 595
 
596 596
 		$this->_template_args['PRC_ID'] = $PRC_ID;
597 597
 		$this->_template_args['price'] = $price;
598 598
 
599 599
 		// get price types
600
-		require_once(EE_MODELS . 'EEM_Price_Type.model.php');
600
+		require_once(EE_MODELS.'EEM_Price_Type.model.php');
601 601
 		$PRT = EEM_Price_Type::instance();
602
-		$price_types = $PRT->get_all( array( array('PBT_ID' => array('!=', 1 ) ) ) );
602
+		$price_types = $PRT->get_all(array(array('PBT_ID' => array('!=', 1))));
603 603
 		$price_type_names = array();
604 604
 		if (empty($price_types)) {
605
-			$msg = __( 'You have no price types defined. Please add a price type before adding a price.', 'event_espresso' );
606
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
605
+			$msg = __('You have no price types defined. Please add a price type before adding a price.', 'event_espresso');
606
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
607 607
 			exit();
608 608
 		} else {
609 609
 			foreach ($price_types as $type) {
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 		$this->_template_args['price_types'] = $price_type_names;
617 617
 		$this->_template_args['learn_more_about_pricing_link'] = $this->_learn_more_about_pricing_link();
618 618
 
619
-		$this->_set_publish_post_box_vars( 'id', $PRC_ID );
619
+		$this->_set_publish_post_box_vars('id', $PRC_ID);
620 620
 		// the details template wrapper
621 621
 		$this->display_admin_page_with_sidebar();
622 622
 	}
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
 	*		@return void
633 633
 	*/
634 634
 	protected function _price_details_meta_boxes() {
635
-		add_meta_box( 'edit-price-details-mbox', __( 'Default Price Details', 'event_espresso' ), array( $this, '_edit_price_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
635
+		add_meta_box('edit-price-details-mbox', __('Default Price Details', 'event_espresso'), array($this, '_edit_price_details_meta_box'), $this->wp_page_slug, 'normal', 'high');
636 636
 	}
637 637
 
638 638
 
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 	*		@return void
647 647
 	*/
648 648
 	public function _edit_price_details_meta_box() {
649
-		echo EEH_Template::display_template( PRICING_TEMPLATE_PATH . 'pricing_details_main_meta_box.template.php', $this->_template_args, TRUE );
649
+		echo EEH_Template::display_template(PRICING_TEMPLATE_PATH.'pricing_details_main_meta_box.template.php', $this->_template_args, TRUE);
650 650
 	}
651 651
 
652 652
 
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
 	*/
661 661
 	protected function set_price_column_values() {
662 662
 
663
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
663
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
664 664
 
665 665
 		$set_column_values = array(
666 666
 				'PRT_ID' => absint($this->_req_data['PRT_ID']),
@@ -688,12 +688,12 @@  discard block
 block discarded – undo
688 688
 	*		@access protected
689 689
 	*		@return void
690 690
 	*/
691
-	protected function _insert_or_update_price( $insert = FALSE ) {
691
+	protected function _insert_or_update_price($insert = FALSE) {
692 692
 
693 693
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
694
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
694
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
695 695
 
696
-		require_once(EE_MODELS . 'EEM_Price.model.php');
696
+		require_once(EE_MODELS.'EEM_Price.model.php');
697 697
 		$PRC = EEM_Price::instance();
698 698
 
699 699
 		// why be so pessimistic ???  : (
@@ -701,14 +701,14 @@  discard block
 block discarded – undo
701 701
 
702 702
 		$set_column_values = $this->set_price_column_values();
703 703
 		// is this a new Price ?
704
-		if ( $insert ) {
704
+		if ($insert) {
705 705
 			// run the insert
706
-			if ( $PRC_ID = $PRC->insert( $set_column_values )) {
706
+			if ($PRC_ID = $PRC->insert($set_column_values)) {
707 707
 				//make sure this new price modifier is attached to the ticket but ONLY if it is not a tax type
708 708
 				$PR = EEM_price::instance()->get_one_by_ID($PRC_ID);
709
-				if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) {
709
+				if ($PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax) {
710 710
 					$ticket = EEM_Ticket::instance()->get_one_by_ID(1);
711
-					$ticket->_add_relation_to( $PR, 'Price' );
711
+					$ticket->_add_relation_to($PR, 'Price');
712 712
 					$ticket->save();
713 713
 				}
714 714
 				$success = 1;
@@ -718,29 +718,29 @@  discard block
 block discarded – undo
718 718
 			}
719 719
 			$action_desc = 'created';
720 720
 		} else {
721
-			$PRC_ID = absint( $this->_req_data['PRC_ID'] );
721
+			$PRC_ID = absint($this->_req_data['PRC_ID']);
722 722
 			// run the update
723
-			$where_cols_n_values = array( 'PRC_ID' => $PRC_ID );
724
-			if ( $PRC->update( $set_column_values, array($where_cols_n_values))) {
723
+			$where_cols_n_values = array('PRC_ID' => $PRC_ID);
724
+			if ($PRC->update($set_column_values, array($where_cols_n_values))) {
725 725
 				$success = 1;
726 726
 			}
727 727
 
728 728
 			$PR = EEM_Price::instance()->get_one_by_ID($PRC_ID);
729
-			if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) {
729
+			if ($PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax) {
730 730
 
731 731
 				//if this is $PRC_ID == 1, then we need to update the default ticket attached to this price so the TKT_price value is updated.
732
-				if ( $PRC_ID === 1 ) {
732
+				if ($PRC_ID === 1) {
733 733
 					$ticket = $PR->get_first_related('Ticket');
734
-					if ( $ticket ) {
735
-						$ticket->set('TKT_price', $PR->get('PRC_amount') );
736
-						$ticket->set('TKT_name', $PR->get('PRC_name') );
734
+					if ($ticket) {
735
+						$ticket->set('TKT_price', $PR->get('PRC_amount'));
736
+						$ticket->set('TKT_name', $PR->get('PRC_name'));
737 737
 						$ticket->set('TKT_description', $PR->get('PRC_desc'));
738 738
 						$ticket->save();
739 739
 					}
740 740
 				} else {
741 741
 					//we make sure this price is attached to base ticket. but ONLY if its not a tax ticket type.
742 742
 					$ticket = EEM_Ticket::instance()->get_one_by_ID(1);
743
-					$ticket->_add_relation_to( $PRC_ID, 'Price' );
743
+					$ticket->_add_relation_to($PRC_ID, 'Price');
744 744
 					$ticket->save();
745 745
 				}
746 746
 			}
@@ -748,9 +748,9 @@  discard block
 block discarded – undo
748 748
 			$action_desc = 'updated';
749 749
 		}
750 750
 
751
-		$query_args = array( 'action' => 'edit_price', 'id' => $PRC_ID );
751
+		$query_args = array('action' => 'edit_price', 'id' => $PRC_ID);
752 752
 
753
-		$this->_redirect_after_action( $success, 'Prices', $action_desc, $query_args );
753
+		$this->_redirect_after_action($success, 'Prices', $action_desc, $query_args);
754 754
 
755 755
 	}
756 756
 
@@ -764,12 +764,12 @@  discard block
 block discarded – undo
764 764
 	*		@access protected
765 765
 	*		@return void
766 766
 	*/
767
-	protected function _trash_or_restore_price( $trash = TRUE ) {
767
+	protected function _trash_or_restore_price($trash = TRUE) {
768 768
 
769 769
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
770
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
770
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
771 771
 
772
-		require_once(EE_MODELS . 'EEM_Price.model.php');
772
+		require_once(EE_MODELS.'EEM_Price.model.php');
773 773
 		$PRC = EEM_Price::instance();
774 774
 
775 775
 		$success = 1;
@@ -778,18 +778,18 @@  discard block
 block discarded – undo
778 778
 		//get base ticket for updating
779 779
 		$ticket = EEM_Ticket::instance()->get_one_by_ID(1);
780 780
 		//Checkboxes
781
-		if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
781
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
782 782
 			// if array has more than one element than success message should be plural
783
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
783
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
784 784
 			// cycle thru checkboxes
785
-			while (list( $PRC_ID, $value ) = each($this->_req_data['checkbox'])) {
786
-				if ( ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), absint($PRC_ID) ) ) {
785
+			while (list($PRC_ID, $value) = each($this->_req_data['checkbox'])) {
786
+				if ( ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), absint($PRC_ID))) {
787 787
 					$success = 0;
788 788
 				} else {
789 789
 					$PR = EEM_Price::instance()->get_one_by_ID($PRC_ID);
790
-					if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) {
790
+					if ($PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax) {
791 791
 						//if trashing then remove relations to base default ticket.  If restoring then add back to base default ticket
792
-						if ( $PRC_deleted ) {
792
+						if ($PRC_deleted) {
793 793
 							$ticket->_remove_relation_to($PRC_ID, 'Price');
794 794
 						} else {
795 795
 							$ticket->_add_relation_to($PRC_ID, 'Price');
@@ -801,14 +801,14 @@  discard block
 block discarded – undo
801 801
 
802 802
 		} else {
803 803
 			// grab single id and delete
804
-			$PRC_ID = isset( $this->_req_data['id'] ) ? absint($this->_req_data['id']) : 0;
805
-			if ( empty( $PRC_ID ) || ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), $PRC_ID) ) {
804
+			$PRC_ID = isset($this->_req_data['id']) ? absint($this->_req_data['id']) : 0;
805
+			if (empty($PRC_ID) || ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), $PRC_ID)) {
806 806
 				$success = 0;
807 807
 			} else {
808 808
 				$PR = EEM_Price::instance()->get_one_by_ID($PRC_ID);
809
-				if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) {
809
+				if ($PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax) {
810 810
 					//if trashing then remove relations to base default ticket.  If restoring then add back to base default ticket
811
-					if ( $PRC_deleted ) {
811
+					if ($PRC_deleted) {
812 812
 						$ticket->_remove_relation_to($PRC_ID, 'Price');
813 813
 					} else {
814 814
 						$ticket->_add_relation_to($PRC_ID, 'Price');
@@ -822,17 +822,17 @@  discard block
 block discarded – undo
822 822
 			'action' => 'default'
823 823
 			);
824 824
 
825
-		if ( $success ) {
826
-			if ( $trash ) {
825
+		if ($success) {
826
+			if ($trash) {
827 827
 				$msg = $success == 2 ? __('The Prices have been trashed.', 'event_espresso') : __('The Price has been trashed.', 'event_espresso');
828 828
 			} else {
829 829
 				$msg = $success == 2 ? __('The Prices have been restored.', 'event_espresso') : __('The Price has been restored.', 'event_espresso');
830 830
 			}
831 831
 
832
-			EE_Error::add_success( $msg );
832
+			EE_Error::add_success($msg);
833 833
 		}
834 834
 
835
-		$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
835
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
836 836
 
837 837
 	}
838 838
 
@@ -849,19 +849,19 @@  discard block
 block discarded – undo
849 849
 	protected function _delete_price() {
850 850
 
851 851
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
852
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
852
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
853 853
 
854
-		require_once(EE_MODELS . 'EEM_Price.model.php');
854
+		require_once(EE_MODELS.'EEM_Price.model.php');
855 855
 		$PRC = EEM_Price::instance();
856 856
 
857 857
 		$success = 1;
858 858
 		//Checkboxes
859
-		if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
859
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
860 860
 			// if array has more than one element than success message should be plural
861
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
861
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
862 862
 			// cycle thru bulk action checkboxes
863
-			while (list( $PRC_ID, $value ) = each($this->_req_data['checkbox'])) {
864
-				if (!$PRC->delete_permanently_by_ID(absint($PRC_ID))) {
863
+			while (list($PRC_ID, $value) = each($this->_req_data['checkbox'])) {
864
+				if ( ! $PRC->delete_permanently_by_ID(absint($PRC_ID))) {
865 865
 					$success = 0;
866 866
 				}
867 867
 			}
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
 
876 876
 		}
877 877
 
878
-		$this->_redirect_after_action( $success, 'Prices', 'deleted', array() );
878
+		$this->_redirect_after_action($success, 'Prices', 'deleted', array());
879 879
 
880 880
 	}
881 881
 
@@ -883,16 +883,16 @@  discard block
 block discarded – undo
883 883
 
884 884
 
885 885
 	public function update_price_order() {
886
-		$success = __( 'Price order was updated successfully.', 'event_espresso' );
886
+		$success = __('Price order was updated successfully.', 'event_espresso');
887 887
 
888 888
 		// grab our row IDs
889
-		$row_ids = isset( $this->_req_data['row_ids'] ) && ! empty( $this->_req_data['row_ids'] ) ? explode( ',', rtrim( $this->_req_data['row_ids'], ',' )) : FALSE;
889
+		$row_ids = isset($this->_req_data['row_ids']) && ! empty($this->_req_data['row_ids']) ? explode(',', rtrim($this->_req_data['row_ids'], ',')) : FALSE;
890 890
 
891
-		if ( is_array( $row_ids )) {
892
-			for ( $i = 0; $i < count( $row_ids ); $i++ ) {
891
+		if (is_array($row_ids)) {
892
+			for ($i = 0; $i < count($row_ids); $i++) {
893 893
 				//Update the prices when re-ordering
894 894
 				$id = absint($row_ids[$i]);
895
-				if ( EEM_Price::instance()->update ( array( 'PRC_order' => $i+1 ), array(array( 'PRC_ID' => $id ) )) === FALSE ) {
895
+				if (EEM_Price::instance()->update(array('PRC_order' => $i + 1), array(array('PRC_ID' => $id))) === FALSE) {
896 896
 					$success = FALSE;
897 897
 				}
898 898
 			}
@@ -900,9 +900,9 @@  discard block
 block discarded – undo
900 900
 			$success = FALSE;
901 901
 		}
902 902
 
903
-		$errors = ! $success ? __( 'An error occurred. The price order was not updated.', 'event_espresso' ) : FALSE;
903
+		$errors = ! $success ? __('An error occurred. The price order was not updated.', 'event_espresso') : FALSE;
904 904
 
905
-		echo wp_json_encode( array( 'return_data' => FALSE, 'success' => $success, 'errors' => $errors ));
905
+		echo wp_json_encode(array('return_data' => FALSE, 'success' => $success, 'errors' => $errors));
906 906
 		die();
907 907
 	}
908 908
 
@@ -926,7 +926,7 @@  discard block
 block discarded – undo
926 926
 	*		@return void
927 927
 	*/
928 928
 	protected function _price_types_overview_list_table() {
929
-		$this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
929
+		$this->_admin_page_title .= ' '.$this->get_action_link_or_button(
930 930
 		    'add_new_price_type',
931 931
             'add_type',
932 932
             array(),
@@ -950,46 +950,46 @@  discard block
 block discarded – undo
950 950
 	* 	@param  boolean $trashed   whether the current view is of the trash can - eww yuck!
951 951
 	* 	@return mixed (int|array)  int = count || array of price objects
952 952
 	*/
953
-	public function get_price_types_overview_data( $per_page = 10, $count = FALSE, $trashed = FALSE ) {
953
+	public function get_price_types_overview_data($per_page = 10, $count = FALSE, $trashed = FALSE) {
954 954
 
955
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
955
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
956 956
 		// start with an empty array
957 957
 
958
-		require_once( PRICING_ADMIN . 'Price_Types_List_Table.class.php' );
959
-		require_once( EE_MODELS . 'EEM_Price_Type.model.php' );
958
+		require_once(PRICING_ADMIN.'Price_Types_List_Table.class.php');
959
+		require_once(EE_MODELS.'EEM_Price_Type.model.php');
960 960
 
961 961
 		$this->_req_data['orderby'] = empty($this->_req_data['orderby']) ? '' : $this->_req_data['orderby'];
962
-		$order = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC';
962
+		$order = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC';
963 963
 		switch ($this->_req_data['orderby']) {
964 964
 			case 'name':
965
-				$orderby = array( 'PRT_name' => $order);
965
+				$orderby = array('PRT_name' => $order);
966 966
 				break;
967 967
 			default:
968
-				$orderby = array( 'PRT_order' => $order);
968
+				$orderby = array('PRT_order' => $order);
969 969
 		}
970 970
 
971 971
 
972
-		$current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1;
973
-		$per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page;
972
+		$current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1;
973
+		$per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page;
974 974
 
975
-		$offset = ($current_page-1)*$per_page;
976
-		$limit = array( $offset, $per_page );
975
+		$offset = ($current_page - 1) * $per_page;
976
+		$limit = array($offset, $per_page);
977 977
 
978
-		$_where = array('PRT_deleted'=>$trashed, 'PBT_ID' => array('!=', 1 ) );
978
+		$_where = array('PRT_deleted'=>$trashed, 'PBT_ID' => array('!=', 1));
979 979
 
980
-		if ( isset( $this->_req_data['s'] ) ) {
981
-			$sstr = '%' . $this->_req_data['s'] . '%';
980
+		if (isset($this->_req_data['s'])) {
981
+			$sstr = '%'.$this->_req_data['s'].'%';
982 982
 			$_where['OR'] = array(
983
-				'PRT_name' => array( 'LIKE', $sstr )
983
+				'PRT_name' => array('LIKE', $sstr)
984 984
 				);
985 985
 		}
986 986
 		$query_params = array(
987 987
 			$_where,
988 988
 			'order_by'=>$orderby,
989 989
 			'limit'=>$limit);
990
-		if($count){
990
+		if ($count) {
991 991
 			return EEM_Price_Type::instance()->count_deleted_and_undeleted($query_params);
992
-		}else{
992
+		} else {
993 993
 			return EEM_Price_Type::instance()->get_all_deleted_and_undeleted($query_params);
994 994
 		}
995 995
 
@@ -1009,34 +1009,34 @@  discard block
 block discarded – undo
1009 1009
 	*/
1010 1010
 	protected function _edit_price_type_details() {
1011 1011
 
1012
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1012
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1013 1013
 
1014 1014
 
1015 1015
 		// grab price type ID
1016
-		$PRT_ID = isset( $this->_req_data['id'] ) && ! empty( $this->_req_data['id'] ) ? absint( $this->_req_data['id'] ) : FALSE;
1016
+		$PRT_ID = isset($this->_req_data['id']) && ! empty($this->_req_data['id']) ? absint($this->_req_data['id']) : FALSE;
1017 1017
 		// change page title based on request action
1018
-		switch( $this->_req_action ) {
1018
+		switch ($this->_req_action) {
1019 1019
 			case 'add_new_price_type' :
1020
-				$this->_admin_page_title = esc_html__( 'Add New Price Type', 'event_espresso' );
1020
+				$this->_admin_page_title = esc_html__('Add New Price Type', 'event_espresso');
1021 1021
 				break;
1022 1022
 			case 'edit_price_type' :
1023
-				$this->_admin_page_title = esc_html__( 'Edit Price Type', 'event_espresso' );
1023
+				$this->_admin_page_title = esc_html__('Edit Price Type', 'event_espresso');
1024 1024
 				break;
1025 1025
 			default :
1026
-				$this->_admin_page_title = ucwords( str_replace( '_', ' ', $this->_req_action ));
1026
+				$this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action));
1027 1027
 		}
1028 1028
 		// add PRT_ID to title if editing
1029
-		$this->_admin_page_title = $PRT_ID ? $this->_admin_page_title . ' # ' . $PRT_ID : $this->_admin_page_title;
1029
+		$this->_admin_page_title = $PRT_ID ? $this->_admin_page_title.' # '.$PRT_ID : $this->_admin_page_title;
1030 1030
 
1031 1031
 //		require_once(EE_MODELS . 'EEM_Price_Type.model.php');
1032 1032
 
1033
-		if ( $PRT_ID ) {
1034
-			$price_type = EEM_Price_Type::instance()->get_one_by_ID( $PRT_ID );
1035
-			$additional_hidden_fields = array( 'PRT_ID' => array( 'type' => 'hidden', 'value' => $PRT_ID ));
1036
-			$this->_set_add_edit_form_tags( 'update_price_type', $additional_hidden_fields );
1033
+		if ($PRT_ID) {
1034
+			$price_type = EEM_Price_Type::instance()->get_one_by_ID($PRT_ID);
1035
+			$additional_hidden_fields = array('PRT_ID' => array('type' => 'hidden', 'value' => $PRT_ID));
1036
+			$this->_set_add_edit_form_tags('update_price_type', $additional_hidden_fields);
1037 1037
 		} else {
1038 1038
 			$price_type = EEM_Price_Type::instance()->get_new_price_type();
1039
-			$this->_set_add_edit_form_tags( 'insert_price_type' );
1039
+			$this->_set_add_edit_form_tags('insert_price_type');
1040 1040
 		}
1041 1041
 
1042 1042
 		$this->_template_args['PRT_ID'] = $PRT_ID;
@@ -1045,19 +1045,19 @@  discard block
 block discarded – undo
1045 1045
 
1046 1046
 		$base_types = EEM_Price_Type::instance()->get_base_types();
1047 1047
 		$select_values = array();
1048
-		foreach ( $base_types as $ref => $text ) {
1049
-			if ( $ref == EEM_Price_Type::base_type_base_price ) {
1048
+		foreach ($base_types as $ref => $text) {
1049
+			if ($ref == EEM_Price_Type::base_type_base_price) {
1050 1050
 				//do not allow creation of base_type_base_prices because that's a system only base type.
1051 1051
 				continue;
1052 1052
 			}
1053
-			$values[] = array( 'id' => $ref, 'text' => $text );
1053
+			$values[] = array('id' => $ref, 'text' => $text);
1054 1054
 		}
1055 1055
 
1056 1056
 
1057 1057
 		$this->_template_args['base_type_select'] = EEH_Form_Fields::select_input('base_type', $values, $price_type->base_type(), 'id="price-type-base-type-slct"');
1058 1058
 		$this->_template_args['learn_more_about_pricing_link'] = $this->_learn_more_about_pricing_link();
1059
-		$redirect_URL = add_query_arg( array( 'action' => 'price_types'), $this->_admin_base_url );
1060
-		$this->_set_publish_post_box_vars( 'id', $PRT_ID, FALSE, $redirect_URL );
1059
+		$redirect_URL = add_query_arg(array('action' => 'price_types'), $this->_admin_base_url);
1060
+		$this->_set_publish_post_box_vars('id', $PRT_ID, FALSE, $redirect_URL);
1061 1061
 		// the details template wrapper
1062 1062
 		$this->display_admin_page_with_sidebar();
1063 1063
 
@@ -1074,7 +1074,7 @@  discard block
 block discarded – undo
1074 1074
 	*		@return void
1075 1075
 	*/
1076 1076
 	protected function _price_type_details_meta_boxes() {
1077
-		add_meta_box( 'edit-price-details-mbox', __( 'Price Type Details', 'event_espresso' ), array( $this, '_edit_price_type_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' );
1077
+		add_meta_box('edit-price-details-mbox', __('Price Type Details', 'event_espresso'), array($this, '_edit_price_type_details_meta_box'), $this->wp_page_slug, 'normal', 'high');
1078 1078
 	}
1079 1079
 
1080 1080
 
@@ -1087,7 +1087,7 @@  discard block
 block discarded – undo
1087 1087
 	*		@return void
1088 1088
 	*/
1089 1089
 	public function _edit_price_type_details_meta_box() {
1090
-		echo EEH_Template::display_template( PRICING_TEMPLATE_PATH . 'pricing_type_details_main_meta_box.template.php', $this->_template_args, TRUE );
1090
+		echo EEH_Template::display_template(PRICING_TEMPLATE_PATH.'pricing_type_details_main_meta_box.template.php', $this->_template_args, TRUE);
1091 1091
 	}
1092 1092
 
1093 1093
 
@@ -1100,9 +1100,9 @@  discard block
 block discarded – undo
1100 1100
 	*/
1101 1101
 	protected function set_price_type_column_values() {
1102 1102
 
1103
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1103
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1104 1104
 
1105
-		$base_type = !empty( $this->_req_data['base_type'] ) ? $this->_req_data['base_type'] : EEM_Price_Type::base_type_base_price;
1105
+		$base_type = ! empty($this->_req_data['base_type']) ? $this->_req_data['base_type'] : EEM_Price_Type::base_type_base_price;
1106 1106
 
1107 1107
 		switch ($base_type) {
1108 1108
 
@@ -1149,12 +1149,12 @@  discard block
 block discarded – undo
1149 1149
 	*		@access protected
1150 1150
 	*		@return void
1151 1151
 	*/
1152
-	protected function _insert_or_update_price_type( $new_price_type = FALSE ) {
1152
+	protected function _insert_or_update_price_type($new_price_type = FALSE) {
1153 1153
 
1154 1154
 //		echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
1155
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1155
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1156 1156
 
1157
-		require_once(EE_MODELS . 'EEM_Price_Type.model.php');
1157
+		require_once(EE_MODELS.'EEM_Price_Type.model.php');
1158 1158
 		$PRT = EEM_Price_Type::instance();
1159 1159
 
1160 1160
 		// why be so pessimistic ???  : (
@@ -1162,24 +1162,24 @@  discard block
 block discarded – undo
1162 1162
 
1163 1163
 		$set_column_values = $this->set_price_type_column_values();
1164 1164
 		// is this a new Price ?
1165
-		if ( $new_price_type ) {
1165
+		if ($new_price_type) {
1166 1166
 			// run the insert
1167
-			if ( $PRT_ID = $PRT->insert( $set_column_values )) {
1167
+			if ($PRT_ID = $PRT->insert($set_column_values)) {
1168 1168
 				$success = 1;
1169 1169
 			}
1170 1170
 			$action_desc = 'created';
1171 1171
 		} else {
1172 1172
 			$PRT_ID = absint($this->_req_data['PRT_ID']);
1173 1173
 			// run the update
1174
-			$where_cols_n_values = array('PRT_ID' => $PRT_ID );
1175
-			if ( $PRT->update( $set_column_values, array( $where_cols_n_values ))) {
1174
+			$where_cols_n_values = array('PRT_ID' => $PRT_ID);
1175
+			if ($PRT->update($set_column_values, array($where_cols_n_values))) {
1176 1176
 				$success = 1;
1177 1177
 			}
1178 1178
 			$action_desc = 'updated';
1179 1179
 		}
1180 1180
 
1181
-		$query_args = array( 'action'=> 'edit_price_type', 'id' => $PRT_ID );
1182
-		$this->_redirect_after_action( $success, 'Price Type', $action_desc, $query_args );
1181
+		$query_args = array('action'=> 'edit_price_type', 'id' => $PRT_ID);
1182
+		$this->_redirect_after_action($success, 'Price Type', $action_desc, $query_args);
1183 1183
 
1184 1184
 	}
1185 1185
 
@@ -1193,49 +1193,49 @@  discard block
 block discarded – undo
1193 1193
 	*		@access protected
1194 1194
 	*		@return void
1195 1195
 	*/
1196
-	protected function _trash_or_restore_price_type( $trash = TRUE ) {
1196
+	protected function _trash_or_restore_price_type($trash = TRUE) {
1197 1197
 
1198 1198
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
1199
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1199
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1200 1200
 
1201
-		require_once(EE_MODELS . 'EEM_Price_Type.model.php');
1201
+		require_once(EE_MODELS.'EEM_Price_Type.model.php');
1202 1202
 		$PRT = EEM_Price_Type::instance();
1203 1203
 
1204 1204
 		$success = 1;
1205 1205
 		$PRT_deleted = $trash ? TRUE : FALSE;
1206 1206
 		//Checkboxes
1207
-		if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1207
+		if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) {
1208 1208
 			// if array has more than one element than success message should be plural
1209
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
1210
-			$what = count( $this->_req_data['checkbox'] ) > 1 ? 'Price Types' : 'Price Type';
1209
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
1210
+			$what = count($this->_req_data['checkbox']) > 1 ? 'Price Types' : 'Price Type';
1211 1211
 			// cycle thru checkboxes
1212
-			while (list( $PRT_ID, $value ) = each($this->_req_data['checkbox'])) {
1213
-				if ( ! $PRT->update_by_ID(array('PRT_deleted' => $PRT_deleted), $PRT_ID ) ) {
1212
+			while (list($PRT_ID, $value) = each($this->_req_data['checkbox'])) {
1213
+				if ( ! $PRT->update_by_ID(array('PRT_deleted' => $PRT_deleted), $PRT_ID)) {
1214 1214
 					$success = 0;
1215 1215
 				}
1216 1216
 			}
1217 1217
 
1218 1218
 		} else {
1219 1219
 			// grab single id and delete
1220
-			$PRT_ID = isset( $this->_req_data['id'] ) ? absint($this->_req_data['id']) : 0;
1221
-			if ( empty( $PRT_ID ) || ! $PRT->update_by_ID(array('PRT_deleted' => $PRT_deleted), $PRT_ID )) {
1220
+			$PRT_ID = isset($this->_req_data['id']) ? absint($this->_req_data['id']) : 0;
1221
+			if (empty($PRT_ID) || ! $PRT->update_by_ID(array('PRT_deleted' => $PRT_deleted), $PRT_ID)) {
1222 1222
 				$success = 0;
1223 1223
 			}
1224 1224
 			$what = 'Price Type';
1225 1225
 
1226 1226
 		}
1227 1227
 
1228
-		$query_args = array( 'action' => 'price_types' );
1229
-		if ( $success ) {
1230
-			if ( $trash ) {
1228
+		$query_args = array('action' => 'price_types');
1229
+		if ($success) {
1230
+			if ($trash) {
1231 1231
 				$msg = $success > 1 ? __('The Price Types have been trashed.', 'event_espresso') : __('The Price Type has been trashed.', 'event_espresso');
1232 1232
 			} else {
1233 1233
 				$msg = $success > 1 ? __('The Price Types have been restored.', 'event_espresso') : __('The Price Type has been restored.', 'event_espresso');
1234 1234
 			}
1235
-			EE_Error::add_success( $msg );
1235
+			EE_Error::add_success($msg);
1236 1236
 		}
1237 1237
 
1238
-		$this->_redirect_after_action( FALSE, '', '', $query_args, TRUE );
1238
+		$this->_redirect_after_action(FALSE, '', '', $query_args, TRUE);
1239 1239
 
1240 1240
 	}
1241 1241
 
@@ -1252,19 +1252,19 @@  discard block
 block discarded – undo
1252 1252
 	protected function _delete_price_type() {
1253 1253
 
1254 1254
 		//echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>';
1255
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
1255
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1256 1256
 
1257 1257
 		$PRT = EEM_Price_Type::instance();
1258 1258
 
1259 1259
 		$success = 1;
1260 1260
 		//Checkboxes
1261
-		if (!empty($this->_req_data['checkbox'])) {
1261
+		if ( ! empty($this->_req_data['checkbox'])) {
1262 1262
 			// if array has more than one element than success message should be plural
1263
-			$success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1;
1263
+			$success = count($this->_req_data['checkbox']) > 1 ? 2 : 1;
1264 1264
 			$what = $PRT->item_name($success);
1265 1265
 			// cycle thru bulk action checkboxes
1266
-			while (list( $PRT_ID, $value ) = each($this->_req_data['checkbox'])) {
1267
-				if (!$PRT->delete_permanently_by_ID($PRT_ID) ) {
1266
+			while (list($PRT_ID, $value) = each($this->_req_data['checkbox'])) {
1267
+				if ( ! $PRT->delete_permanently_by_ID($PRT_ID)) {
1268 1268
 					$success = 0;
1269 1269
 				}
1270 1270
 			}
@@ -1272,8 +1272,8 @@  discard block
 block discarded – undo
1272 1272
 		}
1273 1273
 
1274 1274
 
1275
-		$query_args = array( 'action'=> 'price_types' );
1276
-		$this->_redirect_after_action( $success, $what, 'deleted', $query_args );
1275
+		$query_args = array('action'=> 'price_types');
1276
+		$this->_redirect_after_action($success, $what, 'deleted', $query_args);
1277 1277
 
1278 1278
 	}
1279 1279
 
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
 	*		@return string
1290 1290
 	*/
1291 1291
 	protected function _learn_more_about_pricing_link() {
1292
-		return '<a class="hidden" style="margin:0 20px; cursor:pointer; font-size:12px;" >' . __('learn more about how pricing works', 'event_espresso') . '</a>';
1292
+		return '<a class="hidden" style="margin:0 20px; cursor:pointer; font-size:12px;" >'.__('learn more about how pricing works', 'event_espresso').'</a>';
1293 1293
 	}
1294 1294
 
1295 1295
 
@@ -1365,17 +1365,17 @@  discard block
 block discarded – undo
1365 1365
 	 * @return void
1366 1366
 	 */
1367 1367
 	public function _update_tax_settings() {
1368
-		if ( ! isset( EE_Registry::instance()->CFG->tax_settings ) ) {
1368
+		if ( ! isset(EE_Registry::instance()->CFG->tax_settings)) {
1369 1369
 			EE_Registry::instance()->CFG->tax_settings = new EE_Tax_Config();
1370 1370
 		}
1371 1371
 		try {
1372 1372
 			$tax_form = $this->tax_settings_form();
1373 1373
 			//check for form submission
1374
-			if ( $tax_form->was_submitted() ) {
1374
+			if ($tax_form->was_submitted()) {
1375 1375
 				//capture form data
1376 1376
 				$tax_form->receive_form_submission();
1377 1377
 				//validate form data
1378
-				if ( $tax_form->is_valid() ) {
1378
+				if ($tax_form->is_valid()) {
1379 1379
 					//grab validated data from form
1380 1380
 					$valid_data = $tax_form->valid_data();
1381 1381
 					//set data on config
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
 						->prices_displayed_including_taxes
1386 1386
 						= $valid_data['tax_settings']['prices_displayed_including_taxes'];
1387 1387
 				} else {
1388
-					if ( $tax_form->submission_error_message() !== '' ) {
1388
+					if ($tax_form->submission_error_message() !== '') {
1389 1389
 						EE_Error::add_error(
1390 1390
 							$tax_form->submission_error_message(),
1391 1391
 							__FILE__,
@@ -1395,8 +1395,8 @@  discard block
 block discarded – undo
1395 1395
 					}
1396 1396
 				}
1397 1397
 			}
1398
-		} catch ( EE_Error $e ) {
1399
-			EE_Error::add_error( $e->get_error(), __FILE__, __FUNCTION__, __LINE__ );
1398
+		} catch (EE_Error $e) {
1399
+			EE_Error::add_error($e->get_error(), __FILE__, __FUNCTION__, __LINE__);
1400 1400
 		}
1401 1401
 
1402 1402
 		$what = 'Tax Settings';
@@ -1407,7 +1407,7 @@  discard block
 block discarded – undo
1407 1407
 			__FUNCTION__,
1408 1408
 			__LINE__
1409 1409
 		);
1410
-		$this->_redirect_after_action( $success, $what, 'updated', array( 'action' => 'tax_settings' ) );
1410
+		$this->_redirect_after_action($success, $what, 'updated', array('action' => 'tax_settings'));
1411 1411
 	}
1412 1412
 
1413 1413
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
@@ -545,7 +547,7 @@  discard block
 block discarded – undo
545 547
 
546 548
 		if($count){
547 549
 			return $trashed ? EEM_Price::instance()->count( array( $_where ) ) : EEM_Price::instance()->count_deleted_and_undeleted(array($_where));
548
-		}else{
550
+		} else{
549 551
 			return EEM_Price::instance()->get_all_deleted_and_undeleted($query_params);
550 552
 		}
551 553
 	}
@@ -989,7 +991,7 @@  discard block
 block discarded – undo
989 991
 			'limit'=>$limit);
990 992
 		if($count){
991 993
 			return EEM_Price_Type::instance()->count_deleted_and_undeleted($query_params);
992
-		}else{
994
+		} else{
993 995
 			return EEM_Price_Type::instance()->get_all_deleted_and_undeleted($query_params);
994 996
 		}
995 997
 
Please login to merge, or discard this patch.
admin_pages/payments/Payments_Admin_Page_Init.core.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 use EventEspresso\core\services\database\TableAnalysis;
3
-if (!defined('EVENT_ESPRESSO_VERSION') ){
3
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
4 4
 	exit('NO direct script access allowed');
5 5
 }
6 6
 /**
@@ -27,18 +27,18 @@  discard block
 block discarded – undo
27 27
 	 */
28 28
 	public function __construct() {
29 29
 		//define some page related constants
30
-		define( 'EE_PAYMENTS_PG_SLUG', 'espresso_payment_settings' );
31
-		define( 'EE_PAYMENTS_ADMIN_URL', admin_url( 'admin.php?page=' . EE_PAYMENTS_PG_SLUG ));
32
-		define( 'EE_PAYMENTS_ADMIN', EE_ADMIN_PAGES . 'payments' . DS );
33
-		define( 'EE_PAYMENTS_TEMPLATE_PATH', EE_PAYMENTS_ADMIN . 'templates' . DS );
34
-		define( 'EE_PAYMENTS_ASSETS_URL', EE_ADMIN_PAGES_URL . 'payments/assets/' );
35
-		$this->_table_analysis = EE_Registry::instance()->create( 'TableAnalysis', array(), true );
30
+		define('EE_PAYMENTS_PG_SLUG', 'espresso_payment_settings');
31
+		define('EE_PAYMENTS_ADMIN_URL', admin_url('admin.php?page='.EE_PAYMENTS_PG_SLUG));
32
+		define('EE_PAYMENTS_ADMIN', EE_ADMIN_PAGES.'payments'.DS);
33
+		define('EE_PAYMENTS_TEMPLATE_PATH', EE_PAYMENTS_ADMIN.'templates'.DS);
34
+		define('EE_PAYMENTS_ASSETS_URL', EE_ADMIN_PAGES_URL.'payments/assets/');
35
+		$this->_table_analysis = EE_Registry::instance()->create('TableAnalysis', array(), true);
36 36
 		//check that there are active gateways on all admin page loads. but dont do it just yet
37 37
 //		echo "constructing payments admin page";die;
38
-		add_action('admin_notices',array($this,'check_payment_gateway_setup'));
38
+		add_action('admin_notices', array($this, 'check_payment_gateway_setup'));
39 39
 
40 40
 		// Show/hide PP Standard along side PP Express.
41
-		add_filter( 'FHEE__Payments_Admin_Page___payment_methods_list__payment_methods', array( $this, 'unset_pp_standard' ) );
41
+		add_filter('FHEE__Payments_Admin_Page___payment_methods_list__payment_methods', array($this, 'unset_pp_standard'));
42 42
 
43 43
 		parent::__construct();
44 44
 	}
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 				'show_on_menu'    => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY,
63 63
 				'parent_slug'     => 'espresso_events',
64 64
 				'menu_slug'       => EE_PAYMENTS_PG_SLUG,
65
-				'menu_label'      => __( 'Payment Methods', 'event_espresso' ),
65
+				'menu_label'      => __('Payment Methods', 'event_espresso'),
66 66
 				'capability'      => 'ee_manage_gateways',
67 67
 				'admin_init_page' => $this,
68 68
 			)
@@ -76,25 +76,25 @@  discard block
 block discarded – undo
76 76
 	 *
77 77
 	 * @throws \EE_Error
78 78
 	 */
79
-	public function check_payment_gateway_setup(){
79
+	public function check_payment_gateway_setup() {
80 80
 		//ONLY do this check if models can query
81 81
 		//and avoid a bug where when we nuke EE4's data that this causes a fatal error
82 82
 		//because the tables are deleted just before this request runs. see https://events.codebasehq.com/projects/event-espresso/tickets/7539
83 83
 		if (
84 84
 			! EE_Maintenance_Mode::instance()->models_can_query()
85
-			|| ! $this->_get_table_analysis()->tableExists( EEM_Payment_Method::instance()->table() )
85
+			|| ! $this->_get_table_analysis()->tableExists(EEM_Payment_Method::instance()->table())
86 86
 		) {
87 87
 			return;
88 88
 		}
89 89
 
90 90
 
91 91
 		// ensure Payment_Method model is loaded
92
-		EE_Registry::instance()->load_model( 'Payment_Method' );
93
-		$actives = EEM_Payment_Method::instance()->count_active( EEM_Payment_Method::scope_cart );
94
-		if( $actives  < 1 ){
92
+		EE_Registry::instance()->load_model('Payment_Method');
93
+		$actives = EEM_Payment_Method::instance()->count_active(EEM_Payment_Method::scope_cart);
94
+		if ($actives < 1) {
95 95
 			$url = EE_Admin_Page::add_query_args_and_nonce(array(), EE_PAYMENTS_ADMIN_URL);
96 96
 			echo '<div class="error">
97
-				 <p>'.  sprintf(__("There are no Active Payment Methods setup for Event Espresso. Please %s activate at least one.%s", "event_espresso"),"<a href='$url'>","</a>").'</p>
97
+				 <p>'.  sprintf(__("There are no Active Payment Methods setup for Event Espresso. Please %s activate at least one.%s", "event_espresso"), "<a href='$url'>", "</a>").'</p>
98 98
 			 </div>';
99 99
 		}
100 100
 	}
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
 	 * @throws \EE_Error
106 106
 	 */
107 107
 	protected function _get_table_analysis() {
108
-		if( $this->_table_analysis instanceof TableAnalysis ) {
108
+		if ($this->_table_analysis instanceof TableAnalysis) {
109 109
 			return $this->_table_analysis;
110 110
 		} else {
111 111
 			throw new \EE_Error( 
112 112
 				sprintf( 
113
-					__( 'Table analysis class on class %1$s is not set properly.', 'event_espresso'), 
114
-					get_class( $this ) 
113
+					__('Table analysis class on class %1$s is not set properly.', 'event_espresso'), 
114
+					get_class($this) 
115 115
 				) 
116 116
 			);
117 117
 		}
@@ -122,20 +122,20 @@  discard block
 block discarded – undo
122 122
 	/**
123 123
 	 * Hide PayPal Standard for "new" users.
124 124
 	 */
125
-	public static function unset_pp_standard( $payment_method_types ) {
126
-		$pps = EEM_Payment_Method::instance()->get_one_of_type( 'Paypal_Standard' );
127
-		$ppstandard_active = ( ! empty($pps) ) ? $pps->active() : false;
125
+	public static function unset_pp_standard($payment_method_types) {
126
+		$pps = EEM_Payment_Method::instance()->get_one_of_type('Paypal_Standard');
127
+		$ppstandard_active = ( ! empty($pps)) ? $pps->active() : false;
128 128
 		$ppstandard_active_before = false;
129
-		if ( $pps ) {
129
+		if ($pps) {
130 130
 			// PP Standard used before ?
131
-			$paypal_id = $pps->get_extra_meta( 'paypal_id', TRUE );
132
-			if ( $paypal_id && ! empty($paypal_id) ) {
131
+			$paypal_id = $pps->get_extra_meta('paypal_id', TRUE);
132
+			if ($paypal_id && ! empty($paypal_id)) {
133 133
 				$ppstandard_active_before = true;
134 134
 			}
135 135
 		}
136 136
 
137 137
 		// Not using PP Standard? Then display only PayPal Express, do not show PayPal Standard.
138
-		if ( apply_filters( 'FHEE__EE_PMT_Paypal_Express__register_payment_methods__hide_paypal_standard', ! $ppstandard_active && ! $ppstandard_active_before ) ) {
138
+		if (apply_filters('FHEE__EE_PMT_Paypal_Express__register_payment_methods__hide_paypal_standard', ! $ppstandard_active && ! $ppstandard_active_before)) {
139 139
 			unset($payment_method_types['paypal_standard']);
140 140
 		}
141 141
 		return $payment_method_types;
Please login to merge, or discard this patch.
core/admin/templates/admin_details_wrapper_no_sidebar.template.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@
 block discarded – undo
21 21
 
22 22
 
23 23
         <div id="postbox-container-2" class="postbox-container">
24
-            <?php do_meta_boxes( $current_page, 'normal', NULL ); ?>
25
-            <?php do_meta_boxes( $current_page, 'advanced', NULL ); ?>
24
+            <?php do_meta_boxes($current_page, 'normal', NULL); ?>
25
+            <?php do_meta_boxes($current_page, 'advanced', NULL); ?>
26 26
         </div>
27 27
         <!-- postbox-container-2 -->
28 28
         <div class="clear"></div>
Please login to merge, or discard this patch.
help_tabs/payment_methods_overview_paypal_express.help_tab.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <p>
2
-	<strong><?php _e( 'PayPal Express Checkout', 'event_espresso' ); ?></strong>
2
+	<strong><?php _e('PayPal Express Checkout', 'event_espresso'); ?></strong>
3 3
 </p>
4 4
 <p>
5 5
 	<?php _e('Please be sure to update the settings for the PayPal Express Checkout payment method.', 'event_espresso'); ?>
6 6
 </p>
7 7
 <p>
8
-	<?php printf( __('For more information on how to get your API credentials, please view the %1$sPayPal Documentation%2$s.', 'event_espresso'), '<a target="_blank" href="https://developer.paypal.com/docs/classic/api/apiCredentials/#create-an-api-signature">', '</a>' ); ?>
8
+	<?php printf(__('For more information on how to get your API credentials, please view the %1$sPayPal Documentation%2$s.', 'event_espresso'), '<a target="_blank" href="https://developer.paypal.com/docs/classic/api/apiCredentials/#create-an-api-signature">', '</a>'); ?>
9 9
 </p>
10 10
 
11 11
 
@@ -14,25 +14,25 @@  discard block
 block discarded – undo
14 14
 </p>
15 15
 <ul>
16 16
 	<li>
17
-		<strong><?php _e( 'API Username', 'event_espresso' ); ?></strong><br/>
18
-		<?php _e( 'Your PayPal API Username.'); ?>
17
+		<strong><?php _e('API Username', 'event_espresso'); ?></strong><br/>
18
+		<?php _e('Your PayPal API Username.'); ?>
19 19
 	</li>
20 20
 	<li>
21
-		<strong><?php _e( 'API Password', 'event_espresso' ); ?></strong><br/>
22
-		<?php _e( 'Your PayPal API Password.' ); ?>
21
+		<strong><?php _e('API Password', 'event_espresso'); ?></strong><br/>
22
+		<?php _e('Your PayPal API Password.'); ?>
23 23
 	</li>
24 24
 	<li>
25
-		<strong><?php _e( 'API Signature', 'event_espresso' ); ?></strong><br/>
26
-		<?php _e( 'Your PayPal Account Signature.' ); ?>
25
+		<strong><?php _e('API Signature', 'event_espresso'); ?></strong><br/>
26
+		<?php _e('Your PayPal Account Signature.'); ?>
27 27
 	</li>
28 28
 	<li>
29
-		<strong><?php _e( 'Request Shipping Address', 'event_espresso' ); ?></strong><br/>
30
-		<?php _e( 'Indicates whether or not you require the buyer\'s shipping address on file with PayPal be a confirmed address.' ); ?>
29
+		<strong><?php _e('Request Shipping Address', 'event_espresso'); ?></strong><br/>
30
+		<?php _e('Indicates whether or not you require the buyer\'s shipping address on file with PayPal be a confirmed address.'); ?>
31 31
 	</li>
32 32
 </ul>
33 33
 <p>
34
-	<?php printf( __('For testing please use a %1$s PaypPal Sandbox account%2$s.', 'event_espresso'), '<a target="_blank" href="https://developer.paypal.com">', '</a>' ); ?>
34
+	<?php printf(__('For testing please use a %1$s PaypPal Sandbox account%2$s.', 'event_espresso'), '<a target="_blank" href="https://developer.paypal.com">', '</a>'); ?>
35 35
 </p>
36 36
 <p>
37
-	<?php printf( __('Don\'t have PayPal? %1$sSign up for an account%2$s to get start right away.', 'event_espresso'), '<a target="_blank" href="hhttps://eventespresso.com/go/paypalstandard/">', '</a>' ); ?>
37
+	<?php printf(__('Don\'t have PayPal? %1$sSign up for an account%2$s to get start right away.', 'event_espresso'), '<a target="_blank" href="hhttps://eventespresso.com/go/paypalstandard/">', '</a>'); ?>
38 38
 </p>
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
admin_pages/general_settings/templates/countries_settings.template.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,10 +5,10 @@  discard block
 block discarded – undo
5 5
 ?>
6 6
 <div class="padding">
7 7
 
8
-	<h2 class="ee-admin-settings-hdr"><?php _e('Countries and States/Provinces', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('country_select_info');?></h2>
8
+	<h2 class="ee-admin-settings-hdr"><?php _e('Countries and States/Provinces', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('country_select_info'); ?></h2>
9 9
 	<table class="form-table">
10 10
 		<tbody>
11
-        <?php echo EEH_Form_Fields::generate_form_input( $countries ); ?>
11
+        <?php echo EEH_Form_Fields::generate_form_input($countries); ?>
12 12
 		</tbody>
13 13
 	</table>
14 14
 	<br/>
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
16 16
         <?php _e('The country that is selected above will populate the Country Details settings and the options for States/Provinces. This information will be used throughout Event Espresso including for registration purposes and how currency is displayed. If you make a change to the country on this page, it is important that you also update your Contact Information on the Your Organization tab.', 'event_espresso'); ?>
17 17
 	</p>
18 18
 	<div id="country-details-settings-dv">
19
-		<h2 class="ee-admin-settings-hdr"><?php _e('Country Details', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('country_details_info');?></h2>
19
+		<h2 class="ee-admin-settings-hdr"><?php _e('Country Details', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('country_details_info'); ?></h2>
20 20
 		<div id="country-details-dv"><?php  echo $country_details_settings; ?></div>
21 21
 	</div>
22 22
 
23 23
 	<div id="country-states-settings-dv">
24
-		<h2 class="ee-admin-settings-hdr"><?php _e( 'States/Provinces', 'event_espresso' );?> <?php echo EEH_Template::get_help_tab_link('country_states_info');?></h2>
24
+		<h2 class="ee-admin-settings-hdr"><?php _e('States/Provinces', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('country_states_info'); ?></h2>
25 25
 		<div id="country-states-dv"><?php  echo $country_states_settings; ?></div>
26 26
 	</div>
27 27
 
Please login to merge, or discard this patch.
payment_methods/Paypal_Standard/EE_Paypal_Standard_Form.form.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,11 +57,11 @@
 block discarded – undo
57 57
 
58 58
 
59 59
 
60
-    /**
61
-     * @param array $req_data
62
-     * @throws EE_Error
63
-     */
64
-    public function _normalize( $req_data ) {
60
+	/**
61
+	 * @param array $req_data
62
+	 * @throws EE_Error
63
+	 */
64
+	public function _normalize( $req_data ) {
65 65
 		parent::_normalize( $req_data );
66 66
 		$paypal_calculates_shipping = $this->get_input_value( 'paypal_shipping' );
67 67
 		$paypal_calculates_taxes = $this->get_input_value( 'paypal_taxes' );
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 
6 6
 /**
@@ -21,35 +21,35 @@  discard block
 block discarded – undo
21 21
 	/**
22 22
 	 * @param EE_PMT_Paypal_Standard $payment_method_type
23 23
 	 */
24
-	public function __construct( $payment_method_type ){
24
+	public function __construct($payment_method_type) {
25 25
 		parent::__construct(
26 26
 			array(
27 27
 				'payment_method_type'          => $payment_method_type,
28 28
 				'extra_meta_inputs'            => array(
29
-					'paypal_id'        => new EE_Text_Input( array(
30
-						'html_label_text' => sprintf( __( "Paypal Email %s", 'event_espresso' ), $payment_method_type->get_help_tab_link() ),
31
-						'html_help_text'  => __( "Typically [email protected]", 'event_espresso' ),
29
+					'paypal_id'        => new EE_Text_Input(array(
30
+						'html_label_text' => sprintf(__("Paypal Email %s", 'event_espresso'), $payment_method_type->get_help_tab_link()),
31
+						'html_help_text'  => __("Typically [email protected]", 'event_espresso'),
32 32
 						'required'        => true
33
-					) ),
34
-					'image_url'        => new EE_Admin_File_Uploader_Input( array(
35
-						'html_help_text'  => __( "Used for your business/personal logo on the PayPal page", 'event_espresso' ),
36
-						'html_label_text' => __( 'Image URL', 'event_espresso' )
37
-					) ),
38
-					'paypal_taxes'     => new EE_Yes_No_Input( array(
39
-						'html_label_text' => sprintf( __( 'Paypal Calculates Taxes %s', 'event_espresso' ), $payment_method_type->get_help_tab_link() ),
40
-						'html_help_text'  => __( 'Whether Paypal should add taxes to the order', 'event_espresso' ),
33
+					)),
34
+					'image_url'        => new EE_Admin_File_Uploader_Input(array(
35
+						'html_help_text'  => __("Used for your business/personal logo on the PayPal page", 'event_espresso'),
36
+						'html_label_text' => __('Image URL', 'event_espresso')
37
+					)),
38
+					'paypal_taxes'     => new EE_Yes_No_Input(array(
39
+						'html_label_text' => sprintf(__('Paypal Calculates Taxes %s', 'event_espresso'), $payment_method_type->get_help_tab_link()),
40
+						'html_help_text'  => __('Whether Paypal should add taxes to the order', 'event_espresso'),
41 41
 						'default'         => false
42
-					) ),
43
-					'paypal_shipping'  => new EE_Yes_No_Input( array(
44
-						'html_label_text' => sprintf( __( 'Paypal Calculates Shipping %s', 'event_espresso' ), $payment_method_type->get_help_tab_link() ),
45
-						'html_help_text'  => __( 'Whether Paypal should add shipping surcharges', 'event_espresso' ),
42
+					)),
43
+					'paypal_shipping'  => new EE_Yes_No_Input(array(
44
+						'html_label_text' => sprintf(__('Paypal Calculates Shipping %s', 'event_espresso'), $payment_method_type->get_help_tab_link()),
45
+						'html_help_text'  => __('Whether Paypal should add shipping surcharges', 'event_espresso'),
46 46
 						'default'         => false
47
-					) ),
48
-					'shipping_details' => new EE_Select_Input( array(
49
-						EE_PMT_Paypal_Standard::shipping_info_none     => __( "Do not prompt for an address", 'event_espresso' ),
50
-						EE_PMT_Paypal_Standard::shipping_info_optional => __( "Prompt for an address, but do not require it", 'event_espresso' ),
51
-						EE_PMT_Paypal_Standard::shipping_info_required => __( "Prompt for an address, and require it", 'event_espresso' )
52
-					) )
47
+					)),
48
+					'shipping_details' => new EE_Select_Input(array(
49
+						EE_PMT_Paypal_Standard::shipping_info_none     => __("Do not prompt for an address", 'event_espresso'),
50
+						EE_PMT_Paypal_Standard::shipping_info_optional => __("Prompt for an address, but do not require it", 'event_espresso'),
51
+						EE_PMT_Paypal_Standard::shipping_info_required => __("Prompt for an address, and require it", 'event_espresso')
52
+					))
53 53
 				)
54 54
 			)
55 55
 		);
@@ -61,28 +61,28 @@  discard block
 block discarded – undo
61 61
      * @param array $req_data
62 62
      * @throws EE_Error
63 63
      */
64
-    public function _normalize( $req_data ) {
65
-		parent::_normalize( $req_data );
66
-		$paypal_calculates_shipping = $this->get_input_value( 'paypal_shipping' );
67
-		$paypal_calculates_taxes = $this->get_input_value( 'paypal_taxes' );
68
-		$paypal_requests_address_info = $this->get_input_value( 'shipping_details' );
64
+    public function _normalize($req_data) {
65
+		parent::_normalize($req_data);
66
+		$paypal_calculates_shipping = $this->get_input_value('paypal_shipping');
67
+		$paypal_calculates_taxes = $this->get_input_value('paypal_taxes');
68
+		$paypal_requests_address_info = $this->get_input_value('shipping_details');
69 69
 		if (
70
-			( $paypal_calculates_shipping || $paypal_calculates_taxes ) &&
70
+			($paypal_calculates_shipping || $paypal_calculates_taxes) &&
71 71
 			$paypal_requests_address_info == EE_PMT_Paypal_Standard::shipping_info_none
72 72
 		) {
73 73
 			//they want paypal to calculate taxes or shipping. They need to ask for
74 74
 			//address info, otherwise paypal can't calculate taxes or shipping
75 75
 			/** @type EE_Select_Input $shipping_details_input */
76
-			$shipping_details_input = $this->get_input( 'shipping_details' );
77
-			$shipping_details_input->set_default( EE_PMT_Paypal_Standard::shipping_info_optional );
76
+			$shipping_details_input = $this->get_input('shipping_details');
77
+			$shipping_details_input->set_default(EE_PMT_Paypal_Standard::shipping_info_optional);
78 78
 			$shipping_details_input_options = $shipping_details_input->options();
79 79
 			EE_Error::add_attention(
80 80
 				sprintf(
81
-					__( 'Automatically set "%s" to "%s" because Paypal requires address info in order to calculate shipping or taxes.', 'event_espresso' ),
82
-					strip_tags( $shipping_details_input->html_label_text() ),
83
-					isset( $shipping_details_input_options[ EE_PMT_Paypal_Standard::shipping_info_optional ] )
84
-						? $shipping_details_input_options[ EE_PMT_Paypal_Standard::shipping_info_optional ]
85
-						: __( 'Unknown', 'event_espresso' )
81
+					__('Automatically set "%s" to "%s" because Paypal requires address info in order to calculate shipping or taxes.', 'event_espresso'),
82
+					strip_tags($shipping_details_input->html_label_text()),
83
+					isset($shipping_details_input_options[EE_PMT_Paypal_Standard::shipping_info_optional])
84
+						? $shipping_details_input_options[EE_PMT_Paypal_Standard::shipping_info_optional]
85
+						: __('Unknown', 'event_espresso')
86 86
 				),
87 87
 				__FILE__, __FUNCTION__, __LINE__
88 88
 			);
Please login to merge, or discard this patch.
core/domain/services/capabilities/RequiresCapCheckInterface.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@
 block discarded – undo
16 16
 interface RequiresCapCheckInterface
17 17
 {
18 18
 
19
-    /**
20
-     * @return CapCheckInterface
21
-     */
22
-    public function getCapCheck();
19
+	/**
20
+	 * @return CapCheckInterface
21
+	 */
22
+	public function getCapCheck();
23 23
 
24 24
 }
25 25
 // End of file RequiresCapCheckInterface.php
Please login to merge, or discard this patch.