@@ -42,94 +42,94 @@ discard block |
||
| 42 | 42 | <tr class="wpinv-item wpinv-item-<?php echo $invoice_status = $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 wpinv_invoice_link( $invoice ); |
|
| 55 | - break; |
|
| 53 | + case 'invoice-number': |
|
| 54 | + echo 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 $invoice->get_status_label_html(); |
|
| 71 | + case 'invoice-status': |
|
| 72 | + echo $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 | |