Passed
Push — master ( 3a0618...5aee45 )
by Stiofan
05:13
created
templates/payment-forms/elements/heading.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-$tag  = isset( $element['level'] ) ? trim( $element['level'] ) : 'h3';
13
-$text = isset( $element['text'] ) ? trim( $element['text'] ) : '';
12
+$tag  = isset($element['level']) ? trim($element['level']) : 'h3';
13
+$text = isset($element['text']) ? trim($element['text']) : '';
14 14
 
15
-if ( ! empty( $text ) ) {
15
+if (!empty($text)) {
16 16
     echo "<$tag>$text</$tag>";
17 17
 }
Please login to merge, or discard this patch.
templates/payment-forms/elements/paragraph.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-$text = isset( $element['text'] ) ? trim( $element['text'] ) : '';
12
+$text = isset($element['text']) ? trim($element['text']) : '';
13 13
 
14
-if ( ! empty( $text ) ) {
14
+if (!empty($text)) {
15 15
     echo "<p>$text</p>";
16 16
 }
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-getpaid-meta-box-payment-form-info.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 if ( ! defined( 'ABSPATH' ) ) {
11
-	exit; // Exit if accessed directly
11
+    exit; // Exit if accessed directly
12 12
 }
13 13
 
14 14
 /**
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 class GetPaid_Meta_Box_Payment_Form_Info {
18 18
 
19 19
     /**
20
-	 * Output the metabox.
21
-	 *
22
-	 * @param WP_Post $post
23
-	 */
20
+     * Output the metabox.
21
+     *
22
+     * @param WP_Post $post
23
+     */
24 24
     public static function output( $post ) {
25 25
 
26 26
         // Prepare the form.
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  *
8 8
  */
9 9
 
10
-if ( ! defined( 'ABSPATH' ) ) {
10
+if (!defined('ABSPATH')) {
11 11
 	exit; // Exit if accessed directly
12 12
 }
13 13
 
@@ -21,43 +21,43 @@  discard block
 block discarded – undo
21 21
 	 *
22 22
 	 * @param WP_Post $post
23 23
 	 */
24
-    public static function output( $post ) {
24
+    public static function output($post) {
25 25
 
26 26
         // Prepare the form.
27
-        $form = new GetPaid_Payment_Form( $post );
27
+        $form = new GetPaid_Payment_Form($post);
28 28
 
29 29
         ?>
30 30
 
31 31
         <div class='bsui' style='padding-top: 10px;'>
32
-            <?php do_action( 'wpinv_payment_form_before_info_metabox', $form ); ?>
32
+            <?php do_action('wpinv_payment_form_before_info_metabox', $form); ?>
33 33
 
34 34
             <div class="wpinv_payment_form_shortcode form-group row">
35 35
                 <label for="wpinv_payment_form_shortcode" class="col-sm-12 col-form-label">
36
-                    <?php _e( 'Payment Form Shortcode', 'invoicing' );?>
37
-                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Displays a payment form', 'invoicing' ); ?>"></span>
36
+                    <?php _e('Payment Form Shortcode', 'invoicing'); ?>
37
+                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Displays a payment form', 'invoicing'); ?>"></span>
38 38
                 </label>
39 39
 
40 40
                 <div class="col-sm-12">
41
-                    <input  onClick="this.select()" type="text" id="wpinv_payment_form_shortcode" value="[getpaid form=<?php echo esc_attr( $form->get_id() ); ?>]" style="width: 100%;" />
41
+                    <input  onClick="this.select()" type="text" id="wpinv_payment_form_shortcode" value="[getpaid form=<?php echo esc_attr($form->get_id()); ?>]" style="width: 100%;" />
42 42
                 </div>
43 43
             </div>
44 44
 
45 45
             <div class="wpinv_payment_form_buy_shortcode form-group row">
46 46
                 <label for="wpinv_payment_form_buy_shortcode" class="col-sm-12 col-form-label">
47
-                    <?php _e( 'Payment Button Shortcode', 'invoicing' );?>
48
-                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Displays a buy now button', 'invoicing' ); ?>"></span>
47
+                    <?php _e('Payment Button Shortcode', 'invoicing'); ?>
48
+                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Displays a buy now button', 'invoicing'); ?>"></span>
49 49
                 </label>
50 50
 
51 51
                 <div class="col-sm-12">
52
-                    <input onClick="this.select()" type="text" id="wpinv_payment_form_buy_shortcode" value="[getpaid form=<?php echo esc_attr( $form->get_id() ); ?> button='Buy Now']" style="width: 100%;" />
52
+                    <input onClick="this.select()" type="text" id="wpinv_payment_form_buy_shortcode" value="[getpaid form=<?php echo esc_attr($form->get_id()); ?> button='Buy Now']" style="width: 100%;" />
53 53
                     <small class="form-text text-muted">
54
-                        <?php _e( 'Or use the following URL in a link:', 'invoicing' );?>
55
-                        <code>#getpaid-form-<?php echo intval( $form->get_id() ); ?></code>
54
+                        <?php _e('Or use the following URL in a link:', 'invoicing'); ?>
55
+                        <code>#getpaid-form-<?php echo intval($form->get_id()); ?></code>
56 56
                     </small>
57 57
                 </div>
58 58
             </div>
59 59
 
60
-            <?php do_action( 'wpinv_payment_form_info_metabox', $form ); ?>
60
+            <?php do_action('wpinv_payment_form_info_metabox', $form); ?>
61 61
         </div>
62 62
         <?php
63 63
 
Please login to merge, or discard this patch.
templates/payment-forms/elements/items.php 2 patches
Switch Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -18,15 +18,15 @@
 block discarded – undo
18 18
 }
19 19
 
20 20
 switch( $items_type ) {
21
-    case 'radio':
22
-        wpinv_get_template( 'payment-forms/variations/radio.php', compact( 'form', 'items_type' ) );
23
-        break;
24
-    case 'checkbox':
25
-        wpinv_get_template( 'payment-forms/variations/checkbox.php', compact( 'form', 'items_type' ) );
26
-        break;
27
-    case 'select':
28
-        wpinv_get_template( 'payment-forms/variations/select.php', compact( 'form', 'items_type' ) );
29
-        break;
21
+        case 'radio':
22
+            wpinv_get_template( 'payment-forms/variations/radio.php', compact( 'form', 'items_type' ) );
23
+            break;
24
+        case 'checkbox':
25
+            wpinv_get_template( 'payment-forms/variations/checkbox.php', compact( 'form', 'items_type' ) );
26
+            break;
27
+        case 'select':
28
+            wpinv_get_template( 'payment-forms/variations/select.php', compact( 'form', 'items_type' ) );
29
+            break;
30 30
 }
31 31
 
32 32
 // Display the cart totals.
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -7,36 +7,36 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-if ( empty( $form->get_items() ) ) {
12
+if (empty($form->get_items())) {
13 13
     return;
14 14
 }
15 15
 
16
-if ( empty( $items_type ) ) {
16
+if (empty($items_type)) {
17 17
     $items_type = 'total';
18 18
 }
19 19
 
20
-switch( $items_type ) {
20
+switch ($items_type) {
21 21
     case 'radio':
22
-        wpinv_get_template( 'payment-forms/variations/radio.php', compact( 'form', 'items_type' ) );
22
+        wpinv_get_template('payment-forms/variations/radio.php', compact('form', 'items_type'));
23 23
         break;
24 24
     case 'checkbox':
25
-        wpinv_get_template( 'payment-forms/variations/checkbox.php', compact( 'form', 'items_type' ) );
25
+        wpinv_get_template('payment-forms/variations/checkbox.php', compact('form', 'items_type'));
26 26
         break;
27 27
     case 'select':
28
-        wpinv_get_template( 'payment-forms/variations/select.php', compact( 'form', 'items_type' ) );
28
+        wpinv_get_template('payment-forms/variations/select.php', compact('form', 'items_type'));
29 29
         break;
30 30
 }
31 31
 
32 32
 // Display the cart totals.
33
-if ( ! empty( $hide_cart ) ) {
33
+if (!empty($hide_cart)) {
34 34
     echo '<div class="d-none">';
35 35
 }
36 36
 
37 37
 // Display the cart totals.
38
-wpinv_get_template( 'payment-forms/cart.php', compact( 'form', 'items_type' ) );
38
+wpinv_get_template('payment-forms/cart.php', compact('form', 'items_type'));
39 39
 
40
-if ( ! empty( $hide_cart ) ) {
40
+if (!empty($hide_cart)) {
41 41
     echo '</div>';
42 42
 }
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-getpaid-meta-box-invoice-items.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 if ( ! defined( 'ABSPATH' ) ) {
11
-	exit; // Exit if accessed directly
11
+    exit; // Exit if accessed directly
12 12
 }
13 13
 
14 14
 /**
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 class GetPaid_Meta_Box_Invoice_Items {
18 18
 
19 19
     /**
20
-	 * Output the metabox.
21
-	 *
22
-	 * @param WP_Post $post
23
-	 */
20
+     * Output the metabox.
21
+     *
22
+     * @param WP_Post $post
23
+     */
24 24
     public static function output( $post ) {
25 25
 
26 26
         // Prepare the invoice.
Please login to merge, or discard this patch.
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  *
8 8
  */
9 9
 
10
-if ( ! defined( 'ABSPATH' ) ) {
10
+if (!defined('ABSPATH')) {
11 11
 	exit; // Exit if accessed directly
12 12
 }
13 13
 
@@ -21,42 +21,42 @@  discard block
 block discarded – undo
21 21
 	 *
22 22
 	 * @param WP_Post $post
23 23
 	 */
24
-    public static function output( $post ) {
24
+    public static function output($post) {
25 25
 
26 26
         // Prepare the invoice.
27
-        $invoice = new WPInv_Invoice( $post );
27
+        $invoice = new WPInv_Invoice($post);
28 28
 
29 29
         // Invoice items.
30 30
         $items = $invoice->get_items();
31 31
 
32 32
         // New item url.
33
-        $new_item = admin_url( 'post-new.php?post_type=wpi_item' );
33
+        $new_item = admin_url('post-new.php?post_type=wpi_item');
34 34
 
35 35
         $totals = array(
36 36
 
37 37
             'subtotal'  => array(
38
-                'label' => __( 'Items Subtotal', 'invoicing' ),
39
-                'value' => wpinv_price( $invoice->get_subtotal(), $invoice->get_currency() ),
38
+                'label' => __('Items Subtotal', 'invoicing'),
39
+                'value' => wpinv_price($invoice->get_subtotal(), $invoice->get_currency()),
40 40
             ),
41 41
 
42 42
             'discount'  => array(
43
-                'label' => __( 'Total Discount', 'invoicing' ),
44
-                'value' => wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() ),
43
+                'label' => __('Total Discount', 'invoicing'),
44
+                'value' => wpinv_price($invoice->get_total_discount(), $invoice->get_currency()),
45 45
             ),
46 46
 
47 47
             'tax'       => array(
48
-                'label' => __( 'Total Tax', 'invoicing' ),
49
-                'value' => wpinv_price( $invoice->get_total_tax(), $invoice->get_currency() ),
48
+                'label' => __('Total Tax', 'invoicing'),
49
+                'value' => wpinv_price($invoice->get_total_tax(), $invoice->get_currency()),
50 50
             ),
51 51
 
52 52
             'total'     => array(
53
-                'label' => __( 'Invoice Total', 'invoicing' ),
54
-                'value' => wpinv_price( $invoice->get_total(), $invoice->get_currency() ),
53
+                'label' => __('Invoice Total', 'invoicing'),
54
+                'value' => wpinv_price($invoice->get_total(), $invoice->get_currency()),
55 55
             )
56 56
         );
57 57
 
58
-        if ( ! wpinv_use_taxes() ) {
59
-            unset( $totals['tax'] );
58
+        if (!wpinv_use_taxes()) {
59
+            unset($totals['tax']);
60 60
         }
61 61
         ?>
62 62
 
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
             }
73 73
         </style>
74 74
 
75
-                <div class="bsui getpaid-invoice-items-inner <?php echo sanitize_html_class( $invoice->get_template( 'edit' ) ); ?> <?php echo empty( $items ) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem">
75
+                <div class="bsui getpaid-invoice-items-inner <?php echo sanitize_html_class($invoice->get_template('edit')); ?> <?php echo empty($items) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem">
76 76
 
77
-                    <?php if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) : ?>
78
-                        <?php do_action( 'wpinv_meta_box_before_invoice_template_row', $invoice->get_id() ); ?>
77
+                    <?php if (!$invoice->is_paid() && !$invoice->is_refunded()) : ?>
78
+                        <?php do_action('wpinv_meta_box_before_invoice_template_row', $invoice->get_id()); ?>
79 79
 
80 80
                         <div class="row">
81 81
                             <div class="col-12 col-sm-6">
@@ -84,15 +84,15 @@  discard block
 block discarded – undo
84 84
                                         array(
85 85
                                             'id'          => 'wpinv_template',
86 86
                                             'name'        => 'wpinv_template',
87
-                                            'label'       => __( 'Template', 'invoicing' ),
87
+                                            'label'       => __('Template', 'invoicing'),
88 88
                                             'label_type'  => 'vertical',
89
-                                            'placeholder' => __( 'Choose a template', 'invoicing' ),
89
+                                            'placeholder' => __('Choose a template', 'invoicing'),
90 90
                                             'class'       => 'form-control-sm',
91
-                                            'value'       => $invoice->get_template( 'edit' ),
91
+                                            'value'       => $invoice->get_template('edit'),
92 92
                                             'options'     => array(
93
-                                                'quantity' => __( 'Quantity', 'invoicing' ),
94
-                                                'hours'    => __( 'Hours', 'invoicing' ),
95
-                                                'amount'   => __( 'Amount Only', 'invoicing' ),
93
+                                                'quantity' => __('Quantity', 'invoicing'),
94
+                                                'hours'    => __('Hours', 'invoicing'),
95
+                                                'amount'   => __('Amount Only', 'invoicing'),
96 96
                                             ),
97 97
                                             'data-allow-clear' => 'false',
98 98
                                             'select2'          => true,
@@ -108,11 +108,11 @@  discard block
 block discarded – undo
108 108
                                         array(
109 109
                                             'id'          => 'wpinv_currency',
110 110
                                             'name'        => 'wpinv_currency',
111
-                                            'label'       => __( 'Currency', 'invoicing' ),
111
+                                            'label'       => __('Currency', 'invoicing'),
112 112
                                             'label_type'  => 'vertical',
113
-                                            'placeholder' => __( 'Select Invoice Currency', 'invoicing' ),
113
+                                            'placeholder' => __('Select Invoice Currency', 'invoicing'),
114 114
                                             'class'       => 'form-control-sm',
115
-                                            'value'       => $invoice->get_currency( 'edit' ),
115
+                                            'value'       => $invoice->get_currency('edit'),
116 116
                                             'required'    => false,
117 117
                                             'data-allow-clear' => 'false',
118 118
                                             'select2'          => true,
@@ -124,24 +124,24 @@  discard block
 block discarded – undo
124 124
                             </div>
125 125
                         </div>
126 126
 
127
-                        <?php do_action( 'wpinv_meta_box_invoice_template_row', $invoice->get_id() ); ?>
127
+                        <?php do_action('wpinv_meta_box_invoice_template_row', $invoice->get_id()); ?>
128 128
                     <?php endif; ?>
129 129
 
130 130
                     <table cellpadding="0" cellspacing="0" class="getpaid_invoice_items">
131 131
                         <thead>
132 132
                             <tr>
133
-                                <th class="getpaid-item" colspan="2"><?php _e( 'Item', 'invoicing' ) ?></th>
133
+                                <th class="getpaid-item" colspan="2"><?php _e('Item', 'invoicing') ?></th>
134 134
                                 <th class="getpaid-quantity hide-if-amount text-right">
135
-                                    <span class="getpaid-hide-if-hours"><?php _e( 'Quantity', 'invoicing' ) ?></span>
136
-                                    <span class="getpaid-hide-if-quantity"><?php _e( 'Hours', 'invoicing' ) ?></span>
135
+                                    <span class="getpaid-hide-if-hours"><?php _e('Quantity', 'invoicing') ?></span>
136
+                                    <span class="getpaid-hide-if-quantity"><?php _e('Hours', 'invoicing') ?></span>
137 137
                                 </th>
138 138
                                 <th class="getpaid-price hide-if-amount text-right">
139
-                                    <span class="getpaid-hide-if-hours"><?php _e( 'Price', 'invoicing' ) ?></span>
140
-                                    <span class="getpaid-hide-if-quantity"><?php _e( 'Rate', 'invoicing' ) ?></span>
139
+                                    <span class="getpaid-hide-if-hours"><?php _e('Price', 'invoicing') ?></span>
140
+                                    <span class="getpaid-hide-if-quantity"><?php _e('Rate', 'invoicing') ?></span>
141 141
                                 </th>
142 142
                                 <th class="getpaid-item-subtotal text-right">
143
-                                    <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php _e( 'Amount', 'invoicing' ) ?></span>
144
-                                    <span class="hide-if-amount"><?php _e( 'Total', 'invoicing' ) ?></span>
143
+                                    <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php _e('Amount', 'invoicing') ?></span>
144
+                                    <span class="hide-if-amount"><?php _e('Total', 'invoicing') ?></span>
145 145
                                 </th>
146 146
                                 <th class="getpaid-item-actions hide-if-not-editable" width="70px">&nbsp;</th>
147 147
                             </tr>
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
 		                <tbody class="getpaid_invoice_line_items">
150 150
                             <tr class="hide-if-has-items hide-if-not-editable">
151 151
                                 <td colspan="2" class="pt-4 pb-4">
152
-                                    <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e( 'Add Existing Items', 'invoicing' ) ?></button>
153
-	                                <a href="<?php echo esc_url( $new_item ); ?>" target="_blank" class="button button-secondary"><?php _e( 'Create New Item', 'invoicing' ) ?></a>
152
+                                    <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e('Add Existing Items', 'invoicing') ?></button>
153
+	                                <a href="<?php echo esc_url($new_item); ?>" target="_blank" class="button button-secondary"><?php _e('Create New Item', 'invoicing') ?></a>
154 154
                                 </td>
155 155
                                 <td class="hide-if-amount">&nbsp;</th>
156 156
                                 <td class="hide-if-amount">&nbsp;</th>
@@ -182,11 +182,11 @@  discard block
 block discarded – undo
182 182
                             <div class="col-12 col-sm-6 offset-sm-6">
183 183
                                 <table class="getpaid-invoice-totals text-right w-100">
184 184
                                     <tbody>
185
-                                        <?php foreach ( apply_filters( 'getpaid_invoice_subtotal_rows', $totals, $invoice ) as $key => $data ) : ?>
186
-                                            <tr class="getpaid-totals-<?php echo sanitize_html_class( $key ); ?>">
187
-                                                <td class="label"><?php echo sanitize_text_field( $data['label'] ) ?>:</td>
185
+                                        <?php foreach (apply_filters('getpaid_invoice_subtotal_rows', $totals, $invoice) as $key => $data) : ?>
186
+                                            <tr class="getpaid-totals-<?php echo sanitize_html_class($key); ?>">
187
+                                                <td class="label"><?php echo sanitize_text_field($data['label']) ?>:</td>
188 188
                                                 <td width="1%"></td>
189
-                                                <td class="value"><?php echo wp_kses_post( $data['value'] ) ?></td>
189
+                                                <td class="value"><?php echo wp_kses_post($data['value']) ?></td>
190 190
                                             </tr>
191 191
                                         <?php endforeach; ?>
192 192
                                     </tbody>
@@ -199,18 +199,18 @@  discard block
 block discarded – undo
199 199
                     <div class="getpaid-invoice-item-actions hide-if-no-items hide-if-not-editable">
200 200
                         <div class="row">
201 201
                             <div class="text-left col-12 col-sm-8">
202
-                                <button type="button" class="button add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e( 'Add Existing Item', 'invoicing' ) ?></button>
203
-                                <a href="<?php echo esc_url( $new_item ); ?>" target="_blank" class="button button-secondary"><?php _e( 'Create New Item', 'invoicing' ) ?></a>
204
-                                <?php do_action( 'getpaid-invoice-items-actions', $invoice ); ?>
202
+                                <button type="button" class="button add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php _e('Add Existing Item', 'invoicing') ?></button>
203
+                                <a href="<?php echo esc_url($new_item); ?>" target="_blank" class="button button-secondary"><?php _e('Create New Item', 'invoicing') ?></a>
204
+                                <?php do_action('getpaid-invoice-items-actions', $invoice); ?>
205 205
                             </div>
206 206
                             <div class="text-right col-12 col-sm-4">
207
-                                <button type="button" class="button button-primary recalculate-totals-button"><?php _e( 'Recalculate Totals', 'invoicing' ) ?></button>
207
+                                <button type="button" class="button button-primary recalculate-totals-button"><?php _e('Recalculate Totals', 'invoicing') ?></button>
208 208
                             </div>
209 209
                         </div>
210 210
                     </div>
211 211
 
212 212
                     <div class="getpaid-invoice-item-actions hide-if-editable">
213
-                        <p class="description m-2 text-right text-muted"><?php _e( 'This invoice is no longer editable', 'invoicing' ); ?></p>
213
+                        <p class="description m-2 text-right text-muted"><?php _e('This invoice is no longer editable', 'invoicing'); ?></p>
214 214
                     </div>
215 215
 
216 216
                     <!-- Add items to an invoice -->
@@ -218,8 +218,8 @@  discard block
 block discarded – undo
218 218
                         <div class="modal-dialog modal-dialog-centered" role="document">
219 219
                             <div class="modal-content">
220 220
                                 <div class="modal-header">
221
-                                    <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php _e( "Add Item(s)", 'invoicing' ); ?></h5>
222
-                                    <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e( "Close", 'invoicing' ); ?>">
221
+                                    <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php _e("Add Item(s)", 'invoicing'); ?></h5>
222
+                                    <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e("Close", 'invoicing'); ?>">
223 223
                                         <span aria-hidden="true">&times;</span>
224 224
                                     </button>
225 225
                                 </div>
@@ -227,17 +227,17 @@  discard block
 block discarded – undo
227 227
                                     <table class="widefat">
228 228
                                         <thead>
229 229
                                             <tr>
230
-                                                <th class="pl-0 text-left"><?php _e( 'Item', 'invoicing' ) ?></th>
230
+                                                <th class="pl-0 text-left"><?php _e('Item', 'invoicing') ?></th>
231 231
                                                 <th class="pr-0 text-right hide-if-amount">
232
-                                                    <span class="getpaid-hide-if-hours"><?php _e( 'Quantity', 'invoicing' ) ?></span>
233
-                                                    <span class="getpaid-hide-if-quantity"><?php _e( 'Hours', 'invoicing' ) ?></span>
232
+                                                    <span class="getpaid-hide-if-hours"><?php _e('Quantity', 'invoicing') ?></span>
233
+                                                    <span class="getpaid-hide-if-quantity"><?php _e('Hours', 'invoicing') ?></span>
234 234
                                                 </th>
235 235
                                             </tr>
236 236
                                         </thead>
237 237
 										<tbody>
238 238
 								            <tr>
239 239
 									            <td class="pl-0 text-left">
240
-                                                    <select class="getpaid-item-search regular-text" data-placeholder="<?php esc_attr_e( 'Search for an item…', 'invoicing' ); ?>"></select>
240
+                                                    <select class="getpaid-item-search regular-text" data-placeholder="<?php esc_attr_e('Search for an item…', 'invoicing'); ?>"></select>
241 241
                                                 </td>
242 242
 									            <td class="pr-0 text-right hide-if-amount">
243 243
                                                     <input type="number" class="w100" step="1" min="1" autocomplete="off" value="1" placeholder="1">
@@ -247,8 +247,8 @@  discard block
 block discarded – undo
247 247
 						            </table>
248 248
                                 </div>
249 249
                                 <div class="modal-footer">
250
-                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e( 'Cancel', 'invoicing' ); ?></button>
251
-                                    <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php _e( 'Add', 'invoicing' ); ?></button>
250
+                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e('Cancel', 'invoicing'); ?></button>
251
+                                    <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php _e('Add', 'invoicing'); ?></button>
252 252
                                 </div>
253 253
                             </div>
254 254
                         </div>
@@ -259,8 +259,8 @@  discard block
 block discarded – undo
259 259
                         <div class="modal-dialog modal-dialog-centered" role="document">
260 260
                             <div class="modal-content">
261 261
                                 <div class="modal-header">
262
-                                    <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php _e( "Edit Item", 'invoicing' ); ?></h5>
263
-                                    <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e( "Close", 'invoicing' ); ?>">
262
+                                    <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php _e("Edit Item", 'invoicing'); ?></h5>
263
+                                    <button type="button" class="close" data-dismiss="modal" aria-label="<?php _e("Close", 'invoicing'); ?>">
264 264
                                         <span aria-hidden="true">&times;</span>
265 265
                                     </button>
266 266
                                 </div>
@@ -268,27 +268,27 @@  discard block
 block discarded – undo
268 268
                                     <div class="getpaid-edit-item-div">
269 269
                                         <input type="hidden" name="id" class="form-control form-control-sm item-id">
270 270
                                         <label class="form-group w-100">
271
-                                            <span><?php _e( 'Name', 'invoicing' ); ?></span>
272
-                                            <input type="text" name="name" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' ); ?>" class="form-control form-control-sm item-name">
271
+                                            <span><?php _e('Name', 'invoicing'); ?></span>
272
+                                            <input type="text" name="name" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="form-control form-control-sm item-name">
273 273
                                         </label>
274 274
                                         <label class="form-group w-100">
275
-                                            <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php _e( 'Amount', 'invoicing' ); ?></span>
276
-                                            <span class="hide-if-amount"><?php _e( 'Price', 'invoicing' ); ?></span>
277
-                                            <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount( 0 ); ?>" class="form-control form-control-sm item-price">
275
+                                            <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php _e('Amount', 'invoicing'); ?></span>
276
+                                            <span class="hide-if-amount"><?php _e('Price', 'invoicing'); ?></span>
277
+                                            <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount(0); ?>" class="form-control form-control-sm item-price">
278 278
                                         </label>
279 279
                                         <label class="form-group w-100 hide-if-amount">
280
-                                            <span><?php _e( 'Quantity', 'invoicing' ); ?></span>
280
+                                            <span><?php _e('Quantity', 'invoicing'); ?></span>
281 281
                                             <input type="text" name="quantity" placeholder="1" class="form-control form-control-sm item-quantity">
282 282
                                         </label>
283 283
                                         <label class="form-group w-100">
284
-                                            <span><?php _e( 'Item Description', 'invoicing' ); ?></span>
285
-                                            <textarea name="description" placeholder="<?php esc_attr_e( 'Enter a description for this item', 'invoicing' ); ?>" class="form-control item-description"></textarea>
284
+                                            <span><?php _e('Item Description', 'invoicing'); ?></span>
285
+                                            <textarea name="description" placeholder="<?php esc_attr_e('Enter a description for this item', 'invoicing'); ?>" class="form-control item-description"></textarea>
286 286
                                         </label>
287 287
                                     </div>
288 288
                                 </div>
289 289
                                 <div class="modal-footer">
290
-                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e( 'Cancel', 'invoicing' ); ?></button>
291
-                                    <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php _e( 'Save', 'invoicing' ); ?></button>
290
+                                    <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php _e('Cancel', 'invoicing'); ?></button>
291
+                                    <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php _e('Save', 'invoicing'); ?></button>
292 292
                                 </div>
293 293
                             </div>
294 294
                         </div>
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-getpaid-meta-box-invoice-payment-meta.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 if ( ! defined( 'ABSPATH' ) ) {
11
-	exit; // Exit if accessed directly
11
+    exit; // Exit if accessed directly
12 12
 }
13 13
 
14 14
 /**
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 class GetPaid_Meta_Box_Invoice_Payment_Meta {
18 18
 
19 19
     /**
20
-	 * Output the metabox.
21
-	 *
22
-	 * @param WP_Post $post
23
-	 */
20
+     * Output the metabox.
21
+     *
22
+     * @param WP_Post $post
23
+     */
24 24
     public static function output( $post ) {
25 25
 
26 26
         // Prepare the invoice.
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  *
8 8
  */
9 9
 
10
-if ( ! defined( 'ABSPATH' ) ) {
10
+if (!defined('ABSPATH')) {
11 11
 	exit; // Exit if accessed directly
12 12
 }
13 13
 
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
 	 *
22 22
 	 * @param WP_Post $post
23 23
 	 */
24
-    public static function output( $post ) {
24
+    public static function output($post) {
25 25
 
26 26
         // Prepare the invoice.
27
-        $invoice = new WPInv_Invoice( $post );
27
+        $invoice = new WPInv_Invoice($post);
28 28
 
29 29
         ?>
30 30
 
@@ -47,12 +47,12 @@  discard block
 block discarded – undo
47 47
                                 'id'          => 'wpinv_key',
48 48
                                 'name'        => 'wpinv_key',
49 49
                                 'label'       => sprintf(
50
-                                    __( '%s Key:', 'invoicing' ),
51
-                                    ucfirst( $invoice->get_invoice_quote_type() )
50
+                                    __('%s Key:', 'invoicing'),
51
+                                    ucfirst($invoice->get_invoice_quote_type())
52 52
                                 ),
53 53
                                 'label_type'  => 'vertical',
54 54
                                 'class'       => 'form-control-sm',
55
-                                'value'       => $invoice->get_key( 'edit' ),
55
+                                'value'       => $invoice->get_key('edit'),
56 56
                                 'extra_attributes' => array(
57 57
                                     'onclick'  => 'this.select();',
58 58
                                     'readonly' => 'true',
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
                                 'id'          => 'wpinv_view_url',
68 68
                                 'name'        => 'wpinv_view_url',
69 69
                                 'label'       => sprintf(
70
-                                    __( '%s URL:', 'invoicing' ),
71
-                                    ucfirst( $invoice->get_invoice_quote_type() )
72
-                                ) . '&nbsp;<a href="' . esc_url_raw( $invoice->get_view_url() ) . '" title="' . __( 'View invoice', 'invoicing' ) . '" target="_blank"><i class="fas fa-external-link-alt fa-fw"></i></a>',
70
+                                    __('%s URL:', 'invoicing'),
71
+                                    ucfirst($invoice->get_invoice_quote_type())
72
+                                ) . '&nbsp;<a href="' . esc_url_raw($invoice->get_view_url()) . '" title="' . __('View invoice', 'invoicing') . '" target="_blank"><i class="fas fa-external-link-alt fa-fw"></i></a>',
73 73
                                 'label_type'  => 'vertical',
74 74
                                 'class'       => 'form-control-sm',
75 75
                                 'value'       => $invoice->get_view_url(),
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
                         );
82 82
 
83 83
                         // If the invoice is paid...
84
-                        if ( $invoice->is_paid() || $invoice->is_refunded() ) {
84
+                        if ($invoice->is_paid() || $invoice->is_refunded()) {
85 85
 
86 86
                             // Gateway.
87 87
                             echo aui()->input(
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
                                     'type'        => 'text',
90 90
                                     'id'          => 'wpinv_gateway',
91 91
                                     'name'        => '',
92
-                                    'label'       => __( 'Gateway:', 'invoicing' ),
92
+                                    'label'       => __('Gateway:', 'invoicing'),
93 93
                                     'label_type'  => 'vertical',
94 94
                                     'class'       => 'form-control-sm',
95
-                                    'value'       => wpinv_get_gateway_admin_label( $invoice->get_gateway( 'edit' ) ),
95
+                                    'value'       => wpinv_get_gateway_admin_label($invoice->get_gateway('edit')),
96 96
                                     'extra_attributes' => array(
97 97
                                         'onclick'  => 'this.select();',
98 98
                                         'readonly' => 'true',
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
                                     'type'        => 'text',
107 107
                                     'id'          => 'wpinv_transaction_id',
108 108
                                     'name'        => 'wpinv_transaction_id',
109
-                                    'label'       => __( 'Transaction ID:', 'invoicing' ),
109
+                                    'label'       => __('Transaction ID:', 'invoicing'),
110 110
                                     'label_type'  => 'vertical',
111 111
                                     'class'       => 'form-control-sm',
112
-                                    'value'       => $invoice->get_transaction_id( 'edit' ),
113
-                                    'help_text'   => apply_filters( 'wpinv_invoice_transaction_link_' . $invoice->get_gateway( 'edit' ), '', $invoice->get_transaction_id(), $invoice ),
112
+                                    'value'       => $invoice->get_transaction_id('edit'),
113
+                                    'help_text'   => apply_filters('wpinv_invoice_transaction_link_' . $invoice->get_gateway('edit'), '', $invoice->get_transaction_id(), $invoice),
114 114
                                     'extra_attributes' => array(
115 115
                                         'onclick'  => 'this.select();',
116 116
                                         'readonly' => 'true',
@@ -124,10 +124,10 @@  discard block
 block discarded – undo
124 124
                                     'type'        => 'text',
125 125
                                     'id'          => 'wpinv_currency',
126 126
                                     'name'        => 'wpinv_currency',
127
-                                    'label'       => __( 'Currency:', 'invoicing' ),
127
+                                    'label'       => __('Currency:', 'invoicing'),
128 128
                                     'label_type'  => 'vertical',
129 129
                                     'class'       => 'form-control-sm',
130
-                                    'value'       => $invoice->get_currency( 'edit' ),
130
+                                    'value'       => $invoice->get_currency('edit'),
131 131
                                     'extra_attributes' => array(
132 132
                                         'onclick'  => 'this.select();',
133 133
                                         'readonly' => 'true',
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 
138 138
                         } else {
139 139
 
140
-                            if ( 'wpi_invoice' == $invoice->get_post_type() ) {
140
+                            if ('wpi_invoice' == $invoice->get_post_type()) {
141 141
 
142 142
                                 // Payment URL.
143 143
                                 echo aui()->input(
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
                                         'type'        => 'text',
146 146
                                         'id'          => 'wpinv_payment_url',
147 147
                                         'name'        => 'wpinv_payment_url',
148
-                                        'label'       => __( 'Payment URL:', 'invoicing' ),
148
+                                        'label'       => __('Payment URL:', 'invoicing'),
149 149
                                         'label_type'  => 'vertical',
150 150
                                         'class'       => 'form-control-sm',
151 151
                                         'value'       => $invoice->get_checkout_payment_url(),
@@ -161,13 +161,13 @@  discard block
 block discarded – undo
161 161
                                     array(
162 162
                                         'id'               => 'wpinv_gateway',
163 163
                                         'name'             => 'wpinv_gateway',
164
-                                        'label'            => __( 'Gateway:', 'invoicing' ),
164
+                                        'label'            => __('Gateway:', 'invoicing'),
165 165
                                         'label_type'       => 'vertical',
166
-                                        'placeholder'      => __( 'Select Gateway', 'invoicing' ),
167
-                                        'value'            => $invoice->get_gateway( 'edit' ),
166
+                                        'placeholder'      => __('Select Gateway', 'invoicing'),
167
+                                        'value'            => $invoice->get_gateway('edit'),
168 168
                                         'select2'          => true,
169 169
                                         'data-allow-clear' => 'false',
170
-                                        'options'          => wp_list_pluck( wpinv_get_enabled_payment_gateways( true ), 'admin_label' ),
170
+                                        'options'          => wp_list_pluck(wpinv_get_enabled_payment_gateways(true), 'admin_label'),
171 171
                                     )
172 172
                                 );
173 173
 
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-getpaid-meta-box-invoice-details.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 if ( ! defined( 'ABSPATH' ) ) {
11
-	exit; // Exit if accessed directly
11
+    exit; // Exit if accessed directly
12 12
 }
13 13
 
14 14
 /**
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 class GetPaid_Meta_Box_Invoice_Details {
18 18
 
19 19
     /**
20
-	 * Output the metabox.
21
-	 *
22
-	 * @param WP_Post $post
23
-	 */
20
+     * Output the metabox.
21
+     *
22
+     * @param WP_Post $post
23
+     */
24 24
     public static function output( $post ) {
25 25
 
26 26
         // Prepare the invoice.
Please login to merge, or discard this patch.
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  *
8 8
  */
9 9
 
10
-if ( ! defined( 'ABSPATH' ) ) {
10
+if (!defined('ABSPATH')) {
11 11
 	exit; // Exit if accessed directly
12 12
 }
13 13
 
@@ -21,13 +21,13 @@  discard block
 block discarded – undo
21 21
 	 *
22 22
 	 * @param WP_Post $post
23 23
 	 */
24
-    public static function output( $post ) {
24
+    public static function output($post) {
25 25
 
26 26
         // Prepare the invoice.
27
-        $invoice = new WPInv_Invoice( $post );
27
+        $invoice = new WPInv_Invoice($post);
28 28
 
29 29
         // Nonce field.
30
-        wp_nonce_field( 'wpinv_details', 'wpinv_details_nonce' ) ;
30
+        wp_nonce_field('wpinv_details', 'wpinv_details_nonce');
31 31
 
32 32
 
33 33
         ?>
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
 
47 47
                 <div class="bsui" style="margin-top: 1.5rem">
48 48
 
49
-                    <?php do_action( 'getpaid_invoice_edit_before_viewed_by_customer', $invoice ); ?>
50
-                    <?php if ( ! $invoice->is_draft() ) : ?>
49
+                    <?php do_action('getpaid_invoice_edit_before_viewed_by_customer', $invoice); ?>
50
+                    <?php if (!$invoice->is_draft()) : ?>
51 51
                         <div class="form-group">
52
-                            <strong><?php _e( 'Viewed by Customer:', 'invoicing' );?></strong>
53
-                            <?php ( $invoice->get_is_viewed() ) ? _e( 'Yes', 'invoicing' ) : _e( 'No', 'invoicing' ); ?>
52
+                            <strong><?php _e('Viewed by Customer:', 'invoicing'); ?></strong>
53
+                            <?php ($invoice->get_is_viewed()) ? _e('Yes', 'invoicing') : _e('No', 'invoicing'); ?>
54 54
                         </div>
55 55
                     <?php endif; ?>
56 56
 
@@ -58,13 +58,13 @@  discard block
 block discarded – undo
58 58
 
59 59
                         // Date created.
60 60
                         $label = sprintf(
61
-                            __( '%s Date:', 'invoicing' ),
62
-                            ucfirst( $invoice->get_invoice_quote_type() )
61
+                            __('%s Date:', 'invoicing'),
62
+                            ucfirst($invoice->get_invoice_quote_type())
63 63
                         );
64 64
 
65
-                        $info  = sprintf(
66
-                            __( 'The date this %s was created.', 'invoicing' ),
67
-                            strtolower( $invoice->get_invoice_quote_type() )
65
+                        $info = sprintf(
66
+                            __('The date this %s was created.', 'invoicing'),
67
+                            strtolower($invoice->get_invoice_quote_type())
68 68
                         );
69 69
 
70 70
                         echo aui()->input(
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
                                 'type'        => 'datepicker',
73 73
                                 'id'          => 'wpinv_date_created',
74 74
                                 'name'        => 'date_created',
75
-                                'label'       => $label . getpaid_get_help_tip( $info ),
75
+                                'label'       => $label . getpaid_get_help_tip($info),
76 76
                                 'label_type'  => 'vertical',
77 77
                                 'placeholder' => 'YYYY-MM-DD 00:00',
78 78
                                 'class'       => 'form-control-sm',
79
-                                'value'       => $invoice->get_date_created( 'edit' ),
79
+                                'value'       => $invoice->get_date_created('edit'),
80 80
                                 'extra_attributes' => array(
81 81
                                     'data-enable-time' => 'true',
82 82
                                     'data-time_24hr'   => 'true',
@@ -87,15 +87,15 @@  discard block
 block discarded – undo
87 87
                         );
88 88
 
89 89
                         // Date paid.
90
-                        $date_paid = $invoice->get_date_completed( 'edit' );
91
-                        if ( ! empty( $date_paid ) && $invoice->is_paid() ) {
90
+                        $date_paid = $invoice->get_date_completed('edit');
91
+                        if (!empty($date_paid) && $invoice->is_paid()) {
92 92
 
93 93
                             echo aui()->input(
94 94
                                 array(
95 95
                                     'type'        => 'text',
96 96
                                     'id'          => 'wpinv_date_completed',
97 97
                                     'name'        => 'wpinv_date_completed',
98
-                                    'label'       => __( 'Date Completed:', 'invoicing' ),
98
+                                    'label'       => __('Date Completed:', 'invoicing'),
99 99
                                     'label_type'  => 'vertical',
100 100
                                     'class'       => 'form-control-sm',
101 101
                                     'value'       => $date_paid,
@@ -109,18 +109,18 @@  discard block
 block discarded – undo
109 109
                         }
110 110
 
111 111
                         // Due date.
112
-                        if ( $invoice->is_type( 'invoice' ) && wpinv_get_option( 'overdue_active' ) && ( ! $invoice->is_paid() || $invoice->is_draft() ) ) {
112
+                        if ($invoice->is_type('invoice') && wpinv_get_option('overdue_active') && (!$invoice->is_paid() || $invoice->is_draft())) {
113 113
 
114 114
                             echo aui()->input(
115 115
                                 array(
116 116
                                     'type'        => 'datepicker',
117 117
                                     'id'          => 'wpinv_due_date',
118 118
                                     'name'        => 'wpinv_due_date',
119
-                                    'label'       => __( 'Due Date:', 'invoicing' ) . getpaid_get_help_tip( __( 'Leave blank to disable automated reminder emails for this invoice.', 'invoicing' ) ),
119
+                                    'label'       => __('Due Date:', 'invoicing') . getpaid_get_help_tip(__('Leave blank to disable automated reminder emails for this invoice.', 'invoicing')),
120 120
                                     'label_type'  => 'vertical',
121
-                                    'placeholder' => __( 'No due date', 'invoicing' ),
121
+                                    'placeholder' => __('No due date', 'invoicing'),
122 122
                                     'class'       => 'form-control-sm',
123
-                                    'value'       => $invoice->get_due_date( 'edit' ),
123
+                                    'value'       => $invoice->get_due_date('edit'),
124 124
                                     'extra_attributes' => array(
125 125
                                         'data-enable-time' => 'true',
126 126
                                         'data-time_24hr'   => 'true',
@@ -132,39 +132,39 @@  discard block
 block discarded – undo
132 132
 
133 133
                         }
134 134
 
135
-                        do_action( 'wpinv_meta_box_details_after_due_date', $invoice->get_id() );
136
-                        do_action( 'getpaid_metabox_after_due_date', $invoice );
135
+                        do_action('wpinv_meta_box_details_after_due_date', $invoice->get_id());
136
+                        do_action('getpaid_metabox_after_due_date', $invoice);
137 137
 
138 138
                         // Status.
139 139
                         $label = sprintf(
140
-                            __( '%s Status:', 'invoicing' ),
141
-                            ucfirst( $invoice->get_invoice_quote_type() )
140
+                            __('%s Status:', 'invoicing'),
141
+                            ucfirst($invoice->get_invoice_quote_type())
142 142
                         );
143 143
 
144
-                        $status = $invoice->get_status( 'edit' );
144
+                        $status = $invoice->get_status('edit');
145 145
                         echo aui()->select(
146 146
                             array(
147 147
                                 'id'               => 'wpinv_status',
148 148
                                 'name'             => 'wpinv_status',
149 149
                                 'label'            => $label,
150 150
                                 'label_type'       => 'vertical',
151
-                                'placeholder'      => __( 'Select Status', 'invoicing' ),
152
-                                'value'            => array_key_exists( $status, $invoice->get_all_statuses() ) ? $status : $invoice->get_default_status(),
151
+                                'placeholder'      => __('Select Status', 'invoicing'),
152
+                                'value'            => array_key_exists($status, $invoice->get_all_statuses()) ? $status : $invoice->get_default_status(),
153 153
                                 'select2'          => true,
154 154
                                 'data-allow-clear' => 'false',
155
-                                'options'          => wpinv_get_invoice_statuses( true, false, $invoice )
155
+                                'options'          => wpinv_get_invoice_statuses(true, false, $invoice)
156 156
                             )
157 157
                         );
158 158
 
159 159
                         // Invoice number.
160 160
                         $label = sprintf(
161
-                            __( '%s Number:', 'invoicing' ),
162
-                            ucfirst( $invoice->get_invoice_quote_type() )
161
+                            __('%s Number:', 'invoicing'),
162
+                            ucfirst($invoice->get_invoice_quote_type())
163 163
                         );
164 164
 
165
-                        $info  = sprintf(
166
-                            __( 'Each %s number must be unique.', 'invoicing' ),
167
-                            strtolower( $invoice->get_invoice_quote_type() )
165
+                        $info = sprintf(
166
+                            __('Each %s number must be unique.', 'invoicing'),
167
+                            strtolower($invoice->get_invoice_quote_type())
168 168
                         );
169 169
 
170 170
                         echo aui()->input(
@@ -172,11 +172,11 @@  discard block
 block discarded – undo
172 172
                                 'type'        => 'text',
173 173
                                 'id'          => 'wpinv_number',
174 174
                                 'name'        => 'wpinv_number',
175
-                                'label'       => $label . getpaid_get_help_tip( $info ),
175
+                                'label'       => $label . getpaid_get_help_tip($info),
176 176
                                 'label_type'  => 'vertical',
177
-                                'placeholder' => __( 'Autogenerate', 'invoicing' ),
177
+                                'placeholder' => __('Autogenerate', 'invoicing'),
178 178
                                 'class'       => 'form-control-sm',
179
-                                'value'       => $invoice->get_number( 'edit' ),
179
+                                'value'       => $invoice->get_number('edit'),
180 180
                             )
181 181
                         );
182 182
 
@@ -186,15 +186,15 @@  discard block
 block discarded – undo
186 186
                                 'type'        => 'text',
187 187
                                 'id'          => 'wpinv_cc',
188 188
                                 'name'        => 'wpinv_cc',
189
-                                'label'       => __( 'Email CC:', 'invoicing' ) . getpaid_get_help_tip( __( 'Enter a comma separated list of other emails that should be notified about the invoice.', 'invoicing' ) ),
189
+                                'label'       => __('Email CC:', 'invoicing') . getpaid_get_help_tip(__('Enter a comma separated list of other emails that should be notified about the invoice.', 'invoicing')),
190 190
                                 'label_type'  => 'vertical',
191
-                                'placeholder' => __( '[email protected], [email protected]', 'invoicing' ),
191
+                                'placeholder' => __('[email protected], [email protected]', 'invoicing'),
192 192
                                 'class'       => 'form-control-sm',
193
-                                'value'       => $invoice->get_email_cc( 'edit' ),
193
+                                'value'       => $invoice->get_email_cc('edit'),
194 194
                             )
195 195
                         );
196 196
 
197
-                        if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) {
197
+                        if (!$invoice->is_paid() && !$invoice->is_refunded()) {
198 198
 
199 199
                             // Apply a discount.
200 200
                             echo aui()->input(
@@ -202,25 +202,25 @@  discard block
 block discarded – undo
202 202
                                     'type'        => 'text',
203 203
                                     'id'          => 'wpinv_discount_code',
204 204
                                     'name'        => 'wpinv_discount_code',
205
-                                    'label'       => __( 'Discount Code:', 'invoicing' ),
206
-                                    'placeholder' => __( 'Apply Discount', 'invoicing' ),
205
+                                    'label'       => __('Discount Code:', 'invoicing'),
206
+                                    'placeholder' => __('Apply Discount', 'invoicing'),
207 207
                                     'label_type'  => 'vertical',
208 208
                                     'class'       => 'form-control-sm',
209
-                                    'value'       => $invoice->get_discount_code( 'edit' ),
209
+                                    'value'       => $invoice->get_discount_code('edit'),
210 210
                                 )
211 211
                             );
212 212
 
213
-                        } else if ( $invoice->get_discount_code( 'edit' ) ) {
213
+                        } else if ($invoice->get_discount_code('edit')) {
214 214
 
215 215
                             echo aui()->input(
216 216
                                 array(
217 217
                                     'type'        => 'text',
218 218
                                     'id'          => 'wpinv_discount_code',
219 219
                                     'name'        => 'wpinv_discount_code',
220
-                                    'label'       => __( 'Discount Code:', 'invoicing' ),
220
+                                    'label'       => __('Discount Code:', 'invoicing'),
221 221
                                     'label_type'  => 'vertical',
222 222
                                     'class'       => 'form-control-sm',
223
-                                    'value'       => $invoice->get_discount_code( 'edit' ),
223
+                                    'value'       => $invoice->get_discount_code('edit'),
224 224
                                     'extra_attributes' => array(
225 225
                                         'onclick'  => 'this.select();',
226 226
                                         'readonly' => 'true',
@@ -230,17 +230,17 @@  discard block
 block discarded – undo
230 230
 
231 231
                         }
232 232
 
233
-                        do_action( 'wpinv_meta_box_details_inner', $invoice->get_id() );
233
+                        do_action('wpinv_meta_box_details_inner', $invoice->get_id());
234 234
 
235 235
                         // Disable taxes.
236
-                        if ( wpinv_use_taxes() && ! ( $invoice->is_paid() || $invoice->is_refunded() ) ) {
236
+                        if (wpinv_use_taxes() && !($invoice->is_paid() || $invoice->is_refunded())) {
237 237
 
238 238
                             echo aui()->input(
239 239
                                 array(
240 240
                                     'id'          => 'wpinv_taxable',
241 241
                                     'name'        => 'disable_taxes',
242 242
                                     'type'        => 'checkbox',
243
-                                    'label'       => __( 'Disable taxes', 'invoicing' ),
243
+                                    'label'       => __('Disable taxes', 'invoicing'),
244 244
                                     'value'       => '1',
245 245
                                     'checked'     => (bool) $invoice->get_disable_taxes(),
246 246
                                 )
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 
249 249
                         }
250 250
 
251
-                        if ( $invoice->is_type( 'invoice' ) ) {
251
+                        if ($invoice->is_type('invoice')) {
252 252
 
253 253
                             // Send to customer.
254 254
                             echo aui()->input(
@@ -256,15 +256,15 @@  discard block
 block discarded – undo
256 256
                                     'id'          => 'wpinv_send_to_customer',
257 257
                                     'name'        => 'send_to_customer',
258 258
                                     'type'        => 'checkbox',
259
-                                    'label'       => __( 'Send invoice to customer after saving', 'invoicing' ),
259
+                                    'label'       => __('Send invoice to customer after saving', 'invoicing'),
260 260
                                     'value'       => '1',
261
-                                    'checked'     => $invoice->is_draft() && (bool) wpinv_get_option( 'email_user_invoice_active', true ),
261
+                                    'checked'     => $invoice->is_draft() && (bool) wpinv_get_option('email_user_invoice_active', true),
262 262
                                 )
263 263
                             );
264 264
 
265 265
                         }
266 266
 
267
-                        do_action( 'getpaid_metabox_after_invoice_details', $invoice );
267
+                        do_action('getpaid_metabox_after_invoice_details', $invoice);
268 268
 
269 269
                     ?>
270 270
 
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-getpaid-meta-box-resend-invoice.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  */
7 7
 
8 8
 if ( ! defined( 'ABSPATH' ) ) {
9
-	exit; // Exit if accessed directly
9
+    exit; // Exit if accessed directly
10 10
 }
11 11
 
12 12
 /**
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
15 15
 class GetPaid_Meta_Box_Resend_Invoice {
16 16
 
17 17
     /**
18
-	 * Output the metabox.
19
-	 *
20
-	 * @param WP_Post $post
21
-	 */
18
+     * Output the metabox.
19
+     *
20
+     * @param WP_Post $post
21
+     */
22 22
     public static function output( $post ) {
23 23
 
24 24
         // Fetch the invoice.
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
  *
6 6
  */
7 7
 
8
-if ( ! defined( 'ABSPATH' ) ) {
8
+if (!defined('ABSPATH')) {
9 9
 	exit; // Exit if accessed directly
10 10
 }
11 11
 
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
 	 *
20 20
 	 * @param WP_Post $post
21 21
 	 */
22
-    public static function output( $post ) {
22
+    public static function output($post) {
23 23
 
24 24
         // Fetch the invoice.
25
-        $invoice = new WPInv_Invoice( $post );
25
+        $invoice = new WPInv_Invoice($post);
26 26
 
27
-        do_action( 'wpinv_metabox_resend_invoice_before', $invoice );
27
+        do_action('wpinv_metabox_resend_invoice_before', $invoice);
28 28
 
29 29
         $invoice_actions = array(
30 30
             'resend-email' => array(
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
                     'getpaid-nonce',
39 39
                     'getpaid-nonce'
40 40
                 ),
41
-                'label' => __( 'Resend Invoice', 'invoicing' ),
41
+                'label' => __('Resend Invoice', 'invoicing'),
42 42
             )
43 43
         );
44 44
 
45
-        if ( $invoice->needs_payment() ) {
45
+        if ($invoice->needs_payment()) {
46 46
 
47 47
             $invoice_actions['send-reminder'] = array(
48 48
                 'url' => wp_nonce_url(
@@ -55,29 +55,29 @@  discard block
 block discarded – undo
55 55
                     'getpaid-nonce',
56 56
                     'getpaid-nonce'
57 57
                 ),
58
-                'label' => __( 'Send Reminder', 'invoicing' ),
58
+                'label' => __('Send Reminder', 'invoicing'),
59 59
             );
60 60
 
61 61
         }
62 62
 
63
-        $invoice_actions = apply_filters( 'getpaid_edit_invoice_actions', $invoice_actions, $invoice );
63
+        $invoice_actions = apply_filters('getpaid_edit_invoice_actions', $invoice_actions, $invoice);
64 64
 
65
-        foreach ( $invoice_actions as $key => $action ) {
65
+        foreach ($invoice_actions as $key => $action) {
66 66
 
67
-            if ( 'resend-email' === $key ) {
68
-                echo wpautop( __( "This will send a copy of the invoice to the customer's email address.", 'invoicing' ) );
67
+            if ('resend-email' === $key) {
68
+                echo wpautop(__("This will send a copy of the invoice to the customer's email address.", 'invoicing'));
69 69
             }
70 70
 
71 71
             printf(
72 72
                 '<p class="wpi-meta-row wpi-%s"><a href="%s" class="button button-secondary">%s</a>',
73
-                esc_attr( $key ),
74
-                esc_url( $action['url'] ),
75
-                sanitize_text_field( $action['label'] )
73
+                esc_attr($key),
74
+                esc_url($action['url']),
75
+                sanitize_text_field($action['label'])
76 76
             );
77 77
 
78 78
         }
79 79
 
80
-        do_action( 'wpinv_metabox_resend_invoice_after', $invoice );
80
+        do_action('wpinv_metabox_resend_invoice_after', $invoice);
81 81
 
82 82
     }
83 83
 
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-mb-invoice-notes.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,39 +1,39 @@
 block discarded – undo
1 1
 <?php
2 2
 // MUST have WordPress.
3
-if ( !defined( 'WPINC' ) ) {
4
-    exit( 'Do NOT access this file directly: ' . basename( __FILE__ ) );
3
+if (!defined('WPINC')) {
4
+    exit('Do NOT access this file directly: ' . basename(__FILE__));
5 5
 }
6 6
 
7 7
 class WPInv_Meta_Box_Notes {
8
-    public static function output( $post ) {
8
+    public static function output($post) {
9 9
         global $post;
10 10
 
11
-        $notes = wpinv_get_invoice_notes( $post->ID );
11
+        $notes = wpinv_get_invoice_notes($post->ID);
12 12
 
13 13
         echo '<ul class="invoice_notes">';
14 14
 
15
-        if ( $notes ) {
16
-            foreach( $notes as $note ) {
17
-                wpinv_get_invoice_note_line_item( $note );
15
+        if ($notes) {
16
+            foreach ($notes as $note) {
17
+                wpinv_get_invoice_note_line_item($note);
18 18
             }
19 19
 
20 20
         } else {
21
-            echo '<li>' . __( 'There are no notes yet.', 'invoicing' ) . '</li>';
21
+            echo '<li>' . __('There are no notes yet.', 'invoicing') . '</li>';
22 22
         }
23 23
 
24 24
         echo '</ul>';
25 25
         ?>
26 26
         <div class="add_note">
27
-            <h4><?php _e( 'Add note', 'invoicing' ); ?></h4>
27
+            <h4><?php _e('Add note', 'invoicing'); ?></h4>
28 28
             <p>
29 29
                 <textarea type="text" name="invoice_note" id="add_invoice_note" class="input-text" cols="20" rows="5"></textarea>
30 30
             </p>
31 31
             <p>
32 32
                 <select name="invoice_note_type" id="invoice_note_type" class="regular-text">
33
-                    <option value=""><?php _e( 'Private note', 'invoicing' ); ?></option>
34
-                    <option value="customer"><?php _e( 'Note to customer', 'invoicing' ); ?></option>
33
+                    <option value=""><?php _e('Private note', 'invoicing'); ?></option>
34
+                    <option value="customer"><?php _e('Note to customer', 'invoicing'); ?></option>
35 35
                 </select>
36
-                <a href="#" class="add_note button"><?php _e( 'Add', 'invoicing' ); ?></a> <span class="description"><?php _e( 'Add a note for your reference, or add a customer note (the user will be notified).', 'invoicing' ); ?></span>
36
+                <a href="#" class="add_note button"><?php _e('Add', 'invoicing'); ?></a> <span class="description"><?php _e('Add a note for your reference, or add a customer note (the user will be notified).', 'invoicing'); ?></span>
37 37
             </p>
38 38
         </div>
39 39
         <?php
Please login to merge, or discard this patch.