Merge branch 'master' into package-details
This commit is contained in:
@@ -1,6 +1,24 @@
|
||||
<?php
|
||||
|
||||
class Wiass_REST_Delivery_Process_API {
|
||||
|
||||
const BASE_NAME = WP_HOME . '/';
|
||||
|
||||
const FILE_KEY_NAME = 'file';
|
||||
|
||||
const PATH_PARTS_TO_EXTRACT = 7;
|
||||
|
||||
const ACCEPTANCE_STATUS_FIELD_ID = 8;
|
||||
const EXPIRATION_DATE_FIELD_ID = 9;
|
||||
const DECLINE_REASON_FIELD_ID = 10;
|
||||
const UPLOADED_FILES_FIELD_ID = 12;
|
||||
|
||||
const USER_INPUT_STEP_NAME = 'Upload acceptance file';
|
||||
const ACCEPT_STATUS_LABEL = 'accept';
|
||||
const DECLINE_STATUS_LABEL = 'decline';
|
||||
|
||||
const ACCEPTABLE_STATUS = [self::ACCEPT_STATUS_LABEL, self::DECLINE_STATUS_LABEL];
|
||||
|
||||
/**
|
||||
* Endpoint namespace.
|
||||
*
|
||||
@@ -14,8 +32,25 @@ class Wiass_REST_Delivery_Process_API {
|
||||
'methods' => 'GET',
|
||||
'callback' => array(__CLASS__, 'get_next_actions_for_user'),
|
||||
) );
|
||||
}
|
||||
|
||||
register_rest_route( self::$namespace, 'customer-acceptance/(?P<entry_id>\d+)', array(
|
||||
'methods' => 'GET',
|
||||
'callback' => array(__CLASS__, 'get_customer_acceptance'),
|
||||
'permission_callback' => 'is_user_logged_in'
|
||||
) );
|
||||
|
||||
register_rest_route( self::$namespace, 'customer-acceptance/(?P<entry_id>\d+)', array(
|
||||
'methods' => 'POST',
|
||||
'callback' => array(__CLASS__, 'submit_customer_acceptance'),
|
||||
'permission_callback' => 'is_user_logged_in'
|
||||
) );
|
||||
|
||||
register_rest_route( self::$namespace, 'customer-acceptance/(?P<entry_id>\d+)/upload-file' , array(
|
||||
'methods' => 'POST',
|
||||
'callback' => array(__CLASS__, 'upload_file'),
|
||||
'permission_callback' => 'is_user_logged_in'
|
||||
) );
|
||||
}
|
||||
|
||||
public static function get_next_actions_for_user() {
|
||||
$current_user = wp_get_current_user();
|
||||
@@ -62,4 +97,207 @@ class Wiass_REST_Delivery_Process_API {
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
public static function get_customer_acceptance(WP_REST_Request $request){
|
||||
$entry = GFAPI::get_entry($request['entry_id']);
|
||||
if (is_wp_error($entry)){
|
||||
return self::generate_error('Customer acceptance entry not found', 404);
|
||||
}
|
||||
|
||||
$acceptance_documents = array();
|
||||
$uploaded_files = json_decode($entry[self::UPLOADED_FILES_FIELD_ID]);
|
||||
|
||||
foreach($uploaded_files as $file_url){
|
||||
//example of decoded url :
|
||||
//http://localhost/wp/index.php?gf-download=2018/08/rokovi-1535378841.docx&form-id=1&field-id=12&hash=1be6c30f0eeff93563b352d15fe459d5ded12ee06c2c8f36fed66b42dedf2534
|
||||
|
||||
$decoded_url = urldecode($file_url);
|
||||
$url_parts = explode('?', $decoded_url);
|
||||
$file_name_base_parts = explode('&', $url_parts[1]);
|
||||
$file_name_parts = explode('/', $file_name_base_parts[0]);
|
||||
$file_name_with_extension_parts = explode('.', $file_name_parts[2]);
|
||||
|
||||
$acceptance_documents_entry = array(
|
||||
'name' => $file_name_with_extension_parts[0],
|
||||
'extension' => $file_name_with_extension_parts[1],
|
||||
'url' => $file_url
|
||||
);
|
||||
array_push($acceptance_documents, $acceptance_documents_entry);
|
||||
}
|
||||
|
||||
$acceptance_status = 0;
|
||||
if ($entry[self::ACCEPTANCE_STATUS_FIELD_ID]){
|
||||
$acceptance_status = ($entry[self::ACCEPTANCE_STATUS_FIELD_ID] === 'accept') ? 1 : -1;
|
||||
}
|
||||
|
||||
$result = array(
|
||||
'documents' => $acceptance_documents,
|
||||
'expiration' => $entry[self::EXPIRATION_DATE_FIELD_ID],
|
||||
'status' => $acceptance_status,
|
||||
'decline_reason' => $entry[self::DECLINE_REASON_FIELD_ID]
|
||||
);
|
||||
|
||||
return new WP_REST_Response($result);
|
||||
}
|
||||
|
||||
public static function submit_customer_acceptance(WP_REST_Request $request){
|
||||
$entry = GFAPI::get_entry($request['entry_id']);
|
||||
if (is_wp_error($entry)){
|
||||
return self::generate_error('Customer acceptance entry not found', 404);
|
||||
}
|
||||
|
||||
$status = $request['actionType'];
|
||||
$reason = $request['declineReason'];
|
||||
|
||||
if (!in_array($status, self::ACCEPTABLE_STATUS)){
|
||||
return self::generate_wiaas_response('ACCEPTANCE_STATUS_MISSING', 'error');
|
||||
}
|
||||
|
||||
$installation_declined = ($status === self::DECLINE_STATUS_LABEL);
|
||||
|
||||
$uploaded_files = json_decode($entry[self::UPLOADED_FILES_FIELD_ID]);
|
||||
|
||||
if ($installation_declined && $reason === ''){
|
||||
return self::generate_wiaas_response('DECLINE_REASON_EMPTY', 'error');
|
||||
}
|
||||
|
||||
if (!$installation_declined && (count($uploaded_files)===0)){
|
||||
return self::generate_wiaas_response('ACCEPTANCE_NOT_UPLOADED', 'error');
|
||||
}
|
||||
|
||||
$entry[self::DECLINE_REASON_FIELD_ID] = $reason;
|
||||
$entry[self::ACCEPTANCE_STATUS_FIELD_ID] = $status;
|
||||
|
||||
if (!GFAPI::update_entry( $entry )){
|
||||
return self::generate_wiaas_response('INTERNAL_SERVER_ERROR', 'error');
|
||||
}
|
||||
|
||||
//Check if step is already completed, to not submit again
|
||||
$gf_api = new Gravity_Flow_API($entry['form_id']);
|
||||
$current_step = $gf_api->get_current_step($entry);
|
||||
if ($current_step->get_name() !== self::USER_INPUT_STEP_NAME){
|
||||
return self::generate_wiaas_response('ACCEPTANCE_STATUS_UPDATED', 'success');
|
||||
}
|
||||
|
||||
if ( $current_step ) {
|
||||
$current_step->purge_assignees();
|
||||
$current_step->update_step_status( 'complete' );
|
||||
}
|
||||
$entry_id = $entry['id'];
|
||||
$new_step_id = $current_step->get_id() + 1;
|
||||
$new_step = $gf_api->get_step( $new_step_id, $entry );
|
||||
$feedback = sprintf( esc_html__( 'Sent to step: %s', 'gravityflow' ), $new_step->get_name() );
|
||||
$gf_api->add_timeline_note( $entry_id, $feedback );
|
||||
$gf_api->log_activity( 'workflow', 'sent_to_step', $gf_api->form_id, $entry_id, $step_id );
|
||||
gform_update_meta( $entry_id, 'workflow_final_status', 'pending' );
|
||||
$new_step->start();
|
||||
$gf_api->process_workflow( $entry_id );
|
||||
|
||||
|
||||
if ($installation_declined){
|
||||
return self::generate_wiaas_response('INSTALLATION_DECLINED', 'success');
|
||||
}
|
||||
return self::generate_wiaas_response('INSTALLATION_ACCEPTED', 'success');
|
||||
}
|
||||
|
||||
public static function upload_file(WP_REST_Request $request){
|
||||
$files = $request->get_file_params();
|
||||
if (!$files[self::FILE_KEY_NAME]){
|
||||
return self::generate_wiaas_response('NO_FILES_UPLOADED', 'error');
|
||||
}
|
||||
|
||||
$entry = GFAPI::get_entry($request['entry_id']);
|
||||
if (is_wp_error($entry)){
|
||||
return self::generate_error('Customer acceptance entry not found', 404);
|
||||
}
|
||||
|
||||
$form = GFAPI::get_form($entry['form_id']);
|
||||
$form_upload_path = GFFormsModel::get_upload_path( $form['id'] );
|
||||
|
||||
$target_path = $form_upload_path . '/' . date('Y') . '/' . date('m') . '/';
|
||||
wp_mkdir_p( $target_path );
|
||||
GFCommon::recursive_add_index_file( $target_path );
|
||||
|
||||
$upload_file_field = GFAPI::get_field($form['id'], self::UPLOADED_FILES_FIELD_ID);
|
||||
$file_name = sanitize_file_name($files[self::FILE_KEY_NAME]['name']);
|
||||
$file_path_details = pathinfo($file_name);
|
||||
|
||||
if ( GFCommon::file_name_has_disallowed_extension( $file_name ) ) {
|
||||
return self::generate_wiaas_response('INVALID_FILE_ACCEPTANCE', 'error');
|
||||
}
|
||||
$allowed_extensions = ! empty( $upload_file_field->allowedExtensions ) ? GFCommon::clean_extensions( explode( ',', strtolower( $upload_file_field->allowedExtensions ) ) ) : array();
|
||||
if ( ! empty( $allowed_extensions ) ) {
|
||||
if ( ! GFCommon::match_file_extension( $file_name, $allowed_extensions ) ) {
|
||||
return self::generate_wiaas_response('INVALID_FILE_ACCEPTANCE', 'error');
|
||||
}
|
||||
}
|
||||
|
||||
$new_file_name = $file_path_details['filename'] . '-' . time() . '.' . $file_path_details['extension'];
|
||||
|
||||
// Bypasses security checks when running unit tests.
|
||||
if ( defined( 'WP_TEST_IN_PROGRESS' ) && WP_TEST_IN_PROGRESS ) {
|
||||
return self::generate_wiaas_response('FILE_UPLOADED', 'success');
|
||||
}
|
||||
|
||||
if ( move_uploaded_file($files[self::FILE_KEY_NAME]['tmp_name'], $target_path . $new_file_name ) ) {
|
||||
GFFormsModel::set_permissions( $target_path . $new_file_name );
|
||||
} else {
|
||||
return self::generate_wiaas_response('INTERNAL_SERVER_ERROR', 'error');
|
||||
}
|
||||
|
||||
//Extract path relative to the root
|
||||
//Last 6 strings (excluding last empty) are path relative to the root
|
||||
$path_parts = explode('/', $target_path);
|
||||
|
||||
$relative_path = '';
|
||||
$i = count($path_parts) - self::PATH_PARTS_TO_EXTRACT;
|
||||
while($i < count($path_parts)-1){
|
||||
$relative_path = $relative_path . $path_parts[$i] . '/';
|
||||
$i++;
|
||||
}
|
||||
|
||||
$file_url = self::BASE_NAME . $relative_path . $new_file_name;
|
||||
$url_for_download = $upload_file_field->get_download_url($file_url);
|
||||
|
||||
$uploaded_files = json_decode($entry[self::UPLOADED_FILES_FIELD_ID]);
|
||||
|
||||
if ($uploaded_files === NULL){
|
||||
$uploaded_files = [];
|
||||
}
|
||||
array_push($uploaded_files, $url_for_download);
|
||||
|
||||
$entry[self::UPLOADED_FILES_FIELD_ID] = json_encode($uploaded_files);
|
||||
|
||||
if (GFAPI::update_entry( $entry )) {
|
||||
return self::generate_wiaas_response('FILE_UPLOADED','success');
|
||||
}
|
||||
|
||||
return self::generate_wiaas_response('NOT_UPLOADED', 'error');
|
||||
}
|
||||
|
||||
//Helper function
|
||||
private static function generate_error($message, $code = 500){
|
||||
$error = array(
|
||||
'status' => $code,
|
||||
'message' => $message,
|
||||
);
|
||||
|
||||
$result = new WP_REST_Response($error);
|
||||
$result->set_status($code);
|
||||
return $result;
|
||||
}
|
||||
|
||||
private static function generate_wiaas_response($message, $code, $data = NULL){
|
||||
$response = array(
|
||||
'messages' => [
|
||||
array(
|
||||
'code' => $code,
|
||||
'message' => $message
|
||||
)
|
||||
],
|
||||
'data' => $data
|
||||
);
|
||||
|
||||
return new WP_REST_Response($response);
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ class Wiaas_DB_Update {
|
||||
'20180801222206' => 'wiaas_db_update_setup_gravity',
|
||||
'20180802222206' => 'wiaas_db_update_add_delivery_process_forms',
|
||||
'20180807222206' => 'wiaas_db_update_setup_customer_capabilities',
|
||||
'20180809134511' => 'wiaas_db_update_add_customer_read_permission',
|
||||
'20180811134511' => 'wiaas_db_update_enable_orders_access_management',
|
||||
'20180813134511' => 'wiaas_db_update_enable_order_numbers',
|
||||
'20180826153509' => 'wiaas_create_broker_access_group'
|
||||
|
||||
@@ -23,8 +23,33 @@ class Wiaas_Delivery_Process {
|
||||
|
||||
add_filter( 'gform_entry_meta', array(__CLASS__, 'extend_gravity_form_entry_meta'), 10, 2 );
|
||||
add_action( 'gravityflow_workflow_complete', array(__CLASS__, 'maybe_complete_parent_process_step'), 5, 3 );
|
||||
|
||||
add_action( 'gravityflow_workflow_complete', array(__CLASS__, 'maybe_complete_parent_order'), 10, 3 );
|
||||
|
||||
// Some temporary functions to make inbox page prettier
|
||||
add_filter('gravityflow_inbox_submitter_name', array(__CLASS__, 'display_step_name_in_inbox'), 10, 3);
|
||||
add_filter('gravityflow_approve_label_workflow_detail', array(__CLASS__, 'approval_step_approval_label'), 10, 2);
|
||||
add_filter('gravityflow_reject_label_workflow_detail', array(__CLASS__, 'approval_step_reject_label'), 10, 2);
|
||||
}
|
||||
|
||||
public static function approval_step_approval_label($label, $step) {
|
||||
if ($step->get_name() === 'Complete step') {
|
||||
return esc_html__( 'Complete step', 'wiaas' );
|
||||
}
|
||||
return $label;
|
||||
}
|
||||
|
||||
public static function approval_step_reject_label($label, $step) {
|
||||
if ($step->get_name() === 'Complete step') {
|
||||
return esc_html__( 'Cancel', 'wiaas' );
|
||||
}
|
||||
return $label;
|
||||
}
|
||||
|
||||
public static function display_step_name_in_inbox($name, $entry, $form) {
|
||||
return $entry['wiaas_delivery_step_name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers our Delivery Process Step Type as available Gravity Flow Step Type
|
||||
*/
|
||||
@@ -34,6 +59,29 @@ class Wiaas_Delivery_Process {
|
||||
Gravity_Flow_Steps::register( new Wiaas_Delivery_Process_Step() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Maybe complete parent order for completed delivery process
|
||||
* @param $entry_id
|
||||
* @param $form
|
||||
*/
|
||||
public static function maybe_complete_parent_order($entry_id, $form) {
|
||||
$entry = GFAPI::get_entry($entry_id);
|
||||
|
||||
$order_id = $entry['wiaas_delivery_order_id'];
|
||||
|
||||
if (!isset($order_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$process_entry_id = get_post_meta($order_id, 'wiaas_delivery_process_entry_id', true);
|
||||
|
||||
// order process entry completed, so complete order
|
||||
if (absint($process_entry_id) === $entry_id) {
|
||||
$order = wc_get_order($order_id);
|
||||
$order->update_status('completed', 'Completed order delivery process.', true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves delivery process instance for order
|
||||
*
|
||||
@@ -134,6 +182,16 @@ class Wiaas_Delivery_Process {
|
||||
),
|
||||
);
|
||||
|
||||
$entry_meta[ 'wiaas_delivery_step_name' ] = array(
|
||||
'label' => 'Wiaas Delivery Step name',
|
||||
'is_numeric' => false,
|
||||
'update_entry_meta_callback' => null,
|
||||
'is_default_column' => false, // this column will be displayed by default on the entry list
|
||||
'filter' => array(
|
||||
'operators' => array( 'is' ),
|
||||
),
|
||||
);
|
||||
|
||||
return $entry_meta;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,19 @@ class Wiaas_Order {
|
||||
add_filter('woocommerce_rest_prepare_shop_order_object', array(__CLASS__, 'transform_rest_order'), 999, 3);
|
||||
|
||||
add_filter('woocommerce_rest_orders_prepare_object_query', array( __CLASS__, 'wiaas_prepare_rest_orders_query'), 10, 2);
|
||||
|
||||
add_filter('woocommerce_new_order_note_data', array( __CLASS__, 'update_new_order_comment_date'), 10, 3);
|
||||
}
|
||||
|
||||
public static function update_new_order_comment_date($comment_data, $order_data) {
|
||||
$user = wp_get_current_user();
|
||||
|
||||
$comment_data['comment_author'] = $user->display_name;
|
||||
$comment_data['comment_author_email'] = $user->user_email;
|
||||
|
||||
return $comment_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assignees order to corresponding user organization when order is created.
|
||||
*
|
||||
@@ -94,6 +105,8 @@ class Wiaas_Order {
|
||||
$data = self::_append_commercial_lead_info($data, $order, $request);
|
||||
|
||||
$data = self::_append_wiaas_order_details($data, $order, $request);
|
||||
|
||||
$data = self::_append_order_comments($data, $order, $request);
|
||||
|
||||
$response->set_data($data);
|
||||
|
||||
@@ -126,6 +139,7 @@ class Wiaas_Order {
|
||||
private static function _append_commercial_lead_info($data, $order, $request) {
|
||||
|
||||
$data['commercial_lead'] = array(
|
||||
'id' => 1,
|
||||
'name' => 'Coor Service Management',
|
||||
'phone' => '123456789',
|
||||
'email' => 'rikard@co-ideation.com'
|
||||
@@ -248,6 +262,34 @@ class Wiaas_Order {
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/** Append order comments if single order is requested
|
||||
* @param $data
|
||||
* @param $order
|
||||
* @param $request
|
||||
*/
|
||||
private static function _append_order_comments($data, $order, $request) {
|
||||
|
||||
if (isset($request['id'])) {
|
||||
$current_user = wp_get_current_user();
|
||||
|
||||
$comments = $order->get_customer_order_notes();
|
||||
|
||||
$data['comments'] = array();
|
||||
|
||||
foreach ($comments as $comment) {
|
||||
$data['comments'][] = array(
|
||||
'id' => $comment->comment_ID,
|
||||
'content' => $comment->comment_content,
|
||||
'username' => $comment->comment_author,
|
||||
'date' => $comment->comment_date,
|
||||
'is_owner' => $comment->comment_author === $current_user->display_name,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
Wiaas_Order::init();
|
||||
|
||||
@@ -1,387 +1,524 @@
|
||||
{
|
||||
"0": {
|
||||
"title": "DELIVERY ACTION TYPE: Customer acceptance",
|
||||
"description": "The customer must accept the implementation before further actions can be taken. If the customer isn't satisfied, the problems or discrepancies must be fixed in order to gen an acceptance.",
|
||||
"labelPlacement": "top_label",
|
||||
"descriptionPlacement": "below",
|
||||
"button": {
|
||||
"type": "text",
|
||||
"text": "Submit",
|
||||
"imageUrl": ""
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
"type": "workflow_user",
|
||||
"id": 2,
|
||||
"label": "customer-id",
|
||||
"adminLabel": "customer-id",
|
||||
"isRequired": false,
|
||||
"size": "medium",
|
||||
"errorMessage": "",
|
||||
"visibility": "administrative",
|
||||
"inputs": null,
|
||||
"choices": [
|
||||
],
|
||||
"formId": 10,
|
||||
"description": "",
|
||||
"allowsPrepopulate": true,
|
||||
"inputMask": false,
|
||||
"inputMaskValue": "",
|
||||
"inputType": "",
|
||||
"labelPlacement": "",
|
||||
"descriptionPlacement": "",
|
||||
"subLabelPlacement": "",
|
||||
"placeholder": "",
|
||||
"cssClass": "",
|
||||
"inputName": "customer-id",
|
||||
"noDuplicates": false,
|
||||
"defaultValue": "",
|
||||
"conditionalLogic": "",
|
||||
"failed_validation": "",
|
||||
"productField": "",
|
||||
"multipleFiles": false,
|
||||
"maxFiles": "",
|
||||
"calculationFormula": "",
|
||||
"calculationRounding": "",
|
||||
"enableCalculation": "",
|
||||
"disableQuantity": false,
|
||||
"displayAllCategories": false,
|
||||
"useRichTextEditor": false,
|
||||
"displayOnly": "",
|
||||
"enablePrice": "",
|
||||
"gravityflowUsersRoleFilter": ""
|
||||
},
|
||||
{
|
||||
"type": "date",
|
||||
"id": 6,
|
||||
"label": "Actual date",
|
||||
"adminLabel": "",
|
||||
"isRequired": false,
|
||||
"size": "medium",
|
||||
"errorMessage": "",
|
||||
"visibility": "visible",
|
||||
"inputs": null,
|
||||
"dateType": "datepicker",
|
||||
"calendarIconType": "none",
|
||||
"formId": 10,
|
||||
"description": "",
|
||||
"allowsPrepopulate": false,
|
||||
"inputMask": false,
|
||||
"inputMaskValue": "",
|
||||
"inputType": "",
|
||||
"labelPlacement": "",
|
||||
"descriptionPlacement": "",
|
||||
"subLabelPlacement": "",
|
||||
"placeholder": "",
|
||||
"cssClass": "",
|
||||
"inputName": "",
|
||||
"noDuplicates": false,
|
||||
"defaultValue": "",
|
||||
"choices": "",
|
||||
"conditionalLogic": "",
|
||||
"calendarIconUrl": "",
|
||||
"dateFormat": "ymd_dash",
|
||||
"productField": "",
|
||||
"multipleFiles": false,
|
||||
"maxFiles": "",
|
||||
"calculationFormula": "",
|
||||
"calculationRounding": "",
|
||||
"enableCalculation": "",
|
||||
"disableQuantity": false,
|
||||
"displayAllCategories": false,
|
||||
"useRichTextEditor": false,
|
||||
"displayOnly": ""
|
||||
},
|
||||
{
|
||||
"type": "fileupload",
|
||||
"id": 7,
|
||||
"label": "Acceptance document",
|
||||
"adminLabel": "",
|
||||
"isRequired": false,
|
||||
"size": "medium",
|
||||
"errorMessage": "",
|
||||
"visibility": "visible",
|
||||
"inputs": null,
|
||||
"formId": 10,
|
||||
"description": "Upload your acceptance document",
|
||||
"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": ""
|
||||
}
|
||||
],
|
||||
"version": "2.3.2",
|
||||
"id": 10,
|
||||
"useCurrentUserAsAuthor": true,
|
||||
"postContentTemplateEnabled": false,
|
||||
"postTitleTemplateEnabled": false,
|
||||
"postTitleTemplate": "",
|
||||
"postContentTemplate": "",
|
||||
"lastPageButton": null,
|
||||
"pagination": null,
|
||||
"firstPageCssClass": null,
|
||||
"confirmations": [
|
||||
{
|
||||
"id": "5b5f75f7494b7",
|
||||
"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": "5b5f75f748cee",
|
||||
"to": "{admin_email}",
|
||||
"name": "Admin Notification",
|
||||
"event": "form_submission",
|
||||
"toType": "email",
|
||||
"subject": "New submission from {form_title}",
|
||||
"message": "{all_fields}"
|
||||
}
|
||||
],
|
||||
"feeds": {
|
||||
"gravityflow": [
|
||||
{
|
||||
"id": "22",
|
||||
"form_id": "10",
|
||||
"is_active": "1",
|
||||
"feed_order": "0",
|
||||
"meta": {
|
||||
"step_name": "Upload acceptance file",
|
||||
"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",
|
||||
"assignee_user_field|2"
|
||||
],
|
||||
"editable_fields": [
|
||||
"5"
|
||||
],
|
||||
"routing": "",
|
||||
"assignee_policy": "any",
|
||||
"highlight_editable_fields_enabled": "0",
|
||||
"highlight_editable_fields_class": "green-triangle",
|
||||
"instructionsEnable": "0",
|
||||
"instructionsValue": "",
|
||||
"display_fields_mode": "selected_fields",
|
||||
"display_fields_selected": [
|
||||
"5"
|
||||
],
|
||||
"default_status": "hidden",
|
||||
"note_mode": "not_required",
|
||||
"assignee_notification_enabled": "0",
|
||||
"assignee_notification_from_name": "",
|
||||
"assignee_notification_from_email": "{admin_email}",
|
||||
"assignee_notification_reply_to": "",
|
||||
"assignee_notification_bcc": "",
|
||||
"assignee_notification_subject": "Upload order acceptance file",
|
||||
"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": "7",
|
||||
"expiration_delay_unit": "days",
|
||||
"expiration_date_field_offset": "0",
|
||||
"expiration_date_field_offset_unit": "hours",
|
||||
"expiration_date_field_before_after": "after",
|
||||
"status_expiration": "expired",
|
||||
"destination_expired": "next",
|
||||
"destination_complete": "next"
|
||||
},
|
||||
"addon_slug": "gravityflow",
|
||||
"event_type": null
|
||||
"0": {
|
||||
"title": "DELIVERY ACTION TYPE: Customer acceptance",
|
||||
"description": "The customer must accept the implementation before further actions can be taken. If the customer isn't satisfied, the problems or discrepancies must be fixed in order to gen an acceptance.",
|
||||
"labelPlacement": "top_label",
|
||||
"descriptionPlacement": "below",
|
||||
"button": {
|
||||
"type": "text",
|
||||
"text": "Submit",
|
||||
"imageUrl": ""
|
||||
},
|
||||
{
|
||||
"id": "30",
|
||||
"form_id": "10",
|
||||
"is_active": "1",
|
||||
"feed_order": "0",
|
||||
"meta": {
|
||||
"step_name": "Approve customer acceptance",
|
||||
"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|2",
|
||||
"fieldId": "0",
|
||||
"operator": "is",
|
||||
"value": "",
|
||||
"type": ""
|
||||
}
|
||||
],
|
||||
"assignee_policy": "any",
|
||||
"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": "22",
|
||||
"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": "22",
|
||||
"destination_approved": "next"
|
||||
},
|
||||
"addon_slug": "gravityflow",
|
||||
"event_type": null
|
||||
"fields": [
|
||||
{
|
||||
"type": "workflow_user",
|
||||
"id": 2,
|
||||
"label": "customer-id",
|
||||
"adminLabel": "customer-id",
|
||||
"isRequired": false,
|
||||
"size": "medium",
|
||||
"errorMessage": "",
|
||||
"visibility": "administrative",
|
||||
"inputs": null,
|
||||
"choices": [
|
||||
],
|
||||
"formId": 1,
|
||||
"description": "",
|
||||
"allowsPrepopulate": true,
|
||||
"inputMask": false,
|
||||
"inputMaskValue": "",
|
||||
"inputType": "",
|
||||
"labelPlacement": "",
|
||||
"descriptionPlacement": "",
|
||||
"subLabelPlacement": "",
|
||||
"placeholder": "",
|
||||
"cssClass": "",
|
||||
"inputName": "customer-id",
|
||||
"noDuplicates": false,
|
||||
"defaultValue": "",
|
||||
"conditionalLogic": "",
|
||||
"failed_validation": "",
|
||||
"productField": "",
|
||||
"multipleFiles": false,
|
||||
"maxFiles": "",
|
||||
"calculationFormula": "",
|
||||
"calculationRounding": "",
|
||||
"enableCalculation": "",
|
||||
"disableQuantity": false,
|
||||
"displayAllCategories": false,
|
||||
"useRichTextEditor": false,
|
||||
"displayOnly": "",
|
||||
"enablePrice": "",
|
||||
"gravityflowUsersRoleFilter": ""
|
||||
},
|
||||
{
|
||||
"type": "date",
|
||||
"id": 6,
|
||||
"label": "Actual date",
|
||||
"adminLabel": "",
|
||||
"isRequired": false,
|
||||
"size": "medium",
|
||||
"errorMessage": "",
|
||||
"visibility": "visible",
|
||||
"inputs": null,
|
||||
"dateType": "datepicker",
|
||||
"calendarIconType": "none",
|
||||
"formId": 1,
|
||||
"description": "",
|
||||
"allowsPrepopulate": false,
|
||||
"inputMask": false,
|
||||
"inputMaskValue": "",
|
||||
"inputType": "",
|
||||
"labelPlacement": "",
|
||||
"descriptionPlacement": "",
|
||||
"subLabelPlacement": "",
|
||||
"placeholder": "",
|
||||
"cssClass": "",
|
||||
"inputName": "",
|
||||
"noDuplicates": false,
|
||||
"defaultValue": "",
|
||||
"choices": "",
|
||||
"conditionalLogic": "",
|
||||
"calendarIconUrl": "",
|
||||
"dateFormat": "ymd_dash",
|
||||
"productField": "",
|
||||
"multipleFiles": false,
|
||||
"maxFiles": "",
|
||||
"calculationFormula": "",
|
||||
"calculationRounding": "",
|
||||
"enableCalculation": "",
|
||||
"disableQuantity": false,
|
||||
"displayAllCategories": false,
|
||||
"useRichTextEditor": false,
|
||||
"displayOnly": ""
|
||||
},
|
||||
{
|
||||
"type": "radio",
|
||||
"id": 8,
|
||||
"label": "acceptance",
|
||||
"adminLabel": "",
|
||||
"isRequired": false,
|
||||
"size": "medium",
|
||||
"errorMessage": "",
|
||||
"visibility": "visible",
|
||||
"inputs": null,
|
||||
"choices": [
|
||||
{
|
||||
"text": "not-accepted",
|
||||
"value": "not-accepted",
|
||||
"isSelected": true,
|
||||
"price": ""
|
||||
},
|
||||
{
|
||||
"text": "accept",
|
||||
"value": "accept",
|
||||
"isSelected": false,
|
||||
"price": ""
|
||||
},
|
||||
{
|
||||
"text": "decline",
|
||||
"value": "decline",
|
||||
"isSelected": false,
|
||||
"price": ""
|
||||
}
|
||||
],
|
||||
"formId": 1,
|
||||
"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,
|
||||
"displayOnly": ""
|
||||
},
|
||||
{
|
||||
"type": "date",
|
||||
"id": 9,
|
||||
"label": "Expiration date",
|
||||
"adminLabel": "",
|
||||
"isRequired": false,
|
||||
"size": "medium",
|
||||
"errorMessage": "",
|
||||
"visibility": "visible",
|
||||
"inputs": null,
|
||||
"dateType": "datepicker",
|
||||
"calendarIconType": "none",
|
||||
"formId": 1,
|
||||
"description": "",
|
||||
"allowsPrepopulate": false,
|
||||
"inputMask": false,
|
||||
"inputMaskValue": "",
|
||||
"inputType": "",
|
||||
"labelPlacement": "",
|
||||
"descriptionPlacement": "",
|
||||
"subLabelPlacement": "",
|
||||
"placeholder": "",
|
||||
"cssClass": "",
|
||||
"inputName": "",
|
||||
"noDuplicates": false,
|
||||
"defaultValue": "",
|
||||
"choices": "",
|
||||
"conditionalLogic": "",
|
||||
"calendarIconUrl": "",
|
||||
"dateFormat": "ymd_dash",
|
||||
"productField": "",
|
||||
"multipleFiles": false,
|
||||
"maxFiles": "",
|
||||
"calculationFormula": "",
|
||||
"calculationRounding": "",
|
||||
"enableCalculation": "",
|
||||
"disableQuantity": false,
|
||||
"displayAllCategories": false,
|
||||
"useRichTextEditor": false,
|
||||
"displayOnly": ""
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"id": 10,
|
||||
"label": "Reason",
|
||||
"adminLabel": "",
|
||||
"isRequired": false,
|
||||
"size": "medium",
|
||||
"errorMessage": "",
|
||||
"visibility": "visible",
|
||||
"inputs": null,
|
||||
"formId": 1,
|
||||
"description": "",
|
||||
"allowsPrepopulate": false,
|
||||
"inputMask": false,
|
||||
"inputMaskValue": "",
|
||||
"inputType": "",
|
||||
"labelPlacement": "",
|
||||
"descriptionPlacement": "",
|
||||
"subLabelPlacement": "",
|
||||
"placeholder": "",
|
||||
"cssClass": "",
|
||||
"inputName": "",
|
||||
"noDuplicates": false,
|
||||
"defaultValue": "",
|
||||
"choices": "",
|
||||
"conditionalLogic": "",
|
||||
"productField": "",
|
||||
"enablePasswordInput": "",
|
||||
"maxLength": "",
|
||||
"multipleFiles": false,
|
||||
"maxFiles": "",
|
||||
"calculationFormula": "",
|
||||
"calculationRounding": "",
|
||||
"enableCalculation": "",
|
||||
"disableQuantity": false,
|
||||
"displayAllCategories": false,
|
||||
"useRichTextEditor": false,
|
||||
"displayOnly": "",
|
||||
"enablePrice": ""
|
||||
},
|
||||
{
|
||||
"type": "fileupload",
|
||||
"id": 12,
|
||||
"label": "File",
|
||||
"adminLabel": "",
|
||||
"isRequired": false,
|
||||
"size": "medium",
|
||||
"errorMessage": "",
|
||||
"visibility": "visible",
|
||||
"inputs": null,
|
||||
"formId": 1,
|
||||
"description": "Upload customer acceptance file",
|
||||
"allowsPrepopulate": false,
|
||||
"inputMask": false,
|
||||
"inputMaskValue": "",
|
||||
"inputType": "",
|
||||
"labelPlacement": "",
|
||||
"descriptionPlacement": "",
|
||||
"subLabelPlacement": "",
|
||||
"placeholder": "",
|
||||
"cssClass": "",
|
||||
"inputName": "",
|
||||
"noDuplicates": false,
|
||||
"defaultValue": "",
|
||||
"choices": "",
|
||||
"conditionalLogic": "",
|
||||
"maxFileSize": "",
|
||||
"maxFiles": "",
|
||||
"multipleFiles": true,
|
||||
"allowedExtensions": "pdf,docx,doc,xlsx,xls,odt,ods,jpg,png,jpeg",
|
||||
"productField": "",
|
||||
"calculationFormula": "",
|
||||
"calculationRounding": "",
|
||||
"enableCalculation": "",
|
||||
"disableQuantity": false,
|
||||
"displayAllCategories": false,
|
||||
"useRichTextEditor": false
|
||||
}
|
||||
],
|
||||
"version": "2.3.2",
|
||||
"id": 1,
|
||||
"useCurrentUserAsAuthor": true,
|
||||
"postContentTemplateEnabled": false,
|
||||
"postTitleTemplateEnabled": false,
|
||||
"postTitleTemplate": "",
|
||||
"postContentTemplate": "",
|
||||
"lastPageButton": null,
|
||||
"pagination": null,
|
||||
"firstPageCssClass": null,
|
||||
"is_active": "1",
|
||||
"date_created": "2018-08-15 20:30:18",
|
||||
"is_trash": "0",
|
||||
"confirmations": [
|
||||
{
|
||||
"id": "5b5f75f7494b7",
|
||||
"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": "5b5f75f748cee",
|
||||
"to": "{admin_email}",
|
||||
"name": "Admin Notification",
|
||||
"event": "form_submission",
|
||||
"toType": "email",
|
||||
"subject": "New submission from {form_title}",
|
||||
"message": "{all_fields}"
|
||||
}
|
||||
],
|
||||
"feeds": {
|
||||
"gravityflow": [
|
||||
{
|
||||
"id": "1",
|
||||
"form_id": "1",
|
||||
"is_active": "1",
|
||||
"feed_order": "0",
|
||||
"meta": {
|
||||
"step_name": "Upload acceptance file",
|
||||
"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|administrator",
|
||||
"assignee_user_field|2"
|
||||
],
|
||||
"routing": "",
|
||||
"assignee_policy": "any",
|
||||
"highlight_editable_fields_enabled": "0",
|
||||
"highlight_editable_fields_class": "green-triangle",
|
||||
"instructionsEnable": "0",
|
||||
"instructionsValue": "",
|
||||
"display_fields_mode": "selected_fields",
|
||||
"default_status": "hidden",
|
||||
"note_mode": "not_required",
|
||||
"assignee_notification_enabled": "0",
|
||||
"assignee_notification_from_name": "",
|
||||
"assignee_notification_from_email": "{admin_email}",
|
||||
"assignee_notification_reply_to": "",
|
||||
"assignee_notification_bcc": "",
|
||||
"assignee_notification_subject": "Upload order acceptance file",
|
||||
"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": "date_field",
|
||||
"expiration_date": "",
|
||||
"expiration_delay_offset": "7",
|
||||
"expiration_delay_unit": "days",
|
||||
"expiration_date_field_offset": "0",
|
||||
"expiration_date_field_offset_unit": "hours",
|
||||
"expiration_date_field_before_after": "after",
|
||||
"expiration_date_field": "9",
|
||||
"status_expiration": "expired",
|
||||
"destination_expired": "2",
|
||||
"destination_complete": "next"
|
||||
},
|
||||
"addon_slug": "gravityflow",
|
||||
"event_type": null
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
"form_id": "1",
|
||||
"is_active": "1",
|
||||
"feed_order": "0",
|
||||
"meta": {
|
||||
"step_name": "Approve customer acceptance",
|
||||
"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|2",
|
||||
"fieldId": "0",
|
||||
"operator": "is",
|
||||
"value": "",
|
||||
"type": ""
|
||||
}
|
||||
],
|
||||
"assignee_policy": "any",
|
||||
"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": 1,
|
||||
"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": 1,
|
||||
"destination_approved": "next"
|
||||
},
|
||||
"addon_slug": "gravityflow",
|
||||
"event_type": null
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"version": "2.3.2.6"
|
||||
},
|
||||
"version": "2.3.2"
|
||||
}
|
||||
@@ -30,7 +30,7 @@
|
||||
"text": "wpUser"
|
||||
}
|
||||
],
|
||||
"formId": 12,
|
||||
"formId": 4,
|
||||
"description": "",
|
||||
"allowsPrepopulate": true,
|
||||
"inputMask": false,
|
||||
@@ -71,7 +71,7 @@
|
||||
"inputs": null,
|
||||
"dateType": "datepicker",
|
||||
"calendarIconType": "calendar",
|
||||
"formId": 12,
|
||||
"formId": 4,
|
||||
"description": "",
|
||||
"allowsPrepopulate": false,
|
||||
"inputMask": false,
|
||||
@@ -102,7 +102,7 @@
|
||||
}
|
||||
],
|
||||
"version": "2.3.2",
|
||||
"id": 12,
|
||||
"id": 4,
|
||||
"useCurrentUserAsAuthor": true,
|
||||
"postContentTemplateEnabled": false,
|
||||
"postTitleTemplateEnabled": false,
|
||||
@@ -111,17 +111,9 @@
|
||||
"lastPageButton": null,
|
||||
"pagination": null,
|
||||
"firstPageCssClass": null,
|
||||
"notifications": [
|
||||
{
|
||||
"id": "5b5f9ebc520f3",
|
||||
"to": "{admin_email}",
|
||||
"name": "Admin Notification",
|
||||
"event": "form_submission",
|
||||
"toType": "email",
|
||||
"subject": "New submission from {form_title}",
|
||||
"message": "{all_fields}"
|
||||
}
|
||||
],
|
||||
"is_active": "1",
|
||||
"date_created": "2018-08-09 15:36:00",
|
||||
"is_trash": "0",
|
||||
"confirmations": [
|
||||
{
|
||||
"id": "5b5f9ebc52a80",
|
||||
@@ -134,11 +126,22 @@
|
||||
"queryString": ""
|
||||
}
|
||||
],
|
||||
"notifications": [
|
||||
{
|
||||
"id": "5b5f9ebc520f3",
|
||||
"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",
|
||||
"id": "6",
|
||||
"form_id": "4",
|
||||
"is_active": "1",
|
||||
"feed_order": "0",
|
||||
"meta": {
|
||||
@@ -245,5 +248,5 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"version": "2.3.2.6"
|
||||
"version": "2.3.2"
|
||||
}
|
||||
@@ -30,7 +30,7 @@
|
||||
"text": "wpUser"
|
||||
}
|
||||
],
|
||||
"formId": 13,
|
||||
"formId": 2,
|
||||
"description": "",
|
||||
"allowsPrepopulate": true,
|
||||
"inputMask": false,
|
||||
@@ -70,7 +70,7 @@
|
||||
"inputs": null,
|
||||
"dateType": "datepicker",
|
||||
"calendarIconType": "calendar",
|
||||
"formId": 13,
|
||||
"formId": 2,
|
||||
"description": "",
|
||||
"allowsPrepopulate": false,
|
||||
"inputMask": false,
|
||||
@@ -111,7 +111,7 @@
|
||||
"inputs": null,
|
||||
"dateType": "datepicker",
|
||||
"calendarIconType": "calendar",
|
||||
"formId": 13,
|
||||
"formId": 2,
|
||||
"description": "",
|
||||
"allowsPrepopulate": false,
|
||||
"inputMask": false,
|
||||
@@ -141,7 +141,7 @@
|
||||
}
|
||||
],
|
||||
"version": "2.3.2",
|
||||
"id": 13,
|
||||
"id": 2,
|
||||
"useCurrentUserAsAuthor": true,
|
||||
"postContentTemplateEnabled": false,
|
||||
"postTitleTemplateEnabled": false,
|
||||
@@ -150,6 +150,9 @@
|
||||
"lastPageButton": null,
|
||||
"pagination": null,
|
||||
"firstPageCssClass": null,
|
||||
"is_active": "1",
|
||||
"date_created": "2018-08-09 15:35:59",
|
||||
"is_trash": "0",
|
||||
"confirmations": [
|
||||
{
|
||||
"id": "5b60b12baa00e",
|
||||
@@ -176,8 +179,8 @@
|
||||
"feeds": {
|
||||
"gravityflow": [
|
||||
{
|
||||
"id": "31",
|
||||
"form_id": "13",
|
||||
"id": "3",
|
||||
"form_id": "2",
|
||||
"is_active": "1",
|
||||
"feed_order": "0",
|
||||
"meta": {
|
||||
@@ -286,8 +289,8 @@
|
||||
"event_type": null
|
||||
},
|
||||
{
|
||||
"id": "32",
|
||||
"form_id": "13",
|
||||
"id": "4",
|
||||
"form_id": "2",
|
||||
"is_active": "1",
|
||||
"feed_order": "0",
|
||||
"meta": {
|
||||
@@ -377,7 +380,7 @@
|
||||
"approval_notification_message": "Entry {entry_id} has been approved",
|
||||
"approval_notification_disable_autoformat": "0",
|
||||
"revertEnable": "0",
|
||||
"revertValue": "31",
|
||||
"revertValue": 3,
|
||||
"note_mode": "not_required",
|
||||
"expiration": "0",
|
||||
"expiration_type": "delay",
|
||||
@@ -390,7 +393,7 @@
|
||||
"expiration_date_field": "4",
|
||||
"status_expiration": "rejected",
|
||||
"destination_expired": "next",
|
||||
"destination_rejected": "31",
|
||||
"destination_rejected": 3,
|
||||
"destination_approved": "complete"
|
||||
},
|
||||
"addon_slug": "gravityflow",
|
||||
@@ -399,5 +402,5 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"version": "2.3.2.6"
|
||||
"version": "2.3.2"
|
||||
}
|
||||
@@ -30,7 +30,7 @@
|
||||
"text": "wpUser"
|
||||
}
|
||||
],
|
||||
"formId": 9,
|
||||
"formId": 3,
|
||||
"description": "",
|
||||
"allowsPrepopulate": true,
|
||||
"inputMask": false,
|
||||
@@ -71,7 +71,7 @@
|
||||
"inputs": null,
|
||||
"dateType": "datepicker",
|
||||
"calendarIconType": "none",
|
||||
"formId": 9,
|
||||
"formId": 3,
|
||||
"description": "",
|
||||
"allowsPrepopulate": false,
|
||||
"inputMask": false,
|
||||
@@ -101,7 +101,7 @@
|
||||
}
|
||||
],
|
||||
"version": "2.3.2",
|
||||
"id": 9,
|
||||
"id": 3,
|
||||
"useCurrentUserAsAuthor": true,
|
||||
"postContentTemplateEnabled": false,
|
||||
"postTitleTemplateEnabled": false,
|
||||
@@ -110,17 +110,9 @@
|
||||
"lastPageButton": null,
|
||||
"pagination": null,
|
||||
"firstPageCssClass": null,
|
||||
"notifications": [
|
||||
{
|
||||
"id": "5b5f68818822e",
|
||||
"to": "{admin_email}",
|
||||
"name": "Admin Notification",
|
||||
"event": "form_submission",
|
||||
"toType": "email",
|
||||
"subject": "New submission from {form_title}",
|
||||
"message": "{all_fields}"
|
||||
}
|
||||
],
|
||||
"is_active": "1",
|
||||
"date_created": "2018-08-09 15:36:00",
|
||||
"is_trash": "0",
|
||||
"confirmations": [
|
||||
{
|
||||
"id": "5b5f688188e90",
|
||||
@@ -133,11 +125,22 @@
|
||||
"queryString": ""
|
||||
}
|
||||
],
|
||||
"notifications": [
|
||||
{
|
||||
"id": "5b5f68818822e",
|
||||
"to": "{admin_email}",
|
||||
"name": "Admin Notification",
|
||||
"event": "form_submission",
|
||||
"toType": "email",
|
||||
"subject": "New submission from {form_title}",
|
||||
"message": "{all_fields}"
|
||||
}
|
||||
],
|
||||
"feeds": {
|
||||
"gravityflow": [
|
||||
{
|
||||
"id": "20",
|
||||
"form_id": "9",
|
||||
"id": "5",
|
||||
"form_id": "3",
|
||||
"is_active": "1",
|
||||
"feed_order": "0",
|
||||
"meta": {
|
||||
@@ -257,5 +260,5 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"version": "2.3.2.6"
|
||||
"version": "2.3.2"
|
||||
}
|
||||
@@ -21,7 +21,7 @@
|
||||
"visibility": "visible",
|
||||
"inputs": null,
|
||||
"numberFormat": "decimal_dot",
|
||||
"formId": "11",
|
||||
"formId": 5,
|
||||
"description": "",
|
||||
"allowsPrepopulate": true,
|
||||
"inputMask": false,
|
||||
@@ -71,7 +71,7 @@
|
||||
"text": "wpUser"
|
||||
}
|
||||
],
|
||||
"formId": "11",
|
||||
"formId": 5,
|
||||
"description": "",
|
||||
"allowsPrepopulate": true,
|
||||
"inputMask": false,
|
||||
@@ -102,7 +102,7 @@
|
||||
}
|
||||
],
|
||||
"version": "2.3.2.6",
|
||||
"id": "11",
|
||||
"id": 5,
|
||||
"useCurrentUserAsAuthor": true,
|
||||
"postContentTemplateEnabled": false,
|
||||
"postTitleTemplateEnabled": false,
|
||||
@@ -112,20 +112,8 @@
|
||||
"pagination": null,
|
||||
"firstPageCssClass": null,
|
||||
"is_active": "1",
|
||||
"date_created": "2018-07-30 20:53:56",
|
||||
"date_created": "2018-08-09 15:36:00",
|
||||
"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",
|
||||
@@ -138,11 +126,23 @@
|
||||
"queryString": ""
|
||||
}
|
||||
],
|
||||
"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
|
||||
}
|
||||
],
|
||||
"feeds": {
|
||||
"gravityflow": [
|
||||
{
|
||||
"id": "28",
|
||||
"form_id": "11",
|
||||
"id": "7",
|
||||
"form_id": "5",
|
||||
"is_active": "1",
|
||||
"feed_order": "0",
|
||||
"meta": {
|
||||
@@ -164,7 +164,7 @@
|
||||
"schedule_date_field_before_after": "after",
|
||||
"instructionsEnable": "0",
|
||||
"instructionsValue": "",
|
||||
"target_form_id": "9",
|
||||
"target_form_id": 3,
|
||||
"store_new_entry_idEnable": "1",
|
||||
"new_entry_id_field": "6",
|
||||
"destination_complete": "next"
|
||||
@@ -173,8 +173,8 @@
|
||||
"event_type": null
|
||||
},
|
||||
{
|
||||
"id": "33",
|
||||
"form_id": "11",
|
||||
"id": "8",
|
||||
"form_id": "5",
|
||||
"is_active": "1",
|
||||
"feed_order": "0",
|
||||
"meta": {
|
||||
@@ -196,7 +196,7 @@
|
||||
"schedule_date_field_before_after": "after",
|
||||
"instructionsEnable": "0",
|
||||
"instructionsValue": "",
|
||||
"target_form_id": "12",
|
||||
"target_form_id": 4,
|
||||
"store_new_entry_idEnable": "0",
|
||||
"new_entry_id_field": "",
|
||||
"destination_complete": "next"
|
||||
@@ -205,8 +205,8 @@
|
||||
"event_type": null
|
||||
},
|
||||
{
|
||||
"id": "34",
|
||||
"form_id": "11",
|
||||
"id": "9",
|
||||
"form_id": "5",
|
||||
"is_active": "1",
|
||||
"feed_order": "0",
|
||||
"meta": {
|
||||
@@ -228,7 +228,7 @@
|
||||
"schedule_date_field_before_after": "after",
|
||||
"instructionsEnable": "0",
|
||||
"instructionsValue": "",
|
||||
"target_form_id": "12",
|
||||
"target_form_id": 4,
|
||||
"store_new_entry_idEnable": "0",
|
||||
"new_entry_id_field": "",
|
||||
"destination_complete": "next"
|
||||
@@ -237,8 +237,8 @@
|
||||
"event_type": null
|
||||
},
|
||||
{
|
||||
"id": "29",
|
||||
"form_id": "11",
|
||||
"id": "10",
|
||||
"form_id": "5",
|
||||
"is_active": "1",
|
||||
"feed_order": "0",
|
||||
"meta": {
|
||||
@@ -258,7 +258,7 @@
|
||||
"schedule_date_field_offset": "0",
|
||||
"schedule_date_field_offset_unit": "hours",
|
||||
"schedule_date_field_before_after": "after",
|
||||
"target_form_id": "10",
|
||||
"target_form_id": 1,
|
||||
"store_new_entry_idEnable": "1",
|
||||
"new_entry_id_field": "7",
|
||||
"destination_complete": "next"
|
||||
@@ -267,8 +267,8 @@
|
||||
"event_type": null
|
||||
},
|
||||
{
|
||||
"id": "36",
|
||||
"form_id": "11",
|
||||
"id": "11",
|
||||
"form_id": "5",
|
||||
"is_active": "1",
|
||||
"feed_order": "0",
|
||||
"meta": {
|
||||
@@ -290,7 +290,7 @@
|
||||
"schedule_date_field_before_after": "after",
|
||||
"instructionsEnable": "0",
|
||||
"instructionsValue": "",
|
||||
"target_form_id": "12",
|
||||
"target_form_id": 4,
|
||||
"store_new_entry_idEnable": "0",
|
||||
"new_entry_id_field": "",
|
||||
"destination_complete": "next",
|
||||
@@ -300,8 +300,8 @@
|
||||
"event_type": null
|
||||
},
|
||||
{
|
||||
"id": "35",
|
||||
"form_id": "11",
|
||||
"id": "12",
|
||||
"form_id": "5",
|
||||
"is_active": "1",
|
||||
"feed_order": "0",
|
||||
"meta": {
|
||||
@@ -323,7 +323,7 @@
|
||||
"schedule_date_field_before_after": "after",
|
||||
"instructionsEnable": "0",
|
||||
"instructionsValue": "",
|
||||
"target_form_id": "12",
|
||||
"target_form_id": 4,
|
||||
"store_new_entry_idEnable": "0",
|
||||
"new_entry_id_field": "",
|
||||
"destination_complete": "next"
|
||||
@@ -334,5 +334,5 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"version": "2.3.2.6"
|
||||
"version": "2.3.2"
|
||||
}
|
||||
@@ -82,12 +82,10 @@ function wiaas_db_update_setup_customer_capabilities() {
|
||||
$customer_role = get_role('customer');
|
||||
|
||||
$customer_role->add_cap('read_private_shop_orders');
|
||||
$customer_role->add_cap('read_shop_order');
|
||||
}
|
||||
|
||||
function wiaas_db_update_add_customer_read_permission() {
|
||||
$role = get_role( 'customer' );
|
||||
$role->add_cap( 'read_private_products' );
|
||||
$customer_role->add_cap('read_private_products');
|
||||
$customer_role->add_cap('read_shop_order');
|
||||
$customer_role->add_cap('publish_shop_orders');
|
||||
|
||||
}
|
||||
|
||||
function wiaas_db_update_enable_orders_access_management() {
|
||||
|
||||
@@ -100,6 +100,7 @@ class Wiaas_Delivery_Process_Step extends Gravity_Flow_Step {
|
||||
'form_id' => $this->target_form_id,
|
||||
'wiaas_delivery_process_id' => $this->get_entry_id(),
|
||||
'wiaas_delivery_order_id' => $entry['wiaas_delivery_order_id'],
|
||||
'wiaas_delivery_step_name' => $this->get_name(),
|
||||
);
|
||||
|
||||
$customer_id_value = null;
|
||||
|
||||
Reference in New Issue
Block a user