@@ -10,13 +10,13 @@ |
||
10 | 10 | * @ version 4+ |
11 | 11 | */ |
12 | 12 | ?> |
13 | -<p><?php _e( 'Event Organizer: ', 'event_espresso' ) . espresso_organization_name( $EVT_ID ); ?><br/> |
|
14 | -<?php _e( 'Organizer Email: ', 'event_espresso' ) . espresso_organization_email( $EVT_ID ); ?><br/> |
|
15 | -<?php _e( 'Event Phone: ', 'event_espresso' ) . espresso_event_phone( $EVT_ID ); ?></p> |
|
16 | -<p><?php _e( 'Event Status: ', 'event_espresso' ) . espresso_event_status( $EVT_ID );?></p> |
|
17 | -<p><?php _e( 'Categories: ', 'event_espresso' ) . espresso_event_categories( $EVT_ID );?></p> |
|
18 | -<?php _e( 'Dates and Times: ', 'event_espresso' ) . espresso_list_of_event_dates( $EVT_ID );?> |
|
19 | -<?php _e( 'Available Tickets: ', 'event_espresso' ) . espresso_event_tickets_available( $EVT_ID );?> |
|
20 | -<p><?php _e( 'Event Venue: ', 'event_espresso' ) . espresso_venue_name( NULL, FALSE ); ?></p> |
|
21 | -<p><?php echo __( 'Description: ', 'event_espresso' ) . $event_description; ?></p><br/> |
|
13 | +<p><?php _e('Event Organizer: ', 'event_espresso').espresso_organization_name($EVT_ID); ?><br/> |
|
14 | +<?php _e('Organizer Email: ', 'event_espresso').espresso_organization_email($EVT_ID); ?><br/> |
|
15 | +<?php _e('Event Phone: ', 'event_espresso').espresso_event_phone($EVT_ID); ?></p> |
|
16 | +<p><?php _e('Event Status: ', 'event_espresso').espresso_event_status($EVT_ID); ?></p> |
|
17 | +<p><?php _e('Categories: ', 'event_espresso').espresso_event_categories($EVT_ID); ?></p> |
|
18 | +<?php _e('Dates and Times: ', 'event_espresso').espresso_list_of_event_dates($EVT_ID); ?> |
|
19 | +<?php _e('Available Tickets: ', 'event_espresso').espresso_event_tickets_available($EVT_ID); ?> |
|
20 | +<p><?php _e('Event Venue: ', 'event_espresso').espresso_venue_name(NULL, FALSE); ?></p> |
|
21 | +<p><?php echo __('Description: ', 'event_espresso').$event_description; ?></p><br/> |
|
22 | 22 | |
23 | 23 | \ No newline at end of file |
@@ -10,11 +10,11 @@ |
||
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 |
@@ -50,7 +50,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -21,23 +21,23 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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&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&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 |
||
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"> </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 | } |
@@ -3,7 +3,7 @@ discard block |
||
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 |
||
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 ''; |
@@ -154,12 +154,12 @@ |
||
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; |
@@ -45,13 +45,13 @@ discard block |
||
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 |
||
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 ?>"> </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 ?>"> </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 ?>"> </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 |
||
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 |
||
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 |
||
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 |
||
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; ?> |
@@ -127,7 +127,7 @@ discard block |
||
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 |
||
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 |
||
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> |
@@ -6,7 +6,7 @@ |
||
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 --> |
@@ -73,7 +73,7 @@ discard block |
||
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 |
||
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> |
@@ -36,53 +36,53 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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"> </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 |
||
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 |
||
280 | 280 | </table> |
281 | 281 | <?php } ?> |
282 | 282 | |
283 | - <?php if($shameless_plug){?> |
|
283 | + <?php if ($shameless_plug) {?> |
|
284 | 284 | <div class='aln-cntr'><?php |
285 | - printf(__("Powered by %sEvent Espresso %s", "event_espresso"),"<a href='http://eventespresso.com'>","</a>"); |
|
285 | + printf(__("Powered by %sEvent Espresso %s", "event_espresso"), "<a href='http://eventespresso.com'>", "</a>"); |
|
286 | 286 | ?></div> |
287 | 287 | <?php } ?> |
288 | 288 | </div> |
@@ -29,7 +29,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -1,4 +1,6 @@ |
||
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 | * |
@@ -1,16 +1,16 @@ |
||
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 | /** |
@@ -251,7 +251,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 ) { |
@@ -242,9 +242,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
339 | 339 | * @param EE_SPCO_Reg_Step $reg_step_obj |
340 | 340 | * @return void |
341 | 341 | */ |
342 | - public function add_reg_step( EE_SPCO_Reg_Step $reg_step_obj ) { |
|
343 | - $this->reg_steps[ $reg_step_obj->slug() ] = $reg_step_obj; |
|
342 | + public function add_reg_step(EE_SPCO_Reg_Step $reg_step_obj) { |
|
343 | + $this->reg_steps[$reg_step_obj->slug()] = $reg_step_obj; |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | |
@@ -356,14 +356,14 @@ discard block |
||
356 | 356 | * @param string $reg_step_slug |
357 | 357 | * @return void |
358 | 358 | */ |
359 | - public function skip_reg_step( $reg_step_slug = '' ) { |
|
360 | - $step_to_skip = $this->find_reg_step( $reg_step_slug ); |
|
361 | - if ( $step_to_skip instanceof EE_SPCO_Reg_Step && $step_to_skip->is_current_step() ) { |
|
359 | + public function skip_reg_step($reg_step_slug = '') { |
|
360 | + $step_to_skip = $this->find_reg_step($reg_step_slug); |
|
361 | + if ($step_to_skip instanceof EE_SPCO_Reg_Step && $step_to_skip->is_current_step()) { |
|
362 | 362 | // advance to the next step |
363 | - $this->set_current_step( $this->next_step->slug() ); |
|
364 | - $step_to_skip->set_is_current_step( false ); |
|
363 | + $this->set_current_step($this->next_step->slug()); |
|
364 | + $step_to_skip->set_is_current_step(false); |
|
365 | 365 | $step_to_skip->set_completed(); |
366 | - $this->set_reg_step_initiated( $this->current_step ); |
|
366 | + $this->set_reg_step_initiated($this->current_step); |
|
367 | 367 | } |
368 | 368 | } |
369 | 369 | |
@@ -377,16 +377,16 @@ discard block |
||
377 | 377 | * @param bool $reset whether to reset reg steps after removal |
378 | 378 | * @throws EE_Error |
379 | 379 | */ |
380 | - public function remove_reg_step( $reg_step_slug = '', $reset = true ) { |
|
381 | - unset( $this->reg_steps[ $reg_step_slug ] ); |
|
382 | - if ( $this->transaction instanceof EE_Transaction ) { |
|
380 | + public function remove_reg_step($reg_step_slug = '', $reset = true) { |
|
381 | + unset($this->reg_steps[$reg_step_slug]); |
|
382 | + if ($this->transaction instanceof EE_Transaction) { |
|
383 | 383 | /** @type EE_Transaction_Processor $transaction_processor */ |
384 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
384 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
385 | 385 | // now remove reg step from TXN and save |
386 | - $transaction_processor->remove_reg_step( $this->transaction, $reg_step_slug ); |
|
386 | + $transaction_processor->remove_reg_step($this->transaction, $reg_step_slug); |
|
387 | 387 | $this->transaction->save(); |
388 | 388 | } |
389 | - if ( $reset ) { |
|
389 | + if ($reset) { |
|
390 | 390 | $this->reset_reg_steps(); |
391 | 391 | } |
392 | 392 | } |
@@ -401,9 +401,9 @@ discard block |
||
401 | 401 | * @param int $order |
402 | 402 | * @return void |
403 | 403 | */ |
404 | - public function set_reg_step_order( $reg_step_slug = '', $order = 100 ) { |
|
405 | - if ( isset( $this->reg_steps[ $reg_step_slug ] )) { |
|
406 | - $this->reg_steps[ $reg_step_slug ]->set_order( $order ); |
|
404 | + public function set_reg_step_order($reg_step_slug = '', $order = 100) { |
|
405 | + if (isset($this->reg_steps[$reg_step_slug])) { |
|
406 | + $this->reg_steps[$reg_step_slug]->set_order($order); |
|
407 | 407 | } |
408 | 408 | } |
409 | 409 | |
@@ -416,25 +416,25 @@ discard block |
||
416 | 416 | * @param string $current_step |
417 | 417 | * @return void |
418 | 418 | */ |
419 | - public function set_current_step( $current_step ) { |
|
419 | + public function set_current_step($current_step) { |
|
420 | 420 | // grab what step we're on |
421 | - $this->current_step = isset( $this->reg_steps[ $current_step ] ) ? $this->reg_steps[ $current_step ] : reset( $this->reg_steps ); |
|
421 | + $this->current_step = isset($this->reg_steps[$current_step]) ? $this->reg_steps[$current_step] : reset($this->reg_steps); |
|
422 | 422 | // verify instance |
423 | - if ( $this->current_step instanceof EE_SPCO_Reg_Step ) { |
|
423 | + if ($this->current_step instanceof EE_SPCO_Reg_Step) { |
|
424 | 424 | // we don't want to repeat completed steps if this is the first time through SPCO |
425 | - if ( $this->continue_reg && $this->current_step->completed() && ! $this->revisit ) { |
|
425 | + if ($this->continue_reg && $this->current_step->completed() && ! $this->revisit) { |
|
426 | 426 | // so advance to the next step |
427 | 427 | $this->set_next_step(); |
428 | - if ( $this->next_step instanceof EE_SPCO_Reg_Step ) { |
|
428 | + if ($this->next_step instanceof EE_SPCO_Reg_Step) { |
|
429 | 429 | // and attempt to set it as the current step |
430 | - $this->set_current_step( $this->next_step->slug() ); |
|
430 | + $this->set_current_step($this->next_step->slug()); |
|
431 | 431 | } |
432 | 432 | return; |
433 | 433 | } |
434 | - $this->current_step->set_is_current_step( TRUE ); |
|
434 | + $this->current_step->set_is_current_step(TRUE); |
|
435 | 435 | } else { |
436 | 436 | EE_Error::add_error( |
437 | - __( 'The current step could not be set.', 'event_espresso' ), |
|
437 | + __('The current step could not be set.', 'event_espresso'), |
|
438 | 438 | __FILE__, __FUNCTION__, __LINE__ |
439 | 439 | ); |
440 | 440 | } |
@@ -451,20 +451,20 @@ discard block |
||
451 | 451 | */ |
452 | 452 | public function set_next_step() { |
453 | 453 | // set pointer to start of array |
454 | - reset( $this->reg_steps ); |
|
454 | + reset($this->reg_steps); |
|
455 | 455 | // if there is more than one step |
456 | - if ( count( $this->reg_steps ) > 1 ) { |
|
456 | + if (count($this->reg_steps) > 1) { |
|
457 | 457 | // advance to the current step and set pointer |
458 | - while ( key( $this->reg_steps ) != $this->current_step->slug() && key( $this->reg_steps ) != '' ) { |
|
459 | - next( $this->reg_steps ); |
|
458 | + while (key($this->reg_steps) != $this->current_step->slug() && key($this->reg_steps) != '') { |
|
459 | + next($this->reg_steps); |
|
460 | 460 | } |
461 | 461 | } |
462 | 462 | // advance one more spot ( if it exists ) |
463 | - $this->next_step = next( $this->reg_steps ); |
|
463 | + $this->next_step = next($this->reg_steps); |
|
464 | 464 | // verify instance |
465 | - $this->next_step = $this->next_step instanceof EE_SPCO_Reg_Step ? $this->next_step : NULL; |
|
465 | + $this->next_step = $this->next_step instanceof EE_SPCO_Reg_Step ? $this->next_step : NULL; |
|
466 | 466 | // then back to current step to reset |
467 | - prev( $this->reg_steps ); |
|
467 | + prev($this->reg_steps); |
|
468 | 468 | } |
469 | 469 | |
470 | 470 | |
@@ -478,8 +478,8 @@ discard block |
||
478 | 478 | * @return EE_SPCO_Reg_Step | null |
479 | 479 | */ |
480 | 480 | public function get_next_reg_step() { |
481 | - $next = next( $this->reg_steps ); |
|
482 | - prev( $this->reg_steps ); |
|
481 | + $next = next($this->reg_steps); |
|
482 | + prev($this->reg_steps); |
|
483 | 483 | return $next instanceof EE_SPCO_Reg_Step ? $next : null; |
484 | 484 | } |
485 | 485 | |
@@ -494,8 +494,8 @@ discard block |
||
494 | 494 | * @return EE_SPCO_Reg_Step | null |
495 | 495 | */ |
496 | 496 | public function get_prev_reg_step() { |
497 | - $prev = prev( $this->reg_steps ); |
|
498 | - next( $this->reg_steps ); |
|
497 | + $prev = prev($this->reg_steps); |
|
498 | + next($this->reg_steps); |
|
499 | 499 | return $prev instanceof EE_SPCO_Reg_Step ? $prev : null; |
500 | 500 | } |
501 | 501 | |
@@ -508,8 +508,8 @@ discard block |
||
508 | 508 | * @return void |
509 | 509 | */ |
510 | 510 | public function sort_reg_steps() { |
511 | - $reg_step_sorting_callback = apply_filters( 'FHEE__EE_Checkout__sort_reg_steps__reg_step_sorting_callback', 'reg_step_sorting_callback' ); |
|
512 | - uasort( $this->reg_steps, array( $this, $reg_step_sorting_callback )); |
|
511 | + $reg_step_sorting_callback = apply_filters('FHEE__EE_Checkout__sort_reg_steps__reg_step_sorting_callback', 'reg_step_sorting_callback'); |
|
512 | + uasort($this->reg_steps, array($this, $reg_step_sorting_callback)); |
|
513 | 513 | } |
514 | 514 | |
515 | 515 | |
@@ -522,19 +522,19 @@ discard block |
||
522 | 522 | * @param string $reg_step_slug |
523 | 523 | * @return EE_SPCO_Reg_Step|null |
524 | 524 | */ |
525 | - public function find_reg_step( $reg_step_slug = '' ) { |
|
526 | - if ( ! empty( $reg_step_slug ) ) { |
|
525 | + public function find_reg_step($reg_step_slug = '') { |
|
526 | + if ( ! empty($reg_step_slug)) { |
|
527 | 527 | // copy reg step array |
528 | 528 | $reg_steps = $this->reg_steps; |
529 | 529 | // set pointer to start of array |
530 | - reset( $reg_steps ); |
|
530 | + reset($reg_steps); |
|
531 | 531 | // if there is more than one step |
532 | - if ( count( $reg_steps ) > 1 ) { |
|
532 | + if (count($reg_steps) > 1) { |
|
533 | 533 | // advance to the current step and set pointer |
534 | - while ( key( $reg_steps ) != $reg_step_slug && key( $reg_steps ) != '' ) { |
|
535 | - next( $reg_steps ); |
|
534 | + while (key($reg_steps) != $reg_step_slug && key($reg_steps) != '') { |
|
535 | + next($reg_steps); |
|
536 | 536 | } |
537 | - return current( $reg_steps ); |
|
537 | + return current($reg_steps); |
|
538 | 538 | } |
539 | 539 | } |
540 | 540 | return null; |
@@ -550,17 +550,17 @@ discard block |
||
550 | 550 | * @param EE_SPCO_Reg_Step $reg_step_B |
551 | 551 | * @return array() |
552 | 552 | */ |
553 | - public function reg_step_sorting_callback( EE_SPCO_Reg_Step $reg_step_A, EE_SPCO_Reg_Step $reg_step_B ) { |
|
553 | + public function reg_step_sorting_callback(EE_SPCO_Reg_Step $reg_step_A, EE_SPCO_Reg_Step $reg_step_B) { |
|
554 | 554 | // send finalize_registration step to the end of the array |
555 | - if ( $reg_step_A->slug() == 'finalize_registration' ) { |
|
555 | + if ($reg_step_A->slug() == 'finalize_registration') { |
|
556 | 556 | return 1; |
557 | - } else if ( $reg_step_B->slug() == 'finalize_registration' ) { |
|
557 | + } else if ($reg_step_B->slug() == 'finalize_registration') { |
|
558 | 558 | return -1; |
559 | 559 | } |
560 | - if ( $reg_step_A->order() == $reg_step_B->order() ) { |
|
560 | + if ($reg_step_A->order() == $reg_step_B->order()) { |
|
561 | 561 | return 0; |
562 | 562 | } |
563 | - return ( $reg_step_A->order() > $reg_step_B->order() ) ? 1 : -1; |
|
563 | + return ($reg_step_A->order() > $reg_step_B->order()) ? 1 : -1; |
|
564 | 564 | } |
565 | 565 | |
566 | 566 | |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | * @access public |
572 | 572 | * @param EE_SPCO_Reg_Step $reg_step |
573 | 573 | */ |
574 | - public function set_reg_step_initiated( EE_SPCO_Reg_Step $reg_step ) { |
|
574 | + public function set_reg_step_initiated(EE_SPCO_Reg_Step $reg_step) { |
|
575 | 575 | // call set_reg_step_initiated ??? |
576 | 576 | if ( |
577 | 577 | // first time visiting SPCO ? |
@@ -580,13 +580,13 @@ discard block |
||
580 | 580 | && $this->action === 'display_spco_reg_step' |
581 | 581 | ) { |
582 | 582 | /** @type EE_Transaction_Processor $transaction_processor */ |
583 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
583 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
584 | 584 | // set the start time for this reg step |
585 | - if ( ! $transaction_processor->set_reg_step_initiated( $this->transaction, $reg_step->slug() ) ) { |
|
586 | - if ( WP_DEBUG ) { |
|
585 | + if ( ! $transaction_processor->set_reg_step_initiated($this->transaction, $reg_step->slug())) { |
|
586 | + if (WP_DEBUG) { |
|
587 | 587 | EE_Error::add_error( |
588 | 588 | sprintf( |
589 | - __( 'The "%1$s" registration step was not initialized properly.', 'event_espresso' ), |
|
589 | + __('The "%1$s" registration step was not initialized properly.', 'event_espresso'), |
|
590 | 590 | $reg_step->name() |
591 | 591 | ), |
592 | 592 | __FILE__, __FUNCTION__, __LINE__ |
@@ -605,10 +605,10 @@ discard block |
||
605 | 605 | * @return void |
606 | 606 | */ |
607 | 607 | public function set_reg_step_JSON_info() { |
608 | - EE_Registry::$i18n_js_strings[ 'reg_steps' ] = array(); |
|
608 | + EE_Registry::$i18n_js_strings['reg_steps'] = array(); |
|
609 | 609 | // pass basic reg step data to JS |
610 | - foreach ( $this->reg_steps as $reg_step ) { |
|
611 | - EE_Registry::$i18n_js_strings[ 'reg_steps' ][] = $reg_step->slug(); |
|
610 | + foreach ($this->reg_steps as $reg_step) { |
|
611 | + EE_Registry::$i18n_js_strings['reg_steps'][] = $reg_step->slug(); |
|
612 | 612 | } |
613 | 613 | // reset reg step html |
614 | 614 | // $this->json_response->set_reg_step_html( '' ); |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | */ |
625 | 625 | public function reset_reg_steps() { |
626 | 626 | $this->sort_reg_steps(); |
627 | - $this->set_current_step( EE_Registry::instance()->REQ->get( 'step' )); |
|
627 | + $this->set_current_step(EE_Registry::instance()->REQ->get('step')); |
|
628 | 628 | $this->set_next_step(); |
629 | 629 | // the text that appears on the reg step form submit button |
630 | 630 | $this->current_step->set_submit_button_text(); |
@@ -641,9 +641,9 @@ discard block |
||
641 | 641 | */ |
642 | 642 | public function get_registration_time_limit() { |
643 | 643 | |
644 | - $registration_time_limit = (float)( EE_Registry::instance() ->SSN->expiration() - time() ); |
|
644 | + $registration_time_limit = (float) (EE_Registry::instance() ->SSN->expiration() - time()); |
|
645 | 645 | $time_limit_format = $registration_time_limit > 60 * MINUTE_IN_SECONDS ? 'H:i:s' : 'i:s'; |
646 | - $registration_time_limit = gmdate( $time_limit_format, $registration_time_limit ); |
|
646 | + $registration_time_limit = gmdate($time_limit_format, $registration_time_limit); |
|
647 | 647 | return apply_filters( |
648 | 648 | 'FHEE__EE_Checkout__get_registration_time_limit__registration_time_limit', |
649 | 649 | $registration_time_limit |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | // overpaid TXN |
664 | 664 | // free TXN ( total = 0.00 ) |
665 | 665 | // then payment required is TRUE |
666 | - return ! ( $this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free() ) ? TRUE : FALSE; |
|
666 | + return ! ($this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free()) ? TRUE : FALSE; |
|
667 | 667 | } |
668 | 668 | |
669 | 669 | |
@@ -676,8 +676,8 @@ discard block |
||
676 | 676 | */ |
677 | 677 | public function initialize_txn_reg_steps_array() { |
678 | 678 | $txn_reg_steps_array = array(); |
679 | - foreach ( $this->reg_steps as $reg_step ) { |
|
680 | - $txn_reg_steps_array[ $reg_step->slug() ] = FALSE; |
|
679 | + foreach ($this->reg_steps as $reg_step) { |
|
680 | + $txn_reg_steps_array[$reg_step->slug()] = FALSE; |
|
681 | 681 | } |
682 | 682 | return $txn_reg_steps_array; |
683 | 683 | } |
@@ -693,13 +693,13 @@ discard block |
||
693 | 693 | public function update_txn_reg_steps_array() { |
694 | 694 | $updated = FALSE; |
695 | 695 | /** @type EE_Transaction_Processor $transaction_processor */ |
696 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
697 | - foreach ( $this->reg_steps as $reg_step ) { |
|
698 | - if ( $reg_step->completed() ) { |
|
699 | - $updated = $transaction_processor->set_reg_step_completed( $this->transaction, $reg_step->slug() ) ? TRUE : $updated; |
|
696 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
697 | + foreach ($this->reg_steps as $reg_step) { |
|
698 | + if ($reg_step->completed()) { |
|
699 | + $updated = $transaction_processor->set_reg_step_completed($this->transaction, $reg_step->slug()) ? TRUE : $updated; |
|
700 | 700 | } |
701 | 701 | } |
702 | - if ( $updated ) { |
|
702 | + if ($updated) { |
|
703 | 703 | $this->transaction->save(); |
704 | 704 | } |
705 | 705 | return $updated; |
@@ -714,14 +714,14 @@ discard block |
||
714 | 714 | * @return void |
715 | 715 | */ |
716 | 716 | public function stash_transaction_and_checkout() { |
717 | - if ( ! $this->revisit ) { |
|
717 | + if ( ! $this->revisit) { |
|
718 | 718 | $this->update_txn_reg_steps_array(); |
719 | 719 | } |
720 | 720 | $this->track_transaction_and_registration_status_updates(); |
721 | 721 | // save all data to the db, but suppress errors |
722 | 722 | //$this->save_all_data( FALSE ); |
723 | 723 | // cache the checkout in the session |
724 | - EE_Registry::instance()->SSN->set_checkout( $this ); |
|
724 | + EE_Registry::instance()->SSN->set_checkout($this); |
|
725 | 725 | } |
726 | 726 | |
727 | 727 | |
@@ -737,21 +737,21 @@ discard block |
||
737 | 737 | */ |
738 | 738 | public function track_transaction_and_registration_status_updates() { |
739 | 739 | // verify the transaction |
740 | - if ( $this->transaction instanceof EE_Transaction ) { |
|
740 | + if ($this->transaction instanceof EE_Transaction) { |
|
741 | 741 | /** @type EE_Transaction_Payments $transaction_payments */ |
742 | - $transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' ); |
|
742 | + $transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments'); |
|
743 | 743 | /** @type EE_Transaction_Processor $transaction_processor */ |
744 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
744 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
745 | 745 | // has there been a TXN status change during this checkout? |
746 | - if ( $transaction_payments->txn_status_updated() || $transaction_processor->txn_status_updated() ) { |
|
746 | + if ($transaction_payments->txn_status_updated() || $transaction_processor->txn_status_updated()) { |
|
747 | 747 | $this->txn_status_updated = true; |
748 | 748 | } |
749 | 749 | /** @type EE_Registration_Processor $registration_processor */ |
750 | - $registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' ); |
|
750 | + $registration_processor = EE_Registry::instance()->load_class('Registration_Processor'); |
|
751 | 751 | // grab the saved registrations from the transaction |
752 | - foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $registration ) { |
|
753 | - if ( $registration_processor->reg_status_updated( $registration->ID() ) ) { |
|
754 | - $this->set_reg_status_updated( $registration->ID(), true ); |
|
752 | + foreach ($this->transaction->registrations($this->reg_cache_where_params) as $registration) { |
|
753 | + if ($registration_processor->reg_status_updated($registration->ID())) { |
|
754 | + $this->set_reg_status_updated($registration->ID(), true); |
|
755 | 755 | } |
756 | 756 | } |
757 | 757 | } |
@@ -773,8 +773,8 @@ discard block |
||
773 | 773 | * @param EE_Registration $registration |
774 | 774 | * @return bool |
775 | 775 | */ |
776 | - public function visit_allows_processing_of_this_registration( EE_Registration $registration ) { |
|
777 | - return ! $this->revisit || $this->primary_revisit || ( $this->revisit && $this->reg_url_link == $registration->reg_url_link() ) ? TRUE : FALSE; |
|
776 | + public function visit_allows_processing_of_this_registration(EE_Registration $registration) { |
|
777 | + return ! $this->revisit || $this->primary_revisit || ($this->revisit && $this->reg_url_link == $registration->reg_url_link()) ? TRUE : FALSE; |
|
778 | 778 | } |
779 | 779 | |
780 | 780 | |
@@ -799,18 +799,18 @@ discard block |
||
799 | 799 | * @param bool $show_errors |
800 | 800 | * @return bool |
801 | 801 | */ |
802 | - public function save_all_data( $show_errors = TRUE ) { |
|
802 | + public function save_all_data($show_errors = TRUE) { |
|
803 | 803 | // verify the transaction |
804 | - if ( $this->transaction instanceof EE_Transaction ) { |
|
804 | + if ($this->transaction instanceof EE_Transaction) { |
|
805 | 805 | // save to ensure that TXN has ID |
806 | 806 | $this->transaction->save(); |
807 | 807 | // grab the saved registrations from the transaction |
808 | - foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $registration ) { |
|
809 | - $this->_save_registration( $registration, $show_errors ); |
|
808 | + foreach ($this->transaction->registrations($this->reg_cache_where_params) as $registration) { |
|
809 | + $this->_save_registration($registration, $show_errors); |
|
810 | 810 | } |
811 | 811 | } else { |
812 | - if ( $show_errors ) { |
|
813 | - EE_Error::add_error( __( 'A valid Transaction was not found when attempting to save your registration information.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
812 | + if ($show_errors) { |
|
813 | + EE_Error::add_error(__('A valid Transaction was not found when attempting to save your registration information.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
814 | 814 | } |
815 | 815 | return FALSE; |
816 | 816 | } |
@@ -825,32 +825,32 @@ discard block |
||
825 | 825 | * @param bool $show_errors |
826 | 826 | * @return void |
827 | 827 | */ |
828 | - private function _save_registration( $registration, $show_errors = TRUE ) { |
|
828 | + private function _save_registration($registration, $show_errors = TRUE) { |
|
829 | 829 | // verify object |
830 | - if ( $registration instanceof EE_Registration ) { |
|
830 | + if ($registration instanceof EE_Registration) { |
|
831 | 831 | // should this registration be processed during this visit ? |
832 | - if ( $this->visit_allows_processing_of_this_registration( $registration ) ) { |
|
832 | + if ($this->visit_allows_processing_of_this_registration($registration)) { |
|
833 | 833 | //set TXN ID |
834 | - if ( ! $registration->transaction_ID() ) { |
|
835 | - $registration->set_transaction_id( $this->transaction->ID() ); |
|
834 | + if ( ! $registration->transaction_ID()) { |
|
835 | + $registration->set_transaction_id($this->transaction->ID()); |
|
836 | 836 | } |
837 | 837 | // verify and save the attendee |
838 | - $this->_save_registration_attendee( $registration, $show_errors ); |
|
838 | + $this->_save_registration_attendee($registration, $show_errors); |
|
839 | 839 | // save answers to reg form questions |
840 | - $this->_save_registration_answers( $registration, $show_errors ); |
|
840 | + $this->_save_registration_answers($registration, $show_errors); |
|
841 | 841 | // save changes |
842 | 842 | $registration->save(); |
843 | 843 | // update txn cache |
844 | - if ( ! $this->transaction->update_cache_after_object_save( 'Registration', $registration )) { |
|
845 | - if ( $show_errors ) { |
|
846 | - EE_Error::add_error( __( 'The newly saved Registration object could not be cached on the Transaction.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
844 | + if ( ! $this->transaction->update_cache_after_object_save('Registration', $registration)) { |
|
845 | + if ($show_errors) { |
|
846 | + EE_Error::add_error(__('The newly saved Registration object could not be cached on the Transaction.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
847 | 847 | } |
848 | 848 | } |
849 | 849 | } |
850 | 850 | } else { |
851 | - if ( $show_errors ) { |
|
851 | + if ($show_errors) { |
|
852 | 852 | EE_Error::add_error( |
853 | - __( 'An invalid Registration object was discovered when attempting to save your registration information.', 'event_espresso' ), |
|
853 | + __('An invalid Registration object was discovered when attempting to save your registration information.', 'event_espresso'), |
|
854 | 854 | __FILE__, __FUNCTION__, __LINE__ |
855 | 855 | ); |
856 | 856 | } |
@@ -866,26 +866,26 @@ discard block |
||
866 | 866 | * @param bool $show_errors |
867 | 867 | * @return void |
868 | 868 | */ |
869 | - private function _save_registration_attendee( $registration, $show_errors = TRUE ) { |
|
870 | - if ( $registration->attendee() instanceof EE_Attendee ) { |
|
869 | + private function _save_registration_attendee($registration, $show_errors = TRUE) { |
|
870 | + if ($registration->attendee() instanceof EE_Attendee) { |
|
871 | 871 | // save so that ATT has ID |
872 | 872 | $registration->attendee()->save(); |
873 | - if ( ! $registration->update_cache_after_object_save( 'Attendee', $registration->attendee() )) { |
|
874 | - if ( $show_errors ) { |
|
873 | + if ( ! $registration->update_cache_after_object_save('Attendee', $registration->attendee())) { |
|
874 | + if ($show_errors) { |
|
875 | 875 | EE_Error::add_error( |
876 | - __( 'The newly saved Attendee object could not be cached on the registration.', 'event_espresso' ), |
|
876 | + __('The newly saved Attendee object could not be cached on the registration.', 'event_espresso'), |
|
877 | 877 | __FILE__, __FUNCTION__, __LINE__ |
878 | 878 | ); |
879 | 879 | } |
880 | 880 | } |
881 | 881 | } else { |
882 | - if ( $show_errors ) { |
|
882 | + if ($show_errors) { |
|
883 | 883 | ob_start(); |
884 | - var_dump( $registration->attendee() ); |
|
884 | + var_dump($registration->attendee()); |
|
885 | 885 | EE_Error::add_error( |
886 | 886 | sprintf( |
887 | 887 | '%1$s||%1$s $attendee = %2$s', |
888 | - __( 'Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso' ), |
|
888 | + __('Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso'), |
|
889 | 889 | ob_get_clean() |
890 | 890 | ), |
891 | 891 | __FILE__, __FUNCTION__, __LINE__ |
@@ -903,25 +903,25 @@ discard block |
||
903 | 903 | * @param bool $show_errors |
904 | 904 | * @return void |
905 | 905 | */ |
906 | - private function _save_registration_answers( $registration, $show_errors = TRUE ) { |
|
906 | + private function _save_registration_answers($registration, $show_errors = TRUE) { |
|
907 | 907 | // now save the answers |
908 | - foreach ( $registration->answers() as $cache_key => $answer ) { |
|
908 | + foreach ($registration->answers() as $cache_key => $answer) { |
|
909 | 909 | // verify object |
910 | - if ( $answer instanceof EE_Answer ) { |
|
911 | - $answer->set_registration( $registration->ID() ); |
|
910 | + if ($answer instanceof EE_Answer) { |
|
911 | + $answer->set_registration($registration->ID()); |
|
912 | 912 | $answer->save(); |
913 | - if ( ! $registration->update_cache_after_object_save( 'Answer', $answer, $cache_key )) { |
|
914 | - if ( $show_errors ) { |
|
913 | + if ( ! $registration->update_cache_after_object_save('Answer', $answer, $cache_key)) { |
|
914 | + if ($show_errors) { |
|
915 | 915 | EE_Error::add_error( |
916 | - __( 'The newly saved Answer object could not be cached on the registration.', 'event_espresso' ), |
|
916 | + __('The newly saved Answer object could not be cached on the registration.', 'event_espresso'), |
|
917 | 917 | __FILE__, __FUNCTION__, __LINE__ |
918 | 918 | ); |
919 | 919 | } |
920 | 920 | } |
921 | 921 | } else { |
922 | - if ( $show_errors ) { |
|
922 | + if ($show_errors) { |
|
923 | 923 | EE_Error::add_error( |
924 | - __( 'An invalid Answer object was discovered when attempting to save your registration information.', 'event_espresso' ), |
|
924 | + __('An invalid Answer object was discovered when attempting to save your registration information.', 'event_espresso'), |
|
925 | 925 | __FILE__, __FUNCTION__, __LINE__ |
926 | 926 | ); |
927 | 927 | } |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | * @param bool $from_db |
940 | 940 | * @return bool |
941 | 941 | */ |
942 | - public function refresh_all_entities( $from_db = false ) { |
|
942 | + public function refresh_all_entities($from_db = false) { |
|
943 | 943 | $from_db = $this->current_step->is_final_step() || $this->action == 'process_gateway_response' ? true : $from_db; |
944 | 944 | //$this->log( |
945 | 945 | // __CLASS__, __FUNCTION__, __LINE__, |
@@ -960,11 +960,11 @@ discard block |
||
960 | 960 | */ |
961 | 961 | protected function refresh_from_db() { |
962 | 962 | // verify the transaction |
963 | - if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) { |
|
963 | + if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) { |
|
964 | 964 | // pull fresh TXN data from the db |
965 | - $this->transaction = $this->transaction->get_model()->refresh_entity_map_from_db( $this->transaction->ID() ); |
|
965 | + $this->transaction = $this->transaction->get_model()->refresh_entity_map_from_db($this->transaction->ID()); |
|
966 | 966 | // update EE_Checkout's cached primary_attendee object |
967 | - $this->primary_attendee_obj = $this->_refresh_primary_attendee_obj_from_db( $this->transaction ); |
|
967 | + $this->primary_attendee_obj = $this->_refresh_primary_attendee_obj_from_db($this->transaction); |
|
968 | 968 | // update EE_Checkout's cached payment object |
969 | 969 | $payment = $this->transaction->last_payment(); |
970 | 970 | $this->payment = $payment instanceof EE_Payment ? $payment : $this->payment; |
@@ -972,15 +972,15 @@ discard block |
||
972 | 972 | $payment_method = $this->payment instanceof EE_Payment ? $this->payment->payment_method() : null; |
973 | 973 | $this->payment_method = $payment_method instanceof EE_Payment_Method ? $payment_method : $this->payment_method; |
974 | 974 | //now refresh the cart, based on the TXN |
975 | - $this->cart = EE_Cart::get_cart_from_txn( $this->transaction ); |
|
975 | + $this->cart = EE_Cart::get_cart_from_txn($this->transaction); |
|
976 | 976 | // verify and update the cart because inaccurate totals are not so much fun |
977 | - if ( $this->cart instanceof EE_Cart ) { |
|
977 | + if ($this->cart instanceof EE_Cart) { |
|
978 | 978 | $this->cart->get_grand_total()->recalculate_total_including_taxes(); |
979 | 979 | } else { |
980 | - $this->cart = EE_Registry::instance()->load_core( 'Cart' ); |
|
980 | + $this->cart = EE_Registry::instance()->load_core('Cart'); |
|
981 | 981 | } |
982 | 982 | } else { |
983 | - EE_Error::add_error( __( 'A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
983 | + EE_Error::add_error(__('A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
984 | 984 | return FALSE; |
985 | 985 | } |
986 | 986 | return TRUE; |
@@ -994,24 +994,24 @@ discard block |
||
994 | 994 | * @param EE_Transaction $transaction |
995 | 995 | * @return EE_Attendee | null |
996 | 996 | */ |
997 | - protected function _refresh_primary_attendee_obj_from_db( EE_Transaction $transaction ) { |
|
997 | + protected function _refresh_primary_attendee_obj_from_db(EE_Transaction $transaction) { |
|
998 | 998 | |
999 | 999 | $primary_attendee_obj = null; |
1000 | 1000 | // grab the saved registrations from the transaction |
1001 | - foreach ( $transaction->registrations( $this->reg_cache_where_params, true ) as $registration ) { |
|
1001 | + foreach ($transaction->registrations($this->reg_cache_where_params, true) as $registration) { |
|
1002 | 1002 | // verify object |
1003 | - if ( $registration instanceof EE_Registration ) { |
|
1003 | + if ($registration instanceof EE_Registration) { |
|
1004 | 1004 | $attendee = $registration->attendee(); |
1005 | 1005 | // verify object |
1006 | - if ( $attendee instanceof EE_Attendee ) { |
|
1006 | + if ($attendee instanceof EE_Attendee) { |
|
1007 | 1007 | // maybe cache primary_attendee_obj ? |
1008 | - if ( $registration->is_primary_registrant() ) { |
|
1008 | + if ($registration->is_primary_registrant()) { |
|
1009 | 1009 | $primary_attendee_obj = $attendee; |
1010 | 1010 | } |
1011 | 1011 | } |
1012 | 1012 | } else { |
1013 | 1013 | EE_Error::add_error( |
1014 | - __( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ), |
|
1014 | + __('An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso'), |
|
1015 | 1015 | __FILE__, __FUNCTION__, __LINE__ |
1016 | 1016 | ); |
1017 | 1017 | } |
@@ -1031,43 +1031,43 @@ discard block |
||
1031 | 1031 | */ |
1032 | 1032 | protected function refresh_entity_map() { |
1033 | 1033 | // verify the transaction |
1034 | - if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) { |
|
1034 | + if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) { |
|
1035 | 1035 | // never cache payment info |
1036 | - $this->transaction->clear_cache( 'Payment' ); |
|
1036 | + $this->transaction->clear_cache('Payment'); |
|
1037 | 1037 | /** @type EE_Transaction_Processor $transaction_processor */ |
1038 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
1038 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
1039 | 1039 | // is the Payment Options Reg Step completed ? |
1040 | - if ( $transaction_processor->reg_step_completed( $this->transaction, 'payment_options' ) ) { |
|
1040 | + if ($transaction_processor->reg_step_completed($this->transaction, 'payment_options')) { |
|
1041 | 1041 | // then check for payments and update TXN accordingly |
1042 | 1042 | /** @type EE_Transaction_Payments $transaction_payments */ |
1043 | - $transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' ); |
|
1044 | - $transaction_payments->calculate_total_payments_and_update_status( $this->transaction ); |
|
1043 | + $transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments'); |
|
1044 | + $transaction_payments->calculate_total_payments_and_update_status($this->transaction); |
|
1045 | 1045 | } |
1046 | 1046 | // grab the saved registrations from the transaction |
1047 | - foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $reg_cache_ID => $registration ) { |
|
1048 | - $this->_refresh_registration( $reg_cache_ID, $registration ); |
|
1047 | + foreach ($this->transaction->registrations($this->reg_cache_where_params) as $reg_cache_ID => $registration) { |
|
1048 | + $this->_refresh_registration($reg_cache_ID, $registration); |
|
1049 | 1049 | } |
1050 | 1050 | // make sure our cached TXN is added to the model entity mapper |
1051 | - $this->transaction = $this->transaction->get_model()->refresh_entity_map_with( $this->transaction->ID(), $this->transaction ); |
|
1051 | + $this->transaction = $this->transaction->get_model()->refresh_entity_map_with($this->transaction->ID(), $this->transaction); |
|
1052 | 1052 | |
1053 | 1053 | } else { |
1054 | - EE_Error::add_error( __( 'A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
1054 | + EE_Error::add_error(__('A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1055 | 1055 | return FALSE; |
1056 | 1056 | } |
1057 | 1057 | // verify and update the cart because inaccurate totals are not so much fun |
1058 | - if ( $this->cart instanceof EE_Cart ) { |
|
1058 | + if ($this->cart instanceof EE_Cart) { |
|
1059 | 1059 | $grand_total = $this->cart->get_grand_total(); |
1060 | - if ( $grand_total instanceof EE_Line_Item && $grand_total->ID() ) { |
|
1060 | + if ($grand_total instanceof EE_Line_Item && $grand_total->ID()) { |
|
1061 | 1061 | $grand_total->recalculate_total_including_taxes(); |
1062 | 1062 | $grand_total = $grand_total->get_model()->refresh_entity_map_with( |
1063 | 1063 | $this->cart->get_grand_total()->ID(), |
1064 | 1064 | $this->cart->get_grand_total() |
1065 | 1065 | ); |
1066 | 1066 | } |
1067 | - if ( $grand_total instanceof EE_Line_Item ) { |
|
1068 | - $this->cart = EE_Cart::instance( $grand_total ); |
|
1067 | + if ($grand_total instanceof EE_Line_Item) { |
|
1068 | + $this->cart = EE_Cart::instance($grand_total); |
|
1069 | 1069 | } else { |
1070 | - EE_Error::add_error( __( 'A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
1070 | + EE_Error::add_error(__('A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1071 | 1071 | return false; |
1072 | 1072 | } |
1073 | 1073 | } |
@@ -1083,19 +1083,19 @@ discard block |
||
1083 | 1083 | * @param EE_Registration $registration |
1084 | 1084 | * @return void |
1085 | 1085 | */ |
1086 | - protected function _refresh_registration( $reg_cache_ID, $registration ) { |
|
1086 | + protected function _refresh_registration($reg_cache_ID, $registration) { |
|
1087 | 1087 | |
1088 | 1088 | // verify object |
1089 | - if ( $registration instanceof EE_Registration ) { |
|
1089 | + if ($registration instanceof EE_Registration) { |
|
1090 | 1090 | // update the entity mapper attendee |
1091 | - $this->_refresh_registration_attendee( $registration ); |
|
1091 | + $this->_refresh_registration_attendee($registration); |
|
1092 | 1092 | // update the entity mapper answers for reg form questions |
1093 | - $this->_refresh_registration_answers( $registration ); |
|
1093 | + $this->_refresh_registration_answers($registration); |
|
1094 | 1094 | // make sure the cached registration is added to the model entity mapper |
1095 | - $registration->get_model()->refresh_entity_map_with( $reg_cache_ID, $registration ); |
|
1095 | + $registration->get_model()->refresh_entity_map_with($reg_cache_ID, $registration); |
|
1096 | 1096 | } else { |
1097 | 1097 | EE_Error::add_error( |
1098 | - __( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ), |
|
1098 | + __('An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso'), |
|
1099 | 1099 | __FILE__, __FUNCTION__, __LINE__ |
1100 | 1100 | ); |
1101 | 1101 | } |
@@ -1109,15 +1109,15 @@ discard block |
||
1109 | 1109 | * @param EE_Registration $registration |
1110 | 1110 | * @return void |
1111 | 1111 | */ |
1112 | - protected function _refresh_registration_attendee( $registration ) { |
|
1112 | + protected function _refresh_registration_attendee($registration) { |
|
1113 | 1113 | |
1114 | 1114 | $attendee = $registration->attendee(); |
1115 | 1115 | // verify object |
1116 | - if ( $attendee instanceof EE_Attendee && $attendee->ID() ) { |
|
1116 | + if ($attendee instanceof EE_Attendee && $attendee->ID()) { |
|
1117 | 1117 | // make sure the cached attendee is added to the model entity mapper |
1118 | - $registration->attendee()->get_model()->refresh_entity_map_with( $attendee->ID(), $attendee ); |
|
1118 | + $registration->attendee()->get_model()->refresh_entity_map_with($attendee->ID(), $attendee); |
|
1119 | 1119 | // maybe cache primary_attendee_obj ? |
1120 | - if ( $registration->is_primary_registrant() ) { |
|
1120 | + if ($registration->is_primary_registrant()) { |
|
1121 | 1121 | $this->primary_attendee_obj = $attendee; |
1122 | 1122 | } |
1123 | 1123 | } |
@@ -1131,19 +1131,19 @@ discard block |
||
1131 | 1131 | * @param EE_Registration $registration |
1132 | 1132 | * @return void |
1133 | 1133 | */ |
1134 | - protected function _refresh_registration_answers( $registration ) { |
|
1134 | + protected function _refresh_registration_answers($registration) { |
|
1135 | 1135 | |
1136 | 1136 | // now update the answers |
1137 | - foreach ( $registration->answers() as $cache_key => $answer ) { |
|
1137 | + foreach ($registration->answers() as $cache_key => $answer) { |
|
1138 | 1138 | // verify object |
1139 | - if ( $answer instanceof EE_Answer ) { |
|
1140 | - if ( $answer->ID() ) { |
|
1139 | + if ($answer instanceof EE_Answer) { |
|
1140 | + if ($answer->ID()) { |
|
1141 | 1141 | // make sure the cached answer is added to the model entity mapper |
1142 | - $answer->get_model()->refresh_entity_map_with( $answer->ID(), $answer ); |
|
1142 | + $answer->get_model()->refresh_entity_map_with($answer->ID(), $answer); |
|
1143 | 1143 | } |
1144 | 1144 | } else { |
1145 | 1145 | EE_Error::add_error( |
1146 | - __( 'An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso' ), |
|
1146 | + __('An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso'), |
|
1147 | 1147 | __FILE__, __FUNCTION__, __LINE__ |
1148 | 1148 | ); |
1149 | 1149 | } |
@@ -1158,7 +1158,7 @@ discard block |
||
1158 | 1158 | * this will reinstate the EE_Checkout object on each EE_SPCO_Reg_Step object |
1159 | 1159 | */ |
1160 | 1160 | function __wakeup() { |
1161 | - foreach ( $this->reg_steps as $reg_step ) { |
|
1161 | + foreach ($this->reg_steps as $reg_step) { |
|
1162 | 1162 | $reg_step->checkout = $this; |
1163 | 1163 | } |
1164 | 1164 | } |
@@ -1174,11 +1174,11 @@ discard block |
||
1174 | 1174 | * @param array $info |
1175 | 1175 | * @param bool $display_request |
1176 | 1176 | */ |
1177 | - function log( $class = '', $func = '', $line = '', $info = array(), $display_request = false ) { |
|
1178 | - if ( WP_DEBUG && false ) { |
|
1179 | - $debug_data = get_option( 'EE_DEBUG_SPCO_' . EE_Session::instance()->id(), array() ); |
|
1177 | + function log($class = '', $func = '', $line = '', $info = array(), $display_request = false) { |
|
1178 | + if (WP_DEBUG && false) { |
|
1179 | + $debug_data = get_option('EE_DEBUG_SPCO_'.EE_Session::instance()->id(), array()); |
|
1180 | 1180 | $default_data = array( |
1181 | - $class => $func . '() : ' . $line, |
|
1181 | + $class => $func.'() : '.$line, |
|
1182 | 1182 | 'request->step' => $this->step, |
1183 | 1183 | 'request->action' => $this->action, |
1184 | 1184 | 'current_step->slug' => $this->current_step instanceof EE_SPCO_Reg_Step ? |
@@ -1190,24 +1190,24 @@ discard block |
||
1190 | 1190 | 'reg_url_link' => $this->reg_url_link, |
1191 | 1191 | 'REQ' => $display_request ? $_REQUEST : '', |
1192 | 1192 | ); |
1193 | - if ( $this->transaction instanceof EE_Transaction ) { |
|
1194 | - $default_data[ 'TXN_status' ] = $this->transaction->status_ID(); |
|
1195 | - $default_data[ 'TXN_reg_steps' ] = $this->transaction->reg_steps(); |
|
1196 | - foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $REG_ID => $registration ) { |
|
1197 | - $default_data[ 'registrations' ][ $REG_ID ] = $registration->status_ID(); |
|
1193 | + if ($this->transaction instanceof EE_Transaction) { |
|
1194 | + $default_data['TXN_status'] = $this->transaction->status_ID(); |
|
1195 | + $default_data['TXN_reg_steps'] = $this->transaction->reg_steps(); |
|
1196 | + foreach ($this->transaction->registrations($this->reg_cache_where_params) as $REG_ID => $registration) { |
|
1197 | + $default_data['registrations'][$REG_ID] = $registration->status_ID(); |
|
1198 | 1198 | } |
1199 | - if ( $this->transaction->ID() ) { |
|
1200 | - $TXN_ID = 'EE_Transaction: ' . $this->transaction->ID(); |
|
1199 | + if ($this->transaction->ID()) { |
|
1200 | + $TXN_ID = 'EE_Transaction: '.$this->transaction->ID(); |
|
1201 | 1201 | // don't serialize objects |
1202 | - $info = $this->_strip_objects( $info ); |
|
1203 | - if ( ! isset( $debug_data[ $TXN_ID ] ) ) { |
|
1204 | - $debug_data[ $TXN_ID ] = array(); |
|
1202 | + $info = $this->_strip_objects($info); |
|
1203 | + if ( ! isset($debug_data[$TXN_ID])) { |
|
1204 | + $debug_data[$TXN_ID] = array(); |
|
1205 | 1205 | } |
1206 | - $debug_data[ $TXN_ID ][ microtime() ] = array_merge( |
|
1206 | + $debug_data[$TXN_ID][microtime()] = array_merge( |
|
1207 | 1207 | $default_data, |
1208 | 1208 | $info |
1209 | 1209 | ); |
1210 | - update_option( 'EE_DEBUG_SPCO_' . EE_Session::instance()->id(), $debug_data ); |
|
1210 | + update_option('EE_DEBUG_SPCO_'.EE_Session::instance()->id(), $debug_data); |
|
1211 | 1211 | } |
1212 | 1212 | } |
1213 | 1213 | } |
@@ -1220,23 +1220,23 @@ discard block |
||
1220 | 1220 | * @param array $info |
1221 | 1221 | * @return array |
1222 | 1222 | */ |
1223 | - function _strip_objects( $info = array() ) { |
|
1224 | - foreach ( $info as $key => $value ) { |
|
1225 | - if ( is_array( $value )) { |
|
1226 | - $info[ $key ] = $this->_strip_objects( $value ); |
|
1227 | - } else if ( is_object( $value ) ) { |
|
1228 | - $object_class = get_class( $value ); |
|
1229 | - $info[ $object_class ] = array(); |
|
1230 | - $info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0; |
|
1231 | - if ( method_exists( $value, 'status' ) ) { |
|
1232 | - $info[ $object_class ][ 'status' ] = $value->status(); |
|
1233 | - } else if ( method_exists( $value, 'status_ID' ) ) { |
|
1234 | - $info[ $object_class ][ 'status' ] = $value->status_ID(); |
|
1223 | + function _strip_objects($info = array()) { |
|
1224 | + foreach ($info as $key => $value) { |
|
1225 | + if (is_array($value)) { |
|
1226 | + $info[$key] = $this->_strip_objects($value); |
|
1227 | + } else if (is_object($value)) { |
|
1228 | + $object_class = get_class($value); |
|
1229 | + $info[$object_class] = array(); |
|
1230 | + $info[$object_class]['ID'] = method_exists($value, 'ID') ? $value->ID() : 0; |
|
1231 | + if (method_exists($value, 'status')) { |
|
1232 | + $info[$object_class]['status'] = $value->status(); |
|
1233 | + } else if (method_exists($value, 'status_ID')) { |
|
1234 | + $info[$object_class]['status'] = $value->status_ID(); |
|
1235 | 1235 | } |
1236 | - unset( $info[ $key ] ); |
|
1236 | + unset($info[$key]); |
|
1237 | 1237 | } |
1238 | 1238 | } |
1239 | - return (array)$info; |
|
1239 | + return (array) $info; |
|
1240 | 1240 | } |
1241 | 1241 | |
1242 | 1242 |