$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()) ); ?>
'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(); ?>| ' . $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); } ?> | |