diff --git a/backend/app/plugins/wiaas/assets/js/wiaas-form-editor.js b/backend/app/plugins/wiaas/assets/js/wiaas-form-editor.js index fc6ddc0..7589022 100644 --- a/backend/app/plugins/wiaas/assets/js/wiaas-form-editor.js +++ b/backend/app/plugins/wiaas/assets/js/wiaas-form-editor.js @@ -2,9 +2,13 @@ jQuery(document).bind('gform_load_field_settings', function (event, field, form) var isBundleDoc = field.type === 'wiaas_order_bundle_document'; - if (isBundleDoc) { + var isOrderDoc = field.type === 'wiaas_order_document'; + + if (isBundleDoc || isOrderDoc) { jQuery('#wiaas-doc-type-filter').val(field.wiaasDocTypeFilter); } + jQuery('#wiaas-installation-organization-filter').prop('checked', !!field.wiaasOnlyInstallationOrg); + }); \ No newline at end of file diff --git a/backend/app/plugins/wiaas/includes/admin/class-wiaas-admin-delivery-process.php b/backend/app/plugins/wiaas/includes/admin/class-wiaas-admin-delivery-process.php index db0f925..512a03e 100644 --- a/backend/app/plugins/wiaas/includes/admin/class-wiaas-admin-delivery-process.php +++ b/backend/app/plugins/wiaas/includes/admin/class-wiaas-admin-delivery-process.php @@ -7,205 +7,389 @@ class Wiaas_Admin_Delivery_Process { add_action( 'gravityflow_entry_detail', array( __CLASS__, 'display_process_steps_details' ), 10, 3 ); add_action( 'gravityflow_title_entry_detail', array( __CLASS__, 'process_title' ), 10, 3 ); + + + add_action('add_meta_boxes', array(__CLASS__, 'add_delivery_process_metabox'), 100); + + add_action( 'wp_ajax_wiaas_create_order_delivery_process', array(__CLASS__, 'wiaas_ajax_create_order_delivery_process') ); + + add_filter('gravityflow_admin_actions_workflow_detail', array (__CLASS__, 'filter_process_send_to_step_options'), 10, 5); + } + + public static function add_delivery_process_metabox() { + + add_meta_box( + 'order_delivery_process_meta_box', + __('Delivery Process', 'cmb'), + array(__CLASS__, 'order_delivery_process_meta_box'), + 'shop_order', + 'side', + 'high' + ); + } + + + public static function filter_process_send_to_step_options($admin_actions, $current_step, $steps, $form, $entry) { + + $delivery_process_actions = array(); + + if ( $current_step ) { + + $previous_step_id = null; + // get previous step id for current step + foreach ($steps as $index => $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 display_process_steps_details($form, $entry, $current_step) { + public static function wiaas_ajax_create_order_delivery_process() { + check_ajax_referer('wiaas_create_order_delivery_process'); - $delivery_settings = rgar($form, 'wiaas_delivery_process'); + $error = new WP_Error('-1', 'Failed to create order delivery process'); - if ($delivery_settings['delivery_form_type'] === 'action') { - return; - } + if (!isset($_POST['order']) || !isset($_POST['form'])){ + wp_send_json_error($error); + } - // get process order ID - $order_id = absint($entry['wiaas_delivery_order_id']); + $order_id = intval( $_POST['order'] ); + $form_id = intval( $_POST['form'] ); - if (empty($order_id)) { + if ($process_entry_id = Wiaas_Delivery_Process::create_delivery_process_for_order($order_id, $form_id)){ - $order_field = GFCommon::get_fields_by_type($form, array( 'wiaas_order') )[0]; + $workflow = new Gravity_Flow_API($form_id); - if ( ! empty($order_field)) { + $step = $workflow->get_current_step(GFAPI::get_entry($process_entry_id)); - $order_id = $entry[$order_field->id]; - } - } + $entry_url = $step->get_entry_url(); - // display process steps + wp_send_json_success(array( + 'url' => $entry_url + )); + } - $workflow_api = new Gravity_Flow_API($form['id']); - - $steps = $workflow_api->get_steps(); - - foreach ($steps as $index => $step) { - - if (! $step->is_active()) { - continue; - } - - $is_step_completed = $step->get_status() === 'complete' || $step->get_status() === 'approved'; - $is_current_step = $current_step && $step->get_id() === $current_step->get_id(); - - if ($is_current_step) { - $style = 'color: #FD8049;'; - } else if ($is_step_completed) { - $style = 'color: #34C388;'; - } else { - $style = 'opacity: 0.5; color: #CCC;'; - } - - ?> - -
- -

- - get_name(), 'wiaas') ?> -

- - target_form_id ); - - if (empty($action_form)) { - - echo '
'; - - continue; - } - - $action_delivery_settings = rgar($action_form, 'wiaas_delivery_process'); - - ?> - -
- - - - ' . - ' ' . $action_form['title'] . '', - $form_url ); - - echo $form_link; - } - - echo '


'; - - $page_size = 20; - $search_criteria = array( - 'status' => 'active', - 'field_filters' => array( - array( 'key' => 'wiaas_delivery_process_id', - 'value' => $entry['id'] - ), - ), - ); - $sorting = array( 'key' => 'date_created', 'direction' => 'DESC' ); - $paging = array( 'offset' => 0, 'page_size' => $page_size ); - - $entries = GFAPI::get_entries( $action_form, $search_criteria, $sorting, $paging ); - - foreach ($entries as $action_entry) { - self::_display_step_action_entry($action_form, $action_entry); - } - - ?> - -
- -
- - - - - get_current_step($action_entry); + $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()) + ); ?> - - type === 'wiaas_order') { - continue; +
+ - if ($field->type === 'workflow_discussion') { + Assign +
- echo ''; + -
+ '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(); + + ?> + +
+

+ + Order placed +

+
+ +
+

+ + Assign process +

+
+ + $step) { + + if (! $step->is_active()) { + continue; + } + + $is_step_completed = $step->get_status() === 'complete' || $step->get_status() === 'approved'; + $is_current_step = $current_step && $step->get_id() === $current_step->get_id(); + + if ($is_current_step) { + $style = 'color: #FD8049;'; + } else if ($is_step_completed) { + $style = 'color: #34C388;'; + } else { + $style = 'opacity: 0.5; color: #CCC;'; + } + + ?> + +
+ +

+ + get_name(), 'wiaas') ?> +

+ + target_form_id ); + + if (empty($action_form)) { + + echo '
'; + + continue; + } + + $action_delivery_settings = rgar($action_form, 'wiaas_delivery_process'); + + ?> + +
+ +
' . $field->format_discussion_value($action_entry[$field->id]) . '
+ + ' . + ' ' . $action_form['title'] . '', + $form_url ); + + echo $form_link; + } + + echo '


'; + + $page_size = 20; + $search_criteria = array( + 'status' => 'active', + 'field_filters' => array( + array( 'key' => 'wiaas_delivery_process_id', + 'value' => $entry['id'] + ), + ), + ); + $sorting = array( 'key' => 'date_created', 'direction' => 'DESC' ); + $paging = array( 'offset' => 0, 'page_size' => $page_size ); + + $entries = GFAPI::get_entries( $action_form, $search_criteria, $sorting, $paging ); + + foreach ($entries as $action_entry) { + self::_display_step_action_entry($action_form, $action_entry); + } + + ?> + +
+ + + + + + + get_current_step($action_entry); + + + ?> + + + type === 'wiaas_order') { + continue; + } + + if ($field->type === 'workflow_discussion') { + + echo ''; + + continue; + } + + $value = $field->get_value_entry_detail($action_entry[$field->id]); + $label = $field->get_field_label(false, $action_entry[$field->id]); + + echo '' . + '' . + '' . + ''; + } + + ?> + + + + + + + + +
' . $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); + } + ?> + + +
+ +
+ 'pending', ); - $user_roles = gravity_flow()->get_user_roles(); - foreach ( $user_roles as $user_role ) { - $field_filters[] = array( - 'key' => 'workflow_role_' . $user_role, - 'value' => 'pending', - ); - } - $field_filters['mode'] = 'any'; $search_criteria = array(); @@ -93,10 +85,11 @@ class Wiass_REST_Delivery_Process_API { $form_ids = gravity_flow()->get_workflow_form_ids(); - $total_count = 7; - - - $entries = GFAPI::get_entries( $form_ids, $search_criteria, null, null, $total_count ); + $entries = GFAPI::get_entries( + $form_ids, + $search_criteria, + null, + null); $data = array(); foreach ($entries as $entry) { @@ -167,6 +160,7 @@ class Wiass_REST_Delivery_Process_API { if ($installation_declined){ return wiaas_api_notice('INSTALLATION_DECLINED', 'success'); } + return wiaas_api_notice('INSTALLATION_ACCEPTED', 'success'); } diff --git a/backend/app/plugins/wiaas/includes/class-wiaas-countries.php b/backend/app/plugins/wiaas/includes/class-wiaas-countries.php index 2e42185..a88c14f 100644 --- a/backend/app/plugins/wiaas/includes/class-wiaas-countries.php +++ b/backend/app/plugins/wiaas/includes/class-wiaas-countries.php @@ -62,6 +62,19 @@ class Wiaas_Countries { return ''; } + public static function get_country_code_by_currency($currency) { + + foreach (self::$available_countries as $country) { + + if ($country['currency'] === $currency) { + + return $country['code']; + } + } + + return null; + } + /** * Registers product taxonomy for avaiable countries */ diff --git a/backend/app/plugins/wiaas/includes/class-wiaas-db-update.php b/backend/app/plugins/wiaas/includes/class-wiaas-db-update.php index 2430b76..3155f2f 100644 --- a/backend/app/plugins/wiaas/includes/class-wiaas-db-update.php +++ b/backend/app/plugins/wiaas/includes/class-wiaas-db-update.php @@ -22,7 +22,8 @@ class Wiaas_DB_Update { '20191019014650' => 'wiaas_db_update_add_product_properties_ui_fields', '20181019064450' => 'wiaas_db_update_add_bundle_properties_ui_field', '20191020014650' => 'wiaas_create_organization_roles_capabilities', - '20191030162450' => 'wiaas_db_update_update_supplier_order_capabilities' + '20191030162450' => 'wiaas_db_update_update_supplier_order_capabilities', + '20191031162450' => 'update_delivery_forms' ); public static function execute() { diff --git a/backend/app/plugins/wiaas/includes/class-wiaas-delivery-process.php b/backend/app/plugins/wiaas/includes/class-wiaas-delivery-process.php index ddec2e9..5ba59d4 100644 --- a/backend/app/plugins/wiaas/includes/class-wiaas-delivery-process.php +++ b/backend/app/plugins/wiaas/includes/class-wiaas-delivery-process.php @@ -27,24 +27,58 @@ class Wiaas_Delivery_Process { * */ private static function _register_delivery_process() { - require_once( 'delivery-process/class-wiaas-delivery-process-step.php' ); - require_once( 'delivery-process/class-wiaas-delivery-process-addon.php' ); require_once( 'delivery-process/class-wiaas-delivery-process-action.php' ); + require_once( 'delivery-process/class-wiaas-delivery-process-step-assignee.php' ); + require_once( 'delivery-process/class-wiaas-delivery-process-step.php' ); // order fields require_once( 'delivery-process/class-wiaas-order-fields.php' ); require_once( 'delivery-process/class-wiaas-field-order-number.php' ); - require_once( 'delivery-process/class-wiaas-field-order-bundle-select.php' ); - require_once( 'delivery-process/class-wiaas-field-order-supplier-select.php' ); + require_once( 'delivery-process/class-wiaas-field-order-bundle.php' ); + require_once( 'delivery-process/class-wiaas-field-order-installation-select.php' ); require_once( 'delivery-process/class-wiaas-field-order-bundle-document.php' ); + require_once( 'delivery-process/class-wiaas-field-order-document.php' ); Gravity_Flow_Steps::register( new Wiaas_Delivery_Process_Step() ); GFAddOn::register( 'Wiaas_Delivery_Process_Addon' ); } + + public static function create_delivery_process_for_order($order_id, $process_id) { + + $process_form = null; + $process_form = GFAPI::get_form($process_id); + + if( $process_form ) { + + $new_process_entry = array( + 'wiaas_delivery_order_id' => $order_id, + 'form_id' => $process_id, + ); + + $order_fields = GFCommon::get_fields_by_type($process_form, array('wiaas_order')); + + + if (! empty($order_fields)) { + + $order_field = $order_fields[0]; + + $new_process_entry[$order_field['id']] = $order_id; + } + + $process_entry_id = GFAPI::add_entry( $new_process_entry ); + + update_post_meta($order_id, 'wiaas_delivery_process_id', $process_id); + update_post_meta($order_id, 'wiaas_delivery_process_entry_id', $process_entry_id); + + return $process_entry_id; + } + return false; + } + /** * Maybe complete parent order for completed delivery process * @param $entry_id @@ -147,7 +181,7 @@ class Wiaas_Delivery_Process { return $data; } - public static function update_customer_acceptance_status($order_id,$status, $reason) { + public static function update_customer_acceptance_status($order_id, $status, $reason) { $delivery_process_entry = self::get_order_delivery_process_entry($order_id); @@ -228,10 +262,12 @@ class Wiaas_Delivery_Process { public static function get_order_delivery_process_entry($order_id) { $order = wc_get_order($order_id); + $process_entry_id = $order->get_meta('wiaas_delivery_process_entry_id', true); - if (!isset($process_entry_id)) { - return array(); + if (empty($process_entry_id)) { + + return array(); } return GFAPI::get_entry($process_entry_id); @@ -246,7 +282,7 @@ class Wiaas_Delivery_Process { */ public static function get_order_delivery_process($order_id) { - $process_entry_id = get_post_meta($order_id, 'wiaas_delivery_process_entry_id'); + $process_entry_id = get_post_meta($order_id, 'wiaas_delivery_process_entry_id', true); if (empty($process_entry_id)) { return null; @@ -263,7 +299,22 @@ class Wiaas_Delivery_Process { $delivery_process = array( 'id' => $process_form['id'], 'name' => $process_form['title'], - 'steps' => array() + 'steps' => array( + array( + 'short_desc' => 'Order placed', + 'status' => 'complete', + 'order_id' => $order_id, + 'process_id' => $process_entry_id, + 'step_id' => -1, + ), + array( + 'short_desc' => 'Assign process', + 'status' => 'complete', + 'order_id' => $order_id, + 'process_id' => $process_entry_id, + 'step_id' => 0, + ) + ) ); $current_step = $api->get_current_step($process_instance); @@ -302,37 +353,3 @@ class Wiaas_Delivery_Process { } add_action( 'gravityflow_loaded', array('Wiaas_Delivery_Process', 'init') ); - - -add_filter( 'gform_notification', 'rw_notification_attachments', 10, 3 ); -function rw_notification_attachments( $notification, $form, $entry ) { - - $fileupload_fields = GFAPI::get_fields_by_type( $form, array( 'fileupload' ) , true); - - if ( ! is_array( $fileupload_fields ) ) { - return $notification; - } - - $notification['attachments'] = rgar( $notification, 'attachments', array() ); - $upload_root = RGFormsModel::get_upload_root(); - - foreach( $fileupload_fields as $field ) { - - $url = rgar( $entry, $field->id ); - - if ( empty( $url ) ) { - continue; - } elseif ( $field->multipleFiles ) { - $uploaded_files = json_decode( stripslashes( $url ), true ); - foreach ( $uploaded_files as $uploaded_file ) { - $attachment = preg_replace( '|^(.*?)/gravity_forms/|', $upload_root, $uploaded_file ); - $notification['attachments'][] = $attachment; - } - } else { - $attachment = preg_replace( '|^(.*?)/gravity_forms/|', $upload_root, $url ); - $notification['attachments'][] = $attachment; - } - } - - return $notification; -} diff --git a/backend/app/plugins/wiaas/includes/db-updates/data/delivery-forms/delivery-action-forms.json b/backend/app/plugins/wiaas/includes/db-updates/data/delivery-forms/delivery-action-forms.json index 593b25c..dc92517 100644 --- a/backend/app/plugins/wiaas/includes/db-updates/data/delivery-forms/delivery-action-forms.json +++ b/backend/app/plugins/wiaas/includes/db-updates/data/delivery-forms/delivery-action-forms.json @@ -1 +1 @@ -{"0":{"title":"ACTION: Supplier Configuration Approval","description":"Bundle configuration for supplier.","labelPlacement":"top_label","descriptionPlacement":"below","button":{"type":"text","text":"Submit","imageUrl":""},"fields":[{"type":"wiaas_order","allowsPrepopulate":true,"id":3,"label":"Order","adminLabel":"","isRequired":true,"size":"medium","errorMessage":"","visibility":"administrative","inputs":null,"formId":"11","description":"","inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"order_id","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","enableCalculation":false,"numberFormat":"decimal_dot","rangeMin":"","rangeMax":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"wiaas_order_supplier","id":7,"label":"Supplier","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":"11","description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":[],"conditionalLogic":"","failed_validation":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"wiaas_order_bundle","id":8,"label":"Bundle","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":"11","description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":[],"conditionalLogic":"","failed_validation":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"fileupload","id":10,"label":"File","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":"11","description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","maxFileSize":"","maxFiles":"","multipleFiles":false,"allowedExtensions":"","productField":"","displayOnly":"","enablePrice":""},{"type":"wiaas_order_bundle_document","wiaasDocTypeFilter":"config","id":9,"label":"Config Document","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":"11","description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","maxFileSize":"","maxFiles":"","multipleFiles":false,"allowedExtensions":"","productField":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""}],"version":"2.3.2","id":"11","useCurrentUserAsAuthor":true,"postContentTemplateEnabled":false,"postTitleTemplateEnabled":false,"postTitleTemplate":"","postContentTemplate":"","lastPageButton":null,"pagination":null,"firstPageCssClass":null,"gravityflowparentchild":{"parent_form_1":"0","parent_form_3":"0","parent_form_4":"0","parent_form_5":"1","parent_form_6":"0","parent_form_7":"0","parent_form_11":"0","parent_form_12":"0"},"wiaas_delivery":{"wiaas_delivery_form_type":"step","wiaas_order_mappings":{"3":"","4":"","5":"","6":""}},"wiaas_delivery_process":{"delivery_form_type":"action","delivery_action_code":"","automatic_action_entries_enabled":"0","automatic_action_entries_type":"single"},"is_active":"1","date_created":"2018-10-27 22:13:02","is_trash":"0","notifications":[{"id":"5bd4e2eeaef5b","to":"{admin_email}","name":"Admin Notification","event":"form_submission","toType":"email","subject":"New submission from {form_title}","message":"{all_fields}"}],"confirmations":[{"id":"5bd4e2eeaf4c1","name":"Default Confirmation","isDefault":true,"type":"message","message":"Thanks for contacting us! We will get in touch with you shortly.","url":"","pageId":"","queryString":""}],"feeds":{"gravityflow":[{"id":"28","form_id":"11","is_active":"1","feed_order":"0","meta":{"step_name":"Approve Supplier Configuration","description":"Supplier must review and approve configuration","step_type":"approval","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","type":"select","assignees":["role|supplier"],"routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"assignee_policy":"all","instructionsEnable":"1","instructionsValue":"Instructions<\/strong>: please review the values in the fields below and click on the Approve<\/span><\/strong> or Reject<\/span><\/strong> button\r\n\r\n ","display_fields_mode":"all_fields","assignee_notification_enabled":"1","assignee_notification_from_name":"Wiaas","assignee_notification_from_email":"{admin_email}","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"Approve Configuration","assignee_notification_message":"A new entry is pending your approval. Please check your Workflow Inbox.\r\n\r\n \r\n\r\n{workflow_entry_link}\r\n\r\n{all_fields}\r\n\r\n ","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","rejection_notification_enabled":"1","rejection_notification_type":"select","rejection_notification_users":["role|administrator"],"rejection_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"rejection_notification_from_name":"{Supplier:5}","rejection_notification_from_email":"{admin_email}","rejection_notification_reply_to":"","rejection_notification_bcc":"","rejection_notification_subject":"","rejection_notification_message":"Entry {entry_id} has been rejected","rejection_notification_disable_autoformat":"0","approval_notification_enabled":"1","approval_notification_type":"select","approval_notification_users":["role|administrator"],"approval_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"approval_notification_from_name":"{Supplier:5}","approval_notification_from_email":"{admin_email}","approval_notification_reply_to":"","approval_notification_bcc":"","approval_notification_subject":"{Order:3} : Supplier approved configuration for {Bundle:6}","approval_notification_message":"Entry {entry_id} has been approved","approval_notification_disable_autoformat":"0","revertEnable":"0","revertValue":"40","note_mode":"not_required","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","status_expiration":"rejected","destination_expired":"next","destination_rejected":"40","destination_approved":"complete"},"addon_slug":"gravityflow","event_type":null},{"id":"40","form_id":"11","is_active":"1","feed_order":"0","meta":{"step_name":"Update Rejected Supplier Configuration","description":"","step_type":"user_input","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","type":"select","assignees":["role|administrator"],"editable_fields":["9"],"routing":"","assignee_policy":"any","highlight_editable_fields_enabled":"0","highlight_editable_fields_class":"green-triangle","instructionsEnable":"0","instructionsValue":"","display_fields_mode":"all_fields","default_status":"hidden","note_mode":"not_required","assignee_notification_enabled":"1","assignee_notification_from_name":"{Supplier:7}","assignee_notification_from_email":"{admin_email}","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"","assignee_notification_message":"{workflow_entry_url}\r\n\r\n{workflow_entry_url}\r\n\r\n \r\n\r\n ","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","in_progress_notification_enabled":"0","in_progress_notification_type":"select","in_progress_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"in_progress_notification_from_name":"","in_progress_notification_from_email":"{admin_email}","in_progress_notification_reply_to":"","in_progress_notification_bcc":"","in_progress_notification_subject":"","in_progress_notification_message":"Entry {entry_id} has been updated and remains in progress.","in_progress_notification_disable_autoformat":"0","complete_notification_enabled":"0","complete_notification_type":"select","complete_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"complete_notification_from_name":"","complete_notification_from_email":"{admin_email}","complete_notification_reply_to":"","complete_notification_bcc":"","complete_notification_subject":"","complete_notification_message":"Entry {entry_id} has been updated completing the step.","complete_notification_disable_autoformat":"0","confirmation_messageEnable":"0","confirmation_messageValue":"Thank you.","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","status_expiration":"complete","destination_expired":"next","destination_complete":"28"},"addon_slug":"gravityflow","event_type":null}]}},"1":{"title":"ACTION: Validate Customer Questionnaire","description":"Bundle configuration for supplier.","labelPlacement":"top_label","descriptionPlacement":"below","button":{"type":"text","text":"Submit","imageUrl":""},"fields":[{"type":"wiaas_order","id":12,"label":"Order Number","adminLabel":"","isRequired":true,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":"12","description":"","allowsPrepopulate":true,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"order_id","noDuplicates":false,"defaultValue":"0","choices":"","conditionalLogic":"","enableCalculation":false,"numberFormat":"decimal_dot","rangeMin":"","rangeMax":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"wiaas_order_bundle","id":13,"label":"Bundle","adminLabel":"","isRequired":true,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":"12","description":"","allowsPrepopulate":true,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"bundle_id","noDuplicates":false,"defaultValue":"","choices":[],"conditionalLogic":"","failed_validation":"","productField":"","displayOnly":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"enablePrice":""},{"type":"wiaas_order_bundle_document","wiaasDocTypeFilter":"order_questionaire","id":17,"label":"Questionnaire Document","adminLabel":"","isRequired":true,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":"12","description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","maxFileSize":"","maxFiles":"","multipleFiles":false,"allowedExtensions":"","productField":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"workflow_discussion","id":9,"label":"Notes","adminLabel":"","isRequired":false,"size":"small","errorMessage":"","visibility":"visible","inputs":null,"formId":"12","description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","productField":"","form_id":"","useRichTextEditor":false,"multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"displayOnly":"","enablePrice":""}],"version":"2.3.2","id":"12","useCurrentUserAsAuthor":true,"postContentTemplateEnabled":false,"postTitleTemplateEnabled":false,"postTitleTemplate":"","postContentTemplate":"","lastPageButton":null,"pagination":null,"firstPageCssClass":null,"gravityflowparentchild":{"parent_form_1":"0","parent_form_3":"0","parent_form_4":"0","parent_form_5":"1","parent_form_6":"0","parent_form_7":"0","parent_form_11":"0","parent_form_12":"0"},"wiaas_delivery":{"delivery_form_type":"action","automatic_step_entries_enabled":"1","automatic_action_entries_type":"bundle"},"is_active":"1","date_created":"2018-10-28 15:09:59","is_trash":"0","wiaas_delivery_process":{"delivery_form_type":"action","delivery_action_code":"validate-questionnaire","automatic_action_entries_enabled":"1","automatic_action_entries_type":"bundle"},"confirmations":[{"id":"5bd4e2eeaf4c1","name":"Default Confirmation","isDefault":true,"type":"message","message":"Thanks for contacting us! We will get in touch with you shortly.","url":"","pageId":"","queryString":""}],"notifications":[{"id":"5bd4e2eeaef5b","to":"{admin_email}","name":"Admin Notification","event":"form_submission","toType":"email","subject":"New submission from {form_title}","message":"{all_fields}"}],"feeds":{"gravityflow":[{"id":"27","form_id":"12","is_active":"1","feed_order":"0","meta":{"step_name":"Approve configuration info","description":"","step_type":"approval","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":{"conditionalLogic":{"actionType":"show","logicType":"all","rules":[{"fieldId":"12","operator":"isnot","value":"0"}]}},"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","type":"select","assignees":["role|administrator"],"routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"assignee_policy":"all","instructionsEnable":"1","instructionsValue":"Review customer configuration {Questionnaire Document:17} for {Bundle:13}","display_fields_mode":"selected_fields","display_fields_selected":["13","17","9"],"assignee_notification_enabled":"1","assignee_notification_from_name":"","assignee_notification_from_email":"{admin_email}","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"","assignee_notification_message":"A new entry is pending your approval. Please check your Workflow Inbox.\r\n\r\n{all_fields}\r\n\r\n \r\n\r\n{workflow_entry_link}","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","rejection_notification_enabled":"1","rejection_notification_type":"select","rejection_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"rejection_notification_from_name":"Wiaas","rejection_notification_from_email":"{admin_email}","rejection_notification_reply_to":"","rejection_notification_bcc":"","rejection_notification_subject":"{Order:3} : Bundle questionnaire has been rejected {Bundle:6}","rejection_notification_message":"Entry {entry_id} has been rejected","rejection_notification_disable_autoformat":"0","approval_notification_enabled":"1","approval_notification_type":"select","approval_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"approval_notification_from_name":"Wiaas","approval_notification_from_email":"{admin_email}","approval_notification_reply_to":"","approval_notification_bcc":"","approval_notification_subject":"{Order:3} : Bundle questionnaire has been approved","approval_notification_message":" \r\n\r\n{all_fields}\r\n\r\nEntry {entry_id} has been approved","approval_notification_disable_autoformat":"0","revertEnable":"0","revertValue":"29","note_mode":"hidden","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","status_expiration":"rejected","destination_expired":"next","destination_rejected":"44","destination_approved":"complete"},"addon_slug":"gravityflow","event_type":null},{"id":"44","form_id":"12","is_active":"1","feed_order":"0","meta":{"step_name":"Add reject reason","description":"","step_type":"user_input","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","type":"select","assignees":["role|administrator"],"editable_fields":["9"],"routing":"","assignee_policy":"all","highlight_editable_fields_enabled":"0","highlight_editable_fields_class":"green-triangle","instructionsEnable":"0","instructionsValue":"","display_fields_mode":"all_fields","default_status":"hidden","note_mode":"not_required","assignee_notification_enabled":"1","assignee_notification_from_name":"","assignee_notification_from_email":"{admin_email}","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"","assignee_notification_message":"A new entry requires your input.","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","in_progress_notification_enabled":"0","in_progress_notification_type":"select","in_progress_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"in_progress_notification_from_name":"","in_progress_notification_from_email":"{admin_email}","in_progress_notification_reply_to":"","in_progress_notification_bcc":"","in_progress_notification_subject":"","in_progress_notification_message":"Entry {entry_id} has been updated and remains in progress.","in_progress_notification_disable_autoformat":"0","complete_notification_enabled":"0","complete_notification_type":"select","complete_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"complete_notification_from_name":"","complete_notification_from_email":"{admin_email}","complete_notification_reply_to":"","complete_notification_bcc":"","complete_notification_subject":"","complete_notification_message":"Entry {entry_id} has been updated completing the step.","complete_notification_disable_autoformat":"0","confirmation_messageEnable":"0","confirmation_messageValue":"Thank you.","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","status_expiration":"complete","destination_expired":"next","destination_complete":"next"},"addon_slug":"gravityflow","event_type":null},{"id":"29","form_id":"12","is_active":"1","feed_order":"0","meta":{"step_name":"Update bundle configuration","description":"Since administrator rejected questionnaire provided by customer, he needs to update it and upload it again.","step_type":"user_input","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","type":"select","assignees":["role|customer"],"editable_fields":["17","9"],"routing":"","assignee_policy":"any","highlight_editable_fields_enabled":"0","highlight_editable_fields_class":"green-triangle","instructionsEnable":"1","instructionsValue":"Please download and update questionnaire.","display_fields_mode":"selected_fields","display_fields_selected":["12","13","17","9"],"default_status":"submit_buttons","note_mode":"hidden","assignee_notification_enabled":"1","assignee_notification_from_name":"Wiaas","assignee_notification_from_email":"{admin_email}","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"{Order:3}: Questionnaire rejected for {Bundle:6}","assignee_notification_message":"A new entry requires your input.\r\n\r\n{workflow_entry_link}\r\n\r\n{all_fields}","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","in_progress_notification_enabled":"0","in_progress_notification_type":"select","in_progress_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"in_progress_notification_from_name":"","in_progress_notification_from_email":"{admin_email}","in_progress_notification_reply_to":"","in_progress_notification_bcc":"","in_progress_notification_subject":"","in_progress_notification_message":"Entry {entry_id} has been updated and remains in progress.","in_progress_notification_disable_autoformat":"0","complete_notification_enabled":"1","complete_notification_type":"select","complete_notification_users":["role|administrator"],"complete_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"complete_notification_from_name":"{user:display_name}","complete_notification_from_email":"{admin_email}","complete_notification_reply_to":"","complete_notification_bcc":"","complete_notification_subject":"{Order:3}: Questionnaire updated for {Bundle:6}","complete_notification_message":"Entry {entry_id} has been updated completing the step.","complete_notification_disable_autoformat":"0","confirmation_messageEnable":"1","confirmation_messageValue":"Thank you.","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","status_expiration":"complete","destination_expired":"next","destination_complete":"27"},"addon_slug":"gravityflow","event_type":null}]}},"2":{"title":"ACTION: Complete Installation And Upload Test Protocol","description":"","labelPlacement":"top_label","descriptionPlacement":"below","button":{"type":"text","text":"Submit","imageUrl":""},"fields":[{"type":"wiaas_order","id":1,"label":"Order ID","adminLabel":"","isRequired":true,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":14,"description":"","allowsPrepopulate":true,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"order_id","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","enableCalculation":false,"numberFormat":"decimal_dot","rangeMin":"","rangeMax":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"wiaas_order_supplier","id":4,"label":"Installation Company","adminLabel":"","isRequired":true,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":14,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":[],"conditionalLogic":"","failed_validation":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"fileupload","id":6,"label":"Installation protocol","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":14,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","maxFileSize":"","maxFiles":"","multipleFiles":false,"allowedExtensions":"","productField":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""}],"version":"2.3.2","id":14,"useCurrentUserAsAuthor":true,"postContentTemplateEnabled":false,"postTitleTemplateEnabled":false,"postTitleTemplate":"","postContentTemplate":"","lastPageButton":null,"pagination":null,"firstPageCssClass":null,"wiaas_delivery":{"wiaas_delivery_form_type":"step"},"wiaas_delivery_process":{"delivery_form_type":"action","delivery_action_code":"","automatic_action_entries_enabled":"1","automatic_action_entries_type":"single"},"notifications":[{"id":"5bd66ca932e4a","to":"{admin_email}","name":"Admin Notification","event":"form_submission","toType":"email","subject":"New submission from {form_title}","message":"{all_fields}"}],"confirmations":[{"id":"5bd66ca93384b","name":"Default Confirmation","isDefault":true,"type":"message","message":"Thanks for contacting us! We will get in touch with you shortly.","url":"","pageId":"","queryString":""}],"feeds":{"gravityflow":[{"id":"34","form_id":"14","is_active":"1","feed_order":"0","meta":{"step_name":"Installation completed confirmation","description":"","step_type":"approval","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","type":"select","assignees":["role|supplier"],"routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"assignee_policy":"all","instructionsEnable":"0","instructionsValue":"Instructions: please review the values in the fields below and click on the Approve or Reject button","display_fields_mode":"all_fields","assignee_notification_enabled":"1","assignee_notification_from_name":"Wiaas","assignee_notification_from_email":"{admin_email}","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"","assignee_notification_message":"Confirm if installation is completed.\r\n\r\n{workflow_entry_link}","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","rejection_notification_enabled":"0","rejection_notification_type":"select","rejection_notification_routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"rejection_notification_from_name":"","rejection_notification_from_email":"{admin_email}","rejection_notification_reply_to":"","rejection_notification_bcc":"","rejection_notification_subject":"","rejection_notification_message":"Entry {entry_id} has been rejected","rejection_notification_disable_autoformat":"0","approval_notification_enabled":"0","approval_notification_type":"select","approval_notification_routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"approval_notification_from_name":"","approval_notification_from_email":"{admin_email}","approval_notification_reply_to":"","approval_notification_bcc":"","approval_notification_subject":"","approval_notification_message":"Entry {entry_id} has been approved","approval_notification_disable_autoformat":"0","revertEnable":"0","revertValue":"35","note_mode":"not_required","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","status_expiration":"rejected","destination_expired":"next","destination_rejected":"complete","destination_approved":"35"},"addon_slug":"gravityflow","event_type":null},{"id":"35","form_id":"14","is_active":"1","feed_order":"0","meta":{"step_name":"Upload installation protocol","description":"","step_type":"user_input","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","type":"select","assignees":["role|supplier"],"editable_fields":["6"],"routing":"","assignee_policy":"all","highlight_editable_fields_enabled":"1","highlight_editable_fields_class":"green-triangle","instructionsEnable":"0","instructionsValue":"","display_fields_mode":"all_fields","default_status":"hidden","note_mode":"not_required","assignee_notification_enabled":"1","assignee_notification_from_name":"Wiaas","assignee_notification_from_email":"{admin_email}","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"Upload installation test protocol for {Order ID:1}","assignee_notification_message":"A new entry requires your input.","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"1","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","in_progress_notification_enabled":"0","in_progress_notification_type":"select","in_progress_notification_routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"in_progress_notification_from_name":"","in_progress_notification_from_email":"{admin_email}","in_progress_notification_reply_to":"","in_progress_notification_bcc":"","in_progress_notification_subject":"","in_progress_notification_message":"Entry {entry_id} has been updated and remains in progress.","in_progress_notification_disable_autoformat":"0","complete_notification_enabled":"0","complete_notification_type":"select","complete_notification_routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"complete_notification_from_name":"","complete_notification_from_email":"{admin_email}","complete_notification_reply_to":"","complete_notification_bcc":"","complete_notification_subject":"","complete_notification_message":"Entry {entry_id} has been updated completing the step.","complete_notification_disable_autoformat":"0","confirmation_messageEnable":"0","confirmation_messageValue":"Thank you.","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","status_expiration":"complete","destination_expired":"next","destination_complete":"complete"},"addon_slug":"gravityflow","event_type":null}]}},"3":{"title":"ACTION: Customer Acceptance","description":"","labelPlacement":"top_label","descriptionPlacement":"below","button":{"type":"text","text":"Submit","imageUrl":""},"fields":[{"type":"wiaas_order","id":1,"label":"Order Number","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":16,"description":"","allowsPrepopulate":true,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"order_id","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","enableCalculation":false,"numberFormat":"decimal_dot","rangeMin":"","rangeMax":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"fileupload","id":2,"label":"Acceptance Document","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":16,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","maxFileSize":"","maxFiles":"","multipleFiles":true,"allowedExtensions":"","productField":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"date","id":6,"label":"Expiration Date","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"dateType":"datepicker","calendarIconType":"none","formId":16,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","calendarIconUrl":"","dateFormat":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":""},{"type":"radio","id":4,"label":"Acceptance","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"choices":[{"text":"Not Accepted","value":"pending","isSelected":false,"price":""},{"text":"Accepted","value":"accept","isSelected":false,"price":""},{"text":"Declined","value":"decline","isSelected":false,"price":""}],"formId":16,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","conditionalLogic":"","productField":"","enableOtherChoice":"","enablePrice":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"enableChoiceValue":true,"displayOnly":""},{"type":"textarea","id":3,"label":"Decline Reason","adminLabel":"","isRequired":false,"size":"small","errorMessage":"","visibility":"visible","inputs":null,"formId":16,"description":"","allowsPrepopulate":true,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"order_decline_reason","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":{"actionType":"show","logicType":"all","rules":[{"fieldId":"4","operator":"is","value":"decline"}]},"productField":"","form_id":"","useRichTextEditor":false,"multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"displayOnly":"","enablePrice":""}],"version":"2.3.2","id":16,"useCurrentUserAsAuthor":true,"postContentTemplateEnabled":false,"postTitleTemplateEnabled":false,"postTitleTemplate":"","postContentTemplate":"","lastPageButton":null,"pagination":null,"firstPageCssClass":null,"wiaas_delivery_process":{"delivery_form_type":"action","delivery_action_code":"customer-acceptance","automatic_action_entries_enabled":"1","automatic_action_entries_type":"single"},"confirmations":[{"id":"5bd8668e50997","name":"Default Confirmation","isDefault":true,"type":"message","message":"Thanks for contacting us! We will get in touch with you shortly.","url":"","pageId":"","queryString":""}],"notifications":[{"id":"5bd8668e50471","to":"{admin_email}","name":"Admin Notification","event":"form_submission","toType":"email","subject":"New submission from {form_title}","message":"{all_fields}"}],"feeds":{"gravityflow":[{"id":"41","form_id":"16","is_active":"1","feed_order":"0","meta":{"step_name":"Upload Acceptance Document","description":"","step_type":"user_input","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","schedule_date_field":"6","type":"select","assignees":["role|customer"],"editable_fields":["2"],"routing":"","assignee_policy":"all","conditional_logic_editable_fields_enabled":"1","highlight_editable_fields_enabled":"0","highlight_editable_fields_class":"green-triangle","instructionsEnable":"0","instructionsValue":"","display_fields_mode":"all_fields","default_status":"hidden","note_mode":"not_required","assignee_notification_enabled":"1","assignee_notification_from_name":"","assignee_notification_from_email":"{admin_email}","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"","assignee_notification_message":"A new entry requires your input.","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","in_progress_notification_enabled":"0","in_progress_notification_type":"select","in_progress_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"in_progress_notification_from_name":"","in_progress_notification_from_email":"{admin_email}","in_progress_notification_reply_to":"","in_progress_notification_bcc":"","in_progress_notification_subject":"","in_progress_notification_message":"Entry {entry_id} has been updated and remains in progress.","in_progress_notification_disable_autoformat":"0","complete_notification_enabled":"0","complete_notification_type":"select","complete_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"complete_notification_from_name":"","complete_notification_from_email":"{admin_email}","complete_notification_reply_to":"","complete_notification_bcc":"","complete_notification_subject":"","complete_notification_message":"Entry {entry_id} has been updated completing the step.","complete_notification_disable_autoformat":"0","confirmation_messageEnable":"0","confirmation_messageValue":"Thank you.","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","expiration_date_field":"6","status_expiration":"complete","destination_expired":"next","destination_complete":"next"},"addon_slug":"gravityflow","event_type":null},{"id":"43","form_id":"16","is_active":"1","feed_order":"0","meta":{"step_name":"Accept installation","description":"","step_type":"approval","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","schedule_date_field":"6","type":"select","assignees":["role|customer"],"routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"assignee_policy":"all","instructionsEnable":"0","instructionsValue":"Instructions: please review the values in the fields below and click on the Approve or Reject button","display_fields_mode":"all_fields","assignee_notification_enabled":"0","assignee_notification_from_name":"","assignee_notification_from_email":"{admin_email}","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"","assignee_notification_message":"A new entry is pending your approval. Please check your Workflow Inbox.","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","rejection_notification_enabled":"0","rejection_notification_type":"select","rejection_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"rejection_notification_from_name":"","rejection_notification_from_email":"{admin_email}","rejection_notification_reply_to":"","rejection_notification_bcc":"","rejection_notification_subject":"","rejection_notification_message":"Entry {entry_id} has been rejected","rejection_notification_disable_autoformat":"0","approval_notification_enabled":"0","approval_notification_type":"select","approval_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"approval_notification_from_name":"","approval_notification_from_email":"{admin_email}","approval_notification_reply_to":"","approval_notification_bcc":"","approval_notification_subject":"","approval_notification_message":"Entry {entry_id} has been approved","approval_notification_disable_autoformat":"0","revertEnable":"0","revertValue":"41","note_mode":"not_required","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","expiration_date_field":"6","status_expiration":"rejected","destination_expired":"next","destination_rejected":"41","destination_approved":"complete"},"addon_slug":"gravityflow","event_type":null}]}},"version":"2.3.2"} \ No newline at end of file +{"0":{"title":"ACTION: Validate Customer Questionnaire","description":"Bundle configuration for supplier.","labelPlacement":"top_label","descriptionPlacement":"below","button":{"type":"text","text":"Submit","imageUrl":""},"fields":[{"type":"wiaas_order","id":12,"label":"Order Number","adminLabel":"","isRequired":true,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":"12","description":"","allowsPrepopulate":true,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"order_id","noDuplicates":false,"defaultValue":"0","choices":"","conditionalLogic":"","enableCalculation":false,"numberFormat":"decimal_dot","rangeMin":"","rangeMax":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"workflow_user","id":18,"label":"Customer User:","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"choices":[{"value":4,"text":"AA aa"},{"value":2,"text":"Commercial User"},{"value":3,"text":"Customer User"},{"value":6,"text":"Supplier 2 Jonson"},{"value":5,"text":"Supplier1 Jonson"},{"value":1,"text":"wpUser"}],"formId":"12","description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","conditionalLogic":"","failed_validation":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"gravityflowUsersRoleFilter":""},{"type":"wiaas_order_bundle","id":13,"label":"Bundle","adminLabel":"","isRequired":true,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":"12","description":"","allowsPrepopulate":true,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"bundle_id","noDuplicates":false,"defaultValue":"","choices":[],"conditionalLogic":"","productField":"","displayOnly":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"enablePrice":""},{"type":"wiaas_order_bundle_document","wiaasDocTypeFilter":"order_questionaire","id":17,"label":"Questionnaire Document","adminLabel":"","isRequired":true,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":"12","description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","maxFileSize":"","maxFiles":"","multipleFiles":false,"allowedExtensions":"","productField":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"workflow_discussion","id":9,"label":"Notes","adminLabel":"","isRequired":false,"size":"small","errorMessage":"","visibility":"visible","inputs":null,"formId":"12","description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","productField":"","form_id":"","useRichTextEditor":false,"multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"displayOnly":"","enablePrice":""}],"version":"2.3.2","id":"12","useCurrentUserAsAuthor":true,"postContentTemplateEnabled":false,"postTitleTemplateEnabled":false,"postTitleTemplate":"","postContentTemplate":"","lastPageButton":null,"pagination":null,"firstPageCssClass":null,"gravityflowparentchild":{"parent_form_1":"0","parent_form_3":"0","parent_form_4":"0","parent_form_5":"1","parent_form_6":"0","parent_form_7":"0","parent_form_11":"0","parent_form_12":"0"},"wiaas_delivery":{"delivery_form_type":"action","automatic_step_entries_enabled":"1","automatic_action_entries_type":"bundle"},"is_active":"1","date_created":"2018-10-28 15:09:59","is_trash":"0","wiaas_delivery_process":{"delivery_form_type":"action","delivery_action_code":"validate-questionnaire","automatic_action_entries_enabled":"1","automatic_action_entries_type":"bundle"},"confirmations":[{"id":"5bd4e2eeaf4c1","name":"Default Confirmation","isDefault":true,"type":"message","message":"Thanks for contacting us! We will get in touch with you shortly.","url":"","pageId":"","queryString":""}],"notifications":[{"id":"5bd4e2eeaef5b","to":"{admin_email}","name":"Admin Notification","event":"form_submission","toType":"email","subject":"New submission from {form_title}","message":"{all_fields}"}],"feeds":{"gravityflow":[{"id":"27","form_id":"12","is_active":"1","feed_order":"0","meta":{"step_name":"Approve configuration info","description":"","step_type":"approval","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":{"conditionalLogic":{"actionType":"show","logicType":"all","rules":[{"fieldId":"12","operator":"isnot","value":"0"}]}},"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","type":"select","assignees":["role|administrator"],"routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"assignee_policy":"all","instructionsEnable":"1","instructionsValue":"Review customer configuration for {Bundle:13}<\/strong>","display_fields_mode":"selected_fields","display_fields_selected":["13","17","9"],"assignee_notification_enabled":"1","assignee_notification_from_name":"WIAAS Marketplace","assignee_notification_from_email":"info@co-ideation.com","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"{Order Number:12} : Validate Customer Configuration","assignee_notification_message":"\u00a0{Order Number:12}<\/strong>\r\n\r\nGo to {workflow_entry_link} to validate customer configuration for\u00a0 {Bundle:13} .\r\n\r\n ","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","rejection_notification_enabled":"1","rejection_notification_type":"select","rejection_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"rejection_notification_from_name":"Wiaas","rejection_notification_from_email":"{admin_email}","rejection_notification_reply_to":"","rejection_notification_bcc":"","rejection_notification_subject":"{Order:3} : Bundle questionnaire has been rejected {Bundle:6}","rejection_notification_message":"Entry {entry_id} has been rejected","rejection_notification_disable_autoformat":"0","approval_notification_enabled":"1","approval_notification_type":"select","approval_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"approval_notification_from_name":"Wiaas","approval_notification_from_email":"{admin_email}","approval_notification_reply_to":"","approval_notification_bcc":"","approval_notification_subject":"{Order:3} : Bundle questionnaire has been approved","approval_notification_message":" \r\n\r\n{all_fields}\r\n\r\nEntry {entry_id} has been approved","approval_notification_disable_autoformat":"0","revertEnable":"0","revertValue":"44","note_mode":"hidden","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","status_expiration":"rejected","destination_expired":"next","destination_rejected":"44","destination_approved":"complete"},"addon_slug":"gravityflow","event_type":null},{"id":"44","form_id":"12","is_active":"1","feed_order":"0","meta":{"step_name":"Add reject reason","description":"","step_type":"user_input","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","type":"select","assignees":["role|administrator"],"editable_fields":["9"],"routing":"","assignee_policy":"all","highlight_editable_fields_enabled":"1","highlight_editable_fields_class":"green-background","instructionsEnable":"1","instructionsValue":"Enter reason why customer configuration has been declined.","display_fields_mode":"all_fields","default_status":"hidden","note_mode":"hidden","assignee_notification_enabled":"0","assignee_notification_from_name":"","assignee_notification_from_email":"{admin_email}","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"","assignee_notification_message":"A new entry requires your input.","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","in_progress_notification_enabled":"0","in_progress_notification_type":"select","in_progress_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"in_progress_notification_from_name":"","in_progress_notification_from_email":"{admin_email}","in_progress_notification_reply_to":"","in_progress_notification_bcc":"","in_progress_notification_subject":"","in_progress_notification_message":"Entry {entry_id} has been updated and remains in progress.","in_progress_notification_disable_autoformat":"0","complete_notification_enabled":"0","complete_notification_type":"select","complete_notification_routing":[{"assignee":"user_id|2","fieldId":"0","operator":"is","value":"","type":""}],"complete_notification_from_name":"","complete_notification_from_email":"{admin_email}","complete_notification_reply_to":"","complete_notification_bcc":"","complete_notification_subject":"","complete_notification_message":"Entry {entry_id} has been updated completing the step.","complete_notification_disable_autoformat":"0","confirmation_messageEnable":"0","confirmation_messageValue":"Thank you.","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","status_expiration":"complete","destination_expired":"next","destination_complete":"next"},"addon_slug":"gravityflow","event_type":null},{"id":"93","form_id":"12","is_active":"1","feed_order":"0","meta":{"step_name":"Update configuration info","description":"","step_type":"user_input","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","type":"select","assignees":["assignee_user_field|18"],"editable_fields":["17"],"routing":"","assignee_policy":"all","highlight_editable_fields_enabled":"0","highlight_editable_fields_class":"green-triangle","instructionsEnable":"0","instructionsValue":"","display_fields_mode":"all_fields","default_status":"hidden","note_mode":"not_required","assignee_notification_enabled":"1","assignee_notification_from_name":"WIAAS Marketplace","assignee_notification_from_email":"support@co-ideation.com","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"{Order Number:12} : Update configuration info","assignee_notification_message":"{Order Number:12}<\/strong>\r\n\r\nConfiguration info has bee rejected for\u00a0{Bundle:13}.\r\n\r\nPlease login to your interface, review and make necessary changes.","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","in_progress_notification_enabled":"0","in_progress_notification_type":"select","in_progress_notification_routing":[{"assignee":"wiaas_order_role|customer","fieldId":"0","operator":"is","value":"","type":""}],"in_progress_notification_from_name":"","in_progress_notification_from_email":"{admin_email}","in_progress_notification_reply_to":"","in_progress_notification_bcc":"","in_progress_notification_subject":"","in_progress_notification_message":"Entry {entry_id} has been updated and remains in progress.","in_progress_notification_disable_autoformat":"0","complete_notification_enabled":"0","complete_notification_type":"select","complete_notification_routing":[{"assignee":"wiaas_order_role|customer","fieldId":"0","operator":"is","value":"","type":""}],"complete_notification_from_name":"","complete_notification_from_email":"{admin_email}","complete_notification_reply_to":"","complete_notification_bcc":"","complete_notification_subject":"","complete_notification_message":"Entry {entry_id} has been updated completing the step.","complete_notification_disable_autoformat":"0","confirmation_messageEnable":"0","confirmation_messageValue":"Thank you.","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","status_expiration":"complete","destination_expired":"next","destination_complete":"27"},"addon_slug":"gravityflow","event_type":null}]}},"1":{"title":"ACTION: Complete Installation And Upload Test Protocol","description":"","labelPlacement":"top_label","descriptionPlacement":"below","button":{"type":"text","text":"Submit","imageUrl":""},"fields":[{"type":"wiaas_order","id":1,"label":"Order ID","adminLabel":"","isRequired":true,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":14,"description":"","allowsPrepopulate":true,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"order_id","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","enableCalculation":false,"numberFormat":"decimal_dot","rangeMin":"","rangeMax":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"wiaas_order_bundle","id":8,"label":"Bundle:","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":14,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":[{"value":"0","text":"Select bundle ..."}],"conditionalLogic":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":"","enableChoiceValue":true},{"type":"wiaas_order_bundle_document","wiaasDocTypeFilter":"install_guide","id":13,"label":"Installation Guide Documents:","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":14,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"fileupload","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","maxFileSize":"","maxFiles":"","multipleFiles":true,"allowedExtensions":"","productField":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"wiaas_order_installation_select","id":11,"label":"Installation Company:","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":14,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":[{"value":"0","text":"Select installation ..."}],"conditionalLogic":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":"","enableChoiceValue":true},{"type":"wiaas_order_bundle_document","wiaasDocTypeFilter":"installation_protocol","id":14,"label":"Installation Protocol Document:","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":14,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","maxFileSize":"","maxFiles":"","multipleFiles":false,"allowedExtensions":"","productField":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false}],"version":"2.3.2","id":14,"useCurrentUserAsAuthor":true,"postContentTemplateEnabled":false,"postTitleTemplateEnabled":false,"postTitleTemplate":"","postContentTemplate":"","lastPageButton":null,"pagination":null,"firstPageCssClass":null,"wiaas_delivery":{"wiaas_delivery_form_type":"step"},"wiaas_delivery_process":{"delivery_form_type":"action","delivery_action_code":"","automatic_action_entries_enabled":"1","automatic_action_entries_type":"bundle"},"confirmations":[{"id":"5bd66ca93384b","name":"Default Confirmation","isDefault":true,"type":"message","message":"Thanks for contacting us! We will get in touch with you shortly.","url":"","pageId":"","queryString":""}],"notifications":[{"id":"5bd66ca932e4a","to":"{admin_email}","name":"Admin Notification","event":"form_submission","toType":"email","subject":"New submission from {form_title}","message":"{all_fields}"}],"feeds":{"gravityflow":[{"id":"80","form_id":"14","is_active":"1","feed_order":"0","meta":{"step_name":"Select Installation","description":"","step_type":"user_input","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"1","feed_condition_conditional_logic_object":{"conditionalLogic":{"actionType":"show","logicType":"all","rules":[{"fieldId":"11","operator":"is","value":"0"}]}},"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","type":"select","assignees":["role|administrator"],"editable_fields":["11"],"routing":"","assignee_policy":"all","highlight_editable_fields_enabled":"1","highlight_editable_fields_class":"green-background","instructionsEnable":"0","instructionsValue":"","display_fields_mode":"selected_fields","display_fields_selected":["1","8","13"],"default_status":"hidden","note_mode":"not_required","assignee_notification_enabled":"1","assignee_notification_from_name":"WIAAS Marketplace","assignee_notification_from_email":"support@co-ideation.com","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"{Order ID:1} : Select installation company for {Bundle::8}","assignee_notification_message":"Select installation company for\u00a0{Bundle::8} in order\u00a0{Order ID:1}","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","in_progress_notification_enabled":"0","in_progress_notification_type":"select","in_progress_notification_routing":[{"assignee":"wiaas_order_role|customer","fieldId":"0","operator":"is","value":"","type":""}],"in_progress_notification_from_name":"","in_progress_notification_from_email":"{admin_email}","in_progress_notification_reply_to":"","in_progress_notification_bcc":"","in_progress_notification_subject":"","in_progress_notification_message":"Entry {entry_id} has been updated and remains in progress.","in_progress_notification_disable_autoformat":"0","complete_notification_enabled":"0","complete_notification_type":"select","complete_notification_routing":[{"assignee":"wiaas_order_role|customer","fieldId":"0","operator":"is","value":"","type":""}],"complete_notification_from_name":"","complete_notification_from_email":"{admin_email}","complete_notification_reply_to":"","complete_notification_bcc":"","complete_notification_subject":"","complete_notification_message":"Entry {entry_id} has been updated completing the step.","complete_notification_disable_autoformat":"0","confirmation_messageEnable":"0","confirmation_messageValue":"Thank you.","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","status_expiration":"complete","destination_expired":"next","destination_complete":"next"},"addon_slug":"gravityflow","event_type":null},{"id":"34","form_id":"14","is_active":"1","feed_order":"0","meta":{"step_name":"Installation completed confirmation","description":"","step_type":"approval","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","type":"select","assignees":["assignee_field|11"],"routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"assignee_policy":"all","instructionsEnable":"0","instructionsValue":"Instructions: please review the values in the fields below and click on the Approve or Reject button","display_fields_mode":"all_fields","assignee_notification_enabled":"1","assignee_notification_from_name":"WIAAS Market","assignee_notification_from_email":"support@co-ideation.com","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"{Order ID:1} : Confirm installation","assignee_notification_message":"Please go to {workflow_entry_link} to\u00a0confirm that installation is completed for order\u00a0{Order ID:1}","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","rejection_notification_enabled":"0","rejection_notification_type":"select","rejection_notification_routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"rejection_notification_from_name":"","rejection_notification_from_email":"{admin_email}","rejection_notification_reply_to":"","rejection_notification_bcc":"","rejection_notification_subject":"","rejection_notification_message":"Entry {entry_id} has been rejected","rejection_notification_disable_autoformat":"0","approval_notification_enabled":"0","approval_notification_type":"select","approval_notification_routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"approval_notification_from_name":"","approval_notification_from_email":"{admin_email}","approval_notification_reply_to":"","approval_notification_bcc":"","approval_notification_subject":"","approval_notification_message":"Entry {entry_id} has been approved","approval_notification_disable_autoformat":"0","revertEnable":"0","revertValue":"35","note_mode":"not_required","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","status_expiration":"rejected","destination_expired":"next","destination_rejected":"complete","destination_approved":"35"},"addon_slug":"gravityflow","event_type":null},{"id":"35","form_id":"14","is_active":"1","feed_order":"0","meta":{"step_name":"Upload installation protocol for order","description":"","step_type":"user_input","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","type":"select","assignees":["assignee_field|11"],"editable_fields":["14"],"routing":"","assignee_policy":"all","highlight_editable_fields_enabled":"1","highlight_editable_fields_class":"green-background","instructionsEnable":"0","instructionsValue":"","display_fields_mode":"all_fields","default_status":"hidden","note_mode":"not_required","assignee_notification_enabled":"1","assignee_notification_from_name":"WIAAS Market","assignee_notification_from_email":" confirm that installation is completed for order\u00a0{Order ID:1}","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"Upload installation test protocol for {Order ID:1}","assignee_notification_message":"{Order ID:1}<\/strong>\r\n\r\nGo to {workflow_entry_link} to upload installation test protocol for order\u00a0{Order ID:1}\r\n\r\n ","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","in_progress_notification_enabled":"0","in_progress_notification_type":"select","in_progress_notification_routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"in_progress_notification_from_name":"","in_progress_notification_from_email":"{admin_email}","in_progress_notification_reply_to":"","in_progress_notification_bcc":"","in_progress_notification_subject":"","in_progress_notification_message":"Entry {entry_id} has been updated and remains in progress.","in_progress_notification_disable_autoformat":"0","complete_notification_enabled":"0","complete_notification_type":"select","complete_notification_routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"complete_notification_from_name":"","complete_notification_from_email":"{admin_email}","complete_notification_reply_to":"","complete_notification_bcc":"","complete_notification_subject":"","complete_notification_message":"Entry {entry_id} has been updated completing the step.","complete_notification_disable_autoformat":"0","confirmation_messageEnable":"0","confirmation_messageValue":"Thank you.","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","status_expiration":"complete","destination_expired":"next","destination_complete":"complete"},"addon_slug":"gravityflow","event_type":null}]}},"2":{"title":"ACTION: Customer Acceptance","description":"","labelPlacement":"top_label","descriptionPlacement":"below","button":{"type":"text","text":"Submit","imageUrl":""},"fields":[{"type":"wiaas_order","id":1,"label":"Order Number","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":16,"description":"","allowsPrepopulate":true,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"order_id","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","enableCalculation":false,"numberFormat":"decimal_dot","rangeMin":"","rangeMax":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"workflow_user","id":10,"label":"Customer User:","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"choices":[{"value":2,"text":"Commercial User"},{"value":3,"text":"Customer User"}],"formId":16,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","conditionalLogic":"","failed_validation":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":"","gravityflowUsersRoleFilter":"customer"},{"type":"wiaas_order_document","wiaasDocTypeFilter":"customer_acceptance","id":9,"label":"Acceptance Document:","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":16,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"fileupload","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","maxFileSize":"","maxFiles":"","multipleFiles":true,"allowedExtensions":"","productField":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"date","id":6,"label":"Expiration Date","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"dateType":"datepicker","calendarIconType":"none","formId":16,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","calendarIconUrl":"","dateFormat":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":""},{"type":"radio","id":4,"label":"Acceptance","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"choices":[{"text":"Not Accepted","value":"pending","isSelected":false,"price":""},{"text":"Accepted","value":"accept","isSelected":false,"price":""},{"text":"Declined","value":"decline","isSelected":false,"price":""}],"formId":16,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","conditionalLogic":"","productField":"","enableOtherChoice":"","enablePrice":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"enableChoiceValue":true,"displayOnly":""},{"type":"textarea","id":3,"label":"Decline Reason","adminLabel":"","isRequired":false,"size":"small","errorMessage":"","visibility":"visible","inputs":null,"formId":16,"description":"","allowsPrepopulate":true,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"order_decline_reason","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":{"actionType":"show","logicType":"all","rules":[{"fieldId":"4","operator":"is","value":"decline"}]},"productField":"","form_id":"","useRichTextEditor":false,"multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"displayOnly":"","enablePrice":""}],"version":"2.3.2","id":16,"useCurrentUserAsAuthor":true,"postContentTemplateEnabled":false,"postTitleTemplateEnabled":false,"postTitleTemplate":"","postContentTemplate":"","lastPageButton":null,"pagination":null,"firstPageCssClass":null,"wiaas_delivery_process":{"delivery_form_type":"action","delivery_action_code":"customer-acceptance","automatic_action_entries_enabled":"1","automatic_action_entries_type":"single"},"confirmations":[{"id":"5bd8668e50997","name":"Default Confirmation","isDefault":true,"type":"message","message":"Thanks for contacting us! We will get in touch with you shortly.","url":"","pageId":"","queryString":""}],"notifications":[{"id":"5bd8668e50471","to":"{admin_email}","name":"Admin Notification","event":"form_submission","toType":"email","subject":"New submission from {form_title}","message":"{all_fields}"}],"feeds":{"gravityflow":[{"id":"94","form_id":"16","is_active":"1","feed_order":"0","meta":{"step_name":"Upload Acceptance Document","description":"","step_type":"user_input","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","schedule_date_field":"6","type":"select","assignees":["assignee_user_field|10"],"editable_fields":["9","4","3"],"routing":"","assignee_policy":"any","conditional_logic_editable_fields_enabled":"1","highlight_editable_fields_enabled":"0","highlight_editable_fields_class":"green-triangle","instructionsEnable":"0","instructionsValue":"","display_fields_mode":"all_fields","default_status":"hidden","note_mode":"not_required","assignee_notification_enabled":"1","assignee_notification_from_name":"WIAAS Market","assignee_notification_from_email":"support@co-ideation.com","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"{Order Number:1}: Upload acceptance document","assignee_notification_message":"{Order Number:1}<\/strong>\r\n\r\nPlease go to your account and upload acceptance document.","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","in_progress_notification_enabled":"0","in_progress_notification_type":"select","in_progress_notification_routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"in_progress_notification_from_name":"","in_progress_notification_from_email":"{admin_email}","in_progress_notification_reply_to":"","in_progress_notification_bcc":"","in_progress_notification_subject":"","in_progress_notification_message":"Entry {entry_id} has been updated and remains in progress.","in_progress_notification_disable_autoformat":"0","complete_notification_enabled":"0","complete_notification_type":"select","complete_notification_routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"complete_notification_from_name":"","complete_notification_from_email":"{admin_email}","complete_notification_reply_to":"","complete_notification_bcc":"","complete_notification_subject":"","complete_notification_message":"Entry {entry_id} has been updated completing the step.","complete_notification_disable_autoformat":"0","confirmation_messageEnable":"0","confirmation_messageValue":"Thank you.","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","expiration_date_field":"6","status_expiration":"complete","destination_expired":"next","destination_complete":"next"},"addon_slug":"gravityflow","event_type":null},{"id":"95","form_id":"16","is_active":"1","feed_order":"0","meta":{"step_name":"Accept installation","description":"","step_type":"approval","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","schedule_date_field":"6","type":"select","assignees":["assignee_user_field|10"],"routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"assignee_policy":"all","instructionsEnable":"0","instructionsValue":"Instructions: please review the values in the fields below and click on the Approve or Reject button","display_fields_mode":"all_fields","assignee_notification_enabled":"1","assignee_notification_from_name":"WIAAS Market","assignee_notification_from_email":"support@co-ideation.com","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"{Order Number:1}: Accept installation","assignee_notification_message":"Login to your account and accept installation.","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","rejection_notification_enabled":"0","rejection_notification_type":"select","rejection_notification_routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"rejection_notification_from_name":"","rejection_notification_from_email":"{admin_email}","rejection_notification_reply_to":"","rejection_notification_bcc":"","rejection_notification_subject":"","rejection_notification_message":"Entry {entry_id} has been rejected","rejection_notification_disable_autoformat":"0","approval_notification_enabled":"0","approval_notification_type":"select","approval_notification_routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"approval_notification_from_name":"","approval_notification_from_email":"{admin_email}","approval_notification_reply_to":"","approval_notification_bcc":"","approval_notification_subject":"","approval_notification_message":"Entry {entry_id} has been approved","approval_notification_disable_autoformat":"0","revertEnable":"0","revertValue":"41","note_mode":"not_required","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","expiration_date_field":"6","status_expiration":"rejected","destination_expired":"next","destination_rejected":"complete","destination_approved":"next"},"addon_slug":"gravityflow","event_type":null}]}},"version":"2.3.2"} \ No newline at end of file diff --git a/backend/app/plugins/wiaas/includes/db-updates/data/delivery-forms/delivery-process-normal-delivery-form.json b/backend/app/plugins/wiaas/includes/db-updates/data/delivery-forms/delivery-process-normal-delivery-form.json deleted file mode 100644 index d1685a1..0000000 --- a/backend/app/plugins/wiaas/includes/db-updates/data/delivery-forms/delivery-process-normal-delivery-form.json +++ /dev/null @@ -1,425 +0,0 @@ -{ - "0": { - "title": "DELIVERY PROCESS: Normal Delivery", - "description": "Normal delivery process", - "labelPlacement": "top_label", - "descriptionPlacement": "below", - "button": { - "type": "text", - "text": "Submit", - "imageUrl": "" - }, - "fields": [ - { - "type": "wiaas_order", - "id": 3, - "label": "Order", - "adminLabel": "", - "isRequired": false, - "size": "medium", - "errorMessage": "", - "visibility": "visible", - "inputs": null, - "formId": 5, - "description": "", - "allowsPrepopulate": false, - "inputMask": false, - "inputMaskValue": "", - "inputType": "", - "labelPlacement": "", - "descriptionPlacement": "", - "subLabelPlacement": "", - "placeholder": "", - "cssClass": "", - "inputName": "", - "noDuplicates": false, - "defaultValue": "", - "choices": "", - "conditionalLogic": "", - "enableCalculation": false, - "numberFormat": "decimal_dot", - "rangeMin": "", - "rangeMax": "", - "productField": "", - "multipleFiles": false, - "maxFiles": "", - "calculationFormula": "", - "calculationRounding": "", - "disableQuantity": false, - "displayAllCategories": false, - "useRichTextEditor": false, - "displayOnly": "", - "enablePrice": "" - } - ], - "version": "2.3.2", - "id": 5, - "useCurrentUserAsAuthor": true, - "postContentTemplateEnabled": false, - "postTitleTemplateEnabled": false, - "postTitleTemplate": "", - "postContentTemplate": "", - "lastPageButton": null, - "pagination": null, - "firstPageCssClass": null, - "is_active": "1", - "date_created": "2018-10-24 18:12:10", - "is_trash": "0", - "notifications": [ - { - "id": "5b5f7ae4baced", - "to": "{admin_email}", - "name": "Admin Notification", - "event": "form_submission", - "toType": "email", - "subject": "New submission from {form_title}", - "message": "{all_fields}", - "isActive": false - } - ], - "confirmations": [ - { - "id": "5b5f7ae4bb79e", - "name": "Default Confirmation", - "isDefault": true, - "type": "message", - "message": "Thanks for contacting us! We will get in touch with you shortly.", - "url": "", - "pageId": "", - "queryString": "" - } - ], - "wiaas_delivery_process": { - "delivery_form_type": "process", - "delivery_action_code": "", - "automatic_action_entries_enabled": "0", - "automatic_action_entries_type": "single" - }, - "feeds": { - "gravityflow": [ - { - "id": "7", - "form_id": "5", - "is_active": "1", - "feed_order": "0", - "meta": { - "step_name": "Validate customer configuration information", - "description": "Review configuration documents uploaded by customer during order creation process.\r\nApprove or reject each document.", - "step_type": "wiaas_delivery_step", - "step_highlight": "0", - "step_highlight_type": "color", - "step_highlight_color": "#dd3333", - "feed_condition_conditional_logic": "0", - "feed_condition_conditional_logic_object": [], - "scheduled": "0", - "schedule_type": "delay", - "schedule_date": "", - "schedule_delay_offset": "", - "schedule_delay_unit": "hours", - "schedule_date_field_offset": "0", - "schedule_date_field_offset_unit": "hours", - "schedule_date_field_before_after": "after", - "instructionsEnable": "1", - "instructionsValue": "Review configuration documents uploaded by customer during order creation process.\u00a0 Approve or reject each document.", - "is_visible_to_customer": "1", - "target_form_id": "12", - "destination_complete": "next" - }, - "addon_slug": "gravityflow", - "event_type": null - }, - { - "id": "26", - "form_id": "5", - "is_active": "1", - "feed_order": "0", - "meta": { - "step_name": "Procure components", - "description": "", - "step_type": "wiaas_delivery_step", - "step_highlight": "0", - "step_highlight_type": "color", - "step_highlight_color": "#c7e8d6", - "feed_condition_conditional_logic": "0", - "feed_condition_conditional_logic_object": [], - "scheduled": "0", - "schedule_type": "delay", - "schedule_date": "", - "schedule_delay_offset": "", - "schedule_delay_unit": "hours", - "schedule_date_field_offset": "0", - "schedule_date_field_offset_unit": "hours", - "schedule_date_field_before_after": "after", - "instructionsEnable": "0", - "instructionsValue": "", - "is_visible_to_customer": "0", - "target_form_id": "11", - "destination_complete": "next" - }, - "addon_slug": "gravityflow", - "event_type": null - }, - { - "id": "8", - "form_id": "5", - "is_active": "1", - "feed_order": "0", - "meta": { - "step_name": "Wait for installation to be scheduled and confirmed", - "description": "Wait for installation to be scheduled and confirmed", - "step_type": "wiaas_delivery_step", - "step_highlight": "0", - "step_highlight_type": "color", - "step_highlight_color": "#dd3333", - "feed_condition_conditional_logic": "0", - "feed_condition_conditional_logic_object": [], - "scheduled": "0", - "schedule_type": "delay", - "schedule_date": "", - "schedule_delay_offset": "", - "schedule_delay_unit": "hours", - "schedule_date_field_offset": "0", - "schedule_date_field_offset_unit": "hours", - "schedule_date_field_before_after": "after", - "instructionsEnable": "0", - "instructionsValue": "", - "is_visible_to_customer": "1", - "target_form_id": "", - "destination_complete": "next" - }, - "addon_slug": "gravityflow", - "event_type": null - }, - { - "id": "9", - "form_id": "5", - "is_active": "1", - "feed_order": "0", - "meta": { - "step_name": "Installation", - "description": " Installation", - "step_type": "wiaas_delivery_step", - "step_highlight": "0", - "step_highlight_type": "color", - "step_highlight_color": "#dd3333", - "feed_condition_conditional_logic": "0", - "feed_condition_conditional_logic_object": [], - "scheduled": "0", - "schedule_type": "delay", - "schedule_date": "", - "schedule_delay_offset": "", - "schedule_delay_unit": "hours", - "schedule_date_field_offset": "0", - "schedule_date_field_offset_unit": "hours", - "schedule_date_field_before_after": "after", - "instructionsEnable": "0", - "instructionsValue": "", - "is_visible_to_customer": "1", - "target_form_id": "14", - "destination_complete": "next" - }, - "addon_slug": "gravityflow", - "event_type": null - }, - { - "id": "10", - "form_id": "5", - "is_active": "1", - "feed_order": "0", - "meta": { - "step_name": "Customer acceptance", - "description": "Customer acceptance", - "step_type": "wiaas_delivery_step", - "step_highlight": "0", - "step_highlight_type": "color", - "step_highlight_color": "#dd3333", - "feed_condition_conditional_logic": "0", - "feed_condition_conditional_logic_object": [], - "scheduled": "0", - "schedule_type": "delay", - "schedule_date": "", - "schedule_delay_offset": "", - "schedule_delay_unit": "hours", - "schedule_date_field_offset": "0", - "schedule_date_field_offset_unit": "hours", - "schedule_date_field_before_after": "after", - "instructionsEnable": "0", - "instructionsValue": "", - "is_visible_to_customer": "1", - "target_form_id": "16", - "destination_complete": "next" - }, - "addon_slug": "gravityflow", - "event_type": null - }, - { - "id": "11", - "form_id": "5", - "is_active": "1", - "feed_order": "0", - "meta": { - "step_name": "Customer training", - "description": "Customer training", - "step_type": "wiaas_delivery_step", - "step_highlight": "0", - "step_highlight_type": "color", - "step_highlight_color": "#dd3333", - "feed_condition_conditional_logic": "0", - "feed_condition_conditional_logic_object": [], - "scheduled": "0", - "schedule_type": "delay", - "schedule_date": "", - "schedule_delay_offset": "", - "schedule_delay_unit": "hours", - "schedule_date_field_offset": "0", - "schedule_date_field_offset_unit": "hours", - "schedule_date_field_before_after": "after", - "instructionsEnable": "0", - "instructionsValue": "", - "is_visible_to_customer": "1", - "target_form_id": "", - "destination_complete": "next" - }, - "addon_slug": "gravityflow", - "event_type": null - }, - { - "id": "12", - "form_id": "5", - "is_active": "1", - "feed_order": "0", - "meta": { - "step_name": "Set start\/stop dates for contracts", - "description": "Set start\/stop dates for contracts", - "step_type": "wiaas_delivery_step", - "step_highlight": "0", - "step_highlight_type": "color", - "step_highlight_color": "#dd3333", - "feed_condition_conditional_logic": "0", - "feed_condition_conditional_logic_object": [], - "scheduled": "0", - "schedule_type": "delay", - "schedule_date": "", - "schedule_delay_offset": "", - "schedule_delay_unit": "hours", - "schedule_date_field_offset": "0", - "schedule_date_field_offset_unit": "hours", - "schedule_date_field_before_after": "after", - "instructionsEnable": "0", - "instructionsValue": "", - "is_visible_to_customer": "1", - "target_form_id": "", - "destination_complete": "next" - }, - "addon_slug": "gravityflow", - "event_type": null - }, - { - "id": "36", - "form_id": "5", - "is_active": "1", - "feed_order": "0", - "meta": { - "step_name": "Complete delivery", - "description": "", - "step_type": "approval", - "step_highlight": "0", - "step_highlight_type": "color", - "step_highlight_color": "#dd3333", - "feed_condition_conditional_logic": "0", - "feed_condition_conditional_logic_object": [], - "scheduled": "0", - "schedule_type": "delay", - "schedule_date": "", - "schedule_delay_offset": "", - "schedule_delay_unit": "hours", - "schedule_date_field_offset": "0", - "schedule_date_field_offset_unit": "hours", - "schedule_date_field_before_after": "after", - "type": "select", - "assignees": [ - "role|administrator" - ], - "routing": [ - { - "assignee": "role|administrator", - "fieldId": "0", - "operator": "is", - "value": "", - "type": "" - } - ], - "assignee_policy": "all", - "instructionsEnable": "0", - "instructionsValue": "Instructions: please review the values in the fields below and click on the Approve or Reject button", - "display_fields_mode": "all_fields", - "assignee_notification_enabled": "0", - "assignee_notification_from_name": "", - "assignee_notification_from_email": "{admin_email}", - "assignee_notification_reply_to": "", - "assignee_notification_bcc": "", - "assignee_notification_subject": "", - "assignee_notification_message": "A new entry is pending your approval. Please check your Workflow Inbox.", - "assignee_notification_disable_autoformat": "0", - "resend_assignee_emailEnable": "0", - "resend_assignee_emailValue": "7", - "resend_assignee_email_repeatEnable": "0", - "resend_assignee_email_repeatValue": "3", - "rejection_notification_enabled": "0", - "rejection_notification_type": "select", - "rejection_notification_routing": [ - { - "assignee": "role|administrator", - "fieldId": "0", - "operator": "is", - "value": "", - "type": "" - } - ], - "rejection_notification_from_name": "", - "rejection_notification_from_email": "{admin_email}", - "rejection_notification_reply_to": "", - "rejection_notification_bcc": "", - "rejection_notification_subject": "", - "rejection_notification_message": "Entry {entry_id} has been rejected", - "rejection_notification_disable_autoformat": "0", - "approval_notification_enabled": "0", - "approval_notification_type": "select", - "approval_notification_routing": [ - { - "assignee": "role|administrator", - "fieldId": "0", - "operator": "is", - "value": "", - "type": "" - } - ], - "approval_notification_from_name": "", - "approval_notification_from_email": "{admin_email}", - "approval_notification_reply_to": "", - "approval_notification_bcc": "", - "approval_notification_subject": "", - "approval_notification_message": "Entry {entry_id} has been approved", - "approval_notification_disable_autoformat": "0", - "note_mode": "not_required", - "expiration": "0", - "expiration_type": "delay", - "expiration_date": "", - "expiration_delay_offset": "", - "expiration_delay_unit": "hours", - "expiration_date_field_offset": "0", - "expiration_date_field_offset_unit": "hours", - "expiration_date_field_before_after": "after", - "status_expiration": "rejected", - "destination_expired": "next", - "destination_rejected": "complete", - "destination_approved": "next" - }, - "addon_slug": "gravityflow", - "event_type": null - } - ] - } - }, - "version": "2.3.2" -} \ No newline at end of file diff --git a/backend/app/plugins/wiaas/includes/db-updates/data/delivery-forms/delivery-process-sample-form.json b/backend/app/plugins/wiaas/includes/db-updates/data/delivery-forms/delivery-process-sample-form.json new file mode 100644 index 0000000..f550ca4 --- /dev/null +++ b/backend/app/plugins/wiaas/includes/db-updates/data/delivery-forms/delivery-process-sample-form.json @@ -0,0 +1 @@ +{"0":{"title":"DELIVERY PROCESS EXAMPLE: Copy and set to active to create new delivery process","description":"","labelPlacement":"top_label","descriptionPlacement":"below","button":{"type":"text","text":"Submit","imageUrl":""},"fields":[{"type":"wiaas_order","id":1,"label":"Order number","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":24,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","enableCalculation":false,"numberFormat":"decimal_dot","rangeMin":"","rangeMax":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""}],"version":"2.3.2","id":24,"useCurrentUserAsAuthor":true,"postContentTemplateEnabled":false,"postTitleTemplateEnabled":false,"postTitleTemplate":"","postContentTemplate":"","lastPageButton":null,"pagination":null,"firstPageCssClass":null,"wiaas_delivery_process":{"delivery_form_type":"process","delivery_country":"se"},"notifications":[{"id":"5bdb1c7c26952","to":"{admin_email}","name":"Admin Notification","event":"form_submission","toType":"email","subject":"New submission from {form_title}","message":"{all_fields}"}],"confirmations":[{"id":"5bdb1c7c26da9","name":"Default Confirmation","isDefault":true,"type":"message","message":"Thanks for contacting us! We will get in touch with you shortly.","url":"","pageId":"","queryString":""}],"feeds":{"gravityflow":[{"id":"83","form_id":"24","is_active":"1","feed_order":"0","meta":{"step_name":"Delivery Step Placeholder (Change this to start creating workflow)","description":"","step_type":"wiaas_delivery_step","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","instructionsEnable":"0","instructionsValue":"","is_visible_to_customer":"1","target_form_id":"","destination_complete":"next"},"addon_slug":"gravityflow","event_type":null},{"id":"84","form_id":"24","is_active":"1","feed_order":"0","meta":{"step_name":"Complete","description":"","step_type":"approval","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","type":"select","assignees":["role|administrator"],"routing":[{"assignee":"user_id|1","fieldId":"0","operator":"is","value":"","type":""}],"assignee_policy":"all","instructionsEnable":"0","instructionsValue":"Instructions: please review the values in the fields below and click on the Approve or Reject button","display_fields_mode":"all_fields","assignee_notification_enabled":"0","assignee_notification_from_name":"","assignee_notification_from_email":"{admin_email}","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"","assignee_notification_message":"A new entry is pending your approval. Please check your Workflow Inbox.","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","rejection_notification_enabled":"0","rejection_notification_type":"select","rejection_notification_routing":[{"assignee":"user_id|1","fieldId":"0","operator":"is","value":"","type":""}],"rejection_notification_from_name":"","rejection_notification_from_email":"{admin_email}","rejection_notification_reply_to":"","rejection_notification_bcc":"","rejection_notification_subject":"","rejection_notification_message":"Entry {entry_id} has been rejected","rejection_notification_disable_autoformat":"0","approval_notification_enabled":"0","approval_notification_type":"select","approval_notification_routing":[{"assignee":"user_id|1","fieldId":"0","operator":"is","value":"","type":""}],"approval_notification_from_name":"","approval_notification_from_email":"{admin_email}","approval_notification_reply_to":"","approval_notification_bcc":"","approval_notification_subject":"","approval_notification_message":"Entry {entry_id} has been approved","approval_notification_disable_autoformat":"0","note_mode":"not_required","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","status_expiration":"rejected","destination_expired":"next","destination_rejected":"complete","destination_approved":"next"},"addon_slug":"gravityflow","event_type":null}]}},"version":"2.3.2"} \ No newline at end of file diff --git a/backend/app/plugins/wiaas/includes/db-updates/wiaas-db-update-general.php b/backend/app/plugins/wiaas/includes/db-updates/wiaas-db-update-general.php index 97cc1f1..2ba2d56 100644 --- a/backend/app/plugins/wiaas/includes/db-updates/wiaas-db-update-general.php +++ b/backend/app/plugins/wiaas/includes/db-updates/wiaas-db-update-general.php @@ -79,7 +79,7 @@ function wiaas_create_organization_roles_capabilities() { } -function import_delivery_action_forms() { +function update_delivery_forms() { $forms = GFAPI::get_forms(); @@ -89,5 +89,5 @@ function import_delivery_action_forms() { GFExport::import_file(dirname( __FILE__ ) . "/data/delivery-forms/delivery-action-forms.json"); - //GFExport::import_file(dirname( __FILE__ ) . "/data/delivery-forms/delivery-process-normal-delivery-form.json"); + GFExport::import_file(dirname( __FILE__ ) . "/data/delivery-forms/delivery-process-sample-form.json"); } \ No newline at end of file diff --git a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-action.php b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-action.php index e1d1683..0e39e60 100644 --- a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-action.php +++ b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-action.php @@ -1,7 +1,17 @@ target_form_id)) { @@ -16,11 +33,18 @@ class Wiaas_Delivery_Process_Action { return null; } - $action_form = GFAPI::get_form($step->target_form_id); - - return $action_form; + return GFAPI::get_form($step->target_form_id); } + /** + * Get action code for delivery process step form + * + * Action code is used for implementing specific logic for step form + * + * @param Wiaas_Delivery_Process_Step $step + * + * @return string + */ public static function get_process_step_action_form_action_code($step) { $action_form = self::get_process_step_action_form($step); @@ -35,16 +59,35 @@ class Wiaas_Delivery_Process_Action { return empty($delivery_settings) ? 'manual' : $delivery_settings['delivery_action_code']; } + /** + * Check if delivery process step has customer acceptance action form + * + * @param Wiaas_Delivery_Process_Step $step + * + * @return bool + */ public static function process_step_has_customer_acceptance_action($step) { return self::get_process_step_action_form_action_code($step) === 'customer-acceptance'; } + /** + * Check if delivery process step has customer validate action form + * + * @param Wiaas_Delivery_Process_Step $step + * + * @return bool + */ public static function process_step_has_customer_validate_questionnaires_action($step) { return self::get_process_step_action_form_action_code($step) === 'validate-questionnaire'; } + /** + * @param Wiaas_Delivery_Process_Step $step + * + * @return array|WP_Error + */ public static function get_process_step_action_entries(Wiaas_Delivery_Process_Step $step) { $action_form = self::get_process_step_action_form($step); @@ -67,6 +110,11 @@ class Wiaas_Delivery_Process_Action { return GFAPI::get_entries( $action_form, $search_criteria, $sorting ); } + /** + * Retrieve forms that will be used as possible action forms + * + * @return array + */ public static function get_action_forms() { $forms = GFAPI::get_forms(); @@ -86,9 +134,14 @@ class Wiaas_Delivery_Process_Action { return $action_forms; } - public static function complete_action_step($action_id) { + /** + * Complete current workflow step for action form + * + * @param int $action_entry_id + */ + public static function complete_action_step($action_entry_id) { - $action_entry = GFAPI::get_entry($action_id); + $action_entry = GFAPI::get_entry($action_entry_id); $action_form = GFAPI::get_form($action_entry['form_id']); @@ -111,6 +164,11 @@ class Wiaas_Delivery_Process_Action { gravity_flow()->process_workflow($action_form, $action_entry['id']); } + /** + * Upload customer questionnaire document + * + * @param int $action_entry_id + */ public static function upload_customer_questionnaire($action_entry_id) { $action_entry = GFAPI::get_entry($action_entry_id); @@ -125,56 +183,34 @@ class Wiaas_Delivery_Process_Action { GFAPI::update_entry($action_entry); } - public static function get_customer_acceptance_action_data($action_id) { - - $action_entry = GFAPI::get_entry($action_id); + /** + * Check if customer uploaded acceptance document + * + * @param int $action_entry_id + * + * @return bool + */ + public static function is_customer_acceptance_uploaded($action_entry_id) { + $action_entry = GFAPI::get_entry($action_entry_id); $action_form = GFAPI::get_form($action_entry['form_id']); - $acceptance_documents_field = GFCommon::get_fields_by_type($action_form, 'fileupload')[0]; - $acceptance_field = GFCommon::get_fields_by_type($action_form, 'radio')[0]; - $decline_reason_field = GFCommon::get_fields_by_type($action_form, 'textarea')[0]; - $expiration_date_field = GFCommon::get_fields_by_type($action_form, 'date')[0]; - - $file_paths = json_decode($action_entry[$acceptance_documents_field->id]); - - $documents = array(); - - foreach ($file_paths as $file_path) { - - $info = pathinfo( $file_path ); - - $documents[] = array( - 'name' => $info['basename'], - 'url' => $acceptance_documents_field->get_download_url( $file_path, true ) - ); - } - - - return array( - 'action_id' => $action_entry['id'], - 'documents' => $documents, - 'expiration' => $action_entry[$expiration_date_field->id], - 'decline_reason' => $action_entry[$decline_reason_field->id], - 'status' => ($action_entry[$acceptance_field->id] === 'accept') ? 1 : -1 - ); - } - - public static function is_customer_acceptance_uploaded($action_id) { - - $action_entry = GFAPI::get_entry($action_id); - $action_form = GFAPI::get_form($action_entry['form_id']); - - - $acceptance_documents_field = GFCommon::get_fields_by_type($action_form, 'fileupload')[0]; + $acceptance_documents_field = GFCommon::get_fields_by_type($action_form, 'wiaas_order_document')[0]; return ! empty( $action_entry[$acceptance_documents_field->id]); } - public static function update_customer_acceptance_status($action_id, $new_status, $reason) { + /** + * Update acceptance status for order + * + * @param int $action_entry_id + * @param $new_status + * @param $reason + */ + public static function update_customer_acceptance_status($action_entry_id, $new_status, $reason) { - $action_entry = GFAPI::get_entry($action_id); + $action_entry = GFAPI::get_entry($action_entry_id); $action_form = GFAPI::get_form($action_entry['form_id']); $acceptance_field = GFCommon::get_fields_by_type($action_form, 'radio')[0]; @@ -184,14 +220,28 @@ class Wiaas_Delivery_Process_Action { $action_entry[$decline_reason_field->id] = $reason; GFAPI::update_entry($action_entry); + + $workflow = new Gravity_Flow_API($action_form['id']); + $current_step = $workflow->get_current_step($action_entry); + + if ($current_step && $current_step->get_t) + + Wiaas_Delivery_Process_Action::complete_action_step($action_entry['id']); } - public static function upload_customer_acceptance_document($action_id) { + /** + * Upload customer acceptance document for order + * + * @param int $action_entry_id + * + * @return bool + */ + public static function upload_customer_acceptance_document($action_entry_id) { - $action_entry = GFAPI::get_entry($action_id); + $action_entry = GFAPI::get_entry($action_entry_id); $action_form = GFAPI::get_form($action_entry['form_id']); - $acceptance_documents_field = GFCommon::get_fields_by_type($action_form, 'fileupload')[0]; + $acceptance_documents_field = GFCommon::get_fields_by_type($action_form, 'wiaas_order_document')[0]; $old_value = $action_entry[$acceptance_documents_field->id]; @@ -220,9 +270,69 @@ class Wiaas_Delivery_Process_Action { return ! is_wp_error($result); } - public static function get_customer_validate_questionnaires_action_data($action_id) { + /** + * Collect customer acceptance action data + * + * @param int $action_entry_id + * + * @return array + */ + public static function get_customer_acceptance_action_data($action_entry_id) { - $action_entry = GFAPI::get_entry($action_id); + $action_entry = GFAPI::get_entry($action_entry_id); + + $action_form = GFAPI::get_form($action_entry['form_id']); + + + $acceptance_documents_field = GFCommon::get_fields_by_type($action_form, 'wiaas_order_document')[0]; + $acceptance_field = GFCommon::get_fields_by_type($action_form, 'radio')[0]; + $decline_reason_field = GFCommon::get_fields_by_type($action_form, 'textarea')[0]; + $expiration_date_field = GFCommon::get_fields_by_type($action_form, 'date')[0]; + + $file_paths = json_decode($action_entry[$acceptance_documents_field->id]); + + error_log($action_entry[$acceptance_documents_field->id]); + + $documents = array(); + + foreach ($file_paths as $file_path) { + + $info = pathinfo( $file_path ); + + $documents[] = array( + 'name' => $info['basename'], + 'url' => $acceptance_documents_field->get_download_url( $file_path, true ) + ); + } + + $status = 0; + if ($action_entry[$acceptance_field->id] === 'accept') { + $status = 1; + } + + if ($action_entry[$acceptance_field->id] === 'decline') { + $status = -1; + } + + return array( + 'action_id' => $action_entry['id'], + 'documents' => $documents, + 'expiration' => $action_entry[$expiration_date_field->id], + 'decline_reason' => $action_entry[$decline_reason_field->id], + 'status' => $status + ); + } + + /** + * Get customer validate questionnaires action data + * + * @param int $action_entry_id + * + * @return array|null + */ + public static function get_customer_validate_questionnaires_action_data($action_entry_id) { + + $action_entry = GFAPI::get_entry($action_entry_id); $action_form = GFAPI::get_form($action_entry['form_id']); @@ -240,9 +350,8 @@ class Wiaas_Delivery_Process_Action { return null; } - $bundle_item = $order->get_item($bundle_item_id); - $document_field = GFCommon::get_fields_by_type(GFAPI::get_form($action_entry['form_id']), 'wiaas_order_bundle_document')[0]; + $document_field = GFCommon::get_fields_by_type($action_form, 'wiaas_order_bundle_document')[0]; $file_path = $action_entry[$document_field->id]; $info = pathinfo( $action_entry[$document_field->id] ); @@ -260,25 +369,29 @@ class Wiaas_Delivery_Process_Action { if (is_array($discussion_items)) { foreach ($discussion_items as $item) { - $formated_comments[] = $discussion_field->format_discussion_item( $item, 'text', $action_id ); + $formated_comments[] = $discussion_field->format_discussion_item( $item, 'text', $action_entry_id ); } } $action_workflow_api = new Gravity_Flow_API($action_form['id']); $action_step = $action_workflow_api->get_current_step($action_entry); + + + // if completed it means that document got validated $status = 'validated'; if (! empty($action_step)) { - if ($action_step->get_type() === 'approval') { - - $status = 'not-validated'; - } - - if ($action_step->get_type() === 'user_input') { + $is_assignee = $action_step->is_assignee($action_step->get_current_assignee_key()); + if ($is_assignee) { + // if customer is assignee it means it is his turn to upload changed version of document + // which means it was rejected $status = 'invalid'; + } else { + // if customer is not assignee it means administrator is still reviewing document + $status = 'not-validated'; } } diff --git a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-addon.php b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-addon.php index c412498..34f8e6d 100644 --- a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-addon.php +++ b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-addon.php @@ -32,18 +32,17 @@ class Wiaas_Delivery_Process_Addon extends Gravity_Flow_Extension { add_filter('gravityflow_assignee_choices', array ($this, 'add_orders_assignee_choices')); - add_filter('gravityflow_admin_actions_workflow_detail', array ($this, 'filter_process_send_to_step_options'), 10, 5); - add_filter('gravityflow_step_assignees', array ($this, 'maybe_assign_organization_to_step'), 10, 2); } - public function init_ajax() { - parent::init_ajax(); - - // this AJAX action is here and not in /admin folder because of Gravity Forms extension logic - add_action( 'wp_ajax_wiaas_delivery_get_form', array( $this, 'ajax_get_form' ) ); - } - + /** + * Handle organization assignee for step (Map users from organization as assignees to step) + * + * @param $assignees + * @param Gravity_Flow_Step $step + * + * @return array + */ public function maybe_assign_organization_to_step($assignees, Gravity_Flow_Step $step) { $mapped_assignees = array(); @@ -78,46 +77,6 @@ class Wiaas_Delivery_Process_Addon extends Gravity_Flow_Extension { return $mapped_assignees; } - public function filter_process_send_to_step_options($admin_actions, $current_step, $steps, $form, $entry) { - - $delivery_process_actions = array(); - - if ( $current_step ) { - - $previous_step_id = null; - // get previous step id for current step - foreach ($steps as $index => $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 function allow_only_administrator_to_be_assigned_to_step($args) { @@ -133,34 +92,6 @@ class Wiaas_Delivery_Process_Addon extends Gravity_Flow_Extension { return $choices; } - public function ajax_get_form() { - - $form_id = isset( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : 0; - - $field_id = sanitize_text_field( rgget( 'field_id' ) ); - - $entry_id = absint( rgget( 'entry_id' ) ); - - $field_values = array( $field_id => $entry_id ); - - gravity_form_enqueue_scripts( $form_id, true ); - - $is_admin = isset( $_GET['is_admin'] ); - if ( $is_admin ) { - wp_enqueue_style( 'common', site_url() . '/wp-admin/css/common.css', array(), $this->_version ); - } else { - wp_enqueue_style( 'common', get_stylesheet_directory_uri() . '/style.css', array(), $this->_version ); - } - - wp_print_styles(); - wp_print_scripts(); - // Render an AJAX-enabled form. - // https://www.gravityhelp.com/documentation/article/embedding-a-form/#function-call - $html = gravity_form( $form_id, true, false, false, $field_values, true, 1, false ); - printf( "
%s
", $html ); - die(); - } - /** * Extends Gravity Form entry metadata with 'wiaas_delivery_process_id' * diff --git a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-step-assignee.php b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-step-assignee.php new file mode 100644 index 0000000..2debd3b --- /dev/null +++ b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-step-assignee.php @@ -0,0 +1,189 @@ + __( 'Order', 'wiaas' ), + 'choices' => array( + array( + 'value' => 'role|administrator', // allow global administrator role here since it is only one + 'label' => __('Administrator', 'wiaas') + ) + ), + ) + ); + + // add administrator users + $args = array( + 'number' => 1000, + 'orderby' => 'display_name', + 'role' => 'administrator' + ); + $accounts = get_users( $args ); + $account_choices = array(); + foreach ( $accounts as $account ) { + $account_choices[] = array( 'value' => 'user_id|' . $account->ID, 'label' => $account->display_name ); + } + + $choices[] = array( + 'label' => __( 'Users', 'gravityflow' ), + 'choices' => $account_choices, + ); + + // append field choices + foreach ($old_choices as $old_choice) { + + if ($old_choice['label'] === 'Fields') { + + $choices[] = $old_choice; + break; + } + } + + return $choices; + } + + + /** + * Handle order level assignees for delivery process step + * + * @param $assignees + * + * @param Gravity_Flow_Step $step + * + * @return array + */ + public static function maybe_handle_order_organization_assignees($assignees, Gravity_Flow_Step $step) { + + $mapped_assignees = array(); + + $order_id = self::get_order_id_for_step($step); + + $order = wc_get_order($order_id); + + foreach ($assignees as $assignee) { + + if (strpos($assignee->get_type(), 'wiaas_installation_') !== false) { + + $item_id = $assignee->get_id(); + + $item = $order->get_item($item_id); + + $product_id = $item['product_id']; + + //TODO: Get this value from order since product can get changed or deleted later + $organization_id = Wiaas_Product_Supplier::get_supplier_organisation_id_from_product($product_id); + + $user_ids = wiaas_get_organization_user_ids($organization_id); + + if (empty($user_ids)) { + + continue; + } + + $user_id = $user_ids[0]; + + $mapped_assignees[] = $step->get_assignee( array( + 'id' => $user_id, + 'type' => 'user_id', + 'editable_fields' => $assignee->get_editable_fields() + ) ); + + continue; + } + + if ($assignee->get_type() === 'wiaas_order_role') { + + + $order_role = $assignee->get_id(); + + if ($order_role === 'customer') { + + $customer_user_id = $order->get_customer_id(); + + // for now assign only customer that create order + // check if all customer organization users should be able to see order step + + $mapped_assignees[] = $step->get_assignee( array( + 'id' => $customer_user_id, + 'type' => 'user_id', + 'editable_fields' => $assignee->get_editable_fields() + ) ); + + continue; + } + } + + $mapped_assignees[] = $assignee; + } + + return $mapped_assignees; + } + + + /** + * Retrieve order id for delivery process step + * + * @param Gravity_Flow_Step $step + * + * @return bool|int Order id on success, false if step does not have associated order id + * + */ + public static function get_order_id_for_step(Gravity_Flow_Step $step) { + + $entry = $step->get_entry(); + + // if order is present in entry metadata use that value + if (! empty($entry['wiaas_delivery_order_id'])) { + + return absint($entry['wiaas_delivery_order_id']); + } + + // try getting order id from order field + $form = GFAPI::get_form($entry['form_id']); + + $order_fields = GFCommon::get_fields_by_type($form, array( 'wiaas_order')); + + if (! empty($order_fields)) { + + $order_field = $order_fields[0]; // there should only be one order field per entry + + return absint($entry[$order_field->id]); + } + + return false; + } +} + +Wiaas_Delivery_Process_Step_Assignee::init(); diff --git a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-step.php b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-step.php index a1c3b80..bc6b668 100644 --- a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-step.php +++ b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-step.php @@ -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(); } diff --git a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-bundle-document.php b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-bundle-document.php index ffe5f3f..dfefebe 100644 --- a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-bundle-document.php +++ b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-bundle-document.php @@ -13,6 +13,7 @@ class Wiaas_Field_Order_Bundle_Document extends GF_Field_FileUpload { public function get_form_editor_field_settings() { return array( 'wiaas_doc_type_filter', + 'multiple_files_setting', 'conditional_logic_field_setting', 'error_message_setting', 'label_setting', diff --git a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-bundle-select.php b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-bundle-select.php deleted file mode 100644 index 84ddeb5..0000000 --- a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-bundle-select.php +++ /dev/null @@ -1,112 +0,0 @@ -get_selected_bundle_display_name($value); - } - - - public function get_value_merge_tag( $value, $input_id, $entry, $form, $modifier, $raw_value, $url_encode, $esc_html, $format, $nl2br ) { - return $this->get_selected_bundle_display_name($value); - } - - - public function get_value_entry_detail( $value, $currency = '', $use_text = false, $format = 'html', $media = 'screen' ) { - return $this->get_selected_bundle_display_name($value); - } - -// public function get_field_input( $form, $value = '', $entry = null ) { -// -// $this->choices = array(); -// -// $order_id = null; -// -// if (! empty($entry)) { -// -// $order_field = GFCommon::get_fields_by_type($form, array( 'wiaas_order' ) )[0]; -// -// $order_id = ! empty($order_field) ? $entry[$order_field->id] : null; -// -// } else if( ! empty($value)) { -// -// list ($order_id, $item_id) = explode('|', $value); -// } else { -// -// $order_id = absint(rgget('order_id')); -// } -// -// if (! empty($order_id)) { -// -// $this->choices = $this->get_selected_bundle_display_name($order_id); -// } -// -// return parent::get_field_input( $form, $value, $entry ); -// } - - - /** - * Adds bundles as choices - */ - public function post_convert_field() { - - if ($this->is_form_editor()) { - - $this->choices = array(); - } - - if ( ! $this->is_form_editor() && ! empty( rgget('order_id') )) { - $this->choices = $this->get_bundles_as_choices(absint(rgget('order_id'))); - } - } - - - public function get_selected_bundle_display_name($value) { - - list ($order_id, $item_id) = explode('|', $value); - - if (! empty($order_id) && ! empty($item_id) && $order = wc_get_order($order_id)) { - - $item = $order->get_item($item_id); - - return $item->get_name(); - } - - return ''; - } - - - public function get_bundles_as_choices($order_id) { - - $choices = array(); - - if (! empty ($order_id) && $order = wc_get_order($order_id)) { - - $standard_bundle_items = wiaas_get_order_standard_bundle_items($order); - - foreach ($standard_bundle_items as $item) { - - $choices[] = array( - 'value' => $order_id . '|' . $item->get_id(), - 'text' => $item->get_name() - ); - } - } - - return $choices; - } -} - -GF_Fields::register( new Wiaas_Field_Order_Bundle_Select() ); diff --git a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-bundle.php b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-bundle.php new file mode 100644 index 0000000..0d4ab92 --- /dev/null +++ b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-bundle.php @@ -0,0 +1,50 @@ +get_bundle_display_name($value); + } + + + public function get_value_merge_tag( $value, $input_id, $entry, $form, $modifier, $raw_value, $url_encode, $esc_html, $format, $nl2br ) { + return $this->get_bundle_display_name($value); + } + + + public function get_value_entry_detail( $value, $currency = '', $use_text = false, $format = 'html', $media = 'screen' ) { + return $this->get_bundle_display_name($value); + } + + public function get_bundle_item($value) { + + list($order_id, $item_id) = rgexplode('|', $value, 2); + + if (! empty($order_id) && ! empty($item_id) && $order = wc_get_order($order_id)) { + + return $order->get_item($item_id); + } + + return null; + } + + public function get_bundle_display_name($value) { + + $item = $this->get_bundle_item($value); + + if (! empty($item)) { + + return $item->get_name(); + } + + return ''; + } +} + +GF_Fields::register( new Wiaas_Field_Order_Bundle() ); \ No newline at end of file diff --git a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-document.php b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-document.php new file mode 100644 index 0000000..a0cde76 --- /dev/null +++ b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-document.php @@ -0,0 +1,61 @@ +formId ); + $upload_root = trailingslashit( $upload_root ); + + // handle download for order documents not uploaded by gravity forms + if ( strpos( $file, $upload_root ) === false ) { + + return admin_url() . '?gf-wiaas-order-doc=' . urlencode($file); + } + + return parent::get_download_url( $file, true ); + } + + public function sanitize_settings() { + parent::sanitize_settings(); + + $this->wiaasDocTypeFilter = sanitize_key($this->wiaasDocTypeFilter); + } +} + + +GF_Fields::register( new Wiaas_Field_Order_Document() ); \ No newline at end of file diff --git a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-installation-select.php b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-installation-select.php new file mode 100644 index 0000000..689ed9f --- /dev/null +++ b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-installation-select.php @@ -0,0 +1,110 @@ +get_bundle_item($entry[$bundle_item_field->id])) { + + $bundled_items = wc_pb_get_bundled_order_items($bundle_item); + + $installation_items = array(); + + foreach ($bundled_items as $id => $bundled_item) { + + $product = $bundled_item->get_product(); + + if ($product && Wiaas_Product_Category::is_installation($product)) { + + $installation_items[] = $bundled_item; + } + } + + $choices = array( + array( 'value' => '0', 'text' => 'Select installation ...') + ); + + $order_id = $bundle_item->get_order_id(); + + foreach ($installation_items as $installation_item) { + + $choices[] = array( + 'value' => 'wiaas_installation_' . $order_id . '|' . $installation_item->get_id(), + 'text' => $installation_item->get_name() + ); + } + + $this->choices = $choices; + } + + return parent::get_field_input($form, $value, $entry); + } + + public function get_form_editor_field_title() { + return esc_attr__( 'Installation Select', 'wiaas' ); + } + + public function get_value_entry_list( $value, $entry, $field_id, $columns, $form ) { + return $this->get_selected_installation_display_name($value); + } + + + public function get_value_merge_tag( $value, $input_id, $entry, $form, $modifier, $raw_value, $url_encode, $esc_html, $format, $nl2br ) { + return $this->get_selected_installation_display_name($value); + } + + + public function get_value_entry_detail( $value, $currency = '', $use_text = false, $format = 'html', $media = 'screen' ) { + return $this->get_selected_installation_display_name($value); + } + + + public function get_selected_installation_display_name($value) { + + $value = $value ? str_replace('wiaas_installation_', '', $value) : ''; + + list ($order_id, $item_id) = explode('|', $value); + + if (! empty($order_id) && ! empty($item_id) && $order = wc_get_order($order_id)) { + + $item = $order->get_item($item_id); + + return $item->get_name(); + } + + return ''; + } + + public function post_convert_field() { + + if ($this->is_form_editor()) { + + $this->choices = array( + array( 'value' => '0', 'text' => 'Select installation ...') + ); + } + } +} + + +GF_Fields::register( new Wiaas_Order_Installation_Select() ); \ No newline at end of file diff --git a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-supplier-select.php b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-supplier-select.php deleted file mode 100644 index 35ed4bd..0000000 --- a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-supplier-select.php +++ /dev/null @@ -1,83 +0,0 @@ -_get_selected_supplier_display_name($value); - } - - - public function get_value_merge_tag( $value, $input_id, $entry, $form, $modifier, $raw_value, $url_encode, $esc_html, $format, $nl2br ) { - return $this->_get_selected_supplier_display_name($value); - } - - - public function get_value_entry_detail( $value, $currency = '', $use_text = false, $format = 'html', $media = 'screen' ) { - return $this->_get_selected_supplier_display_name($value); - } - - - /** - * Adds bundles as choices - */ - public function post_convert_field() { - $this->choices = array(); - - if ( ! $this->is_form_editor() ) { - $this->choices = $this->_get_suppliers_as_choices(); - } - } - - - private function _get_selected_supplier_display_name($value) { - - list ($order_key, $supplier_id) = explode('|', $value); - - if (! empty($supplier_id)) { - - return wiaas_get_organization_name($supplier_id); - } - - return ''; - } - - - private function _get_suppliers_as_choices() { - - $choices = array(); - - $order_id = absint(rgget('order_id')); - - if (! empty ($order_id) && $order = wc_get_order($order_id)) { - - $suppliers = wiaas_get_order_suppliers($order); - - foreach ($suppliers as $supplier_id => $supplier_name) { - - $choices[] = array( - 'value' => 'wiaas_organization_order_' . $order_id . '|' . $supplier_id, - 'text' => $supplier_name - ); - } - } - - return $choices; - } -} - -GF_Fields::register( new Wiaas_Field_Order_Supplier_Select() ); diff --git a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-order-fields.php b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-order-fields.php index f104f11..af92e20 100644 --- a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-order-fields.php +++ b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-order-fields.php @@ -9,6 +9,21 @@ class Wiaas_Order_Fields { public static function init() { add_action( 'gform_field_standard_settings', array( __CLASS__, 'field_settings' ) ); + + add_filter('gform_fileupload_entry_value_file_path', array( __CLASS__, 'display_order_document_fields' ), 999, 2); + } + + + public static function display_order_document_fields($file_path, $field) { + + if ($field->type === 'wiaas_order_bundle_document') { + + $field = new Wiaas_Field_Order_Bundle_Document(); + + return $field->get_download_url($file_path); + } + + return $file_path; } /** @@ -30,11 +45,20 @@ class Wiaas_Order_Fields { + +
  • + + +
  • + get_item($bundle_item_id); - $entry = array(); foreach ($form['fields'] as $field) { @@ -87,8 +109,15 @@ class Wiaas_Order_Fields { break; + case 'workflow_user': + $entry[(string) $field->id] = $order->get_customer_id(); // save customer if needed + + break; + case 'wiaas_order_bundle': + $bundle_item = $order->get_item($bundle_item_id); + if ( empty($bundle_item) && $field->isRequired) { // there is no data for required field so entry cannot be created return false; @@ -103,6 +132,8 @@ class Wiaas_Order_Fields { case 'wiaas_order_bundle_document': + $bundle_item = $order->get_item($bundle_item_id); + if ( empty($bundle_item) && $field->isRequired) { // there is no data for required field so entry cannot be created return false; @@ -110,31 +141,80 @@ class Wiaas_Order_Fields { if (! empty($bundle_item)) { - $documents = wiaas_get_order_item_documents($bundle_item, $field->wiaasDocTypeFilter); + $documents = wiaas_get_standard_package_order_item_documents($order, $bundle_item_id); - if ( empty($documents) && $field->isRequired) { + $filtered_documents = array(); + + foreach ($documents as $document) { + + if ($document['type'] === $field->wiaasDocTypeFilter) { + + $filtered_documents[] = $document; + } + } + + if ( empty($filtered_documents) && $field->isRequired ) { // there is no data for required field so entry cannot be created return false; } - if (! empty($documents)) { + if (! empty ($filtered_documents) && ! $field->multipleFiles) { - $document = $documents[0]; + $document = $filtered_documents[0]; $entry[$field->id] = $document['version']; + + } else if (! empty ($filtered_documents) ) { + + $versions = array(); + foreach ($filtered_documents as $filtered_document) { + $versions[] = $filtered_document['version']; + } + + $entry[$field->id] = json_encode($versions); } } break; - case 'wiaas_order_supplier': - $suppliers = wiaas_get_order_suppliers($order); + case 'wiaas_order_installation_select': - $supplier_ids = array_keys($suppliers); + $bundle_item = $order->get_item($bundle_item_id); - $supplier_id = $supplier_ids[0]; + if ( empty($bundle_item) && $field->isRequired) { + // there is no data for required field so entry cannot be created + return false; + } - $entry[(string) $field->id] = 'wiaas_organization_order_' . $order_id . '|' . $supplier_id; + $bundled_items = wc_pb_get_bundled_order_items($bundle_item, $order); + + $installation_items = array(); + + foreach ($bundled_items as $id => $bundled_item) { + + $product = $bundled_item->get_product(); + + if ($product && Wiaas_Product_Category::is_installation($product)) { + + $installation_items[] = $bundled_item; + } + } + + if (empty($installation_items) && $field->isRequired) { + // there is no data for required field so entry cannot be created + return false; + } + + if (count($installation_items) === 1) { + + $installation_item = $installation_items[0]; + + $entry[(string) $field->id] = 'wiaas_installation_' . $order->get_id() . '|' . $installation_item->get_id(); + } else if (count($installation_items) > 1) { + + // force admin to select installation + $entry[(string) $field->id] = '0'; + } } } diff --git a/backend/app/plugins/wiaas/includes/document/class-wiaas-document-upload.php b/backend/app/plugins/wiaas/includes/document/class-wiaas-document-upload.php index 37c01ee..87211ab 100644 --- a/backend/app/plugins/wiaas/includes/document/class-wiaas-document-upload.php +++ b/backend/app/plugins/wiaas/includes/document/class-wiaas-document-upload.php @@ -7,7 +7,7 @@ class Wiaas_Document_Upload { ); public static function init() { - //add_filter( 'upload_dir', array( __CLASS__, 'upload_dir' ) ); + add_filter( 'upload_dir', array( __CLASS__, 'upload_dir' ) ); } diff --git a/backend/app/plugins/wiaas/includes/document/wiaas-document-functions.php b/backend/app/plugins/wiaas/includes/document/wiaas-document-functions.php index 8a078ab..524b2ef 100644 --- a/backend/app/plugins/wiaas/includes/document/wiaas-document-functions.php +++ b/backend/app/plugins/wiaas/includes/document/wiaas-document-functions.php @@ -222,9 +222,4 @@ function wiaas_get_order_item_documents($order_item, $doc_type = null) { } return $filtered_documents; -} - -function wiaas_get_order_item_document_admin_download_link($order_id, $item_id, $version) { - - } \ No newline at end of file diff --git a/backend/app/plugins/wiaas/includes/order/wiaas-order-functions.php b/backend/app/plugins/wiaas/includes/order/wiaas-order-functions.php index a25c61d..0787060 100644 --- a/backend/app/plugins/wiaas/includes/order/wiaas-order-functions.php +++ b/backend/app/plugins/wiaas/includes/order/wiaas-order-functions.php @@ -1,26 +1,5 @@ get_items(); - - $suppliers = wiaas_get_suppliers(); - - return $suppliers; -} - /** * Retrieve standard bundles from order * diff --git a/frontend/src/containers/orders/components/process/OrderProcess.jsx b/frontend/src/containers/orders/components/process/OrderProcess.jsx index 3424e32..bc4d8e8 100644 --- a/frontend/src/containers/orders/components/process/OrderProcess.jsx +++ b/frontend/src/containers/orders/components/process/OrderProcess.jsx @@ -41,7 +41,11 @@ class OrderProcess extends Component { { - visibleSteps.reverse().map((step, index) => ) + visibleSteps.reverse().map((step, index) => ) }