@@ -1,7 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // don't load directly |
3 | -if ( !defined('ABSPATH') ) |
|
3 | +if ( !defined('ABSPATH') ) { |
|
4 | 4 | die('-1'); |
5 | +} |
|
5 | 6 | |
6 | 7 | do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
7 | 8 | ?> |
@@ -1,7 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // don't load directly |
3 | -if ( !defined('ABSPATH') ) |
|
3 | +if ( !defined('ABSPATH') ) { |
|
4 | 4 | die('-1'); |
5 | +} |
|
5 | 6 | |
6 | 7 | do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
7 | 8 | ?> |
@@ -1,7 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // don't load directly |
3 | -if ( !defined('ABSPATH') ) |
|
3 | +if ( !defined('ABSPATH') ) { |
|
4 | 4 | die('-1'); |
5 | +} |
|
5 | 6 | |
6 | 7 | do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
7 | 8 |
@@ -1,7 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // don't load directly |
3 | -if ( !defined('ABSPATH') ) |
|
3 | +if ( !defined('ABSPATH') ) { |
|
4 | 4 | die('-1'); |
5 | +} |
|
5 | 6 | |
6 | 7 | do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
7 | 8 | ?> |
@@ -1,7 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // don't load directly |
3 | -if ( !defined('ABSPATH') ) |
|
3 | +if ( !defined('ABSPATH') ) { |
|
4 | 4 | die('-1'); |
5 | +} |
|
5 | 6 | |
6 | 7 | do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
7 | 8 |
@@ -1,7 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // don't load directly |
3 | -if ( !defined('ABSPATH') ) |
|
3 | +if ( !defined('ABSPATH') ) { |
|
4 | 4 | die('-1'); |
5 | +} |
|
5 | 6 | |
6 | 7 | do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
7 | 8 | ?> |
@@ -1,6 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // Exit if accessed directly |
3 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
3 | +if ( ! defined( 'ABSPATH' ) ) { |
|
4 | + exit; |
|
5 | +} |
|
4 | 6 | |
5 | 7 | function wpinv_get_users_invoices( $user = 0, $number = 20, $pagination = false, $status = 'publish' ) { |
6 | 8 | if ( empty( $user ) ) { |
@@ -12,12 +14,13 @@ discard block |
||
12 | 14 | } |
13 | 15 | |
14 | 16 | if ( $pagination ) { |
15 | - if ( get_query_var( 'paged' ) ) |
|
16 | - $paged = get_query_var('paged'); |
|
17 | - else if ( get_query_var( 'page' ) ) |
|
18 | - $paged = get_query_var( 'page' ); |
|
19 | - else |
|
20 | - $paged = 1; |
|
17 | + if ( get_query_var( 'paged' ) ) { |
|
18 | + $paged = get_query_var('paged'); |
|
19 | + } else if ( get_query_var( 'page' ) ) { |
|
20 | + $paged = get_query_var( 'page' ); |
|
21 | + } else { |
|
22 | + $paged = 1; |
|
23 | + } |
|
21 | 24 | } |
22 | 25 | |
23 | 26 | $args = array( |
@@ -32,8 +35,9 @@ discard block |
||
32 | 35 | $invoices = get_posts( $args ); |
33 | 36 | |
34 | 37 | // No invoices |
35 | - if ( ! $invoices ) |
|
36 | - return false; |
|
38 | + if ( ! $invoices ) { |
|
39 | + return false; |
|
40 | + } |
|
37 | 41 | |
38 | 42 | return $invoices; |
39 | 43 | } |
@@ -93,12 +93,13 @@ |
||
93 | 93 | <?php |
94 | 94 | $big = 999999; |
95 | 95 | |
96 | - if (get_query_var('paged')) |
|
97 | - $current_page = get_query_var('paged'); |
|
98 | - elseif (get_query_var('page')) |
|
99 | - $current_page = get_query_var('page'); |
|
100 | - else |
|
101 | - $current_page = 1; |
|
96 | + if (get_query_var('paged')) { |
|
97 | + $current_page = get_query_var('paged'); |
|
98 | + } elseif (get_query_var('page')) { |
|
99 | + $current_page = get_query_var('page'); |
|
100 | + } else { |
|
101 | + $current_page = 1; |
|
102 | + } |
|
102 | 103 | |
103 | 104 | echo paginate_links( array( |
104 | 105 | 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
@@ -169,8 +169,9 @@ discard block |
||
169 | 169 | |
170 | 170 | // Setup possible parts |
171 | 171 | $templates = array(); |
172 | - if ( isset( $name ) ) |
|
173 | - $templates[] = $slug . '-' . $name . '.php'; |
|
172 | + if ( isset( $name ) ) { |
|
173 | + $templates[] = $slug . '-' . $name . '.php'; |
|
174 | + } |
|
174 | 175 | $templates[] = $slug . '.php'; |
175 | 176 | |
176 | 177 | // Allow template parts to be filtered |
@@ -188,8 +189,9 @@ discard block |
||
188 | 189 | foreach ( (array)$template_names as $template_name ) { |
189 | 190 | |
190 | 191 | // Continue if template is empty |
191 | - if ( empty( $template_name ) ) |
|
192 | - continue; |
|
192 | + if ( empty( $template_name ) ) { |
|
193 | + continue; |
|
194 | + } |
|
193 | 195 | |
194 | 196 | // Trim off any slashes from the template name |
195 | 197 | $template_name = ltrim( $template_name, '/' ); |
@@ -208,8 +210,9 @@ discard block |
||
208 | 210 | } |
209 | 211 | } |
210 | 212 | |
211 | - if ( ( true == $load ) && ! empty( $located ) ) |
|
212 | - load_template( $located, $require_once ); |
|
213 | + if ( ( true == $load ) && ! empty( $located ) ) { |
|
214 | + load_template( $located, $require_once ); |
|
215 | + } |
|
213 | 216 | |
214 | 217 | return $located; |
215 | 218 | } |
@@ -285,8 +288,9 @@ discard block |
||
285 | 288 | function wpinv_html_dropdown( $name = 'wpinv_discounts', $selected = 0, $status = '' ) { |
286 | 289 | $args = array( 'nopaging' => true ); |
287 | 290 | |
288 | - if ( ! empty( $status ) ) |
|
289 | - $args['post_status'] = $status; |
|
291 | + if ( ! empty( $status ) ) { |
|
292 | + $args['post_status'] = $status; |
|
293 | + } |
|
290 | 294 | |
291 | 295 | $discounts = wpinv_get_discounts( $args ); |
292 | 296 | $options = array(); |
@@ -893,8 +897,11 @@ discard block |
||
893 | 897 | |
894 | 898 | $invoice_status = wpinv_get_invoice_status( $invoice_id ); |
895 | 899 | |
896 | - if($invoice->post_type == 'wpi_invoice') $type = 'Invoice'; |
|
897 | - elseif($invoice->post_type == 'wpi_quote') $type = 'Quote'; |
|
900 | + if($invoice->post_type == 'wpi_invoice') { |
|
901 | + $type = 'Invoice'; |
|
902 | + } elseif($invoice->post_type == 'wpi_quote') { |
|
903 | + $type = 'Quote'; |
|
904 | + } |
|
898 | 905 | ?> |
899 | 906 | <table class="table table-bordered table-sm"> |
900 | 907 | <?php if ( $invoice_number = wpinv_get_invoice_number( $invoice_id ) ) { ?> |
@@ -1461,17 +1468,19 @@ discard block |
||
1461 | 1468 | add_action( 'wpinv_cart_empty', 'wpinv_empty_checkout_cart' ); |
1462 | 1469 | |
1463 | 1470 | function wpinv_save_cart_button() { |
1464 | - if ( wpinv_is_cart_saving_disabled() ) |
|
1465 | - return; |
|
1466 | -?> |
|
1471 | + if ( wpinv_is_cart_saving_disabled() ) { |
|
1472 | + return; |
|
1473 | + } |
|
1474 | + ?> |
|
1467 | 1475 | <a class="wpinv-cart-saving-button wpinv-submit button" id="wpinv-save-cart-button" href="<?php echo esc_url( add_query_arg( 'wpi_action', 'save_cart' ) ); ?>"><?php _e( 'Save Cart', 'invoicing' ); ?></a> |
1468 | 1476 | <?php |
1469 | 1477 | } |
1470 | 1478 | |
1471 | 1479 | function wpinv_update_cart_button() { |
1472 | - if ( !wpinv_item_quantities_enabled() ) |
|
1473 | - return; |
|
1474 | -?> |
|
1480 | + if ( !wpinv_item_quantities_enabled() ) { |
|
1481 | + return; |
|
1482 | + } |
|
1483 | + ?> |
|
1475 | 1484 | <input type="submit" name="wpinv_update_cart_submit" class="wpinv-submit wpinv-no-js button" value="<?php _e( 'Update Cart', 'invoicing' ); ?>"/> |
1476 | 1485 | <input type="hidden" name="wpi_action" value="update_cart"/> |
1477 | 1486 | <?php |
@@ -1612,7 +1621,7 @@ discard block |
||
1612 | 1621 | </div> |
1613 | 1622 | <?php |
1614 | 1623 | } |
1615 | - }else{ |
|
1624 | + } else{ |
|
1616 | 1625 | echo '<div class="alert alert-warning">'. __('No payment gateway active','invoicing') .'</div>'; |
1617 | 1626 | } |
1618 | 1627 |