{
    "type": "Ext.panel.Panel",
    "reference": {
        "name": "items",
        "type": "array"
    },
    "codeClass": null,
    "userConfig": {
        "container|align": "stretch",
        "designer|initialView": true,
        "designer|userClassName": "Main",
        "header": false,
        "height": 537,
        "html": null,
        "id": null,
        "itemId": "mypanel",
        "layout": "vbox",
        "title": "Risk Management",
        "width": 1132
    },
    "configAlternates": {
        "html": "string"
    },
    "designerId": "d6dfdd09-afc4-4208-afc3-4e783f4c4664",
    "cn": [
        {
            "type": "Ext.form.FieldSet",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "dock": null,
                "layout": "fit",
                "layout|flex": 5,
                "margin": "3 10 0 10",
                "title": "Defined risks"
            },
            "designerId": "589f0baf-813e-459c-aac9-859e375c53b0",
            "cn": [
                {
                    "type": "Ext.tree.Panel",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "border": false,
                        "displayField": null,
                        "header": false,
                        "height": 250,
                        "id": null,
                        "itemId": "treegrid",
                        "rootVisible": false,
                        "store": "CurrentRuleTreeStore",
                        "title": "My Tree Grid Panel",
                        "useArrows": true,
                        "width": 400
                    },
                    "designerId": "b476fa64-8040-4f64-8ecb-4a644ec3fea4",
                    "isBuiltIn": true,
                    "iconCls": "icon-treegridpanel",
                    "autoName": "TreeGrid",
                    "cn": [
                        {
                            "type": "Ext.tree.View",
                            "reference": {
                                "name": "viewConfig",
                                "type": "object"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "autoRender": null,
                                "autoShow": null,
                                "itemId": "mytreeview",
                                "loadMask": [
                                    "true"
                                ],
                                "overflowY": "scroll",
                                "rootVisible": null,
                                "width": null
                            },
                            "designerId": "d0e3a447-bc35-4eb1-9925-f6f8f6238881"
                        },
                        {
                            "type": "Ext.tree.Column",
                            "reference": {
                                "name": "columns",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "dataIndex": "name",
                                "flex": 1,
                                "text": "Groups and defined risks"
                            },
                            "designerId": "d989e113-9749-42b1-803e-af4adff5168c"
                        },
                        {
                            "type": "Ext.grid.column.Column",
                            "reference": {
                                "name": "columns",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "container|align": "stretch",
                                "dataIndex": "description",
                                "detachOnRemove": false,
                                "draggable": false,
                                "enableColumnHide": false,
                                "flex": 2,
                                "hideable": false,
                                "layout": "vbox",
                                "overflowX": null,
                                "overflowY": null,
                                "sortable": false,
                                "text": "Description"
                            },
                            "designerId": "36d4cd7c-a868-40af-b623-95d5f8b5d6f4"
                        },
                        {
                            "type": "Ext.grid.column.Column",
                            "reference": {
                                "name": "columns",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "align": "right",
                                "cls": "gridNumber",
                                "dataIndex": "ruleId",
                                "defaultWidth": null,
                                "detachOnRemove": false,
                                "draggable": false,
                                "enableColumnHide": false,
                                "flex": null,
                                "hideable": false,
                                "layout": null,
                                "maxWidth": null,
                                "minWidth": null,
                                "overflowX": null,
                                "overflowY": null,
                                "sortable": false,
                                "text": "Risk ID",
                                "width": 75
                            },
                            "designerId": "6998e617-5f7b-4fea-967c-297d97394140",
                            "cn": [
                                {
                                    "type": "fixedfunction",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "designer|params": [
                                            "value",
                                            "metaData",
                                            "record",
                                            "rowIndex",
                                            "colIndex",
                                            "store",
                                            "view"
                                        ],
                                        "fn": "renderer",
                                        "implHandler": [
                                            "var urlParams = Ext.Object.fromQueryString(document.location.search);\r",
                                            "urlParams.risk_id = record.get('id');\r",
                                            "switch(record.get('rule_type')) {\r",
                                            "\tcase 'sod_func':\r",
                                            "\t\tvar link = '../sodfunc/sodfunc.php?'+ Ext.urlEncode(urlParams);\r",
                                            "\tbreak;\r",
                                            "\tcase 'crit_tcode':\r",
                                            "\t\tvar link = '../crittcode/crittcode.php?'+ Ext.urlEncode(urlParams);\r",
                                            "\tbreak;\r",
                                            "\tcase 'crit_role':\r",
                                            "\t\tvar link = '../critrole/critrole.php?'+ Ext.urlEncode(urlParams);\r",
                                            "\tbreak;\r",
                                            "\tcase 'sod_role2':\r",
                                            "\t\tvar link = '../sodrole2/sodrole2.php?'+ Ext.urlEncode(urlParams);\r",
                                            "\tbreak;\r",
                                            "\tdefault:\r",
                                            "\t//\talert('No such risk type: '+record.get('rule_type_org'));\r",
                                            "}\r",
                                            "\r",
                                            "return '<a href=\"'+link+'\" title=\"'+CCS.Translator.getText('Go to risk definition')+'\">'+value+'</a>';"
                                        ]
                                    },
                                    "designerId": "b3b388fc-695a-42a1-90f5-c042c4613950"
                                }
                            ]
                        },
                        {
                            "type": "Ext.grid.column.Column",
                            "reference": {
                                "name": "columns",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "container|align": "stretch",
                                "dataIndex": "type",
                                "detachOnRemove": false,
                                "draggable": false,
                                "enableColumnHide": false,
                                "flex": null,
                                "hideable": false,
                                "layout": "vbox",
                                "overflowX": null,
                                "overflowY": null,
                                "sortable": false,
                                "text": "Type",
                                "width": 150
                            },
                            "designerId": "3687be33-80f1-43ee-9d0f-d9738cc3bb87"
                        },
                        {
                            "type": "Ext.grid.column.Column",
                            "reference": {
                                "name": "columns",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "align": null,
                                "dataIndex": "level",
                                "defaultAlign": null,
                                "defaultWidth": null,
                                "detachOnRemove": false,
                                "draggable": false,
                                "enableColumnHide": null,
                                "flex": null,
                                "hideable": false,
                                "layout": null,
                                "maxWidth": null,
                                "minWidth": null,
                                "overflowX": null,
                                "overflowY": null,
                                "sortable": false,
                                "text": "Level",
                                "width": 50
                            },
                            "designerId": "5f1de25c-d693-4ff6-9117-3c7b6b0ec09a"
                        },
                        {
                            "type": "Ext.grid.column.Column",
                            "reference": {
                                "name": "columns",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "align": null,
                                "dataIndex": "warningText",
                                "defaultAlign": null,
                                "defaultWidth": null,
                                "detachOnRemove": false,
                                "draggable": false,
                                "enableColumnHide": null,
                                "flex": null,
                                "hideable": false,
                                "layout": null,
                                "maxWidth": null,
                                "minWidth": null,
                                "overflowX": null,
                                "overflowY": null,
                                "sortable": false,
                                "text": "System reaction",
                                "width": 150
                            },
                            "designerId": "40fa6457-e113-46e0-a9bf-20d5a3b244f8"
                        },
                        {
                            "type": "Ext.grid.column.Template",
                            "reference": {
                                "name": "columns",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "align": "center",
                                "cls": "gridMitigation",
                                "dataIndex": "mitigation",
                                "enableColumnHide": false,
                                "hideable": false,
                                "sortable": false,
                                "text": "Mitigation description",
                                "width": 115
                            },
                            "designerId": "ad432c07-4061-4176-b982-2017374dc675",
                            "cn": [
                                {
                                    "type": "Ext.XTemplate",
                                    "reference": {
                                        "name": "tpl",
                                        "type": "object"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "designer|displayName": "tpl",
                                        "implHandler": [
                                            "<img src=\"{mitigation:this.findM}\" alt=\"Mitigation Icon\" title=\"{mitigation:this.findMText}\" />"
                                        ]
                                    },
                                    "designerId": "3bfe2b76-762a-4323-87bb-f8f69912b096",
                                    "cn": [
                                        {
                                            "type": "templatefunction",
                                            "reference": {
                                                "name": "items",
                                                "type": "array"
                                            },
                                            "codeClass": null,
                                            "userConfig": {
                                                "designer|displayName": "mitigationFunctionality",
                                                "designer|params": [
                                                    "item"
                                                ],
                                                "fn": "findM",
                                                "implHandler": [
                                                    "\tvar pic = '';\r",
                                                    "\tif(item !== \"\" && item !== null && item !== undefined) {\r",
                                                    "\t\tpic = \"../gfx/m.png\";\r",
                                                    "\t} else {\r",
                                                    "\t\tpic = '../gfx/blank.png';\r",
                                                    "\t}\r",
                                                    "return pic;"
                                                ]
                                            },
                                            "designerId": "72c67428-1eb8-4ddf-b30d-e0d4f4bedb21"
                                        },
                                        {
                                            "type": "templatefunction",
                                            "reference": {
                                                "name": "items",
                                                "type": "array"
                                            },
                                            "codeClass": null,
                                            "userConfig": {
                                                "designer|displayName": "mitigationAddBubbleText",
                                                "designer|params": [
                                                    "item"
                                                ],
                                                "fn": "findMText",
                                                "implHandler": [
                                                    "var text = \"\";\r",
                                                    "if(item !== \"\" && item !== null && item !== undefined) {\r",
                                                    "\ttext = CCS.Translator.getText(\"Mitigation description\")+\":\\n\"+item;\r",
                                                    "}\r",
                                                    "return text;"
                                                ]
                                            },
                                            "designerId": "a82eab56-abb2-44aa-8b9c-fb31482622fb"
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "type": "Ext.grid.column.Column",
                            "reference": {
                                "name": "columns",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "align": "center",
                                "cls": "setLeft",
                                "dataIndex": "statusId",
                                "defaultWidth": null,
                                "detachOnRemove": false,
                                "draggable": false,
                                "enableColumnHide": false,
                                "flex": null,
                                "hideable": false,
                                "layout": null,
                                "maxWidth": null,
                                "minWidth": null,
                                "overflowX": null,
                                "overflowY": null,
                                "sortable": false,
                                "text": "Status",
                                "width": 50
                            },
                            "designerId": "e50f745b-2911-4458-a407-c26e00c2b6dc",
                            "cn": [
                                {
                                    "type": "fixedfunction",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "designer|params": [
                                            "value",
                                            "metaData",
                                            "record",
                                            "rowIndex",
                                            "colIndex",
                                            "store",
                                            "view"
                                        ],
                                        "fn": "renderer",
                                        "implHandler": [
                                            "if(value=='Active')\r",
                                            "\treturn '<img src=\"../gfx/approve.png\" title=\"'+record.get('status')+'\" />';\r",
                                            "else if(value=='Inactive')\r",
                                            "\treturn '<img src=\"../gfx/icon_red_minus_small.png\" title=\"'+record.get('status')+'\" />';\r",
                                            "else\r",
                                            "\treturn '';"
                                        ]
                                    },
                                    "designerId": "86b9d929-bdec-48a5-a114-d75ae738c004"
                                }
                            ]
                        },
                        {
                            "type": "Ext.grid.column.Column",
                            "reference": {
                                "name": "columns",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "dataIndex": "origin",
                                "defaultWidth": null,
                                "detachOnRemove": false,
                                "draggable": false,
                                "enableColumnHide": false,
                                "flex": null,
                                "hideable": false,
                                "layout": null,
                                "maxWidth": null,
                                "minWidth": null,
                                "overflowX": null,
                                "overflowY": null,
                                "sortable": false,
                                "text": "Origin"
                            },
                            "designerId": "6a4b0fca-e115-4d87-8220-5769eb1b0f0e"
                        }
                    ]
                }
            ]
        },
        {
            "type": "Ext.form.FieldSet",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "container|align": "stretch",
                "dock": null,
                "height": null,
                "itemId": "actionsPanel",
                "layout": "hbox",
                "layout|flex": null,
                "margin": "3 10 10 10",
                "title": "Actions"
            },
            "designerId": "b6827948-6ca4-4b9e-9497-0d59fd64dfe4",
            "cn": [
                {
                    "type": "Ext.button.Button",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "disabled": true,
                        "icon": "../gfx/history.png",
                        "id": null,
                        "itemId": "viewRuleHistoryButton",
                        "layout|flex": null,
                        "layout|margins": "2 10 10 0",
                        "padding": "5 10 5 10",
                        "scale": "medium",
                        "text": "History"
                    },
                    "designerId": "97015953-4ef7-484a-b403-a9ab2c4ab410"
                },
                {
                    "type": "Ext.button.Button",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "disabled": null,
                        "icon": "../gfx/history.png",
                        "id": null,
                        "itemId": "rulesetLogBtn",
                        "layout|flex": null,
                        "layout|margins": "2 10 10 0",
                        "padding": "5 10 5 10",
                        "scale": "medium",
                        "text": "Ruleset Log"
                    },
                    "designerId": "b117c88f-5de3-4dd9-9c70-6710431df404"
                }
            ]
        }
    ]
}