Completed
Branch FET-9046-messages-queue (bdca24)
by
unknown
547:25 queued 529:16
created
modules/feeds/templates/espresso_venues_feed.template.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * This template will display venue details for your RSS feed
4
- *
5
- * @ package		Event Espresso
6
- * @ author		Seth Shoultes
7
- * @ copyright	(c) 2008-2013 Event Espresso  All Rights Reserved.
8
- * @ license		http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
9
- * @ link			http://www.eventespresso.com
10
- * @ version		4+
11
- */
3
+  * This template will display venue details for your RSS feed
4
+  *
5
+  * @ package		Event Espresso
6
+  * @ author		Seth Shoultes
7
+  * @ copyright	(c) 2008-2013 Event Espresso  All Rights Reserved.
8
+  * @ license		http://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
9
+  * @ link			http://www.eventespresso.com
10
+  * @ version		4+
11
+  */
12 12
  ?>
13 13
 <p><?php  _e( 'Organizer Name: ', 'event_espresso' ) . espresso_organization_name( $VNU_ID ); ?><br/>
14 14
 <?php  _e( 'Organizer Email: ', 'event_espresso' ) . espresso_organization_email( $VNU_ID ); ?><br/>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@
 block discarded – undo
10 10
  * @ version		4+
11 11
  */
12 12
  ?>
13
-<p><?php  _e( 'Organizer Name: ', 'event_espresso' ) . espresso_organization_name( $VNU_ID ); ?><br/>
14
-<?php  _e( 'Organizer Email: ', 'event_espresso' ) . espresso_organization_email( $VNU_ID ); ?><br/>
15
-<?php  _e( 'Venue Phone: ', 'event_espresso' ) . espresso_venue_phone( $VNU_ID ); ?></p>
16
-<p><?php  _e( 'Categories: ', 'event_espresso' ) . espresso_venue_categories( $VNU_ID );?></p>
17
-<p><?php  _e( 'Address: ', 'event_espresso' ) . espresso_venue_address( $VNU_ID );?></p>
18
-<p><?php  _e( 'Website: ', 'event_espresso' ) . espresso_venue_website( $VNU_ID );?></p>
19
-<p><?php  echo __( 'Description: ', 'event_espresso' )  . $venue_description; ?></p><br/>
13
+<p><?php  _e('Organizer Name: ', 'event_espresso').espresso_organization_name($VNU_ID); ?><br/>
14
+<?php  _e('Organizer Email: ', 'event_espresso').espresso_organization_email($VNU_ID); ?><br/>
15
+<?php  _e('Venue Phone: ', 'event_espresso').espresso_venue_phone($VNU_ID); ?></p>
16
+<p><?php  _e('Categories: ', 'event_espresso').espresso_venue_categories($VNU_ID); ?></p>
17
+<p><?php  _e('Address: ', 'event_espresso').espresso_venue_address($VNU_ID); ?></p>
18
+<p><?php  _e('Website: ', 'event_espresso').espresso_venue_website($VNU_ID); ?></p>
19
+<p><?php  echo __('Description: ', 'event_espresso').$venue_description; ?></p><br/>
20 20
  
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
modules/gateways/Invoice/lib/Invoice.class.php 2 patches
Braces   +10 added lines, -9 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 		//Get the CSS file
51 51
 		if( isset( $themes[ $theme_requested ] ) ) {
52 52
 			$template_args['invoice_css'] = $themes[ $theme_requested ];
53
-		}else{
53
+		} else{
54 54
 			$template_args['invoice_css'] = $this->invoice_payment_method->get_extra_meta( 'legacy_invoice_css', TRUE, 'simple.css' );
55 55
 		}
56 56
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		$attendee_state = $primary_attendee->state_obj();
79 79
 		if($attendee_state){
80 80
 			$attendee_state_name = $attendee_state->name();
81
-		}else{
81
+		} else{
82 82
 			$attendee_state_name = '';
83 83
 		}
84 84
 		$template_args['attendee_state'] = $attendee_state_name;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 			$EE->load_helper( 'Venue_View' );
150 150
 //			d($template_args);
151 151
 			$template_args['download_link'] = $this->registration->receipt_url('download');
152
-		}else{
152
+		} else{
153 153
 			//it's just an invoice we're accessing
154 154
 			$template_args['download_link'] = $this->registration->invoice_url('download');
155 155
 		}
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 		$template_header = EEH_Template::locate_template( $templates_relative_path . 'invoice_header.template.php', $template_args, TRUE, TRUE );
166 166
 		if(isset($_GET['receipt'])){
167 167
 			$template_body = EEH_Template::locate_template( $templates_relative_path . 'receipt_body.template.php', $template_args, TRUE, TRUE );
168
-		}else{
168
+		} else{
169 169
 			$template_body = EEH_Template::locate_template( $templates_relative_path . 'invoice_body.template.php', $template_args, TRUE, TRUE );
170 170
 		}
171 171
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 		//Create the PDF
191 191
 		if(array_key_exists('html',$_GET)){
192 192
 			echo $content;
193
-		}else{
193
+		} else{
194 194
 			//only load dompdf if nobody else has yet...
195 195
 			if( ! defined('DOMPDF_DIR')){
196 196
 				define('DOMPDF_ENABLE_REMOTE', TRUE);
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 	function check_if_any_line_items_have_a_description(EE_Line_Item $line_item){
215 215
 		if($line_item->desc()){
216 216
 			return true;
217
-		}else{
217
+		} else{
218 218
 			foreach($line_item->children() as $child_line_item){
219 219
 				if($this->check_if_any_line_items_have_a_description($child_line_item)){
220 220
 					return true;
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 		$org_state = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( $EE->CFG->organization->STA_ID );
259 259
 		if($org_state){
260 260
 			$org_state_name = $org_state->name();
261
-		}else{
261
+		} else{
262 262
 			$org_state_name = '';
263 263
 		}
264 264
 		$ReplaceValues = array(
@@ -285,8 +285,9 @@  discard block
 block discarded – undo
285 285
 	public function espressoLoadData($items) {
286 286
 		$lines = $items;
287 287
 		$data = array();
288
-		foreach ($lines as $line)
289
-			$data[] = explode(';', chop($line));
288
+		foreach ($lines as $line) {
289
+					$data[] = explode(';', chop($line));
290
+		}
290 291
 
291 292
 		return $data;
292 293
 	}
Please login to merge, or discard this patch.
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -21,23 +21,23 @@  discard block
 block discarded – undo
21 21
 	private $EE;
22 22
 	public function __construct($url_link = 0) {
23 23
 
24
-		if ( $this->registration = EE_Registry::instance()->load_model( 'Registration' )->get_registration_for_reg_url_link( $url_link)) {
24
+		if ($this->registration = EE_Registry::instance()->load_model('Registration')->get_registration_for_reg_url_link($url_link)) {
25 25
 			$this->transaction = $this->registration->transaction();
26 26
 
27
-			$payment_settings = EE_Config::instance()->gateway->payment_settings;//get_user_meta(EE_Registry::instance()->CFG->wp_user, 'payment_settings', TRUE);
28
-			$this->invoice_payment_method = EEM_Payment_Method::instance()->get_one_of_type( 'Invoice' );
27
+			$payment_settings = EE_Config::instance()->gateway->payment_settings; //get_user_meta(EE_Registry::instance()->CFG->wp_user, 'payment_settings', TRUE);
28
+			$this->invoice_payment_method = EEM_Payment_Method::instance()->get_one_of_type('Invoice');
29 29
 		} else {
30
-			EE_Error::add_error( __( 'Your request appears to be missing some required data, and no information for your transaction could be retrieved.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
30
+			EE_Error::add_error(__('Your request appears to be missing some required data, and no information for your transaction could be retrieved.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
31 31
 		}
32 32
 
33 33
 	}
34 34
 
35
-	public function send_invoice( $download = FALSE ) {
35
+	public function send_invoice($download = FALSE) {
36 36
 		$template_args = array();
37 37
 		$EE = EE_Registry::instance();
38 38
 
39 39
 		//allow the request to override the default theme defined in the invoice settings
40
-		$theme_requested = ( isset( $_REQUEST['theme'] ) && $_REQUEST['theme'] > 0 && $_REQUEST['theme'] < 8 ) ? absint( $_REQUEST['theme'] ) : null;
40
+		$theme_requested = (isset($_REQUEST['theme']) && $_REQUEST['theme'] > 0 && $_REQUEST['theme'] < 8) ? absint($_REQUEST['theme']) : null;
41 41
 		$themes = array(
42 42
 										1 => "simple.css",
43 43
 										2 => "bauhaus.css",
@@ -48,26 +48,26 @@  discard block
 block discarded – undo
48 48
 										7 => "union.css"
49 49
 									);
50 50
 		//Get the CSS file
51
-		if( isset( $themes[ $theme_requested ] ) ) {
52
-			$template_args['invoice_css'] = $themes[ $theme_requested ];
53
-		}else{
54
-			$template_args['invoice_css'] = $this->invoice_payment_method->get_extra_meta( 'legacy_invoice_css', TRUE, 'simple.css' );
51
+		if (isset($themes[$theme_requested])) {
52
+			$template_args['invoice_css'] = $themes[$theme_requested];
53
+		} else {
54
+			$template_args['invoice_css'] = $this->invoice_payment_method->get_extra_meta('legacy_invoice_css', TRUE, 'simple.css');
55 55
 		}
56 56
 
57
-		if (is_dir(EVENT_ESPRESSO_GATEWAY_DIR . '/invoice')) {
58
-			$template_args['base_url'] = EVENT_ESPRESSO_GATEWAY_URL . 'Invoice/lib/templates/';
57
+		if (is_dir(EVENT_ESPRESSO_GATEWAY_DIR.'/invoice')) {
58
+			$template_args['base_url'] = EVENT_ESPRESSO_GATEWAY_URL.'Invoice/lib/templates/';
59 59
 		} else {
60
-			$template_args['base_url'] = EE_GATEWAYS . '/Invoice/lib/templates/';
60
+			$template_args['base_url'] = EE_GATEWAYS.'/Invoice/lib/templates/';
61 61
 		}
62 62
 		$primary_attendee = $this->transaction->primary_registration()->attendee();
63 63
 
64
-		$template_args['organization'] = $EE->CFG->organization->get_pretty( 'name' );
65
-		$template_args['street'] = empty( $EE->CFG->organization->address_2 ) ? $EE->CFG->organization->get_pretty( 'address_1' ) : $EE->CFG->organization->get_pretty( 'address_1' ) . '<br>' . $EE->CFG->organization->get_pretty( 'address_2' );
66
-		$template_args['city'] = $EE->CFG->organization->get_pretty( 'city' );
67
-		$template_args['state'] = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( $EE->CFG->organization->STA_ID );
68
-		$template_args['country'] = EE_Registry::instance()->load_model( 'Country' )->get_one_by_ID( $EE->CFG->organization->CNT_ISO );
69
-		$template_args['zip'] = $EE->CFG->organization->get_pretty( 'zip' );
70
-		$template_args['email'] = $EE->CFG->organization->get_pretty( 'email' );
64
+		$template_args['organization'] = $EE->CFG->organization->get_pretty('name');
65
+		$template_args['street'] = empty($EE->CFG->organization->address_2) ? $EE->CFG->organization->get_pretty('address_1') : $EE->CFG->organization->get_pretty('address_1').'<br>'.$EE->CFG->organization->get_pretty('address_2');
66
+		$template_args['city'] = $EE->CFG->organization->get_pretty('city');
67
+		$template_args['state'] = EE_Registry::instance()->load_model('State')->get_one_by_ID($EE->CFG->organization->STA_ID);
68
+		$template_args['country'] = EE_Registry::instance()->load_model('Country')->get_one_by_ID($EE->CFG->organization->CNT_ISO);
69
+		$template_args['zip'] = $EE->CFG->organization->get_pretty('zip');
70
+		$template_args['email'] = $EE->CFG->organization->get_pretty('email');
71 71
 
72 72
 		$template_args['registration_code'] = $this->registration->reg_code();
73 73
 		$template_args['registration_date'] = $this->registration->date();
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
 		$template_args['attendee_address2'] = $primary_attendee->address2();
77 77
 		$template_args['attendee_city'] = $primary_attendee->city();
78 78
 		$attendee_state = $primary_attendee->state_obj();
79
-		if($attendee_state){
79
+		if ($attendee_state) {
80 80
 			$attendee_state_name = $attendee_state->name();
81
-		}else{
81
+		} else {
82 82
 			$attendee_state_name = '';
83 83
 		}
84 84
 		$template_args['attendee_state'] = $attendee_state_name;
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
 		if ($template_args['amount_pd'] != $template_args['total_cost']) {
103 103
 			//$template_args['net_total'] = $this->espressoInvoiceTotals( __('SubTotal', 'event_espresso'), $this->transaction->total());//$this->session_data['cart']['REG']['sub_total']);
104 104
 			$tax_items = $this->transaction->tax_items();
105
-			if(!empty($tax_items) ){
105
+			if ( ! empty($tax_items)) {
106 106
 				foreach ($tax_items as $tax) {
107
-					$template_args['net_total'] .= $this->espressoInvoiceTotals( $tax->name(), $tax->total());
107
+					$template_args['net_total'] .= $this->espressoInvoiceTotals($tax->name(), $tax->total());
108 108
 				}
109 109
 			}
110 110
 
@@ -114,30 +114,30 @@  discard block
 block discarded – undo
114 114
 			} else {
115 115
 				$text = __('Extra', 'event_espresso');
116 116
 			}
117
-			$template_args['discount'] = $this->espressoInvoiceTotals( $text, $difference );
117
+			$template_args['discount'] = $this->espressoInvoiceTotals($text, $difference);
118 118
 		}
119 119
 
120 120
 		$template_args['currency_symbol'] = $EE->CFG->currency->sign;
121
-		$template_args['template_payment_instructions'] = wpautop(stripslashes_deep(html_entity_decode($this->invoice_payment_method->get_extra_meta( 'pdf_instructions', TRUE ), ENT_QUOTES)));
122
-		$template_args['shameless_plug'] = apply_filters( 'FHEE_Invoice__send_invoice__shameless_plug',true );
123
-		if(isset($_GET['receipt'])){
121
+		$template_args['template_payment_instructions'] = wpautop(stripslashes_deep(html_entity_decode($this->invoice_payment_method->get_extra_meta('pdf_instructions', TRUE), ENT_QUOTES)));
122
+		$template_args['shameless_plug'] = apply_filters('FHEE_Invoice__send_invoice__shameless_plug', true);
123
+		if (isset($_GET['receipt'])) {
124 124
 			//receipt-specific stuff
125 125
 			$events_for_txn = EEM_Event::instance()->get_all(array(array('Registration.TXN_ID'=>$this->transaction->ID())));
126 126
 			$ticket_line_items_per_event = array();
127 127
 			$registrations_per_line_item = array();
128 128
 			$venues_for_events = array();
129
-			foreach($events_for_txn as $event_id => $event){
130
-				$line_items_for_this_event = EEM_Line_Item::instance()->get_all(array(array('Ticket.Datetime.EVT_ID'=>$event_id,'TXN_ID'=>$this->transaction->ID())));
129
+			foreach ($events_for_txn as $event_id => $event) {
130
+				$line_items_for_this_event = EEM_Line_Item::instance()->get_all(array(array('Ticket.Datetime.EVT_ID'=>$event_id, 'TXN_ID'=>$this->transaction->ID())));
131 131
 				$ticket_line_items_per_event[$event_id] = $line_items_for_this_event;
132
-				foreach($line_items_for_this_event as $line_item_id => $line_item){
132
+				foreach ($line_items_for_this_event as $line_item_id => $line_item) {
133 133
 					$ticket = $line_item->ticket();
134
-					$registrations_for_this_ticket = EEM_Registration::instance()->get_all(array(array('TKT_ID'=>$ticket->ID(),'TXN_ID'=>$this->transaction->ID())));
134
+					$registrations_for_this_ticket = EEM_Registration::instance()->get_all(array(array('TKT_ID'=>$ticket->ID(), 'TXN_ID'=>$this->transaction->ID())));
135 135
 					$registrations_per_line_item[$line_item_id] = $registrations_for_this_ticket;
136 136
 				}
137 137
 				$venues_for_events = array_merge($venues_for_events, $event->venues());
138 138
 			}
139
-			$tax_total_line_item = EEM_Line_Item::instance()->get_one(array(array('TXN_ID'=>$this->transaction->ID(),'LIN_type'=>  EEM_Line_Item::type_tax_sub_total)));
140
-			$questions_to_skip = array(EEM_Attendee::system_question_fname,EEM_Attendee::system_question_lname,  EEM_Attendee::system_question_email);
139
+			$tax_total_line_item = EEM_Line_Item::instance()->get_one(array(array('TXN_ID'=>$this->transaction->ID(), 'LIN_type'=>  EEM_Line_Item::type_tax_sub_total)));
140
+			$questions_to_skip = array(EEM_Attendee::system_question_fname, EEM_Attendee::system_question_lname, EEM_Attendee::system_question_email);
141 141
 
142 142
 
143 143
 			$template_args['events_for_txn'] = $events_for_txn;
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
 			$template_args['venues_for_events'] = $venues_for_events;
147 147
 			$template_args['tax_total_line_item'] = $tax_total_line_item;
148 148
 			$template_args['questions_to_skip'] = $questions_to_skip;
149
-			$EE->load_helper( 'Venue_View' );
149
+			$EE->load_helper('Venue_View');
150 150
 //			d($template_args);
151 151
 			$template_args['download_link'] = $this->registration->receipt_url('download');
152
-		}else{
152
+		} else {
153 153
 			//it's just an invoice we're accessing
154 154
 			$template_args['download_link'] = $this->registration->invoice_url('download');
155 155
 		}
@@ -157,51 +157,51 @@  discard block
 block discarded – undo
157 157
 
158 158
 
159 159
 		//require helpers
160
-		$EE->load_helper( 'Formatter' );
160
+		$EE->load_helper('Formatter');
161 161
 
162 162
 		//Get the HTML as an object
163 163
 		EE_Registry::instance()->load_helper('Template');
164 164
 		$templates_relative_path = 'modules/gateways/Invoice/lib/templates/';
165
-		$template_header = EEH_Template::locate_template( $templates_relative_path . 'invoice_header.template.php', $template_args, TRUE, TRUE );
166
-		if(isset($_GET['receipt'])){
167
-			$template_body = EEH_Template::locate_template( $templates_relative_path . 'receipt_body.template.php', $template_args, TRUE, TRUE );
168
-		}else{
169
-			$template_body = EEH_Template::locate_template( $templates_relative_path . 'invoice_body.template.php', $template_args, TRUE, TRUE );
165
+		$template_header = EEH_Template::locate_template($templates_relative_path.'invoice_header.template.php', $template_args, TRUE, TRUE);
166
+		if (isset($_GET['receipt'])) {
167
+			$template_body = EEH_Template::locate_template($templates_relative_path.'receipt_body.template.php', $template_args, TRUE, TRUE);
168
+		} else {
169
+			$template_body = EEH_Template::locate_template($templates_relative_path.'invoice_body.template.php', $template_args, TRUE, TRUE);
170 170
 		}
171 171
 
172 172
 
173
-		$template_footer = EEH_Template::locate_template( $templates_relative_path . 'invoice_footer.template.php', $template_args, TRUE, TRUE );
173
+		$template_footer = EEH_Template::locate_template($templates_relative_path.'invoice_footer.template.php', $template_args, TRUE, TRUE);
174 174
 
175
-		$copies =  ! empty( $_REQUEST['copies'] ) ? $_REQUEST['copies'] : 1;
175
+		$copies = ! empty($_REQUEST['copies']) ? $_REQUEST['copies'] : 1;
176 176
 
177 177
 		$content = $this->espresso_replace_invoice_shortcodes($template_header);
178
-		for( $x = 1; $x <= $copies; $x++ ) {
178
+		for ($x = 1; $x <= $copies; $x++) {
179 179
 			$content .= $this->espresso_replace_invoice_shortcodes($template_body);
180 180
 		}
181 181
 		$content .= $this->espresso_replace_invoice_shortcodes($template_footer);
182 182
 
183 183
 		//Check if debugging or mobile is set
184
-		if (!empty($_REQUEST['html'])) {
184
+		if ( ! empty($_REQUEST['html'])) {
185 185
 			echo $content;
186 186
 			exit(0);
187 187
 		}
188
-		$invoice_name = $template_args['organization'] . ' ' . __('Invoice #', 'event_espresso') . $template_args['registration_code'] . __(' for ', 'event_espresso') . $template_args['name'];
189
-		$invoice_name = str_replace( ' ', '_', $invoice_name );
188
+		$invoice_name = $template_args['organization'].' '.__('Invoice #', 'event_espresso').$template_args['registration_code'].__(' for ', 'event_espresso').$template_args['name'];
189
+		$invoice_name = str_replace(' ', '_', $invoice_name);
190 190
 		//Create the PDF
191
-		if(array_key_exists('html',$_GET)){
191
+		if (array_key_exists('html', $_GET)) {
192 192
 			echo $content;
193
-		}else{
193
+		} else {
194 194
 			//only load dompdf if nobody else has yet...
195
-			if( ! defined('DOMPDF_DIR')){
195
+			if ( ! defined('DOMPDF_DIR')) {
196 196
 				define('DOMPDF_ENABLE_REMOTE', TRUE);
197 197
 				define('DOMPDF_ENABLE_JAVASCRIPT', FALSE);
198 198
 				define('DOMPDF_ENABLE_CSS_FLOAT', TRUE);
199
-				require_once(EE_THIRD_PARTY . 'dompdf/dompdf_config.inc.php');
199
+				require_once(EE_THIRD_PARTY.'dompdf/dompdf_config.inc.php');
200 200
 			}
201 201
 			$dompdf = new DOMPDF();
202 202
 			$dompdf->load_html($content);
203 203
 			$dompdf->render();
204
-			$dompdf->stream($invoice_name . ".pdf", array( 'Attachment' => $download ));
204
+			$dompdf->stream($invoice_name.".pdf", array('Attachment' => $download));
205 205
 		}
206 206
 		exit(0);
207 207
 	}
@@ -211,12 +211,12 @@  discard block
 block discarded – undo
211 211
 	 * @param EE_Line_Item $line_item
212 212
 	 * @return boolean
213 213
 	 */
214
-	function check_if_any_line_items_have_a_description(EE_Line_Item $line_item){
215
-		if($line_item->desc()){
214
+	function check_if_any_line_items_have_a_description(EE_Line_Item $line_item) {
215
+		if ($line_item->desc()) {
216 216
 			return true;
217
-		}else{
218
-			foreach($line_item->children() as $child_line_item){
219
-				if($this->check_if_any_line_items_have_a_description($child_line_item)){
217
+		} else {
218
+			foreach ($line_item->children() as $child_line_item) {
219
+				if ($this->check_if_any_line_items_have_a_description($child_line_item)) {
220 220
 					return true;
221 221
 				}
222 222
 			}
@@ -226,14 +226,14 @@  discard block
 block discarded – undo
226 226
 	}
227 227
 
228 228
 //Perform the shortcode replacement
229
-	function espresso_replace_invoice_shortcodes( $content ) {
229
+	function espresso_replace_invoice_shortcodes($content) {
230 230
 
231 231
 		$EE = EE_Registry::instance();
232 232
 		//Create the logo
233
-		$invoice_logo_url = $this->invoice_payment_method->get_extra_meta('pdf_logo_image', TRUE,  $EE->CFG->organization->logo_url );
234
-		if (!empty($invoice_logo_url)) {
233
+		$invoice_logo_url = $this->invoice_payment_method->get_extra_meta('pdf_logo_image', TRUE, $EE->CFG->organization->logo_url);
234
+		if ( ! empty($invoice_logo_url)) {
235 235
 			$image_size = getimagesize($invoice_logo_url);
236
-			$invoice_logo_image = '<img class="logo screen" src="' . $invoice_logo_url . '" ' . $image_size[3] . ' alt="logo" /> ';
236
+			$invoice_logo_image = '<img class="logo screen" src="'.$invoice_logo_url.'" '.$image_size[3].' alt="logo" /> ';
237 237
 		} else {
238 238
 			$invoice_logo_image = '';
239 239
 		}
@@ -255,28 +255,28 @@  discard block
 block discarded – undo
255 255
 				"[instructions]",
256 256
 		);
257 257
 		$primary_attendee = $this->transaction->primary_registration()->attendee();
258
-		$org_state = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( $EE->CFG->organization->STA_ID );
259
-		if($org_state){
258
+		$org_state = EE_Registry::instance()->load_model('State')->get_one_by_ID($EE->CFG->organization->STA_ID);
259
+		if ($org_state) {
260 260
 			$org_state_name = $org_state->name();
261
-		}else{
261
+		} else {
262 262
 			$org_state_name = '';
263 263
 		}
264 264
 		$ReplaceValues = array(
265
-				$EE->CFG->organization->get_pretty( 'name' ),
265
+				$EE->CFG->organization->get_pretty('name'),
266 266
 				$this->registration->reg_code(),
267 267
 				$this->transaction->ID(),
268 268
 				$primary_attendee->full_name(),
269
-				(is_dir(EVENT_ESPRESSO_GATEWAY_DIR . '/invoice')) ? EVENT_ESPRESSO_GATEWAY_URL . 'Invoice/lib/templates/' : EE_GATEWAYS_URL . 'Invoice/lib/templates/',
270
-				$this->registration->invoice_url(),//home_url() . '/?download_invoice=true&amp;id=' . $this->registration->reg_url_link(),
269
+				(is_dir(EVENT_ESPRESSO_GATEWAY_DIR.'/invoice')) ? EVENT_ESPRESSO_GATEWAY_URL.'Invoice/lib/templates/' : EE_GATEWAYS_URL.'Invoice/lib/templates/',
270
+				$this->registration->invoice_url(), //home_url() . '/?download_invoice=true&amp;id=' . $this->registration->reg_url_link(),
271 271
 				$invoice_logo_image,
272
-				empty( $EE->CFG->organization->address_2 ) ? $EE->CFG->organization->get_pretty( 'address_1' ) : $EE->CFG->organization->get_pretty( 'address_1' ) . '<br>' . $EE->CFG->organization->get_pretty( 'address_2' ),
273
-				$EE->CFG->organization->get_pretty( 'city' ),
272
+				empty($EE->CFG->organization->address_2) ? $EE->CFG->organization->get_pretty('address_1') : $EE->CFG->organization->get_pretty('address_1').'<br>'.$EE->CFG->organization->get_pretty('address_2'),
273
+				$EE->CFG->organization->get_pretty('city'),
274 274
 				$org_state_name,
275
-				$EE->CFG->organization->get_pretty( 'zip' ),
276
-				$EE->CFG->organization->get_pretty( 'email' ),
275
+				$EE->CFG->organization->get_pretty('zip'),
276
+				$EE->CFG->organization->get_pretty('email'),
277 277
 				$EE->CFG->organization->vat,
278
-				$this->registration->get_i18n_datetime( 'REG_date', get_option( 'date_format' ) ),
279
-				$this->invoice_payment_method->get_extra_meta( 'pdf_instructions', TRUE ),
278
+				$this->registration->get_i18n_datetime('REG_date', get_option('date_format')),
279
+				$this->invoice_payment_method->get_extra_meta('pdf_instructions', TRUE),
280 280
 		);
281 281
 
282 282
 		return str_replace($SearchValues, $ReplaceValues, $content);
@@ -299,12 +299,12 @@  discard block
 block discarded – undo
299 299
 		if ($total_cost < 0) {
300 300
 			$total_cost = (-1) * $total_cost;
301 301
 		}
302
-		$find = array( ' ' );
303
-		$replace = array( '-' );
304
-		$row_id = strtolower( str_replace( $find, $replace, $text ));
302
+		$find = array(' ');
303
+		$replace = array('-');
304
+		$row_id = strtolower(str_replace($find, $replace, $text));
305 305
 		$html .= '<tr id="'.$row_id.'-tr"><td colspan="4">&nbsp;</td>';
306
-		$html .= '<td class="item_r">' . $text . '</td>';
307
-		$html .= '<td class="item_r">' . $total_cost . '</td>';
306
+		$html .= '<td class="item_r">'.$text.'</td>';
307
+		$html .= '<td class="item_r">'.$total_cost.'</td>';
308 308
 		$html .= '</tr>';
309 309
 		return $html;
310 310
 	}
Please login to merge, or discard this patch.
modules/gateways/Invoice/lib/invoice_functions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 //Returns an array of available template files
4 4
 function espresso_invoice_template_files($class_file) {
5 5
 	// read our template dir and build an array of files
6
-	$dhandle = opendir(dirname($class_file) . '/lib/templates/css/'); //If the template files have been moved to the uploads folder
6
+	$dhandle = opendir(dirname($class_file).'/lib/templates/css/'); //If the template files have been moved to the uploads folder
7 7
 	//} else return FALSE;
8 8
 
9 9
 	$files = array();
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 }
34 34
 
35 35
 //Checks to see if the invoice is selected
36
-function espresso_invoice_is_selected($input_item, $selected='') {
37
-	if ( $input_item == $option_selections ) {
36
+function espresso_invoice_is_selected($input_item, $selected = '') {
37
+	if ($input_item == $option_selections) {
38 38
 		return 'selected="selected"';
39 39
 	} else {
40 40
 		return '';
Please login to merge, or discard this patch.
modules/gateways/Invoice/lib/templates/invoice_body.template.php 3 patches
Switch Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -154,12 +154,12 @@
 block discarded – undo
154 154
 							<td class="item_r"><?php echo $line_item->total_no_code();?></td>
155 155
 						</tr>
156 156
 						<?php break;
157
-					case EEM_Line_Item::type_tax:
158
-							?>
157
+						case EEM_Line_Item::type_tax:
158
+								?>
159 159
 						<tr class="item sub-item tax-total">
160 160
 							<td class="item_l"><?php echo $line_item->name(); ?></td>
161 161
 							<?php if ($show_line_item_description){?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
162
-							<td colspan="2" class="item_c"><?php echo $line_item->percent(); ?>%</td>
162
+								<td colspan="2" class="item_c"><?php echo $line_item->percent(); ?>%</td>
163 163
 
164 164
 							<td class="item_r"><?php echo $line_item->total_no_code();?></td>
165 165
 						</tr><?php break;
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -45,13 +45,13 @@  discard block
 block discarded – undo
45 45
 					</div>
46 46
 					 <!--#client-details vcard-->
47 47
 
48
-		<h2><?php _e("Purchases",'event_espresso')?></h2>
48
+		<h2><?php _e("Purchases", 'event_espresso')?></h2>
49 49
 		<table class="invoice-amount">
50 50
 
51 51
 			<thead>
52 52
 				<tr class="header_row">
53 53
 					<th class="left ticket_th"><?php _e('Item', 'event_espresso'); ?></th>
54
-					<?php if ($show_line_item_description){?><th class="left event_th"><?php _e('Description', 'event_espresso'); ?></th><?php }?>
54
+					<?php if ($show_line_item_description) {?><th class="left event_th"><?php _e('Description', 'event_espresso'); ?></th><?php }?>
55 55
 					<th class="quantity_th"><?php _e('Qty', 'event_espresso'); ?></th>
56 56
 					<th class="left event_th"><?php _e('Price', 'event_espresso'); ?></th>
57 57
 					<th class="subtotal_th item_r"><?php _e('Total', 'event_espresso'); ?></th>
@@ -65,56 +65,56 @@  discard block
 block discarded – undo
65 65
 				 * @param EE_Line_Item $line_item
66 66
 				 * @param boolean $odd for indicating whether to style this line item as an 'odd' or 'even'
67 67
 				 */
68
-				function ee_invoice_display_line_item(EE_Line_Item $line_item, $show_line_item_description, $odd = false){
69
-					switch($line_item->type()){
68
+				function ee_invoice_display_line_item(EE_Line_Item $line_item, $show_line_item_description, $odd = false) {
69
+					switch ($line_item->type()) {
70 70
 						case EEM_Line_Item::type_total:
71
-							foreach($line_item->children() as $child_line_item){
72
-								ee_invoice_display_line_item($child_line_item,$show_line_item_description);
71
+							foreach ($line_item->children() as $child_line_item) {
72
+								ee_invoice_display_line_item($child_line_item, $show_line_item_description);
73 73
 								}?>
74 74
 							<tr><td colspan="<?php echo $show_line_item_description ? 5 : 4 ?>"><hr></td></tr>
75 75
 							<tr class="total_tr odd">
76 76
 								<td colspan="<?php echo $show_line_item_description ? 2 : 1 ?>">&nbsp;</td>
77 77
 								<td colspan="2" class="total" id="total_currency"><?php _e('Total', 'event_espresso'); ?></td>
78
-								<td class="total"><?php echo $line_item->total_no_code();?></td>
78
+								<td class="total"><?php echo $line_item->total_no_code(); ?></td>
79 79
 							</tr>
80 80
 						<?php break;
81 81
 
82 82
 
83 83
 						case EEM_Line_Item::type_sub_total:
84
-							foreach($line_item->children() as $child_line_item){
84
+							foreach ($line_item->children() as $child_line_item) {
85 85
 							//$odd = !$odd;
86
-								ee_invoice_display_line_item($child_line_item,$show_line_item_description,$odd);
86
+								ee_invoice_display_line_item($child_line_item, $show_line_item_description, $odd);
87 87
 							}?>
88 88
 							<tr class="total_tr odd">
89 89
 								<td colspan="<?php echo $show_line_item_description ? 2 : 1 ?>">&nbsp;</td>
90 90
 								<td colspan="2" class="total" id="total_currency"><?php _e('Sub-Total', 'event_espresso'); ?></td>
91
-								<td class="total"><?php echo $line_item->total_no_code();?></td>
91
+								<td class="total"><?php echo $line_item->total_no_code(); ?></td>
92 92
 							</tr>
93 93
 						<?php break;
94 94
 
95 95
 
96 96
 						case EEM_Line_Item::type_tax_sub_total:
97
-							foreach($line_item->children() as $child_line_item){
98
-								$odd = !$odd;
97
+							foreach ($line_item->children() as $child_line_item) {
98
+								$odd = ! $odd;
99 99
 								ee_invoice_display_line_item($child_line_item, $show_line_item_description, $odd);
100 100
 							}?>
101 101
 							<tr class="total_tr odd">
102 102
 								<td colspan="<?php echo $show_line_item_description ? 2 : 1 ?>">&nbsp;</td>
103 103
 								<td colspan="2" class="total" id="total_currency"><?php _e('Tax Total', 'event_espresso'); ?></td>
104
-								<td class="total"><?php echo $line_item->total_no_code();?></td>
104
+								<td class="total"><?php echo $line_item->total_no_code(); ?></td>
105 105
 							</tr>
106 106
 						<?php break;
107 107
 
108 108
 
109 109
 						case EEM_Line_Item::type_line_item:
110 110
 							$subitems = $line_item->children();
111
-							$has_subitems  = count($subitems) > 1 ;
112
-							if($has_subitems){
111
+							$has_subitems = count($subitems) > 1;
112
+							if ($has_subitems) {
113 113
 							?>
114
-							<tr class="item <?php echo $odd ?   'odd' : ''; ?>">
114
+							<tr class="item <?php echo $odd ? 'odd' : ''; ?>">
115 115
 								<td class="item_l"><?php echo $line_item->name() ?></td>
116
-								<?php if ($show_line_item_description){?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
117
-								<td class="item_l"><?php echo $line_item->quantity();?></td>
116
+								<?php if ($show_line_item_description) {?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
117
+								<td class="item_l"><?php echo $line_item->quantity(); ?></td>
118 118
 
119 119
 								<td class="item_c"><?php echo $line_item->unit_price_no_code()?></td>
120 120
 
@@ -122,15 +122,15 @@  discard block
 block discarded – undo
122 122
 								<?php //<td class="item_l"><?php  $datetimes_strings = array(); foreach($datetimes as $datetime){ $datetimes_strings[]= $datetime->start_date_and_time();} echo implode(", ",$datetimes_strings); ?>
123 123
 							</tr>
124 124
 							<?php
125
-								if( $has_subitems ){
126
-									foreach($line_item->children() as $child_line_item){
127
-										ee_invoice_display_line_item($child_line_item,$show_line_item_description, $odd);
125
+								if ($has_subitems) {
126
+									foreach ($line_item->children() as $child_line_item) {
127
+										ee_invoice_display_line_item($child_line_item, $show_line_item_description, $odd);
128 128
 									}
129 129
 								}
130
-							}else{//no subitems - just show this line item ?>
131
-								<tr class="item <?php echo $odd ?   'odd' : ''; ?>">
130
+							} else {//no subitems - just show this line item ?>
131
+								<tr class="item <?php echo $odd ? 'odd' : ''; ?>">
132 132
 									<td class="item_l"><?php echo $line_item->name()?></td>
133
-									<?php if ($show_line_item_description){?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
133
+									<?php if ($show_line_item_description) {?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
134 134
 									<td class="item_l"><?php echo $line_item->quantity()?></td>
135 135
 									<td class="item_c"><?php echo $line_item->unit_price_no_code()?></td>
136 136
 									<td class="item_r"> <?php echo $line_item->total_no_code(); echo $line_item->is_taxable() ? '*' : ''?> </td>
@@ -143,32 +143,32 @@  discard block
 block discarded – undo
143 143
 							?>
144 144
 						<tr class="item subitem-row">
145 145
 							<td class="item_l subitem"><?php echo $line_item->name(); ?></td>
146
-							<?php if ($show_line_item_description){?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
146
+							<?php if ($show_line_item_description) {?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
147 147
 							<?php if ($line_item->is_percent()) { ?>
148 148
 									<td></td>
149
-									<td class="item_c"><?php echo $line_item->percent();?>%</td>
150
-							<?php }else{//flat discount/surcharge ?>
149
+									<td class="item_c"><?php echo $line_item->percent(); ?>%</td>
150
+							<?php } else {//flat discount/surcharge ?>
151 151
 									<td></td>
152
-									<td class="item_c"><?php echo $line_item->unit_price_no_code();?></td>
152
+									<td class="item_c"><?php echo $line_item->unit_price_no_code(); ?></td>
153 153
 							<?php } ?>
154
-							<td class="item_r"><?php echo $line_item->total_no_code();?></td>
154
+							<td class="item_r"><?php echo $line_item->total_no_code(); ?></td>
155 155
 						</tr>
156 156
 						<?php break;
157 157
 					case EEM_Line_Item::type_tax:
158 158
 							?>
159 159
 						<tr class="item sub-item tax-total">
160 160
 							<td class="item_l"><?php echo $line_item->name(); ?></td>
161
-							<?php if ($show_line_item_description){?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
161
+							<?php if ($show_line_item_description) {?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
162 162
 							<td colspan="2" class="item_c"><?php echo $line_item->percent(); ?>%</td>
163 163
 
164
-							<td class="item_r"><?php echo $line_item->total_no_code();?></td>
164
+							<td class="item_r"><?php echo $line_item->total_no_code(); ?></td>
165 165
 						</tr><?php break;
166 166
 					}
167 167
 				}
168
-				$c=false;
168
+				$c = false;
169 169
 				/* @var $transaction EE_Transaction */
170 170
 				$total_line_item = $transaction->total_line_item();
171
-				ee_invoice_display_line_item($total_line_item,$show_line_item_description);
171
+				ee_invoice_display_line_item($total_line_item, $show_line_item_description);
172 172
 				/* foreach($transaction->registrations() as $registration){
173 173
 					 ?>
174 174
 					<tr class="item <?php echo ($c = !$c) ? ' odd' : ''; ?>">
@@ -183,13 +183,13 @@  discard block
 block discarded – undo
183 183
 			</tbody>
184 184
 
185 185
 		</table>
186
-		<p><?php _e("* taxable items", "event_espresso");?></p>
187
-		<h2><?php _e("Payments",'event_espresso')?></h2>
186
+		<p><?php _e("* taxable items", "event_espresso"); ?></p>
187
+		<h2><?php _e("Payments", 'event_espresso')?></h2>
188 188
 		<table class="invoice-amount">
189 189
 			<thead>
190 190
 				<tr class="header_row">
191 191
 					<th ><span class=""><?php _e('Payment Method', 'event_espresso'); ?></span></th>
192
-					<th class='left datetime_th'><?php _e("Date",'event_espresso')?></th>
192
+					<th class='left datetime_th'><?php _e("Date", 'event_espresso')?></th>
193 193
 					<th ><span class=""><?php _e('Transaction Id / Cheque #', 'event_espresso'); ?></span></th>
194 194
 					<th ><span class=""><?php _e('P.O. / S.O.#', 'event_espresso'); ?></span></th>
195 195
 					<th ><span class=""><?php _e('Status', 'event_espresso'); ?></span></th>
@@ -199,29 +199,29 @@  discard block
 block discarded – undo
199 199
 			<tbody>
200 200
 				<?php
201 201
 				$c = false;
202
-				if(!empty($payments)){
202
+				if ( ! empty($payments)) {
203 203
 
204
-					foreach($payments as $payment){
204
+					foreach ($payments as $payment) {
205 205
 						/* @var $payment EE_Payment */?>
206
-					<tr class='item <?php echo (($c = !$c) ? ' odd' : '')?>'>
206
+					<tr class='item <?php echo (($c = ! $c) ? ' odd' : '')?>'>
207 207
 						<td><?php $payment->e('PAY_gateway')?></td>
208 208
 						<td><?php echo $payment->timestamp('D M j, Y')?></td>
209 209
 						<td><?php $payment->e('PAY_txn_id_chq_nmbr')?></td>
210 210
 						<td><?php $payment->e('PAY_po_number')?></td>
211 211
 						<td><?php $payment->e_pretty_status()?></td>
212
-						<td class='item_r'><?php echo EEH_Template::format_currency($payment->amount());?></td>
212
+						<td class='item_r'><?php echo EEH_Template::format_currency($payment->amount()); ?></td>
213 213
 					</tr>
214 214
 					<?php }
215
-				}else{?>
215
+				} else {?>
216 216
 					<tr class='item'>
217
-						<td class='aln-cntr' colspan=6><?php _e("No approved payments have been received",'event_espresso')?></td>
217
+						<td class='aln-cntr' colspan=6><?php _e("No approved payments have been received", 'event_espresso')?></td>
218 218
 					</tr>
219 219
 				<?php }
220 220
 ?>
221 221
 			</tbody>
222 222
 			<tfoot>
223 223
 				<tr class='total_tr'><td colspan="4"></td>
224
-					<td class="item_r"><?php _e('Total Paid','event_espresso')?></td>
224
+					<td class="item_r"><?php _e('Total Paid', 'event_espresso')?></td>
225 225
 					<td class="item_r"><?php echo EEH_Template::format_currency($amount_pd)?> </td>
226 226
 				</tr>
227 227
 				<?php //echo $discount; ?>
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 										ee_invoice_display_line_item($child_line_item,$show_line_item_description, $odd);
128 128
 									}
129 129
 								}
130
-							}else{//no subitems - just show this line item ?>
130
+							} else{//no subitems - just show this line item ?>
131 131
 								<tr class="item <?php echo $odd ?   'odd' : ''; ?>">
132 132
 									<td class="item_l"><?php echo $line_item->name()?></td>
133 133
 									<?php if ($show_line_item_description){?><td class="item_l"><?php echo $line_item->desc() ?></td><?php }?>
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 							<?php if ($line_item->is_percent()) { ?>
148 148
 									<td></td>
149 149
 									<td class="item_c"><?php echo $line_item->percent();?>%</td>
150
-							<?php }else{//flat discount/surcharge ?>
150
+							<?php } else{//flat discount/surcharge ?>
151 151
 									<td></td>
152 152
 									<td class="item_c"><?php echo $line_item->unit_price_no_code();?></td>
153 153
 							<?php } ?>
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 						<td class='item_r'><?php echo EEH_Template::format_currency($payment->amount());?></td>
213 213
 					</tr>
214 214
 					<?php }
215
-				}else{?>
215
+				} else{?>
216 216
 					<tr class='item'>
217 217
 						<td class='aln-cntr' colspan=6><?php _e("No approved payments have been received",'event_espresso')?></td>
218 218
 					</tr>
Please login to merge, or discard this patch.
modules/gateways/Invoice/lib/templates/invoice_header.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 <!-- Base Stylesheet do not change or remove -->
7 7
 <link rel="stylesheet" type="text/css" href="[base_url]base.css" media="screen" />
8 8
 <!-- Print Style Sheet -->
9
-<link rel="stylesheet" type="text/css" href="[base_url]css/print/<?php echo str_replace('.css', '',$invoice_css); ?>_print.css" media="print" />
9
+<link rel="stylesheet" type="text/css" href="[base_url]css/print/<?php echo str_replace('.css', '', $invoice_css); ?>_print.css" media="print" />
10 10
 <!-- Primary Style Sheet -->
11 11
 <link rel="stylesheet" type="text/css" href="[base_url]css/<?php echo $invoice_css; ?>" />
12 12
 <!-- Make sure the buttons don't print -->
Please login to merge, or discard this patch.
modules/gateways/Invoice/lib/templates/receipt_body.template.php 2 patches
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 									<td class="item_c"><?php echo $line_item->unit_price_no_code()?></td>
74 74
 									<td class="item_r"><?php echo $line_item->total_no_code()?></td>
75 75
 								</tr>
76
-								<?php }else{?>
76
+								<?php } else{?>
77 77
 									<tr class="item">
78 78
 										<td class="aln-left"><?php echo $line_item->name().$taxable_html?></td>
79 79
 										<td colspan="2"><?php echo $line_item->desc();?><p class="ticket-note"><?php echo sprintf(__('This ticket can be used once at %s of the dates/times below.', 'event_espresso'), $ticket_uses); ?></p></td>
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 							<td class='item_r'><?php echo $payment->amount_no_code()?></td>
238 238
 						</tr>
239 239
 						<?php }
240
-					}else{?>
240
+					} else{?>
241 241
 						<tr class='item'>
242 242
 							<td class='aln-cntr' colspan="6"><?php _e("No approved payments have been received.",'event_espresso')?> </td>
243 243
 						</tr>
Please login to merge, or discard this patch.
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -36,53 +36,53 @@  discard block
 block discarded – undo
36 36
 						<h2 id="invoice-hdr"><?php _e('Order Confirmation', 'event_espresso')?></h2>
37 37
 						<h3 id="invoice-date"><?php _e('Date:', 'event_espresso')?> <span class="plain-text">[registration_date]</span></h3>
38 38
 						<h3 id="invoice-txn-id"><?php _e('Transaction ID:', 'event_espresso')?> <span class="plain-text">[transaction_id]</span></h3>
39
-						<h3 id="invoice-txn-status"><?php _e('Status:', 'event_espresso')?> <span class="<?php echo $transaction->status_ID()?> plain-text"><?php echo $transaction->pretty_status();?></span></h3>
39
+						<h3 id="invoice-txn-status"><?php _e('Status:', 'event_espresso')?> <span class="<?php echo $transaction->status_ID()?> plain-text"><?php echo $transaction->pretty_status(); ?></span></h3>
40 40
 					</div>
41 41
 				</td>
42 42
 			</tr>
43 43
 		</table>
44 44
 		<div class="events">
45
-		<?php foreach($events_for_txn as $event_id => $event){
46
-			?><h3 class="section-title event-name"><img class="icon" src="<?php echo EE_IMAGES_URL.'calendar_year-24x24.png';?>"><?php _e("Event Name:","event_espresso")?> <span class="plain-text"><?php echo $event->name();?></span> <span class="small-text link">[ <a href='<?php echo $event->get_permalink()?>'><?php _e('view', 'event_espresso'); ?></a> ]</span></h3>
47
-			<?php if (strlen($event->description()>1)){?><p class="event-description"><?php $event->description()?></p><?php }?>
45
+		<?php foreach ($events_for_txn as $event_id => $event) {
46
+			?><h3 class="section-title event-name"><img class="icon" src="<?php echo EE_IMAGES_URL.'calendar_year-24x24.png'; ?>"><?php _e("Event Name:", "event_espresso")?> <span class="plain-text"><?php echo $event->name(); ?></span> <span class="small-text link">[ <a href='<?php echo $event->get_permalink()?>'><?php _e('view', 'event_espresso'); ?></a> ]</span></h3>
47
+			<?php if (strlen($event->description() > 1)) {?><p class="event-description"><?php $event->description()?></p><?php }?>
48 48
 			<ul class="tickets-per-event">
49
-			<?php foreach($ticket_line_items_per_event[$event_id] as $line_item_id => $line_item){
49
+			<?php foreach ($ticket_line_items_per_event[$event_id] as $line_item_id => $line_item) {
50 50
 				$ticket = $line_item->ticket();
51
-				$taxable_html = $ticket->taxable() ? '*': '';
51
+				$taxable_html = $ticket->taxable() ? '*' : '';
52 52
 				$subitems = $line_item->children();
53
-				$ticket_uses = $ticket->get_pretty('TKT_uses',  __("any", "event_espresso"));
53
+				$ticket_uses = $ticket->get_pretty('TKT_uses', __("any", "event_espresso"));
54 54
 			?>
55 55
 				<li class="event-ticket">
56 56
 					<div class="ticket-details">
57 57
 						<table class="invoice-amount">
58 58
 							<thead>
59 59
 								<tr class="header_row">
60
-									<th class="name-column"><?php _e("Ticket", "event_espresso");?></th>
61
-									<th colspan="2" class="desc-column"><?php _e("Description", "event_espresso");?></th>
62
-									<th class="number-column item_c"><?php _e("Quantity", "event_espresso");?></th>
63
-									<th class="number-column item_c"><?php _e("Price", "event_espresso");?></th>
64
-									<th class="number-column item_r"><?php _e("Total", "event_espresso");?></th>
60
+									<th class="name-column"><?php _e("Ticket", "event_espresso"); ?></th>
61
+									<th colspan="2" class="desc-column"><?php _e("Description", "event_espresso"); ?></th>
62
+									<th class="number-column item_c"><?php _e("Quantity", "event_espresso"); ?></th>
63
+									<th class="number-column item_c"><?php _e("Price", "event_espresso"); ?></th>
64
+									<th class="number-column item_r"><?php _e("Total", "event_espresso"); ?></th>
65 65
 								</tr>
66 66
 							</thead>
67 67
 							<tbody>
68
-								<?php if( count($subitems) < 2){?>
68
+								<?php if (count($subitems) < 2) {?>
69 69
 								<tr class="item">
70 70
 									<td><?php echo $line_item->name().$taxable_html?></td>
71
-									<td colspan="2"><?php echo $line_item->desc();?><p class="ticket-note"><?php echo sprintf(__('This ticket can be used once at %s of the dates/times below.', 'event_espresso'), $ticket_uses); ?></p></td>
71
+									<td colspan="2"><?php echo $line_item->desc(); ?><p class="ticket-note"><?php echo sprintf(__('This ticket can be used once at %s of the dates/times below.', 'event_espresso'), $ticket_uses); ?></p></td>
72 72
 									<td class="item_c"><?php echo $line_item->quantity()?></td>
73 73
 									<td class="item_c"><?php echo $line_item->unit_price_no_code()?></td>
74 74
 									<td class="item_r"><?php echo $line_item->total_no_code()?></td>
75 75
 								</tr>
76
-								<?php }else{?>
76
+								<?php } else {?>
77 77
 									<tr class="item">
78 78
 										<td class="aln-left"><?php echo $line_item->name().$taxable_html?></td>
79
-										<td colspan="2"><?php echo $line_item->desc();?><p class="ticket-note"><?php echo sprintf(__('This ticket can be used once at %s of the dates/times below.', 'event_espresso'), $ticket_uses); ?></p></td>
79
+										<td colspan="2"><?php echo $line_item->desc(); ?><p class="ticket-note"><?php echo sprintf(__('This ticket can be used once at %s of the dates/times below.', 'event_espresso'), $ticket_uses); ?></p></td>
80 80
 										<td class="item_c"><?php echo $line_item->quantity()?></td>
81 81
 										<td class="item_c"><?php echo $line_item->unit_price_no_code()?></td>
82 82
 										<td class="item_r"><?php echo $line_item->total_no_code()?></td>
83 83
 									</tr>
84
-									<?php foreach($subitems as $sub_line_item){
85
-										$is_percent = $sub_line_item->is_percent();?>
84
+									<?php foreach ($subitems as $sub_line_item) {
85
+										$is_percent = $sub_line_item->is_percent(); ?>
86 86
 										<tr class="subitem-row">
87 87
 											<td class="subitem"><?php echo $sub_line_item->name()?></td>
88 88
 											<td colspan="2"><?php echo $sub_line_item->desc()?></td>
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 									<?php } ?>
94 94
 									<tr class="total_tr odd">
95 95
 										<td colspan="4"></td>
96
-										<td class="total" nowrap="nowrap"><?php _e("Ticket Total:", "event_espresso");?></td>
96
+										<td class="total" nowrap="nowrap"><?php _e("Ticket Total:", "event_espresso"); ?></td>
97 97
 										<td class="item_r"><?php echo $line_item->total_no_code()?></td>
98 98
 									</tr>
99 99
 								<?php }?>
@@ -104,22 +104,22 @@  discard block
 block discarded – undo
104 104
 					<div class="reg-details-for-ticket">
105 105
 						<div class="ticket-time-and-place-details">
106 106
 							<div class="ticket-time-details">
107
-								<h4 class="sub-section-title no-bottom-margin"><img class="icon" src="<?php echo EE_IMAGES_URL.'clock-16x16.png';?>"><?php echo _n("Date/Time:","Dates/Times:",count($ticket->datetimes()), "event_espresso");?></h4>
107
+								<h4 class="sub-section-title no-bottom-margin"><img class="icon" src="<?php echo EE_IMAGES_URL.'clock-16x16.png'; ?>"><?php echo _n("Date/Time:", "Dates/Times:", count($ticket->datetimes()), "event_espresso"); ?></h4>
108 108
 								<ul class="event-dates">
109
-									<?php foreach($ticket->datetimes_ordered() as $datetime){
109
+									<?php foreach ($ticket->datetimes_ordered() as $datetime) {
110 110
 										/* @var $datetime EE_Datetime */ ?>
111 111
 									<li><?php
112
-										echo $datetime->name() ? '<b>'.$datetime->name().' </b>' : '' ;
113
-										echo sprintf(__("%s - %s (%s)", "event_espresso"),$datetime->start_date_and_time(),$datetime->end_date_and_time(),$datetime->get_timezone());
112
+										echo $datetime->name() ? '<b>'.$datetime->name().' </b>' : '';
113
+										echo sprintf(__("%s - %s (%s)", "event_espresso"), $datetime->start_date_and_time(), $datetime->end_date_and_time(), $datetime->get_timezone());
114 114
 										echo $datetime->description() ? '<p class="ticket-note">'.$datetime->description().'</p>' : '' ?></li>
115 115
 									<?php }?>
116 116
 								</ul>
117 117
 							</div>
118
-							<?php if ($event->venues()){?>
118
+							<?php if ($event->venues()) {?>
119 119
 							<div class="ticket-place-details">
120
-								<h4 class="sub-section-title no-bottom-margin"><img class="icon" src="<?php echo EE_IMAGES_URL.'location-pin-16x16.png';?>"><?php echo _n("Venue:","Venues:",count($event->venues()), "event_espresso");?></h4>
120
+								<h4 class="sub-section-title no-bottom-margin"><img class="icon" src="<?php echo EE_IMAGES_URL.'location-pin-16x16.png'; ?>"><?php echo _n("Venue:", "Venues:", count($event->venues()), "event_espresso"); ?></h4>
121 121
 								<ul class="event-venues">
122
-									<?php foreach($event->venues() as $venue){?>
122
+									<?php foreach ($event->venues() as $venue) {?>
123 123
 									<li><?php echo $venue->name()?> <span class="small-text">[ <a href='<?php echo $venue->get_permalink()?>'><?php _e('view', 'event_espresso'); ?></a> ]</span></li>
124 124
 									<?php } ?>
125 125
 								</ul>
@@ -127,34 +127,34 @@  discard block
 block discarded – undo
127 127
 							<?php }?>
128 128
 						</div>
129 129
 						<div class="ticket-registrations-area">
130
-							<h4 class="sub-section-title"><img class="icon" src="<?php echo EE_IMAGES_URL.'users-16x16.png';?>"><?php echo __("Registration Details", "event_espresso");?> <span class="small-text link">[ <a class="print_button noPrint" href="<?php echo $edit_reg_info_url; ?>"><?php _e('edit', 'event_espresso'); ?></a> ]</span></h4>
130
+							<h4 class="sub-section-title"><img class="icon" src="<?php echo EE_IMAGES_URL.'users-16x16.png'; ?>"><?php echo __("Registration Details", "event_espresso"); ?> <span class="small-text link">[ <a class="print_button noPrint" href="<?php echo $edit_reg_info_url; ?>"><?php _e('edit', 'event_espresso'); ?></a> ]</span></h4>
131 131
 							<ul class="ticket-registrations-list">
132
-								<?php foreach($registrations_per_line_item[$line_item_id] as $registration){
132
+								<?php foreach ($registrations_per_line_item[$line_item_id] as $registration) {
133 133
 									/* @var $registration EE_Registration */
134 134
 									$attendee = $registration->attendee();
135
-									$answers = $registration->answers(array('order_by'=>array('Question.Question_Group_Question.QGQ_order'=>'ASC')));?>
135
+									$answers = $registration->answers(array('order_by'=>array('Question.Question_Group_Question.QGQ_order'=>'ASC'))); ?>
136 136
 								<li class="ticket-registration">
137 137
 									<table class="registration-details">
138 138
 										<tr class="odd">
139
-											<th><?php echo 	_e("Registration Code:", "event_espresso");?></th>
140
-											<td><?php echo $registration->reg_code();?> - <span class="<?php echo $registration->status_ID()?>"><?php echo $registration->pretty_status()?></span></td>
139
+											<th><?php echo 	_e("Registration Code:", "event_espresso"); ?></th>
140
+											<td><?php echo $registration->reg_code(); ?> - <span class="<?php echo $registration->status_ID()?>"><?php echo $registration->pretty_status()?></span></td>
141 141
 										</tr>
142 142
 										<?php
143
-										foreach($event->question_groups() as $question_group){
144
-											?><tr><th><?php $question_group->e('QSG_name');?></th><td></td></tr><?php
143
+										foreach ($event->question_groups() as $question_group) {
144
+											?><tr><th><?php $question_group->e('QSG_name'); ?></th><td></td></tr><?php
145 145
 											$has_personal_info = false;
146
-											foreach($question_group->questions() as $question){
147
-												if( in_array($question->system_ID(),$questions_to_skip)){
146
+											foreach ($question_group->questions() as $question) {
147
+												if (in_array($question->system_ID(), $questions_to_skip)) {
148 148
 													$has_personal_info = true;
149 149
 													continue;
150 150
 												}
151 151
 												?><tr>
152 152
 														<th><?php echo $question->display_text()?></th>
153
-														<td><?php echo $registration->answer_value_to_question($question);?></td>
153
+														<td><?php echo $registration->answer_value_to_question($question); ?></td>
154 154
 												</tr><?php
155 155
 											}
156
-											if($has_personal_info){
157
-												?><tr><th><?php	_e('Attendee', 'event_espresso');?></th><td><?php echo sprintf(__('%s (%s)', "event_espresso"),$attendee->full_name(),$attendee->email())?></td></tr><?php
156
+											if ($has_personal_info) {
157
+												?><tr><th><?php	_e('Attendee', 'event_espresso'); ?></th><td><?php echo sprintf(__('%s (%s)', "event_espresso"), $attendee->full_name(), $attendee->email())?></td></tr><?php
158 158
 											}
159 159
 										}
160 160
 										?>
@@ -171,21 +171,21 @@  discard block
 block discarded – undo
171 171
 		<?php }?>
172 172
 		</div>
173 173
 		<div class="taxes">
174
-			<?php if ($tax_total_line_item && $tax_total_line_item->children()){?>
175
-				<h3 class="section-title"><?php _e("Taxes",'event_espresso')?></h3>
174
+			<?php if ($tax_total_line_item && $tax_total_line_item->children()) {?>
175
+				<h3 class="section-title"><?php _e("Taxes", 'event_espresso')?></h3>
176 176
 				<table class="invoice-amount">
177 177
 
178 178
 					<thead>
179 179
 						<tr class="header_row">
180
-							<th class="left ticket_th"><?php _e("Tax Name", "event_espresso");?></th>
181
-							<th class="left"><?php _e('Description', 'event_espresso');?></th>
180
+							<th class="left ticket_th"><?php _e("Tax Name", "event_espresso"); ?></th>
181
+							<th class="left"><?php _e('Description', 'event_espresso'); ?></th>
182 182
 							<th class="event_th item_c"><?php _e('Rate', 'event_espresso'); ?></th>
183 183
 							<th class="subtotal_th"><?php _e('Tax Amount', 'event_espresso'); ?></th>
184 184
 						</tr>
185 185
 					</thead>
186 186
 					<tbody>
187 187
 						<?php
188
-						foreach($tax_total_line_item->children() as $child_tax){?>
188
+						foreach ($tax_total_line_item->children() as $child_tax) {?>
189 189
 						<tr>
190 190
 							<td><?php echo $child_tax->name()?></td>
191 191
 							<td><?php echo $child_tax->desc()?></td>
@@ -195,26 +195,26 @@  discard block
 block discarded – undo
195 195
 						<?php } ?>
196 196
 						<tr class="total_tr odd">
197 197
 							<td class="total_tr" colspan="2"></td>
198
-							<td class="total"><?php	_e("Tax Total:", "event_espresso");?></td>
198
+							<td class="total"><?php	_e("Tax Total:", "event_espresso"); ?></td>
199 199
 							<td class="item_r"><?php echo $tax_total_line_item->total_no_code()?></td>
200 200
 						</tr>
201 201
 					</tbody>
202 202
 
203 203
 				</table>
204 204
 			<?php }?>
205
-			<p><?php _e("* taxable items", "event_espresso");?></p>
205
+			<p><?php _e("* taxable items", "event_espresso"); ?></p>
206 206
 		</div>
207 207
 		<div class="grand-total-dv">
208
-		<h2 class="grand-total"><?php printf(__("Grand Total: %s", "event_espresso"),EEH_Template::format_currency($total_cost));?></h2>
208
+		<h2 class="grand-total"><?php printf(__("Grand Total: %s", "event_espresso"), EEH_Template::format_currency($total_cost)); ?></h2>
209 209
 		</div>
210 210
 		<div class="payment-dv">
211
-			<h3 class="section-title"><?php _e("Payments",'event_espresso')?></h3>
211
+			<h3 class="section-title"><?php _e("Payments", 'event_espresso')?></h3>
212 212
 			<p>[instructions]</p>
213 213
 			<table class="invoice-amount">
214 214
 				<thead>
215 215
 					<tr class="header_row">
216 216
 						<th><span class=""><?php _e('Payment Method', 'event_espresso'); ?></span></th>
217
-						<th class='left datetime_th'><?php _e("Date",'event_espresso')?></th>
217
+						<th class='left datetime_th'><?php _e("Date", 'event_espresso')?></th>
218 218
 						<th><span class=""><?php _e('Transaction Id / Cheque #', 'event_espresso'); ?></span></th>
219 219
 						<th><span class=""><?php _e('P.O. / S.O.#', 'event_espresso'); ?></span></th>
220 220
 						<th><span class=""><?php _e('Status', 'event_espresso'); ?></span></th>
@@ -224,11 +224,11 @@  discard block
 block discarded – undo
224 224
 				<tbody>
225 225
 					<?php
226 226
 					$c = false;
227
-					if(!empty($payments)){
227
+					if ( ! empty($payments)) {
228 228
 
229
-						foreach($payments as $payment){
229
+						foreach ($payments as $payment) {
230 230
 							/* @var $payment EE_Payment */?>
231
-						<tr class='item <?php echo (($c = !$c) ? ' odd' : '')?>'>
231
+						<tr class='item <?php echo (($c = ! $c) ? ' odd' : '')?>'>
232 232
 							<td><?php $payment->e('PAY_gateway')?></td>
233 233
 							<td><?php echo $payment->timestamp()?></td>
234 234
 							<td><?php $payment->e('PAY_txn_id_chq_nmbr')?></td>
@@ -237,17 +237,17 @@  discard block
 block discarded – undo
237 237
 							<td class='item_r'><?php echo $payment->amount_no_code()?></td>
238 238
 						</tr>
239 239
 						<?php }
240
-					}else{?>
240
+					} else {?>
241 241
 						<tr class='item'>
242
-							<td class='aln-cntr' colspan="6"><?php _e("No approved payments have been received.",'event_espresso')?> </td>
242
+							<td class='aln-cntr' colspan="6"><?php _e("No approved payments have been received.", 'event_espresso')?> </td>
243 243
 						</tr>
244 244
 					<?php }
245
-					?><tr class="item" ><td class='aln-cntr' colspan="6"><?php if($amount_owed){?><a class="noPrint" href='<?php echo $retry_payment_url?>'><?php _e("Please make a payment.", "event_espresso");}?></a></td></tr>
245
+					?><tr class="item" ><td class='aln-cntr' colspan="6"><?php if ($amount_owed) {?><a class="noPrint" href='<?php echo $retry_payment_url?>'><?php _e("Please make a payment.", "event_espresso"); }?></a></td></tr>
246 246
 				</tbody>
247 247
 				<tfoot>
248 248
 					<tr class='total_tr'><td colspan="4">&nbsp;</td>
249
-						<td class="item_r"><?php _e('Total Paid','event_espresso')?></td>
250
-						<td class="item_r"><?php echo EEH_Template::format_currency($amount_pd,false,false)?> </td>
249
+						<td class="item_r"><?php _e('Total Paid', 'event_espresso')?></td>
250
+						<td class="item_r"><?php echo EEH_Template::format_currency($amount_pd, false, false)?> </td>
251 251
 					</tr>
252 252
 					<?php //echo $discount; ?>
253 253
 					<tr class="total_tr odd">
@@ -259,20 +259,20 @@  discard block
 block discarded – undo
259 259
 			</table>
260 260
 		</div>
261 261
 		<div class="additional-info-dv">
262
-			<h3 class="section-title"><?php _e("Additional Information:", "event_espresso");?></h3>
262
+			<h3 class="section-title"><?php _e("Additional Information:", "event_espresso"); ?></h3>
263 263
 			<div class="additional-info">
264
-				<?php if($venues_for_events){?>
265
-				<h2><?php echo _n("Venue Details:", "Venues Details:", "event_espresso",count($venues_for_events));?></h2>
264
+				<?php if ($venues_for_events) {?>
265
+				<h2><?php echo _n("Venue Details:", "Venues Details:", "event_espresso", count($venues_for_events)); ?></h2>
266 266
 				<table class="venue-list">
267
-					<?php foreach($venues_for_events as $venue){?>
267
+					<?php foreach ($venues_for_events as $venue) {?>
268 268
 						<tr class="venue-details">
269 269
 							<td class="venue-details-part venue-address-dv">
270 270
 								<h3><a href='<?php echo $venue->get_permalink()?>'><?php
271 271
 									echo $venue->name()
272 272
 								?></a></h3>
273 273
 								<p><?php echo $venue->description()?></p>
274
-								<?php echo  EEH_Address::format($venue);?></td>
275
-							<?php if($venue->enable_for_gmap()){?>
274
+								<?php echo  EEH_Address::format($venue); ?></td>
275
+							<?php if ($venue->enable_for_gmap()) {?>
276 276
 								<td class="venue-details-part venue-image-dv"><?php echo EEH_Venue_View::espresso_google_static_map($venue)?></td>
277 277
 							<?php } ?>
278 278
 						</tr>
@@ -280,9 +280,9 @@  discard block
 block discarded – undo
280 280
 				</table>
281 281
 				<?php } ?>
282 282
 
283
-				<?php if($shameless_plug){?>
283
+				<?php if ($shameless_plug) {?>
284 284
 				<div class='aln-cntr'><?php
285
-					printf(__("Powered by %sEvent Espresso %s", "event_espresso"),"<a href='http://eventespresso.com'>","</a>");
285
+					printf(__("Powered by %sEvent Espresso %s", "event_espresso"), "<a href='http://eventespresso.com'>", "</a>");
286 286
 				?></div>
287 287
 				<?php } ?>
288 288
 			</div>
Please login to merge, or discard this patch.
modules/invoice/EED_Invoice.module.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @return EED_Invoice
30 30
 	 */
31 31
 	public static function instance() {
32
-		return parent::get_instance( __CLASS__ );
32
+		return parent::get_instance(__CLASS__);
33 33
 	}
34 34
 
35 35
 
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 	 *  @return 	void
42 42
 	 */
43 43
 	public static function set_hooks() {
44
-		EE_Config::register_route( 'download_invoice', 'EED_Invoice', 'download_invoice' );
45
-		EE_Config::register_route( 'launch_invoice', 'EED_Invoice', 'launch_invoice' );
44
+		EE_Config::register_route('download_invoice', 'EED_Invoice', 'download_invoice');
45
+		EE_Config::register_route('launch_invoice', 'EED_Invoice', 'launch_invoice');
46 46
 	}
47 47
 
48 48
 
@@ -63,12 +63,12 @@  discard block
 block discarded – undo
63 63
 	 *  @access 	public
64 64
 	 *  @return 	void
65 65
 	 */
66
-	public function run( $WP ) {
67
-		if ( is_readable( EE_MODULES . 'gateways/Invoice/lib/Invoice.class.php' )) {
68
-			require_once( EE_MODULES . 'gateways/Invoice/lib/Invoice.class.php' );
66
+	public function run($WP) {
67
+		if (is_readable(EE_MODULES.'gateways/Invoice/lib/Invoice.class.php')) {
68
+			require_once(EE_MODULES.'gateways/Invoice/lib/Invoice.class.php');
69 69
 		} else {
70
-			$msg = __( 'The Invoice.class.php file could not be loaded.', 'event_espresso' );
71
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
70
+			$msg = __('The Invoice.class.php file could not be loaded.', 'event_espresso');
71
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
72 72
 		}
73 73
 //		add_filter( 'FHEE_load_ee_config', '__return_true' );
74 74
 //		add_filter( 'FHEE_run_EE_wp', '__return_true' );
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	public function launch_invoice() {
91 91
 		$this->run(null);
92
-		if ( EE_Registry::instance()->REQ->is_set( 'id' )) {
93
-			$id = sanitize_key( EE_Registry::instance()->REQ->get( 'id' ));
94
-			$invoice = new Invoice( $id );
92
+		if (EE_Registry::instance()->REQ->is_set('id')) {
93
+			$id = sanitize_key(EE_Registry::instance()->REQ->get('id'));
94
+			$invoice = new Invoice($id);
95 95
 			$invoice->send_invoice();
96 96
 		}
97 97
 	}
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
 	 */
107 107
 	public function download_invoice() {
108 108
 		$this->run(null);
109
-		if ( EE_Registry::instance()->REQ->is_set( 'id' )) {
110
-			$id = sanitize_key( EE_Registry::instance()->REQ->get( 'id' ));
109
+		if (EE_Registry::instance()->REQ->is_set('id')) {
110
+			$id = sanitize_key(EE_Registry::instance()->REQ->get('id'));
111 111
 			$invoice = new Invoice($_REQUEST['id']);
112 112
 			// send invoice but force download
113
-			$invoice->send_invoice( TRUE );
113
+			$invoice->send_invoice(TRUE);
114 114
 		}
115 115
 	}
116 116
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 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
  *
Please login to merge, or discard this patch.
modules/single_page_checkout/inc/EE_Checkout.class.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
  /**
3
- *
4
- * Class EE_Checkout
5
- *
6
- * Description
7
- *
8
- * @package 			Event Espresso
9
- * @subpackage    core
10
- * @author				Brent Christensen
11
- * @since 				4.5.0
12
- *
13
- */
3
+  *
4
+  * Class EE_Checkout
5
+  *
6
+  * Description
7
+  *
8
+  * @package 			Event Espresso
9
+  * @subpackage    core
10
+  * @author				Brent Christensen
11
+  * @since 				4.5.0
12
+  *
13
+  */
14 14
 class EE_Checkout {
15 15
 
16 16
 	/**
Please login to merge, or discard this patch.
Doc Comments   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 
252 252
 	/**
253 253
 	 * returns true if ANY reg status was updated during checkout
254
-	 * @return array
254
+	 * @return boolean
255 255
 	 */
256 256
 	public function any_reg_status_updated() {
257 257
 		foreach ( $this->reg_status_updated as $reg_status ) {
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 
277 277
 	/**
278 278
 	 * @param $REG_ID
279
-	 * @param $reg_status
279
+	 * @param boolean $reg_status
280 280
 	 */
281 281
 	public function set_reg_status_updated( $REG_ID, $reg_status ) {
282 282
 		$this->reg_status_updated[ $REG_ID ] = filter_var( $reg_status, FILTER_VALIDATE_BOOLEAN );
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
 	 * 	reset_reg_steps
621 621
 	 *
622 622
 	 * 	@access public
623
-	 * 	@return 	bool
623
+	 * 	@return 	boolean|null
624 624
 	 */
625 625
 	public function reset_reg_steps() {
626 626
 		$this->sort_reg_steps();
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
 	 * 	stores whether any updates were made to the TXN or it's related registrations
734 734
 	 *
735 735
 	 * 	@access public
736
-	 * 	@return 	bool
736
+	 * 	@return 	boolean|null
737 737
 	 */
738 738
 	public function track_transaction_and_registration_status_updates() {
739 739
 		// verify the transaction
@@ -1081,6 +1081,7 @@  discard block
 block discarded – undo
1081 1081
 	 *
1082 1082
 	 * @param 	string | int 	$reg_cache_ID
1083 1083
 	 * @param 	EE_Registration 	$registration
1084
+	 * @param integer $reg_cache_ID
1084 1085
 	 * @return void
1085 1086
 	 */
1086 1087
 	protected function _refresh_registration( $reg_cache_ID, $registration ) {
Please login to merge, or discard this patch.
Spacing   +206 added lines, -206 removed lines patch added patch discarded remove patch
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
 		$this->reg_page_base_url = EE_Registry::instance()->CFG->core->reg_page_url();
243 243
 		$this->thank_you_page_url = EE_Registry::instance()->CFG->core->thank_you_page_url();
244 244
 		$this->cancel_page_url = EE_Registry::instance()->CFG->core->cancel_page_url();
245
-		$this->continue_reg = apply_filters( 'FHEE__EE_Checkout___construct___continue_reg', TRUE );
245
+		$this->continue_reg = apply_filters('FHEE__EE_Checkout___construct___continue_reg', TRUE);
246 246
 		$this->admin_request = is_admin() && ! EE_Registry::instance()->REQ->ajax;
247
-		$this->reg_cache_where_params = array( 'order_by' => array( 'REG_count' => 'ASC' ));
247
+		$this->reg_cache_where_params = array('order_by' => array('REG_count' => 'ASC'));
248 248
 	}
249 249
 
250 250
 
@@ -254,8 +254,8 @@  discard block
 block discarded – undo
254 254
 	 * @return array
255 255
 	 */
256 256
 	public function any_reg_status_updated() {
257
-		foreach ( $this->reg_status_updated as $reg_status ) {
258
-			if ( $reg_status ) {
257
+		foreach ($this->reg_status_updated as $reg_status) {
258
+			if ($reg_status) {
259 259
 				return true;
260 260
 			}
261 261
 		}
@@ -268,8 +268,8 @@  discard block
 block discarded – undo
268 268
 	 * @param $REG_ID
269 269
 	 * @return array
270 270
 	 */
271
-	public function reg_status_updated( $REG_ID ) {
272
-		return isset( $this->reg_status_updated[ $REG_ID ] ) ? $this->reg_status_updated[ $REG_ID ] : false;
271
+	public function reg_status_updated($REG_ID) {
272
+		return isset($this->reg_status_updated[$REG_ID]) ? $this->reg_status_updated[$REG_ID] : false;
273 273
 	}
274 274
 
275 275
 
@@ -278,8 +278,8 @@  discard block
 block discarded – undo
278 278
 	 * @param $REG_ID
279 279
 	 * @param $reg_status
280 280
 	 */
281
-	public function set_reg_status_updated( $REG_ID, $reg_status ) {
282
-		$this->reg_status_updated[ $REG_ID ] = filter_var( $reg_status, FILTER_VALIDATE_BOOLEAN );
281
+	public function set_reg_status_updated($REG_ID, $reg_status) {
282
+		$this->reg_status_updated[$REG_ID] = filter_var($reg_status, FILTER_VALIDATE_BOOLEAN);
283 283
 	}
284 284
 
285 285
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 	 * can ONLY be set by the  Finalize_Registration reg step
301 301
 	 */
302 302
 	public function set_exit_spco() {
303
-		if ( $this->current_step instanceof EE_SPCO_Reg_Step_Finalize_Registration ) {
303
+		if ($this->current_step instanceof EE_SPCO_Reg_Step_Finalize_Registration) {
304 304
 			$this->exit_spco = true;
305 305
 		}
306 306
 	}
@@ -317,12 +317,12 @@  discard block
 block discarded – undo
317 317
 	 */
318 318
 	public function reset_for_current_request() {
319 319
 		$this->process_form_submission = FALSE;
320
-		$this->continue_reg = apply_filters( 'FHEE__EE_Checkout___construct___continue_reg', true );
320
+		$this->continue_reg = apply_filters('FHEE__EE_Checkout___construct___continue_reg', true);
321 321
 		$this->admin_request = is_admin() && ! EE_Registry::instance()->REQ->front_ajax;
322 322
 		$this->continue_reg = true;
323 323
 		$this->redirect = false;
324 324
 		// don't reset the cached redirect form if we're about to be asked to display it !!!
325
-		if ( EE_Registry::instance()->REQ->get( 'action', 'display_spco_reg_step' ) !== 'redirect_form' ) {
325
+		if (EE_Registry::instance()->REQ->get('action', 'display_spco_reg_step') !== 'redirect_form') {
326 326
 			$this->redirect_form = '';
327 327
 		}
328 328
 		$this->redirect_url = '';
@@ -339,8 +339,8 @@  discard block
 block discarded – undo
339 339
 	 * @param EE_SPCO_Reg_Step $reg_step_obj
340 340
 	 * @return    void
341 341
 	 */
342
-	public function add_reg_step( EE_SPCO_Reg_Step $reg_step_obj ) {
343
-		$this->reg_steps[ $reg_step_obj->slug()  ] = $reg_step_obj;
342
+	public function add_reg_step(EE_SPCO_Reg_Step $reg_step_obj) {
343
+		$this->reg_steps[$reg_step_obj->slug()] = $reg_step_obj;
344 344
 	}
345 345
 
346 346
 
@@ -356,14 +356,14 @@  discard block
 block discarded – undo
356 356
 	 * @param string $reg_step_slug
357 357
 	 * @return    void
358 358
 	 */
359
-	public function skip_reg_step( $reg_step_slug = '' ) {
360
-		$step_to_skip = $this->find_reg_step( $reg_step_slug );
361
-		if ( $step_to_skip instanceof EE_SPCO_Reg_Step && $step_to_skip->is_current_step() ) {
359
+	public function skip_reg_step($reg_step_slug = '') {
360
+		$step_to_skip = $this->find_reg_step($reg_step_slug);
361
+		if ($step_to_skip instanceof EE_SPCO_Reg_Step && $step_to_skip->is_current_step()) {
362 362
 			// advance to the next step
363
-			$this->set_current_step( $this->next_step->slug() );
364
-			$step_to_skip->set_is_current_step( false );
363
+			$this->set_current_step($this->next_step->slug());
364
+			$step_to_skip->set_is_current_step(false);
365 365
 			$step_to_skip->set_completed();
366
-			$this->set_reg_step_initiated( $this->current_step );
366
+			$this->set_reg_step_initiated($this->current_step);
367 367
 		}
368 368
 	}
369 369
 
@@ -377,16 +377,16 @@  discard block
 block discarded – undo
377 377
 	 * @param bool   $reset whether to reset reg steps after removal
378 378
 	 * @throws EE_Error
379 379
 	 */
380
-	public function remove_reg_step( $reg_step_slug = '', $reset = true ) {
381
-		unset( $this->reg_steps[ $reg_step_slug  ] );
382
-		if ( $this->transaction instanceof EE_Transaction ) {
380
+	public function remove_reg_step($reg_step_slug = '', $reset = true) {
381
+		unset($this->reg_steps[$reg_step_slug]);
382
+		if ($this->transaction instanceof EE_Transaction) {
383 383
 			/** @type EE_Transaction_Processor $transaction_processor */
384
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
384
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
385 385
 			// now remove reg step from TXN and save
386
-			$transaction_processor->remove_reg_step( $this->transaction, $reg_step_slug );
386
+			$transaction_processor->remove_reg_step($this->transaction, $reg_step_slug);
387 387
 			$this->transaction->save();
388 388
 		}
389
-		if ( $reset ) {
389
+		if ($reset) {
390 390
 			$this->reset_reg_steps();
391 391
 		}
392 392
 	}
@@ -401,9 +401,9 @@  discard block
 block discarded – undo
401 401
 	 * @param int    $order
402 402
 	 * @return    void
403 403
 	 */
404
-	public function set_reg_step_order( $reg_step_slug = '', $order = 100 ) {
405
-		if ( isset( $this->reg_steps[ $reg_step_slug  ] )) {
406
-			$this->reg_steps[ $reg_step_slug ]->set_order( $order );
404
+	public function set_reg_step_order($reg_step_slug = '', $order = 100) {
405
+		if (isset($this->reg_steps[$reg_step_slug])) {
406
+			$this->reg_steps[$reg_step_slug]->set_order($order);
407 407
 		}
408 408
 	}
409 409
 
@@ -416,25 +416,25 @@  discard block
 block discarded – undo
416 416
 	 * @param string $current_step
417 417
 	 * @return    void
418 418
 	 */
419
-	public function set_current_step( $current_step ) {
419
+	public function set_current_step($current_step) {
420 420
 		// grab what step we're on
421
-		$this->current_step = isset( $this->reg_steps[ $current_step ] ) ? $this->reg_steps[ $current_step ] : reset( $this->reg_steps );
421
+		$this->current_step = isset($this->reg_steps[$current_step]) ? $this->reg_steps[$current_step] : reset($this->reg_steps);
422 422
 		// verify instance
423
-		if ( $this->current_step instanceof EE_SPCO_Reg_Step ) {
423
+		if ($this->current_step instanceof EE_SPCO_Reg_Step) {
424 424
 			// we don't want to repeat completed steps if this is the first time through SPCO
425
-			if ( $this->continue_reg && $this->current_step->completed() && ! $this->revisit ) {
425
+			if ($this->continue_reg && $this->current_step->completed() && ! $this->revisit) {
426 426
 				// so advance to the next step
427 427
 				$this->set_next_step();
428
-				if ( $this->next_step instanceof EE_SPCO_Reg_Step ) {
428
+				if ($this->next_step instanceof EE_SPCO_Reg_Step) {
429 429
 					// and attempt to set it as the current step
430
-					$this->set_current_step( $this->next_step->slug() );
430
+					$this->set_current_step($this->next_step->slug());
431 431
 				}
432 432
 				return;
433 433
 			}
434
-			$this->current_step->set_is_current_step( TRUE );
434
+			$this->current_step->set_is_current_step(TRUE);
435 435
 		} else {
436 436
 			EE_Error::add_error(
437
-				__( 'The current step could not be set.', 'event_espresso' ),
437
+				__('The current step could not be set.', 'event_espresso'),
438 438
 				__FILE__, __FUNCTION__, __LINE__
439 439
 			);
440 440
 		}
@@ -451,20 +451,20 @@  discard block
 block discarded – undo
451 451
 	 */
452 452
 	public function set_next_step() {
453 453
 		// set pointer to start of array
454
-		reset( $this->reg_steps );
454
+		reset($this->reg_steps);
455 455
 		// if there is more than one step
456
-		if ( count( $this->reg_steps ) > 1 ) {
456
+		if (count($this->reg_steps) > 1) {
457 457
 			// advance to the current step and set pointer
458
-			while ( key( $this->reg_steps ) != $this->current_step->slug() && key( $this->reg_steps ) != '' ) {
459
-				next( $this->reg_steps );
458
+			while (key($this->reg_steps) != $this->current_step->slug() && key($this->reg_steps) != '') {
459
+				next($this->reg_steps);
460 460
 			}
461 461
 		}
462 462
 		// advance one more spot ( if it exists )
463
-		$this->next_step = next( $this->reg_steps );
463
+		$this->next_step = next($this->reg_steps);
464 464
 		// verify instance
465
-		$this->next_step = $this->next_step instanceof EE_SPCO_Reg_Step ? $this->next_step  : NULL;
465
+		$this->next_step = $this->next_step instanceof EE_SPCO_Reg_Step ? $this->next_step : NULL;
466 466
 		// then back to current step to reset
467
-		prev( $this->reg_steps );
467
+		prev($this->reg_steps);
468 468
 	}
469 469
 
470 470
 
@@ -478,8 +478,8 @@  discard block
 block discarded – undo
478 478
 	 *  @return 	EE_SPCO_Reg_Step | null
479 479
 	 */
480 480
 	public function get_next_reg_step() {
481
-		$next = next( $this->reg_steps );
482
-		prev( $this->reg_steps );
481
+		$next = next($this->reg_steps);
482
+		prev($this->reg_steps);
483 483
 		return $next instanceof EE_SPCO_Reg_Step ? $next : null;
484 484
 	}
485 485
 
@@ -494,8 +494,8 @@  discard block
 block discarded – undo
494 494
 	 *  @return 	EE_SPCO_Reg_Step | null
495 495
 	 */
496 496
 	public function get_prev_reg_step() {
497
-		$prev = prev( $this->reg_steps );
498
-		next( $this->reg_steps );
497
+		$prev = prev($this->reg_steps);
498
+		next($this->reg_steps);
499 499
 		return $prev instanceof EE_SPCO_Reg_Step ? $prev : null;
500 500
 	}
501 501
 
@@ -508,8 +508,8 @@  discard block
 block discarded – undo
508 508
 	 * @return void
509 509
 	 */
510 510
 	public function sort_reg_steps() {
511
-		$reg_step_sorting_callback = apply_filters( 'FHEE__EE_Checkout__sort_reg_steps__reg_step_sorting_callback', 'reg_step_sorting_callback' );
512
-		uasort( $this->reg_steps, array( $this, $reg_step_sorting_callback ));
511
+		$reg_step_sorting_callback = apply_filters('FHEE__EE_Checkout__sort_reg_steps__reg_step_sorting_callback', 'reg_step_sorting_callback');
512
+		uasort($this->reg_steps, array($this, $reg_step_sorting_callback));
513 513
 	}
514 514
 
515 515
 
@@ -522,19 +522,19 @@  discard block
 block discarded – undo
522 522
 	 * @param string $reg_step_slug
523 523
 	 * @return EE_SPCO_Reg_Step|null
524 524
 	 */
525
-	public function find_reg_step( $reg_step_slug = '' ) {
526
-		if ( ! empty( $reg_step_slug ) ) {
525
+	public function find_reg_step($reg_step_slug = '') {
526
+		if ( ! empty($reg_step_slug)) {
527 527
 			// copy reg step array
528 528
 			$reg_steps = $this->reg_steps;
529 529
 			// set pointer to start of array
530
-			reset( $reg_steps );
530
+			reset($reg_steps);
531 531
 			// if there is more than one step
532
-			if ( count( $reg_steps ) > 1 ) {
532
+			if (count($reg_steps) > 1) {
533 533
 				// advance to the current step and set pointer
534
-				while ( key( $reg_steps ) != $reg_step_slug && key( $reg_steps ) != '' ) {
535
-					next( $reg_steps );
534
+				while (key($reg_steps) != $reg_step_slug && key($reg_steps) != '') {
535
+					next($reg_steps);
536 536
 				}
537
-				return current( $reg_steps );
537
+				return current($reg_steps);
538 538
 			}
539 539
 		}
540 540
 		return null;
@@ -550,17 +550,17 @@  discard block
 block discarded – undo
550 550
 	 * @param EE_SPCO_Reg_Step $reg_step_B
551 551
 	 * @return array()
552 552
 	 */
553
-	public function reg_step_sorting_callback( EE_SPCO_Reg_Step $reg_step_A, EE_SPCO_Reg_Step $reg_step_B ) {
553
+	public function reg_step_sorting_callback(EE_SPCO_Reg_Step $reg_step_A, EE_SPCO_Reg_Step $reg_step_B) {
554 554
 		// send finalize_registration step to the end of the array
555
-		if ( $reg_step_A->slug() == 'finalize_registration' ) {
555
+		if ($reg_step_A->slug() == 'finalize_registration') {
556 556
 			return 1;
557
-		} else if ( $reg_step_B->slug() == 'finalize_registration' ) {
557
+		} else if ($reg_step_B->slug() == 'finalize_registration') {
558 558
 			return -1;
559 559
 		}
560
-		if ( $reg_step_A->order() == $reg_step_B->order() ) {
560
+		if ($reg_step_A->order() == $reg_step_B->order()) {
561 561
 			return 0;
562 562
 		}
563
-		return ( $reg_step_A->order() > $reg_step_B->order() ) ? 1 : -1;
563
+		return ($reg_step_A->order() > $reg_step_B->order()) ? 1 : -1;
564 564
 	}
565 565
 
566 566
 
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 	 * @access 	public
572 572
 	 * @param 	EE_SPCO_Reg_Step $reg_step
573 573
 	 */
574
-	public function set_reg_step_initiated( EE_SPCO_Reg_Step $reg_step ) {
574
+	public function set_reg_step_initiated(EE_SPCO_Reg_Step $reg_step) {
575 575
 		// call set_reg_step_initiated ???
576 576
 		if (
577 577
 			// first time visiting SPCO ?
@@ -580,13 +580,13 @@  discard block
 block discarded – undo
580 580
 			&& $this->action === 'display_spco_reg_step'
581 581
 		) {
582 582
 			/** @type EE_Transaction_Processor $transaction_processor */
583
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
583
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
584 584
 			// set the start time for this reg step
585
-			if ( ! $transaction_processor->set_reg_step_initiated( $this->transaction, $reg_step->slug() ) ) {
586
-				if ( WP_DEBUG ) {
585
+			if ( ! $transaction_processor->set_reg_step_initiated($this->transaction, $reg_step->slug())) {
586
+				if (WP_DEBUG) {
587 587
 					EE_Error::add_error(
588 588
 						sprintf(
589
-							__( 'The "%1$s" registration step was not initialized properly.', 'event_espresso' ),
589
+							__('The "%1$s" registration step was not initialized properly.', 'event_espresso'),
590 590
 							$reg_step->name()
591 591
 						),
592 592
 						__FILE__, __FUNCTION__, __LINE__
@@ -605,10 +605,10 @@  discard block
 block discarded – undo
605 605
 	 * 	@return 	void
606 606
 	 */
607 607
 	public function set_reg_step_JSON_info() {
608
-		EE_Registry::$i18n_js_strings[ 'reg_steps' ] = array();
608
+		EE_Registry::$i18n_js_strings['reg_steps'] = array();
609 609
 		// pass basic reg step data to JS
610
-		foreach ( $this->reg_steps as $reg_step ) {
611
-			EE_Registry::$i18n_js_strings[ 'reg_steps' ][] = $reg_step->slug();
610
+		foreach ($this->reg_steps as $reg_step) {
611
+			EE_Registry::$i18n_js_strings['reg_steps'][] = $reg_step->slug();
612 612
 		}
613 613
 		// reset reg step html
614 614
 //		$this->json_response->set_reg_step_html( '' );
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 	 */
625 625
 	public function reset_reg_steps() {
626 626
 		$this->sort_reg_steps();
627
-		$this->set_current_step( EE_Registry::instance()->REQ->get( 'step' ));
627
+		$this->set_current_step(EE_Registry::instance()->REQ->get('step'));
628 628
 		$this->set_next_step();
629 629
 		// the text that appears on the reg step form submit button
630 630
 		$this->current_step->set_submit_button_text();
@@ -641,9 +641,9 @@  discard block
 block discarded – undo
641 641
 	 */
642 642
 	public function get_registration_time_limit() {
643 643
 
644
-		$registration_time_limit = (float)( EE_Registry::instance()	->SSN->expiration() - time() );
644
+		$registration_time_limit = (float) (EE_Registry::instance()	->SSN->expiration() - time());
645 645
 		$time_limit_format = $registration_time_limit > 60 * MINUTE_IN_SECONDS ? 'H:i:s' : 'i:s';
646
-		$registration_time_limit = gmdate( $time_limit_format, $registration_time_limit );
646
+		$registration_time_limit = gmdate($time_limit_format, $registration_time_limit);
647 647
 		return apply_filters(
648 648
 			'FHEE__EE_Checkout__get_registration_time_limit__registration_time_limit',
649 649
 			$registration_time_limit
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 		//		overpaid TXN
664 664
 		//		free TXN ( total = 0.00 )
665 665
 		// then payment required is TRUE
666
-		return ! ( $this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free() ) ? TRUE : FALSE;
666
+		return ! ($this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free()) ? TRUE : FALSE;
667 667
 	}
668 668
 
669 669
 
@@ -675,12 +675,12 @@  discard block
 block discarded – undo
675 675
 	 * @param EE_Transaction $transaction
676 676
 	 * @return EE_Cart
677 677
 	 */
678
-	public function get_cart_for_transaction( $transaction ) {
679
-		$session = EE_Registry::instance()->load_core( 'Session' );
680
-		$cart = $transaction instanceof EE_Transaction ? EE_Cart::get_cart_from_txn( $transaction, $session ) : null;
678
+	public function get_cart_for_transaction($transaction) {
679
+		$session = EE_Registry::instance()->load_core('Session');
680
+		$cart = $transaction instanceof EE_Transaction ? EE_Cart::get_cart_from_txn($transaction, $session) : null;
681 681
 		// verify cart
682
-		if ( ! $cart instanceof EE_Cart ) {
683
-			$cart = EE_Registry::instance()->load_core( 'Cart' );
682
+		if ( ! $cart instanceof EE_Cart) {
683
+			$cart = EE_Registry::instance()->load_core('Cart');
684 684
 		}
685 685
 
686 686
 		return $cart;
@@ -696,8 +696,8 @@  discard block
 block discarded – undo
696 696
 	 */
697 697
 	public function initialize_txn_reg_steps_array() {
698 698
 		$txn_reg_steps_array = array();
699
-		foreach ( $this->reg_steps as $reg_step ) {
700
-			$txn_reg_steps_array[ $reg_step->slug() ] = FALSE;
699
+		foreach ($this->reg_steps as $reg_step) {
700
+			$txn_reg_steps_array[$reg_step->slug()] = FALSE;
701 701
 		}
702 702
 		return $txn_reg_steps_array;
703 703
 	}
@@ -713,13 +713,13 @@  discard block
 block discarded – undo
713 713
 	public function update_txn_reg_steps_array() {
714 714
 		$updated = FALSE;
715 715
 		/** @type EE_Transaction_Processor $transaction_processor */
716
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
717
-		foreach ( $this->reg_steps as $reg_step ) {
718
-			if ( $reg_step->completed() ) {
719
-				$updated = $transaction_processor->set_reg_step_completed( $this->transaction, $reg_step->slug() ) ? TRUE : $updated;
716
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
717
+		foreach ($this->reg_steps as $reg_step) {
718
+			if ($reg_step->completed()) {
719
+				$updated = $transaction_processor->set_reg_step_completed($this->transaction, $reg_step->slug()) ? TRUE : $updated;
720 720
 			}
721 721
 		}
722
-		if ( $updated ) {
722
+		if ($updated) {
723 723
 			$this->transaction->save();
724 724
 		}
725 725
 		return $updated;
@@ -734,14 +734,14 @@  discard block
 block discarded – undo
734 734
 	 * 	@return 	void
735 735
 	 */
736 736
 	public function stash_transaction_and_checkout() {
737
-		if ( ! $this->revisit ) {
737
+		if ( ! $this->revisit) {
738 738
 			$this->update_txn_reg_steps_array();
739 739
 		}
740 740
 		$this->track_transaction_and_registration_status_updates();
741 741
 		// save all data to the db, but suppress errors
742 742
 		//$this->save_all_data( FALSE );
743 743
 		// cache the checkout in the session
744
-		EE_Registry::instance()->SSN->set_checkout( $this );
744
+		EE_Registry::instance()->SSN->set_checkout($this);
745 745
 	}
746 746
 
747 747
 
@@ -757,21 +757,21 @@  discard block
 block discarded – undo
757 757
 	 */
758 758
 	public function track_transaction_and_registration_status_updates() {
759 759
 		// verify the transaction
760
-		if ( $this->transaction instanceof EE_Transaction ) {
760
+		if ($this->transaction instanceof EE_Transaction) {
761 761
 			/** @type EE_Transaction_Payments $transaction_payments */
762
-			$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
762
+			$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
763 763
 			/** @type EE_Transaction_Processor $transaction_processor */
764
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
764
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
765 765
 			// has there been a TXN status change during this checkout?
766
-			if ( $transaction_payments->txn_status_updated() || $transaction_processor->txn_status_updated() ) {
766
+			if ($transaction_payments->txn_status_updated() || $transaction_processor->txn_status_updated()) {
767 767
 				$this->txn_status_updated = true;
768 768
 			}
769 769
 			/** @type EE_Registration_Processor $registration_processor */
770
-			$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
770
+			$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
771 771
 			// grab the saved registrations from the transaction
772
-			foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $registration ) {
773
-				if ( $registration_processor->reg_status_updated( $registration->ID() ) ) {
774
-					$this->set_reg_status_updated( $registration->ID(), true );
772
+			foreach ($this->transaction->registrations($this->reg_cache_where_params) as $registration) {
773
+				if ($registration_processor->reg_status_updated($registration->ID())) {
774
+					$this->set_reg_status_updated($registration->ID(), true);
775 775
 				}
776 776
 			}
777 777
 		}
@@ -793,8 +793,8 @@  discard block
 block discarded – undo
793 793
 	 * @param 	EE_Registration 	$registration
794 794
 	 * 	@return 	bool
795 795
 	 */
796
-	public function visit_allows_processing_of_this_registration( EE_Registration $registration ) {
797
-		return ! $this->revisit || $this->primary_revisit || ( $this->revisit && $this->reg_url_link == $registration->reg_url_link() ) ? TRUE : FALSE;
796
+	public function visit_allows_processing_of_this_registration(EE_Registration $registration) {
797
+		return ! $this->revisit || $this->primary_revisit || ($this->revisit && $this->reg_url_link == $registration->reg_url_link()) ? TRUE : FALSE;
798 798
 	}
799 799
 
800 800
 
@@ -819,18 +819,18 @@  discard block
 block discarded – undo
819 819
 	 * @param bool $show_errors
820 820
 	 * @return bool
821 821
 	 */
822
-	public function save_all_data( $show_errors = TRUE ) {
822
+	public function save_all_data($show_errors = TRUE) {
823 823
 		// verify the transaction
824
-		if ( $this->transaction instanceof EE_Transaction ) {
824
+		if ($this->transaction instanceof EE_Transaction) {
825 825
 			// save to ensure that TXN has ID
826 826
 			$this->transaction->save();
827 827
 			// grab the saved registrations from the transaction
828
-			foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as  $registration ) {
829
-				$this->_save_registration( $registration, $show_errors );
828
+			foreach ($this->transaction->registrations($this->reg_cache_where_params) as  $registration) {
829
+				$this->_save_registration($registration, $show_errors);
830 830
 			}
831 831
 		} else {
832
-			if ( $show_errors ) {
833
-				EE_Error::add_error( __( 'A valid Transaction was not found when attempting to save your registration information.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
832
+			if ($show_errors) {
833
+				EE_Error::add_error(__('A valid Transaction was not found when attempting to save your registration information.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
834 834
 			}
835 835
 			return FALSE;
836 836
 		}
@@ -845,32 +845,32 @@  discard block
 block discarded – undo
845 845
 	 * @param bool $show_errors
846 846
 	 * @return void
847 847
 	 */
848
-	private function _save_registration( $registration, $show_errors = TRUE  ) {
848
+	private function _save_registration($registration, $show_errors = TRUE) {
849 849
 		// verify object
850
-		if ( $registration instanceof EE_Registration ) {
850
+		if ($registration instanceof EE_Registration) {
851 851
 			// should this registration be processed during this visit ?
852
-			if ( $this->visit_allows_processing_of_this_registration( $registration ) ) {
852
+			if ($this->visit_allows_processing_of_this_registration($registration)) {
853 853
 				//set TXN ID
854
-				if ( ! $registration->transaction_ID() ) {
855
-					$registration->set_transaction_id( $this->transaction->ID() );
854
+				if ( ! $registration->transaction_ID()) {
855
+					$registration->set_transaction_id($this->transaction->ID());
856 856
 				}
857 857
 				// verify and save the attendee
858
-				$this->_save_registration_attendee( $registration, $show_errors );
858
+				$this->_save_registration_attendee($registration, $show_errors);
859 859
 				// save answers to reg form questions
860
-				$this->_save_registration_answers( $registration, $show_errors );
860
+				$this->_save_registration_answers($registration, $show_errors);
861 861
 				// save changes
862 862
 				$registration->save();
863 863
 				// update txn cache
864
-				if ( ! $this->transaction->update_cache_after_object_save( 'Registration', $registration )) {
865
-					if ( $show_errors ) {
866
-						EE_Error::add_error( __( 'The newly saved Registration object could not be cached on the Transaction.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
864
+				if ( ! $this->transaction->update_cache_after_object_save('Registration', $registration)) {
865
+					if ($show_errors) {
866
+						EE_Error::add_error(__('The newly saved Registration object could not be cached on the Transaction.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
867 867
 					}
868 868
 				}
869 869
 			}
870 870
 		} else {
871
-			if ( $show_errors ) {
871
+			if ($show_errors) {
872 872
 				EE_Error::add_error(
873
-					__( 'An invalid Registration object was discovered when attempting to save your registration information.', 'event_espresso' ),
873
+					__('An invalid Registration object was discovered when attempting to save your registration information.', 'event_espresso'),
874 874
 					__FILE__, __FUNCTION__, __LINE__
875 875
 				);
876 876
 			}
@@ -886,26 +886,26 @@  discard block
 block discarded – undo
886 886
 	 * @param bool $show_errors
887 887
 	 * @return void
888 888
 	 */
889
-	private function _save_registration_attendee( $registration, $show_errors = TRUE ) {
890
-		if ( $registration->attendee() instanceof EE_Attendee ) {
889
+	private function _save_registration_attendee($registration, $show_errors = TRUE) {
890
+		if ($registration->attendee() instanceof EE_Attendee) {
891 891
 			// save so that ATT has ID
892 892
 			$registration->attendee()->save();
893
-			if ( ! $registration->update_cache_after_object_save( 'Attendee', $registration->attendee() )) {
894
-				if ( $show_errors ) {
893
+			if ( ! $registration->update_cache_after_object_save('Attendee', $registration->attendee())) {
894
+				if ($show_errors) {
895 895
 					EE_Error::add_error(
896
-						__( 'The newly saved Attendee object could not be cached on the registration.', 'event_espresso' ),
896
+						__('The newly saved Attendee object could not be cached on the registration.', 'event_espresso'),
897 897
 						__FILE__, __FUNCTION__, __LINE__
898 898
 					);
899 899
 				}
900 900
 			}
901 901
 		} else {
902
-			if ( $show_errors ) {
902
+			if ($show_errors) {
903 903
 				ob_start();
904
-				var_dump( $registration->attendee() );
904
+				var_dump($registration->attendee());
905 905
 				EE_Error::add_error(
906 906
 					sprintf(
907 907
 						'%1$s||%1$s $attendee = %2$s',
908
-						__( 'Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso' ),
908
+						__('Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso'),
909 909
 						ob_get_clean()
910 910
 					),
911 911
 					__FILE__, __FUNCTION__, __LINE__
@@ -923,25 +923,25 @@  discard block
 block discarded – undo
923 923
 	 * @param bool $show_errors
924 924
 	 * @return void
925 925
 	 */
926
-	private function _save_registration_answers( $registration, $show_errors = TRUE ) {
926
+	private function _save_registration_answers($registration, $show_errors = TRUE) {
927 927
 		// now save the answers
928
-		foreach ( $registration->answers() as $cache_key => $answer ) {
928
+		foreach ($registration->answers() as $cache_key => $answer) {
929 929
 			// verify object
930
-			if ( $answer instanceof EE_Answer ) {
931
-				$answer->set_registration( $registration->ID() );
930
+			if ($answer instanceof EE_Answer) {
931
+				$answer->set_registration($registration->ID());
932 932
 				$answer->save();
933
-				if ( ! $registration->update_cache_after_object_save( 'Answer', $answer, $cache_key )) {
934
-					if ( $show_errors ) {
933
+				if ( ! $registration->update_cache_after_object_save('Answer', $answer, $cache_key)) {
934
+					if ($show_errors) {
935 935
 						EE_Error::add_error(
936
-							__( 'The newly saved Answer object could not be cached on the registration.', 'event_espresso' ),
936
+							__('The newly saved Answer object could not be cached on the registration.', 'event_espresso'),
937 937
 							__FILE__, __FUNCTION__, __LINE__
938 938
 						);
939 939
 					}
940 940
 				}
941 941
 			} else {
942
-				if ( $show_errors ) {
942
+				if ($show_errors) {
943 943
 					EE_Error::add_error(
944
-						__( 'An invalid Answer object was discovered when attempting to save your registration information.', 'event_espresso' ),
944
+						__('An invalid Answer object was discovered when attempting to save your registration information.', 'event_espresso'),
945 945
 						__FILE__, __FUNCTION__, __LINE__
946 946
 					);
947 947
 				}
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
 	 * @param bool $from_db
960 960
 	 * @return bool
961 961
 	 */
962
-	public function refresh_all_entities( $from_db = false ) {
962
+	public function refresh_all_entities($from_db = false) {
963 963
 		$from_db = $this->current_step->is_final_step() || $this->action == 'process_gateway_response' ? true : $from_db;
964 964
 		//$this->log(
965 965
 		//	__CLASS__, __FUNCTION__, __LINE__,
@@ -980,11 +980,11 @@  discard block
 block discarded – undo
980 980
 	 */
981 981
 	protected function refresh_from_db() {
982 982
 		// verify the transaction
983
-		if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) {
983
+		if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) {
984 984
 			// pull fresh TXN data from the db
985
-			$this->transaction = $this->transaction->get_model()->refresh_entity_map_from_db( $this->transaction->ID() );
985
+			$this->transaction = $this->transaction->get_model()->refresh_entity_map_from_db($this->transaction->ID());
986 986
 			// update EE_Checkout's cached primary_attendee object
987
-			$this->primary_attendee_obj = $this->_refresh_primary_attendee_obj_from_db( $this->transaction );
987
+			$this->primary_attendee_obj = $this->_refresh_primary_attendee_obj_from_db($this->transaction);
988 988
 			// update EE_Checkout's cached payment object
989 989
 			$payment = $this->transaction->last_payment();
990 990
 			$this->payment = $payment instanceof EE_Payment ? $payment : $this->payment;
@@ -992,9 +992,9 @@  discard block
 block discarded – undo
992 992
 			$payment_method = $this->payment instanceof EE_Payment ? $this->payment->payment_method() : null;
993 993
 			$this->payment_method = $payment_method instanceof EE_Payment_Method ? $payment_method : $this->payment_method;
994 994
 			//now refresh the cart, based on the TXN
995
-			$this->cart = $this->get_cart_for_transaction( $this->transaction );
995
+			$this->cart = $this->get_cart_for_transaction($this->transaction);
996 996
 		} else {
997
-			EE_Error::add_error( __( 'A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
997
+			EE_Error::add_error(__('A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
998 998
 			return FALSE;
999 999
 		}
1000 1000
 		return TRUE;
@@ -1008,24 +1008,24 @@  discard block
 block discarded – undo
1008 1008
 	 * @param   EE_Transaction $transaction
1009 1009
 	 * @return  EE_Attendee | null
1010 1010
 	 */
1011
-	protected function _refresh_primary_attendee_obj_from_db( EE_Transaction $transaction ) {
1011
+	protected function _refresh_primary_attendee_obj_from_db(EE_Transaction $transaction) {
1012 1012
 
1013 1013
 		$primary_attendee_obj = null;
1014 1014
 		// grab the saved registrations from the transaction
1015
-		foreach ( $transaction->registrations( $this->reg_cache_where_params, true ) as $registration ) {
1015
+		foreach ($transaction->registrations($this->reg_cache_where_params, true) as $registration) {
1016 1016
 			// verify object
1017
-			if ( $registration instanceof EE_Registration ) {
1017
+			if ($registration instanceof EE_Registration) {
1018 1018
 				$attendee = $registration->attendee();
1019 1019
 				// verify object
1020
-				if ( $attendee instanceof EE_Attendee  ) {
1020
+				if ($attendee instanceof EE_Attendee) {
1021 1021
 					// maybe cache primary_attendee_obj ?
1022
-					if ( $registration->is_primary_registrant() ) {
1022
+					if ($registration->is_primary_registrant()) {
1023 1023
 						$primary_attendee_obj = $attendee;
1024 1024
 					}
1025 1025
 				}
1026 1026
 			} else {
1027 1027
 				EE_Error::add_error(
1028
-						__( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
1028
+						__('An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso'),
1029 1029
 						__FILE__, __FUNCTION__, __LINE__
1030 1030
 				);
1031 1031
 			}
@@ -1045,43 +1045,43 @@  discard block
 block discarded – undo
1045 1045
 	 */
1046 1046
 	protected function refresh_entity_map() {
1047 1047
 		// verify the transaction
1048
-		if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) {
1048
+		if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) {
1049 1049
 			// never cache payment info
1050
-			$this->transaction->clear_cache( 'Payment' );
1050
+			$this->transaction->clear_cache('Payment');
1051 1051
 			/** @type EE_Transaction_Processor $transaction_processor */
1052
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1052
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1053 1053
 			// is the Payment Options Reg Step completed ?
1054
-			if ( $transaction_processor->reg_step_completed( $this->transaction, 'payment_options' ) ) {
1054
+			if ($transaction_processor->reg_step_completed($this->transaction, 'payment_options')) {
1055 1055
 				// then check for payments and update TXN accordingly
1056 1056
 				/** @type EE_Transaction_Payments $transaction_payments */
1057
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1058
-				$transaction_payments->calculate_total_payments_and_update_status( $this->transaction );
1057
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1058
+				$transaction_payments->calculate_total_payments_and_update_status($this->transaction);
1059 1059
 			}
1060 1060
 			// grab the saved registrations from the transaction
1061
-			foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $reg_cache_ID => $registration ) {
1062
-				$this->_refresh_registration( $reg_cache_ID, $registration );
1061
+			foreach ($this->transaction->registrations($this->reg_cache_where_params) as $reg_cache_ID => $registration) {
1062
+				$this->_refresh_registration($reg_cache_ID, $registration);
1063 1063
 			}
1064 1064
 			// make sure our cached TXN is added to the model entity mapper
1065
-			$this->transaction = $this->transaction->get_model()->refresh_entity_map_with( $this->transaction->ID(), $this->transaction );
1065
+			$this->transaction = $this->transaction->get_model()->refresh_entity_map_with($this->transaction->ID(), $this->transaction);
1066 1066
 
1067 1067
 		} else {
1068
-			EE_Error::add_error( __( 'A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
1068
+			EE_Error::add_error(__('A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1069 1069
 			return FALSE;
1070 1070
 		}
1071 1071
 		// verify and update the cart because inaccurate totals are not so much fun
1072
-		if ( $this->cart instanceof EE_Cart ) {
1072
+		if ($this->cart instanceof EE_Cart) {
1073 1073
 			$grand_total = $this->cart->get_grand_total();
1074
-			if ( $grand_total instanceof EE_Line_Item && $grand_total->ID() ) {
1074
+			if ($grand_total instanceof EE_Line_Item && $grand_total->ID()) {
1075 1075
 				$grand_total->recalculate_total_including_taxes();
1076 1076
 				$grand_total = $grand_total->get_model()->refresh_entity_map_with(
1077 1077
 					$this->cart->get_grand_total()->ID(),
1078 1078
 					$this->cart->get_grand_total()
1079 1079
 				);
1080 1080
 			}
1081
-			if ( $grand_total instanceof EE_Line_Item ) {
1082
-				$this->cart = EE_Cart::instance( $grand_total );
1081
+			if ($grand_total instanceof EE_Line_Item) {
1082
+				$this->cart = EE_Cart::instance($grand_total);
1083 1083
 			} else {
1084
-				EE_Error::add_error( __( 'A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1084
+				EE_Error::add_error(__('A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1085 1085
 				return false;
1086 1086
 			}
1087 1087
 		}
@@ -1097,19 +1097,19 @@  discard block
 block discarded – undo
1097 1097
 	 * @param 	EE_Registration 	$registration
1098 1098
 	 * @return void
1099 1099
 	 */
1100
-	protected function _refresh_registration( $reg_cache_ID, $registration ) {
1100
+	protected function _refresh_registration($reg_cache_ID, $registration) {
1101 1101
 
1102 1102
 		// verify object
1103
-		if ( $registration instanceof EE_Registration ) {
1103
+		if ($registration instanceof EE_Registration) {
1104 1104
 			// update the entity mapper attendee
1105
-			$this->_refresh_registration_attendee( $registration );
1105
+			$this->_refresh_registration_attendee($registration);
1106 1106
 			// update the entity mapper answers for reg form questions
1107
-			$this->_refresh_registration_answers( $registration );
1107
+			$this->_refresh_registration_answers($registration);
1108 1108
 			// make sure the cached registration is added to the model entity mapper
1109
-			$registration->get_model()->refresh_entity_map_with( $reg_cache_ID, $registration );
1109
+			$registration->get_model()->refresh_entity_map_with($reg_cache_ID, $registration);
1110 1110
 		} else {
1111 1111
 			EE_Error::add_error(
1112
-				__( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
1112
+				__('An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso'),
1113 1113
 				__FILE__, __FUNCTION__, __LINE__
1114 1114
 			);
1115 1115
 		}
@@ -1123,15 +1123,15 @@  discard block
 block discarded – undo
1123 1123
 	 * @param 	EE_Registration 	$registration
1124 1124
 	 * @return void
1125 1125
 	 */
1126
-	protected function _refresh_registration_attendee( $registration ) {
1126
+	protected function _refresh_registration_attendee($registration) {
1127 1127
 
1128 1128
 		$attendee = $registration->attendee();
1129 1129
 		// verify object
1130
-		if ( $attendee instanceof EE_Attendee && $attendee->ID() ) {
1130
+		if ($attendee instanceof EE_Attendee && $attendee->ID()) {
1131 1131
 			// make sure the cached attendee is added to the model entity mapper
1132
-			$registration->attendee()->get_model()->refresh_entity_map_with( $attendee->ID(), $attendee );
1132
+			$registration->attendee()->get_model()->refresh_entity_map_with($attendee->ID(), $attendee);
1133 1133
 			// maybe cache primary_attendee_obj ?
1134
-			if ( $registration->is_primary_registrant() ) {
1134
+			if ($registration->is_primary_registrant()) {
1135 1135
 				$this->primary_attendee_obj = $attendee;
1136 1136
 			}
1137 1137
 		}
@@ -1145,19 +1145,19 @@  discard block
 block discarded – undo
1145 1145
 	 * @param 	EE_Registration 	$registration
1146 1146
 	 * @return void
1147 1147
 	 */
1148
-	protected function _refresh_registration_answers( $registration ) {
1148
+	protected function _refresh_registration_answers($registration) {
1149 1149
 
1150 1150
 		// now update the answers
1151
-		foreach ( $registration->answers() as $cache_key => $answer ) {
1151
+		foreach ($registration->answers() as $cache_key => $answer) {
1152 1152
 			// verify object
1153
-			if ( $answer instanceof EE_Answer ) {
1154
-				if ( $answer->ID() ) {
1153
+			if ($answer instanceof EE_Answer) {
1154
+				if ($answer->ID()) {
1155 1155
 					// make sure the cached answer is added to the model entity mapper
1156
-					$answer->get_model()->refresh_entity_map_with( $answer->ID(), $answer );
1156
+					$answer->get_model()->refresh_entity_map_with($answer->ID(), $answer);
1157 1157
 				}
1158 1158
 			} else {
1159 1159
 				EE_Error::add_error(
1160
-					__( 'An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
1160
+					__('An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso'),
1161 1161
 					__FILE__, __FUNCTION__, __LINE__
1162 1162
 				);
1163 1163
 			}
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
 	 * this will reinstate the EE_Checkout object on each EE_SPCO_Reg_Step object
1173 1173
 	 */
1174 1174
 	function __wakeup() {
1175
-		foreach ( $this->reg_steps as $reg_step ) {
1175
+		foreach ($this->reg_steps as $reg_step) {
1176 1176
 			$reg_step->checkout = $this;
1177 1177
 		}
1178 1178
 	}
@@ -1188,11 +1188,11 @@  discard block
 block discarded – undo
1188 1188
 	 * @param array $info
1189 1189
 	 * @param bool $display_request
1190 1190
 	 */
1191
-	function log( $class = '', $func = '', $line = '', $info = array(), $display_request = false ) {
1192
-		if ( WP_DEBUG && false ) {
1193
-			$debug_data = get_option( 'EE_DEBUG_SPCO_' . EE_Session::instance()->id(), array() );
1191
+	function log($class = '', $func = '', $line = '', $info = array(), $display_request = false) {
1192
+		if (WP_DEBUG && false) {
1193
+			$debug_data = get_option('EE_DEBUG_SPCO_'.EE_Session::instance()->id(), array());
1194 1194
 			$default_data = array(
1195
-				$class 		=> $func . '() : ' . $line,
1195
+				$class 		=> $func.'() : '.$line,
1196 1196
 				'request->step' 		=> $this->step,
1197 1197
 				'request->action' 	=> $this->action,
1198 1198
 				'current_step->slug' => $this->current_step instanceof EE_SPCO_Reg_Step ?
@@ -1204,24 +1204,24 @@  discard block
 block discarded – undo
1204 1204
 				'reg_url_link' => $this->reg_url_link,
1205 1205
 				'REQ' => $display_request ? $_REQUEST : '',
1206 1206
 			);
1207
-			if ( $this->transaction instanceof EE_Transaction ) {
1208
-				$default_data[ 'TXN_status' ] 		= $this->transaction->status_ID();
1209
-				$default_data[ 'TXN_reg_steps' ] 	= $this->transaction->reg_steps();
1210
-				foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $REG_ID => $registration ) {
1211
-					$default_data[ 'registrations' ][ $REG_ID ] = $registration->status_ID();
1207
+			if ($this->transaction instanceof EE_Transaction) {
1208
+				$default_data['TXN_status'] = $this->transaction->status_ID();
1209
+				$default_data['TXN_reg_steps'] = $this->transaction->reg_steps();
1210
+				foreach ($this->transaction->registrations($this->reg_cache_where_params) as $REG_ID => $registration) {
1211
+					$default_data['registrations'][$REG_ID] = $registration->status_ID();
1212 1212
 				}
1213
-				if ( $this->transaction->ID() ) {
1214
-					$TXN_ID = 'EE_Transaction: ' . $this->transaction->ID();
1213
+				if ($this->transaction->ID()) {
1214
+					$TXN_ID = 'EE_Transaction: '.$this->transaction->ID();
1215 1215
 					// don't serialize objects
1216
-					$info = $this->_strip_objects( $info );
1217
-					if ( ! isset( $debug_data[ $TXN_ID ] ) ) {
1218
-						$debug_data[ $TXN_ID ] = array();
1216
+					$info = $this->_strip_objects($info);
1217
+					if ( ! isset($debug_data[$TXN_ID])) {
1218
+						$debug_data[$TXN_ID] = array();
1219 1219
 					}
1220
-					$debug_data[ $TXN_ID ][ microtime() ] = array_merge(
1220
+					$debug_data[$TXN_ID][microtime()] = array_merge(
1221 1221
 						$default_data,
1222 1222
 						$info
1223 1223
 					);
1224
-					update_option( 'EE_DEBUG_SPCO_' . EE_Session::instance()->id(), $debug_data );
1224
+					update_option('EE_DEBUG_SPCO_'.EE_Session::instance()->id(), $debug_data);
1225 1225
 				}
1226 1226
 			}
1227 1227
 		}
@@ -1234,23 +1234,23 @@  discard block
 block discarded – undo
1234 1234
 	 * @param array $info
1235 1235
 	 * @return array
1236 1236
 	 */
1237
-	function _strip_objects( $info = array() ) {
1238
-		foreach ( $info as $key => $value ) {
1239
-			if ( is_array( $value )) {
1240
-				$info[ $key ] = $this->_strip_objects( $value );
1241
-			} else if ( is_object( $value ) ) {
1242
-				$object_class = get_class( $value );
1243
-				$info[ $object_class ] = array();
1244
-				$info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0;
1245
-				if ( method_exists( $value, 'status' ) ) {
1246
-					$info[ $object_class ][ 'status' ] = $value->status();
1247
-				} else if ( method_exists( $value, 'status_ID' ) ) {
1248
-					$info[ $object_class ][ 'status' ] = $value->status_ID();
1237
+	function _strip_objects($info = array()) {
1238
+		foreach ($info as $key => $value) {
1239
+			if (is_array($value)) {
1240
+				$info[$key] = $this->_strip_objects($value);
1241
+			} else if (is_object($value)) {
1242
+				$object_class = get_class($value);
1243
+				$info[$object_class] = array();
1244
+				$info[$object_class]['ID'] = method_exists($value, 'ID') ? $value->ID() : 0;
1245
+				if (method_exists($value, 'status')) {
1246
+					$info[$object_class]['status'] = $value->status();
1247
+				} else if (method_exists($value, 'status_ID')) {
1248
+					$info[$object_class]['status'] = $value->status_ID();
1249 1249
 				}
1250
-				unset( $info[ $key ] );
1250
+				unset($info[$key]);
1251 1251
 			}
1252 1252
 		}
1253
-		return (array)$info;
1253
+		return (array) $info;
1254 1254
 	}
1255 1255
 
1256 1256
 
Please login to merge, or discard this patch.
modules/single_page_checkout/inc/EE_SPCO_JSON_Response.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
  /**
3
- *
4
- * Class EE_SPCO_JSON_Response
5
- *
6
- * Description
7
- *
8
- * @package         Event Espresso
9
- * @subpackage    core
10
- * @author				Brent Christensen
11
- * @since		 	   $VID:$
12
- *
13
- */
3
+  *
4
+  * Class EE_SPCO_JSON_Response
5
+  *
6
+  * Description
7
+  *
8
+  * @package         Event Espresso
9
+  * @subpackage    core
10
+  * @author				Brent Christensen
11
+  * @since		 	   $VID:$
12
+  *
13
+  */
14 14
 class EE_SPCO_JSON_Response {
15 15
 
16 16
 	/**
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -107,71 +107,71 @@  discard block
 block discarded – undo
107 107
 	public function __toString() {
108 108
 		$JSON_response = array();
109 109
 		// grab notices
110
-		$notices = EE_Error::get_notices( FALSE );
111
-		$this->set_attention( isset( $notices['attention'] ) ? $notices['attention'] : '' );
112
-		$this->set_errors( isset( $notices['errors'] ) ? $notices['errors'] : '' );
113
-		$this->set_success( isset( $notices['success'] ) ? $notices['success'] : '' );
110
+		$notices = EE_Error::get_notices(FALSE);
111
+		$this->set_attention(isset($notices['attention']) ? $notices['attention'] : '');
112
+		$this->set_errors(isset($notices['errors']) ? $notices['errors'] : '');
113
+		$this->set_success(isset($notices['success']) ? $notices['success'] : '');
114 114
 		// add notices to JSON response, but only if they exist
115
-		if ( $this->attention() ) {
115
+		if ($this->attention()) {
116 116
 			$JSON_response['attention'] = $this->attention();
117 117
 		}
118
-		if ( $this->errors() ) {
118
+		if ($this->errors()) {
119 119
 			$JSON_response['errors'] = $this->errors();
120 120
 		}
121
-		if ( $this->unexpected_errors() ) {
121
+		if ($this->unexpected_errors()) {
122 122
 			$JSON_response['unexpected_errors'] = $this->unexpected_errors();
123 123
 		}
124
-		if ( $this->success() ) {
124
+		if ($this->success()) {
125 125
 			$JSON_response['success'] = $this->success();
126 126
 		}
127 127
 		// but if NO notices are set... at least set the "success" as a key so that the JS knows everything worked
128
-		if ( ! isset( $JSON_response[ 'attention' ] ) && ! isset( $JSON_response[ 'errors' ] ) && ! isset( $JSON_response[ 'success' ] ) ) {
128
+		if ( ! isset($JSON_response['attention']) && ! isset($JSON_response['errors']) && ! isset($JSON_response['success'])) {
129 129
 			$JSON_response['success'] = null;
130 130
 		}
131 131
 		// set redirect_url, IF it exists
132
-		if ( $this->redirect_url() ) {
132
+		if ($this->redirect_url()) {
133 133
 			$JSON_response['redirect_url'] = $this->redirect_url();
134 134
 		}
135 135
 		// set registration_time_limit, IF it exists
136
-		if ( $this->registration_time_limit() ) {
136
+		if ($this->registration_time_limit()) {
137 137
 			$JSON_response['registration_time_limit'] = $this->registration_time_limit();
138 138
 		}
139 139
 		// set payment_amount, IF it exists
140
-		if ( $this->payment_amount() !== null ) {
141
-			$JSON_response[ 'payment_amount' ] = $this->payment_amount();
140
+		if ($this->payment_amount() !== null) {
141
+			$JSON_response['payment_amount'] = $this->payment_amount();
142 142
 		}
143 143
 		// grab generic return data
144 144
 		$return_data = $this->return_data();
145 145
 		// add billing form validation rules
146
-		if ( $this->validation_rules() ) {
146
+		if ($this->validation_rules()) {
147 147
 			$return_data['validation_rules'] = $this->validation_rules();
148 148
 		}
149 149
 		// set reg_step_html, IF it exists
150
-		if ( $this->reg_step_html() ) {
150
+		if ($this->reg_step_html()) {
151 151
 			$return_data['reg_step_html'] = $this->reg_step_html();
152 152
 		}
153 153
 		// set method of payment, IF it exists
154
-		if ( $this->method_of_payment() ) {
154
+		if ($this->method_of_payment()) {
155 155
 			$return_data['method_of_payment'] = $this->method_of_payment();
156 156
 		}
157 157
 		// set "plz_select_method_of_payment" message, IF it exists
158
-		if ( $this->plz_select_method_of_payment() ) {
158
+		if ($this->plz_select_method_of_payment()) {
159 159
 			$return_data['plz_select_method_of_payment'] = $this->plz_select_method_of_payment();
160 160
 		}
161 161
 		// set redirect_form, IF it exists
162
-		if ( $this->redirect_form() ) {
162
+		if ($this->redirect_form()) {
163 163
 			$return_data['redirect_form'] = $this->redirect_form();
164 164
 		}
165 165
 		// and finally, add return_data array to main JSON response array, IF it contains anything
166 166
 		// why did we add some of the above properties to the return data array?
167 167
 		// because it is easier and cleaner in the Javascript to deal with this way
168
-		if ( ! empty( $return_data )) {
168
+		if ( ! empty($return_data)) {
169 169
 			$JSON_response['return_data'] = $return_data;
170 170
 		}
171 171
 		// filter final array
172
-		$JSON_response = apply_filters( 'FHEE__EE_SPCO_JSON_Response___toString__JSON_response', $JSON_response );
172
+		$JSON_response = apply_filters('FHEE__EE_SPCO_JSON_Response___toString__JSON_response', $JSON_response);
173 173
 		// return encoded array
174
-		return json_encode( $JSON_response );
174
+		return json_encode($JSON_response);
175 175
 	}
176 176
 
177 177
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	/**
180 180
 	 * @param string $attention
181 181
 	 */
182
-	public function set_attention( $attention ) {
182
+	public function set_attention($attention) {
183 183
 		$this->_attention = $attention;
184 184
 	}
185 185
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	/**
198 198
 	 * @param string $errors
199 199
 	 */
200
-	public function set_errors( $errors ) {
200
+	public function set_errors($errors) {
201 201
 		$this->_errors = $errors;
202 202
 	}
203 203
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	/**
225 225
 	 * @param string $unexpected_errors
226 226
 	 */
227
-	public function set_unexpected_errors( $unexpected_errors ) {
227
+	public function set_unexpected_errors($unexpected_errors) {
228 228
 		$this->_unexpected_errors = $unexpected_errors;
229 229
 	}
230 230
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	/**
234 234
 	 * @param string $success
235 235
 	 */
236
-	public function set_success( $success ) {
236
+	public function set_success($success) {
237 237
 		$this->_success = $success;
238 238
 	}
239 239
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	/**
252 252
 	 * @param string $method_of_payment
253 253
 	 */
254
-	public function set_method_of_payment( $method_of_payment ) {
254
+	public function set_method_of_payment($method_of_payment) {
255 255
 		$this->_method_of_payment = $method_of_payment;
256 256
 	}
257 257
 
@@ -278,9 +278,9 @@  discard block
 block discarded – undo
278 278
 	/**
279 279
 	 * @param float $payment_amount
280 280
 	 */
281
-	public function set_payment_amount( $payment_amount ) {
282
-		EE_Registry::instance()->load_helper( 'Money' );
283
-		$this->_payment_amount = EEH_Money::convert_to_float_from_localized_money( $payment_amount );
281
+	public function set_payment_amount($payment_amount) {
282
+		EE_Registry::instance()->load_helper('Money');
283
+		$this->_payment_amount = EEH_Money::convert_to_float_from_localized_money($payment_amount);
284 284
 	}
285 285
 
286 286
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 	/**
289 289
 	 * @param string $next_step_html
290 290
 	 */
291
-	public function set_reg_step_html( $next_step_html ) {
291
+	public function set_reg_step_html($next_step_html) {
292 292
 		$this->_reg_step_html = $next_step_html;
293 293
 	}
294 294
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	/**
307 307
 	 * @param string $redirect_form
308 308
 	 */
309
-	public function set_redirect_form( $redirect_form ) {
309
+	public function set_redirect_form($redirect_form) {
310 310
 		$this->_redirect_form = $redirect_form;
311 311
 	}
312 312
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 	 * @return string
317 317
 	 */
318 318
 	public function redirect_form() {
319
-		return ! empty( $this->_redirect_form ) ? $this->_redirect_form : FALSE;
319
+		return ! empty($this->_redirect_form) ? $this->_redirect_form : FALSE;
320 320
 	}
321 321
 
322 322
 
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 	/**
325 325
 	 * @param string $plz_select_method_of_payment
326 326
 	 */
327
-	public function set_plz_select_method_of_payment( $plz_select_method_of_payment ) {
327
+	public function set_plz_select_method_of_payment($plz_select_method_of_payment) {
328 328
 		$this->_plz_select_method_of_payment = $plz_select_method_of_payment;
329 329
 	}
330 330
 
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 	/**
343 343
 	 * @param string $redirect_url
344 344
 	 */
345
-	public function set_redirect_url( $redirect_url ) {
345
+	public function set_redirect_url($redirect_url) {
346 346
 		$this->_redirect_url = $redirect_url;
347 347
 	}
348 348
 
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 	/**
370 370
 	 * @param string $registration_time_limit
371 371
 	 */
372
-	public function set_registration_time_limit( $registration_time_limit ) {
372
+	public function set_registration_time_limit($registration_time_limit) {
373 373
 		$this->_registration_time_limit = $registration_time_limit;
374 374
 	}
375 375
 
@@ -378,8 +378,8 @@  discard block
 block discarded – undo
378 378
 	/**
379 379
 	 * @param array $return_data
380 380
 	 */
381
-	public function set_return_data( $return_data ) {
382
-		$this->_return_data = array_merge( $this->_return_data, $return_data );
381
+	public function set_return_data($return_data) {
382
+		$this->_return_data = array_merge($this->_return_data, $return_data);
383 383
 	}
384 384
 
385 385
 
@@ -396,9 +396,9 @@  discard block
 block discarded – undo
396 396
 	/**
397 397
 	 * @param array $validation_rules
398 398
 	 */
399
-	public function add_validation_rules( $validation_rules = array() ) {
400
-		if ( is_array( $validation_rules ) && ! empty( $validation_rules )) {
401
-			$this->_validation_rules = array_merge( $this->_validation_rules, $validation_rules );
399
+	public function add_validation_rules($validation_rules = array()) {
400
+		if (is_array($validation_rules) && ! empty($validation_rules)) {
401
+			$this->_validation_rules = array_merge($this->_validation_rules, $validation_rules);
402 402
 		}
403 403
 	}
404 404
 
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 	 * @return array | bool
409 409
 	 */
410 410
 	public function validation_rules() {
411
-		return ! empty( $this->_validation_rules ) ? $this->_validation_rules : FALSE;
411
+		return ! empty($this->_validation_rules) ? $this->_validation_rules : FALSE;
412 412
 	}
413 413
 
414 414
 
Please login to merge, or discard this patch.