51 lines
1.6 KiB
PHP
51 lines
1.6 KiB
PHP
<?php
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
$is_step_completed = $current_step->get_status() === 'complete' || $current_step->get_status() === 'approved';
|
|
|
|
// get next step id
|
|
$next_step = gravity_flow()->get_next_step($current_step, $current_step->get_entry(), $current_step->get_form());
|
|
$next_step_id = empty($next_step) ? null : $next_step->get_id();
|
|
|
|
// get previous step id
|
|
foreach ($steps as $step) {
|
|
|
|
$next = gravity_flow()->get_next_step($step, $current_step->get_entry(), $current_step->get_form());
|
|
if ($next && $next->get_id() === $current_step->get_id()) {
|
|
$previous_step = $step;
|
|
}
|
|
}
|
|
$previous_step_id = empty($previous_step) ? null : $previous_step->get_id();
|
|
|
|
// bail out if none exist
|
|
if ( empty($next_step_id) && empty($previous_step_id) && $is_step_completed) {
|
|
|
|
return;
|
|
}
|
|
|
|
?>
|
|
|
|
<div style="padding:10px; height:40px">
|
|
|
|
<input id="wiaas_delivery_process_navigation_action" type="hidden" name="wiaas_delivery_process_navigation_action">
|
|
<?php wp_nonce_field( 'wiaas_delivery_process_navigation', 'wiaas_delivery_process_navigation_nonce' ); ?>
|
|
|
|
<input
|
|
data-step="<?php echo empty($next_step_id) ? 'complete' : 'send_to_step|'.$next_step_id ?>"
|
|
type="submit"
|
|
class="button button-primary wiaas_delivery_step_nav"
|
|
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') ?>"
|
|
type="submit"
|
|
<?php disabled(empty($previous_step_id), true, true) ?>
|
|
class="button button-primary wiaas_delivery_step_nav"
|
|
style="float:right;" value="PREV STEP">
|
|
</div>
|