{
    "type": "Ext.app.Controller",
    "reference": {
        "name": "items",
        "type": "array"
    },
    "codeClass": null,
    "userConfig": {
        "designer|userClassName": "Control"
    },
    "designerId": "3db61920-ef41-4d58-a47a-5a4b571c7bb0",
    "cn": [
        {
            "type": "basicfunction",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "designer|params": [
                    "data"
                ],
                "fn": "formatText",
                "implHandler": [
                    "var controller = MyApp.app.getController('ShowDetails');\r",
                    "if(!Ext.isEmpty(data.mitigation_description)) {\r",
                    "\tcontroller.showText(this.getControlDescription(), data.mitigation_description);\r",
                    "}\r",
                    "if(!Ext.isEmpty(data.mitigation_purpose)) {\r",
                    "\tcontroller.showText(this.getControlPurpose(), data.mitigation_purpose);\r",
                    "}\r",
                    "if(!Ext.isEmpty(data.mitigation_execution)) {\r",
                    "\tcontroller.showText(this.getControlExecution(), data.mitigation_execution);\r",
                    "}\r",
                    "if(!Ext.isEmpty(data.mitigation_parameters)) {\r",
                    "\tcontroller.showText(this.getControlParameters(), data.mitigation_parameters);\r",
                    "}\r",
                    "if(!Ext.isEmpty(data.mitigation_documentation)) {\r",
                    "\tcontroller.showText(this.getControlDocumentation(), data.mitigation_documentation);\r",
                    "}\r",
                    "if(!Ext.isEmpty(data.mitigation_reaction)) {\r",
                    "\tcontroller.showText(this.getControlReaction(), data.mitigation_reaction);\r",
                    "}\r",
                    "if(!Ext.isEmpty(data.gdpr_text)) {\r",
                    "\tcontroller.showText(this.getControlGDPR(), data.gdpr_text);\r",
                    "}\r",
                    "\r",
                    "if(Ext.isEmpty(data.ac_risk)) {\r",
                    "\tthis.getAcRiskId().hide();\r",
                    "}\r",
                    "\r",
                    "this.getControlFilesGrid().getStore().load({\r",
                    "\tcallback: function(records, request, success) {\r",
                    "\t\tif(records.length > 0) {\r",
                    "\t\t\tthis.getControlFilesGrid().show();\r",
                    "\t\t\tthis.getControlFiles().down('label').show();\r",
                    "\t\t\tthis.getControlFiles().show();\r",
                    "\t\t\tthis.getControlFiles().doLayout();\r",
                    "\t\t}\r",
                    "\t},\r",
                    "\tscope: this\r",
                    "});\r",
                    ""
                ]
            },
            "designerId": "2d32f9a2-0e7e-42b9-ac61-cbaf37bc30e8"
        },
        {
            "type": "basicfunction",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "designer|params": [
                    "id"
                ],
                "fn": "download",
                "implHandler": [
                    "var iframe = document.getElementById(\"hiddenIFrameCurrent\");\r",
                    "if(iframe === null) {\r",
                    "    iframe = document.createElement('iframe');\r",
                    "    iframe.id = \"hiddenIFrameCurrent\";\r",
                    "    iframe.style.display = 'none';\r",
                    "    document.body.appendChild(iframe);\r",
                    "}\r",
                    "iframe.src = '../../service/attached_files.php' + document.location.search + '&action=download&id='+id;"
                ]
            },
            "designerId": "2e1db8f5-87e8-49bf-8000-e3f0a0e3a9fe"
        },
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "controlDescription",
                "selector": "#controlDescription"
            },
            "designerId": "ecee74b7-6894-4e1c-ba39-9fe6da38fca3"
        },
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "controlPurpose",
                "selector": "#controlPurpose"
            },
            "designerId": "ad77c1f0-62a7-4f2c-abb4-dc1d6e1ecab1"
        },
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "controlExecution",
                "selector": "#controlExecution"
            },
            "designerId": "9b1381d9-e150-4971-8610-d65a724245e7"
        },
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "controlParameters",
                "selector": "#controlParameters"
            },
            "designerId": "95312f39-71ad-4425-bd23-a6fa977160b9"
        },
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "controlDocumentation",
                "selector": "#controlDocumentation"
            },
            "designerId": "a416ddd3-6f89-4cb8-81f8-800021b38ff6"
        },
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "controlReaction",
                "selector": "#controlReaction"
            },
            "designerId": "a5d3f315-79ab-4fe0-9882-d3cf32b6f044"
        },
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "controlGDPR",
                "selector": "#controlGDPR"
            },
            "designerId": "5f383695-d6be-4562-913d-7f451c56f4c5"
        },
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "controlFiles",
                "selector": "#controlFiles"
            },
            "designerId": "5c19dfb8-71bd-4bb1-9013-3bfeaa7e93b0"
        },
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "controlFilesGrid",
                "selector": "#controlFilesGrid"
            },
            "designerId": "df91d63f-8599-4880-8412-f4970999c4d0"
        },
        {
            "type": "fixedfunction",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "designer|params": [
                    "application"
                ],
                "fn": "init",
                "implHandler": [
                    "this.control({\r",
                    "\t'#acRiskId': {\r",
                    "\t\tfocus: this.showACdetails\r",
                    "\t},\r",
                    "\t'#checkAcRiskId': {\r",
                    "\t\tfocus: this.showACdetails\r",
                    "\t}\r",
                    "});"
                ]
            },
            "designerId": "c60764d8-d42f-4b60-849d-62846a0987bc"
        },
        {
            "type": "basicfunction",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "designer|params": [
                    "component",
                    "event"
                ],
                "fn": "showACdetails",
                "implHandler": [
                    "var url = \"../../../SoD/ui/display_details/display_details.php\";\r",
                    "\r",
                    "var params = Ext.Object.fromQueryString(document.location.search);\r",
                    "params.id = component.getValue();\r",
                    "params.type = 'risk';\r",
                    "\r",
                    "var H = Ext.getBody().getViewSize().height*0.90;\r",
                    "var W = Ext.getBody().getViewSize().width*0.90;\r",
                    "this.getACRiskDetails().setHeight(H);\r",
                    "this.getACRiskDetails().setWidth(W);\r",
                    "this.getACRiskDetails().animateTarget = component;\r",
                    "this.getACRiskDetails().show();\r",
                    "\r",
                    "this.getACRiskDetails().update('<iframe src=\"'+url+\"?\"+Ext.Object.toQueryString(params)+'\" width=\"100%\" height=\"100%\" frameborder=\"0\" style=\"border-color: white;\"></iframe>');\r",
                    ""
                ]
            },
            "designerId": "f74e63f0-7d51-4a39-935c-ebcabfdb981b"
        },
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "autoCreate": true,
                "ref": "aCRiskDetails",
                "selector": "#ACRiskDetails",
                "xtype": "ACRiskDetails"
            },
            "designerId": "6f30c7e3-c219-4249-8bc2-a11a1458920c"
        },
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "acRiskId",
                "selector": "#acRiskId"
            },
            "designerId": "7d5dafb8-5e93-4fa4-9c83-6b2fcdb994d3"
        }
    ]
}