Files
old-new-wiaas/backend/app/plugins/wiaas/includes/admin/delivery-process/views/html-admin-delivery-process-page.php

147 lines
3.6 KiB
PHP

<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* WC_Order $order
*
*/
$delivery_process = Wiaas_Delivery_Process::get_order_delivery_process_entry($order->get_id());
if ( ! empty($delivery_process)) {
$form_id = $delivery_process['form_id'];
$workflow_api = new Gravity_Flow_API($form_id);
$current_step = $workflow_api->get_current_step($delivery_process);
$steps = $workflow_api->get_steps();
}
?>
<div class="wrap">
<form name="delivery" action="" method="post">
<input type="hidden" name="page" value="wiaas-order-delivery"/>
<input type="hidden" name="id" value="<?php echo esc_attr($order->get_id()) ?>"/>
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-2">
<div id="postbox-container-1" class="postbox-container">
<div class="postbox">
<div class="inside">
<?php require 'html-order-notes.php' ?>
</div>
</div>
</div>
<div id="postbox-container-2" class="postbox-container">
<div class="postbox">
<div class="inside">
<div class="panel-wrap">
<div class="panel">
<h1>
Delivery Order
<?php
if (current_user_can('edit_others_shop_orders')) {
echo '<a href="' . esc_url( admin_url( 'post.php?post=' . absint( $order->get_id() ) ) . '&action=edit' ) . '">#' . esc_attr( $order->get_order_number() ) . '</a>';
} else {
echo '#' . esc_attr($order->get_order_number());
}
?>
&nbsp &nbsp
<mark class="wiaas-order-status <?php esc_attr_e( sanitize_html_class( 'wiaas-order-status-' . $order->get_status() ), 'wiaas' ) ?>">
<span>
<?php esc_html_e( wc_get_order_status_name( $order->get_status() ) ) ?>
</span>
</mark>
</h1>
<?php
if (GFAPI::current_user_can_any( 'manage_wiaas_order_delivery_process' )) {
?>
<p>
<a
id="wiaas_download_procurement_order_btn"
href="<?php echo admin_url() . '?wiaas-procurement-order-id=' . $order->get_id() ?>"
download
class="button"
>
<span><?php esc_html_e('Download procurement report', 'wiaas') ?></span>
</a>
</p>
<?php
}
?>
<?php
if (empty($delivery_process)) {
echo '<h2>Delivery process has not been assigned.</h2>';
}
if (! empty($delivery_process)) {
$is_disabled = ! Wiaas_Delivery_Process::can_delivery_dates_be_set($order->get_id(), $delivery_process, $steps);
require 'html-order-suppliers-delivery-dates.php';
}
?>
</div>
</div>
</div>
</div>
<?php
if (! empty($delivery_process)) {
if ($current_step && GFAPI::current_user_can_any( 'manage_wiaas_order_delivery_process' )) {
require 'html-delivery-process-navigation.php';
}
?>
<div class="postbox">
<h3>
<i class="dashicons dashicons-marker" style="font-size: 22px; margin-right: 10px;color: #34C388; "></i>
<span>Order placed </span>
</h3>
</div>
<div class="postbox">
<h3>
<i class="dashicons dashicons-marker" style="font-size: 22px; margin-right: 10px;color: #34C388; "></i>
<span> Assign process </span>
</h3>
</div>
<?php
foreach ($steps as $step) {
$step = $workflow_api->get_step($step->get_id(), $delivery_process);
require 'html-delivery-process-step.php';
}
?>
<?php
}
?>
</div>
</div>
</div>
</form>
</div>