Update delivery process fields and sample form
This commit is contained in:
@@ -90,7 +90,7 @@ class Wiaas_Admin_Order_Process_Flow {
|
||||
|
||||
$order_id = $entry['wiaas_delivery_order_id'];
|
||||
|
||||
$suppliers = wiaas_get_order_delivery_suppliers($order_id);
|
||||
$suppliers = Wiaas_Order::get_suppliers($order_id);
|
||||
$final_estimated_date = Wiaas_Order::get_final_estimated_date($order_id);
|
||||
$final_confirmed_date = Wiaas_Order::get_final_confirmed_date($order_id);
|
||||
$earliest_installation_date = Wiaas_Order::get_earliest_installation_date($order_id);
|
||||
@@ -102,6 +102,24 @@ class Wiaas_Admin_Order_Process_Flow {
|
||||
|
||||
$admin_action = rgpost( 'wiaas_delivery_process_navigation_action' );
|
||||
|
||||
if ($admin_action === 'complete') {
|
||||
|
||||
$api = new Gravity_Flow_API( $form['id'] );
|
||||
|
||||
$current_step = $api->get_current_step($entry);
|
||||
|
||||
if ( $current_step ) {
|
||||
$current_step->purge_assignees();
|
||||
$current_step->update_step_status( 'complete' );
|
||||
}
|
||||
|
||||
$api->process_workflow($entry['id']);
|
||||
|
||||
$feedback = esc_html__( 'Workflow Complete', 'wiaas' );
|
||||
|
||||
return $feedback;
|
||||
}
|
||||
|
||||
list( $base_admin_action, $action_id ) = rgexplode( '|', $admin_action, 2 );
|
||||
|
||||
if ( $base_admin_action == 'send_to_step' ) {
|
||||
@@ -162,11 +180,12 @@ class Wiaas_Admin_Order_Process_Flow {
|
||||
<input type="hidden" name="_gravityflow_admin_action" value="1">
|
||||
|
||||
<input
|
||||
data-step="send_to_step|<?php esc_attr_e($next_step_id, 'wiaas') ?>"
|
||||
data-step="<?php echo empty($next_step_id) ? 'complete' : 'send_to_step|'.$next_step_id ?>"
|
||||
type="submit"
|
||||
<?php disabled(empty($next_step_id), true, true) ?>
|
||||
class="button button-primary wiaas_delivery_step_nav"
|
||||
style="float:right; margin-left: 20px;" value="NEXT STEP">
|
||||
style="float:right; margin-left: 20px;"
|
||||
value="<?php echo empty($next_step_id) ? 'COMPLETE' : 'NEXT STEP' ?>"
|
||||
>
|
||||
|
||||
<input
|
||||
data-step="send_to_step|<?php esc_attr_e($previous_step_id, 'wiaas') ?>"
|
||||
@@ -390,6 +409,7 @@ class Wiaas_Admin_Order_Process_Flow {
|
||||
<hr />
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Wiaas_Admin_Order_Process_Flow::init();
|
||||
|
||||
Reference in New Issue
Block a user