gw_fct_getunexpected - Giswater/giswater_dbmodel GitHub Wiki


Description

Function that returns the visit form for the selected visit class, unrelated with any feature, with all the fields definition set on config_form_fields.

Input example

SELECT gw_fct_getunexpected($${
"client":{"device":3,"infoType":0,"lang":"en"},
"form":{},
"data":{"relatedFeature":{"type":"", "id":"", "tableName":"v_edit_arc"},
"fields":{},"pageInfo":null}}$$)

Output example


{
  "status": "Accepted",
  "message": {},
  "apiVersion": {
    "value": "0.9.101"
  },
  "body": {
    "feature": {
      "featureType": "visit",
      "tableName": "ve_visit_incident",
      "idName": "visit_id",
      "id": 5410
    },
    "form": {
      "formId": "F11",
      "formName": "INCIDENT - 5410",
      "formTabs": [
        {
          "tabName": "tab_data",
          "tabLabel": "Data",
          "tooltip": "Data",
          "tabFunction": {
            "name": "gwGetVisit",
            "parameters": {
              "form": {
                "tabData": {
                  "active": true
                },
                "tabFiles": {
                  "active": false
                }
              }
            }
          },
          "tabActions": [
            {
              "actionName": "actionAddFile",
              "actionFunction": "gwSetFileInsert",
              "actionTooltip": "Add file",
              "disabled": false
            }
          ],
          "active": true,
          "fields": [
            {
              "label": "Accept",
              "columnname": "acceptbutton",
              "column_id": "acceptbutton",
              "widgetname": "data_acceptbutton",
              "widgettype": "button",
              "widgetfunction": "set_visit",
              "widgetaction": "set_visit",
              "updateaction": "set_visit",
              "changeaction": "set_visit",
              "type": "button",
              "name": "acceptbutton",
              "dataType": null,
              "widgetAction": "gwSetVisit",
              "updateAction": "gwSetVisit",
              "changeAction": "gwSetVisit",
              "position": "footer",
              "disabled": false,
              "hidden": false,
              "widgetdim": null,
              "datatype": null,
              "tooltip": null,
              "placeholder": null,
              "iseditable": true,
              "orderby": 1,
              "layoutname": "lyt_bot_1",
              "layoutorder": 1,
              "isparent": false,
              "ismandatory": false,
              "linkedaction": null,
              "isautoupdate": false,
              "stylesheet": null,
              "widgetcontrols": null
            },
            {
              "label": "Back",
              "columnname": "backbutton",
              "column_id": "backbutton",
              "widgetname": "data_backbutton",
              "widgettype": "button",
              "widgetfunction": "set_previous_form_back",
              "widgetaction": "set_previous_form_back",
              "updateaction": "set_previous_form_back",
              "changeaction": "set_previous_form_back",
              "type": "button",
              "name": "backbutton",
              "dataType": null,
              "widgetAction": "backButtonClicked",
              "updateAction": "backButtonClicked",
              "changeAction": "backButtonClicked",
              "position": "footer",
              "disabled": false,
              "hidden": false,
              "widgetdim": null,
              "datatype": null,
              "tooltip": null,
              "placeholder": null,
              "iseditable": true,
              "orderby": 2,
              "layoutname": "lyt_bot_1",
              "layoutorder": 2,
              "isparent": false,
              "ismandatory": false,
              "linkedaction": null,
              "isautoupdate": false,
              "stylesheet": null,
              "widgetcontrols": null
            },
            {
              "label": "Visit type:",
              "columnname": "class_id",
              "column_id": "class_id",
              "widgetname": "data_class_id",
              "widgettype": "combo",
              "widgetfunction": "get_visit",
              "widgetaction": "get_visit",
              "updateaction": "get_visit",
              "changeaction": "get_visit",
              "type": "combo",
              "name": "class_id",
              "dataType": "integer",
              "widgetAction": "gwGetVisit",
              "updateAction": "gwGetVisit",
              "changeAction": "gwGetVisit",
              "position": "body",
              "disabled": true,
              "hidden": false,
              "widgetdim": null,
              "datatype": "integer",
              "tooltip": null,
              "placeholder": null,
              "iseditable": false,
              "orderby": 3,
              "layoutname": "lyt_data_1",
              "layoutorder": 1,
              "isparent": false,
              "ismandatory": true,
              "linkedaction": null,
              "isautoupdate": false,
              "stylesheet": null,
              "widgetcontrols": null,
              "comboIds": [
                "0"
              ],
              "comboNames": [
                "Incident"
              ],
              "selectedId": "0"
            },
            {
              "label": "Visit id:",
              "columnname": "visit_id",
              "column_id": "visit_id",
              "widgetname": "data_visit_id",
              "widgettype": "text",
              "widgetfunction": null,
              "widgetaction": null,
              "updateaction": null,
              "changeaction": null,
              "type": "text",
              "name": "visit_id",
              "dataType": "double",
              "widgetAction": null,
              "updateAction": null,
              "changeAction": null,
              "position": "body",
              "disabled": true,
              "hidden": false,
              "widgetdim": null,
              "datatype": "double",
              "tooltip": null,
              "placeholder": null,
              "iseditable": false,
              "orderby": 4,
              "layoutname": "lyt_data_1",
              "layoutorder": 3,
              "isparent": false,
              "ismandatory": false,
              "linkedaction": null,
              "isautoupdate": false,
              "stylesheet": null,
              "widgetcontrols": null,
              "value": "5410"
            },
            {
              "label": "Code:",
              "columnname": "ext_code",
              "column_id": "ext_code",
              "widgetname": "data_ext_code",
              "widgettype": "text",
              "widgetfunction": null,
              "widgetaction": null,
              "updateaction": null,
              "changeaction": null,
              "type": "text",
              "name": "ext_code",
              "dataType": "string",
              "widgetAction": null,
              "updateAction": null,
              "changeAction": null,
              "position": "body",
              "disabled": false,
              "hidden": false,
              "widgetdim": null,
              "datatype": "string",
              "tooltip": null,
              "placeholder": "Ex.: Work order code",
              "iseditable": true,
              "orderby": 5,
              "layoutname": "lyt_data_1",
              "layoutorder": 6,
              "isparent": false,
              "ismandatory": false,
              "linkedaction": null,
              "isautoupdate": false,
              "stylesheet": null,
              "widgetcontrols": null
            },
            {
              "label": "Event code:",
              "columnname": "event_code",
              "column_id": "event_code",
              "widgetname": "data_event_code",
              "widgettype": "text",
              "widgetfunction": null,
              "widgetaction": null,
              "updateaction": null,
              "changeaction": null,
              "type": "text",
              "name": "event_code",
              "dataType": "string",
              "widgetAction": null,
              "updateAction": null,
              "changeAction": null,
              "position": "body",
              "disabled": false,
              "hidden": false,
              "widgetdim": null,
              "datatype": "string",
              "tooltip": null,
              "placeholder": "Ex.: Parameter code",
              "iseditable": true,
              "orderby": 6,
              "layoutname": "lyt_data_1",
              "layoutorder": 7,
              "isparent": false,
              "ismandatory": false,
              "linkedaction": null,
              "isautoupdate": false,
              "stylesheet": null,
              "widgetcontrols": null
            },
            {
              "label": "Incident:",
              "columnname": "parameter_id",
              "column_id": "parameter_id",
              "widgetname": "data_parameter_id",
              "widgettype": "combo",
              "widgetfunction": null,
              "widgetaction": null,
              "updateaction": null,
              "changeaction": null,
              "type": "combo",
              "name": "parameter_id",
              "dataType": "string",
              "widgetAction": null,
              "updateAction": null,
              "changeAction": null,
              "position": "body",
              "disabled": false,
              "hidden": false,
              "widgetdim": null,
              "datatype": "string",
              "tooltip": null,
              "placeholder": null,
              "iseditable": true,
              "orderby": 7,
              "layoutname": "lyt_data_1",
              "layoutorder": 8,
              "isparent": false,
              "ismandatory": false,
              "linkedaction": null,
              "isautoupdate": false,
              "stylesheet": null,
              "widgetcontrols": null,
              "comboIds": [
                "water_street",
                "other",
                "broken_cover"
              ],
              "comboNames": [
                "Water on the street",
                "Other",
                "Broken cover"
              ]
            },
            {
              "label": "Catalog visita:",
              "columnname": "visitcat_id",
              "column_id": "visitcat_id",
              "widgetname": "data_visitcat_id",
              "widgettype": "combo",
              "widgetfunction": null,
              "widgetaction": null,
              "updateaction": null,
              "changeaction": null,
              "type": "combo",
              "name": "visitcat_id",
              "dataType": "string",
              "widgetAction": null,
              "updateAction": null,
              "changeAction": null,
              "position": "body",
              "disabled": true,
              "hidden": false,
              "widgetdim": null,
              "datatype": "string",
              "tooltip": null,
              "placeholder": null,
              "iseditable": false,
              "orderby": 8,
              "layoutname": "lyt_data_1",
              "layoutorder": 9,
              "isparent": false,
              "ismandatory": false,
              "linkedaction": null,
              "isautoupdate": false,
              "stylesheet": null,
              "widgetcontrols": null,
              "comboIds": [
                "1"
              ],
              "comboNames": [
                "INCIDENT"
              ],
              "selectedId": "1"
            },
            {
              "label": "Description:",
              "columnname": "descript",
              "column_id": "descript",
              "widgetname": "data_descript",
              "widgettype": "text",
              "widgetfunction": null,
              "widgetaction": null,
              "updateaction": null,
              "changeaction": null,
              "type": "text",
              "name": "descript",
              "dataType": "string",
              "widgetAction": null,
              "updateAction": null,
              "changeAction": null,
              "position": "body",
              "disabled": false,
              "hidden": false,
              "widgetdim": null,
              "datatype": "string",
              "tooltip": null,
              "placeholder": null,
              "iseditable": true,
              "orderby": 9,
              "layoutname": "lyt_data_1",
              "layoutorder": 10,
              "isparent": false,
              "ismandatory": false,
              "linkedaction": null,
              "isautoupdate": false,
              "stylesheet": null,
              "widgetcontrols": null
            },
            {
              "label": "Value:",
              "columnname": "value",
              "column_id": "value",
              "widgetname": "data_value",
              "widgettype": "text",
              "widgetfunction": null,
              "widgetaction": null,
              "updateaction": null,
              "changeaction": null,
              "type": "text",
              "name": "value",
              "dataType": "string",
              "widgetAction": null,
              "updateAction": null,
              "changeAction": null,
              "position": "body",
              "disabled": false,
              "hidden": false,
              "widgetdim": null,
              "datatype": "string",
              "tooltip": null,
              "placeholder": null,
              "iseditable": true,
              "orderby": 10,
              "layoutname": "lyt_data_1",
              "layoutorder": 12,
              "isparent": false,
              "ismandatory": false,
              "linkedaction": null,
              "isautoupdate": false,
              "stylesheet": null,
              "widgetcontrols": null
            },
            {
              "label": null,
              "columnname": "divider",
              "column_id": "divider",
              "widgetname": "data_divider",
              "widgettype": "divider",
              "widgetfunction": null,
              "widgetaction": null,
              "updateaction": null,
              "changeaction": null,
              "type": "formDivider",
              "name": "divider",
              "dataType": null,
              "widgetAction": null,
              "updateAction": null,
              "changeAction": null,
              "position": "body",
              "disabled": false,
              "hidden": false,
              "widgetdim": null,
              "datatype": null,
              "tooltip": null,
              "placeholder": null,
              "iseditable": true,
              "orderby": 11,
              "layoutname": "lyt_data_1",
              "layoutorder": 13,
              "isparent": false,
              "ismandatory": false,
              "linkedaction": null,
              "isautoupdate": false,
              "stylesheet": null,
              "widgetcontrols": null
            },
            {
              "label": "Start date:",
              "columnname": "startdate",
              "column_id": "startdate",
              "widgetname": "data_startdate",
              "widgettype": "text",
              "widgetfunction": null,
              "widgetaction": null,
              "updateaction": null,
              "changeaction": null,
              "type": "text",
              "name": "startdate",
              "dataType": "date",
              "widgetAction": null,
              "updateAction": null,
              "changeAction": null,
              "position": "body",
              "disabled": false,
              "hidden": false,
              "widgetdim": null,
              "datatype": "date",
              "tooltip": null,
              "placeholder": null,
              "iseditable": true,
              "orderby": 12,
              "layoutname": "lyt_data_1",
              "layoutorder": 14,
              "isparent": false,
              "ismandatory": false,
              "linkedaction": null,
              "isautoupdate": false,
              "stylesheet": null,
              "widgetcontrols": null,
              "value": "2021-03-22 08:50"
            },
            {
              "label": "End date:",
              "columnname": "enddate",
              "column_id": "enddate",
              "widgetname": "data_enddate",
              "widgettype": "datetime",
              "widgetfunction": null,
              "widgetaction": null,
              "updateaction": null,
              "changeaction": null,
              "type": "datepickertime",
              "name": "enddate",
              "dataType": "date",
              "widgetAction": null,
              "updateAction": null,
              "changeAction": null,
              "position": "body",
              "disabled": false,
              "hidden": false,
              "widgetdim": null,
              "datatype": "date",
              "tooltip": null,
              "placeholder": null,
              "iseditable": true,
              "orderby": 13,
              "layoutname": "lyt_data_1",
              "layoutorder": 15,
              "isparent": false,
              "ismandatory": false,
              "linkedaction": null,
              "isautoupdate": false,
              "stylesheet": null,
              "widgetcontrols": null
            },
            {
              "label": "Status:",
              "columnname": "status",
              "column_id": "status",
              "widgetname": "data_status",
              "widgettype": "combo",
              "widgetfunction": null,
              "widgetaction": null,
              "updateaction": null,
              "changeaction": null,
              "type": "combo",
              "name": "status",
              "dataType": "integer",
              "widgetAction": null,
              "updateAction": null,
              "changeAction": null,
              "position": "body",
              "disabled": false,
              "hidden": false,
              "widgetdim": null,
              "datatype": "integer",
              "tooltip": null,
              "placeholder": null,
              "iseditable": true,
              "orderby": 14,
              "layoutname": "lyt_data_1",
              "layoutorder": 16,
              "isparent": false,
              "ismandatory": false,
              "linkedaction": null,
              "isautoupdate": false,
              "stylesheet": null,
              "widgetcontrols": null,
              "comboIds": [
                "1",
                "2",
                "3",
                "4"
              ],
              "comboNames": [
                "Started",
                "Stand-by",
                "Canceled",
                "Finished"
              ],
              "selectedId": "4"
            }
          ]
        }
      ]
    },
    "data": {
      "layerManager": {},
      "geometry": {}
    }
  }
}