@@ -1,30 +1,30 @@ discard block |
||
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_Details { |
8 | - public static function output( $post ) { |
|
8 | + public static function output($post) { |
|
9 | 9 | $currency_symbol = wpinv_currency_symbol(); |
10 | - $statuses = wpinv_get_invoice_statuses( true ); |
|
10 | + $statuses = wpinv_get_invoice_statuses(true); |
|
11 | 11 | |
12 | - $post_id = !empty( $post->ID ) ? $post->ID : 0; |
|
13 | - $invoice = new WPInv_Invoice( $post_id ); |
|
12 | + $post_id = !empty($post->ID) ? $post->ID : 0; |
|
13 | + $invoice = new WPInv_Invoice($post_id); |
|
14 | 14 | |
15 | - $status = $invoice->get_status( false ); // Current status |
|
15 | + $status = $invoice->get_status(false); // Current status |
|
16 | 16 | $discount = $invoice->get_discount(); |
17 | 17 | $discount_code = $discount > 0 ? $invoice->get_discount_code() : ''; |
18 | 18 | $invoice_number = $invoice->get_number(); |
19 | 19 | |
20 | 20 | $date_created = $invoice->get_created_date(); |
21 | - $datetime_created = strtotime( $date_created ); |
|
22 | - $date_created = $date_created != '' && $date_created != '0000-00-00 00:00:00' ? date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $datetime_created ) : ''; |
|
21 | + $datetime_created = strtotime($date_created); |
|
22 | + $date_created = $date_created != '' && $date_created != '0000-00-00 00:00:00' ? date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $datetime_created) : ''; |
|
23 | 23 | $date_completed = $invoice->get_completed_date(); |
24 | - $date_completed = $date_completed != '' && $date_completed != '0000-00-00 00:00:00' ? date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), strtotime( $date_completed ) ) : 'n/a'; |
|
25 | - $title['status'] = __( 'Invoice Status:', 'invoicing' ); |
|
26 | - $title['number'] = __( 'Invoice Number:', 'invoicing' ); |
|
27 | - $mail_notice = esc_attr__( 'After saving invoice, this will send a copy of the invoice to the user’s email address.', 'invoicing' ); |
|
24 | + $date_completed = $date_completed != '' && $date_completed != '0000-00-00 00:00:00' ? date_i18n(get_option('date_format') . ' ' . get_option('time_format'), strtotime($date_completed)) : 'n/a'; |
|
25 | + $title['status'] = __('Invoice Status:', 'invoicing'); |
|
26 | + $title['number'] = __('Invoice Number:', 'invoicing'); |
|
27 | + $mail_notice = esc_attr__('After saving invoice, this will send a copy of the invoice to the user’s email address.', 'invoicing'); |
|
28 | 28 | |
29 | 29 | $title = apply_filters('wpinv_details_metabox_titles', $title, $invoice); |
30 | 30 | $statuses = apply_filters('wpinv_invoice_statuses', $statuses, $invoice); |
@@ -34,36 +34,36 @@ discard block |
||
34 | 34 | <div class="gdmbx2-wrap form-table"> |
35 | 35 | <div class="gdmbx2-metabox gdmbx-field-list" id="gdmbx2-metabox-wpinv_details"> |
36 | 36 | <div class="gdmbx-row gdmbx-type-select gdmbx2-id-wpinv-date-created"> |
37 | - <div class="gdmbx-th"><label><?php _e( 'Date Created:', 'invoicing' );?></label></div> |
|
38 | - <div class="gdmbx-td"><?php echo $date_created;?></div> |
|
37 | + <div class="gdmbx-th"><label><?php _e('Date Created:', 'invoicing'); ?></label></div> |
|
38 | + <div class="gdmbx-td"><?php echo $date_created; ?></div> |
|
39 | 39 | </div> |
40 | - <?php if ( $invoice->post_type == 'wpi_invoice' && wpinv_get_option( 'overdue_active' ) && ( $invoice->needs_payment() || $invoice->has_status( array( 'auto-draft', 'draft' ) ) ) ) { ?> |
|
40 | + <?php if ($invoice->post_type == 'wpi_invoice' && wpinv_get_option('overdue_active') && ($invoice->needs_payment() || $invoice->has_status(array('auto-draft', 'draft')))) { ?> |
|
41 | 41 | <div class="gdmbx-row gdmbx-type-select gdmbx2-id-wpinv-date-overdue"> |
42 | - <div class="gdmbx-th"><label for="wpinv_due_date"><?php _e( 'Due Date:', 'invoicing' );?></label></div> |
|
42 | + <div class="gdmbx-th"><label for="wpinv_due_date"><?php _e('Due Date:', 'invoicing'); ?></label></div> |
|
43 | 43 | <div class="gdmbx-td"> |
44 | - <input type="text" placeholder="<?php esc_attr_e( 'Y-m-d', 'invoicing' );?>" value="<?php echo esc_attr( $invoice->get_due_date() );?>" id="wpinv_due_date" name="wpinv_due_date" class="regular-text wpiDatepicker" data-minDate="<?php echo esc_attr( date_i18n( 'Y-m-d', $datetime_created ) );?>" data-dateFormat="yy-mm-dd"> |
|
45 | - <p class="wpi-meta-row wpi-meta-desc"><?php _e( 'Leave blank to disable sending auto reminder for this invoice.', 'invoicing' );?></p> |
|
44 | + <input type="text" placeholder="<?php esc_attr_e('Y-m-d', 'invoicing'); ?>" value="<?php echo esc_attr($invoice->get_due_date()); ?>" id="wpinv_due_date" name="wpinv_due_date" class="regular-text wpiDatepicker" data-minDate="<?php echo esc_attr(date_i18n('Y-m-d', $datetime_created)); ?>" data-dateFormat="yy-mm-dd"> |
|
45 | + <p class="wpi-meta-row wpi-meta-desc"><?php _e('Leave blank to disable sending auto reminder for this invoice.', 'invoicing'); ?></p> |
|
46 | 46 | </div> |
47 | 47 | </div> |
48 | 48 | <?php } ?> |
49 | - <?php do_action( 'wpinv_meta_box_details_after_due_date', $post_id ); ?> |
|
50 | - <?php if ( $date_completed && $date_completed != 'n/a' ) { ?> |
|
49 | + <?php do_action('wpinv_meta_box_details_after_due_date', $post_id); ?> |
|
50 | + <?php if ($date_completed && $date_completed != 'n/a') { ?> |
|
51 | 51 | <div class="gdmbx-row gdmbx-type-select gdmbx2-id-wpinv-date-completed"> |
52 | - <div class="gdmbx-th"><label><?php _e( 'Payment Date:', 'invoicing' );?></label></div> |
|
53 | - <div class="gdmbx-td"><?php echo $date_completed;?></div> |
|
52 | + <div class="gdmbx-th"><label><?php _e('Payment Date:', 'invoicing'); ?></label></div> |
|
53 | + <div class="gdmbx-td"><?php echo $date_completed; ?></div> |
|
54 | 54 | </div> |
55 | 55 | <?php } ?> |
56 | - <?php $is_viewed = wpinv_is_invoice_viewed( $post_id ); ?> |
|
56 | + <?php $is_viewed = wpinv_is_invoice_viewed($post_id); ?> |
|
57 | 57 | <div class="gdmbx-row gdmbx-type-select gdmbx2-id-wpinv-customer-viewed"> |
58 | - <div class="gdmbx-th"><label><?php _e( 'Viewed by Customer:', 'invoicing' );?></label></div> |
|
59 | - <div class="gdmbx-td"><?php ( 1 == $is_viewed ) ? _e( 'Yes', 'invoicing' ) : _e( 'No', 'invoicing' ); ?></div> |
|
58 | + <div class="gdmbx-th"><label><?php _e('Viewed by Customer:', 'invoicing'); ?></label></div> |
|
59 | + <div class="gdmbx-td"><?php (1 == $is_viewed) ? _e('Yes', 'invoicing') : _e('No', 'invoicing'); ?></div> |
|
60 | 60 | </div> |
61 | 61 | <div class="gdmbx-row gdmbx-type-select gdmbx2-id-wpinv-status"> |
62 | 62 | <div class="gdmbx-th"><label for="wpinv_status"><?php echo $title['status']; ?></label></div> |
63 | 63 | <div class="gdmbx-td"> |
64 | 64 | <select required="required" id="wpinv_status" name="wpinv_status" class="gdmbx2_select wpi_select2"> |
65 | - <?php foreach ( $statuses as $value => $label ) { ?> |
|
66 | - <option value="<?php echo $value;?>" <?php selected( $status, $value );?>><?php echo $label;?></option> |
|
65 | + <?php foreach ($statuses as $value => $label) { ?> |
|
66 | + <option value="<?php echo $value; ?>" <?php selected($status, $value); ?>><?php echo $label; ?></option> |
|
67 | 67 | <?php } ?> |
68 | 68 | </select> |
69 | 69 | </div> |
@@ -71,117 +71,117 @@ discard block |
||
71 | 71 | <div class="gdmbx-row gdmbx-type-text gdmbx2-id-wpinv-number table-layout"> |
72 | 72 | <div class="gdmbx-th"><label for="wpinv_number"><?php echo $title['number']; ?></label></div> |
73 | 73 | <div class="gdmbx-td"> |
74 | - <input type="text" value="<?php echo esc_attr( $invoice_number );?>" id="wpinv_number" name="wpinv_number" class="regular-text" readonly> |
|
74 | + <input type="text" value="<?php echo esc_attr($invoice_number); ?>" id="wpinv_number" name="wpinv_number" class="regular-text" readonly> |
|
75 | 75 | </div> |
76 | 76 | </div> |
77 | - <?php do_action( 'wpinv_meta_box_details_inner', $post_id ); |
|
77 | + <?php do_action('wpinv_meta_box_details_inner', $post_id); |
|
78 | 78 | $disable_discount = apply_filters('wpinv_disable_apply_discount', false, $invoice, $post_id); |
79 | 79 | ?> |
80 | - <?php if ( !( $is_paid = ( $invoice->is_paid() || $invoice->is_refunded() ) ) && !$disable_discount || $discount_code ) { ?> |
|
80 | + <?php if (!($is_paid = ($invoice->is_paid() || $invoice->is_refunded())) && !$disable_discount || $discount_code) { ?> |
|
81 | 81 | <div class="gdmbx-row gdmbx-type-text gdmbx2-id-wpinv-discount-code table-layout"> |
82 | - <div class="gdmbx-th"><label for="wpinv_discount_code"><?php _e( 'Discount Code:', 'invoicing' );?></label></div> |
|
82 | + <div class="gdmbx-th"><label for="wpinv_discount_code"><?php _e('Discount Code:', 'invoicing'); ?></label></div> |
|
83 | 83 | <div class="gdmbx-td"> |
84 | - <input type="text" value="<?php echo esc_attr( $discount_code ); ?>" id="wpinv_discount" class="medium-text" <?php echo ( $discount_code ? 'readonly' : '' ); ?> /><?php if ( !$is_paid && !$disable_discount ) { ?><input value="<?php echo esc_attr_e( 'Apply', 'invoicing' ); ?>" class="button button-small button-primary <?php echo ( $discount_code ? 'wpi-hide' : 'wpi-inlineb' ); ?>" id="wpinv-apply-code" type="button" /><input value="<?php echo esc_attr_e( 'Remove', 'invoicing' ); ?>" class="button button-small button-primary <?php echo ( $discount_code ? 'wpi-inlineb' : 'wpi-hide' ); ?>" id="wpinv-remove-code" type="button" /><?php } ?> |
|
84 | + <input type="text" value="<?php echo esc_attr($discount_code); ?>" id="wpinv_discount" class="medium-text" <?php echo ($discount_code ? 'readonly' : ''); ?> /><?php if (!$is_paid && !$disable_discount) { ?><input value="<?php echo esc_attr_e('Apply', 'invoicing'); ?>" class="button button-small button-primary <?php echo ($discount_code ? 'wpi-hide' : 'wpi-inlineb'); ?>" id="wpinv-apply-code" type="button" /><input value="<?php echo esc_attr_e('Remove', 'invoicing'); ?>" class="button button-small button-primary <?php echo ($discount_code ? 'wpi-inlineb' : 'wpi-hide'); ?>" id="wpinv-remove-code" type="button" /><?php } ?> |
|
85 | 85 | </div> |
86 | 86 | </div> |
87 | 87 | <?php } ?> |
88 | 88 | </div> |
89 | 89 | </div> |
90 | 90 | <div class="gdmbx-row gdmbx-type-text gdmbx-wpinv-save-send table-layout"> |
91 | - <p class="wpi-meta-row wpi-save-send"><label for="wpi_save_send"><?php echo sprintf(__( 'Send %s:', 'invoicing' ),$post_obj->labels->singular_name) ; ?></label> |
|
91 | + <p class="wpi-meta-row wpi-save-send"><label for="wpi_save_send"><?php echo sprintf(__('Send %s:', 'invoicing'), $post_obj->labels->singular_name); ?></label> |
|
92 | 92 | <select id="wpi_save_send" name="wpi_save_send" class="wpi_select2"> |
93 | - <option value="1"><?php _e( 'Yes', 'invoicing' ); ?></option> |
|
94 | - <option value="" selected="selected"><?php _e( 'No', 'invoicing' ); ?></option> |
|
93 | + <option value="1"><?php _e('Yes', 'invoicing'); ?></option> |
|
94 | + <option value="" selected="selected"><?php _e('No', 'invoicing'); ?></option> |
|
95 | 95 | </select> |
96 | 96 | </p> |
97 | 97 | <p class="wpi-meta-row wpi-send-info"><?php echo $mail_notice; ?></p> |
98 | 98 | </div> |
99 | -<?php wp_nonce_field( 'wpinv_details', 'wpinv_details_nonce' ) ;?> |
|
99 | +<?php wp_nonce_field('wpinv_details', 'wpinv_details_nonce'); ?> |
|
100 | 100 | <?php |
101 | 101 | } |
102 | 102 | |
103 | - public static function resend_invoice( $post ) { |
|
103 | + public static function resend_invoice($post) { |
|
104 | 104 | global $wpi_mb_invoice; |
105 | 105 | |
106 | - if ( empty( $wpi_mb_invoice ) ) { |
|
106 | + if (empty($wpi_mb_invoice)) { |
|
107 | 107 | return; |
108 | 108 | } |
109 | 109 | |
110 | 110 | $text = array( |
111 | - 'message' => esc_attr__( 'This will send a copy of the invoice to the customer’s email address.', 'invoicing' ), |
|
112 | - 'button_text' => __( 'Resend Invoice', 'invoicing' ), |
|
111 | + 'message' => esc_attr__('This will send a copy of the invoice to the customer’s email address.', 'invoicing'), |
|
112 | + 'button_text' => __('Resend Invoice', 'invoicing'), |
|
113 | 113 | ); |
114 | 114 | |
115 | 115 | $text = apply_filters('wpinv_resend_invoice_metabox_text', $text); |
116 | - do_action( 'wpinv_metabox_resend_invoice_before', $wpi_mb_invoice ); |
|
116 | + do_action('wpinv_metabox_resend_invoice_before', $wpi_mb_invoice); |
|
117 | 117 | |
118 | - if ( $email = $wpi_mb_invoice->get_email() ) { |
|
118 | + if ($email = $wpi_mb_invoice->get_email()) { |
|
119 | 119 | $email_actions = array(); |
120 | - $email_actions['email_url'] = remove_query_arg( 'wpinv-message', add_query_arg( array( 'wpi_action' => 'send_invoice', 'invoice_id' => $post->ID ) ) ); |
|
121 | - $email_actions['reminder_url'] = add_query_arg( array( 'wpi_action' => 'send_reminder', 'invoice_id' => $post->ID ) ); |
|
120 | + $email_actions['email_url'] = remove_query_arg('wpinv-message', add_query_arg(array('wpi_action' => 'send_invoice', 'invoice_id' => $post->ID))); |
|
121 | + $email_actions['reminder_url'] = add_query_arg(array('wpi_action' => 'send_reminder', 'invoice_id' => $post->ID)); |
|
122 | 122 | |
123 | - $email_actions = apply_filters('wpinv_resend_invoice_email_actions', $email_actions ); |
|
123 | + $email_actions = apply_filters('wpinv_resend_invoice_email_actions', $email_actions); |
|
124 | 124 | ?> |
125 | 125 | <p class="wpi-meta-row wpi-resend-info"><?php echo $text['message']; ?></p> |
126 | - <p class="wpi-meta-row wpi-resend-email"><a href="<?php echo esc_url( $email_actions['email_url'] ); ?>" class="button button-secondary"><?php echo $text['button_text']; ?></a></p> |
|
127 | - <?php if ( wpinv_get_option( 'overdue_active' ) && "wpi_invoice" === $wpi_mb_invoice->post_type && $wpi_mb_invoice->needs_payment() && ( $due_date = $wpi_mb_invoice->get_due_date() ) ) { ?> |
|
128 | - <p class="wpi-meta-row wpi-send-reminder"><a title="<?php esc_attr_e( 'Send overdue reminder notification to customer', 'invoicing' ); ?>" href="<?php echo esc_url( $email_actions['reminder_url'] ); ?>" class="button button-secondary"><?php esc_attr_e( 'Send Reminder', 'invoicing' ); ?></a></p> |
|
126 | + <p class="wpi-meta-row wpi-resend-email"><a href="<?php echo esc_url($email_actions['email_url']); ?>" class="button button-secondary"><?php echo $text['button_text']; ?></a></p> |
|
127 | + <?php if (wpinv_get_option('overdue_active') && "wpi_invoice" === $wpi_mb_invoice->post_type && $wpi_mb_invoice->needs_payment() && ($due_date = $wpi_mb_invoice->get_due_date())) { ?> |
|
128 | + <p class="wpi-meta-row wpi-send-reminder"><a title="<?php esc_attr_e('Send overdue reminder notification to customer', 'invoicing'); ?>" href="<?php echo esc_url($email_actions['reminder_url']); ?>" class="button button-secondary"><?php esc_attr_e('Send Reminder', 'invoicing'); ?></a></p> |
|
129 | 129 | <?php } ?> |
130 | 130 | <?php |
131 | 131 | } |
132 | 132 | |
133 | - do_action( 'wpinv_metabox_resend_invoice_after', $wpi_mb_invoice ); |
|
133 | + do_action('wpinv_metabox_resend_invoice_after', $wpi_mb_invoice); |
|
134 | 134 | } |
135 | 135 | |
136 | - public static function subscriptions( $post ) { |
|
137 | - $invoice = wpinv_get_invoice( $post->ID ); |
|
136 | + public static function subscriptions($post) { |
|
137 | + $invoice = wpinv_get_invoice($post->ID); |
|
138 | 138 | |
139 | - if ( ! empty( $invoice ) && $invoice->is_recurring() && $invoice->is_parent() ) { |
|
140 | - $subscription = wpinv_get_subscription( $invoice ); |
|
139 | + if (!empty($invoice) && $invoice->is_recurring() && $invoice->is_parent()) { |
|
140 | + $subscription = wpinv_get_subscription($invoice); |
|
141 | 141 | |
142 | - if ( empty( $subscription ) ) { |
|
142 | + if (empty($subscription)) { |
|
143 | 143 | ?> |
144 | - <p class="wpi-meta-row"><?php echo wp_sprintf( __( 'New Subscription will be created when customer will checkout and pay the invoice. Go to: %sSubscriptions%s', 'invoicing' ), '<a href="' . admin_url( 'admin.php?page=wpinv-subscriptions' ).'">', '</a>' ); ?></p> |
|
144 | + <p class="wpi-meta-row"><?php echo wp_sprintf(__('New Subscription will be created when customer will checkout and pay the invoice. Go to: %sSubscriptions%s', 'invoicing'), '<a href="' . admin_url('admin.php?page=wpinv-subscriptions') . '">', '</a>'); ?></p> |
|
145 | 145 | <?php |
146 | 146 | return; |
147 | 147 | } |
148 | - $frequency = WPInv_Subscriptions::wpinv_get_pretty_subscription_frequency( $subscription->period, $subscription->frequency ); |
|
149 | - $billing = wpinv_price(wpinv_format_amount( $subscription->recurring_amount ), wpinv_get_invoice_currency_code( $subscription->parent_payment_id ) ) . ' / ' . $frequency; |
|
150 | - $initial = wpinv_price(wpinv_format_amount( $subscription->initial_amount ), wpinv_get_invoice_currency_code( $subscription->parent_payment_id ) ); |
|
148 | + $frequency = WPInv_Subscriptions::wpinv_get_pretty_subscription_frequency($subscription->period, $subscription->frequency); |
|
149 | + $billing = wpinv_price(wpinv_format_amount($subscription->recurring_amount), wpinv_get_invoice_currency_code($subscription->parent_payment_id)) . ' / ' . $frequency; |
|
150 | + $initial = wpinv_price(wpinv_format_amount($subscription->initial_amount), wpinv_get_invoice_currency_code($subscription->parent_payment_id)); |
|
151 | 151 | $payments = $subscription->get_child_payments(); |
152 | 152 | ?> |
153 | 153 | <p class="wpi-meta-row wpi-sub-label <?php echo 'status-' . $subscription->status; ?>"><?php _e('Recurring Payment', 'invoicing'); ?></p> |
154 | - <?php if ( ! empty( $subscription ) && ! empty( $subscription->id ) ) { ?> |
|
154 | + <?php if (!empty($subscription) && !empty($subscription->id)) { ?> |
|
155 | 155 | <p class="wpi-meta-row wpi-sub-id"> |
156 | - <label><?php _e( 'Subscription ID:', 'invoicing' ); ?> </label><a href="<?php echo esc_url( admin_url( 'admin.php?page=wpinv-subscriptions&id=' . $subscription->id ) ); ?>" title="<?php esc_attr_e( 'View or edit subscription', 'invoicing' ); ?>" target="_blank"><?php echo $subscription->id; ?></a></p> |
|
156 | + <label><?php _e('Subscription ID:', 'invoicing'); ?> </label><a href="<?php echo esc_url(admin_url('admin.php?page=wpinv-subscriptions&id=' . $subscription->id)); ?>" title="<?php esc_attr_e('View or edit subscription', 'invoicing'); ?>" target="_blank"><?php echo $subscription->id; ?></a></p> |
|
157 | 157 | <?php } ?> |
158 | 158 | <p class="wpi-meta-row wpi-bill-cycle"> |
159 | - <label><?php _e( 'Billing Cycle:', 'invoicing'); ?> </label><?php printf( _x( '%s then %s', 'Initial subscription amount then billing cycle and amount', 'invoicing' ), $initial, $billing ); ?> |
|
159 | + <label><?php _e('Billing Cycle:', 'invoicing'); ?> </label><?php printf(_x('%s then %s', 'Initial subscription amount then billing cycle and amount', 'invoicing'), $initial, $billing); ?> |
|
160 | 160 | </p> |
161 | 161 | <p class="wpi-meta-row wpi-billed-times"> |
162 | - <label><?php _e( 'Times Billed:', 'invoicing' ); ?> </label><?php echo $subscription->get_times_billed() . ' / ' . ( ( $subscription->bill_times == 0 ) ? 'Until Cancelled' : $subscription->bill_times ); ?> |
|
162 | + <label><?php _e('Times Billed:', 'invoicing'); ?> </label><?php echo $subscription->get_times_billed() . ' / ' . (($subscription->bill_times == 0) ? 'Until Cancelled' : $subscription->bill_times); ?> |
|
163 | 163 | </p> |
164 | 164 | <p class="wpi-meta-row wpi-start-date"> |
165 | - <label><?php _e( 'Start Date:', 'invoicing' ); ?> </label><?php echo date_i18n( get_option( 'date_format' ), strtotime( $subscription->created, current_time( 'timestamp' ) ) ); ?> |
|
165 | + <label><?php _e('Start Date:', 'invoicing'); ?> </label><?php echo date_i18n(get_option('date_format'), strtotime($subscription->created, current_time('timestamp'))); ?> |
|
166 | 166 | </p> |
167 | 167 | <p class="wpi-meta-row wpi-end-date"> |
168 | - <label><?php echo ( 'trialling' == $subscription->status ? __( 'Trialling Until:', 'invoicing' ) : __( 'Expiration Date:', 'invoicing' ) ); ?> </label><?php echo date_i18n( get_option( 'date_format' ), strtotime( $subscription->expiration, current_time( 'timestamp' ) ) ); ?> |
|
168 | + <label><?php echo ('trialling' == $subscription->status ? __('Trialling Until:', 'invoicing') : __('Expiration Date:', 'invoicing')); ?> </label><?php echo date_i18n(get_option('date_format'), strtotime($subscription->expiration, current_time('timestamp'))); ?> |
|
169 | 169 | </p> |
170 | - <?php if ( $subscription->status ) { ?> |
|
170 | + <?php if ($subscription->status) { ?> |
|
171 | 171 | <p class="wpi-meta-row wpi-sub-status"> |
172 | - <label><?php _e( 'Subscription Status:', 'invoicing'); ?> </label><?php echo $subscription->get_status_label(); ?> |
|
172 | + <label><?php _e('Subscription Status:', 'invoicing'); ?> </label><?php echo $subscription->get_status_label(); ?> |
|
173 | 173 | </p> |
174 | 174 | <?php } ?> |
175 | - <?php if ( !empty( $payments ) ) { ?> |
|
176 | - <p><strong><?php _e( 'Renewal Payments:', 'invoicing' ); ?></strong></p> |
|
175 | + <?php if (!empty($payments)) { ?> |
|
176 | + <p><strong><?php _e('Renewal Payments:', 'invoicing'); ?></strong></p> |
|
177 | 177 | <ul id="wpi-sub-payments"> |
178 | - <?php foreach ( $payments as $payment ) { |
|
178 | + <?php foreach ($payments as $payment) { |
|
179 | 179 | $invoice_id = $payment->ID; |
180 | 180 | ?> |
181 | 181 | <li> |
182 | - <a href="<?php echo esc_url( get_edit_post_link( $invoice_id ) ); ?>"><?php echo wpinv_get_invoice_number( $invoice_id ); ?></a> – |
|
183 | - <span><?php echo wpinv_get_invoice_date( $invoice_id ); ?> – </span> |
|
184 | - <span><?php echo wpinv_payment_total( $invoice_id, true ); ?></span> |
|
182 | + <a href="<?php echo esc_url(get_edit_post_link($invoice_id)); ?>"><?php echo wpinv_get_invoice_number($invoice_id); ?></a> – |
|
183 | + <span><?php echo wpinv_get_invoice_date($invoice_id); ?> – </span> |
|
184 | + <span><?php echo wpinv_payment_total($invoice_id, true); ?></span> |
|
185 | 185 | </li> |
186 | 186 | <?php } ?> |
187 | 187 | </ul> |
@@ -189,16 +189,16 @@ discard block |
||
189 | 189 | } |
190 | 190 | } |
191 | 191 | |
192 | - public static function renewals( $post ) { |
|
193 | - $invoice = wpinv_get_invoice( $post->ID ); |
|
192 | + public static function renewals($post) { |
|
193 | + $invoice = wpinv_get_invoice($post->ID); |
|
194 | 194 | |
195 | - if ( wpinv_is_subscription_payment( $invoice ) ) { |
|
196 | - $parent_url = get_edit_post_link( $invoice->parent_invoice ); |
|
197 | - $parent_id = wpinv_get_invoice_number( $invoice->parent_invoice ); |
|
198 | - $subscription = wpinv_get_subscription( $invoice ); |
|
195 | + if (wpinv_is_subscription_payment($invoice)) { |
|
196 | + $parent_url = get_edit_post_link($invoice->parent_invoice); |
|
197 | + $parent_id = wpinv_get_invoice_number($invoice->parent_invoice); |
|
198 | + $subscription = wpinv_get_subscription($invoice); |
|
199 | 199 | ?> |
200 | - <?php if ( ! empty( $subscription ) ) { ?><p class="wpi-meta-row wpi-sub-id"><label><?php _e('Subscription ID:', 'invoicing'); ?> </label><a href="<?php echo esc_url( admin_url( 'admin.php?page=wpinv-subscriptions&id=' . $subscription->id ) ); ?>" title="<?php esc_attr_e( 'View or edit subscription', 'invoicing' ); ?>" target="_blank"><?php echo $subscription->id; ?></a></p><?php } ?> |
|
201 | - <p class="wpi-meta-row wpi-parent-id"><label><?php _e( 'Parent Invoice:', 'invoicing' );?> </label><a href="<?php echo esc_url( $parent_url ); ?>"><?php echo $parent_id; ?></a></p> |
|
200 | + <?php if (!empty($subscription)) { ?><p class="wpi-meta-row wpi-sub-id"><label><?php _e('Subscription ID:', 'invoicing'); ?> </label><a href="<?php echo esc_url(admin_url('admin.php?page=wpinv-subscriptions&id=' . $subscription->id)); ?>" title="<?php esc_attr_e('View or edit subscription', 'invoicing'); ?>" target="_blank"><?php echo $subscription->id; ?></a></p><?php } ?> |
|
201 | + <p class="wpi-meta-row wpi-parent-id"><label><?php _e('Parent Invoice:', 'invoicing'); ?> </label><a href="<?php echo esc_url($parent_url); ?>"><?php echo $parent_id; ?></a></p> |
|
202 | 202 | <?php |
203 | 203 | } |
204 | 204 | } |
@@ -206,47 +206,47 @@ discard block |
||
206 | 206 | /** |
207 | 207 | * Renders a metabox to edit a payment form. |
208 | 208 | */ |
209 | - public static function payment_form( $post ) { |
|
210 | - WPInv_Meta_Box_Form_Items::output_options( $post ); |
|
209 | + public static function payment_form($post) { |
|
210 | + WPInv_Meta_Box_Form_Items::output_options($post); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
214 | 214 | * Renders a metabox to select items. |
215 | 215 | */ |
216 | - public static function payment_form_items( $post ) { |
|
217 | - WPInv_Meta_Box_Form_Items::output( $post ); |
|
216 | + public static function payment_form_items($post) { |
|
217 | + WPInv_Meta_Box_Form_Items::output($post); |
|
218 | 218 | } |
219 | 219 | |
220 | - public static function payment_meta( $post ) { |
|
220 | + public static function payment_meta($post) { |
|
221 | 221 | global $wpi_mb_invoice; |
222 | 222 | |
223 | - $set_dateway = empty( $wpi_mb_invoice->gateway ) ? true : false; |
|
224 | - if ( !$set_dateway && !$wpi_mb_invoice->get_meta( '_wpinv_checkout', true ) && !$wpi_mb_invoice->is_paid() && !$wpi_mb_invoice->is_refunded() ) { |
|
223 | + $set_dateway = empty($wpi_mb_invoice->gateway) ? true : false; |
|
224 | + if (!$set_dateway && !$wpi_mb_invoice->get_meta('_wpinv_checkout', true) && !$wpi_mb_invoice->is_paid() && !$wpi_mb_invoice->is_refunded()) { |
|
225 | 225 | $set_dateway = true; |
226 | 226 | } |
227 | 227 | |
228 | 228 | ?> |
229 | 229 | <p class="wpi-meta-row"> |
230 | - <?php if ( $set_dateway ) { $gateways = wpinv_get_enabled_payment_gateways( true ); ?> |
|
231 | - <label for="wpinv_gateway"><?php _e( 'Gateway:', 'invoicing' ) ; ?></label> |
|
230 | + <?php if ($set_dateway) { $gateways = wpinv_get_enabled_payment_gateways(true); ?> |
|
231 | + <label for="wpinv_gateway"><?php _e('Gateway:', 'invoicing'); ?></label> |
|
232 | 232 | <select required="required" id="wpinv_gateway" class="wpi_select2" name="wpinv_gateway"> |
233 | - <?php foreach ( $gateways as $name => $gateway ) { |
|
234 | - if ( $wpi_mb_invoice->is_recurring() && !wpinv_gateway_support_subscription( $name ) ) { |
|
233 | + <?php foreach ($gateways as $name => $gateway) { |
|
234 | + if ($wpi_mb_invoice->is_recurring() && !wpinv_gateway_support_subscription($name)) { |
|
235 | 235 | continue; |
236 | 236 | } |
237 | 237 | ?> |
238 | - <option value="<?php echo $name;?>" <?php selected( $wpi_mb_invoice->gateway, $name );?>><?php echo !empty( $gateway['admin_label'] ) ? $gateway['admin_label'] : $gateway['checkout_label']; ?></option> |
|
238 | + <option value="<?php echo $name; ?>" <?php selected($wpi_mb_invoice->gateway, $name); ?>><?php echo !empty($gateway['admin_label']) ? $gateway['admin_label'] : $gateway['checkout_label']; ?></option> |
|
239 | 239 | <?php } ?> |
240 | 240 | </select> |
241 | 241 | <?php } else { |
242 | - echo wp_sprintf( __( '<label>Gateway:</label> %s', 'invoicing' ), wpinv_get_gateway_admin_label( $wpi_mb_invoice->gateway ) ); |
|
242 | + echo wp_sprintf(__('<label>Gateway:</label> %s', 'invoicing'), wpinv_get_gateway_admin_label($wpi_mb_invoice->gateway)); |
|
243 | 243 | } ?> |
244 | 244 | </p> |
245 | - <?php if ( $key = $wpi_mb_invoice->get_key() ) { ?> |
|
246 | - <p class="wpi-meta-row"><?php echo wp_sprintf( __( '<label>Key:</label> %s', 'invoicing' ), $key ); ?></p> |
|
245 | + <?php if ($key = $wpi_mb_invoice->get_key()) { ?> |
|
246 | + <p class="wpi-meta-row"><?php echo wp_sprintf(__('<label>Key:</label> %s', 'invoicing'), $key); ?></p> |
|
247 | 247 | <?php } ?> |
248 | - <?php if ( $wpi_mb_invoice->is_paid() || $wpi_mb_invoice->is_refunded() ) { ?> |
|
249 | - <p class="wpi-meta-row"><?php echo wp_sprintf( __( '<label>Transaction ID:</label> %s', 'invoicing' ), wpinv_payment_link_transaction_id( $wpi_mb_invoice ) ); ?></p> |
|
248 | + <?php if ($wpi_mb_invoice->is_paid() || $wpi_mb_invoice->is_refunded()) { ?> |
|
249 | + <p class="wpi-meta-row"><?php echo wp_sprintf(__('<label>Transaction ID:</label> %s', 'invoicing'), wpinv_payment_link_transaction_id($wpi_mb_invoice)); ?></p> |
|
250 | 250 | <?php } ?> |
251 | 251 | <?php |
252 | 252 | } |
@@ -144,11 +144,11 @@ |
||
144 | 144 | <?php |
145 | 145 | } |
146 | 146 | |
147 | - /** |
|
148 | - * Outputs the payment options. |
|
149 | - * |
|
150 | - * @param WP_Post $post |
|
151 | - */ |
|
147 | + /** |
|
148 | + * Outputs the payment options. |
|
149 | + * |
|
150 | + * @param WP_Post $post |
|
151 | + */ |
|
152 | 152 | public static function output_options( $post ) { |
153 | 153 | |
154 | 154 | $post_id = ! empty( $post->ID ) ? $post->ID : 0; |
@@ -1,7 +1,7 @@ discard block |
||
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_Form_Items { |
@@ -11,17 +11,17 @@ discard block |
||
11 | 11 | * |
12 | 12 | * @param WP_Post $post |
13 | 13 | */ |
14 | - public static function output( $post ) { |
|
14 | + public static function output($post) { |
|
15 | 15 | global $wpinv_euvat, $ajax_cart_details; |
16 | 16 | |
17 | - $post_id = ! empty( $post->ID ) ? $post->ID : 0; |
|
18 | - $items = get_post_meta( $post->ID, 'wpinv_payment_items', true ); |
|
19 | - $supports_discounts = (int) get_post_meta( $post->ID, 'wpinv_form_supports_discounts', true ); |
|
20 | - $supports_quantities = (int) get_post_meta( $post->ID, 'wpinv_form_supports_quantities', true ); |
|
21 | - $enable_taxes = (int) get_post_meta( $post->ID, 'wpinv_form_supports_quantities', true ); |
|
22 | - $item_types = apply_filters( 'wpinv_item_types_for_quick_add_item', wpinv_get_item_types(), $post ); |
|
17 | + $post_id = !empty($post->ID) ? $post->ID : 0; |
|
18 | + $items = get_post_meta($post->ID, 'wpinv_payment_items', true); |
|
19 | + $supports_discounts = (int) get_post_meta($post->ID, 'wpinv_form_supports_discounts', true); |
|
20 | + $supports_quantities = (int) get_post_meta($post->ID, 'wpinv_form_supports_quantities', true); |
|
21 | + $enable_taxes = (int) get_post_meta($post->ID, 'wpinv_form_supports_quantities', true); |
|
22 | + $item_types = apply_filters('wpinv_item_types_for_quick_add_item', wpinv_get_item_types(), $post); |
|
23 | 23 | |
24 | - if ( empty( $items ) || ! is_array( $items ) ) { |
|
24 | + if (empty($items) || !is_array($items)) { |
|
25 | 25 | $items = array(); |
26 | 26 | } |
27 | 27 | |
@@ -36,17 +36,17 @@ discard block |
||
36 | 36 | data-supports-discouts="<?php echo $supports_discounts; ?>" |
37 | 37 | data-supports-discouts="<?php echo $supports_quantities; ?>" |
38 | 38 | data-supports-discouts="<?php echo $enable_taxes; ?>" |
39 | - data-decimal-places="<?php echo esc_attr( wpinv_decimals() ); ?>" |
|
40 | - data-currency-symbol="<?php echo esc_attr( wpinv_currency_symbol() ); ?>" |
|
41 | - data-currency-position="<?php echo esc_attr( wpinv_currency_position() ); ?>" |
|
39 | + data-decimal-places="<?php echo esc_attr(wpinv_decimals()); ?>" |
|
40 | + data-currency-symbol="<?php echo esc_attr(wpinv_currency_symbol()); ?>" |
|
41 | + data-currency-position="<?php echo esc_attr(wpinv_currency_position()); ?>" |
|
42 | 42 | > |
43 | 43 | |
44 | 44 | <thead> |
45 | 45 | <tr> |
46 | - <th class="id"><?php _e( 'ID', 'invoicing' );?></th> |
|
47 | - <th class="title"><?php _e( 'Name', 'invoicing' );?></th> |
|
48 | - <th class="desc"><?php _e( 'Description', 'invoicing' );?></th> |
|
49 | - <th class="price"><?php _e( 'Price', 'invoicing' );?></th> |
|
46 | + <th class="id"><?php _e('ID', 'invoicing'); ?></th> |
|
47 | + <th class="title"><?php _e('Name', 'invoicing'); ?></th> |
|
48 | + <th class="desc"><?php _e('Description', 'invoicing'); ?></th> |
|
49 | + <th class="price"><?php _e('Price', 'invoicing'); ?></th> |
|
50 | 50 | <th class="action"></th> |
51 | 51 | </tr> |
52 | 52 | </thead> |
@@ -54,25 +54,25 @@ discard block |
||
54 | 54 | <tbody class="wpinv-line-items"> |
55 | 55 | <?php |
56 | 56 | |
57 | - foreach ( $items as $item ) { |
|
58 | - $id = isset( $item['id'] ) ? (int) $item['id'] : 0; |
|
59 | - $name = isset( $item['name'] ) ? sanitize_text_field( $item['name'] ) : __( 'No name', 'invoicing' ); |
|
60 | - $price = isset( $item['price'] ) ? wpinv_format_amount( $item['price'] ) : 0.00; |
|
61 | - $description = isset( $item['description'] ) ? esc_textarea( $item['description'] ) : ''; |
|
57 | + foreach ($items as $item) { |
|
58 | + $id = isset($item['id']) ? (int) $item['id'] : 0; |
|
59 | + $name = isset($item['name']) ? sanitize_text_field($item['name']) : __('No name', 'invoicing'); |
|
60 | + $price = isset($item['price']) ? wpinv_format_amount($item['price']) : 0.00; |
|
61 | + $description = isset($item['description']) ? esc_textarea($item['description']) : ''; |
|
62 | 62 | |
63 | 63 | ?> |
64 | 64 | |
65 | 65 | <tr class="item" data-item-id="<?php echo $id; ?>"> |
66 | 66 | <td class="id"><?php echo $id; ?></td> |
67 | 67 | <td class="title"> |
68 | - <a href="<?php echo esc_url( get_edit_post_link( $id ) ); ?>" target="_blank"><?php echo $name ; ?></a> |
|
69 | - <?php echo wpinv_get_item_suffix( $id ); ?> |
|
68 | + <a href="<?php echo esc_url(get_edit_post_link($id)); ?>" target="_blank"><?php echo $name; ?></a> |
|
69 | + <?php echo wpinv_get_item_suffix($id); ?> |
|
70 | 70 | </td> |
71 | 71 | <td class="meta"> |
72 | - <?php echo $description ; ?> |
|
72 | + <?php echo $description; ?> |
|
73 | 73 | </td> |
74 | 74 | <td class="price"> |
75 | - <?php echo $price ; ?> |
|
75 | + <?php echo $price; ?> |
|
76 | 76 | </td> |
77 | 77 | </tr> |
78 | 78 | |
@@ -86,30 +86,30 @@ discard block |
||
86 | 86 | <td class="id"> |
87 | 87 | </td> |
88 | 88 | <td class="title"> |
89 | - <input type="text" class="regular-text" placeholder="<?php _e( 'Item Name', 'invoicing' ); ?>" value="" name="_wpinv_quick[name]"> |
|
89 | + <input type="text" class="regular-text" placeholder="<?php _e('Item Name', 'invoicing'); ?>" value="" name="_wpinv_quick[name]"> |
|
90 | 90 | |
91 | 91 | <div class="wp-clearfix"> |
92 | 92 | <label class="wpi-item-type"> |
93 | - <span class="title"><?php _e( 'Item type', 'invoicing' );?></span> |
|
93 | + <span class="title"><?php _e('Item type', 'invoicing'); ?></span> |
|
94 | 94 | </label> |
95 | 95 | </div> |
96 | 96 | |
97 | 97 | <div class="wp-clearfix"> |
98 | 98 | <?php |
99 | - echo wpinv_html_textarea( array( |
|
99 | + echo wpinv_html_textarea(array( |
|
100 | 100 | 'name' => '_wpinv_quick[excerpt]', |
101 | 101 | 'id' => '_wpinv_quick_excerpt', |
102 | 102 | 'value' => '', |
103 | 103 | 'class' => 'large-text', |
104 | - 'label' => __( 'Item description', 'invoicing' ), |
|
105 | - ) ); |
|
104 | + 'label' => __('Item description', 'invoicing'), |
|
105 | + )); |
|
106 | 106 | ?> |
107 | 107 | </div> |
108 | 108 | |
109 | 109 | <div class="wp-clearfix"> |
110 | 110 | <label class="wpi-item-actions"> |
111 | 111 | <span class="input-text-wrap"> |
112 | - <input type="button" value="<?php esc_attr_e( 'Add', 'invoicing' ); ?>" class="button button-primary" id="wpinv-save-item"><input type="button" value="Cancel" class="button button-secondary" id="wpinv-cancel-item"> |
|
112 | + <input type="button" value="<?php esc_attr_e('Add', 'invoicing'); ?>" class="button button-primary" id="wpinv-save-item"><input type="button" value="Cancel" class="button button-secondary" id="wpinv-cancel-item"> |
|
113 | 113 | </span> |
114 | 114 | </label> |
115 | 115 | </div> |
@@ -127,17 +127,17 @@ discard block |
||
127 | 127 | |
128 | 128 | <?php |
129 | 129 | |
130 | - echo wpinv_item_dropdown( array( |
|
130 | + echo wpinv_item_dropdown(array( |
|
131 | 131 | 'name' => 'wpinv_invoice_item', |
132 | 132 | 'id' => 'wpinv_invoice_item', |
133 | 133 | 'show_recurring' => true, |
134 | 134 | 'class' => 'wpi_select2', |
135 | - ) ); |
|
135 | + )); |
|
136 | 136 | |
137 | 137 | ?> |
138 | 138 | |
139 | - <input type="button" value="<?php esc_attr_e( 'Add item to form', 'invoicing'); ?>" class="button button-primary" id="wpinv-add-item" /> |
|
140 | - <input type="button" value="<?php esc_attr_e( 'Create new item', 'invoicing' );?>" class="button button-primary" id="wpinv-new-item" /> |
|
139 | + <input type="button" value="<?php esc_attr_e('Add item to form', 'invoicing'); ?>" class="button button-primary" id="wpinv-add-item" /> |
|
140 | + <input type="button" value="<?php esc_attr_e('Create new item', 'invoicing'); ?>" class="button button-primary" id="wpinv-new-item" /> |
|
141 | 141 | |
142 | 142 | </div> |
143 | 143 | </div> |
@@ -149,23 +149,23 @@ discard block |
||
149 | 149 | * |
150 | 150 | * @param WP_Post $post |
151 | 151 | */ |
152 | - public static function output_options( $post ) { |
|
152 | + public static function output_options($post) { |
|
153 | 153 | |
154 | - $post_id = ! empty( $post->ID ) ? $post->ID : 0; |
|
155 | - $success_page = get_post_meta( $post->ID, 'wpinv_success_page', true ); |
|
156 | - $button_text = get_post_meta( $post->ID, 'wpinv_button_text', true ); |
|
157 | - $processing_text = get_post_meta( $post->ID, 'wpinv_processing_text', true ); |
|
158 | - $supports_quantities = (int) get_post_meta( $post->ID, 'wpinv_form_supports_quantities', true ); |
|
159 | - $supports_discounts = (int) get_post_meta( $post->ID, 'wpinv_form_supports_discounts', true ); |
|
160 | - $enable_taxes = (int) get_post_meta( $post->ID, 'wpinv_form_supports_quantities', true ); |
|
154 | + $post_id = !empty($post->ID) ? $post->ID : 0; |
|
155 | + $success_page = get_post_meta($post->ID, 'wpinv_success_page', true); |
|
156 | + $button_text = get_post_meta($post->ID, 'wpinv_button_text', true); |
|
157 | + $processing_text = get_post_meta($post->ID, 'wpinv_processing_text', true); |
|
158 | + $supports_quantities = (int) get_post_meta($post->ID, 'wpinv_form_supports_quantities', true); |
|
159 | + $supports_discounts = (int) get_post_meta($post->ID, 'wpinv_form_supports_discounts', true); |
|
160 | + $enable_taxes = (int) get_post_meta($post->ID, 'wpinv_form_supports_quantities', true); |
|
161 | 161 | |
162 | 162 | $values = array( |
163 | - 'success_page' => empty( $success_page ) ? wpinv_get_success_page_uri() : $success_page, |
|
164 | - 'button_text' => empty( $button_text ) ? __( 'Pay Now', 'invoicing' ) : $button_text, |
|
165 | - 'processing_text' => empty( $processing_text ) ? __( 'Processing', 'invoicing' ) : $processing_text, |
|
166 | - 'supports_quantities' => empty( $supports_quantities ) ? 0 : 1, |
|
167 | - 'enable_taxes' => empty( $enable_taxes ) ? 0 : 1, |
|
168 | - 'supports_discounts' => empty( $supports_discounts ) ? 0 : 1, |
|
163 | + 'success_page' => empty($success_page) ? wpinv_get_success_page_uri() : $success_page, |
|
164 | + 'button_text' => empty($button_text) ? __('Pay Now', 'invoicing') : $button_text, |
|
165 | + 'processing_text' => empty($processing_text) ? __('Processing', 'invoicing') : $processing_text, |
|
166 | + 'supports_quantities' => empty($supports_quantities) ? 0 : 1, |
|
167 | + 'enable_taxes' => empty($enable_taxes) ? 0 : 1, |
|
168 | + 'supports_discounts' => empty($supports_discounts) ? 0 : 1, |
|
169 | 169 | ); |
170 | 170 | |
171 | 171 | ?> |
@@ -179,8 +179,8 @@ discard block |
||
179 | 179 | <td> |
180 | 180 | <div> |
181 | 181 | <label> |
182 | - <input type="checkbox" name="supports_quantities" id="field_supports_quantities" value="1" <?php checked( $values['supports_quantities'], 1 ); ?>> |
|
183 | - <span><?php _e( 'Let users set custom item quantities', 'invoicing' ); ?></span> |
|
182 | + <input type="checkbox" name="supports_quantities" id="field_supports_quantities" value="1" <?php checked($values['supports_quantities'], 1); ?>> |
|
183 | + <span><?php _e('Let users set custom item quantities', 'invoicing'); ?></span> |
|
184 | 184 | </label> |
185 | 185 | </div> |
186 | 186 | </td> |
@@ -191,8 +191,8 @@ discard block |
||
191 | 191 | <td> |
192 | 192 | <div> |
193 | 193 | <label> |
194 | - <input type="checkbox" name="enable_taxes" id="field_enable_taxes" value="1" <?php checked( $values['enable_taxes'], 1 ); ?>> |
|
195 | - <span><?php _e( 'Enable tax calculations', 'invoicing' ); ?></span> |
|
194 | + <input type="checkbox" name="enable_taxes" id="field_enable_taxes" value="1" <?php checked($values['enable_taxes'], 1); ?>> |
|
195 | + <span><?php _e('Enable tax calculations', 'invoicing'); ?></span> |
|
196 | 196 | </label> |
197 | 197 | </div> |
198 | 198 | </td> |
@@ -203,39 +203,39 @@ discard block |
||
203 | 203 | <td> |
204 | 204 | <div> |
205 | 205 | <label> |
206 | - <input type="checkbox" name="supports_discounts" id="field_supports_discounts" value="1" <?php checked( $values['supports_discounts'], 1 ); ?>> |
|
207 | - <span><?php _e( 'Enable coupon codes', 'invoicing' ); ?></span> |
|
206 | + <input type="checkbox" name="supports_discounts" id="field_supports_discounts" value="1" <?php checked($values['supports_discounts'], 1); ?>> |
|
207 | + <span><?php _e('Enable coupon codes', 'invoicing'); ?></span> |
|
208 | 208 | </label> |
209 | 209 | </div> |
210 | 210 | </td> |
211 | 211 | </tr> |
212 | 212 | |
213 | 213 | <tr class="form-field-success_page"> |
214 | - <th scope="row"><label for="field_success_page"><?php _e( 'Success Page', 'invoicing' ); ?></label></th> |
|
214 | + <th scope="row"><label for="field_success_page"><?php _e('Success Page', 'invoicing'); ?></label></th> |
|
215 | 215 | <td> |
216 | 216 | <div> |
217 | - <input type="text" class="regular-text" name="success_page" id="field_success_page" value="<?php echo esc_attr( $values['success_page'] ); ?>"> |
|
218 | - <p class="description"><?php _e( 'Where should we redirect users after successfuly completing their payment?', 'invoicing' ); ?></p> |
|
217 | + <input type="text" class="regular-text" name="success_page" id="field_success_page" value="<?php echo esc_attr($values['success_page']); ?>"> |
|
218 | + <p class="description"><?php _e('Where should we redirect users after successfuly completing their payment?', 'invoicing'); ?></p> |
|
219 | 219 | </div> |
220 | 220 | </td> |
221 | 221 | </tr> |
222 | 222 | |
223 | 223 | <tr class="form-field-button_text"> |
224 | - <th scope="row"><label for="field_button_text"><?php _e( 'Button Text', 'invoicing' ); ?></label></th> |
|
224 | + <th scope="row"><label for="field_button_text"><?php _e('Button Text', 'invoicing'); ?></label></th> |
|
225 | 225 | <td> |
226 | 226 | <div> |
227 | - <input type="text" class="regular-text" name="button_text" id="field_button_text" value="<?php echo esc_attr( $values['button_text'] ); ?>"> |
|
228 | - <p class="description"><?php _e( 'Payment button text', 'invoicing' ); ?></p> |
|
227 | + <input type="text" class="regular-text" name="button_text" id="field_button_text" value="<?php echo esc_attr($values['button_text']); ?>"> |
|
228 | + <p class="description"><?php _e('Payment button text', 'invoicing'); ?></p> |
|
229 | 229 | </div> |
230 | 230 | </td> |
231 | 231 | </tr> |
232 | 232 | |
233 | 233 | <tr class="form-field-processing_text"> |
234 | - <th scope="row"><label for="field_processing_text"><?php _e( 'Processing Text', 'invoicing' ); ?></label></th> |
|
234 | + <th scope="row"><label for="field_processing_text"><?php _e('Processing Text', 'invoicing'); ?></label></th> |
|
235 | 235 | <td> |
236 | 236 | <div> |
237 | - <input type="text" class="regular-text" name="processing_text" id="field_processing_text" value="<?php echo esc_attr( $values['processing_text'] ); ?>"> |
|
238 | - <p class="description"><?php _e( 'Processing payment button text', 'invoicing' ); ?></p> |
|
237 | + <input type="text" class="regular-text" name="processing_text" id="field_processing_text" value="<?php echo esc_attr($values['processing_text']); ?>"> |
|
238 | + <p class="description"><?php _e('Processing payment button text', 'invoicing'); ?></p> |
|
239 | 239 | </div> |
240 | 240 | </td> |
241 | 241 | </tr> |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | <?php |
247 | 247 | } |
248 | 248 | |
249 | - public static function save( $post_id, $data, $post ) { |
|
249 | + public static function save($post_id, $data, $post) { |
|
250 | 250 | |
251 | 251 | } |
252 | 252 | } |