Completed
Branch BUG-9467-never-double-install-... (7d31d4)
by
unknown
358:28 queued 341:17
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='https://eventespresso.com'>","</a>");
285
+					printf(__("Powered by %sEvent Espresso %s", "event_espresso"), "<a href='https://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   +205 added lines, -205 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,22 +356,22 @@  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() ) {
362
-			$step_to_skip->set_is_current_step( false );
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
+			$step_to_skip->set_is_current_step(false);
363 363
 			$step_to_skip->set_completed();
364 364
 			// advance to the next step
365
-			$this->set_current_step( $this->next_step->slug() );
365
+			$this->set_current_step($this->next_step->slug());
366 366
 			// also reset the step param in the request in case any other code references that directly
367
-			EE_Registry::instance()->REQ->set( 'step', $this->current_step->slug() );
367
+			EE_Registry::instance()->REQ->set('step', $this->current_step->slug());
368 368
 			// since we are skipping a step and setting the current step to be what was previously the next step,
369 369
 			// we need to check that the next step is now correct, and not still set to the current step.
370
-			if ( $this->current_step->slug() == $this->next_step->slug() ) {
370
+			if ($this->current_step->slug() == $this->next_step->slug()) {
371 371
 				// correctly setup the next step
372 372
 				$this->set_next_step();
373 373
 			}
374
-			$this->set_reg_step_initiated( $this->current_step );
374
+			$this->set_reg_step_initiated($this->current_step);
375 375
 		}
376 376
 	}
377 377
 
@@ -385,16 +385,16 @@  discard block
 block discarded – undo
385 385
 	 * @param bool   $reset whether to reset reg steps after removal
386 386
 	 * @throws EE_Error
387 387
 	 */
388
-	public function remove_reg_step( $reg_step_slug = '', $reset = true ) {
389
-		unset( $this->reg_steps[ $reg_step_slug  ] );
390
-		if ( $this->transaction instanceof EE_Transaction ) {
388
+	public function remove_reg_step($reg_step_slug = '', $reset = true) {
389
+		unset($this->reg_steps[$reg_step_slug]);
390
+		if ($this->transaction instanceof EE_Transaction) {
391 391
 			/** @type EE_Transaction_Processor $transaction_processor */
392
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
392
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
393 393
 			// now remove reg step from TXN and save
394
-			$transaction_processor->remove_reg_step( $this->transaction, $reg_step_slug );
394
+			$transaction_processor->remove_reg_step($this->transaction, $reg_step_slug);
395 395
 			$this->transaction->save();
396 396
 		}
397
-		if ( $reset ) {
397
+		if ($reset) {
398 398
 			$this->reset_reg_steps();
399 399
 		}
400 400
 	}
@@ -409,9 +409,9 @@  discard block
 block discarded – undo
409 409
 	 * @param int    $order
410 410
 	 * @return    void
411 411
 	 */
412
-	public function set_reg_step_order( $reg_step_slug = '', $order = 100 ) {
413
-		if ( isset( $this->reg_steps[ $reg_step_slug  ] )) {
414
-			$this->reg_steps[ $reg_step_slug ]->set_order( $order );
412
+	public function set_reg_step_order($reg_step_slug = '', $order = 100) {
413
+		if (isset($this->reg_steps[$reg_step_slug])) {
414
+			$this->reg_steps[$reg_step_slug]->set_order($order);
415 415
 		}
416 416
 	}
417 417
 
@@ -424,25 +424,25 @@  discard block
 block discarded – undo
424 424
 	 * @param string $current_step
425 425
 	 * @return    void
426 426
 	 */
427
-	public function set_current_step( $current_step ) {
427
+	public function set_current_step($current_step) {
428 428
 		// grab what step we're on
429
-		$this->current_step = isset( $this->reg_steps[ $current_step ] ) ? $this->reg_steps[ $current_step ] : reset( $this->reg_steps );
429
+		$this->current_step = isset($this->reg_steps[$current_step]) ? $this->reg_steps[$current_step] : reset($this->reg_steps);
430 430
 		// verify instance
431
-		if ( $this->current_step instanceof EE_SPCO_Reg_Step ) {
431
+		if ($this->current_step instanceof EE_SPCO_Reg_Step) {
432 432
 			// we don't want to repeat completed steps if this is the first time through SPCO
433
-			if ( $this->continue_reg && $this->current_step->completed() && ! $this->revisit ) {
433
+			if ($this->continue_reg && $this->current_step->completed() && ! $this->revisit) {
434 434
 				// so advance to the next step
435 435
 				$this->set_next_step();
436
-				if ( $this->next_step instanceof EE_SPCO_Reg_Step ) {
436
+				if ($this->next_step instanceof EE_SPCO_Reg_Step) {
437 437
 					// and attempt to set it as the current step
438
-					$this->set_current_step( $this->next_step->slug() );
438
+					$this->set_current_step($this->next_step->slug());
439 439
 				}
440 440
 				return;
441 441
 			}
442
-			$this->current_step->set_is_current_step( TRUE );
442
+			$this->current_step->set_is_current_step(TRUE);
443 443
 		} else {
444 444
 			EE_Error::add_error(
445
-				__( 'The current step could not be set.', 'event_espresso' ),
445
+				__('The current step could not be set.', 'event_espresso'),
446 446
 				__FILE__, __FUNCTION__, __LINE__
447 447
 			);
448 448
 		}
@@ -459,20 +459,20 @@  discard block
 block discarded – undo
459 459
 	 */
460 460
 	public function set_next_step() {
461 461
 		// set pointer to start of array
462
-		reset( $this->reg_steps );
462
+		reset($this->reg_steps);
463 463
 		// if there is more than one step
464
-		if ( count( $this->reg_steps ) > 1 ) {
464
+		if (count($this->reg_steps) > 1) {
465 465
 			// advance to the current step and set pointer
466
-			while ( key( $this->reg_steps ) != $this->current_step->slug() && key( $this->reg_steps ) != '' ) {
467
-				next( $this->reg_steps );
466
+			while (key($this->reg_steps) != $this->current_step->slug() && key($this->reg_steps) != '') {
467
+				next($this->reg_steps);
468 468
 			}
469 469
 		}
470 470
 		// advance one more spot ( if it exists )
471
-		$this->next_step = next( $this->reg_steps );
471
+		$this->next_step = next($this->reg_steps);
472 472
 		// verify instance
473
-		$this->next_step = $this->next_step instanceof EE_SPCO_Reg_Step ? $this->next_step  : NULL;
473
+		$this->next_step = $this->next_step instanceof EE_SPCO_Reg_Step ? $this->next_step : NULL;
474 474
 		// then back to current step to reset
475
-		prev( $this->reg_steps );
475
+		prev($this->reg_steps);
476 476
 	}
477 477
 
478 478
 
@@ -486,8 +486,8 @@  discard block
 block discarded – undo
486 486
 	 *  @return 	EE_SPCO_Reg_Step | null
487 487
 	 */
488 488
 	public function get_next_reg_step() {
489
-		$next = next( $this->reg_steps );
490
-		prev( $this->reg_steps );
489
+		$next = next($this->reg_steps);
490
+		prev($this->reg_steps);
491 491
 		return $next instanceof EE_SPCO_Reg_Step ? $next : null;
492 492
 	}
493 493
 
@@ -502,8 +502,8 @@  discard block
 block discarded – undo
502 502
 	 *  @return 	EE_SPCO_Reg_Step | null
503 503
 	 */
504 504
 	public function get_prev_reg_step() {
505
-		$prev = prev( $this->reg_steps );
506
-		next( $this->reg_steps );
505
+		$prev = prev($this->reg_steps);
506
+		next($this->reg_steps);
507 507
 		return $prev instanceof EE_SPCO_Reg_Step ? $prev : null;
508 508
 	}
509 509
 
@@ -516,8 +516,8 @@  discard block
 block discarded – undo
516 516
 	 * @return void
517 517
 	 */
518 518
 	public function sort_reg_steps() {
519
-		$reg_step_sorting_callback = apply_filters( 'FHEE__EE_Checkout__sort_reg_steps__reg_step_sorting_callback', 'reg_step_sorting_callback' );
520
-		uasort( $this->reg_steps, array( $this, $reg_step_sorting_callback ));
519
+		$reg_step_sorting_callback = apply_filters('FHEE__EE_Checkout__sort_reg_steps__reg_step_sorting_callback', 'reg_step_sorting_callback');
520
+		uasort($this->reg_steps, array($this, $reg_step_sorting_callback));
521 521
 	}
522 522
 
523 523
 
@@ -530,19 +530,19 @@  discard block
 block discarded – undo
530 530
 	 * @param string $reg_step_slug
531 531
 	 * @return EE_SPCO_Reg_Step|null
532 532
 	 */
533
-	public function find_reg_step( $reg_step_slug = '' ) {
534
-		if ( ! empty( $reg_step_slug ) ) {
533
+	public function find_reg_step($reg_step_slug = '') {
534
+		if ( ! empty($reg_step_slug)) {
535 535
 			// copy reg step array
536 536
 			$reg_steps = $this->reg_steps;
537 537
 			// set pointer to start of array
538
-			reset( $reg_steps );
538
+			reset($reg_steps);
539 539
 			// if there is more than one step
540
-			if ( count( $reg_steps ) > 1 ) {
540
+			if (count($reg_steps) > 1) {
541 541
 				// advance to the current step and set pointer
542
-				while ( key( $reg_steps ) != $reg_step_slug && key( $reg_steps ) != '' ) {
543
-					next( $reg_steps );
542
+				while (key($reg_steps) != $reg_step_slug && key($reg_steps) != '') {
543
+					next($reg_steps);
544 544
 				}
545
-				return current( $reg_steps );
545
+				return current($reg_steps);
546 546
 			}
547 547
 		}
548 548
 		return null;
@@ -558,17 +558,17 @@  discard block
 block discarded – undo
558 558
 	 * @param EE_SPCO_Reg_Step $reg_step_B
559 559
 	 * @return array()
560 560
 	 */
561
-	public function reg_step_sorting_callback( EE_SPCO_Reg_Step $reg_step_A, EE_SPCO_Reg_Step $reg_step_B ) {
561
+	public function reg_step_sorting_callback(EE_SPCO_Reg_Step $reg_step_A, EE_SPCO_Reg_Step $reg_step_B) {
562 562
 		// send finalize_registration step to the end of the array
563
-		if ( $reg_step_A->slug() == 'finalize_registration' ) {
563
+		if ($reg_step_A->slug() == 'finalize_registration') {
564 564
 			return 1;
565
-		} else if ( $reg_step_B->slug() == 'finalize_registration' ) {
565
+		} else if ($reg_step_B->slug() == 'finalize_registration') {
566 566
 			return -1;
567 567
 		}
568
-		if ( $reg_step_A->order() == $reg_step_B->order() ) {
568
+		if ($reg_step_A->order() == $reg_step_B->order()) {
569 569
 			return 0;
570 570
 		}
571
-		return ( $reg_step_A->order() > $reg_step_B->order() ) ? 1 : -1;
571
+		return ($reg_step_A->order() > $reg_step_B->order()) ? 1 : -1;
572 572
 	}
573 573
 
574 574
 
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 	 * @access 	public
580 580
 	 * @param 	EE_SPCO_Reg_Step $reg_step
581 581
 	 */
582
-	public function set_reg_step_initiated( EE_SPCO_Reg_Step $reg_step ) {
582
+	public function set_reg_step_initiated(EE_SPCO_Reg_Step $reg_step) {
583 583
 		// call set_reg_step_initiated ???
584 584
 		if (
585 585
 			// first time visiting SPCO ?
@@ -592,13 +592,13 @@  discard block
 block discarded – undo
592 592
 			)
593 593
 		) {
594 594
 			/** @type EE_Transaction_Processor $transaction_processor */
595
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
595
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
596 596
 			// set the start time for this reg step
597
-			if ( ! $transaction_processor->set_reg_step_initiated( $this->transaction, $reg_step->slug() ) ) {
598
-				if ( WP_DEBUG ) {
597
+			if ( ! $transaction_processor->set_reg_step_initiated($this->transaction, $reg_step->slug())) {
598
+				if (WP_DEBUG) {
599 599
 					EE_Error::add_error(
600 600
 						sprintf(
601
-							__( 'The "%1$s" registration step was not initialized properly.', 'event_espresso' ),
601
+							__('The "%1$s" registration step was not initialized properly.', 'event_espresso'),
602 602
 							$reg_step->name()
603 603
 						),
604 604
 						__FILE__, __FUNCTION__, __LINE__
@@ -617,10 +617,10 @@  discard block
 block discarded – undo
617 617
 	 * 	@return 	void
618 618
 	 */
619 619
 	public function set_reg_step_JSON_info() {
620
-		EE_Registry::$i18n_js_strings[ 'reg_steps' ] = array();
620
+		EE_Registry::$i18n_js_strings['reg_steps'] = array();
621 621
 		// pass basic reg step data to JS
622
-		foreach ( $this->reg_steps as $reg_step ) {
623
-			EE_Registry::$i18n_js_strings[ 'reg_steps' ][] = $reg_step->slug();
622
+		foreach ($this->reg_steps as $reg_step) {
623
+			EE_Registry::$i18n_js_strings['reg_steps'][] = $reg_step->slug();
624 624
 		}
625 625
 		// reset reg step html
626 626
 //		$this->json_response->set_reg_step_html( '' );
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
 	 */
637 637
 	public function reset_reg_steps() {
638 638
 		$this->sort_reg_steps();
639
-		$this->set_current_step( EE_Registry::instance()->REQ->get( 'step' ));
639
+		$this->set_current_step(EE_Registry::instance()->REQ->get('step'));
640 640
 		$this->set_next_step();
641 641
 		// the text that appears on the reg step form submit button
642 642
 		$this->current_step->set_submit_button_text();
@@ -653,9 +653,9 @@  discard block
 block discarded – undo
653 653
 	 */
654 654
 	public function get_registration_time_limit() {
655 655
 
656
-		$registration_time_limit = (float)( EE_Registry::instance()	->SSN->expiration() - time() );
656
+		$registration_time_limit = (float) (EE_Registry::instance()	->SSN->expiration() - time());
657 657
 		$time_limit_format = $registration_time_limit > 60 * MINUTE_IN_SECONDS ? 'H:i:s' : 'i:s';
658
-		$registration_time_limit = gmdate( $time_limit_format, $registration_time_limit );
658
+		$registration_time_limit = gmdate($time_limit_format, $registration_time_limit);
659 659
 		return apply_filters(
660 660
 			'FHEE__EE_Checkout__get_registration_time_limit__registration_time_limit',
661 661
 			$registration_time_limit
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
 		//		overpaid TXN
676 676
 		//		free TXN ( total = 0.00 )
677 677
 		// then payment required is TRUE
678
-		return ! ( $this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free() ) ? TRUE : FALSE;
678
+		return ! ($this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free()) ? TRUE : FALSE;
679 679
 	}
680 680
 
681 681
 
@@ -688,8 +688,8 @@  discard block
 block discarded – undo
688 688
 	 */
689 689
 	public function initialize_txn_reg_steps_array() {
690 690
 		$txn_reg_steps_array = array();
691
-		foreach ( $this->reg_steps as $reg_step ) {
692
-			$txn_reg_steps_array[ $reg_step->slug() ] = FALSE;
691
+		foreach ($this->reg_steps as $reg_step) {
692
+			$txn_reg_steps_array[$reg_step->slug()] = FALSE;
693 693
 		}
694 694
 		return $txn_reg_steps_array;
695 695
 	}
@@ -705,13 +705,13 @@  discard block
 block discarded – undo
705 705
 	public function update_txn_reg_steps_array() {
706 706
 		$updated = FALSE;
707 707
 		/** @type EE_Transaction_Processor $transaction_processor */
708
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
709
-		foreach ( $this->reg_steps as $reg_step ) {
710
-			if ( $reg_step->completed() ) {
711
-				$updated = $transaction_processor->set_reg_step_completed( $this->transaction, $reg_step->slug() ) ? TRUE : $updated;
708
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
709
+		foreach ($this->reg_steps as $reg_step) {
710
+			if ($reg_step->completed()) {
711
+				$updated = $transaction_processor->set_reg_step_completed($this->transaction, $reg_step->slug()) ? TRUE : $updated;
712 712
 			}
713 713
 		}
714
-		if ( $updated ) {
714
+		if ($updated) {
715 715
 			$this->transaction->save();
716 716
 		}
717 717
 		return $updated;
@@ -726,14 +726,14 @@  discard block
 block discarded – undo
726 726
 	 * 	@return 	void
727 727
 	 */
728 728
 	public function stash_transaction_and_checkout() {
729
-		if ( ! $this->revisit ) {
729
+		if ( ! $this->revisit) {
730 730
 			$this->update_txn_reg_steps_array();
731 731
 		}
732 732
 		$this->track_transaction_and_registration_status_updates();
733 733
 		// save all data to the db, but suppress errors
734 734
 		//$this->save_all_data( FALSE );
735 735
 		// cache the checkout in the session
736
-		EE_Registry::instance()->SSN->set_checkout( $this );
736
+		EE_Registry::instance()->SSN->set_checkout($this);
737 737
 	}
738 738
 
739 739
 
@@ -749,21 +749,21 @@  discard block
 block discarded – undo
749 749
 	 */
750 750
 	public function track_transaction_and_registration_status_updates() {
751 751
 		// verify the transaction
752
-		if ( $this->transaction instanceof EE_Transaction ) {
752
+		if ($this->transaction instanceof EE_Transaction) {
753 753
 			/** @type EE_Transaction_Payments $transaction_payments */
754
-			$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
754
+			$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
755 755
 			/** @type EE_Transaction_Processor $transaction_processor */
756
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
756
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
757 757
 			// has there been a TXN status change during this checkout?
758
-			if ( $transaction_payments->txn_status_updated() || $transaction_processor->txn_status_updated() ) {
758
+			if ($transaction_payments->txn_status_updated() || $transaction_processor->txn_status_updated()) {
759 759
 				$this->txn_status_updated = true;
760 760
 			}
761 761
 			/** @type EE_Registration_Processor $registration_processor */
762
-			$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
762
+			$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
763 763
 			// grab the saved registrations from the transaction
764
-			foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $registration ) {
765
-				if ( $registration_processor->reg_status_updated( $registration->ID() ) ) {
766
-					$this->set_reg_status_updated( $registration->ID(), true );
764
+			foreach ($this->transaction->registrations($this->reg_cache_where_params) as $registration) {
765
+				if ($registration_processor->reg_status_updated($registration->ID())) {
766
+					$this->set_reg_status_updated($registration->ID(), true);
767 767
 				}
768 768
 			}
769 769
 		}
@@ -785,8 +785,8 @@  discard block
 block discarded – undo
785 785
 	 * @param 	EE_Registration 	$registration
786 786
 	 * 	@return 	bool
787 787
 	 */
788
-	public function visit_allows_processing_of_this_registration( EE_Registration $registration ) {
789
-		return ! $this->revisit || $this->primary_revisit || ( $this->revisit && $this->reg_url_link == $registration->reg_url_link() ) ? TRUE : FALSE;
788
+	public function visit_allows_processing_of_this_registration(EE_Registration $registration) {
789
+		return ! $this->revisit || $this->primary_revisit || ($this->revisit && $this->reg_url_link == $registration->reg_url_link()) ? TRUE : FALSE;
790 790
 	}
791 791
 
792 792
 
@@ -811,18 +811,18 @@  discard block
 block discarded – undo
811 811
 	 * @param bool $show_errors
812 812
 	 * @return bool
813 813
 	 */
814
-	public function save_all_data( $show_errors = TRUE ) {
814
+	public function save_all_data($show_errors = TRUE) {
815 815
 		// verify the transaction
816
-		if ( $this->transaction instanceof EE_Transaction ) {
816
+		if ($this->transaction instanceof EE_Transaction) {
817 817
 			// save to ensure that TXN has ID
818 818
 			$this->transaction->save();
819 819
 			// grab the saved registrations from the transaction
820
-			foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as  $registration ) {
821
-				$this->_save_registration( $registration, $show_errors );
820
+			foreach ($this->transaction->registrations($this->reg_cache_where_params) as  $registration) {
821
+				$this->_save_registration($registration, $show_errors);
822 822
 			}
823 823
 		} else {
824
-			if ( $show_errors ) {
825
-				EE_Error::add_error( __( 'A valid Transaction was not found when attempting to save your registration information.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
824
+			if ($show_errors) {
825
+				EE_Error::add_error(__('A valid Transaction was not found when attempting to save your registration information.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
826 826
 			}
827 827
 			return FALSE;
828 828
 		}
@@ -837,32 +837,32 @@  discard block
 block discarded – undo
837 837
 	 * @param bool $show_errors
838 838
 	 * @return void
839 839
 	 */
840
-	private function _save_registration( $registration, $show_errors = TRUE  ) {
840
+	private function _save_registration($registration, $show_errors = TRUE) {
841 841
 		// verify object
842
-		if ( $registration instanceof EE_Registration ) {
842
+		if ($registration instanceof EE_Registration) {
843 843
 			// should this registration be processed during this visit ?
844
-			if ( $this->visit_allows_processing_of_this_registration( $registration ) ) {
844
+			if ($this->visit_allows_processing_of_this_registration($registration)) {
845 845
 				//set TXN ID
846
-				if ( ! $registration->transaction_ID() ) {
847
-					$registration->set_transaction_id( $this->transaction->ID() );
846
+				if ( ! $registration->transaction_ID()) {
847
+					$registration->set_transaction_id($this->transaction->ID());
848 848
 				}
849 849
 				// verify and save the attendee
850
-				$this->_save_registration_attendee( $registration, $show_errors );
850
+				$this->_save_registration_attendee($registration, $show_errors);
851 851
 				// save answers to reg form questions
852
-				$this->_save_registration_answers( $registration, $show_errors );
852
+				$this->_save_registration_answers($registration, $show_errors);
853 853
 				// save changes
854 854
 				$registration->save();
855 855
 				// update txn cache
856
-				if ( ! $this->transaction->update_cache_after_object_save( 'Registration', $registration )) {
857
-					if ( $show_errors ) {
858
-						EE_Error::add_error( __( 'The newly saved Registration object could not be cached on the Transaction.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
856
+				if ( ! $this->transaction->update_cache_after_object_save('Registration', $registration)) {
857
+					if ($show_errors) {
858
+						EE_Error::add_error(__('The newly saved Registration object could not be cached on the Transaction.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
859 859
 					}
860 860
 				}
861 861
 			}
862 862
 		} else {
863
-			if ( $show_errors ) {
863
+			if ($show_errors) {
864 864
 				EE_Error::add_error(
865
-					__( 'An invalid Registration object was discovered when attempting to save your registration information.', 'event_espresso' ),
865
+					__('An invalid Registration object was discovered when attempting to save your registration information.', 'event_espresso'),
866 866
 					__FILE__, __FUNCTION__, __LINE__
867 867
 				);
868 868
 			}
@@ -878,26 +878,26 @@  discard block
 block discarded – undo
878 878
 	 * @param bool $show_errors
879 879
 	 * @return void
880 880
 	 */
881
-	private function _save_registration_attendee( $registration, $show_errors = TRUE ) {
882
-		if ( $registration->attendee() instanceof EE_Attendee ) {
881
+	private function _save_registration_attendee($registration, $show_errors = TRUE) {
882
+		if ($registration->attendee() instanceof EE_Attendee) {
883 883
 			// save so that ATT has ID
884 884
 			$registration->attendee()->save();
885
-			if ( ! $registration->update_cache_after_object_save( 'Attendee', $registration->attendee() )) {
886
-				if ( $show_errors ) {
885
+			if ( ! $registration->update_cache_after_object_save('Attendee', $registration->attendee())) {
886
+				if ($show_errors) {
887 887
 					EE_Error::add_error(
888
-						__( 'The newly saved Attendee object could not be cached on the registration.', 'event_espresso' ),
888
+						__('The newly saved Attendee object could not be cached on the registration.', 'event_espresso'),
889 889
 						__FILE__, __FUNCTION__, __LINE__
890 890
 					);
891 891
 				}
892 892
 			}
893 893
 		} else {
894
-			if ( $show_errors ) {
894
+			if ($show_errors) {
895 895
 				ob_start();
896
-				var_dump( $registration->attendee() );
896
+				var_dump($registration->attendee());
897 897
 				EE_Error::add_error(
898 898
 					sprintf(
899 899
 						'%1$s||%1$s $attendee = %2$s',
900
-						__( 'Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso' ),
900
+						__('Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso'),
901 901
 						ob_get_clean()
902 902
 					),
903 903
 					__FILE__, __FUNCTION__, __LINE__
@@ -915,25 +915,25 @@  discard block
 block discarded – undo
915 915
 	 * @param bool $show_errors
916 916
 	 * @return void
917 917
 	 */
918
-	private function _save_registration_answers( $registration, $show_errors = TRUE ) {
918
+	private function _save_registration_answers($registration, $show_errors = TRUE) {
919 919
 		// now save the answers
920
-		foreach ( $registration->answers() as $cache_key => $answer ) {
920
+		foreach ($registration->answers() as $cache_key => $answer) {
921 921
 			// verify object
922
-			if ( $answer instanceof EE_Answer ) {
923
-				$answer->set_registration( $registration->ID() );
922
+			if ($answer instanceof EE_Answer) {
923
+				$answer->set_registration($registration->ID());
924 924
 				$answer->save();
925
-				if ( ! $registration->update_cache_after_object_save( 'Answer', $answer, $cache_key )) {
926
-					if ( $show_errors ) {
925
+				if ( ! $registration->update_cache_after_object_save('Answer', $answer, $cache_key)) {
926
+					if ($show_errors) {
927 927
 						EE_Error::add_error(
928
-							__( 'The newly saved Answer object could not be cached on the registration.', 'event_espresso' ),
928
+							__('The newly saved Answer object could not be cached on the registration.', 'event_espresso'),
929 929
 							__FILE__, __FUNCTION__, __LINE__
930 930
 						);
931 931
 					}
932 932
 				}
933 933
 			} else {
934
-				if ( $show_errors ) {
934
+				if ($show_errors) {
935 935
 					EE_Error::add_error(
936
-						__( 'An invalid Answer object was discovered when attempting to save your registration information.', 'event_espresso' ),
936
+						__('An invalid Answer object was discovered when attempting to save your registration information.', 'event_espresso'),
937 937
 						__FILE__, __FUNCTION__, __LINE__
938 938
 					);
939 939
 				}
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
 	 * @param bool $from_db
952 952
 	 * @return bool
953 953
 	 */
954
-	public function refresh_all_entities( $from_db = false ) {
954
+	public function refresh_all_entities($from_db = false) {
955 955
 		$from_db = $this->current_step->is_final_step() || $this->action == 'process_gateway_response' ? true : $from_db;
956 956
 		//$this->log(
957 957
 		//	__CLASS__, __FUNCTION__, __LINE__,
@@ -972,11 +972,11 @@  discard block
 block discarded – undo
972 972
 	 */
973 973
 	protected function refresh_from_db() {
974 974
 		// verify the transaction
975
-		if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) {
975
+		if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) {
976 976
 			// pull fresh TXN data from the db
977
-			$this->transaction = $this->transaction->get_model()->refresh_entity_map_from_db( $this->transaction->ID() );
977
+			$this->transaction = $this->transaction->get_model()->refresh_entity_map_from_db($this->transaction->ID());
978 978
 			// update EE_Checkout's cached primary_attendee object
979
-			$this->primary_attendee_obj = $this->_refresh_primary_attendee_obj_from_db( $this->transaction );
979
+			$this->primary_attendee_obj = $this->_refresh_primary_attendee_obj_from_db($this->transaction);
980 980
 			// update EE_Checkout's cached payment object
981 981
 			$payment = $this->transaction->last_payment();
982 982
 			$this->payment = $payment instanceof EE_Payment ? $payment : $this->payment;
@@ -984,15 +984,15 @@  discard block
 block discarded – undo
984 984
 			$payment_method = $this->payment instanceof EE_Payment ? $this->payment->payment_method() : null;
985 985
 			$this->payment_method = $payment_method instanceof EE_Payment_Method ? $payment_method : $this->payment_method;
986 986
 			//now refresh the cart, based on the TXN
987
-			$this->cart = EE_Cart::get_cart_from_txn( $this->transaction );
987
+			$this->cart = EE_Cart::get_cart_from_txn($this->transaction);
988 988
 			// verify and update the cart because inaccurate totals are not so much fun
989
-			if ( $this->cart instanceof EE_Cart ) {
989
+			if ($this->cart instanceof EE_Cart) {
990 990
 				$this->cart->get_grand_total()->recalculate_total_including_taxes();
991 991
 			} else {
992
-				$this->cart = EE_Registry::instance()->load_core( 'Cart' );
992
+				$this->cart = EE_Registry::instance()->load_core('Cart');
993 993
 			}
994 994
 		} else {
995
-			EE_Error::add_error( __( 'A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
995
+			EE_Error::add_error(__('A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
996 996
 			return FALSE;
997 997
 		}
998 998
 		return TRUE;
@@ -1006,24 +1006,24 @@  discard block
 block discarded – undo
1006 1006
 	 * @param   EE_Transaction $transaction
1007 1007
 	 * @return  EE_Attendee | null
1008 1008
 	 */
1009
-	protected function _refresh_primary_attendee_obj_from_db( EE_Transaction $transaction ) {
1009
+	protected function _refresh_primary_attendee_obj_from_db(EE_Transaction $transaction) {
1010 1010
 
1011 1011
 		$primary_attendee_obj = null;
1012 1012
 		// grab the saved registrations from the transaction
1013
-		foreach ( $transaction->registrations( $this->reg_cache_where_params, true ) as $registration ) {
1013
+		foreach ($transaction->registrations($this->reg_cache_where_params, true) as $registration) {
1014 1014
 			// verify object
1015
-			if ( $registration instanceof EE_Registration ) {
1015
+			if ($registration instanceof EE_Registration) {
1016 1016
 				$attendee = $registration->attendee();
1017 1017
 				// verify object
1018
-				if ( $attendee instanceof EE_Attendee  ) {
1018
+				if ($attendee instanceof EE_Attendee) {
1019 1019
 					// maybe cache primary_attendee_obj ?
1020
-					if ( $registration->is_primary_registrant() ) {
1020
+					if ($registration->is_primary_registrant()) {
1021 1021
 						$primary_attendee_obj = $attendee;
1022 1022
 					}
1023 1023
 				}
1024 1024
 			} else {
1025 1025
 				EE_Error::add_error(
1026
-						__( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
1026
+						__('An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso'),
1027 1027
 						__FILE__, __FUNCTION__, __LINE__
1028 1028
 				);
1029 1029
 			}
@@ -1043,43 +1043,43 @@  discard block
 block discarded – undo
1043 1043
 	 */
1044 1044
 	protected function refresh_entity_map() {
1045 1045
 		// verify the transaction
1046
-		if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) {
1046
+		if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) {
1047 1047
 			// never cache payment info
1048
-			$this->transaction->clear_cache( 'Payment' );
1048
+			$this->transaction->clear_cache('Payment');
1049 1049
 			/** @type EE_Transaction_Processor $transaction_processor */
1050
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1050
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1051 1051
 			// is the Payment Options Reg Step completed ?
1052
-			if ( $transaction_processor->reg_step_completed( $this->transaction, 'payment_options' ) ) {
1052
+			if ($transaction_processor->reg_step_completed($this->transaction, 'payment_options')) {
1053 1053
 				// then check for payments and update TXN accordingly
1054 1054
 				/** @type EE_Transaction_Payments $transaction_payments */
1055
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1056
-				$transaction_payments->calculate_total_payments_and_update_status( $this->transaction );
1055
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1056
+				$transaction_payments->calculate_total_payments_and_update_status($this->transaction);
1057 1057
 			}
1058 1058
 			// grab the saved registrations from the transaction
1059
-			foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $reg_cache_ID => $registration ) {
1060
-				$this->_refresh_registration( $reg_cache_ID, $registration );
1059
+			foreach ($this->transaction->registrations($this->reg_cache_where_params) as $reg_cache_ID => $registration) {
1060
+				$this->_refresh_registration($reg_cache_ID, $registration);
1061 1061
 			}
1062 1062
 			// make sure our cached TXN is added to the model entity mapper
1063
-			$this->transaction = $this->transaction->get_model()->refresh_entity_map_with( $this->transaction->ID(), $this->transaction );
1063
+			$this->transaction = $this->transaction->get_model()->refresh_entity_map_with($this->transaction->ID(), $this->transaction);
1064 1064
 
1065 1065
 		} else {
1066
-			EE_Error::add_error( __( 'A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
1066
+			EE_Error::add_error(__('A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1067 1067
 			return FALSE;
1068 1068
 		}
1069 1069
 		// verify and update the cart because inaccurate totals are not so much fun
1070
-		if ( $this->cart instanceof EE_Cart ) {
1070
+		if ($this->cart instanceof EE_Cart) {
1071 1071
 			$grand_total = $this->cart->get_grand_total();
1072
-			if ( $grand_total instanceof EE_Line_Item && $grand_total->ID() ) {
1072
+			if ($grand_total instanceof EE_Line_Item && $grand_total->ID()) {
1073 1073
 				$grand_total->recalculate_total_including_taxes();
1074 1074
 				$grand_total = $grand_total->get_model()->refresh_entity_map_with(
1075 1075
 					$this->cart->get_grand_total()->ID(),
1076 1076
 					$this->cart->get_grand_total()
1077 1077
 				);
1078 1078
 			}
1079
-			if ( $grand_total instanceof EE_Line_Item ) {
1080
-				$this->cart = EE_Cart::instance( $grand_total );
1079
+			if ($grand_total instanceof EE_Line_Item) {
1080
+				$this->cart = EE_Cart::instance($grand_total);
1081 1081
 			} else {
1082
-				EE_Error::add_error( __( 'A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1082
+				EE_Error::add_error(__('A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1083 1083
 				return false;
1084 1084
 			}
1085 1085
 		}
@@ -1095,19 +1095,19 @@  discard block
 block discarded – undo
1095 1095
 	 * @param 	EE_Registration 	$registration
1096 1096
 	 * @return void
1097 1097
 	 */
1098
-	protected function _refresh_registration( $reg_cache_ID, $registration ) {
1098
+	protected function _refresh_registration($reg_cache_ID, $registration) {
1099 1099
 
1100 1100
 		// verify object
1101
-		if ( $registration instanceof EE_Registration ) {
1101
+		if ($registration instanceof EE_Registration) {
1102 1102
 			// update the entity mapper attendee
1103
-			$this->_refresh_registration_attendee( $registration );
1103
+			$this->_refresh_registration_attendee($registration);
1104 1104
 			// update the entity mapper answers for reg form questions
1105
-			$this->_refresh_registration_answers( $registration );
1105
+			$this->_refresh_registration_answers($registration);
1106 1106
 			// make sure the cached registration is added to the model entity mapper
1107
-			$registration->get_model()->refresh_entity_map_with( $reg_cache_ID, $registration );
1107
+			$registration->get_model()->refresh_entity_map_with($reg_cache_ID, $registration);
1108 1108
 		} else {
1109 1109
 			EE_Error::add_error(
1110
-				__( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
1110
+				__('An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso'),
1111 1111
 				__FILE__, __FUNCTION__, __LINE__
1112 1112
 			);
1113 1113
 		}
@@ -1121,15 +1121,15 @@  discard block
 block discarded – undo
1121 1121
 	 * @param 	EE_Registration 	$registration
1122 1122
 	 * @return void
1123 1123
 	 */
1124
-	protected function _refresh_registration_attendee( $registration ) {
1124
+	protected function _refresh_registration_attendee($registration) {
1125 1125
 
1126 1126
 		$attendee = $registration->attendee();
1127 1127
 		// verify object
1128
-		if ( $attendee instanceof EE_Attendee && $attendee->ID() ) {
1128
+		if ($attendee instanceof EE_Attendee && $attendee->ID()) {
1129 1129
 			// make sure the cached attendee is added to the model entity mapper
1130
-			$registration->attendee()->get_model()->refresh_entity_map_with( $attendee->ID(), $attendee );
1130
+			$registration->attendee()->get_model()->refresh_entity_map_with($attendee->ID(), $attendee);
1131 1131
 			// maybe cache primary_attendee_obj ?
1132
-			if ( $registration->is_primary_registrant() ) {
1132
+			if ($registration->is_primary_registrant()) {
1133 1133
 				$this->primary_attendee_obj = $attendee;
1134 1134
 			}
1135 1135
 		}
@@ -1143,19 +1143,19 @@  discard block
 block discarded – undo
1143 1143
 	 * @param 	EE_Registration 	$registration
1144 1144
 	 * @return void
1145 1145
 	 */
1146
-	protected function _refresh_registration_answers( $registration ) {
1146
+	protected function _refresh_registration_answers($registration) {
1147 1147
 
1148 1148
 		// now update the answers
1149
-		foreach ( $registration->answers() as $cache_key => $answer ) {
1149
+		foreach ($registration->answers() as $cache_key => $answer) {
1150 1150
 			// verify object
1151
-			if ( $answer instanceof EE_Answer ) {
1152
-				if ( $answer->ID() ) {
1151
+			if ($answer instanceof EE_Answer) {
1152
+				if ($answer->ID()) {
1153 1153
 					// make sure the cached answer is added to the model entity mapper
1154
-					$answer->get_model()->refresh_entity_map_with( $answer->ID(), $answer );
1154
+					$answer->get_model()->refresh_entity_map_with($answer->ID(), $answer);
1155 1155
 				}
1156 1156
 			} else {
1157 1157
 				EE_Error::add_error(
1158
-					__( 'An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
1158
+					__('An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso'),
1159 1159
 					__FILE__, __FUNCTION__, __LINE__
1160 1160
 				);
1161 1161
 			}
@@ -1170,7 +1170,7 @@  discard block
 block discarded – undo
1170 1170
 	 * this will reinstate the EE_Checkout object on each EE_SPCO_Reg_Step object
1171 1171
 	 */
1172 1172
 	function __wakeup() {
1173
-		foreach ( $this->reg_steps as $reg_step ) {
1173
+		foreach ($this->reg_steps as $reg_step) {
1174 1174
 			$reg_step->checkout = $this;
1175 1175
 		}
1176 1176
 	}
@@ -1186,11 +1186,11 @@  discard block
 block discarded – undo
1186 1186
 	 * @param array $info
1187 1187
 	 * @param bool $display_request
1188 1188
 	 */
1189
-	function log( $class = '', $func = '', $line = '', $info = array(), $display_request = false ) {
1190
-		if ( WP_DEBUG && false ) {
1191
-			$debug_data = get_option( 'EE_DEBUG_SPCO_' . EE_Session::instance()->id(), array() );
1189
+	function log($class = '', $func = '', $line = '', $info = array(), $display_request = false) {
1190
+		if (WP_DEBUG && false) {
1191
+			$debug_data = get_option('EE_DEBUG_SPCO_'.EE_Session::instance()->id(), array());
1192 1192
 			$default_data = array(
1193
-				$class 		=> $func . '() : ' . $line,
1193
+				$class 		=> $func.'() : '.$line,
1194 1194
 				'request->step' 		=> $this->step,
1195 1195
 				'request->action' 	=> $this->action,
1196 1196
 				'current_step->slug' => $this->current_step instanceof EE_SPCO_Reg_Step ?
@@ -1202,24 +1202,24 @@  discard block
 block discarded – undo
1202 1202
 				'reg_url_link' => $this->reg_url_link,
1203 1203
 				'REQ' => $display_request ? $_REQUEST : '',
1204 1204
 			);
1205
-			if ( $this->transaction instanceof EE_Transaction ) {
1206
-				$default_data[ 'TXN_status' ] 		= $this->transaction->status_ID();
1207
-				$default_data[ 'TXN_reg_steps' ] 	= $this->transaction->reg_steps();
1208
-				foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $REG_ID => $registration ) {
1209
-					$default_data[ 'registrations' ][ $REG_ID ] = $registration->status_ID();
1205
+			if ($this->transaction instanceof EE_Transaction) {
1206
+				$default_data['TXN_status'] = $this->transaction->status_ID();
1207
+				$default_data['TXN_reg_steps'] = $this->transaction->reg_steps();
1208
+				foreach ($this->transaction->registrations($this->reg_cache_where_params) as $REG_ID => $registration) {
1209
+					$default_data['registrations'][$REG_ID] = $registration->status_ID();
1210 1210
 				}
1211
-				if ( $this->transaction->ID() ) {
1212
-					$TXN_ID = 'EE_Transaction: ' . $this->transaction->ID();
1211
+				if ($this->transaction->ID()) {
1212
+					$TXN_ID = 'EE_Transaction: '.$this->transaction->ID();
1213 1213
 					// don't serialize objects
1214
-					$info = $this->_strip_objects( $info );
1215
-					if ( ! isset( $debug_data[ $TXN_ID ] ) ) {
1216
-						$debug_data[ $TXN_ID ] = array();
1214
+					$info = $this->_strip_objects($info);
1215
+					if ( ! isset($debug_data[$TXN_ID])) {
1216
+						$debug_data[$TXN_ID] = array();
1217 1217
 					}
1218
-					$debug_data[ $TXN_ID ][ microtime() ] = array_merge(
1218
+					$debug_data[$TXN_ID][microtime()] = array_merge(
1219 1219
 						$default_data,
1220 1220
 						$info
1221 1221
 					);
1222
-					update_option( 'EE_DEBUG_SPCO_' . EE_Session::instance()->id(), $debug_data );
1222
+					update_option('EE_DEBUG_SPCO_'.EE_Session::instance()->id(), $debug_data);
1223 1223
 				}
1224 1224
 			}
1225 1225
 		}
@@ -1232,23 +1232,23 @@  discard block
 block discarded – undo
1232 1232
 	 * @param array $info
1233 1233
 	 * @return array
1234 1234
 	 */
1235
-	function _strip_objects( $info = array() ) {
1236
-		foreach ( $info as $key => $value ) {
1237
-			if ( is_array( $value )) {
1238
-				$info[ $key ] = $this->_strip_objects( $value );
1239
-			} else if ( is_object( $value ) ) {
1240
-				$object_class = get_class( $value );
1241
-				$info[ $object_class ] = array();
1242
-				$info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0;
1243
-				if ( method_exists( $value, 'status' ) ) {
1244
-					$info[ $object_class ][ 'status' ] = $value->status();
1245
-				} else if ( method_exists( $value, 'status_ID' ) ) {
1246
-					$info[ $object_class ][ 'status' ] = $value->status_ID();
1235
+	function _strip_objects($info = array()) {
1236
+		foreach ($info as $key => $value) {
1237
+			if (is_array($value)) {
1238
+				$info[$key] = $this->_strip_objects($value);
1239
+			} else if (is_object($value)) {
1240
+				$object_class = get_class($value);
1241
+				$info[$object_class] = array();
1242
+				$info[$object_class]['ID'] = method_exists($value, 'ID') ? $value->ID() : 0;
1243
+				if (method_exists($value, 'status')) {
1244
+					$info[$object_class]['status'] = $value->status();
1245
+				} else if (method_exists($value, 'status_ID')) {
1246
+					$info[$object_class]['status'] = $value->status_ID();
1247 1247
 				}
1248
-				unset( $info[ $key ] );
1248
+				unset($info[$key]);
1249 1249
 			}
1250 1250
 		}
1251
-		return (array)$info;
1251
+		return (array) $info;
1252 1252
 	}
1253 1253
 
1254 1254
 
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.