@@ -3,43 +3,43 @@ discard block |
||
| 3 | 3 | /** @type int $max_atndz */ |
| 4 | 4 | /** @type boolean $event_is_expired */ |
| 5 | 5 | |
| 6 | -$template_settings = isset ( EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector ) ? EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector : new EE_Ticket_Selector_Config(); |
|
| 6 | +$template_settings = isset (EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector) ? EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector : new EE_Ticket_Selector_Config(); |
|
| 7 | 7 | ?> |
| 8 | 8 | <div id="tkt-slctr-tbl-wrap-dv-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl-wrap-dv" > |
| 9 | 9 | <table id="tkt-slctr-tbl-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl" border="0" cellspacing="0" cellpadding="0"> |
| 10 | 10 | <thead> |
| 11 | 11 | <tr> |
| 12 | 12 | <th scope="col" width=""> |
| 13 | - <span class="ee-icon ee-icon-tickets"></span><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__table_header_available_tickets', __( 'Available Tickets', 'event_espresso' )); ?> |
|
| 13 | + <span class="ee-icon ee-icon-tickets"></span><?php echo apply_filters('FHEE__ticket_selector_chart_template__table_header_available_tickets', __('Available Tickets', 'event_espresso')); ?> |
|
| 14 | 14 | </th> |
| 15 | - <?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE )) { ?> |
|
| 16 | - <th scope="col" width="22.5%"><?php _e( 'Price', 'event_espresso' ); ?> </th> |
|
| 15 | + <?php if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?> |
|
| 16 | + <th scope="col" width="22.5%"><?php _e('Price', 'event_espresso'); ?> </th> |
|
| 17 | 17 | <?php } ?> |
| 18 | - <th scope="col" width="17.5%" class="cntr"><?php _e( 'Qty*', 'event_espresso' ); ?></th> |
|
| 18 | + <th scope="col" width="17.5%" class="cntr"><?php _e('Qty*', 'event_espresso'); ?></th> |
|
| 19 | 19 | </tr> |
| 20 | 20 | </thead> |
| 21 | 21 | <tbody> |
| 22 | 22 | <?php |
| 23 | 23 | |
| 24 | 24 | $row = 1; |
| 25 | -$ticket_count = count( $tickets ); |
|
| 25 | +$ticket_count = count($tickets); |
|
| 26 | 26 | $required_ticket_sold_out = FALSE; |
| 27 | -foreach ( $tickets as $TKT_ID => $ticket ) { |
|
| 28 | - if ( $ticket instanceof EE_Ticket ) { |
|
| 27 | +foreach ($tickets as $TKT_ID => $ticket) { |
|
| 28 | + if ($ticket instanceof EE_Ticket) { |
|
| 29 | 29 | // d( $ticket ); |
| 30 | - $max =$ticket->max(); |
|
| 30 | + $max = $ticket->max(); |
|
| 31 | 31 | $min = 0; |
| 32 | 32 | $remaining = $ticket->remaining(); |
| 33 | - if ( $ticket->is_on_sale() && $ticket->is_remaining() ) { |
|
| 33 | + if ($ticket->is_on_sale() && $ticket->is_remaining()) { |
|
| 34 | 34 | // offer the number of $tickets_remaining or $max_atndz, whichever is smaller |
| 35 | - $max = min( $remaining, $max_atndz ); |
|
| 35 | + $max = min($remaining, $max_atndz); |
|
| 36 | 36 | // but... we also want to restrict the number of tickets by the ticket max setting, |
| 37 | 37 | // however, the max still can't be higher than what was just set above |
| 38 | - $max = $ticket->max() > 0 ? min( $ticket->max(), $max ) : $max; |
|
| 38 | + $max = $ticket->max() > 0 ? min($ticket->max(), $max) : $max; |
|
| 39 | 39 | // and we also want to restrict the minimum number of tickets by the ticket min setting |
| 40 | 40 | $min = $ticket->min() > 0 ? $ticket->min() : 0; |
| 41 | 41 | // and if the ticket is required, then make sure that min qty is at least 1 |
| 42 | - $min = $ticket->required() ? max( $min, 1 ) : $min; |
|
| 42 | + $min = $ticket->required() ? max($min, 1) : $min; |
|
| 43 | 43 | } else { |
| 44 | 44 | // set flag if ticket is required (flag is set to start date so that future tickets are not blocked) |
| 45 | 45 | $required_ticket_sold_out = $ticket->required() && ! $remaining ? $ticket->start_date() : $required_ticket_sold_out; |
@@ -48,39 +48,39 @@ discard block |
||
| 48 | 48 | $ticket_price = $ticket->get_ticket_total_with_taxes(); |
| 49 | 49 | $ticket_bundle = FALSE; |
| 50 | 50 | // for ticket bundles, set min and max qty the same |
| 51 | - if ( $ticket->min() != 0 && $ticket->min() == $ticket->max() ) { |
|
| 51 | + if ($ticket->min() != 0 && $ticket->min() == $ticket->max()) { |
|
| 52 | 52 | $ticket_price = $ticket_price * $ticket->min(); |
| 53 | 53 | $ticket_bundle = TRUE; |
| 54 | 54 | } |
| 55 | - $ticket_price = apply_filters( 'FHEE__ticket_selector_chart_template__ticket_price', $ticket_price, $ticket ); |
|
| 55 | + $ticket_price = apply_filters('FHEE__ticket_selector_chart_template__ticket_price', $ticket_price, $ticket); |
|
| 56 | 56 | // if a previous required ticket with the same sale start date is sold out, then mark this ticket as sold out as well. |
| 57 | 57 | // tickets that go on sale at a later date than the required ticket will NOT be affected |
| 58 | 58 | $tkt_status = $required_ticket_sold_out !== FALSE && $required_ticket_sold_out === $ticket->start_date() ? EE_Ticket::sold_out : $ticket->ticket_status(); |
| 59 | 59 | // check ticket status |
| 60 | - switch ( $tkt_status ) { |
|
| 60 | + switch ($tkt_status) { |
|
| 61 | 61 | // sold_out |
| 62 | 62 | case EE_Ticket::sold_out : |
| 63 | - $ticket_status = '<span class="ticket-sales-sold-out">' . $ticket->ticket_status( TRUE ) . '</span>'; |
|
| 63 | + $ticket_status = '<span class="ticket-sales-sold-out">'.$ticket->ticket_status(TRUE).'</span>'; |
|
| 64 | 64 | $status_class = 'ticket-sales-sold-out lt-grey-text'; |
| 65 | 65 | break; |
| 66 | 66 | // expired |
| 67 | 67 | case EE_Ticket::expired : |
| 68 | - $ticket_status = '<span class="ticket-sales-expired">' . $ticket->ticket_status( TRUE ) . '</span>'; |
|
| 68 | + $ticket_status = '<span class="ticket-sales-expired">'.$ticket->ticket_status(TRUE).'</span>'; |
|
| 69 | 69 | $status_class = 'ticket-sales-expired lt-grey-text'; |
| 70 | 70 | break; |
| 71 | 71 | // archived |
| 72 | 72 | case EE_Ticket::archived : |
| 73 | - $ticket_status = '<span class="archived-ticket">' . $ticket->ticket_status( TRUE ) . '</span>'; |
|
| 73 | + $ticket_status = '<span class="archived-ticket">'.$ticket->ticket_status(TRUE).'</span>'; |
|
| 74 | 74 | $status_class = 'archived-ticket hidden'; |
| 75 | 75 | break; |
| 76 | 76 | // pending |
| 77 | 77 | case EE_Ticket::pending : |
| 78 | - $ticket_status = '<span class="ticket-pending">' . $ticket->ticket_status( TRUE ) . '</span>'; |
|
| 78 | + $ticket_status = '<span class="ticket-pending">'.$ticket->ticket_status(TRUE).'</span>'; |
|
| 79 | 79 | $status_class = 'ticket-pending'; |
| 80 | 80 | break; |
| 81 | 81 | // onsale |
| 82 | 82 | case EE_Ticket::onsale : |
| 83 | - $ticket_status = '<span class="ticket-on-sale">' . $ticket->ticket_status( TRUE ) . '</span>'; |
|
| 83 | + $ticket_status = '<span class="ticket-on-sale">'.$ticket->ticket_status(TRUE).'</span>'; |
|
| 84 | 84 | $status_class = 'ticket-on-sale'; |
| 85 | 85 | break; |
| 86 | 86 | } |
@@ -95,12 +95,12 @@ discard block |
||
| 95 | 95 | * |
| 96 | 96 | * @var string|bool |
| 97 | 97 | */ |
| 98 | - if ( false !== ( $new_row_content = apply_filters( 'FHEE__ticket_selector_chart_template__do_ticket_entire_row', false, $ticket, $max, $min, $required_ticket_sold_out, $ticket_price, $ticket_bundle, $ticket_status, $status_class ) ) ) { |
|
| 98 | + if (false !== ($new_row_content = apply_filters('FHEE__ticket_selector_chart_template__do_ticket_entire_row', false, $ticket, $max, $min, $required_ticket_sold_out, $ticket_price, $ticket_bundle, $ticket_status, $status_class))) { |
|
| 99 | 99 | echo $new_row_content; |
| 100 | 100 | continue; |
| 101 | 101 | } |
| 102 | 102 | ?> |
| 103 | - <tr class="tckt-slctr-tbl-tr <?php echo $status_class . ' ' . espresso_get_object_css_class( $ticket ); ?>"> |
|
| 103 | + <tr class="tckt-slctr-tbl-tr <?php echo $status_class.' '.espresso_get_object_css_class($ticket); ?>"> |
|
| 104 | 104 | <?php |
| 105 | 105 | /** |
| 106 | 106 | * Allow plugins to hook in and abort the generation and display of the contents of this |
@@ -112,24 +112,24 @@ discard block |
||
| 112 | 112 | * |
| 113 | 113 | * @var string|bool |
| 114 | 114 | */ |
| 115 | - if ( false !== ( $new_row_cells_content = apply_filters( 'FHEE__ticket_selector_chart_template__do_ticket_inside_row', false, $ticket, $max, $min, $required_ticket_sold_out, $ticket_price, $ticket_bundle, $ticket_status, $status_class ) ) ) { |
|
| 115 | + if (false !== ($new_row_cells_content = apply_filters('FHEE__ticket_selector_chart_template__do_ticket_inside_row', false, $ticket, $max, $min, $required_ticket_sold_out, $ticket_price, $ticket_bundle, $ticket_status, $status_class))) { |
|
| 116 | 116 | echo $new_row_cells_content; |
| 117 | 117 | echo '</tr>'; |
| 118 | 118 | continue; |
| 119 | 119 | } |
| 120 | 120 | ?> |
| 121 | 121 | <td class="tckt-slctr-tbl-td-name"> |
| 122 | - <b><?php echo $ticket->get_pretty('TKT_name');?></b> |
|
| 123 | - <?php if ( $template_settings->show_ticket_details ) : ?> |
|
| 124 | - <a id="display-tckt-slctr-tkt-details-<?php echo $EVT_ID . '-' . $TKT_ID; ?>" class="display-tckt-slctr-tkt-details display-the-hidden lt-grey-text smaller-text hide-if-no-js" rel="tckt-slctr-tkt-details-<?php echo $EVT_ID . '-' . $TKT_ID; ?>" title="<?php echo esc_attr( apply_filters( 'FHEE__ticket_selector_chart_template__show_ticket_details_link_title', __( 'click to show additional ticket details', 'event_espresso' )) ); ?>"> |
|
| 125 | - <?php echo sprintf( __( 'show%1$sdetails%1$s+', 'event_espresso' ), ' ' ); ?> |
|
| 122 | + <b><?php echo $ticket->get_pretty('TKT_name'); ?></b> |
|
| 123 | + <?php if ($template_settings->show_ticket_details) : ?> |
|
| 124 | + <a id="display-tckt-slctr-tkt-details-<?php echo $EVT_ID.'-'.$TKT_ID; ?>" class="display-tckt-slctr-tkt-details display-the-hidden lt-grey-text smaller-text hide-if-no-js" rel="tckt-slctr-tkt-details-<?php echo $EVT_ID.'-'.$TKT_ID; ?>" title="<?php echo esc_attr(apply_filters('FHEE__ticket_selector_chart_template__show_ticket_details_link_title', __('click to show additional ticket details', 'event_espresso'))); ?>"> |
|
| 125 | + <?php echo sprintf(__('show%1$sdetails%1$s+', 'event_espresso'), ' '); ?> |
|
| 126 | 126 | </a> |
| 127 | - <a id="hide-tckt-slctr-tkt-details-<?php echo $EVT_ID . '-' . $TKT_ID; ?>" class="hide-tckt-slctr-tkt-details hide-the-displayed lt-grey-text smaller-text hide-if-no-js" rel="tckt-slctr-tkt-details-<?php echo $EVT_ID . '-' . $TKT_ID; ?>" title="<?php echo esc_attr( apply_filters( 'FHEE__ticket_selector_chart_template__hide_ticket_details_link_title', __( 'click to hide additional ticket details', 'event_espresso' )) ); ?>" style="display:none;"> |
|
| 128 | - <?php echo sprintf( __( 'hide%1$sdetails%1$s-', 'event_espresso' ), ' ' ); ?> |
|
| 127 | + <a id="hide-tckt-slctr-tkt-details-<?php echo $EVT_ID.'-'.$TKT_ID; ?>" class="hide-tckt-slctr-tkt-details hide-the-displayed lt-grey-text smaller-text hide-if-no-js" rel="tckt-slctr-tkt-details-<?php echo $EVT_ID.'-'.$TKT_ID; ?>" title="<?php echo esc_attr(apply_filters('FHEE__ticket_selector_chart_template__hide_ticket_details_link_title', __('click to hide additional ticket details', 'event_espresso'))); ?>" style="display:none;"> |
|
| 128 | + <?php echo sprintf(__('hide%1$sdetails%1$s-', 'event_espresso'), ' '); ?> |
|
| 129 | 129 | </a> |
| 130 | 130 | <?php endif; //end show details check ?> |
| 131 | - <?php if ( $ticket->required() ) { ?> |
|
| 132 | - <p class="ticket-required-pg"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_required_message', __( 'This ticket is required and must be purchased.', 'event_espresso' )); ?></p> |
|
| 131 | + <?php if ($ticket->required()) { ?> |
|
| 132 | + <p class="ticket-required-pg"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_required_message', __('This ticket is required and must be purchased.', 'event_espresso')); ?></p> |
|
| 133 | 133 | <?php } ?> |
| 134 | 134 | <?php |
| 135 | 135 | // echo '<br/><b>$max_atndz : ' . $max_atndz . '</b>'; |
@@ -143,12 +143,12 @@ discard block |
||
| 143 | 143 | // echo '<br/><b> $ticket->required() : ' . $ticket->uses() . '</b>'; |
| 144 | 144 | ?> |
| 145 | 145 | </td> |
| 146 | - <?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE )) { ?> |
|
| 147 | - <td class="tckt-slctr-tbl-td-price jst-rght"><?php echo EEH_Template::format_currency( $ticket_price ); ?> <span class="smaller-text no-bold"><?php |
|
| 148 | - if ( $ticket_bundle ) { |
|
| 149 | - echo apply_filters( 'FHEE__ticket_selector_chart_template__per_ticket_bundle_text', __( ' / bundle', 'event_espresso' )); |
|
| 146 | + <?php if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?> |
|
| 147 | + <td class="tckt-slctr-tbl-td-price jst-rght"><?php echo EEH_Template::format_currency($ticket_price); ?> <span class="smaller-text no-bold"><?php |
|
| 148 | + if ($ticket_bundle) { |
|
| 149 | + echo apply_filters('FHEE__ticket_selector_chart_template__per_ticket_bundle_text', __(' / bundle', 'event_espresso')); |
|
| 150 | 150 | } else { |
| 151 | - echo apply_filters( 'FHEE__ticket_selector_chart_template__per_ticket_text', __( ' / ticket', 'event_espresso' )); |
|
| 151 | + echo apply_filters('FHEE__ticket_selector_chart_template__per_ticket_text', __(' / ticket', 'event_espresso')); |
|
| 152 | 152 | }?></span> |
| 153 | 153 | </td> |
| 154 | 154 | <?php } ?> |
@@ -156,51 +156,51 @@ discard block |
||
| 156 | 156 | <?php |
| 157 | 157 | $hidden_input_qty = $max_atndz > 1 ? TRUE : FALSE; |
| 158 | 158 | // sold out or other status ? |
| 159 | - if ( $tkt_status == EE_Ticket::sold_out || $remaining == 0 ) { |
|
| 159 | + if ($tkt_status == EE_Ticket::sold_out || $remaining == 0) { |
|
| 160 | 160 | ?> |
| 161 | - <span class="sold-out"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_sold_out_msg', __( 'Sold Out', 'event_espresso' ));?></span> |
|
| 161 | + <span class="sold-out"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_sold_out_msg', __('Sold Out', 'event_espresso')); ?></span> |
|
| 162 | 162 | <?php |
| 163 | - } else if ( $tkt_status == EE_Ticket::expired || $tkt_status == EE_Ticket::archived ) { |
|
| 163 | + } else if ($tkt_status == EE_Ticket::expired || $tkt_status == EE_Ticket::archived) { |
|
| 164 | 164 | echo $ticket_status; |
| 165 | - } else if ( $tkt_status == EE_Ticket::pending ) { |
|
| 165 | + } else if ($tkt_status == EE_Ticket::pending) { |
|
| 166 | 166 | ?> |
| 167 | 167 | <div class="ticket-pending-pg"> |
| 168 | - <span class="ticket-pending"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_goes_on_sale_msg', __( 'Goes On Sale', 'event_espresso' )); ?></span><br/> |
|
| 169 | - <span class="small-text"><?php echo date_i18n( 'M d, Y', strtotime( $ticket->start_date() )); ?></span> |
|
| 168 | + <span class="ticket-pending"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_goes_on_sale_msg', __('Goes On Sale', 'event_espresso')); ?></span><br/> |
|
| 169 | + <span class="small-text"><?php echo date_i18n('M d, Y', strtotime($ticket->start_date())); ?></span> |
|
| 170 | 170 | </div> |
| 171 | 171 | <?php |
| 172 | 172 | // min qty purchasable is less than tickets available |
| 173 | - } else if ( $ticket->min() > $remaining ) { |
|
| 173 | + } else if ($ticket->min() > $remaining) { |
|
| 174 | 174 | ?> |
| 175 | 175 | <div class="archived-ticket-pg"> |
| 176 | - <span class="archived-ticket small-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_not_available_msg', __( 'Not Available', 'event_espresso' )); ?></span><br/> |
|
| 176 | + <span class="archived-ticket small-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_not_available_msg', __('Not Available', 'event_espresso')); ?></span><br/> |
|
| 177 | 177 | </div> |
| 178 | 178 | <?php |
| 179 | 179 | // if only one attendee is allowed to register at a time |
| 180 | - } else if ( $max_atndz == 1 ) { |
|
| 180 | + } else if ($max_atndz == 1) { |
|
| 181 | 181 | // display submit button since we have tickets available |
| 182 | - add_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' ); |
|
| 182 | + add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true'); |
|
| 183 | 183 | ?> |
| 184 | - <input type="radio" name="tkt-slctr-qty-<?php echo $EVT_ID; ?>" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID . '-' . $row; ?>" class="ticket-selector-tbl-qty-slct" value="<?php echo $row . '-'; ?>1" <?php echo $row == 1 ? ' checked="checked"' : ''; ?> title=""/> |
|
| 184 | + <input type="radio" name="tkt-slctr-qty-<?php echo $EVT_ID; ?>" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID.'-'.$row; ?>" class="ticket-selector-tbl-qty-slct" value="<?php echo $row.'-'; ?>1" <?php echo $row == 1 ? ' checked="checked"' : ''; ?> title=""/> |
|
| 185 | 185 | <?php |
| 186 | 186 | $hidden_input_qty = FALSE; |
| 187 | 187 | |
| 188 | - } else if ( $max_atndz == 0 ) { |
|
| 189 | - echo '<span class="sold-out">' . apply_filters( 'FHEE__ticket_selector_chart_template__ticket_closed_msg', __( 'Closed', 'event_espresso' )) . '</span>'; |
|
| 190 | - } elseif ( $max > 0 ) { |
|
| 188 | + } else if ($max_atndz == 0) { |
|
| 189 | + echo '<span class="sold-out">'.apply_filters('FHEE__ticket_selector_chart_template__ticket_closed_msg', __('Closed', 'event_espresso')).'</span>'; |
|
| 190 | + } elseif ($max > 0) { |
|
| 191 | 191 | // display submit button since we have tickets available |
| 192 | - add_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' ); |
|
| 192 | + add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true'); |
|
| 193 | 193 | |
| 194 | 194 | ?> |
| 195 | - <select name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID . '-' . $row; ?>" class="ticket-selector-tbl-qty-slct" title=""> |
|
| 195 | + <select name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID.'-'.$row; ?>" class="ticket-selector-tbl-qty-slct" title=""> |
|
| 196 | 196 | <?php |
| 197 | 197 | // this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased |
| 198 | - if ( ! $ticket->required() && $min !== 0 ) { |
|
| 198 | + if ( ! $ticket->required() && $min !== 0) { |
|
| 199 | 199 | ?> |
| 200 | 200 | <option value="0"> 0 </option> |
| 201 | 201 | <?php } |
| 202 | 202 | // offer ticket quantities from the min to the max |
| 203 | - for ( $i = $min; $i <= $max; $i++) { |
|
| 203 | + for ($i = $min; $i <= $max; $i++) { |
|
| 204 | 204 | ?> |
| 205 | 205 | <option value="<?php echo $i; ?>"> <?php echo $i; ?> </option> |
| 206 | 206 | <?php } ?> |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | |
| 211 | 211 | } |
| 212 | 212 | // depending on group reg we need to change the format for qty |
| 213 | - if ( $hidden_input_qty ) { |
|
| 213 | + if ($hidden_input_qty) { |
|
| 214 | 214 | ?> |
| 215 | 215 | <input type="hidden" name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" value="0" /> |
| 216 | 216 | <?php |
@@ -220,33 +220,33 @@ discard block |
||
| 220 | 220 | |
| 221 | 221 | </td> |
| 222 | 222 | </tr> |
| 223 | - <?php if ( $template_settings->show_ticket_details ) : ?> |
|
| 224 | - <tr class="tckt-slctr-tkt-details-tr <?php echo espresso_get_object_css_class( $ticket, '', 'details' );?>"> |
|
| 223 | + <?php if ($template_settings->show_ticket_details) : ?> |
|
| 224 | + <tr class="tckt-slctr-tkt-details-tr <?php echo espresso_get_object_css_class($ticket, '', 'details'); ?>"> |
|
| 225 | 225 | <td class="tckt-slctr-tkt-details-td" colspan="4" style="padding: 0;border-top:none;"> |
| 226 | - <div id="tckt-slctr-tkt-details-<?php echo $EVT_ID . '-' . $TKT_ID; ?>-dv" class="tckt-slctr-tkt-details-dv" style="display: none;"> |
|
| 226 | + <div id="tckt-slctr-tkt-details-<?php echo $EVT_ID.'-'.$TKT_ID; ?>-dv" class="tckt-slctr-tkt-details-dv" style="display: none;"> |
|
| 227 | 227 | |
| 228 | 228 | <section class="tckt-slctr-tkt-details-sctn"> |
| 229 | - <h3><?php _e( 'Ticket Details', 'event_espresso' ); ?></h3> |
|
| 229 | + <h3><?php _e('Ticket Details', 'event_espresso'); ?></h3> |
|
| 230 | 230 | <p><?php echo $ticket->description(); ?></p> |
| 231 | 231 | |
| 232 | - <?php if ( $ticket_price != 0 && apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE )) { ?> |
|
| 232 | + <?php if ($ticket_price != 0 && apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?> |
|
| 233 | 233 | <section class="tckt-slctr-tkt-price-sctn"> |
| 234 | - <h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading', __( 'Ticket Price Breakdown', 'event_espresso' )); ?></h5> |
|
| 234 | + <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading', __('Ticket Price Breakdown', 'event_espresso')); ?></h5> |
|
| 235 | 235 | <div class="tckt-slctr-tkt-details-tbl-wrap-dv"> |
| 236 | 236 | <table class="tckt-slctr-tkt-details-tbl"> |
| 237 | 237 | <thead> |
| 238 | 238 | <tr> |
| 239 | - <th width="30%" class=""><span class="small-text"><?php _e( 'Name', 'event_espresso' ); ?></span></th> |
|
| 240 | - <th width="" class="jst-cntr"><span class="small-text"><?php _e( 'Description', 'event_espresso' ); ?></span></th> |
|
| 241 | - <th width="25%" class="jst-rght"><span class="small-text"><?php _e( 'Amount', 'event_espresso' ); ?></span></th> |
|
| 239 | + <th width="30%" class=""><span class="small-text"><?php _e('Name', 'event_espresso'); ?></span></th> |
|
| 240 | + <th width="" class="jst-cntr"><span class="small-text"><?php _e('Description', 'event_espresso'); ?></span></th> |
|
| 241 | + <th width="25%" class="jst-rght"><span class="small-text"><?php _e('Amount', 'event_espresso'); ?></span></th> |
|
| 242 | 242 | </tr> |
| 243 | 243 | </thead> |
| 244 | 244 | <tbody> |
| 245 | - <?php if ( $ticket->base_price() instanceof EE_Price ) { ?> |
|
| 245 | + <?php if ($ticket->base_price() instanceof EE_Price) { ?> |
|
| 246 | 246 | <tr> |
| 247 | - <td data-th="<?php _e( 'Name', 'event_espresso' ); ?>" class="small-text"><b><?php echo $ticket->base_price()->name(); ?></b></td> |
|
| 248 | - <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="small-text"><?php echo $ticket->base_price()->desc(); ?></td> |
|
| 249 | - <td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo $ticket->base_price()->pretty_price(); ?></td> |
|
| 247 | + <td data-th="<?php _e('Name', 'event_espresso'); ?>" class="small-text"><b><?php echo $ticket->base_price()->name(); ?></b></td> |
|
| 248 | + <td data-th="<?php _e('Description', 'event_espresso'); ?>" class="small-text"><?php echo $ticket->base_price()->desc(); ?></td> |
|
| 249 | + <td data-th="<?php _e('Amount', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo $ticket->base_price()->pretty_price(); ?></td> |
|
| 250 | 250 | </tr> |
| 251 | 251 | <?php |
| 252 | 252 | $running_total = $ticket->base_price()->amount(); |
@@ -254,44 +254,44 @@ discard block |
||
| 254 | 254 | $running_total = 0; |
| 255 | 255 | } |
| 256 | 256 | // now add price modifiers |
| 257 | - foreach ( $ticket->price_modifiers() as $price_mod ) { ?> |
|
| 257 | + foreach ($ticket->price_modifiers() as $price_mod) { ?> |
|
| 258 | 258 | <tr> |
| 259 | - <td data-th="<?php _e( 'Name', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo $price_mod->name(); ?></td> |
|
| 260 | - <?php if ( $price_mod->is_percent() ) { ?> |
|
| 261 | - <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="small-text"><?php echo $price_mod->desc(); ?> <?php echo $price_mod->amount(); ?>%</td> |
|
| 259 | + <td data-th="<?php _e('Name', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo $price_mod->name(); ?></td> |
|
| 260 | + <?php if ($price_mod->is_percent()) { ?> |
|
| 261 | + <td data-th="<?php _e('Description', 'event_espresso'); ?>" class="small-text"><?php echo $price_mod->desc(); ?> <?php echo $price_mod->amount(); ?>%</td> |
|
| 262 | 262 | <?php |
| 263 | - $new_sub_total = $running_total * ( $price_mod->amount() / 100 ); |
|
| 263 | + $new_sub_total = $running_total * ($price_mod->amount() / 100); |
|
| 264 | 264 | $new_sub_total = $price_mod->is_discount() ? $new_sub_total * -1 : $new_sub_total; |
| 265 | 265 | ?> |
| 266 | 266 | <?php } else { ?> |
| 267 | 267 | <?php $new_sub_total = $price_mod->is_discount() ? $price_mod->amount() * -1 : $price_mod->amount(); ?> |
| 268 | - <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="small-text"><?php echo $price_mod->desc(); ?></td> |
|
| 268 | + <td data-th="<?php _e('Description', 'event_espresso'); ?>" class="small-text"><?php echo $price_mod->desc(); ?></td> |
|
| 269 | 269 | <?php $new_sub_total = $price_mod->is_discount() ? $price_mod->amount() * -1 : $price_mod->amount(); ?> |
| 270 | 270 | <?php } ?> |
| 271 | - <td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo EEH_Template::format_currency( $new_sub_total ); ?></td> |
|
| 271 | + <td data-th="<?php _e('Amount', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo EEH_Template::format_currency($new_sub_total); ?></td> |
|
| 272 | 272 | <?php $running_total += $new_sub_total; ?> |
| 273 | 273 | </tr> |
| 274 | 274 | <?php } ?> |
| 275 | - <?php if ( $ticket->taxable() ) { ?> |
|
| 275 | + <?php if ($ticket->taxable()) { ?> |
|
| 276 | 276 | <?php //$ticket_subtotal =$ticket->get_ticket_subtotal(); ?> |
| 277 | 277 | <tr> |
| 278 | - <td colspan="2" class="jst-rght small-text sbttl"><b><?php _e( 'subtotal', 'event_espresso' ); ?></b></td> |
|
| 279 | - <td data-th="<?php _e( 'subtotal', 'event_espresso' ); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency( $running_total ); ?></b></td> |
|
| 278 | + <td colspan="2" class="jst-rght small-text sbttl"><b><?php _e('subtotal', 'event_espresso'); ?></b></td> |
|
| 279 | + <td data-th="<?php _e('subtotal', 'event_espresso'); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency($running_total); ?></b></td> |
|
| 280 | 280 | </tr> |
| 281 | 281 | |
| 282 | - <?php foreach ( $ticket->get_ticket_taxes_for_admin() as $tax ) { ?> |
|
| 282 | + <?php foreach ($ticket->get_ticket_taxes_for_admin() as $tax) { ?> |
|
| 283 | 283 | <tr> |
| 284 | - <td data-th="<?php _e( 'Name', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo $tax->name(); ?></td> |
|
| 285 | - <td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo $tax->amount(); ?>%</td> |
|
| 286 | - <?php $tax_amount = $running_total * ( $tax->amount() / 100 ); ?> |
|
| 287 | - <td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo EEH_Template::format_currency( $tax_amount ); ?></td> |
|
| 284 | + <td data-th="<?php _e('Name', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo $tax->name(); ?></td> |
|
| 285 | + <td data-th="<?php _e('Description', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo $tax->amount(); ?>%</td> |
|
| 286 | + <?php $tax_amount = $running_total * ($tax->amount() / 100); ?> |
|
| 287 | + <td data-th="<?php _e('Amount', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo EEH_Template::format_currency($tax_amount); ?></td> |
|
| 288 | 288 | <?php $running_total += $tax_amount; ?> |
| 289 | 289 | </tr> |
| 290 | 290 | <?php } ?> |
| 291 | 291 | <?php } ?> |
| 292 | 292 | <tr> |
| 293 | - <td colspan="2" class="jst-rght small-text ttl-lbl-td"><b><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_total_price', __( 'Total Ticket Price', 'event_espresso' )); ?></b></td> |
|
| 294 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_total_price', __( 'Total Ticket Price', 'event_espresso' )); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency( $running_total ); ?></b></td> |
|
| 293 | + <td colspan="2" class="jst-rght small-text ttl-lbl-td"><b><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_total_price', __('Total Ticket Price', 'event_espresso')); ?></b></td> |
|
| 294 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_total_price', __('Total Ticket Price', 'event_espresso')); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency($running_total); ?></b></td> |
|
| 295 | 295 | </tr> |
| 296 | 296 | </tbody> |
| 297 | 297 | </table> |
@@ -301,106 +301,106 @@ discard block |
||
| 301 | 301 | <?php } ?> |
| 302 | 302 | |
| 303 | 303 | <section class="tckt-slctr-tkt-sale-dates-sctn"> |
| 304 | - <h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading', __( 'Ticket Sale Dates', 'event_espresso' )); ?></h5> |
|
| 305 | - <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message', __( 'The dates when this ticket is available for purchase.', 'event_espresso' )); ?></span><br/> |
|
| 306 | - <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale', __( 'Goes On Sale:', 'event_espresso' )); ?></span><span class="dashicons dashicons-calendar"></span><?php echo date_i18n( $date_format, strtotime( $ticket->start_date() )) . ' '; ?><span class="dashicons dashicons-clock"></span><?php echo date_i18n( $time_format, strtotime( $ticket->start_date() )) ; ?><br/> |
|
| 307 | - <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_sales_end', __( 'Sales End:', 'event_espresso' )); ?></span><span class="dashicons dashicons-calendar"></span><?php echo date_i18n( $date_format, strtotime( $ticket->end_date() )) . ' '; ?><span class="dashicons dashicons-clock"></span><?php echo date_i18n( $time_format, strtotime( $ticket->end_date() )) ; ?><br/> |
|
| 304 | + <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading', __('Ticket Sale Dates', 'event_espresso')); ?></h5> |
|
| 305 | + <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_dates_available_message', __('The dates when this ticket is available for purchase.', 'event_espresso')); ?></span><br/> |
|
| 306 | + <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale', __('Goes On Sale:', 'event_espresso')); ?></span><span class="dashicons dashicons-calendar"></span><?php echo date_i18n($date_format, strtotime($ticket->start_date())).' '; ?><span class="dashicons dashicons-clock"></span><?php echo date_i18n($time_format, strtotime($ticket->start_date())); ?><br/> |
|
| 307 | + <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_sales_end', __('Sales End:', 'event_espresso')); ?></span><span class="dashicons dashicons-calendar"></span><?php echo date_i18n($date_format, strtotime($ticket->end_date())).' '; ?><span class="dashicons dashicons-clock"></span><?php echo date_i18n($time_format, strtotime($ticket->end_date())); ?><br/> |
|
| 308 | 308 | </section> |
| 309 | 309 | <br/> |
| 310 | 310 | |
| 311 | - <?php do_action( 'AHEE__ticket_selector_chart_template__after_ticket_date', $ticket ); ?> |
|
| 311 | + <?php do_action('AHEE__ticket_selector_chart_template__after_ticket_date', $ticket); ?> |
|
| 312 | 312 | |
| 313 | - <?php if ( $ticket->min() &&$ticket->max() ) { ?> |
|
| 313 | + <?php if ($ticket->min() && $ticket->max()) { ?> |
|
| 314 | 314 | <section class="tckt-slctr-tkt-quantities-sctn"> |
| 315 | - <h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading', __( 'Purchasable Quantities', 'event_espresso' )); ?></h5> |
|
| 316 | - <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message', __( 'The number of tickets that can be purchased per transaction (if available).', 'event_espresso' )); ?></span><br/> |
|
| 317 | - <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty', __( 'Minimum Qty:', 'event_espresso' )); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?> |
|
| 318 | - <?php if ( $ticket->min() > $remaining ) { ?> <span class="important-notice small-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message', __( 'The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining', 'event_espresso' )); ?></span><?php } ?><br/> |
|
| 315 | + <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading', __('Purchasable Quantities', 'event_espresso')); ?></h5> |
|
| 316 | + <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message', __('The number of tickets that can be purchased per transaction (if available).', 'event_espresso')); ?></span><br/> |
|
| 317 | + <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty', __('Minimum Qty:', 'event_espresso')); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?> |
|
| 318 | + <?php if ($ticket->min() > $remaining) { ?> <span class="important-notice small-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message', __('The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining', 'event_espresso')); ?></span><?php } ?><br/> |
|
| 319 | 319 | <?php //$max = min( $max, $max_atndz );?> |
| 320 | - <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty', __( 'Maximum Qty:', 'event_espresso' )); ?></span><?php echo $ticket->max() === INF ? __( 'no limit', 'event_espresso' ) : max( $ticket->max(), 1 ); ?><br/> |
|
| 320 | + <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty', __('Maximum Qty:', 'event_espresso')); ?></span><?php echo $ticket->max() === INF ? __('no limit', 'event_espresso') : max($ticket->max(), 1); ?><br/> |
|
| 321 | 321 | </section> |
| 322 | 322 | <br/> |
| 323 | 323 | <?php } ?> |
| 324 | 324 | |
| 325 | - <?php if ( $ticket->uses() !== INF && ( ! defined( 'EE_DECAF' ) || EE_DECAF !== TRUE )) { ?> |
|
| 325 | + <?php if ($ticket->uses() !== INF && ( ! defined('EE_DECAF') || EE_DECAF !== TRUE)) { ?> |
|
| 326 | 326 | <section class="tckt-slctr-tkt-uses-sctn"> |
| 327 | - <h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading', __( 'Event Date Ticket Uses', 'event_espresso' )); ?></h5> |
|
| 327 | + <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading', __('Event Date Ticket Uses', 'event_espresso')); ?></h5> |
|
| 328 | 328 | <span class="drk-grey-text small-text no-bold"> - <?php |
| 329 | 329 | echo apply_filters( |
| 330 | 330 | 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_message', |
| 331 | 331 | sprintf( |
| 332 | - __( 'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s', 'event_espresso' ), |
|
| 332 | + __('The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s', 'event_espresso'), |
|
| 333 | 333 | '<br/>', |
| 334 | 334 | '<strong>', |
| 335 | 335 | '</strong>' |
| 336 | 336 | ) |
| 337 | 337 | ); |
| 338 | 338 | ?></span><br/> |
| 339 | - <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes', __( '# Datetimes:', 'event_espresso' )); ?></span><?php echo $ticket->uses();?><br/> |
|
| 339 | + <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes', __('# Datetimes:', 'event_espresso')); ?></span><?php echo $ticket->uses(); ?><br/> |
|
| 340 | 340 | </section> |
| 341 | 341 | <?php } ?> |
| 342 | 342 | |
| 343 | 343 | <?php |
| 344 | - $datetimes = $ticket->datetimes_ordered( $event_is_expired, FALSE ); |
|
| 344 | + $datetimes = $ticket->datetimes_ordered($event_is_expired, FALSE); |
|
| 345 | 345 | $chart_column_width = $template_settings->show_ticket_sale_columns ? '12.5%' : '50%'; |
| 346 | - if ( ! empty( $datetimes )) { ?> |
|
| 346 | + if ( ! empty($datetimes)) { ?> |
|
| 347 | 347 | <section class="tckt-slctr-tkt-datetimes-sctn"> |
| 348 | - <h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading', __( 'Event Access', 'event_espresso' )); ?></h5> |
|
| 349 | - <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_message', __( 'This ticket allows access to the following event dates and times.', 'event_espresso' )); ?></span> |
|
| 348 | + <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_heading', __('Event Access', 'event_espresso')); ?></h5> |
|
| 349 | + <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_message', __('This ticket allows access to the following event dates and times.', 'event_espresso')); ?></span> |
|
| 350 | 350 | <div class="tckt-slctr-tkt-details-tbl-wrap-dv"> |
| 351 | 351 | <table class="tckt-slctr-tkt-details-tbl"> |
| 352 | 352 | <thead> |
| 353 | 353 | <tr> |
| 354 | 354 | <th valign="middle"> |
| 355 | - <span class="dashicons dashicons-calendar"></span><span class="small-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', __( 'Event Date ', 'event_espresso' )); ?></span> |
|
| 355 | + <span class="dashicons dashicons-calendar"></span><span class="small-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', __('Event Date ', 'event_espresso')); ?></span> |
|
| 356 | 356 | </th> |
| 357 | 357 | <th width="<?php echo $chart_column_width; ?>" valign="middle" class=""> |
| 358 | - <span class="dashicons dashicons-clock"></span><span class="small-text"><?php _e( 'Time ', 'event_espresso' ); ?></span> |
|
| 358 | + <span class="dashicons dashicons-clock"></span><span class="small-text"><?php _e('Time ', 'event_espresso'); ?></span> |
|
| 359 | 359 | </th> |
| 360 | - <?php if ( $template_settings->show_ticket_sale_columns ) : ?> |
|
| 360 | + <?php if ($template_settings->show_ticket_sale_columns) : ?> |
|
| 361 | 361 | <th width="12.5%" valign="middle" class="cntr"> |
| 362 | - <span class="smaller-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', sprintf( __( 'This Ticket%sSold', 'event_espresso' ), '<br/>' )); ?></span> |
|
| 362 | + <span class="smaller-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', sprintf(__('This Ticket%sSold', 'event_espresso'), '<br/>')); ?></span> |
|
| 363 | 363 | </th> |
| 364 | 364 | <th width="12.5%" valign="middle" class="cntr"> |
| 365 | - <span class="smaller-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', sprintf( __( 'This Ticket%sLeft', 'event_espresso' ), '<br/>' )); ?></span> |
|
| 365 | + <span class="smaller-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', sprintf(__('This Ticket%sLeft', 'event_espresso'), '<br/>')); ?></span> |
|
| 366 | 366 | </th> |
| 367 | 367 | <th width="12.5%" valign="middle" class="cntr"> |
| 368 | - <span class="smaller-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', sprintf( __( 'Total Tickets%sSold', 'event_espresso' ), '<br/>' )); ?></span> |
|
| 368 | + <span class="smaller-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', sprintf(__('Total Tickets%sSold', 'event_espresso'), '<br/>')); ?></span> |
|
| 369 | 369 | </th> |
| 370 | 370 | <th width="12.5%" valign="middle" class="cntr"> |
| 371 | - <span class="smaller-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', sprintf( __( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' )); ?></span> |
|
| 371 | + <span class="smaller-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', sprintf(__('Total Spaces%sLeft', 'event_espresso'), '<br/>')); ?></span> |
|
| 372 | 372 | </th> |
| 373 | 373 | <?php endif; //end $template_settings->show_ticket_sale_columns conditional ?> |
| 374 | 374 | </tr> |
| 375 | 375 | </thead> |
| 376 | 376 | <tbody> |
| 377 | 377 | <?php |
| 378 | - foreach ( $datetimes as $datetime ) { |
|
| 379 | - if ( $datetime instanceof EE_Datetime ) { |
|
| 378 | + foreach ($datetimes as $datetime) { |
|
| 379 | + if ($datetime instanceof EE_Datetime) { |
|
| 380 | 380 | ?> |
| 381 | 381 | |
| 382 | 382 | <tr> |
| 383 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', __( 'Event Date ', 'event_espresso' )); ?>" class="small-text"> |
|
| 383 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', __('Event Date ', 'event_espresso')); ?>" class="small-text"> |
|
| 384 | 384 | <?php $datetime_name = $datetime->name(); ?> |
| 385 | - <?php echo ! empty( $datetime_name ) ? '<b>' . $datetime_name . '</b><br/>' : ''; ?> |
|
| 386 | - <?php echo $datetime->date_range( $date_format, __( ' to ', 'event_espresso' )); ?> |
|
| 385 | + <?php echo ! empty($datetime_name) ? '<b>'.$datetime_name.'</b><br/>' : ''; ?> |
|
| 386 | + <?php echo $datetime->date_range($date_format, __(' to ', 'event_espresso')); ?> |
|
| 387 | 387 | </td> |
| 388 | - <td data-th="<?php _e( 'Time ', 'event_espresso' ); ?>" class="cntr small-text"> |
|
| 389 | - <?php echo $datetime->time_range( $time_format, __( ' to ', 'event_espresso' )); ?> |
|
| 388 | + <td data-th="<?php _e('Time ', 'event_espresso'); ?>" class="cntr small-text"> |
|
| 389 | + <?php echo $datetime->time_range($time_format, __(' to ', 'event_espresso')); ?> |
|
| 390 | 390 | </td> |
| 391 | - <?php if ( $template_settings->show_ticket_sale_columns ) : ?> |
|
| 392 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', __( 'This Ticket Sold', 'event_espresso' )); ?>" class="cntr small-text"> |
|
| 391 | + <?php if ($template_settings->show_ticket_sale_columns) : ?> |
|
| 392 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', __('This Ticket Sold', 'event_espresso')); ?>" class="cntr small-text"> |
|
| 393 | 393 | <?php echo $ticket->sold(); ?> |
| 394 | 394 | </td> |
| 395 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', __( 'This Ticket Left', 'event_espresso' )); ?>" class="cntr small-text"> |
|
| 396 | - <?php echo $ticket->qty() === INF ? '<span class="smaller-text">' . __( 'unlimited ', 'event_espresso' ) . '</span>' : $ticket->qty() - $ticket->sold(); ?> |
|
| 395 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', __('This Ticket Left', 'event_espresso')); ?>" class="cntr small-text"> |
|
| 396 | + <?php echo $ticket->qty() === INF ? '<span class="smaller-text">'.__('unlimited ', 'event_espresso').'</span>' : $ticket->qty() - $ticket->sold(); ?> |
|
| 397 | 397 | </td> |
| 398 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', __( 'Total Tickets Sold', 'event_espresso' )); ?>" class="cntr small-text"> |
|
| 398 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', __('Total Tickets Sold', 'event_espresso')); ?>" class="cntr small-text"> |
|
| 399 | 399 | <?php echo $datetime->sold(); ?> |
| 400 | 400 | </td> |
| 401 | - <?php $tkts_left = $datetime->sold_out() ? '<span class="sold-out smaller-text">' . __( 'Sold Out', 'event_espresso' ) . '</span>' : $datetime->spaces_remaining(); ?> |
|
| 402 | - <td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', __( 'Total Spaces Left', 'event_espresso' )); ?>" class="cntr small-text"> |
|
| 403 | - <?php echo $tkts_left === INF ? '<span class="smaller-text">' . __( 'unlimited ', 'event_espresso' ) . '</span>' : $tkts_left; ?> |
|
| 401 | + <?php $tkts_left = $datetime->sold_out() ? '<span class="sold-out smaller-text">'.__('Sold Out', 'event_espresso').'</span>' : $datetime->spaces_remaining(); ?> |
|
| 402 | + <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', __('Total Spaces Left', 'event_espresso')); ?>" class="cntr small-text"> |
|
| 403 | + <?php echo $tkts_left === INF ? '<span class="smaller-text">'.__('unlimited ', 'event_espresso').'</span>' : $tkts_left; ?> |
|
| 404 | 404 | </td> |
| 405 | 405 | <?php endif; //end $template_settings->show_ticket_sale_columns conditional ?> |
| 406 | 406 | </tr> |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | </div> |
| 419 | 419 | </td> |
| 420 | 420 | </tr> |
| 421 | - <?php endif; //end template_settings->show_ticket_details check?> |
|
| 421 | + <?php endif; //end template_settings->show_ticket_details check?> |
|
| 422 | 422 | <?php |
| 423 | 423 | $row++; |
| 424 | 424 | } |
@@ -434,10 +434,10 @@ discard block |
||
| 434 | 434 | <input type="hidden" name="tkt-slctr-max-atndz-<?php echo $EVT_ID; ?>" value="<?php echo $max_atndz; ?>" /> |
| 435 | 435 | <input type="hidden" name="tkt-slctr-event-id" value="<?php echo $EVT_ID; ?>" /> |
| 436 | 436 | |
| 437 | -<?php if ( $max_atndz > 0 ) { ?> |
|
| 438 | - <p class="smaller-text lt-grey-text">* <?php echo apply_filters( 'FHEE__ticket_selector_chart_template__maximum_tickets_purchased_footnote', sprintf( __( 'Please note that a maximum number of %d tickets can be purchased for this event per order.', 'event_espresso' ), $max_atndz ));?></p> |
|
| 437 | +<?php if ($max_atndz > 0) { ?> |
|
| 438 | + <p class="smaller-text lt-grey-text">* <?php echo apply_filters('FHEE__ticket_selector_chart_template__maximum_tickets_purchased_footnote', sprintf(__('Please note that a maximum number of %d tickets can be purchased for this event per order.', 'event_espresso'), $max_atndz)); ?></p> |
|
| 439 | 439 | <?php } ?> |
| 440 | 440 | |
| 441 | - <?php do_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID ); ?> |
|
| 441 | + <?php do_action('AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID); ?> |
|
| 442 | 442 | |
| 443 | 443 | </div> |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 4 | 4 | exit('No direct script access allowed'); |
| 5 | 5 | |
| 6 | 6 | /** |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * |
| 26 | 26 | * ------------------------------------------------------------------------ |
| 27 | 27 | */ |
| 28 | -class EE_PMT_Invoice extends EE_PMT_Base{ |
|
| 28 | +class EE_PMT_Invoice extends EE_PMT_Base { |
|
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | public function __construct($pm_instance = NULL) { |
| 38 | 38 | $this->_pretty_name = __("Invoice", 'event_espresso'); |
| 39 | - $this->_default_description = __( 'After clicking "Finalize Registration", you will be given instructions on how to access your invoice and complete your payment.', 'event_espresso' ); |
|
| 39 | + $this->_default_description = __('After clicking "Finalize Registration", you will be given instructions on how to access your invoice and complete your payment.', 'event_espresso'); |
|
| 40 | 40 | parent::__construct($pm_instance); |
| 41 | 41 | $this->_default_button_url = $this->file_url().'lib'.DS.'invoice-logo.png'; |
| 42 | 42 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * @param \EE_Transaction $transaction |
| 49 | 49 | * @return NULL |
| 50 | 50 | */ |
| 51 | - public function generate_new_billing_form( EE_Transaction $transaction = NULL ) { |
|
| 51 | + public function generate_new_billing_form(EE_Transaction $transaction = NULL) { |
|
| 52 | 52 | return NULL; |
| 53 | 53 | } |
| 54 | 54 | |
@@ -61,49 +61,49 @@ discard block |
||
| 61 | 61 | public function generate_new_settings_form() { |
| 62 | 62 | $pdf_payee_input_name = 'pdf_payee_name'; |
| 63 | 63 | $confirmation_text_input_name = 'page_confirmation_text'; |
| 64 | - $form = new EE_Payment_Method_Form(array( |
|
| 64 | + $form = new EE_Payment_Method_Form(array( |
|
| 65 | 65 | // 'payment_method_type' => $this, |
| 66 | 66 | 'extra_meta_inputs'=>array( |
| 67 | 67 | $pdf_payee_input_name => new EE_Text_Input(array( |
| 68 | - 'html_label_text' => sprintf( __( 'Payee Name %s', 'event_espresso' ), $this->get_help_tab_link()) |
|
| 68 | + 'html_label_text' => sprintf(__('Payee Name %s', 'event_espresso'), $this->get_help_tab_link()) |
|
| 69 | 69 | )), |
| 70 | 70 | 'pdf_payee_email' => new EE_Text_Input(array( |
| 71 | - 'html_label_text' => sprintf( __( 'Payee Email %s', 'event_espresso' ), $this->get_help_tab_link()), |
|
| 71 | + 'html_label_text' => sprintf(__('Payee Email %s', 'event_espresso'), $this->get_help_tab_link()), |
|
| 72 | 72 | )), |
| 73 | 73 | 'pdf_payee_tax_number' => new EE_Text_Input(array( |
| 74 | - 'html_label_text' => sprintf( __( 'Payee Tax Number %s', 'event_espresso' ), $this->get_help_tab_link()), |
|
| 74 | + 'html_label_text' => sprintf(__('Payee Tax Number %s', 'event_espresso'), $this->get_help_tab_link()), |
|
| 75 | 75 | )), |
| 76 | 76 | 'pdf_payee_address' => new EE_Text_Area_Input(array( |
| 77 | - 'html_label_text' => sprintf( __( 'Payee Address %s', 'event_espresso' ), $this->get_help_tab_link()), |
|
| 77 | + 'html_label_text' => sprintf(__('Payee Address %s', 'event_espresso'), $this->get_help_tab_link()), |
|
| 78 | 78 | )), |
| 79 | 79 | 'pdf_instructions'=>new EE_Text_Area_Input(array( |
| 80 | - 'html_label_text'=> sprintf(__("Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 80 | + 'html_label_text'=> sprintf(__("Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 81 | 81 | 'default'=> __("Please send this invoice with payment attached to the address above, or use the payment link below. Payment must be received within 48 hours of event date.", 'event_espresso') |
| 82 | 82 | )), |
| 83 | 83 | 'pdf_logo_image'=>new EE_Admin_File_Uploader_Input(array( |
| 84 | - 'html_label_text'=> sprintf(__("Logo Image %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 84 | + 'html_label_text'=> sprintf(__("Logo Image %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 85 | 85 | 'default'=> EE_Config::instance()->organization->logo_url, |
| 86 | 86 | 'html_help_text'=> __("(Logo for the top left of the invoice)", 'event_espresso'), |
| 87 | 87 | )), |
| 88 | 88 | $confirmation_text_input_name =>new EE_Text_Area_Input(array( |
| 89 | - 'html_label_text'=> sprintf(__("Confirmation Text %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 89 | + 'html_label_text'=> sprintf(__("Confirmation Text %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 90 | 90 | 'default'=> __("Payment must be received within 48 hours of event date. Details about where to send payment is included on the invoice.", 'event_espresso') |
| 91 | 91 | )), |
| 92 | 92 | 'page_extra_info'=>new EE_Text_Area_Input(array( |
| 93 | - 'html_label_text'=> sprintf(__("Extra Info %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 93 | + 'html_label_text'=> sprintf(__("Extra Info %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 94 | 94 | )), |
| 95 | 95 | ), |
| 96 | 96 | 'include'=>array( |
| 97 | - 'PMD_ID', 'PMD_name','PMD_desc','PMD_admin_name','PMD_admin_desc', 'PMD_type','PMD_slug', 'PMD_open_by_default','PMD_button_url','PMD_scope','Currency', |
|
| 98 | - $pdf_payee_input_name, 'pdf_payee_email', 'pdf_payee_tax_number', 'pdf_payee_address', 'pdf_instructions','pdf_logo_image', |
|
| 97 | + 'PMD_ID', 'PMD_name', 'PMD_desc', 'PMD_admin_name', 'PMD_admin_desc', 'PMD_type', 'PMD_slug', 'PMD_open_by_default', 'PMD_button_url', 'PMD_scope', 'Currency', |
|
| 98 | + $pdf_payee_input_name, 'pdf_payee_email', 'pdf_payee_tax_number', 'pdf_payee_address', 'pdf_instructions', 'pdf_logo_image', |
|
| 99 | 99 | $confirmation_text_input_name, 'page_extra_info'), |
| 100 | 100 | )); |
| 101 | 101 | $form->add_subsections( |
| 102 | - array( 'header1' => new EE_Form_Section_HTML_From_Template( 'payment_methods/Invoice/templates/invoice_settings_header_display.template.php' )), |
|
| 102 | + array('header1' => new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_display.template.php')), |
|
| 103 | 103 | $pdf_payee_input_name |
| 104 | 104 | ); |
| 105 | 105 | $form->add_subsections( |
| 106 | - array( 'header2'=>new EE_Form_Section_HTML_From_Template( 'payment_methods/Invoice/templates/invoice_settings_header_gateway.template.php' )), |
|
| 106 | + array('header2'=>new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_gateway.template.php')), |
|
| 107 | 107 | $confirmation_text_input_name |
| 108 | 108 | ); |
| 109 | 109 | return $form; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * @see EE_PMT_Base::help_tabs_config() |
| 117 | 117 | * @return array |
| 118 | 118 | */ |
| 119 | - public function help_tabs_config(){ |
|
| 119 | + public function help_tabs_config() { |
|
| 120 | 120 | return array( |
| 121 | 121 | $this->get_help_tab_name() => array( |
| 122 | 122 | 'title' => __('Invoice Settings', 'event_espresso'), |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * @param \EE_Payment $payment |
| 135 | 135 | * @return string |
| 136 | 136 | */ |
| 137 | - public function payment_overview_content( EE_Payment $payment ){ |
|
| 137 | + public function payment_overview_content(EE_Payment $payment) { |
|
| 138 | 138 | EE_Registry::instance()->load_helper('Template'); |
| 139 | 139 | return EEH_Template::display_template( |
| 140 | 140 | $this->_file_folder.'templates'.DS.'invoice_payment_details_content.template.php', |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | 'payment' => $payment, |
| 145 | 145 | 'page_confirmation_text' => '', |
| 146 | 146 | 'page_extra_info' => '', |
| 147 | - 'invoice_url' => $payment->transaction()->primary_registration()->invoice_url( 'html' ) |
|
| 147 | + 'invoice_url' => $payment->transaction()->primary_registration()->invoice_url('html') |
|
| 148 | 148 | ), |
| 149 | 149 | $this->_pm_instance->all_extra_meta_array() |
| 150 | 150 | ), |
@@ -1,7 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
| 4 | 4 | exit('No direct script access allowed'); |
| 5 | +} |
|
| 5 | 6 | |
| 6 | 7 | /** |
| 7 | 8 | * Event Espresso |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * @return EEG_Paypal_Standard |
| 64 | 64 | */ |
| 65 | 65 | public function __construct() { |
| 66 | - $this->set_uses_separate_IPN_request( true ) ; |
|
| 66 | + $this->set_uses_separate_IPN_request(true); |
|
| 67 | 67 | parent::__construct(); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -73,11 +73,11 @@ discard block |
||
| 73 | 73 | * Also sets the gateway url class variable based on whether debug mode is enabled or not |
| 74 | 74 | * @param array $settings_array |
| 75 | 75 | */ |
| 76 | - public function set_settings($settings_array){ |
|
| 76 | + public function set_settings($settings_array) { |
|
| 77 | 77 | parent::set_settings($settings_array); |
| 78 | - if($this->_debug_mode){ |
|
| 78 | + if ($this->_debug_mode) { |
|
| 79 | 79 | $this->_gateway_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; |
| 80 | - }else{ |
|
| 80 | + } else { |
|
| 81 | 81 | $this->_gateway_url = 'https://www.paypal.com/cgi-bin/webscr'; |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -92,47 +92,47 @@ discard block |
||
| 92 | 92 | * @param string $cancel_url URL to send the user to after a cancelled payment attempt on teh payment provider's website |
| 93 | 93 | * @return EEI_Payment |
| 94 | 94 | */ |
| 95 | - public function set_redirection_info( $payment, $billing_info = array(), $return_url = NULL, $notify_url = NULL, $cancel_url = NULL ){ |
|
| 95 | + public function set_redirection_info($payment, $billing_info = array(), $return_url = NULL, $notify_url = NULL, $cancel_url = NULL) { |
|
| 96 | 96 | $redirect_args = array(); |
| 97 | 97 | $transaction = $payment->transaction(); |
| 98 | 98 | $primary_registrant = $transaction->primary_registration(); |
| 99 | 99 | $item_num = 1; |
| 100 | 100 | $total_line_item = $transaction->total_line_item(); |
| 101 | - if( $this->_can_easily_itemize_transaction_for( $payment ) ){ |
|
| 101 | + if ($this->_can_easily_itemize_transaction_for($payment)) { |
|
| 102 | 102 | //this payment is for the entire transaction, |
| 103 | 103 | //so let's show all the line items |
| 104 | - foreach($total_line_item->get_items() as $line_item){ |
|
| 105 | - if ( $line_item instanceof EE_Line_Item ) { |
|
| 104 | + foreach ($total_line_item->get_items() as $line_item) { |
|
| 105 | + if ($line_item instanceof EE_Line_Item) { |
|
| 106 | 106 | //if this is a re-attempt at paying, don't re-add PayPal's shipping |
| 107 | - if ( $line_item->code() == 'paypal_shipping' ) { |
|
| 107 | + if ($line_item->code() == 'paypal_shipping') { |
|
| 108 | 108 | continue; |
| 109 | 109 | } |
| 110 | - $redirect_args[ 'item_name_' . $item_num ] = substr( |
|
| 111 | - sprintf( __( '%1$s for %2$s', 'event_espresso' ), $line_item->name(), $line_item->ticket_event_name() ), 0, 127 ); |
|
| 112 | - $redirect_args[ 'amount_' . $item_num ] = $line_item->unit_price(); |
|
| 113 | - $redirect_args[ 'quantity_' . $item_num ] = $line_item->quantity(); |
|
| 114 | - if ( ! $line_item->is_taxable() ) { |
|
| 115 | - $redirect_args[ 'tax_' . $item_num ] = 0; |
|
| 110 | + $redirect_args['item_name_'.$item_num] = substr( |
|
| 111 | + sprintf(__('%1$s for %2$s', 'event_espresso'), $line_item->name(), $line_item->ticket_event_name()), 0, 127 ); |
|
| 112 | + $redirect_args['amount_'.$item_num] = $line_item->unit_price(); |
|
| 113 | + $redirect_args['quantity_'.$item_num] = $line_item->quantity(); |
|
| 114 | + if ( ! $line_item->is_taxable()) { |
|
| 115 | + $redirect_args['tax_'.$item_num] = 0; |
|
| 116 | 116 | } |
| 117 | 117 | //if we're not letting PayPal calculate shipping, tell them its 0 |
| 118 | - if ( ! $this->_paypal_shipping ) { |
|
| 119 | - $redirect_args[ 'shipping_' . $item_num ] = '0'; |
|
| 120 | - $redirect_args[ 'shipping2_' . $item_num ] = '0'; |
|
| 118 | + if ( ! $this->_paypal_shipping) { |
|
| 119 | + $redirect_args['shipping_'.$item_num] = '0'; |
|
| 120 | + $redirect_args['shipping2_'.$item_num] = '0'; |
|
| 121 | 121 | } |
| 122 | 122 | $item_num++; |
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | //add our taxes to the order if we're NOT using PayPal's |
| 126 | - if( ! $this->_paypal_taxes ){ |
|
| 126 | + if ( ! $this->_paypal_taxes) { |
|
| 127 | 127 | $redirect_args['tax_cart'] = $total_line_item->get_total_tax(); |
| 128 | 128 | } |
| 129 | - }else{ |
|
| 129 | + } else { |
|
| 130 | 130 | //this is a partial payment, so we can't really show all the line items |
| 131 | - $redirect_args['item_name_' . $item_num] = substr( sprintf(__('Payment of %1$s for %2$s', "event_espresso"),$payment->amount(), $primary_registrant->reg_code()), 0, 127 ); |
|
| 132 | - $redirect_args['amount_' . $item_num] = $payment->amount(); |
|
| 131 | + $redirect_args['item_name_'.$item_num] = substr(sprintf(__('Payment of %1$s for %2$s', "event_espresso"), $payment->amount(), $primary_registrant->reg_code()), 0, 127); |
|
| 132 | + $redirect_args['amount_'.$item_num] = $payment->amount(); |
|
| 133 | 133 | //if we aren't allowing PayPal to calculate shipping, set it to 0 |
| 134 | - $redirect_args['shipping_' . $item_num ] = '0'; |
|
| 135 | - $redirect_args['shipping2_' . $item_num ] = '0'; |
|
| 134 | + $redirect_args['shipping_'.$item_num] = '0'; |
|
| 135 | + $redirect_args['shipping2_'.$item_num] = '0'; |
|
| 136 | 136 | //PayPal can't calculate taxes because we don't know what parts of it are taxable |
| 137 | 137 | $redirect_args['tax_cart'] = '0'; |
| 138 | 138 | |
@@ -141,16 +141,16 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | |
| 143 | 143 | } |
| 144 | - if($this->_debug_mode){ |
|
| 145 | - $redirect_args['item_name_' . $item_num] = 'DEBUG INFO (this item only added in sandbox mode'; |
|
| 146 | - $redirect_args['amount_' . $item_num] = 0; |
|
| 144 | + if ($this->_debug_mode) { |
|
| 145 | + $redirect_args['item_name_'.$item_num] = 'DEBUG INFO (this item only added in sandbox mode'; |
|
| 146 | + $redirect_args['amount_'.$item_num] = 0; |
|
| 147 | 147 | $redirect_args['on0_'.$item_num] = 'NOTIFY URL'; |
| 148 | - $redirect_args['os0_' . $item_num] = $notify_url; |
|
| 148 | + $redirect_args['os0_'.$item_num] = $notify_url; |
|
| 149 | 149 | $redirect_args['on1_'.$item_num] = 'RETURN URL'; |
| 150 | - $redirect_args['os1_' . $item_num] = $return_url; |
|
| 150 | + $redirect_args['os1_'.$item_num] = $return_url; |
|
| 151 | 151 | // $redirect_args['option_index_' . $item_num] = 1; // <-- dunno if this is needed ? |
| 152 | - $redirect_args['shipping_' . $item_num ] = '0'; |
|
| 153 | - $redirect_args['shipping2_' . $item_num ] = '0'; |
|
| 152 | + $redirect_args['shipping_'.$item_num] = '0'; |
|
| 153 | + $redirect_args['shipping2_'.$item_num] = '0'; |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | $redirect_args['business'] = $this->_paypal_id; |
@@ -160,14 +160,14 @@ discard block |
||
| 160 | 160 | $redirect_args['cmd'] = '_cart'; |
| 161 | 161 | $redirect_args['upload'] = 1; |
| 162 | 162 | $redirect_args['currency_code'] = $payment->currency_code(); |
| 163 | - $redirect_args['rm'] = 2;//makes the user return with method=POST |
|
| 164 | - if($this->_image_url){ |
|
| 163 | + $redirect_args['rm'] = 2; //makes the user return with method=POST |
|
| 164 | + if ($this->_image_url) { |
|
| 165 | 165 | $redirect_args['image_url'] = $this->_image_url; |
| 166 | 166 | } |
| 167 | 167 | $redirect_args['no_shipping'] = $this->_shipping_details; |
| 168 | - $redirect_args['bn'] = 'EventEspresso_SP';//EE will blow up if you change this |
|
| 168 | + $redirect_args['bn'] = 'EventEspresso_SP'; //EE will blow up if you change this |
|
| 169 | 169 | |
| 170 | - $redirect_args = apply_filters( "FHEE__EEG_Paypal_Standard__set_redirection_info__arguments", $redirect_args ); |
|
| 170 | + $redirect_args = apply_filters("FHEE__EEG_Paypal_Standard__set_redirection_info__arguments", $redirect_args); |
|
| 171 | 171 | |
| 172 | 172 | $payment->set_redirect_url($this->_gateway_url); |
| 173 | 173 | $payment->set_redirect_args($redirect_args); |
@@ -185,74 +185,74 @@ discard block |
||
| 185 | 185 | * @return \EEI_Payment updated |
| 186 | 186 | * @throws \EE_Error |
| 187 | 187 | */ |
| 188 | - public function handle_payment_update( $update_info, $transaction ){ |
|
| 188 | + public function handle_payment_update($update_info, $transaction) { |
|
| 189 | 189 | //verify there's payment data that's been sent |
| 190 | - if(empty($update_info['payment_status']) || empty($update_info['txn_id'])){ |
|
| 190 | + if (empty($update_info['payment_status']) || empty($update_info['txn_id'])) { |
|
| 191 | 191 | //waaaait... is this a PDT request? (see https://developer.paypal.com/docs/classic/products/payment-data-transfer/) |
| 192 | 192 | //indicated by the "tx" argument? If so, we don't need it. We'll just use the IPN data when it comes |
| 193 | - if( isset( $update_info[ 'tx' ] ) ){ |
|
| 193 | + if (isset($update_info['tx'])) { |
|
| 194 | 194 | return $transaction->last_payment(); |
| 195 | - }else{ |
|
| 195 | + } else { |
|
| 196 | 196 | return NULL; |
| 197 | 197 | } |
| 198 | 198 | } |
| 199 | - $payment = $this->_pay_model->get_payment_by_txn_id_chq_nmbr($update_info['txn_id']); |
|
| 200 | - if ( ! $payment ){ |
|
| 199 | + $payment = $this->_pay_model->get_payment_by_txn_id_chq_nmbr($update_info['txn_id']); |
|
| 200 | + if ( ! $payment) { |
|
| 201 | 201 | $payment = $transaction->last_payment(); |
| 202 | 202 | } |
| 203 | 203 | //ok, then validate the IPN. Even if we've already processed this payment, let PayPal know we don't want to hear from them anymore! |
| 204 | - if( ! $this->validate_ipn($update_info,$payment)){ |
|
| 204 | + if ( ! $this->validate_ipn($update_info, $payment)) { |
|
| 205 | 205 | return $payment; |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | |
| 209 | 209 | //ok, well let's process this payment then! |
| 210 | - if($update_info['payment_status']=='Completed'){ //the old code considered 'Pending' as completed too.. |
|
| 211 | - $status = $this->_pay_model->approved_status();//approved |
|
| 210 | + if ($update_info['payment_status'] == 'Completed') { //the old code considered 'Pending' as completed too.. |
|
| 211 | + $status = $this->_pay_model->approved_status(); //approved |
|
| 212 | 212 | $gateway_response = __('Your payment is approved.', 'event_espresso'); |
| 213 | - }elseif($update_info['payment_status']=='Pending'){ |
|
| 214 | - $status = $this->_pay_model->pending_status();//approved |
|
| 213 | + }elseif ($update_info['payment_status'] == 'Pending') { |
|
| 214 | + $status = $this->_pay_model->pending_status(); //approved |
|
| 215 | 215 | $gateway_response = __('Your payment is in progress. Another message will be sent when payment is approved.', 'event_espresso'); |
| 216 | - }elseif( in_array( $update_info['payment_status'], array( 'Partially_Refunded', 'Refunded', 'Reversed', 'Voided' ) ) ){ |
|
| 216 | + }elseif (in_array($update_info['payment_status'], array('Partially_Refunded', 'Refunded', 'Reversed', 'Voided'))) { |
|
| 217 | 217 | //we don't handle refunds yet. |
| 218 | 218 | //throw an exception so unit tests can work on this |
| 219 | 219 | $this->log( |
| 220 | 220 | array( |
| 221 | - 'url' => isset( $_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"] ) ? ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] : 'unknown', |
|
| 222 | - 'message' => sprintf( __( 'Refund IPN sent and ignored. We do not yet support automatic refunds. You will want to manually cancel the payment and possible change the registrations\' statuses.', 'event_espresso' )), |
|
| 221 | + 'url' => isset($_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"]) ? (is_ssl() ? 'https://' : 'http://').$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] : 'unknown', |
|
| 222 | + 'message' => sprintf(__('Refund IPN sent and ignored. We do not yet support automatic refunds. You will want to manually cancel the payment and possible change the registrations\' statuses.', 'event_espresso')), |
|
| 223 | 223 | 'payment' => $payment->model_field_array(), |
| 224 | 224 | 'IPN_data' => $update_info |
| 225 | 225 | ), |
| 226 | 226 | $payment |
| 227 | 227 | ); |
| 228 | - throw new EE_Error( sprintf( __( '%s IPNs are not yet supported by Event Espresso Paypal Standard integration', 'event_espresso' ), $update_info['payment_status'] ) ); |
|
| 228 | + throw new EE_Error(sprintf(__('%s IPNs are not yet supported by Event Espresso Paypal Standard integration', 'event_espresso'), $update_info['payment_status'])); |
|
| 229 | 229 | |
| 230 | - }else{ |
|
| 230 | + } else { |
|
| 231 | 231 | //it must be 'Denied', 'Canceled_Reversal', 'Expired', or 'Failed' |
| 232 | - $status = $this->_pay_model->declined_status();//declined |
|
| 232 | + $status = $this->_pay_model->declined_status(); //declined |
|
| 233 | 233 | $gateway_response = __('Your payment has been declined.', 'event_espresso'); |
| 234 | 234 | } |
| 235 | 235 | //check if we've already processed this payment |
| 236 | - if( ! empty($payment)){ |
|
| 236 | + if ( ! empty($payment)) { |
|
| 237 | 237 | //payment exists. if this has the exact same status and amount, don't bother updating. just return |
| 238 | - if($payment->status() == $status && $payment->amount() == $update_info['mc_gross']){ |
|
| 238 | + if ($payment->status() == $status && $payment->amount() == $update_info['mc_gross']) { |
|
| 239 | 239 | //echo "duplicated ipn! dont bother updating transaction foo!"; |
| 240 | - $this->log( array( |
|
| 241 | - 'url' => isset( $_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"] ) ? (is_ssl() ? 'https://' : 'http://' ) . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] : 'unknown', |
|
| 242 | - 'message' => sprintf( __( 'It appears we have received a duplicate IPN from PayPal for payment %d', 'event_espresso' ), $payment->ID()), |
|
| 240 | + $this->log(array( |
|
| 241 | + 'url' => isset($_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"]) ? (is_ssl() ? 'https://' : 'http://').$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] : 'unknown', |
|
| 242 | + 'message' => sprintf(__('It appears we have received a duplicate IPN from PayPal for payment %d', 'event_espresso'), $payment->ID()), |
|
| 243 | 243 | 'payment' => $payment->model_field_array(), |
| 244 | 244 | 'IPN data' => $update_info ), |
| 245 | - $payment ); |
|
| 246 | - }else{ |
|
| 245 | + $payment); |
|
| 246 | + } else { |
|
| 247 | 247 | // $this->_debug_log( "<hr>Existing IPN for this PayPal transaction, but it\'s got some new info. Old status:".$payment->STS_ID().", old amount:".$payment->amount()); |
| 248 | 248 | $payment->set_status($status); |
| 249 | - $payment->set_amount( floatval( $update_info[ 'mc_gross' ] ) ); |
|
| 249 | + $payment->set_amount(floatval($update_info['mc_gross'])); |
|
| 250 | 250 | $payment->set_gateway_response($gateway_response); |
| 251 | - $payment->set_details( $update_info ); |
|
| 252 | - $payment->set_txn_id_chq_nmbr( $update_info['txn_id'] ); |
|
| 253 | - $this->log( array( |
|
| 254 | - 'url' => isset( $_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"] ) ? ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] : 'unknown', |
|
| 255 | - 'message' => sprintf( __( 'Updated payment either from IPN or as part of POST from PayPal', 'event_espresso' )), |
|
| 251 | + $payment->set_details($update_info); |
|
| 252 | + $payment->set_txn_id_chq_nmbr($update_info['txn_id']); |
|
| 253 | + $this->log(array( |
|
| 254 | + 'url' => isset($_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"]) ? (is_ssl() ? 'https://' : 'http://').$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] : 'unknown', |
|
| 255 | + 'message' => sprintf(__('Updated payment either from IPN or as part of POST from PayPal', 'event_espresso')), |
|
| 256 | 256 | 'payment' => $payment->model_field_array(), |
| 257 | 257 | 'IPN_data' => $update_info ), |
| 258 | 258 | $payment); |
@@ -270,12 +270,12 @@ discard block |
||
| 270 | 270 | * @param EE_Payment|EEI_Payment $payment |
| 271 | 271 | * @return boolean |
| 272 | 272 | */ |
| 273 | - public function validate_ipn($update_info,$payment) { |
|
| 273 | + public function validate_ipn($update_info, $payment) { |
|
| 274 | 274 | //allow us to skip validating IPNs with PayPal (useful for testing) |
| 275 | - if( apply_filters( 'FHEE__EEG_Paypal_Standard__validate_ipn__skip', FALSE ) ){ |
|
| 275 | + if (apply_filters('FHEE__EEG_Paypal_Standard__validate_ipn__skip', FALSE)) { |
|
| 276 | 276 | return TRUE; |
| 277 | 277 | } |
| 278 | - if( $update_info === $_REQUEST ){ |
|
| 278 | + if ($update_info === $_REQUEST) { |
|
| 279 | 279 | //we're using the $_REQUEST info... except we can't use it because it has issues with quotes |
| 280 | 280 | // Reading POSTed data directly from $_POST causes serialization issues with array data in the POST. |
| 281 | 281 | // Instead, read raw POST data from the input stream. |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | $raw_post_array = explode('&', $raw_post_data); |
| 285 | 285 | $update_info = array(); |
| 286 | 286 | foreach ($raw_post_array as $keyval) { |
| 287 | - $keyval = explode ('=', $keyval); |
|
| 287 | + $keyval = explode('=', $keyval); |
|
| 288 | 288 | if (count($keyval) == 2) |
| 289 | 289 | $update_info[$keyval[0]] = urldecode($keyval[1]); |
| 290 | 290 | } |
@@ -293,9 +293,9 @@ discard block |
||
| 293 | 293 | |
| 294 | 294 | // read the IPN message sent from PayPal and prepend 'cmd=_notify-validate' |
| 295 | 295 | $req = 'cmd=_notify-validate'; |
| 296 | - $get_magic_quotes_exists = function_exists( 'get_magic_quotes_gpc' ) ? true : false; |
|
| 296 | + $get_magic_quotes_exists = function_exists('get_magic_quotes_gpc') ? true : false; |
|
| 297 | 297 | foreach ($update_info as $key => $value) { |
| 298 | - if( $get_magic_quotes_exists && get_magic_quotes_gpc() == 1 ) { |
|
| 298 | + if ($get_magic_quotes_exists && get_magic_quotes_gpc() == 1) { |
|
| 299 | 299 | $value = urlencode(stripslashes($value)); |
| 300 | 300 | } else { |
| 301 | 301 | $value = urlencode($value); |
@@ -304,18 +304,18 @@ discard block |
||
| 304 | 304 | } |
| 305 | 305 | // $update_info_from_post_only = array_diff_key($update_info, $_GET); |
| 306 | 306 | // $response_post_data=$update_info_from_post_only + array('cmd'=>'_notify-validate'); |
| 307 | - $result= wp_remote_post($this->_gateway_url, array('body' => $req, 'sslverify' => false, 'timeout' => 60)); |
|
| 307 | + $result = wp_remote_post($this->_gateway_url, array('body' => $req, 'sslverify' => false, 'timeout' => 60)); |
|
| 308 | 308 | |
| 309 | - if ( ! is_wp_error($result) && array_key_exists('body',$result) && strcmp($result['body'], "VERIFIED") == 0) { |
|
| 309 | + if ( ! is_wp_error($result) && array_key_exists('body', $result) && strcmp($result['body'], "VERIFIED") == 0) { |
|
| 310 | 310 | return true; |
| 311 | - }else{ |
|
| 311 | + } else { |
|
| 312 | 312 | //huh, something's wack... the IPN didn't validate. We must have replied to the IPN incorrectly, |
| 313 | 313 | //or their API must have changed: http://www.paypalobjects.com/en_US/ebook/PP_OrderManagement_IntegrationGuide/ipn.html |
| 314 | - $payment->set_gateway_response(sprintf(__("IPN Validation failed! Paypal responded with '%s'", "event_espresso"),$result['body'])); |
|
| 315 | - $payment->set_details(array('REQUEST'=>$update_info,'VALIDATION_RESPONSE'=>$result)); |
|
| 314 | + $payment->set_gateway_response(sprintf(__("IPN Validation failed! Paypal responded with '%s'", "event_espresso"), $result['body'])); |
|
| 315 | + $payment->set_details(array('REQUEST'=>$update_info, 'VALIDATION_RESPONSE'=>$result)); |
|
| 316 | 316 | $payment->set_status(EEM_Payment::status_id_failed); |
| 317 | - $this->log( array( |
|
| 318 | - 'url' => isset( $_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"] ) ? ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] : 'unknown', |
|
| 317 | + $this->log(array( |
|
| 318 | + 'url' => isset($_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"]) ? (is_ssl() ? 'https://' : 'http://').$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] : 'unknown', |
|
| 319 | 319 | 'message' => $payment->gateway_response(), |
| 320 | 320 | 'details' => $payment->details() ), $payment); |
| 321 | 321 | return false; |
@@ -327,19 +327,19 @@ discard block |
||
| 327 | 327 | * like the taxes or shipping |
| 328 | 328 | * @param EEI_Payment $payment |
| 329 | 329 | */ |
| 330 | - public function update_txn_based_on_payment( $payment ) { |
|
| 330 | + public function update_txn_based_on_payment($payment) { |
|
| 331 | 331 | $update_info = $payment->details(); |
| 332 | 332 | $redirect_args = $payment->redirect_args(); |
| 333 | 333 | $transaction = $payment->transaction(); |
| 334 | - if( ! $transaction ){ |
|
| 335 | - $this->log( __( 'Payment with ID %d has no related transaction, and so update_txn_based_on_payment couldn\'t be executed properly', 'event_espresso' ), $payment ); |
|
| 334 | + if ( ! $transaction) { |
|
| 335 | + $this->log(__('Payment with ID %d has no related transaction, and so update_txn_based_on_payment couldn\'t be executed properly', 'event_espresso'), $payment); |
|
| 336 | 336 | return; |
| 337 | 337 | } |
| 338 | - if( ! is_array( $update_info ) || ! isset( $update_info[ 'mc_shipping' ] ) || ! isset( $update_info[ 'tax' ] ) ) { |
|
| 338 | + if ( ! is_array($update_info) || ! isset($update_info['mc_shipping']) || ! isset($update_info['tax'])) { |
|
| 339 | 339 | $this->log( |
| 340 | 340 | array( |
| 341 | - 'url' => isset( $_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"] ) ? ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] : 'unknown', |
|
| 342 | - 'message' => __( 'Could not update transaction based on payment because the payment details have not yet been put on the payment. This normally happens during the IPN or returning from PayPal', 'event_espresso' ), |
|
| 341 | + 'url' => isset($_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"]) ? (is_ssl() ? 'https://' : 'http://').$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] : 'unknown', |
|
| 342 | + 'message' => __('Could not update transaction based on payment because the payment details have not yet been put on the payment. This normally happens during the IPN or returning from PayPal', 'event_espresso'), |
|
| 343 | 343 | 'payment' => $payment->model_field_array() ), |
| 344 | 344 | $payment ); |
| 345 | 345 | return; |
@@ -353,23 +353,23 @@ discard block |
||
| 353 | 353 | $grand_total_needs_resaving = FALSE; |
| 354 | 354 | |
| 355 | 355 | //might PayPal have added shipping? |
| 356 | - if( $this->_paypal_shipping && floatval( $update_info[ 'mc_shipping' ] ) != 0 ){ |
|
| 357 | - $this->_line_item->add_unrelated_item( $transaction->total_line_item(), __('Shipping', 'event_espresso'), floatval( $update_info[ 'mc_shipping' ] ), __('Shipping charges calculated by Paypal', 'event_espresso'), 1, FALSE, 'paypal_shipping' ); |
|
| 356 | + if ($this->_paypal_shipping && floatval($update_info['mc_shipping']) != 0) { |
|
| 357 | + $this->_line_item->add_unrelated_item($transaction->total_line_item(), __('Shipping', 'event_espresso'), floatval($update_info['mc_shipping']), __('Shipping charges calculated by Paypal', 'event_espresso'), 1, FALSE, 'paypal_shipping'); |
|
| 358 | 358 | $grand_total_needs_resaving = TRUE; |
| 359 | 359 | |
| 360 | 360 | } |
| 361 | 361 | //might PayPal have changed the taxes? |
| 362 | - if( $this->_paypal_taxes && floatval( $update_info[ 'tax' ] ) != $redirect_args[ 'tax_cart' ] ){ |
|
| 363 | - $this->_line_item->set_total_tax_to( $transaction->total_line_item(), floatval( $update_info['tax'] ), __( 'Taxes', 'event_espresso' ), __( 'Calculated by Paypal', 'event_espresso' ) ); |
|
| 362 | + if ($this->_paypal_taxes && floatval($update_info['tax']) != $redirect_args['tax_cart']) { |
|
| 363 | + $this->_line_item->set_total_tax_to($transaction->total_line_item(), floatval($update_info['tax']), __('Taxes', 'event_espresso'), __('Calculated by Paypal', 'event_espresso')); |
|
| 364 | 364 | $grand_total_needs_resaving = TRUE; |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | - if( $grand_total_needs_resaving ){ |
|
| 368 | - $transaction->total_line_item()->save_this_and_descendants_to_txn( $transaction->ID() ); |
|
| 367 | + if ($grand_total_needs_resaving) { |
|
| 368 | + $transaction->total_line_item()->save_this_and_descendants_to_txn($transaction->ID()); |
|
| 369 | 369 | } |
| 370 | - $this->log( array( |
|
| 371 | - 'url' => isset( $_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"] ) ? ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] : 'unknown', |
|
| 372 | - 'message' => __( 'Updated transaction related to payment', 'event_espresso' ), |
|
| 370 | + $this->log(array( |
|
| 371 | + 'url' => isset($_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"]) ? (is_ssl() ? 'https://' : 'http://').$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] : 'unknown', |
|
| 372 | + 'message' => __('Updated transaction related to payment', 'event_espresso'), |
|
| 373 | 373 | 'transaction (updated)' => $transaction->model_field_array(), |
| 374 | 374 | 'payment (updated)' => $payment->model_field_array(), |
| 375 | 375 | 'use_paypal_shipping' => $this->_paypal_shipping, |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | parent::set_settings($settings_array); |
| 78 | 78 | if($this->_debug_mode){ |
| 79 | 79 | $this->_gateway_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; |
| 80 | - }else{ |
|
| 80 | + } else{ |
|
| 81 | 81 | $this->_gateway_url = 'https://www.paypal.com/cgi-bin/webscr'; |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | if( ! $this->_paypal_taxes ){ |
| 127 | 127 | $redirect_args['tax_cart'] = $total_line_item->get_total_tax(); |
| 128 | 128 | } |
| 129 | - }else{ |
|
| 129 | + } else{ |
|
| 130 | 130 | //this is a partial payment, so we can't really show all the line items |
| 131 | 131 | $redirect_args['item_name_' . $item_num] = substr( sprintf(__('Payment of %1$s for %2$s', "event_espresso"),$payment->amount(), $primary_registrant->reg_code()), 0, 127 ); |
| 132 | 132 | $redirect_args['amount_' . $item_num] = $payment->amount(); |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | //indicated by the "tx" argument? If so, we don't need it. We'll just use the IPN data when it comes |
| 193 | 193 | if( isset( $update_info[ 'tx' ] ) ){ |
| 194 | 194 | return $transaction->last_payment(); |
| 195 | - }else{ |
|
| 195 | + } else{ |
|
| 196 | 196 | return NULL; |
| 197 | 197 | } |
| 198 | 198 | } |
@@ -210,10 +210,10 @@ discard block |
||
| 210 | 210 | if($update_info['payment_status']=='Completed'){ //the old code considered 'Pending' as completed too.. |
| 211 | 211 | $status = $this->_pay_model->approved_status();//approved |
| 212 | 212 | $gateway_response = __('Your payment is approved.', 'event_espresso'); |
| 213 | - }elseif($update_info['payment_status']=='Pending'){ |
|
| 213 | + } elseif($update_info['payment_status']=='Pending'){ |
|
| 214 | 214 | $status = $this->_pay_model->pending_status();//approved |
| 215 | 215 | $gateway_response = __('Your payment is in progress. Another message will be sent when payment is approved.', 'event_espresso'); |
| 216 | - }elseif( in_array( $update_info['payment_status'], array( 'Partially_Refunded', 'Refunded', 'Reversed', 'Voided' ) ) ){ |
|
| 216 | + } elseif( in_array( $update_info['payment_status'], array( 'Partially_Refunded', 'Refunded', 'Reversed', 'Voided' ) ) ){ |
|
| 217 | 217 | //we don't handle refunds yet. |
| 218 | 218 | //throw an exception so unit tests can work on this |
| 219 | 219 | $this->log( |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | ); |
| 228 | 228 | throw new EE_Error( sprintf( __( '%s IPNs are not yet supported by Event Espresso Paypal Standard integration', 'event_espresso' ), $update_info['payment_status'] ) ); |
| 229 | 229 | |
| 230 | - }else{ |
|
| 230 | + } else{ |
|
| 231 | 231 | //it must be 'Denied', 'Canceled_Reversal', 'Expired', or 'Failed' |
| 232 | 232 | $status = $this->_pay_model->declined_status();//declined |
| 233 | 233 | $gateway_response = __('Your payment has been declined.', 'event_espresso'); |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | 'payment' => $payment->model_field_array(), |
| 244 | 244 | 'IPN data' => $update_info ), |
| 245 | 245 | $payment ); |
| 246 | - }else{ |
|
| 246 | + } else{ |
|
| 247 | 247 | // $this->_debug_log( "<hr>Existing IPN for this PayPal transaction, but it\'s got some new info. Old status:".$payment->STS_ID().", old amount:".$payment->amount()); |
| 248 | 248 | $payment->set_status($status); |
| 249 | 249 | $payment->set_amount( floatval( $update_info[ 'mc_gross' ] ) ); |
@@ -285,8 +285,9 @@ discard block |
||
| 285 | 285 | $update_info = array(); |
| 286 | 286 | foreach ($raw_post_array as $keyval) { |
| 287 | 287 | $keyval = explode ('=', $keyval); |
| 288 | - if (count($keyval) == 2) |
|
| 289 | - $update_info[$keyval[0]] = urldecode($keyval[1]); |
|
| 288 | + if (count($keyval) == 2) { |
|
| 289 | + $update_info[$keyval[0]] = urldecode($keyval[1]); |
|
| 290 | + } |
|
| 290 | 291 | } |
| 291 | 292 | } |
| 292 | 293 | |
@@ -308,7 +309,7 @@ discard block |
||
| 308 | 309 | |
| 309 | 310 | if ( ! is_wp_error($result) && array_key_exists('body',$result) && strcmp($result['body'], "VERIFIED") == 0) { |
| 310 | 311 | return true; |
| 311 | - }else{ |
|
| 312 | + } else{ |
|
| 312 | 313 | //huh, something's wack... the IPN didn't validate. We must have replied to the IPN incorrectly, |
| 313 | 314 | //or their API must have changed: http://www.paypalobjects.com/en_US/ebook/PP_OrderManagement_IntegrationGuide/ipn.html |
| 314 | 315 | $payment->set_gateway_response(sprintf(__("IPN Validation failed! Paypal responded with '%s'", "event_espresso"),$result['body'])); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * @param WP $WP |
| 52 | 52 | * @return void |
| 53 | 53 | */ |
| 54 | - public function run( WP $WP ) { |
|
| 54 | + public function run(WP $WP) { |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -61,19 +61,19 @@ discard block |
||
| 61 | 61 | * @param array $attributes |
| 62 | 62 | * @return string |
| 63 | 63 | */ |
| 64 | - public function process_shortcode( $attributes = array() ) { |
|
| 65 | - EE_Registry::instance()->load_core( 'Session' ); |
|
| 66 | - $transaction = EE_Registry::instance()->SSN->get_session_data( 'transaction' ); |
|
| 67 | - if ( $transaction instanceof EE_Transaction ) { |
|
| 68 | - do_action( 'AHEE__EES_Espresso_Cancelled__process_shortcode__transaction', $transaction ); |
|
| 64 | + public function process_shortcode($attributes = array()) { |
|
| 65 | + EE_Registry::instance()->load_core('Session'); |
|
| 66 | + $transaction = EE_Registry::instance()->SSN->get_session_data('transaction'); |
|
| 67 | + if ($transaction instanceof EE_Transaction) { |
|
| 68 | + do_action('AHEE__EES_Espresso_Cancelled__process_shortcode__transaction', $transaction); |
|
| 69 | 69 | $registrations = $transaction->registrations(); |
| 70 | - foreach( $registrations as $registration ) { |
|
| 71 | - if ( $registration instanceof EE_Registration ) { |
|
| 72 | - do_action( 'AHEE__EES_Espresso_Cancelled__process_shortcode__registration', $registration ); |
|
| 70 | + foreach ($registrations as $registration) { |
|
| 71 | + if ($registration instanceof EE_Registration) { |
|
| 72 | + do_action('AHEE__EES_Espresso_Cancelled__process_shortcode__registration', $registration); |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | - EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ ); |
|
| 76 | + EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
| 77 | 77 | return EE_Registry::instance()->REQ->get_output(); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -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 | * |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * @return void |
| 92 | 92 | */ |
| 93 | 93 | public static function set_hooks() { |
| 94 | - add_action( 'wp_loaded', array( 'EES_Espresso_Thank_You', 'set_definitions' ), 2 ); |
|
| 94 | + add_action('wp_loaded', array('EES_Espresso_Thank_You', 'set_definitions'), 2); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
@@ -102,10 +102,10 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public static function set_hooks_admin() { |
| 104 | 104 | // AJAX for IPN monitoring |
| 105 | - add_filter( 'heartbeat_received', array( 'EES_Espresso_Thank_You', 'thank_you_page_IPN_monitor' ), 10, 3 ); |
|
| 106 | - add_filter( 'heartbeat_nopriv_received', array( 'EES_Espresso_Thank_You', 'thank_you_page_IPN_monitor' ), 10, 3 ); |
|
| 107 | - add_action( 'wp_ajax_espresso_resend_reg_confirmation_email', array( 'EES_Espresso_Thank_You', 'resend_reg_confirmation_email' ), 10, 2 ); |
|
| 108 | - add_action( 'wp_ajax_nopriv_espresso_resend_reg_confirmation_email', array( 'EES_Espresso_Thank_You', 'resend_reg_confirmation_email' ), 10, 2 ); |
|
| 105 | + add_filter('heartbeat_received', array('EES_Espresso_Thank_You', 'thank_you_page_IPN_monitor'), 10, 3); |
|
| 106 | + add_filter('heartbeat_nopriv_received', array('EES_Espresso_Thank_You', 'thank_you_page_IPN_monitor'), 10, 3); |
|
| 107 | + add_action('wp_ajax_espresso_resend_reg_confirmation_email', array('EES_Espresso_Thank_You', 'resend_reg_confirmation_email'), 10, 2); |
|
| 108 | + add_action('wp_ajax_nopriv_espresso_resend_reg_confirmation_email', array('EES_Espresso_Thank_You', 'resend_reg_confirmation_email'), 10, 2); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | * @return void |
| 118 | 118 | */ |
| 119 | 119 | public static function set_definitions() { |
| 120 | - define( 'THANK_YOU_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
| 121 | - define( 'THANK_YOU_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS ); |
|
| 120 | + define('THANK_YOU_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
| 121 | + define('THANK_YOU_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
@@ -130,23 +130,23 @@ discard block |
||
| 130 | 130 | * @return EE_Transaction |
| 131 | 131 | */ |
| 132 | 132 | public function get_txn() { |
| 133 | - if ( $this->_current_txn instanceof EE_Transaction ) { |
|
| 133 | + if ($this->_current_txn instanceof EE_Transaction) { |
|
| 134 | 134 | return $this->_current_txn; |
| 135 | 135 | } |
| 136 | - $TXN_model = EE_Registry::instance()->load_model( 'Transaction' ); |
|
| 137 | - if ( ! $TXN_model instanceof EEM_Transaction ) { |
|
| 136 | + $TXN_model = EE_Registry::instance()->load_model('Transaction'); |
|
| 137 | + if ( ! $TXN_model instanceof EEM_Transaction) { |
|
| 138 | 138 | EE_Error::add_error( |
| 139 | - __( 'The transaction model could not be established.', 'event_espresso' ), |
|
| 139 | + __('The transaction model could not be established.', 'event_espresso'), |
|
| 140 | 140 | __FILE__, __FUNCTION__, __LINE__ |
| 141 | 141 | ); |
| 142 | 142 | return NULL; |
| 143 | 143 | } |
| 144 | 144 | //get the transaction. yes, we may have just loaded it, but it may have been updated, or this may be via an ajax request |
| 145 | - $this->_current_txn = $TXN_model->get_transaction_from_reg_url_link( $this->_reg_url_link ); |
|
| 145 | + $this->_current_txn = $TXN_model->get_transaction_from_reg_url_link($this->_reg_url_link); |
|
| 146 | 146 | // verify TXN |
| 147 | - if ( ! $this->_current_txn instanceof EE_Transaction ) { |
|
| 147 | + if ( ! $this->_current_txn instanceof EE_Transaction) { |
|
| 148 | 148 | EE_Error::add_error( |
| 149 | - __( 'No transaction information could be retrieved or the transaction data is not of the correct type.', 'event_espresso' ), |
|
| 149 | + __('No transaction information could be retrieved or the transaction data is not of the correct type.', 'event_espresso'), |
|
| 150 | 150 | __FILE__, __FUNCTION__, __LINE__ |
| 151 | 151 | ); |
| 152 | 152 | return NULL; |
@@ -163,16 +163,16 @@ discard block |
||
| 163 | 163 | * @param int $since |
| 164 | 164 | * @return mixed array of EE_Payment || FALSE |
| 165 | 165 | */ |
| 166 | - public function get_txn_payments( $since = 0 ) { |
|
| 167 | - if ( ! $this->get_txn() ) { |
|
| 166 | + public function get_txn_payments($since = 0) { |
|
| 167 | + if ( ! $this->get_txn()) { |
|
| 168 | 168 | return FALSE; |
| 169 | 169 | } |
| 170 | - $args = array( 'order_by' => array( 'PAY_timestamp' => 'ASC' )); |
|
| 171 | - if ( $since > 0 ) { |
|
| 172 | - $args[0] = array( 'PAY_timestamp' => array( '>', $since )); |
|
| 170 | + $args = array('order_by' => array('PAY_timestamp' => 'ASC')); |
|
| 171 | + if ($since > 0) { |
|
| 172 | + $args[0] = array('PAY_timestamp' => array('>', $since)); |
|
| 173 | 173 | } |
| 174 | 174 | // get array of payments with most recent first |
| 175 | - $payments = $this->_current_txn->payments( $args ); |
|
| 175 | + $payments = $this->_current_txn->payments($args); |
|
| 176 | 176 | // global $wpdb; |
| 177 | 177 | // echo $wpdb->last_query; |
| 178 | 178 | // EEH_Debug_Tools::printr( $payments, '$payments <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
@@ -188,19 +188,19 @@ discard block |
||
| 188 | 188 | * @return void |
| 189 | 189 | */ |
| 190 | 190 | private function _get_reg_url_link() { |
| 191 | - if ( ! empty( $this->_reg_url_link )) { |
|
| 191 | + if ( ! empty($this->_reg_url_link)) { |
|
| 192 | 192 | return; |
| 193 | 193 | } |
| 194 | 194 | // only do thank you page stuff if we have a REG_url_link in the url |
| 195 | - if ( ! EE_Registry::instance()->REQ->is_set( 'e_reg_url_link' )) { |
|
| 195 | + if ( ! EE_Registry::instance()->REQ->is_set('e_reg_url_link')) { |
|
| 196 | 196 | EE_Error::add_error( |
| 197 | - __( 'No transaction information could be retrieved because the registration URL link is missing or invalid.', 'event_espresso' ), |
|
| 197 | + __('No transaction information could be retrieved because the registration URL link is missing or invalid.', 'event_espresso'), |
|
| 198 | 198 | __FILE__, __FUNCTION__, __LINE__ |
| 199 | 199 | ); |
| 200 | 200 | return; |
| 201 | 201 | } |
| 202 | 202 | // check for reg_url_link |
| 203 | - $this->_reg_url_link = EE_Registry::instance()->REQ->get( 'e_reg_url_link' ); |
|
| 203 | + $this->_reg_url_link = EE_Registry::instance()->REQ->get('e_reg_url_link'); |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | |
@@ -212,8 +212,8 @@ discard block |
||
| 212 | 212 | * @param string $reg_url_link |
| 213 | 213 | * @return string |
| 214 | 214 | */ |
| 215 | - public function set_reg_url_link( $reg_url_link = NULL ) { |
|
| 216 | - $this->_reg_url_link = ! empty( $reg_url_link ) ? $reg_url_link : $this->_reg_url_link; |
|
| 215 | + public function set_reg_url_link($reg_url_link = NULL) { |
|
| 216 | + $this->_reg_url_link = ! empty($reg_url_link) ? $reg_url_link : $this->_reg_url_link; |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | |
@@ -226,21 +226,21 @@ discard block |
||
| 226 | 226 | * @param WP $WP |
| 227 | 227 | * @return void |
| 228 | 228 | */ |
| 229 | - public function run( WP $WP ) { |
|
| 229 | + public function run(WP $WP) { |
|
| 230 | 230 | // ensure this shortcode doesn't trigger on anything BUT the thank you page |
| 231 | - if ( isset( $WP->request ) && basename( $WP->request ) != basename( EE_Registry::instance()->CFG->core->thank_you_page_url() )) { |
|
| 231 | + if (isset($WP->request) && basename($WP->request) != basename(EE_Registry::instance()->CFG->core->thank_you_page_url())) { |
|
| 232 | 232 | return; |
| 233 | - } else if ( isset( $WP->query_vars['page_id'] ) && $WP->query_vars['page_id'] != EE_Registry::instance()->CFG->core->thank_you_page_id ) { |
|
| 233 | + } else if (isset($WP->query_vars['page_id']) && $WP->query_vars['page_id'] != EE_Registry::instance()->CFG->core->thank_you_page_id) { |
|
| 234 | 234 | return; |
| 235 | 235 | } |
| 236 | 236 | $this->_get_reg_url_link(); |
| 237 | 237 | // resend_reg_confirmation_email ? |
| 238 | - if ( EE_Registry::instance()->REQ->is_set( 'resend' )) { |
|
| 238 | + if (EE_Registry::instance()->REQ->is_set('resend')) { |
|
| 239 | 239 | EES_Espresso_Thank_You::resend_reg_confirmation_email(); |
| 240 | 240 | } |
| 241 | 241 | // load assets |
| 242 | - add_action( 'wp_enqueue_scripts', array( $this, 'load_js' ), 10 ); |
|
| 243 | - add_action( 'shutdown', array( EE_Session::instance(), 'clear_session' )); |
|
| 242 | + add_action('wp_enqueue_scripts', array($this, 'load_js'), 10); |
|
| 243 | + add_action('shutdown', array(EE_Session::instance(), 'clear_session')); |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | |
@@ -251,25 +251,25 @@ discard block |
||
| 251 | 251 | * @return void |
| 252 | 252 | */ |
| 253 | 253 | public function load_js() { |
| 254 | - wp_register_script( 'thank_you_page', THANK_YOU_ASSETS_URL . 'thank_you_page.js', array( 'espresso_core', 'heartbeat' ), EVENT_ESPRESSO_VERSION, TRUE ); |
|
| 255 | - wp_enqueue_script( 'thank_you_page' ); |
|
| 254 | + wp_register_script('thank_you_page', THANK_YOU_ASSETS_URL.'thank_you_page.js', array('espresso_core', 'heartbeat'), EVENT_ESPRESSO_VERSION, TRUE); |
|
| 255 | + wp_enqueue_script('thank_you_page'); |
|
| 256 | 256 | EE_Registry::$i18n_js_strings['e_reg_url_link'] = $this->_reg_url_link; |
| 257 | 257 | EE_Registry::$i18n_js_strings['initial_access'] = current_time('timestamp'); |
| 258 | 258 | EE_Registry::$i18n_js_strings['IPN_wait_time'] = EES_Espresso_Thank_You::IPN_wait_time; |
| 259 | 259 | EE_Registry::$i18n_js_strings['TXN_complete'] = EEM_Transaction::complete_status_code; |
| 260 | 260 | EE_Registry::$i18n_js_strings['TXN_incomplete'] = EEM_Transaction::incomplete_status_code; |
| 261 | - EE_Registry::$i18n_js_strings['checking_for_new_payments'] = __( 'checking for new payments...', 'event_espresso' ); |
|
| 262 | - EE_Registry::$i18n_js_strings['loading_payment_info'] = __( 'loading payment information...', 'event_espresso' ); |
|
| 261 | + EE_Registry::$i18n_js_strings['checking_for_new_payments'] = __('checking for new payments...', 'event_espresso'); |
|
| 262 | + EE_Registry::$i18n_js_strings['loading_payment_info'] = __('loading payment information...', 'event_espresso'); |
|
| 263 | 263 | EE_Registry::$i18n_js_strings['server_error'] = __('An unknown error occurred on the server while attempting to process your request. Please refresh the page and try again.', 'event_espresso'); |
| 264 | 264 | EE_Registry::$i18n_js_strings['slow_IPN'] = apply_filters( |
| 265 | 265 | 'EES_Espresso_Thank_You__load_js__slow_IPN', |
| 266 | 266 | sprintf( |
| 267 | - __( '%sThe Payment Notification appears to be taking longer than usual to arrive. Maybe check back later or just wait for your payment and registration confirmation results to be sent to you via email. We apologize for any inconvenience this may have caused.%s', 'event_espresso' ), |
|
| 267 | + __('%sThe Payment Notification appears to be taking longer than usual to arrive. Maybe check back later or just wait for your payment and registration confirmation results to be sent to you via email. We apologize for any inconvenience this may have caused.%s', 'event_espresso'), |
|
| 268 | 268 | '<div id="espresso-thank-you-page-slow-IPN-dv" class="ee-attention jst-left">', |
| 269 | 269 | '</div>' |
| 270 | 270 | ) |
| 271 | 271 | ); |
| 272 | - wp_localize_script( 'thank_you_page', 'eei18n', EE_Registry::$i18n_js_strings ); |
|
| 272 | + wp_localize_script('thank_you_page', 'eei18n', EE_Registry::$i18n_js_strings); |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | |
@@ -283,26 +283,26 @@ discard block |
||
| 283 | 283 | */ |
| 284 | 284 | public function init() { |
| 285 | 285 | $this->_get_reg_url_link(); |
| 286 | - if ( ! $this->get_txn() ) { |
|
| 286 | + if ( ! $this->get_txn()) { |
|
| 287 | 287 | return NULL; |
| 288 | 288 | } |
| 289 | 289 | // if we've made it to the Thank You page, then let's toggle any "Failed" transactions to "Incomplete" |
| 290 | - if ( $this->_current_txn->status_ID() == EEM_Transaction::failed_status_code ) { |
|
| 291 | - $this->_current_txn->set_status( EEM_Transaction::incomplete_status_code ); |
|
| 290 | + if ($this->_current_txn->status_ID() == EEM_Transaction::failed_status_code) { |
|
| 291 | + $this->_current_txn->set_status(EEM_Transaction::incomplete_status_code); |
|
| 292 | 292 | $this->_current_txn->save(); |
| 293 | 293 | } |
| 294 | 294 | $this->_primary_registrant = $this->_current_txn->primary_registration() instanceof EE_Registration ? $this->_current_txn->primary_registration() : NULL; |
| 295 | 295 | $this->_is_primary = $this->_primary_registrant->reg_url_link() == $this->_reg_url_link ? TRUE : FALSE; |
| 296 | 296 | |
| 297 | - $show_try_pay_again_link_default = do_action( 'AHEE__EES_Espresso_Thank_You__init__show_try_pay_again_link_default', TRUE ); |
|
| 297 | + $show_try_pay_again_link_default = do_action('AHEE__EES_Espresso_Thank_You__init__show_try_pay_again_link_default', TRUE); |
|
| 298 | 298 | // txn status ? |
| 299 | - if( $this->_current_txn->is_completed() ){ |
|
| 299 | + if ($this->_current_txn->is_completed()) { |
|
| 300 | 300 | $this->_show_try_pay_again_link = $show_try_pay_again_link_default; |
| 301 | - } else if ( $this->_current_txn->is_incomplete() && ( $this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment() )){ |
|
| 301 | + } else if ($this->_current_txn->is_incomplete() && ($this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment())) { |
|
| 302 | 302 | $this->_show_try_pay_again_link = TRUE; |
| 303 | - } else if ( $this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment() ) { |
|
| 303 | + } else if ($this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment()) { |
|
| 304 | 304 | // its pending |
| 305 | - $this->_show_try_pay_again_link = isset( EE_Registry::instance()->CFG->registration->show_pending_payment_options ) && EE_Registry::instance()->CFG->registration->show_pending_payment_options ? TRUE : $show_try_pay_again_link_default; |
|
| 305 | + $this->_show_try_pay_again_link = isset(EE_Registry::instance()->CFG->registration->show_pending_payment_options) && EE_Registry::instance()->CFG->registration->show_pending_payment_options ? TRUE : $show_try_pay_again_link_default; |
|
| 306 | 306 | } else { |
| 307 | 307 | $this->_show_try_pay_again_link = $show_try_pay_again_link_default; |
| 308 | 308 | } |
@@ -310,18 +310,18 @@ discard block |
||
| 310 | 310 | $this->_is_offline_payment_method = $this->_current_txn->payment_method() instanceof EE_Payment_Method && $this->_current_txn->payment_method()->is_off_line() ? TRUE : FALSE; |
| 311 | 311 | // link to SPCO |
| 312 | 312 | $revisit_spco_url = add_query_arg( |
| 313 | - array( 'ee'=>'_register', 'revisit'=>TRUE, 'e_reg_url_link'=>$this->_reg_url_link ), |
|
| 313 | + array('ee'=>'_register', 'revisit'=>TRUE, 'e_reg_url_link'=>$this->_reg_url_link), |
|
| 314 | 314 | EE_Registry::instance()->CFG->core->reg_page_url() |
| 315 | 315 | ); |
| 316 | 316 | // link to SPCO payment_options |
| 317 | - $this->_SPCO_payment_options_url = $this->_primary_registrant instanceof EE_Registration ? $this->_primary_registrant->payment_overview_url() : add_query_arg( array('step'=>'payment_options' ), $revisit_spco_url ); |
|
| 317 | + $this->_SPCO_payment_options_url = $this->_primary_registrant instanceof EE_Registration ? $this->_primary_registrant->payment_overview_url() : add_query_arg(array('step'=>'payment_options'), $revisit_spco_url); |
|
| 318 | 318 | // link to SPCO attendee_information |
| 319 | 319 | $this->_SPCO_attendee_information_url = $this->_primary_registrant instanceof EE_Registration ? $this->_primary_registrant->edit_attendee_information_url() : FALSE; |
| 320 | 320 | |
| 321 | - EE_Registry::instance()->load_helper( 'Template' ); |
|
| 322 | - EE_Registry::instance()->load_helper( 'Template_Validator' ); |
|
| 321 | + EE_Registry::instance()->load_helper('Template'); |
|
| 322 | + EE_Registry::instance()->load_helper('Template_Validator'); |
|
| 323 | 323 | |
| 324 | - do_action( 'AHEE__EES_Espresso_Thank_You__init_end', $this->_current_txn ); |
|
| 324 | + do_action('AHEE__EES_Espresso_Thank_You__init_end', $this->_current_txn); |
|
| 325 | 325 | // set no cache headers and constants |
| 326 | 326 | EE_System::do_not_cache(); |
| 327 | 327 | |
@@ -337,32 +337,32 @@ discard block |
||
| 337 | 337 | * @param array $attributes |
| 338 | 338 | * @return string |
| 339 | 339 | */ |
| 340 | - public function process_shortcode( $attributes = array() ) { |
|
| 340 | + public function process_shortcode($attributes = array()) { |
|
| 341 | 341 | |
| 342 | 342 | $this->init(); |
| 343 | 343 | |
| 344 | - if ( ! $this->_current_txn instanceof EE_Transaction ) { |
|
| 344 | + if ( ! $this->_current_txn instanceof EE_Transaction) { |
|
| 345 | 345 | return EE_Error::get_notices(); |
| 346 | 346 | } |
| 347 | - EE_Registry::instance()->load_helper( 'Debug_Tools' ); |
|
| 348 | - EEH_Debug_Tools::log( __CLASS__, __FUNCTION__, __LINE__, array( $this->_current_txn ), true, |
|
| 349 | - 'EE_Transaction: ' . $this->_current_txn->ID() ); |
|
| 347 | + EE_Registry::instance()->load_helper('Debug_Tools'); |
|
| 348 | + EEH_Debug_Tools::log(__CLASS__, __FUNCTION__, __LINE__, array($this->_current_txn), true, |
|
| 349 | + 'EE_Transaction: '.$this->_current_txn->ID()); |
|
| 350 | 350 | // link to receipt |
| 351 | - $template_args['TXN_receipt_url'] = $this->_current_txn->receipt_url( 'html' ); |
|
| 352 | - if ( ! empty( $template_args['TXN_receipt_url'] )) { |
|
| 353 | - $template_args['order_conf_desc'] = __( '%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation or click the button below to view / download / print a full description of your purchases and registration information.', 'event_espresso' ); |
|
| 351 | + $template_args['TXN_receipt_url'] = $this->_current_txn->receipt_url('html'); |
|
| 352 | + if ( ! empty($template_args['TXN_receipt_url'])) { |
|
| 353 | + $template_args['order_conf_desc'] = __('%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation or click the button below to view / download / print a full description of your purchases and registration information.', 'event_espresso'); |
|
| 354 | 354 | } else { |
| 355 | - $template_args['order_conf_desc'] = __( '%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation.', 'event_espresso' ); |
|
| 355 | + $template_args['order_conf_desc'] = __('%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation.', 'event_espresso'); |
|
| 356 | 356 | } |
| 357 | 357 | $template_args['transaction'] = $this->_current_txn; |
| 358 | - $template_args['revisit'] = EE_Registry::instance()->REQ->get( 'revisit', FALSE ); |
|
| 358 | + $template_args['revisit'] = EE_Registry::instance()->REQ->get('revisit', FALSE); |
|
| 359 | 359 | |
| 360 | - add_action( 'AHEE__thank_you_page_overview_template__content', array( $this, 'get_registration_details' )); |
|
| 361 | - if ( $this->_is_primary && $this->_payments_closed && ! $this->_current_txn->is_free() ) { |
|
| 362 | - add_action( 'AHEE__thank_you_page_overview_template__content', array( $this, 'get_ajax_content' )); |
|
| 360 | + add_action('AHEE__thank_you_page_overview_template__content', array($this, 'get_registration_details')); |
|
| 361 | + if ($this->_is_primary && $this->_payments_closed && ! $this->_current_txn->is_free()) { |
|
| 362 | + add_action('AHEE__thank_you_page_overview_template__content', array($this, 'get_ajax_content')); |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | - return EEH_Template::locate_template( THANK_YOU_TEMPLATES_PATH . 'thank-you-page-overview.template.php', $template_args, TRUE, TRUE ); |
|
| 365 | + return EEH_Template::locate_template(THANK_YOU_TEMPLATES_PATH.'thank-you-page-overview.template.php', $template_args, TRUE, TRUE); |
|
| 366 | 366 | |
| 367 | 367 | } |
| 368 | 368 | |
@@ -379,15 +379,15 @@ discard block |
||
| 379 | 379 | * @param array $data |
| 380 | 380 | * @return array |
| 381 | 381 | */ |
| 382 | - public static function thank_you_page_IPN_monitor( $response = array(), $data = array() ) { |
|
| 382 | + public static function thank_you_page_IPN_monitor($response = array(), $data = array()) { |
|
| 383 | 383 | // does this heartbeat contain our data ? |
| 384 | - if ( ! isset( $data['espresso_thank_you_page'] )) { |
|
| 384 | + if ( ! isset($data['espresso_thank_you_page'])) { |
|
| 385 | 385 | return $response; |
| 386 | 386 | } |
| 387 | 387 | // check for reg_url_link in the incoming heartbeat data |
| 388 | - if ( ! isset( $data['espresso_thank_you_page']['e_reg_url_link'] )) { |
|
| 389 | - $response['espresso_thank_you_page'] = array ( |
|
| 390 | - 'errors' => ! empty( $notices['errors'] ) ? $notices['errors'] : __( 'No transaction information could be retrieved because the registration URL link is missing or invalid.', 'event_espresso' ) |
|
| 388 | + if ( ! isset($data['espresso_thank_you_page']['e_reg_url_link'])) { |
|
| 389 | + $response['espresso_thank_you_page'] = array( |
|
| 390 | + 'errors' => ! empty($notices['errors']) ? $notices['errors'] : __('No transaction information could be retrieved because the registration URL link is missing or invalid.', 'event_espresso') |
|
| 391 | 391 | ); |
| 392 | 392 | return $response; |
| 393 | 393 | } |
@@ -397,24 +397,24 @@ discard block |
||
| 397 | 397 | EES_Espresso_Thank_You::set_definitions(); |
| 398 | 398 | /** @var $espresso_thank_you_page EES_Espresso_Thank_You */ |
| 399 | 399 | $espresso_thank_you_page = EES_Espresso_Thank_You::instance(); |
| 400 | - $espresso_thank_you_page->set_reg_url_link( $data['espresso_thank_you_page']['e_reg_url_link'] ); |
|
| 400 | + $espresso_thank_you_page->set_reg_url_link($data['espresso_thank_you_page']['e_reg_url_link']); |
|
| 401 | 401 | $espresso_thank_you_page->init(); |
| 402 | 402 | //get TXN |
| 403 | 403 | $TXN = $espresso_thank_you_page->get_txn(); |
| 404 | 404 | // no TXN? then get out |
| 405 | - if ( ! $TXN instanceof EE_Transaction ) { |
|
| 405 | + if ( ! $TXN instanceof EE_Transaction) { |
|
| 406 | 406 | $notices = EE_Error::get_notices(); |
| 407 | - $response['espresso_thank_you_page'] = array ( |
|
| 408 | - 'errors' => ! empty( $notices['errors'] ) ? $notices['errors'] : sprintf( __( 'The information for your transaction could not be retrieved from the server or the transaction data received was invalid because of a technical reason. (%s)', 'event_espresso' ), __LINE__ ) |
|
| 407 | + $response['espresso_thank_you_page'] = array( |
|
| 408 | + 'errors' => ! empty($notices['errors']) ? $notices['errors'] : sprintf(__('The information for your transaction could not be retrieved from the server or the transaction data received was invalid because of a technical reason. (%s)', 'event_espresso'), __LINE__) |
|
| 409 | 409 | ); |
| 410 | 410 | return $response; |
| 411 | 411 | } |
| 412 | 412 | // grab transient of TXN's status |
| 413 | - $txn_status = isset( $data['espresso_thank_you_page']['txn_status'] ) ? $data['espresso_thank_you_page']['txn_status'] : NULL; |
|
| 413 | + $txn_status = isset($data['espresso_thank_you_page']['txn_status']) ? $data['espresso_thank_you_page']['txn_status'] : NULL; |
|
| 414 | 414 | // has the TXN status changed since we last checked (or empty because this is the first time running through this code)? |
| 415 | - if ( $txn_status !== $TXN->status_ID() ) { |
|
| 415 | + if ($txn_status !== $TXN->status_ID()) { |
|
| 416 | 416 | // switch between two possible basic outcomes |
| 417 | - switch( $TXN->status_ID()) { |
|
| 417 | + switch ($TXN->status_ID()) { |
|
| 418 | 418 | // TXN has been updated in some way |
| 419 | 419 | case EEM_Transaction::overpaid_status_code: |
| 420 | 420 | case EEM_Transaction::complete_status_code: |
@@ -429,29 +429,29 @@ discard block |
||
| 429 | 429 | case EEM_Transaction::failed_status_code: |
| 430 | 430 | default: |
| 431 | 431 | // keep on waiting... |
| 432 | - return $espresso_thank_you_page->_update_server_wait_time( $data['espresso_thank_you_page'] ); |
|
| 432 | + return $espresso_thank_you_page->_update_server_wait_time($data['espresso_thank_you_page']); |
|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | // or is the TXN still failed (never been updated) ??? |
| 436 | - } else if ( $TXN->failed() ) { |
|
| 436 | + } else if ($TXN->failed()) { |
|
| 437 | 437 | // keep on waiting... |
| 438 | - return $espresso_thank_you_page->_update_server_wait_time( $data['espresso_thank_you_page'] ); |
|
| 438 | + return $espresso_thank_you_page->_update_server_wait_time($data['espresso_thank_you_page']); |
|
| 439 | 439 | } |
| 440 | 440 | // TXN is happening so let's get the payments now |
| 441 | 441 | // if we've already gotten payments then the heartbeat data will contain the timestamp of the last time we checked |
| 442 | - $since = isset( $data['espresso_thank_you_page']['get_payments_since'] ) ? $data['espresso_thank_you_page']['get_payments_since'] : 0; |
|
| 442 | + $since = isset($data['espresso_thank_you_page']['get_payments_since']) ? $data['espresso_thank_you_page']['get_payments_since'] : 0; |
|
| 443 | 443 | // then check for payments |
| 444 | - $payments = $espresso_thank_you_page->get_txn_payments( $since ); |
|
| 444 | + $payments = $espresso_thank_you_page->get_txn_payments($since); |
|
| 445 | 445 | // has a payment been processed ? |
| 446 | - if ( ! empty( $payments ) || $espresso_thank_you_page->_is_offline_payment_method ) { |
|
| 447 | - if ( $since ) { |
|
| 446 | + if ( ! empty($payments) || $espresso_thank_you_page->_is_offline_payment_method) { |
|
| 447 | + if ($since) { |
|
| 448 | 448 | $response['espresso_thank_you_page'] = array( |
| 449 | - 'new_payments' => $espresso_thank_you_page->get_new_payments( $payments ), |
|
| 449 | + 'new_payments' => $espresso_thank_you_page->get_new_payments($payments), |
|
| 450 | 450 | 'transaction_details' => $espresso_thank_you_page->get_transaction_details(), |
| 451 | 451 | 'txn_status' => $TXN->status_ID() |
| 452 | 452 | ); |
| 453 | 453 | } else { |
| 454 | - $response['espresso_thank_you_page']['payment_details'] = $espresso_thank_you_page->get_payment_details( $payments ); |
|
| 454 | + $response['espresso_thank_you_page']['payment_details'] = $espresso_thank_you_page->get_payment_details($payments); |
|
| 455 | 455 | } |
| 456 | 456 | // reset time to check for payments |
| 457 | 457 | $response['espresso_thank_you_page']['get_payments_since'] = current_time('timestamp'); |
@@ -471,9 +471,9 @@ discard block |
||
| 471 | 471 | * @param array $thank_you_page_data thank you page portion of the incoming JSON array from the WP heartbeat data |
| 472 | 472 | * @return array |
| 473 | 473 | */ |
| 474 | - private function _update_server_wait_time( $thank_you_page_data = array() ) { |
|
| 475 | - $response['espresso_thank_you_page'] = array ( |
|
| 476 | - 'still_waiting' => isset( $thank_you_page_data['initial_access'] ) ? current_time('timestamp') - $thank_you_page_data['initial_access'] : 0, |
|
| 474 | + private function _update_server_wait_time($thank_you_page_data = array()) { |
|
| 475 | + $response['espresso_thank_you_page'] = array( |
|
| 476 | + 'still_waiting' => isset($thank_you_page_data['initial_access']) ? current_time('timestamp') - $thank_you_page_data['initial_access'] : 0, |
|
| 477 | 477 | 'txn_status' => $this->_current_txn->status_ID() |
| 478 | 478 | ); |
| 479 | 479 | return $response; |
@@ -496,13 +496,13 @@ discard block |
||
| 496 | 496 | $template_args['SPCO_attendee_information_url'] = $this->_SPCO_attendee_information_url; |
| 497 | 497 | |
| 498 | 498 | $template_args['resend_reg_confirmation_url'] = add_query_arg( |
| 499 | - array( 'token'=>$this->_reg_url_link, 'resend_reg_confirmation' => 'true' ), |
|
| 499 | + array('token'=>$this->_reg_url_link, 'resend_reg_confirmation' => 'true'), |
|
| 500 | 500 | EE_Registry::instance()->CFG->core->thank_you_page_url() |
| 501 | 501 | ); |
| 502 | 502 | // verify template arguments |
| 503 | - EEH_Template_Validator::verify_instanceof( $template_args['transaction'], '$transaction', 'EE_Transaction' ); |
|
| 504 | - EEH_Template_Validator::verify_isnt_null( $template_args['SPCO_attendee_information_url'], '$SPCO_attendee_information_url'); |
|
| 505 | - echo EEH_Template::locate_template( THANK_YOU_TEMPLATES_PATH . 'thank-you-page-registration-details.template.php', $template_args, TRUE, TRUE ); |
|
| 503 | + EEH_Template_Validator::verify_instanceof($template_args['transaction'], '$transaction', 'EE_Transaction'); |
|
| 504 | + EEH_Template_Validator::verify_isnt_null($template_args['SPCO_attendee_information_url'], '$SPCO_attendee_information_url'); |
|
| 505 | + echo EEH_Template::locate_template(THANK_YOU_TEMPLATES_PATH.'thank-you-page-registration-details.template.php', $template_args, TRUE, TRUE); |
|
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | |
@@ -511,38 +511,38 @@ discard block |
||
| 511 | 511 | * resend_reg_confirmation_email |
| 512 | 512 | */ |
| 513 | 513 | public static function resend_reg_confirmation_email() { |
| 514 | - EE_Registry::instance()->load_core( 'Request_Handler' ); |
|
| 515 | - $reg_url_link = EE_Registry::instance()->REQ->get( 'token' ); |
|
| 514 | + EE_Registry::instance()->load_core('Request_Handler'); |
|
| 515 | + $reg_url_link = EE_Registry::instance()->REQ->get('token'); |
|
| 516 | 516 | |
| 517 | 517 | // was a REG_ID passed ? |
| 518 | - if ( $reg_url_link ) { |
|
| 519 | - $registration = EE_Registry::instance()->load_model( 'Registration' )->get_one( array( array( 'REG_url_link' => $reg_url_link ))); |
|
| 520 | - if ( $registration instanceof EE_Registration ) { |
|
| 518 | + if ($reg_url_link) { |
|
| 519 | + $registration = EE_Registry::instance()->load_model('Registration')->get_one(array(array('REG_url_link' => $reg_url_link))); |
|
| 520 | + if ($registration instanceof EE_Registration) { |
|
| 521 | 521 | // resend email |
| 522 | - EED_Messages::process_resend( array( '_REG_ID' => $registration->ID() )); |
|
| 522 | + EED_Messages::process_resend(array('_REG_ID' => $registration->ID())); |
|
| 523 | 523 | } else { |
| 524 | 524 | EE_Error::add_error( |
| 525 | - __( 'The Registration Confirmation email could not be sent because a valid Registration could not be retrieved from the database.', 'event_espresso' ), |
|
| 525 | + __('The Registration Confirmation email could not be sent because a valid Registration could not be retrieved from the database.', 'event_espresso'), |
|
| 526 | 526 | __FILE__, __FUNCTION__, __LINE__ |
| 527 | 527 | ); |
| 528 | 528 | } |
| 529 | 529 | } else { |
| 530 | 530 | EE_Error::add_error( |
| 531 | - __( 'The Registration Confirmation email could not be sent because a registration token is missing or invalid.', 'event_espresso' ), |
|
| 531 | + __('The Registration Confirmation email could not be sent because a registration token is missing or invalid.', 'event_espresso'), |
|
| 532 | 532 | __FILE__, __FUNCTION__, __LINE__ |
| 533 | 533 | ); |
| 534 | 534 | } |
| 535 | 535 | // request sent via AJAX ? |
| 536 | - if ( EE_FRONT_AJAX ) { |
|
| 537 | - echo json_encode( EE_Error::get_notices( FALSE )); |
|
| 536 | + if (EE_FRONT_AJAX) { |
|
| 537 | + echo json_encode(EE_Error::get_notices(FALSE)); |
|
| 538 | 538 | die(); |
| 539 | 539 | // or was JS disabled ? |
| 540 | 540 | } else { |
| 541 | 541 | // save errors so that they get picked up on the next request |
| 542 | - EE_Error::get_notices( TRUE, TRUE ); |
|
| 542 | + EE_Error::get_notices(TRUE, TRUE); |
|
| 543 | 543 | wp_safe_redirect( |
| 544 | 544 | add_query_arg( |
| 545 | - array( 'e_reg_url_link'=> $reg_url_link ), |
|
| 545 | + array('e_reg_url_link'=> $reg_url_link), |
|
| 546 | 546 | EE_Registry::instance()->CFG->core->thank_you_page_url() |
| 547 | 547 | ) |
| 548 | 548 | ); |
@@ -558,19 +558,19 @@ discard block |
||
| 558 | 558 | * @return string |
| 559 | 559 | */ |
| 560 | 560 | public function get_ajax_content() { |
| 561 | - if ( ! $this->_primary_registrant->is_not_approved() ) { |
|
| 561 | + if ( ! $this->_primary_registrant->is_not_approved()) { |
|
| 562 | 562 | ?> |
| 563 | 563 | <div id="espresso-thank-you-page-ajax-content-dv"> |
| 564 | 564 | <div id="espresso-thank-you-page-ajax-transaction-dv"></div> |
| 565 | 565 | <div id="espresso-thank-you-page-ajax-payment-dv"></div> |
| 566 | 566 | <div id="espresso-thank-you-page-ajax-loading-dv"> |
| 567 | 567 | <div id="ee-ajax-loading-dv" class="left lt-blue-text"> |
| 568 | - <span class="dashicons dashicons-upload"></span><span id="ee-ajax-loading-msg-spn"><?php _e( 'loading transaction and payment information...', 'event_espresso' );?></span> |
|
| 568 | + <span class="dashicons dashicons-upload"></span><span id="ee-ajax-loading-msg-spn"><?php _e('loading transaction and payment information...', 'event_espresso'); ?></span> |
|
| 569 | 569 | </div> |
| 570 | - <?php if ( ! $this->_is_offline_payment_method ) : ?> |
|
| 570 | + <?php if ( ! $this->_is_offline_payment_method) : ?> |
|
| 571 | 571 | <p id="ee-ajax-loading-pg" class="highlight-bg small-text clear"> |
| 572 | - <?php echo apply_filters( 'EES_Espresso_Thank_You__get_ajax_content__waiting_for_IPN_msg', __( 'Some payment gateways can take 15 minutes or more to return their payment notification, so please be patient if you require payment confirmation as soon as possible. Please note that as soon as everything is finalized, we will send your full payment and registration confirmation results to you via email.', 'event_espresso' ));?><br/> |
|
| 573 | - <span class="jst-rght ee-block small-text lt-grey-text"><?php _e( 'current wait time ', 'event_espresso' );?><span id="espresso-thank-you-page-ajax-time-dv">00:00:00</span></span> |
|
| 572 | + <?php echo apply_filters('EES_Espresso_Thank_You__get_ajax_content__waiting_for_IPN_msg', __('Some payment gateways can take 15 minutes or more to return their payment notification, so please be patient if you require payment confirmation as soon as possible. Please note that as soon as everything is finalized, we will send your full payment and registration confirmation results to you via email.', 'event_espresso')); ?><br/> |
|
| 573 | + <span class="jst-rght ee-block small-text lt-grey-text"><?php _e('current wait time ', 'event_espresso'); ?><span id="espresso-thank-you-page-ajax-time-dv">00:00:00</span></span> |
|
| 574 | 574 | </p> |
| 575 | 575 | <?php endif; ?> |
| 576 | 576 | </div> |
@@ -580,9 +580,9 @@ discard block |
||
| 580 | 580 | } else { |
| 581 | 581 | ?> |
| 582 | 582 | <div id="espresso-thank-you-page-not-approved-message-dv"> |
| 583 | - <h4 class="orange-text"><?php _e('Important Notice:', 'event_espresso');?></h4> |
|
| 583 | + <h4 class="orange-text"><?php _e('Important Notice:', 'event_espresso'); ?></h4> |
|
| 584 | 584 | <p id="events-requiring-pre-approval-pg" class="small-text"> |
| 585 | - <?php echo apply_filters( 'AHEE__EES_Espresso_Thank_You__get_ajax_content__not_approved_message', __('The Event you have registered for does not require payment at this time and was not billed for during this transaction. Billing will only occur after all attendees have been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.', 'event_espresso') ); ?> |
|
| 585 | + <?php echo apply_filters('AHEE__EES_Espresso_Thank_You__get_ajax_content__not_approved_message', __('The Event you have registered for does not require payment at this time and was not billed for during this transaction. Billing will only occur after all attendees have been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.', 'event_espresso')); ?> |
|
| 586 | 586 | </p> |
| 587 | 587 | <div class="clear"></div> |
| 588 | 588 | </div> |
@@ -603,15 +603,15 @@ discard block |
||
| 603 | 603 | $template_args = array(); |
| 604 | 604 | $template_args['transaction'] = $this->_current_txn; |
| 605 | 605 | $template_args['reg_url_link'] = $this->_reg_url_link; |
| 606 | - $template_args['primary_registrant_name'] = $this->_primary_registrant->attendee()->full_name( TRUE ); |
|
| 606 | + $template_args['primary_registrant_name'] = $this->_primary_registrant->attendee()->full_name(TRUE); |
|
| 607 | 607 | // link to SPCO payment_options |
| 608 | 608 | $template_args['show_try_pay_again_link'] = $this->_show_try_pay_again_link; |
| 609 | 609 | $template_args['SPCO_payment_options_url'] = $this->_SPCO_payment_options_url; |
| 610 | 610 | // verify template arguments |
| 611 | - EEH_Template_Validator::verify_instanceof( $template_args['transaction'], '$transaction', 'EE_Transaction' ); |
|
| 612 | - EEH_Template_Validator::verify_isnt_null( $template_args['show_try_pay_again_link'], '$show_try_pay_again_link' ); |
|
| 613 | - EEH_Template_Validator::verify_isnt_null( $template_args['SPCO_payment_options_url'], '$SPCO_payment_options_url' ); |
|
| 614 | - return EEH_Template::locate_template( THANK_YOU_TEMPLATES_PATH . 'thank-you-page-transaction-details.template.php', $template_args, TRUE, TRUE ); |
|
| 611 | + EEH_Template_Validator::verify_instanceof($template_args['transaction'], '$transaction', 'EE_Transaction'); |
|
| 612 | + EEH_Template_Validator::verify_isnt_null($template_args['show_try_pay_again_link'], '$show_try_pay_again_link'); |
|
| 613 | + EEH_Template_Validator::verify_isnt_null($template_args['SPCO_payment_options_url'], '$SPCO_payment_options_url'); |
|
| 614 | + return EEH_Template::locate_template(THANK_YOU_TEMPLATES_PATH.'thank-you-page-transaction-details.template.php', $template_args, TRUE, TRUE); |
|
| 615 | 615 | } |
| 616 | 616 | |
| 617 | 617 | |
@@ -623,9 +623,9 @@ discard block |
||
| 623 | 623 | * @param EE_Payment $payment |
| 624 | 624 | * @return string |
| 625 | 625 | */ |
| 626 | - public function get_payment_row_html( $payment = NULL ) { |
|
| 626 | + public function get_payment_row_html($payment = NULL) { |
|
| 627 | 627 | $html = ''; |
| 628 | - if ( $payment instanceof EE_Payment ) { |
|
| 628 | + if ($payment instanceof EE_Payment) { |
|
| 629 | 629 | if ( |
| 630 | 630 | $payment->payment_method() instanceof EE_Payment_Method |
| 631 | 631 | && $payment->payment_method()->is_off_site() |
@@ -634,25 +634,25 @@ discard block |
||
| 634 | 634 | // considering the registrant has made it to the Thank You page, |
| 635 | 635 | // any failed payments may actually be pending and the IPN is just slow |
| 636 | 636 | // so let's |
| 637 | - $payment->set_status( EEM_Payment::status_id_pending ); |
|
| 637 | + $payment->set_status(EEM_Payment::status_id_pending); |
|
| 638 | 638 | } |
| 639 | - $payment_declined_msg = $payment->STS_ID() === EEM_Payment::status_id_declined ? '<br /><span class="small-text">' . $payment->gateway_response() . '</span>' : ''; |
|
| 639 | + $payment_declined_msg = $payment->STS_ID() === EEM_Payment::status_id_declined ? '<br /><span class="small-text">'.$payment->gateway_response().'</span>' : ''; |
|
| 640 | 640 | $html .= ' |
| 641 | 641 | <tr> |
| 642 | 642 | <td> |
| 643 | - ' . $payment->timestamp() . ' |
|
| 643 | + ' . $payment->timestamp().' |
|
| 644 | 644 | </td> |
| 645 | 645 | <td> |
| 646 | - ' . ( $payment->payment_method() instanceof EE_Payment_Method ? $payment->payment_method()->name() : __( 'Unknown', 'event_espresso' ) ) . ' |
|
| 646 | + ' . ($payment->payment_method() instanceof EE_Payment_Method ? $payment->payment_method()->name() : __('Unknown', 'event_espresso')).' |
|
| 647 | 647 | </td> |
| 648 | 648 | <td class="jst-rght"> |
| 649 | - ' . EEH_Template::format_currency( $payment->amount() ) . ' |
|
| 649 | + ' . EEH_Template::format_currency($payment->amount()).' |
|
| 650 | 650 | </td> |
| 651 | 651 | <td class="jst-rght" style="line-height:1;"> |
| 652 | - ' . $payment->pretty_status( TRUE ) . $payment_declined_msg . ' |
|
| 652 | + ' . $payment->pretty_status(TRUE).$payment_declined_msg.' |
|
| 653 | 653 | </td> |
| 654 | 654 | </tr>'; |
| 655 | - do_action( 'AHEE__thank_you_page_payment_details_template__after_each_payment', $payment ); |
|
| 655 | + do_action('AHEE__thank_you_page_payment_details_template__after_each_payment', $payment); |
|
| 656 | 656 | } |
| 657 | 657 | return $html; |
| 658 | 658 | } |
@@ -666,34 +666,34 @@ discard block |
||
| 666 | 666 | * @param array $payments |
| 667 | 667 | * @return string |
| 668 | 668 | */ |
| 669 | - public function get_payment_details( $payments = array() ) { |
|
| 669 | + public function get_payment_details($payments = array()) { |
|
| 670 | 670 | //prepare variables for displaying |
| 671 | 671 | $template_args = array(); |
| 672 | 672 | $template_args['transaction'] = $this->_current_txn; |
| 673 | 673 | $template_args['reg_url_link'] = $this->_reg_url_link; |
| 674 | 674 | $template_args['payments'] = array(); |
| 675 | - foreach ( $payments as $payment ) { |
|
| 676 | - $template_args['payments'][] = $this->get_payment_row_html( $payment ); |
|
| 675 | + foreach ($payments as $payment) { |
|
| 676 | + $template_args['payments'][] = $this->get_payment_row_html($payment); |
|
| 677 | 677 | } |
| 678 | 678 | //create a hacky payment object, but dont save it |
| 679 | - $payment = EE_Payment::new_instance( array( |
|
| 679 | + $payment = EE_Payment::new_instance(array( |
|
| 680 | 680 | 'TXN_ID'=>$this->_current_txn->ID(), |
| 681 | 681 | 'STS_ID'=>EEM_Payment::status_id_pending, |
| 682 | 682 | 'PAY_timestamp'=>current_time('timestamp'), |
| 683 | 683 | 'PAY_amount'=>$this->_current_txn->total(), |
| 684 | 684 | 'PMD_ID'=>$this->_current_txn->payment_method_ID() |
| 685 | 685 | )); |
| 686 | - $template_args['gateway_content'] = $this->_current_txn->payment_method()->type_obj()->payment_overview_content($payment);//EEM_Gateways::instance()->get_payment_overview_content( $gateway_name, $payment ); |
|
| 686 | + $template_args['gateway_content'] = $this->_current_txn->payment_method()->type_obj()->payment_overview_content($payment); //EEM_Gateways::instance()->get_payment_overview_content( $gateway_name, $payment ); |
|
| 687 | 687 | // link to SPCO payment_options |
| 688 | 688 | $template_args['show_try_pay_again_link'] = $this->_show_try_pay_again_link; |
| 689 | 689 | $template_args['SPCO_payment_options_url'] = $this->_SPCO_payment_options_url; |
| 690 | 690 | // verify template arguments |
| 691 | - EEH_Template_Validator::verify_instanceof( $template_args['transaction'], '$transaction', 'EE_Transaction' ); |
|
| 692 | - EEH_Template_Validator::verify_isnt_null( $template_args['payments'], '$payments' ); |
|
| 693 | - EEH_Template_Validator::verify_isnt_null( $template_args['show_try_pay_again_link'], '$show_try_pay_again_link' ); |
|
| 694 | - EEH_Template_Validator::verify_isnt_null( $template_args['gateway_content'], '$gateway_content'); |
|
| 695 | - EEH_Template_Validator::verify_isnt_null( $template_args['SPCO_payment_options_url'], '$SPCO_payment_options_url'); |
|
| 696 | - return EEH_Template::locate_template( THANK_YOU_TEMPLATES_PATH . 'thank-you-page-payment-details.template.php', $template_args, TRUE, TRUE ); |
|
| 691 | + EEH_Template_Validator::verify_instanceof($template_args['transaction'], '$transaction', 'EE_Transaction'); |
|
| 692 | + EEH_Template_Validator::verify_isnt_null($template_args['payments'], '$payments'); |
|
| 693 | + EEH_Template_Validator::verify_isnt_null($template_args['show_try_pay_again_link'], '$show_try_pay_again_link'); |
|
| 694 | + EEH_Template_Validator::verify_isnt_null($template_args['gateway_content'], '$gateway_content'); |
|
| 695 | + EEH_Template_Validator::verify_isnt_null($template_args['SPCO_payment_options_url'], '$SPCO_payment_options_url'); |
|
| 696 | + return EEH_Template::locate_template(THANK_YOU_TEMPLATES_PATH.'thank-you-page-payment-details.template.php', $template_args, TRUE, TRUE); |
|
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | |
@@ -705,11 +705,11 @@ discard block |
||
| 705 | 705 | * @param array $payments |
| 706 | 706 | * @return string |
| 707 | 707 | */ |
| 708 | - public function get_new_payments( $payments = array() ) { |
|
| 708 | + public function get_new_payments($payments = array()) { |
|
| 709 | 709 | $payments_html = ''; |
| 710 | 710 | //prepare variables for displaying |
| 711 | - foreach ( $payments as $payment ) { |
|
| 712 | - $payments_html .= $this->get_payment_row_html( $payment ); |
|
| 711 | + foreach ($payments as $payment) { |
|
| 712 | + $payments_html .= $this->get_payment_row_html($payment); |
|
| 713 | 713 | } |
| 714 | 714 | return $payments_html; |
| 715 | 715 | } |
@@ -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 | * |
@@ -5,61 +5,61 @@ discard block |
||
| 5 | 5 | /** @type string $SPCO_attendee_information_url */ |
| 6 | 6 | ?> |
| 7 | 7 | <h3 class="ee-registration-details-h3"><?php _e('Registration Details', 'event_espresso'); ?></h3> |
| 8 | -<?php do_action( 'AHEE__thank_you_page_registration_details_template__after_heading' ); ?> |
|
| 8 | +<?php do_action('AHEE__thank_you_page_registration_details_template__after_heading'); ?> |
|
| 9 | 9 | |
| 10 | 10 | <div class="ee-registration-details-dv"> |
| 11 | 11 | <?php |
| 12 | 12 | $reg_cntr = 0; |
| 13 | 13 | $event_name = ''; |
| 14 | 14 | |
| 15 | -foreach ( $transaction->registrations() as $registration ) { |
|
| 16 | - if ( $registration instanceof EE_Registration ) { |
|
| 15 | +foreach ($transaction->registrations() as $registration) { |
|
| 16 | + if ($registration instanceof EE_Registration) { |
|
| 17 | 17 | $reg_cntr++; |
| 18 | - if ( $event_name != $registration->event_name() ) { |
|
| 18 | + if ($event_name != $registration->event_name()) { |
|
| 19 | 19 | $event_name = $registration->event_name(); |
| 20 | 20 | ?> |
| 21 | 21 | <h5> |
| 22 | - <span class="smaller-text grey-text"><?php _e('for','event_espresso');?>: </span> <?php echo htmlentities( $registration->event_name(), ENT_QUOTES, 'UTF-8' );?> |
|
| 22 | + <span class="smaller-text grey-text"><?php _e('for', 'event_espresso'); ?>: </span> <?php echo htmlentities($registration->event_name(), ENT_QUOTES, 'UTF-8'); ?> |
|
| 23 | 23 | </h5> |
| 24 | 24 | <table class='ee-table ee-registrations-list'> |
| 25 | 25 | <thead> |
| 26 | 26 | <tr> |
| 27 | 27 | <th width="40%"> |
| 28 | - <?php _e("Registrant Name",'event_espresso')?> |
|
| 28 | + <?php _e("Registrant Name", 'event_espresso')?> |
|
| 29 | 29 | </th> |
| 30 | 30 | <th width="25%" class="jst-left"> |
| 31 | - <?php _e("REG Code",'event_espresso');?> |
|
| 31 | + <?php _e("REG Code", 'event_espresso'); ?> |
|
| 32 | 32 | </th> |
| 33 | 33 | <th width="35%" class="jst-left"> |
| 34 | - <?php _e("REG Status",'event_espresso');?> |
|
| 34 | + <?php _e("REG Status", 'event_espresso'); ?> |
|
| 35 | 35 | </th> |
| 36 | 36 | </tr> |
| 37 | 37 | </thead> |
| 38 | 38 | <tbody> |
| 39 | 39 | <?php } ?> |
| 40 | - <?php if ( $is_primary || ( ! $is_primary && $reg_url_link == $registration->reg_url_link() )) { ?> |
|
| 40 | + <?php if ($is_primary || ( ! $is_primary && $reg_url_link == $registration->reg_url_link())) { ?> |
|
| 41 | 41 | <tr> |
| 42 | 42 | <td width="40%"> |
| 43 | 43 | <?php |
| 44 | - if ( $registration->attendee() instanceof EE_Attendee ) { |
|
| 45 | - echo $registration->attendee()->full_name( TRUE ); |
|
| 44 | + if ($registration->attendee() instanceof EE_Attendee) { |
|
| 45 | + echo $registration->attendee()->full_name(TRUE); |
|
| 46 | 46 | } |
| 47 | 47 | ?> |
| 48 | 48 | <p class="tiny-text" style="margin: .75em 0 0;"> |
| 49 | - <a class="ee-icon-only-lnk" href="<?php echo $registration->edit_attendee_information_url();?>" title="<?php esc_attr_e('Click here to edit Attendee Information', 'event_espresso');?>"><span class="ee-icon ee-icon-user-edit"></span><?php _e('edit info', 'event_espresso');?></a> |
|
| 50 | - <a class="ee-resend-reg-confirmation-email ee-icon-only-lnk" href="<?php echo add_query_arg( array( 'token'=>$registration->reg_url_link(), 'resend_reg_confirmation' => 'true' ), EE_Registry::instance()->CFG->core->thank_you_page_url() );?>" title="<?php esc_attr_e('Click here to resend the Registration Confirmation email', 'event_espresso');?>" rel="<?php echo $registration->reg_url_link();?>"><span class="dashicons dashicons-email-alt"></span><?php _e('resend email', 'event_espresso');?></a> |
|
| 49 | + <a class="ee-icon-only-lnk" href="<?php echo $registration->edit_attendee_information_url(); ?>" title="<?php esc_attr_e('Click here to edit Attendee Information', 'event_espresso'); ?>"><span class="ee-icon ee-icon-user-edit"></span><?php _e('edit info', 'event_espresso'); ?></a> |
|
| 50 | + <a class="ee-resend-reg-confirmation-email ee-icon-only-lnk" href="<?php echo add_query_arg(array('token'=>$registration->reg_url_link(), 'resend_reg_confirmation' => 'true'), EE_Registry::instance()->CFG->core->thank_you_page_url()); ?>" title="<?php esc_attr_e('Click here to resend the Registration Confirmation email', 'event_espresso'); ?>" rel="<?php echo $registration->reg_url_link(); ?>"><span class="dashicons dashicons-email-alt"></span><?php _e('resend email', 'event_espresso'); ?></a> |
|
| 51 | 51 | </p> |
| 52 | 52 | </td> |
| 53 | 53 | <td width="25%" class="jst-left"> |
| 54 | 54 | <?php $registration->e('REG_code') ?> |
| 55 | 55 | </td> |
| 56 | 56 | <td width="35%" class="jst-left"> |
| 57 | - <?php $registration->e_pretty_status( TRUE )?> |
|
| 57 | + <?php $registration->e_pretty_status(TRUE)?> |
|
| 58 | 58 | </td> |
| 59 | 59 | </tr> |
| 60 | - <?php do_action( 'AHEE__thank_you_page_registration_details_template__after_registration_table_row', $registration ); ?> |
|
| 60 | + <?php do_action('AHEE__thank_you_page_registration_details_template__after_registration_table_row', $registration); ?> |
|
| 61 | 61 | <?php } ?> |
| 62 | - <?php if (( $event_name != $registration->event_name() && $event_name != '' ) || $reg_cntr >= count( $transaction->registrations() )) { ?> |
|
| 62 | + <?php if (($event_name != $registration->event_name() && $event_name != '') || $reg_cntr >= count($transaction->registrations())) { ?> |
|
| 63 | 63 | </tbody> |
| 64 | 64 | </table> |
| 65 | 65 | <?php |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | ?> |
| 70 | -<?php if ( $is_primary && $SPCO_attendee_information_url ) { ?> |
|
| 70 | +<?php if ($is_primary && $SPCO_attendee_information_url) { ?> |
|
| 71 | 71 | <p class="small-text jst-rght"> |
| 72 | 72 | <a href='<?php echo $SPCO_attendee_information_url?>'><?php _e("Click here to edit All Attendee Information", 'event_espresso'); ?></a> |
| 73 | 73 | </p> |
| 74 | 74 | <?php } ?> |
| 75 | 75 | |
| 76 | - <?php do_action( 'AHEE__thank_you_page_registration_details_template__after_registration_details' ); ?> |
|
| 76 | + <?php do_action('AHEE__thank_you_page_registration_details_template__after_registration_details'); ?> |
|
| 77 | 77 | |
| 78 | 78 | </div> |
| 79 | 79 | <!-- end of .registration-details --> |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -125,34 +125,34 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | |
| 127 | 127 | protected function _start() { |
| 128 | - $content = '<h3>' . __('Questions Overview', 'event_espresso') . '</h3>'; |
|
| 129 | - $content .= '<p>' . __('This tour of the Questions Overview page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
| 128 | + $content = '<h3>'.__('Questions Overview', 'event_espresso').'</h3>'; |
|
| 129 | + $content .= '<p>'.__('This tour of the Questions Overview page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
| 130 | 130 | |
| 131 | 131 | return $content; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | protected function _question_id_stop() { |
| 135 | - return '<p>' . __('View the question ID. Can be sorted in ascending or descending order.', 'event_espresso') . '</p>'; |
|
| 135 | + return '<p>'.__('View the question ID. Can be sorted in ascending or descending order.', 'event_espresso').'</p>'; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | protected function _display_text_stop() { |
| 139 | - return '<p>' . __('View available questions. You can reorder your questions by dragging and dropping them.', 'event_espresso') . '</p>'; |
|
| 139 | + return '<p>'.__('View available questions. You can reorder your questions by dragging and dropping them.', 'event_espresso').'</p>'; |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | protected function _admin_label_stop() { |
| 143 | - return '<p>' . __('View the admin label for your questions.', 'event_espresso') . '</p>'; |
|
| 143 | + return '<p>'.__('View the admin label for your questions.', 'event_espresso').'</p>'; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | protected function _type_stop() { |
| 147 | - return '<p>' . __('View the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', 'event_espresso') . '</p>'; |
|
| 147 | + return '<p>'.__('View the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', 'event_espresso').'</p>'; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | protected function _values_stop() { |
| 151 | - return '<p>' . __('View stored values for checkboxes, radio buttons, and select boxes.', 'event_espresso') . '</p>'; |
|
| 151 | + return '<p>'.__('View stored values for checkboxes, radio buttons, and select boxes.', 'event_espresso').'</p>'; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | protected function _required_stop() { |
| 155 | - return '<p>' . __('View if a question is required.', 'event_espresso') . '</p>'; |
|
| 155 | + return '<p>'.__('View if a question is required.', 'event_espresso').'</p>'; |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /* protected function _bulk_actions_stop() { |
@@ -160,11 +160,11 @@ discard block |
||
| 160 | 160 | } */ |
| 161 | 161 | |
| 162 | 162 | protected function _search_stop() { |
| 163 | - return '<p>' . __('Search through questions. The following sources will be searched: Name of Question (display text).', 'event_espresso') . '</p>'; |
|
| 163 | + return '<p>'.__('Search through questions. The following sources will be searched: Name of Question (display text).', 'event_espresso').'</p>'; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | protected function _add_new_question_stop() { |
| 167 | - return '<p>' . __('Click here to add a new question.', 'event_espresso') . '</p>'; |
|
| 167 | + return '<p>'.__('Click here to add a new question.', 'event_espresso').'</p>'; |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | } |
| 171 | 171 | \ No newline at end of file |
@@ -1,6 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | +} |
|
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * Event Espresso |
@@ -1,18 +1,18 @@ |
||
| 1 | 1 | |
| 2 | - <h3 id="reg-admin-reg-details-reg-nmbr-hdr"><?php echo __( 'Registration # ', 'event_espresso' ) . $reg_nmbr['value'];?></h3> |
|
| 3 | - <h2 id="reg-admin-reg-details-reg-date-hdr"><?php echo $reg_datetime['value'];?></h2> |
|
| 2 | + <h3 id="reg-admin-reg-details-reg-nmbr-hdr"><?php echo __('Registration # ', 'event_espresso').$reg_nmbr['value']; ?></h3> |
|
| 3 | + <h2 id="reg-admin-reg-details-reg-date-hdr"><?php echo $reg_datetime['value']; ?></h2> |
|
| 4 | 4 | <h2 id="reg-admin-reg-details-reg-status-hdr"> |
| 5 | - <?php echo __( 'Registration Status : ', 'event_espresso' );?> |
|
| 6 | - <span class="<?php echo $reg_status['class'];?>"><?php echo $reg_status['value'];?></span> |
|
| 5 | + <?php echo __('Registration Status : ', 'event_espresso'); ?> |
|
| 6 | + <span class="<?php echo $reg_status['class']; ?>"><?php echo $reg_status['value']; ?></span> |
|
| 7 | 7 | </h2> |
| 8 | 8 | <h3> |
| 9 | 9 | <?php _e('Change status to: ', 'event_espresso'); ?> |
| 10 | 10 | <span id="reg-admin-approve-decline-reg-status-spn"> |
| 11 | - <?php echo $approve_decline_reg_status_buttons;?> |
|
| 11 | + <?php echo $approve_decline_reg_status_buttons; ?> |
|
| 12 | 12 | </span> |
| 13 | 13 | </h3> |
| 14 | - <?php if ( $registration->group_size() > 1 ) : ?> |
|
| 15 | - <a id="scroll-to-other-attendees" class="scroll-to" href="#other-attendees"><?php echo __( 'Scroll to Other Registrations in the Same Transaction', 'event_espresso' );?></a> |
|
| 14 | + <?php if ($registration->group_size() > 1) : ?> |
|
| 15 | + <a id="scroll-to-other-attendees" class="scroll-to" href="#other-attendees"><?php echo __('Scroll to Other Registrations in the Same Transaction', 'event_espresso'); ?></a> |
|
| 16 | 16 | <?php endif; ?> |
| 17 | 17 | |
| 18 | 18 | |
@@ -4,44 +4,44 @@ discard block |
||
| 4 | 4 | <?php echo $resend_registration_button; ?> |
| 5 | 5 | <br/> |
| 6 | 6 | |
| 7 | - <h4 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-clipboard"></span><?php _e( 'Registration Items', 'event_espresso' );?></h4> |
|
| 7 | + <h4 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-clipboard"></span><?php _e('Registration Items', 'event_espresso'); ?></h4> |
|
| 8 | 8 | |
| 9 | 9 | <div class="admin-primary-mbox-tbl-wrap"> |
| 10 | 10 | <table class="admin-primary-mbox-tbl"> |
| 11 | 11 | <thead> |
| 12 | 12 | <tr> |
| 13 | - <th class="jst-left"><?php _e( 'Line Item ID', 'event_espresso' );?></th> |
|
| 14 | - <th class="jst-left"><?php _e( 'Event Name', 'event_espresso' );?></th> |
|
| 15 | - <th class="jst-left"><?php _e( 'Event Date', 'event_espresso' );?></th> |
|
| 16 | - <th class="jst-left"><?php _e( 'Ticket Option', 'event_espresso' );?></th> |
|
| 17 | - <th class="jst-cntr"><?php _e( 'Price', 'event_espresso' );?></th> |
|
| 18 | - <th class="jst-cntr"><?php _e( 'Qty', 'event_espresso' );?></th> |
|
| 19 | - <th class="jst-cntr"><?php _e( 'Line Total', 'event_espresso' );?></th> |
|
| 13 | + <th class="jst-left"><?php _e('Line Item ID', 'event_espresso'); ?></th> |
|
| 14 | + <th class="jst-left"><?php _e('Event Name', 'event_espresso'); ?></th> |
|
| 15 | + <th class="jst-left"><?php _e('Event Date', 'event_espresso'); ?></th> |
|
| 16 | + <th class="jst-left"><?php _e('Ticket Option', 'event_espresso'); ?></th> |
|
| 17 | + <th class="jst-cntr"><?php _e('Price', 'event_espresso'); ?></th> |
|
| 18 | + <th class="jst-cntr"><?php _e('Qty', 'event_espresso'); ?></th> |
|
| 19 | + <th class="jst-cntr"><?php _e('Line Total', 'event_espresso'); ?></th> |
|
| 20 | 20 | </tr> |
| 21 | 21 | </thead> |
| 22 | 22 | <tbody> |
| 23 | - <?php foreach ( $line_items as $item ) : |
|
| 23 | + <?php foreach ($line_items as $item) : |
|
| 24 | 24 | ?> |
| 25 | 25 | <tr> |
| 26 | - <td class="jst-left"><?php echo $item->get('LIN_code');?></td> |
|
| 27 | - <td class="jst-left"><?php echo $item->ticket_event_name();?></td> |
|
| 28 | - <td class="jst-left"><?php echo $item->ticket_datetime_start('Y-m-d','h:i a'); ?></td> |
|
| 29 | - <td class="jst-left"><?php echo $item->get('LIN_name');?></td> |
|
| 30 | - <td class="jst-rght"><?php echo EEH_Template::format_currency( $item->get('LIN_unit_price') );?></td> |
|
| 31 | - <td class="jst-rght"><?php echo $item->get('LIN_quantity');?></td> |
|
| 32 | - <td class="jst-rght"><?php echo EEH_Template::format_currency($item->get('LIN_total'));?></td> |
|
| 26 | + <td class="jst-left"><?php echo $item->get('LIN_code'); ?></td> |
|
| 27 | + <td class="jst-left"><?php echo $item->ticket_event_name(); ?></td> |
|
| 28 | + <td class="jst-left"><?php echo $item->ticket_datetime_start('Y-m-d', 'h:i a'); ?></td> |
|
| 29 | + <td class="jst-left"><?php echo $item->get('LIN_name'); ?></td> |
|
| 30 | + <td class="jst-rght"><?php echo EEH_Template::format_currency($item->get('LIN_unit_price')); ?></td> |
|
| 31 | + <td class="jst-rght"><?php echo $item->get('LIN_quantity'); ?></td> |
|
| 32 | + <td class="jst-rght"><?php echo EEH_Template::format_currency($item->get('LIN_total')); ?></td> |
|
| 33 | 33 | </tr> |
| 34 | 34 | <?php endforeach; // $items?> |
| 35 | - <?php if ( $taxes ) : ?> |
|
| 36 | - <?php foreach ( $taxes as $tax ) : ?> |
|
| 35 | + <?php if ($taxes) : ?> |
|
| 36 | + <?php foreach ($taxes as $tax) : ?> |
|
| 37 | 37 | <tr> |
| 38 | - <th class=" jst-rght" colspan="6"><?php echo $tax->get('LIN_name');?> (<?php echo $tax->get_pretty('LIN_percent'); ?>%)</th> |
|
| 39 | - <th class=" jst-rght"><?php echo EEH_Template::format_currency( $tax->get('LIN_total'));?></th> |
|
| 38 | + <th class=" jst-rght" colspan="6"><?php echo $tax->get('LIN_name'); ?> (<?php echo $tax->get_pretty('LIN_percent'); ?>%)</th> |
|
| 39 | + <th class=" jst-rght"><?php echo EEH_Template::format_currency($tax->get('LIN_total')); ?></th> |
|
| 40 | 40 | </tr> |
| 41 | 41 | <?php endforeach; // $taxes?> |
| 42 | 42 | <?php endif; // $taxes?> |
| 43 | 43 | <tr class="admin-primary-mbox-total-tr"> |
| 44 | - <th class=" jst-rght" colspan="6"><?php _e( 'Grand Total', 'event_espresso' );?></th> |
|
| 44 | + <th class=" jst-rght" colspan="6"><?php _e('Grand Total', 'event_espresso'); ?></th> |
|
| 45 | 45 | <th class=" jst-rght"><?php echo $grand_total; ?></th> |
| 46 | 46 | </tr> |
| 47 | 47 | </tbody> |
@@ -49,28 +49,28 @@ discard block |
||
| 49 | 49 | </div> |
| 50 | 50 | |
| 51 | 51 | <?php |
| 52 | - if ( WP_DEBUG ) { |
|
| 53 | - $delivered_messages = get_option( 'EED_Messages__maybe_registration', array() ); |
|
| 54 | - if ( isset( $delivered_messages[ $REG_ID ] )) { |
|
| 52 | + if (WP_DEBUG) { |
|
| 53 | + $delivered_messages = get_option('EED_Messages__maybe_registration', array()); |
|
| 54 | + if (isset($delivered_messages[$REG_ID])) { |
|
| 55 | 55 | ?> |
| 56 | - <h4 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-email-alt"></span><?php _e( 'Messages Sent to Registrant', 'event_espresso' );?></h4> |
|
| 56 | + <h4 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-email-alt"></span><?php _e('Messages Sent to Registrant', 'event_espresso'); ?></h4> |
|
| 57 | 57 | |
| 58 | 58 | <div class="admin-primary-mbox-tbl-wrap"> |
| 59 | 59 | <table class="admin-primary-mbox-tbl"> |
| 60 | 60 | <thead> |
| 61 | 61 | <tr> |
| 62 | - <th class="jst-left"><?php _e( 'Date & Time', 'event_espresso' );?></th> |
|
| 63 | - <th class="jst-left"><?php _e( 'Message Type', 'event_espresso' );?></th> |
|
| 64 | - <th class="jst-left"><?php _e( 'REG Status Upon Sending', 'event_espresso' );?></th> |
|
| 62 | + <th class="jst-left"><?php _e('Date & Time', 'event_espresso'); ?></th> |
|
| 63 | + <th class="jst-left"><?php _e('Message Type', 'event_espresso'); ?></th> |
|
| 64 | + <th class="jst-left"><?php _e('REG Status Upon Sending', 'event_espresso'); ?></th> |
|
| 65 | 65 | </tr> |
| 66 | 66 | </thead> |
| 67 | 67 | <tbody> |
| 68 | - <?php foreach ( $delivered_messages[ $REG_ID ] as $timestamp => $delivered_message ) : |
|
| 68 | + <?php foreach ($delivered_messages[$REG_ID] as $timestamp => $delivered_message) : |
|
| 69 | 69 | ?> |
| 70 | 70 | <tr> |
| 71 | - <td class="jst-left"><?php echo gmdate( get_option('date_format') . ' ' . get_option('time_format'), ( $timestamp + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) );?></td> |
|
| 72 | - <td class="jst-left"><?php echo isset( $delivered_message['message_type'] ) ? $delivered_message['message_type'] : '';?></td> |
|
| 73 | - <td class="jst-left"><?php echo isset( $delivered_message['reg_status'] ) ? $delivered_message['reg_status'] : '';?></td> |
|
| 71 | + <td class="jst-left"><?php echo gmdate(get_option('date_format').' '.get_option('time_format'), ($timestamp + (get_option('gmt_offset') * HOUR_IN_SECONDS))); ?></td> |
|
| 72 | + <td class="jst-left"><?php echo isset($delivered_message['message_type']) ? $delivered_message['message_type'] : ''; ?></td> |
|
| 73 | + <td class="jst-left"><?php echo isset($delivered_message['reg_status']) ? $delivered_message['reg_status'] : ''; ?></td> |
|
| 74 | 74 | </tr> |
| 75 | 75 | <?php endforeach; // $delivered_messages?> |
| 76 | 76 | </tbody> |
@@ -82,27 +82,27 @@ discard block |
||
| 82 | 82 | ?> |
| 83 | 83 | |
| 84 | 84 | <a id="display-additional-registration-session-info" class="display-the-hidden smaller-text" rel="additional-registration-session-info"> |
| 85 | - <span class="dashicons dashicons-plus-alt"></span><?php _e( 'view additional registration session details', 'event_espresso' );?> |
|
| 85 | + <span class="dashicons dashicons-plus-alt"></span><?php _e('view additional registration session details', 'event_espresso'); ?> |
|
| 86 | 86 | </a> |
| 87 | 87 | |
| 88 | 88 | <div id="additional-registration-session-info-dv" class="hidden"> |
| 89 | 89 | |
| 90 | 90 | <a id="hide-additional-registration-session-info" class="hide-the-displayed hidden smaller-text" rel="additional-registration-session-info"> |
| 91 | - <span class="dashicons dashicons-dismiss"></span><?php _e( 'hide additional registration session details', 'event_espresso' );?> |
|
| 91 | + <span class="dashicons dashicons-dismiss"></span><?php _e('hide additional registration session details', 'event_espresso'); ?> |
|
| 92 | 92 | </a> |
| 93 | 93 | <br class="clear"/> |
| 94 | 94 | |
| 95 | - <h4 class="admin-primary-mbox-h4"><?php _e( 'Registration Session Details', 'event_espresso' );?></h4> |
|
| 95 | + <h4 class="admin-primary-mbox-h4"><?php _e('Registration Session Details', 'event_espresso'); ?></h4> |
|
| 96 | 96 | |
| 97 | 97 | <table id="admin-primary-mbox-reg-extra-session-info-tbl" class="form-table skinny-rows"> |
| 98 | 98 | <tbody> |
| 99 | - <?php foreach ( $reg_details as $key => $reg_detail ) : ?> |
|
| 99 | + <?php foreach ($reg_details as $key => $reg_detail) : ?> |
|
| 100 | 100 | <tr> |
| 101 | 101 | <th> |
| 102 | - <label for="<?php echo $key;?>"><?php echo $reg_detail['label'];?></label> |
|
| 102 | + <label for="<?php echo $key; ?>"><?php echo $reg_detail['label']; ?></label> |
|
| 103 | 103 | </th> |
| 104 | 104 | <td> |
| 105 | - <?php echo $reg_detail['value'];?> |
|
| 105 | + <?php echo $reg_detail['value']; ?> |
|
| 106 | 106 | </td> |
| 107 | 107 | </tr> |
| 108 | 108 | <?php endforeach; // $reg_details?> |