handle order actions
This commit is contained in:
@@ -79,9 +79,16 @@ class Wiaas_Delivery_Process_Step extends Gravity_Flow_Step {
|
||||
|
||||
public function update_step_status($status = false) {
|
||||
|
||||
if ($status === 'cancelled') {
|
||||
if (isset( $_POST['_gravityflow_admin_action'] ) ) {
|
||||
|
||||
$status = 'complete';
|
||||
$admin_action = rgpost( 'gravityflow_admin_action' );
|
||||
|
||||
list( $base_admin_action, $action_id ) = rgexplode( '|', $admin_action, 2 );
|
||||
|
||||
if ($base_admin_action === 'send_to_step' && $this->get_status() === 'pending') {
|
||||
|
||||
$status = 'complete';
|
||||
}
|
||||
}
|
||||
|
||||
parent::update_step_status($status);
|
||||
@@ -262,12 +269,9 @@ class Wiaas_Delivery_Process_Step extends Gravity_Flow_Step {
|
||||
return $action_entries_ids;
|
||||
}
|
||||
|
||||
$new_entry = array_merge($new_entry,array(
|
||||
'form_id' => $this->target_form_id,
|
||||
'wiaas_delivery_process_id' => $this->get_entry_id(),
|
||||
'wiaas_delivery_order_id' => $order_id,
|
||||
'wiaas_delivery_step_name' => $this->get_name(),
|
||||
));
|
||||
$new_entry['form_id'] = $target_form['id'];
|
||||
$new_entry['wiaas_delivery_process_id'] = $this->get_entry_id();
|
||||
$new_entry['wiaas_delivery_order_id'] = $order_id;
|
||||
|
||||
$entry_id = GFAPI::add_entry( $new_entry );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user