Handle assigment for order delivery flow

This commit is contained in:
Almira Krdzic
2018-11-02 10:30:25 +01:00
parent 4b0fc6c61d
commit cdbefc7ef0
25 changed files with 1131 additions and 1047 deletions

View File

@@ -27,16 +27,7 @@ class Wiaas_Delivery_Process_Step extends Gravity_Flow_Step {
$form_choices[] = array( 'label' => esc_html__( 'Select a Form', 'wiaas' ), 'value' => '' );
foreach ( $forms as $form ) {
$delivery_settings = rgar($form, 'wiaas_delivery_process');
$code = $form['id'];
if (! empty($delivery_settings['delivery_action_code'])) {
$code = $delivery_settings['delivery_action_code'];
}
$form_choices[] = array( 'label' => $form['title'], 'value' => $code );
$form_choices[] = array( 'label' => $form['title'], 'value' => $form['id'] );
}
$settings = array(
@@ -215,26 +206,12 @@ class Wiaas_Delivery_Process_Step extends Gravity_Flow_Step {
/**
* Retrieves forms that are valid options for delivery step action
*
* @return array
*/
public function get_action_forms_choices() {
$forms = GFAPI::get_forms();
$action_forms = array();
foreach ( $forms as $form ) {
$delivery_settings = rgar($form, 'wiaas_delivery_process');
if ( ! empty($delivery_settings) && $delivery_settings['delivery_form_type'] === 'action'){
$action_forms[] = $form;
}
}
return $action_forms;
return Wiaas_Delivery_Process_Action::get_action_forms();
}