@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php |
|
1 | + <?php |
|
2 | 2 | /** |
3 | 3 | * Displays right side of the invoice header. |
4 | 4 | * |
@@ -8,56 +8,56 @@ discard block |
||
8 | 8 | * @var WPInv_Invoice $invoice |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | + defined( 'ABSPATH' ) || exit; |
|
12 | 12 | |
13 | -?> |
|
13 | + ?> |
|
14 | 14 | |
15 | 15 | <div class="getpaid-header-right-actions"> |
16 | 16 | |
17 | 17 | <?php |
18 | 18 | |
19 | - $actions = array(); |
|
19 | + $actions = array(); |
|
20 | 20 | |
21 | - echo sprintf( |
|
22 | - '<a href="javascript:void(0)" class="btn btn-sm m-1 d-inline-block btn-secondary text-white invoice-action-print d-none d-lg-inline-block" onclick="window.print();">%s</a>', |
|
23 | - sprintf( |
|
24 | - esc_html__( 'Print %s', 'invoicing' ), |
|
25 | - esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) |
|
26 | - ) |
|
27 | - ); |
|
28 | - |
|
29 | - if ( is_user_logged_in() ) { |
|
30 | - |
|
31 | - $actions[] = sprintf( |
|
32 | - '<a href="%s" class="btn btn-sm btn-secondary text-white m-1 d-inline-block invoice-action-history">%s</a>', |
|
33 | - esc_url( wpinv_get_history_page_uri( $invoice->get_post_type() ) ), |
|
21 | + echo sprintf( |
|
22 | + '<a href="javascript:void(0)" class="btn btn-sm m-1 d-inline-block btn-secondary text-white invoice-action-print d-none d-lg-inline-block" onclick="window.print();">%s</a>', |
|
34 | 23 | sprintf( |
35 | - __( '%s History', 'invoicing' ), |
|
24 | + esc_html__( 'Print %s', 'invoicing' ), |
|
36 | 25 | esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) |
37 | 26 | ) |
38 | 27 | ); |
39 | 28 | |
40 | - } |
|
29 | + if ( is_user_logged_in() ) { |
|
41 | 30 | |
42 | - if ( wpinv_current_user_can_manage_invoicing() ) { |
|
31 | + $actions[] = sprintf( |
|
32 | + '<a href="%s" class="btn btn-sm btn-secondary text-white m-1 d-inline-block invoice-action-history">%s</a>', |
|
33 | + esc_url( wpinv_get_history_page_uri( $invoice->get_post_type() ) ), |
|
34 | + sprintf( |
|
35 | + __( '%s History', 'invoicing' ), |
|
36 | + esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) |
|
37 | + ) |
|
38 | + ); |
|
43 | 39 | |
44 | - $actions[] = sprintf( |
|
45 | - '<a href="%s" class="btn btn-sm btn-secondary text-white m-1 d-inline-block invoice-action-edit">%s</a>', |
|
46 | - esc_url( get_edit_post_link( $invoice->get_id() ) ), |
|
47 | - sprintf( |
|
48 | - __( 'Edit %s', 'invoicing' ), |
|
49 | - esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) |
|
50 | - ) |
|
51 | - ); |
|
40 | + } |
|
41 | + |
|
42 | + if ( wpinv_current_user_can_manage_invoicing() ) { |
|
52 | 43 | |
53 | - } |
|
44 | + $actions[] = sprintf( |
|
45 | + '<a href="%s" class="btn btn-sm btn-secondary text-white m-1 d-inline-block invoice-action-edit">%s</a>', |
|
46 | + esc_url( get_edit_post_link( $invoice->get_id() ) ), |
|
47 | + sprintf( |
|
48 | + __( 'Edit %s', 'invoicing' ), |
|
49 | + esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) |
|
50 | + ) |
|
51 | + ); |
|
54 | 52 | |
55 | - $actions = apply_filters( 'getpaid_invoice_header_right_actions_array', $actions, $invoice ); |
|
56 | - echo wp_kses_post( implode( '', $actions ) ); |
|
53 | + } |
|
57 | 54 | |
58 | - ?> |
|
55 | + $actions = apply_filters( 'getpaid_invoice_header_right_actions_array', $actions, $invoice ); |
|
56 | + echo wp_kses_post( implode( '', $actions ) ); |
|
59 | 57 | |
58 | + ?> |
|
59 | + |
|
60 | 60 | <?php do_action( 'wpinv_invoice_display_right_actions', $invoice ); ?> |
61 | - </div> |
|
61 | + </div> |
|
62 | 62 | |
63 | -<?php |
|
63 | + <?php |