$step) { $next_step = gravity_flow()->get_next_step($step, $entry, $form); if ($next_step && $next_step->get_id() === $current_step->get_id()) { $previous_step_id = $step->get_id(); } } if (! empty($previous_step_id)) { $delivery_process_actions[] = array( 'label' => esc_html__( 'Previous step', 'wiaas' ), 'value' => 'send_to_step|' . $previous_step_id ); } // get next step id for current step $next_step = gravity_flow()->get_next_step($current_step, $entry, $form); if ($next_step) { $delivery_process_actions[] = array( 'label' => esc_html__( 'Next step', 'wiaas' ), 'value' => 'send_to_step|' . $next_step->get_id() ); } } return $delivery_process_actions; } public static function wiaas_ajax_create_order_delivery_process() { check_ajax_referer('wiaas_create_order_delivery_process'); $error = new WP_Error('-1', 'Failed to create order delivery process'); if (!isset($_POST['order']) || !isset($_POST['form'])){ wp_send_json_error($error); } $order_id = intval( $_POST['order'] ); $form_id = intval( $_POST['form'] ); if ($process_entry_id = Wiaas_Delivery_Process::create_delivery_process_for_order($order_id, $form_id)){ $workflow = new Gravity_Flow_API($form_id); $step = $workflow->get_current_step(GFAPI::get_entry($process_entry_id)); $entry_url = $step->get_entry_url(); wp_send_json_success(array( 'url' => $entry_url )); } wp_send_json_error($error); } public static function order_delivery_process_meta_box() { global $post; $order_id = $post->ID; $process_entry = Wiaas_Delivery_Process::get_order_delivery_process_entry($order_id); if ( empty($process_entry) ){ $order = wc_get_order($order_id); $list_of_delivery_processes = Wiaas_Delivery_Process::get_available_process_list_for_country( Wiaas_Countries::get_country_code_by_currency($order->get_currency()) ); ?>
Assign
'gravityflow-inbox', 'view' => 'entry', 'id' => $process_entry['form_id'], 'lid' => $process_entry['id'] ), admin_url() ); ?> Delivery Process id]; } } // display process steps $workflow_api = new Gravity_Flow_API($form['id']); $steps = $workflow_api->get_steps(); ?>

Order placed

Assign process

$step) { if (! $step->is_active()) { continue; } $is_step_completed = $step->get_status() === 'complete' || $step->get_status() === 'approved'; $is_current_step = $current_step && $step->get_id() === $current_step->get_id(); if ($is_current_step) { $style = 'color: #FD8049;'; } else if ($is_step_completed) { $style = 'color: #34C388;'; } else { $style = 'opacity: 0.5; color: #CCC;'; } ?>

get_name(), 'wiaas') ?>

target_form_id ); if (empty($action_form)) { echo '
'; continue; } $action_delivery_settings = rgar($action_form, 'wiaas_delivery_process'); ?>
' . ' ' . $action_form['title'] . '', $form_url ); echo $form_link; } echo '


'; $page_size = 20; $search_criteria = array( 'status' => 'active', 'field_filters' => array( array( 'key' => 'wiaas_delivery_process_id', 'value' => $entry['id'] ), ), ); $sorting = array( 'key' => 'date_created', 'direction' => 'DESC' ); $paging = array( 'offset' => 0, 'page_size' => $page_size ); $entries = GFAPI::get_entries( $action_form, $search_criteria, $sorting, $paging ); foreach ($entries as $action_entry) { self::_display_step_action_entry($action_form, $action_entry); } ?>
get_current_step($action_entry); ?> type === 'wiaas_order') { continue; } if ($field->type === 'workflow_discussion') { echo ''; continue; } $value = $field->get_value_entry_detail($action_entry[$field->id]); $label = $field->get_field_label(false, $action_entry[$field->id]); echo '' . '' . '' . ''; } ?>
' . $field->format_discussion_value($action_entry[$field->id]) . '
' . $label . ' : ' . $value . '
get_status_label($current_action_step->get_status()) . ': ' . $current_action_step->get_name(); echo '' . ' ' . ''; } else { echo $workflow_api->get_status($action_entry); } ?>