@@ -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 --> |
@@ -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->ID(),$questions_to_skip)){ |
|
146 | + foreach ($question_group->questions() as $question) { |
|
147 | + if (in_array($question->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> |
@@ -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> |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * @return EED_Ical |
33 | 33 | */ |
34 | 34 | public static function instance() { |
35 | - return parent::get_instance( __CLASS__ ); |
|
35 | + return parent::get_instance(__CLASS__); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public static function set_hooks() { |
47 | 47 | // create download buttons |
48 | - add_filter( 'FHEE__espresso_list_of_event_dates__datetime_html', array( 'EED_Ical', 'generate_add_to_iCal_button' ), 10, 2 ); |
|
48 | + add_filter('FHEE__espresso_list_of_event_dates__datetime_html', array('EED_Ical', 'generate_add_to_iCal_button'), 10, 2); |
|
49 | 49 | // process ics download request |
50 | - EE_Config::register_route( 'download_ics_file', 'EED_Ical', 'download_ics_file' ); |
|
50 | + EE_Config::register_route('download_ics_file', 'EED_Ical', 'download_ics_file'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @param WP $WP |
71 | 71 | * @return void |
72 | 72 | */ |
73 | - public function run( $WP ) {} |
|
73 | + public function run($WP) {} |
|
74 | 74 | |
75 | 75 | |
76 | 76 | |
@@ -82,30 +82,30 @@ discard block |
||
82 | 82 | * @param $datetime |
83 | 83 | * @return string |
84 | 84 | */ |
85 | - public static function generate_add_to_iCal_button( $html, $datetime ) { |
|
85 | + public static function generate_add_to_iCal_button($html, $datetime) { |
|
86 | 86 | // first verify a proper datetime object has been received |
87 | - if ( $datetime instanceof EE_Datetime ) { |
|
87 | + if ($datetime instanceof EE_Datetime) { |
|
88 | 88 | // set whether a link or submit button is shown |
89 | - $iCal_type = apply_filters( 'FHEE__EED_Ical__generate_add_to_iCal_button__iCal_type', 'submit' ); |
|
89 | + $iCal_type = apply_filters('FHEE__EED_Ical__generate_add_to_iCal_button__iCal_type', 'submit'); |
|
90 | 90 | // generate a link to the route we registered in set_hooks() |
91 | - $URL = add_query_arg( array( 'ee' => 'download_ics_file', 'ics_id' => $datetime->ID() ), site_url() ); |
|
91 | + $URL = add_query_arg(array('ee' => 'download_ics_file', 'ics_id' => $datetime->ID()), site_url()); |
|
92 | 92 | // what type ? |
93 | - switch ( $iCal_type ) { |
|
93 | + switch ($iCal_type) { |
|
94 | 94 | // submit buttons appear as buttons and are very compatible with a theme's style |
95 | 95 | case 'submit' : |
96 | - $html .= '<form id="download-iCal-frm-' . $datetime->ID() . '" class="download-iCal-frm" action="' . $URL . '" method="post" >'; |
|
97 | - $html .= '<input type="submit" class="ee-ical-sbmt" value="" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '"/>'; |
|
96 | + $html .= '<form id="download-iCal-frm-'.$datetime->ID().'" class="download-iCal-frm" action="'.$URL.'" method="post" >'; |
|
97 | + $html .= '<input type="submit" class="ee-ical-sbmt" value="" title="'.__('Add to iCal Calendar', 'event_espresso').'"/>'; |
|
98 | 98 | $html .= '</form>'; |
99 | 99 | break; |
100 | 100 | // buttons are just links that have been styled to appear as buttons, but may not be blend with a theme as well as submit buttons |
101 | 101 | case 'button' : |
102 | - $html .= '<a class="ee-ical-btn small ee-button ee-roundish" href="' . $URL . '" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '">'; |
|
102 | + $html .= '<a class="ee-ical-btn small ee-button ee-roundish" href="'.$URL.'" title="'.__('Add to iCal Calendar', 'event_espresso').'">'; |
|
103 | 103 | $html .= ' <span class="dashicons dashicons-calendar"></span>'; |
104 | 104 | $html .= '</a>'; |
105 | 105 | break; |
106 | 106 | // links are just links that use the calendar dashicon |
107 | 107 | case 'icon' : |
108 | - $html .= '<a class="ee-ical-lnk" href="' . $URL . '" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '">'; |
|
108 | + $html .= '<a class="ee-ical-lnk" href="'.$URL.'" title="'.__('Add to iCal Calendar', 'event_espresso').'">'; |
|
109 | 109 | $html .= ' <span class="dashicons dashicons-calendar"></span>'; |
110 | 110 | $html .= '</a>'; |
111 | 111 | break; |
@@ -123,73 +123,73 @@ discard block |
||
123 | 123 | * @return void |
124 | 124 | */ |
125 | 125 | public static function download_ics_file() { |
126 | - if ( EE_Registry::instance()->REQ->is_set( 'ics_id' )) { |
|
127 | - $DTT_ID = absint( EE_Registry::instance()->REQ->get( 'ics_id' )); |
|
128 | - $datetime = EE_Registry::instance()->load_model( 'Datetime' )->get_one_by_ID( $DTT_ID ); |
|
129 | - if ( $datetime instanceof EE_Datetime ) { |
|
126 | + if (EE_Registry::instance()->REQ->is_set('ics_id')) { |
|
127 | + $DTT_ID = absint(EE_Registry::instance()->REQ->get('ics_id')); |
|
128 | + $datetime = EE_Registry::instance()->load_model('Datetime')->get_one_by_ID($DTT_ID); |
|
129 | + if ($datetime instanceof EE_Datetime) { |
|
130 | 130 | // get related event, venues, and event categories |
131 | 131 | $event = $datetime->event(); |
132 | 132 | // get related category Term object and it's name |
133 | 133 | $category = $event->first_event_category(); |
134 | - if ( $category instanceof EE_Term ) { |
|
134 | + if ($category instanceof EE_Term) { |
|
135 | 135 | $category = $category->name(); |
136 | 136 | } |
137 | 137 | $location = ''; |
138 | 138 | // get first related venue and convert to CSV string |
139 | - $venue = $event->venues(array( 'limit'=>1 )); |
|
140 | - if ( is_array( $venue ) && ! empty( $venue )) { |
|
141 | - $venue = array_shift( $venue ); |
|
142 | - if ( $venue instanceof EE_Venue ) { |
|
143 | - EE_Registry::instance()->load_helper( 'Venue_View' ); |
|
144 | - $location = espresso_venue_raw_address( 'inline', $venue->ID(), FALSE ); |
|
139 | + $venue = $event->venues(array('limit'=>1)); |
|
140 | + if (is_array($venue) && ! empty($venue)) { |
|
141 | + $venue = array_shift($venue); |
|
142 | + if ($venue instanceof EE_Venue) { |
|
143 | + EE_Registry::instance()->load_helper('Venue_View'); |
|
144 | + $location = espresso_venue_raw_address('inline', $venue->ID(), FALSE); |
|
145 | 145 | } |
146 | 146 | } |
147 | 147 | // set variables, escape strings, convert timestamps to ics format, etc |
148 | - $filename = $event->slug() . '-' . $datetime->start_date( 'Y-m-d' ) . '.ics'; |
|
149 | - $organizer = EED_Ical::_escape_ICal_data( EE_Registry::instance()->CFG->organization->name ); |
|
150 | - $UID = EED_Ical::_escape_ICal_data( md5( $event->name() . $event->ID() . $datetime->ID() )); |
|
151 | - $org_email = EED_Ical::_escape_ICal_data( $datetime->ID() ); |
|
152 | - $timestamp = date( EED_Ical::iCal_datetime_format ); |
|
153 | - $location = EED_Ical::_escape_ICal_data( $location ); |
|
154 | - $summary = EED_Ical::_escape_ICal_data( $event->name() ); |
|
155 | - $description = EED_Ical::_escape_ICal_data( wp_strip_all_tags( $event->description() )); |
|
148 | + $filename = $event->slug().'-'.$datetime->start_date('Y-m-d').'.ics'; |
|
149 | + $organizer = EED_Ical::_escape_ICal_data(EE_Registry::instance()->CFG->organization->name); |
|
150 | + $UID = EED_Ical::_escape_ICal_data(md5($event->name().$event->ID().$datetime->ID())); |
|
151 | + $org_email = EED_Ical::_escape_ICal_data($datetime->ID()); |
|
152 | + $timestamp = date(EED_Ical::iCal_datetime_format); |
|
153 | + $location = EED_Ical::_escape_ICal_data($location); |
|
154 | + $summary = EED_Ical::_escape_ICal_data($event->name()); |
|
155 | + $description = EED_Ical::_escape_ICal_data(wp_strip_all_tags($event->description())); |
|
156 | 156 | $status = $datetime->get_active_status(); |
157 | 157 | $status = $status == EE_Datetime::cancelled ? 'Cancelled' : 'Confirmed'; |
158 | - $status = EED_Ical::_escape_ICal_data( $status ); |
|
159 | - $categories = EED_Ical::_escape_ICal_data( $category ); |
|
160 | - $url = EED_Ical::_escape_ICal_data( get_permalink( $event->ID() )); |
|
161 | - $dtt_start = EED_Ical::_escape_ICal_data( date( EED_Ical::iCal_datetime_format, $datetime->start() )); |
|
162 | - $dtt_end = EED_Ical::_escape_ICal_data( date( EED_Ical::iCal_datetime_format, $datetime->end() )); |
|
158 | + $status = EED_Ical::_escape_ICal_data($status); |
|
159 | + $categories = EED_Ical::_escape_ICal_data($category); |
|
160 | + $url = EED_Ical::_escape_ICal_data(get_permalink($event->ID())); |
|
161 | + $dtt_start = EED_Ical::_escape_ICal_data(date(EED_Ical::iCal_datetime_format, $datetime->start())); |
|
162 | + $dtt_end = EED_Ical::_escape_ICal_data(date(EED_Ical::iCal_datetime_format, $datetime->end())); |
|
163 | 163 | // set headers |
164 | - header( 'Content-type: text/calendar; charset=utf-8' ); |
|
165 | - header( 'Content-Disposition: attachment; filename="' . $filename . '"' ); |
|
166 | - header( 'Cache-Control: private, max-age=0, must-revalidate' ); |
|
167 | - header( 'Pragma: public' ); |
|
168 | - header( 'Content-Type: application/octet-stream' ); |
|
169 | - header( 'Content-Type: application/force-download' ); |
|
170 | - header( 'Cache-Control: no-cache, must-revalidate' ); |
|
171 | - header( 'Content-Transfer-Encoding: binary' ); |
|
172 | - header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); // past date |
|
173 | - ini_set( 'zlib.output_compression', '0' ); |
|
164 | + header('Content-type: text/calendar; charset=utf-8'); |
|
165 | + header('Content-Disposition: attachment; filename="'.$filename.'"'); |
|
166 | + header('Cache-Control: private, max-age=0, must-revalidate'); |
|
167 | + header('Pragma: public'); |
|
168 | + header('Content-Type: application/octet-stream'); |
|
169 | + header('Content-Type: application/force-download'); |
|
170 | + header('Cache-Control: no-cache, must-revalidate'); |
|
171 | + header('Content-Transfer-Encoding: binary'); |
|
172 | + header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // past date |
|
173 | + ini_set('zlib.output_compression', '0'); |
|
174 | 174 | // echo the output |
175 | - echo "BEGIN:VCALENDAR" . PHP_EOL; |
|
176 | - echo "VERSION:2.0" . PHP_EOL; |
|
177 | - echo "PRODID:-//{$organizer}//NONSGML PDA Calendar Version 1.0//EN" . PHP_EOL; |
|
178 | - echo "CALSCALE:GREGORIAN" . PHP_EOL; |
|
179 | - echo "BEGIN:VEVENT" . PHP_EOL; |
|
180 | - echo "UID:{$UID}" . PHP_EOL; |
|
181 | - echo "ORGANIZER:MAILTO:{$org_email}" . PHP_EOL; |
|
182 | - echo "DTSTAMP:{$timestamp}" . PHP_EOL; |
|
183 | - echo "LOCATION:{$location}" . PHP_EOL; |
|
184 | - echo "SUMMARY:{$summary}" . PHP_EOL; |
|
185 | - echo "DESCRIPTION:{$description}" . PHP_EOL; |
|
186 | - echo "STATUS:{$status}" . PHP_EOL; |
|
187 | - echo "CATEGORIES:{$categories}" . PHP_EOL; |
|
188 | - echo "URL;VALUE=URI:{$url}" . PHP_EOL; |
|
189 | - echo "DTSTART:{$dtt_start}" . PHP_EOL; |
|
190 | - echo "DTEND:{$dtt_end}" . PHP_EOL; |
|
191 | - echo "END:VEVENT" . PHP_EOL; |
|
192 | - echo "END:VCALENDAR" . PHP_EOL; |
|
175 | + echo "BEGIN:VCALENDAR".PHP_EOL; |
|
176 | + echo "VERSION:2.0".PHP_EOL; |
|
177 | + echo "PRODID:-//{$organizer}//NONSGML PDA Calendar Version 1.0//EN".PHP_EOL; |
|
178 | + echo "CALSCALE:GREGORIAN".PHP_EOL; |
|
179 | + echo "BEGIN:VEVENT".PHP_EOL; |
|
180 | + echo "UID:{$UID}".PHP_EOL; |
|
181 | + echo "ORGANIZER:MAILTO:{$org_email}".PHP_EOL; |
|
182 | + echo "DTSTAMP:{$timestamp}".PHP_EOL; |
|
183 | + echo "LOCATION:{$location}".PHP_EOL; |
|
184 | + echo "SUMMARY:{$summary}".PHP_EOL; |
|
185 | + echo "DESCRIPTION:{$description}".PHP_EOL; |
|
186 | + echo "STATUS:{$status}".PHP_EOL; |
|
187 | + echo "CATEGORIES:{$categories}".PHP_EOL; |
|
188 | + echo "URL;VALUE=URI:{$url}".PHP_EOL; |
|
189 | + echo "DTSTART:{$dtt_start}".PHP_EOL; |
|
190 | + echo "DTEND:{$dtt_end}".PHP_EOL; |
|
191 | + echo "END:VEVENT".PHP_EOL; |
|
192 | + echo "END:VCALENDAR".PHP_EOL; |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | die(); |
@@ -204,8 +204,8 @@ discard block |
||
204 | 204 | * @param string $string |
205 | 205 | * @return string |
206 | 206 | */ |
207 | - private static function _escape_ICal_data( $string = '' ) { |
|
208 | - return preg_replace( '/([\,;])/', '\\\$1', $string ); |
|
207 | + private static function _escape_ICal_data($string = '') { |
|
208 | + return preg_replace('/([\,;])/', '\\\$1', $string); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 |
@@ -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 | * |
@@ -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 | /** |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | /** |
263 | 263 | * @param $REG_ID |
264 | - * @param $reg_status |
|
264 | + * @param boolean $reg_status |
|
265 | 265 | */ |
266 | 266 | public function set_reg_status_updated( $REG_ID, $reg_status ) { |
267 | 267 | $this->reg_status_updated[ $REG_ID ] = $reg_status; |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | * reset_reg_steps |
516 | 516 | * |
517 | 517 | * @access public |
518 | - * @return bool |
|
518 | + * @return boolean|null |
|
519 | 519 | */ |
520 | 520 | public function reset_reg_steps() { |
521 | 521 | $this->sort_reg_steps(); |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | * stash_transaction_and_checkout |
607 | 607 | * |
608 | 608 | * @access public |
609 | - * @return bool |
|
609 | + * @return boolean|null |
|
610 | 610 | */ |
611 | 611 | public function stash_transaction_and_checkout() { |
612 | 612 | if ( ! $this->revisit ) { |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | * stores whether any updates were made to the TXN or it's related registrations |
629 | 629 | * |
630 | 630 | * @access public |
631 | - * @return bool |
|
631 | + * @return boolean|null |
|
632 | 632 | */ |
633 | 633 | public function track_transaction_and_registration_status_updates() { |
634 | 634 | // verify the transaction |
@@ -969,6 +969,7 @@ discard block |
||
969 | 969 | * |
970 | 970 | * @param string | int $reg_cache_ID |
971 | 971 | * @param EE_Registration $registration |
972 | + * @param integer $reg_cache_ID |
|
972 | 973 | * @return void |
973 | 974 | */ |
974 | 975 | 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->front_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 | |
@@ -253,8 +253,8 @@ discard block |
||
253 | 253 | * @param $REG_ID |
254 | 254 | * @return array |
255 | 255 | */ |
256 | - public function reg_status_updated( $REG_ID ) { |
|
257 | - return isset( $this->reg_status_updated[ $REG_ID ] ) ? $this->reg_status_updated[ $REG_ID ] : false; |
|
256 | + public function reg_status_updated($REG_ID) { |
|
257 | + return isset($this->reg_status_updated[$REG_ID]) ? $this->reg_status_updated[$REG_ID] : false; |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | |
@@ -263,8 +263,8 @@ discard block |
||
263 | 263 | * @param $REG_ID |
264 | 264 | * @param $reg_status |
265 | 265 | */ |
266 | - public function set_reg_status_updated( $REG_ID, $reg_status ) { |
|
267 | - $this->reg_status_updated[ $REG_ID ] = $reg_status; |
|
266 | + public function set_reg_status_updated($REG_ID, $reg_status) { |
|
267 | + $this->reg_status_updated[$REG_ID] = $reg_status; |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | * can ONLY be set by the Finalize_Registration reg step |
286 | 286 | */ |
287 | 287 | public function set_exit_spco() { |
288 | - if ( $this->current_step instanceof EE_SPCO_Reg_Step_Finalize_Registration ) { |
|
288 | + if ($this->current_step instanceof EE_SPCO_Reg_Step_Finalize_Registration) { |
|
289 | 289 | $this->exit_spco = true; |
290 | 290 | } |
291 | 291 | } |
@@ -301,12 +301,12 @@ discard block |
||
301 | 301 | * @return void |
302 | 302 | */ |
303 | 303 | public function reset_for_current_request() { |
304 | - $this->continue_reg = apply_filters( 'FHEE__EE_Checkout___construct___continue_reg', true ); |
|
304 | + $this->continue_reg = apply_filters('FHEE__EE_Checkout___construct___continue_reg', true); |
|
305 | 305 | $this->admin_request = is_admin() && ! EE_Registry::instance()->REQ->front_ajax; |
306 | 306 | $this->continue_reg = true; |
307 | 307 | $this->redirect = false; |
308 | 308 | // don't reset the cached redirect form if we're about to be asked to display it !!! |
309 | - if ( EE_Registry::instance()->REQ->get( 'action', 'display_spco_reg_step' ) !== 'redirect_form' ) { |
|
309 | + if (EE_Registry::instance()->REQ->get('action', 'display_spco_reg_step') !== 'redirect_form') { |
|
310 | 310 | $this->redirect_form = ''; |
311 | 311 | } |
312 | 312 | $this->redirect_url = ''; |
@@ -323,8 +323,8 @@ discard block |
||
323 | 323 | * @param EE_SPCO_Reg_Step $reg_step_obj |
324 | 324 | * @return void |
325 | 325 | */ |
326 | - public function add_reg_step( EE_SPCO_Reg_Step $reg_step_obj ) { |
|
327 | - $this->reg_steps[ $reg_step_obj->slug() ] = $reg_step_obj; |
|
326 | + public function add_reg_step(EE_SPCO_Reg_Step $reg_step_obj) { |
|
327 | + $this->reg_steps[$reg_step_obj->slug()] = $reg_step_obj; |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | |
@@ -336,13 +336,13 @@ discard block |
||
336 | 336 | * @param string $reg_step_slug |
337 | 337 | * @return void |
338 | 338 | */ |
339 | - public function remove_reg_step( $reg_step_slug = '' ) { |
|
340 | - unset( $this->reg_steps[ $reg_step_slug ] ); |
|
341 | - if ( $this->transaction instanceof EE_Transaction ) { |
|
339 | + public function remove_reg_step($reg_step_slug = '') { |
|
340 | + unset($this->reg_steps[$reg_step_slug]); |
|
341 | + if ($this->transaction instanceof EE_Transaction) { |
|
342 | 342 | /** @type EE_Transaction_Processor $transaction_processor */ |
343 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
343 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
344 | 344 | // now remove reg step from TXN and save |
345 | - $transaction_processor->remove_reg_step( $this->transaction, $reg_step_slug ); |
|
345 | + $transaction_processor->remove_reg_step($this->transaction, $reg_step_slug); |
|
346 | 346 | $this->transaction->save(); |
347 | 347 | } |
348 | 348 | } |
@@ -357,9 +357,9 @@ discard block |
||
357 | 357 | * @param int $order |
358 | 358 | * @return void |
359 | 359 | */ |
360 | - public function set_reg_step_order( $reg_step_slug = '', $order = 100 ) { |
|
361 | - if ( isset( $this->reg_steps[ $reg_step_slug ] )) { |
|
362 | - $this->reg_steps[ $reg_step_slug ]->set_order( $order ); |
|
360 | + public function set_reg_step_order($reg_step_slug = '', $order = 100) { |
|
361 | + if (isset($this->reg_steps[$reg_step_slug])) { |
|
362 | + $this->reg_steps[$reg_step_slug]->set_order($order); |
|
363 | 363 | } |
364 | 364 | } |
365 | 365 | |
@@ -372,25 +372,25 @@ discard block |
||
372 | 372 | * @param string $current_step |
373 | 373 | * @return void |
374 | 374 | */ |
375 | - public function set_current_step( $current_step ) { |
|
375 | + public function set_current_step($current_step) { |
|
376 | 376 | // grab what step we're on |
377 | - $this->current_step = isset( $this->reg_steps[ $current_step ] ) ? $this->reg_steps[ $current_step ] : reset( $this->reg_steps ); |
|
377 | + $this->current_step = isset($this->reg_steps[$current_step]) ? $this->reg_steps[$current_step] : reset($this->reg_steps); |
|
378 | 378 | // verify instance |
379 | - if ( $this->current_step instanceof EE_SPCO_Reg_Step ) { |
|
379 | + if ($this->current_step instanceof EE_SPCO_Reg_Step) { |
|
380 | 380 | // we don't want to repeat completed steps if this is the first time through SPCO |
381 | - if ( $this->continue_reg && $this->current_step->completed() && ! $this->revisit ) { |
|
381 | + if ($this->continue_reg && $this->current_step->completed() && ! $this->revisit) { |
|
382 | 382 | // so advance to the next step |
383 | 383 | $this->set_next_step(); |
384 | - if ( $this->next_step instanceof EE_SPCO_Reg_Step ) { |
|
384 | + if ($this->next_step instanceof EE_SPCO_Reg_Step) { |
|
385 | 385 | // and attempt to set it as the current step |
386 | - $this->set_current_step( $this->next_step->slug() ); |
|
386 | + $this->set_current_step($this->next_step->slug()); |
|
387 | 387 | } |
388 | 388 | return; |
389 | 389 | } |
390 | - $this->current_step->set_is_current_step( TRUE ); |
|
390 | + $this->current_step->set_is_current_step(TRUE); |
|
391 | 391 | } else { |
392 | 392 | EE_Error::add_error( |
393 | - __( 'The current step could not be set.', 'event_espresso' ), |
|
393 | + __('The current step could not be set.', 'event_espresso'), |
|
394 | 394 | __FILE__, __FUNCTION__, __LINE__ |
395 | 395 | ); |
396 | 396 | } |
@@ -407,20 +407,20 @@ discard block |
||
407 | 407 | */ |
408 | 408 | public function set_next_step() { |
409 | 409 | // set pointer to start of array |
410 | - reset( $this->reg_steps ); |
|
410 | + reset($this->reg_steps); |
|
411 | 411 | // if there is more than one step |
412 | - if ( count( $this->reg_steps ) > 1 ) { |
|
412 | + if (count($this->reg_steps) > 1) { |
|
413 | 413 | // advance to the current step and set pointer |
414 | - while ( key( $this->reg_steps ) != $this->current_step->slug() && key( $this->reg_steps ) != '' ) { |
|
415 | - next( $this->reg_steps ); |
|
414 | + while (key($this->reg_steps) != $this->current_step->slug() && key($this->reg_steps) != '') { |
|
415 | + next($this->reg_steps); |
|
416 | 416 | } |
417 | 417 | } |
418 | 418 | // advance one more spot ( if it exists ) |
419 | - $this->next_step = next( $this->reg_steps ); |
|
419 | + $this->next_step = next($this->reg_steps); |
|
420 | 420 | // verify instance |
421 | - $this->next_step = $this->next_step instanceof EE_SPCO_Reg_Step ? $this->next_step : NULL; |
|
421 | + $this->next_step = $this->next_step instanceof EE_SPCO_Reg_Step ? $this->next_step : NULL; |
|
422 | 422 | // then back to current step to reset |
423 | - prev( $this->reg_steps ); |
|
423 | + prev($this->reg_steps); |
|
424 | 424 | } |
425 | 425 | |
426 | 426 | |
@@ -434,8 +434,8 @@ discard block |
||
434 | 434 | * @return EE_SPCO_Reg_Step | null |
435 | 435 | */ |
436 | 436 | public function get_next_reg_step() { |
437 | - $next = next( $this->reg_steps ); |
|
438 | - prev( $this->reg_steps ); |
|
437 | + $next = next($this->reg_steps); |
|
438 | + prev($this->reg_steps); |
|
439 | 439 | return $next instanceof EE_SPCO_Reg_Step ? $next : null; |
440 | 440 | } |
441 | 441 | |
@@ -450,8 +450,8 @@ discard block |
||
450 | 450 | * @return EE_SPCO_Reg_Step | null |
451 | 451 | */ |
452 | 452 | public function get_prev_reg_step() { |
453 | - $prev = prev( $this->reg_steps ); |
|
454 | - next( $this->reg_steps ); |
|
453 | + $prev = prev($this->reg_steps); |
|
454 | + next($this->reg_steps); |
|
455 | 455 | return $prev instanceof EE_SPCO_Reg_Step ? $prev : null; |
456 | 456 | } |
457 | 457 | |
@@ -464,8 +464,8 @@ discard block |
||
464 | 464 | * @return void |
465 | 465 | */ |
466 | 466 | public function sort_reg_steps() { |
467 | - $reg_step_sorting_callback = apply_filters( 'FHEE__EE_Checkout__sort_reg_steps__reg_step_sorting_callback', 'reg_step_sorting_callback' ); |
|
468 | - uasort( $this->reg_steps, array( $this, $reg_step_sorting_callback )); |
|
467 | + $reg_step_sorting_callback = apply_filters('FHEE__EE_Checkout__sort_reg_steps__reg_step_sorting_callback', 'reg_step_sorting_callback'); |
|
468 | + uasort($this->reg_steps, array($this, $reg_step_sorting_callback)); |
|
469 | 469 | } |
470 | 470 | |
471 | 471 | |
@@ -478,17 +478,17 @@ discard block |
||
478 | 478 | * @param EE_SPCO_Reg_Step $reg_step_B |
479 | 479 | * @return array() |
480 | 480 | */ |
481 | - public function reg_step_sorting_callback( EE_SPCO_Reg_Step $reg_step_A, EE_SPCO_Reg_Step $reg_step_B ) { |
|
481 | + public function reg_step_sorting_callback(EE_SPCO_Reg_Step $reg_step_A, EE_SPCO_Reg_Step $reg_step_B) { |
|
482 | 482 | // send finalize_registration step to the end of the array |
483 | - if ( $reg_step_A->slug() == 'finalize_registration' ) { |
|
483 | + if ($reg_step_A->slug() == 'finalize_registration') { |
|
484 | 484 | return 1; |
485 | - } else if ( $reg_step_B->slug() == 'finalize_registration' ) { |
|
485 | + } else if ($reg_step_B->slug() == 'finalize_registration') { |
|
486 | 486 | return -1; |
487 | 487 | } |
488 | - if ( $reg_step_A->order() == $reg_step_B->order() ) { |
|
488 | + if ($reg_step_A->order() == $reg_step_B->order()) { |
|
489 | 489 | return 0; |
490 | 490 | } |
491 | - return ( $reg_step_A->order() > $reg_step_B->order() ) ? 1 : -1; |
|
491 | + return ($reg_step_A->order() > $reg_step_B->order()) ? 1 : -1; |
|
492 | 492 | } |
493 | 493 | |
494 | 494 | |
@@ -500,10 +500,10 @@ discard block |
||
500 | 500 | * @return void |
501 | 501 | */ |
502 | 502 | public function set_reg_step_JSON_info() { |
503 | - EE_Registry::$i18n_js_strings[ 'reg_steps' ] = array(); |
|
503 | + EE_Registry::$i18n_js_strings['reg_steps'] = array(); |
|
504 | 504 | // pass basic reg step data to JS |
505 | - foreach ( $this->reg_steps as $reg_step ) { |
|
506 | - EE_Registry::$i18n_js_strings[ 'reg_steps' ][] = $reg_step->slug(); |
|
505 | + foreach ($this->reg_steps as $reg_step) { |
|
506 | + EE_Registry::$i18n_js_strings['reg_steps'][] = $reg_step->slug(); |
|
507 | 507 | } |
508 | 508 | // reset reg step html |
509 | 509 | // $this->json_response->set_reg_step_html( '' ); |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | */ |
520 | 520 | public function reset_reg_steps() { |
521 | 521 | $this->sort_reg_steps(); |
522 | - $this->set_current_step( EE_Registry::instance()->REQ->get( 'step' )); |
|
522 | + $this->set_current_step(EE_Registry::instance()->REQ->get('step')); |
|
523 | 523 | $this->set_next_step(); |
524 | 524 | // the text that appears on the reg step form submit button |
525 | 525 | $this->current_step->set_submit_button_text(); |
@@ -536,9 +536,9 @@ discard block |
||
536 | 536 | */ |
537 | 537 | public function get_registration_time_limit() { |
538 | 538 | |
539 | - $registration_time_limit = (float)( EE_Registry::instance() ->SSN->expiration() - time() ); |
|
539 | + $registration_time_limit = (float) (EE_Registry::instance() ->SSN->expiration() - time()); |
|
540 | 540 | $time_limit_format = $registration_time_limit > 60 * MINUTE_IN_SECONDS ? 'H:i:s' : 'i:s'; |
541 | - $registration_time_limit = gmdate( $time_limit_format, $registration_time_limit ); |
|
541 | + $registration_time_limit = gmdate($time_limit_format, $registration_time_limit); |
|
542 | 542 | return apply_filters( |
543 | 543 | 'FHEE__EE_Checkout__get_registration_time_limit__registration_time_limit', |
544 | 544 | $registration_time_limit |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | // overpaid TXN |
559 | 559 | // free TXN ( total = 0.00 ) |
560 | 560 | // then payment required is TRUE |
561 | - return ! ( $this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free() ) ? TRUE : FALSE; |
|
561 | + return ! ($this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free()) ? TRUE : FALSE; |
|
562 | 562 | } |
563 | 563 | |
564 | 564 | |
@@ -571,8 +571,8 @@ discard block |
||
571 | 571 | */ |
572 | 572 | public function initialize_txn_reg_steps_array() { |
573 | 573 | $txn_reg_steps_array = array(); |
574 | - foreach ( $this->reg_steps as $reg_step ) { |
|
575 | - $txn_reg_steps_array[ $reg_step->slug() ] = FALSE; |
|
574 | + foreach ($this->reg_steps as $reg_step) { |
|
575 | + $txn_reg_steps_array[$reg_step->slug()] = FALSE; |
|
576 | 576 | } |
577 | 577 | return $txn_reg_steps_array; |
578 | 578 | } |
@@ -588,13 +588,13 @@ discard block |
||
588 | 588 | public function update_txn_reg_steps_array() { |
589 | 589 | $updated = FALSE; |
590 | 590 | /** @type EE_Transaction_Processor $transaction_processor */ |
591 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
592 | - foreach ( $this->reg_steps as $reg_step ) { |
|
593 | - if ( $reg_step->completed() ) { |
|
594 | - $updated = $transaction_processor->set_reg_step_completed( $this->transaction, $reg_step->slug() ) ? TRUE : $updated; |
|
591 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
592 | + foreach ($this->reg_steps as $reg_step) { |
|
593 | + if ($reg_step->completed()) { |
|
594 | + $updated = $transaction_processor->set_reg_step_completed($this->transaction, $reg_step->slug()) ? TRUE : $updated; |
|
595 | 595 | } |
596 | 596 | } |
597 | - if ( $updated ) { |
|
597 | + if ($updated) { |
|
598 | 598 | $this->transaction->save(); |
599 | 599 | } |
600 | 600 | return $updated; |
@@ -609,14 +609,14 @@ discard block |
||
609 | 609 | * @return bool |
610 | 610 | */ |
611 | 611 | public function stash_transaction_and_checkout() { |
612 | - if ( ! $this->revisit ) { |
|
612 | + if ( ! $this->revisit) { |
|
613 | 613 | $this->update_txn_reg_steps_array(); |
614 | 614 | } |
615 | 615 | $this->track_transaction_and_registration_status_updates(); |
616 | 616 | // save all data to the db, but suppress errors |
617 | 617 | //$this->save_all_data( FALSE ); |
618 | 618 | // cache the checkout in the session |
619 | - EE_Registry::instance()->SSN->set_checkout( $this ); |
|
619 | + EE_Registry::instance()->SSN->set_checkout($this); |
|
620 | 620 | } |
621 | 621 | |
622 | 622 | |
@@ -632,21 +632,21 @@ discard block |
||
632 | 632 | */ |
633 | 633 | public function track_transaction_and_registration_status_updates() { |
634 | 634 | // verify the transaction |
635 | - if ( $this->transaction instanceof EE_Transaction ) { |
|
635 | + if ($this->transaction instanceof EE_Transaction) { |
|
636 | 636 | /** @type EE_Transaction_Payments $transaction_payments */ |
637 | - $transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' ); |
|
637 | + $transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments'); |
|
638 | 638 | /** @type EE_Transaction_Processor $transaction_processor */ |
639 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
639 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
640 | 640 | // has there been a TXN status change during this checkout? |
641 | - if ( $transaction_payments->txn_status_updated() || $transaction_processor->txn_status_updated() ) { |
|
641 | + if ($transaction_payments->txn_status_updated() || $transaction_processor->txn_status_updated()) { |
|
642 | 642 | $this->txn_status_updated = true; |
643 | 643 | } |
644 | 644 | /** @type EE_Registration_Processor $registration_processor */ |
645 | - $registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' ); |
|
645 | + $registration_processor = EE_Registry::instance()->load_class('Registration_Processor'); |
|
646 | 646 | // grab the saved registrations from the transaction |
647 | - foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $registration ) { |
|
648 | - if ( $registration_processor->reg_status_updated( $registration->ID() ) ) { |
|
649 | - $this->set_reg_status_updated( $registration->ID(), true ); |
|
647 | + foreach ($this->transaction->registrations($this->reg_cache_where_params) as $registration) { |
|
648 | + if ($registration_processor->reg_status_updated($registration->ID())) { |
|
649 | + $this->set_reg_status_updated($registration->ID(), true); |
|
650 | 650 | } |
651 | 651 | } |
652 | 652 | } |
@@ -668,8 +668,8 @@ discard block |
||
668 | 668 | * @param EE_Registration $registration |
669 | 669 | * @return bool |
670 | 670 | */ |
671 | - public function visit_allows_processing_of_this_registration( EE_Registration $registration ) { |
|
672 | - return ! $this->revisit || $this->primary_revisit || ( $this->revisit && $this->reg_url_link == $registration->reg_url_link() ) ? TRUE : FALSE; |
|
671 | + public function visit_allows_processing_of_this_registration(EE_Registration $registration) { |
|
672 | + return ! $this->revisit || $this->primary_revisit || ($this->revisit && $this->reg_url_link == $registration->reg_url_link()) ? TRUE : FALSE; |
|
673 | 673 | } |
674 | 674 | |
675 | 675 | |
@@ -694,18 +694,18 @@ discard block |
||
694 | 694 | * @param bool $show_errors |
695 | 695 | * @return bool |
696 | 696 | */ |
697 | - public function save_all_data( $show_errors = TRUE ) { |
|
697 | + public function save_all_data($show_errors = TRUE) { |
|
698 | 698 | // verify the transaction |
699 | - if ( $this->transaction instanceof EE_Transaction ) { |
|
699 | + if ($this->transaction instanceof EE_Transaction) { |
|
700 | 700 | // save to ensure that TXN has ID |
701 | 701 | $this->transaction->save(); |
702 | 702 | // grab the saved registrations from the transaction |
703 | - foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $registration ) { |
|
704 | - $this->_save_registration( $registration, $show_errors ); |
|
703 | + foreach ($this->transaction->registrations($this->reg_cache_where_params) as $registration) { |
|
704 | + $this->_save_registration($registration, $show_errors); |
|
705 | 705 | } |
706 | 706 | } else { |
707 | - if ( $show_errors ) { |
|
708 | - EE_Error::add_error( __( 'A valid Transaction was not found when attempting to save your registration information.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
707 | + if ($show_errors) { |
|
708 | + EE_Error::add_error(__('A valid Transaction was not found when attempting to save your registration information.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
709 | 709 | } |
710 | 710 | return FALSE; |
711 | 711 | } |
@@ -720,32 +720,32 @@ discard block |
||
720 | 720 | * @param bool $show_errors |
721 | 721 | * @return void |
722 | 722 | */ |
723 | - private function _save_registration( $registration, $show_errors = TRUE ) { |
|
723 | + private function _save_registration($registration, $show_errors = TRUE) { |
|
724 | 724 | // verify object |
725 | - if ( $registration instanceof EE_Registration ) { |
|
725 | + if ($registration instanceof EE_Registration) { |
|
726 | 726 | // should this registration be processed during this visit ? |
727 | - if ( $this->visit_allows_processing_of_this_registration( $registration ) ) { |
|
727 | + if ($this->visit_allows_processing_of_this_registration($registration)) { |
|
728 | 728 | //set TXN ID |
729 | - if ( ! $registration->transaction_ID() ) { |
|
730 | - $registration->set_transaction_id( $this->transaction->ID() ); |
|
729 | + if ( ! $registration->transaction_ID()) { |
|
730 | + $registration->set_transaction_id($this->transaction->ID()); |
|
731 | 731 | } |
732 | 732 | // verify and save the attendee |
733 | - $this->_save_registration_attendee( $registration, $show_errors ); |
|
733 | + $this->_save_registration_attendee($registration, $show_errors); |
|
734 | 734 | // save answers to reg form questions |
735 | - $this->_save_registration_answers( $registration, $show_errors ); |
|
735 | + $this->_save_registration_answers($registration, $show_errors); |
|
736 | 736 | // save changes |
737 | 737 | $registration->save(); |
738 | 738 | // update txn cache |
739 | - if ( ! $this->transaction->update_cache_after_object_save( 'Registration', $registration )) { |
|
740 | - if ( $show_errors ) { |
|
741 | - EE_Error::add_error( __( 'The newly saved Registration object could not be cached on the Transaction.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
739 | + if ( ! $this->transaction->update_cache_after_object_save('Registration', $registration)) { |
|
740 | + if ($show_errors) { |
|
741 | + EE_Error::add_error(__('The newly saved Registration object could not be cached on the Transaction.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
742 | 742 | } |
743 | 743 | } |
744 | 744 | } |
745 | 745 | } else { |
746 | - if ( $show_errors ) { |
|
746 | + if ($show_errors) { |
|
747 | 747 | EE_Error::add_error( |
748 | - __( 'An invalid Registration object was discovered when attempting to save your registration information.', 'event_espresso' ), |
|
748 | + __('An invalid Registration object was discovered when attempting to save your registration information.', 'event_espresso'), |
|
749 | 749 | __FILE__, __FUNCTION__, __LINE__ |
750 | 750 | ); |
751 | 751 | } |
@@ -761,26 +761,26 @@ discard block |
||
761 | 761 | * @param bool $show_errors |
762 | 762 | * @return void |
763 | 763 | */ |
764 | - private function _save_registration_attendee( $registration, $show_errors = TRUE ) { |
|
765 | - if ( $registration->attendee() instanceof EE_Attendee ) { |
|
764 | + private function _save_registration_attendee($registration, $show_errors = TRUE) { |
|
765 | + if ($registration->attendee() instanceof EE_Attendee) { |
|
766 | 766 | // save so that ATT has ID |
767 | 767 | $registration->attendee()->save(); |
768 | - if ( ! $registration->update_cache_after_object_save( 'Attendee', $registration->attendee() )) { |
|
769 | - if ( $show_errors ) { |
|
768 | + if ( ! $registration->update_cache_after_object_save('Attendee', $registration->attendee())) { |
|
769 | + if ($show_errors) { |
|
770 | 770 | EE_Error::add_error( |
771 | - __( 'The newly saved Attendee object could not be cached on the registration.', 'event_espresso' ), |
|
771 | + __('The newly saved Attendee object could not be cached on the registration.', 'event_espresso'), |
|
772 | 772 | __FILE__, __FUNCTION__, __LINE__ |
773 | 773 | ); |
774 | 774 | } |
775 | 775 | } |
776 | 776 | } else { |
777 | - if ( $show_errors ) { |
|
777 | + if ($show_errors) { |
|
778 | 778 | ob_start(); |
779 | - var_dump( $registration->attendee() ); |
|
779 | + var_dump($registration->attendee()); |
|
780 | 780 | EE_Error::add_error( |
781 | 781 | sprintf( |
782 | 782 | '%1$s||%1$s $attendee = %2$s', |
783 | - __( 'Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso' ), |
|
783 | + __('Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso'), |
|
784 | 784 | ob_get_clean() |
785 | 785 | ), |
786 | 786 | __FILE__, __FUNCTION__, __LINE__ |
@@ -798,25 +798,25 @@ discard block |
||
798 | 798 | * @param bool $show_errors |
799 | 799 | * @return void |
800 | 800 | */ |
801 | - private function _save_registration_answers( $registration, $show_errors = TRUE ) { |
|
801 | + private function _save_registration_answers($registration, $show_errors = TRUE) { |
|
802 | 802 | // now save the answers |
803 | - foreach ( $registration->answers() as $cache_key => $answer ) { |
|
803 | + foreach ($registration->answers() as $cache_key => $answer) { |
|
804 | 804 | // verify object |
805 | - if ( $answer instanceof EE_Answer ) { |
|
806 | - $answer->set_registration( $registration->ID() ); |
|
805 | + if ($answer instanceof EE_Answer) { |
|
806 | + $answer->set_registration($registration->ID()); |
|
807 | 807 | $answer->save(); |
808 | - if ( ! $registration->update_cache_after_object_save( 'Answer', $answer, $cache_key )) { |
|
809 | - if ( $show_errors ) { |
|
808 | + if ( ! $registration->update_cache_after_object_save('Answer', $answer, $cache_key)) { |
|
809 | + if ($show_errors) { |
|
810 | 810 | EE_Error::add_error( |
811 | - __( 'The newly saved Answer object could not be cached on the registration.', 'event_espresso' ), |
|
811 | + __('The newly saved Answer object could not be cached on the registration.', 'event_espresso'), |
|
812 | 812 | __FILE__, __FUNCTION__, __LINE__ |
813 | 813 | ); |
814 | 814 | } |
815 | 815 | } |
816 | 816 | } else { |
817 | - if ( $show_errors ) { |
|
817 | + if ($show_errors) { |
|
818 | 818 | EE_Error::add_error( |
819 | - __( 'An invalid Answer object was discovered when attempting to save your registration information.', 'event_espresso' ), |
|
819 | + __('An invalid Answer object was discovered when attempting to save your registration information.', 'event_espresso'), |
|
820 | 820 | __FILE__, __FUNCTION__, __LINE__ |
821 | 821 | ); |
822 | 822 | } |
@@ -834,7 +834,7 @@ discard block |
||
834 | 834 | * @param bool $from_db |
835 | 835 | * @return bool |
836 | 836 | */ |
837 | - public function refresh_all_entities( $from_db = false ) { |
|
837 | + public function refresh_all_entities($from_db = false) { |
|
838 | 838 | $from_db = $this->current_step->is_final_step() || $this->action == 'process_gateway_response' ? true : $from_db; |
839 | 839 | //$this->log( |
840 | 840 | // __CLASS__, __FUNCTION__, __LINE__, |
@@ -855,11 +855,11 @@ discard block |
||
855 | 855 | */ |
856 | 856 | protected function refresh_from_db() { |
857 | 857 | // verify the transaction |
858 | - if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) { |
|
858 | + if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) { |
|
859 | 859 | // pull fresh TXN data from the db |
860 | - $this->transaction = $this->transaction->get_model()->refresh_entity_map_from_db( $this->transaction->ID() ); |
|
860 | + $this->transaction = $this->transaction->get_model()->refresh_entity_map_from_db($this->transaction->ID()); |
|
861 | 861 | // update EE_Checkout's cached primary_attendee object |
862 | - $this->primary_attendee_obj = $this->_refresh_primary_attendee_obj_from_db( $this->transaction ); |
|
862 | + $this->primary_attendee_obj = $this->_refresh_primary_attendee_obj_from_db($this->transaction); |
|
863 | 863 | // update EE_Checkout's cached payment object |
864 | 864 | $payment = $this->transaction->last_payment(); |
865 | 865 | $this->payment = $payment instanceof EE_Payment ? $payment : null; |
@@ -867,13 +867,13 @@ discard block |
||
867 | 867 | $payment_method = $this->payment instanceof EE_Payment ? $this->payment->payment_method() : null; |
868 | 868 | $this->payment_method = $payment_method instanceof EE_Payment_Method ? $payment_method : null; |
869 | 869 | //now refresh the cart, based on the TXN |
870 | - $this->cart = EE_Cart::get_cart_from_txn( $this->transaction ); |
|
870 | + $this->cart = EE_Cart::get_cart_from_txn($this->transaction); |
|
871 | 871 | // verify cart |
872 | - if ( ! $this->cart instanceof EE_Cart ) { |
|
873 | - $this->cart = EE_Registry::instance()->load_core( 'Cart' ); |
|
872 | + if ( ! $this->cart instanceof EE_Cart) { |
|
873 | + $this->cart = EE_Registry::instance()->load_core('Cart'); |
|
874 | 874 | } |
875 | 875 | } else { |
876 | - EE_Error::add_error( __( 'A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
876 | + EE_Error::add_error(__('A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
877 | 877 | return FALSE; |
878 | 878 | } |
879 | 879 | return TRUE; |
@@ -887,24 +887,24 @@ discard block |
||
887 | 887 | * @param EE_Transaction $transaction |
888 | 888 | * @return EE_Attendee | null |
889 | 889 | */ |
890 | - protected function _refresh_primary_attendee_obj_from_db( EE_Transaction $transaction ) { |
|
890 | + protected function _refresh_primary_attendee_obj_from_db(EE_Transaction $transaction) { |
|
891 | 891 | |
892 | 892 | $primary_attendee_obj = null; |
893 | 893 | // grab the saved registrations from the transaction |
894 | - foreach ( $transaction->registrations( $this->reg_cache_where_params, true ) as $registration ) { |
|
894 | + foreach ($transaction->registrations($this->reg_cache_where_params, true) as $registration) { |
|
895 | 895 | // verify object |
896 | - if ( $registration instanceof EE_Registration ) { |
|
896 | + if ($registration instanceof EE_Registration) { |
|
897 | 897 | $attendee = $registration->attendee(); |
898 | 898 | // verify object |
899 | - if ( $attendee instanceof EE_Attendee ) { |
|
899 | + if ($attendee instanceof EE_Attendee) { |
|
900 | 900 | // maybe cache primary_attendee_obj ? |
901 | - if ( $registration->is_primary_registrant() ) { |
|
901 | + if ($registration->is_primary_registrant()) { |
|
902 | 902 | $primary_attendee_obj = $attendee; |
903 | 903 | } |
904 | 904 | } |
905 | 905 | } else { |
906 | 906 | EE_Error::add_error( |
907 | - __( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ), |
|
907 | + __('An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso'), |
|
908 | 908 | __FILE__, __FUNCTION__, __LINE__ |
909 | 909 | ); |
910 | 910 | } |
@@ -924,38 +924,38 @@ discard block |
||
924 | 924 | */ |
925 | 925 | protected function refresh_entity_map() { |
926 | 926 | // verify the transaction |
927 | - if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) { |
|
927 | + if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) { |
|
928 | 928 | // never cache payment info |
929 | - $this->transaction->clear_cache( 'Payment' ); |
|
929 | + $this->transaction->clear_cache('Payment'); |
|
930 | 930 | /** @type EE_Transaction_Processor $transaction_processor */ |
931 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
931 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
932 | 932 | // is the Payment Options Reg Step completed ? |
933 | - if ( $transaction_processor->reg_step_completed( $this->transaction, 'payment_options' ) ) { |
|
933 | + if ($transaction_processor->reg_step_completed($this->transaction, 'payment_options')) { |
|
934 | 934 | // then check for payments and update TXN accordingly |
935 | 935 | /** @type EE_Transaction_Payments $transaction_payments */ |
936 | - $transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' ); |
|
937 | - $transaction_payments->calculate_total_payments_and_update_status( $this->transaction ); |
|
936 | + $transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments'); |
|
937 | + $transaction_payments->calculate_total_payments_and_update_status($this->transaction); |
|
938 | 938 | } |
939 | 939 | // grab the saved registrations from the transaction |
940 | - foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $reg_cache_ID => $registration ) { |
|
941 | - $this->_refresh_registration( $reg_cache_ID, $registration ); |
|
940 | + foreach ($this->transaction->registrations($this->reg_cache_where_params) as $reg_cache_ID => $registration) { |
|
941 | + $this->_refresh_registration($reg_cache_ID, $registration); |
|
942 | 942 | } |
943 | 943 | // make sure our cached TXN is added to the model entity mapper |
944 | - $this->transaction = $this->transaction->get_model()->refresh_entity_map_with( $this->transaction->ID(), $this->transaction ); |
|
944 | + $this->transaction = $this->transaction->get_model()->refresh_entity_map_with($this->transaction->ID(), $this->transaction); |
|
945 | 945 | |
946 | 946 | } else { |
947 | - EE_Error::add_error( __( 'A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
947 | + EE_Error::add_error(__('A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
948 | 948 | return FALSE; |
949 | 949 | } |
950 | - if ( $this->cart instanceof EE_Cart ) { |
|
950 | + if ($this->cart instanceof EE_Cart) { |
|
951 | 951 | $grand_total = $this->cart->get_grand_total()->get_model()->refresh_entity_map_with( |
952 | 952 | $this->cart->get_grand_total()->ID(), |
953 | 953 | $this->cart->get_grand_total() |
954 | 954 | ); |
955 | - if ( $grand_total instanceof EE_Line_Item ) { |
|
956 | - $this->cart = EE_Cart::instance( $grand_total ); |
|
955 | + if ($grand_total instanceof EE_Line_Item) { |
|
956 | + $this->cart = EE_Cart::instance($grand_total); |
|
957 | 957 | } else { |
958 | - EE_Error::add_error( __( 'A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
958 | + EE_Error::add_error(__('A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
959 | 959 | return false; |
960 | 960 | } |
961 | 961 | } |
@@ -971,19 +971,19 @@ discard block |
||
971 | 971 | * @param EE_Registration $registration |
972 | 972 | * @return void |
973 | 973 | */ |
974 | - protected function _refresh_registration( $reg_cache_ID, $registration ) { |
|
974 | + protected function _refresh_registration($reg_cache_ID, $registration) { |
|
975 | 975 | |
976 | 976 | // verify object |
977 | - if ( $registration instanceof EE_Registration ) { |
|
977 | + if ($registration instanceof EE_Registration) { |
|
978 | 978 | // update the entity mapper attendee |
979 | - $this->_refresh_registration_attendee( $registration ); |
|
979 | + $this->_refresh_registration_attendee($registration); |
|
980 | 980 | // update the entity mapper answers for reg form questions |
981 | - $this->_refresh_registration_answers( $registration ); |
|
981 | + $this->_refresh_registration_answers($registration); |
|
982 | 982 | // make sure the cached registration is added to the model entity mapper |
983 | - $registration->get_model()->refresh_entity_map_with( $reg_cache_ID, $registration ); |
|
983 | + $registration->get_model()->refresh_entity_map_with($reg_cache_ID, $registration); |
|
984 | 984 | } else { |
985 | 985 | EE_Error::add_error( |
986 | - __( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ), |
|
986 | + __('An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso'), |
|
987 | 987 | __FILE__, __FUNCTION__, __LINE__ |
988 | 988 | ); |
989 | 989 | } |
@@ -997,15 +997,15 @@ discard block |
||
997 | 997 | * @param EE_Registration $registration |
998 | 998 | * @return void |
999 | 999 | */ |
1000 | - protected function _refresh_registration_attendee( $registration ) { |
|
1000 | + protected function _refresh_registration_attendee($registration) { |
|
1001 | 1001 | |
1002 | 1002 | $attendee = $registration->attendee(); |
1003 | 1003 | // verify object |
1004 | - if ( $attendee instanceof EE_Attendee && $attendee->ID() ) { |
|
1004 | + if ($attendee instanceof EE_Attendee && $attendee->ID()) { |
|
1005 | 1005 | // make sure the cached attendee is added to the model entity mapper |
1006 | - $registration->attendee()->get_model()->refresh_entity_map_with( $attendee->ID(), $attendee ); |
|
1006 | + $registration->attendee()->get_model()->refresh_entity_map_with($attendee->ID(), $attendee); |
|
1007 | 1007 | // maybe cache primary_attendee_obj ? |
1008 | - if ( $registration->is_primary_registrant() ) { |
|
1008 | + if ($registration->is_primary_registrant()) { |
|
1009 | 1009 | $this->primary_attendee_obj = $attendee; |
1010 | 1010 | } |
1011 | 1011 | } |
@@ -1019,19 +1019,19 @@ discard block |
||
1019 | 1019 | * @param EE_Registration $registration |
1020 | 1020 | * @return void |
1021 | 1021 | */ |
1022 | - protected function _refresh_registration_answers( $registration ) { |
|
1022 | + protected function _refresh_registration_answers($registration) { |
|
1023 | 1023 | |
1024 | 1024 | // now update the answers |
1025 | - foreach ( $registration->answers() as $cache_key => $answer ) { |
|
1025 | + foreach ($registration->answers() as $cache_key => $answer) { |
|
1026 | 1026 | // verify object |
1027 | - if ( $answer instanceof EE_Answer ) { |
|
1028 | - if ( $answer->ID() ) { |
|
1027 | + if ($answer instanceof EE_Answer) { |
|
1028 | + if ($answer->ID()) { |
|
1029 | 1029 | // make sure the cached answer is added to the model entity mapper |
1030 | - $answer->get_model()->refresh_entity_map_with( $answer->ID(), $answer ); |
|
1030 | + $answer->get_model()->refresh_entity_map_with($answer->ID(), $answer); |
|
1031 | 1031 | } |
1032 | 1032 | } else { |
1033 | 1033 | EE_Error::add_error( |
1034 | - __( 'An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso' ), |
|
1034 | + __('An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso'), |
|
1035 | 1035 | __FILE__, __FUNCTION__, __LINE__ |
1036 | 1036 | ); |
1037 | 1037 | } |
@@ -1046,7 +1046,7 @@ discard block |
||
1046 | 1046 | * this will reinstate the EE_Checkout object on each EE_SPCO_Reg_Step object |
1047 | 1047 | */ |
1048 | 1048 | function __wakeup() { |
1049 | - foreach ( $this->reg_steps as $reg_step ) { |
|
1049 | + foreach ($this->reg_steps as $reg_step) { |
|
1050 | 1050 | $reg_step->checkout = $this; |
1051 | 1051 | } |
1052 | 1052 | } |
@@ -1062,11 +1062,11 @@ discard block |
||
1062 | 1062 | * @param array $info |
1063 | 1063 | * @param bool $display_request |
1064 | 1064 | */ |
1065 | - function log( $class = '', $func = '', $line = '', $info = array(), $display_request = false ) { |
|
1066 | - if ( WP_DEBUG && false ) { |
|
1067 | - $debug_data = get_option( 'EE_DEBUG_SPCO_' . EE_Session::instance()->id(), array() ); |
|
1065 | + function log($class = '', $func = '', $line = '', $info = array(), $display_request = false) { |
|
1066 | + if (WP_DEBUG && false) { |
|
1067 | + $debug_data = get_option('EE_DEBUG_SPCO_'.EE_Session::instance()->id(), array()); |
|
1068 | 1068 | $default_data = array( |
1069 | - $class => $func . '() : ' . $line, |
|
1069 | + $class => $func.'() : '.$line, |
|
1070 | 1070 | 'request->step' => $this->step, |
1071 | 1071 | 'request->action' => $this->action, |
1072 | 1072 | 'current_step->slug' => $this->current_step instanceof EE_SPCO_Reg_Step ? |
@@ -1078,24 +1078,24 @@ discard block |
||
1078 | 1078 | 'reg_url_link' => $this->reg_url_link, |
1079 | 1079 | 'REQ' => $display_request ? $_REQUEST : '', |
1080 | 1080 | ); |
1081 | - if ( $this->transaction instanceof EE_Transaction ) { |
|
1082 | - $default_data[ 'TXN_status' ] = $this->transaction->status_ID(); |
|
1083 | - $default_data[ 'TXN_reg_steps' ] = $this->transaction->reg_steps(); |
|
1084 | - foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $REG_ID => $registration ) { |
|
1085 | - $default_data[ 'registrations' ][ $REG_ID ] = $registration->status_ID(); |
|
1081 | + if ($this->transaction instanceof EE_Transaction) { |
|
1082 | + $default_data['TXN_status'] = $this->transaction->status_ID(); |
|
1083 | + $default_data['TXN_reg_steps'] = $this->transaction->reg_steps(); |
|
1084 | + foreach ($this->transaction->registrations($this->reg_cache_where_params) as $REG_ID => $registration) { |
|
1085 | + $default_data['registrations'][$REG_ID] = $registration->status_ID(); |
|
1086 | 1086 | } |
1087 | - if ( $this->transaction->ID() ) { |
|
1088 | - $TXN_ID = 'EE_Transaction: ' . $this->transaction->ID(); |
|
1087 | + if ($this->transaction->ID()) { |
|
1088 | + $TXN_ID = 'EE_Transaction: '.$this->transaction->ID(); |
|
1089 | 1089 | // don't serialize objects |
1090 | - $info = $this->_strip_objects( $info ); |
|
1091 | - if ( ! isset( $debug_data[ $TXN_ID ] ) ) { |
|
1092 | - $debug_data[ $TXN_ID ] = array(); |
|
1090 | + $info = $this->_strip_objects($info); |
|
1091 | + if ( ! isset($debug_data[$TXN_ID])) { |
|
1092 | + $debug_data[$TXN_ID] = array(); |
|
1093 | 1093 | } |
1094 | - $debug_data[ $TXN_ID ][ microtime() ] = array_merge( |
|
1094 | + $debug_data[$TXN_ID][microtime()] = array_merge( |
|
1095 | 1095 | $default_data, |
1096 | 1096 | $info |
1097 | 1097 | ); |
1098 | - update_option( 'EE_DEBUG_SPCO_' . EE_Session::instance()->id(), $debug_data ); |
|
1098 | + update_option('EE_DEBUG_SPCO_'.EE_Session::instance()->id(), $debug_data); |
|
1099 | 1099 | } |
1100 | 1100 | } |
1101 | 1101 | } |
@@ -1108,23 +1108,23 @@ discard block |
||
1108 | 1108 | * @param array $info |
1109 | 1109 | * @return array |
1110 | 1110 | */ |
1111 | - function _strip_objects( $info = array() ) { |
|
1112 | - foreach ( $info as $key => $value ) { |
|
1113 | - if ( is_array( $value )) { |
|
1114 | - $info[ $key ] = $this->_strip_objects( $value ); |
|
1115 | - } else if ( is_object( $value ) ) { |
|
1116 | - $object_class = get_class( $value ); |
|
1117 | - $info[ $object_class ] = array(); |
|
1118 | - $info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0; |
|
1119 | - if ( method_exists( $value, 'status' ) ) { |
|
1120 | - $info[ $object_class ][ 'status' ] = $value->status(); |
|
1121 | - } else if ( method_exists( $value, 'status_ID' ) ) { |
|
1122 | - $info[ $object_class ][ 'status' ] = $value->status_ID(); |
|
1111 | + function _strip_objects($info = array()) { |
|
1112 | + foreach ($info as $key => $value) { |
|
1113 | + if (is_array($value)) { |
|
1114 | + $info[$key] = $this->_strip_objects($value); |
|
1115 | + } else if (is_object($value)) { |
|
1116 | + $object_class = get_class($value); |
|
1117 | + $info[$object_class] = array(); |
|
1118 | + $info[$object_class]['ID'] = method_exists($value, 'ID') ? $value->ID() : 0; |
|
1119 | + if (method_exists($value, 'status')) { |
|
1120 | + $info[$object_class]['status'] = $value->status(); |
|
1121 | + } else if (method_exists($value, 'status_ID')) { |
|
1122 | + $info[$object_class]['status'] = $value->status_ID(); |
|
1123 | 1123 | } |
1124 | - unset( $info[ $key ] ); |
|
1124 | + unset($info[$key]); |
|
1125 | 1125 | } |
1126 | 1126 | } |
1127 | - return (array)$info; |
|
1127 | + return (array) $info; |
|
1128 | 1128 | } |
1129 | 1129 | |
1130 | 1130 |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * |
|
4 | - * Class EE_SPCO_JSON_Response |
|
5 | - * |
|
6 | - * Description |
|
7 | - * |
|
8 | - * @package Event Espresso |
|
9 | - * @subpackage core |
|
10 | - * @author Brent Christensen |
|
11 | - * @since $VID:$ |
|
12 | - * |
|
13 | - */ |
|
3 | + * |
|
4 | + * Class EE_SPCO_JSON_Response |
|
5 | + * |
|
6 | + * Description |
|
7 | + * |
|
8 | + * @package Event Espresso |
|
9 | + * @subpackage core |
|
10 | + * @author Brent Christensen |
|
11 | + * @since $VID:$ |
|
12 | + * |
|
13 | + */ |
|
14 | 14 | class EE_SPCO_JSON_Response { |
15 | 15 | |
16 | 16 | /** |
@@ -97,64 +97,64 @@ discard block |
||
97 | 97 | public function __toString() { |
98 | 98 | $JSON_response = array(); |
99 | 99 | // grab notices |
100 | - $notices = EE_Error::get_notices( FALSE ); |
|
101 | - $this->set_attention( isset( $notices['attention'] ) ? $notices['attention'] : '' ); |
|
102 | - $this->set_errors( isset( $notices['errors'] ) ? $notices['errors'] : '' ); |
|
103 | - $this->set_success( isset( $notices['success'] ) ? $notices['success'] : '' ); |
|
100 | + $notices = EE_Error::get_notices(FALSE); |
|
101 | + $this->set_attention(isset($notices['attention']) ? $notices['attention'] : ''); |
|
102 | + $this->set_errors(isset($notices['errors']) ? $notices['errors'] : ''); |
|
103 | + $this->set_success(isset($notices['success']) ? $notices['success'] : ''); |
|
104 | 104 | // add notices to JSON response, but only if they exist |
105 | - if ( $this->attention() ) { |
|
105 | + if ($this->attention()) { |
|
106 | 106 | $JSON_response['attention'] = $this->attention(); |
107 | 107 | } |
108 | - if ( $this->errors() ) { |
|
108 | + if ($this->errors()) { |
|
109 | 109 | $JSON_response['errors'] = $this->errors(); |
110 | 110 | } |
111 | - if ( $this->success() ) { |
|
111 | + if ($this->success()) { |
|
112 | 112 | $JSON_response['success'] = $this->success(); |
113 | 113 | } |
114 | 114 | // but if NO notices are set... at least set the "success" as a key so that the JS knows everything worked |
115 | - if ( ! isset( $JSON_response[ 'attention' ] ) && ! isset( $JSON_response[ 'errors' ] ) && ! isset( $JSON_response[ 'success' ] ) ) { |
|
115 | + if ( ! isset($JSON_response['attention']) && ! isset($JSON_response['errors']) && ! isset($JSON_response['success'])) { |
|
116 | 116 | $JSON_response['success'] = null; |
117 | 117 | } |
118 | 118 | // set redirect_url, IF it exists |
119 | - if ( $this->redirect_url() ) { |
|
119 | + if ($this->redirect_url()) { |
|
120 | 120 | $JSON_response['redirect_url'] = $this->redirect_url(); |
121 | 121 | } |
122 | 122 | // set registration_time_limit, IF it exists |
123 | - if ( $this->registration_time_limit() ) { |
|
123 | + if ($this->registration_time_limit()) { |
|
124 | 124 | $JSON_response['registration_time_limit'] = $this->registration_time_limit(); |
125 | 125 | } |
126 | 126 | // grab generic return data |
127 | 127 | $return_data = $this->return_data(); |
128 | 128 | // add billing form validation rules |
129 | - if ( $this->validation_rules() ) { |
|
129 | + if ($this->validation_rules()) { |
|
130 | 130 | $return_data['validation_rules'] = $this->validation_rules(); |
131 | 131 | } |
132 | 132 | // set reg_step_html, IF it exists |
133 | - if ( $this->reg_step_html() ) { |
|
133 | + if ($this->reg_step_html()) { |
|
134 | 134 | $return_data['reg_step_html'] = $this->reg_step_html(); |
135 | 135 | } |
136 | 136 | // set method of payment, IF it exists |
137 | - if ( $this->method_of_payment() ) { |
|
137 | + if ($this->method_of_payment()) { |
|
138 | 138 | $return_data['method_of_payment'] = $this->method_of_payment(); |
139 | 139 | } |
140 | 140 | // set "plz_select_method_of_payment" message, IF it exists |
141 | - if ( $this->plz_select_method_of_payment() ) { |
|
141 | + if ($this->plz_select_method_of_payment()) { |
|
142 | 142 | $return_data['plz_select_method_of_payment'] = $this->plz_select_method_of_payment(); |
143 | 143 | } |
144 | 144 | // set redirect_form, IF it exists |
145 | - if ( $this->redirect_form() ) { |
|
145 | + if ($this->redirect_form()) { |
|
146 | 146 | $return_data['redirect_form'] = $this->redirect_form(); |
147 | 147 | } |
148 | 148 | // and finally, add return_data array to main JSON response array, IF it contains anything |
149 | 149 | // why did we add some of the above properties to the return data array? |
150 | 150 | // because it is easier and cleaner in the Javascript to deal with this way |
151 | - if ( ! empty( $return_data )) { |
|
151 | + if ( ! empty($return_data)) { |
|
152 | 152 | $JSON_response['return_data'] = $return_data; |
153 | 153 | } |
154 | 154 | // filter final array |
155 | - $JSON_response = apply_filters( 'FHEE__EE_SPCO_JSON_Response___toString__JSON_response', $JSON_response ); |
|
155 | + $JSON_response = apply_filters('FHEE__EE_SPCO_JSON_Response___toString__JSON_response', $JSON_response); |
|
156 | 156 | // return encoded array |
157 | - return json_encode( $JSON_response ); |
|
157 | + return json_encode($JSON_response); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | /** |
163 | 163 | * @param string $attention |
164 | 164 | */ |
165 | - public function set_attention( $attention ) { |
|
165 | + public function set_attention($attention) { |
|
166 | 166 | $this->_attention = $attention; |
167 | 167 | } |
168 | 168 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | /** |
181 | 181 | * @param string $errors |
182 | 182 | */ |
183 | - public function set_errors( $errors ) { |
|
183 | + public function set_errors($errors) { |
|
184 | 184 | $this->_errors = $errors; |
185 | 185 | } |
186 | 186 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | /** |
199 | 199 | * @param string $success |
200 | 200 | */ |
201 | - public function set_success( $success ) { |
|
201 | + public function set_success($success) { |
|
202 | 202 | $this->_success = $success; |
203 | 203 | } |
204 | 204 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | /** |
217 | 217 | * @param string $method_of_payment |
218 | 218 | */ |
219 | - public function set_method_of_payment( $method_of_payment ) { |
|
219 | + public function set_method_of_payment($method_of_payment) { |
|
220 | 220 | $this->_method_of_payment = $method_of_payment; |
221 | 221 | } |
222 | 222 | |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | /** |
235 | 235 | * @param string $next_step_html |
236 | 236 | */ |
237 | - public function set_reg_step_html( $next_step_html ) { |
|
237 | + public function set_reg_step_html($next_step_html) { |
|
238 | 238 | $this->_reg_step_html = $next_step_html; |
239 | 239 | } |
240 | 240 | |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | /** |
253 | 253 | * @param string $redirect_form |
254 | 254 | */ |
255 | - public function set_redirect_form( $redirect_form ) { |
|
255 | + public function set_redirect_form($redirect_form) { |
|
256 | 256 | $this->_redirect_form = $redirect_form; |
257 | 257 | } |
258 | 258 | |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | * @return string |
263 | 263 | */ |
264 | 264 | public function redirect_form() { |
265 | - return ! empty( $this->_redirect_form ) ? $this->_redirect_form : FALSE; |
|
265 | + return ! empty($this->_redirect_form) ? $this->_redirect_form : FALSE; |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | /** |
271 | 271 | * @param string $plz_select_method_of_payment |
272 | 272 | */ |
273 | - public function set_plz_select_method_of_payment( $plz_select_method_of_payment ) { |
|
273 | + public function set_plz_select_method_of_payment($plz_select_method_of_payment) { |
|
274 | 274 | $this->_plz_select_method_of_payment = $plz_select_method_of_payment; |
275 | 275 | } |
276 | 276 | |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | /** |
289 | 289 | * @param string $redirect_url |
290 | 290 | */ |
291 | - public function set_redirect_url( $redirect_url ) { |
|
291 | + public function set_redirect_url($redirect_url) { |
|
292 | 292 | $this->_redirect_url = $redirect_url; |
293 | 293 | } |
294 | 294 | |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | /** |
316 | 316 | * @param string $registration_time_limit |
317 | 317 | */ |
318 | - public function set_registration_time_limit( $registration_time_limit ) { |
|
318 | + public function set_registration_time_limit($registration_time_limit) { |
|
319 | 319 | $this->_registration_time_limit = $registration_time_limit; |
320 | 320 | } |
321 | 321 | |
@@ -324,8 +324,8 @@ discard block |
||
324 | 324 | /** |
325 | 325 | * @param array $return_data |
326 | 326 | */ |
327 | - public function set_return_data( $return_data ) { |
|
328 | - $this->_return_data = array_merge( $this->_return_data, $return_data ); |
|
327 | + public function set_return_data($return_data) { |
|
328 | + $this->_return_data = array_merge($this->_return_data, $return_data); |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | |
@@ -342,9 +342,9 @@ discard block |
||
342 | 342 | /** |
343 | 343 | * @param array $validation_rules |
344 | 344 | */ |
345 | - public function add_validation_rules( $validation_rules = array() ) { |
|
346 | - if ( is_array( $validation_rules ) && ! empty( $validation_rules )) { |
|
347 | - $this->_validation_rules = array_merge( $this->_validation_rules, $validation_rules ); |
|
345 | + public function add_validation_rules($validation_rules = array()) { |
|
346 | + if (is_array($validation_rules) && ! empty($validation_rules)) { |
|
347 | + $this->_validation_rules = array_merge($this->_validation_rules, $validation_rules); |
|
348 | 348 | } |
349 | 349 | } |
350 | 350 | |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | * @return array | bool |
355 | 355 | */ |
356 | 356 | public function validation_rules() { |
357 | - return ! empty( $this->_validation_rules ) ? $this->_validation_rules : FALSE; |
|
357 | + return ! empty($this->_validation_rules) ? $this->_validation_rules : FALSE; |
|
358 | 358 | } |
359 | 359 | |
360 | 360 |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | * @param EE_Checkout $checkout |
21 | 21 | * @return \EE_SPCO_Reg_Step_Registration_Confirmation |
22 | 22 | */ |
23 | - public function __construct( EE_Checkout $checkout ) { |
|
23 | + public function __construct(EE_Checkout $checkout) { |
|
24 | 24 | $this->_slug = 'registration_confirmation'; |
25 | 25 | $this->_name = __('Registration Confirmation', 'event_espresso'); |
26 | - $this->_template = SPCO_TEMPLATES_PATH . 'registration_page_confirmation.template.php'; |
|
26 | + $this->_template = SPCO_TEMPLATES_PATH.'registration_page_confirmation.template.php'; |
|
27 | 27 | $this->checkout = $checkout; |
28 | 28 | } |
29 | 29 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @return string |
50 | 50 | */ |
51 | 51 | public function generate_reg_form() { |
52 | - EE_Registry::instance()->REQ->add_output( 'generate_reg_form' ); |
|
52 | + EE_Registry::instance()->REQ->add_output('generate_reg_form'); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } |
2 | 2 | /** |
3 | - * |
|
4 | - * Class EE_SPCO_Reg_Step_Registration_Confirmation |
|
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_SPCO_Reg_Step_Registration_Confirmation |
|
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_SPCO_Reg_Step_Registration_Confirmation extends EE_SPCO_Reg_Step { |
15 | 15 | |
16 | 16 | /** |
@@ -27,7 +27,7 @@ |
||
27 | 27 | /** |
28 | 28 | * Applies all teh individual item validation strategies on each item in the array |
29 | 29 | * @param array $normalized_value |
30 | - * @return boolean |
|
30 | + * @return boolean|null |
|
31 | 31 | */ |
32 | 32 | function validate($normalized_value) { |
33 | 33 | if( is_array($normalized_value)){ |