From 3419f2bddc952e32aef1d5af0f8e2a88033cfcef Mon Sep 17 00:00:00 2001 From: GotPPay Date: Sun, 26 Aug 2018 20:26:30 +0200 Subject: [PATCH] use Orchestration API to complete GF step --- .../api/class-wiaas-rest-delivery-process-api.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/app/plugins/wiaas/includes/api/class-wiaas-rest-delivery-process-api.php b/backend/app/plugins/wiaas/includes/api/class-wiaas-rest-delivery-process-api.php index 1b6601a..d49c407 100644 --- a/backend/app/plugins/wiaas/includes/api/class-wiaas-rest-delivery-process-api.php +++ b/backend/app/plugins/wiaas/includes/api/class-wiaas-rest-delivery-process-api.php @@ -175,11 +175,11 @@ class Wiass_REST_Delivery_Process_API { $entry[self::DECLINE_REASON_FIELD_ID] = $reason; $entry[self::ACCEPTANCE_STATUS_FIELD_ID] = $status; - //submit step - $entry['workflow_step'] = 2; - $entry['workflow_step_status_1'] = 'complete'; - $entry['workflow_step_status_2'] = 'pending'; - $entry['workflow_timestamp'] = time(); + + $gf_api = new Gravity_Flow_API($entry['form_id']); + $current_step = $gf_api->get_current_step($entry); + $current_step->update_step_status('complete'); + $gf_api->send_to_step($entry, $current_step->get_id() + 1); if (GFAPI::update_entry( $entry )){ if ($installation_declined){