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rc.2 3.1.0 6.2.1 3.1.1 6.2.2 3.1.2 6.2.3 3.2.0 6.3.0 3.2.1 6.3.0-beta.1 3.2.2 6.3.0-rc.1 3.2.3 6.3.0-rc.2 3.2.4 6.3.1 3.2.5 6.3.2 3.2.6 6.4.0 3.3.0 6.4.0-beta.1 3.3.1 6.4.0-rc.1 3.3.2 6.4.1 3.3.2-rc.1 6.4.2 3.3.3 6.5.0 3.3.4 6.5.0-beta.1 3.3.5 6.5.0-rc.1 3.3.6 6.5.0-rc.2 3.4.0 6.5.1 3.4.0-beta.1 6.5.2 3.4.0-rc.2 6.6.0 3.4.1 6.6.0-beta.1 3.4.2 6.6.0-rc.1 3.4.3 6.6.0-rc.2 3.4.4 6.6.1 3.4.5 6.6.2 3.4.6 6.7.0 3.4.7 6.7.0-beta.1 3.4.8 6.7.0-beta.2 3.5.0 6.7.0-rc.1 3.5.0-beta.1 6.7.1 3.5.0-rc.1 6.8.0 3.5.0-rc.2 6.8.0-beta.1 3.5.1 6.8.0-beta.2 3.5.10 6.8.0-rc.1 3.5.2 6.8.1 3.5.3 6.8.2 3.5.4 6.8.3 3.5.5 6.9.0 3.5.6 6.9.0-beta.1 3.5.7 6.9.0-beta.2 3.5.8 6.9.0-rc.1 3.5.9 6.9.1 3.6.0 6.9.2 3.6.0-beta.1 6.9.3 3.6.0-rc.1 6.9.4 3.6.0-rc.2 6.9.5 3.6.0-rc.3 7.0.0 3.6.1 7.0.0-beta.1 3.6.2 7.0.0-beta.2 3.6.3 7.0.0-beta.3 3.6.4 7.0.0-rc.1 3.6.5 7.0.0-rc.2 3.6.6 7.0.1 3.6.7 7.0.2 3.7.0 7.1.0 3.7.0-beta.1 7.1.0-beta.1 3.7.0-rc.1 7.1.0-beta.2 3.7.0-rc.2 7.1.0-rc.1 3.7.1 7.1.0-rc.2 3.7.2 7.1.1
woocommerce / src / Internal / StockNotifications / Admin / Templates / html-admin-notification-edit.php
woocommerce / src / Internal / StockNotifications / Admin / Templates Last commit date
html-admin-notification-create.php 1 month ago html-admin-notification-edit.php 10 months ago html-admin-notifications.php 10 months ago html-product-data-admin.php 10 months ago
html-admin-notification-edit.php
247 lines
1 <?php
2 /**
3 * Admin View: Notification create
4 *
5 * @since 10.2.0
6 */
7
8 declare( strict_types = 1 );
9
10 if ( ! defined( 'ABSPATH' ) ) {
11 exit;
12 }
13
14 use Automattic\WooCommerce\Internal\StockNotifications\Admin\NotificationsPage;
15 use Automattic\WooCommerce\Internal\StockNotifications\Enums\NotificationStatus;
16 ?>
17 <div class="wrap woocommerce woocommerce-customer-stock-notifications">
18
19 <h1 class="wp-heading-inline"><?php esc_html_e( 'Edit Notification', 'woocommerce' ); ?></h1>
20 <a href="<?php echo esc_url( NotificationsPage::PAGE_URL ); ?>" class="page-title-action"><?php esc_html_e( 'View All', 'woocommerce' ); ?></a>
21 <a href="<?php echo esc_url( add_query_arg( array( 'notification_action' => 'create' ), NotificationsPage::PAGE_URL ) ); ?>" class="page-title-action"><?php esc_html_e( 'Add New', 'woocommerce' ); ?></a>
22
23 <hr class="wp-header-end">
24
25 <form method="POST" id="edit-notification-form">
26 <?php wp_nonce_field( 'woocommerce-customer-stock-notification-edit', 'customer_stock_notification_edit_security' ); ?>
27
28 <div id="poststuff">
29 <div id="post-body" class="columns-2">
30
31 <!-- SIDEBAR -->
32 <div id="postbox-container-1" class="postbox-container">
33
34 <div id="woocommerce-order-actions" class="postbox">
35
36 <h2 class="hndle ui-sortable-handle"><span><?php esc_html_e( 'Notification actions', 'woocommerce' ); ?></span></h2>
37
38 <div class="inside">
39 <ul class="order_actions submitbox">
40
41 <li class="wide" id="actions">
42 <select name="wc_customer_stock_notification_action">
43 <option value=""><?php esc_html_e( 'Choose an action...', 'woocommerce' ); ?></option>
44 <?php if ( $notification->get_status() === NotificationStatus::ACTIVE ) : ?>
45 <option value="send_notification"><?php esc_html_e( 'Send', 'woocommerce' ); ?></option>
46 <option value="cancel_notification"><?php esc_html_e( 'Cancel', 'woocommerce' ); ?></option>
47 <?php elseif ( $notification->get_status() === NotificationStatus::PENDING ) : ?>
48 <option value="send_verification_email"><?php esc_html_e( 'Resend verification email', 'woocommerce' ); ?></option>
49 <option value="activate_notification"><?php esc_html_e( 'Activate', 'woocommerce' ); ?></option>
50 <?php elseif ( $notification->get_status() === NotificationStatus::CANCELLED ) : ?>
51 <option value="activate_notification"><?php esc_html_e( 'Activate', 'woocommerce' ); ?></option>
52 <?php elseif ( $notification->get_status() === NotificationStatus::SENT ) : ?>
53 <option value="activate_notification"><?php esc_html_e( 'Activate', 'woocommerce' ); ?></option>
54 <option value="cancel_notification"><?php esc_html_e( 'Cancel', 'woocommerce' ); ?></option>
55 <?php endif; ?>
56 </select>
57 <button class="button wc-reload"><span><?php esc_html_e( 'Apply', 'woocommerce' ); ?></span></button>
58 </li>
59
60 <li class="wide">
61 <div id="delete-action">
62 <a class="submitdelete deletion" href="<?php echo esc_url( wp_nonce_url( admin_url( sprintf( NotificationsPage::PAGE_URL . '&notification_action=delete&notification_id=%d', $notification->get_id() ) ), 'delete_customer_stock_notification' ) ); ?>"><?php esc_html_e( 'Delete permanently', 'woocommerce' ); ?></a>
63 </div>
64
65 <button type="submit" class="button save_order button-primary" name="save" value="<?php esc_attr_e( 'Update', 'woocommerce' ); ?>"><?php esc_html_e( 'Update', 'woocommerce' ); ?></button>
66 </li>
67
68 </ul>
69 </div>
70
71 </div><!-- .postbox -->
72
73 </div><!-- #container1 -->
74
75 <!-- MAIN -->
76 <div id="postbox-container-2" class="postbox-container">
77
78 <div id="notification-data" class="postbox notification-data">
79
80 <div class="notification-data__row notification-data__row--columns">
81
82 <div class="notification-data__header-column">
83
84 <h2 class="notification-data__header">
85 <?php
86 /* translators: %s: Notification ID */
87 echo esc_html( sprintf( __( 'Notification #%d details', 'woocommerce' ), $notification->get_id() ) );
88 ?>
89 </h2>
90
91 </div>
92
93 <div class="notification-data__status-column">
94 <?php
95 if ( $notification->get_status() === NotificationStatus::PENDING ) {
96 $notification_status = 'cancelled';
97 $label = _x( 'Pending', 'stock notification status', 'woocommerce' );
98 } elseif ( $notification->get_status() === NotificationStatus::CANCELLED ) {
99 $notification_status = 'cancelled';
100 $label = _x( 'Cancelled', 'stock notification status', 'woocommerce' );
101 } elseif ( $notification->get_status() === NotificationStatus::SENT ) {
102 $notification_status = 'cancelled';
103 $label = _x( 'Sent', 'stock notification status', 'woocommerce' );
104 } else {
105 $notification_status = 'completed';
106 $label = _x( 'Active', 'stock notification status', 'woocommerce' );
107 }
108
109 printf( '<mark class="order-status %s"><span>%s</span></mark>', esc_attr( sanitize_html_class( 'status-' . $notification_status ) ), esc_html( $label ) );
110
111 ?>
112 </div>
113
114 </div><!-- #row -->
115
116 <div class="notification-data__row notification-data__row--columns">
117
118 <div class="notification-data__form-field">
119 <label><?php esc_html_e( 'Customer', 'woocommerce' ); ?></label>
120 <?php
121 $user_string = '&mdash;';
122 $user_id = $notification->get_user_id();
123 $user = $user_id ? get_user_by( 'id', $user_id ) : null;
124 if ( is_a( $user, 'WP_User' ) ) {
125 $user_string = $user->display_name;
126 } elseif ( filter_var( $notification->get_user_email(), FILTER_VALIDATE_EMAIL ) ) {
127 $user_string = $notification->get_user_email();
128 }
129 ?>
130 <p class="notification-data__customer-data"><?php echo esc_html( $user_string ); ?></p>
131
132 <div class="form-field__actions">
133 <?php if ( isset( $user ) && is_a( $user, 'WP_User' ) ) { ?>
134 <a href="<?php echo esc_url( get_edit_user_link( $user->ID ) ); ?>"><?php esc_html_e( 'View profile &rarr;', 'woocommerce' ); ?></a>
135 <?php } ?>
136 <a href="<?php echo esc_url( admin_url( NotificationsPage::PAGE_URL . '&s=' . rawurlencode( $notification->get_user_email() ) ) ); ?>"><?php esc_html_e( 'View notifications &rarr;', 'woocommerce' ); ?></a>
137 </div>
138 </div>
139
140 <div class="notification-data__form-field">
141
142 <label><?php esc_html_e( 'Product', 'woocommerce' ); ?></label>
143
144 <div class="notification-data__product-data">
145 <?php
146 $product = $notification->get_product();
147 if ( is_a( $product, 'WC_Product' ) ) {
148 include __DIR__ . '/html-product-data-admin.php';
149 } else {
150 ?>
151 <small><?php esc_html_e( 'Product not found.', 'woocommerce' ); ?></small>
152 <?php
153 }
154 ?>
155 </div>
156
157 </div>
158
159 </div><!-- #row -->
160
161 <div class="notification-data__meta">
162 <div class="notification-data__row notification-data__row--columns">
163
164 <div class="notification-data__meta-column">
165 <div class="notification-data__meta-data">
166 <label><?php esc_html_e( 'Waiting', 'woocommerce' ); ?></label>
167 <span>
168 <?php
169 if ( ! $notification->get_date_created() || $notification->get_status() !== 'active' ) {
170 $t_time = __( '&mdash;', 'woocommerce' );
171 $h_time = $t_time;
172 $time_diff = 0;
173 } else {
174 $date_created_timestamp = $notification->get_date_created()->getTimestamp();
175 $t_time = date_i18n( _x( 'Y/m/d g:i:s a', 'list table date hover format', 'woocommerce' ), $date_created_timestamp );
176 $time_diff = time() - $date_created_timestamp;
177
178 if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) {
179 /* translators: %s: human time diff */
180 $h_time = wp_kses_post( human_time_diff( $date_created_timestamp ) );
181 } else {
182 $h_time = date_i18n( wc_date_format(), $date_created_timestamp );
183 }
184 }
185 ?>
186 <span title="<?php echo esc_attr( $t_time ); ?>"><?php echo esc_html( $h_time ); ?></span>
187 </span>
188 </div>
189 <div class="notification-data__meta-data">
190 <label><?php esc_html_e( 'Signed up', 'woocommerce' ); ?></label>
191 <?php
192 $date_created = $notification->get_date_created();
193
194 if ( ! $date_created ) {
195 $t_time = __( '&mdash;', 'woocommerce' );
196 $h_time = $t_time;
197 } else {
198 $date_created = $date_created->getTimestamp();
199 $t_time = date_i18n( _x( 'Y/m/d g:i:s a', 'list table date hover format', 'woocommerce' ), $date_created );
200 $h_time = date_i18n( wc_date_format(), $date_created );
201 }
202 ?>
203 <span title="<?php echo esc_attr( $t_time ); ?>"><?php echo esc_html( $h_time ); ?></span>
204 </div>
205 </div><!-- .column -->
206
207 <div class="notification-data__meta-column">
208 <div class="notification-data__meta-data">
209 <label><?php esc_html_e( 'Signed-up customers', 'woocommerce' ); ?></label>
210 <span>
211 <?php
212 echo absint( $signed_up_customers );
213
214 if ( $signed_up_customers > 0 ) {
215 ?>
216 <a href="<?php echo esc_attr( add_query_arg( array( 'customer_stock_notifications_product_filter' => $notification->get_product_id() ), NotificationsPage::PAGE_URL ) ); ?>"><?php esc_html_e( 'View notifications &rarr;', 'woocommerce' ); ?></a>
217 <?php } ?>
218 </span>
219 </div>
220 <?php
221 $attributes = $notification->get_product_formatted_variation_list( true );
222 if ( ! empty( $attributes ) ) {
223 ?>
224 <div class="notification-data__meta-data">
225 <label><?php esc_html_e( 'Attributes', 'woocommerce' ); ?></label>
226 <span>
227 <?php echo wp_kses_post( $attributes ); ?>
228 </span>
229 </div>
230 <?php } ?>
231
232 </div><!-- .column -->
233
234 </div>
235 </div>
236
237 </div><!-- .postbox -->
238
239 </div><!-- #container2 -->
240
241 </div><!-- #post-body -->
242 </div>
243
244 </form>
245
246 </div>
247