@@ -42,94 +42,94 @@ discard block |
||
| 42 | 42 | <tr class="wpinv-item wpinv-item-<?php echo sanitize_html_class( $invoice->get_status() ); ?>"> |
| 43 | 43 | <?php |
| 44 | 44 | |
| 45 | - foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : |
|
| 45 | + foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : |
|
| 46 | 46 | |
| 47 | - $column_id = sanitize_html_class( $column_id ); |
|
| 48 | - $class = empty( $column_name['class'] ) ? '' : sanitize_html_class( $column_name['class'] ); |
|
| 47 | + $column_id = sanitize_html_class( $column_id ); |
|
| 48 | + $class = empty( $column_name['class'] ) ? '' : sanitize_html_class( $column_name['class'] ); |
|
| 49 | 49 | |
| 50 | - echo "<td class='$column_id $class'>"; |
|
| 51 | - switch ( $column_id ) { |
|
| 50 | + echo "<td class='$column_id $class'>"; |
|
| 51 | + switch ( $column_id ) { |
|
| 52 | 52 | |
| 53 | - case 'invoice-number': |
|
| 54 | - echo wp_kses_post( wpinv_invoice_link( $invoice ) ); |
|
| 55 | - break; |
|
| 53 | + case 'invoice-number': |
|
| 54 | + echo wp_kses_post( wpinv_invoice_link( $invoice ) ); |
|
| 55 | + break; |
|
| 56 | 56 | |
| 57 | - case 'created-date': |
|
| 58 | - echo getpaid_format_date_value( $invoice->get_date_created() ); |
|
| 59 | - break; |
|
| 57 | + case 'created-date': |
|
| 58 | + echo getpaid_format_date_value( $invoice->get_date_created() ); |
|
| 59 | + break; |
|
| 60 | 60 | |
| 61 | - case 'payment-date': |
|
| 61 | + case 'payment-date': |
|
| 62 | 62 | |
| 63 | - if ( $invoice->needs_payment() ) { |
|
| 64 | - echo "—"; |
|
| 65 | - } else { |
|
| 66 | - echo getpaid_format_date_value( $invoice->get_date_completed() ); |
|
| 67 | - } |
|
| 63 | + if ( $invoice->needs_payment() ) { |
|
| 64 | + echo "—"; |
|
| 65 | + } else { |
|
| 66 | + echo getpaid_format_date_value( $invoice->get_date_completed() ); |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - break; |
|
| 69 | + break; |
|
| 70 | 70 | |
| 71 | - case 'invoice-status': |
|
| 72 | - echo wp_kses_post( $invoice->get_status_label_html() ); |
|
| 71 | + case 'invoice-status': |
|
| 72 | + echo wp_kses_post( $invoice->get_status_label_html() ); |
|
| 73 | 73 | |
| 74 | - break; |
|
| 74 | + break; |
|
| 75 | 75 | |
| 76 | - case 'invoice-total': |
|
| 77 | - echo wpinv_price( $invoice->get_total(), $invoice->get_currency() ); |
|
| 76 | + case 'invoice-total': |
|
| 77 | + echo wpinv_price( $invoice->get_total(), $invoice->get_currency() ); |
|
| 78 | 78 | |
| 79 | - break; |
|
| 79 | + break; |
|
| 80 | 80 | |
| 81 | - case 'invoice-actions': |
|
| 81 | + case 'invoice-actions': |
|
| 82 | 82 | |
| 83 | - $actions = array( |
|
| 83 | + $actions = array( |
|
| 84 | 84 | |
| 85 | - 'pay' => array( |
|
| 86 | - 'url' => $invoice->get_checkout_payment_url(), |
|
| 87 | - 'name' => __( 'Pay Now', 'invoicing' ), |
|
| 88 | - 'class' => 'btn-success' |
|
| 89 | - ), |
|
| 85 | + 'pay' => array( |
|
| 86 | + 'url' => $invoice->get_checkout_payment_url(), |
|
| 87 | + 'name' => __( 'Pay Now', 'invoicing' ), |
|
| 88 | + 'class' => 'btn-success' |
|
| 89 | + ), |
|
| 90 | 90 | |
| 91 | - 'print' => array( |
|
| 92 | - 'url' => $invoice->get_view_url(), |
|
| 93 | - 'name' => __( 'View', 'invoicing' ), |
|
| 94 | - 'class' => 'btn-secondary', |
|
| 95 | - 'attrs' => 'target="_blank"' |
|
| 96 | - ) |
|
| 97 | - ); |
|
| 91 | + 'print' => array( |
|
| 92 | + 'url' => $invoice->get_view_url(), |
|
| 93 | + 'name' => __( 'View', 'invoicing' ), |
|
| 94 | + 'class' => 'btn-secondary', |
|
| 95 | + 'attrs' => 'target="_blank"' |
|
| 96 | + ) |
|
| 97 | + ); |
|
| 98 | 98 | |
| 99 | - if ( ! $invoice->needs_payment() ) { |
|
| 100 | - unset( $actions['pay'] ); |
|
| 101 | - } |
|
| 99 | + if ( ! $invoice->needs_payment() ) { |
|
| 100 | + unset( $actions['pay'] ); |
|
| 101 | + } |
|
| 102 | 102 | |
| 103 | - if ( $invoice->needs_payment() ) { |
|
| 104 | - $actions['delete'] = array( |
|
| 105 | - 'url' => getpaid_get_authenticated_action_url( 'delete_invoice', add_query_arg( 'invoice_id', $invoice->get_id() ) ), |
|
| 106 | - 'name' => __( 'Delete', 'invoicing' ), |
|
| 107 | - 'class' => 'btn-danger' |
|
| 108 | - ); |
|
| 109 | - } |
|
| 103 | + if ( $invoice->needs_payment() ) { |
|
| 104 | + $actions['delete'] = array( |
|
| 105 | + 'url' => getpaid_get_authenticated_action_url( 'delete_invoice', add_query_arg( 'invoice_id', $invoice->get_id() ) ), |
|
| 106 | + 'name' => __( 'Delete', 'invoicing' ), |
|
| 107 | + 'class' => 'btn-danger' |
|
| 108 | + ); |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type ); |
|
| 111 | + $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type ); |
|
| 112 | 112 | |
| 113 | - foreach ( $actions as $key => $action ) { |
|
| 114 | - $class = !empty($action['class']) ? sanitize_html_class($action['class']) : ''; |
|
| 115 | - echo '<a href="' . esc_url( $action['url'] ) . '" class="btn btn-sm btn-block ' . $class . ' ' . sanitize_html_class( $key ) . '" ' . ( !empty($action['attrs']) ? $action['attrs'] : '' ) . '>' . $action['name'] . '</a>'; |
|
| 116 | - } |
|
| 113 | + foreach ( $actions as $key => $action ) { |
|
| 114 | + $class = !empty($action['class']) ? sanitize_html_class($action['class']) : ''; |
|
| 115 | + echo '<a href="' . esc_url( $action['url'] ) . '" class="btn btn-sm btn-block ' . $class . ' ' . sanitize_html_class( $key ) . '" ' . ( !empty($action['attrs']) ? $action['attrs'] : '' ) . '>' . $action['name'] . '</a>'; |
|
| 116 | + } |
|
| 117 | 117 | |
| 118 | - break; |
|
| 118 | + break; |
|
| 119 | 119 | |
| 120 | - default: |
|
| 121 | - do_action( "wpinv_user_invoices_column_$column_id", $invoice ); |
|
| 122 | - break; |
|
| 120 | + default: |
|
| 121 | + do_action( "wpinv_user_invoices_column_$column_id", $invoice ); |
|
| 122 | + break; |
|
| 123 | 123 | |
| 124 | 124 | |
| 125 | - } |
|
| 125 | + } |
|
| 126 | 126 | |
| 127 | - do_action( "wpinv_user_invoices_column_after_$column_id", $invoice ); |
|
| 127 | + do_action( "wpinv_user_invoices_column_after_$column_id", $invoice ); |
|
| 128 | 128 | |
| 129 | - echo '</td>'; |
|
| 129 | + echo '</td>'; |
|
| 130 | 130 | |
| 131 | - endforeach; |
|
| 132 | - ?> |
|
| 131 | + endforeach; |
|
| 132 | + ?> |
|
| 133 | 133 | </tr> |
| 134 | 134 | |
| 135 | 135 | <?php endforeach; ?> |
@@ -143,14 +143,14 @@ discard block |
||
| 143 | 143 | <?php if ( 1 < $invoices->max_num_pages ) : ?> |
| 144 | 144 | <div class="invoicing-Pagination"> |
| 145 | 145 | <?php |
| 146 | - $big = 999999; |
|
| 147 | - |
|
| 148 | - echo paginate_links( array( |
|
| 149 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
| 150 | - 'format' => '?paged=%#%', |
|
| 151 | - 'total' => $invoices->max_num_pages, |
|
| 152 | - ) ); |
|
| 153 | - ?> |
|
| 146 | + $big = 999999; |
|
| 147 | + |
|
| 148 | + echo paginate_links( array( |
|
| 149 | + 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
| 150 | + 'format' => '?paged=%#%', |
|
| 151 | + 'total' => $invoices->max_num_pages, |
|
| 152 | + ) ); |
|
| 153 | + ?> |
|
| 154 | 154 | </div> |
| 155 | 155 | <?php endif; ?> |
| 156 | 156 | |
@@ -13,42 +13,42 @@ |
||
| 13 | 13 | |
| 14 | 14 | foreach ( array_keys( $widget->get_subscriptions_table_columns() ) as $column ) : |
| 15 | 15 | |
| 16 | - $class = sanitize_html_class( $column ); |
|
| 17 | - echo "<td class='getpaid-subscriptions-table-column-$class'>"; |
|
| 16 | + $class = sanitize_html_class( $column ); |
|
| 17 | + echo "<td class='getpaid-subscriptions-table-column-$class'>"; |
|
| 18 | 18 | |
| 19 | - do_action( "getpaid_subscriptions_before_frontend_subscription_table_$column", $subscription ); |
|
| 19 | + do_action( "getpaid_subscriptions_before_frontend_subscription_table_$column", $subscription ); |
|
| 20 | 20 | |
| 21 | - switch( $column ) : |
|
| 21 | + switch( $column ) : |
|
| 22 | 22 | |
| 23 | - case 'subscription': |
|
| 24 | - $subscription_id = (int) $subscription->get_id(); |
|
| 25 | - $url = esc_url( $subscription->get_view_url() ); |
|
| 26 | - $id_label = sprintf( |
|
| 27 | - esc_attr_x( '#%s', 'subscription id', 'invoicing' ), |
|
| 28 | - (int) $subscription->get_id() |
|
| 29 | - ); |
|
| 30 | - echo $widget->add_row_actions( "<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription ); |
|
| 31 | - break; |
|
| 23 | + case 'subscription': |
|
| 24 | + $subscription_id = (int) $subscription->get_id(); |
|
| 25 | + $url = esc_url( $subscription->get_view_url() ); |
|
| 26 | + $id_label = sprintf( |
|
| 27 | + esc_attr_x( '#%s', 'subscription id', 'invoicing' ), |
|
| 28 | + (int) $subscription->get_id() |
|
| 29 | + ); |
|
| 30 | + echo $widget->add_row_actions( "<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription ); |
|
| 31 | + break; |
|
| 32 | 32 | |
| 33 | - case 'status': |
|
| 34 | - echo esc_html( $subscription->get_status_label() ); |
|
| 35 | - break; |
|
| 33 | + case 'status': |
|
| 34 | + echo esc_html( $subscription->get_status_label() ); |
|
| 35 | + break; |
|
| 36 | 36 | |
| 37 | - case 'renewal-date': |
|
| 38 | - $renewal = getpaid_format_date_value( $subscription->get_next_renewal_date() ); |
|
| 39 | - echo $subscription->is_active() ? esc_html( $renewal ) : "—"; |
|
| 40 | - break; |
|
| 37 | + case 'renewal-date': |
|
| 38 | + $renewal = getpaid_format_date_value( $subscription->get_next_renewal_date() ); |
|
| 39 | + echo $subscription->is_active() ? esc_html( $renewal ) : "—"; |
|
| 40 | + break; |
|
| 41 | 41 | |
| 42 | - case 'amount': |
|
| 43 | - $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
| 44 | - $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 45 | - echo wp_kses_post( "<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>" ); |
|
| 46 | - break; |
|
| 42 | + case 'amount': |
|
| 43 | + $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
| 44 | + $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 45 | + echo wp_kses_post( "<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>" ); |
|
| 46 | + break; |
|
| 47 | 47 | |
| 48 | - endswitch; |
|
| 48 | + endswitch; |
|
| 49 | 49 | |
| 50 | - do_action( "getpaid_subscriptions_frontend_subscription_table_$column", $subscription ); |
|
| 50 | + do_action( "getpaid_subscriptions_frontend_subscription_table_$column", $subscription ); |
|
| 51 | 51 | |
| 52 | - echo '</td>'; |
|
| 52 | + echo '</td>'; |
|
| 53 | 53 | |
| 54 | 54 | endforeach; |
@@ -46,64 +46,64 @@ discard block |
||
| 46 | 46 | <td style="width: 65%"> |
| 47 | 47 | <?php |
| 48 | 48 | |
| 49 | - switch ( $key ) { |
|
| 49 | + switch ( $key ) { |
|
| 50 | 50 | |
| 51 | - case 'status': |
|
| 52 | - echo esc_html( $subscription->get_status_label() ); |
|
| 53 | - break; |
|
| 51 | + case 'status': |
|
| 52 | + echo esc_html( $subscription->get_status_label() ); |
|
| 53 | + break; |
|
| 54 | 54 | |
| 55 | - case 'start_date': |
|
| 56 | - echo esc_html( getpaid_format_date_value( $subscription->get_date_created() ) ); |
|
| 57 | - break; |
|
| 55 | + case 'start_date': |
|
| 56 | + echo esc_html( getpaid_format_date_value( $subscription->get_date_created() ) ); |
|
| 57 | + break; |
|
| 58 | 58 | |
| 59 | - case 'expiry_date': |
|
| 60 | - echo esc_html( getpaid_format_date_value( $subscription->get_next_renewal_date() ) ); |
|
| 61 | - break; |
|
| 59 | + case 'expiry_date': |
|
| 60 | + echo esc_html( getpaid_format_date_value( $subscription->get_next_renewal_date() ) ); |
|
| 61 | + break; |
|
| 62 | 62 | |
| 63 | - case 'initial_amount': |
|
| 64 | - echo wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 63 | + case 'initial_amount': |
|
| 64 | + echo wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 65 | 65 | |
| 66 | - if ( $subscription->has_trial_period() ) { |
|
| 66 | + if ( $subscription->has_trial_period() ) { |
|
| 67 | 67 | |
| 68 | - echo "<small class='text-muted'> "; |
|
| 69 | - printf( |
|
| 70 | - _x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ), |
|
| 71 | - esc_html( $subscription->get_trial_period() ) |
|
| 72 | - ); |
|
| 73 | - echo '</small>'; |
|
| 68 | + echo "<small class='text-muted'> "; |
|
| 69 | + printf( |
|
| 70 | + _x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ), |
|
| 71 | + esc_html( $subscription->get_trial_period() ) |
|
| 72 | + ); |
|
| 73 | + echo '</small>'; |
|
| 74 | 74 | |
| 75 | - } |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | - break; |
|
| 77 | + break; |
|
| 78 | 78 | |
| 79 | - case 'recurring_amount': |
|
| 80 | - $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
| 81 | - $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 82 | - echo wp_kses_post( strtolower( "<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>" ) ); |
|
| 83 | - break; |
|
| 79 | + case 'recurring_amount': |
|
| 80 | + $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
| 81 | + $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 82 | + echo wp_kses_post( strtolower( "<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>" ) ); |
|
| 83 | + break; |
|
| 84 | 84 | |
| 85 | - case 'item': |
|
| 85 | + case 'item': |
|
| 86 | 86 | |
| 87 | - if ( empty( $subscription_group ) ) { |
|
| 88 | - echo wp_kses_post( WPInv_Subscriptions_List_Table::generate_item_markup( $subscription->get_product_id() ) ); |
|
| 89 | - } else { |
|
| 90 | - $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) ); |
|
| 91 | - echo wp_kses_post( implode( ' | ', $markup ) ); |
|
| 92 | - } |
|
| 87 | + if ( empty( $subscription_group ) ) { |
|
| 88 | + echo wp_kses_post( WPInv_Subscriptions_List_Table::generate_item_markup( $subscription->get_product_id() ) ); |
|
| 89 | + } else { |
|
| 90 | + $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) ); |
|
| 91 | + echo wp_kses_post( implode( ' | ', $markup ) ); |
|
| 92 | + } |
|
| 93 | 93 | |
| 94 | - break; |
|
| 94 | + break; |
|
| 95 | 95 | |
| 96 | - case 'payments': |
|
| 96 | + case 'payments': |
|
| 97 | 97 | |
| 98 | - $max_activations = (int) $subscription->get_bill_times(); |
|
| 99 | - echo ( (int) $subscription->get_times_billed() ) . ' / ' . ( empty( $max_activations ) ? "∞" : (int) $max_activations ); |
|
| 98 | + $max_activations = (int) $subscription->get_bill_times(); |
|
| 99 | + echo ( (int) $subscription->get_times_billed() ) . ' / ' . ( empty( $max_activations ) ? "∞" : (int) $max_activations ); |
|
| 100 | 100 | |
| 101 | - break; |
|
| 101 | + break; |
|
| 102 | 102 | |
| 103 | - } |
|
| 104 | - do_action( "getpaid_render_single_subscription_column_$key", $subscription ); |
|
| 103 | + } |
|
| 104 | + do_action( "getpaid_render_single_subscription_column_$key", $subscription ); |
|
| 105 | 105 | |
| 106 | - ?> |
|
| 106 | + ?> |
|
| 107 | 107 | </td> |
| 108 | 108 | |
| 109 | 109 | </tr> |
@@ -130,17 +130,17 @@ discard block |
||
| 130 | 130 | <span class="form-text"> |
| 131 | 131 | |
| 132 | 132 | <?php |
| 133 | - if ( $subscription->can_cancel() ) { |
|
| 134 | - printf( |
|
| 135 | - '<a href="%s" class="btn btn-danger btn-sm" onclick="return confirm(\'%s\')">%s</a> ', |
|
| 136 | - esc_url( $subscription->get_cancel_url() ), |
|
| 137 | - esc_attr__( 'Are you sure you want to cancel this subscription?', 'invoicing' ), |
|
| 138 | - __( 'Cancel Subscription', 'invoicing' ) |
|
| 139 | - ); |
|
| 140 | - } |
|
| 141 | - |
|
| 142 | - do_action( 'getpaid-single-subscription-page-actions', $subscription ); |
|
| 143 | - ?> |
|
| 133 | + if ( $subscription->can_cancel() ) { |
|
| 134 | + printf( |
|
| 135 | + '<a href="%s" class="btn btn-danger btn-sm" onclick="return confirm(\'%s\')">%s</a> ', |
|
| 136 | + esc_url( $subscription->get_cancel_url() ), |
|
| 137 | + esc_attr__( 'Are you sure you want to cancel this subscription?', 'invoicing' ), |
|
| 138 | + __( 'Cancel Subscription', 'invoicing' ) |
|
| 139 | + ); |
|
| 140 | + } |
|
| 141 | + |
|
| 142 | + do_action( 'getpaid-single-subscription-page-actions', $subscription ); |
|
| 143 | + ?> |
|
| 144 | 144 | |
| 145 | 145 | <a href="<?php echo esc_url( getpaid_get_tab_url( 'gp-subscriptions', get_permalink( (int) wpinv_get_option( 'invoice_subscription_page' ) ) ) ); ?>" class="btn btn-secondary btn-sm"><?php _e( 'Go Back', 'invoicing' ); ?></a> |
| 146 | 146 | </span> |